@kelceyp/caw-server 0.0.26 → 0.0.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/main.js +327 -237
- package/dist/public_html/main.js +14 -14
- package/package.json +3 -1
package/dist/public_html/main.js
CHANGED
|
@@ -10,21 +10,21 @@ Your code should look like:
|
|
|
10
10
|
1. You might have mismatching versions of React and the renderer (such as React DOM)
|
|
11
11
|
2. You might be breaking the Rules of Hooks
|
|
12
12
|
3. You might have more than one copy of React in the same app
|
|
13
|
-
See https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem.`);return M0}function W6(M0){var a0=X6();if(M0._context!==void 0){var D6=M0._context;if(D6.Consumer===M0)x("Calling useContext(Context.Consumer) is not supported, may cause bugs, and will be removed in a future major release. Did you mean to call useContext(Context) instead?");else if(D6.Provider===M0)x("Calling useContext(Context.Provider) is not supported. Did you mean to call useContext(Context) instead?")}return a0.useContext(M0)}function _6(M0){var a0=X6();return a0.useState(M0)}function c6(M0,a0,D6){var v6=X6();return v6.useReducer(M0,a0,D6)}function d6(M0){var a0=X6();return a0.useRef(M0)}function l6(M0,a0){var D6=X6();return D6.useEffect(M0,a0)}function t6(M0,a0){var D6=X6();return D6.useInsertionEffect(M0,a0)}function g8(M0,a0){var D6=X6();return D6.useLayoutEffect(M0,a0)}function k6(M0,a0){var D6=X6();return D6.useCallback(M0,a0)}function d0(M0,a0){var D6=X6();return D6.useMemo(M0,a0)}function V6(M0,a0,D6){var v6=X6();return v6.useImperativeHandle(M0,a0,D6)}function Z8(M0,a0){{var D6=X6();return D6.useDebugValue(M0,a0)}}function qJ(){var M0=X6();return M0.useTransition()}function ZJ(M0){var a0=X6();return a0.useDeferredValue(M0)}function q8(){var M0=X6();return M0.useId()}function B9(M0,a0,D6){var v6=X6();return v6.useSyncExternalStore(M0,a0,D6)}var m9=0,H7,kJ,
|
|
13
|
+
See https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem.`);return M0}function W6(M0){var a0=X6();if(M0._context!==void 0){var D6=M0._context;if(D6.Consumer===M0)x("Calling useContext(Context.Consumer) is not supported, may cause bugs, and will be removed in a future major release. Did you mean to call useContext(Context) instead?");else if(D6.Provider===M0)x("Calling useContext(Context.Provider) is not supported. Did you mean to call useContext(Context) instead?")}return a0.useContext(M0)}function _6(M0){var a0=X6();return a0.useState(M0)}function c6(M0,a0,D6){var v6=X6();return v6.useReducer(M0,a0,D6)}function d6(M0){var a0=X6();return a0.useRef(M0)}function l6(M0,a0){var D6=X6();return D6.useEffect(M0,a0)}function t6(M0,a0){var D6=X6();return D6.useInsertionEffect(M0,a0)}function g8(M0,a0){var D6=X6();return D6.useLayoutEffect(M0,a0)}function k6(M0,a0){var D6=X6();return D6.useCallback(M0,a0)}function d0(M0,a0){var D6=X6();return D6.useMemo(M0,a0)}function V6(M0,a0,D6){var v6=X6();return v6.useImperativeHandle(M0,a0,D6)}function Z8(M0,a0){{var D6=X6();return D6.useDebugValue(M0,a0)}}function qJ(){var M0=X6();return M0.useTransition()}function ZJ(M0){var a0=X6();return a0.useDeferredValue(M0)}function q8(){var M0=X6();return M0.useId()}function B9(M0,a0,D6){var v6=X6();return v6.useSyncExternalStore(M0,a0,D6)}var m9=0,H7,kJ,p0,T6,z8,C6,wJ;function x0(){}x0.__reactDisabledLog=!0;function fQ(){{if(m9===0){H7=console.log,kJ=console.info,p0=console.warn,T6=console.error,z8=console.group,C6=console.groupCollapsed,wJ=console.groupEnd;var M0={configurable:!0,enumerable:!0,value:x0,writable:!0};Object.defineProperties(console,{info:M0,log:M0,warn:M0,error:M0,group:M0,groupCollapsed:M0,groupEnd:M0})}m9++}}function c0(){{if(m9--,m9===0){var M0={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:i({},M0,{value:H7}),info:i({},M0,{value:kJ}),warn:i({},M0,{value:p0}),error:i({},M0,{value:T6}),group:i({},M0,{value:z8}),groupCollapsed:i({},M0,{value:C6}),groupEnd:i({},M0,{value:wJ})})}if(m9<0)x("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var xJ=v.ReactCurrentDispatcher,YQ;function cK(M0,a0,D6){{if(YQ===void 0)try{throw Error()}catch(F8){var v6=F8.stack.trim().match(/\n( *(at )?)/);YQ=v6&&v6[1]||""}return`
|
|
14
14
|
`+YQ+M0}}var lK=!1,cz;{var C2=typeof WeakMap==="function"?WeakMap:Map;cz=new C2}function G4(M0,a0){if(!M0||lK)return"";{var D6=cz.get(M0);if(D6!==void 0)return D6}var v6;lK=!0;var F8=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var FJ;FJ=xJ.current,xJ.current=null,fQ();try{if(a0){var m8=function(){throw Error()};if(Object.defineProperty(m8.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==="object"&&Reflect.construct){try{Reflect.construct(m8,[])}catch(w9){v6=w9}Reflect.construct(M0,[],m8)}else{try{m8.call()}catch(w9){v6=w9}M0.call(m8.prototype)}}else{try{throw Error()}catch(w9){v6=w9}M0()}}catch(w9){if(w9&&v6&&typeof w9.stack==="string"){var AJ=w9.stack.split(`
|
|
15
15
|
`),J9=v6.stack.split(`
|
|
16
16
|
`),l9=AJ.length-1,L7=J9.length-1;while(l9>=1&&L7>=0&&AJ[l9]!==J9[L7])L7--;for(;l9>=1&&L7>=0;l9--,L7--)if(AJ[l9]!==J9[L7]){if(l9!==1||L7!==1)do if(l9--,L7--,L7<0||AJ[l9]!==J9[L7]){var A7=`
|
|
17
|
-
`+AJ[l9].replace(" at new "," at ");if(M0.displayName&&A7.includes("<anonymous>"))A7=A7.replace("<anonymous>",M0.displayName);if(typeof M0==="function")cz.set(M0,A7);return A7}while(l9>=1&&L7>=0);break}}}finally{lK=!1,xJ.current=FJ,
|
|
17
|
+
`+AJ[l9].replace(" at new "," at ");if(M0.displayName&&A7.includes("<anonymous>"))A7=A7.replace("<anonymous>",M0.displayName);if(typeof M0==="function")cz.set(M0,A7);return A7}while(l9>=1&&L7>=0);break}}}finally{lK=!1,xJ.current=FJ,c0(),Error.prepareStackTrace=F8}var x7=M0?M0.displayName||M0.name:"",E4=x7?cK(x7):"";if(typeof M0==="function")cz.set(M0,E4);return E4}function a5(M0,a0,D6){return G4(M0,!1)}function S2(M0){var a0=M0.prototype;return!!(a0&&a0.isReactComponent)}function dK(M0,a0,D6){if(M0==null)return"";if(typeof M0==="function")return G4(M0,S2(M0));if(typeof M0==="string")return cK(M0);switch(M0){case W:return cK("Suspense");case H:return cK("SuspenseList")}if(typeof M0==="object")switch(M0.$$typeof){case G:return a5(M0.render);case q:return dK(M0.type,a0,D6);case F:{var v6=M0,F8=v6._payload,FJ=v6._init;try{return dK(FJ(F8),a0,D6)}catch(m8){}}}return""}var CM={},$2=v.ReactDebugCurrentFrame;function lz(M0){if(M0){var a0=M0._owner,D6=dK(M0.type,M0._source,a0?a0.type:null);$2.setExtraStackFrame(D6)}else $2.setExtraStackFrame(null)}function l4(M0,a0,D6,v6,F8){{var FJ=Function.call.bind(z6);for(var m8 in M0)if(FJ(M0,m8)){var AJ=void 0;try{if(typeof M0[m8]!=="function"){var J9=Error((v6||"React class")+": "+D6+" type `"+m8+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof M0[m8]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw J9.name="Invariant Violation",J9}AJ=M0[m8](a0,m8,v6,D6,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(l9){AJ=l9}if(AJ&&!(AJ instanceof Error))lz(F8),x("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",v6||"React class",D6,m8,typeof AJ),lz(null);if(AJ instanceof Error&&!(AJ.message in CM))CM[AJ.message]=!0,lz(F8),x("Failed %s type: %s",D6,AJ.message),lz(null)}}}function pJ(M0){if(M0){var a0=M0._owner,D6=dK(M0.type,M0._source,a0?a0.type:null);C(D6)}else C(null)}var iK=!1;function _Q(){if(V.current){var M0=J0(V.current.type);if(M0)return`
|
|
18
18
|
|
|
19
19
|
Check the render method of \``+M0+"`."}return""}function $J(M0){if(M0!==void 0){var a0=M0.fileName.replace(/^.*[\\\/]/,""),D6=M0.lineNumber;return`
|
|
20
20
|
|
|
21
21
|
Check your code at `+a0+":"+D6+"."}return""}function gW(M0){if(M0!==null&&M0!==void 0)return $J(M0.__source);return""}var W4={};function rK(M0){var a0=_Q();if(!a0){var D6=typeof M0==="string"?M0:M0.displayName||M0.name;if(D6)a0=`
|
|
22
22
|
|
|
23
|
-
Check the top-level render call using <`+D6+">."}return a0}function bQ(M0,a0){if(!M0._store||M0._store.validated||M0.key!=null)return;M0._store.validated=!0;var D6=rK(a0);if(W4[D6])return;W4[D6]=!0;var v6="";if(M0&&M0._owner&&M0._owner!==V.current)v6=" It was passed a child from "+J0(M0._owner.type)+".";pJ(M0),x('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',D6,v6),pJ(null)}function v2(M0,a0){if(typeof M0!=="object")return;if(z0(M0))for(var D6=0;D6<M0.length;D6++){var v6=M0[D6];if(d(v6))bQ(v6,a0)}else if(d(M0)){if(M0._store)M0._store.validated=!0}else if(M0){var F8=I(M0);if(typeof F8==="function"){if(F8!==M0.entries){var FJ=F8.call(M0),m8;while(!(m8=FJ.next()).done)if(d(m8.value))bQ(m8.value,a0)}}}}function H4(M0){{var a0=M0.type;if(a0===null||a0===void 0||typeof a0==="string")return;var D6;if(typeof a0==="function")D6=a0.propTypes;else if(typeof a0==="object"&&(a0.$$typeof===G||a0.$$typeof===q))D6=a0.propTypes;else return;if(D6){var v6=J0(a0);l4(D6,M0.props,"prop",v6,M0)}else if(a0.PropTypes!==void 0&&!iK){iK=!0;var F8=J0(a0);x("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",F8||"Unknown")}if(typeof a0.getDefaultProps==="function"&&!a0.getDefaultProps.isReactClassApproved)x("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function O7(M0){{var a0=Object.keys(M0.props);for(var D6=0;D6<a0.length;D6++){var v6=a0[D6];if(v6!=="children"&&v6!=="key"){pJ(M0),x("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",v6),pJ(null);break}}if(M0.ref!==null)pJ(M0),x("Invalid attribute `ref` supplied to `React.Fragment`."),pJ(null)}}function JZ(M0,a0,D6){var v6=B6(M0);if(!v6){var F8="";if(M0===void 0||typeof M0==="object"&&M0!==null&&Object.keys(M0).length===0)F8+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.";var FJ=gW(a0);if(FJ)F8+=FJ;else F8+=_Q();var m8;if(M0===null)m8="null";else if(z0(M0))m8="array";else if(M0!==void 0&&M0.$$typeof===Q)m8="<"+(J0(M0.type)||"Unknown")+" />",F8=" Did you accidentally export a JSX literal instead of a component?";else m8=typeof M0;x("React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",m8,F8)}var AJ=y0.apply(this,arguments);if(AJ==null)return AJ;if(v6)for(var J9=2;J9<arguments.length;J9++)v2(arguments[J9],M0);if(M0===U)O7(AJ);else H4(AJ);return AJ}var o5=!1;function tU(M0){var a0=JZ.bind(null,M0);a0.type=M0;{if(!o5)o5=!0,f("React.createFactory() is deprecated and will be removed in a future major release. Consider using JSX or use React.createElement() directly instead.");Object.defineProperty(a0,"type",{enumerable:!1,get:function(){return f("Factory.type is deprecated. Access the class directly before passing it to createFactory."),Object.defineProperty(this,"type",{value:M0}),M0}})}return a0}function YY(M0,a0,D6){var v6=w0.apply(this,arguments);for(var F8=2;F8<arguments.length;F8++)v2(arguments[F8],v6.type);return H4(v6),v6}function bu(M0,a0){var D6=N.transition;N.transition={};var v6=N.transition;N.transition._updatedFibers=new Set;try{M0()}finally{if(N.transition=D6,D6===null&&v6._updatedFibers){var F8=v6._updatedFibers.size;if(F8>10)f("Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table.");v6._updatedFibers.clear()}}}var SM=!1,k2=null;function qT(M0){if(k2===null)try{var a0=("require"+Math.random()).slice(0,7),D6=NS&&NS[a0];k2=D6.call(NS,"timers").setImmediate}catch(v6){k2=function(F8){if(SM===!1){if(SM=!0,typeof MessageChannel==="undefined")x("This browser does not have a MessageChannel implementation, so enqueuing tasks via await act(async () => ...) will fail. Please file an issue at https://github.com/facebook/react/issues if you encounter this warning.")}var FJ=new MessageChannel;FJ.port1.onmessage=F8,FJ.port2.postMessage(void 0)}}return k2(M0)}var mW=0,FT=!1;function BT(M0){{var a0=mW;if(mW++,E.current===null)E.current=[];var D6=E.isBatchingLegacy,v6;try{if(E.isBatchingLegacy=!0,v6=M0(),!D6&&E.didScheduleLegacyUpdate){var F8=E.current;if(F8!==null)E.didScheduleLegacyUpdate=!1,vM(F8)}}catch(x7){throw dz(a0),x7}finally{E.isBatchingLegacy=D6}if(v6!==null&&typeof v6==="object"&&typeof v6.then==="function"){var FJ=v6,m8=!1,AJ={then:function(x7,E4){m8=!0,FJ.then(function(w9){if(dz(a0),mW===0)$M(w9,x7,E4);else x7(w9)},function(w9){dz(a0),E4(w9)})}};if(!FT&&typeof Promise!=="undefined")Promise.resolve().then(function(){}).then(function(){if(!m8)FT=!0,x("You called act(async () => ...) without await. This could lead to unexpected testing behaviour, interleaving multiple act calls and mixing their scopes. You should - await act(async () => ...);")});return AJ}else{var J9=v6;if(dz(a0),mW===0){var l9=E.current;if(l9!==null)vM(l9),E.current=null;var L7={then:function(x7,E4){if(E.current===null)E.current=[],$M(J9,x7,E4);else x7(J9)}};return L7}else{var A7={then:function(x7,E4){x7(J9)}};return A7}}}}function dz(M0){{if(M0!==mW-1)x("You seem to have overlapping act() calls, this is not supported. Be sure to await previous act() calls before making a new one. ");mW=M0}}function $M(M0,a0,D6){{var v6=E.current;if(v6!==null)try{vM(v6),qT(function(){if(v6.length===0)E.current=null,a0(M0);else $M(M0,a0,D6)})}catch(F8){D6(F8)}else a0(M0)}}var uW=!1;function vM(M0){if(!uW){uW=!0;var a0=0;try{for(;a0<M0.length;a0++){var D6=M0[a0];do D6=D6(!0);while(D6!==null)}M0.length=0}catch(v6){throw M0=M0.slice(a0+1),v6}finally{uW=!1}}}var MT=JZ,OT=YY,LT=tU,AT={map:A6,forEach:N6,count:r6,toArray:F6,only:P6};if($Z6.Children=AT,$Z6.Component=a,$Z6.Fragment=U,$Z6.Profiler=X,$Z6.PureComponent=X0,$Z6.StrictMode=K,$Z6.Suspense=W,$Z6.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=v,$Z6.act=BT,$Z6.cloneElement=OT,$Z6.createContext=M6,$Z6.createElement=MT,$Z6.createFactory=LT,$Z6.createRef=W0,$Z6.forwardRef=S0,$Z6.isValidElement=d,$Z6.lazy=u6,$Z6.memo=D0,$Z6.startTransition=bu,$Z6.unstable_act=BT,$Z6.useCallback=k6,$Z6.useContext=W6,$Z6.useDebugValue=Z8,$Z6.useDeferredValue=ZJ,$Z6.useEffect=l6,$Z6.useId=q8,$Z6.useImperativeHandle=V6,$Z6.useInsertionEffect=t6,$Z6.useLayoutEffect=g8,$Z6.useMemo=d0,$Z6.useReducer=c6,$Z6.useRef=d6,$Z6.useState=_6,$Z6.useSyncExternalStore=B9,$Z6.useTransition=qJ,$Z6.version=J,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__!=="undefined"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop==="function")__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)})()});var sq0=F4((vZ6)=>{(function(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__!=="undefined"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart==="function")__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var J=!1,Q=!1,Z=5;function U(o,w0){var d=o.length;o.push(w0),Y(o,w0,d)}function K(o){return o.length===0?null:o[0]}function X(o){if(o.length===0)return null;var w0=o[0],d=o.pop();if(d!==w0)o[0]=d,z(o,d,0);return w0}function Y(o,w0,d){var L0=d;while(L0>0){var I0=L0-1>>>1,T0=o[I0];if(G(T0,w0)>0)o[I0]=w0,o[L0]=T0,L0=I0;else return}}function z(o,w0,d){var L0=d,I0=o.length,T0=I0>>>1;while(L0<T0){var $0=(L0+1)*2-1,v0=o[$0],r0=$0+1,u0=o[r0];if(G(v0,w0)<0)if(r0<I0&&G(u0,v0)<0)o[L0]=u0,o[r0]=w0,L0=r0;else o[L0]=v0,o[$0]=w0,L0=$0;else if(r0<I0&&G(u0,w0)<0)o[L0]=u0,o[r0]=w0,L0=r0;else return}}function G(o,w0){var d=o.sortIndex-w0.sortIndex;return d!==0?d:o.id-w0.id}var W=1,H=2,q=3,F=4,M=5;function L(o,w0){}var A=typeof performance==="object"&&typeof performance.now==="function";if(A){var I=performance;vZ6.unstable_now=function(){return I.now()}}else{var R=Date,N=R.now();vZ6.unstable_now=function(){return R.now()-N}}var E=1073741823,V=-1,j=250,T=5000,C=1e4,$=E,b=[],h=[],_=1,S=null,v=q,f=!1,x=!1,y=!1,m=typeof setTimeout==="function"?setTimeout:null,g=typeof clearTimeout==="function"?clearTimeout:null,p=typeof setImmediate!=="undefined"?setImmediate:null,i=typeof navigator!=="undefined"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0?navigator.scheduling.isInputPending.bind(navigator.scheduling):null;function l(o){var w0=K(h);while(w0!==null){if(w0.callback===null)X(h);else if(w0.startTime<=o)X(h),w0.sortIndex=w0.expirationTime,U(b,w0);else return;w0=K(h)}}function a(o){if(y=!1,l(o),!x)if(K(b)!==null)x=!0,g0(e);else{var w0=K(h);if(w0!==null)h0(a,w0.startTime-o)}}function e(o,w0){if(x=!1,y)y=!1,t0();f=!0;var d=v;try{if(Q)try{return G0(o,w0)}catch(I0){if(S!==null){var L0=vZ6.unstable_now();L(S,L0),S.isQueued=!1}throw I0}else return G0(o,w0)}finally{S=null,v=d,f=!1}}function G0(o,w0){var d=w0;l(d),S=K(b);while(S!==null&&!J){if(S.expirationTime>d&&(!o||z6()))break;var L0=S.callback;if(typeof L0==="function"){S.callback=null,v=S.priorityLevel;var I0=S.expirationTime<=d,T0=L0(I0);if(d=vZ6.unstable_now(),typeof T0==="function")S.callback=T0;else if(S===K(b))X(b);l(d)}else X(b);S=K(b)}if(S!==null)return!0;else{var $0=K(h);if($0!==null)h0(a,$0.startTime-d);return!1}}function U0(o,w0){switch(o){case W:case H:case q:case F:case M:break;default:o=q}var d=v;v=o;try{return w0()}finally{v=d}}function O0(o){var w0;switch(v){case W:case H:case q:w0=q;break;default:w0=v;break}var d=v;v=w0;try{return o()}finally{v=d}}function X0(o){var w0=v;return function(){var d=v;v=w0;try{return o.apply(this,arguments)}finally{v=d}}}function E0(o,w0,d){var L0=vZ6.unstable_now(),I0;if(typeof d==="object"&&d!==null){var T0=d.delay;if(typeof T0==="number"&&T0>0)I0=L0+T0;else I0=L0}else I0=L0;var $0;switch(o){case W:$0=V;break;case H:$0=j;break;case M:$0=$;break;case F:$0=C;break;case q:default:$0=T;break}var v0=I0+$0,r0={id:_++,callback:w0,priorityLevel:o,startTime:I0,expirationTime:v0,sortIndex:-1};if(I0>L0){if(r0.sortIndex=I0,U(h,r0),K(b)===null&&r0===K(h)){if(y)t0();else y=!0;h0(a,I0-L0)}}else if(r0.sortIndex=v0,U(b,r0),!x&&!f)x=!0,g0(e);return r0}function W0(){}function q0(){if(!x&&!f)x=!0,g0(e)}function z0(){return K(b)}function K0(o){o.callback=null}function R0(){return v}var Y0=!1,P0=null,F0=-1,m0=Z,J0=-1;function z6(){var o=vZ6.unstable_now()-J0;if(o<m0)return!1;return!0}function t(){}function N0(o){if(o<0||o>125){console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported");return}if(o>0)m0=Math.floor(1000/o);else m0=Z}var f0=function(){if(P0!==null){var o=vZ6.unstable_now();J0=o;var w0=!0,d=!0;try{d=P0(w0,o)}finally{if(d)l0();else Y0=!1,P0=null}}else Y0=!1},l0;if(typeof p==="function")l0=function(){p(f0)};else if(typeof MessageChannel!=="undefined"){var k0=new MessageChannel,_0=k0.port2;k0.port1.onmessage=f0,l0=function(){_0.postMessage(null)}}else l0=function(){m(f0,0)};function g0(o){if(P0=o,!Y0)Y0=!0,l0()}function h0(o,w0){F0=m(function(){o(vZ6.unstable_now())},w0)}function t0(){g(F0),F0=-1}var C0=t,y0=null;if(vZ6.unstable_IdlePriority=M,vZ6.unstable_ImmediatePriority=W,vZ6.unstable_LowPriority=F,vZ6.unstable_NormalPriority=q,vZ6.unstable_Profiling=y0,vZ6.unstable_UserBlockingPriority=H,vZ6.unstable_cancelCallback=K0,vZ6.unstable_continueExecution=q0,vZ6.unstable_forceFrameRate=N0,vZ6.unstable_getCurrentPriorityLevel=R0,vZ6.unstable_getFirstCallbackNode=z0,vZ6.unstable_next=O0,vZ6.unstable_pauseExecution=W0,vZ6.unstable_requestPaint=C0,vZ6.unstable_runWithPriority=U0,vZ6.unstable_scheduleCallback=E0,vZ6.unstable_shouldYield=z6,vZ6.unstable_wrapCallback=X0,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__!=="undefined"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop==="function")__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)})()});var aq0=F4((kZ6)=>{var eN=J6(n6(),1),n9=J6(sq0(),1);(function(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__!=="undefined"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart==="function")__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var J=eN.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Q=!1;function Z(B){Q=B}function U(B){if(!Q){for(var O=arguments.length,D=new Array(O>1?O-1:0),P=1;P<O;P++)D[P-1]=arguments[P];X("warn",B,D)}}function K(B){if(!Q){for(var O=arguments.length,D=new Array(O>1?O-1:0),P=1;P<O;P++)D[P-1]=arguments[P];X("error",B,D)}}function X(B,O,D){{var P=J.ReactDebugCurrentFrame,k=P.getStackAddendum();if(k!=="")O+="%s",D=D.concat([k]);var u=D.map(function(n){return String(n)});u.unshift("Warning: "+O),Function.prototype.apply.call(console[B],console,u)}}var Y=0,z=1,G=2,W=3,H=4,q=5,F=6,M=7,L=8,A=9,I=10,R=11,N=12,E=13,V=14,j=15,T=16,C=17,$=18,b=19,h=21,_=22,S=23,v=24,f=25,x=!0,y=!1,m=!1,g=!1,p=!1,i=!0,l=!1,a=!0,e=!0,G0=!0,U0=!0,O0=new Set,X0={},E0={};function W0(B,O){q0(B,O),q0(B+"Capture",O)}function q0(B,O){if(X0[B])K("EventRegistry: More than one plugin attempted to publish the same registration name, `%s`.",B);X0[B]=O;{var D=B.toLowerCase();if(E0[D]=B,B==="onDoubleClick")E0.ondblclick=B}for(var P=0;P<O.length;P++)O0.add(O[P])}var z0=typeof window!=="undefined"&&typeof window.document!=="undefined"&&typeof window.document.createElement!=="undefined",K0=Object.prototype.hasOwnProperty;function R0(B){{var O=typeof Symbol==="function"&&Symbol.toStringTag,D=O&&B[Symbol.toStringTag]||B.constructor.name||"Object";return D}}function Y0(B){try{return P0(B),!1}catch(O){return!0}}function P0(B){return""+B}function F0(B,O){if(Y0(B))return K("The provided `%s` attribute is an unsupported type %s. This value must be coerced to a string before before using it here.",O,R0(B)),P0(B)}function m0(B){if(Y0(B))return K("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",R0(B)),P0(B)}function J0(B,O){if(Y0(B))return K("The provided `%s` prop is an unsupported type %s. This value must be coerced to a string before before using it here.",O,R0(B)),P0(B)}function z6(B,O){if(Y0(B))return K("The provided `%s` CSS property is an unsupported type %s. This value must be coerced to a string before before using it here.",O,R0(B)),P0(B)}function t(B){if(Y0(B))return K("The provided HTML markup uses a value of unsupported type %s. This value must be coerced to a string before before using it here.",R0(B)),P0(B)}function N0(B){if(Y0(B))return K("Form field values (value, checked, defaultValue, or defaultChecked props) must be strings, not %s. This value must be coerced to a string before before using it here.",R0(B)),P0(B)}var f0=0,l0=1,k0=2,_0=3,g0=4,h0=5,t0=6,C0=":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",y0=C0+"\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",o=new RegExp("^["+C0+"]["+y0+"]*$"),w0={},d={};function L0(B){if(K0.call(d,B))return!0;if(K0.call(w0,B))return!1;if(o.test(B))return d[B]=!0,!0;return w0[B]=!0,K("Invalid attribute name: `%s`",B),!1}function I0(B,O,D){if(O!==null)return O.type===f0;if(D)return!1;if(B.length>2&&(B[0]==="o"||B[0]==="O")&&(B[1]==="n"||B[1]==="N"))return!0;return!1}function T0(B,O,D,P){if(D!==null&&D.type===f0)return!1;switch(typeof O){case"function":case"symbol":return!0;case"boolean":{if(P)return!1;if(D!==null)return!D.acceptsBooleans;else{var k=B.toLowerCase().slice(0,5);return k!=="data-"&&k!=="aria-"}}default:return!1}}function $0(B,O,D,P){if(O===null||typeof O==="undefined")return!0;if(T0(B,O,D,P))return!0;if(P)return!1;if(D!==null)switch(D.type){case _0:return!O;case g0:return O===!1;case h0:return isNaN(O);case t0:return isNaN(O)||O<1}return!1}function v0(B){return u0.hasOwnProperty(B)?u0[B]:null}function r0(B,O,D,P,k,u,n){this.acceptsBooleans=O===k0||O===_0||O===g0,this.attributeName=P,this.attributeNamespace=k,this.mustUseProperty=D,this.propertyName=B,this.type=O,this.sanitizeURL=u,this.removeEmptyString=n}var u0={},G6=["children","dangerouslySetInnerHTML","defaultValue","defaultChecked","innerHTML","suppressContentEditableWarning","suppressHydrationWarning","style"];G6.forEach(function(B){u0[B]=new r0(B,f0,!1,B,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(B){var O=B[0],D=B[1];u0[O]=new r0(O,l0,!1,D,null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(B){u0[B]=new r0(B,k0,!1,B.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(B){u0[B]=new r0(B,k0,!1,B,null,!1,!1)}),["allowFullScreen","async","autoFocus","autoPlay","controls","default","defer","disabled","disablePictureInPicture","disableRemotePlayback","formNoValidate","hidden","loop","noModule","noValidate","open","playsInline","readOnly","required","reversed","scoped","seamless","itemScope"].forEach(function(B){u0[B]=new r0(B,_0,!1,B.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(B){u0[B]=new r0(B,_0,!0,B,null,!1,!1)}),["capture","download"].forEach(function(B){u0[B]=new r0(B,g0,!1,B,null,!1,!1)}),["cols","rows","size","span"].forEach(function(B){u0[B]=new r0(B,t0,!1,B,null,!1,!1)}),["rowSpan","start"].forEach(function(B){u0[B]=new r0(B,h0,!1,B.toLowerCase(),null,!1,!1)});var A6=/[\-\:]([a-z])/g,r6=function(B){return B[1].toUpperCase()};["accent-height","alignment-baseline","arabic-form","baseline-shift","cap-height","clip-path","clip-rule","color-interpolation","color-interpolation-filters","color-profile","color-rendering","dominant-baseline","enable-background","fill-opacity","fill-rule","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","glyph-name","glyph-orientation-horizontal","glyph-orientation-vertical","horiz-adv-x","horiz-origin-x","image-rendering","letter-spacing","lighting-color","marker-end","marker-mid","marker-start","overline-position","overline-thickness","paint-order","panose-1","pointer-events","rendering-intent","shape-rendering","stop-color","stop-opacity","strikethrough-position","strikethrough-thickness","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-anchor","text-decoration","text-rendering","underline-position","underline-thickness","unicode-bidi","unicode-range","units-per-em","v-alphabetic","v-hanging","v-ideographic","v-mathematical","vector-effect","vert-adv-y","vert-origin-x","vert-origin-y","word-spacing","writing-mode","xmlns:xlink","x-height"].forEach(function(B){var O=B.replace(A6,r6);u0[O]=new r0(O,l0,!1,B,null,!1,!1)}),["xlink:actuate","xlink:arcrole","xlink:role","xlink:show","xlink:title","xlink:type"].forEach(function(B){var O=B.replace(A6,r6);u0[O]=new r0(O,l0,!1,B,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(B){var O=B.replace(A6,r6);u0[O]=new r0(O,l0,!1,B,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(B){u0[B]=new r0(B,l0,!1,B.toLowerCase(),null,!1,!1)});var N6="xlinkHref";u0[N6]=new r0("xlinkHref",l0,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(B){u0[B]=new r0(B,l0,!1,B.toLowerCase(),null,!0,!0)});var F6=/^[\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,P6=!1;function M6(B){if(!P6&&F6.test(B))P6=!0,K("A future version of React will block javascript: URLs as a security precaution. Use event handlers instead if you can. If you need to generate unsafe HTML try using dangerouslySetInnerHTML instead. React was passed %s.",JSON.stringify(B))}function g6(B,O,D,P){if(P.mustUseProperty){var k=P.propertyName;return B[k]}else{if(F0(D,O),P.sanitizeURL)M6(""+D);var u=P.attributeName,n=null;if(P.type===g0){if(B.hasAttribute(u)){var Z0=B.getAttribute(u);if(Z0==="")return!0;if($0(O,D,P,!1))return Z0;if(Z0===""+D)return D;return Z0}}else if(B.hasAttribute(u)){if($0(O,D,P,!1))return B.getAttribute(u);if(P.type===_0)return D;n=B.getAttribute(u)}if($0(O,D,P,!1))return n===null?D:n;else if(n===""+D)return D;else return n}}function O8(B,O,D,P){{if(!L0(O))return;if(!B.hasAttribute(O))return D===void 0?void 0:null;var k=B.getAttribute(O);if(F0(D,O),k===""+D)return D;return k}}function a6(B,O,D,P){var k=v0(O);if(I0(O,k,P))return;if($0(O,D,k,P))D=null;if(P||k===null){if(L0(O)){var u=O;if(D===null)B.removeAttribute(u);else F0(D,O),B.setAttribute(u,""+D)}return}var n=k.mustUseProperty;if(n){var Z0=k.propertyName;if(D===null){var H0=k.type;B[Z0]=H0===_0?!1:""}else B[Z0]=D;return}var{attributeName:j0,attributeNamespace:b0}=k;if(D===null)B.removeAttribute(j0);else{var K6=k.type,Z6;if(K6===_0||K6===g0&&D===!0)Z6="";else if(F0(D,j0),Z6=""+D,k.sanitizeURL)M6(Z6.toString());if(b0)B.setAttributeNS(b0,j0,Z6);else B.setAttribute(j0,Z6)}}var U8=Symbol.for("react.element"),p6=Symbol.for("react.portal"),u6=Symbol.for("react.fragment"),S0=Symbol.for("react.strict_mode"),Q6=Symbol.for("react.profiler"),B6=Symbol.for("react.provider"),D0=Symbol.for("react.context"),X6=Symbol.for("react.forward_ref"),W6=Symbol.for("react.suspense"),_6=Symbol.for("react.suspense_list"),c6=Symbol.for("react.memo"),d6=Symbol.for("react.lazy"),l6=Symbol.for("react.scope"),t6=Symbol.for("react.debug_trace_mode"),g8=Symbol.for("react.offscreen"),k6=Symbol.for("react.legacy_hidden"),d0=Symbol.for("react.cache"),V6=Symbol.for("react.tracing_marker"),Z8=Symbol.iterator,qJ="@@iterator";function ZJ(B){if(B===null||typeof B!=="object")return null;var O=Z8&&B[Z8]||B[qJ];if(typeof O==="function")return O;return null}var q8=Object.assign,B9=0,m9,H7,kJ,c0,T6,z8,C6;function wJ(){}wJ.__reactDisabledLog=!0;function x0(){{if(B9===0){m9=console.log,H7=console.info,kJ=console.warn,c0=console.error,T6=console.group,z8=console.groupCollapsed,C6=console.groupEnd;var B={configurable:!0,enumerable:!0,value:wJ,writable:!0};Object.defineProperties(console,{info:B,log:B,warn:B,error:B,group:B,groupCollapsed:B,groupEnd:B})}B9++}}function fQ(){{if(B9--,B9===0){var B={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:q8({},B,{value:m9}),info:q8({},B,{value:H7}),warn:q8({},B,{value:kJ}),error:q8({},B,{value:c0}),group:q8({},B,{value:T6}),groupCollapsed:q8({},B,{value:z8}),groupEnd:q8({},B,{value:C6})})}if(B9<0)K("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var p0=J.ReactCurrentDispatcher,xJ;function YQ(B,O,D){{if(xJ===void 0)try{throw Error()}catch(k){var P=k.stack.trim().match(/\n( *(at )?)/);xJ=P&&P[1]||""}return`
|
|
24
|
-
`+xJ+B}}var cK=!1,lK;{var cz=typeof WeakMap==="function"?WeakMap:Map;lK=new cz}function C2(B,O){if(!B||cK)return"";{var D=lK.get(B);if(D!==void 0)return D}var P;cK=!0;var k=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var u;u=
|
|
23
|
+
Check the top-level render call using <`+D6+">."}return a0}function bQ(M0,a0){if(!M0._store||M0._store.validated||M0.key!=null)return;M0._store.validated=!0;var D6=rK(a0);if(W4[D6])return;W4[D6]=!0;var v6="";if(M0&&M0._owner&&M0._owner!==V.current)v6=" It was passed a child from "+J0(M0._owner.type)+".";pJ(M0),x('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',D6,v6),pJ(null)}function v2(M0,a0){if(typeof M0!=="object")return;if(z0(M0))for(var D6=0;D6<M0.length;D6++){var v6=M0[D6];if(d(v6))bQ(v6,a0)}else if(d(M0)){if(M0._store)M0._store.validated=!0}else if(M0){var F8=I(M0);if(typeof F8==="function"){if(F8!==M0.entries){var FJ=F8.call(M0),m8;while(!(m8=FJ.next()).done)if(d(m8.value))bQ(m8.value,a0)}}}}function H4(M0){{var a0=M0.type;if(a0===null||a0===void 0||typeof a0==="string")return;var D6;if(typeof a0==="function")D6=a0.propTypes;else if(typeof a0==="object"&&(a0.$$typeof===G||a0.$$typeof===q))D6=a0.propTypes;else return;if(D6){var v6=J0(a0);l4(D6,M0.props,"prop",v6,M0)}else if(a0.PropTypes!==void 0&&!iK){iK=!0;var F8=J0(a0);x("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",F8||"Unknown")}if(typeof a0.getDefaultProps==="function"&&!a0.getDefaultProps.isReactClassApproved)x("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function O7(M0){{var a0=Object.keys(M0.props);for(var D6=0;D6<a0.length;D6++){var v6=a0[D6];if(v6!=="children"&&v6!=="key"){pJ(M0),x("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",v6),pJ(null);break}}if(M0.ref!==null)pJ(M0),x("Invalid attribute `ref` supplied to `React.Fragment`."),pJ(null)}}function JZ(M0,a0,D6){var v6=B6(M0);if(!v6){var F8="";if(M0===void 0||typeof M0==="object"&&M0!==null&&Object.keys(M0).length===0)F8+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.";var FJ=gW(a0);if(FJ)F8+=FJ;else F8+=_Q();var m8;if(M0===null)m8="null";else if(z0(M0))m8="array";else if(M0!==void 0&&M0.$$typeof===Q)m8="<"+(J0(M0.type)||"Unknown")+" />",F8=" Did you accidentally export a JSX literal instead of a component?";else m8=typeof M0;x("React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",m8,F8)}var AJ=y0.apply(this,arguments);if(AJ==null)return AJ;if(v6)for(var J9=2;J9<arguments.length;J9++)v2(arguments[J9],M0);if(M0===U)O7(AJ);else H4(AJ);return AJ}var o5=!1;function tU(M0){var a0=JZ.bind(null,M0);a0.type=M0;{if(!o5)o5=!0,f("React.createFactory() is deprecated and will be removed in a future major release. Consider using JSX or use React.createElement() directly instead.");Object.defineProperty(a0,"type",{enumerable:!1,get:function(){return f("Factory.type is deprecated. Access the class directly before passing it to createFactory."),Object.defineProperty(this,"type",{value:M0}),M0}})}return a0}function YY(M0,a0,D6){var v6=w0.apply(this,arguments);for(var F8=2;F8<arguments.length;F8++)v2(arguments[F8],v6.type);return H4(v6),v6}function bu(M0,a0){var D6=N.transition;N.transition={};var v6=N.transition;N.transition._updatedFibers=new Set;try{M0()}finally{if(N.transition=D6,D6===null&&v6._updatedFibers){var F8=v6._updatedFibers.size;if(F8>10)f("Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table.");v6._updatedFibers.clear()}}}var SM=!1,k2=null;function qT(M0){if(k2===null)try{var a0=("require"+Math.random()).slice(0,7),D6=NS&&NS[a0];k2=D6.call(NS,"timers").setImmediate}catch(v6){k2=function(F8){if(SM===!1){if(SM=!0,typeof MessageChannel==="undefined")x("This browser does not have a MessageChannel implementation, so enqueuing tasks via await act(async () => ...) will fail. Please file an issue at https://github.com/facebook/react/issues if you encounter this warning.")}var FJ=new MessageChannel;FJ.port1.onmessage=F8,FJ.port2.postMessage(void 0)}}return k2(M0)}var mW=0,FT=!1;function BT(M0){{var a0=mW;if(mW++,E.current===null)E.current=[];var D6=E.isBatchingLegacy,v6;try{if(E.isBatchingLegacy=!0,v6=M0(),!D6&&E.didScheduleLegacyUpdate){var F8=E.current;if(F8!==null)E.didScheduleLegacyUpdate=!1,vM(F8)}}catch(x7){throw dz(a0),x7}finally{E.isBatchingLegacy=D6}if(v6!==null&&typeof v6==="object"&&typeof v6.then==="function"){var FJ=v6,m8=!1,AJ={then:function(x7,E4){m8=!0,FJ.then(function(w9){if(dz(a0),mW===0)$M(w9,x7,E4);else x7(w9)},function(w9){dz(a0),E4(w9)})}};if(!FT&&typeof Promise!=="undefined")Promise.resolve().then(function(){}).then(function(){if(!m8)FT=!0,x("You called act(async () => ...) without await. This could lead to unexpected testing behaviour, interleaving multiple act calls and mixing their scopes. You should - await act(async () => ...);")});return AJ}else{var J9=v6;if(dz(a0),mW===0){var l9=E.current;if(l9!==null)vM(l9),E.current=null;var L7={then:function(x7,E4){if(E.current===null)E.current=[],$M(J9,x7,E4);else x7(J9)}};return L7}else{var A7={then:function(x7,E4){x7(J9)}};return A7}}}}function dz(M0){{if(M0!==mW-1)x("You seem to have overlapping act() calls, this is not supported. Be sure to await previous act() calls before making a new one. ");mW=M0}}function $M(M0,a0,D6){{var v6=E.current;if(v6!==null)try{vM(v6),qT(function(){if(v6.length===0)E.current=null,a0(M0);else $M(M0,a0,D6)})}catch(F8){D6(F8)}else a0(M0)}}var uW=!1;function vM(M0){if(!uW){uW=!0;var a0=0;try{for(;a0<M0.length;a0++){var D6=M0[a0];do D6=D6(!0);while(D6!==null)}M0.length=0}catch(v6){throw M0=M0.slice(a0+1),v6}finally{uW=!1}}}var MT=JZ,OT=YY,LT=tU,AT={map:A6,forEach:N6,count:r6,toArray:F6,only:P6};if($Z6.Children=AT,$Z6.Component=a,$Z6.Fragment=U,$Z6.Profiler=X,$Z6.PureComponent=X0,$Z6.StrictMode=K,$Z6.Suspense=W,$Z6.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=v,$Z6.act=BT,$Z6.cloneElement=OT,$Z6.createContext=M6,$Z6.createElement=MT,$Z6.createFactory=LT,$Z6.createRef=W0,$Z6.forwardRef=S0,$Z6.isValidElement=d,$Z6.lazy=u6,$Z6.memo=D0,$Z6.startTransition=bu,$Z6.unstable_act=BT,$Z6.useCallback=k6,$Z6.useContext=W6,$Z6.useDebugValue=Z8,$Z6.useDeferredValue=ZJ,$Z6.useEffect=l6,$Z6.useId=q8,$Z6.useImperativeHandle=V6,$Z6.useInsertionEffect=t6,$Z6.useLayoutEffect=g8,$Z6.useMemo=d0,$Z6.useReducer=c6,$Z6.useRef=d6,$Z6.useState=_6,$Z6.useSyncExternalStore=B9,$Z6.useTransition=qJ,$Z6.version=J,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__!=="undefined"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop==="function")__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)})()});var sq0=F4((vZ6)=>{(function(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__!=="undefined"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart==="function")__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var J=!1,Q=!1,Z=5;function U(o,w0){var d=o.length;o.push(w0),Y(o,w0,d)}function K(o){return o.length===0?null:o[0]}function X(o){if(o.length===0)return null;var w0=o[0],d=o.pop();if(d!==w0)o[0]=d,z(o,d,0);return w0}function Y(o,w0,d){var L0=d;while(L0>0){var I0=L0-1>>>1,T0=o[I0];if(G(T0,w0)>0)o[I0]=w0,o[L0]=T0,L0=I0;else return}}function z(o,w0,d){var L0=d,I0=o.length,T0=I0>>>1;while(L0<T0){var $0=(L0+1)*2-1,v0=o[$0],r0=$0+1,u0=o[r0];if(G(v0,w0)<0)if(r0<I0&&G(u0,v0)<0)o[L0]=u0,o[r0]=w0,L0=r0;else o[L0]=v0,o[$0]=w0,L0=$0;else if(r0<I0&&G(u0,w0)<0)o[L0]=u0,o[r0]=w0,L0=r0;else return}}function G(o,w0){var d=o.sortIndex-w0.sortIndex;return d!==0?d:o.id-w0.id}var W=1,H=2,q=3,F=4,M=5;function L(o,w0){}var A=typeof performance==="object"&&typeof performance.now==="function";if(A){var I=performance;vZ6.unstable_now=function(){return I.now()}}else{var R=Date,N=R.now();vZ6.unstable_now=function(){return R.now()-N}}var E=1073741823,V=-1,j=250,T=5000,C=1e4,$=E,b=[],h=[],_=1,S=null,v=q,f=!1,x=!1,y=!1,m=typeof setTimeout==="function"?setTimeout:null,g=typeof clearTimeout==="function"?clearTimeout:null,p=typeof setImmediate!=="undefined"?setImmediate:null,i=typeof navigator!=="undefined"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0?navigator.scheduling.isInputPending.bind(navigator.scheduling):null;function l(o){var w0=K(h);while(w0!==null){if(w0.callback===null)X(h);else if(w0.startTime<=o)X(h),w0.sortIndex=w0.expirationTime,U(b,w0);else return;w0=K(h)}}function a(o){if(y=!1,l(o),!x)if(K(b)!==null)x=!0,g0(e);else{var w0=K(h);if(w0!==null)h0(a,w0.startTime-o)}}function e(o,w0){if(x=!1,y)y=!1,t0();f=!0;var d=v;try{if(Q)try{return G0(o,w0)}catch(I0){if(S!==null){var L0=vZ6.unstable_now();L(S,L0),S.isQueued=!1}throw I0}else return G0(o,w0)}finally{S=null,v=d,f=!1}}function G0(o,w0){var d=w0;l(d),S=K(b);while(S!==null&&!J){if(S.expirationTime>d&&(!o||z6()))break;var L0=S.callback;if(typeof L0==="function"){S.callback=null,v=S.priorityLevel;var I0=S.expirationTime<=d,T0=L0(I0);if(d=vZ6.unstable_now(),typeof T0==="function")S.callback=T0;else if(S===K(b))X(b);l(d)}else X(b);S=K(b)}if(S!==null)return!0;else{var $0=K(h);if($0!==null)h0(a,$0.startTime-d);return!1}}function U0(o,w0){switch(o){case W:case H:case q:case F:case M:break;default:o=q}var d=v;v=o;try{return w0()}finally{v=d}}function O0(o){var w0;switch(v){case W:case H:case q:w0=q;break;default:w0=v;break}var d=v;v=w0;try{return o()}finally{v=d}}function X0(o){var w0=v;return function(){var d=v;v=w0;try{return o.apply(this,arguments)}finally{v=d}}}function E0(o,w0,d){var L0=vZ6.unstable_now(),I0;if(typeof d==="object"&&d!==null){var T0=d.delay;if(typeof T0==="number"&&T0>0)I0=L0+T0;else I0=L0}else I0=L0;var $0;switch(o){case W:$0=V;break;case H:$0=j;break;case M:$0=$;break;case F:$0=C;break;case q:default:$0=T;break}var v0=I0+$0,r0={id:_++,callback:w0,priorityLevel:o,startTime:I0,expirationTime:v0,sortIndex:-1};if(I0>L0){if(r0.sortIndex=I0,U(h,r0),K(b)===null&&r0===K(h)){if(y)t0();else y=!0;h0(a,I0-L0)}}else if(r0.sortIndex=v0,U(b,r0),!x&&!f)x=!0,g0(e);return r0}function W0(){}function q0(){if(!x&&!f)x=!0,g0(e)}function z0(){return K(b)}function K0(o){o.callback=null}function R0(){return v}var Y0=!1,P0=null,F0=-1,m0=Z,J0=-1;function z6(){var o=vZ6.unstable_now()-J0;if(o<m0)return!1;return!0}function t(){}function N0(o){if(o<0||o>125){console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported");return}if(o>0)m0=Math.floor(1000/o);else m0=Z}var f0=function(){if(P0!==null){var o=vZ6.unstable_now();J0=o;var w0=!0,d=!0;try{d=P0(w0,o)}finally{if(d)l0();else Y0=!1,P0=null}}else Y0=!1},l0;if(typeof p==="function")l0=function(){p(f0)};else if(typeof MessageChannel!=="undefined"){var k0=new MessageChannel,_0=k0.port2;k0.port1.onmessage=f0,l0=function(){_0.postMessage(null)}}else l0=function(){m(f0,0)};function g0(o){if(P0=o,!Y0)Y0=!0,l0()}function h0(o,w0){F0=m(function(){o(vZ6.unstable_now())},w0)}function t0(){g(F0),F0=-1}var C0=t,y0=null;if(vZ6.unstable_IdlePriority=M,vZ6.unstable_ImmediatePriority=W,vZ6.unstable_LowPriority=F,vZ6.unstable_NormalPriority=q,vZ6.unstable_Profiling=y0,vZ6.unstable_UserBlockingPriority=H,vZ6.unstable_cancelCallback=K0,vZ6.unstable_continueExecution=q0,vZ6.unstable_forceFrameRate=N0,vZ6.unstable_getCurrentPriorityLevel=R0,vZ6.unstable_getFirstCallbackNode=z0,vZ6.unstable_next=O0,vZ6.unstable_pauseExecution=W0,vZ6.unstable_requestPaint=C0,vZ6.unstable_runWithPriority=U0,vZ6.unstable_scheduleCallback=E0,vZ6.unstable_shouldYield=z6,vZ6.unstable_wrapCallback=X0,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__!=="undefined"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop==="function")__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)})()});var aq0=F4((kZ6)=>{var eN=J6(n6(),1),n9=J6(sq0(),1);(function(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__!=="undefined"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart==="function")__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var J=eN.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Q=!1;function Z(B){Q=B}function U(B){if(!Q){for(var O=arguments.length,D=new Array(O>1?O-1:0),P=1;P<O;P++)D[P-1]=arguments[P];X("warn",B,D)}}function K(B){if(!Q){for(var O=arguments.length,D=new Array(O>1?O-1:0),P=1;P<O;P++)D[P-1]=arguments[P];X("error",B,D)}}function X(B,O,D){{var P=J.ReactDebugCurrentFrame,k=P.getStackAddendum();if(k!=="")O+="%s",D=D.concat([k]);var u=D.map(function(n){return String(n)});u.unshift("Warning: "+O),Function.prototype.apply.call(console[B],console,u)}}var Y=0,z=1,G=2,W=3,H=4,q=5,F=6,M=7,L=8,A=9,I=10,R=11,N=12,E=13,V=14,j=15,T=16,C=17,$=18,b=19,h=21,_=22,S=23,v=24,f=25,x=!0,y=!1,m=!1,g=!1,p=!1,i=!0,l=!1,a=!0,e=!0,G0=!0,U0=!0,O0=new Set,X0={},E0={};function W0(B,O){q0(B,O),q0(B+"Capture",O)}function q0(B,O){if(X0[B])K("EventRegistry: More than one plugin attempted to publish the same registration name, `%s`.",B);X0[B]=O;{var D=B.toLowerCase();if(E0[D]=B,B==="onDoubleClick")E0.ondblclick=B}for(var P=0;P<O.length;P++)O0.add(O[P])}var z0=typeof window!=="undefined"&&typeof window.document!=="undefined"&&typeof window.document.createElement!=="undefined",K0=Object.prototype.hasOwnProperty;function R0(B){{var O=typeof Symbol==="function"&&Symbol.toStringTag,D=O&&B[Symbol.toStringTag]||B.constructor.name||"Object";return D}}function Y0(B){try{return P0(B),!1}catch(O){return!0}}function P0(B){return""+B}function F0(B,O){if(Y0(B))return K("The provided `%s` attribute is an unsupported type %s. This value must be coerced to a string before before using it here.",O,R0(B)),P0(B)}function m0(B){if(Y0(B))return K("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",R0(B)),P0(B)}function J0(B,O){if(Y0(B))return K("The provided `%s` prop is an unsupported type %s. This value must be coerced to a string before before using it here.",O,R0(B)),P0(B)}function z6(B,O){if(Y0(B))return K("The provided `%s` CSS property is an unsupported type %s. This value must be coerced to a string before before using it here.",O,R0(B)),P0(B)}function t(B){if(Y0(B))return K("The provided HTML markup uses a value of unsupported type %s. This value must be coerced to a string before before using it here.",R0(B)),P0(B)}function N0(B){if(Y0(B))return K("Form field values (value, checked, defaultValue, or defaultChecked props) must be strings, not %s. This value must be coerced to a string before before using it here.",R0(B)),P0(B)}var f0=0,l0=1,k0=2,_0=3,g0=4,h0=5,t0=6,C0=":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",y0=C0+"\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",o=new RegExp("^["+C0+"]["+y0+"]*$"),w0={},d={};function L0(B){if(K0.call(d,B))return!0;if(K0.call(w0,B))return!1;if(o.test(B))return d[B]=!0,!0;return w0[B]=!0,K("Invalid attribute name: `%s`",B),!1}function I0(B,O,D){if(O!==null)return O.type===f0;if(D)return!1;if(B.length>2&&(B[0]==="o"||B[0]==="O")&&(B[1]==="n"||B[1]==="N"))return!0;return!1}function T0(B,O,D,P){if(D!==null&&D.type===f0)return!1;switch(typeof O){case"function":case"symbol":return!0;case"boolean":{if(P)return!1;if(D!==null)return!D.acceptsBooleans;else{var k=B.toLowerCase().slice(0,5);return k!=="data-"&&k!=="aria-"}}default:return!1}}function $0(B,O,D,P){if(O===null||typeof O==="undefined")return!0;if(T0(B,O,D,P))return!0;if(P)return!1;if(D!==null)switch(D.type){case _0:return!O;case g0:return O===!1;case h0:return isNaN(O);case t0:return isNaN(O)||O<1}return!1}function v0(B){return u0.hasOwnProperty(B)?u0[B]:null}function r0(B,O,D,P,k,u,n){this.acceptsBooleans=O===k0||O===_0||O===g0,this.attributeName=P,this.attributeNamespace=k,this.mustUseProperty=D,this.propertyName=B,this.type=O,this.sanitizeURL=u,this.removeEmptyString=n}var u0={},G6=["children","dangerouslySetInnerHTML","defaultValue","defaultChecked","innerHTML","suppressContentEditableWarning","suppressHydrationWarning","style"];G6.forEach(function(B){u0[B]=new r0(B,f0,!1,B,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(B){var O=B[0],D=B[1];u0[O]=new r0(O,l0,!1,D,null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(B){u0[B]=new r0(B,k0,!1,B.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(B){u0[B]=new r0(B,k0,!1,B,null,!1,!1)}),["allowFullScreen","async","autoFocus","autoPlay","controls","default","defer","disabled","disablePictureInPicture","disableRemotePlayback","formNoValidate","hidden","loop","noModule","noValidate","open","playsInline","readOnly","required","reversed","scoped","seamless","itemScope"].forEach(function(B){u0[B]=new r0(B,_0,!1,B.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(B){u0[B]=new r0(B,_0,!0,B,null,!1,!1)}),["capture","download"].forEach(function(B){u0[B]=new r0(B,g0,!1,B,null,!1,!1)}),["cols","rows","size","span"].forEach(function(B){u0[B]=new r0(B,t0,!1,B,null,!1,!1)}),["rowSpan","start"].forEach(function(B){u0[B]=new r0(B,h0,!1,B.toLowerCase(),null,!1,!1)});var A6=/[\-\:]([a-z])/g,r6=function(B){return B[1].toUpperCase()};["accent-height","alignment-baseline","arabic-form","baseline-shift","cap-height","clip-path","clip-rule","color-interpolation","color-interpolation-filters","color-profile","color-rendering","dominant-baseline","enable-background","fill-opacity","fill-rule","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","glyph-name","glyph-orientation-horizontal","glyph-orientation-vertical","horiz-adv-x","horiz-origin-x","image-rendering","letter-spacing","lighting-color","marker-end","marker-mid","marker-start","overline-position","overline-thickness","paint-order","panose-1","pointer-events","rendering-intent","shape-rendering","stop-color","stop-opacity","strikethrough-position","strikethrough-thickness","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-anchor","text-decoration","text-rendering","underline-position","underline-thickness","unicode-bidi","unicode-range","units-per-em","v-alphabetic","v-hanging","v-ideographic","v-mathematical","vector-effect","vert-adv-y","vert-origin-x","vert-origin-y","word-spacing","writing-mode","xmlns:xlink","x-height"].forEach(function(B){var O=B.replace(A6,r6);u0[O]=new r0(O,l0,!1,B,null,!1,!1)}),["xlink:actuate","xlink:arcrole","xlink:role","xlink:show","xlink:title","xlink:type"].forEach(function(B){var O=B.replace(A6,r6);u0[O]=new r0(O,l0,!1,B,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(B){var O=B.replace(A6,r6);u0[O]=new r0(O,l0,!1,B,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(B){u0[B]=new r0(B,l0,!1,B.toLowerCase(),null,!1,!1)});var N6="xlinkHref";u0[N6]=new r0("xlinkHref",l0,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(B){u0[B]=new r0(B,l0,!1,B.toLowerCase(),null,!0,!0)});var F6=/^[\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,P6=!1;function M6(B){if(!P6&&F6.test(B))P6=!0,K("A future version of React will block javascript: URLs as a security precaution. Use event handlers instead if you can. If you need to generate unsafe HTML try using dangerouslySetInnerHTML instead. React was passed %s.",JSON.stringify(B))}function g6(B,O,D,P){if(P.mustUseProperty){var k=P.propertyName;return B[k]}else{if(F0(D,O),P.sanitizeURL)M6(""+D);var u=P.attributeName,n=null;if(P.type===g0){if(B.hasAttribute(u)){var Z0=B.getAttribute(u);if(Z0==="")return!0;if($0(O,D,P,!1))return Z0;if(Z0===""+D)return D;return Z0}}else if(B.hasAttribute(u)){if($0(O,D,P,!1))return B.getAttribute(u);if(P.type===_0)return D;n=B.getAttribute(u)}if($0(O,D,P,!1))return n===null?D:n;else if(n===""+D)return D;else return n}}function O8(B,O,D,P){{if(!L0(O))return;if(!B.hasAttribute(O))return D===void 0?void 0:null;var k=B.getAttribute(O);if(F0(D,O),k===""+D)return D;return k}}function a6(B,O,D,P){var k=v0(O);if(I0(O,k,P))return;if($0(O,D,k,P))D=null;if(P||k===null){if(L0(O)){var u=O;if(D===null)B.removeAttribute(u);else F0(D,O),B.setAttribute(u,""+D)}return}var n=k.mustUseProperty;if(n){var Z0=k.propertyName;if(D===null){var H0=k.type;B[Z0]=H0===_0?!1:""}else B[Z0]=D;return}var{attributeName:j0,attributeNamespace:b0}=k;if(D===null)B.removeAttribute(j0);else{var K6=k.type,Z6;if(K6===_0||K6===g0&&D===!0)Z6="";else if(F0(D,j0),Z6=""+D,k.sanitizeURL)M6(Z6.toString());if(b0)B.setAttributeNS(b0,j0,Z6);else B.setAttribute(j0,Z6)}}var U8=Symbol.for("react.element"),p6=Symbol.for("react.portal"),u6=Symbol.for("react.fragment"),S0=Symbol.for("react.strict_mode"),Q6=Symbol.for("react.profiler"),B6=Symbol.for("react.provider"),D0=Symbol.for("react.context"),X6=Symbol.for("react.forward_ref"),W6=Symbol.for("react.suspense"),_6=Symbol.for("react.suspense_list"),c6=Symbol.for("react.memo"),d6=Symbol.for("react.lazy"),l6=Symbol.for("react.scope"),t6=Symbol.for("react.debug_trace_mode"),g8=Symbol.for("react.offscreen"),k6=Symbol.for("react.legacy_hidden"),d0=Symbol.for("react.cache"),V6=Symbol.for("react.tracing_marker"),Z8=Symbol.iterator,qJ="@@iterator";function ZJ(B){if(B===null||typeof B!=="object")return null;var O=Z8&&B[Z8]||B[qJ];if(typeof O==="function")return O;return null}var q8=Object.assign,B9=0,m9,H7,kJ,p0,T6,z8,C6;function wJ(){}wJ.__reactDisabledLog=!0;function x0(){{if(B9===0){m9=console.log,H7=console.info,kJ=console.warn,p0=console.error,T6=console.group,z8=console.groupCollapsed,C6=console.groupEnd;var B={configurable:!0,enumerable:!0,value:wJ,writable:!0};Object.defineProperties(console,{info:B,log:B,warn:B,error:B,group:B,groupCollapsed:B,groupEnd:B})}B9++}}function fQ(){{if(B9--,B9===0){var B={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:q8({},B,{value:m9}),info:q8({},B,{value:H7}),warn:q8({},B,{value:kJ}),error:q8({},B,{value:p0}),group:q8({},B,{value:T6}),groupCollapsed:q8({},B,{value:z8}),groupEnd:q8({},B,{value:C6})})}if(B9<0)K("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var c0=J.ReactCurrentDispatcher,xJ;function YQ(B,O,D){{if(xJ===void 0)try{throw Error()}catch(k){var P=k.stack.trim().match(/\n( *(at )?)/);xJ=P&&P[1]||""}return`
|
|
24
|
+
`+xJ+B}}var cK=!1,lK;{var cz=typeof WeakMap==="function"?WeakMap:Map;lK=new cz}function C2(B,O){if(!B||cK)return"";{var D=lK.get(B);if(D!==void 0)return D}var P;cK=!0;var k=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var u;u=c0.current,c0.current=null,x0();try{if(O){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==="object"&&Reflect.construct){try{Reflect.construct(n,[])}catch(E6){P=E6}Reflect.construct(B,[],n)}else{try{n.call()}catch(E6){P=E6}B.call(n.prototype)}}else{try{throw Error()}catch(E6){P=E6}B()}}catch(E6){if(E6&&P&&typeof E6.stack==="string"){var Z0=E6.stack.split(`
|
|
25
25
|
`),H0=P.stack.split(`
|
|
26
26
|
`),j0=Z0.length-1,b0=H0.length-1;while(j0>=1&&b0>=0&&Z0[j0]!==H0[b0])b0--;for(;j0>=1&&b0>=0;j0--,b0--)if(Z0[j0]!==H0[b0]){if(j0!==1||b0!==1)do if(j0--,b0--,b0<0||Z0[j0]!==H0[b0]){var K6=`
|
|
27
|
-
`+Z0[j0].replace(" at new "," at ");if(B.displayName&&K6.includes("<anonymous>"))K6=K6.replace("<anonymous>",B.displayName);if(typeof B==="function")lK.set(B,K6);return K6}while(j0>=1&&b0>=0);break}}}finally{cK=!1,
|
|
27
|
+
`+Z0[j0].replace(" at new "," at ");if(B.displayName&&K6.includes("<anonymous>"))K6=K6.replace("<anonymous>",B.displayName);if(typeof B==="function")lK.set(B,K6);return K6}while(j0>=1&&b0>=0);break}}}finally{cK=!1,c0.current=u,fQ(),Error.prepareStackTrace=k}var Z6=B?B.displayName||B.name:"",w6=Z6?YQ(Z6):"";if(typeof B==="function")lK.set(B,w6);return w6}function G4(B,O,D){return C2(B,!0)}function a5(B,O,D){return C2(B,!1)}function S2(B){var O=B.prototype;return!!(O&&O.isReactComponent)}function dK(B,O,D){if(B==null)return"";if(typeof B==="function")return C2(B,S2(B));if(typeof B==="string")return YQ(B);switch(B){case W6:return YQ("Suspense");case _6:return YQ("SuspenseList")}if(typeof B==="object")switch(B.$$typeof){case X6:return a5(B.render);case c6:return dK(B.type,O,D);case d6:{var P=B,k=P._payload,u=P._init;try{return dK(u(k),O,D)}catch(n){}}}return""}function CM(B){var O=B._debugOwner?B._debugOwner.type:null,D=B._debugSource;switch(B.tag){case q:return YQ(B.type);case T:return YQ("Lazy");case E:return YQ("Suspense");case b:return YQ("SuspenseList");case Y:case G:case j:return a5(B.type);case R:return a5(B.type.render);case z:return G4(B.type);default:return""}}function $2(B){try{var O="",D=B;do O+=CM(D),D=D.return;while(D);return O}catch(P){return`
|
|
28
28
|
Error generating stack: `+P.message+`
|
|
29
29
|
`+P.stack}}function lz(B,O,D){var P=B.displayName;if(P)return P;var k=O.displayName||O.name||"";return k!==""?D+"("+k+")":D}function l4(B){return B.displayName||"Context"}function pJ(B){if(B==null)return null;if(typeof B.tag==="number")K("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue.");if(typeof B==="function")return B.displayName||B.name||null;if(typeof B==="string")return B;switch(B){case u6:return"Fragment";case p6:return"Portal";case Q6:return"Profiler";case S0:return"StrictMode";case W6:return"Suspense";case _6:return"SuspenseList"}if(typeof B==="object")switch(B.$$typeof){case D0:var O=B;return l4(O)+".Consumer";case B6:var D=B;return l4(D._context)+".Provider";case X6:return lz(B,B.render,"ForwardRef");case c6:var P=B.displayName||null;if(P!==null)return P;return pJ(B.type)||"Memo";case d6:{var k=B,u=k._payload,n=k._init;try{return pJ(n(u))}catch(Z0){return null}}}return null}function iK(B,O,D){var P=O.displayName||O.name||"";return B.displayName||(P!==""?D+"("+P+")":D)}function _Q(B){return B.displayName||"Context"}function $J(B){var{tag:O,type:D}=B;switch(O){case v:return"Cache";case A:var P=D;return _Q(P)+".Consumer";case I:var k=D;return _Q(k._context)+".Provider";case $:return"DehydratedFragment";case R:return iK(D,D.render,"ForwardRef");case M:return"Fragment";case q:return D;case H:return"Portal";case W:return"Root";case F:return"Text";case T:return pJ(D);case L:if(D===S0)return"StrictMode";return"Mode";case _:return"Offscreen";case N:return"Profiler";case h:return"Scope";case E:return"Suspense";case b:return"SuspenseList";case f:return"TracingMarker";case z:case Y:case C:case G:case V:case j:if(typeof D==="function")return D.displayName||D.name||null;if(typeof D==="string")return D;break}return null}var gW=J.ReactDebugCurrentFrame,W4=null,rK=!1;function bQ(){{if(W4===null)return null;var B=W4._debugOwner;if(B!==null&&typeof B!=="undefined")return $J(B)}return null}function v2(){{if(W4===null)return"";return $2(W4)}}function H4(){gW.getCurrentStack=null,W4=null,rK=!1}function O7(B){gW.getCurrentStack=B===null?null:v2,W4=B,rK=!1}function JZ(){return W4}function o5(B){rK=B}function tU(B){return""+B}function YY(B){switch(typeof B){case"boolean":case"number":case"string":case"undefined":return B;case"object":return N0(B),B;default:return""}}var bu={button:!0,checkbox:!0,image:!0,hidden:!0,radio:!0,reset:!0,submit:!0};function SM(B,O){{if(!(bu[O.type]||O.onChange||O.onInput||O.readOnly||O.disabled||O.value==null))K("You provided a `value` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultValue`. Otherwise, set either `onChange` or `readOnly`.");if(!(O.onChange||O.readOnly||O.disabled||O.checked==null))K("You provided a `checked` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultChecked`. Otherwise, set either `onChange` or `readOnly`.")}}function k2(B){var{type:O,nodeName:D}=B;return D&&D.toLowerCase()==="input"&&(O==="checkbox"||O==="radio")}function qT(B){return B._valueTracker}function mW(B){B._valueTracker=null}function FT(B){var O="";if(!B)return O;if(k2(B))O=B.checked?"true":"false";else O=B.value;return O}function BT(B){var O=k2(B)?"checked":"value",D=Object.getOwnPropertyDescriptor(B.constructor.prototype,O);N0(B[O]);var P=""+B[O];if(B.hasOwnProperty(O)||typeof D==="undefined"||typeof D.get!=="function"||typeof D.set!=="function")return;var{get:k,set:u}=D;Object.defineProperty(B,O,{configurable:!0,get:function(){return k.call(this)},set:function(Z0){N0(Z0),P=""+Z0,u.call(this,Z0)}}),Object.defineProperty(B,O,{enumerable:D.enumerable});var n={getValue:function(){return P},setValue:function(Z0){N0(Z0),P=""+Z0},stopTracking:function(){mW(B),delete B[O]}};return n}function dz(B){if(qT(B))return;B._valueTracker=BT(B)}function $M(B){if(!B)return!1;var O=qT(B);if(!O)return!0;var D=O.getValue(),P=FT(B);if(P!==D)return O.setValue(P),!0;return!1}function uW(B){if(B=B||(typeof document!=="undefined"?document:void 0),typeof B==="undefined")return null;try{return B.activeElement||B.body}catch(O){return B.body}}var vM=!1,MT=!1,OT=!1,LT=!1;function AT(B){var O=B.type==="checkbox"||B.type==="radio";return O?B.checked!=null:B.value!=null}function M0(B,O){var D=B,P=O.checked,k=q8({},O,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:P!=null?P:D._wrapperState.initialChecked});return k}function a0(B,O){{if(SM("input",O),O.checked!==void 0&&O.defaultChecked!==void 0&&!MT)K("%s contains an input of type %s with both checked and defaultChecked props. Input elements must be either controlled or uncontrolled (specify either the checked prop, or the defaultChecked prop, but not both). Decide between using a controlled or uncontrolled input element and remove one of these props. More info: https://reactjs.org/link/controlled-components",bQ()||"A component",O.type),MT=!0;if(O.value!==void 0&&O.defaultValue!==void 0&&!vM)K("%s contains an input of type %s with both value and defaultValue props. Input elements must be either controlled or uncontrolled (specify either the value prop, or the defaultValue prop, but not both). Decide between using a controlled or uncontrolled input element and remove one of these props. More info: https://reactjs.org/link/controlled-components",bQ()||"A component",O.type),vM=!0}var D=B,P=O.defaultValue==null?"":O.defaultValue;D._wrapperState={initialChecked:O.checked!=null?O.checked:O.defaultChecked,initialValue:YY(O.value!=null?O.value:P),controlled:AT(O)}}function D6(B,O){var D=B,P=O.checked;if(P!=null)a6(D,"checked",P,!1)}function v6(B,O){var D=B;{var P=AT(O);if(!D._wrapperState.controlled&&P&&!LT)K("A component is changing an uncontrolled input to be controlled. This is likely caused by the value changing from undefined to a defined value, which should not happen. Decide between using a controlled or uncontrolled input element for the lifetime of the component. More info: https://reactjs.org/link/controlled-components"),LT=!0;if(D._wrapperState.controlled&&!P&&!OT)K("A component is changing a controlled input to be uncontrolled. This is likely caused by the value changing from a defined to undefined, which should not happen. Decide between using a controlled or uncontrolled input element for the lifetime of the component. More info: https://reactjs.org/link/controlled-components"),OT=!0}D6(B,O);var k=YY(O.value),u=O.type;if(k!=null){if(u==="number"){if(k===0&&D.value===""||D.value!=k)D.value=tU(k)}else if(D.value!==tU(k))D.value=tU(k)}else if(u==="submit"||u==="reset"){D.removeAttribute("value");return}if(O.hasOwnProperty("value"))AJ(D,O.type,k);else if(O.hasOwnProperty("defaultValue"))AJ(D,O.type,YY(O.defaultValue));if(O.checked==null&&O.defaultChecked!=null)D.defaultChecked=!!O.defaultChecked}function F8(B,O,D){var P=B;if(O.hasOwnProperty("value")||O.hasOwnProperty("defaultValue")){var k=O.type,u=k==="submit"||k==="reset";if(u&&(O.value===void 0||O.value===null))return;var n=tU(P._wrapperState.initialValue);if(!D){if(n!==P.value)P.value=n}P.defaultValue=n}var Z0=P.name;if(Z0!=="")P.name="";if(P.defaultChecked=!P.defaultChecked,P.defaultChecked=!!P._wrapperState.initialChecked,Z0!=="")P.name=Z0}function FJ(B,O){var D=B;v6(D,O),m8(D,O)}function m8(B,O){var D=O.name;if(O.type==="radio"&&D!=null){var P=B;while(P.parentNode)P=P.parentNode;F0(D,"name");var k=P.querySelectorAll("input[name="+JSON.stringify(""+D)+'][type="radio"]');for(var u=0;u<k.length;u++){var n=k[u];if(n===B||n.form!==B.form)continue;var Z0=KC(n);if(!Z0)throw new Error("ReactDOMInput: Mixing React and non-React radio inputs with the same `name` is not supported.");$M(n),v6(n,Z0)}}}function AJ(B,O,D){if(O!=="number"||uW(B.ownerDocument)!==B){if(D==null)B.defaultValue=tU(B._wrapperState.initialValue);else if(B.defaultValue!==tU(D))B.defaultValue=tU(D)}}var J9=!1,l9=!1,L7=!1;function A7(B,O){{if(O.value==null){if(typeof O.children==="object"&&O.children!==null)eN.Children.forEach(O.children,function(D){if(D==null)return;if(typeof D==="string"||typeof D==="number")return;if(!l9)l9=!0,K("Cannot infer the option value of complex children. Pass a `value` prop or use a plain string as children to <option>.")});else if(O.dangerouslySetInnerHTML!=null){if(!L7)L7=!0,K("Pass a `value` prop if you set dangerouslyInnerHTML so React knows which value should be selected.")}}if(O.selected!=null&&!J9)K("Use the `defaultValue` or `value` props on <select> instead of setting `selected` on <option>."),J9=!0}}function x7(B,O){if(O.value!=null)B.setAttribute("value",tU(YY(O.value)))}var E4=Array.isArray;function w9(B){return E4(B)}var f2=!1;function kM(){var B=bQ();if(B)return`
|
|
30
30
|
|
|
@@ -230,7 +230,7 @@ ${J}</tr>
|
|
|
230
230
|
`}tablecell(J){let Q=this.parser.parseInline(J.tokens),Z=J.header?"th":"td";return(J.align?`<${Z} align="${J.align}">`:`<${Z}>`)+Q+`</${Z}>
|
|
231
231
|
`}strong({tokens:J}){return`<strong>${this.parser.parseInline(J)}</strong>`}em({tokens:J}){return`<em>${this.parser.parseInline(J)}</em>`}codespan({text:J}){return`<code>${CG(J,!0)}</code>`}br(J){return"<br>"}del({tokens:J}){return`<del>${this.parser.parseInline(J)}</del>`}link({href:J,title:Q,tokens:Z}){let U=this.parser.parseInline(Z),K=wN0(J);if(K===null)return U;J=K;let X='<a href="'+J+'"';return Q&&(X+=' title="'+CG(Q)+'"'),X+=">"+U+"</a>",X}image({href:J,title:Q,text:Z,tokens:U}){U&&(Z=this.parser.parseInline(U,this.parser.textRenderer));let K=wN0(J);if(K===null)return CG(Z);J=K;let X=`<img src="${J}" alt="${Z}"`;return Q&&(X+=` title="${CG(Q)}"`),X+=">",X}text(J){return"tokens"in J&&J.tokens?this.parser.parseInline(J.tokens):("escaped"in J)&&J.escaped?J.text:CG(J.text)}},Xk=class{strong({text:J}){return J}em({text:J}){return J}codespan({text:J}){return J}del({text:J}){return J}html({text:J}){return J}text({text:J}){return J}link({text:J}){return""+J}image({text:J}){return""+J}br(){return""}checkbox({raw:J}){return J}},OX=class J{options;renderer;textRenderer;constructor(Q){this.options=Q||nH,this.options.renderer=this.options.renderer||new Kw,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Xk}static parse(Q,Z){return new J(Z).parse(Q)}static parseInline(Q,Z){return new J(Z).parseInline(Q)}parse(Q){let Z="";for(let U=0;U<Q.length;U++){let K=Q[U];if(this.options.extensions?.renderers?.[K.type]){let Y=K,z=this.options.extensions.renderers[Y.type].call({parser:this},Y);if(z!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(Y.type)){Z+=z||"";continue}}let X=K;switch(X.type){case"space":{Z+=this.renderer.space(X);break}case"hr":{Z+=this.renderer.hr(X);break}case"heading":{Z+=this.renderer.heading(X);break}case"code":{Z+=this.renderer.code(X);break}case"table":{Z+=this.renderer.table(X);break}case"blockquote":{Z+=this.renderer.blockquote(X);break}case"list":{Z+=this.renderer.list(X);break}case"checkbox":{Z+=this.renderer.checkbox(X);break}case"html":{Z+=this.renderer.html(X);break}case"def":{Z+=this.renderer.def(X);break}case"paragraph":{Z+=this.renderer.paragraph(X);break}case"text":{Z+=this.renderer.text(X);break}default:{let Y='Token with "'+X.type+'" type was not found.';if(this.options.silent)return console.error(Y),"";throw new Error(Y)}}}return Z}parseInline(Q,Z=this.renderer){let U="";for(let K=0;K<Q.length;K++){let X=Q[K];if(this.options.extensions?.renderers?.[X.type]){let z=this.options.extensions.renderers[X.type].call({parser:this},X);if(z!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(X.type)){U+=z||"";continue}}let Y=X;switch(Y.type){case"escape":{U+=Z.text(Y);break}case"html":{U+=Z.html(Y);break}case"link":{U+=Z.link(Y);break}case"image":{U+=Z.image(Y);break}case"checkbox":{U+=Z.checkbox(Y);break}case"strong":{U+=Z.strong(Y);break}case"em":{U+=Z.em(Y);break}case"codespan":{U+=Z.codespan(Y);break}case"br":{U+=Z.br(Y);break}case"del":{U+=Z.del(Y);break}case"text":{U+=Z.text(Y);break}default:{let z='Token with "'+Y.type+'" type was not found.';if(this.options.silent)return console.error(z),"";throw new Error(z)}}}return U}},xL,xN0=class{defaults=Zk();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=OX;Renderer=Kw;TextRenderer=Xk;Lexer=MX;Tokenizer=Uw;Hooks=xL;constructor(...J){this.use(...J)}walkTokens(J,Q){let Z=[];for(let U of J)switch(Z=Z.concat(Q.call(this,U)),U.type){case"table":{let K=U;for(let X of K.header)Z=Z.concat(this.walkTokens(X.tokens,Q));for(let X of K.rows)for(let Y of X)Z=Z.concat(this.walkTokens(Y.tokens,Q));break}case"list":{let K=U;Z=Z.concat(this.walkTokens(K.items,Q));break}default:{let K=U;this.defaults.extensions?.childTokens?.[K.type]?this.defaults.extensions.childTokens[K.type].forEach((X)=>{let Y=K[X].flat(1/0);Z=Z.concat(this.walkTokens(Y,Q))}):K.tokens&&(Z=Z.concat(this.walkTokens(K.tokens,Q)))}}return Z}use(...J){let Q=this.defaults.extensions||{renderers:{},childTokens:{}};return J.forEach((Z)=>{let U={...Z};if(U.async=this.defaults.async||U.async||!1,Z.extensions&&(Z.extensions.forEach((K)=>{if(!K.name)throw new Error("extension name required");if("renderer"in K){let X=Q.renderers[K.name];X?Q.renderers[K.name]=function(...Y){let z=K.renderer.apply(this,Y);return z===!1&&(z=X.apply(this,Y)),z}:Q.renderers[K.name]=K.renderer}if("tokenizer"in K){if(!K.level||K.level!=="block"&&K.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let X=Q[K.level];X?X.unshift(K.tokenizer):Q[K.level]=[K.tokenizer],K.start&&(K.level==="block"?Q.startBlock?Q.startBlock.push(K.start):Q.startBlock=[K.start]:K.level==="inline"&&(Q.startInline?Q.startInline.push(K.start):Q.startInline=[K.start]))}"childTokens"in K&&K.childTokens&&(Q.childTokens[K.name]=K.childTokens)}),U.extensions=Q),Z.renderer){let K=this.defaults.renderer||new Kw(this.defaults);for(let X in Z.renderer){if(!(X in K))throw new Error(`renderer '${X}' does not exist`);if(["options","parser"].includes(X))continue;let Y=X,z=Z.renderer[Y],G=K[Y];K[Y]=(...W)=>{let H=z.apply(K,W);return H===!1&&(H=G.apply(K,W)),H||""}}U.renderer=K}if(Z.tokenizer){let K=this.defaults.tokenizer||new Uw(this.defaults);for(let X in Z.tokenizer){if(!(X in K))throw new Error(`tokenizer '${X}' does not exist`);if(["options","rules","lexer"].includes(X))continue;let Y=X,z=Z.tokenizer[Y],G=K[Y];K[Y]=(...W)=>{let H=z.apply(K,W);return H===!1&&(H=G.apply(K,W)),H}}U.tokenizer=K}if(Z.hooks){let K=this.defaults.hooks||new xL;for(let X in Z.hooks){if(!(X in K))throw new Error(`hook '${X}' does not exist`);if(["options","block"].includes(X))continue;let Y=X,z=Z.hooks[Y],G=K[Y];xL.passThroughHooks.has(X)?K[Y]=(W)=>{if(this.defaults.async&&xL.passThroughHooksRespectAsync.has(X))return(async()=>{let q=await z.call(K,W);return G.call(K,q)})();let H=z.call(K,W);return G.call(K,H)}:K[Y]=(...W)=>{if(this.defaults.async)return(async()=>{let q=await z.apply(K,W);return q===!1&&(q=await G.apply(K,W)),q})();let H=z.apply(K,W);return H===!1&&(H=G.apply(K,W)),H}}U.hooks=K}if(Z.walkTokens){let K=this.defaults.walkTokens,X=Z.walkTokens;U.walkTokens=function(Y){let z=[];return z.push(X.call(this,Y)),K&&(z=z.concat(K.call(this,Y))),z}}this.defaults={...this.defaults,...U}}),this}setOptions(J){return this.defaults={...this.defaults,...J},this}lexer(J,Q){return MX.lex(J,Q??this.defaults)}parser(J,Q){return OX.parse(J,Q??this.defaults)}parseMarkdown(J){return(Q,Z)=>{let U={...Z},K={...this.defaults,...U},X=this.onError(!!K.silent,!!K.async);if(this.defaults.async===!0&&U.async===!1)return X(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof Q>"u"||Q===null)return X(new Error("marked(): input parameter is undefined or null"));if(typeof Q!="string")return X(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(Q)+", string expected"));if(K.hooks&&(K.hooks.options=K,K.hooks.block=J),K.async)return(async()=>{let Y=K.hooks?await K.hooks.preprocess(Q):Q,z=await(K.hooks?await K.hooks.provideLexer():J?MX.lex:MX.lexInline)(Y,K),G=K.hooks?await K.hooks.processAllTokens(z):z;K.walkTokens&&await Promise.all(this.walkTokens(G,K.walkTokens));let W=await(K.hooks?await K.hooks.provideParser():J?OX.parse:OX.parseInline)(G,K);return K.hooks?await K.hooks.postprocess(W):W})().catch(X);try{K.hooks&&(Q=K.hooks.preprocess(Q));let Y=(K.hooks?K.hooks.provideLexer():J?MX.lex:MX.lexInline)(Q,K);K.hooks&&(Y=K.hooks.processAllTokens(Y)),K.walkTokens&&this.walkTokens(Y,K.walkTokens);let z=(K.hooks?K.hooks.provideParser():J?OX.parse:OX.parseInline)(Y,K);return K.hooks&&(z=K.hooks.postprocess(z)),z}catch(Y){return X(Y)}}}onError(J,Q){return(Z)=>{if(Z.message+=`
|
|
232
232
|
Please report this to https://github.com/markedjs/marked.`,J){let U="<p>An error occurred:</p><pre>"+CG(Z.message+"",!0)+"</pre>";return Q?Promise.resolve(U):U}if(Q)return Promise.reject(Z);throw Z}}},dF,kO6,fO6,_O6,bO6,xO6,hO6,yO6,gO6;var yN0=r(()=>{nH=Zk();Zw={exec:()=>null};aM6=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),RU={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:(J)=>new RegExp(`^( {0,3}${J})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:(J)=>new RegExp(`^ {0,${Math.min(3,J-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:(J)=>new RegExp(`^ {0,${Math.min(3,J-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:(J)=>new RegExp(`^ {0,${Math.min(3,J-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:(J)=>new RegExp(`^ {0,${Math.min(3,J-1)}}#`),htmlBeginRegex:(J)=>new RegExp(`^ {0,${Math.min(3,J-1)}}<(?:[a-z].*>|!--)`,"i")},oM6=/^(?:[ \t]*(?:\n|$))+/,tM6=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,eM6=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Xw=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,JO6=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,gn=/(?:[*+-]|\d{1,9}[.)])/,VN0=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,TN0=_9(VN0).replace(/bull/g,gn).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),QO6=_9(VN0).replace(/bull/g,gn).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),mn=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,ZO6=/^[^\n]+/,un=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,UO6=_9(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",un).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),KO6=_9(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,gn).getRegex(),pn=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,XO6=_9("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",pn).replace("tag",Uk).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),CN0=_9(mn).replace("hr",Xw).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Uk).getRegex(),YO6=_9(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",CN0).getRegex(),cn={blockquote:YO6,code:tM6,def:UO6,fences:eM6,heading:JO6,hr:Xw,html:XO6,lheading:TN0,list:KO6,newline:oM6,paragraph:CN0,table:Zw,text:ZO6},RN0=_9("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Xw).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Uk).getRegex(),zO6={...cn,lheading:QO6,table:RN0,paragraph:_9(mn).replace("hr",Xw).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",RN0).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Uk).getRegex()},GO6={...cn,html:_9(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",pn).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Zw,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:_9(mn).replace("hr",Xw).replace("heading",` *#{1,6} *[^
|
|
233
|
-
]`).replace("lheading",TN0).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},WO6=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,HO6=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,SN0=/^( {2,}|\\)\n(?!\s*$)/,qO6=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Kk=/[\p{P}\p{S}]/u,ln=/[\s\p{P}\p{S}]/u,$N0=/[^\s\p{P}\p{S}]/u,FO6=_9(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,ln).getRegex(),vN0=/(?!~)[\p{P}\p{S}]/u,BO6=/(?!~)[\s\p{P}\p{S}]/u,MO6=/(?:[^\s\p{P}\p{S}]|~)/u,OO6=_9(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",aM6?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),kN0=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,LO6=_9(kN0,"u").replace(/punct/g,Kk).getRegex(),AO6=_9(kN0,"u").replace(/punct/g,vN0).getRegex(),IO6=_9(fN0,"gu").replace(/notPunctSpace/g,$N0).replace(/punctSpace/g,ln).replace(/punct/g,Kk).getRegex(),RO6=_9(fN0,"gu").replace(/notPunctSpace/g,MO6).replace(/punctSpace/g,BO6).replace(/punct/g,vN0).getRegex(),NO6=_9("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,$N0).replace(/punctSpace/g,ln).replace(/punct/g,Kk).getRegex(),DO6=_9(/\\(punct)/,"gu").replace(/punct/g,Kk).getRegex(),wO6=_9(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),EO6=_9(pn).replace("(?:-->|$)","-->").getRegex(),jO6=_9("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",EO6).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Qk=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,PO6=_9(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",Qk).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),_N0=_9(/^!?\[(label)\]\[(ref)\]/).replace("label",Qk).replace("ref",un).getRegex(),bN0=_9(/^!?\[(ref)\](?:\[\])?/).replace("ref",un).getRegex(),VO6=_9("reflink|nolink(?!\\()","g").replace("reflink",_N0).replace("nolink",bN0).getRegex(),NN0=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,dn={_backpedal:Zw,anyPunctuation:DO6,autolink:wO6,blockSkip:OO6,br:SN0,code:HO6,del:Zw,emStrongLDelim:LO6,emStrongRDelimAst:IO6,emStrongRDelimUnd:NO6,escape:WO6,link:PO6,nolink:bN0,punctuation:FO6,reflink:_N0,reflinkSearch:VO6,tag:jO6,text:qO6,url:Zw},TO6={...dn,link:_9(/^!?\[(label)\]\((.*?)\)/).replace("label",Qk).getRegex(),reflink:_9(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Qk).getRegex()},yn={...dn,emStrongRDelimAst:RO6,emStrongLDelim:AO6,url:_9(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",NN0).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:_9(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",NN0).getRegex()},CO6={...yn,br:_9(SN0).replace("{2,}","*").getRegex(),text:_9(yn.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Jk={normal:cn,gfm:zO6,pedantic:GO6},Jw={normal:dn,gfm:yn,breaks:CO6,pedantic:TO6},SO6={"&":"&","<":"<",">":">",'"':""","'":"'"};xL=class{options;block;constructor(J){this.options=J||nH}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(J){return J}postprocess(J){return J}processAllTokens(J){return J}emStrongMask(J){return J}provideLexer(){return this.block?MX.lex:MX.lexInline}provideParser(){return this.block?OX.parse:OX.parseInline}},dF=new xN0;o9.options=o9.setOptions=function(J){return dF.setOptions(J),o9.defaults=dF.defaults,PN0(o9.defaults),o9};o9.getDefaults=Zk;o9.defaults=nH;o9.use=function(...J){return dF.use(...J),o9.defaults=dF.defaults,PN0(o9.defaults),o9};o9.walkTokens=function(J,Q){return dF.walkTokens(J,Q)};o9.parseInline=dF.parseInline;o9.Parser=OX;o9.parser=OX.parse;o9.Renderer=Kw;o9.TextRenderer=Xk;o9.Lexer=MX;o9.lexer=MX.lex;o9.Tokenizer=Uw;o9.Hooks=xL;o9.parse=o9;kO6=o9.options,fO6=o9.setOptions,_O6=o9.use,bO6=o9.walkTokens,xO6=o9.parseInline,hO6=o9,yO6=OX.parse,gO6=MX.lex});var oN0={};QJ(oN0,{default:()=>$G});function wU(J){return function(Q){if(Q instanceof RegExp)Q.lastIndex=0;for(var Z=arguments.length,U=new Array(Z>1?Z-1:0),K=1;K<Z;K++)U[K-1]=arguments[K];return Js(J,Q,U)}}function rO6(J){return function(){for(var Q=arguments.length,Z=new Array(Q),U=0;U<Q;U++)Z[U]=arguments[U];return Qs(J,Z)}}function K9(J,Q){let Z=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Gk;if(gN0)gN0(J,null);let U=Q.length;while(U--){let K=Q[U];if(typeof K==="string"){let X=Z(K);if(X!==K){if(!mO6(Q))Q[U]=X;K=X}}J[K]=!0}return J}function nO6(J){for(let Q=0;Q<J.length;Q++)if(!E1(J,Q))J[Q]=null;return J}function SG(J){let Q=en(null);for(let[Z,U]of rN0(J))if(E1(J,Z))if(Array.isArray(U))Q[Z]=nO6(U);else if(U&&typeof U==="object"&&U.constructor===Object)Q[Z]=SG(U);else Q[Z]=U;return Q}function Ww(J,Q){while(J!==null){let U=pO6(J,Q);if(U){if(U.get)return wU(U.get);if(typeof U.value==="function")return wU(U.value)}J=uO6(J)}function Z(){return null}return Z}function aN0(){let J=arguments.length>0&&arguments[0]!==void 0?arguments[0]:XL6(),Q=(k6)=>aN0(k6);if(Q.version="3.3.0",Q.removed=[],!J||!J.document||J.document.nodeType!==Hw.document||!J.Element)return Q.isSupported=!1,Q;let{document:Z}=J,U=Z,K=U.currentScript,{DocumentFragment:X,HTMLTemplateElement:Y,Node:z,Element:G,NodeFilter:W,NamedNodeMap:H=J.NamedNodeMap||J.MozNamedAttrMap,HTMLFormElement:q,DOMParser:F,trustedTypes:M}=J,L=G.prototype,A=Ww(L,"cloneNode"),I=Ww(L,"remove"),R=Ww(L,"nextSibling"),N=Ww(L,"childNodes"),E=Ww(L,"parentNode");if(typeof Y==="function"){let k6=Z.createElement("template");if(k6.content&&k6.content.ownerDocument)Z=k6.content.ownerDocument}let V,j="",{implementation:T,createNodeIterator:C,createDocumentFragment:$,getElementsByTagName:b}=Z,{importNode:h}=U,_=iN0();Q.isSupported=typeof rN0==="function"&&typeof E==="function"&&T&&T.createHTMLDocument!==void 0;let{MUSTACHE_EXPR:S,ERB_EXPR:v,TMPLIT_EXPR:f,DATA_ATTR:x,ARIA_ATTR:y,IS_SCRIPT_OR_DATA:m,ATTR_WHITESPACE:g,CUSTOM_ELEMENT:p}=dN0,{IS_ALLOWED_URI:i}=dN0,l=null,a=K9({},[...uN0,...sn,...an,...on,...pN0]),e=null,G0=K9({},[...cN0,...tn,...lN0,...zk]),U0=Object.seal(en(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),O0=null,X0=null,E0=Object.seal(en(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),W0=!0,q0=!0,z0=!1,K0=!0,R0=!1,Y0=!0,P0=!1,F0=!1,m0=!1,J0=!1,z6=!1,t=!1,N0=!0,f0=!1,l0="user-content-",k0=!0,_0=!1,g0={},h0=null,t0=K9({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),C0=null,y0=K9({},["audio","video","img","source","image","track"]),o=null,w0=K9({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),d="http://www.w3.org/1998/Math/MathML",L0="http://www.w3.org/2000/svg",I0="http://www.w3.org/1999/xhtml",T0=I0,$0=!1,v0=null,r0=K9({},[d,L0,I0],rn),u0=K9({},["mi","mo","mn","ms","mtext"]),G6=K9({},["annotation-xml"]),A6=K9({},["title","style","font","a","script"]),r6=null,N6=["application/xhtml+xml","text/html"],F6="text/html",P6=null,M6=null,g6=Z.createElement("form"),O8=function k6(d0){return d0 instanceof RegExp||d0 instanceof Function},a6=function k6(){let d0=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(M6&&M6===d0)return;if(!d0||typeof d0!=="object")d0={};if(d0=SG(d0),r6=N6.indexOf(d0.PARSER_MEDIA_TYPE)===-1?F6:d0.PARSER_MEDIA_TYPE,P6=r6==="application/xhtml+xml"?rn:Gk,l=E1(d0,"ALLOWED_TAGS")?K9({},d0.ALLOWED_TAGS,P6):a,e=E1(d0,"ALLOWED_ATTR")?K9({},d0.ALLOWED_ATTR,P6):G0,v0=E1(d0,"ALLOWED_NAMESPACES")?K9({},d0.ALLOWED_NAMESPACES,rn):r0,o=E1(d0,"ADD_URI_SAFE_ATTR")?K9(SG(w0),d0.ADD_URI_SAFE_ATTR,P6):w0,C0=E1(d0,"ADD_DATA_URI_TAGS")?K9(SG(y0),d0.ADD_DATA_URI_TAGS,P6):y0,h0=E1(d0,"FORBID_CONTENTS")?K9({},d0.FORBID_CONTENTS,P6):t0,O0=E1(d0,"FORBID_TAGS")?K9({},d0.FORBID_TAGS,P6):SG({}),X0=E1(d0,"FORBID_ATTR")?K9({},d0.FORBID_ATTR,P6):SG({}),g0=E1(d0,"USE_PROFILES")?d0.USE_PROFILES:!1,W0=d0.ALLOW_ARIA_ATTR!==!1,q0=d0.ALLOW_DATA_ATTR!==!1,z0=d0.ALLOW_UNKNOWN_PROTOCOLS||!1,K0=d0.ALLOW_SELF_CLOSE_IN_ATTR!==!1,R0=d0.SAFE_FOR_TEMPLATES||!1,Y0=d0.SAFE_FOR_XML!==!1,P0=d0.WHOLE_DOCUMENT||!1,J0=d0.RETURN_DOM||!1,z6=d0.RETURN_DOM_FRAGMENT||!1,t=d0.RETURN_TRUSTED_TYPE||!1,m0=d0.FORCE_BODY||!1,N0=d0.SANITIZE_DOM!==!1,f0=d0.SANITIZE_NAMED_PROPS||!1,k0=d0.KEEP_CONTENT!==!1,_0=d0.IN_PLACE||!1,i=d0.ALLOWED_URI_REGEXP||nN0,T0=d0.NAMESPACE||I0,u0=d0.MATHML_TEXT_INTEGRATION_POINTS||u0,G6=d0.HTML_INTEGRATION_POINTS||G6,U0=d0.CUSTOM_ELEMENT_HANDLING||{},d0.CUSTOM_ELEMENT_HANDLING&&O8(d0.CUSTOM_ELEMENT_HANDLING.tagNameCheck))U0.tagNameCheck=d0.CUSTOM_ELEMENT_HANDLING.tagNameCheck;if(d0.CUSTOM_ELEMENT_HANDLING&&O8(d0.CUSTOM_ELEMENT_HANDLING.attributeNameCheck))U0.attributeNameCheck=d0.CUSTOM_ELEMENT_HANDLING.attributeNameCheck;if(d0.CUSTOM_ELEMENT_HANDLING&&typeof d0.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements==="boolean")U0.allowCustomizedBuiltInElements=d0.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements;if(R0)q0=!1;if(z6)J0=!0;if(g0){if(l=K9({},pN0),e=[],g0.html===!0)K9(l,uN0),K9(e,cN0);if(g0.svg===!0)K9(l,sn),K9(e,tn),K9(e,zk);if(g0.svgFilters===!0)K9(l,an),K9(e,tn),K9(e,zk);if(g0.mathMl===!0)K9(l,on),K9(e,lN0),K9(e,zk)}if(d0.ADD_TAGS)if(typeof d0.ADD_TAGS==="function")E0.tagCheck=d0.ADD_TAGS;else{if(l===a)l=SG(l);K9(l,d0.ADD_TAGS,P6)}if(d0.ADD_ATTR)if(typeof d0.ADD_ATTR==="function")E0.attributeCheck=d0.ADD_ATTR;else{if(e===G0)e=SG(e);K9(e,d0.ADD_ATTR,P6)}if(d0.ADD_URI_SAFE_ATTR)K9(o,d0.ADD_URI_SAFE_ATTR,P6);if(d0.FORBID_CONTENTS){if(h0===t0)h0=SG(h0);K9(h0,d0.FORBID_CONTENTS,P6)}if(k0)l["#text"]=!0;if(P0)K9(l,["html","head","body"]);if(l.table)K9(l,["tbody"]),delete O0.tbody;if(d0.TRUSTED_TYPES_POLICY){if(typeof d0.TRUSTED_TYPES_POLICY.createHTML!=="function")throw Gw('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof d0.TRUSTED_TYPES_POLICY.createScriptURL!=="function")throw Gw('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');V=d0.TRUSTED_TYPES_POLICY,j=V.createHTML("")}else{if(V===void 0)V=YL6(M,K);if(V!==null&&typeof j==="string")j=V.createHTML("")}if(DU)DU(d0);M6=d0},U8=K9({},[...sn,...an,...sO6]),p6=K9({},[...on,...aO6]),u6=function k6(d0){let V6=E(d0);if(!V6||!V6.tagName)V6={namespaceURI:T0,tagName:"template"};let Z8=Gk(d0.tagName),qJ=Gk(V6.tagName);if(!v0[d0.namespaceURI])return!1;if(d0.namespaceURI===L0){if(V6.namespaceURI===I0)return Z8==="svg";if(V6.namespaceURI===d)return Z8==="svg"&&(qJ==="annotation-xml"||u0[qJ]);return Boolean(U8[Z8])}if(d0.namespaceURI===d){if(V6.namespaceURI===I0)return Z8==="math";if(V6.namespaceURI===L0)return Z8==="math"&&G6[qJ];return Boolean(p6[Z8])}if(d0.namespaceURI===I0){if(V6.namespaceURI===L0&&!G6[qJ])return!1;if(V6.namespaceURI===d&&!u0[qJ])return!1;return!p6[Z8]&&(A6[Z8]||!U8[Z8])}if(r6==="application/xhtml+xml"&&v0[d0.namespaceURI])return!0;return!1},S0=function k6(d0){Yw(Q.removed,{element:d0});try{E(d0).removeChild(d0)}catch(V6){I(d0)}},Q6=function k6(d0,V6){try{Yw(Q.removed,{attribute:V6.getAttributeNode(d0),from:V6})}catch(Z8){Yw(Q.removed,{attribute:null,from:V6})}if(V6.removeAttribute(d0),d0==="is")if(J0||z6)try{S0(V6)}catch(Z8){}else try{V6.setAttribute(d0,"")}catch(Z8){}},B6=function k6(d0){let V6=null,Z8=null;if(m0)d0="<remove></remove>"+d0;else{let q8=nn(d0,/^[\r\n\t ]+/);Z8=q8&&q8[0]}if(r6==="application/xhtml+xml"&&T0===I0)d0='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+d0+"</body></html>";let qJ=V?V.createHTML(d0):d0;if(T0===I0)try{V6=new F().parseFromString(qJ,r6)}catch(q8){}if(!V6||!V6.documentElement){V6=T.createDocument(T0,"template",null);try{V6.documentElement.innerHTML=$0?j:qJ}catch(q8){}}let ZJ=V6.body||V6.documentElement;if(d0&&Z8)ZJ.insertBefore(Z.createTextNode(Z8),ZJ.childNodes[0]||null);if(T0===I0)return b.call(V6,P0?"html":"body")[0];return P0?V6.documentElement:ZJ},D0=function k6(d0){return C.call(d0.ownerDocument||d0,d0,W.SHOW_ELEMENT|W.SHOW_COMMENT|W.SHOW_TEXT|W.SHOW_PROCESSING_INSTRUCTION|W.SHOW_CDATA_SECTION,null)},X6=function k6(d0){return d0 instanceof q&&(typeof d0.nodeName!=="string"||typeof d0.textContent!=="string"||typeof d0.removeChild!=="function"||!(d0.attributes instanceof H)||typeof d0.removeAttribute!=="function"||typeof d0.setAttribute!=="function"||typeof d0.namespaceURI!=="string"||typeof d0.insertBefore!=="function"||typeof d0.hasChildNodes!=="function")},W6=function k6(d0){return typeof z==="function"&&d0 instanceof z};function _6(k6,d0,V6){Yk(k6,(Z8)=>{Z8.call(Q,d0,V6,M6)})}let c6=function k6(d0){let V6=null;if(_6(_.beforeSanitizeElements,d0,null),X6(d0))return S0(d0),!0;let Z8=P6(d0.nodeName);if(_6(_.uponSanitizeElement,d0,{tagName:Z8,allowedTags:l}),Y0&&d0.hasChildNodes()&&!W6(d0.firstElementChild)&&NU(/<[/\w!]/g,d0.innerHTML)&&NU(/<[/\w!]/g,d0.textContent))return S0(d0),!0;if(d0.nodeType===Hw.progressingInstruction)return S0(d0),!0;if(Y0&&d0.nodeType===Hw.comment&&NU(/<[/\w]/g,d0.data))return S0(d0),!0;if(!(E0.tagCheck instanceof Function&&E0.tagCheck(Z8))&&(!l[Z8]||O0[Z8])){if(!O0[Z8]&&l6(Z8)){if(U0.tagNameCheck instanceof RegExp&&NU(U0.tagNameCheck,Z8))return!1;if(U0.tagNameCheck instanceof Function&&U0.tagNameCheck(Z8))return!1}if(k0&&!h0[Z8]){let qJ=E(d0)||d0.parentNode,ZJ=N(d0)||d0.childNodes;if(ZJ&&qJ){let q8=ZJ.length;for(let B9=q8-1;B9>=0;--B9){let m9=A(ZJ[B9],!0);m9.__removalCount=(d0.__removalCount||0)+1,qJ.insertBefore(m9,R(d0))}}}return S0(d0),!0}if(d0 instanceof G&&!u6(d0))return S0(d0),!0;if((Z8==="noscript"||Z8==="noembed"||Z8==="noframes")&&NU(/<\/no(script|embed|frames)/i,d0.innerHTML))return S0(d0),!0;if(R0&&d0.nodeType===Hw.text){if(V6=d0.textContent,Yk([S,v,f],(qJ)=>{V6=zw(V6,qJ," ")}),d0.textContent!==V6)Yw(Q.removed,{element:d0.cloneNode()}),d0.textContent=V6}return _6(_.afterSanitizeElements,d0,null),!1},d6=function k6(d0,V6,Z8){if(N0&&(V6==="id"||V6==="name")&&((Z8 in Z)||(Z8 in g6)))return!1;if(q0&&!X0[V6]&&NU(x,V6));else if(W0&&NU(y,V6));else if(E0.attributeCheck instanceof Function&&E0.attributeCheck(V6,d0));else if(!e[V6]||X0[V6])if(l6(d0)&&(U0.tagNameCheck instanceof RegExp&&NU(U0.tagNameCheck,d0)||U0.tagNameCheck instanceof Function&&U0.tagNameCheck(d0))&&(U0.attributeNameCheck instanceof RegExp&&NU(U0.attributeNameCheck,V6)||U0.attributeNameCheck instanceof Function&&U0.attributeNameCheck(V6,d0))||V6==="is"&&U0.allowCustomizedBuiltInElements&&(U0.tagNameCheck instanceof RegExp&&NU(U0.tagNameCheck,Z8)||U0.tagNameCheck instanceof Function&&U0.tagNameCheck(Z8)));else return!1;else if(o[V6]);else if(NU(i,zw(Z8,g,"")));else if((V6==="src"||V6==="xlink:href"||V6==="href")&&d0!=="script"&&dO6(Z8,"data:")===0&&C0[d0]);else if(z0&&!NU(m,zw(Z8,g,"")));else if(Z8)return!1;return!0},l6=function k6(d0){return d0!=="annotation-xml"&&nn(d0,p)},t6=function k6(d0){_6(_.beforeSanitizeAttributes,d0,null);let{attributes:V6}=d0;if(!V6||X6(d0))return;let Z8={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:e,forceKeepAttr:void 0},qJ=V6.length;while(qJ--){let ZJ=V6[qJ],{name:q8,namespaceURI:B9,value:m9}=ZJ,H7=P6(q8),kJ=m9,c0=q8==="value"?kJ:iO6(kJ);if(Z8.attrName=H7,Z8.attrValue=c0,Z8.keepAttr=!0,Z8.forceKeepAttr=void 0,_6(_.uponSanitizeAttribute,d0,Z8),c0=Z8.attrValue,f0&&(H7==="id"||H7==="name"))Q6(q8,d0),c0=l0+c0;if(Y0&&NU(/((--!?|])>)|<\/(style|title|textarea)/i,c0)){Q6(q8,d0);continue}if(H7==="attributename"&&nn(c0,"href")){Q6(q8,d0);continue}if(Z8.forceKeepAttr)continue;if(!Z8.keepAttr){Q6(q8,d0);continue}if(!K0&&NU(/\/>/i,c0)){Q6(q8,d0);continue}if(R0)Yk([S,v,f],(z8)=>{c0=zw(c0,z8," ")});let T6=P6(d0.nodeName);if(!d6(T6,H7,c0)){Q6(q8,d0);continue}if(V&&typeof M==="object"&&typeof M.getAttributeType==="function")if(B9);else switch(M.getAttributeType(T6,H7)){case"TrustedHTML":{c0=V.createHTML(c0);break}case"TrustedScriptURL":{c0=V.createScriptURL(c0);break}}if(c0!==kJ)try{if(B9)d0.setAttributeNS(B9,q8,c0);else d0.setAttribute(q8,c0);if(X6(d0))S0(d0);else mN0(Q.removed)}catch(z8){Q6(q8,d0)}}_6(_.afterSanitizeAttributes,d0,null)},g8=function k6(d0){let V6=null,Z8=D0(d0);_6(_.beforeSanitizeShadowDOM,d0,null);while(V6=Z8.nextNode())if(_6(_.uponSanitizeShadowNode,V6,null),c6(V6),t6(V6),V6.content instanceof X)k6(V6.content);_6(_.afterSanitizeShadowDOM,d0,null)};return Q.sanitize=function(k6){let d0=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},V6=null,Z8=null,qJ=null,ZJ=null;if($0=!k6,$0)k6="<!-->";if(typeof k6!=="string"&&!W6(k6))if(typeof k6.toString==="function"){if(k6=k6.toString(),typeof k6!=="string")throw Gw("dirty is not a string, aborting")}else throw Gw("toString is not a function");if(!Q.isSupported)return k6;if(!F0)a6(d0);if(Q.removed=[],typeof k6==="string")_0=!1;if(_0){if(k6.nodeName){let m9=P6(k6.nodeName);if(!l[m9]||O0[m9])throw Gw("root node is forbidden and cannot be sanitized in-place")}}else if(k6 instanceof z)if(V6=B6("<!---->"),Z8=V6.ownerDocument.importNode(k6,!0),Z8.nodeType===Hw.element&&Z8.nodeName==="BODY")V6=Z8;else if(Z8.nodeName==="HTML")V6=Z8;else V6.appendChild(Z8);else{if(!J0&&!R0&&!P0&&k6.indexOf("<")===-1)return V&&t?V.createHTML(k6):k6;if(V6=B6(k6),!V6)return J0?null:t?j:""}if(V6&&m0)S0(V6.firstChild);let q8=D0(_0?k6:V6);while(qJ=q8.nextNode())if(c6(qJ),t6(qJ),qJ.content instanceof X)g8(qJ.content);if(_0)return k6;if(J0){if(z6){ZJ=$.call(V6.ownerDocument);while(V6.firstChild)ZJ.appendChild(V6.firstChild)}else ZJ=V6;if(e.shadowroot||e.shadowrootmode)ZJ=h.call(U,ZJ,!0);return ZJ}let B9=P0?V6.outerHTML:V6.innerHTML;if(P0&&l["!doctype"]&&V6.ownerDocument&&V6.ownerDocument.doctype&&V6.ownerDocument.doctype.name&&NU(sN0,V6.ownerDocument.doctype.name))B9="<!DOCTYPE "+V6.ownerDocument.doctype.name+`>
|
|
233
|
+
]`).replace("lheading",TN0).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},WO6=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,HO6=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,SN0=/^( {2,}|\\)\n(?!\s*$)/,qO6=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Kk=/[\p{P}\p{S}]/u,ln=/[\s\p{P}\p{S}]/u,$N0=/[^\s\p{P}\p{S}]/u,FO6=_9(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,ln).getRegex(),vN0=/(?!~)[\p{P}\p{S}]/u,BO6=/(?!~)[\s\p{P}\p{S}]/u,MO6=/(?:[^\s\p{P}\p{S}]|~)/u,OO6=_9(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",aM6?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),kN0=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,LO6=_9(kN0,"u").replace(/punct/g,Kk).getRegex(),AO6=_9(kN0,"u").replace(/punct/g,vN0).getRegex(),IO6=_9(fN0,"gu").replace(/notPunctSpace/g,$N0).replace(/punctSpace/g,ln).replace(/punct/g,Kk).getRegex(),RO6=_9(fN0,"gu").replace(/notPunctSpace/g,MO6).replace(/punctSpace/g,BO6).replace(/punct/g,vN0).getRegex(),NO6=_9("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,$N0).replace(/punctSpace/g,ln).replace(/punct/g,Kk).getRegex(),DO6=_9(/\\(punct)/,"gu").replace(/punct/g,Kk).getRegex(),wO6=_9(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),EO6=_9(pn).replace("(?:-->|$)","-->").getRegex(),jO6=_9("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",EO6).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Qk=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,PO6=_9(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",Qk).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),_N0=_9(/^!?\[(label)\]\[(ref)\]/).replace("label",Qk).replace("ref",un).getRegex(),bN0=_9(/^!?\[(ref)\](?:\[\])?/).replace("ref",un).getRegex(),VO6=_9("reflink|nolink(?!\\()","g").replace("reflink",_N0).replace("nolink",bN0).getRegex(),NN0=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,dn={_backpedal:Zw,anyPunctuation:DO6,autolink:wO6,blockSkip:OO6,br:SN0,code:HO6,del:Zw,emStrongLDelim:LO6,emStrongRDelimAst:IO6,emStrongRDelimUnd:NO6,escape:WO6,link:PO6,nolink:bN0,punctuation:FO6,reflink:_N0,reflinkSearch:VO6,tag:jO6,text:qO6,url:Zw},TO6={...dn,link:_9(/^!?\[(label)\]\((.*?)\)/).replace("label",Qk).getRegex(),reflink:_9(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Qk).getRegex()},yn={...dn,emStrongRDelimAst:RO6,emStrongLDelim:AO6,url:_9(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",NN0).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:_9(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",NN0).getRegex()},CO6={...yn,br:_9(SN0).replace("{2,}","*").getRegex(),text:_9(yn.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Jk={normal:cn,gfm:zO6,pedantic:GO6},Jw={normal:dn,gfm:yn,breaks:CO6,pedantic:TO6},SO6={"&":"&","<":"<",">":">",'"':""","'":"'"};xL=class{options;block;constructor(J){this.options=J||nH}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(J){return J}postprocess(J){return J}processAllTokens(J){return J}emStrongMask(J){return J}provideLexer(){return this.block?MX.lex:MX.lexInline}provideParser(){return this.block?OX.parse:OX.parseInline}},dF=new xN0;o9.options=o9.setOptions=function(J){return dF.setOptions(J),o9.defaults=dF.defaults,PN0(o9.defaults),o9};o9.getDefaults=Zk;o9.defaults=nH;o9.use=function(...J){return dF.use(...J),o9.defaults=dF.defaults,PN0(o9.defaults),o9};o9.walkTokens=function(J,Q){return dF.walkTokens(J,Q)};o9.parseInline=dF.parseInline;o9.Parser=OX;o9.parser=OX.parse;o9.Renderer=Kw;o9.TextRenderer=Xk;o9.Lexer=MX;o9.lexer=MX.lex;o9.Tokenizer=Uw;o9.Hooks=xL;o9.parse=o9;kO6=o9.options,fO6=o9.setOptions,_O6=o9.use,bO6=o9.walkTokens,xO6=o9.parseInline,hO6=o9,yO6=OX.parse,gO6=MX.lex});var oN0={};QJ(oN0,{default:()=>$G});function wU(J){return function(Q){if(Q instanceof RegExp)Q.lastIndex=0;for(var Z=arguments.length,U=new Array(Z>1?Z-1:0),K=1;K<Z;K++)U[K-1]=arguments[K];return Js(J,Q,U)}}function rO6(J){return function(){for(var Q=arguments.length,Z=new Array(Q),U=0;U<Q;U++)Z[U]=arguments[U];return Qs(J,Z)}}function K9(J,Q){let Z=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Gk;if(gN0)gN0(J,null);let U=Q.length;while(U--){let K=Q[U];if(typeof K==="string"){let X=Z(K);if(X!==K){if(!mO6(Q))Q[U]=X;K=X}}J[K]=!0}return J}function nO6(J){for(let Q=0;Q<J.length;Q++)if(!E1(J,Q))J[Q]=null;return J}function SG(J){let Q=en(null);for(let[Z,U]of rN0(J))if(E1(J,Z))if(Array.isArray(U))Q[Z]=nO6(U);else if(U&&typeof U==="object"&&U.constructor===Object)Q[Z]=SG(U);else Q[Z]=U;return Q}function Ww(J,Q){while(J!==null){let U=pO6(J,Q);if(U){if(U.get)return wU(U.get);if(typeof U.value==="function")return wU(U.value)}J=uO6(J)}function Z(){return null}return Z}function aN0(){let J=arguments.length>0&&arguments[0]!==void 0?arguments[0]:XL6(),Q=(k6)=>aN0(k6);if(Q.version="3.3.0",Q.removed=[],!J||!J.document||J.document.nodeType!==Hw.document||!J.Element)return Q.isSupported=!1,Q;let{document:Z}=J,U=Z,K=U.currentScript,{DocumentFragment:X,HTMLTemplateElement:Y,Node:z,Element:G,NodeFilter:W,NamedNodeMap:H=J.NamedNodeMap||J.MozNamedAttrMap,HTMLFormElement:q,DOMParser:F,trustedTypes:M}=J,L=G.prototype,A=Ww(L,"cloneNode"),I=Ww(L,"remove"),R=Ww(L,"nextSibling"),N=Ww(L,"childNodes"),E=Ww(L,"parentNode");if(typeof Y==="function"){let k6=Z.createElement("template");if(k6.content&&k6.content.ownerDocument)Z=k6.content.ownerDocument}let V,j="",{implementation:T,createNodeIterator:C,createDocumentFragment:$,getElementsByTagName:b}=Z,{importNode:h}=U,_=iN0();Q.isSupported=typeof rN0==="function"&&typeof E==="function"&&T&&T.createHTMLDocument!==void 0;let{MUSTACHE_EXPR:S,ERB_EXPR:v,TMPLIT_EXPR:f,DATA_ATTR:x,ARIA_ATTR:y,IS_SCRIPT_OR_DATA:m,ATTR_WHITESPACE:g,CUSTOM_ELEMENT:p}=dN0,{IS_ALLOWED_URI:i}=dN0,l=null,a=K9({},[...uN0,...sn,...an,...on,...pN0]),e=null,G0=K9({},[...cN0,...tn,...lN0,...zk]),U0=Object.seal(en(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),O0=null,X0=null,E0=Object.seal(en(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),W0=!0,q0=!0,z0=!1,K0=!0,R0=!1,Y0=!0,P0=!1,F0=!1,m0=!1,J0=!1,z6=!1,t=!1,N0=!0,f0=!1,l0="user-content-",k0=!0,_0=!1,g0={},h0=null,t0=K9({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),C0=null,y0=K9({},["audio","video","img","source","image","track"]),o=null,w0=K9({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),d="http://www.w3.org/1998/Math/MathML",L0="http://www.w3.org/2000/svg",I0="http://www.w3.org/1999/xhtml",T0=I0,$0=!1,v0=null,r0=K9({},[d,L0,I0],rn),u0=K9({},["mi","mo","mn","ms","mtext"]),G6=K9({},["annotation-xml"]),A6=K9({},["title","style","font","a","script"]),r6=null,N6=["application/xhtml+xml","text/html"],F6="text/html",P6=null,M6=null,g6=Z.createElement("form"),O8=function k6(d0){return d0 instanceof RegExp||d0 instanceof Function},a6=function k6(){let d0=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(M6&&M6===d0)return;if(!d0||typeof d0!=="object")d0={};if(d0=SG(d0),r6=N6.indexOf(d0.PARSER_MEDIA_TYPE)===-1?F6:d0.PARSER_MEDIA_TYPE,P6=r6==="application/xhtml+xml"?rn:Gk,l=E1(d0,"ALLOWED_TAGS")?K9({},d0.ALLOWED_TAGS,P6):a,e=E1(d0,"ALLOWED_ATTR")?K9({},d0.ALLOWED_ATTR,P6):G0,v0=E1(d0,"ALLOWED_NAMESPACES")?K9({},d0.ALLOWED_NAMESPACES,rn):r0,o=E1(d0,"ADD_URI_SAFE_ATTR")?K9(SG(w0),d0.ADD_URI_SAFE_ATTR,P6):w0,C0=E1(d0,"ADD_DATA_URI_TAGS")?K9(SG(y0),d0.ADD_DATA_URI_TAGS,P6):y0,h0=E1(d0,"FORBID_CONTENTS")?K9({},d0.FORBID_CONTENTS,P6):t0,O0=E1(d0,"FORBID_TAGS")?K9({},d0.FORBID_TAGS,P6):SG({}),X0=E1(d0,"FORBID_ATTR")?K9({},d0.FORBID_ATTR,P6):SG({}),g0=E1(d0,"USE_PROFILES")?d0.USE_PROFILES:!1,W0=d0.ALLOW_ARIA_ATTR!==!1,q0=d0.ALLOW_DATA_ATTR!==!1,z0=d0.ALLOW_UNKNOWN_PROTOCOLS||!1,K0=d0.ALLOW_SELF_CLOSE_IN_ATTR!==!1,R0=d0.SAFE_FOR_TEMPLATES||!1,Y0=d0.SAFE_FOR_XML!==!1,P0=d0.WHOLE_DOCUMENT||!1,J0=d0.RETURN_DOM||!1,z6=d0.RETURN_DOM_FRAGMENT||!1,t=d0.RETURN_TRUSTED_TYPE||!1,m0=d0.FORCE_BODY||!1,N0=d0.SANITIZE_DOM!==!1,f0=d0.SANITIZE_NAMED_PROPS||!1,k0=d0.KEEP_CONTENT!==!1,_0=d0.IN_PLACE||!1,i=d0.ALLOWED_URI_REGEXP||nN0,T0=d0.NAMESPACE||I0,u0=d0.MATHML_TEXT_INTEGRATION_POINTS||u0,G6=d0.HTML_INTEGRATION_POINTS||G6,U0=d0.CUSTOM_ELEMENT_HANDLING||{},d0.CUSTOM_ELEMENT_HANDLING&&O8(d0.CUSTOM_ELEMENT_HANDLING.tagNameCheck))U0.tagNameCheck=d0.CUSTOM_ELEMENT_HANDLING.tagNameCheck;if(d0.CUSTOM_ELEMENT_HANDLING&&O8(d0.CUSTOM_ELEMENT_HANDLING.attributeNameCheck))U0.attributeNameCheck=d0.CUSTOM_ELEMENT_HANDLING.attributeNameCheck;if(d0.CUSTOM_ELEMENT_HANDLING&&typeof d0.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements==="boolean")U0.allowCustomizedBuiltInElements=d0.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements;if(R0)q0=!1;if(z6)J0=!0;if(g0){if(l=K9({},pN0),e=[],g0.html===!0)K9(l,uN0),K9(e,cN0);if(g0.svg===!0)K9(l,sn),K9(e,tn),K9(e,zk);if(g0.svgFilters===!0)K9(l,an),K9(e,tn),K9(e,zk);if(g0.mathMl===!0)K9(l,on),K9(e,lN0),K9(e,zk)}if(d0.ADD_TAGS)if(typeof d0.ADD_TAGS==="function")E0.tagCheck=d0.ADD_TAGS;else{if(l===a)l=SG(l);K9(l,d0.ADD_TAGS,P6)}if(d0.ADD_ATTR)if(typeof d0.ADD_ATTR==="function")E0.attributeCheck=d0.ADD_ATTR;else{if(e===G0)e=SG(e);K9(e,d0.ADD_ATTR,P6)}if(d0.ADD_URI_SAFE_ATTR)K9(o,d0.ADD_URI_SAFE_ATTR,P6);if(d0.FORBID_CONTENTS){if(h0===t0)h0=SG(h0);K9(h0,d0.FORBID_CONTENTS,P6)}if(k0)l["#text"]=!0;if(P0)K9(l,["html","head","body"]);if(l.table)K9(l,["tbody"]),delete O0.tbody;if(d0.TRUSTED_TYPES_POLICY){if(typeof d0.TRUSTED_TYPES_POLICY.createHTML!=="function")throw Gw('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof d0.TRUSTED_TYPES_POLICY.createScriptURL!=="function")throw Gw('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');V=d0.TRUSTED_TYPES_POLICY,j=V.createHTML("")}else{if(V===void 0)V=YL6(M,K);if(V!==null&&typeof j==="string")j=V.createHTML("")}if(DU)DU(d0);M6=d0},U8=K9({},[...sn,...an,...sO6]),p6=K9({},[...on,...aO6]),u6=function k6(d0){let V6=E(d0);if(!V6||!V6.tagName)V6={namespaceURI:T0,tagName:"template"};let Z8=Gk(d0.tagName),qJ=Gk(V6.tagName);if(!v0[d0.namespaceURI])return!1;if(d0.namespaceURI===L0){if(V6.namespaceURI===I0)return Z8==="svg";if(V6.namespaceURI===d)return Z8==="svg"&&(qJ==="annotation-xml"||u0[qJ]);return Boolean(U8[Z8])}if(d0.namespaceURI===d){if(V6.namespaceURI===I0)return Z8==="math";if(V6.namespaceURI===L0)return Z8==="math"&&G6[qJ];return Boolean(p6[Z8])}if(d0.namespaceURI===I0){if(V6.namespaceURI===L0&&!G6[qJ])return!1;if(V6.namespaceURI===d&&!u0[qJ])return!1;return!p6[Z8]&&(A6[Z8]||!U8[Z8])}if(r6==="application/xhtml+xml"&&v0[d0.namespaceURI])return!0;return!1},S0=function k6(d0){Yw(Q.removed,{element:d0});try{E(d0).removeChild(d0)}catch(V6){I(d0)}},Q6=function k6(d0,V6){try{Yw(Q.removed,{attribute:V6.getAttributeNode(d0),from:V6})}catch(Z8){Yw(Q.removed,{attribute:null,from:V6})}if(V6.removeAttribute(d0),d0==="is")if(J0||z6)try{S0(V6)}catch(Z8){}else try{V6.setAttribute(d0,"")}catch(Z8){}},B6=function k6(d0){let V6=null,Z8=null;if(m0)d0="<remove></remove>"+d0;else{let q8=nn(d0,/^[\r\n\t ]+/);Z8=q8&&q8[0]}if(r6==="application/xhtml+xml"&&T0===I0)d0='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+d0+"</body></html>";let qJ=V?V.createHTML(d0):d0;if(T0===I0)try{V6=new F().parseFromString(qJ,r6)}catch(q8){}if(!V6||!V6.documentElement){V6=T.createDocument(T0,"template",null);try{V6.documentElement.innerHTML=$0?j:qJ}catch(q8){}}let ZJ=V6.body||V6.documentElement;if(d0&&Z8)ZJ.insertBefore(Z.createTextNode(Z8),ZJ.childNodes[0]||null);if(T0===I0)return b.call(V6,P0?"html":"body")[0];return P0?V6.documentElement:ZJ},D0=function k6(d0){return C.call(d0.ownerDocument||d0,d0,W.SHOW_ELEMENT|W.SHOW_COMMENT|W.SHOW_TEXT|W.SHOW_PROCESSING_INSTRUCTION|W.SHOW_CDATA_SECTION,null)},X6=function k6(d0){return d0 instanceof q&&(typeof d0.nodeName!=="string"||typeof d0.textContent!=="string"||typeof d0.removeChild!=="function"||!(d0.attributes instanceof H)||typeof d0.removeAttribute!=="function"||typeof d0.setAttribute!=="function"||typeof d0.namespaceURI!=="string"||typeof d0.insertBefore!=="function"||typeof d0.hasChildNodes!=="function")},W6=function k6(d0){return typeof z==="function"&&d0 instanceof z};function _6(k6,d0,V6){Yk(k6,(Z8)=>{Z8.call(Q,d0,V6,M6)})}let c6=function k6(d0){let V6=null;if(_6(_.beforeSanitizeElements,d0,null),X6(d0))return S0(d0),!0;let Z8=P6(d0.nodeName);if(_6(_.uponSanitizeElement,d0,{tagName:Z8,allowedTags:l}),Y0&&d0.hasChildNodes()&&!W6(d0.firstElementChild)&&NU(/<[/\w!]/g,d0.innerHTML)&&NU(/<[/\w!]/g,d0.textContent))return S0(d0),!0;if(d0.nodeType===Hw.progressingInstruction)return S0(d0),!0;if(Y0&&d0.nodeType===Hw.comment&&NU(/<[/\w]/g,d0.data))return S0(d0),!0;if(!(E0.tagCheck instanceof Function&&E0.tagCheck(Z8))&&(!l[Z8]||O0[Z8])){if(!O0[Z8]&&l6(Z8)){if(U0.tagNameCheck instanceof RegExp&&NU(U0.tagNameCheck,Z8))return!1;if(U0.tagNameCheck instanceof Function&&U0.tagNameCheck(Z8))return!1}if(k0&&!h0[Z8]){let qJ=E(d0)||d0.parentNode,ZJ=N(d0)||d0.childNodes;if(ZJ&&qJ){let q8=ZJ.length;for(let B9=q8-1;B9>=0;--B9){let m9=A(ZJ[B9],!0);m9.__removalCount=(d0.__removalCount||0)+1,qJ.insertBefore(m9,R(d0))}}}return S0(d0),!0}if(d0 instanceof G&&!u6(d0))return S0(d0),!0;if((Z8==="noscript"||Z8==="noembed"||Z8==="noframes")&&NU(/<\/no(script|embed|frames)/i,d0.innerHTML))return S0(d0),!0;if(R0&&d0.nodeType===Hw.text){if(V6=d0.textContent,Yk([S,v,f],(qJ)=>{V6=zw(V6,qJ," ")}),d0.textContent!==V6)Yw(Q.removed,{element:d0.cloneNode()}),d0.textContent=V6}return _6(_.afterSanitizeElements,d0,null),!1},d6=function k6(d0,V6,Z8){if(N0&&(V6==="id"||V6==="name")&&((Z8 in Z)||(Z8 in g6)))return!1;if(q0&&!X0[V6]&&NU(x,V6));else if(W0&&NU(y,V6));else if(E0.attributeCheck instanceof Function&&E0.attributeCheck(V6,d0));else if(!e[V6]||X0[V6])if(l6(d0)&&(U0.tagNameCheck instanceof RegExp&&NU(U0.tagNameCheck,d0)||U0.tagNameCheck instanceof Function&&U0.tagNameCheck(d0))&&(U0.attributeNameCheck instanceof RegExp&&NU(U0.attributeNameCheck,V6)||U0.attributeNameCheck instanceof Function&&U0.attributeNameCheck(V6,d0))||V6==="is"&&U0.allowCustomizedBuiltInElements&&(U0.tagNameCheck instanceof RegExp&&NU(U0.tagNameCheck,Z8)||U0.tagNameCheck instanceof Function&&U0.tagNameCheck(Z8)));else return!1;else if(o[V6]);else if(NU(i,zw(Z8,g,"")));else if((V6==="src"||V6==="xlink:href"||V6==="href")&&d0!=="script"&&dO6(Z8,"data:")===0&&C0[d0]);else if(z0&&!NU(m,zw(Z8,g,"")));else if(Z8)return!1;return!0},l6=function k6(d0){return d0!=="annotation-xml"&&nn(d0,p)},t6=function k6(d0){_6(_.beforeSanitizeAttributes,d0,null);let{attributes:V6}=d0;if(!V6||X6(d0))return;let Z8={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:e,forceKeepAttr:void 0},qJ=V6.length;while(qJ--){let ZJ=V6[qJ],{name:q8,namespaceURI:B9,value:m9}=ZJ,H7=P6(q8),kJ=m9,p0=q8==="value"?kJ:iO6(kJ);if(Z8.attrName=H7,Z8.attrValue=p0,Z8.keepAttr=!0,Z8.forceKeepAttr=void 0,_6(_.uponSanitizeAttribute,d0,Z8),p0=Z8.attrValue,f0&&(H7==="id"||H7==="name"))Q6(q8,d0),p0=l0+p0;if(Y0&&NU(/((--!?|])>)|<\/(style|title|textarea)/i,p0)){Q6(q8,d0);continue}if(H7==="attributename"&&nn(p0,"href")){Q6(q8,d0);continue}if(Z8.forceKeepAttr)continue;if(!Z8.keepAttr){Q6(q8,d0);continue}if(!K0&&NU(/\/>/i,p0)){Q6(q8,d0);continue}if(R0)Yk([S,v,f],(z8)=>{p0=zw(p0,z8," ")});let T6=P6(d0.nodeName);if(!d6(T6,H7,p0)){Q6(q8,d0);continue}if(V&&typeof M==="object"&&typeof M.getAttributeType==="function")if(B9);else switch(M.getAttributeType(T6,H7)){case"TrustedHTML":{p0=V.createHTML(p0);break}case"TrustedScriptURL":{p0=V.createScriptURL(p0);break}}if(p0!==kJ)try{if(B9)d0.setAttributeNS(B9,q8,p0);else d0.setAttribute(q8,p0);if(X6(d0))S0(d0);else mN0(Q.removed)}catch(z8){Q6(q8,d0)}}_6(_.afterSanitizeAttributes,d0,null)},g8=function k6(d0){let V6=null,Z8=D0(d0);_6(_.beforeSanitizeShadowDOM,d0,null);while(V6=Z8.nextNode())if(_6(_.uponSanitizeShadowNode,V6,null),c6(V6),t6(V6),V6.content instanceof X)k6(V6.content);_6(_.afterSanitizeShadowDOM,d0,null)};return Q.sanitize=function(k6){let d0=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},V6=null,Z8=null,qJ=null,ZJ=null;if($0=!k6,$0)k6="<!-->";if(typeof k6!=="string"&&!W6(k6))if(typeof k6.toString==="function"){if(k6=k6.toString(),typeof k6!=="string")throw Gw("dirty is not a string, aborting")}else throw Gw("toString is not a function");if(!Q.isSupported)return k6;if(!F0)a6(d0);if(Q.removed=[],typeof k6==="string")_0=!1;if(_0){if(k6.nodeName){let m9=P6(k6.nodeName);if(!l[m9]||O0[m9])throw Gw("root node is forbidden and cannot be sanitized in-place")}}else if(k6 instanceof z)if(V6=B6("<!---->"),Z8=V6.ownerDocument.importNode(k6,!0),Z8.nodeType===Hw.element&&Z8.nodeName==="BODY")V6=Z8;else if(Z8.nodeName==="HTML")V6=Z8;else V6.appendChild(Z8);else{if(!J0&&!R0&&!P0&&k6.indexOf("<")===-1)return V&&t?V.createHTML(k6):k6;if(V6=B6(k6),!V6)return J0?null:t?j:""}if(V6&&m0)S0(V6.firstChild);let q8=D0(_0?k6:V6);while(qJ=q8.nextNode())if(c6(qJ),t6(qJ),qJ.content instanceof X)g8(qJ.content);if(_0)return k6;if(J0){if(z6){ZJ=$.call(V6.ownerDocument);while(V6.firstChild)ZJ.appendChild(V6.firstChild)}else ZJ=V6;if(e.shadowroot||e.shadowrootmode)ZJ=h.call(U,ZJ,!0);return ZJ}let B9=P0?V6.outerHTML:V6.innerHTML;if(P0&&l["!doctype"]&&V6.ownerDocument&&V6.ownerDocument.doctype&&V6.ownerDocument.doctype.name&&NU(sN0,V6.ownerDocument.doctype.name))B9="<!DOCTYPE "+V6.ownerDocument.doctype.name+`>
|
|
234
234
|
`+B9;if(R0)Yk([S,v,f],(m9)=>{B9=zw(B9,m9," ")});return V&&t?V.createHTML(B9):B9},Q.setConfig=function(){let k6=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};a6(k6),F0=!0},Q.clearConfig=function(){M6=null,F0=!1},Q.isValidAttribute=function(k6,d0,V6){if(!M6)a6({});let Z8=P6(k6),qJ=P6(d0);return d6(Z8,qJ,V6)},Q.addHook=function(k6,d0){if(typeof d0!=="function")return;Yw(_[k6],d0)},Q.removeHook=function(k6,d0){if(d0!==void 0){let V6=cO6(_[k6],d0);return V6===-1?void 0:lO6(_[k6],V6,1)[0]}return mN0(_[k6])},Q.removeHooks=function(k6){_[k6]=[]},Q.removeAllHooks=function(){_=iN0()},Q}var rN0,gN0,mO6,uO6,pO6,DU,LX,en,Js,Qs,Yk,cO6,mN0,Yw,lO6,Gk,rn,nn,zw,dO6,iO6,E1,NU,Gw,uN0,sn,an,sO6,on,aO6,pN0,cN0,tn,lN0,zk,oO6,tO6,eO6,JL6,QL6,nN0,ZL6,UL6,sN0,KL6,dN0,Hw,XL6=function J(){return typeof window==="undefined"?null:window},YL6=function J(Q,Z){if(typeof Q!=="object"||typeof Q.createPolicy!=="function")return null;let U=null,K="data-tt-policy-suffix";if(Z&&Z.hasAttribute(K))U=Z.getAttribute(K);let X="dompurify"+(U?"#"+U:"");try{return Q.createPolicy(X,{createHTML(Y){return Y},createScriptURL(Y){return Y}})}catch(Y){return console.warn("TrustedTypes policy "+X+" could not be created."),null}},iN0=function J(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},$G;var Wk=r(()=>{/*! @license DOMPurify 3.3.0 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.3.0/LICENSE */({entries:rN0,setPrototypeOf:gN0,isFrozen:mO6,getPrototypeOf:uO6,getOwnPropertyDescriptor:pO6}=Object),{freeze:DU,seal:LX,create:en}=Object,{apply:Js,construct:Qs}=typeof Reflect!=="undefined"&&Reflect;if(!DU)DU=function J(Q){return Q};if(!LX)LX=function J(Q){return Q};if(!Js)Js=function J(Q,Z){for(var U=arguments.length,K=new Array(U>2?U-2:0),X=2;X<U;X++)K[X-2]=arguments[X];return Q.apply(Z,K)};if(!Qs)Qs=function J(Q){for(var Z=arguments.length,U=new Array(Z>1?Z-1:0),K=1;K<Z;K++)U[K-1]=arguments[K];return new Q(...U)};Yk=wU(Array.prototype.forEach),cO6=wU(Array.prototype.lastIndexOf),mN0=wU(Array.prototype.pop),Yw=wU(Array.prototype.push),lO6=wU(Array.prototype.splice),Gk=wU(String.prototype.toLowerCase),rn=wU(String.prototype.toString),nn=wU(String.prototype.match),zw=wU(String.prototype.replace),dO6=wU(String.prototype.indexOf),iO6=wU(String.prototype.trim),E1=wU(Object.prototype.hasOwnProperty),NU=wU(RegExp.prototype.test),Gw=rO6(TypeError);uN0=DU(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),sn=DU(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),an=DU(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),sO6=DU(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),on=DU(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),aO6=DU(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),pN0=DU(["#text"]),cN0=DU(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),tn=DU(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),lN0=DU(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),zk=DU(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),oO6=LX(/\{\{[\w\W]*|[\w\W]*\}\}/gm),tO6=LX(/<%[\w\W]*|[\w\W]*%>/gm),eO6=LX(/\$\{[\w\W]*/gm),JL6=LX(/^data-[\-\w.\u00B7-\uFFFF]+$/),QL6=LX(/^aria-[\-\w]+$/),nN0=LX(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),ZL6=LX(/^(?:\w+script|data):/i),UL6=LX(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),sN0=LX(/^html$/i),KL6=LX(/^[a-z][.\w]*(-[.\w]+)+$/i),dN0=Object.freeze({__proto__:null,ARIA_ATTR:QL6,ATTR_WHITESPACE:UL6,CUSTOM_ELEMENT:KL6,DATA_ATTR:JL6,DOCTYPE_NAME:sN0,ERB_EXPR:tO6,IS_ALLOWED_URI:nN0,IS_SCRIPT_OR_DATA:ZL6,MUSTACHE_EXPR:oO6,TMPLIT_EXPR:eO6}),Hw={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12};$G=aN0()});var qw;var Zs=r(()=>{qw={name:"mermaid",version:"11.12.1",description:"Markdown-ish syntax for generating flowcharts, mindmaps, sequence diagrams, class diagrams, gantt charts, git graphs and more.",type:"module",module:"./dist/mermaid.core.mjs",types:"./dist/mermaid.d.ts",exports:{".":{types:"./dist/mermaid.d.ts",import:"./dist/mermaid.core.mjs",default:"./dist/mermaid.core.mjs"},"./*":"./*"},keywords:["diagram","markdown","flowchart","sequence diagram","gantt","class diagram","git graph","mindmap","packet diagram","c4 diagram","er diagram","pie chart","pie diagram","quadrant chart","requirement diagram","graph"],scripts:{clean:"rimraf dist",dev:"pnpm -w dev","docs:code":"typedoc src/defaultConfig.ts src/config.ts src/mermaid.ts && prettier --write ./src/docs/config/setup","docs:build":"rimraf ../../docs && pnpm docs:code && pnpm docs:spellcheck && tsx scripts/docs.cli.mts","docs:verify":"pnpm docs:code && pnpm docs:spellcheck && tsx scripts/docs.cli.mts --verify","docs:pre:vitepress":"pnpm --filter ./src/docs prefetch && rimraf src/vitepress && pnpm docs:code && tsx scripts/docs.cli.mts --vitepress && pnpm --filter ./src/vitepress install --no-frozen-lockfile --ignore-scripts","docs:build:vitepress":"pnpm docs:pre:vitepress && (cd src/vitepress && pnpm run build) && cpy --flat src/docs/landing/ ./src/vitepress/.vitepress/dist/landing","docs:dev":'pnpm docs:pre:vitepress && concurrently "pnpm --filter ./src/vitepress dev" "tsx scripts/docs.cli.mts --watch --vitepress"',"docs:dev:docker":'pnpm docs:pre:vitepress && concurrently "pnpm --filter ./src/vitepress dev:docker" "tsx scripts/docs.cli.mts --watch --vitepress"',"docs:serve":"pnpm docs:build:vitepress && vitepress serve src/vitepress","docs:spellcheck":'cspell "src/docs/**/*.md"',"docs:release-version":"tsx scripts/update-release-version.mts","docs:verify-version":"tsx scripts/update-release-version.mts --verify","types:build-config":"tsx scripts/create-types-from-json-schema.mts","types:verify-config":"tsx scripts/create-types-from-json-schema.mts --verify",checkCircle:"npx madge --circular ./src",prepublishOnly:"pnpm docs:verify-version"},repository:{type:"git",url:"https://github.com/mermaid-js/mermaid"},author:"Knut Sveidqvist",license:"MIT",standard:{ignore:["**/parser/*.js","dist/**/*.js","cypress/**/*.js"],globals:["page"]},dependencies:{"@braintree/sanitize-url":"^7.1.1","@iconify/utils":"^3.0.1","@mermaid-js/parser":"workspace:^","@types/d3":"^7.4.3",cytoscape:"^3.29.3","cytoscape-cose-bilkent":"^4.1.0","cytoscape-fcose":"^2.2.0",d3:"^7.9.0","d3-sankey":"^0.12.3","dagre-d3-es":"7.0.13",dayjs:"^1.11.18",dompurify:"^3.2.5",katex:"^0.16.22",khroma:"^2.1.0","lodash-es":"^4.17.21",marked:"^16.2.1",roughjs:"^4.6.6",stylis:"^4.3.6","ts-dedent":"^2.2.0",uuid:"^11.1.0"},devDependencies:{"@adobe/jsonschema2md":"^8.0.5","@iconify/types":"^2.0.0","@types/cytoscape":"^3.21.9","@types/cytoscape-fcose":"^2.2.4","@types/d3-sankey":"^0.12.4","@types/d3-scale":"^4.0.9","@types/d3-scale-chromatic":"^3.1.0","@types/d3-selection":"^3.0.11","@types/d3-shape":"^3.1.7","@types/jsdom":"^21.1.7","@types/katex":"^0.16.7","@types/lodash-es":"^4.17.12","@types/micromatch":"^4.0.9","@types/stylis":"^4.2.7","@types/uuid":"^10.0.0",ajv:"^8.17.1",canvas:"^3.1.2",chokidar:"3.6.0",concurrently:"^9.1.2","csstree-validator":"^4.0.1",globby:"^14.1.0",jison:"^0.4.18","js-base64":"^3.7.8",jsdom:"^26.1.0","json-schema-to-typescript":"^15.0.4",micromatch:"^4.0.8","path-browserify":"^1.0.1",prettier:"^3.5.3",remark:"^15.0.1","remark-frontmatter":"^5.0.0","remark-gfm":"^4.0.1",rimraf:"^6.0.1","start-server-and-test":"^2.0.13","type-fest":"^4.35.0",typedoc:"^0.28.12","typedoc-plugin-markdown":"^4.8.1",typescript:"~5.7.3","unist-util-flatmap":"^1.0.0","unist-util-visit":"^5.0.0",vitepress:"^1.6.4","vitepress-plugin-search":"1.0.4-alpha.22"},files:["dist/","README.md"],publishConfig:{access:"public"}}});var Hk=F4((Us,Ks)=>{(function(J,Q){typeof Us=="object"&&typeof Ks!="undefined"?Ks.exports=Q():typeof define=="function"&&define.amd?define(Q):(J=typeof globalThis!="undefined"?globalThis:J||self).dayjs=Q()})(Us,function(){var J=1000,Q=60000,Z=3600000,U="millisecond",K="second",X="minute",Y="hour",z="day",G="week",W="month",H="quarter",q="year",F="date",M="Invalid Date",L=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,A=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,I={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(S){var v=["th","st","nd","rd"],f=S%100;return"["+S+(v[(f-20)%10]||v[f]||v[0])+"]"}},R=function(S,v,f){var x=String(S);return!x||x.length>=v?S:""+Array(v+1-x.length).join(f)+S},N={s:R,z:function(S){var v=-S.utcOffset(),f=Math.abs(v),x=Math.floor(f/60),y=f%60;return(v<=0?"+":"-")+R(x,2,"0")+":"+R(y,2,"0")},m:function S(v,f){if(v.date()<f.date())return-S(f,v);var x=12*(f.year()-v.year())+(f.month()-v.month()),y=v.clone().add(x,W),m=f-y<0,g=v.clone().add(x+(m?-1:1),W);return+(-(x+(f-y)/(m?y-g:g-y))||0)},a:function(S){return S<0?Math.ceil(S)||0:Math.floor(S)},p:function(S){return{M:W,y:q,w:G,d:z,D:F,h:Y,m:X,s:K,ms:U,Q:H}[S]||String(S||"").toLowerCase().replace(/s$/,"")},u:function(S){return S===void 0}},E="en",V={};V[E]=I;var j="$isDayjsObject",T=function(S){return S instanceof h||!(!S||!S[j])},C=function S(v,f,x){var y;if(!v)return E;if(typeof v=="string"){var m=v.toLowerCase();V[m]&&(y=m),f&&(V[m]=f,y=m);var g=v.split("-");if(!y&&g.length>1)return S(g[0])}else{var p=v.name;V[p]=v,y=p}return!x&&y&&(E=y),y||!x&&E},$=function(S,v){if(T(S))return S.clone();var f=typeof v=="object"?v:{};return f.date=S,f.args=arguments,new h(f)},b=N;b.l=C,b.i=T,b.w=function(S,v){return $(S,{locale:v.$L,utc:v.$u,x:v.$x,$offset:v.$offset})};var h=function(){function S(f){this.$L=C(f.locale,null,!0),this.parse(f),this.$x=this.$x||f.x||{},this[j]=!0}var v=S.prototype;return v.parse=function(f){this.$d=function(x){var{date:y,utc:m}=x;if(y===null)return new Date(NaN);if(b.u(y))return new Date;if(y instanceof Date)return new Date(y);if(typeof y=="string"&&!/Z$/i.test(y)){var g=y.match(L);if(g){var p=g[2]-1||0,i=(g[7]||"0").substring(0,3);return m?new Date(Date.UTC(g[1],p,g[3]||1,g[4]||0,g[5]||0,g[6]||0,i)):new Date(g[1],p,g[3]||1,g[4]||0,g[5]||0,g[6]||0,i)}}return new Date(y)}(f),this.init()},v.init=function(){var f=this.$d;this.$y=f.getFullYear(),this.$M=f.getMonth(),this.$D=f.getDate(),this.$W=f.getDay(),this.$H=f.getHours(),this.$m=f.getMinutes(),this.$s=f.getSeconds(),this.$ms=f.getMilliseconds()},v.$utils=function(){return b},v.isValid=function(){return this.$d.toString()!==M},v.isSame=function(f,x){var y=$(f);return this.startOf(x)<=y&&y<=this.endOf(x)},v.isAfter=function(f,x){return $(f)<this.startOf(x)},v.isBefore=function(f,x){return this.endOf(x)<$(f)},v.$g=function(f,x,y){return b.u(f)?this[x]:this.set(y,f)},v.unix=function(){return Math.floor(this.valueOf()/1000)},v.valueOf=function(){return this.$d.getTime()},v.startOf=function(f,x){var y=this,m=!!b.u(x)||x,g=b.p(f),p=function(X0,E0){var W0=b.w(y.$u?Date.UTC(y.$y,E0,X0):new Date(y.$y,E0,X0),y);return m?W0:W0.endOf(z)},i=function(X0,E0){return b.w(y.toDate()[X0].apply(y.toDate("s"),(m?[0,0,0,0]:[23,59,59,999]).slice(E0)),y)},l=this.$W,a=this.$M,e=this.$D,G0="set"+(this.$u?"UTC":"");switch(g){case q:return m?p(1,0):p(31,11);case W:return m?p(1,a):p(0,a+1);case G:var U0=this.$locale().weekStart||0,O0=(l<U0?l+7:l)-U0;return p(m?e-O0:e+(6-O0),a);case z:case F:return i(G0+"Hours",0);case Y:return i(G0+"Minutes",1);case X:return i(G0+"Seconds",2);case K:return i(G0+"Milliseconds",3);default:return this.clone()}},v.endOf=function(f){return this.startOf(f,!1)},v.$set=function(f,x){var y,m=b.p(f),g="set"+(this.$u?"UTC":""),p=(y={},y[z]=g+"Date",y[F]=g+"Date",y[W]=g+"Month",y[q]=g+"FullYear",y[Y]=g+"Hours",y[X]=g+"Minutes",y[K]=g+"Seconds",y[U]=g+"Milliseconds",y)[m],i=m===z?this.$D+(x-this.$W):x;if(m===W||m===q){var l=this.clone().set(F,1);l.$d[p](i),l.init(),this.$d=l.set(F,Math.min(this.$D,l.daysInMonth())).$d}else p&&this.$d[p](i);return this.init(),this},v.set=function(f,x){return this.clone().$set(f,x)},v.get=function(f){return this[b.p(f)]()},v.add=function(f,x){var y,m=this;f=Number(f);var g=b.p(x),p=function(a){var e=$(m);return b.w(e.date(e.date()+Math.round(a*f)),m)};if(g===W)return this.set(W,this.$M+f);if(g===q)return this.set(q,this.$y+f);if(g===z)return p(1);if(g===G)return p(7);var i=(y={},y[X]=Q,y[Y]=Z,y[K]=J,y)[g]||1,l=this.$d.getTime()+f*i;return b.w(l,this)},v.subtract=function(f,x){return this.add(-1*f,x)},v.format=function(f){var x=this,y=this.$locale();if(!this.isValid())return y.invalidDate||M;var m=f||"YYYY-MM-DDTHH:mm:ssZ",g=b.z(this),p=this.$H,i=this.$m,l=this.$M,a=y.weekdays,e=y.months,G0=y.meridiem,U0=function(E0,W0,q0,z0){return E0&&(E0[W0]||E0(x,m))||q0[W0].slice(0,z0)},O0=function(E0){return b.s(p%12||12,E0,"0")},X0=G0||function(E0,W0,q0){var z0=E0<12?"AM":"PM";return q0?z0.toLowerCase():z0};return m.replace(A,function(E0,W0){return W0||function(q0){switch(q0){case"YY":return String(x.$y).slice(-2);case"YYYY":return b.s(x.$y,4,"0");case"M":return l+1;case"MM":return b.s(l+1,2,"0");case"MMM":return U0(y.monthsShort,l,e,3);case"MMMM":return U0(e,l);case"D":return x.$D;case"DD":return b.s(x.$D,2,"0");case"d":return String(x.$W);case"dd":return U0(y.weekdaysMin,x.$W,a,2);case"ddd":return U0(y.weekdaysShort,x.$W,a,3);case"dddd":return a[x.$W];case"H":return String(p);case"HH":return b.s(p,2,"0");case"h":return O0(1);case"hh":return O0(2);case"a":return X0(p,i,!0);case"A":return X0(p,i,!1);case"m":return String(i);case"mm":return b.s(i,2,"0");case"s":return String(x.$s);case"ss":return b.s(x.$s,2,"0");case"SSS":return b.s(x.$ms,3,"0");case"Z":return g}return null}(E0)||g.replace(":","")})},v.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},v.diff=function(f,x,y){var m,g=this,p=b.p(x),i=$(f),l=(i.utcOffset()-this.utcOffset())*Q,a=this-i,e=function(){return b.m(g,i)};switch(p){case q:m=e()/12;break;case W:m=e();break;case H:m=e()/3;break;case G:m=(a-l)/604800000;break;case z:m=(a-l)/86400000;break;case Y:m=a/Z;break;case X:m=a/Q;break;case K:m=a/J;break;default:m=a}return y?m:b.a(m)},v.daysInMonth=function(){return this.endOf(W).$D},v.$locale=function(){return V[this.$L]},v.locale=function(f,x){if(!f)return this.$L;var y=this.clone(),m=C(f,x,!0);return m&&(y.$L=m),y},v.clone=function(){return b.w(this.$d,this)},v.toDate=function(){return new Date(this.valueOf())},v.toJSON=function(){return this.isValid()?this.toISOString():null},v.toISOString=function(){return this.$d.toISOString()},v.toString=function(){return this.$d.toUTCString()},S}(),_=h.prototype;return $.prototype=_,[["$ms",U],["$s",K],["$m",X],["$H",Y],["$W",z],["$M",W],["$y",q],["$D",F]].forEach(function(S){_[S[1]]=function(v){return this.$g(v,S[0],S[1])}}),$.extend=function(S,v){return S.$i||(S(v,h,$),S.$i=!0),$},$.locale=C,$.isDayjs=T,$.unix=function(S){return $(1000*S)},$.en=V[E],$.Ls=V,$.p={},$})});var eN0,tN0,w=(J,Q)=>tN0(J,"name",{value:Q,configurable:!0}),sH=(J,Q)=>{for(var Z in Q)tN0(J,Z,{get:Q[Z],enumerable:!0})},vG,B0,Fw,AX;var NJ=r(()=>{eN0=J6(Hk(),1),tN0=Object.defineProperty,vG={trace:0,debug:1,info:2,warn:3,error:4,fatal:5},B0={trace:w((...J)=>{},"trace"),debug:w((...J)=>{},"debug"),info:w((...J)=>{},"info"),warn:w((...J)=>{},"warn"),error:w((...J)=>{},"error"),fatal:w((...J)=>{},"fatal")},Fw=w(function(J="fatal"){let Q=vG.fatal;if(typeof J==="string"){if(J.toLowerCase()in vG)Q=vG[J]}else if(typeof J==="number")Q=J;if(B0.trace=()=>{},B0.debug=()=>{},B0.info=()=>{},B0.warn=()=>{},B0.error=()=>{},B0.fatal=()=>{},Q<=vG.fatal)B0.fatal=console.error?console.error.bind(console,AX("FATAL"),"color: orange"):console.log.bind(console,"\x1B[35m",AX("FATAL"));if(Q<=vG.error)B0.error=console.error?console.error.bind(console,AX("ERROR"),"color: orange"):console.log.bind(console,"\x1B[31m",AX("ERROR"));if(Q<=vG.warn)B0.warn=console.warn?console.warn.bind(console,AX("WARN"),"color: orange"):console.log.bind(console,"\x1B[33m",AX("WARN"));if(Q<=vG.info)B0.info=console.info?console.info.bind(console,AX("INFO"),"color: lightblue"):console.log.bind(console,"\x1B[34m",AX("INFO"));if(Q<=vG.debug)B0.debug=console.debug?console.debug.bind(console,AX("DEBUG"),"color: lightgreen"):console.log.bind(console,"\x1B[32m",AX("DEBUG"));if(Q<=vG.trace)B0.trace=console.debug?console.debug.bind(console,AX("TRACE"),"color: lightgreen"):console.log.bind(console,"\x1B[32m",AX("TRACE"))},"setLogLevel"),AX=w((J)=>{return`%c${eN0.default().format("ss.SSS")} : ${J} : `},"format")});var qk,JD0;var QD0=r(()=>{qk={min:{r:0,g:0,b:0,s:0,l:0,a:0},max:{r:255,g:255,b:255,h:360,s:100,l:100,a:1},clamp:{r:(J)=>J>=255?255:J<0?0:J,g:(J)=>J>=255?255:J<0?0:J,b:(J)=>J>=255?255:J<0?0:J,h:(J)=>J%360,s:(J)=>J>=100?100:J<0?0:J,l:(J)=>J>=100?100:J<0?0:J,a:(J)=>J>=1?1:J<0?0:J},toLinear:(J)=>{let Q=J/255;return J>0.03928?Math.pow((Q+0.055)/1.055,2.4):Q/12.92},hue2rgb:(J,Q,Z)=>{if(Z<0)Z+=1;if(Z>1)Z-=1;if(Z<0.16666666666666666)return J+(Q-J)*6*Z;if(Z<0.5)return Q;if(Z<0.6666666666666666)return J+(Q-J)*(0.6666666666666666-Z)*6;return J},hsl2rgb:({h:J,s:Q,l:Z},U)=>{if(!Q)return Z*2.55;J/=360,Q/=100,Z/=100;let K=Z<0.5?Z*(1+Q):Z+Q-Z*Q,X=2*Z-K;switch(U){case"r":return qk.hue2rgb(X,K,J+0.3333333333333333)*255;case"g":return qk.hue2rgb(X,K,J)*255;case"b":return qk.hue2rgb(X,K,J-0.3333333333333333)*255}},rgb2hsl:({r:J,g:Q,b:Z},U)=>{J/=255,Q/=255,Z/=255;let K=Math.max(J,Q,Z),X=Math.min(J,Q,Z),Y=(K+X)/2;if(U==="l")return Y*100;if(K===X)return 0;let z=K-X,G=Y>0.5?z/(2-K-X):z/(K+X);if(U==="s")return G*100;switch(K){case J:return((Q-Z)/z+(Q<Z?6:0))*60;case Q:return((Z-J)/z+2)*60;case Z:return((J-Q)/z+4)*60;default:return-1}}},JD0=qk});var zL6,ZD0;var UD0=r(()=>{zL6={clamp:(J,Q,Z)=>{if(Q>Z)return Math.min(Q,Math.max(Z,J));return Math.min(Z,Math.max(Q,J))},round:(J)=>{return Math.round(J*10000000000)/10000000000}},ZD0=zL6});var GL6,KD0;var XD0=r(()=>{GL6={dec2hex:(J)=>{let Q=Math.round(J).toString(16);return Q.length>1?Q:`0${Q}`}},KD0=GL6});var WL6,t8;var uY=r(()=>{QD0();UD0();XD0();WL6={channel:JD0,lang:ZD0,unit:KD0},t8=WL6});var kG,NQ;var Bw=r(()=>{uY();kG={};for(let J=0;J<=255;J++)kG[J]=t8.unit.dec2hex(J);NQ={ALL:0,RGB:1,HSL:2}});class YD0{constructor(){this.type=NQ.ALL}get(){return this.type}set(J){if(this.type&&this.type!==J)throw new Error("Cannot change both RGB and HSL channels at the same time");this.type=J}reset(){this.type=NQ.ALL}is(J){return this.type===J}}var zD0;var GD0=r(()=>{Bw();zD0=YD0});class WD0{constructor(J,Q){this.color=Q,this.changed=!1,this.data=J,this.type=new zD0}set(J,Q){return this.color=Q,this.changed=!1,this.data=J,this.type.type=NQ.ALL,this}_ensureHSL(){let J=this.data,{h:Q,s:Z,l:U}=J;if(Q===void 0)J.h=t8.channel.rgb2hsl(J,"h");if(Z===void 0)J.s=t8.channel.rgb2hsl(J,"s");if(U===void 0)J.l=t8.channel.rgb2hsl(J,"l")}_ensureRGB(){let J=this.data,{r:Q,g:Z,b:U}=J;if(Q===void 0)J.r=t8.channel.hsl2rgb(J,"r");if(Z===void 0)J.g=t8.channel.hsl2rgb(J,"g");if(U===void 0)J.b=t8.channel.hsl2rgb(J,"b")}get r(){let J=this.data,Q=J.r;if(!this.type.is(NQ.HSL)&&Q!==void 0)return Q;return this._ensureHSL(),t8.channel.hsl2rgb(J,"r")}get g(){let J=this.data,Q=J.g;if(!this.type.is(NQ.HSL)&&Q!==void 0)return Q;return this._ensureHSL(),t8.channel.hsl2rgb(J,"g")}get b(){let J=this.data,Q=J.b;if(!this.type.is(NQ.HSL)&&Q!==void 0)return Q;return this._ensureHSL(),t8.channel.hsl2rgb(J,"b")}get h(){let J=this.data,Q=J.h;if(!this.type.is(NQ.RGB)&&Q!==void 0)return Q;return this._ensureRGB(),t8.channel.rgb2hsl(J,"h")}get s(){let J=this.data,Q=J.s;if(!this.type.is(NQ.RGB)&&Q!==void 0)return Q;return this._ensureRGB(),t8.channel.rgb2hsl(J,"s")}get l(){let J=this.data,Q=J.l;if(!this.type.is(NQ.RGB)&&Q!==void 0)return Q;return this._ensureRGB(),t8.channel.rgb2hsl(J,"l")}get a(){return this.data.a}set r(J){this.type.set(NQ.RGB),this.changed=!0,this.data.r=J}set g(J){this.type.set(NQ.RGB),this.changed=!0,this.data.g=J}set b(J){this.type.set(NQ.RGB),this.changed=!0,this.data.b=J}set h(J){this.type.set(NQ.HSL),this.changed=!0,this.data.h=J}set s(J){this.type.set(NQ.HSL),this.changed=!0,this.data.s=J}set l(J){this.type.set(NQ.HSL),this.changed=!0,this.data.l=J}set a(J){this.changed=!0,this.data.a=J}}var HD0;var qD0=r(()=>{uY();GD0();Bw();HD0=WD0});var HL6,aH;var Mw=r(()=>{qD0();HL6=new HD0({r:0,g:0,b:0,a:0},"transparent"),aH=HL6});var FD0,iF;var Xs=r(()=>{Mw();Bw();FD0={re:/^#((?:[a-f0-9]{2}){2,4}|[a-f0-9]{3})$/i,parse:(J)=>{if(J.charCodeAt(0)!==35)return;let Q=J.match(FD0.re);if(!Q)return;let Z=Q[1],U=parseInt(Z,16),K=Z.length,X=K%4===0,Y=K>4,z=Y?1:17,G=Y?8:4,W=X?0:-1,H=Y?255:15;return aH.set({r:(U>>G*(W+3)&H)*z,g:(U>>G*(W+2)&H)*z,b:(U>>G*(W+1)&H)*z,a:X?(U&H)*z/255:1},J)},stringify:(J)=>{let{r:Q,g:Z,b:U,a:K}=J;if(K<1)return`#${kG[Math.round(Q)]}${kG[Math.round(Z)]}${kG[Math.round(U)]}${kG[Math.round(K*255)]}`;else return`#${kG[Math.round(Q)]}${kG[Math.round(Z)]}${kG[Math.round(U)]}`}},iF=FD0});var Fk,Ow;var BD0=r(()=>{uY();Mw();Fk={re:/^hsla?\(\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?(?:deg|grad|rad|turn)?)\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?%)\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?%)(?:\s*?(?:,|\/)\s*?\+?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?(%)?))?\s*?\)$/i,hueRe:/^(.+?)(deg|grad|rad|turn)$/i,_hue2deg:(J)=>{let Q=J.match(Fk.hueRe);if(Q){let[,Z,U]=Q;switch(U){case"grad":return t8.channel.clamp.h(parseFloat(Z)*0.9);case"rad":return t8.channel.clamp.h(parseFloat(Z)*180/Math.PI);case"turn":return t8.channel.clamp.h(parseFloat(Z)*360)}}return t8.channel.clamp.h(parseFloat(J))},parse:(J)=>{let Q=J.charCodeAt(0);if(Q!==104&&Q!==72)return;let Z=J.match(Fk.re);if(!Z)return;let[,U,K,X,Y,z]=Z;return aH.set({h:Fk._hue2deg(U),s:t8.channel.clamp.s(parseFloat(K)),l:t8.channel.clamp.l(parseFloat(X)),a:Y?t8.channel.clamp.a(z?parseFloat(Y)/100:parseFloat(Y)):1},J)},stringify:(J)=>{let{h:Q,s:Z,l:U,a:K}=J;if(K<1)return`hsla(${t8.lang.round(Q)}, ${t8.lang.round(Z)}%, ${t8.lang.round(U)}%, ${K})`;else return`hsl(${t8.lang.round(Q)}, ${t8.lang.round(Z)}%, ${t8.lang.round(U)}%)`}},Ow=Fk});var Bk,Ys;var MD0=r(()=>{Xs();Bk={colors:{aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyanaqua:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",transparent:"#00000000",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},parse:(J)=>{J=J.toLowerCase();let Q=Bk.colors[J];if(!Q)return;return iF.parse(Q)},stringify:(J)=>{let Q=iF.stringify(J);for(let Z in Bk.colors)if(Bk.colors[Z]===Q)return Z;return}},Ys=Bk});var OD0,Lw;var LD0=r(()=>{uY();Mw();OD0={re:/^rgba?\(\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))(?:\s*?(?:,|\/)\s*?\+?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?)))?\s*?\)$/i,parse:(J)=>{let Q=J.charCodeAt(0);if(Q!==114&&Q!==82)return;let Z=J.match(OD0.re);if(!Z)return;let[,U,K,X,Y,z,G,W,H]=Z;return aH.set({r:t8.channel.clamp.r(K?parseFloat(U)*2.55:parseFloat(U)),g:t8.channel.clamp.g(Y?parseFloat(X)*2.55:parseFloat(X)),b:t8.channel.clamp.b(G?parseFloat(z)*2.55:parseFloat(z)),a:W?t8.channel.clamp.a(H?parseFloat(W)/100:parseFloat(W)):1},J)},stringify:(J)=>{let{r:Q,g:Z,b:U,a:K}=J;if(K<1)return`rgba(${t8.lang.round(Q)}, ${t8.lang.round(Z)}, ${t8.lang.round(U)}, ${t8.lang.round(K)})`;else return`rgb(${t8.lang.round(Q)}, ${t8.lang.round(Z)}, ${t8.lang.round(U)})`}},Lw=OD0});var qL6,DQ;var fG=r(()=>{Xs();BD0();MD0();LD0();Bw();qL6={format:{keyword:Ys,hex:iF,rgb:Lw,rgba:Lw,hsl:Ow,hsla:Ow},parse:(J)=>{if(typeof J!=="string")return J;let Q=iF.parse(J)||Lw.parse(J)||Ow.parse(J)||Ys.parse(J);if(Q)return Q;throw new Error(`Unsupported color format: "${J}"`)},stringify:(J)=>{if(!J.changed&&J.color)return J.color;if(J.type.is(NQ.HSL)||J.data.r===void 0)return Ow.stringify(J);else if(J.a<1||!Number.isInteger(J.r)||!Number.isInteger(J.g)||!Number.isInteger(J.b))return Lw.stringify(J);else return iF.stringify(J)}},DQ=qL6});var FL6=(J,Q)=>{let Z=DQ.parse(J);for(let U in Q)Z[U]=t8.channel.clamp[U](Q[U]);return DQ.stringify(Z)},Mk;var zs=r(()=>{uY();fG();Mk=FL6});var BL6=(J,Q,Z=0,U=1)=>{if(typeof J!=="number")return Mk(J,{a:Q});let K=aH.set({r:t8.channel.clamp.r(J),g:t8.channel.clamp.g(Q),b:t8.channel.clamp.b(Z),a:t8.channel.clamp.a(U)});return DQ.stringify(K)},EU;var Gs=r(()=>{uY();Mw();fG();zs();EU=BL6});var ML6=(J,Q)=>{return t8.lang.round(DQ.parse(J)[Q])},rF;var AD0=r(()=>{uY();fG();rF=ML6});var OL6=(J)=>{let{r:Q,g:Z,b:U}=DQ.parse(J),K=0.2126*t8.channel.toLinear(Q)+0.7152*t8.channel.toLinear(Z)+0.0722*t8.channel.toLinear(U);return t8.lang.round(K)},ID0;var RD0=r(()=>{uY();fG();ID0=OL6});var LL6=(J)=>{return ID0(J)>=0.5},ND0;var DD0=r(()=>{RD0();ND0=LL6});var AL6=(J)=>{return!ND0(J)},RZ;var wD0=r(()=>{DD0();RZ=AL6});var IL6=(J,Q,Z)=>{let U=DQ.parse(J),K=U[Q],X=t8.channel.clamp[Q](K+Z);if(K!==X)U[Q]=X;return DQ.stringify(U)},Ok;var Ws=r(()=>{uY();fG();Ok=IL6});var RL6=(J,Q)=>{return Ok(J,"l",Q)},w8;var ED0=r(()=>{Ws();w8=RL6});var NL6=(J,Q)=>{return Ok(J,"l",-Q)},b8;var jD0=r(()=>{Ws();b8=NL6});var DL6=(J,Q)=>{let Z=DQ.parse(J),U={};for(let K in Q){if(!Q[K])continue;U[K]=Z[K]+Q[K]}return Mk(J,U)},H6;var PD0=r(()=>{fG();zs();H6=DL6});var wL6=(J,Q,Z=50)=>{let{r:U,g:K,b:X,a:Y}=DQ.parse(J),{r:z,g:G,b:W,a:H}=DQ.parse(Q),q=Z/100,F=q*2-1,M=Y-H,A=((F*M===-1?F:(F+M)/(1+F*M))+1)/2,I=1-A,R=U*A+z*I,N=K*A+G*I,E=X*A+W*I,V=Y*q+H*(1-q);return EU(R,N,E,V)},VD0;var TD0=r(()=>{fG();Gs();VD0=wL6});var EL6=(J,Q=100)=>{let Z=DQ.parse(J);return Z.r=255-Z.r,Z.g=255-Z.g,Z.b=255-Z.b,VD0(Z,J,Q)},B8;var CD0=r(()=>{fG();TD0();B8=EL6});var SD0=r(()=>{Gs();AD0();wD0();ED0();jD0();PD0();CD0()});var LK=r(()=>{SD0()});var qE0={};QJ(qE0,{version:()=>WE0,renderToString:()=>XE0,render:()=>ns,default:()=>B36,__setFontMetrics:()=>Ww0,__renderToHTMLTree:()=>GE0,__renderToDomTree:()=>uk,__parse:()=>YE0,__domTree:()=>HE0,__defineSymbol:()=>s,__defineMacro:()=>V0,__defineFunction:()=>P8,SETTINGS_SCHEMA:()=>ww,ParseError:()=>X8});class j5{constructor(J,Q,Z){this.lexer=void 0,this.start=void 0,this.end=void 0,this.lexer=J,this.start=Q,this.end=Z}static range(J,Q){if(!Q)return J&&J.loc;else if(!J||!J.loc||!Q.loc||J.loc.lexer!==Q.loc.lexer)return null;else return new j5(J.loc.lexer,J.loc.start,Q.loc.end)}}class AK{constructor(J,Q){this.text=void 0,this.loc=void 0,this.noexpand=void 0,this.treatAsRelax=void 0,this.text=J,this.loc=Q}range(J,Q){return new AK(Q,j5.range(this,J))}}class X8{constructor(J,Q){this.name=void 0,this.position=void 0,this.length=void 0,this.rawMessage=void 0;var Z="KaTeX parse error: "+J,U,K,X=Q&&Q.loc;if(X&&X.start<=X.end){var Y=X.lexer.input;if(U=X.start,K=X.end,U===Y.length)Z+=" at end of input: ";else Z+=" at position "+(U+1)+": ";var z=Y.slice(U,K).replace(/[^]/g,"$&̲"),G;if(U>15)G="…"+Y.slice(U-15,U);else G=Y.slice(0,U);var W;if(K+15<Y.length)W=Y.slice(K,K+15)+"…";else W=Y.slice(K);Z+=G+z+W}var H=new Error(Z);if(H.name="ParseError",H.__proto__=X8.prototype,H.position=U,U!=null&&K!=null)H.length=K-U;return H.rawMessage=J,H}}function SL6(J){return String(J).replace(CL6,(Q)=>TL6[Q])}function fL6(J){if(J.default)return J.default;var Q=J.type,Z=Array.isArray(Q)?Q[0]:Q;if(typeof Z!=="string")return Z.enum[0];switch(Z){case"boolean":return!1;case"string":return"";case"number":return 0;case"object":return{}}}class kk{constructor(J){this.displayMode=void 0,this.output=void 0,this.leqno=void 0,this.fleqn=void 0,this.throwOnError=void 0,this.errorColor=void 0,this.macros=void 0,this.minRuleThickness=void 0,this.colorIsTextColor=void 0,this.strict=void 0,this.trust=void 0,this.maxSize=void 0,this.maxExpand=void 0,this.globalGroup=void 0,J=J||{};for(var Q in ww)if(ww.hasOwnProperty(Q)){var Z=ww[Q];this[Q]=J[Q]!==void 0?Z.processor?Z.processor(J[Q]):J[Q]:fL6(Z)}}reportNonstrict(J,Q,Z){var U=this.strict;if(typeof U==="function")U=U(J,Q,Z);if(!U||U==="ignore")return;else if(U===!0||U==="error")throw new X8("LaTeX-incompatible input and strict mode is set to 'error': "+(Q+" ["+J+"]"),Z);else if(U==="warn")typeof console!=="undefined"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(Q+" ["+J+"]"));else typeof console!=="undefined"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+U+"': "+Q+" ["+J+"]"))}useStrictBehavior(J,Q,Z){var U=this.strict;if(typeof U==="function")try{U=U(J,Q,Z)}catch(K){U="error"}if(!U||U==="ignore")return!1;else if(U===!0||U==="error")return!0;else if(U==="warn")return typeof console!=="undefined"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(Q+" ["+J+"]")),!1;else return typeof console!=="undefined"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+U+"': "+Q+" ["+J+"]")),!1}isTrusted(J){if(J.url&&!J.protocol){var Q=b9.protocolFromUrl(J.url);if(Q==null)return!1;J.protocol=Q}var Z=typeof this.trust==="function"?this.trust(J):this.trust;return Boolean(Z)}}class bG{constructor(J,Q,Z){this.id=void 0,this.size=void 0,this.cramped=void 0,this.id=J,this.size=Q,this.cramped=Z}sup(){return cY[_L6[this.id]]}sub(){return cY[bL6[this.id]]}fracNum(){return cY[xL6[this.id]]}fracDen(){return cY[hL6[this.id]]}cramp(){return cY[yL6[this.id]]}text(){return cY[gL6[this.id]]}isTight(){return this.size>=2}}function mL6(J){for(var Q=0;Q<ws.length;Q++){var Z=ws[Q];for(var U=0;U<Z.blocks.length;U++){var K=Z.blocks[U];if(J>=K[0]&&J<=K[1])return Z.name}}return null}function Gw0(J){for(var Q=0;Q<Ek.length;Q+=2)if(J>=Ek[Q]&&J<=Ek[Q+1])return!0;return!1}class pL{constructor(J){this.children=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.children=J,this.classes=[],this.height=0,this.depth=0,this.maxFontSize=0,this.style={}}hasClass(J){return this.classes.includes(J)}toNode(){var J=document.createDocumentFragment();for(var Q=0;Q<this.children.length;Q++)J.appendChild(this.children[Q].toNode());return J}toMarkup(){var J="";for(var Q=0;Q<this.children.length;Q++)J+=this.children[Q].toMarkup();return J}toText(){var J=(Q)=>Q.toText();return this.children.map(J).join("")}}function Ww0(J,Q){lY[J]=Q}function ks(J,Q,Z){if(!lY[Q])throw new Error("Font metrics not found for font: "+Q+".");var U=J.charCodeAt(0),K=lY[Q][U];if(!K&&J[0]in vD0)U=vD0[J[0]].charCodeAt(0),K=lY[Q][U];if(!K&&Z==="text"){if(Gw0(U))K=lY[Q][77]}if(K)return{depth:K[0],height:K[1],italic:K[2],skew:K[3],width:K[4]}}function oL6(J){var Q;if(J>=5)Q=0;else if(J>=3)Q=1;else Q=2;if(!qs[Q]){var Z=qs[Q]={cssEmPerMu:Lk.quad[Q]/18};for(var U in Lk)if(Lk.hasOwnProperty(U))Z[U]=Lk[U][Q]}return qs[Q]}class hG{constructor(J){this.style=void 0,this.color=void 0,this.size=void 0,this.textSize=void 0,this.phantom=void 0,this.font=void 0,this.fontFamily=void 0,this.fontWeight=void 0,this.fontShape=void 0,this.sizeMultiplier=void 0,this.maxSize=void 0,this.minRuleThickness=void 0,this._fontMetrics=void 0,this.style=J.style,this.color=J.color,this.size=J.size||hG.BASESIZE,this.textSize=J.textSize||this.size,this.phantom=!!J.phantom,this.font=J.font||"",this.fontFamily=J.fontFamily||"",this.fontWeight=J.fontWeight||"",this.fontShape=J.fontShape||"",this.sizeMultiplier=kD0[this.size-1],this.maxSize=J.maxSize,this.minRuleThickness=J.minRuleThickness,this._fontMetrics=void 0}extend(J){var Q={style:this.style,size:this.size,textSize:this.textSize,color:this.color,phantom:this.phantom,font:this.font,fontFamily:this.fontFamily,fontWeight:this.fontWeight,fontShape:this.fontShape,maxSize:this.maxSize,minRuleThickness:this.minRuleThickness};for(var Z in J)if(J.hasOwnProperty(Z))Q[Z]=J[Z];return new hG(Q)}havingStyle(J){if(this.style===J)return this;else return this.extend({style:J,size:fD0(this.textSize,J)})}havingCrampedStyle(){return this.havingStyle(this.style.cramp())}havingSize(J){if(this.size===J&&this.textSize===J)return this;else return this.extend({style:this.style.text(),size:J,textSize:J,sizeMultiplier:kD0[J-1]})}havingBaseStyle(J){J=J||this.style.text();var Q=fD0(hG.BASESIZE,J);if(this.size===Q&&this.textSize===hG.BASESIZE&&this.style===J)return this;else return this.extend({style:J,size:Q})}havingBaseSizing(){var J;switch(this.style.id){case 4:case 5:J=3;break;case 6:case 7:J=1;break;default:J=6}return this.extend({style:this.style.text(),size:J})}withColor(J){return this.extend({color:J})}withPhantom(){return this.extend({phantom:!0})}withFont(J){return this.extend({font:J})}withTextFontFamily(J){return this.extend({fontFamily:J,font:""})}withTextFontWeight(J){return this.extend({fontWeight:J,font:""})}withTextFontShape(J){return this.extend({fontShape:J,font:""})}sizingClasses(J){if(J.size!==this.size)return["sizing","reset-size"+J.size,"size"+this.size];else return[]}baseSizingClasses(){if(this.size!==hG.BASESIZE)return["sizing","reset-size"+this.size,"size"+hG.BASESIZE];else return[]}fontMetrics(){if(!this._fontMetrics)this._fontMetrics=oL6(this.size);return this._fontMetrics}getColor(){if(this.phantom)return"transparent";else return this.color}}class cL{constructor(J,Q,Z,U){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.width=void 0,this.maxFontSize=void 0,this.style=void 0,qw0.call(this,J,Z,U),this.children=Q||[]}setAttribute(J,Q){this.attributes[J]=Q}hasClass(J){return this.classes.includes(J)}toNode(){return Fw0.call(this,"span")}toMarkup(){return Bw0.call(this,"span")}}class fk{constructor(J,Q,Z,U){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,qw0.call(this,Q,U),this.children=Z||[],this.setAttribute("href",J)}setAttribute(J,Q){this.attributes[J]=Q}hasClass(J){return this.classes.includes(J)}toNode(){return Fw0.call(this,"a")}toMarkup(){return Bw0.call(this,"a")}}class Mw0{constructor(J,Q,Z){this.src=void 0,this.alt=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.alt=Q,this.src=J,this.classes=["mord"],this.style=Z}hasClass(J){return this.classes.includes(J)}toNode(){var J=document.createElement("img");J.src=this.src,J.alt=this.alt,J.className="mord";for(var Q in this.style)if(this.style.hasOwnProperty(Q))J.style[Q]=this.style[Q];return J}toMarkup(){var J='<img src="'+b9.escape(this.src)+'"'+(' alt="'+b9.escape(this.alt)+'"'),Q="";for(var Z in this.style)if(this.style.hasOwnProperty(Z))Q+=b9.hyphenate(Z)+":"+this.style[Z]+";";if(Q)J+=' style="'+b9.escape(Q)+'"';return J+="'/>",J}}class IK{constructor(J,Q,Z,U,K,X,Y,z){this.text=void 0,this.height=void 0,this.depth=void 0,this.italic=void 0,this.skew=void 0,this.width=void 0,this.maxFontSize=void 0,this.classes=void 0,this.style=void 0,this.text=J,this.height=Q||0,this.depth=Z||0,this.italic=U||0,this.skew=K||0,this.width=X||0,this.classes=Y||[],this.style=z||{},this.maxFontSize=0;var G=mL6(this.text.charCodeAt(0));if(G)this.classes.push(G+"_fallback");if(/[îïíì]/.test(this.text))this.text=QA6[this.text]}hasClass(J){return this.classes.includes(J)}toNode(){var J=document.createTextNode(this.text),Q=null;if(this.italic>0)Q=document.createElement("span"),Q.style.marginRight=M8(this.italic);if(this.classes.length>0)Q=Q||document.createElement("span"),Q.className=tH(this.classes);for(var Z in this.style)if(this.style.hasOwnProperty(Z))Q=Q||document.createElement("span"),Q.style[Z]=this.style[Z];if(Q)return Q.appendChild(J),Q;else return J}toMarkup(){var J=!1,Q="<span";if(this.classes.length)J=!0,Q+=' class="',Q+=b9.escape(tH(this.classes)),Q+='"';var Z="";if(this.italic>0)Z+="margin-right:"+this.italic+"em;";for(var U in this.style)if(this.style.hasOwnProperty(U))Z+=b9.hyphenate(U)+":"+this.style[U]+";";if(Z)J=!0,Q+=' style="'+b9.escape(Z)+'"';var K=b9.escape(this.text);if(J)return Q+=">",Q+=K,Q+="</span>",Q;else return K}}class dY{constructor(J,Q){this.children=void 0,this.attributes=void 0,this.children=J||[],this.attributes=Q||{}}toNode(){var J="http://www.w3.org/2000/svg",Q=document.createElementNS(J,"svg");for(var Z in this.attributes)if(Object.prototype.hasOwnProperty.call(this.attributes,Z))Q.setAttribute(Z,this.attributes[Z]);for(var U=0;U<this.children.length;U++)Q.appendChild(this.children[U].toNode());return Q}toMarkup(){var J='<svg xmlns="http://www.w3.org/2000/svg"';for(var Q in this.attributes)if(Object.prototype.hasOwnProperty.call(this.attributes,Q))J+=" "+Q+'="'+b9.escape(this.attributes[Q])+'"';J+=">";for(var Z=0;Z<this.children.length;Z++)J+=this.children[Z].toMarkup();return J+="</svg>",J}}class mG{constructor(J,Q){this.pathName=void 0,this.alternate=void 0,this.pathName=J,this.alternate=Q}toNode(){var J="http://www.w3.org/2000/svg",Q=document.createElementNS(J,"path");if(this.alternate)Q.setAttribute("d",this.alternate);else Q.setAttribute("d",$D0[this.pathName]);return Q}toMarkup(){if(this.alternate)return'<path d="'+b9.escape(this.alternate)+'"/>';else return'<path d="'+b9.escape($D0[this.pathName])+'"/>'}}class Tk{constructor(J){this.attributes=void 0,this.attributes=J||{}}toNode(){var J="http://www.w3.org/2000/svg",Q=document.createElementNS(J,"line");for(var Z in this.attributes)if(Object.prototype.hasOwnProperty.call(this.attributes,Z))Q.setAttribute(Z,this.attributes[Z]);return Q}toMarkup(){var J="<line";for(var Q in this.attributes)if(Object.prototype.hasOwnProperty.call(this.attributes,Q))J+=" "+Q+'="'+b9.escape(this.attributes[Q])+'"';return J+="/>",J}}function _D0(J){if(J instanceof IK)return J;else throw new Error("Expected symbolNode but got "+String(J)+".")}function ZA6(J){if(J instanceof cL)return J;else throw new Error("Expected span<HtmlDomNode> but got "+String(J)+".")}function s(J,Q,Z,U,K,X){if(v7[J][K]={font:Q,group:Z,replace:U},X&&U)v7[J][U]=v7[J][K]}function P8(J){var{type:Q,names:Z,props:U,handler:K,htmlBuilder:X,mathmlBuilder:Y}=J,z={type:Q,numArgs:U.numArgs,argTypes:U.argTypes,allowedInArgument:!!U.allowedInArgument,allowedInText:!!U.allowedInText,allowedInMath:U.allowedInMath===void 0?!0:U.allowedInMath,numOptionalArgs:U.numOptionalArgs||0,infix:!!U.infix,primitive:!!U.primitive,handler:K};for(var G=0;G<Z.length;++G)Nw0[Z[G]]=z;if(Q){if(X)Sk[Q]=X;if(Y)$k[Q]=Y}}function sF(J){var{type:Q,htmlBuilder:Z,mathmlBuilder:U}=J;P8({type:Q,names:[],props:{numArgs:0},handler(){throw new Error("Should never be called.")},htmlBuilder:Z,mathmlBuilder:U})}function Rk(J,Q){var Z=uG(["base"],J,Q),U=uG(["strut"]);if(U.style.height=M8(Z.height+Z.depth),Z.depth)U.style.verticalAlign=M8(-Z.depth);return Z.children.unshift(U),Z}function Vs(J,Q){var Z=null;if(J.length===1&&J[0].type==="tag")Z=J[0].tag,J=J[0].body;var U=wQ(J,Q,"root"),K;if(U.length===2&&U[1].hasClass("tag"))K=U.pop();var X=[],Y=[];for(var z=0;z<U.length;z++)if(Y.push(U[z]),U[z].hasClass("mbin")||U[z].hasClass("mrel")||U[z].hasClass("allowbreak")){var G=!1;while(z<U.length-1&&U[z+1].hasClass("mspace")&&!U[z+1].hasClass("newline"))if(z++,Y.push(U[z]),U[z].hasClass("nobreak"))G=!0;if(!G)X.push(Rk(Y,Q)),Y=[]}else if(U[z].hasClass("newline")){if(Y.pop(),Y.length>0)X.push(Rk(Y,Q)),Y=[];X.push(U[z])}if(Y.length>0)X.push(Rk(Y,Q));var W;if(Z)W=Rk(wQ(Z,Q,!0)),W.classes=["tag"],X.push(W);else if(K)X.push(K);var H=uG(["katex-html"],X);if(H.setAttribute("aria-hidden","true"),W){var q=W.children[0];if(q.style.height=M8(H.height+H.depth),H.depth)q.style.verticalAlign=M8(-H.depth)}return H}function ww0(J){return new pL(J)}class P5{constructor(J,Q,Z){this.type=void 0,this.attributes=void 0,this.children=void 0,this.classes=void 0,this.type=J,this.attributes={},this.children=Q||[],this.classes=Z||[]}setAttribute(J,Q){this.attributes[J]=Q}getAttribute(J){return this.attributes[J]}toNode(){var J=document.createElementNS("http://www.w3.org/1998/Math/MathML",this.type);for(var Q in this.attributes)if(Object.prototype.hasOwnProperty.call(this.attributes,Q))J.setAttribute(Q,this.attributes[Q]);if(this.classes.length>0)J.className=tH(this.classes);for(var Z=0;Z<this.children.length;Z++)if(this.children[Z]instanceof P1&&this.children[Z+1]instanceof P1){var U=this.children[Z].toText()+this.children[++Z].toText();while(this.children[Z+1]instanceof P1)U+=this.children[++Z].toText();J.appendChild(new P1(U).toNode())}else J.appendChild(this.children[Z].toNode());return J}toMarkup(){var J="<"+this.type;for(var Q in this.attributes)if(Object.prototype.hasOwnProperty.call(this.attributes,Q))J+=" "+Q+'="',J+=b9.escape(this.attributes[Q]),J+='"';if(this.classes.length>0)J+=' class ="'+b9.escape(tH(this.classes))+'"';J+=">";for(var Z=0;Z<this.children.length;Z++)J+=this.children[Z].toMarkup();return J+="</"+this.type+">",J}toText(){return this.children.map((J)=>J.toText()).join("")}}class P1{constructor(J){this.text=void 0,this.text=J}toNode(){return document.createTextNode(this.text)}toMarkup(){return b9.escape(this.toText())}toText(){return this.text}}class Ew0{constructor(J){if(this.width=void 0,this.character=void 0,this.width=J,J>=0.05555&&J<=0.05556)this.character=" ";else if(J>=0.1666&&J<=0.1667)this.character=" ";else if(J>=0.2222&&J<=0.2223)this.character=" ";else if(J>=0.2777&&J<=0.2778)this.character=" ";else if(J>=-0.05556&&J<=-0.05555)this.character=" ";else if(J>=-0.1667&&J<=-0.1666)this.character=" ";else if(J>=-0.2223&&J<=-0.2222)this.character=" ";else if(J>=-0.2778&&J<=-0.2777)this.character=" ";else this.character=null}toNode(){if(this.character)return document.createTextNode(this.character);else{var J=document.createElementNS("http://www.w3.org/1998/Math/MathML","mspace");return J.setAttribute("width",M8(this.width)),J}}toMarkup(){if(this.character)return"<mtext>"+this.character+"</mtext>";else return'<mspace width="'+M8(this.width)+'"/>'}toText(){if(this.character)return this.character;else return" "}}function Fs(J){if(!J)return!1;if(J.type==="mi"&&J.children.length===1){var Q=J.children[0];return Q instanceof P1&&Q.text==="."}else if(J.type==="mo"&&J.children.length===1&&J.getAttribute("separator")==="true"&&J.getAttribute("lspace")==="0em"&&J.getAttribute("rspace")==="0em"){var Z=J.children[0];return Z instanceof P1&&Z.text===","}else return!1}function gD0(J,Q,Z,U,K){var X=V5(J,Z),Y;if(X.length===1&&X[0]instanceof P5&&["mrow","mtable"].includes(X[0].type))Y=X[0];else Y=new K8.MathNode("mrow",X);var z=new K8.MathNode("annotation",[new K8.TextNode(Q)]);z.setAttribute("encoding","application/x-tex");var G=new K8.MathNode("semantics",[Y,z]),W=new K8.MathNode("math",[G]);if(W.setAttribute("xmlns","http://www.w3.org/1998/Math/MathML"),U)W.setAttribute("display","block");var H=K?"katex":"katex-mathml";return I6.makeSpan([H],[W])}function gJ(J,Q){if(!J||J.type!==Q)throw new Error("Expected node of type "+Q+", but got "+(J?"node of type "+J.type:String(J)));return J}function xs(J){var Q=xk(J);if(!Q)throw new Error("Expected node of symbol group type, but got "+(J?"node of type "+J.type:String(J)));return Q}function xk(J){if(J&&(J.type==="atom"||KA6.hasOwnProperty(J.type)))return J;return null}function Tw0(J,Q){var Z=wQ(J.body,Q,!0);return _A6([J.mclass],Z,Q)}function Cw0(J,Q){var Z,U=V5(J.body,Q);if(J.mclass==="minner")Z=new K8.MathNode("mpadded",U);else if(J.mclass==="mord")if(J.isCharacterBox)Z=U[0],Z.type="mi";else Z=new K8.MathNode("mi",U);else{if(J.isCharacterBox)Z=U[0],Z.type="mo";else Z=new K8.MathNode("mo",U);if(J.mclass==="mbin")Z.attributes.lspace="0.22em",Z.attributes.rspace="0.22em";else if(J.mclass==="mpunct")Z.attributes.lspace="0em",Z.attributes.rspace="0.17em";else if(J.mclass==="mopen"||J.mclass==="mclose")Z.attributes.lspace="0em",Z.attributes.rspace="0em";else if(J.mclass==="minner")Z.attributes.lspace="0.0556em",Z.attributes.width="+0.1111em"}return Z}function hA6(J,Q,Z){var U=bA6[J];switch(U){case"\\\\cdrightarrow":case"\\\\cdleftarrow":return Z.callFunction(U,[Q[0]],[Q[1]]);case"\\uparrow":case"\\downarrow":{var K=Z.callFunction("\\\\cdleft",[Q[0]],[]),X={type:"atom",text:U,mode:"math",family:"rel"},Y=Z.callFunction("\\Big",[X],[]),z=Z.callFunction("\\\\cdright",[Q[1]],[]),G={type:"ordgroup",mode:"math",body:[K,Y,z]};return Z.callFunction("\\\\cdparent",[G],[])}case"\\\\cdlongequal":return Z.callFunction("\\\\cdlongequal",[],[]);case"\\Vert":{var W={type:"textord",text:"\\Vert",mode:"math"};return Z.callFunction("\\Big",[W],[])}default:return{type:"textord",text:" ",mode:"math"}}}function yA6(J){var Q=[];J.gullet.beginGroup(),J.gullet.macros.set("\\cr","\\\\\\relax"),J.gullet.beginGroup();while(!0){Q.push(J.parseExpression(!1,"\\\\")),J.gullet.endGroup(),J.gullet.beginGroup();var Z=J.fetch().text;if(Z==="&"||Z==="\\\\")J.consume();else if(Z==="\\end"){if(Q[Q.length-1].length===0)Q.pop();break}else throw new X8("Expected \\\\ or \\cr or \\end",J.nextToken)}var U=[],K=[U];for(var X=0;X<Q.length;X++){var Y=Q[X],z=mD0();for(var G=0;G<Y.length;G++)if(!uD0(Y[G]))z.body.push(Y[G]);else{U.push(z),G+=1;var W=xs(Y[G]).text,H=new Array(2);if(H[0]={type:"ordgroup",mode:"math",body:[]},H[1]={type:"ordgroup",mode:"math",body:[]},"=|.".indexOf(W)>-1);else if("<>AV".indexOf(W)>-1)for(var q=0;q<2;q++){var F=!0;for(var M=G+1;M<Y.length;M++){if(xA6(Y[M],W)){F=!1,G=M;break}if(uD0(Y[M]))throw new X8("Missing a "+W+" character to complete a CD arrow.",Y[M]);H[q].body.push(Y[M])}if(F)throw new X8("Missing a "+W+" character to complete a CD arrow.",Y[G])}else throw new X8('Expected one of "<>AV=|." after @',Y[G]);var L=hA6(W,H,J),A={type:"styling",body:[L],mode:"math",style:"display"};U.push(A),z=mD0()}if(X%2===0)U.push(z);else U.shift();U=[],K.push(U)}J.gullet.endGroup(),J.gullet.endGroup();var I=new Array(K[0].length).fill({type:"align",align:"c",pregap:0.25,postgap:0.25});return{type:"array",mode:"math",body:K,arraystretch:1,addJot:!0,rowGaps:[null],cols:I,colSeparationType:"CD",hLinesBeforeRow:new Array(K.length+1).fill([])}}function yk(J,Q){var Z=xk(J);if(Z&&oA6.includes(Z.text))return Z;else if(Z)throw new X8("Invalid delimiter '"+Z.text+"' after '"+Q.funcName+"'",J);else throw new X8("Invalid delimiter type '"+J.type+"'",J)}function cD0(J){if(!J.body)throw new Error("Bug: The leftright ParseNode wasn't fully parsed.")}function iY(J){var{type:Q,names:Z,props:U,handler:K,htmlBuilder:X,mathmlBuilder:Y}=J,z={type:Q,numArgs:U.numArgs||0,allowedInText:!1,numOptionalArgs:0,handler:K};for(var G=0;G<Z.length;++G)uw0[Z[G]]=z;if(X)Sk[Q]=X;if(Y)$k[Q]=Y}function V0(J,Q){pw0[J]=Q}function lD0(J){var Q=[];J.consumeSpaces();var Z=J.fetch().text;if(Z==="\\relax")J.consume(),J.consumeSpaces(),Z=J.fetch().text;while(Z==="\\hline"||Z==="\\hdashline")J.consume(),Q.push(Z==="\\hdashline"),J.consumeSpaces(),Z=J.fetch().text;return Q}function us(J){if(J.indexOf("ed")===-1)return J.indexOf("*")===-1}function Jq(J,Q,Z){var{hskipBeforeAndAfter:U,addJot:K,cols:X,arraystretch:Y,colSeparationType:z,autoTag:G,singleRow:W,emptySingleRow:H,maxNumCols:q,leqno:F}=Q;if(J.gullet.beginGroup(),!W)J.gullet.macros.set("\\cr","\\\\\\relax");if(!Y){var M=J.gullet.expandMacroAsText("\\arraystretch");if(M==null)Y=1;else if(Y=parseFloat(M),!Y||Y<0)throw new X8("Invalid \\arraystretch: "+M)}J.gullet.beginGroup();var L=[],A=[L],I=[],R=[],N=G!=null?[]:void 0;function E(){if(G)J.gullet.macros.set("\\@eqnsw","1",!0)}function V(){if(N)if(J.gullet.macros.get("\\df@tag"))N.push(J.subparse([new AK("\\df@tag")])),J.gullet.macros.set("\\df@tag",void 0,!0);else N.push(Boolean(G)&&J.gullet.macros.get("\\@eqnsw")==="1")}E(),R.push(lD0(J));while(!0){var j=J.parseExpression(!1,W?"\\end":"\\\\");if(J.gullet.endGroup(),J.gullet.beginGroup(),j={type:"ordgroup",mode:J.mode,body:j},Z)j={type:"styling",mode:J.mode,style:Z,body:[j]};L.push(j);var T=J.fetch().text;if(T==="&"){if(q&&L.length===q)if(W||z)throw new X8("Too many tab characters: &",J.nextToken);else J.settings.reportNonstrict("textEnv","Too few columns specified in the {array} column argument.");J.consume()}else if(T==="\\end"){if(V(),L.length===1&&j.type==="styling"&&j.body[0].body.length===0&&(A.length>1||!H))A.pop();if(R.length<A.length+1)R.push([]);break}else if(T==="\\\\"){J.consume();var C=void 0;if(J.gullet.future().text!==" ")C=J.parseSizeGroup(!0);I.push(C?C.value:null),V(),R.push(lD0(J)),L=[],A.push(L),E()}else throw new X8("Expected & or \\\\ or \\cr or \\end",J.nextToken)}return J.gullet.endGroup(),J.gullet.endGroup(),{type:"array",mode:J.mode,addJot:K,arraystretch:Y,body:A,cols:X,rowGaps:I,hskipBeforeAndAfter:U,hLinesBeforeRow:R,colSeparationType:z,tags:N,leqno:F}}function ps(J){if(J.slice(0,1)==="d")return"display";else return"text"}function ow0(J,Q,Z){var U=wQ(J,Q,!1),K=Q.sizeMultiplier/Z.sizeMultiplier;for(var X=0;X<U.length;X++){var Y=U[X].classes.indexOf("sizing");if(Y<0)Array.prototype.push.apply(U[X].classes,Q.sizingClasses(Z));else if(U[X].classes[Y+1]==="reset-size"+Q.size)U[X].classes[Y+1]="reset-size"+Z.size;U[X].height*=K,U[X].depth*=K}return I6.makeFragment(U)}class $s{constructor(J,Q){this.input=void 0,this.settings=void 0,this.tokenRegex=void 0,this.catcodes=void 0,this.input=J,this.settings=Q,this.tokenRegex=new RegExp(q36,"g"),this.catcodes={"%":14,"~":13}}setCatcode(J,Q){this.catcodes[J]=Q}lex(){var J=this.input,Q=this.tokenRegex.lastIndex;if(Q===J.length)return new AK("EOF",new j5(this,Q,Q));var Z=this.tokenRegex.exec(J);if(Z===null||Z.index!==Q)throw new X8("Unexpected character: '"+J[Q]+"'",new AK(J[Q],new j5(this,Q,Q+1)));var U=Z[6]||Z[3]||(Z[2]?"\\ ":" ");if(this.catcodes[U]===14){var K=J.indexOf(`
|
|
235
235
|
`,this.tokenRegex.lastIndex);if(K===-1)this.tokenRegex.lastIndex=J.length,this.settings.reportNonstrict("commentAtEnd","% comment has no terminating newline; LaTeX would fail because of commenting the end of math mode (e.g. $)");else this.tokenRegex.lastIndex=K+1;return this.lex()}return new AK(U,new j5(this,Q,this.tokenRegex.lastIndex))}}class JE0{constructor(J,Q){if(J===void 0)J={};if(Q===void 0)Q={};this.current=void 0,this.builtins=void 0,this.undefStack=void 0,this.current=Q,this.builtins=J,this.undefStack=[]}beginGroup(){this.undefStack.push({})}endGroup(){if(this.undefStack.length===0)throw new X8("Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug");var J=this.undefStack.pop();for(var Q in J)if(J.hasOwnProperty(Q))if(J[Q]==null)delete this.current[Q];else this.current[Q]=J[Q]}endGroups(){while(this.undefStack.length>0)this.endGroup()}has(J){return this.current.hasOwnProperty(J)||this.builtins.hasOwnProperty(J)}get(J){if(this.current.hasOwnProperty(J))return this.current[J];else return this.builtins[J]}set(J,Q,Z){if(Z===void 0)Z=!1;if(Z){for(var U=0;U<this.undefStack.length;U++)delete this.undefStack[U][J];if(this.undefStack.length>0)this.undefStack[this.undefStack.length-1][J]=Q}else{var K=this.undefStack[this.undefStack.length-1];if(K&&!K.hasOwnProperty(J))K[J]=this.current[J]}if(Q==null)delete this.current[J];else this.current[J]=Q}}class KE0{constructor(J,Q,Z){this.settings=void 0,this.expansionCount=void 0,this.lexer=void 0,this.macros=void 0,this.stack=void 0,this.mode=void 0,this.settings=Q,this.expansionCount=0,this.feed(J),this.macros=new JE0(F36,Q.macros),this.mode=Z,this.stack=[]}feed(J){this.lexer=new $s(J,this.settings)}switchMode(J){this.mode=J}beginGroup(){this.macros.beginGroup()}endGroup(){this.macros.endGroup()}endGroups(){this.macros.endGroups()}future(){if(this.stack.length===0)this.pushToken(this.lexer.lex());return this.stack[this.stack.length-1]}popToken(){return this.future(),this.stack.pop()}pushToken(J){this.stack.push(J)}pushTokens(J){this.stack.push(...J)}scanArgument(J){var Q,Z,U;if(J){if(this.consumeSpaces(),this.future().text!=="[")return null;Q=this.popToken(),{tokens:U,end:Z}=this.consumeArg(["]"])}else({tokens:U,start:Q,end:Z}=this.consumeArg());return this.pushToken(new AK("EOF",Z.loc)),this.pushTokens(U),new AK("",j5.range(Q,Z))}consumeSpaces(){for(;;){var J=this.future();if(J.text===" ")this.stack.pop();else break}}consumeArg(J){var Q=[],Z=J&&J.length>0;if(!Z)this.consumeSpaces();var U=this.future(),K,X=0,Y=0;do{if(K=this.popToken(),Q.push(K),K.text==="{")++X;else if(K.text==="}"){if(--X,X===-1)throw new X8("Extra }",K)}else if(K.text==="EOF")throw new X8("Unexpected end of input in a macro argument, expected '"+(J&&Z?J[Y]:"}")+"'",K);if(J&&Z)if((X===0||X===1&&J[Y]==="{")&&K.text===J[Y]){if(++Y,Y===J.length){Q.splice(-Y,Y);break}}else Y=0}while(X!==0||Z);if(U.text==="{"&&Q[Q.length-1].text==="}")Q.pop(),Q.shift();return Q.reverse(),{tokens:Q,start:U,end:K}}consumeArgs(J,Q){if(Q){if(Q.length!==J+1)throw new X8("The length of delimiters doesn't match the number of args!");var Z=Q[0];for(var U=0;U<Z.length;U++){var K=this.popToken();if(Z[U]!==K.text)throw new X8("Use of the macro doesn't match its definition",K)}}var X=[];for(var Y=0;Y<J;Y++)X.push(this.consumeArg(Q&&Q[Y+1]).tokens);return X}countExpansion(J){if(this.expansionCount+=J,this.expansionCount>this.settings.maxExpand)throw new X8("Too many expansions: infinite loop or need to increase maxExpand setting")}expandOnce(J){var Q=this.popToken(),Z=Q.text,U=!Q.noexpand?this._getExpansion(Z):null;if(U==null||J&&U.unexpandable){if(J&&U==null&&Z[0]==="\\"&&!this.isDefined(Z))throw new X8("Undefined control sequence: "+Z);return this.pushToken(Q),!1}this.countExpansion(1);var K=U.tokens,X=this.consumeArgs(U.numArgs,U.delimiters);if(U.numArgs){K=K.slice();for(var Y=K.length-1;Y>=0;--Y){var z=K[Y];if(z.text==="#"){if(Y===0)throw new X8("Incomplete placeholder at end of macro body",z);if(z=K[--Y],z.text==="#")K.splice(Y+1,1);else if(/^[1-9]$/.test(z.text))K.splice(Y,2,...X[+z.text-1]);else throw new X8("Not a valid argument number",z)}}}return this.pushTokens(K),K.length}expandAfterFuture(){return this.expandOnce(),this.future()}expandNextToken(){for(;;)if(this.expandOnce()===!1){var J=this.stack.pop();if(J.treatAsRelax)J.text="\\relax";return J}throw new Error}expandMacro(J){return this.macros.has(J)?this.expandTokens([new AK(J)]):void 0}expandTokens(J){var Q=[],Z=this.stack.length;this.pushTokens(J);while(this.stack.length>Z)if(this.expandOnce(!0)===!1){var U=this.stack.pop();if(U.treatAsRelax)U.noexpand=!1,U.treatAsRelax=!1;Q.push(U)}return this.countExpansion(Q.length),Q}expandMacroAsText(J){var Q=this.expandMacro(J);if(Q)return Q.map((Z)=>Z.text).join("");else return Q}_getExpansion(J){var Q=this.macros.get(J);if(Q==null)return Q;if(J.length===1){var Z=this.lexer.catcodes[J];if(Z!=null&&Z!==13)return}var U=typeof Q==="function"?Q(this):Q;if(typeof U==="string"){var K=0;if(U.indexOf("#")!==-1){var X=U.replace(/##/g,"");while(X.indexOf("#"+(K+1))!==-1)++K}var Y=new $s(U,this.settings),z=[],G=Y.lex();while(G.text!=="EOF")z.push(G),G=Y.lex();z.reverse();var W={tokens:z,numArgs:K};return W}return U}isDefined(J){return this.macros.has(J)||oH.hasOwnProperty(J)||v7.math.hasOwnProperty(J)||v7.text.hasOwnProperty(J)||UE0.hasOwnProperty(J)}isExpandable(J){var Q=this.macros.get(J);return Q!=null?typeof Q==="string"||typeof Q==="function"||!Q.unexpandable:oH.hasOwnProperty(J)&&!oH[J].primitive}}class mk{constructor(J,Q){this.mode=void 0,this.gullet=void 0,this.settings=void 0,this.leftrightDepth=void 0,this.nextToken=void 0,this.mode="math",this.gullet=new KE0(J,Q,this.mode),this.settings=Q,this.leftrightDepth=0}expect(J,Q){if(Q===void 0)Q=!0;if(this.fetch().text!==J)throw new X8("Expected '"+J+"', got '"+this.fetch().text+"'",this.fetch());if(Q)this.consume()}consume(){this.nextToken=null}fetch(){if(this.nextToken==null)this.nextToken=this.gullet.expandNextToken();return this.nextToken}switchMode(J){this.mode=J,this.gullet.switchMode(J)}parse(){if(!this.settings.globalGroup)this.gullet.beginGroup();if(this.settings.colorIsTextColor)this.gullet.macros.set("\\color","\\textcolor");try{var J=this.parseExpression(!1);if(this.expect("EOF"),!this.settings.globalGroup)this.gullet.endGroup();return J}finally{this.gullet.endGroups()}}subparse(J){var Q=this.nextToken;this.consume(),this.gullet.pushToken(new AK("}")),this.gullet.pushTokens(J);var Z=this.parseExpression(!1);return this.expect("}"),this.nextToken=Q,Z}parseExpression(J,Q){var Z=[];while(!0){if(this.mode==="math")this.consumeSpaces();var U=this.fetch();if(mk.endOfExpression.indexOf(U.text)!==-1)break;if(Q&&U.text===Q)break;if(J&&oH[U.text]&&oH[U.text].infix)break;var K=this.parseAtom(Q);if(!K)break;else if(K.type==="internal")continue;Z.push(K)}if(this.mode==="text")this.formLigatures(Z);return this.handleInfixNodes(Z)}handleInfixNodes(J){var Q=-1,Z;for(var U=0;U<J.length;U++)if(J[U].type==="infix"){if(Q!==-1)throw new X8("only one infix operator per group",J[U].token);Q=U,Z=J[U].replaceWith}if(Q!==-1&&Z){var K,X,Y=J.slice(0,Q),z=J.slice(Q+1);if(Y.length===1&&Y[0].type==="ordgroup")K=Y[0];else K={type:"ordgroup",mode:this.mode,body:Y};if(z.length===1&&z[0].type==="ordgroup")X=z[0];else X={type:"ordgroup",mode:this.mode,body:z};var G;if(Z==="\\\\abovefrac")G=this.callFunction(Z,[K,J[Q],X],[]);else G=this.callFunction(Z,[K,X],[]);return[G]}else return J}handleSupSubscript(J){var Q=this.fetch(),Z=Q.text;this.consume(),this.consumeSpaces();var U;do{var K;U=this.parseGroup(J)}while(((K=U)==null?void 0:K.type)==="internal");if(!U)throw new X8("Expected group after '"+Z+"'",Q);return U}formatUnsupportedCmd(J){var Q=[];for(var Z=0;Z<J.length;Z++)Q.push({type:"textord",mode:"text",text:J[Z]});var U={type:"text",mode:this.mode,body:Q},K={type:"color",mode:this.mode,color:this.settings.errorColor,body:[U]};return K}parseAtom(J){var Q=this.parseGroup("atom",J);if((Q==null?void 0:Q.type)==="internal")return Q;if(this.mode==="text")return Q;var Z,U;while(!0){this.consumeSpaces();var K=this.fetch();if(K.text==="\\limits"||K.text==="\\nolimits"){if(Q&&Q.type==="op"){var X=K.text==="\\limits";Q.limits=X,Q.alwaysHandleSupSub=!0}else if(Q&&Q.type==="operatorname"){if(Q.alwaysHandleSupSub)Q.limits=K.text==="\\limits"}else throw new X8("Limit controls must follow a math operator",K);this.consume()}else if(K.text==="^"){if(Z)throw new X8("Double superscript",K);Z=this.handleSupSubscript("superscript")}else if(K.text==="_"){if(U)throw new X8("Double subscript",K);U=this.handleSupSubscript("subscript")}else if(K.text==="'"){if(Z)throw new X8("Double superscript",K);var Y={type:"textord",mode:this.mode,text:"\\prime"},z=[Y];this.consume();while(this.fetch().text==="'")z.push(Y),this.consume();if(this.fetch().text==="^")z.push(this.handleSupSubscript("superscript"));Z={type:"ordgroup",mode:this.mode,body:z}}else if(wk[K.text]){var G=Xw0.test(K.text),W=[];W.push(new AK(wk[K.text])),this.consume();while(!0){var H=this.fetch().text;if(!wk[H])break;if(Xw0.test(H)!==G)break;W.unshift(new AK(wk[H])),this.consume()}var q=this.subparse(W);if(G)U={type:"ordgroup",mode:"math",body:q};else Z={type:"ordgroup",mode:"math",body:q}}else break}if(Z||U)return{type:"supsub",mode:this.mode,base:Q,sup:Z,sub:U};else return Q}parseFunction(J,Q){var Z=this.fetch(),U=Z.text,K=oH[U];if(!K)return null;if(this.consume(),Q&&Q!=="atom"&&!K.allowedInArgument)throw new X8("Got function '"+U+"' with no arguments"+(Q?" as "+Q:""),Z);else if(this.mode==="text"&&!K.allowedInText)throw new X8("Can't use function '"+U+"' in text mode",Z);else if(this.mode==="math"&&K.allowedInMath===!1)throw new X8("Can't use function '"+U+"' in math mode",Z);var{args:X,optArgs:Y}=this.parseArguments(U,K);return this.callFunction(U,X,Y,Z,J)}callFunction(J,Q,Z,U,K){var X={funcName:J,parser:this,token:U,breakOnTokenText:K},Y=oH[J];if(Y&&Y.handler)return Y.handler(X,Q,Z);else throw new X8("No function handler for "+J)}parseArguments(J,Q){var Z=Q.numArgs+Q.numOptionalArgs;if(Z===0)return{args:[],optArgs:[]};var U=[],K=[];for(var X=0;X<Z;X++){var Y=Q.argTypes&&Q.argTypes[X],z=X<Q.numOptionalArgs;if(Q.primitive&&Y==null||Q.type==="sqrt"&&X===1&&K[0]==null)Y="primitive";var G=this.parseGroupOfType("argument to '"+J+"'",Y,z);if(z)K.push(G);else if(G!=null)U.push(G);else throw new X8("Null argument, please report this as a bug")}return{args:U,optArgs:K}}parseGroupOfType(J,Q,Z){switch(Q){case"color":return this.parseColorGroup(Z);case"size":return this.parseSizeGroup(Z);case"url":return this.parseUrlGroup(Z);case"math":case"text":return this.parseArgumentGroup(Z,Q);case"hbox":{var U=this.parseArgumentGroup(Z,"text");return U!=null?{type:"styling",mode:U.mode,body:[U],style:"text"}:null}case"raw":{var K=this.parseStringGroup("raw",Z);return K!=null?{type:"raw",mode:"text",string:K.text}:null}case"primitive":{if(Z)throw new X8("A primitive argument cannot be optional");var X=this.parseGroup(J);if(X==null)throw new X8("Expected group as "+J,this.fetch());return X}case"original":case null:case void 0:return this.parseArgumentGroup(Z);default:throw new X8("Unknown group type as "+J,this.fetch())}}consumeSpaces(){while(this.fetch().text===" ")this.consume()}parseStringGroup(J,Q){var Z=this.gullet.scanArgument(Q);if(Z==null)return null;var U="",K;while((K=this.fetch()).text!=="EOF")U+=K.text,this.consume();return this.consume(),Z.text=U,Z}parseRegexGroup(J,Q){var Z=this.fetch(),U=Z,K="",X;while((X=this.fetch()).text!=="EOF"&&J.test(K+X.text))U=X,K+=U.text,this.consume();if(K==="")throw new X8("Invalid "+Q+": '"+Z.text+"'",Z);return Z.range(U,K)}parseColorGroup(J){var Q=this.parseStringGroup("color",J);if(Q==null)return null;var Z=/^(#[a-f0-9]{3,4}|#[a-f0-9]{6}|#[a-f0-9]{8}|[a-f0-9]{6}|[a-z]+)$/i.exec(Q.text);if(!Z)throw new X8("Invalid color: '"+Q.text+"'",Q);var U=Z[0];if(/^[0-9a-f]{6}$/i.test(U))U="#"+U;return{type:"color-token",mode:this.mode,color:U}}parseSizeGroup(J){var Q,Z=!1;if(this.gullet.consumeSpaces(),!J&&this.gullet.future().text!=="{")Q=this.parseRegexGroup(/^[-+]? *(?:$|\d+|\d+\.\d*|\.\d*) *[a-z]{0,2} *$/,"size");else Q=this.parseStringGroup("size",J);if(!Q)return null;if(!J&&Q.text.length===0)Q.text="0pt",Z=!0;var U=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(Q.text);if(!U)throw new X8("Invalid size: '"+Q.text+"'",Q);var K={number:+(U[1]+U[2]),unit:U[3]};if(!Hw0(K))throw new X8("Invalid unit: '"+K.unit+"'",Q);return{type:"size",mode:this.mode,value:K,isBlank:Z}}parseUrlGroup(J){this.gullet.lexer.setCatcode("%",13),this.gullet.lexer.setCatcode("~",12);var Q=this.parseStringGroup("url",J);if(this.gullet.lexer.setCatcode("%",14),this.gullet.lexer.setCatcode("~",13),Q==null)return null;var Z=Q.text.replace(/\\([#$%&~_^{}])/g,"$1");return{type:"url",mode:this.mode,url:Z}}parseArgumentGroup(J,Q){var Z=this.gullet.scanArgument(J);if(Z==null)return null;var U=this.mode;if(Q)this.switchMode(Q);this.gullet.beginGroup();var K=this.parseExpression(!1,"EOF");this.expect("EOF"),this.gullet.endGroup();var X={type:"ordgroup",mode:this.mode,loc:Z.loc,body:K};if(Q)this.switchMode(U);return X}parseGroup(J,Q){var Z=this.fetch(),U=Z.text,K;if(U==="{"||U==="\\begingroup"){this.consume();var X=U==="{"?"}":"\\endgroup";this.gullet.beginGroup();var Y=this.parseExpression(!1,X),z=this.fetch();this.expect(X),this.gullet.endGroup(),K={type:"ordgroup",mode:this.mode,loc:j5.range(Z,z),body:Y,semisimple:U==="\\begingroup"||void 0}}else if(K=this.parseFunction(Q,J)||this.parseSymbol(),K==null&&U[0]==="\\"&&!UE0.hasOwnProperty(U)){if(this.settings.throwOnError)throw new X8("Undefined control sequence: "+U,Z);K=this.formatUnsupportedCmd(U),this.consume()}return K}formLigatures(J){var Q=J.length-1;for(var Z=0;Z<Q;++Z){var U=J[Z],K=U.text;if(K==="-"&&J[Z+1].text==="-")if(Z+1<Q&&J[Z+2].text==="-")J.splice(Z,3,{type:"textord",mode:"text",loc:j5.range(U,J[Z+2]),text:"---"}),Q-=2;else J.splice(Z,2,{type:"textord",mode:"text",loc:j5.range(U,J[Z+1]),text:"--"}),Q-=1;if((K==="'"||K==="`")&&J[Z+1].text===K)J.splice(Z,2,{type:"textord",mode:"text",loc:j5.range(U,J[Z+1]),text:K+K}),Q-=1}}parseSymbol(){var J=this.fetch(),Q=J.text;if(/^\\verb[^a-zA-Z]/.test(Q)){this.consume();var Z=Q.slice(5),U=Z.charAt(0)==="*";if(U)Z=Z.slice(1);if(Z.length<2||Z.charAt(0)!==Z.slice(-1))throw new X8(`\\verb assertion failed --
|
|
236
236
|
please report what input caused this bug`);return Z=Z.slice(1,-1),{type:"verb",mode:"text",body:Z,star:U}}if(Yw0.hasOwnProperty(Q[0])&&!v7[this.mode][Q[0]]){if(this.settings.strict&&this.mode==="math")this.settings.reportNonstrict("unicodeTextInMathMode",'Accented Unicode text character "'+Q[0]+'" used in math mode',J);Q=Yw0[Q[0]]+Q.slice(1)}var K=H36.exec(Q);if(K){if(Q=Q.substring(0,K.index),Q==="i")Q="ı";else if(Q==="j")Q="ȷ"}var X;if(v7[this.mode][Q]){if(this.settings.strict&&this.mode==="math"&&js.indexOf(Q)>=0)this.settings.reportNonstrict("unicodeTextInMathMode",'Latin-1/Unicode text character "'+Q[0]+'" used in math mode',J);var Y=v7[this.mode][Q].group,z=j5.range(J),G;if(UA6.hasOwnProperty(Y)){var W=Y;G={type:"atom",mode:this.mode,family:W,loc:z,text:Q}}else G={type:Y,mode:this.mode,loc:z,text:Q};X=G}else if(Q.charCodeAt(0)>=128){if(this.settings.strict){if(!Gw0(Q.charCodeAt(0)))this.settings.reportNonstrict("unknownSymbol",'Unrecognized Unicode character "'+Q[0]+'"'+(" ("+Q.charCodeAt(0)+")"),J);else if(this.mode==="math")this.settings.reportNonstrict("unicodeTextInMathMode",'Unicode text character "'+Q[0]+'" used in math mode',J)}X={type:"textord",mode:"text",loc:j5.range(J),text:Q}}else return null;if(this.consume(),K)for(var H=0;H<K[0].length;H++){var q=K[0][H];if(!Ds[q])throw new X8("Unknown accent ' "+q+"'",J);var F=Ds[q][this.mode]||Ds[q].text;if(!F)throw new X8("Accent "+q+" unsupported in "+this.mode+" mode",J);X={type:"accent",mode:this.mode,loc:j5.range(J),label:F,isStretchy:!1,isShifty:!0,base:X}}return X}}var jL6=function J(Q,Z){return Q===void 0?Z:Q},PL6,VL6=function J(Q){return Q.replace(PL6,"-$1").toLowerCase()},TL6,CL6,zw0=function J(Q){if(Q.type==="ordgroup")if(Q.body.length===1)return J(Q.body[0]);else return Q;else if(Q.type==="color")if(Q.body.length===1)return J(Q.body[0]);else return Q;else if(Q.type==="font")return J(Q.body);else return Q},$L6=function J(Q){var Z=zw0(Q);return Z.type==="mathord"||Z.type==="textord"||Z.type==="atom"},vL6=function J(Q){if(!Q)throw new Error("Expected non-null, but got "+String(Q));return Q},kL6=function J(Q){var Z=/^[\x00-\x20]*([^\\/#?]*?)(:|�*58|�*3a|&colon)/i.exec(Q);if(!Z)return"_relative";if(Z[2]!==":")return null;if(!/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(Z[1]))return null;return Z[1].toLowerCase()},b9,ww,vs=0,Vk=1,mL=2,yG=3,jw=4,IX=5,uL=6,jU=7,cY,_L6,bL6,xL6,hL6,yL6,gL6,GJ,ws,Ek,hL=80,uL6=function J(Q,Z){return"M95,"+(622+Q+Z)+`
|
|
@@ -788,7 +788,7 @@ https://github.com/jquery/jquery/blob/master/src/event.js
|
|
|
788
788
|
*/Ph0.prototype={instanceString:function J(){return"event"},recycle:function J(Q,Z){if(this.isImmediatePropagationStopped=this.isPropagationStopped=this.isDefaultPrevented=tE,Q!=null&&Q.preventDefault)this.type=Q.type,this.isDefaultPrevented=Q.defaultPrevented?wb:tE;else if(Q!=null&&Q.type)Z=Q;else this.type=Q;if(Z!=null)this.originalEvent=Z.originalEvent,this.type=Z.type!=null?Z.type:this.type,this.cy=Z.cy,this.target=Z.target,this.position=Z.position,this.renderedPosition=Z.renderedPosition,this.namespace=Z.namespace,this.layout=Z.layout;if(this.cy!=null&&this.position!=null&&this.renderedPosition==null){var U=this.position,K=this.cy.zoom(),X=this.cy.pan();this.renderedPosition={x:U.x*K+X.x,y:U.y*K+X.y}}this.timeStamp=Q&&Q.timeStamp||Date.now()},preventDefault:function J(){this.isDefaultPrevented=wb;var Q=this.originalEvent;if(!Q)return;if(Q.preventDefault)Q.preventDefault()},stopPropagation:function J(){this.isPropagationStopped=wb;var Q=this.originalEvent;if(!Q)return;if(Q.stopPropagation)Q.stopPropagation()},stopImmediatePropagation:function J(){this.isImmediatePropagationStopped=wb,this.stopPropagation()},isDefaultPrevented:tE,isPropagationStopped:tE,isImmediatePropagationStopped:tE};Vh0=/^([^.]+)(\.(?:[^.]+))?$/,Th0={qualifierCompare:function J(Q,Z){return Q===Z},eventMatches:function J(){return!0},addEventFields:function J(){},callbackContext:function J(Q){return Q},beforeEmit:function J(){},afterEmit:function J(){},bubble:function J(){return!1},parent:function J(){return null},context:null},cb0=Object.keys(Th0),Gv6={};pq=Wx.prototype;pq.on=pq.addListener=function(J,Q,Z,U,K){return Ch0(this,function(X,Y,z,G,W,H,q){if(N4(H))X.listeners.push({event:Y,callback:H,type:z,namespace:G,qualifier:W,conf:q})},J,Q,Z,U,K),this};pq.one=function(J,Q,Z,U){return this.on(J,Q,Z,U,{one:!0})};pq.removeListener=pq.off=function(J,Q,Z,U){var K=this;if(this.emitting!==0)this.listeners=oT6(this.listeners);var X=this.listeners,Y=function G(W){var H=X[W];Ch0(K,function(q,F,M,L,A,I){if((H.type===M||J==="*")&&(!L&&H.namespace!==".*"||H.namespace===L)&&(!A||q.qualifierCompare(H.qualifier,A))&&(!I||H.callback===I))return X.splice(W,1),!1},J,Q,Z,U)};for(var z=X.length-1;z>=0;z--)Y(z);return this};pq.removeAllListeners=function(){return this.removeListener("*")};pq.emit=pq.trigger=function(J,Q,Z){var U=this.listeners,K=U.length;if(this.emitting++,!E7(Q))Q=[Q];return Wv6(this,function(X,Y){if(Z!=null)U=[{event:Y.event,type:Y.type,namespace:Y.namespace,callback:Z}],K=U.length;var z=function W(){var H=U[G];if(H.type===Y.type&&(!H.namespace||H.namespace===Y.namespace||H.namespace===zv6)&&X.eventMatches(X.context,H,Y)){var q=[Y];if(Q!=null)eT6(q,Q);if(X.beforeEmit(X.context,H,Y),H.conf&&H.conf.one)X.listeners=X.listeners.filter(function(L){return L!==H});var F=X.callbackContext(X.context,H,Y),M=H.callback.apply(F,q);if(X.afterEmit(X.context,H,Y),M===!1)Y.stopPropagation(),Y.preventDefault()}};for(var G=0;G<K;G++)z();if(X.bubble(X.context)&&!Y.isPropagationStopped())X.parent(X.context).emit(Y,Q)},J),this.emitting--,this};Hv6={qualifierCompare:function J(Q,Z){if(Q==null||Z==null)return Q==null&&Z==null;else return Q.sameText(Z)},eventMatches:function J(Q,Z,U){var K=Z.qualifier;if(K!=null)return Q!==U.target&&Nj(U.target)&&K.matches(U.target);return!0},addEventFields:function J(Q,Z){Z.cy=Q.cy(),Z.target=Q},callbackContext:function J(Q,Z,U){return Z.qualifier!=null?U.target:Q},beforeEmit:function J(Q,Z){if(Z.conf&&Z.conf.once)Z.conf.onceCollection.removeListener(Z.event,Z.qualifier,Z.callback)},bubble:function J(){return!0},parent:function J(Q){return Q.isChild()?Q.parent():Q.cy()}},Sh0={createEmitter:function J(){for(var Q=0;Q<this.length;Q++){var Z=this[Q],U=Z._private;if(!U.emitter)U.emitter=new Wx(Hv6,Z)}return this},emitter:function J(){return this._private.emitter},on:function J(Q,Z,U){var K=Eb(Z);for(var X=0;X<this.length;X++){var Y=this[X];Y.emitter().on(Q,K,U)}return this},removeListener:function J(Q,Z,U){var K=Eb(Z);for(var X=0;X<this.length;X++){var Y=this[X];Y.emitter().removeListener(Q,K,U)}return this},removeAllListeners:function J(){for(var Q=0;Q<this.length;Q++){var Z=this[Q];Z.emitter().removeAllListeners()}return this},one:function J(Q,Z,U){var K=Eb(Z);for(var X=0;X<this.length;X++){var Y=this[X];Y.emitter().one(Q,K,U)}return this},once:function J(Q,Z,U){var K=Eb(Z);for(var X=0;X<this.length;X++){var Y=this[X];Y.emitter().on(Q,K,U,{once:!0,onceCollection:this})}},emit:function J(Q,Z){for(var U=0;U<this.length;U++){var K=this[U];K.emitter().emit(Q,Z)}return this},emitAndNotify:function J(Q,Z){if(this.length===0)return;return this.cy().notify(Q,this),this.emit(Q,Z),this}};t9.eventAliasesOn(Sh0);$h0={nodes:function J(Q){return this.filter(function(Z){return Z.isNode()}).filter(Q)},edges:function J(Q){return this.filter(function(Z){return Z.isEdge()}).filter(Q)},byGroup:function J(){var Q=this.spawn(),Z=this.spawn();for(var U=0;U<this.length;U++){var K=this[U];if(K.isNode())Q.push(K);else Z.push(K)}return{nodes:Q,edges:Z}},filter:function J(Q,Z){if(Q===void 0)return this;else if(JJ(Q)||VK(Q))return new mq(Q).filter(this);else if(N4(Q)){var U=this.spawn(),K=this;for(var X=0;X<K.length;X++){var Y=K[X],z=Z?Q.apply(Z,[Y,X,K]):Q(Y,X,K);if(z)U.push(Y)}return U}return this.spawn()},not:function J(Q){if(!Q)return this;else{if(JJ(Q))Q=this.filter(Q);var Z=this.spawn();for(var U=0;U<this.length;U++){var K=this[U],X=Q.has(K);if(!X)Z.push(K)}return Z}},absoluteComplement:function J(){var Q=this.cy();return Q.mutableElements().not(this)},intersect:function J(Q){if(JJ(Q)){var Z=Q;return this.filter(Z)}var U=this.spawn(),K=this,X=Q,Y=this.length<Q.length,z=Y?K:X,G=Y?X:K;for(var W=0;W<z.length;W++){var H=z[W];if(G.has(H))U.push(H)}return U},xor:function J(Q){var Z=this._private.cy;if(JJ(Q))Q=Z.$(Q);var U=this.spawn(),K=this,X=Q,Y=function z(G,W){for(var H=0;H<G.length;H++){var q=G[H],F=q._private.data.id,M=W.hasElementWithId(F);if(!M)U.push(q)}};return Y(K,X),Y(X,K),U},diff:function J(Q){var Z=this._private.cy;if(JJ(Q))Q=Z.$(Q);var U=this.spawn(),K=this.spawn(),X=this.spawn(),Y=this,z=Q,G=function W(H,q,F){for(var M=0;M<H.length;M++){var L=H[M],A=L._private.data.id,I=q.hasElementWithId(A);if(I)X.merge(L);else F.push(L)}};return G(Y,z,U),G(z,Y,K),{left:U,right:K,both:X}},add:function J(Q){var Z=this._private.cy;if(!Q)return this;if(JJ(Q)){var U=Q;Q=Z.mutableElements().filter(U)}var K=this.spawnSelf();for(var X=0;X<Q.length;X++){var Y=Q[X],z=!this.has(Y);if(z)K.push(Y)}return K},merge:function J(Q){var Z=this._private,U=Z.cy;if(!Q)return this;if(Q&&JJ(Q)){var K=Q;Q=U.mutableElements().filter(K)}var X=Z.map;for(var Y=0;Y<Q.length;Y++){var z=Q[Y],G=z._private.data.id,W=!X.has(G);if(W){var H=this.length++;this[H]=z,X.set(G,{ele:z,index:H})}}return this},unmergeAt:function J(Q){var Z=this[Q],U=Z.id(),K=this._private,X=K.map;this[Q]=void 0,X.delete(U);var Y=Q===this.length-1;if(this.length>1&&!Y){var z=this.length-1,G=this[z],W=G._private.data.id;this[z]=void 0,this[Q]=G,X.set(W,{ele:G,index:Q})}return this.length--,this},unmergeOne:function J(Q){Q=Q[0];var Z=this._private,U=Q._private.data.id,K=Z.map,X=K.get(U);if(!X)return this;var Y=X.index;return this.unmergeAt(Y),this},unmerge:function J(Q){var Z=this._private.cy;if(!Q)return this;if(Q&&JJ(Q)){var U=Q;Q=Z.mutableElements().filter(U)}for(var K=0;K<Q.length;K++)this.unmergeOne(Q[K]);return this},unmergeBy:function J(Q){for(var Z=this.length-1;Z>=0;Z--){var U=this[Z];if(Q(U))this.unmergeAt(Z)}return this},map:function J(Q,Z){var U=[],K=this;for(var X=0;X<K.length;X++){var Y=K[X],z=Z?Q.apply(Z,[Y,X,K]):Q(Y,X,K);U.push(z)}return U},reduce:function J(Q,Z){var U=Z,K=this;for(var X=0;X<K.length;X++)U=Q(U,K[X],X,K);return U},max:function J(Q,Z){var U=-1/0,K,X=this;for(var Y=0;Y<X.length;Y++){var z=X[Y],G=Z?Q.apply(Z,[z,Y,X]):Q(z,Y,X);if(G>U)U=G,K=z}return{value:U,ele:K}},min:function J(Q,Z){var U=1/0,K,X=this;for(var Y=0;Y<X.length;Y++){var z=X[Y],G=Z?Q.apply(Z,[z,Y,X]):Q(z,Y,X);if(G<U)U=G,K=z}return{value:U,ele:K}}},y9=$h0;y9.u=y9["|"]=y9["+"]=y9.union=y9.or=y9.add;y9["\\"]=y9["!"]=y9["-"]=y9.difference=y9.relativeComplement=y9.subtract=y9.not;y9.n=y9["&"]=y9["."]=y9.and=y9.intersection=y9.intersect;y9["^"]=y9["(+)"]=y9["(-)"]=y9.symmetricDifference=y9.symdiff=y9.xor;y9.fnFilter=y9.filterFn=y9.stdFilter=y9.filter;y9.complement=y9.abscomp=y9.absoluteComplement;qv6={isNode:function J(){return this.group()==="nodes"},isEdge:function J(){return this.group()==="edges"},isLoop:function J(){return this.isEdge()&&this.source()[0]===this.target()[0]},isSimple:function J(){return this.isEdge()&&this.source()[0]!==this.target()[0]},group:function J(){var Q=this[0];if(Q)return Q._private.group}},ib={forEach:function J(Q,Z){if(N4(Q)){var U=this.length;for(var K=0;K<U;K++){var X=this[K],Y=Z?Q.apply(Z,[X,K,this]):Q(X,K,this);if(Y===!1)break}}return this},toArray:function J(){var Q=[];for(var Z=0;Z<this.length;Z++)Q.push(this[Z]);return Q},slice:function J(Q,Z){var U=[],K=this.length;if(Z==null)Z=K;if(Q==null)Q=0;if(Q<0)Q=K+Q;if(Z<0)Z=K+Z;for(var X=Q;X>=0&&X<Z&&X<K;X++)U.push(this[X]);return this.spawn(U)},size:function J(){return this.length},eq:function J(Q){return this[Q]||this.spawn()},first:function J(){return this[0]||this.spawn()},last:function J(){return this[this.length-1]||this.spawn()},empty:function J(){return this.length===0},nonempty:function J(){return!this.empty()},sort:function J(Q){if(!N4(Q))return this;var Z=this.toArray().sort(Q);return this.spawn(Z)},sortByZIndex:function J(){return this.sort(vh0)},zDepth:function J(){var Q=this[0];if(!Q)return;var Z=Q._private,U=Z.group;if(U==="nodes"){var K=Z.data.parent?Q.parents().size():0;if(!Q.isParent())return IJ0-1;return K}else{var{source:X,target:Y}=Z,z=X.zDepth(),G=Y.zDepth();return Math.max(z,G,0)}}};ib.each=ib.forEach;Fv6();Bv6=fZ({nodeDimensionsIncludeLabels:!1}),kb={layoutDimensions:function J(Q){Q=Bv6(Q);var Z;if(!this.takesUpSpace())Z={w:0,h:0};else if(Q.nodeDimensionsIncludeLabels){var U=this.boundingBox();Z={w:U.w,h:U.h}}else Z={w:this.outerWidth(),h:this.outerHeight()};if(Z.w===0||Z.h===0)Z.w=Z.h=1;return Z},layoutPositions:function J(Q,Z,U){var K=this.nodes().filter(function(j){return!j.isParent()}),X=this.cy(),Y=Z.eles,z=function j(T){return T.id()},G=dA(U,z);Q.emit({type:"layoutstart",layout:Q}),Q.animations=[];var W=function j(T,C,$){var b={x:C.x1+C.w/2,y:C.y1+C.h/2},h={x:($.x-b.x)*T,y:($.y-b.y)*T};return{x:b.x+h.x,y:b.y+h.y}},H=Z.spacingFactor&&Z.spacingFactor!==1,q=function j(){if(!H)return null;var T=fU();for(var C=0;C<K.length;C++){var $=K[C],b=G($,C);sx0(T,b.x,b.y)}return T},F=q(),M=dA(function(j,T){var C=G(j,T);if(H){var $=Math.abs(Z.spacingFactor);C=W($,F,C)}if(Z.transform!=null)C=Z.transform(j,C);return C},z);if(Z.animate){for(var L=0;L<K.length;L++){var A=K[L],I=M(A,L),R=Z.animateFilter==null||Z.animateFilter(A,L);if(R){var N=A.animation({position:I,duration:Z.animationDuration,easing:Z.animationEasing});Q.animations.push(N)}else A.position(I)}if(Z.fit){var E=X.animation({fit:{boundingBox:Y.boundingBoxAt(M),padding:Z.padding},duration:Z.animationDuration,easing:Z.animationEasing});Q.animations.push(E)}else if(Z.zoom!==void 0&&Z.pan!==void 0){var V=X.animation({zoom:Z.zoom,pan:Z.pan,duration:Z.animationDuration,easing:Z.animationEasing});Q.animations.push(V)}Q.animations.forEach(function(j){return j.play()}),Q.one("layoutready",Z.ready),Q.emit({type:"layoutready",layout:Q}),sA.all(Q.animations.map(function(j){return j.promise()})).then(function(){Q.one("layoutstop",Z.stop),Q.emit({type:"layoutstop",layout:Q})})}else{if(K.positions(M),Z.fit)X.fit(Z.eles,Z.padding);if(Z.zoom!=null)X.zoom(Z.zoom);if(Z.pan)X.pan(Z.pan);Q.one("layoutready",Z.ready),Q.emit({type:"layoutready",layout:Q}),Q.one("layoutstop",Z.stop),Q.emit({type:"layoutstop",layout:Q})}return this},layout:function J(Q){var Z=this.cy();return Z.makeLayout(HJ({},Q,{eles:this}))}};kb.createLayout=kb.makeLayout=kb.layout;vZ={recalculateRenderedStyle:function J(Q){var Z=this.cy(),U=Z.renderer(),K=Z.styleEnabled();if(U&&K)U.recalculateRenderedStyle(this,Q);return this},dirtyStyleCache:function J(){var Q=this.cy(),Z=function K(X){return X._private.styleCache=null};if(Q.hasCompoundNodes()){var U=this.spawnSelf().merge(this.descendants()).merge(this.parents());U.merge(U.connectedEdges()),U.forEach(Z)}else this.forEach(function(K){Z(K),K.connectedEdges().forEach(Z)});return this},updateStyle:function J(Q){var Z=this._private.cy;if(!Z.styleEnabled())return this;if(Z.batching()){var U=Z._private.batchStyleEles;return U.merge(this),this}var K=Z.hasCompoundNodes(),X=this;if(Q=Q||Q===void 0?!0:!1,K)X=this.spawnSelf().merge(this.descendants()).merge(this.parents());var Y=X;if(Q)Y.emitAndNotify("style");else Y.emit("style");return X.forEach(function(z){return z._private.styleDirty=!0}),this},cleanStyle:function J(){var Q=this.cy();if(!Q.styleEnabled())return;for(var Z=0;Z<this.length;Z++){var U=this[Z];if(U._private.styleDirty)U._private.styleDirty=!1,Q.style().apply(U)}},parsedStyle:function J(Q){var Z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,U=this[0],K=U.cy();if(!K.styleEnabled())return;if(U){if(U._private.styleDirty)U._private.styleDirty=!1,K.style().apply(U);var X=U._private.style[Q];if(X!=null)return X;else if(Z)return K.style().getDefaultProperty(Q);else return null}},numericStyle:function J(Q){var Z=this[0];if(!Z.cy().styleEnabled())return;if(Z){var U=Z.pstyle(Q);return U.pfValue!==void 0?U.pfValue:U.value}},numericStyleUnits:function J(Q){var Z=this[0];if(!Z.cy().styleEnabled())return;if(Z)return Z.pstyle(Q).units},renderedStyle:function J(Q){var Z=this.cy();if(!Z.styleEnabled())return this;var U=this[0];if(U)return Z.style().getRenderedStyle(U,Q)},style:function J(Q,Z){var U=this.cy();if(!U.styleEnabled())return this;var K=!1,X=U.style();if(C9(Q)){var Y=Q;X.applyBypass(this,Y,K),this.emitAndNotify("style")}else if(JJ(Q))if(Z===void 0){var z=this[0];if(z)return X.getStylePropertyValue(z,Q);else return}else X.applyBypass(this,Q,Z,K),this.emitAndNotify("style");else if(Q===void 0){var G=this[0];if(G)return X.getRawStyle(G);else return}return this},removeStyle:function J(Q){var Z=this.cy();if(!Z.styleEnabled())return this;var U=!1,K=Z.style(),X=this;if(Q===void 0)for(var Y=0;Y<X.length;Y++){var z=X[Y];K.removeAllBypasses(z,U)}else{Q=Q.split(/\s+/);for(var G=0;G<X.length;G++){var W=X[G];K.removeBypasses(W,Q,U)}}return this.emitAndNotify("style"),this},show:function J(){return this.css("display","element"),this},hide:function J(){return this.css("display","none"),this},effectiveOpacity:function J(){var Q=this.cy();if(!Q.styleEnabled())return 1;var Z=Q.hasCompoundNodes(),U=this[0];if(U){var K=U._private,X=U.pstyle("opacity").value;if(!Z)return X;var Y=!K.data.parent?null:U.parents();if(Y)for(var z=0;z<Y.length;z++){var G=Y[z],W=G.pstyle("opacity").value;X=W*X}return X}},transparent:function J(){var Q=this.cy();if(!Q.styleEnabled())return!1;var Z=this[0],U=Z.cy().hasCompoundNodes();if(Z)if(!U)return Z.pstyle("opacity").value===0;else return Z.effectiveOpacity()===0},backgrounding:function J(){var Q=this.cy();if(!Q.styleEnabled())return!1;var Z=this[0];return Z._private.backgrounding?!0:!1}};aA=Hx("eleTakesUpSpace",function(J){return J.pstyle("display").value==="element"&&J.width()!==0&&(J.isNode()?J.height()!==0:!0)});vZ.takesUpSpace=qx("takesUpSpace",$J0({ok:aA}));Mv6=Hx("eleInteractive",function(J){return J.pstyle("events").value==="yes"&&J.pstyle("visibility").value==="visible"&&aA(J)}),Ov6=Hx("parentInteractive",function(J){return J.pstyle("visibility").value==="visible"&&aA(J)});vZ.interactive=qx("interactive",$J0({ok:Mv6,parentOk:Ov6,edgeOkViaNode:aA}));vZ.noninteractive=function(){var J=this[0];if(J)return!J.interactive()};Lv6=Hx("eleVisible",function(J){return J.pstyle("visibility").value==="visible"&&J.pstyle("opacity").pfValue!==0&&aA(J)}),Av6=aA;vZ.visible=qx("visible",$J0({ok:Lv6,edgeOkViaNode:Av6}));vZ.hidden=function(){var J=this[0];if(J)return!J.visible()};vZ.isBundledBezier=qx("isBundledBezier",function(){if(!this.cy().styleEnabled())return!1;return!this.removed()&&this.pstyle("curve-style").value==="bezier"&&this.takesUpSpace()});vZ.bypass=vZ.css=vZ.style;vZ.renderedCss=vZ.renderedStyle;vZ.removeBypass=vZ.removeCss=vZ.removeStyle;vZ.pstyle=vZ.parsedStyle;xq={};oA({field:"locked",overrideField:function J(Q){return Q.cy().autolock()?!0:void 0},on:"lock",off:"unlock"});oA({field:"grabbable",overrideField:function J(Q){return Q.cy().autoungrabify()||Q.pannable()?!1:void 0},on:"grabify",off:"ungrabify"});oA({field:"selected",ableField:"selectable",overrideAble:function J(Q){return Q.cy().autounselectify()?!1:void 0},on:"select",off:"unselect"});oA({field:"selectable",overrideField:function J(Q){return Q.cy().autounselectify()?!1:void 0},on:"selectify",off:"unselectify"});xq.deselect=xq.unselect;xq.grabbed=function(){var J=this[0];if(J)return J._private.grabbed};oA({field:"active",on:"activate",off:"unactivate"});oA({field:"pannable",on:"panify",off:"unpanify"});xq.inactive=function(){var J=this[0];if(J)return!J._private.active};JU={};JU.clearTraversalCache=function(){for(var J=0;J<this.length;J++)this[J]._private.traversalCache=null};HJ(JU,{roots:ib0({noIncomingEdges:!0}),leaves:ib0({noOutgoingEdges:!0}),outgoers:CX(rb0({outgoing:!0}),"outgoers"),successors:nb0({outgoing:!0}),incomers:CX(rb0({incoming:!0}),"incomers"),predecessors:nb0({})});HJ(JU,{neighborhood:CX(function(J){var Q=[],Z=this.nodes();for(var U=0;U<Z.length;U++){var K=Z[U],X=K.connectedEdges();for(var Y=0;Y<X.length;Y++){var z=X[Y],G=z.source(),W=z.target(),H=K===G?W:G;if(H.length>0)Q.push(H[0]);Q.push(z[0])}}return this.spawn(Q,!0).filter(J)},"neighborhood"),closedNeighborhood:function J(Q){return this.neighborhood().add(this).filter(Q)},openNeighborhood:function J(Q){return this.neighborhood(Q)}});JU.neighbourhood=JU.neighborhood;JU.closedNeighbourhood=JU.closedNeighborhood;JU.openNeighbourhood=JU.openNeighborhood;HJ(JU,{source:CX(function J(Q){var Z=this[0],U;if(Z)U=Z._private.source||Z.cy().collection();return U&&Q?U.filter(Q):U},"source"),target:CX(function J(Q){var Z=this[0],U;if(Z)U=Z._private.target||Z.cy().collection();return U&&Q?U.filter(Q):U},"target"),sources:sb0({attr:"source"}),targets:sb0({attr:"target"})});HJ(JU,{edgesWith:CX(ab0(),"edgesWith"),edgesTo:CX(ab0({thisIsSrc:!0}),"edgesTo")});HJ(JU,{connectedEdges:CX(function(J){var Q=[],Z=this;for(var U=0;U<Z.length;U++){var K=Z[U];if(!K.isNode())continue;var X=K._private.edges;for(var Y=0;Y<X.length;Y++){var z=X[Y];Q.push(z)}}return this.spawn(Q,!0).filter(J)},"connectedEdges"),connectedNodes:CX(function(J){var Q=[],Z=this;for(var U=0;U<Z.length;U++){var K=Z[U];if(!K.isEdge())continue;Q.push(K.source()[0]),Q.push(K.target()[0])}return this.spawn(Q,!0).filter(J)},"connectedNodes"),parallelEdges:CX(ob0(),"parallelEdges"),codirectedEdges:CX(ob0({codirected:!0}),"codirectedEdges")});HJ(JU,{components:function J(Q){var Z=this,U=Z.cy(),K=U.collection(),X=Q==null?Z.nodes():Q.nodes(),Y=[];if(Q!=null&&X.empty())X=Q.sources();var z=function W(H,q){K.merge(H),X.unmerge(H),q.merge(H)};if(X.empty())return Z.spawn();var G=function W(){var H=U.collection();Y.push(H);var q=X[0];z(q,H),Z.bfs({directed:!1,roots:q,visit:function F(M){return z(M,H)}}),H.forEach(function(F){F.connectedEdges().forEach(function(M){if(Z.has(M)&&H.has(M.source())&&H.has(M.target()))H.merge(M)})})};do G();while(X.length>0);return Y},component:function J(){var Q=this[0];return Q.cy().mutableElements().components(Q)[0]}});JU.componentsOf=JU.components;f7=Qx.prototype=kZ.prototype=Object.create(Array.prototype);f7.instanceString=function(){return"collection"};f7.spawn=function(J,Q){return new kZ(this.cy(),J,Q)};f7.spawnSelf=function(){return this.spawn(this)};f7.cy=function(){return this._private.cy};f7.renderer=function(){return this._private.cy.renderer()};f7.element=function(){return this[0]};f7.collection=function(){if(kx0(this))return this;else return new kZ(this._private.cy,[this])};f7.unique=function(){return new kZ(this._private.cy,this,!0)};f7.hasElementWithId=function(J){return J=""+J,this._private.map.has(J)};f7.getElementById=function(J){J=""+J;var Q=this._private.cy,Z=this._private.map.get(J);return Z?Z.ele:new kZ(Q)};f7.$id=f7.getElementById;f7.poolIndex=function(){var J=this._private.cy,Q=J._private.elements,Z=this[0]._private.data.id;return Q._private.map.get(Z).index};f7.indexOf=function(J){var Q=J[0]._private.data.id;return this._private.map.get(Q).index};f7.indexOfId=function(J){return J=""+J,this._private.map.get(J).index};f7.json=function(J){var Q=this.element(),Z=this.cy();if(Q==null&&J)return this;if(Q==null)return;var U=Q._private;if(C9(J)){if(Z.startBatch(),J.data){Q.data(J.data);var K=U.data;if(Q.isEdge()){var X=!1,Y={},z=J.data.source,G=J.data.target;if(z!=null&&z!=K.source)Y.source=""+z,X=!0;if(G!=null&&G!=K.target)Y.target=""+G,X=!0;if(X)Q=Q.move(Y)}else{var W="parent"in J.data,H=J.data.parent;if(W&&(H!=null||K.parent!=null)&&H!=K.parent){if(H===void 0)H=null;if(H!=null)H=""+H;Q=Q.move({parent:H})}}}if(J.position)Q.position(J.position);var q=function L(A,I,R){var N=J[A];if(N!=null&&N!==U[A])if(N)Q[I]();else Q[R]()};if(q("removed","remove","restore"),q("selected","select","unselect"),q("selectable","selectify","unselectify"),q("locked","lock","unlock"),q("grabbable","grabify","ungrabify"),q("pannable","panify","unpanify"),J.classes!=null)Q.classes(J.classes);return Z.endBatch(),this}else if(J===void 0){var F={data:Az(U.data),position:Az(U.position),group:U.group,removed:U.removed,selected:U.selected,selectable:U.selectable,locked:U.locked,grabbable:U.grabbable,pannable:U.pannable,classes:null};F.classes="";var M=0;return U.classes.forEach(function(L){return F.classes+=M++===0?L:" "+L}),F}};f7.jsons=function(){var J=[];for(var Q=0;Q<this.length;Q++){var Z=this[Q],U=Z.json();J.push(U)}return J};f7.clone=function(){var J=this.cy(),Q=[];for(var Z=0;Z<this.length;Z++){var U=this[Z],K=U.json(),X=new Qx(J,K,!1);Q.push(X)}return new kZ(J,Q)};f7.copy=f7.clone;f7.restore=function(){var J=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,Q=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,Z=this,U=Z.cy(),K=U._private,X=[],Y=[],z;for(var G=0,W=Z.length;G<W;G++){var H=Z[G];if(Q&&!H.removed())continue;if(H.isNode())X.push(H);else Y.push(H)}z=X.concat(Y);var q,F=function e(){z.splice(q,1),q--};for(q=0;q<z.length;q++){var M=z[q],L=M._private,A=L.data;if(M.clearTraversalCache(),!Q&&!L.removed);else if(A.id===void 0)A.id=ix0();else if(A8(A.id))A.id=""+A.id;else if(hq(A.id)||!JJ(A.id)){U4("Can not create element with invalid string ID `"+A.id+"`"),F();continue}else if(U.hasElementWithId(A.id)){U4("Can not create second element with ID `"+A.id+"`"),F();continue}var I=A.id;if(M.isNode()){var R=L.position;if(R.x==null)R.x=0;if(R.y==null)R.y=0}if(M.isEdge()){var N=M,E=["source","target"],V=E.length,j=!1;for(var T=0;T<V;T++){var C=E[T],$=A[C];if(A8($))$=A[C]=""+A[C];if($==null||$==="")U4("Can not create edge `"+I+"` with unspecified "+C),j=!0;else if(!U.hasElementWithId($))U4("Can not create edge `"+I+"` with nonexistant "+C+" `"+$+"`"),j=!0}if(j){F();continue}var b=U.getElementById(A.source),h=U.getElementById(A.target);if(b.same(h))b._private.edges.push(N);else b._private.edges.push(N),h._private.edges.push(N);N._private.source=b,N._private.target=h}if(L.map=new zW,L.map.set(I,{ele:M,index:0}),L.removed=!1,Q)U.addToPool(M)}for(var _=0;_<X.length;_++){var S=X[_],v=S._private.data;if(A8(v.parent))v.parent=""+v.parent;var f=v.parent,x=f!=null;if(x||S._private.parent){var y=S._private.parent?U.collection().merge(S._private.parent):U.getElementById(f);if(y.empty())v.parent=void 0;else if(y[0].removed())e9("Node added with missing parent, reference to parent removed"),v.parent=void 0,S._private.parent=null;else{var m=!1,g=y;while(!g.empty()){if(S.same(g)){m=!0,v.parent=void 0;break}g=g.parent()}if(!m)y[0]._private.children.push(S),S._private.parent=y[0],K.hasCompoundNodes=!0}}}if(z.length>0){var p=z.length===Z.length?Z:new kZ(U,z);for(var i=0;i<p.length;i++){var l=p[i];if(l.isNode())continue;l.parallelEdges().clearTraversalCache(),l.source().clearTraversalCache(),l.target().clearTraversalCache()}var a;if(K.hasCompoundNodes)a=U.collection().merge(p).merge(p.connectedNodes()).merge(p.parent());else a=p;if(a.dirtyCompoundBoundsCache().dirtyBoundingBoxCache().updateStyle(J),J)p.emitAndNotify("add");else if(Q)p.emit("add")}return Z};f7.removed=function(){var J=this[0];return J&&J._private.removed};f7.inside=function(){var J=this[0];return J&&!J._private.removed};f7.remove=function(){var J=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,Q=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,Z=this,U=[],K={},X=Z._private.cy;function Y(f){var x=f._private.edges;for(var y=0;y<x.length;y++)G(x[y])}function z(f){var x=f._private.children;for(var y=0;y<x.length;y++)G(x[y])}function G(f){var x=K[f.id()];if(Q&&f.removed()||x)return;else K[f.id()]=!0;if(f.isNode())U.push(f),Y(f),z(f);else U.unshift(f)}for(var W=0,H=Z.length;W<H;W++){var q=Z[W];G(q)}function F(f,x){var y=f._private.edges;yq(y,x),f.clearTraversalCache()}function M(f){f.clearTraversalCache()}var L=[];L.ids={};function A(f,x){x=x[0],f=f[0];var y=f._private.children,m=f.id();if(yq(y,x),x._private.parent=null,!L.ids[m])L.ids[m]=!0,L.push(f)}if(Z.dirtyCompoundBoundsCache(),Q)X.removeFromPool(U);for(var I=0;I<U.length;I++){var R=U[I];if(R.isEdge()){var N=R.source()[0],E=R.target()[0];F(N,R),F(E,R);var V=R.parallelEdges();for(var j=0;j<V.length;j++){var T=V[j];if(M(T),T.isBundledBezier())T.dirtyBoundingBoxCache()}}else{var C=R.parent();if(C.length!==0)A(C,R)}if(Q)R._private.removed=!0}var $=X._private.elements;X._private.hasCompoundNodes=!1;for(var b=0;b<$.length;b++){var h=$[b];if(h.isParent()){X._private.hasCompoundNodes=!0;break}}var _=new kZ(this.cy(),U);if(_.size()>0){if(J)_.emitAndNotify("remove");else if(Q)_.emit("remove")}for(var S=0;S<L.length;S++){var v=L[S];if(!Q||!v.removed())v.updateStyle()}return _};f7.move=function(J){var Q=this._private.cy,Z=this,U=!1,K=!1,X=function M(L){return L==null?L:""+L};if(J.source!==void 0||J.target!==void 0){var Y=X(J.source),z=X(J.target),G=Y!=null&&Q.hasElementWithId(Y),W=z!=null&&Q.hasElementWithId(z);if(G||W)Q.batch(function(){Z.remove(U,K),Z.emitAndNotify("moveout");for(var M=0;M<Z.length;M++){var L=Z[M],A=L._private.data;if(L.isEdge()){if(G)A.source=Y;if(W)A.target=z}}Z.restore(U,K)}),Z.emitAndNotify("move")}else if(J.parent!==void 0){var H=X(J.parent),q=H===null||Q.hasElementWithId(H);if(q){var F=H===null?void 0:H;Q.batch(function(){var M=Z.remove(U,K);M.emitAndNotify("moveout");for(var L=0;L<Z.length;L++){var A=Z[L],I=A._private.data;if(A.isNode())I.parent=F}M.restore(U,K)}),Z.emitAndNotify("move")}}return this};[Kh0,C$6,vb,bq,rA,l$6,Gx,Yv6,Sh0,$h0,qv6,ib,kb,vZ,xq,JU].forEach(function(J){HJ(f7,J)});Iv6={add:function J(Q){var Z,U=this;if(VK(Q)){var K=Q;if(K._private.cy===U)Z=K.restore();else{var X=[];for(var Y=0;Y<K.length;Y++){var z=K[Y];X.push(z.json())}Z=new kZ(U,X)}}else if(E7(Q)){var G=Q;Z=new kZ(U,G)}else if(C9(Q)&&(E7(Q.nodes)||E7(Q.edges))){var W=Q,H=[],q=["nodes","edges"];for(var F=0,M=q.length;F<M;F++){var L=q[F],A=W[L];if(E7(A))for(var I=0,R=A.length;I<R;I++){var N=HJ({group:L},A[I]);H.push(N)}}Z=new kZ(U,H)}else{var E=Q;Z=new Qx(U,E).collection()}return Z},remove:function J(Q){if(VK(Q));else if(JJ(Q)){var Z=Q;Q=this.$(Z)}return Q.remove()}};/*! Bezier curve function generator. Copyright Gaetan Renaudeau. MIT License: http://en.wikipedia.org/wiki/MIT_License *//*! Runge-Kutta spring physics function generator. Adapted from Framer.js, copyright Koen Bok. MIT License: http://en.wikipedia.org/wiki/MIT_License */Nv6=function(){function J(U){return-U.tension*U.x-U.friction*U.v}function Q(U,K,X){var Y={x:U.x+X.dx*K,v:U.v+X.dv*K,tension:U.tension,friction:U.friction};return{dx:Y.v,dv:J(Y)}}function Z(U,K){var X={dx:U.v,dv:J(U)},Y=Q(U,K*0.5,X),z=Q(U,K*0.5,Y),G=Q(U,K,z),W=0.16666666666666666*(X.dx+2*(Y.dx+z.dx)+G.dx),H=0.16666666666666666*(X.dv+2*(Y.dv+z.dv)+G.dv);return U.x=U.x+W*K,U.v=U.v+H*K,U}return function U(K,X,Y){var z={x:-1,v:0,tension:null,friction:null},G=[0],W=0,H=0.0001,q=0.016,F,M,L;if(K=parseFloat(K)||500,X=parseFloat(X)||20,Y=Y||null,z.tension=K,z.friction=X,F=Y!==null,F)W=U(K,X),M=W/Y*q;else M=q;for(;;)if(L=Z(L||z,M),G.push(1+L.x),W+=16,!(Math.abs(L.x)>H&&Math.abs(L.v)>H))break;return!F?W:function(A){return G[A*(G.length-1)|0]}}}(),fb={linear:function J(Q,Z,U){return Q+(Z-Q)*U},ease:k7(0.25,0.1,0.25,1),"ease-in":k7(0.42,0,1,1),"ease-out":k7(0,0,0.58,1),"ease-in-out":k7(0.42,0,0.58,1),"ease-in-sine":k7(0.47,0,0.745,0.715),"ease-out-sine":k7(0.39,0.575,0.565,1),"ease-in-out-sine":k7(0.445,0.05,0.55,0.95),"ease-in-quad":k7(0.55,0.085,0.68,0.53),"ease-out-quad":k7(0.25,0.46,0.45,0.94),"ease-in-out-quad":k7(0.455,0.03,0.515,0.955),"ease-in-cubic":k7(0.55,0.055,0.675,0.19),"ease-out-cubic":k7(0.215,0.61,0.355,1),"ease-in-out-cubic":k7(0.645,0.045,0.355,1),"ease-in-quart":k7(0.895,0.03,0.685,0.22),"ease-out-quart":k7(0.165,0.84,0.44,1),"ease-in-out-quart":k7(0.77,0,0.175,1),"ease-in-quint":k7(0.755,0.05,0.855,0.06),"ease-out-quint":k7(0.23,1,0.32,1),"ease-in-out-quint":k7(0.86,0,0.07,1),"ease-in-expo":k7(0.95,0.05,0.795,0.035),"ease-out-expo":k7(0.19,1,0.22,1),"ease-in-out-expo":k7(1,0,0,1),"ease-in-circ":k7(0.6,0.04,0.98,0.335),"ease-out-circ":k7(0.075,0.82,0.165,1),"ease-in-out-circ":k7(0.785,0.135,0.15,0.86),spring:function J(Q,Z,U){if(U===0)return fb.linear;var K=Nv6(Q,Z,U);return function(X,Y,z){return X+(Y-X)*K(z)}},"cubic-bezier":k7};Ev6={animate:t9.animate(),animation:t9.animation(),animated:t9.animated(),clearQueue:t9.clearQueue(),delay:t9.delay(),delayAnimation:t9.delayAnimation(),stop:t9.stop(),addToAnimationPool:function J(Q){var Z=this;if(!Z.styleEnabled())return;Z._private.aniEles.merge(Q)},stopAnimationLoop:function J(){this._private.animationsRunning=!1},startAnimationLoop:function J(){var Q=this;if(Q._private.animationsRunning=!0,!Q.styleEnabled())return;function Z(){if(!Q._private.animationsRunning)return;ub(function K(X){Jx0(X,Q),Z()})}var U=Q.renderer();if(U&&U.beforeRender)U.beforeRender(function K(X,Y){Jx0(Y,Q)},U.beforeRenderPriorities.animations);else Z()}},jv6={qualifierCompare:function J(Q,Z){if(Q==null||Z==null)return Q==null&&Z==null;else return Q.sameText(Z)},eventMatches:function J(Q,Z,U){var K=Z.qualifier;if(K!=null)return Q!==U.target&&Nj(U.target)&&K.matches(U.target);return!0},addEventFields:function J(Q,Z){Z.cy=Q,Z.target=Q},callbackContext:function J(Q,Z,U){return Z.qualifier!=null?U.target:Q}},fh0={createEmitter:function J(){var Q=this._private;if(!Q.emitter)Q.emitter=new Wx(jv6,this);return this},emitter:function J(){return this._private.emitter},on:function J(Q,Z,U){return this.emitter().on(Q,jb(Z),U),this},removeListener:function J(Q,Z,U){return this.emitter().removeListener(Q,jb(Z),U),this},removeAllListeners:function J(){return this.emitter().removeAllListeners(),this},one:function J(Q,Z,U){return this.emitter().one(Q,jb(Z),U),this},once:function J(Q,Z,U){return this.emitter().one(Q,jb(Z),U),this},emit:function J(Q,Z){return this.emitter().emit(Q,Z),this},emitAndNotify:function J(Q,Z){return this.emit(Q),this.notify(Q,Z),this}};t9.eventAliasesOn(fh0);UJ0={png:function J(Q){var Z=this._private.renderer;return Q=Q||{},Z.png(Q)},jpg:function J(Q){var Z=this._private.renderer;return Q=Q||{},Q.bg=Q.bg||"#fff",Z.jpg(Q)}};UJ0.jpeg=UJ0.jpg;_b={layout:function J(Q){var Z=this;if(Q==null){U4("Layout options must be specified to make a layout");return}if(Q.name==null){U4("A `name` must be specified to make a layout");return}var U=Q.name,K=Z.extension("layout",U);if(K==null){U4("No such layout `"+U+"` found. Did you forget to import it and `cytoscape.use()` it?");return}var X;if(JJ(Q.eles))X=Z.$(Q.eles);else X=Q.eles!=null?Q.eles:Z.$();var Y=new K(HJ({},Q,{cy:Z,eles:X}));return Y}};_b.createLayout=_b.makeLayout=_b.layout;Pv6={notify:function J(Q,Z){var U=this._private;if(this.batching()){U.batchNotifications=U.batchNotifications||{};var K=U.batchNotifications[Q]=U.batchNotifications[Q]||this.collection();if(Z!=null)K.merge(Z);return}if(!U.notificationsEnabled)return;var X=this.renderer();if(this.destroyed()||!X)return;X.notify(Q,Z)},notifications:function J(Q){var Z=this._private;if(Q===void 0)return Z.notificationsEnabled;else Z.notificationsEnabled=Q?!0:!1;return this},noNotifications:function J(Q){this.notifications(!1),Q(),this.notifications(!0)},batching:function J(){return this._private.batchCount>0},startBatch:function J(){var Q=this._private;if(Q.batchCount==null)Q.batchCount=0;if(Q.batchCount===0)Q.batchStyleEles=this.collection(),Q.batchNotifications={};return Q.batchCount++,this},endBatch:function J(){var Q=this._private;if(Q.batchCount===0)return this;if(Q.batchCount--,Q.batchCount===0){Q.batchStyleEles.updateStyle();var Z=this.renderer();Object.keys(Q.batchNotifications).forEach(function(U){var K=Q.batchNotifications[U];if(K.empty())Z.notify(U);else Z.notify(U,K)})}return this},batch:function J(Q){return this.startBatch(),Q(),this.endBatch(),this},batchData:function J(Q){var Z=this;return this.batch(function(){var U=Object.keys(Q);for(var K=0;K<U.length;K++){var X=U[K],Y=Q[X],z=Z.getElementById(X);z.data(Y)}})}},Vv6=fZ({hideEdgesOnViewport:!1,textureOnViewport:!1,motionBlur:!1,motionBlurOpacity:0.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]}),KJ0={renderTo:function J(Q,Z,U,K){var X=this._private.renderer;return X.renderTo(Q,Z,U,K),this},renderer:function J(){return this._private.renderer},forceRender:function J(){return this.notify("draw"),this},resize:function J(){return this.invalidateSize(),this.emitAndNotify("resize"),this},initRenderer:function J(Q){var Z=this,U=Z.extension("renderer",Q.name);if(U==null){U4("Can not initialise: No such renderer `".concat(Q.name,"` found. Did you forget to import it and `cytoscape.use()` it?"));return}if(Q.wheelSensitivity!==void 0)e9("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 K=Vv6(Q);K.cy=Z,Z._private.renderer=new U(K),this.notify("init")},destroyRenderer:function J(){var Q=this;Q.notify("destroy");var Z=Q.container();if(Z){Z._cyreg=null;while(Z.childNodes.length>0)Z.removeChild(Z.childNodes[0])}Q._private.renderer=null,Q.mutableElements().forEach(function(U){var K=U._private;K.rscratch={},K.rstyle={},K.animation.current=[],K.animation.queue=[]})},onRender:function J(Q){return this.on("render",Q)},offRender:function J(Q){return this.off("render",Q)}};KJ0.invalidateDimensions=KJ0.resize;bb={collection:function J(Q,Z){if(JJ(Q))return this.$(Q);else if(VK(Q))return Q.collection();else if(E7(Q)){if(!Z)Z={};return new kZ(this,Q,Z.unique,Z.removed)}return new kZ(this)},nodes:function J(Q){var Z=this.$(function(U){return U.isNode()});if(Q)return Z.filter(Q);return Z},edges:function J(Q){var Z=this.$(function(U){return U.isEdge()});if(Q)return Z.filter(Q);return Z},$:function J(Q){var Z=this._private.elements;if(Q)return Z.filter(Q);else return Z.spawnSelf()},mutableElements:function J(){return this._private.elements}};bb.elements=bb.filter=bb.$;oQ={};oQ.apply=function(J){var Q=this,Z=Q._private,U=Z.cy,K=U.collection();for(var X=0;X<J.length;X++){var Y=J[X],z=Q.getContextMeta(Y);if(z.empty)continue;var G=Q.getContextStyle(z),W=Q.applyContextStyle(z,G,Y);if(Y._private.appliedInitStyle)Q.updateTransitions(Y,W.diffProps);else Y._private.appliedInitStyle=!0;var H=Q.updateStyleHints(Y);if(H)K.push(Y)}return K};oQ.getPropertiesDiff=function(J,Q){var Z=this,U=Z._private.propDiffs=Z._private.propDiffs||{},K=J+"-"+Q,X=U[K];if(X)return X;var Y=[],z={};for(var G=0;G<Z.length;G++){var W=Z[G],H=J[G]===Yj,q=Q[G]===Yj,F=H!==q,M=W.mappedProperties.length>0;if(F||q&&M){var L=void 0;if(F&&M)L=W.properties;else if(F)L=W.properties;else if(M)L=W.mappedProperties;for(var A=0;A<L.length;A++){var I=L[A],R=I.name,N=!1;for(var E=G+1;E<Z.length;E++){var V=Z[E],j=Q[E]===Yj;if(!j)continue;if(N=V.properties[I.name]!=null,N)break}if(!z[R]&&!N)z[R]=!0,Y.push(R)}}}return U[K]=Y,Y};oQ.getContextMeta=function(J){var Q=this,Z="",U,K=J._private.styleCxtKey||"";for(var X=0;X<Q.length;X++){var Y=Q[X],z=Y.selector&&Y.selector.matches(J);if(z)Z+=Yj;else Z+=Tv6}return U=Q.getPropertiesDiff(K,Z),J._private.styleCxtKey=Z,{key:Z,diffPropNames:U,empty:U.length===0}};oQ.getContextStyle=function(J){var Q=J.key,Z=this,U=this._private.contextStyles=this._private.contextStyles||{};if(U[Q])return U[Q];var K={_private:{key:Q}};for(var X=0;X<Z.length;X++){var Y=Z[X],z=Q[X]===Yj;if(!z)continue;for(var G=0;G<Y.properties.length;G++){var W=Y.properties[G];K[W.name]=W}}return U[Q]=K,K};oQ.applyContextStyle=function(J,Q,Z){var U=this,K=J.diffPropNames,X={},Y=U.types;for(var z=0;z<K.length;z++){var G=K[z],W=Q[G],H=Z.pstyle(G);if(!W)if(!H)continue;else if(H.bypass)W={name:G,deleteBypassed:!0};else W={name:G,delete:!0};if(H===W)continue;if(W.mapped===Y.fn&&H!=null&&H.mapping!=null&&H.mapping.value===W.value){var q=H.mapping,F=q.fnValue=W.value(Z);if(F===q.prevFnValue)continue}var M=X[G]={prev:H};if(U.applyParsedProperty(Z,W),M.next=Z.pstyle(G),M.next&&M.next.bypass)M.next=M.next.bypassed}return{diffProps:X}};oQ.updateStyleHints=function(J){var Q=J._private,Z=this,U=Z.propertyGroupNames,K=Z.propertyGroupKeys,X=function z0(K0,R0,Y0){return Z.getPropertiesHash(K0,R0,Y0)},Y=Q.styleKey;if(J.removed())return!1;var z=Q.group==="nodes",G=J._private.style;U=Object.keys(G);for(var W=0;W<K.length;W++){var H=K[W];Q.styleKeys[H]=[vB,hA]}var q=function z0(K0,R0){return Q.styleKeys[R0][0]=Wj(K0,Q.styleKeys[R0][0])},F=function z0(K0,R0){return Q.styleKeys[R0][1]=Hj(K0,Q.styleKeys[R0][1])},M=function z0(K0,R0){q(K0,R0),F(K0,R0)},L=function z0(K0,R0){for(var Y0=0;Y0<K0.length;Y0++){var P0=K0.charCodeAt(Y0);q(P0,R0),F(P0,R0)}},A=2000000000,I=function z0(K0){return-128<K0&&K0<128&&Math.floor(K0)!==K0?A-(K0*1024|0):K0};for(var R=0;R<U.length;R++){var N=U[R],E=G[N];if(E==null)continue;var V=this.properties[N],j=V.type,T=V.groupKey,C=void 0;if(V.hashOverride!=null)C=V.hashOverride(J,E);else if(E.pfValue!=null)C=E.pfValue;var $=V.enums==null?E.value:null,b=C!=null,h=$!=null,_=b||h,S=E.units;if(j.number&&_&&!j.multiple){var v=b?C:$;if(M(I(v),T),!b&&S!=null)L(S,T)}else L(E.strValue,T)}var f=[vB,hA];for(var x=0;x<K.length;x++){var y=K[x],m=Q.styleKeys[y];f[0]=Wj(m[0],f[0]),f[1]=Hj(m[1],f[1])}Q.styleKey=cT6(f[0],f[1]);var g=Q.styleKeys;Q.labelDimsKey=Cq(g.labelDimensions);var p=X(J,["label"],g.labelDimensions);if(Q.labelKey=Cq(p),Q.labelStyleKey=Cq(Lb(g.commonLabel,p)),!z){var i=X(J,["source-label"],g.labelDimensions);Q.sourceLabelKey=Cq(i),Q.sourceLabelStyleKey=Cq(Lb(g.commonLabel,i));var l=X(J,["target-label"],g.labelDimensions);Q.targetLabelKey=Cq(l),Q.targetLabelStyleKey=Cq(Lb(g.commonLabel,l))}if(z){var a=Q.styleKeys,e=a.nodeBody,G0=a.nodeBorder,U0=a.nodeOutline,O0=a.backgroundImage,X0=a.compound,E0=a.pie,W0=a.stripe,q0=[e,G0,U0,O0,X0,E0,W0].filter(function(z0){return z0!=null}).reduce(Lb,[vB,hA]);Q.nodeKey=Cq(q0),Q.hasPie=E0!=null&&E0[0]!==vB&&E0[1]!==hA,Q.hasStripe=W0!=null&&W0[0]!==vB&&W0[1]!==hA}return Y!==Q.styleKey};oQ.clearStyleHints=function(J){var Q=J._private;Q.styleCxtKey="",Q.styleKeys={},Q.styleKey=null,Q.labelKey=null,Q.labelStyleKey=null,Q.sourceLabelKey=null,Q.sourceLabelStyleKey=null,Q.targetLabelKey=null,Q.targetLabelStyleKey=null,Q.nodeKey=null,Q.hasPie=null,Q.hasStripe=null};oQ.applyParsedProperty=function(J,Q){var Z=this,U=Q,K=J._private.style,X,Y=Z.types,z=Z.properties[U.name].type,G=U.bypass,W=K[U.name],H=W&&W.bypass,q=J._private,F="mapping",M=function a(e){if(e==null)return null;else if(e.pfValue!=null)return e.pfValue;else return e.value},L=function a(){var e=M(W),G0=M(U);Z.checkTriggers(J,U.name,e,G0)};if(Q.name==="curve-style"&&J.isEdge()&&(Q.value!=="bezier"&&J.isLoop()||Q.value==="haystack"&&(J.source().isParent()||J.target().isParent())))U=Q=this.parse(Q.name,"bezier",G);if(U.delete)return K[U.name]=void 0,L(),!0;if(U.deleteBypassed)if(!W)return L(),!0;else if(W.bypass)return W.bypassed=void 0,L(),!0;else return!1;if(U.deleteBypass)if(!W)return L(),!0;else if(W.bypass)return K[U.name]=W.bypassed,L(),!0;else return!1;var A=function a(){e9("Do not assign mappings to elements without corresponding data (i.e. ele `"+J.id()+"` has no mapping for property `"+U.name+"` with data field `"+U.field+"`); try a `["+U.field+"]` selector to limit scope to elements with `"+U.field+"` defined")};switch(U.mapped){case Y.mapData:{var I=U.field.split("."),R=q.data;for(var N=0;N<I.length&&R;N++){var E=I[N];R=R[E]}if(R==null)return A(),!1;var V;if(!A8(R))return e9("Do not use continuous mappers without specifying numeric data (i.e. `"+U.field+": "+R+"` for `"+J.id()+"` is non-numeric)"),!1;else{var j=U.fieldMax-U.fieldMin;if(j===0)V=0;else V=(R-U.fieldMin)/j}if(V<0)V=0;else if(V>1)V=1;if(z.color){var T=U.valueMin[0],C=U.valueMax[0],$=U.valueMin[1],b=U.valueMax[1],h=U.valueMin[2],_=U.valueMax[2],S=U.valueMin[3]==null?1:U.valueMin[3],v=U.valueMax[3]==null?1:U.valueMax[3],f=[Math.round(T+(C-T)*V),Math.round($+(b-$)*V),Math.round(h+(_-h)*V),Math.round(S+(v-S)*V)];X={bypass:U.bypass,name:U.name,value:f,strValue:"rgb("+f[0]+", "+f[1]+", "+f[2]+")"}}else if(z.number){var x=U.valueMin+(U.valueMax-U.valueMin)*V;X=this.parse(U.name,x,U.bypass,F)}else return!1;if(!X)return A(),!1;X.mapping=U,U=X;break}case Y.data:{var y=U.field.split("."),m=q.data;for(var g=0;g<y.length&&m;g++){var p=y[g];m=m[p]}if(m!=null)X=this.parse(U.name,m,U.bypass,F);if(!X)return A(),!1;X.mapping=U,U=X;break}case Y.fn:{var i=U.value,l=U.fnValue!=null?U.fnValue:i(J);if(U.prevFnValue=l,l==null)return e9("Custom function mappers may not return null (i.e. `"+U.name+"` for ele `"+J.id()+"` is null)"),!1;if(X=this.parse(U.name,l,U.bypass,F),!X)return e9("Custom function mappers may not return invalid values for the property type (i.e. `"+U.name+"` for ele `"+J.id()+"` is invalid)"),!1;X.mapping=Az(U),U=X;break}case void 0:break;default:return!1}if(G){if(H)U.bypassed=W.bypassed;else U.bypassed=W;K[U.name]=U}else if(H)W.bypassed=U;else K[U.name]=U;return L(),!0};oQ.cleanElements=function(J,Q){for(var Z=0;Z<J.length;Z++){var U=J[Z];if(this.clearStyleHints(U),U.dirtyCompoundBoundsCache(),U.dirtyBoundingBoxCache(),!Q)U._private.style={};else{var K=U._private.style,X=Object.keys(K);for(var Y=0;Y<X.length;Y++){var z=X[Y],G=K[z];if(G!=null)if(G.bypass)G.bypassed=null;else K[z]=null}}}};oQ.update=function(){var J=this._private.cy,Q=J.mutableElements();Q.updateStyle()};oQ.updateTransitions=function(J,Q){var Z=this,U=J._private,K=J.pstyle("transition-property").value,X=J.pstyle("transition-duration").pfValue,Y=J.pstyle("transition-delay").pfValue;if(K.length>0&&X>0){var z={},G=!1;for(var W=0;W<K.length;W++){var H=K[W],q=J.pstyle(H),F=Q[H];if(!F)continue;var M=F.prev,L=M,A=F.next!=null?F.next:q,I=!1,R=void 0,N=0.000001;if(!L)continue;if(A8(L.pfValue)&&A8(A.pfValue))I=A.pfValue-L.pfValue,R=L.pfValue+N*I;else if(A8(L.value)&&A8(A.value))I=A.value-L.value,R=L.value+N*I;else if(E7(L.value)&&E7(A.value))I=L.value[0]!==A.value[0]||L.value[1]!==A.value[1]||L.value[2]!==A.value[2],R=L.strValue;if(I)z[H]=A.strValue,this.applyBypass(J,H,R),G=!0}if(!G)return;U.transitioning=!0,new sA(function(E){if(Y>0)J.delayAnimation(Y).play().promise().then(E);else E()}).then(function(){return J.animation({style:z,duration:X,easing:J.pstyle("transition-timing-function").value,queue:!1}).play().promise()}).then(function(){Z.removeBypasses(J,K),J.emitAndNotify("style"),U.transitioning=!1})}else if(U.transitioning)this.removeBypasses(J,K),J.emitAndNotify("style"),U.transitioning=!1};oQ.checkTrigger=function(J,Q,Z,U,K,X){var Y=this.properties[Q],z=K(Y);if(J.removed())return;if(z!=null&&z(Z,U,J))X(Y)};oQ.checkZOrderTrigger=function(J,Q,Z,U){var K=this;this.checkTrigger(J,Q,Z,U,function(X){return X.triggersZOrder},function(){K._private.cy.notify("zorder",J)})};oQ.checkBoundsTrigger=function(J,Q,Z,U){this.checkTrigger(J,Q,Z,U,function(K){return K.triggersBounds},function(K){J.dirtyCompoundBoundsCache(),J.dirtyBoundingBoxCache()})};oQ.checkConnectedEdgesBoundsTrigger=function(J,Q,Z,U){this.checkTrigger(J,Q,Z,U,function(K){return K.triggersBoundsOfConnectedEdges},function(K){J.connectedEdges().forEach(function(X){X.dirtyBoundingBoxCache()})})};oQ.checkParallelEdgesBoundsTrigger=function(J,Q,Z,U){this.checkTrigger(J,Q,Z,U,function(K){return K.triggersBoundsOfParallelEdges},function(K){J.parallelEdges().forEach(function(X){X.dirtyBoundingBoxCache()})})};oQ.checkTriggers=function(J,Q,Z,U){J.dirtyStyleCache(),this.checkZOrderTrigger(J,Q,Z,U),this.checkBoundsTrigger(J,Q,Z,U),this.checkConnectedEdgesBoundsTrigger(J,Q,Z,U),this.checkParallelEdgesBoundsTrigger(J,Q,Z,U)};Tj={};Tj.applyBypass=function(J,Q,Z,U){var K=this,X=[],Y=!0;if(Q==="*"||Q==="**"){if(Z!==void 0)for(var z=0;z<K.properties.length;z++){var G=K.properties[z],W=G.name,H=this.parse(W,Z,!0);if(H)X.push(H)}}else if(JJ(Q)){var q=this.parse(Q,Z,!0);if(q)X.push(q)}else if(C9(Q)){var F=Q;U=Z;var M=Object.keys(F);for(var L=0;L<M.length;L++){var A=M[L],I=F[A];if(I===void 0)I=F[eb(A)];if(I!==void 0){var R=this.parse(A,I,!0);if(R)X.push(R)}}}else return!1;if(X.length===0)return!1;var N=!1;for(var E=0;E<J.length;E++){var V=J[E],j={},T=void 0;for(var C=0;C<X.length;C++){var $=X[C];if(U){var b=V.pstyle($.name);T=j[$.name]={prev:b}}if(N=this.applyParsedProperty(V,Az($))||N,U)T.next=V.pstyle($.name)}if(N)this.updateStyleHints(V);if(U)this.updateTransitions(V,j,Y)}return N};Tj.overrideBypass=function(J,Q,Z){Q=LJ0(Q);for(var U=0;U<J.length;U++){var K=J[U],X=K._private.style[Q],Y=this.properties[Q].type,z=Y.color,G=Y.mutiple,W=!X?null:X.pfValue!=null?X.pfValue:X.value;if(!X||!X.bypass)this.applyBypass(K,Q,Z);else{if(X.value=Z,X.pfValue!=null)X.pfValue=Z;if(z)X.strValue="rgb("+Z.join(",")+")";else if(G)X.strValue=Z.join(" ");else X.strValue=""+Z;this.updateStyleHints(K)}this.checkTriggers(K,Q,W,Z)}};Tj.removeAllBypasses=function(J,Q){return this.removeBypasses(J,this.propertyNames,Q)};Tj.removeBypasses=function(J,Q,Z){var U=!0;for(var K=0;K<J.length;K++){var X=J[K],Y={};for(var z=0;z<Q.length;z++){var G=Q[z],W=this.properties[G],H=X.pstyle(W.name);if(!H||!H.bypass)continue;var q="",F=this.parse(G,q,!0),M=Y[W.name]={prev:H};this.applyParsedProperty(X,F),M.next=X.pstyle(W.name)}if(this.updateStyleHints(X),Z)this.updateTransitions(X,Y,U)}};vJ0={};vJ0.getEmSizeInPixels=function(){var J=this.containerCss("font-size");if(J!=null)return parseFloat(J);else return 1};vJ0.containerCss=function(J){var Q=this._private.cy,Z=Q.container(),U=Q.window();if(U&&Z&&U.getComputedStyle)return U.getComputedStyle(Z).getPropertyValue(J)};Iz={};Iz.getRenderedStyle=function(J,Q){if(Q)return this.getStylePropertyValue(J,Q,!0);else return this.getRawStyle(J,!0)};Iz.getRawStyle=function(J,Q){var Z=this;if(J=J[0],J){var U={};for(var K=0;K<Z.properties.length;K++){var X=Z.properties[K],Y=Z.getStylePropertyValue(J,X.name,Q);if(Y!=null)U[X.name]=Y,U[eb(X.name)]=Y}return U}};Iz.getIndexedStyle=function(J,Q,Z,U){var K=J.pstyle(Q)[Z][U];return K!=null?K:J.cy().style().getDefaultProperty(Q)[Z][0]};Iz.getStylePropertyValue=function(J,Q,Z){var U=this;if(J=J[0],J){var K=U.properties[Q];if(K.alias)K=K.pointsTo;var X=K.type,Y=J.pstyle(K.name);if(Y){var{value:z,units:G,strValue:W}=Y;if(Z&&X.number&&z!=null&&A8(z)){var H=J.cy().zoom(),q=function A(I){return I*H},F=function A(I,R){return q(I)+R},M=E7(z),L=M?G.every(function(A){return A!=null}):G!=null;if(L)if(M)return z.map(function(A,I){return F(A,G[I])}).join(" ");else return F(z,G);else if(M)return z.map(function(A){return JJ(A)?A:""+q(A)}).join(" ");else return""+q(z)}else if(W!=null)return W}return null}};Iz.getAnimationStartStyle=function(J,Q){var Z={};for(var U=0;U<Q.length;U++){var K=Q[U],X=K.name,Y=J.pstyle(X);if(Y!==void 0)if(C9(Y))Y=this.parse(X,Y.strValue);else Y=this.parse(X,Y);if(Y)Z[X]=Y}return Z};Iz.getPropsList=function(J){var Q=this,Z=[],U=J,K=Q.properties;if(U){var X=Object.keys(U);for(var Y=0;Y<X.length;Y++){var z=X[Y],G=U[z],W=K[z]||K[LJ0(z)],H=this.parse(W.name,G);if(H)Z.push(H)}}return Z};Iz.getNonDefaultPropertiesHash=function(J,Q,Z){var U=Z.slice(),K,X,Y,z,G,W;for(G=0;G<Q.length;G++)if(K=Q[G],X=J.pstyle(K,!1),X==null)continue;else if(X.pfValue!=null)U[0]=Wj(z,U[0]),U[1]=Hj(z,U[1]);else{Y=X.strValue;for(W=0;W<Y.length;W++)z=Y.charCodeAt(W),U[0]=Wj(z,U[0]),U[1]=Hj(z,U[1])}return U};Iz.getPropertiesHash=Iz.getNonDefaultPropertiesHash;Fx={};Fx.appendFromJson=function(J){var Q=this;for(var Z=0;Z<J.length;Z++){var U=J[Z],K=U.selector,X=U.style||U.css,Y=Object.keys(X);Q.selector(K);for(var z=0;z<Y.length;z++){var G=Y[z],W=X[G];Q.css(G,W)}}return Q};Fx.fromJson=function(J){var Q=this;return Q.resetToDefault(),Q.appendFromJson(J),Q};Fx.json=function(){var J=[];for(var Q=this.defaultLength;Q<this.length;Q++){var Z=this[Q],U=Z.selector,K=Z.properties,X={};for(var Y=0;Y<K.length;Y++){var z=K[Y];X[z.name]=z.strValue}J.push({selector:!U?"core":U.toString(),style:X})}return J};kJ0={};kJ0.appendFromString=function(J){var Q=this,Z=this,U=""+J,K,X,Y;U=U.replace(/[/][*](\s|.)+?[*][/]/g,"");function z(){if(U.length>K.length)U=U.substr(K.length);else U=""}function G(){if(X.length>Y.length)X=X.substr(Y.length);else X=""}for(;;){var W=U.match(/^\s*$/);if(W)break;var H=U.match(/^\s*((?:.|\s)+?)\s*\{((?:.|\s)+?)\}/);if(!H){e9("Halting stylesheet parsing: String stylesheet contains more to parse but no selector and block found in: "+U);break}K=H[0];var q=H[1];if(q!=="core"){var F=new mq(q);if(F.invalid){e9("Skipping parsing of block: Invalid selector found in string stylesheet: "+q),z();continue}}var M=H[2],L=!1;X=M;var A=[];for(;;){var I=X.match(/^\s*$/);if(I)break;var R=X.match(/^\s*(.+?)\s*:\s*(.+?)(?:\s*;|\s*$)/);if(!R){e9("Skipping parsing of block: Invalid formatting of style property and value definitions found in:"+M),L=!0;break}Y=R[0];var N=R[1],E=R[2],V=Q.properties[N];if(!V){e9("Skipping property: Invalid property name in: "+Y),G();continue}var j=Z.parse(N,E);if(!j){e9("Skipping property: Invalid property definition in: "+Y),G();continue}A.push({name:N,val:E}),G()}if(L){z();break}Z.selector(q);for(var T=0;T<A.length;T++){var C=A[T];Z.css(C.name,C.val)}z()}return Z};kJ0.fromString=function(J){var Q=this;return Q.resetToDefault(),Q.appendFromString(J),Q};t4={};(function(){var J=VQ,Q=DT6,Z=ET6,U=jT6,K=PT6,X=function q0(z0){return"^"+z0+"\\s*\\(\\s*([\\w\\.]+)\\s*\\)$"},Y=function q0(z0){var K0=J+"|\\w+|"+Q+"|"+Z+"|"+U+"|"+K;return"^"+z0+"\\s*\\(([\\w\\.]+)\\s*\\,\\s*("+J+")\\s*\\,\\s*("+J+")\\s*,\\s*("+K0+")\\s*\\,\\s*("+K0+")\\)$"},z=[`^url\\s*\\(\\s*['"]?(.+?)['"]?\\s*\\)$`,"^(none)$","^(.+)$"];t4.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:X("data")},layoutData:{mapping:!0,regex:X("layoutData")},scratch:{mapping:!0,regex:X("scratch")},mapData:{mapping:!0,regex:Y("mapData")},mapLayoutData:{mapping:!0,regex:Y("mapLayoutData")},mapScratch:{mapping:!0,regex:Y("mapScratch")},fn:{mapping:!0,fn:!0},url:{regexes:z,singleRegexMatchValue:!0},urls:{regexes:z,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 q0(z0,K0){switch(z0.length){case 2:return K0[0]!=="deg"&&K0[0]!=="rad"&&K0[1]!=="deg"&&K0[1]!=="rad";case 1:return JJ(z0[0])||K0[0]==="deg"||K0[0]==="rad";default:return!1}}},easing:{regexes:["^(spring)\\s*\\(\\s*("+J+")\\s*,\\s*("+J+")\\s*\\)$","^(cubic-bezier)\\s*\\(\\s*("+J+")\\s*,\\s*("+J+")\\s*,\\s*("+J+")\\s*,\\s*("+J+")\\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 q0(z0){var K0=z0.length;return K0===1||K0===2||K0===4}}};var G={zeroNonZero:function q0(z0,K0){if((z0==null||K0==null)&&z0!==K0)return!0;if(z0==0&&K0!=0)return!0;else if(z0!=0&&K0==0)return!0;else return!1},any:function q0(z0,K0){return z0!=K0},emptyNonEmpty:function q0(z0,K0){var R0=hq(z0),Y0=hq(K0);return R0&&!Y0||!R0&&Y0}},W=t4.types,H=[{name:"label",type:W.text,triggersBounds:G.any,triggersZOrder:G.emptyNonEmpty},{name:"text-rotation",type:W.textRotation,triggersBounds:G.any},{name:"text-margin-x",type:W.bidirectionalSize,triggersBounds:G.any},{name:"text-margin-y",type:W.bidirectionalSize,triggersBounds:G.any}],q=[{name:"source-label",type:W.text,triggersBounds:G.any},{name:"source-text-rotation",type:W.textRotation,triggersBounds:G.any},{name:"source-text-margin-x",type:W.bidirectionalSize,triggersBounds:G.any},{name:"source-text-margin-y",type:W.bidirectionalSize,triggersBounds:G.any},{name:"source-text-offset",type:W.size,triggersBounds:G.any}],F=[{name:"target-label",type:W.text,triggersBounds:G.any},{name:"target-text-rotation",type:W.textRotation,triggersBounds:G.any},{name:"target-text-margin-x",type:W.bidirectionalSize,triggersBounds:G.any},{name:"target-text-margin-y",type:W.bidirectionalSize,triggersBounds:G.any},{name:"target-text-offset",type:W.size,triggersBounds:G.any}],M=[{name:"font-family",type:W.fontFamily,triggersBounds:G.any},{name:"font-style",type:W.fontStyle,triggersBounds:G.any},{name:"font-weight",type:W.fontWeight,triggersBounds:G.any},{name:"font-size",type:W.size,triggersBounds:G.any},{name:"text-transform",type:W.textTransform,triggersBounds:G.any},{name:"text-wrap",type:W.textWrap,triggersBounds:G.any},{name:"text-overflow-wrap",type:W.textOverflowWrap,triggersBounds:G.any},{name:"text-max-width",type:W.size,triggersBounds:G.any},{name:"text-outline-width",type:W.size,triggersBounds:G.any},{name:"line-height",type:W.positiveNumber,triggersBounds:G.any}],L=[{name:"text-valign",type:W.valign,triggersBounds:G.any},{name:"text-halign",type:W.halign,triggersBounds:G.any},{name:"color",type:W.color},{name:"text-outline-color",type:W.color},{name:"text-outline-opacity",type:W.zeroOneNumber},{name:"text-background-color",type:W.color},{name:"text-background-opacity",type:W.zeroOneNumber},{name:"text-background-padding",type:W.size,triggersBounds:G.any},{name:"text-border-opacity",type:W.zeroOneNumber},{name:"text-border-color",type:W.color},{name:"text-border-width",type:W.size,triggersBounds:G.any},{name:"text-border-style",type:W.borderStyle,triggersBounds:G.any},{name:"text-background-shape",type:W.textBackgroundShape,triggersBounds:G.any},{name:"text-justification",type:W.justification},{name:"box-select-labels",type:W.bool,triggersBounds:G.any}],A=[{name:"events",type:W.bool,triggersZOrder:G.any},{name:"text-events",type:W.bool,triggersZOrder:G.any},{name:"box-selection",type:W.boxSelection,triggersZOrder:G.any}],I=[{name:"display",type:W.display,triggersZOrder:G.any,triggersBounds:G.any,triggersBoundsOfConnectedEdges:G.any,triggersBoundsOfParallelEdges:function q0(z0,K0,R0){if(z0===K0)return!1;return R0.pstyle("curve-style").value==="bezier"}},{name:"visibility",type:W.visibility,triggersZOrder:G.any},{name:"opacity",type:W.zeroOneNumber,triggersZOrder:G.zeroNonZero},{name:"text-opacity",type:W.zeroOneNumber},{name:"min-zoomed-font-size",type:W.size},{name:"z-compound-depth",type:W.zCompoundDepth,triggersZOrder:G.any},{name:"z-index-compare",type:W.zIndexCompare,triggersZOrder:G.any},{name:"z-index",type:W.number,triggersZOrder:G.any}],R=[{name:"overlay-padding",type:W.size,triggersBounds:G.any},{name:"overlay-color",type:W.color},{name:"overlay-opacity",type:W.zeroOneNumber,triggersBounds:G.zeroNonZero},{name:"overlay-shape",type:W.overlayShape,triggersBounds:G.any},{name:"overlay-corner-radius",type:W.cornerRadius}],N=[{name:"underlay-padding",type:W.size,triggersBounds:G.any},{name:"underlay-color",type:W.color},{name:"underlay-opacity",type:W.zeroOneNumber,triggersBounds:G.zeroNonZero},{name:"underlay-shape",type:W.overlayShape,triggersBounds:G.any},{name:"underlay-corner-radius",type:W.cornerRadius}],E=[{name:"transition-property",type:W.propList},{name:"transition-duration",type:W.time},{name:"transition-delay",type:W.time},{name:"transition-timing-function",type:W.easing}],V=function q0(z0,K0){if(K0.value==="label")return-z0.poolIndex();else return K0.pfValue},j=[{name:"height",type:W.nodeSize,triggersBounds:G.any,hashOverride:V},{name:"width",type:W.nodeSize,triggersBounds:G.any,hashOverride:V},{name:"shape",type:W.nodeShape,triggersBounds:G.any},{name:"shape-polygon-points",type:W.polygonPointList,triggersBounds:G.any},{name:"corner-radius",type:W.cornerRadius},{name:"background-color",type:W.color},{name:"background-fill",type:W.fill},{name:"background-opacity",type:W.zeroOneNumber},{name:"background-blacken",type:W.nOneOneNumber},{name:"background-gradient-stop-colors",type:W.colors},{name:"background-gradient-stop-positions",type:W.percentages},{name:"background-gradient-direction",type:W.gradientDirection},{name:"padding",type:W.sizeMaybePercent,triggersBounds:G.any},{name:"padding-relative-to",type:W.paddingRelativeTo,triggersBounds:G.any},{name:"bounds-expansion",type:W.boundsExpansion,triggersBounds:G.any}],T=[{name:"border-color",type:W.color},{name:"border-opacity",type:W.zeroOneNumber},{name:"border-width",type:W.size,triggersBounds:G.any},{name:"border-style",type:W.borderStyle},{name:"border-cap",type:W.lineCap},{name:"border-join",type:W.lineJoin},{name:"border-dash-pattern",type:W.numbers},{name:"border-dash-offset",type:W.number},{name:"border-position",type:W.linePosition}],C=[{name:"outline-color",type:W.color},{name:"outline-opacity",type:W.zeroOneNumber},{name:"outline-width",type:W.size,triggersBounds:G.any},{name:"outline-style",type:W.borderStyle},{name:"outline-offset",type:W.size,triggersBounds:G.any}],$=[{name:"background-image",type:W.urls},{name:"background-image-crossorigin",type:W.bgCrossOrigin},{name:"background-image-opacity",type:W.zeroOneNumbers},{name:"background-image-containment",type:W.bgContainment},{name:"background-image-smoothing",type:W.bools},{name:"background-position-x",type:W.bgPos},{name:"background-position-y",type:W.bgPos},{name:"background-width-relative-to",type:W.bgRelativeTo},{name:"background-height-relative-to",type:W.bgRelativeTo},{name:"background-repeat",type:W.bgRepeat},{name:"background-fit",type:W.bgFit},{name:"background-clip",type:W.bgClip},{name:"background-width",type:W.bgWH},{name:"background-height",type:W.bgWH},{name:"background-offset-x",type:W.bgPos},{name:"background-offset-y",type:W.bgPos}],b=[{name:"position",type:W.position,triggersBounds:G.any},{name:"compound-sizing-wrt-labels",type:W.compoundIncludeLabels,triggersBounds:G.any},{name:"min-width",type:W.size,triggersBounds:G.any},{name:"min-width-bias-left",type:W.sizeMaybePercent,triggersBounds:G.any},{name:"min-width-bias-right",type:W.sizeMaybePercent,triggersBounds:G.any},{name:"min-height",type:W.size,triggersBounds:G.any},{name:"min-height-bias-top",type:W.sizeMaybePercent,triggersBounds:G.any},{name:"min-height-bias-bottom",type:W.sizeMaybePercent,triggersBounds:G.any}],h=[{name:"line-style",type:W.lineStyle},{name:"line-color",type:W.color},{name:"line-fill",type:W.fill},{name:"line-cap",type:W.lineCap},{name:"line-opacity",type:W.zeroOneNumber},{name:"line-dash-pattern",type:W.numbers},{name:"line-dash-offset",type:W.number},{name:"line-outline-width",type:W.size},{name:"line-outline-color",type:W.color},{name:"line-gradient-stop-colors",type:W.colors},{name:"line-gradient-stop-positions",type:W.percentages},{name:"curve-style",type:W.curveStyle,triggersBounds:G.any,triggersBoundsOfParallelEdges:function q0(z0,K0){if(z0===K0)return!1;return z0==="bezier"||K0==="bezier"}},{name:"haystack-radius",type:W.zeroOneNumber,triggersBounds:G.any},{name:"source-endpoint",type:W.edgeEndpoint,triggersBounds:G.any},{name:"target-endpoint",type:W.edgeEndpoint,triggersBounds:G.any},{name:"control-point-step-size",type:W.size,triggersBounds:G.any},{name:"control-point-distances",type:W.bidirectionalSizes,triggersBounds:G.any},{name:"control-point-weights",type:W.numbers,triggersBounds:G.any},{name:"segment-distances",type:W.bidirectionalSizes,triggersBounds:G.any},{name:"segment-weights",type:W.numbers,triggersBounds:G.any},{name:"segment-radii",type:W.numbers,triggersBounds:G.any},{name:"radius-type",type:W.radiusType,triggersBounds:G.any},{name:"taxi-turn",type:W.bidirectionalSizeMaybePercent,triggersBounds:G.any},{name:"taxi-turn-min-distance",type:W.size,triggersBounds:G.any},{name:"taxi-direction",type:W.axisDirection,triggersBounds:G.any},{name:"taxi-radius",type:W.number,triggersBounds:G.any},{name:"edge-distances",type:W.edgeDistances,triggersBounds:G.any},{name:"arrow-scale",type:W.positiveNumber,triggersBounds:G.any},{name:"loop-direction",type:W.angle,triggersBounds:G.any},{name:"loop-sweep",type:W.angle,triggersBounds:G.any},{name:"source-distance-from-node",type:W.size,triggersBounds:G.any},{name:"target-distance-from-node",type:W.size,triggersBounds:G.any}],_=[{name:"ghost",type:W.bool,triggersBounds:G.any},{name:"ghost-offset-x",type:W.bidirectionalSize,triggersBounds:G.any},{name:"ghost-offset-y",type:W.bidirectionalSize,triggersBounds:G.any},{name:"ghost-opacity",type:W.zeroOneNumber}],S=[{name:"selection-box-color",type:W.color},{name:"selection-box-opacity",type:W.zeroOneNumber},{name:"selection-box-border-color",type:W.color},{name:"selection-box-border-width",type:W.size},{name:"active-bg-color",type:W.color},{name:"active-bg-opacity",type:W.zeroOneNumber},{name:"active-bg-size",type:W.size},{name:"outside-texture-bg-color",type:W.color},{name:"outside-texture-bg-opacity",type:W.zeroOneNumber}],v=[];t4.pieBackgroundN=16,v.push({name:"pie-size",type:W.sizeMaybePercent}),v.push({name:"pie-hole",type:W.sizeMaybePercent}),v.push({name:"pie-start-angle",type:W.angle});for(var f=1;f<=t4.pieBackgroundN;f++)v.push({name:"pie-"+f+"-background-color",type:W.color}),v.push({name:"pie-"+f+"-background-size",type:W.percent}),v.push({name:"pie-"+f+"-background-opacity",type:W.zeroOneNumber});var x=[];t4.stripeBackgroundN=16,x.push({name:"stripe-size",type:W.sizeMaybePercent}),x.push({name:"stripe-direction",type:W.axisDirectionPrimary});for(var y=1;y<=t4.stripeBackgroundN;y++)x.push({name:"stripe-"+y+"-background-color",type:W.color}),x.push({name:"stripe-"+y+"-background-size",type:W.percent}),x.push({name:"stripe-"+y+"-background-opacity",type:W.zeroOneNumber});var m=[],g=t4.arrowPrefixes=["source","mid-source","target","mid-target"];[{name:"arrow-shape",type:W.arrowShape,triggersBounds:G.any},{name:"arrow-color",type:W.color},{name:"arrow-fill",type:W.arrowFill},{name:"arrow-width",type:W.arrowWidth}].forEach(function(q0){g.forEach(function(z0){var K0=z0+"-"+q0.name,R0=q0.type,Y0=q0.triggersBounds;m.push({name:K0,type:R0,triggersBounds:Y0})})},{});var p=t4.properties=[].concat(A,E,I,R,N,_,L,M,H,q,F,j,T,C,$,v,x,b,h,m,S),i=t4.propertyGroups={behavior:A,transition:E,visibility:I,overlay:R,underlay:N,ghost:_,commonLabel:L,labelDimensions:M,mainLabel:H,sourceLabel:q,targetLabel:F,nodeBody:j,nodeBorder:T,nodeOutline:C,backgroundImage:$,pie:v,stripe:x,compound:b,edgeLine:h,edgeArrow:m,core:S},l=t4.propertyGroupNames={},a=t4.propertyGroupKeys=Object.keys(i);a.forEach(function(q0){l[q0]=i[q0].map(function(z0){return z0.name}),i[q0].forEach(function(z0){return z0.groupKey=q0})});var e=t4.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"}];t4.propertyNames=p.map(function(q0){return q0.name});for(var G0=0;G0<p.length;G0++){var U0=p[G0];p[U0.name]=U0}for(var O0=0;O0<e.length;O0++){var X0=e[O0],E0=p[X0.pointsTo],W0={name:X0.name,alias:!0,pointsTo:E0};p.push(W0),p[X0.name]=W0}})();t4.getDefaultProperty=function(J){return this.getDefaultProperties()[J]};t4.getDefaultProperties=function(){var J=this._private;if(J.defaultProperties!=null)return J.defaultProperties;var Q=HJ({"selection-box-color":"#ddd","selection-box-opacity":0.65,"selection-box-border-color":"#aaa","selection-box-border-width":1,"active-bg-color":"black","active-bg-opacity":0.15,"active-bg-size":30,"outside-texture-bg-color":"#000","outside-texture-bg-opacity":0.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(G,W){for(var H=1;H<=t4.pieBackgroundN;H++){var q=W.name.replace("{{i}}",H),F=W.value;G[q]=F}return G},{}),{"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(G,W){for(var H=1;H<=t4.stripeBackgroundN;H++){var q=W.name.replace("{{i}}",H),F=W.value;G[q]=F}return G},{}),{"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":0.5,"segment-weights":0.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(G,W){return t4.arrowPrefixes.forEach(function(H){var q=H+"-"+W.name,F=W.value;G[q]=F}),G},{})),Z={};for(var U=0;U<this.properties.length;U++){var K=this.properties[U];if(K.pointsTo)continue;var X=K.name,Y=Q[X],z=this.parse(X,Y);Z[X]=z}return J.defaultProperties=Z,J.defaultProperties};t4.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":0.25}),this.defaultLength=this.length};Bx={};Bx.parse=function(J,Q,Z,U){var K=this;if(N4(Q))return K.parseImplWarn(J,Q,Z,U);var X=U==="mapping"||U===!0||U===!1||U==null?"dontcare":U,Y=Z?"t":"f",z=""+Q,G=cx0(J,z,Y,X),W=K.propCache=K.propCache||[],H;if(!(H=W[G]))H=W[G]=K.parseImplWarn(J,Q,Z,U);if(Z||U==="mapping"){if(H=Az(H),H)H.value=Az(H.value)}return H};Bx.parseImplWarn=function(J,Q,Z,U){var K=this.parseImpl(J,Q,Z,U);if(!K&&Q!=null)e9("The style property `".concat(J,": ").concat(Q,"` is invalid"));if(K&&(K.name==="width"||K.name==="height")&&Q==="label")e9("The style value of `label` is deprecated for `"+K.name+"`");return K};Bx.parseImpl=function(J,Q,Z,U){var K=this;J=LJ0(J);var X=K.properties[J],Y=Q,z=K.types;if(!X)return null;if(Q===void 0)return null;if(X.alias)X=X.pointsTo,J=X.name;var G=JJ(Q);if(G)Q=Q.trim();var W=X.type;if(!W)return null;if(Z&&(Q===""||Q===null))return{name:J,value:Q,bypass:!0,deleteBypass:!0};if(N4(Q))return{name:J,value:Q,strValue:"fn",mapped:z.fn,bypass:Z};var H,q;if(!G||U||Q.length<7||Q[1]!=="a");else if(Q.length>=7&&Q[0]==="d"&&(H=new RegExp(z.data.regex).exec(Q))){if(Z)return!1;var F=z.data;return{name:J,value:H,strValue:""+Q,mapped:F,field:H[1],bypass:Z}}else if(Q.length>=10&&Q[0]==="m"&&(q=new RegExp(z.mapData.regex).exec(Q))){if(Z)return!1;if(W.multiple)return!1;var M=z.mapData;if(!(W.color||W.number))return!1;var L=this.parse(J,q[4]);if(!L||L.mapped)return!1;var A=this.parse(J,q[5]);if(!A||A.mapped)return!1;if(L.pfValue===A.pfValue||L.strValue===A.strValue)return e9("`"+J+": "+Q+"` is not a valid mapper because the output range is zero; converting to `"+J+": "+L.strValue+"`"),this.parse(J,L.strValue);else if(W.color){var I=L.value,R=A.value,N=I[0]===R[0]&&I[1]===R[1]&&I[2]===R[2]&&(I[3]===R[3]||(I[3]==null||I[3]===1)&&(R[3]==null||R[3]===1));if(N)return!1}return{name:J,value:q,strValue:""+Q,mapped:M,field:q[1],fieldMin:parseFloat(q[2]),fieldMax:parseFloat(q[3]),valueMin:L.value,valueMax:A.value,bypass:Z}}if(W.multiple&&U!=="multiple"){var E;if(G)E=Q.split(/\s+/);else if(E7(Q))E=Q;else E=[Q];if(W.evenMultiple&&E.length%2!==0)return null;var V=[],j=[],T=[],C="",$=!1;for(var b=0;b<E.length;b++){var h=K.parse(J,E[b],Z,"multiple");$=$||JJ(h.value),V.push(h.value),T.push(h.pfValue!=null?h.pfValue:h.value),j.push(h.units),C+=(b>0?" ":"")+h.strValue}if(W.validate&&!W.validate(V,j))return null;if(W.singleEnum&&$)if(V.length===1&&JJ(V[0]))return{name:J,value:V[0],strValue:V[0],bypass:Z};else return null;return{name:J,value:V,pfValue:T,strValue:C,bypass:Z,units:j}}var _=function E0(){for(var W0=0;W0<W.enums.length;W0++){var q0=W.enums[W0];if(q0===Q)return{name:J,value:Q,strValue:""+Q,bypass:Z}}return null};if(W.number){var S,v="px";if(W.units)S=W.units;if(W.implicitUnits)v=W.implicitUnits;if(!W.unitless){if(G){var f="px|em"+(W.allowPercent?"|\\%":"");if(S)f=S;var x=Q.match("^("+VQ+")("+f+")?$");if(x)Q=x[1],S=x[2]||v}else if(!S||W.implicitUnits)S=v}if(Q=parseFloat(Q),isNaN(Q)&&W.enums===void 0)return null;if(isNaN(Q)&&W.enums!==void 0)return Q=Y,_();if(W.integer&&!MT6(Q))return null;if(W.min!==void 0&&(Q<W.min||W.strictMin&&Q===W.min)||W.max!==void 0&&(Q>W.max||W.strictMax&&Q===W.max))return null;var y={name:J,value:Q,strValue:""+Q+(S?S:""),units:S,bypass:Z};if(W.unitless||S!=="px"&&S!=="em")y.pfValue=Q;else y.pfValue=S==="px"||!S?Q:this.getEmSizeInPixels()*Q;if(S==="ms"||S==="s")y.pfValue=S==="ms"?Q:1000*Q;if(S==="deg"||S==="rad")y.pfValue=S==="rad"?Q:jC6(Q);if(S==="%")y.pfValue=Q/100;return y}else if(W.propList){var m=[],g=""+Q;if(g==="none");else{var p=g.split(/\s*,\s*|\s+/);for(var i=0;i<p.length;i++){var l=p[i].trim();if(K.properties[l])m.push(l);else e9("`"+l+"` is not a valid property name")}if(m.length===0)return null}return{name:J,value:m,strValue:m.length===0?"none":m.join(" "),bypass:Z}}else if(W.color){var a=xx0(Q);if(!a)return null;return{name:J,value:a,pfValue:a,strValue:"rgb("+a[0]+","+a[1]+","+a[2]+")",bypass:Z}}else if(W.regex||W.regexes){if(W.enums){var e=_();if(e)return e}var G0=W.regexes?W.regexes:[W.regex];for(var U0=0;U0<G0.length;U0++){var O0=new RegExp(G0[U0]),X0=O0.exec(Q);if(X0)return{name:J,value:W.singleRegexMatchValue?X0[1]:X0,strValue:""+Q,bypass:Z}}return null}else if(W.string)return{name:J,value:""+Q,strValue:""+Q,bypass:Z};else if(W.enums)return _();else return null};QU=aQ.prototype;QU.instanceString=function(){return"style"};QU.clear=function(){var J=this._private,Q=J.cy,Z=Q.elements();for(var U=0;U<this.length;U++)this[U]=void 0;return this.length=0,J.contextStyles={},J.propDiffs={},this.cleanElements(Z,!0),Z.forEach(function(K){var X=K[0]._private;X.styleDirty=!0,X.appliedInitStyle=!1}),this};QU.resetToDefault=function(){return this.clear(),this.addDefaultStylesheet(),this};QU.core=function(J){return this._private.coreStyle[J]||this.getDefaultProperty(J)};QU.selector=function(J){var Q=J==="core"?null:new mq(J),Z=this.length++;return this[Z]={selector:Q,properties:[],mappedProperties:[],index:Z},this};QU.css=function(){var J=this,Q=arguments;if(Q.length===1){var Z=Q[0];for(var U=0;U<J.properties.length;U++){var K=J.properties[U],X=Z[K.name];if(X===void 0)X=Z[eb(K.name)];if(X!==void 0)this.cssRule(K.name,X)}}else if(Q.length===2)this.cssRule(Q[0],Q[1]);return this};QU.style=QU.css;QU.cssRule=function(J,Q){var Z=this.parse(J,Q);if(Z){var U=this.length-1;if(this[U].properties.push(Z),this[U].properties[Z.name]=Z,Z.name.match(/pie-(\d+)-background-size/)&&Z.value)this._private.hasPie=!0;if(Z.name.match(/stripe-(\d+)-background-size/)&&Z.value)this._private.hasStripe=!0;if(Z.mapped)this[U].mappedProperties.push(Z);var K=!this[U].selector;if(K)this._private.coreStyle[Z.name]=Z}return this};QU.append=function(J){if(fx0(J))J.appendToStyle(this);else if(E7(J))this.appendFromJson(J);else if(JJ(J))this.appendFromString(J);return this};aQ.fromJson=function(J,Q){var Z=new aQ(J);return Z.fromJson(Q),Z};aQ.fromString=function(J,Q){return new aQ(J).fromString(Q)};[oQ,Tj,vJ0,Iz,Fx,kJ0,t4,Bx].forEach(function(J){HJ(QU,J)});aQ.types=QU.types;aQ.properties=QU.properties;aQ.propertyGroups=QU.propertyGroups;aQ.propertyGroupNames=QU.propertyGroupNames;aQ.propertyGroupKeys=QU.propertyGroupKeys;Cv6={style:function J(Q){if(Q){var Z=this.setStyle(Q);Z.update()}return this._private.style},setStyle:function J(Q){var Z=this._private;if(fx0(Q))Z.style=Q.generateStyle(this);else if(E7(Q))Z.style=aQ.fromJson(this,Q);else if(JJ(Q))Z.style=aQ.fromString(this,Q);else Z.style=aQ(this);return Z.style},updateStyle:function J(){this.mutableElements().updateStyle()}},hB={autolock:function J(Q){if(Q!==void 0)this._private.autolock=Q?!0:!1;else return this._private.autolock;return this},autoungrabify:function J(Q){if(Q!==void 0)this._private.autoungrabify=Q?!0:!1;else return this._private.autoungrabify;return this},autounselectify:function J(Q){if(Q!==void 0)this._private.autounselectify=Q?!0:!1;else return this._private.autounselectify;return this},selectionType:function J(Q){var Z=this._private;if(Z.selectionType==null)Z.selectionType=Sv6;if(Q!==void 0){if(Q==="additive"||Q==="single")Z.selectionType=Q}else return Z.selectionType;return this},panningEnabled:function J(Q){if(Q!==void 0)this._private.panningEnabled=Q?!0:!1;else return this._private.panningEnabled;return this},userPanningEnabled:function J(Q){if(Q!==void 0)this._private.userPanningEnabled=Q?!0:!1;else return this._private.userPanningEnabled;return this},zoomingEnabled:function J(Q){if(Q!==void 0)this._private.zoomingEnabled=Q?!0:!1;else return this._private.zoomingEnabled;return this},userZoomingEnabled:function J(Q){if(Q!==void 0)this._private.userZoomingEnabled=Q?!0:!1;else return this._private.userZoomingEnabled;return this},boxSelectionEnabled:function J(Q){if(Q!==void 0)this._private.boxSelectionEnabled=Q?!0:!1;else return this._private.boxSelectionEnabled;return this},pan:function J(){var Q=arguments,Z=this._private.pan,U,K,X,Y,z;switch(Q.length){case 0:return Z;case 1:if(JJ(Q[0]))return U=Q[0],Z[U];else if(C9(Q[0])){if(!this._private.panningEnabled)return this;if(X=Q[0],Y=X.x,z=X.y,A8(Y))Z.x=Y;if(A8(z))Z.y=z;this.emit("pan viewport")}break;case 2:if(!this._private.panningEnabled)return this;if(U=Q[0],K=Q[1],(U==="x"||U==="y")&&A8(K))Z[U]=K;this.emit("pan viewport");break}return this.notify("viewport"),this},panBy:function J(Q,Z){var U=arguments,K=this._private.pan,X,Y,z,G,W;if(!this._private.panningEnabled)return this;switch(U.length){case 1:if(C9(Q)){if(z=U[0],G=z.x,W=z.y,A8(G))K.x+=G;if(A8(W))K.y+=W;this.emit("pan viewport")}break;case 2:if(X=Q,Y=Z,(X==="x"||X==="y")&&A8(Y))K[X]+=Y;this.emit("pan viewport");break}return this.notify("viewport"),this},gc:function J(){this.notify("gc")},fit:function J(Q,Z){var U=this.getFitViewport(Q,Z);if(U){var K=this._private;K.zoom=U.zoom,K.pan=U.pan,this.emit("pan zoom viewport"),this.notify("viewport")}return this},getFitViewport:function J(Q,Z){if(A8(Q)&&Z===void 0)Z=Q,Q=void 0;if(!this._private.panningEnabled||!this._private.zoomingEnabled)return;var U;if(JJ(Q)){var K=Q;Q=this.$(K)}else if(AT6(Q)){var X=Q;U={x1:X.x1,y1:X.y1,x2:X.x2,y2:X.y2},U.w=U.x2-U.x1,U.h=U.y2-U.y1}else if(!VK(Q))Q=this.mutableElements();if(VK(Q)&&Q.empty())return;U=U||Q.boundingBox();var Y=this.width(),z=this.height(),G;if(Z=A8(Z)?Z:0,!isNaN(Y)&&!isNaN(z)&&Y>0&&z>0&&!isNaN(U.w)&&!isNaN(U.h)&&U.w>0&&U.h>0){G=Math.min((Y-2*Z)/U.w,(z-2*Z)/U.h),G=G>this._private.maxZoom?this._private.maxZoom:G,G=G<this._private.minZoom?this._private.minZoom:G;var W={x:(Y-G*(U.x1+U.x2))/2,y:(z-G*(U.y1+U.y2))/2};return{zoom:G,pan:W}}return},zoomRange:function J(Q,Z){var U=this._private;if(Z==null){var K=Q;Q=K.min,Z=K.max}if(A8(Q)&&A8(Z)&&Q<=Z)U.minZoom=Q,U.maxZoom=Z;else if(A8(Q)&&Z===void 0&&Q<=U.maxZoom)U.minZoom=Q;else if(A8(Z)&&Q===void 0&&Z>=U.minZoom)U.maxZoom=Z;return this},minZoom:function J(Q){if(Q===void 0)return this._private.minZoom;else return this.zoomRange({min:Q})},maxZoom:function J(Q){if(Q===void 0)return this._private.maxZoom;else return this.zoomRange({max:Q})},getZoomedViewport:function J(Q){var Z=this._private,U=Z.pan,K=Z.zoom,X,Y,z=!1;if(!Z.zoomingEnabled)z=!0;if(A8(Q))Y=Q;else if(C9(Q)){if(Y=Q.level,Q.position!=null)X=Zx(Q.position,K,U);else if(Q.renderedPosition!=null)X=Q.renderedPosition;if(X!=null&&!Z.panningEnabled)z=!0}if(Y=Y>Z.maxZoom?Z.maxZoom:Y,Y=Y<Z.minZoom?Z.minZoom:Y,z||!A8(Y)||Y===K||X!=null&&(!A8(X.x)||!A8(X.y)))return null;if(X!=null){var G=U,W=K,H=Y,q={x:-H/W*(X.x-G.x)+X.x,y:-H/W*(X.y-G.y)+X.y};return{zoomed:!0,panned:!0,zoom:H,pan:q}}else return{zoomed:!0,panned:!1,zoom:Y,pan:U}},zoom:function J(Q){if(Q===void 0)return this._private.zoom;else{var Z=this.getZoomedViewport(Q),U=this._private;if(Z==null||!Z.zoomed)return this;if(U.zoom=Z.zoom,Z.panned)U.pan.x=Z.pan.x,U.pan.y=Z.pan.y;return this.emit("zoom"+(Z.panned?" pan":"")+" viewport"),this.notify("viewport"),this}},viewport:function J(Q){var Z=this._private,U=!0,K=!0,X=[],Y=!1,z=!1;if(!Q)return this;if(!A8(Q.zoom))U=!1;if(!C9(Q.pan))K=!1;if(!U&&!K)return this;if(U){var G=Q.zoom;if(G<Z.minZoom||G>Z.maxZoom||!Z.zoomingEnabled)Y=!0;else Z.zoom=G,X.push("zoom")}if(K&&(!Y||!Q.cancelOnFailedZoom)&&Z.panningEnabled){var W=Q.pan;if(A8(W.x))Z.pan.x=W.x,z=!1;if(A8(W.y))Z.pan.y=W.y,z=!1;if(!z)X.push("pan")}if(X.length>0)X.push("viewport"),this.emit(X.join(" ")),this.notify("viewport");return this},center:function J(Q){var Z=this.getCenterPan(Q);if(Z)this._private.pan=Z,this.emit("pan viewport"),this.notify("viewport");return this},getCenterPan:function J(Q,Z){if(!this._private.panningEnabled)return;if(JJ(Q)){var U=Q;Q=this.mutableElements().filter(U)}else if(!VK(Q))Q=this.mutableElements();if(Q.length===0)return;var K=Q.boundingBox(),X=this.width(),Y=this.height();Z=Z===void 0?this._private.zoom:Z;var z={x:(X-Z*(K.x1+K.x2))/2,y:(Y-Z*(K.y1+K.y2))/2};return z},reset:function J(){if(!this._private.panningEnabled||!this._private.zoomingEnabled)return this;return this.viewport({pan:{x:0,y:0},zoom:1}),this},invalidateSize:function J(){this._private.sizeCache=null},size:function J(){var Q=this._private,Z=Q.container,U=this;return Q.sizeCache=Q.sizeCache||(Z?function(){var K=U.window().getComputedStyle(Z),X=function Y(z){return parseFloat(K.getPropertyValue(z))};return{width:Z.clientWidth-X("padding-left")-X("padding-right"),height:Z.clientHeight-X("padding-top")-X("padding-bottom")}}():{width:1,height:1})},width:function J(){return this.size().width},height:function J(){return this.size().height},extent:function J(){var Q=this._private.pan,Z=this._private.zoom,U=this.renderedExtent(),K={x1:(U.x1-Q.x)/Z,x2:(U.x2-Q.x)/Z,y1:(U.y1-Q.y)/Z,y2:(U.y2-Q.y)/Z};return K.w=K.x2-K.x1,K.h=K.y2-K.y1,K},renderedExtent:function J(){var Q=this.width(),Z=this.height();return{x1:0,y1:0,x2:Q,y2:Z,w:Q,h:Z}},multiClickDebounceTime:function J(Q){if(Q)this._private.multiClickDebounceTime=Q;else return this._private.multiClickDebounceTime;return this}};hB.centre=hB.center;hB.autolockNodes=hB.autolock;hB.autoungrabifyNodes=hB.autoungrabify;Lj={data:t9.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeData:t9.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),scratch:t9.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:t9.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0})};Lj.attr=Lj.data;Lj.removeAttr=Lj.removeData;rb=Aj.prototype;HJ(rb,{instanceString:function J(){return"core"},isReady:function J(){return this._private.ready},destroyed:function J(){return this._private.destroyed},ready:function J(Q){if(this.isReady())this.emitter().emit("ready",[],Q);else this.on("ready",Q);return this},destroy:function J(){var Q=this;if(Q.destroyed())return;return Q.stopAnimationLoop(),Q.destroyRenderer(),this.emit("destroy"),Q._private.destroyed=!0,Q},hasElementWithId:function J(Q){return this._private.elements.hasElementWithId(Q)},getElementById:function J(Q){return this._private.elements.getElementById(Q)},hasCompoundNodes:function J(){return this._private.hasCompoundNodes},headless:function J(){return this._private.renderer.isHeadless()},styleEnabled:function J(){return this._private.styleEnabled},addToPool:function J(Q){return this._private.elements.merge(Q),this},removeFromPool:function J(Q){return this._private.elements.unmerge(Q),this},container:function J(){return this._private.container||null},window:function J(){var Q=this._private.container;if(Q==null)return PQ;var Z=this._private.container.ownerDocument;if(Z===void 0||Z==null)return PQ;return Z.defaultView||PQ},mount:function J(Q){if(Q==null)return;var Z=this,U=Z._private,K=U.options;if(!mb(Q)&&mb(Q[0]))Q=Q[0];return Z.stopAnimationLoop(),Z.destroyRenderer(),U.container=Q,U.styleEnabled=!0,Z.invalidateSize(),Z.initRenderer(HJ({},K,K.renderer,{name:K.renderer.name==="null"?"canvas":K.renderer.name})),Z.startAnimationLoop(),Z.style(K.style),Z.emit("mount"),Z},unmount:function J(){var Q=this;return Q.stopAnimationLoop(),Q.destroyRenderer(),Q.initRenderer({name:"null"}),Q.emit("unmount"),Q},options:function J(){return Az(this._private.options)},json:function J(Q){var Z=this,U=Z._private,K=Z.mutableElements(),X=function E(V){return Z.getElementById(V.id())};if(C9(Q)){if(Z.startBatch(),Q.elements){var Y={},z=function E(V,j){var T=[],C=[];for(var $=0;$<V.length;$++){var b=V[$];if(!b.data.id){e9("cy.json() cannot handle elements without an ID attribute");continue}var h=""+b.data.id,_=Z.getElementById(h);if(Y[h]=!0,_.length!==0)C.push({ele:_,json:b});else if(j)b.group=j,T.push(b);else T.push(b)}Z.add(T);for(var S=0;S<C.length;S++){var v=C[S],f=v.ele,x=v.json;f.json(x)}};if(E7(Q.elements))z(Q.elements);else{var G=["nodes","edges"];for(var W=0;W<G.length;W++){var H=G[W],q=Q.elements[H];if(E7(q))z(q,H)}}var F=Z.collection();K.filter(function(E){return!Y[E.id()]}).forEach(function(E){if(E.isParent())F.merge(E);else E.remove()}),F.forEach(function(E){return E.children().move({parent:null})}),F.forEach(function(E){return X(E).remove()})}if(Q.style)Z.style(Q.style);if(Q.zoom!=null&&Q.zoom!==U.zoom)Z.zoom(Q.zoom);if(Q.pan){if(Q.pan.x!==U.pan.x||Q.pan.y!==U.pan.y)Z.pan(Q.pan)}if(Q.data)Z.data(Q.data);var M=["minZoom","maxZoom","zoomingEnabled","userZoomingEnabled","panningEnabled","userPanningEnabled","boxSelectionEnabled","autolock","autoungrabify","autounselectify","multiClickDebounceTime"];for(var L=0;L<M.length;L++){var A=M[L];if(Q[A]!=null)Z[A](Q[A])}return Z.endBatch(),this}else{var I=!!Q,R={};if(I)R.elements=this.elements().map(function(E){return E.json()});else R.elements={},K.forEach(function(E){var V=E.group();if(!R.elements[V])R.elements[V]=[];R.elements[V].push(E.json())});if(this._private.styleEnabled)R.style=Z.style().json();R.data=Az(Z.data());var N=U.options;return R.zoomingEnabled=U.zoomingEnabled,R.userZoomingEnabled=U.userZoomingEnabled,R.zoom=U.zoom,R.minZoom=U.minZoom,R.maxZoom=U.maxZoom,R.panningEnabled=U.panningEnabled,R.userPanningEnabled=U.userPanningEnabled,R.pan=Az(U.pan),R.boxSelectionEnabled=U.boxSelectionEnabled,R.renderer=Az(N.renderer),R.hideEdgesOnViewport=N.hideEdgesOnViewport,R.textureOnViewport=N.textureOnViewport,R.wheelSensitivity=N.wheelSensitivity,R.motionBlur=N.motionBlur,R.multiClickDebounceTime=N.multiClickDebounceTime,R}}});rb.$id=rb.getElementById;[Iv6,Ev6,fh0,UJ0,_b,Pv6,KJ0,bb,Cv6,hB,Lj].forEach(function(J){HJ(rb,J)});$v6={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 J(Q,Z){return!0},ready:void 0,stop:void 0,transform:function J(Q,Z){return Z}},vv6={maximal:!1,acyclic:!1};_h0.prototype.run=function(){var J=this.options,Q=J.cy,Z=J.eles,U=Z.nodes().filter(function(z6){return z6.isChildless()}),K=Z,X=J.directed,Y=J.acyclic||J.maximal||J.maximalAdjustments>0,z=!!J.boundingBox,G=fU(z?J.boundingBox:structuredClone(Q.extent())),W;if(VK(J.roots))W=J.roots;else if(E7(J.roots)){var H=[];for(var q=0;q<J.roots.length;q++){var F=J.roots[q],M=Q.getElementById(F);H.push(M)}W=Q.collection(H)}else if(JJ(J.roots))W=Q.$(J.roots);else if(X)W=U.roots();else{var L=Z.components();W=Q.collection();var A=function z6(){var t=L[I],N0=t.maxDegree(!1),f0=t.filter(function(l0){return l0.degree(!1)===N0});W=W.add(f0)};for(var I=0;I<L.length;I++)A()}var R=[],N={},E=function z6(t,N0){if(R[N0]==null)R[N0]=[];var f0=R[N0].length;R[N0].push(t),Qx0(t,{index:f0,depth:N0})},V=function z6(t,N0){var f0=fA(t),l0=f0.depth,k0=f0.index;if(R[l0][k0]=null,t.isChildless())E(t,N0)};K.bfs({roots:W,directed:J.directed,visit:function z6(t,N0,f0,l0,k0){var _0=t[0],g0=_0.id();if(_0.isChildless())E(_0,k0);N[g0]=!0}});var j=[];for(var T=0;T<U.length;T++){var C=U[T];if(N[C.id()])continue;else j.push(C)}var $=function z6(t){var N0=R[t];for(var f0=0;f0<N0.length;f0++){var l0=N0[f0];if(l0==null){N0.splice(f0,1),f0--;continue}Qx0(l0,{depth:t,index:f0})}},b=function z6(t,N0){var f0=fA(t),l0=t.incomers().filter(function(y0){return y0.isNode()&&Z.has(y0)}),k0=-1,_0=t.id();for(var g0=0;g0<l0.length;g0++){var h0=l0[g0],t0=fA(h0);k0=Math.max(k0,t0.depth)}if(f0.depth<=k0){if(!J.acyclic&&N0[_0])return null;var C0=k0+1;return V(t,C0),N0[_0]=C0,!0}return!1};if(X&&Y){var h=[],_={},S=function z6(t){return h.push(t)},v=function z6(){return h.shift()};U.forEach(function(z6){return h.push(z6)});while(h.length>0){var f=v(),x=b(f,_);if(x)f.outgoers().filter(function(z6){return z6.isNode()&&Z.has(z6)}).forEach(S);else if(x===null){e9("Detected double maximal shift for node `"+f.id()+"`. Bailing maximal adjustment due to cycle. Use `options.maximal: true` only on DAGs.");break}}}var y=0;if(J.avoidOverlap)for(var m=0;m<U.length;m++){var g=U[m],p=g.layoutDimensions(J),i=p.w,l=p.h;y=Math.max(y,i,l)}var a={},e=function z6(t){if(a[t.id()])return a[t.id()];var N0=fA(t).depth,f0=t.neighborhood(),l0=0,k0=0;for(var _0=0;_0<f0.length;_0++){var g0=f0[_0];if(g0.isEdge()||g0.isParent()||!U.has(g0))continue;var h0=fA(g0);if(h0==null)continue;var{index:t0,depth:C0}=h0;if(t0==null||C0==null)continue;var y0=R[C0].length;if(C0<N0)l0+=t0/y0,k0++}if(k0=Math.max(1,k0),l0=l0/k0,k0===0)l0=0;return a[t.id()]=l0,l0},G0=function z6(t,N0){var f0=e(t),l0=e(N0),k0=f0-l0;if(k0===0)return bx0(t.id(),N0.id());else return k0};if(J.depthSort!==void 0)G0=J.depthSort;var U0=R.length;for(var O0=0;O0<U0;O0++)R[O0].sort(G0),$(O0);var X0=[];for(var E0=0;E0<j.length;E0++)X0.push(j[E0]);var W0=function z6(){for(var t=0;t<U0;t++)$(t)};if(X0.length)R.unshift(X0),U0=R.length,W0();var q0=0;for(var z0=0;z0<U0;z0++)q0=Math.max(R[z0].length,q0);var K0={x:G.x1+G.w/2,y:G.y1+G.h/2},R0=U.reduce(function(z6,t){return function(N0){return{w:z6.w===-1?N0.w:(z6.w+N0.w)/2,h:z6.h===-1?N0.h:(z6.h+N0.h)/2}}(t.boundingBox({includeLabels:J.nodeDimensionsIncludeLabels}))},{w:-1,h:-1}),Y0=Math.max(U0===1?0:z?(G.h-J.padding*2-R0.h)/(U0-1):(G.h-J.padding*2-R0.h)/(U0+1),y),P0=R.reduce(function(z6,t){return Math.max(z6,t.length)},0),F0=function z6(t){var N0=fA(t),f0=N0.depth,l0=N0.index;if(J.circle){var k0=Math.min(G.w/2/U0,G.h/2/U0);k0=Math.max(k0,y);var _0=k0*f0+k0-(U0>0&&R[0].length<=3?k0/2:0),g0=2*Math.PI/R[f0].length*l0;if(f0===0&&R[0].length===1)_0=1;return{x:K0.x+_0*Math.cos(g0),y:K0.y+_0*Math.sin(g0)}}else{var h0=R[f0].length,t0=Math.max(h0===1?0:z?(G.w-J.padding*2-R0.w)/((J.grid?P0:h0)-1):(G.w-J.padding*2-R0.w)/((J.grid?P0:h0)+1),y),C0={x:K0.x+(l0+1-(h0+1)/2)*t0,y:K0.y+(f0+1-(U0+1)/2)*Y0};return C0}},m0={downward:0,leftward:90,upward:180,rightward:-90};if(Object.keys(m0).indexOf(J.direction)===-1)U4("Invalid direction '".concat(J.direction,"' specified for breadthfirst layout. Valid values are: ").concat(Object.keys(m0).join(", ")));var J0=function z6(t){return rT6(F0(t),G,m0[J.direction])};return Z.nodes().layoutPositions(this,J,J0),this};kv6={fit:!0,padding:30,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,spacingFactor:void 0,radius:void 0,startAngle:1.5*Math.PI,sweep:void 0,clockwise:!0,sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function J(Q,Z){return!0},ready:void 0,stop:void 0,transform:function J(Q,Z){return Z}};bh0.prototype.run=function(){var J=this.options,Q=J,Z=J.cy,U=Q.eles,K=Q.counterclockwise!==void 0?!Q.counterclockwise:Q.clockwise,X=U.nodes().not(":parent");if(Q.sort)X=X.sort(Q.sort);var Y=fU(Q.boundingBox?Q.boundingBox:{x1:0,y1:0,w:Z.width(),h:Z.height()}),z={x:Y.x1+Y.w/2,y:Y.y1+Y.h/2},G=Q.sweep===void 0?2*Math.PI-2*Math.PI/X.length:Q.sweep,W=G/Math.max(1,X.length-1),H,q=0;for(var F=0;F<X.length;F++){var M=X[F],L=M.layoutDimensions(Q),A=L.w,I=L.h;q=Math.max(q,A,I)}if(A8(Q.radius))H=Q.radius;else if(X.length<=1)H=0;else H=Math.min(Y.h,Y.w)/2-q;if(X.length>1&&Q.avoidOverlap){q*=1.75;var R=Math.cos(W)-Math.cos(0),N=Math.sin(W)-Math.sin(0),E=Math.sqrt(q*q/(R*R+N*N));H=Math.max(E,H)}var V=function j(T,C){var $=Q.startAngle+C*W*(K?1:-1),b=H*Math.cos($),h=H*Math.sin($),_={x:z.x+b,y:z.y+h};return _};return U.nodes().layoutPositions(this,Q,V),this};fv6={fit:!0,padding:30,startAngle:1.5*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 J(Q){return Q.degree()},levelWidth:function J(Q){return Q.maxDegree()/4},animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function J(Q,Z){return!0},ready:void 0,stop:void 0,transform:function J(Q,Z){return Z}};xh0.prototype.run=function(){var J=this.options,Q=J,Z=Q.counterclockwise!==void 0?!Q.counterclockwise:Q.clockwise,U=J.cy,K=Q.eles,X=K.nodes().not(":parent"),Y=fU(Q.boundingBox?Q.boundingBox:{x1:0,y1:0,w:U.width(),h:U.height()}),z={x:Y.x1+Y.w/2,y:Y.y1+Y.h/2},G=[],W=0;for(var H=0;H<X.length;H++){var q=X[H],F=void 0;F=Q.concentric(q),G.push({value:F,node:q}),q._private.scratch.concentric=F}X.updateStyle();for(var M=0;M<X.length;M++){var L=X[M],A=L.layoutDimensions(Q);W=Math.max(W,A.w,A.h)}G.sort(function(Y0,P0){return P0.value-Y0.value});var I=Q.levelWidth(X),R=[[]],N=R[0];for(var E=0;E<G.length;E++){var V=G[E];if(N.length>0){var j=Math.abs(N[0].value-V.value);if(j>=I)N=[],R.push(N)}N.push(V)}var T=W+Q.minNodeSpacing;if(!Q.avoidOverlap){var C=R.length>0&&R[0].length>1,$=Math.min(Y.w,Y.h)/2-T,b=$/(R.length+C?1:0);T=Math.min(T,b)}var h=0;for(var _=0;_<R.length;_++){var S=R[_],v=Q.sweep===void 0?2*Math.PI-2*Math.PI/S.length:Q.sweep,f=S.dTheta=v/Math.max(1,S.length-1);if(S.length>1&&Q.avoidOverlap){var x=Math.cos(f)-Math.cos(0),y=Math.sin(f)-Math.sin(0),m=Math.sqrt(T*T/(x*x+y*y));h=Math.max(m,h)}S.r=h,h+=T}if(Q.equidistant){var g=0,p=0;for(var i=0;i<R.length;i++){var l=R[i],a=l.r-p;g=Math.max(g,a)}p=0;for(var e=0;e<R.length;e++){var G0=R[e];if(e===0)p=G0.r;G0.r=p,p+=g}}var U0={};for(var O0=0;O0<R.length;O0++){var X0=R[O0],E0=X0.dTheta,W0=X0.r;for(var q0=0;q0<X0.length;q0++){var z0=X0[q0],K0=Q.startAngle+(Z?1:-1)*E0*q0,R0={x:z.x+W0*Math.cos(K0),y:z.y+W0*Math.sin(K0)};U0[z0.node.id()]=R0}}return K.nodes().layoutPositions(this,Q,function(Y0){var P0=Y0.id();return U0[P0]}),this};_v6={ready:function J(){},stop:function J(){},animate:!0,animationEasing:void 0,animationDuration:void 0,animateFilter:function J(Q,Z){return!0},animationThreshold:250,refresh:20,fit:!0,padding:30,boundingBox:void 0,nodeDimensionsIncludeLabels:!1,randomize:!1,componentSpacing:40,nodeRepulsion:function J(Q){return 2048},nodeOverlap:4,idealEdgeLength:function J(Q){return 32},edgeElasticity:function J(Q){return 32},nestingFactor:1.2,gravity:1,numIter:1000,initialTemp:1000,coolingFactor:0.99,minTemp:1};Mx.prototype.run=function(){var J=this.options,Q=J.cy,Z=this;if(Z.stopped=!1,J.animate===!0||J.animate===!1)Z.emit({type:"layoutstart",layout:Z});if(J.debug===!0)g80=!0;else g80=!1;var U=bv6(Q,Z,J);if(g80)hv6(U);if(J.randomize)yv6(U);var K=GW(),X=function q(){if(gv6(U,Q,J),J.fit===!0)Q.fit(J.padding)},Y=function q(F){if(Z.stopped||F>=J.numIter)return!1;if(mv6(U,J),U.temperature=U.temperature*J.coolingFactor,U.temperature<J.minTemp)return!1;return!0},z=function q(){if(J.animate===!0||J.animate===!1)X(),Z.one("layoutstop",J.stop),Z.emit({type:"layoutstop",layout:Z});else{var F=J.eles.nodes(),M=yh0(U,J,F);F.layoutPositions(Z,J,M)}},G=0,W=!0;if(J.animate===!0){var H=function q(){var F=0;while(W&&F<J.refresh)W=Y(G),G++,F++;if(!W)Ux0(U,J),z();else{var M=GW();if(M-K>=J.animationThreshold)X();ub(H)}};H()}else{while(W)W=Y(G),G++;Ux0(U,J),z()}return this};Mx.prototype.stop=function(){if(this.stopped=!0,this.thread)this.thread.stop();return this.emit("layoutstop"),this};Mx.prototype.destroy=function(){if(this.thread)this.thread.stop();return this};sv6={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 J(Q){},sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function J(Q,Z){return!0},ready:void 0,stop:void 0,transform:function J(Q,Z){return Z}};mh0.prototype.run=function(){var J=this.options,Q=J,Z=J.cy,U=Q.eles,K=U.nodes().not(":parent");if(Q.sort)K=K.sort(Q.sort);var X=fU(Q.boundingBox?Q.boundingBox:{x1:0,y1:0,w:Z.width(),h:Z.height()});if(X.h===0||X.w===0)U.nodes().layoutPositions(this,Q,function(e){return{x:X.x1,y:X.y1}});else{var Y=K.size(),z=Math.sqrt(Y*X.h/X.w),G=Math.round(z),W=Math.round(X.w/X.h*z),H=function e(G0){if(G0==null)return Math.min(G,W);else{var U0=Math.min(G,W);if(U0==G)G=G0;else W=G0}},q=function e(G0){if(G0==null)return Math.max(G,W);else{var U0=Math.max(G,W);if(U0==G)G=G0;else W=G0}},F=Q.rows,M=Q.cols!=null?Q.cols:Q.columns;if(F!=null&&M!=null)G=F,W=M;else if(F!=null&&M==null)G=F,W=Math.ceil(Y/G);else if(F==null&&M!=null)W=M,G=Math.ceil(Y/W);else if(W*G>Y){var L=H(),A=q();if((L-1)*A>=Y)H(L-1);else if((A-1)*L>=Y)q(A-1)}else while(W*G<Y){var I=H(),R=q();if((R+1)*I>=Y)q(R+1);else H(I+1)}var N=X.w/W,E=X.h/G;if(Q.condense)N=0,E=0;if(Q.avoidOverlap)for(var V=0;V<K.length;V++){var j=K[V],T=j._private.position;if(T.x==null||T.y==null)T.x=0,T.y=0;var C=j.layoutDimensions(Q),$=Q.avoidOverlapPadding,b=C.w+$,h=C.h+$;N=Math.max(N,b),E=Math.max(E,h)}var _={},S=function e(G0,U0){return _["c-"+G0+"-"+U0]?!0:!1},v=function e(G0,U0){_["c-"+G0+"-"+U0]=!0},f=0,x=0,y=function e(){if(x++,x>=W)x=0,f++},m={};for(var g=0;g<K.length;g++){var p=K[g],i=Q.position(p);if(i&&(i.row!==void 0||i.col!==void 0)){var l={row:i.row,col:i.col};if(l.col===void 0){l.col=0;while(S(l.row,l.col))l.col++}else if(l.row===void 0){l.row=0;while(S(l.row,l.col))l.row++}m[p.id()]=l,v(l.row,l.col)}}var a=function e(G0,U0){var O0,X0;if(G0.locked()||G0.isParent())return!1;var E0=m[G0.id()];if(E0)O0=E0.col*N+N/2+X.x1,X0=E0.row*E+E/2+X.y1;else{while(S(f,x))y();O0=x*N+N/2+X.x1,X0=f*E+E/2+X.y1,v(f,x),y()}return{x:O0,y:X0}};K.layoutPositions(this,Q,a)}return this};av6={ready:function J(){},stop:function J(){}};fJ0.prototype.run=function(){var J=this.options,Q=J.eles,Z=this;return J.cy,Z.emit("layoutstart"),Q.nodes().positions(function(){return{x:0,y:0}}),Z.one("layoutready",J.ready),Z.emit("layoutready"),Z.one("layoutstop",J.stop),Z.emit("layoutstop"),this};fJ0.prototype.stop=function(){return this};ov6={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 J(Q,Z){return!0},ready:void 0,stop:void 0,transform:function J(Q,Z){return Z}};uh0.prototype.run=function(){var J=this.options,Q=J.eles,Z=Q.nodes(),U=N4(J.positions);function K(X){if(J.positions==null)return RC6(X.position());if(U)return J.positions(X);var Y=J.positions[X._private.data.id];if(Y==null)return null;return Y}return Z.layoutPositions(this,J,function(X,Y){var z=K(X);if(X.locked()||z==null)return!1;return z}),this};tv6={fit:!0,padding:30,boundingBox:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function J(Q,Z){return!0},ready:void 0,stop:void 0,transform:function J(Q,Z){return Z}};ph0.prototype.run=function(){var J=this.options,Q=J.cy,Z=J.eles,U=fU(J.boundingBox?J.boundingBox:{x1:0,y1:0,w:Q.width(),h:Q.height()}),K=function X(Y,z){return{x:U.x1+Math.round(Math.random()*U.w),y:U.y1+Math.round(Math.random()*U.h)}};return Z.nodes().layoutPositions(this,J,K),this};ev6=[{name:"breadthfirst",impl:_h0},{name:"circle",impl:bh0},{name:"concentric",impl:xh0},{name:"cose",impl:Mx},{name:"grid",impl:mh0},{name:"null",impl:fJ0},{name:"preset",impl:uh0},{name:"random",impl:ph0}];ch0.prototype={recalculateRenderedStyle:Kx0,notify:function J(){this.notifications++},init:Kx0,isHeadless:function J(){return!0},png:Xx0,jpg:Xx0};_J0={};_J0.arrowShapeWidth=0.3;_J0.registerArrowShapes=function(){var J=this.arrowShapes={},Q=this,Z=function G(W,H,q,F,M,L,A){var I=M.x-q/2-A,R=M.x+q/2+A,N=M.y-q/2-A,E=M.y+q/2+A,V=I<=W&&W<=R&&N<=H&&H<=E;return V},U=function G(W,H,q,F,M){var L=W*Math.cos(F)-H*Math.sin(F),A=W*Math.sin(F)+H*Math.cos(F),I=L*q,R=A*q,N=I+M.x,E=R+M.y;return{x:N,y:E}},K=function G(W,H,q,F){var M=[];for(var L=0;L<W.length;L+=2){var A=W[L],I=W[L+1];M.push(U(A,I,H,q,F))}return M},X=function G(W){var H=[];for(var q=0;q<W.length;q++){var F=W[q];H.push(F.x,F.y)}return H},Y=function G(W){return W.pstyle("width").pfValue*W.pstyle("arrow-scale").pfValue*2},z=function G(W,H){if(JJ(H))H=J[H];J[W]=HJ({name:W,points:[-0.15,-0.3,0.15,-0.3,0.15,0.3,-0.15,0.3],collide:function q(F,M,L,A,I,R){var N=X(K(this.points,L+2*R,A,I)),E=_5(F,M,N);return E},roughCollide:Z,draw:function q(F,M,L,A){var I=K(this.points,M,L,A);Q.arrowShapeImpl("polygon")(F,I)},spacing:function q(F){return 0},gap:Y},H)};z("none",{collide:pb,roughCollide:pb,draw:RJ0,spacing:R_0,gap:R_0}),z("triangle",{points:[-0.15,-0.3,0,0,0.15,-0.3]}),z("arrow","triangle"),z("triangle-backcurve",{points:J.triangle.points,controlPoint:[0,-0.15],roughCollide:Z,draw:function G(W,H,q,F,M){var L=K(this.points,H,q,F),A=this.controlPoint,I=U(A[0],A[1],H,q,F);Q.arrowShapeImpl(this.name)(W,L,I)},gap:function G(W){return Y(W)*0.8}}),z("triangle-tee",{points:[0,0,0.15,-0.3,-0.15,-0.3,0,0],pointsTee:[-0.15,-0.4,-0.15,-0.5,0.15,-0.5,0.15,-0.4],collide:function G(W,H,q,F,M,L,A){var I=X(K(this.points,q+2*A,F,M)),R=X(K(this.pointsTee,q+2*A,F,M)),N=_5(W,H,I)||_5(W,H,R);return N},draw:function G(W,H,q,F,M){var L=K(this.points,H,q,F),A=K(this.pointsTee,H,q,F);Q.arrowShapeImpl(this.name)(W,L,A)}}),z("circle-triangle",{radius:0.15,pointsTr:[0,-0.15,0.15,-0.45,-0.15,-0.45,0,-0.15],collide:function G(W,H,q,F,M,L,A){var I=M,R=Math.pow(I.x-W,2)+Math.pow(I.y-H,2)<=Math.pow((q+2*A)*this.radius,2),N=X(K(this.points,q+2*A,F,M));return _5(W,H,N)||R},draw:function G(W,H,q,F,M){var L=K(this.pointsTr,H,q,F);Q.arrowShapeImpl(this.name)(W,L,F.x,F.y,this.radius*H)},spacing:function G(W){return Q.getArrowWidth(W.pstyle("width").pfValue,W.pstyle("arrow-scale").value)*this.radius}}),z("triangle-cross",{points:[0,0,0.15,-0.3,-0.15,-0.3,0,0],baseCrossLinePts:[-0.15,-0.4,-0.15,-0.4,0.15,-0.4,0.15,-0.4],crossLinePts:function G(W,H){var q=this.baseCrossLinePts.slice(),F=H/W,M=3,L=5;return q[M]=q[M]-F,q[L]=q[L]-F,q},collide:function G(W,H,q,F,M,L,A){var I=X(K(this.points,q+2*A,F,M)),R=X(K(this.crossLinePts(q,L),q+2*A,F,M)),N=_5(W,H,I)||_5(W,H,R);return N},draw:function G(W,H,q,F,M){var L=K(this.points,H,q,F),A=K(this.crossLinePts(H,M),H,q,F);Q.arrowShapeImpl(this.name)(W,L,A)}}),z("vee",{points:[-0.15,-0.3,0,0,0.15,-0.3,0,-0.15],gap:function G(W){return Y(W)*0.525}}),z("circle",{radius:0.15,collide:function G(W,H,q,F,M,L,A){var I=M,R=Math.pow(I.x-W,2)+Math.pow(I.y-H,2)<=Math.pow((q+2*A)*this.radius,2);return R},draw:function G(W,H,q,F,M){Q.arrowShapeImpl(this.name)(W,F.x,F.y,this.radius*H)},spacing:function G(W){return Q.getArrowWidth(W.pstyle("width").pfValue,W.pstyle("arrow-scale").value)*this.radius}}),z("tee",{points:[-0.15,0,-0.15,-0.1,0.15,-0.1,0.15,0],spacing:function G(W){return 1},gap:function G(W){return 1}}),z("square",{points:[-0.15,0,0.15,0,0.15,-0.3,-0.15,-0.3]}),z("diamond",{points:[-0.15,-0.15,0,-0.3,0.15,-0.15,0,0],gap:function G(W){return W.pstyle("width").pfValue*W.pstyle("arrow-scale").value}}),z("chevron",{points:[0,0,-0.15,-0.15,-0.1,-0.2,0,-0.1,0.1,-0.2,0.15,-0.15],gap:function G(W){return 0.95*W.pstyle("width").pfValue*W.pstyle("arrow-scale").value}})};gB={};gB.projectIntoViewport=function(J,Q){var Z=this.cy,U=this.findContainerClientCoords(),K=U[0],X=U[1],Y=U[4],z=Z.pan(),G=Z.zoom(),W=((J-K)/Y-z.x)/G,H=((Q-X)/Y-z.y)/G;return[W,H]};gB.findContainerClientCoords=function(){if(this.containerBB)return this.containerBB;var J=this.container,Q=J.getBoundingClientRect(),Z=this.cy.window().getComputedStyle(J),U=function I(R){return parseFloat(Z.getPropertyValue(R))},K={left:U("padding-left"),right:U("padding-right"),top:U("padding-top"),bottom:U("padding-bottom")},X={left:U("border-left-width"),right:U("border-right-width"),top:U("border-top-width"),bottom:U("border-bottom-width")},Y=J.clientWidth,z=J.clientHeight,G=K.left+K.right,W=K.top+K.bottom,H=X.left+X.right,q=Q.width/(Y+H),F=Y-G,M=z-W,L=Q.left+K.left+X.left,A=Q.top+K.top+X.top;return this.containerBB=[L,A,F,M,q]};gB.invalidateContainerClientCoordsCache=function(){this.containerBB=null};gB.findNearestElement=function(J,Q,Z,U){return this.findNearestElements(J,Q,Z,U)[0]};gB.findNearestElements=function(J,Q,Z,U){var K=this,X=this,Y=X.getCachedZSortedEles(),z=[],G=X.cy.zoom(),W=X.cy.hasCompoundNodes(),H=(U?24:8)/G,q=(U?8:2)/G,F=(U?8:2)/G,M=1/0,L,A;if(Z)Y=Y.interactive;function I(C,$){if(C.isNode())if(A)return;else A=C,z.push(C);if(C.isEdge()&&($==null||$<M))if(L){if(L.pstyle("z-compound-depth").value===C.pstyle("z-compound-depth").value&&L.pstyle("z-compound-depth").value===C.pstyle("z-compound-depth").value){for(var b=0;b<z.length;b++)if(z[b].isEdge()){z[b]=C,L=C,M=$!=null?$:M;break}}}else z.push(C),L=C,M=$!=null?$:M}function R(C){var $=C.outerWidth()+2*q,b=C.outerHeight()+2*q,h=$/2,_=b/2,S=C.position(),v=C.pstyle("corner-radius").value==="auto"?"auto":C.pstyle("corner-radius").pfValue,f=C._private.rscratch;if(S.x-h<=J&&J<=S.x+h&&S.y-_<=Q&&Q<=S.y+_){var x=X.nodeShapes[K.getNodeShape(C)];if(x.checkPoint(J,Q,0,$,b,S.x,S.y,v,f))return I(C,0),!0}}function N(C){var $=C._private,b=$.rscratch,h=C.pstyle("width").pfValue,_=C.pstyle("arrow-scale").value,S=h/2+H,v=S*S,f=S*2,g=$.source,p=$.target,x;if(b.edgeType==="segments"||b.edgeType==="straight"||b.edgeType==="haystack"){var y=b.allpts;for(var m=0;m+3<y.length;m+=2)if(fC6(J,Q,y[m],y[m+1],y[m+2],y[m+3],f)&&v>(x=yC6(J,Q,y[m],y[m+1],y[m+2],y[m+3])))return I(C,x),!0}else if(b.edgeType==="bezier"||b.edgeType==="multibezier"||b.edgeType==="self"||b.edgeType==="compound"){var y=b.allpts;for(var m=0;m+5<b.allpts.length;m+=4)if(_C6(J,Q,y[m],y[m+1],y[m+2],y[m+3],y[m+4],y[m+5],f)&&v>(x=hC6(J,Q,y[m],y[m+1],y[m+2],y[m+3],y[m+4],y[m+5])))return I(C,x),!0}var g=g||$.source,p=p||$.target,i=K.getArrowWidth(h,_),l=[{name:"source",x:b.arrowStartX,y:b.arrowStartY,angle:b.srcArrowAngle},{name:"target",x:b.arrowEndX,y:b.arrowEndY,angle:b.tgtArrowAngle},{name:"mid-source",x:b.midX,y:b.midY,angle:b.midsrcArrowAngle},{name:"mid-target",x:b.midX,y:b.midY,angle:b.midtgtArrowAngle}];for(var m=0;m<l.length;m++){var a=l[m],e=X.arrowShapes[C.pstyle(a.name+"-arrow-shape").value],G0=C.pstyle("width").pfValue;if(e.roughCollide(J,Q,i,a.angle,{x:a.x,y:a.y},G0,H)&&e.collide(J,Q,i,a.angle,{x:a.x,y:a.y},G0,H))return I(C),!0}if(W&&z.length>0)R(g),R(p)}function E(C,$,b){return f5(C,$,b)}function V(C,$){var b=C._private,h=F,_;if($)_=$+"-";else _="";C.boundingBox();var S=b.labelBounds[$||"main"],v=C.pstyle(_+"label").value,f=C.pstyle("text-events").strValue==="yes";if(!f||!v)return;var x=E(b.rscratch,"labelX",$),y=E(b.rscratch,"labelY",$),m=E(b.rscratch,"labelAngle",$),g=C.pstyle(_+"text-margin-x").pfValue,p=C.pstyle(_+"text-margin-y").pfValue,i=S.x1-h-g,l=S.x2+h-g,a=S.y1-h-p,e=S.y2+h-p;if(m){var G0=Math.cos(m),U0=Math.sin(m),O0=function K0(R0,Y0){return R0=R0-x,Y0=Y0-y,{x:R0*G0-Y0*U0+x,y:R0*U0+Y0*G0+y}},X0=O0(i,a),E0=O0(i,e),W0=O0(l,a),q0=O0(l,e),z0=[X0.x+g,X0.y+p,W0.x+g,W0.y+p,q0.x+g,q0.y+p,E0.x+g,E0.y+p];if(_5(J,Q,z0))return I(C),!0}else if(fq(S,J,Q))return I(C),!0}for(var j=Y.length-1;j>=0;j--){var T=Y[j];if(T.isNode())R(T)||V(T);else N(T)||V(T)||V(T,"source")||V(T,"target")}return z};gB.getAllInBox=function(J,Q,Z,U){var K=this.getCachedZSortedEles().interactive,X=this.cy.zoom(),Y=2/X,z=[],G=Math.min(J,Z),W=Math.max(J,Z),H=Math.min(Q,U),q=Math.max(Q,U);J=G,Z=W,Q=H,U=q;var F=fU({x1:J,y1:Q,x2:Z,y2:U}),M=[{x:F.x1,y:F.y1},{x:F.x2,y:F.y1},{x:F.x2,y:F.y2},{x:F.x1,y:F.y2}],L=[[M[0],M[1]],[M[1],M[2]],[M[2],M[3]],[M[3],M[0]]];function A(R0,Y0,P0){return f5(R0,Y0,P0)}function I(R0,Y0){var P0=R0._private,F0=Y,m0="";R0.boundingBox();var J0=P0.labelBounds.main;if(!J0)return null;var z6=A(P0.rscratch,"labelX",Y0),t=A(P0.rscratch,"labelY",Y0),N0=A(P0.rscratch,"labelAngle",Y0),f0=R0.pstyle(m0+"text-margin-x").pfValue,l0=R0.pstyle(m0+"text-margin-y").pfValue,k0=J0.x1-F0-f0,_0=J0.x2+F0-f0,g0=J0.y1-F0-l0,h0=J0.y2+F0-l0;if(N0){var t0=Math.cos(N0),C0=Math.sin(N0),y0=function o(w0,d){return w0=w0-z6,d=d-t,{x:w0*t0-d*C0+z6,y:w0*C0+d*t0+t}};return[y0(k0,g0),y0(_0,g0),y0(_0,h0),y0(k0,h0)]}else return[{x:k0,y:g0},{x:_0,y:g0},{x:_0,y:h0},{x:k0,y:h0}]}function R(R0,Y0,P0,F0){function m0(J0,z6,t){return(t.y-J0.y)*(z6.x-J0.x)>(z6.y-J0.y)*(t.x-J0.x)}return m0(R0,P0,F0)!==m0(Y0,P0,F0)&&m0(R0,Y0,P0)!==m0(R0,Y0,F0)}for(var N=0;N<K.length;N++){var E=K[N];if(E.isNode()){var V=E,j=V.pstyle("text-events").strValue==="yes",T=V.pstyle("box-selection").strValue,C=V.pstyle("box-select-labels").strValue==="yes";if(T==="none")continue;var $=(T==="overlap"||C)&&j,b=V.boundingBox({includeNodes:!0,includeEdges:!1,includeLabels:$});if(T==="contain"){var h=!1;if(C&&j){var _=I(V);if(_&&h60(_,M))z.push(V),h=!0}if(!h&&ax0(F,b))z.push(V)}else if(T==="overlap"){if(EJ0(F,b)){var S=V.boundingBox({includeNodes:!0,includeEdges:!0,includeLabels:!1,includeMainLabels:!1,includeSourceLabels:!1,includeTargetLabels:!1}),v=[{x:S.x1,y:S.y1},{x:S.x2,y:S.y1},{x:S.x2,y:S.y2},{x:S.x1,y:S.y2}];if(h60(v,M))z.push(V);else{var f=I(V);if(f&&h60(f,M))z.push(V)}}}}else{var x=E,y=x._private,m=y.rscratch,g=x.pstyle("box-selection").strValue;if(g==="none")continue;if(g==="contain"){if(m.startX!=null&&m.startY!=null&&!fq(F,m.startX,m.startY))continue;if(m.endX!=null&&m.endY!=null&&!fq(F,m.endX,m.endY))continue;if(m.edgeType==="bezier"||m.edgeType==="multibezier"||m.edgeType==="self"||m.edgeType==="compound"||m.edgeType==="segments"||m.edgeType==="haystack"){var p=y.rstyle.bezierPts||y.rstyle.linePts||y.rstyle.haystackPts,i=!0;for(var l=0;l<p.length;l++)if(!j_0(F,p[l])){i=!1;break}if(i)z.push(x)}else if(m.edgeType==="straight")z.push(x)}else if(g==="overlap"){var a=!1;if(m.startX!=null&&m.startY!=null&&m.endX!=null&&m.endY!=null&&(fq(F,m.startX,m.startY)||fq(F,m.endX,m.endY)))z.push(x),a=!0;else if(!a&&m.edgeType==="haystack"){var e=y.rstyle.haystackPts;for(var G0=0;G0<e.length;G0++)if(j_0(F,e[G0])){z.push(x),a=!0;break}}if(!a){var U0=y.rstyle.bezierPts||y.rstyle.linePts||y.rstyle.haystackPts;if((!U0||U0.length<2)&&m.edgeType==="straight"){if(m.startX!=null&&m.startY!=null&&m.endX!=null&&m.endY!=null)U0=[{x:m.startX,y:m.startY},{x:m.endX,y:m.endY}]}if(!U0||U0.length<2)continue;for(var O0=0;O0<U0.length-1;O0++){var X0=U0[O0],E0=U0[O0+1];for(var W0=0;W0<L.length;W0++){var q0=e4(L[W0],2),z0=q0[0],K0=q0[1];if(R(X0,E0,z0,K0)){z.push(x),a=!0;break}}if(a)break}}}}}return z};sb={};sb.calculateArrowAngles=function(J){var Q=J._private.rscratch,Z=Q.edgeType==="haystack",U=Q.edgeType==="bezier",K=Q.edgeType==="multibezier",X=Q.edgeType==="segments",Y=Q.edgeType==="compound",z=Q.edgeType==="self",G,W,H,q,F,M,R,N;if(Z)H=Q.haystackPts[0],q=Q.haystackPts[1],F=Q.haystackPts[2],M=Q.haystackPts[3];else H=Q.arrowStartX,q=Q.arrowStartY,F=Q.arrowEndX,M=Q.arrowEndY;if(R=Q.midX,N=Q.midY,X)G=H-Q.segpts[0],W=q-Q.segpts[1];else if(K||Y||z||U){var L=Q.allpts,A=sQ(L[0],L[2],L[4],0.1),I=sQ(L[1],L[3],L[5],0.1);G=H-A,W=q-I}else G=H-R,W=q-N;Q.srcArrowAngle=Ab(G,W);var{midX:R,midY:N}=Q;if(Z)R=(H+F)/2,N=(q+M)/2;if(G=F-H,W=M-q,X){var L=Q.allpts;if(L.length/2%2===0){var E=L.length/2,V=E-2;G=L[E]-L[V],W=L[E+1]-L[V+1]}else if(Q.isRound)G=Q.midVector[1],W=-Q.midVector[0];else{var E=L.length/2-1,V=E-2;G=L[E]-L[V],W=L[E+1]-L[V+1]}}else if(K||Y||z){var{allpts:L,ctrlpts:j}=Q,T,C,$,b;if(j.length/2%2===0){var h=L.length/2-1,_=h+2,S=_+2;T=sQ(L[h],L[_],L[S],0),C=sQ(L[h+1],L[_+1],L[S+1],0),$=sQ(L[h],L[_],L[S],0.0001),b=sQ(L[h+1],L[_+1],L[S+1],0.0001)}else{var _=L.length/2-1,h=_-2,S=_+2;T=sQ(L[h],L[_],L[S],0.4999),C=sQ(L[h+1],L[_+1],L[S+1],0.4999),$=sQ(L[h],L[_],L[S],0.5),b=sQ(L[h+1],L[_+1],L[S+1],0.5)}G=$-T,W=b-C}if(Q.midtgtArrowAngle=Ab(G,W),Q.midDispX=G,Q.midDispY=W,G*=-1,W*=-1,X){var L=Q.allpts;if(L.length/2%2===0);else if(!Q.isRound){var E=L.length/2-1,v=E+2;G=-(L[v]-L[E]),W=-(L[v+1]-L[E+1])}}if(Q.midsrcArrowAngle=Ab(G,W),X)G=F-Q.segpts[Q.segpts.length-2],W=M-Q.segpts[Q.segpts.length-1];else if(K||Y||z||U){var L=Q.allpts,f=L.length,A=sQ(L[f-6],L[f-4],L[f-2],0.9),I=sQ(L[f-5],L[f-3],L[f-1],0.9);G=F-A,W=M-I}else G=F-R,W=M-N;Q.tgtArrowAngle=Ab(G,W)};sb.getArrowWidth=sb.getArrowHeight=function(J,Q){var Z=this.arrowWidthCache=this.arrowWidthCache||{},U=Z[J+", "+Q];if(U)return U;return U=Math.max(Math.pow(J*13.37,0.9),29)*Q,Z[J+", "+Q]=U,U};Lz={},VX={};Zk6=Math.sqrt(2*Ij),ZU={};ZU.findMidptPtsEtc=function(J,Q){var{posPts:Z,intersectionPts:U,vectorNormInverse:K}=Q,X,Y=J.pstyle("source-endpoint"),z=J.pstyle("target-endpoint"),G=Y.units!=null&&z.units!=null,W=function V(j,T,C,$){var b=$-T,h=C-j,_=Math.sqrt(h*h+b*b);return{x:-b/_,y:h/_}},H=J.pstyle("edge-distances").value;switch(H){case"node-position":X=Z;break;case"intersection":X=U;break;case"endpoints":{if(G){var q=this.manualEndptToPx(J.source()[0],Y),F=e4(q,2),M=F[0],L=F[1],A=this.manualEndptToPx(J.target()[0],z),I=e4(A,2),R=I[0],N=I[1],E={x1:M,y1:L,x2:R,y2:N};K=W(M,L,R,N),X=E}else e9("Edge ".concat(J.id()," has edge-distances:endpoints specified without manual endpoints specified via source-endpoint and target-endpoint. Falling back on edge-distances:intersection (default).")),X=U;break}}return{midptPts:X,vectorNormInverse:K}};ZU.findHaystackPoints=function(J){for(var Q=0;Q<J.length;Q++){var Z=J[Q],U=Z._private,K=U.rscratch;if(!K.haystack){var X=Math.random()*2*Math.PI;K.source={x:Math.cos(X),y:Math.sin(X)},X=Math.random()*2*Math.PI,K.target={x:Math.cos(X),y:Math.sin(X)}}var{source:Y,target:z}=U,G=Y.position(),W=z.position(),H=Y.width(),q=z.width(),F=Y.height(),M=z.height(),L=Z.pstyle("haystack-radius").value,A=L/2;K.haystackPts=K.allpts=[K.source.x*H*A+G.x,K.source.y*F*A+G.y,K.target.x*q*A+W.x,K.target.y*M*A+W.y],K.midX=(K.allpts[0]+K.allpts[2])/2,K.midY=(K.allpts[1]+K.allpts[3])/2,K.edgeType="haystack",K.haystack=!0,this.storeEdgeProjections(Z),this.calculateArrowAngles(Z),this.recalculateEdgeLabelProjections(Z),this.calculateLabelAngles(Z)}};ZU.findSegmentsPoints=function(J,Q){var Z=J._private.rscratch,U=J.pstyle("segment-weights"),K=J.pstyle("segment-distances"),X=J.pstyle("segment-radii"),Y=J.pstyle("radius-type"),z=Math.min(U.pfValue.length,K.pfValue.length),G=X.pfValue[X.pfValue.length-1],W=Y.pfValue[Y.pfValue.length-1];Z.edgeType="segments",Z.segpts=[],Z.radii=[],Z.isArcRadius=[];for(var H=0;H<z;H++){var q=U.pfValue[H],F=K.pfValue[H],M=1-q,L=q,A=this.findMidptPtsEtc(J,Q),I=A.midptPts,R=A.vectorNormInverse,N={x:I.x1*M+I.x2*L,y:I.y1*M+I.y2*L};Z.segpts.push(N.x+R.x*F,N.y+R.y*F),Z.radii.push(X.pfValue[H]!==void 0?X.pfValue[H]:G),Z.isArcRadius.push((Y.pfValue[H]!==void 0?Y.pfValue[H]:W)==="arc-radius")}};ZU.findLoopPoints=function(J,Q,Z,U){var K=J._private.rscratch,X=Q.dirCounts,Y=Q.srcPos,z=J.pstyle("control-point-distances"),G=z?z.pfValue[0]:void 0,W=J.pstyle("loop-direction").pfValue,H=J.pstyle("loop-sweep").pfValue,q=J.pstyle("control-point-step-size").pfValue;K.edgeType="self";var F=Z,M=q;if(U)F=0,M=G;var L=W-Math.PI/2,A=L-H/2,I=L+H/2,R=String(W+"_"+H);F=X[R]===void 0?X[R]=0:++X[R],K.ctrlpts=[Y.x+Math.cos(A)*1.4*M*(F/3+1),Y.y+Math.sin(A)*1.4*M*(F/3+1),Y.x+Math.cos(I)*1.4*M*(F/3+1),Y.y+Math.sin(I)*1.4*M*(F/3+1)]};ZU.findCompoundLoopPoints=function(J,Q,Z,U){var K=J._private.rscratch;K.edgeType="compound";var{srcPos:X,tgtPos:Y,srcW:z,srcH:G,tgtW:W,tgtH:H}=Q,q=J.pstyle("control-point-step-size").pfValue,F=J.pstyle("control-point-distances"),M=F?F.pfValue[0]:void 0,L=Z,A=q;if(U)L=0,A=M;var I=50,R={x:X.x-z/2,y:X.y-G/2},N={x:Y.x-W/2,y:Y.y-H/2},E={x:Math.min(R.x,N.x),y:Math.min(R.y,N.y)},V=0.5,j=Math.max(V,Math.log(z*Ij)),T=Math.max(V,Math.log(W*Ij));K.ctrlpts=[E.x,E.y-(1+Math.pow(I,1.12)/100)*A*(L/3+1)*j,E.x-(1+Math.pow(I,1.12)/100)*A*(L/3+1)*T,E.y]};ZU.findStraightEdgePoints=function(J){J._private.rscratch.edgeType="straight"};ZU.findBezierPoints=function(J,Q,Z,U,K){var X=J._private.rscratch,Y=J.pstyle("control-point-step-size").pfValue,z=J.pstyle("control-point-distances"),G=J.pstyle("control-point-weights"),W=z&&G?Math.min(z.value.length,G.value.length):1,H=z?z.pfValue[0]:void 0,q=G.value[0],F=U;X.edgeType=F?"multibezier":"bezier",X.ctrlpts=[];for(var M=0;M<W;M++){var L=(0.5-Q.eles.length/2+Z)*Y*(K?-1:1),A=void 0,I=wJ0(L);if(F)H=z?z.pfValue[M]:Y,q=G.value[M];if(U)A=H;else A=H!==void 0?I*H:void 0;var R=A!==void 0?A:L,N=1-q,E=q,V=this.findMidptPtsEtc(J,Q),j=V.midptPts,T=V.vectorNormInverse,C={x:j.x1*N+j.x2*E,y:j.y1*N+j.y2*E};X.ctrlpts.push(C.x+T.x*R,C.y+T.y*R)}};ZU.findTaxiPoints=function(J,Q){var Z=J._private.rscratch;Z.edgeType="segments";var U="vertical",K="horizontal",X="leftward",Y="rightward",z="downward",G="upward",W="auto",H=Q.posPts,q=Q.srcW,F=Q.srcH,M=Q.tgtW,L=Q.tgtH,A=J.pstyle("edge-distances").value,I=A!=="node-position",R=J.pstyle("taxi-direction").value,N=R,E=J.pstyle("taxi-turn"),V=E.units==="%",j=E.pfValue,T=j<0,C=J.pstyle("taxi-turn-min-distance").pfValue,$=I?(q+M)/2:0,b=I?(F+L)/2:0,h=H.x2-H.x1,_=H.y2-H.y1,S=function w0(d,L0){if(d>0)return Math.max(d-L0,0);else return Math.min(d+L0,0)},v=S(h,$),f=S(_,b),x=!1;if(N===W)R=Math.abs(v)>Math.abs(f)?K:U;else if(N===G||N===z)R=U,x=!0;else if(N===X||N===Y)R=K,x=!0;var y=R===U,m=y?f:v,g=y?_:h,p=wJ0(g),i=!1;if(!(x&&(V||T))&&(N===z&&g<0||N===G&&g>0||N===X&&g>0||N===Y&&g<0))p*=-1,m=p*Math.abs(m),i=!0;var l;if(V){var a=j<0?1+j:j;l=a*m}else{var e=j<0?m:0;l=e+j*p}var G0=function w0(d){return Math.abs(d)<C||Math.abs(d)>=Math.abs(m)},U0=G0(l),O0=G0(Math.abs(m)-Math.abs(l)),X0=U0||O0;if(X0&&!i)if(y){var E0=Math.abs(g)<=F/2,W0=Math.abs(h)<=M/2;if(E0){var q0=(H.x1+H.x2)/2,z0=H.y1,K0=H.y2;Z.segpts=[q0,z0,q0,K0]}else if(W0){var R0=(H.y1+H.y2)/2,Y0=H.x1,P0=H.x2;Z.segpts=[Y0,R0,P0,R0]}else Z.segpts=[H.x1,H.y2]}else{var F0=Math.abs(g)<=q/2,m0=Math.abs(_)<=L/2;if(F0){var J0=(H.y1+H.y2)/2,z6=H.x1,t=H.x2;Z.segpts=[z6,J0,t,J0]}else if(m0){var N0=(H.x1+H.x2)/2,f0=H.y1,l0=H.y2;Z.segpts=[N0,f0,N0,l0]}else Z.segpts=[H.x2,H.y1]}else if(y){var k0=H.y1+l+(I?F/2*p:0),_0=H.x1,g0=H.x2;Z.segpts=[_0,k0,g0,k0]}else{var h0=H.x1+l+(I?q/2*p:0),t0=H.y1,C0=H.y2;Z.segpts=[h0,t0,h0,C0]}if(Z.isRound){var y0=J.pstyle("taxi-radius").value,o=J.pstyle("radius-type").value[0]==="arc-radius";Z.radii=new Array(Z.segpts.length/2).fill(y0),Z.isArcRadius=new Array(Z.segpts.length/2).fill(o)}};ZU.tryToCorrectInvalidPoints=function(J,Q){var Z=J._private.rscratch;if(Z.edgeType==="bezier"){var{srcPos:U,tgtPos:K,srcW:X,srcH:Y,tgtW:z,tgtH:G,srcShape:W,tgtShape:H,srcCornerRadius:q,tgtCornerRadius:F,srcRs:M,tgtRs:L}=Q,A=!A8(Z.startX)||!A8(Z.startY),I=!A8(Z.arrowStartX)||!A8(Z.arrowStartY),R=!A8(Z.endX)||!A8(Z.endY),N=!A8(Z.arrowEndX)||!A8(Z.arrowEndY),E=3,V=this.getArrowWidth(J.pstyle("width").pfValue,J.pstyle("arrow-scale").value)*this.arrowShapeWidth,j=E*V,T=bB({x:Z.ctrlpts[0],y:Z.ctrlpts[1]},{x:Z.startX,y:Z.startY}),C=T<j,$=bB({x:Z.ctrlpts[0],y:Z.ctrlpts[1]},{x:Z.endX,y:Z.endY}),b=$<j,h=!1;if(A||I||C){h=!0;var _={x:Z.ctrlpts[0]-U.x,y:Z.ctrlpts[1]-U.y},S=Math.sqrt(_.x*_.x+_.y*_.y),v={x:_.x/S,y:_.y/S},f=Math.max(X,Y),x={x:Z.ctrlpts[0]+v.x*2*f,y:Z.ctrlpts[1]+v.y*2*f},y=W.intersectLine(U.x,U.y,X,Y,x.x,x.y,0,q,M);if(C)Z.ctrlpts[0]=Z.ctrlpts[0]+v.x*(j-T),Z.ctrlpts[1]=Z.ctrlpts[1]+v.y*(j-T);else Z.ctrlpts[0]=y[0]+v.x*j,Z.ctrlpts[1]=y[1]+v.y*j}if(R||N||b){h=!0;var m={x:Z.ctrlpts[0]-K.x,y:Z.ctrlpts[1]-K.y},g=Math.sqrt(m.x*m.x+m.y*m.y),p={x:m.x/g,y:m.y/g},i=Math.max(X,Y),l={x:Z.ctrlpts[0]+p.x*2*i,y:Z.ctrlpts[1]+p.y*2*i},a=H.intersectLine(K.x,K.y,z,G,l.x,l.y,0,F,L);if(b)Z.ctrlpts[0]=Z.ctrlpts[0]+p.x*(j-$),Z.ctrlpts[1]=Z.ctrlpts[1]+p.y*(j-$);else Z.ctrlpts[0]=a[0]+p.x*j,Z.ctrlpts[1]=a[1]+p.y*j}if(h)this.findEndpoints(J)}};ZU.storeAllpts=function(J){var Q=J._private.rscratch;if(Q.edgeType==="multibezier"||Q.edgeType==="bezier"||Q.edgeType==="self"||Q.edgeType==="compound"){Q.allpts=[],Q.allpts.push(Q.startX,Q.startY);for(var Z=0;Z+1<Q.ctrlpts.length;Z+=2)if(Q.allpts.push(Q.ctrlpts[Z],Q.ctrlpts[Z+1]),Z+3<Q.ctrlpts.length)Q.allpts.push((Q.ctrlpts[Z]+Q.ctrlpts[Z+2])/2,(Q.ctrlpts[Z+1]+Q.ctrlpts[Z+3])/2);Q.allpts.push(Q.endX,Q.endY);var U,K;if(Q.ctrlpts.length/2%2===0)U=Q.allpts.length/2-1,Q.midX=Q.allpts[U],Q.midY=Q.allpts[U+1];else U=Q.allpts.length/2-3,K=0.5,Q.midX=sQ(Q.allpts[U],Q.allpts[U+2],Q.allpts[U+4],K),Q.midY=sQ(Q.allpts[U+1],Q.allpts[U+3],Q.allpts[U+5],K)}else if(Q.edgeType==="straight")Q.allpts=[Q.startX,Q.startY,Q.endX,Q.endY],Q.midX=(Q.startX+Q.endX+Q.arrowStartX+Q.arrowEndX)/4,Q.midY=(Q.startY+Q.endY+Q.arrowStartY+Q.arrowEndY)/4;else if(Q.edgeType==="segments"){if(Q.allpts=[],Q.allpts.push(Q.startX,Q.startY),Q.allpts.push.apply(Q.allpts,Q.segpts),Q.allpts.push(Q.endX,Q.endY),Q.isRound){Q.roundCorners=[];for(var X=2;X+3<Q.allpts.length;X+=2){var Y=Q.radii[X/2-1],z=Q.isArcRadius[X/2-1];Q.roundCorners.push(bJ0({x:Q.allpts[X-2],y:Q.allpts[X-1]},{x:Q.allpts[X],y:Q.allpts[X+1],radius:Y},{x:Q.allpts[X+2],y:Q.allpts[X+3]},Y,z))}}if(Q.segpts.length%4===0){var G=Q.segpts.length/2,W=G-2;Q.midX=(Q.segpts[W]+Q.segpts[G])/2,Q.midY=(Q.segpts[W+1]+Q.segpts[G+1])/2}else{var H=Q.segpts.length/2-1;if(!Q.isRound)Q.midX=Q.segpts[H],Q.midY=Q.segpts[H+1];else{var q={x:Q.segpts[H],y:Q.segpts[H+1]},F=Q.roundCorners[H/2];if(F.radius===0){var M={x:Q.segpts[H+2],y:Q.segpts[H+3]};Q.midX=q.x,Q.midY=q.y,Q.midVector=[q.y-M.y,M.x-q.x]}else{var L=[q.x-F.cx,q.y-F.cy],A=F.radius/Math.sqrt(Math.pow(L[0],2)+Math.pow(L[1],2));L=L.map(function(I){return I*A}),Q.midX=F.cx+L[0],Q.midY=F.cy+L[1],Q.midVector=L}}}}};ZU.checkForInvalidEdgeWarning=function(J){var Q=J[0]._private.rscratch;if(Q.nodesOverlap||A8(Q.startX)&&A8(Q.startY)&&A8(Q.endX)&&A8(Q.endY))Q.loggedErr=!1;else if(!Q.loggedErr)Q.loggedErr=!0,e9("Edge `"+J.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.")};ZU.findEdgeControlPoints=function(J){var Q=this;if(!J||J.length===0)return;var Z=this,U=Z.cy,K=U.hasCompoundNodes(),X=new zW,Y=function $(b,h){return[].concat(gb(b),[h?1:0]).join("-")},z=[],G=[];for(var W=0;W<J.length;W++){var H=J[W],q=H._private,F=H.pstyle("curve-style").value;if(H.removed()||!H.takesUpSpace())continue;if(F==="haystack"){G.push(H);continue}var M=F==="unbundled-bezier"||kq(F,"segments")||F==="straight"||F==="straight-triangle"||kq(F,"taxi"),L=F==="unbundled-bezier"||F==="bezier",A=q.source,I=q.target,R=A.poolIndex(),N=I.poolIndex(),E=[R,N].sort(),V=Y(E,M),j=X.get(V);if(j==null)j={eles:[]},z.push({pairId:E,edgeIsUnbundled:M}),X.set(V,j);if(j.eles.push(H),M)j.hasUnbundled=!0;if(L)j.hasBezier=!0}var T=function $(){var b=z[C],h=b.pairId,_=b.edgeIsUnbundled,S=Y(h,_),v=X.get(S),f;if(!v.hasUnbundled){var x=v.eles[0].parallelEdges().filter(function(o){return o.isBundledBezier()});NJ0(v.eles),x.forEach(function(o){return v.eles.push(o)}),v.eles.sort(function(o,w0){return o.poolIndex()-w0.poolIndex()})}var y=v.eles[0],m=y.source(),g=y.target();if(m.poolIndex()>g.poolIndex()){var p=m;m=g,g=p}var i=v.srcPos=m.position(),l=v.tgtPos=g.position(),a=v.srcW=m.outerWidth(),e=v.srcH=m.outerHeight(),G0=v.tgtW=g.outerWidth(),U0=v.tgtH=g.outerHeight(),O0=v.srcShape=Z.nodeShapes[Q.getNodeShape(m)],X0=v.tgtShape=Z.nodeShapes[Q.getNodeShape(g)],E0=v.srcCornerRadius=m.pstyle("corner-radius").value==="auto"?"auto":m.pstyle("corner-radius").pfValue,W0=v.tgtCornerRadius=g.pstyle("corner-radius").value==="auto"?"auto":g.pstyle("corner-radius").pfValue,q0=v.tgtRs=g._private.rscratch,z0=v.srcRs=m._private.rscratch;v.dirCounts={north:0,west:0,south:0,east:0,northwest:0,southwest:0,northeast:0,southeast:0};for(var K0=0;K0<v.eles.length;K0++){var R0=v.eles[K0],Y0=R0[0]._private.rscratch,P0=R0.pstyle("curve-style").value,F0=P0==="unbundled-bezier"||kq(P0,"segments")||kq(P0,"taxi"),m0=!m.same(R0.source());if(!v.calculatedIntersection&&m!==g&&(v.hasBezier||v.hasUnbundled)){v.calculatedIntersection=!0;var J0=O0.intersectLine(i.x,i.y,a,e,l.x,l.y,0,E0,z0),z6=v.srcIntn=J0,t=X0.intersectLine(l.x,l.y,G0,U0,i.x,i.y,0,W0,q0),N0=v.tgtIntn=t,f0=v.intersectionPts={x1:J0[0],x2:t[0],y1:J0[1],y2:t[1]},l0=v.posPts={x1:i.x,x2:l.x,y1:i.y,y2:l.y},k0=t[1]-J0[1],_0=t[0]-J0[0],g0=Math.sqrt(_0*_0+k0*k0);if(A8(g0)&&g0>=Zk6);else g0=Math.sqrt(Math.max(_0*_0,Ij)+Math.max(k0*k0,Ij));var h0=v.vector={x:_0,y:k0},t0=v.vectorNorm={x:h0.x/g0,y:h0.y/g0},C0={x:-t0.y,y:t0.x};v.nodesOverlap=!A8(g0)||X0.checkPoint(J0[0],J0[1],0,G0,U0,l.x,l.y,W0,q0)||O0.checkPoint(t[0],t[1],0,a,e,i.x,i.y,E0,z0),v.vectorNormInverse=C0,f={nodesOverlap:v.nodesOverlap,dirCounts:v.dirCounts,calculatedIntersection:!0,hasBezier:v.hasBezier,hasUnbundled:v.hasUnbundled,eles:v.eles,srcPos:l,srcRs:q0,tgtPos:i,tgtRs:z0,srcW:G0,srcH:U0,tgtW:a,tgtH:e,srcIntn:N0,tgtIntn:z6,srcShape:X0,tgtShape:O0,posPts:{x1:l0.x2,y1:l0.y2,x2:l0.x1,y2:l0.y1},intersectionPts:{x1:f0.x2,y1:f0.y2,x2:f0.x1,y2:f0.y1},vector:{x:-h0.x,y:-h0.y},vectorNorm:{x:-t0.x,y:-t0.y},vectorNormInverse:{x:-C0.x,y:-C0.y}}}var y0=m0?f:v;if(Y0.nodesOverlap=y0.nodesOverlap,Y0.srcIntn=y0.srcIntn,Y0.tgtIntn=y0.tgtIntn,Y0.isRound=P0.startsWith("round"),K&&(m.isParent()||m.isChild()||g.isParent()||g.isChild())&&(m.parents().anySame(g)||g.parents().anySame(m)||m.same(g)&&m.isParent()))Q.findCompoundLoopPoints(R0,y0,K0,F0);else if(m===g)Q.findLoopPoints(R0,y0,K0,F0);else if(P0.endsWith("segments"))Q.findSegmentsPoints(R0,y0);else if(P0.endsWith("taxi"))Q.findTaxiPoints(R0,y0);else if(P0==="straight"||!F0&&v.eles.length%2===1&&K0===Math.floor(v.eles.length/2))Q.findStraightEdgePoints(R0);else Q.findBezierPoints(R0,y0,K0,F0,m0);Q.findEndpoints(R0),Q.tryToCorrectInvalidPoints(R0,y0),Q.checkForInvalidEdgeWarning(R0),Q.storeAllpts(R0),Q.storeEdgeProjections(R0),Q.calculateArrowAngles(R0),Q.recalculateEdgeLabelProjections(R0),Q.calculateLabelAngles(R0)}};for(var C=0;C<z.length;C++)T();this.findHaystackPoints(G)};ZU.getSegmentPoints=function(J){var Q=J[0]._private.rscratch;this.recalculateRenderedStyle(J);var Z=Q.edgeType;if(Z==="segments")return rh0(Q.segpts)};ZU.getControlPoints=function(J){var Q=J[0]._private.rscratch;this.recalculateRenderedStyle(J);var Z=Q.edgeType;if(Z==="bezier"||Z==="multibezier"||Z==="self"||Z==="compound")return rh0(Q.ctrlpts)};ZU.getEdgeMidpoint=function(J){var Q=J[0]._private.rscratch;return this.recalculateRenderedStyle(J),{x:Q.midX,y:Q.midY}};Cj={};Cj.manualEndptToPx=function(J,Q){var Z=this,U=J.position(),K=J.outerWidth(),X=J.outerHeight(),Y=J._private.rscratch;if(Q.value.length===2){var z=[Q.pfValue[0],Q.pfValue[1]];if(Q.units[0]==="%")z[0]=z[0]*K;if(Q.units[1]==="%")z[1]=z[1]*X;return z[0]+=U.x,z[1]+=U.y,z}else{var G=Q.pfValue[0];G=-Math.PI/2+G;var W=2*Math.max(K,X),H=[U.x+Math.cos(G)*W,U.y+Math.sin(G)*W];return Z.nodeShapes[this.getNodeShape(J)].intersectLine(U.x,U.y,K,X,H[0],H[1],0,J.pstyle("corner-radius").value==="auto"?"auto":J.pstyle("corner-radius").pfValue,Y)}};Cj.findEndpoints=function(J){var Q,Z,U,K,X=this,Y,z=J.source()[0],G=J.target()[0],W=z.position(),H=G.position(),q=J.pstyle("target-arrow-shape").value,F=J.pstyle("source-arrow-shape").value,M=J.pstyle("target-distance-from-node").pfValue,L=J.pstyle("source-distance-from-node").pfValue,A=z._private.rscratch,I=G._private.rscratch,R=J.pstyle("curve-style").value,N=J._private.rscratch,E=N.edgeType,V=kq(R,"taxi"),j=E==="self"||E==="compound",T=E==="bezier"||E==="multibezier"||j,C=E!=="bezier",$=E==="straight"||E==="segments",b=E==="segments",h=T||C||$,_=j||V,S=J.pstyle("source-endpoint"),v=_?"outside-to-node":S.value,f=z.pstyle("corner-radius").value==="auto"?"auto":z.pstyle("corner-radius").pfValue,x=J.pstyle("target-endpoint"),y=_?"outside-to-node":x.value,m=G.pstyle("corner-radius").value==="auto"?"auto":G.pstyle("corner-radius").pfValue;N.srcManEndpt=S,N.tgtManEndpt=x;var g,p,i,l,a=(Q=(x===null||x===void 0||(Z=x.pfValue)===null||Z===void 0?void 0:Z.length)===2?x.pfValue:null)!==null&&Q!==void 0?Q:[0,0],e=(U=(S===null||S===void 0||(K=S.pfValue)===null||K===void 0?void 0:K.length)===2?S.pfValue:null)!==null&&U!==void 0?U:[0,0];if(T){var G0=[N.ctrlpts[0],N.ctrlpts[1]],U0=C?[N.ctrlpts[N.ctrlpts.length-2],N.ctrlpts[N.ctrlpts.length-1]]:G0;g=U0,p=G0}else if($){var O0=!b?[H.x+a[0],H.y+a[1]]:N.segpts.slice(0,2),X0=!b?[W.x+e[0],W.y+e[1]]:N.segpts.slice(N.segpts.length-2);g=X0,p=O0}if(y==="inside-to-node")Y=[H.x,H.y];else if(x.units)Y=this.manualEndptToPx(G,x);else if(y==="outside-to-line")Y=N.tgtIntn;else{if(y==="outside-to-node"||y==="outside-to-node-or-label")i=g;else if(y==="outside-to-line"||y==="outside-to-line-or-label")i=[W.x,W.y];if(Y=X.nodeShapes[this.getNodeShape(G)].intersectLine(H.x,H.y,G.outerWidth(),G.outerHeight(),i[0],i[1],0,m,I),y==="outside-to-node-or-label"||y==="outside-to-line-or-label"){var E0=G._private.rscratch,W0=E0.labelWidth,q0=E0.labelHeight,z0=E0.labelX,K0=E0.labelY,R0=W0/2,Y0=q0/2,P0=G.pstyle("text-valign").value;if(P0==="top")K0-=Y0;else if(P0==="bottom")K0+=Y0;var F0=G.pstyle("text-halign").value;if(F0==="left")z0-=R0;else if(F0==="right")z0+=R0;var m0=Bj(i[0],i[1],[z0-R0,K0-Y0,z0+R0,K0-Y0,z0+R0,K0+Y0,z0-R0,K0+Y0],H.x,H.y);if(m0.length>0){var J0=W,z6=SB(J0,yA(Y)),t=SB(J0,yA(m0)),N0=z6;if(t<z6)Y=m0,N0=t;if(m0.length>2){var f0=SB(J0,{x:m0[2],y:m0[3]});if(f0<N0)Y=[m0[2],m0[3]]}}}}var l0=Ib(Y,g,X.arrowShapes[q].spacing(J)+M),k0=Ib(Y,g,X.arrowShapes[q].gap(J)+M);if(N.endX=k0[0],N.endY=k0[1],N.arrowEndX=l0[0],N.arrowEndY=l0[1],v==="inside-to-node")Y=[W.x,W.y];else if(S.units)Y=this.manualEndptToPx(z,S);else if(v==="outside-to-line")Y=N.srcIntn;else{if(v==="outside-to-node"||v==="outside-to-node-or-label")l=p;else if(v==="outside-to-line"||v==="outside-to-line-or-label")l=[H.x,H.y];if(Y=X.nodeShapes[this.getNodeShape(z)].intersectLine(W.x,W.y,z.outerWidth(),z.outerHeight(),l[0],l[1],0,f,A),v==="outside-to-node-or-label"||v==="outside-to-line-or-label"){var _0=z._private.rscratch,g0=_0.labelWidth,h0=_0.labelHeight,t0=_0.labelX,C0=_0.labelY,y0=g0/2,o=h0/2,w0=z.pstyle("text-valign").value;if(w0==="top")C0-=o;else if(w0==="bottom")C0+=o;var d=z.pstyle("text-halign").value;if(d==="left")t0-=y0;else if(d==="right")t0+=y0;var L0=Bj(l[0],l[1],[t0-y0,C0-o,t0+y0,C0-o,t0+y0,C0+o,t0-y0,C0+o],W.x,W.y);if(L0.length>0){var I0=H,T0=SB(I0,yA(Y)),$0=SB(I0,yA(L0)),v0=T0;if($0<T0)Y=[L0[0],L0[1]],v0=$0;if(L0.length>2){var r0=SB(I0,{x:L0[2],y:L0[3]});if(r0<v0)Y=[L0[2],L0[3]]}}}}var u0=Ib(Y,p,X.arrowShapes[F].spacing(J)+L),G6=Ib(Y,p,X.arrowShapes[F].gap(J)+L);if(N.startX=G6[0],N.startY=G6[1],N.arrowStartX=u0[0],N.arrowStartY=u0[1],h)if(!A8(N.startX)||!A8(N.startY)||!A8(N.endX)||!A8(N.endY))N.badLine=!0;else N.badLine=!1};Cj.getSourceEndpoint=function(J){var Q=J[0]._private.rscratch;switch(this.recalculateRenderedStyle(J),Q.edgeType){case"haystack":return{x:Q.haystackPts[0],y:Q.haystackPts[1]};default:return{x:Q.arrowStartX,y:Q.arrowStartY}}};Cj.getTargetEndpoint=function(J){var Q=J[0]._private.rscratch;switch(this.recalculateRenderedStyle(J),Q.edgeType){case"haystack":return{x:Q.haystackPts[2],y:Q.haystackPts[3]};default:return{x:Q.arrowEndX,y:Q.arrowEndY}}};xJ0={};xJ0.storeEdgeProjections=function(J){var Q=J._private,Z=Q.rscratch,U=Z.edgeType;if(Q.rstyle.bezierPts=null,Q.rstyle.linePts=null,Q.rstyle.haystackPts=null,U==="multibezier"||U==="bezier"||U==="self"||U==="compound"){Q.rstyle.bezierPts=[];for(var K=0;K+5<Z.allpts.length;K+=4)Uk6(this,J,Z.allpts.slice(K,K+6))}else if(U==="segments"){var X=Q.rstyle.linePts=[];for(var K=0;K+1<Z.allpts.length;K+=2)X.push({x:Z.allpts[K],y:Z.allpts[K+1]})}else if(U==="haystack"){var Y=Z.haystackPts;Q.rstyle.haystackPts=[{x:Y[0],y:Y[1]},{x:Y[2],y:Y[3]}]}Q.rstyle.arrowWidth=this.getArrowWidth(J.pstyle("width").pfValue,J.pstyle("arrow-scale").value)*this.arrowShapeWidth};xJ0.recalculateEdgeProjections=function(J){this.findEdgeControlPoints(J)};Rz={};Rz.recalculateNodeLabelProjection=function(J){var Q=J.pstyle("label").strValue;if(hq(Q))return;var Z,U,K=J._private,X=J.width(),Y=J.height(),z=J.padding(),G=J.position(),W=J.pstyle("text-halign").strValue,H=J.pstyle("text-valign").strValue,q=K.rscratch,F=K.rstyle;switch(W){case"left":Z=G.x-X/2-z;break;case"right":Z=G.x+X/2+z;break;default:Z=G.x}switch(H){case"top":U=G.y-Y/2-z;break;case"bottom":U=G.y+Y/2+z;break;default:U=G.y}q.labelX=Z,q.labelY=U,F.labelX=Z,F.labelY=U,this.calculateLabelAngles(J),this.applyLabelDimensions(J)};Rz.recalculateEdgeLabelProjections=function(J){var Q,Z=J._private,U=Z.rscratch,K=this,X={mid:J.pstyle("label").strValue,source:J.pstyle("source-label").strValue,target:J.pstyle("target-label").strValue};if(X.mid||X.source||X.target);else return;Q={x:U.midX,y:U.midY};var Y=function H(q,F,M){YW(Z.rscratch,q,F,M),YW(Z.rstyle,q,F,M)};Y("labelX",null,Q.x),Y("labelY",null,Q.y);var z=nh0(U.midDispX,U.midDispY);Y("labelAutoAngle",null,z);var G=function H(){if(G.cache)return G.cache;var q=[];for(var F=0;F+5<U.allpts.length;F+=4){var M={x:U.allpts[F],y:U.allpts[F+1]},L={x:U.allpts[F+2],y:U.allpts[F+3]},A={x:U.allpts[F+4],y:U.allpts[F+5]};q.push({p0:M,p1:L,p2:A,startDist:0,length:0,segments:[]})}var I=Z.rstyle.bezierPts,R=K.bezierProjPcts.length;function N(C,$,b,h,_){var S=bB($,b),v=C.segments[C.segments.length-1],f={p0:$,p1:b,t0:h,t1:_,startDist:v?v.startDist+v.length:0,length:S};C.segments.push(f),C.length+=S}for(var E=0;E<q.length;E++){var V=q[E],j=q[E-1];if(j)V.startDist=j.startDist+j.length;N(V,V.p0,I[E*R],0,K.bezierProjPcts[0]);for(var T=0;T<R-1;T++)N(V,I[E*R+T],I[E*R+T+1],K.bezierProjPcts[T],K.bezierProjPcts[T+1]);N(V,I[E*R+R-1],V.p2,K.bezierProjPcts[R-1],1)}return G.cache=q},W=function H(q){var F,M=q==="source";if(!X[q])return;var L=J.pstyle(q+"-text-offset").pfValue;switch(U.edgeType){case"self":case"compound":case"bezier":case"multibezier":{var A=G(),I,R=0,N=0;for(var E=0;E<A.length;E++){var V=A[M?E:A.length-1-E];for(var j=0;j<V.segments.length;j++){var T=V.segments[M?j:V.segments.length-1-j],C=E===A.length-1&&j===V.segments.length-1;if(R=N,N+=T.length,N>=L||C){I={cp:V,segment:T};break}}if(I)break}var{cp:$,segment:b}=I,h=(L-R)/b.length,_=b.t1-b.t0,S=M?b.t0+_*h:b.t1-_*h;S=Fj(0,S,1),Q=uA($.p0,$.p1,$.p2,S),F=Kk6($.p0,$.p1,$.p2,S);break}case"straight":case"segments":case"haystack":{var v=0,f,x,y,m,g=U.allpts.length;for(var p=0;p+3<g;p+=2){if(M)y={x:U.allpts[p],y:U.allpts[p+1]},m={x:U.allpts[p+2],y:U.allpts[p+3]};else y={x:U.allpts[g-2-p],y:U.allpts[g-1-p]},m={x:U.allpts[g-4-p],y:U.allpts[g-3-p]};if(f=bB(y,m),x=v,v+=f,v>=L)break}var i=L-x,l=i/f;l=Fj(0,l,1),Q=VC6(y,m,l),F=sh0(y,m);break}}Y("labelX",q,Q.x),Y("labelY",q,Q.y),Y("labelAutoAngle",q,F)};W("source"),W("target"),this.applyLabelDimensions(J)};Rz.applyLabelDimensions=function(J){if(this.applyPrefixedLabelDimensions(J),J.isEdge())this.applyPrefixedLabelDimensions(J,"source"),this.applyPrefixedLabelDimensions(J,"target")};Rz.applyPrefixedLabelDimensions=function(J,Q){var Z=J._private,U=this.getLabelText(J,Q),K=_B(U,J._private.labelDimsKey);if(f5(Z.rscratch,"prefixedLabelDimsKey",Q)===K)return;YW(Z.rscratch,"prefixedLabelDimsKey",Q,K);var X=this.calculateLabelDimensions(J,U),Y=J.pstyle("line-height").pfValue,z=J.pstyle("text-wrap").strValue,G=f5(Z.rscratch,"labelWrapCachedLines",Q)||[],W=z!=="wrap"?1:Math.max(G.length,1),H=X.height/W,q=H*Y,F=X.width,M=X.height+(W-1)*(Y-1)*H;YW(Z.rstyle,"labelWidth",Q,F),YW(Z.rscratch,"labelWidth",Q,F),YW(Z.rstyle,"labelHeight",Q,M),YW(Z.rscratch,"labelHeight",Q,M),YW(Z.rscratch,"labelLineHeight",Q,q)};Rz.getLabelText=function(J,Q){var Z=J._private,U=Q?Q+"-":"",K=J.pstyle(U+"label").strValue,X=J.pstyle("text-transform").value,Y=function a(e,G0){if(G0)return YW(Z.rscratch,e,Q,G0),G0;else return f5(Z.rscratch,e,Q)};if(!K)return"";if(X=="none");else if(X=="uppercase")K=K.toUpperCase();else if(X=="lowercase")K=K.toLowerCase();var z=J.pstyle("text-wrap").value;if(z==="wrap"){var G=Y("labelKey");if(G!=null&&Y("labelWrapKey")===G)return Y("labelWrapCachedText");var W="",H=K.split(`
|
|
789
789
|
`),q=J.pstyle("text-max-width").pfValue,F=J.pstyle("text-overflow-wrap").value,M=F==="anywhere",L=[],A=/[\s\u200b]+|$/g;for(var I=0;I<H.length;I++){var R=H[I],N=this.calculateLabelDimensions(J,R),E=N.width;if(M){var V=R.split("").join(W);R=V}if(E>q){var j=R.matchAll(A),T="",C=0,$=b5(j),b;try{for($.s();!(b=$.n()).done;){var h=b.value,_=h[0],S=R.substring(C,h.index);C=h.index+_.length;var v=T.length===0?S:T+S+_,f=this.calculateLabelDimensions(J,v),x=f.width;if(x<=q)T+=S+_;else{if(T)L.push(T);T=S+_}}}catch(a){$.e(a)}finally{$.f()}if(!T.match(/^[\s\u200b]+$/))L.push(T)}else L.push(R)}Y("labelWrapCachedLines",L),K=Y("labelWrapCachedText",L.join(`
|
|
790
790
|
`)),Y("labelWrapKey",G)}else if(z==="ellipsis"){var y=J.pstyle("text-max-width").pfValue,m="",g="…",p=!1;if(this.calculateLabelDimensions(J,K).width<y)return K;for(var i=0;i<K.length;i++){var l=this.calculateLabelDimensions(J,m+K[i]+g).width;if(l>y)break;if(m+=K[i],i===K.length-1)p=!0}if(!p)m+=g;return m}return K};Rz.getLabelJustification=function(J){var Q=J.pstyle("text-justification").strValue,Z=J.pstyle("text-halign").strValue;if(Q==="auto")if(J.isNode())switch(Z){case"left":return"right";case"right":return"left";default:return"center"}else return"center";else return Q};Rz.calculateLabelDimensions=function(J,Q){var Z=this,U=Z.cy.window(),K=U.document,X=0,Y=J.pstyle("font-style").strValue,z=J.pstyle("font-size").pfValue,G=J.pstyle("font-family").strValue,W=J.pstyle("font-weight").strValue,H=this.labelCalcCanvas,q=this.labelCalcCanvasContext;if(!H){H=this.labelCalcCanvas=K.createElement("canvas"),q=this.labelCalcCanvasContext=H.getContext("2d");var F=H.style;F.position="absolute",F.left="-9999px",F.top="-9999px",F.zIndex="-1",F.visibility="hidden",F.pointerEvents="none"}q.font="".concat(Y," ").concat(W," ").concat(z,"px ").concat(G);var M=0,L=0,A=Q.split(`
|
|
791
|
-
`);for(var I=0;I<A.length;I++){var R=A[I],N=q.measureText(R),E=Math.ceil(N.width),V=z;M=Math.max(E,M),L+=V}return M+=X,L+=X,{width:M,height:L}};Rz.calculateLabelAngle=function(J,Q){var Z=J._private,U=Z.rscratch,K=J.isEdge(),X=Q?Q+"-":"",Y=J.pstyle(X+"text-rotation"),z=Y.strValue;if(z==="none")return 0;else if(K&&z==="autorotate")return U.labelAutoAngle;else if(z==="autorotate")return 0;else return Y.pfValue};Rz.calculateLabelAngles=function(J){var Q=this,Z=J.isEdge(),U=J._private,K=U.rscratch;if(K.labelAngle=Q.calculateLabelAngle(J),Z)K.sourceLabelAngle=Q.calculateLabelAngle(J,"source"),K.targetLabelAngle=Q.calculateLabelAngle(J,"target")};ah0={};ah0.getNodeShape=function(J){var Q=this,Z=J.pstyle("shape").value;if(Z==="cutrectangle"&&(J.width()<Hx0||J.height()<Hx0)){if(!qx0)e9("The `cutrectangle` node shape can not be used at small sizes so `rectangle` is used instead"),qx0=!0;return"rectangle"}if(J.isParent())if(Z==="rectangle"||Z==="roundrectangle"||Z==="round-rectangle"||Z==="cutrectangle"||Z==="cut-rectangle"||Z==="barrel")return Z;else return"rectangle";if(Z==="polygon"){var U=J.pstyle("shape-polygon-points").value;return Q.nodeShapes.makePolygon(U).name}return Z};Ox={};Ox.registerCalculationListeners=function(){var J=this.cy,Q=J.collection(),Z=this,U=function X(Y){var z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(Q.merge(Y),z)for(var G=0;G<Y.length;G++){var W=Y[G],H=W._private,q=H.rstyle;q.clean=!1,q.cleanConnected=!1}};Z.binder(J).on("bounds.* dirty.*",function X(Y){var z=Y.target;U(z)}).on("style.* background.*",function X(Y){var z=Y.target;U(z,!1)});var K=function X(Y){if(Y){var z=Z.onUpdateEleCalcsFns;Q.cleanStyle();for(var G=0;G<Q.length;G++){var W=Q[G],H=W._private.rstyle;if(W.isNode()&&!H.cleanConnected)U(W.connectedEdges()),H.cleanConnected=!0}if(z)for(var q=0;q<z.length;q++){var F=z[q];F(Y,Q)}Z.recalculateRenderedStyle(Q),Q=J.collection()}};Z.flushRenderedStyleQueue=function(){K(!0)},Z.beforeRender(K,Z.beforeRenderPriorities.eleCalcs)};Ox.onUpdateEleCalcs=function(J){var Q=this.onUpdateEleCalcsFns=this.onUpdateEleCalcsFns||[];Q.push(J)};Ox.recalculateRenderedStyle=function(J,Q){var Z=function E(V){return V._private.rstyle.cleanConnected};if(J.length===0)return;var U=[],K=[];if(this.destroyed)return;if(Q===void 0)Q=!0;for(var X=0;X<J.length;X++){var Y=J[X],z=Y._private,G=z.rstyle;if(Y.isEdge()&&(!Z(Y.source())||!Z(Y.target())))G.clean=!1;if(Y.isEdge()&&Y.isBundledBezier()){if(Y.parallelEdges().some(function(E){return!E._private.rstyle.clean&&E.isBundledBezier()}))G.clean=!1}if(Q&&G.clean||Y.removed())continue;if(Y.pstyle("display").value==="none")continue;if(z.group==="nodes")K.push(Y);else U.push(Y);G.clean=!0}for(var W=0;W<K.length;W++){var H=K[W],q=H._private,F=q.rstyle,M=H.position();this.recalculateNodeLabelProjection(H),F.nodeX=M.x,F.nodeY=M.y,F.nodeW=H.pstyle("width").pfValue,F.nodeH=H.pstyle("height").pfValue}this.recalculateEdgeProjections(U);for(var L=0;L<U.length;L++){var A=U[L],I=A._private,R=I.rstyle,N=I.rscratch;R.srcX=N.arrowStartX,R.srcY=N.arrowStartY,R.tgtX=N.arrowEndX,R.tgtY=N.arrowEndY,R.midX=N.midX,R.midY=N.midY,R.labelAngle=N.labelAngle,R.sourceLabelAngle=N.sourceLabelAngle,R.targetLabelAngle=N.targetLabelAngle}};Lx={};Lx.updateCachedGrabbedEles=function(){var J=this.cachedZSortedEles;if(!J)return;J.drag=[],J.nondrag=[];var Q=[];for(var Z=0;Z<J.length;Z++){var U=J[Z],K=U._private.rscratch;if(U.grabbed()&&!U.isParent())Q.push(U);else if(K.inDragLayer)J.drag.push(U);else J.nondrag.push(U)}for(var Z=0;Z<Q.length;Z++){var U=Q[Z];J.drag.push(U)}};Lx.invalidateCachedZSortedEles=function(){this.cachedZSortedEles=null};Lx.getCachedZSortedEles=function(J){if(J||!this.cachedZSortedEles){var Q=this.cy.mutableElements().toArray();Q.sort(vh0),Q.interactive=Q.filter(function(Z){return Z.interactive()}),this.cachedZSortedEles=Q,this.updateCachedGrabbedEles()}else Q=this.cachedZSortedEles;return Q};oh0={};[gB,sb,ZU,Cj,xJ0,Rz,ah0,Ox,Lx].forEach(function(J){HJ(oh0,J)});th0={};th0.getCachedImage=function(J,Q,Z){var U=this,K=U.imageCache=U.imageCache||{},X=K[J];if(X){if(!X.image.complete)X.image.addEventListener("load",Z);return X.image}else{X=K[J]=K[J]||{};var Y=X.image=new Image;Y.addEventListener("load",Z),Y.addEventListener("error",function(){Y.error=!0});var z="data:",G=J.substring(0,z.length).toLowerCase()===z;if(!G)Q=Q==="null"?null:Q,Y.crossOrigin=Q;return Y.src=J,Y}};tA={};tA.registerBinding=function(J,Q,Z,U){var K=Array.prototype.slice.apply(arguments,[1]);if(Array.isArray(J)){var X=[];for(var Y=0;Y<J.length;Y++){var z=J[Y];if(z!==void 0){var G=this.binder(z);X.push(G.on.apply(G,K))}}return X}var G=this.binder(J);return G.on.apply(G,K)};tA.binder=function(J){var Q=this,Z=Q.cy.window(),U=J===Z||J===Z.document||J===Z.document.body||LT6(J);if(Q.supportsPassiveEvents==null){var K=!1;try{var X=Object.defineProperty({},"passive",{get:function z(){return K=!0,!0}});Z.addEventListener("test",null,X)}catch(z){}Q.supportsPassiveEvents=K}var Y=function z(G,W,H){var q=Array.prototype.slice.call(arguments);if(U&&Q.supportsPassiveEvents)q[2]={capture:H!=null?H:!1,passive:!1,once:!1};return Q.bindings.push({target:J,args:q}),(J.addEventListener||J.on).apply(J,q),this};return{on:Y,addEventListener:Y,addListener:Y,bind:Y}};tA.nodeIsDraggable=function(J){return J&&J.isNode()&&!J.locked()&&J.grabbable()};tA.nodeIsGrabbable=function(J){return this.nodeIsDraggable(J)&&J.interactive()};tA.load=function(){var J=this,Q=J.cy.window(),Z=function w0(d){return d.selected()},U=function w0(d){var L0=d.getRootNode();if(L0&&L0.nodeType===11&&L0.host!==void 0)return L0},K=function w0(d,L0,I0,T0){if(d==null)d=J.cy;for(var $0=0;$0<L0.length;$0++){var v0=L0[$0];d.emit({originalEvent:I0,type:v0,position:T0})}},X=function w0(d){return d.shiftKey||d.metaKey||d.ctrlKey},Y=function w0(d,L0){var I0=!0;if(J.cy.hasCompoundNodes()&&d&&d.pannable())for(var T0=0;L0&&T0<L0.length;T0++){var d=L0[T0];if(d.isNode()&&d.isParent()&&!d.pannable()){I0=!1;break}}else I0=!0;return I0},z=function w0(d){d[0]._private.grabbed=!0},G=function w0(d){d[0]._private.grabbed=!1},W=function w0(d){d[0]._private.rscratch.inDragLayer=!0},H=function w0(d){d[0]._private.rscratch.inDragLayer=!1},q=function w0(d){d[0]._private.rscratch.isGrabTarget=!0},F=function w0(d){d[0]._private.rscratch.isGrabTarget=!1},M=function w0(d,L0){var I0=L0.addToList,T0=I0.has(d);if(!T0&&d.grabbable()&&!d.locked())I0.merge(d),z(d)},L=function w0(d,L0){if(!d.cy().hasCompoundNodes())return;if(L0.inDragLayer==null&&L0.addToList==null)return;var I0=d.descendants();if(L0.inDragLayer)I0.forEach(W),I0.connectedEdges().forEach(W);if(L0.addToList)M(I0,L0)},A=function w0(d,L0){L0=L0||{};var I0=d.cy().hasCompoundNodes();if(L0.inDragLayer)d.forEach(W),d.neighborhood().stdFilter(function(T0){return!I0||T0.isEdge()}).forEach(W);if(L0.addToList)d.forEach(function(T0){M(T0,L0)});L(d,L0),N(d,{inDragLayer:L0.inDragLayer}),J.updateCachedGrabbedEles()},I=A,R=function w0(d){if(!d)return;J.getCachedZSortedEles().forEach(function(L0){G(L0),H(L0),F(L0)}),J.updateCachedGrabbedEles()},N=function w0(d,L0){if(L0.inDragLayer==null&&L0.addToList==null)return;if(!d.cy().hasCompoundNodes())return;var I0=d.ancestors().orphans();if(I0.same(d))return;var T0=I0.descendants().spawnSelf().merge(I0).unmerge(d).unmerge(d.descendants()),$0=T0.connectedEdges();if(L0.inDragLayer)$0.forEach(W),T0.forEach(W);if(L0.addToList)T0.forEach(function(v0){M(v0,L0)})},E=function w0(){if(document.activeElement!=null&&document.activeElement.blur!=null)document.activeElement.blur()},V=typeof MutationObserver!=="undefined",j=typeof ResizeObserver!=="undefined";if(V){if(J.removeObserver=new MutationObserver(function(w0){for(var d=0;d<w0.length;d++){var L0=w0[d],I0=L0.removedNodes;if(I0)for(var T0=0;T0<I0.length;T0++){var $0=I0[T0];if($0===J.container){J.destroy();break}}}}),J.container.parentNode)J.removeObserver.observe(J.container.parentNode,{childList:!0})}else J.registerBinding(J.container,"DOMNodeRemoved",function(w0){J.destroy()});var T=jj(function(){J.cy.resize()},100);if(V)J.styleObserver=new MutationObserver(T),J.styleObserver.observe(J.container,{attributes:!0});if(J.registerBinding(Q,"resize",T),j)J.resizeObserver=new ResizeObserver(T),J.resizeObserver.observe(J.container);var C=function w0(d,L0){while(d!=null)L0(d),d=d.parentNode},$=function w0(){J.invalidateContainerClientCoordsCache()};C(J.container,function(w0){J.registerBinding(w0,"transitionend",$),J.registerBinding(w0,"animationend",$),J.registerBinding(w0,"scroll",$)}),J.registerBinding(J.container,"contextmenu",function(w0){w0.preventDefault()});var b=function w0(){return J.selection[4]!==0},h=function w0(d){var L0=J.findContainerClientCoords(),I0=L0[0],T0=L0[1],$0=L0[2],v0=L0[3],r0=d.touches?d.touches:[d],u0=!1;for(var G6=0;G6<r0.length;G6++){var A6=r0[G6];if(I0<=A6.clientX&&A6.clientX<=I0+$0&&T0<=A6.clientY&&A6.clientY<=T0+v0){u0=!0;break}}if(!u0)return!1;var r6=J.container,N6=d.target,F6=N6.parentNode,P6=!1;while(F6){if(F6===r6){P6=!0;break}F6=F6.parentNode}if(!P6)return!1;return!0};J.registerBinding(J.container,"mousedown",function w0(d){if(!h(d))return;if(J.hoverData.which===1&&d.which!==1)return;d.preventDefault(),E(),J.hoverData.capture=!0,J.hoverData.which=d.which;var L0=J.cy,I0=[d.clientX,d.clientY],T0=J.projectIntoViewport(I0[0],I0[1]),$0=J.selection,v0=J.findNearestElements(T0[0],T0[1],!0,!1),r0=v0[0],u0=J.dragData.possibleDragElements;J.hoverData.mdownPos=T0,J.hoverData.mdownGPos=I0;var G6=function P6(M6){return{originalEvent:d,type:M6,position:{x:T0[0],y:T0[1]}}},A6=function P6(){J.hoverData.tapholdCancelled=!1,clearTimeout(J.hoverData.tapholdTimeout),J.hoverData.tapholdTimeout=setTimeout(function(){if(J.hoverData.tapholdCancelled)return;else{var M6=J.hoverData.down;if(M6)M6.emit(G6("taphold"));else L0.emit(G6("taphold"))}},J.tapholdDuration)};if(d.which==3){J.hoverData.cxtStarted=!0;var r6={originalEvent:d,type:"cxttapstart",position:{x:T0[0],y:T0[1]}};if(r0)r0.activate(),r0.emit(r6),J.hoverData.down=r0;else L0.emit(r6);J.hoverData.downTime=new Date().getTime(),J.hoverData.cxtDragged=!1}else if(d.which==1){if(r0)r0.activate();{if(r0!=null){if(J.nodeIsGrabbable(r0)){var N6=function P6(M6){M6.emit(G6("grab"))};if(q(r0),!r0.selected())u0=J.dragData.possibleDragElements=L0.collection(),I(r0,{addToList:u0}),r0.emit(G6("grabon")).emit(G6("grab"));else{u0=J.dragData.possibleDragElements=L0.collection();var F6=L0.$(function(P6){return P6.isNode()&&P6.selected()&&J.nodeIsGrabbable(P6)});A(F6,{addToList:u0}),r0.emit(G6("grabon")),F6.forEach(N6)}J.redrawHint("eles",!0),J.redrawHint("drag",!0)}}J.hoverData.down=r0,J.hoverData.downs=v0,J.hoverData.downTime=new Date().getTime()}if(K(r0,["mousedown","tapstart","vmousedown"],d,{x:T0[0],y:T0[1]}),r0==null)$0[4]=1,J.data.bgActivePosistion={x:T0[0],y:T0[1]},J.redrawHint("select",!0),J.redraw();else if(r0.pannable())$0[4]=1;A6()}$0[0]=$0[2]=T0[0],$0[1]=$0[3]=T0[1]},!1);var _=U(J.container);J.registerBinding([Q,_],"mousemove",function w0(d){var L0=J.hoverData.capture;if(!L0&&!h(d))return;var I0=!1,T0=J.cy,$0=T0.zoom(),v0=[d.clientX,d.clientY],r0=J.projectIntoViewport(v0[0],v0[1]),u0=J.hoverData.mdownPos,G6=J.hoverData.mdownGPos,A6=J.selection,r6=null;if(!J.hoverData.draggingEles&&!J.hoverData.dragging&&!J.hoverData.selecting)r6=J.findNearestElement(r0[0],r0[1],!0,!1);var N6=J.hoverData.last,F6=J.hoverData.down,P6=[r0[0]-A6[2],r0[1]-A6[3]],M6=J.dragData.possibleDragElements,g6;if(G6){var O8=v0[0]-G6[0],a6=O8*O8,U8=v0[1]-G6[1],p6=U8*U8,u6=a6+p6;J.hoverData.isOverThresholdDrag=g6=u6>=J.desktopTapThreshold2}var S0=X(d);if(g6)J.hoverData.tapholdCancelled=!0;var Q6=function g8(){var k6=J.hoverData.dragDelta=J.hoverData.dragDelta||[];if(k6.length===0)k6.push(P6[0]),k6.push(P6[1]);else k6[0]+=P6[0],k6[1]+=P6[1]};I0=!0,K(r6,["mousemove","vmousemove","tapdrag"],d,{x:r0[0],y:r0[1]});var B6=function g8(k6){return{originalEvent:d,type:k6,position:{x:r0[0],y:r0[1]}}},D0=function g8(){if(J.data.bgActivePosistion=void 0,!J.hoverData.selecting)T0.emit(B6("boxstart"));A6[4]=1,J.hoverData.selecting=!0,J.redrawHint("select",!0),J.redraw()};if(J.hoverData.which===3){if(g6){var X6=B6("cxtdrag");if(F6)F6.emit(X6);else T0.emit(X6);if(J.hoverData.cxtDragged=!0,!J.hoverData.cxtOver||r6!==J.hoverData.cxtOver){if(J.hoverData.cxtOver)J.hoverData.cxtOver.emit(B6("cxtdragout"));if(J.hoverData.cxtOver=r6,r6)r6.emit(B6("cxtdragover"))}}}else if(J.hoverData.dragging){if(I0=!0,T0.panningEnabled()&&T0.userPanningEnabled()){var W6;if(J.hoverData.justStartedPan){var _6=J.hoverData.mdownPos;W6={x:(r0[0]-_6[0])*$0,y:(r0[1]-_6[1])*$0},J.hoverData.justStartedPan=!1}else W6={x:P6[0]*$0,y:P6[1]*$0};T0.panBy(W6),T0.emit(B6("dragpan")),J.hoverData.dragged=!0}r0=J.projectIntoViewport(d.clientX,d.clientY)}else if(A6[4]==1&&(F6==null||F6.pannable())){if(g6){if(!J.hoverData.dragging&&T0.boxSelectionEnabled()&&(S0||!T0.panningEnabled()||!T0.userPanningEnabled()))D0();else if(!J.hoverData.selecting&&T0.panningEnabled()&&T0.userPanningEnabled()){var c6=Y(F6,J.hoverData.downs);if(c6)J.hoverData.dragging=!0,J.hoverData.justStartedPan=!0,A6[4]=0,J.data.bgActivePosistion=yA(u0),J.redrawHint("select",!0),J.redraw()}if(F6&&F6.pannable()&&F6.active())F6.unactivate()}}else{if(F6&&F6.pannable()&&F6.active())F6.unactivate();if((!F6||!F6.grabbed())&&r6!=N6){if(N6)K(N6,["mouseout","tapdragout"],d,{x:r0[0],y:r0[1]});if(r6)K(r6,["mouseover","tapdragover"],d,{x:r0[0],y:r0[1]});J.hoverData.last=r6}if(F6)if(g6){if(T0.boxSelectionEnabled()&&S0){if(F6&&F6.grabbed()){if(R(M6),F6.emit(B6("freeon")),M6.emit(B6("free")),J.dragData.didDrag)F6.emit(B6("dragfreeon")),M6.emit(B6("dragfree"))}D0()}else if(F6&&F6.grabbed()&&J.nodeIsDraggable(F6)){var d6=!J.dragData.didDrag;if(d6)J.redrawHint("eles",!0);if(J.dragData.didDrag=!0,!J.hoverData.draggingEles)A(M6,{inDragLayer:!0});var l6={x:0,y:0};if(A8(P6[0])&&A8(P6[1])){if(l6.x+=P6[0],l6.y+=P6[1],d6){var t6=J.hoverData.dragDelta;if(t6&&A8(t6[0])&&A8(t6[1]))l6.x+=t6[0],l6.y+=t6[1]}}J.hoverData.draggingEles=!0,M6.silentShift(l6).emit(B6("position")).emit(B6("drag")),J.redrawHint("drag",!0),J.redraw()}}else Q6();I0=!0}if(A6[2]=r0[0],A6[3]=r0[1],I0){if(d.stopPropagation)d.stopPropagation();if(d.preventDefault)d.preventDefault();return!1}},!1);var S,v,f;J.registerBinding(Q,"mouseup",function w0(d){if(J.hoverData.which===1&&d.which!==1&&J.hoverData.capture)return;var L0=J.hoverData.capture;if(!L0)return;J.hoverData.capture=!1;var I0=J.cy,T0=J.projectIntoViewport(d.clientX,d.clientY),$0=J.selection,v0=J.findNearestElement(T0[0],T0[1],!0,!1),r0=J.dragData.possibleDragElements,u0=J.hoverData.down,G6=X(d);if(J.data.bgActivePosistion)J.redrawHint("select",!0),J.redraw();if(J.hoverData.tapholdCancelled=!0,J.data.bgActivePosistion=void 0,u0)u0.unactivate();var A6=function g6(O8){return{originalEvent:d,type:O8,position:{x:T0[0],y:T0[1]}}};if(J.hoverData.which===3){var r6=A6("cxttapend");if(u0)u0.emit(r6);else I0.emit(r6);if(!J.hoverData.cxtDragged){var N6=A6("cxttap");if(u0)u0.emit(N6);else I0.emit(N6)}J.hoverData.cxtDragged=!1,J.hoverData.which=null}else if(J.hoverData.which===1){if(K(v0,["mouseup","tapend","vmouseup"],d,{x:T0[0],y:T0[1]}),!J.dragData.didDrag&&!J.hoverData.dragged&&!J.hoverData.selecting&&!J.hoverData.isOverThresholdDrag)if(K(u0,["click","tap","vclick"],d,{x:T0[0],y:T0[1]}),v=!1,d.timeStamp-f<=I0.multiClickDebounceTime())S&&clearTimeout(S),v=!0,f=null,K(u0,["dblclick","dbltap","vdblclick"],d,{x:T0[0],y:T0[1]});else S=setTimeout(function(){if(v)return;K(u0,["oneclick","onetap","voneclick"],d,{x:T0[0],y:T0[1]})},I0.multiClickDebounceTime()),f=d.timeStamp;if(u0==null&&!J.dragData.didDrag&&!J.hoverData.selecting&&!J.hoverData.dragged&&!X(d)){if(I0.$(Z).unselect(["tapunselect"]),r0.length>0)J.redrawHint("eles",!0);J.dragData.possibleDragElements=r0=I0.collection()}if(v0==u0&&!J.dragData.didDrag&&!J.hoverData.selecting){if(v0!=null&&v0._private.selectable){if(J.hoverData.dragging);else if(I0.selectionType()==="additive"||G6)if(v0.selected())v0.unselect(["tapunselect"]);else v0.select(["tapselect"]);else if(!G6)I0.$(Z).unmerge(v0).unselect(["tapunselect"]),v0.select(["tapselect"]);J.redrawHint("eles",!0)}}if(J.hoverData.selecting){var F6=I0.collection(J.getAllInBox($0[0],$0[1],$0[2],$0[3]));if(J.redrawHint("select",!0),F6.length>0)J.redrawHint("eles",!0);I0.emit(A6("boxend"));var P6=function g6(O8){return O8.selectable()&&!O8.selected()};if(I0.selectionType()==="additive")F6.emit(A6("box")).stdFilter(P6).select().emit(A6("boxselect"));else{if(!G6)I0.$(Z).unmerge(F6).unselect();F6.emit(A6("box")).stdFilter(P6).select().emit(A6("boxselect"))}J.redraw()}if(J.hoverData.dragging)J.hoverData.dragging=!1,J.redrawHint("select",!0),J.redrawHint("eles",!0),J.redraw();if(!$0[4]){J.redrawHint("drag",!0),J.redrawHint("eles",!0);var M6=u0&&u0.grabbed();if(R(r0),M6){if(u0.emit(A6("freeon")),r0.emit(A6("free")),J.dragData.didDrag)u0.emit(A6("dragfreeon")),r0.emit(A6("dragfree"))}}}$0[4]=0,J.hoverData.down=null,J.hoverData.cxtStarted=!1,J.hoverData.draggingEles=!1,J.hoverData.selecting=!1,J.hoverData.isOverThresholdDrag=!1,J.dragData.didDrag=!1,J.hoverData.dragged=!1,J.hoverData.dragDelta=[],J.hoverData.mdownPos=null,J.hoverData.mdownGPos=null,J.hoverData.which=null},!1);var x=[],y=4,m,g=1e5,p=function w0(d,L0){for(var I0=0;I0<d.length;I0++)if(d[I0]%L0!==0)return!1;return!0},i=function w0(d){var L0=Math.abs(d[0]);for(var I0=1;I0<d.length;I0++)if(Math.abs(d[I0])!==L0)return!1;return!0},l=function w0(d){var L0=!1,I0=d.deltaY;if(I0==null){if(d.wheelDeltaY!=null)I0=d.wheelDeltaY/4;else if(d.wheelDelta!=null)I0=d.wheelDelta/4}if(I0===0)return;if(m==null)if(x.length>=y){var T0=x;if(m=p(T0,5),!m){var $0=Math.abs(T0[0]);m=i(T0)&&$0>5}if(m)for(var v0=0;v0<T0.length;v0++)g=Math.min(Math.abs(T0[v0]),g)}else x.push(I0),L0=!0;else if(m)g=Math.min(Math.abs(I0),g);if(J.scrollingPage)return;var r0=J.cy,u0=r0.zoom(),G6=r0.pan(),A6=J.projectIntoViewport(d.clientX,d.clientY),r6=[A6[0]*u0+G6.x,A6[1]*u0+G6.y];if(J.hoverData.draggingEles||J.hoverData.dragging||J.hoverData.cxtStarted||b()){d.preventDefault();return}if(r0.panningEnabled()&&r0.userPanningEnabled()&&r0.zoomingEnabled()&&r0.userZoomingEnabled()){d.preventDefault(),J.data.wheelZooming=!0,clearTimeout(J.data.wheelTimeout),J.data.wheelTimeout=setTimeout(function(){J.data.wheelZooming=!1,J.redrawHint("eles",!0),J.redraw()},150);var N6;if(L0&&Math.abs(I0)>5)I0=wJ0(I0)*5;if(N6=I0/-250,m)N6/=g,N6*=3;N6=N6*J.wheelSensitivity;var F6=d.deltaMode===1;if(F6)N6*=33;var P6=r0.zoom()*Math.pow(10,N6);if(d.type==="gesturechange")P6=J.gestureStartZoom*d.scale;r0.zoom({level:P6,renderedPosition:{x:r6[0],y:r6[1]}}),r0.emit({type:d.type==="gesturechange"?"pinchzoom":"scrollzoom",originalEvent:d,position:{x:A6[0],y:A6[1]}})}};J.registerBinding(J.container,"wheel",l,!0),J.registerBinding(Q,"scroll",function w0(d){J.scrollingPage=!0,clearTimeout(J.scrollingPageTimeout),J.scrollingPageTimeout=setTimeout(function(){J.scrollingPage=!1},250)},!0),J.registerBinding(J.container,"gesturestart",function w0(d){if(J.gestureStartZoom=J.cy.zoom(),!J.hasTouchStarted)d.preventDefault()},!0),J.registerBinding(J.container,"gesturechange",function(w0){if(!J.hasTouchStarted)l(w0)},!0),J.registerBinding(J.container,"mouseout",function w0(d){var L0=J.projectIntoViewport(d.clientX,d.clientY);J.cy.emit({originalEvent:d,type:"mouseout",position:{x:L0[0],y:L0[1]}})},!1),J.registerBinding(J.container,"mouseover",function w0(d){var L0=J.projectIntoViewport(d.clientX,d.clientY);J.cy.emit({originalEvent:d,type:"mouseover",position:{x:L0[0],y:L0[1]}})},!1);var a,e,G0,U0,O0,X0,E0,W0,q0,z0,K0,R0,Y0,P0=function w0(d,L0,I0,T0){return Math.sqrt((I0-d)*(I0-d)+(T0-L0)*(T0-L0))},F0=function w0(d,L0,I0,T0){return(I0-d)*(I0-d)+(T0-L0)*(T0-L0)},m0;J.registerBinding(J.container,"touchstart",m0=function w0(d){if(J.hasTouchStarted=!0,!h(d))return;E(),J.touchData.capture=!0,J.data.bgActivePosistion=void 0;var L0=J.cy,I0=J.touchData.now,T0=J.touchData.earlier;if(d.touches[0]){var $0=J.projectIntoViewport(d.touches[0].clientX,d.touches[0].clientY);I0[0]=$0[0],I0[1]=$0[1]}if(d.touches[1]){var $0=J.projectIntoViewport(d.touches[1].clientX,d.touches[1].clientY);I0[2]=$0[0],I0[3]=$0[1]}if(d.touches[2]){var $0=J.projectIntoViewport(d.touches[2].clientX,d.touches[2].clientY);I0[4]=$0[0],I0[5]=$0[1]}var v0=function u6(S0){return{originalEvent:d,type:S0,position:{x:I0[0],y:I0[1]}}};if(d.touches[1]){J.touchData.singleTouchMoved=!0,R(J.dragData.touchDragEles);var r0=J.findContainerClientCoords();q0=r0[0],z0=r0[1],K0=r0[2],R0=r0[3],a=d.touches[0].clientX-q0,e=d.touches[0].clientY-z0,G0=d.touches[1].clientX-q0,U0=d.touches[1].clientY-z0,Y0=0<=a&&a<=K0&&0<=G0&&G0<=K0&&0<=e&&e<=R0&&0<=U0&&U0<=R0;var u0=L0.pan(),G6=L0.zoom();O0=P0(a,e,G0,U0),X0=F0(a,e,G0,U0),E0=[(a+G0)/2,(e+U0)/2],W0=[(E0[0]-u0.x)/G6,(E0[1]-u0.y)/G6];var A6=200,r6=A6*A6;if(X0<r6&&!d.touches[2]){var N6=J.findNearestElement(I0[0],I0[1],!0,!0),F6=J.findNearestElement(I0[2],I0[3],!0,!0);if(N6&&N6.isNode())N6.activate().emit(v0("cxttapstart")),J.touchData.start=N6;else if(F6&&F6.isNode())F6.activate().emit(v0("cxttapstart")),J.touchData.start=F6;else L0.emit(v0("cxttapstart"));if(J.touchData.start)J.touchData.start._private.grabbed=!1;J.touchData.cxt=!0,J.touchData.cxtDragged=!1,J.data.bgActivePosistion=void 0,J.redraw();return}}if(d.touches[2]){if(L0.boxSelectionEnabled())d.preventDefault()}else if(d.touches[1]);else if(d.touches[0]){var P6=J.findNearestElements(I0[0],I0[1],!0,!0),M6=P6[0];if(M6!=null){if(M6.activate(),J.touchData.start=M6,J.touchData.starts=P6,J.nodeIsGrabbable(M6)){var g6=J.dragData.touchDragEles=L0.collection(),O8=null;if(J.redrawHint("eles",!0),J.redrawHint("drag",!0),M6.selected())O8=L0.$(function(u6){return u6.selected()&&J.nodeIsGrabbable(u6)}),A(O8,{addToList:g6});else I(M6,{addToList:g6});if(q(M6),M6.emit(v0("grabon")),O8)O8.forEach(function(u6){u6.emit(v0("grab"))});else M6.emit(v0("grab"))}}if(K(M6,["touchstart","tapstart","vmousedown"],d,{x:I0[0],y:I0[1]}),M6==null)J.data.bgActivePosistion={x:$0[0],y:$0[1]},J.redrawHint("select",!0),J.redraw();J.touchData.singleTouchMoved=!1,J.touchData.singleTouchStartTime=+new Date,clearTimeout(J.touchData.tapholdTimeout),J.touchData.tapholdTimeout=setTimeout(function(){if(J.touchData.singleTouchMoved===!1&&!J.pinching&&!J.touchData.selecting)K(J.touchData.start,["taphold"],d,{x:I0[0],y:I0[1]})},J.tapholdDuration)}if(d.touches.length>=1){var a6=J.touchData.startPosition=[null,null,null,null,null,null];for(var U8=0;U8<I0.length;U8++)a6[U8]=T0[U8]=I0[U8];var p6=d.touches[0];J.touchData.startGPosition=[p6.clientX,p6.clientY]}},!1);var J0;J.registerBinding(Q,"touchmove",J0=function w0(d){var L0=J.touchData.capture;if(!L0&&!h(d))return;var{selection:I0,cy:T0}=J,$0=J.touchData.now,v0=J.touchData.earlier,r0=T0.zoom();if(d.touches[0]){var u0=J.projectIntoViewport(d.touches[0].clientX,d.touches[0].clientY);$0[0]=u0[0],$0[1]=u0[1]}if(d.touches[1]){var u0=J.projectIntoViewport(d.touches[1].clientX,d.touches[1].clientY);$0[2]=u0[0],$0[3]=u0[1]}if(d.touches[2]){var u0=J.projectIntoViewport(d.touches[2].clientX,d.touches[2].clientY);$0[4]=u0[0],$0[5]=u0[1]}var G6=function cK(lK){return{originalEvent:d,type:lK,position:{x:$0[0],y:$0[1]}}},A6=J.touchData.startGPosition,r6;if(L0&&d.touches[0]&&A6){var N6=[];for(var F6=0;F6<$0.length;F6++)N6[F6]=$0[F6]-v0[F6];var P6=d.touches[0].clientX-A6[0],M6=P6*P6,g6=d.touches[0].clientY-A6[1],O8=g6*g6,a6=M6+O8;r6=a6>=J.touchTapThreshold2}if(L0&&J.touchData.cxt){d.preventDefault();var U8=d.touches[0].clientX-q0,p6=d.touches[0].clientY-z0,u6=d.touches[1].clientX-q0,S0=d.touches[1].clientY-z0,Q6=F0(U8,p6,u6,S0),B6=Q6/X0,D0=150,X6=D0*D0,W6=1.5,_6=W6*W6;if(B6>=_6||Q6>=X6){J.touchData.cxt=!1,J.data.bgActivePosistion=void 0,J.redrawHint("select",!0);var c6=G6("cxttapend");if(J.touchData.start)J.touchData.start.unactivate().emit(c6),J.touchData.start=null;else T0.emit(c6)}}if(L0&&J.touchData.cxt){var c6=G6("cxtdrag");if(J.data.bgActivePosistion=void 0,J.redrawHint("select",!0),J.touchData.start)J.touchData.start.emit(c6);else T0.emit(c6);if(J.touchData.start)J.touchData.start._private.grabbed=!1;J.touchData.cxtDragged=!0;var d6=J.findNearestElement($0[0],$0[1],!0,!0);if(!J.touchData.cxtOver||d6!==J.touchData.cxtOver){if(J.touchData.cxtOver)J.touchData.cxtOver.emit(G6("cxtdragout"));if(J.touchData.cxtOver=d6,d6)d6.emit(G6("cxtdragover"))}}else if(L0&&d.touches[2]&&T0.boxSelectionEnabled()){if(d.preventDefault(),J.data.bgActivePosistion=void 0,this.lastThreeTouch=+new Date,!J.touchData.selecting)T0.emit(G6("boxstart"));if(J.touchData.selecting=!0,J.touchData.didSelect=!0,I0[4]=1,!I0||I0.length===0||I0[0]===void 0)I0[0]=($0[0]+$0[2]+$0[4])/3,I0[1]=($0[1]+$0[3]+$0[5])/3,I0[2]=($0[0]+$0[2]+$0[4])/3+1,I0[3]=($0[1]+$0[3]+$0[5])/3+1;else I0[2]=($0[0]+$0[2]+$0[4])/3,I0[3]=($0[1]+$0[3]+$0[5])/3;J.redrawHint("select",!0),J.redraw()}else if(L0&&d.touches[1]&&!J.touchData.didSelect&&T0.zoomingEnabled()&&T0.panningEnabled()&&T0.userZoomingEnabled()&&T0.userPanningEnabled()){d.preventDefault(),J.data.bgActivePosistion=void 0,J.redrawHint("select",!0);var l6=J.dragData.touchDragEles;if(l6){J.redrawHint("drag",!0);for(var t6=0;t6<l6.length;t6++){var g8=l6[t6]._private;g8.grabbed=!1,g8.rscratch.inDragLayer=!1}}var k6=J.touchData.start,U8=d.touches[0].clientX-q0,p6=d.touches[0].clientY-z0,u6=d.touches[1].clientX-q0,S0=d.touches[1].clientY-z0,d0=P0(U8,p6,u6,S0),V6=d0/O0;if(Y0){var Z8=U8-a,qJ=p6-e,ZJ=u6-G0,q8=S0-U0,B9=(Z8+ZJ)/2,m9=(qJ+q8)/2,H7=T0.zoom(),kJ=H7*V6,c0=T0.pan(),T6=W0[0]*H7+c0.x,z8=W0[1]*H7+c0.y,C6={x:-kJ/H7*(T6-c0.x-B9)+T6,y:-kJ/H7*(z8-c0.y-m9)+z8};if(k6&&k6.active()){var l6=J.dragData.touchDragEles;if(R(l6),J.redrawHint("drag",!0),J.redrawHint("eles",!0),k6.unactivate().emit(G6("freeon")),l6.emit(G6("free")),J.dragData.didDrag)k6.emit(G6("dragfreeon")),l6.emit(G6("dragfree"))}T0.viewport({zoom:kJ,pan:C6,cancelOnFailedZoom:!0}),T0.emit(G6("pinchzoom")),O0=d0,a=U8,e=p6,G0=u6,U0=S0,J.pinching=!0}if(d.touches[0]){var u0=J.projectIntoViewport(d.touches[0].clientX,d.touches[0].clientY);$0[0]=u0[0],$0[1]=u0[1]}if(d.touches[1]){var u0=J.projectIntoViewport(d.touches[1].clientX,d.touches[1].clientY);$0[2]=u0[0],$0[3]=u0[1]}if(d.touches[2]){var u0=J.projectIntoViewport(d.touches[2].clientX,d.touches[2].clientY);$0[4]=u0[0],$0[5]=u0[1]}}else if(d.touches[0]&&!J.touchData.didSelect){var wJ=J.touchData.start,x0=J.touchData.last,d6;if(!J.hoverData.draggingEles&&!J.swipePanning)d6=J.findNearestElement($0[0],$0[1],!0,!0);if(L0&&wJ!=null)d.preventDefault();if(L0&&wJ!=null&&J.nodeIsDraggable(wJ))if(r6){var l6=J.dragData.touchDragEles,fQ=!J.dragData.didDrag;if(fQ)A(l6,{inDragLayer:!0});J.dragData.didDrag=!0;var p0={x:0,y:0};if(A8(N6[0])&&A8(N6[1])){if(p0.x+=N6[0],p0.y+=N6[1],fQ){J.redrawHint("eles",!0);var xJ=J.touchData.dragDelta;if(xJ&&A8(xJ[0])&&A8(xJ[1]))p0.x+=xJ[0],p0.y+=xJ[1]}}if(J.hoverData.draggingEles=!0,l6.silentShift(p0).emit(G6("position")).emit(G6("drag")),J.redrawHint("drag",!0),J.touchData.startPosition[0]==v0[0]&&J.touchData.startPosition[1]==v0[1])J.redrawHint("eles",!0);J.redraw()}else{var xJ=J.touchData.dragDelta=J.touchData.dragDelta||[];if(xJ.length===0)xJ.push(N6[0]),xJ.push(N6[1]);else xJ[0]+=N6[0],xJ[1]+=N6[1]}{if(K(wJ||d6,["touchmove","tapdrag","vmousemove"],d,{x:$0[0],y:$0[1]}),(!wJ||!wJ.grabbed())&&d6!=x0){if(x0)x0.emit(G6("tapdragout"));if(d6)d6.emit(G6("tapdragover"))}J.touchData.last=d6}if(L0){for(var t6=0;t6<$0.length;t6++)if($0[t6]&&J.touchData.startPosition[t6]&&r6)J.touchData.singleTouchMoved=!0}if(L0&&(wJ==null||wJ.pannable())&&T0.panningEnabled()&&T0.userPanningEnabled()){var YQ=Y(wJ,J.touchData.starts);if(YQ){if(d.preventDefault(),!J.data.bgActivePosistion)J.data.bgActivePosistion=yA(J.touchData.startPosition);if(J.swipePanning)T0.panBy({x:N6[0]*r0,y:N6[1]*r0}),T0.emit(G6("dragpan"));else if(r6){if(J.swipePanning=!0,T0.panBy({x:P6*r0,y:g6*r0}),T0.emit(G6("dragpan")),wJ)wJ.unactivate(),J.redrawHint("select",!0),J.touchData.start=null}}var u0=J.projectIntoViewport(d.touches[0].clientX,d.touches[0].clientY);$0[0]=u0[0],$0[1]=u0[1]}}for(var F6=0;F6<$0.length;F6++)v0[F6]=$0[F6];if(L0&&d.touches.length>0&&!J.hoverData.draggingEles&&!J.swipePanning&&J.data.bgActivePosistion!=null)J.data.bgActivePosistion=void 0,J.redrawHint("select",!0),J.redraw()},!1);var z6;J.registerBinding(Q,"touchcancel",z6=function w0(d){var L0=J.touchData.start;if(J.touchData.capture=!1,L0)L0.unactivate()});var t,N0,f0,l0;if(J.registerBinding(Q,"touchend",t=function w0(d){var L0=J.touchData.start,I0=J.touchData.capture;if(I0){if(d.touches.length===0)J.touchData.capture=!1;d.preventDefault()}else return;var T0=J.selection;J.swipePanning=!1,J.hoverData.draggingEles=!1;var $0=J.cy,v0=$0.zoom(),r0=J.touchData.now,u0=J.touchData.earlier;if(d.touches[0]){var G6=J.projectIntoViewport(d.touches[0].clientX,d.touches[0].clientY);r0[0]=G6[0],r0[1]=G6[1]}if(d.touches[1]){var G6=J.projectIntoViewport(d.touches[1].clientX,d.touches[1].clientY);r0[2]=G6[0],r0[3]=G6[1]}if(d.touches[2]){var G6=J.projectIntoViewport(d.touches[2].clientX,d.touches[2].clientY);r0[4]=G6[0],r0[5]=G6[1]}var A6=function D0(X6){return{originalEvent:d,type:X6,position:{x:r0[0],y:r0[1]}}};if(L0)L0.unactivate();var r6;if(J.touchData.cxt){if(r6=A6("cxttapend"),L0)L0.emit(r6);else $0.emit(r6);if(!J.touchData.cxtDragged){var N6=A6("cxttap");if(L0)L0.emit(N6);else $0.emit(N6)}if(J.touchData.start)J.touchData.start._private.grabbed=!1;J.touchData.cxt=!1,J.touchData.start=null,J.redraw();return}if(!d.touches[2]&&$0.boxSelectionEnabled()&&J.touchData.selecting){J.touchData.selecting=!1;var F6=$0.collection(J.getAllInBox(T0[0],T0[1],T0[2],T0[3]));T0[0]=void 0,T0[1]=void 0,T0[2]=void 0,T0[3]=void 0,T0[4]=0,J.redrawHint("select",!0),$0.emit(A6("boxend"));var P6=function D0(X6){return X6.selectable()&&!X6.selected()};if(F6.emit(A6("box")).stdFilter(P6).select().emit(A6("boxselect")),F6.nonempty())J.redrawHint("eles",!0);J.redraw()}if(L0!=null)L0.unactivate();if(d.touches[2])J.data.bgActivePosistion=void 0,J.redrawHint("select",!0);else if(d.touches[1]);else if(d.touches[0]);else if(!d.touches[0]){J.data.bgActivePosistion=void 0,J.redrawHint("select",!0);var M6=J.dragData.touchDragEles;if(L0!=null){var g6=L0._private.grabbed;if(R(M6),J.redrawHint("drag",!0),J.redrawHint("eles",!0),g6){if(L0.emit(A6("freeon")),M6.emit(A6("free")),J.dragData.didDrag)L0.emit(A6("dragfreeon")),M6.emit(A6("dragfree"))}K(L0,["touchend","tapend","vmouseup","tapdragout"],d,{x:r0[0],y:r0[1]}),L0.unactivate(),J.touchData.start=null}else{var O8=J.findNearestElement(r0[0],r0[1],!0,!0);K(O8,["touchend","tapend","vmouseup","tapdragout"],d,{x:r0[0],y:r0[1]})}var a6=J.touchData.startPosition[0]-r0[0],U8=a6*a6,p6=J.touchData.startPosition[1]-r0[1],u6=p6*p6,S0=U8+u6,Q6=S0*v0*v0;if(!J.touchData.singleTouchMoved){if(!L0)$0.$(":selected").unselect(["tapunselect"]);if(K(L0,["tap","vclick"],d,{x:r0[0],y:r0[1]}),N0=!1,d.timeStamp-l0<=$0.multiClickDebounceTime())f0&&clearTimeout(f0),N0=!0,l0=null,K(L0,["dbltap","vdblclick"],d,{x:r0[0],y:r0[1]});else f0=setTimeout(function(){if(N0)return;K(L0,["onetap","voneclick"],d,{x:r0[0],y:r0[1]})},$0.multiClickDebounceTime()),l0=d.timeStamp}if(L0!=null&&!J.dragData.didDrag&&L0._private.selectable&&Q6<J.touchTapThreshold2&&!J.pinching){if($0.selectionType()==="single")$0.$(Z).unmerge(L0).unselect(["tapunselect"]),L0.select(["tapselect"]);else if(L0.selected())L0.unselect(["tapunselect"]);else L0.select(["tapselect"]);J.redrawHint("eles",!0)}J.touchData.singleTouchMoved=!0}for(var B6=0;B6<r0.length;B6++)u0[B6]=r0[B6];if(J.dragData.didDrag=!1,d.touches.length===0)J.touchData.dragDelta=[],J.touchData.startPosition=[null,null,null,null,null,null],J.touchData.startGPosition=null,J.touchData.didSelect=!1;if(d.touches.length<2){if(d.touches.length===1)J.touchData.startGPosition=[d.touches[0].clientX,d.touches[0].clientY];J.pinching=!1,J.redrawHint("eles",!0),J.redraw()}},!1),typeof TouchEvent==="undefined"){var k0=[],_0=function w0(d){return{clientX:d.clientX,clientY:d.clientY,force:1,identifier:d.pointerId,pageX:d.pageX,pageY:d.pageY,radiusX:d.width/2,radiusY:d.height/2,screenX:d.screenX,screenY:d.screenY,target:d.target}},g0=function w0(d){return{event:d,touch:_0(d)}},h0=function w0(d){k0.push(g0(d))},t0=function w0(d){for(var L0=0;L0<k0.length;L0++){var I0=k0[L0];if(I0.event.pointerId===d.pointerId){k0.splice(L0,1);return}}},C0=function w0(d){var L0=k0.filter(function(I0){return I0.event.pointerId===d.pointerId})[0];L0.event=d,L0.touch=_0(d)},y0=function w0(d){d.touches=k0.map(function(L0){return L0.touch})},o=function w0(d){return d.pointerType==="mouse"||d.pointerType===4};J.registerBinding(J.container,"pointerdown",function(w0){if(o(w0))return;w0.preventDefault(),h0(w0),y0(w0),m0(w0)}),J.registerBinding(J.container,"pointerup",function(w0){if(o(w0))return;t0(w0),y0(w0),t(w0)}),J.registerBinding(J.container,"pointercancel",function(w0){if(o(w0))return;t0(w0),y0(w0),z6(w0)}),J.registerBinding(J.container,"pointermove",function(w0){if(o(w0))return;w0.preventDefault(),C0(w0),y0(w0),J0(w0)})}};HW={};HW.generatePolygon=function(J,Q){return this.nodeShapes[J]={renderer:this,name:J,points:Q,draw:function Z(U,K,X,Y,z,G){this.renderer.nodeShapeImpl("polygon",U,K,X,Y,z,this.points)},intersectLine:function Z(U,K,X,Y,z,G,W,H){return Bj(z,G,this.points,U,K,X/2,Y/2,W)},checkPoint:function Z(U,K,X,Y,z,G,W,H){return WW(U,K,this.points,G,W,Y,z,[0,-1],X)},hasMiterBounds:J!=="rectangle",miterBounds:function Z(U,K,X,Y,z,G){return kC6(this.points,U,K,X,Y,z)}}};HW.generateEllipse=function(){return this.nodeShapes.ellipse={renderer:this,name:"ellipse",draw:function J(Q,Z,U,K,X,Y){this.renderer.nodeShapeImpl(this.name,Q,Z,U,K,X)},intersectLine:function J(Q,Z,U,K,X,Y,z,G){return mC6(X,Y,Q,Z,U/2+z,K/2+z)},checkPoint:function J(Q,Z,U,K,X,Y,z,G){return fB(Q,Z,K,X,Y,z,U)}}};HW.generateRoundPolygon=function(J,Q){return this.nodeShapes[J]={renderer:this,name:J,points:Q,getOrCreateCorners:function Z(U,K,X,Y,z,G,W){if(G[W]!==void 0&&G[W+"-cx"]===U&&G[W+"-cy"]===K)return G[W];G[W]=new Array(Q.length/2),G[W+"-cx"]=U,G[W+"-cy"]=K;var H=X/2,q=Y/2;z=z==="auto"?ex0(X,Y):z;var F=new Array(Q.length/2);for(var M=0;M<Q.length/2;M++)F[M]={x:U+H*Q[M*2],y:K+q*Q[M*2+1]};var L,A,I,R,N=F.length;A=F[N-1];for(L=0;L<N;L++)I=F[L%N],R=F[(L+1)%N],G[W][L]=bJ0(A,I,R,z),A=I,I=R;return G[W]},draw:function Z(U,K,X,Y,z,G,W){this.renderer.nodeShapeImpl("round-polygon",U,K,X,Y,z,this.points,this.getOrCreateCorners(K,X,Y,z,G,W,"drawCorners"))},intersectLine:function Z(U,K,X,Y,z,G,W,H,q){return pC6(z,G,this.points,U,K,X,Y,W,this.getOrCreateCorners(U,K,X,Y,H,q,"corners"))},checkPoint:function Z(U,K,X,Y,z,G,W,H,q){return gC6(U,K,this.points,G,W,Y,z,this.getOrCreateCorners(G,W,Y,z,H,q,"corners"))}}};HW.generateRoundRectangle=function(){return this.nodeShapes["round-rectangle"]=this.nodeShapes.roundrectangle={renderer:this,name:"round-rectangle",points:kU(4,0),draw:function J(Q,Z,U,K,X,Y){this.renderer.nodeShapeImpl(this.name,Q,Z,U,K,X,this.points,Y)},intersectLine:function J(Q,Z,U,K,X,Y,z,G){return ox0(X,Y,Q,Z,U,K,z,G)},checkPoint:function J(Q,Z,U,K,X,Y,z,G){var W=K/2,H=X/2;G=G==="auto"?gq(K,X):G,G=Math.min(W,H,G);var q=G*2;if(WW(Q,Z,this.points,Y,z,K,X-q,[0,-1],U))return!0;if(WW(Q,Z,this.points,Y,z,K-q,X,[0,-1],U))return!0;if(fB(Q,Z,q,q,Y-W+G,z-H+G,U))return!0;if(fB(Q,Z,q,q,Y+W-G,z-H+G,U))return!0;if(fB(Q,Z,q,q,Y+W-G,z+H-G,U))return!0;if(fB(Q,Z,q,q,Y-W+G,z+H-G,U))return!0;return!1}}};HW.generateCutRectangle=function(){return this.nodeShapes["cut-rectangle"]=this.nodeShapes.cutrectangle={renderer:this,name:"cut-rectangle",cornerLength:jJ0(),points:kU(4,0),draw:function J(Q,Z,U,K,X,Y){this.renderer.nodeShapeImpl(this.name,Q,Z,U,K,X,null,Y)},generateCutTrianglePts:function J(Q,Z,U,K,X){var Y=X==="auto"?this.cornerLength:X,z=Z/2,G=Q/2,W=U-G,H=U+G,q=K-z,F=K+z;return{topLeft:[W,q+Y,W+Y,q,W+Y,q+Y],topRight:[H-Y,q,H,q+Y,H-Y,q+Y],bottomRight:[H,F-Y,H-Y,F,H-Y,F-Y],bottomLeft:[W+Y,F,W,F-Y,W+Y,F-Y]}},intersectLine:function J(Q,Z,U,K,X,Y,z,G){var W=this.generateCutTrianglePts(U+2*z,K+2*z,Q,Z,G),H=[].concat.apply([],[W.topLeft.splice(0,4),W.topRight.splice(0,4),W.bottomRight.splice(0,4),W.bottomLeft.splice(0,4)]);return Bj(X,Y,H,Q,Z)},checkPoint:function J(Q,Z,U,K,X,Y,z,G){var W=G==="auto"?this.cornerLength:G;if(WW(Q,Z,this.points,Y,z,K,X-2*W,[0,-1],U))return!0;if(WW(Q,Z,this.points,Y,z,K-2*W,X,[0,-1],U))return!0;var H=this.generateCutTrianglePts(K,X,Y,z);return _5(Q,Z,H.topLeft)||_5(Q,Z,H.topRight)||_5(Q,Z,H.bottomRight)||_5(Q,Z,H.bottomLeft)}}};HW.generateBarrel=function(){return this.nodeShapes.barrel={renderer:this,name:"barrel",points:kU(4,0),draw:function J(Q,Z,U,K,X,Y){this.renderer.nodeShapeImpl(this.name,Q,Z,U,K,X)},intersectLine:function J(Q,Z,U,K,X,Y,z,G){var W=0.15,H=0.5,q=0.85,F=this.generateBarrelBezierPts(U+2*z,K+2*z,Q,Z),M=function A(I){var R=uA({x:I[0],y:I[1]},{x:I[2],y:I[3]},{x:I[4],y:I[5]},W),N=uA({x:I[0],y:I[1]},{x:I[2],y:I[3]},{x:I[4],y:I[5]},H),E=uA({x:I[0],y:I[1]},{x:I[2],y:I[3]},{x:I[4],y:I[5]},q);return[I[0],I[1],R.x,R.y,N.x,N.y,E.x,E.y,I[4],I[5]]},L=[].concat(M(F.topLeft),M(F.topRight),M(F.bottomRight),M(F.bottomLeft));return Bj(X,Y,L,Q,Z)},generateBarrelBezierPts:function J(Q,Z,U,K){var X=Z/2,Y=Q/2,z=U-Y,G=U+Y,W=K-X,H=K+X,q=a80(Q,Z),F=q.heightOffset,M=q.widthOffset,L=q.ctrlPtOffsetPct*Q,A={topLeft:[z,W+F,z+L,W,z+M,W],topRight:[G-M,W,G-L,W,G,W+F],bottomRight:[G,H-F,G-L,H,G-M,H],bottomLeft:[z+M,H,z+L,H,z,H-F]};return A.topLeft.isTop=!0,A.topRight.isTop=!0,A.bottomLeft.isBottom=!0,A.bottomRight.isBottom=!0,A},checkPoint:function J(Q,Z,U,K,X,Y,z,G){var W=a80(K,X),H=W.heightOffset,q=W.widthOffset;if(WW(Q,Z,this.points,Y,z,K,X-2*H,[0,-1],U))return!0;if(WW(Q,Z,this.points,Y,z,K-2*q,X,[0,-1],U))return!0;var F=this.generateBarrelBezierPts(K,X,Y,z),M=function C($,b,h){var _=h[4],S=h[2],v=h[0],f=h[5],x=h[1],y=Math.min(_,v),m=Math.max(_,v),g=Math.min(f,x),p=Math.max(f,x);if(y<=$&&$<=m&&g<=b&&b<=p){var i=cC6(_,S,v),l=bC6(i[0],i[1],i[2],$),a=l.filter(function(e){return 0<=e&&e<=1});if(a.length>0)return a[0]}return null},L=Object.keys(F);for(var A=0;A<L.length;A++){var I=L[A],R=F[I],N=M(Q,Z,R);if(N==null)continue;var E=R[5],V=R[3],j=R[1],T=sQ(E,V,j,N);if(R.isTop&&T<=Z)return!0;if(R.isBottom&&Z<=T)return!0}return!1}}};HW.generateBottomRoundrectangle=function(){return this.nodeShapes["bottom-round-rectangle"]=this.nodeShapes.bottomroundrectangle={renderer:this,name:"bottom-round-rectangle",points:kU(4,0),draw:function J(Q,Z,U,K,X,Y){this.renderer.nodeShapeImpl(this.name,Q,Z,U,K,X,this.points,Y)},intersectLine:function J(Q,Z,U,K,X,Y,z,G){var W=Q-(U/2+z),H=Z-(K/2+z),q=H,F=Q+(U/2+z),M=_q(X,Y,Q,Z,W,H,F,q,!1);if(M.length>0)return M;return ox0(X,Y,Q,Z,U,K,z,G)},checkPoint:function J(Q,Z,U,K,X,Y,z,G){G=G==="auto"?gq(K,X):G;var W=2*G;if(WW(Q,Z,this.points,Y,z,K,X-W,[0,-1],U))return!0;if(WW(Q,Z,this.points,Y,z,K-W,X,[0,-1],U))return!0;var H=K/2+2*U,q=X/2+2*U,F=[Y-H,z-q,Y-H,z,Y+H,z,Y+H,z-q];if(_5(Q,Z,F))return!0;if(fB(Q,Z,W,W,Y+K/2-G,z+X/2-G,U))return!0;if(fB(Q,Z,W,W,Y-K/2+G,z+X/2-G,U))return!0;return!1}}};HW.registerNodeShapes=function(){var J=this.nodeShapes={},Q=this;this.generateEllipse(),this.generatePolygon("triangle",kU(3,0)),this.generateRoundPolygon("round-triangle",kU(3,0)),this.generatePolygon("rectangle",kU(4,0)),J.square=J.rectangle,this.generateRoundRectangle(),this.generateCutRectangle(),this.generateBarrel(),this.generateBottomRoundrectangle();{var Z=[0,1,1,0,0,-1,-1,0];this.generatePolygon("diamond",Z),this.generateRoundPolygon("round-diamond",Z)}this.generatePolygon("pentagon",kU(5,0)),this.generateRoundPolygon("round-pentagon",kU(5,0)),this.generatePolygon("hexagon",kU(6,0)),this.generateRoundPolygon("round-hexagon",kU(6,0)),this.generatePolygon("heptagon",kU(7,0)),this.generateRoundPolygon("round-heptagon",kU(7,0)),this.generatePolygon("octagon",kU(8,0)),this.generateRoundPolygon("round-octagon",kU(8,0));var U=new Array(20);{var K=s80(5,0),X=s80(5,Math.PI/5),Y=0.5*(3-Math.sqrt(5));Y*=1.57;for(var z=0;z<X.length/2;z++)X[z*2]*=Y,X[z*2+1]*=Y;for(var z=0;z<5;z++)U[z*4]=K[z*2],U[z*4+1]=K[z*2+1],U[z*4+2]=X[z*2],U[z*4+3]=X[z*2+1]}U=tx0(U),this.generatePolygon("star",U),this.generatePolygon("vee",[-1,-1,0,-0.333,1,-1,0,1]),this.generatePolygon("rhomboid",[-1,-1,0.333,-1,1,1,-0.333,1]),this.generatePolygon("right-rhomboid",[-0.333,-1,1,-1,0.333,1,-1,1]),this.nodeShapes.concavehexagon=this.generatePolygon("concave-hexagon",[-1,-0.95,-0.75,0,-1,0.95,1,0.95,0.75,0,1,-0.95]);{var G=[-1,-1,0.25,-1,1,0,0.25,1,-1,1];this.generatePolygon("tag",G),this.generateRoundPolygon("round-tag",G)}J.makePolygon=function(W){var H=W.join("$"),q="polygon-"+H,F;if(F=this[q])return F;return Q.generatePolygon(q,W)}};Sj={};Sj.timeToRender=function(){return this.redrawTotalTime/this.redrawCount};Sj.redraw=function(J){J=J||rx0();var Q=this;if(Q.averageRedrawTime===void 0)Q.averageRedrawTime=0;if(Q.lastRedrawTime===void 0)Q.lastRedrawTime=0;if(Q.lastDrawTime===void 0)Q.lastDrawTime=0;Q.requestedFrame=!0,Q.renderOptions=J};Sj.beforeRender=function(J,Q){if(this.destroyed)return;if(Q==null)U4("Priority is not optional for beforeRender");var Z=this.beforeRenderCallbacks;Z.push({fn:J,priority:Q}),Z.sort(function(U,K){return K.priority-U.priority})};Sj.startRenderLoop=function(){var J=this,Q=J.cy;if(J.renderLoopStarted)return;else J.renderLoopStarted=!0;var Z=function U(K){if(J.destroyed)return;if(Q.batching());else if(J.requestedFrame&&!J.skipFrame){Fx0(J,!0,K);var X=GW();J.render(J.renderOptions);var Y=J.lastDrawTime=GW();if(J.averageRedrawTime===void 0)J.averageRedrawTime=Y-X;if(J.redrawCount===void 0)J.redrawCount=0;if(J.redrawCount++,J.redrawTotalTime===void 0)J.redrawTotalTime=0;var z=Y-X;J.redrawTotalTime+=z,J.lastRedrawTime=z,J.averageRedrawTime=J.averageRedrawTime/2+z/2,J.requestedFrame=!1}else Fx0(J,!1,K);J.skipFrame=!1,ub(Z)};ub(Z)};eh0=Xk6,eA=eh0.prototype;eA.clientFunctions=["redrawHint","render","renderTo","matchCanvasSize","nodeShapeImpl","arrowShapeImpl"];eA.init=function(J){var Q=this;Q.options=J,Q.cy=J.cy;var Z=Q.container=J.cy.container(),U=Q.cy.window();if(U){var K=U.document,X=K.head,Y="__________cytoscape_stylesheet",z="__________cytoscape_container",G=K.getElementById(Y)!=null;if(Z.className.indexOf(z)<0)Z.className=(Z.className||"")+" "+z;if(!G){var W=K.createElement("style");W.id=Y,W.textContent="."+z+" { position: relative; }",X.insertBefore(W,X.children[0])}var H=U.getComputedStyle(Z),q=H.getPropertyValue("position");if(q==="static")e9("A Cytoscape container has style position:static and so can not use UI extensions properly")}Q.selection=[void 0,void 0,void 0,void 0,0],Q.bezierProjPcts=[0.05,0.225,0.4,0.5,0.6,0.775,0.95],Q.hoverData={down:null,last:null,downTime:null,triggerMode:null,dragging:!1,initialPan:[null,null],capture:!1},Q.dragData={possibleDragElements:[]},Q.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]},Q.redraws=0,Q.showFps=J.showFps,Q.debug=J.debug,Q.webgl=J.webgl,Q.hideEdgesOnViewport=J.hideEdgesOnViewport,Q.textureOnViewport=J.textureOnViewport,Q.wheelSensitivity=J.wheelSensitivity,Q.motionBlurEnabled=J.motionBlur,Q.forcedPixelRatio=A8(J.pixelRatio)?J.pixelRatio:null,Q.motionBlur=J.motionBlur,Q.motionBlurOpacity=J.motionBlurOpacity,Q.motionBlurTransparency=1-Q.motionBlurOpacity,Q.motionBlurPxRatio=1,Q.mbPxRBlurry=1,Q.minMbLowQualFrames=4,Q.fullQualityMb=!1,Q.clearedForMotionBlur=[],Q.desktopTapThreshold=J.desktopTapThreshold,Q.desktopTapThreshold2=J.desktopTapThreshold*J.desktopTapThreshold,Q.touchTapThreshold=J.touchTapThreshold,Q.touchTapThreshold2=J.touchTapThreshold*J.touchTapThreshold,Q.tapholdDuration=500,Q.bindings=[],Q.beforeRenderCallbacks=[],Q.beforeRenderPriorities={animations:400,eleCalcs:300,eleTxrDeq:200,lyrTxrDeq:150,lyrTxrSkip:100},Q.registerNodeShapes(),Q.registerArrowShapes(),Q.registerCalculationListeners()};eA.notify=function(J,Q){var Z=this,U=Z.cy;if(this.destroyed)return;if(J==="init"){Z.load();return}if(J==="destroy"){Z.destroy();return}if(J==="add"||J==="remove"||J==="move"&&U.hasCompoundNodes()||J==="load"||J==="zorder"||J==="mount")Z.invalidateCachedZSortedEles();if(J==="viewport")Z.redrawHint("select",!0);if(J==="gc")Z.redrawHint("gc",!0);if(J==="load"||J==="resize"||J==="mount")Z.invalidateContainerClientCoordsCache(),Z.matchCanvasSize(Z.container);Z.redrawHint("eles",!0),Z.redrawHint("drag",!0),this.startRenderLoop(),this.redraw()};eA.destroy=function(){var J=this;J.destroyed=!0,J.cy.stopAnimationLoop();for(var Q=0;Q<J.bindings.length;Q++){var Z=J.bindings[Q],U=Z,K=U.target;(K.off||K.removeEventListener).apply(K,U.args)}if(J.bindings=[],J.beforeRenderCallbacks=[],J.onUpdateEleCalcsFns=[],J.removeObserver)J.removeObserver.disconnect();if(J.styleObserver)J.styleObserver.disconnect();if(J.resizeObserver)J.resizeObserver.disconnect();if(J.labelCalcDiv)try{document.body.removeChild(J.labelCalcDiv)}catch(X){}};eA.isHeadless=function(){return!1};[_J0,oh0,th0,tA,HW,Sj].forEach(function(J){HJ(eA,J)});Jy0={setupDequeueing:function J(Q){return function Z(){var U=this,K=this.renderer;if(U.dequeueingSetup)return;else U.dequeueingSetup=!0;var X=jj(function(){K.redrawHint("eles",!0),K.redrawHint("drag",!0),K.redraw()},Q.deqRedrawThreshold),Y=function G(W,H){var q=GW(),F=K.averageRedrawTime,M=K.lastRedrawTime,L=[],A=K.cy.extent(),I=K.getPixelRatio();if(!W)K.flushRenderedStyleQueue();while(!0){var R=GW(),N=R-q,E=R-H;if(M<m80){var V=m80-(W?F:0);if(E>=Q.deqFastCost*V)break}else if(W){if(N>=Q.deqCost*M||N>=Q.deqAvgCost*F)break}else if(E>=Q.deqNoDrawCost*m80)break;var j=Q.deq(U,I,A);if(j.length>0)for(var T=0;T<j.length;T++)L.push(j[T]);else break}if(L.length>0){if(Q.onDeqd(U,L),!W&&Q.shouldRedraw(U,L,I,A))X()}},z=Q.priority||RJ0;K.beforeRender(Y,z(U))}}},Yk6=function(){function J(Q){var Z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:pb;cq(this,J),this.idsByKey=new zW,this.keyForId=new zW,this.cachesByLvl=new zW,this.lvls=[],this.getKey=Q,this.doesEleInvalidateKey=Z}return lq(J,[{key:"getIdsFor",value:function Q(Z){if(Z==null)U4("Can not get id list for null key");var U=this.idsByKey,K=this.idsByKey.get(Z);if(!K)K=new nA,U.set(Z,K);return K}},{key:"addIdForKey",value:function Q(Z,U){if(Z!=null)this.getIdsFor(Z).add(U)}},{key:"deleteIdForKey",value:function Q(Z,U){if(Z!=null)this.getIdsFor(Z).delete(U)}},{key:"getNumberOfIdsForKey",value:function Q(Z){if(Z==null)return 0;else return this.getIdsFor(Z).size}},{key:"updateKeyMappingFor",value:function Q(Z){var U=Z.id(),K=this.keyForId.get(U),X=this.getKey(Z);this.deleteIdForKey(K,U),this.addIdForKey(X,U),this.keyForId.set(U,X)}},{key:"deleteKeyMappingFor",value:function Q(Z){var U=Z.id(),K=this.keyForId.get(U);this.deleteIdForKey(K,U),this.keyForId.delete(U)}},{key:"keyHasChangedFor",value:function Q(Z){var U=Z.id(),K=this.keyForId.get(U),X=this.getKey(Z);return K!==X}},{key:"isInvalid",value:function Q(Z){return this.keyHasChangedFor(Z)||this.doesEleInvalidateKey(Z)}},{key:"getCachesAt",value:function Q(Z){var U=this.cachesByLvl,K=this.lvls,X=U.get(Z);if(!X)X=new zW,U.set(Z,X),K.push(Z);return X}},{key:"getCache",value:function Q(Z,U){return this.getCachesAt(U).get(Z)}},{key:"get",value:function Q(Z,U){var K=this.getKey(Z),X=this.getCache(K,U);if(X!=null)this.updateKeyMappingFor(Z);return X}},{key:"getForCachedKey",value:function Q(Z,U){var K=this.keyForId.get(Z.id()),X=this.getCache(K,U);return X}},{key:"hasCache",value:function Q(Z,U){return this.getCachesAt(U).has(Z)}},{key:"has",value:function Q(Z,U){var K=this.getKey(Z);return this.hasCache(K,U)}},{key:"setCache",value:function Q(Z,U,K){K.key=Z,this.getCachesAt(U).set(Z,K)}},{key:"set",value:function Q(Z,U,K){var X=this.getKey(Z);this.setCache(X,U,K),this.updateKeyMappingFor(Z)}},{key:"deleteCache",value:function Q(Z,U){this.getCachesAt(U).delete(Z)}},{key:"delete",value:function Q(Z,U){var K=this.getKey(Z);this.deleteCache(K,U)}},{key:"invalidateKey",value:function Q(Z){var U=this;this.lvls.forEach(function(K){return U.deleteCache(Z,K)})}},{key:"invalidate",value:function Q(Z){var U=Z.id(),K=this.keyForId.get(U);this.deleteKeyMappingFor(Z);var X=this.doesEleInvalidateKey(Z);if(X)this.invalidateKey(K);return X||this.getNumberOfIdsForKey(K)===0}}])}(),mA={dequeue:"dequeue",downscale:"downscale",highQuality:"highQuality"},Nk6=fZ({getKey:null,doesEleInvalidateKey:pb,drawElement:null,getBoundingBox:null,getRotationPoint:null,getRotationOffset:null,isVisible:lx0,allowEdgeTxrCaching:!0,allowParentTxrCaching:!0}),CQ=Xj.prototype;CQ.reasons=mA;CQ.getTextureQueue=function(J){var Q=this;return Q.eleImgCaches=Q.eleImgCaches||{},Q.eleImgCaches[J]=Q.eleImgCaches[J]||[]};CQ.getRetiredTextureQueue=function(J){var Q=this,Z=Q.eleImgCaches.retired=Q.eleImgCaches.retired||{},U=Z[J]=Z[J]||[];return U};CQ.getElementQueue=function(){var J=this,Q=J.eleCacheQueue=J.eleCacheQueue||new Pj(function(Z,U){return U.reqs-Z.reqs});return Q};CQ.getElementKeyToQueue=function(){var J=this,Q=J.eleKeyToCacheQueue=J.eleKeyToCacheQueue||{};return Q};CQ.getElement=function(J,Q,Z,U,K){var X=this,Y=this.renderer,z=Y.cy.zoom(),G=this.lookup;if(!Q||Q.w===0||Q.h===0||isNaN(Q.w)||isNaN(Q.h)||!J.visible()||J.removed())return null;if(!X.allowEdgeTxrCaching&&J.isEdge()||!X.allowParentTxrCaching&&J.isParent())return null;if(U==null)U=Math.ceil(DJ0(z*Z));if(U<hb)U=hb;else if(z>=Qy0||U>WJ0)return null;var W=Math.pow(2,U),H=Q.h*W,q=Q.w*W,F=Y.eleTextBiggerThanMin(J,W);if(!this.isVisible(J,F))return null;var M=G.get(J,U);if(M&&M.invalidated)M.invalidated=!1,M.texture.invalidatedWidth-=M.width;if(M)return M;var L;if(H<=Bx0)L=Bx0;else if(H<=Vb)L=Vb;else L=Math.ceil(H/Vb)*Vb;if(H>Hk6||q>Wk6)return null;var A=X.getTextureQueue(L),I=A[A.length-2],R=function x(){return X.recycleTexture(L,q)||X.addTexture(L,q)};if(!I)I=A[A.length-1];if(!I)I=R();if(I.width-I.usedWidth<q)I=R();var N=function x(y){return y&&y.scaledLabelShown===F},E=K&&K===mA.dequeue,V=K&&K===mA.highQuality,j=K&&K===mA.downscale,T;for(var C=U+1;C<=WJ0;C++){var $=G.get(J,C);if($){T=$;break}}var b=T&&T.level===U+1?T:null,h=function x(){I.context.drawImage(b.texture.canvas,b.x,0,b.width,b.height,I.usedWidth,0,q,H)};if(I.context.setTransform(1,0,0,1,0,0),I.context.clearRect(I.usedWidth,0,q,L),N(b))h();else if(N(T))if(V){for(var _=T.level;_>U;_--)b=X.getElement(J,Q,Z,_,mA.downscale);h()}else return X.queueElement(J,T.level-1),T;else{var S;if(!E&&!V&&!j)for(var v=U-1;v>=hb;v--){var f=G.get(J,v);if(f){S=f;break}}if(N(S))return X.queueElement(J,U),S;I.context.translate(I.usedWidth,0),I.context.scale(W,W),this.drawElement(I.context,J,Q,F,!1),I.context.scale(1/W,1/W),I.context.translate(-I.usedWidth,0)}return M={x:I.usedWidth,texture:I,level:U,scale:W,width:q,height:H,scaledLabelShown:F},I.usedWidth+=Math.ceil(q+zk6),I.eleCaches.push(M),G.set(J,U,M),X.checkTextureFullness(I),M};CQ.invalidateElements=function(J){for(var Q=0;Q<J.length;Q++)this.invalidateElement(J[Q])};CQ.invalidateElement=function(J){var Q=this,Z=Q.lookup,U=[],K=Z.isInvalid(J);if(!K)return;for(var X=hb;X<=WJ0;X++){var Y=Z.getForCachedKey(J,X);if(Y)U.push(Y)}var z=Z.invalidate(J);if(z)for(var G=0;G<U.length;G++){var W=U[G],H=W.texture;H.invalidatedWidth+=W.width,W.invalidated=!0,Q.checkTextureUtility(H)}Q.removeFromQueue(J)};CQ.checkTextureUtility=function(J){if(J.invalidatedWidth>=qk6*J.width)this.retireTexture(J)};CQ.checkTextureFullness=function(J){var Q=this,Z=Q.getTextureQueue(J.height);if(J.usedWidth/J.width>Fk6&&J.fullnessChecks>=Bk6)yq(Z,J);else J.fullnessChecks++};CQ.retireTexture=function(J){var Q=this,Z=J.height,U=Q.getTextureQueue(Z),K=this.lookup;yq(U,J),J.retired=!0;var X=J.eleCaches;for(var Y=0;Y<X.length;Y++){var z=X[Y];K.deleteCache(z.key,z.level)}NJ0(X);var G=Q.getRetiredTextureQueue(Z);G.push(J)};CQ.addTexture=function(J,Q){var Z=this,U=Z.getTextureQueue(J),K={};return U.push(K),K.eleCaches=[],K.height=J,K.width=Math.max(Gk6,Q),K.usedWidth=0,K.invalidatedWidth=0,K.fullnessChecks=0,K.canvas=Z.renderer.makeOffscreenCanvas(K.width,K.height),K.context=K.canvas.getContext("2d"),K};CQ.recycleTexture=function(J,Q){var Z=this,U=Z.getTextureQueue(J),K=Z.getRetiredTextureQueue(J);for(var X=0;X<K.length;X++){var Y=K[X];if(Y.width>=Q)return Y.retired=!1,Y.usedWidth=0,Y.invalidatedWidth=0,Y.fullnessChecks=0,NJ0(Y.eleCaches),Y.context.setTransform(1,0,0,1,0,0),Y.context.clearRect(0,0,Y.width,Y.height),yq(K,Y),U.push(Y),Y}};CQ.queueElement=function(J,Q){var Z=this,U=Z.getElementQueue(),K=Z.getElementKeyToQueue(),X=this.getKey(J),Y=K[X];if(Y)Y.level=Math.max(Y.level,Q),Y.eles.merge(J),Y.reqs++,U.updateItem(Y);else{var z={eles:J.spawn().merge(J),level:Q,reqs:1,key:X};U.push(z),K[X]=z}};CQ.dequeue=function(J){var Q=this,Z=Q.getElementQueue(),U=Q.getElementKeyToQueue(),K=[],X=Q.lookup;for(var Y=0;Y<Rk6;Y++)if(Z.size()>0){var z=Z.pop(),G=z.key,W=z.eles[0],H=X.hasCache(W,z.level);if(U[G]=null,H)continue;K.push(z);var q=Q.getBoundingBox(W);Q.getElement(W,q,J,z.level,mA.dequeue)}else break;return K};CQ.removeFromQueue=function(J){var Q=this,Z=Q.getElementQueue(),U=Q.getElementKeyToQueue(),K=this.getKey(J),X=U[K];if(X!=null)if(X.eles.length===1)X.reqs=IJ0,Z.updateItem(X),Z.pop(),U[K]=null;else X.eles.unmerge(J)};CQ.onDequeue=function(J){this.onDequeues.push(J)};CQ.offDequeue=function(J){yq(this.onDequeues,J)};CQ.setupDequeueing=Jy0.setupDequeueing({deqRedrawThreshold:Ik6,deqCost:Mk6,deqAvgCost:Ok6,deqNoDrawCost:Lk6,deqFastCost:Ak6,deq:function J(Q,Z,U){return Q.dequeue(Z,U)},onDeqd:function J(Q,Z){for(var U=0;U<Q.onDequeues.length;U++){var K=Q.onDequeues[U];K(Z)}},shouldRedraw:function J(Q,Z,U,K){for(var X=0;X<Z.length;X++){var Y=Z[X].eles;for(var z=0;z<Y.length;z++){var G=Y[z].boundingBox();if(EJ0(G,K))return!0}}return!1},priority:function J(Q){return Q.renderer.beforeRenderPriorities.eleTxrDeq}});_Z=Zy0.prototype,kk6=Math.pow(2,53)-1;_Z.makeLayer=function(J,Q){var Z=Math.pow(2,Q),U=Math.ceil(J.w*Z),K=Math.ceil(J.h*Z),X=this.renderer.makeOffscreenCanvas(U,K),Y={id:Lx0=++Lx0%kk6,bb:J,level:Q,width:U,height:K,canvas:X,context:X.getContext("2d"),eles:[],elesQueue:[],reqs:0},z=Y.context,G=-Y.bb.x1,W=-Y.bb.y1;return z.scale(Z,Z),z.translate(G,W),Y};_Z.getLayers=function(J,Q,Z){var U=this,K=U.renderer,X=K.cy,Y=X.zoom(),z=U.firstGet;if(U.firstGet=!1,Z==null){if(Z=Math.ceil(DJ0(Y*Q)),Z<zj)Z=zj;else if(Y>=wk6||Z>ab)return null}U.validateLayersElesOrdering(Z,J);var G=U.layersByLevel,W=Math.pow(2,Z),H=G[Z]=G[Z]||[],q,F=U.levelIsComplete(Z,J),M,L=function b(){var h=function f(x){if(U.validateLayersElesOrdering(x,J),U.levelIsComplete(x,J))return M=G[x],!0},_=function f(x){if(M)return;for(var y=Z+x;zj<=y&&y<=ab;y+=x)if(h(y))break};_(1),_(-1);for(var S=H.length-1;S>=0;S--){var v=H[S];if(v.invalid)yq(H,v)}};if(!F)L();else return H;var A=function b(){if(!q){q=fU();for(var h=0;h<J.length;h++)SC6(q,J[h].boundingBox())}return q},I=function b(h){h=h||{};var _=h.after;A();var S=Math.ceil(q.w*W),v=Math.ceil(q.h*W);if(S>Ox0||v>Ox0)return null;var f=S*v;if(f>$k6)return null;var x=U.makeLayer(q,Z);if(_!=null){var y=H.indexOf(_)+1;H.splice(y,0,x)}else if(h.insert===void 0||h.insert)H.unshift(x);return x};if(U.skipping&&!z)return null;var R=null,N=J.length/Dk6,E=!z;for(var V=0;V<J.length;V++){var j=J[V],T=j._private.rscratch,C=T.imgLayerCaches=T.imgLayerCaches||{},$=C[Z];if($){R=$;continue}if(!R||R.eles.length>=N||!ax0(R.bb,j.boundingBox())){if(R=I({insert:!0,after:R}),!R)return null}if(M||E)U.queueLayer(R,j);else U.drawEleInLayer(R,j,Z,Q);R.eles.push(j),C[Z]=R}if(M)return M;if(E)return null;return H};_Z.getEleLevelForLayerLevel=function(J,Q){return J};_Z.drawEleInLayer=function(J,Q,Z,U){var K=this,X=this.renderer,Y=J.context,z=Q.boundingBox();if(z.w===0||z.h===0||!Q.visible())return;Z=K.getEleLevelForLayerLevel(Z,U),X.setImgSmoothing(Y,!1),X.drawCachedElement(Y,Q,null,null,Z,vk6),X.setImgSmoothing(Y,!0)};_Z.levelIsComplete=function(J,Q){var Z=this,U=Z.layersByLevel[J];if(!U||U.length===0)return!1;var K=0;for(var X=0;X<U.length;X++){var Y=U[X];if(Y.reqs>0)return!1;if(Y.invalid)return!1;K+=Y.eles.length}if(K!==Q.length)return!1;return!0};_Z.validateLayersElesOrdering=function(J,Q){var Z=this.layersByLevel[J];if(!Z)return;for(var U=0;U<Z.length;U++){var K=Z[U],X=-1;for(var Y=0;Y<Q.length;Y++)if(K.eles[0]===Q[Y]){X=Y;break}if(X<0){this.invalidateLayer(K);continue}var z=X;for(var Y=0;Y<K.eles.length;Y++)if(K.eles[Y]!==Q[z+Y]){this.invalidateLayer(K);break}}};_Z.updateElementsInLayers=function(J,Q){var Z=this,U=Nj(J[0]);for(var K=0;K<J.length;K++){var X=U?null:J[K],Y=U?J[K]:J[K].ele,z=Y._private.rscratch,G=z.imgLayerCaches=z.imgLayerCaches||{};for(var W=zj;W<=ab;W++){var H=G[W];if(!H)continue;if(X&&Z.getEleLevelForLayerLevel(H.level)!==X.level)continue;Q(H,Y,X)}}};_Z.haveLayers=function(){var J=this,Q=!1;for(var Z=zj;Z<=ab;Z++){var U=J.layersByLevel[Z];if(U&&U.length>0){Q=!0;break}}return Q};_Z.invalidateElements=function(J){var Q=this;if(J.length===0)return;if(Q.lastInvalidationTime=GW(),J.length===0||!Q.haveLayers())return;Q.updateElementsInLayers(J,function Z(U,K,X){Q.invalidateLayer(U)})};_Z.invalidateLayer=function(J){if(this.lastInvalidationTime=GW(),J.invalid)return;var{level:Q,eles:Z}=J,U=this.layersByLevel[Q];if(yq(U,J),J.elesQueue=[],J.invalid=!0,J.replacement)J.replacement.invalid=!0;for(var K=0;K<Z.length;K++){var X=Z[K]._private.rscratch.imgLayerCaches;if(X)X[Q]=null}};_Z.refineElementTextures=function(J){var Q=this;Q.updateElementsInLayers(J,function Z(U,K,X){var Y=U.replacement;if(!Y)Y=U.replacement=Q.makeLayer(U.bb,U.level),Y.replaces=U,Y.eles=U.eles;if(!Y.reqs)for(var z=0;z<Y.eles.length;z++)Q.queueLayer(Y,Y.eles[z])})};_Z.enqueueElementRefinement=function(J){this.eleTxrDeqs.merge(J),this.scheduleElementRefinement()};_Z.queueLayer=function(J,Q){var Z=this,U=Z.layersQueue,K=J.elesQueue,X=K.hasId=K.hasId||{};if(J.replacement)return;if(Q){if(X[Q.id()])return;K.push(Q),X[Q.id()]=!0}if(J.reqs)J.reqs++,U.updateItem(J);else J.reqs=1,U.push(J)};_Z.dequeue=function(J){var Q=this,Z=Q.layersQueue,U=[],K=0;while(K<Sk6){if(Z.size()===0)break;var X=Z.peek();if(X.replacement){Z.pop();continue}if(X.replaces&&X!==X.replaces.replacement){Z.pop();continue}if(X.invalid){Z.pop();continue}var Y=X.elesQueue.shift();if(Y)Q.drawEleInLayer(X,Y,X.level,J),K++;if(U.length===0)U.push(!0);if(X.elesQueue.length===0){if(Z.pop(),X.reqs=0,X.replaces)Q.applyLayerReplacement(X);Q.requestRedraw()}}return U};_Z.applyLayerReplacement=function(J){var Q=this,Z=Q.layersByLevel[J.level],U=J.replaces,K=Z.indexOf(U);if(K<0||U.invalid)return;Z[K]=J;for(var X=0;X<J.eles.length;X++){var Y=J.eles[X]._private,z=Y.imgLayerCaches=Y.imgLayerCaches||{};if(z)z[J.level]=J}Q.requestRedraw()};_Z.requestRedraw=jj(function(){var J=this.renderer;J.redrawHint("eles",!0),J.redrawHint("drag",!0),J.redraw()},100);_Z.setupDequeueing=Jy0.setupDequeueing({deqRedrawThreshold:Ek6,deqCost:Pk6,deqAvgCost:Vk6,deqNoDrawCost:Tk6,deqFastCost:Ck6,deq:function J(Q,Z){return Q.dequeue(Z)},onDeqd:RJ0,shouldRedraw:lx0,priority:function J(Q){return Q.renderer.beforeRenderPriorities.lyrTxrDeq}});Uy0={};Uy0.arrowShapeImpl=function(J){return(Ax0||(Ax0={polygon:fk6,"triangle-backcurve":_k6,"triangle-tee":Ix0,"circle-triangle":bk6,"triangle-cross":Ix0,circle:xk6}))[J]};Nz={};Nz.drawElement=function(J,Q,Z,U,K,X){var Y=this;if(Q.isNode())Y.drawNode(J,Q,Z,U,K,X);else Y.drawEdge(J,Q,Z,U,K,X)};Nz.drawElementOverlay=function(J,Q){var Z=this;if(Q.isNode())Z.drawNodeOverlay(J,Q);else Z.drawEdgeOverlay(J,Q)};Nz.drawElementUnderlay=function(J,Q){var Z=this;if(Q.isNode())Z.drawNodeUnderlay(J,Q);else Z.drawEdgeUnderlay(J,Q)};Nz.drawCachedElementPortion=function(J,Q,Z,U,K,X,Y,z){var G=this,W=Z.getBoundingBox(Q);if(W.w===0||W.h===0)return;var H=Z.getElement(Q,W,U,K,X);if(H!=null){var q=z(G,Q);if(q===0)return;var F=Y(G,Q),M=W.x1,L=W.y1,A=W.w,I=W.h,R,N,E,V,j;if(F!==0){var T=Z.getRotationPoint(Q);if(E=T.x,V=T.y,J.translate(E,V),J.rotate(F),j=G.getImgSmoothing(J),!j)G.setImgSmoothing(J,!0);var C=Z.getRotationOffset(Q);R=C.x,N=C.y}else R=M,N=L;var $;if(q!==1)$=J.globalAlpha,J.globalAlpha=$*q;if(J.drawImage(H.texture.canvas,H.x,0,H.width,H.height,R,N,A,I),q!==1)J.globalAlpha=$;if(F!==0){if(J.rotate(-F),J.translate(-E,-V),!j)G.setImgSmoothing(J,!1)}}else Z.drawElement(J,Q)};Nz.drawCachedElement=function(J,Q,Z,U,K,X){var Y=this,z=Y.data,G=z.eleTxrCache,W=z.lblTxrCache,H=z.slbTxrCache,q=z.tlbTxrCache,F=Q.boundingBox(),M=X===!0?G.reasons.highQuality:null;if(F.w===0||F.h===0||!Q.visible())return;if(!U||EJ0(F,U)){var L=Q.isEdge(),A=Q.element()._private.rscratch.badLine;if(Y.drawElementUnderlay(J,Q),Y.drawCachedElementPortion(J,Q,G,Z,K,M,hk6,uk6),!L||!A)Y.drawCachedElementPortion(J,Q,W,Z,K,M,yk6,u80);if(L&&!A)Y.drawCachedElementPortion(J,Q,H,Z,K,M,gk6,u80),Y.drawCachedElementPortion(J,Q,q,Z,K,M,mk6,u80);Y.drawElementOverlay(J,Q)}};Nz.drawElements=function(J,Q){var Z=this;for(var U=0;U<Q.length;U++){var K=Q[U];Z.drawElement(J,K)}};Nz.drawCachedElements=function(J,Q,Z,U){var K=this;for(var X=0;X<Q.length;X++){var Y=Q[X];K.drawCachedElement(J,Y,Z,U)}};Nz.drawCachedNodes=function(J,Q,Z,U){var K=this;for(var X=0;X<Q.length;X++){var Y=Q[X];if(!Y.isNode())continue;K.drawCachedElement(J,Y,Z,U)}};Nz.drawLayeredElements=function(J,Q,Z,U){var K=this,X=K.data.lyrTxrCache.getLayers(Q,Z);if(X)for(var Y=0;Y<X.length;Y++){var z=X[Y],G=z.bb;if(G.w===0||G.h===0)continue;J.drawImage(z.canvas,G.x1,G.y1,G.w,G.h)}else K.drawCachedElements(J,Q,Z,U)};qW={};qW.drawEdge=function(J,Q,Z){var U=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,K=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,X=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,Y=this,z=Q._private.rscratch;if(X&&!Q.visible())return;if(z.badLine||z.allpts==null||isNaN(z.allpts[0]))return;var G;if(Z)G=Z,J.translate(-G.x1,-G.y1);var W=X?Q.pstyle("opacity").value:1,H=X?Q.pstyle("line-opacity").value:1,q=Q.pstyle("curve-style").value,F=Q.pstyle("line-style").value,M=Q.pstyle("width").pfValue,L=Q.pstyle("line-cap").value,A=Q.pstyle("line-outline-width").value,I=Q.pstyle("line-outline-color").value,R=W*H,N=W*H,E=function f(){var x=arguments.length>0&&arguments[0]!==void 0?arguments[0]:R;if(q==="straight-triangle")Y.eleStrokeStyle(J,Q,x),Y.drawEdgeTrianglePath(Q,J,z.allpts);else J.lineWidth=M,J.lineCap=L,Y.eleStrokeStyle(J,Q,x),Y.drawEdgePath(Q,J,z.allpts,F),J.lineCap="butt"},V=function f(){var x=arguments.length>0&&arguments[0]!==void 0?arguments[0]:R;if(J.lineWidth=M+A,J.lineCap=L,A>0)Y.colorStrokeStyle(J,I[0],I[1],I[2],x);else{J.lineCap="butt";return}if(q==="straight-triangle")Y.drawEdgeTrianglePath(Q,J,z.allpts);else Y.drawEdgePath(Q,J,z.allpts,F),J.lineCap="butt"},j=function f(){if(!K)return;Y.drawEdgeOverlay(J,Q)},T=function f(){if(!K)return;Y.drawEdgeUnderlay(J,Q)},C=function f(){var x=arguments.length>0&&arguments[0]!==void 0?arguments[0]:N;Y.drawArrowheads(J,Q,x)},$=function f(){Y.drawElementText(J,Q,null,U)};J.lineJoin="round";var b=Q.pstyle("ghost").value==="yes";if(b){var h=Q.pstyle("ghost-offset-x").pfValue,_=Q.pstyle("ghost-offset-y").pfValue,S=Q.pstyle("ghost-opacity").value,v=R*S;J.translate(h,_),E(v),C(v),J.translate(-h,-_)}else V();if(T(),E(),C(),j(),$(),Z)J.translate(G.x1,G.y1)};qW.drawEdgeOverlay=Ky0("overlay");qW.drawEdgeUnderlay=Ky0("underlay");qW.drawEdgePath=function(J,Q,Z,U){var K=J._private.rscratch,X=Q,Y,z=!1,G=this.usePaths(),W=J.pstyle("line-dash-pattern").pfValue,H=J.pstyle("line-dash-offset").pfValue;if(G){var q=Z.join("$"),F=K.pathCacheKey&&K.pathCacheKey===q;if(F)Y=Q=K.pathCache,z=!0;else Y=Q=new Path2D,K.pathCacheKey=q,K.pathCache=Y}if(X.setLineDash)switch(U){case"dotted":X.setLineDash([1,1]);break;case"dashed":X.setLineDash(W),X.lineDashOffset=H;break;case"solid":X.setLineDash([]);break}if(!z&&!K.badLine){if(Q.beginPath)Q.beginPath();switch(Q.moveTo(Z[0],Z[1]),K.edgeType){case"bezier":case"self":case"compound":case"multibezier":for(var M=2;M+3<Z.length;M+=4)Q.quadraticCurveTo(Z[M],Z[M+1],Z[M+2],Z[M+3]);break;case"straight":case"haystack":for(var L=2;L+1<Z.length;L+=2)Q.lineTo(Z[L],Z[L+1]);break;case"segments":if(K.isRound){var A=b5(K.roundCorners),I;try{for(A.s();!(I=A.n()).done;){var R=I.value;ih0(Q,R)}}catch(E){A.e(E)}finally{A.f()}Q.lineTo(Z[Z.length-2],Z[Z.length-1])}else for(var N=2;N+1<Z.length;N+=2)Q.lineTo(Z[N],Z[N+1]);break}}if(Q=X,G)Q.stroke(Y);else Q.stroke();if(Q.setLineDash)Q.setLineDash([])};qW.drawEdgeTrianglePath=function(J,Q,Z){Q.fillStyle=Q.strokeStyle;var U=J.pstyle("width").pfValue;for(var K=0;K+1<Z.length;K+=2){var X=[Z[K+2]-Z[K],Z[K+3]-Z[K+1]],Y=Math.sqrt(X[0]*X[0]+X[1]*X[1]),z=[X[1]/Y,-X[0]/Y],G=[z[0]*U/2,z[1]*U/2];Q.beginPath(),Q.moveTo(Z[K]-G[0],Z[K+1]-G[1]),Q.lineTo(Z[K]+G[0],Z[K+1]+G[1]),Q.lineTo(Z[K+2],Z[K+3]),Q.closePath(),Q.fill()}};qW.drawArrowheads=function(J,Q,Z){var U=Q._private.rscratch,K=U.edgeType==="haystack";if(!K)this.drawArrowhead(J,Q,"source",U.arrowStartX,U.arrowStartY,U.srcArrowAngle,Z);if(this.drawArrowhead(J,Q,"mid-target",U.midX,U.midY,U.midtgtArrowAngle,Z),this.drawArrowhead(J,Q,"mid-source",U.midX,U.midY,U.midsrcArrowAngle,Z),!K)this.drawArrowhead(J,Q,"target",U.arrowEndX,U.arrowEndY,U.tgtArrowAngle,Z)};qW.drawArrowhead=function(J,Q,Z,U,K,X,Y){if(isNaN(U)||U==null||isNaN(K)||K==null||isNaN(X)||X==null)return;var z=this,G=Q.pstyle(Z+"-arrow-shape").value;if(G==="none")return;var W=Q.pstyle(Z+"-arrow-fill").value==="hollow"?"both":"filled",H=Q.pstyle(Z+"-arrow-fill").value,q=Q.pstyle("width").pfValue,F=Q.pstyle(Z+"-arrow-width"),M=F.value==="match-line"?q:F.pfValue;if(F.units==="%")M*=q;var L=Q.pstyle("opacity").value;if(Y===void 0)Y=L;var A=J.globalCompositeOperation;if(Y!==1||H==="hollow")J.globalCompositeOperation="destination-out",z.colorFillStyle(J,255,255,255,1),z.colorStrokeStyle(J,255,255,255,1),z.drawArrowShape(Q,J,W,q,G,M,U,K,X),J.globalCompositeOperation=A;var I=Q.pstyle(Z+"-arrow-color").value;z.colorFillStyle(J,I[0],I[1],I[2],Y),z.colorStrokeStyle(J,I[0],I[1],I[2],Y),z.drawArrowShape(Q,J,H,q,G,M,U,K,X)};qW.drawArrowShape=function(J,Q,Z,U,K,X,Y,z,G){var W=this,H=this.usePaths()&&K!=="triangle-cross",q=!1,F,M=Q,L={x:Y,y:z},A=J.pstyle("arrow-scale").value,I=this.getArrowWidth(U,A),R=W.arrowShapes[K];if(H){var N=W.arrowPathCache=W.arrowPathCache||[],E=_B(K),V=N[E];if(V!=null)F=Q=V,q=!0;else F=Q=new Path2D,N[E]=F}if(!q){if(Q.beginPath)Q.beginPath();if(H)R.draw(Q,1,0,{x:0,y:0},1);else R.draw(Q,I,G,L,U);if(Q.closePath)Q.closePath()}if(Q=M,H)Q.translate(Y,z),Q.rotate(G),Q.scale(I,I);if(Z==="filled"||Z==="both")if(H)Q.fill(F);else Q.fill();if(Z==="hollow"||Z==="both")if(Q.lineWidth=X/(H?I:1),Q.lineJoin="miter",H)Q.stroke(F);else Q.stroke();if(H)Q.scale(1/I,1/I),Q.rotate(-G),Q.translate(-Y,-z)};hJ0={};hJ0.safeDrawImage=function(J,Q,Z,U,K,X,Y,z,G,W){if(K<=0||X<=0||G<=0||W<=0)return;try{J.drawImage(Q,Z,U,K,X,Y,z,G,W)}catch(H){e9(H)}};hJ0.drawInscribedImage=function(J,Q,Z,U,K){var X=this,Y=Z.position(),z=Y.x,G=Y.y,W=Z.cy().style(),H=W.getIndexedStyle.bind(W),q=H(Z,"background-fit","value",U),F=H(Z,"background-repeat","value",U),M=Z.width(),L=Z.height(),A=Z.padding()*2,I=M+(H(Z,"background-width-relative-to","value",U)==="inner"?0:A),R=L+(H(Z,"background-height-relative-to","value",U)==="inner"?0:A),N=Z._private.rscratch,E=H(Z,"background-clip","value",U),V=E==="node",j=H(Z,"background-image-opacity","value",U)*K,T=H(Z,"background-image-smoothing","value",U),C=Z.pstyle("corner-radius").value;if(C!=="auto")C=Z.pstyle("corner-radius").pfValue;var $=Q.width||Q.cachedW,b=Q.height||Q.cachedH;if($==null||b==null)document.body.appendChild(Q),$=Q.cachedW=Q.width||Q.offsetWidth,b=Q.cachedH=Q.height||Q.offsetHeight,document.body.removeChild(Q);var h=$,_=b;if(H(Z,"background-width","value",U)!=="auto")if(H(Z,"background-width","units",U)==="%")h=H(Z,"background-width","pfValue",U)*I;else h=H(Z,"background-width","pfValue",U);if(H(Z,"background-height","value",U)!=="auto")if(H(Z,"background-height","units",U)==="%")_=H(Z,"background-height","pfValue",U)*R;else _=H(Z,"background-height","pfValue",U);if(h===0||_===0)return;if(q==="contain"){var S=Math.min(I/h,R/_);h*=S,_*=S}else if(q==="cover"){var S=Math.max(I/h,R/_);h*=S,_*=S}var v=z-I/2,f=H(Z,"background-position-x","units",U),x=H(Z,"background-position-x","pfValue",U);if(f==="%")v+=(I-h)*x;else v+=x;var y=H(Z,"background-offset-x","units",U),m=H(Z,"background-offset-x","pfValue",U);if(y==="%")v+=(I-h)*m;else v+=m;var g=G-R/2,p=H(Z,"background-position-y","units",U),i=H(Z,"background-position-y","pfValue",U);if(p==="%")g+=(R-_)*i;else g+=i;var l=H(Z,"background-offset-y","units",U),a=H(Z,"background-offset-y","pfValue",U);if(l==="%")g+=(R-_)*a;else g+=a;if(N.pathCache)v-=z,g-=G,z=0,G=0;var e=J.globalAlpha;J.globalAlpha=j;var G0=X.getImgSmoothing(J),U0=!1;if(T==="no"&&G0)X.setImgSmoothing(J,!1),U0=!0;else if(T==="yes"&&!G0)X.setImgSmoothing(J,!0),U0=!0;if(F==="no-repeat"){if(V)if(J.save(),N.pathCache)J.clip(N.pathCache);else X.nodeShapes[X.getNodeShape(Z)].draw(J,z,G,I,R,C,N),J.clip();if(X.safeDrawImage(J,Q,0,0,$,b,v,g,h,_),V)J.restore()}else{var O0=J.createPattern(Q,F);J.fillStyle=O0,X.nodeShapes[X.getNodeShape(Z)].draw(J,z,G,I,R,C,N),J.translate(v,g),J.fill(),J.translate(-v,-g)}if(J.globalAlpha=e,U0)X.setImgSmoothing(J,G0)};mB={};mB.eleTextBiggerThanMin=function(J,Q){if(!Q){var Z=J.cy().zoom(),U=this.getPixelRatio(),K=Math.ceil(DJ0(Z*U));Q=Math.pow(2,K)}var X=J.pstyle("font-size").pfValue*Q,Y=J.pstyle("min-zoomed-font-size").pfValue;if(X<Y)return!1;return!0};mB.drawElementText=function(J,Q,Z,U,K){var X=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,Y=this;if(U==null){if(X&&!Y.eleTextBiggerThanMin(Q))return}else if(U===!1)return;if(Q.isNode()){var z=Q.pstyle("label");if(!z||!z.value)return;var G=Y.getLabelJustification(Q);J.textAlign=G,J.textBaseline="bottom"}else{var W=Q.element()._private.rscratch.badLine,H=Q.pstyle("label"),q=Q.pstyle("source-label"),F=Q.pstyle("target-label");if(W||(!H||!H.value)&&(!q||!q.value)&&(!F||!F.value))return;J.textAlign="center",J.textBaseline="bottom"}var M=!Z,L;if(Z)L=Z,J.translate(-L.x1,-L.y1);if(K==null){if(Y.drawText(J,Q,null,M,X),Q.isEdge())Y.drawText(J,Q,"source",M,X),Y.drawText(J,Q,"target",M,X)}else Y.drawText(J,Q,K,M,X);if(Z)J.translate(L.x1,L.y1)};mB.getFontCache=function(J){var Q;this.fontCaches=this.fontCaches||[];for(var Z=0;Z<this.fontCaches.length;Z++)if(Q=this.fontCaches[Z],Q.context===J)return Q;return Q={context:J},this.fontCaches.push(Q),Q};mB.setupTextStyle=function(J,Q){var Z=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,U=Q.pstyle("font-style").strValue,K=Q.pstyle("font-size").pfValue+"px",X=Q.pstyle("font-family").strValue,Y=Q.pstyle("font-weight").strValue,z=Z?Q.effectiveOpacity()*Q.pstyle("text-opacity").value:1,G=Q.pstyle("text-outline-opacity").value*z,W=Q.pstyle("color").value,H=Q.pstyle("text-outline-color").value;J.font=U+" "+Y+" "+K+" "+X,J.lineJoin="round",this.colorFillStyle(J,W[0],W[1],W[2],z),this.colorStrokeStyle(J,H[0],H[1],H[2],G)};mB.getTextAngle=function(J,Q){var Z,U=J._private,K=U.rscratch,X=Q?Q+"-":"",Y=J.pstyle(X+"text-rotation");if(Y.strValue==="autorotate"){var z=f5(K,"labelAngle",Q);Z=J.isEdge()?z:0}else if(Y.strValue==="none")Z=0;else Z=Y.pfValue;return Z};mB.drawText=function(J,Q,Z){var U=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,K=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,X=Q._private,Y=X.rscratch,z=K?Q.effectiveOpacity():1;if(K&&(z===0||Q.pstyle("text-opacity").value===0))return;if(Z==="main")Z=null;var G=f5(Y,"labelX",Z),W=f5(Y,"labelY",Z),H,q,F=this.getLabelText(Q,Z);if(F!=null&&F!==""&&!isNaN(G)&&!isNaN(W)){this.setupTextStyle(J,Q,K);var M=Z?Z+"-":"",L=f5(Y,"labelWidth",Z),A=f5(Y,"labelHeight",Z),I=Q.pstyle(M+"text-margin-x").pfValue,R=Q.pstyle(M+"text-margin-y").pfValue,N=Q.isEdge(),E=Q.pstyle("text-halign").value,V=Q.pstyle("text-valign").value;if(N)E="center",V="center";G+=I,W+=R;var j;if(!U)j=0;else j=this.getTextAngle(Q,Z);if(j!==0)H=G,q=W,J.translate(H,q),J.rotate(j),G=0,W=0;switch(V){case"top":break;case"center":W+=A/2;break;case"bottom":W+=A;break}var T=Q.pstyle("text-background-opacity").value,C=Q.pstyle("text-border-opacity").value,$=Q.pstyle("text-border-width").pfValue,b=Q.pstyle("text-background-padding").pfValue,h=Q.pstyle("text-background-shape").strValue,_=h==="round-rectangle"||h==="roundrectangle",S=h==="circle",v=2;if(T>0||$>0&&C>0){var{fillStyle:f,strokeStyle:x,lineWidth:y}=J,m=Q.pstyle("text-background-color").value,g=Q.pstyle("text-border-color").value,p=Q.pstyle("text-border-style").value,i=T>0,l=$>0&&C>0,a=G-b;switch(E){case"left":a-=L;break;case"center":a-=L/2;break}var e=W-A-b,G0=L+2*b,U0=A+2*b;if(i)J.fillStyle="rgba(".concat(m[0],",").concat(m[1],",").concat(m[2],",").concat(T*z,")");if(l){if(J.strokeStyle="rgba(".concat(g[0],",").concat(g[1],",").concat(g[2],",").concat(C*z,")"),J.lineWidth=$,J.setLineDash)switch(p){case"dotted":J.setLineDash([1,1]);break;case"dashed":J.setLineDash([4,2]);break;case"double":J.lineWidth=$/4,J.setLineDash([]);break;case"solid":default:J.setLineDash([]);break}}if(_)J.beginPath(),Rx0(J,a,e,G0,U0,v);else if(S)J.beginPath(),pk6(J,a,e,G0,U0);else J.beginPath(),J.rect(a,e,G0,U0);if(i)J.fill();if(l)J.stroke();if(l&&p==="double"){var O0=$/2;if(J.beginPath(),_)Rx0(J,a+O0,e+O0,G0-2*O0,U0-2*O0,v);else J.rect(a+O0,e+O0,G0-2*O0,U0-2*O0);J.stroke()}if(J.fillStyle=f,J.strokeStyle=x,J.lineWidth=y,J.setLineDash)J.setLineDash([])}var X0=2*Q.pstyle("text-outline-width").pfValue;if(X0>0)J.lineWidth=X0;if(Q.pstyle("text-wrap").value==="wrap"){var E0=f5(Y,"labelWrapCachedLines",Z),W0=f5(Y,"labelLineHeight",Z),q0=L/2,z0=this.getLabelJustification(Q);if(z0==="auto");else if(E==="left"){if(z0==="left")G+=-L;else if(z0==="center")G+=-q0}else if(E==="center"){if(z0==="left")G+=-q0;else if(z0==="right")G+=q0}else if(E==="right"){if(z0==="center")G+=q0;else if(z0==="right")G+=L}switch(V){case"top":W-=(E0.length-1)*W0;break;case"center":case"bottom":W-=(E0.length-1)*W0;break}for(var K0=0;K0<E0.length;K0++){if(X0>0)J.strokeText(E0[K0],G,W);J.fillText(E0[K0],G,W),W+=W0}}else{if(X0>0)J.strokeText(F,G,W);J.fillText(F,G,W)}if(j!==0)J.rotate(-j),J.translate(-H,-q)}};iq={};iq.drawNode=function(J,Q,Z){var U=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,K=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,X=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,Y=this,z,G,W=Q._private,H=W.rscratch,q=Q.position();if(!A8(q.x)||!A8(q.y))return;if(X&&!Q.visible())return;var F=X?Q.effectiveOpacity():1,M=Y.usePaths(),L,A=!1,I=Q.padding();z=Q.width()+2*I,G=Q.height()+2*I;var R;if(Z)R=Z,J.translate(-R.x1,-R.y1);var N=Q.pstyle("background-image"),E=N.value,V=new Array(E.length),j=new Array(E.length),T=0;for(var C=0;C<E.length;C++){var $=E[C],b=V[C]=$!=null&&$!=="none";if(b){var h=Q.cy().style().getIndexedStyle(Q,"background-image-crossorigin","value",C);T++,j[C]=Y.getCachedImage($,h,function(){W.backgroundTimestamp=Date.now(),Q.emitAndNotify("background")})}}var _=Q.pstyle("background-blacken").value,S=Q.pstyle("border-width").pfValue,v=Q.pstyle("background-opacity").value*F,f=Q.pstyle("border-color").value,x=Q.pstyle("border-style").value,y=Q.pstyle("border-join").value,m=Q.pstyle("border-cap").value,g=Q.pstyle("border-position").value,p=Q.pstyle("border-dash-pattern").pfValue,i=Q.pstyle("border-dash-offset").pfValue,l=Q.pstyle("border-opacity").value*F,a=Q.pstyle("outline-width").pfValue,e=Q.pstyle("outline-color").value,G0=Q.pstyle("outline-style").value,U0=Q.pstyle("outline-opacity").value*F,O0=Q.pstyle("outline-offset").value,X0=Q.pstyle("corner-radius").value;if(X0!=="auto")X0=Q.pstyle("corner-radius").pfValue;var E0=function y0(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:v;Y.eleFillStyle(J,Q,o)},W0=function y0(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:l;Y.colorStrokeStyle(J,f[0],f[1],f[2],o)},q0=function y0(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:U0;Y.colorStrokeStyle(J,e[0],e[1],e[2],o)},z0=function y0(o,w0,d,L0){var I0=Y.nodePathCache=Y.nodePathCache||[],T0=cx0(d==="polygon"?d+","+L0.join(","):d,""+w0,""+o,""+X0),$0=I0[T0],v0,r0=!1;if($0!=null)v0=$0,r0=!0,H.pathCache=v0;else v0=new Path2D,I0[T0]=H.pathCache=v0;return{path:v0,cacheHit:r0}},K0=Q.pstyle("shape").strValue,R0=Q.pstyle("shape-polygon-points").pfValue;if(M){J.translate(q.x,q.y);var Y0=z0(z,G,K0,R0);L=Y0.path,A=Y0.cacheHit}var P0=function y0(){if(!A){var o=q;if(M)o={x:0,y:0};Y.nodeShapes[Y.getNodeShape(Q)].draw(L||J,o.x,o.y,z,G,X0,H)}if(M)J.fill(L);else J.fill()},F0=function y0(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:F,w0=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,d=W.backgrounding,L0=0;for(var I0=0;I0<j.length;I0++){var T0=Q.cy().style().getIndexedStyle(Q,"background-image-containment","value",I0);if(w0&&T0==="over"||!w0&&T0==="inside"){L0++;continue}if(V[I0]&&j[I0].complete&&!j[I0].error)L0++,Y.drawInscribedImage(J,j[I0],Q,I0,o)}if(W.backgrounding=L0!==T,d!==W.backgrounding)Q.updateStyle(!1)},m0=function y0(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,w0=arguments.length>1&&arguments[1]!==void 0?arguments[1]:F;if(Y.hasPie(Q)){if(Y.drawPie(J,Q,w0),o){if(!M)Y.nodeShapes[Y.getNodeShape(Q)].draw(J,q.x,q.y,z,G,X0,H)}}},J0=function y0(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,w0=arguments.length>1&&arguments[1]!==void 0?arguments[1]:F;if(Y.hasStripe(Q)){if(J.save(),M)J.clip(H.pathCache);else Y.nodeShapes[Y.getNodeShape(Q)].draw(J,q.x,q.y,z,G,X0,H),J.clip();if(Y.drawStripe(J,Q,w0),J.restore(),o){if(!M)Y.nodeShapes[Y.getNodeShape(Q)].draw(J,q.x,q.y,z,G,X0,H)}}},z6=function y0(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:F,w0=(_>0?_:-_)*o,d=_>0?0:255;if(_!==0)if(Y.colorFillStyle(J,d,d,d,w0),M)J.fill(L);else J.fill()},t=function y0(){if(S>0){if(J.lineWidth=S,J.lineCap=m,J.lineJoin=y,J.setLineDash)switch(x){case"dotted":J.setLineDash([1,1]);break;case"dashed":J.setLineDash(p),J.lineDashOffset=i;break;case"solid":case"double":J.setLineDash([]);break}if(g!=="center"){if(J.save(),J.lineWidth*=2,g==="inside")M?J.clip(L):J.clip();else{var o=new Path2D;o.rect(-z/2-S,-G/2-S,z+2*S,G+2*S),o.addPath(L),J.clip(o,"evenodd")}M?J.stroke(L):J.stroke(),J.restore()}else M?J.stroke(L):J.stroke();if(x==="double"){J.lineWidth=S/3;var w0=J.globalCompositeOperation;if(J.globalCompositeOperation="destination-out",M)J.stroke(L);else J.stroke();J.globalCompositeOperation=w0}if(J.setLineDash)J.setLineDash([])}},N0=function y0(){if(a>0){if(J.lineWidth=a,J.lineCap="butt",J.setLineDash)switch(G0){case"dotted":J.setLineDash([1,1]);break;case"dashed":J.setLineDash([4,2]);break;case"solid":case"double":J.setLineDash([]);break}var o=q;if(M)o={x:0,y:0};var w0=Y.getNodeShape(Q),d=S;if(g==="inside")d=0;if(g==="outside")d*=2;var L0=(z+d+(a+O0))/z,I0=(G+d+(a+O0))/G,T0=z*L0,$0=G*I0,v0=Y.nodeShapes[w0].points,r0;if(M){var u0=z0(T0,$0,w0,v0);r0=u0.path}if(w0==="ellipse")Y.drawEllipsePath(r0||J,o.x,o.y,T0,$0);else if(["round-diamond","round-heptagon","round-hexagon","round-octagon","round-pentagon","round-polygon","round-triangle","round-tag"].includes(w0)){var G6=0,A6=0,r6=0;if(w0==="round-diamond")G6=(d+O0+a)*1.4;else if(w0==="round-heptagon")G6=(d+O0+a)*1.075,r6=-(d/2+O0+a)/35;else if(w0==="round-hexagon")G6=(d+O0+a)*1.12;else if(w0==="round-pentagon")G6=(d+O0+a)*1.13,r6=-(d/2+O0+a)/15;else if(w0==="round-tag")G6=(d+O0+a)*1.12,A6=(d/2+a+O0)*0.07;else if(w0==="round-triangle")G6=(d+O0+a)*(Math.PI/2),r6=-(d+O0/2+a)/Math.PI;if(G6!==0){if(L0=(z+G6)/z,T0=z*L0,!["round-hexagon","round-tag"].includes(w0))I0=(G+G6)/G,$0=G*I0}X0=X0==="auto"?ex0(T0,$0):X0;var N6=T0/2,F6=$0/2,P6=X0+(d+a+O0)/2,M6=new Array(v0.length/2),g6=new Array(v0.length/2);for(var O8=0;O8<v0.length/2;O8++)M6[O8]={x:o.x+A6+N6*v0[O8*2],y:o.y+r6+F6*v0[O8*2+1]};var a6,U8,p6,u6,S0=M6.length;U8=M6[S0-1];for(a6=0;a6<S0;a6++)p6=M6[a6%S0],u6=M6[(a6+1)%S0],g6[a6]=bJ0(U8,p6,u6,P6),U8=p6,p6=u6;Y.drawRoundPolygonPath(r0||J,o.x+A6,o.y+r6,z*L0,G*I0,v0,g6)}else if(["roundrectangle","round-rectangle"].includes(w0))X0=X0==="auto"?gq(T0,$0):X0,Y.drawRoundRectanglePath(r0||J,o.x,o.y,T0,$0,X0+(d+a+O0)/2);else if(["cutrectangle","cut-rectangle"].includes(w0))X0=X0==="auto"?jJ0():X0,Y.drawCutRectanglePath(r0||J,o.x,o.y,T0,$0,null,X0+(d+a+O0)/4);else if(["bottomroundrectangle","bottom-round-rectangle"].includes(w0))X0=X0==="auto"?gq(T0,$0):X0,Y.drawBottomRoundRectanglePath(r0||J,o.x,o.y,T0,$0,X0+(d+a+O0)/2);else if(w0==="barrel")Y.drawBarrelPath(r0||J,o.x,o.y,T0,$0);else if(w0.startsWith("polygon")||["rhomboid","right-rhomboid","round-tag","tag","vee"].includes(w0)){var Q6=(d+a+O0)/z;v0=cb(lb(v0,Q6)),Y.drawPolygonPath(r0||J,o.x,o.y,z,G,v0)}else{var B6=(d+a+O0)/z;v0=cb(lb(v0,-B6)),Y.drawPolygonPath(r0||J,o.x,o.y,z,G,v0)}if(M)J.stroke(r0);else J.stroke();if(G0==="double"){J.lineWidth=d/3;var D0=J.globalCompositeOperation;if(J.globalCompositeOperation="destination-out",M)J.stroke(r0);else J.stroke();J.globalCompositeOperation=D0}if(J.setLineDash)J.setLineDash([])}},f0=function y0(){if(K)Y.drawNodeOverlay(J,Q,q,z,G)},l0=function y0(){if(K)Y.drawNodeUnderlay(J,Q,q,z,G)},k0=function y0(){Y.drawElementText(J,Q,null,U)},_0=Q.pstyle("ghost").value==="yes";if(_0){var g0=Q.pstyle("ghost-offset-x").pfValue,h0=Q.pstyle("ghost-offset-y").pfValue,t0=Q.pstyle("ghost-opacity").value,C0=t0*F;J.translate(g0,h0),q0(),N0(),E0(t0*v),P0(),F0(C0,!0),W0(t0*l),t(),m0(_!==0||S!==0),J0(_!==0||S!==0),F0(C0,!1),z6(C0),J.translate(-g0,-h0)}if(M)J.translate(-q.x,-q.y);if(l0(),M)J.translate(q.x,q.y);if(q0(),N0(),E0(),P0(),F0(F,!0),W0(),t(),m0(_!==0||S!==0),J0(_!==0||S!==0),F0(F,!1),z6(),M)J.translate(-q.x,-q.y);if(k0(),f0(),Z)J.translate(R.x1,R.y1)};iq.drawNodeOverlay=Xy0("overlay");iq.drawNodeUnderlay=Xy0("underlay");iq.hasPie=function(J){return J=J[0],J._private.hasPie};iq.hasStripe=function(J){return J=J[0],J._private.hasStripe};iq.drawPie=function(J,Q,Z,U){Q=Q[0],U=U||Q.position();var K=Q.cy().style(),X=Q.pstyle("pie-size"),Y=Q.pstyle("pie-hole"),z=Q.pstyle("pie-start-angle").pfValue,G=U.x,W=U.y,H=Q.width(),q=Q.height(),F=Math.min(H,q)/2,M,L=0,A=this.usePaths();if(A)G=0,W=0;if(X.units==="%")F=F*X.pfValue;else if(X.pfValue!==void 0)F=X.pfValue/2;if(Y.units==="%")M=F*Y.pfValue;else if(Y.pfValue!==void 0)M=Y.pfValue/2;if(M>=F)return;for(var I=1;I<=K.pieBackgroundN;I++){var R=Q.pstyle("pie-"+I+"-background-size").value,N=Q.pstyle("pie-"+I+"-background-color").value,E=Q.pstyle("pie-"+I+"-background-opacity").value*Z,V=R/100;if(V+L>1)V=1-L;var j=1.5*Math.PI+2*Math.PI*L;j+=z;var T=2*Math.PI*V,C=j+T;if(R===0||L>=1||L+V>1)continue;if(M===0)J.beginPath(),J.moveTo(G,W),J.arc(G,W,F,j,C),J.closePath();else J.beginPath(),J.arc(G,W,F,j,C),J.arc(G,W,M,C,j,!0),J.closePath();this.colorFillStyle(J,N[0],N[1],N[2],E),J.fill(),L+=V}};iq.drawStripe=function(J,Q,Z,U){Q=Q[0],U=U||Q.position();var K=Q.cy().style(),X=U.x,Y=U.y,z=Q.width(),G=Q.height(),W=0,H=this.usePaths();J.save();var q=Q.pstyle("stripe-direction").value,F=Q.pstyle("stripe-size");switch(q){case"vertical":break;case"righward":J.rotate(-Math.PI/2);break}var M=z,L=G;if(F.units==="%")M=M*F.pfValue,L=L*F.pfValue;else if(F.pfValue!==void 0)M=F.pfValue,L=F.pfValue;if(H)X=0,Y=0;Y-=M/2,X-=L/2;for(var A=1;A<=K.stripeBackgroundN;A++){var I=Q.pstyle("stripe-"+A+"-background-size").value,R=Q.pstyle("stripe-"+A+"-background-color").value,N=Q.pstyle("stripe-"+A+"-background-opacity").value*Z,E=I/100;if(E+W>1)E=1-W;if(I===0||W>=1||W+E>1)continue;J.beginPath(),J.rect(X,Y+L*W,M,L*E),J.closePath(),this.colorFillStyle(J,R[0],R[1],R[2],N),J.fill(),W+=E}J.restore()};_U={};_U.getPixelRatio=function(){var J=this.data.contexts[0];if(this.forcedPixelRatio!=null)return this.forcedPixelRatio;var Q=this.cy.window(),Z=J.backingStorePixelRatio||J.webkitBackingStorePixelRatio||J.mozBackingStorePixelRatio||J.msBackingStorePixelRatio||J.oBackingStorePixelRatio||J.backingStorePixelRatio||1;return(Q.devicePixelRatio||1)/Z};_U.paintCache=function(J){var Q=this.paintCaches=this.paintCaches||[],Z=!0,U;for(var K=0;K<Q.length;K++)if(U=Q[K],U.context===J){Z=!1;break}if(Z)U={context:J},Q.push(U);return U};_U.createGradientStyleFor=function(J,Q,Z,U,K){var X,Y=this.usePaths(),z=Z.pstyle(Q+"-gradient-stop-colors").value,G=Z.pstyle(Q+"-gradient-stop-positions").pfValue;if(U==="radial-gradient")if(Z.isEdge()){var W=Z.sourceEndpoint(),H=Z.targetEndpoint(),q=Z.midpoint(),F=bB(W,q),M=bB(H,q);X=J.createRadialGradient(q.x,q.y,0,q.x,q.y,Math.max(F,M))}else{var L=Y?{x:0,y:0}:Z.position(),A=Z.paddedWidth(),I=Z.paddedHeight();X=J.createRadialGradient(L.x,L.y,0,L.x,L.y,Math.max(A,I))}else if(Z.isEdge()){var R=Z.sourceEndpoint(),N=Z.targetEndpoint();X=J.createLinearGradient(R.x,R.y,N.x,N.y)}else{var E=Y?{x:0,y:0}:Z.position(),V=Z.paddedWidth(),j=Z.paddedHeight(),T=V/2,C=j/2,$=Z.pstyle("background-gradient-direction").value;switch($){case"to-bottom":X=J.createLinearGradient(E.x,E.y-C,E.x,E.y+C);break;case"to-top":X=J.createLinearGradient(E.x,E.y+C,E.x,E.y-C);break;case"to-left":X=J.createLinearGradient(E.x+T,E.y,E.x-T,E.y);break;case"to-right":X=J.createLinearGradient(E.x-T,E.y,E.x+T,E.y);break;case"to-bottom-right":case"to-right-bottom":X=J.createLinearGradient(E.x-T,E.y-C,E.x+T,E.y+C);break;case"to-top-right":case"to-right-top":X=J.createLinearGradient(E.x-T,E.y+C,E.x+T,E.y-C);break;case"to-bottom-left":case"to-left-bottom":X=J.createLinearGradient(E.x+T,E.y-C,E.x-T,E.y+C);break;case"to-top-left":case"to-left-top":X=J.createLinearGradient(E.x+T,E.y+C,E.x-T,E.y-C);break}}if(!X)return null;var b=G.length===z.length,h=z.length;for(var _=0;_<h;_++)X.addColorStop(b?G[_]:_/(h-1),"rgba("+z[_][0]+","+z[_][1]+","+z[_][2]+","+K+")");return X};_U.gradientFillStyle=function(J,Q,Z,U){var K=this.createGradientStyleFor(J,"background",Q,Z,U);if(!K)return null;J.fillStyle=K};_U.colorFillStyle=function(J,Q,Z,U,K){J.fillStyle="rgba("+Q+","+Z+","+U+","+K+")"};_U.eleFillStyle=function(J,Q,Z){var U=Q.pstyle("background-fill").value;if(U==="linear-gradient"||U==="radial-gradient")this.gradientFillStyle(J,Q,U,Z);else{var K=Q.pstyle("background-color").value;this.colorFillStyle(J,K[0],K[1],K[2],Z)}};_U.gradientStrokeStyle=function(J,Q,Z,U){var K=this.createGradientStyleFor(J,"line",Q,Z,U);if(!K)return null;J.strokeStyle=K};_U.colorStrokeStyle=function(J,Q,Z,U,K){J.strokeStyle="rgba("+Q+","+Z+","+U+","+K+")"};_U.eleStrokeStyle=function(J,Q,Z){var U=Q.pstyle("line-fill").value;if(U==="linear-gradient"||U==="radial-gradient")this.gradientStrokeStyle(J,Q,U,Z);else{var K=Q.pstyle("line-color").value;this.colorStrokeStyle(J,K[0],K[1],K[2],Z)}};_U.matchCanvasSize=function(J){var Q=this,Z=Q.data,U=Q.findContainerClientCoords(),K=U[2],X=U[3],Y=Q.getPixelRatio(),z=Q.motionBlurPxRatio;if(J===Q.data.bufferCanvases[Q.MOTIONBLUR_BUFFER_NODE]||J===Q.data.bufferCanvases[Q.MOTIONBLUR_BUFFER_DRAG])Y=z;var G=K*Y,W=X*Y,H;if(G===Q.canvasWidth&&W===Q.canvasHeight)return;Q.fontCaches=null;var q=Z.canvasContainer;q.style.width=K+"px",q.style.height=X+"px";for(var F=0;F<Q.CANVAS_LAYERS;F++)H=Z.canvases[F],H.width=G,H.height=W,H.style.width=K+"px",H.style.height=X+"px";for(var F=0;F<Q.BUFFER_COUNT;F++)H=Z.bufferCanvases[F],H.width=G,H.height=W,H.style.width=K+"px",H.style.height=X+"px";if(Q.textureMult=1,Y<=1)H=Z.bufferCanvases[Q.TEXTURE_BUFFER],Q.textureMult=2,H.width=G*Q.textureMult,H.height=W*Q.textureMult;Q.canvasWidth=G,Q.canvasHeight=W,Q.pixelRatio=Y};_U.renderTo=function(J,Q,Z,U){this.render({forcedContext:J,forcedZoom:Q,forcedPan:Z,drawAllLayers:!0,forcedPxRatio:U})};_U.clearCanvas=function(){var J=this,Q=J.data;function Z(U){U.clearRect(0,0,J.canvasWidth,J.canvasHeight)}Z(Q.contexts[J.NODE]),Z(Q.contexts[J.DRAG])};_U.render=function(J){var Q=this;J=J||rx0();var Z=Q.cy,U=J.forcedContext,K=J.drawAllLayers,X=J.drawOnlyNodeLayer,Y=J.forcedZoom,z=J.forcedPan,G=J.forcedPxRatio===void 0?this.getPixelRatio():J.forcedPxRatio,W=Q.data,H=W.canvasNeedsRedraw,q=Q.textureOnViewport&&!U&&(Q.pinching||Q.hoverData.dragging||Q.swipePanning||Q.data.wheelZooming),F=J.motionBlur!==void 0?J.motionBlur:Q.motionBlur,M=Q.motionBlurPxRatio,L=Z.hasCompoundNodes(),A=Q.hoverData.draggingEles,I=Q.hoverData.selecting||Q.touchData.selecting?!0:!1;F=F&&!U&&Q.motionBlurEnabled&&!I;var R=F;if(!U){if(Q.prevPxRatio!==G)Q.invalidateContainerClientCoordsCache(),Q.matchCanvasSize(Q.container),Q.redrawHint("eles",!0),Q.redrawHint("drag",!0);Q.prevPxRatio=G}if(!U&&Q.motionBlurTimeout)clearTimeout(Q.motionBlurTimeout);if(F){if(Q.mbFrames==null)Q.mbFrames=0;if(Q.mbFrames++,Q.mbFrames<3)R=!1;if(Q.mbFrames>Q.minMbLowQualFrames)Q.motionBlurPxRatio=Q.mbPxRBlurry}if(Q.clearingMotionBlur)Q.motionBlurPxRatio=1;if(Q.textureDrawLastFrame&&!q)H[Q.NODE]=!0,H[Q.SELECT_BOX]=!0;var N=Z.style(),E=Z.zoom(),V=Y!==void 0?Y:E,j=Z.pan(),T={x:j.x,y:j.y},C={zoom:E,pan:{x:j.x,y:j.y}},$=Q.prevViewport,b=$===void 0||C.zoom!==$.zoom||C.pan.x!==$.pan.x||C.pan.y!==$.pan.y;if(!b&&!(A&&!L))Q.motionBlurPxRatio=1;if(z)T=z;V*=G,T.x*=G,T.y*=G;var h=Q.getCachedZSortedEles();function _(W0,q0,z0,K0,R0){var Y0=W0.globalCompositeOperation;W0.globalCompositeOperation="destination-out",Q.colorFillStyle(W0,255,255,255,Q.motionBlurTransparency),W0.fillRect(q0,z0,K0,R0),W0.globalCompositeOperation=Y0}function S(W0,q0){var z0,K0,R0,Y0;if(!Q.clearingMotionBlur&&(W0===W.bufferContexts[Q.MOTIONBLUR_BUFFER_NODE]||W0===W.bufferContexts[Q.MOTIONBLUR_BUFFER_DRAG]))z0={x:j.x*M,y:j.y*M},K0=E*M,R0=Q.canvasWidth*M,Y0=Q.canvasHeight*M;else z0=T,K0=V,R0=Q.canvasWidth,Y0=Q.canvasHeight;if(W0.setTransform(1,0,0,1,0,0),q0==="motionBlur")_(W0,0,0,R0,Y0);else if(!U&&(q0===void 0||q0))W0.clearRect(0,0,R0,Y0);if(!K)W0.translate(z0.x,z0.y),W0.scale(K0,K0);if(z)W0.translate(z.x,z.y);if(Y)W0.scale(Y,Y)}if(!q)Q.textureDrawLastFrame=!1;if(q){if(Q.textureDrawLastFrame=!0,!Q.textureCache){Q.textureCache={},Q.textureCache.bb=Z.mutableElements().boundingBox(),Q.textureCache.texture=Q.data.bufferCanvases[Q.TEXTURE_BUFFER];var v=Q.data.bufferContexts[Q.TEXTURE_BUFFER];v.setTransform(1,0,0,1,0,0),v.clearRect(0,0,Q.canvasWidth*Q.textureMult,Q.canvasHeight*Q.textureMult),Q.render({forcedContext:v,drawOnlyNodeLayer:!0,forcedPxRatio:G*Q.textureMult});var C=Q.textureCache.viewport={zoom:Z.zoom(),pan:Z.pan(),width:Q.canvasWidth,height:Q.canvasHeight};C.mpan={x:(0-C.pan.x)/C.zoom,y:(0-C.pan.y)/C.zoom}}H[Q.DRAG]=!1,H[Q.NODE]=!1;var f=W.contexts[Q.NODE],x=Q.textureCache.texture,C=Q.textureCache.viewport;if(f.setTransform(1,0,0,1,0,0),F)_(f,0,0,C.width,C.height);else f.clearRect(0,0,C.width,C.height);var y=N.core("outside-texture-bg-color").value,m=N.core("outside-texture-bg-opacity").value;Q.colorFillStyle(f,y[0],y[1],y[2],m),f.fillRect(0,0,C.width,C.height);var E=Z.zoom();S(f,!1),f.clearRect(C.mpan.x,C.mpan.y,C.width/C.zoom/G,C.height/C.zoom/G),f.drawImage(x,C.mpan.x,C.mpan.y,C.width/C.zoom/G,C.height/C.zoom/G)}else if(Q.textureOnViewport&&!U)Q.textureCache=null;var g=Z.extent(),p=Q.pinching||Q.hoverData.dragging||Q.swipePanning||Q.data.wheelZooming||Q.hoverData.draggingEles||Q.cy.animated(),i=Q.hideEdgesOnViewport&&p,l=[];if(l[Q.NODE]=!H[Q.NODE]&&F&&!Q.clearedForMotionBlur[Q.NODE]||Q.clearingMotionBlur,l[Q.NODE])Q.clearedForMotionBlur[Q.NODE]=!0;if(l[Q.DRAG]=!H[Q.DRAG]&&F&&!Q.clearedForMotionBlur[Q.DRAG]||Q.clearingMotionBlur,l[Q.DRAG])Q.clearedForMotionBlur[Q.DRAG]=!0;if(H[Q.NODE]||K||X||l[Q.NODE]){var a=F&&!l[Q.NODE]&&M!==1,f=U||(a?Q.data.bufferContexts[Q.MOTIONBLUR_BUFFER_NODE]:W.contexts[Q.NODE]),e=F&&!a?"motionBlur":void 0;if(S(f,e),i)Q.drawCachedNodes(f,h.nondrag,G,g);else Q.drawLayeredElements(f,h.nondrag,G,g);if(Q.debug)Q.drawDebugPoints(f,h.nondrag);if(!K&&!F)H[Q.NODE]=!1}if(!X&&(H[Q.DRAG]||K||l[Q.DRAG])){var a=F&&!l[Q.DRAG]&&M!==1,f=U||(a?Q.data.bufferContexts[Q.MOTIONBLUR_BUFFER_DRAG]:W.contexts[Q.DRAG]);if(S(f,F&&!a?"motionBlur":void 0),i)Q.drawCachedNodes(f,h.drag,G,g);else Q.drawCachedElements(f,h.drag,G,g);if(Q.debug)Q.drawDebugPoints(f,h.drag);if(!K&&!F)H[Q.DRAG]=!1}if(this.drawSelectionRectangle(J,S),F&&M!==1){var G0=W.contexts[Q.NODE],U0=Q.data.bufferCanvases[Q.MOTIONBLUR_BUFFER_NODE],O0=W.contexts[Q.DRAG],X0=Q.data.bufferCanvases[Q.MOTIONBLUR_BUFFER_DRAG],E0=function W0(q0,z0,K0){if(q0.setTransform(1,0,0,1,0,0),K0||!R)q0.clearRect(0,0,Q.canvasWidth,Q.canvasHeight);else _(q0,0,0,Q.canvasWidth,Q.canvasHeight);var R0=M;q0.drawImage(z0,0,0,Q.canvasWidth*R0,Q.canvasHeight*R0,0,0,Q.canvasWidth,Q.canvasHeight)};if(H[Q.NODE]||l[Q.NODE])E0(G0,U0,l[Q.NODE]),H[Q.NODE]=!1;if(H[Q.DRAG]||l[Q.DRAG])E0(O0,X0,l[Q.DRAG]),H[Q.DRAG]=!1}if(Q.prevViewport=C,Q.clearingMotionBlur)Q.clearingMotionBlur=!1,Q.motionBlurCleared=!0,Q.motionBlur=!0;if(F)Q.motionBlurTimeout=setTimeout(function(){Q.motionBlurTimeout=null,Q.clearedForMotionBlur[Q.NODE]=!1,Q.clearedForMotionBlur[Q.DRAG]=!1,Q.motionBlur=!1,Q.clearingMotionBlur=!q,Q.mbFrames=0,H[Q.NODE]=!0,H[Q.DRAG]=!0,Q.redraw()},ck6);if(!U)Z.emit("render")};_U.drawSelectionRectangle=function(J,Q){var Z=this,U=Z.cy,K=Z.data,X=U.style(),Y=J.drawOnlyNodeLayer,z=J.drawAllLayers,G=K.canvasNeedsRedraw,W=J.forcedContext;if(Z.showFps||!Y&&G[Z.SELECT_BOX]&&!z){var H=W||K.contexts[Z.SELECT_BOX];if(Q(H),Z.selection[4]==1&&(Z.hoverData.selecting||Z.touchData.selecting)){var q=Z.cy.zoom(),F=X.core("selection-box-border-width").value/q;if(H.lineWidth=F,H.fillStyle="rgba("+X.core("selection-box-color").value[0]+","+X.core("selection-box-color").value[1]+","+X.core("selection-box-color").value[2]+","+X.core("selection-box-opacity").value+")",H.fillRect(Z.selection[0],Z.selection[1],Z.selection[2]-Z.selection[0],Z.selection[3]-Z.selection[1]),F>0)H.strokeStyle="rgba("+X.core("selection-box-border-color").value[0]+","+X.core("selection-box-border-color").value[1]+","+X.core("selection-box-border-color").value[2]+","+X.core("selection-box-opacity").value+")",H.strokeRect(Z.selection[0],Z.selection[1],Z.selection[2]-Z.selection[0],Z.selection[3]-Z.selection[1])}if(K.bgActivePosistion&&!Z.hoverData.selecting){var q=Z.cy.zoom(),M=K.bgActivePosistion;H.fillStyle="rgba("+X.core("active-bg-color").value[0]+","+X.core("active-bg-color").value[1]+","+X.core("active-bg-color").value[2]+","+X.core("active-bg-opacity").value+")",H.beginPath(),H.arc(M.x,M.y,X.core("active-bg-size").pfValue/q,0,2*Math.PI),H.fill()}var L=Z.lastRedrawTime;if(Z.showFps&&L){L=Math.round(L);var A=Math.round(1000/L),I="1 frame = "+L+" ms = "+A+" 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",!Jj){var R=H.measureText(I);Jj=R.actualBoundingBoxAscent}H.fillText(I,0,Jj);var N=60;H.strokeRect(0,Jj+10,250,20),H.fillRect(0,Jj+10,250*Math.min(A/N,1),20)}if(!z)G[Z.SELECT_BOX]=!1}};Dx0=typeof Float32Array!=="undefined"?Float32Array:Array;if(!Math.hypot)Math.hypot=function(){var J=0,Q=arguments.length;while(Q--)J+=arguments[Q]*arguments[Q];return Math.sqrt(J)};Kf6=function(){function J(Q,Z,U,K){cq(this,J),this.debugID=Math.floor(Math.random()*1e4),this.r=Q,this.texSize=Z,this.texRows=U,this.texHeight=Math.floor(Z/U),this.enableWrapping=!0,this.locked=!1,this.texture=null,this.needsBuffer=!0,this.freePointer={x:0,row:0},this.keyToLocation=new Map,this.canvas=K(Q,Z,Z),this.scratch=K(Q,Z,this.texHeight,"scratch")}return lq(J,[{key:"lock",value:function Q(){this.locked=!0}},{key:"getKeys",value:function Q(){return new Set(this.keyToLocation.keys())}},{key:"getScale",value:function Q(Z){var{w:U,h:K}=Z,X=this.texHeight,Y=this.texSize,z=X/K,G=U*z,W=K*z;if(G>Y)z=Y/U,G=U*z,W=K*z;return{scale:z,texW:G,texH:W}}},{key:"draw",value:function Q(Z,U,K){var X=this;if(this.locked)throw new Error("can't draw, atlas is locked");var Y=this.texSize,z=this.texRows,G=this.texHeight,W=this.getScale(U),H=W.scale,q=W.texW,F=W.texH,M=function N(E,V){if(K&&V){var j=V.context,T=E.x,C=E.row,$=T,b=G*C;j.save(),j.translate($,b),j.scale(H,H),K(j,U),j.restore()}},L=[null,null],A=function N(){if(M(X.freePointer,X.canvas),L[0]={x:X.freePointer.x,y:X.freePointer.row*G,w:q,h:F},L[1]={x:X.freePointer.x+q,y:X.freePointer.row*G,w:0,h:F},X.freePointer.x+=q,X.freePointer.x==Y)X.freePointer.x=0,X.freePointer.row++},I=function N(){var{scratch:E,canvas:V}=X;E.clear(),M({x:0,row:0},E);var j=Y-X.freePointer.x,T=q-j,C=G;{var $=X.freePointer.x,b=X.freePointer.row*G,h=j;V.context.drawImage(E,0,0,h,C,$,b,h,C),L[0]={x:$,y:b,w:h,h:F}}{var _=j,S=(X.freePointer.row+1)*G,v=T;if(V)V.context.drawImage(E,_,0,v,C,0,S,v,C);L[1]={x:0,y:S,w:v,h:F}}X.freePointer.x=T,X.freePointer.row++},R=function N(){X.freePointer.x=0,X.freePointer.row++};if(this.freePointer.x+q<=Y)A();else if(this.freePointer.row>=z-1)return!1;else if(this.freePointer.x===Y)R(),A();else if(this.enableWrapping)I();else R(),A();return this.keyToLocation.set(Z,L),this.needsBuffer=!0,L}},{key:"getOffsets",value:function Q(Z){return this.keyToLocation.get(Z)}},{key:"isEmpty",value:function Q(){return this.freePointer.x===0&&this.freePointer.row===0}},{key:"canFit",value:function Q(Z){if(this.locked)return!1;var U=this.texSize,K=this.texRows,X=this.getScale(Z),Y=X.texW;if(this.freePointer.x+Y>U)return this.freePointer.row<K-1;return!0}},{key:"bufferIfNeeded",value:function Q(Z){if(!this.texture)this.texture=ok6(Z,this.debugID);if(this.needsBuffer){if(this.texture.buffer(this.canvas),this.needsBuffer=!1,this.locked)this.canvas=null,this.scratch=null}}},{key:"dispose",value:function Q(){if(this.texture)this.texture.deleteTexture(),this.texture=null;this.canvas=null,this.scratch=null,this.locked=!0}}])}(),Xf6=function(){function J(Q,Z,U,K){cq(this,J),this.r=Q,this.texSize=Z,this.texRows=U,this.createTextureCanvas=K,this.atlases=[],this.styleKeyToAtlas=new Map,this.markedKeys=new Set}return lq(J,[{key:"getKeys",value:function Q(){return new Set(this.styleKeyToAtlas.keys())}},{key:"_createAtlas",value:function Q(){var Z=this.r,U=this.texSize,K=this.texRows,X=this.createTextureCanvas;return new Kf6(Z,U,K,X)}},{key:"_getScratchCanvas",value:function Q(){if(!this.scratch){var Z=this.r,U=this.texSize,K=this.texRows,X=this.createTextureCanvas,Y=Math.floor(U/K);this.scratch=X(Z,U,Y,"scratch")}return this.scratch}},{key:"draw",value:function Q(Z,U,K){var X=this.styleKeyToAtlas.get(Z);if(!X){if(X=this.atlases[this.atlases.length-1],!X||!X.canFit(U)){if(X)X.lock();X=this._createAtlas(),this.atlases.push(X)}X.draw(Z,U,K),this.styleKeyToAtlas.set(Z,X)}return X}},{key:"getAtlas",value:function Q(Z){return this.styleKeyToAtlas.get(Z)}},{key:"hasAtlas",value:function Q(Z){return this.styleKeyToAtlas.has(Z)}},{key:"markKeyForGC",value:function Q(Z){this.markedKeys.add(Z)}},{key:"gc",value:function Q(){var Z=this,U=this.markedKeys;if(U.size===0){console.log("nothing to garbage collect");return}var K=[],X=new Map,Y=null,z=b5(this.atlases),G;try{var W=function H(){var q=G.value,F=q.getKeys(),M=Yf6(U,F);if(M.size===0)return K.push(q),F.forEach(function(j){return X.set(j,q)}),1;if(!Y)Y=Z._createAtlas(),K.push(Y);var L=b5(F),A;try{for(L.s();!(A=L.n()).done;){var I=A.value;if(!M.has(I)){var R=q.getOffsets(I),N=e4(R,2),E=N[0],V=N[1];if(!Y.canFit({w:E.w+V.w,h:E.h}))Y.lock(),Y=Z._createAtlas(),K.push(Y);if(q.canvas)Z._copyTextureToNewAtlas(I,q,Y),X.set(I,Y)}}}catch(j){L.e(j)}finally{L.f()}q.dispose()};for(z.s();!(G=z.n()).done;)if(W())continue}catch(H){z.e(H)}finally{z.f()}this.atlases=K,this.styleKeyToAtlas=X,this.markedKeys=new Set}},{key:"_copyTextureToNewAtlas",value:function Q(Z,U,K){var X=U.getOffsets(Z),Y=e4(X,2),z=Y[0],G=Y[1];if(G.w===0)K.draw(Z,z,function(F){F.drawImage(U.canvas,z.x,z.y,z.w,z.h,0,0,z.w,z.h)});else{var W=this._getScratchCanvas();W.clear(),W.context.drawImage(U.canvas,z.x,z.y,z.w,z.h,0,0,z.w,z.h),W.context.drawImage(U.canvas,G.x,G.y,G.w,G.h,z.w,0,G.w,G.h);var H=z.w+G.w,q=z.h;K.draw(Z,{w:H,h:q},function(F){F.drawImage(W,0,0,H,q,0,0,H,q)})}}},{key:"getCounts",value:function Q(){return{keyCount:this.styleKeyToAtlas.size,atlasCount:new Set(this.styleKeyToAtlas.values()).size}}}])}();zf6=function(){function J(Q,Z){cq(this,J),this.r=Q,this.globalOptions=Z,this.atlasSize=Z.webglTexSize,this.maxAtlasesPerBatch=Z.webglTexPerBatch,this.renderTypes=new Map,this.collections=new Map,this.typeAndIdToKey=new Map}return lq(J,[{key:"getAtlasSize",value:function Q(){return this.atlasSize}},{key:"addAtlasCollection",value:function Q(Z,U){var K=this.globalOptions,X=K.webglTexSize,Y=K.createTextureCanvas,z=U.texRows,G=this._cacheScratchCanvas(Y),W=new Xf6(this.r,X,z,G);this.collections.set(Z,W)}},{key:"addRenderType",value:function Q(Z,U){var K=U.collection;if(!this.collections.has(K))throw new Error("invalid atlas collection name '".concat(K,"'"));var X=this.collections.get(K),Y=HJ({type:Z,atlasCollection:X},U);this.renderTypes.set(Z,Y)}},{key:"getRenderTypeOpts",value:function Q(Z){return this.renderTypes.get(Z)}},{key:"getAtlasCollection",value:function Q(Z){return this.collections.get(Z)}},{key:"_cacheScratchCanvas",value:function Q(Z){var U=-1,K=-1,X=null;return function(Y,z,G,W){if(W){if(!X||z!=U||G!=K)U=z,K=G,X=Z(Y,z,G);return X}else return Z(Y,z,G)}}},{key:"_key",value:function Q(Z,U){return"".concat(Z,"-").concat(U)}},{key:"invalidate",value:function Q(Z){var U=this,K=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},X=K.forceRedraw,Y=X===void 0?!1:X,z=K.filterEle,G=z===void 0?function(){return!0}:z,W=K.filterType,H=W===void 0?function(){return!0}:W,q=!1,F=!1,M=b5(Z),L;try{for(M.s();!(L=M.n()).done;){var A=L.value;if(G(A)){var I=b5(this.renderTypes.values()),R;try{var N=function E(){var V=R.value,j=V.type;if(H(j)){var T=U.collections.get(V.collection),C=V.getKey(A),$=Array.isArray(C)?C:[C];if(Y)$.forEach(function(S){return T.markKeyForGC(S)}),F=!0;else{var b=V.getID?V.getID(A):A.id(),h=U._key(j,b),_=U.typeAndIdToKey.get(h);if(_!==void 0&&!sk6($,_))q=!0,U.typeAndIdToKey.delete(h),_.forEach(function(S){return T.markKeyForGC(S)})}}};for(I.s();!(R=I.n()).done;)N()}catch(E){I.e(E)}finally{I.f()}}}}catch(E){M.e(E)}finally{M.f()}if(F)this.gc(),q=!1;return q}},{key:"gc",value:function Q(){var Z=b5(this.collections.values()),U;try{for(Z.s();!(U=Z.n()).done;){var K=U.value;K.gc()}}catch(X){Z.e(X)}finally{Z.f()}}},{key:"getOrCreateAtlas",value:function Q(Z,U,K,X){var Y=this.renderTypes.get(U),z=this.collections.get(Y.collection),G=!1,W=z.draw(X,K,function(F){if(Y.drawClipped)F.save(),F.beginPath(),F.rect(0,0,K.w,K.h),F.clip(),Y.drawElement(F,Z,K,!0,!0),F.restore();else Y.drawElement(F,Z,K,!0,!0);G=!0});if(G){var H=Y.getID?Y.getID(Z):Z.id(),q=this._key(U,H);if(this.typeAndIdToKey.has(q))this.typeAndIdToKey.get(q).push(X);else this.typeAndIdToKey.set(q,[X])}return W}},{key:"getAtlasInfo",value:function Q(Z,U){var K=this,X=this.renderTypes.get(U),Y=X.getKey(Z),z=Array.isArray(Y)?Y:[Y];return z.map(function(G){var W=X.getBoundingBox(Z,G),H=K.getOrCreateAtlas(Z,U,W,G),q=H.getOffsets(G),F=e4(q,2),M=F[0],L=F[1];return{atlas:H,tex:M,tex1:M,tex2:L,bb:W}})}},{key:"getDebugInfo",value:function Q(){var Z=[],U=b5(this.collections),K;try{for(U.s();!(K=U.n()).done;){var X=e4(K.value,2),Y=X[0],z=X[1],G=z.getCounts(),W=G.keyCount,H=G.atlasCount;Z.push({type:Y,keyCount:W,atlasCount:H})}}catch(q){U.e(q)}finally{U.f()}return Z}}])}(),Gf6=function(){function J(Q){cq(this,J),this.globalOptions=Q,this.atlasSize=Q.webglTexSize,this.maxAtlasesPerBatch=Q.webglTexPerBatch,this.batchAtlases=[]}return lq(J,[{key:"getMaxAtlasesPerBatch",value:function Q(){return this.maxAtlasesPerBatch}},{key:"getAtlasSize",value:function Q(){return this.atlasSize}},{key:"getIndexArray",value:function Q(){return Array.from({length:this.maxAtlasesPerBatch},function(Z,U){return U})}},{key:"startBatch",value:function Q(){this.batchAtlases=[]}},{key:"getAtlasCount",value:function Q(){return this.batchAtlases.length}},{key:"getAtlases",value:function Q(){return this.batchAtlases}},{key:"canAddToCurrentBatch",value:function Q(Z){if(this.batchAtlases.length===this.maxAtlasesPerBatch)return this.batchAtlases.includes(Z);return!0}},{key:"getAtlasIndexForBatch",value:function Q(Z){var U=this.batchAtlases.indexOf(Z);if(U<0){if(this.batchAtlases.length===this.maxAtlasesPerBatch)throw new Error("cannot add more atlases to batch");this.batchAtlases.push(Z),U=this.batchAtlases.length-1}return U}}])}(),Gj={SCREEN:{name:"screen",screen:!0},PICKING:{name:"picking",picking:!0}},ob={IGNORE:1,USE_BB:2},Bf6=function(){function J(Q,Z,U){cq(this,J),this.r=Q,this.gl=Z,this.maxInstances=U.webglBatchSize,this.atlasSize=U.webglTexSize,this.bgColor=U.bgColor,this.debug=U.webglDebug,this.batchDebugInfo=[],U.enableWrapping=!0,U.createTextureCanvas=dk6,this.atlasManager=new zf6(Q,U),this.batchManager=new Gf6(U),this.simpleShapeOptions=new Map,this.program=this._createShaderProgram(Gj.SCREEN),this.pickingProgram=this._createShaderProgram(Gj.PICKING),this.vao=this._createVAO()}return lq(J,[{key:"addAtlasCollection",value:function Q(Z,U){this.atlasManager.addAtlasCollection(Z,U)}},{key:"addTextureAtlasRenderType",value:function Q(Z,U){this.atlasManager.addRenderType(Z,U)}},{key:"addSimpleShapeRenderType",value:function Q(Z,U){this.simpleShapeOptions.set(Z,U)}},{key:"invalidate",value:function Q(Z){var U=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},K=U.type,X=this.atlasManager;if(K)return X.invalidate(Z,{filterType:function Y(z){return z===K},forceRedraw:!0});else return X.invalidate(Z)}},{key:"gc",value:function Q(){this.atlasManager.gc()}},{key:"_createShaderProgram",value:function Q(Z){var U=this.gl,K=`#version 300 es
|
|
791
|
+
`);for(var I=0;I<A.length;I++){var R=A[I],N=q.measureText(R),E=Math.ceil(N.width),V=z;M=Math.max(E,M),L+=V}return M+=X,L+=X,{width:M,height:L}};Rz.calculateLabelAngle=function(J,Q){var Z=J._private,U=Z.rscratch,K=J.isEdge(),X=Q?Q+"-":"",Y=J.pstyle(X+"text-rotation"),z=Y.strValue;if(z==="none")return 0;else if(K&&z==="autorotate")return U.labelAutoAngle;else if(z==="autorotate")return 0;else return Y.pfValue};Rz.calculateLabelAngles=function(J){var Q=this,Z=J.isEdge(),U=J._private,K=U.rscratch;if(K.labelAngle=Q.calculateLabelAngle(J),Z)K.sourceLabelAngle=Q.calculateLabelAngle(J,"source"),K.targetLabelAngle=Q.calculateLabelAngle(J,"target")};ah0={};ah0.getNodeShape=function(J){var Q=this,Z=J.pstyle("shape").value;if(Z==="cutrectangle"&&(J.width()<Hx0||J.height()<Hx0)){if(!qx0)e9("The `cutrectangle` node shape can not be used at small sizes so `rectangle` is used instead"),qx0=!0;return"rectangle"}if(J.isParent())if(Z==="rectangle"||Z==="roundrectangle"||Z==="round-rectangle"||Z==="cutrectangle"||Z==="cut-rectangle"||Z==="barrel")return Z;else return"rectangle";if(Z==="polygon"){var U=J.pstyle("shape-polygon-points").value;return Q.nodeShapes.makePolygon(U).name}return Z};Ox={};Ox.registerCalculationListeners=function(){var J=this.cy,Q=J.collection(),Z=this,U=function X(Y){var z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(Q.merge(Y),z)for(var G=0;G<Y.length;G++){var W=Y[G],H=W._private,q=H.rstyle;q.clean=!1,q.cleanConnected=!1}};Z.binder(J).on("bounds.* dirty.*",function X(Y){var z=Y.target;U(z)}).on("style.* background.*",function X(Y){var z=Y.target;U(z,!1)});var K=function X(Y){if(Y){var z=Z.onUpdateEleCalcsFns;Q.cleanStyle();for(var G=0;G<Q.length;G++){var W=Q[G],H=W._private.rstyle;if(W.isNode()&&!H.cleanConnected)U(W.connectedEdges()),H.cleanConnected=!0}if(z)for(var q=0;q<z.length;q++){var F=z[q];F(Y,Q)}Z.recalculateRenderedStyle(Q),Q=J.collection()}};Z.flushRenderedStyleQueue=function(){K(!0)},Z.beforeRender(K,Z.beforeRenderPriorities.eleCalcs)};Ox.onUpdateEleCalcs=function(J){var Q=this.onUpdateEleCalcsFns=this.onUpdateEleCalcsFns||[];Q.push(J)};Ox.recalculateRenderedStyle=function(J,Q){var Z=function E(V){return V._private.rstyle.cleanConnected};if(J.length===0)return;var U=[],K=[];if(this.destroyed)return;if(Q===void 0)Q=!0;for(var X=0;X<J.length;X++){var Y=J[X],z=Y._private,G=z.rstyle;if(Y.isEdge()&&(!Z(Y.source())||!Z(Y.target())))G.clean=!1;if(Y.isEdge()&&Y.isBundledBezier()){if(Y.parallelEdges().some(function(E){return!E._private.rstyle.clean&&E.isBundledBezier()}))G.clean=!1}if(Q&&G.clean||Y.removed())continue;if(Y.pstyle("display").value==="none")continue;if(z.group==="nodes")K.push(Y);else U.push(Y);G.clean=!0}for(var W=0;W<K.length;W++){var H=K[W],q=H._private,F=q.rstyle,M=H.position();this.recalculateNodeLabelProjection(H),F.nodeX=M.x,F.nodeY=M.y,F.nodeW=H.pstyle("width").pfValue,F.nodeH=H.pstyle("height").pfValue}this.recalculateEdgeProjections(U);for(var L=0;L<U.length;L++){var A=U[L],I=A._private,R=I.rstyle,N=I.rscratch;R.srcX=N.arrowStartX,R.srcY=N.arrowStartY,R.tgtX=N.arrowEndX,R.tgtY=N.arrowEndY,R.midX=N.midX,R.midY=N.midY,R.labelAngle=N.labelAngle,R.sourceLabelAngle=N.sourceLabelAngle,R.targetLabelAngle=N.targetLabelAngle}};Lx={};Lx.updateCachedGrabbedEles=function(){var J=this.cachedZSortedEles;if(!J)return;J.drag=[],J.nondrag=[];var Q=[];for(var Z=0;Z<J.length;Z++){var U=J[Z],K=U._private.rscratch;if(U.grabbed()&&!U.isParent())Q.push(U);else if(K.inDragLayer)J.drag.push(U);else J.nondrag.push(U)}for(var Z=0;Z<Q.length;Z++){var U=Q[Z];J.drag.push(U)}};Lx.invalidateCachedZSortedEles=function(){this.cachedZSortedEles=null};Lx.getCachedZSortedEles=function(J){if(J||!this.cachedZSortedEles){var Q=this.cy.mutableElements().toArray();Q.sort(vh0),Q.interactive=Q.filter(function(Z){return Z.interactive()}),this.cachedZSortedEles=Q,this.updateCachedGrabbedEles()}else Q=this.cachedZSortedEles;return Q};oh0={};[gB,sb,ZU,Cj,xJ0,Rz,ah0,Ox,Lx].forEach(function(J){HJ(oh0,J)});th0={};th0.getCachedImage=function(J,Q,Z){var U=this,K=U.imageCache=U.imageCache||{},X=K[J];if(X){if(!X.image.complete)X.image.addEventListener("load",Z);return X.image}else{X=K[J]=K[J]||{};var Y=X.image=new Image;Y.addEventListener("load",Z),Y.addEventListener("error",function(){Y.error=!0});var z="data:",G=J.substring(0,z.length).toLowerCase()===z;if(!G)Q=Q==="null"?null:Q,Y.crossOrigin=Q;return Y.src=J,Y}};tA={};tA.registerBinding=function(J,Q,Z,U){var K=Array.prototype.slice.apply(arguments,[1]);if(Array.isArray(J)){var X=[];for(var Y=0;Y<J.length;Y++){var z=J[Y];if(z!==void 0){var G=this.binder(z);X.push(G.on.apply(G,K))}}return X}var G=this.binder(J);return G.on.apply(G,K)};tA.binder=function(J){var Q=this,Z=Q.cy.window(),U=J===Z||J===Z.document||J===Z.document.body||LT6(J);if(Q.supportsPassiveEvents==null){var K=!1;try{var X=Object.defineProperty({},"passive",{get:function z(){return K=!0,!0}});Z.addEventListener("test",null,X)}catch(z){}Q.supportsPassiveEvents=K}var Y=function z(G,W,H){var q=Array.prototype.slice.call(arguments);if(U&&Q.supportsPassiveEvents)q[2]={capture:H!=null?H:!1,passive:!1,once:!1};return Q.bindings.push({target:J,args:q}),(J.addEventListener||J.on).apply(J,q),this};return{on:Y,addEventListener:Y,addListener:Y,bind:Y}};tA.nodeIsDraggable=function(J){return J&&J.isNode()&&!J.locked()&&J.grabbable()};tA.nodeIsGrabbable=function(J){return this.nodeIsDraggable(J)&&J.interactive()};tA.load=function(){var J=this,Q=J.cy.window(),Z=function w0(d){return d.selected()},U=function w0(d){var L0=d.getRootNode();if(L0&&L0.nodeType===11&&L0.host!==void 0)return L0},K=function w0(d,L0,I0,T0){if(d==null)d=J.cy;for(var $0=0;$0<L0.length;$0++){var v0=L0[$0];d.emit({originalEvent:I0,type:v0,position:T0})}},X=function w0(d){return d.shiftKey||d.metaKey||d.ctrlKey},Y=function w0(d,L0){var I0=!0;if(J.cy.hasCompoundNodes()&&d&&d.pannable())for(var T0=0;L0&&T0<L0.length;T0++){var d=L0[T0];if(d.isNode()&&d.isParent()&&!d.pannable()){I0=!1;break}}else I0=!0;return I0},z=function w0(d){d[0]._private.grabbed=!0},G=function w0(d){d[0]._private.grabbed=!1},W=function w0(d){d[0]._private.rscratch.inDragLayer=!0},H=function w0(d){d[0]._private.rscratch.inDragLayer=!1},q=function w0(d){d[0]._private.rscratch.isGrabTarget=!0},F=function w0(d){d[0]._private.rscratch.isGrabTarget=!1},M=function w0(d,L0){var I0=L0.addToList,T0=I0.has(d);if(!T0&&d.grabbable()&&!d.locked())I0.merge(d),z(d)},L=function w0(d,L0){if(!d.cy().hasCompoundNodes())return;if(L0.inDragLayer==null&&L0.addToList==null)return;var I0=d.descendants();if(L0.inDragLayer)I0.forEach(W),I0.connectedEdges().forEach(W);if(L0.addToList)M(I0,L0)},A=function w0(d,L0){L0=L0||{};var I0=d.cy().hasCompoundNodes();if(L0.inDragLayer)d.forEach(W),d.neighborhood().stdFilter(function(T0){return!I0||T0.isEdge()}).forEach(W);if(L0.addToList)d.forEach(function(T0){M(T0,L0)});L(d,L0),N(d,{inDragLayer:L0.inDragLayer}),J.updateCachedGrabbedEles()},I=A,R=function w0(d){if(!d)return;J.getCachedZSortedEles().forEach(function(L0){G(L0),H(L0),F(L0)}),J.updateCachedGrabbedEles()},N=function w0(d,L0){if(L0.inDragLayer==null&&L0.addToList==null)return;if(!d.cy().hasCompoundNodes())return;var I0=d.ancestors().orphans();if(I0.same(d))return;var T0=I0.descendants().spawnSelf().merge(I0).unmerge(d).unmerge(d.descendants()),$0=T0.connectedEdges();if(L0.inDragLayer)$0.forEach(W),T0.forEach(W);if(L0.addToList)T0.forEach(function(v0){M(v0,L0)})},E=function w0(){if(document.activeElement!=null&&document.activeElement.blur!=null)document.activeElement.blur()},V=typeof MutationObserver!=="undefined",j=typeof ResizeObserver!=="undefined";if(V){if(J.removeObserver=new MutationObserver(function(w0){for(var d=0;d<w0.length;d++){var L0=w0[d],I0=L0.removedNodes;if(I0)for(var T0=0;T0<I0.length;T0++){var $0=I0[T0];if($0===J.container){J.destroy();break}}}}),J.container.parentNode)J.removeObserver.observe(J.container.parentNode,{childList:!0})}else J.registerBinding(J.container,"DOMNodeRemoved",function(w0){J.destroy()});var T=jj(function(){J.cy.resize()},100);if(V)J.styleObserver=new MutationObserver(T),J.styleObserver.observe(J.container,{attributes:!0});if(J.registerBinding(Q,"resize",T),j)J.resizeObserver=new ResizeObserver(T),J.resizeObserver.observe(J.container);var C=function w0(d,L0){while(d!=null)L0(d),d=d.parentNode},$=function w0(){J.invalidateContainerClientCoordsCache()};C(J.container,function(w0){J.registerBinding(w0,"transitionend",$),J.registerBinding(w0,"animationend",$),J.registerBinding(w0,"scroll",$)}),J.registerBinding(J.container,"contextmenu",function(w0){w0.preventDefault()});var b=function w0(){return J.selection[4]!==0},h=function w0(d){var L0=J.findContainerClientCoords(),I0=L0[0],T0=L0[1],$0=L0[2],v0=L0[3],r0=d.touches?d.touches:[d],u0=!1;for(var G6=0;G6<r0.length;G6++){var A6=r0[G6];if(I0<=A6.clientX&&A6.clientX<=I0+$0&&T0<=A6.clientY&&A6.clientY<=T0+v0){u0=!0;break}}if(!u0)return!1;var r6=J.container,N6=d.target,F6=N6.parentNode,P6=!1;while(F6){if(F6===r6){P6=!0;break}F6=F6.parentNode}if(!P6)return!1;return!0};J.registerBinding(J.container,"mousedown",function w0(d){if(!h(d))return;if(J.hoverData.which===1&&d.which!==1)return;d.preventDefault(),E(),J.hoverData.capture=!0,J.hoverData.which=d.which;var L0=J.cy,I0=[d.clientX,d.clientY],T0=J.projectIntoViewport(I0[0],I0[1]),$0=J.selection,v0=J.findNearestElements(T0[0],T0[1],!0,!1),r0=v0[0],u0=J.dragData.possibleDragElements;J.hoverData.mdownPos=T0,J.hoverData.mdownGPos=I0;var G6=function P6(M6){return{originalEvent:d,type:M6,position:{x:T0[0],y:T0[1]}}},A6=function P6(){J.hoverData.tapholdCancelled=!1,clearTimeout(J.hoverData.tapholdTimeout),J.hoverData.tapholdTimeout=setTimeout(function(){if(J.hoverData.tapholdCancelled)return;else{var M6=J.hoverData.down;if(M6)M6.emit(G6("taphold"));else L0.emit(G6("taphold"))}},J.tapholdDuration)};if(d.which==3){J.hoverData.cxtStarted=!0;var r6={originalEvent:d,type:"cxttapstart",position:{x:T0[0],y:T0[1]}};if(r0)r0.activate(),r0.emit(r6),J.hoverData.down=r0;else L0.emit(r6);J.hoverData.downTime=new Date().getTime(),J.hoverData.cxtDragged=!1}else if(d.which==1){if(r0)r0.activate();{if(r0!=null){if(J.nodeIsGrabbable(r0)){var N6=function P6(M6){M6.emit(G6("grab"))};if(q(r0),!r0.selected())u0=J.dragData.possibleDragElements=L0.collection(),I(r0,{addToList:u0}),r0.emit(G6("grabon")).emit(G6("grab"));else{u0=J.dragData.possibleDragElements=L0.collection();var F6=L0.$(function(P6){return P6.isNode()&&P6.selected()&&J.nodeIsGrabbable(P6)});A(F6,{addToList:u0}),r0.emit(G6("grabon")),F6.forEach(N6)}J.redrawHint("eles",!0),J.redrawHint("drag",!0)}}J.hoverData.down=r0,J.hoverData.downs=v0,J.hoverData.downTime=new Date().getTime()}if(K(r0,["mousedown","tapstart","vmousedown"],d,{x:T0[0],y:T0[1]}),r0==null)$0[4]=1,J.data.bgActivePosistion={x:T0[0],y:T0[1]},J.redrawHint("select",!0),J.redraw();else if(r0.pannable())$0[4]=1;A6()}$0[0]=$0[2]=T0[0],$0[1]=$0[3]=T0[1]},!1);var _=U(J.container);J.registerBinding([Q,_],"mousemove",function w0(d){var L0=J.hoverData.capture;if(!L0&&!h(d))return;var I0=!1,T0=J.cy,$0=T0.zoom(),v0=[d.clientX,d.clientY],r0=J.projectIntoViewport(v0[0],v0[1]),u0=J.hoverData.mdownPos,G6=J.hoverData.mdownGPos,A6=J.selection,r6=null;if(!J.hoverData.draggingEles&&!J.hoverData.dragging&&!J.hoverData.selecting)r6=J.findNearestElement(r0[0],r0[1],!0,!1);var N6=J.hoverData.last,F6=J.hoverData.down,P6=[r0[0]-A6[2],r0[1]-A6[3]],M6=J.dragData.possibleDragElements,g6;if(G6){var O8=v0[0]-G6[0],a6=O8*O8,U8=v0[1]-G6[1],p6=U8*U8,u6=a6+p6;J.hoverData.isOverThresholdDrag=g6=u6>=J.desktopTapThreshold2}var S0=X(d);if(g6)J.hoverData.tapholdCancelled=!0;var Q6=function g8(){var k6=J.hoverData.dragDelta=J.hoverData.dragDelta||[];if(k6.length===0)k6.push(P6[0]),k6.push(P6[1]);else k6[0]+=P6[0],k6[1]+=P6[1]};I0=!0,K(r6,["mousemove","vmousemove","tapdrag"],d,{x:r0[0],y:r0[1]});var B6=function g8(k6){return{originalEvent:d,type:k6,position:{x:r0[0],y:r0[1]}}},D0=function g8(){if(J.data.bgActivePosistion=void 0,!J.hoverData.selecting)T0.emit(B6("boxstart"));A6[4]=1,J.hoverData.selecting=!0,J.redrawHint("select",!0),J.redraw()};if(J.hoverData.which===3){if(g6){var X6=B6("cxtdrag");if(F6)F6.emit(X6);else T0.emit(X6);if(J.hoverData.cxtDragged=!0,!J.hoverData.cxtOver||r6!==J.hoverData.cxtOver){if(J.hoverData.cxtOver)J.hoverData.cxtOver.emit(B6("cxtdragout"));if(J.hoverData.cxtOver=r6,r6)r6.emit(B6("cxtdragover"))}}}else if(J.hoverData.dragging){if(I0=!0,T0.panningEnabled()&&T0.userPanningEnabled()){var W6;if(J.hoverData.justStartedPan){var _6=J.hoverData.mdownPos;W6={x:(r0[0]-_6[0])*$0,y:(r0[1]-_6[1])*$0},J.hoverData.justStartedPan=!1}else W6={x:P6[0]*$0,y:P6[1]*$0};T0.panBy(W6),T0.emit(B6("dragpan")),J.hoverData.dragged=!0}r0=J.projectIntoViewport(d.clientX,d.clientY)}else if(A6[4]==1&&(F6==null||F6.pannable())){if(g6){if(!J.hoverData.dragging&&T0.boxSelectionEnabled()&&(S0||!T0.panningEnabled()||!T0.userPanningEnabled()))D0();else if(!J.hoverData.selecting&&T0.panningEnabled()&&T0.userPanningEnabled()){var c6=Y(F6,J.hoverData.downs);if(c6)J.hoverData.dragging=!0,J.hoverData.justStartedPan=!0,A6[4]=0,J.data.bgActivePosistion=yA(u0),J.redrawHint("select",!0),J.redraw()}if(F6&&F6.pannable()&&F6.active())F6.unactivate()}}else{if(F6&&F6.pannable()&&F6.active())F6.unactivate();if((!F6||!F6.grabbed())&&r6!=N6){if(N6)K(N6,["mouseout","tapdragout"],d,{x:r0[0],y:r0[1]});if(r6)K(r6,["mouseover","tapdragover"],d,{x:r0[0],y:r0[1]});J.hoverData.last=r6}if(F6)if(g6){if(T0.boxSelectionEnabled()&&S0){if(F6&&F6.grabbed()){if(R(M6),F6.emit(B6("freeon")),M6.emit(B6("free")),J.dragData.didDrag)F6.emit(B6("dragfreeon")),M6.emit(B6("dragfree"))}D0()}else if(F6&&F6.grabbed()&&J.nodeIsDraggable(F6)){var d6=!J.dragData.didDrag;if(d6)J.redrawHint("eles",!0);if(J.dragData.didDrag=!0,!J.hoverData.draggingEles)A(M6,{inDragLayer:!0});var l6={x:0,y:0};if(A8(P6[0])&&A8(P6[1])){if(l6.x+=P6[0],l6.y+=P6[1],d6){var t6=J.hoverData.dragDelta;if(t6&&A8(t6[0])&&A8(t6[1]))l6.x+=t6[0],l6.y+=t6[1]}}J.hoverData.draggingEles=!0,M6.silentShift(l6).emit(B6("position")).emit(B6("drag")),J.redrawHint("drag",!0),J.redraw()}}else Q6();I0=!0}if(A6[2]=r0[0],A6[3]=r0[1],I0){if(d.stopPropagation)d.stopPropagation();if(d.preventDefault)d.preventDefault();return!1}},!1);var S,v,f;J.registerBinding(Q,"mouseup",function w0(d){if(J.hoverData.which===1&&d.which!==1&&J.hoverData.capture)return;var L0=J.hoverData.capture;if(!L0)return;J.hoverData.capture=!1;var I0=J.cy,T0=J.projectIntoViewport(d.clientX,d.clientY),$0=J.selection,v0=J.findNearestElement(T0[0],T0[1],!0,!1),r0=J.dragData.possibleDragElements,u0=J.hoverData.down,G6=X(d);if(J.data.bgActivePosistion)J.redrawHint("select",!0),J.redraw();if(J.hoverData.tapholdCancelled=!0,J.data.bgActivePosistion=void 0,u0)u0.unactivate();var A6=function g6(O8){return{originalEvent:d,type:O8,position:{x:T0[0],y:T0[1]}}};if(J.hoverData.which===3){var r6=A6("cxttapend");if(u0)u0.emit(r6);else I0.emit(r6);if(!J.hoverData.cxtDragged){var N6=A6("cxttap");if(u0)u0.emit(N6);else I0.emit(N6)}J.hoverData.cxtDragged=!1,J.hoverData.which=null}else if(J.hoverData.which===1){if(K(v0,["mouseup","tapend","vmouseup"],d,{x:T0[0],y:T0[1]}),!J.dragData.didDrag&&!J.hoverData.dragged&&!J.hoverData.selecting&&!J.hoverData.isOverThresholdDrag)if(K(u0,["click","tap","vclick"],d,{x:T0[0],y:T0[1]}),v=!1,d.timeStamp-f<=I0.multiClickDebounceTime())S&&clearTimeout(S),v=!0,f=null,K(u0,["dblclick","dbltap","vdblclick"],d,{x:T0[0],y:T0[1]});else S=setTimeout(function(){if(v)return;K(u0,["oneclick","onetap","voneclick"],d,{x:T0[0],y:T0[1]})},I0.multiClickDebounceTime()),f=d.timeStamp;if(u0==null&&!J.dragData.didDrag&&!J.hoverData.selecting&&!J.hoverData.dragged&&!X(d)){if(I0.$(Z).unselect(["tapunselect"]),r0.length>0)J.redrawHint("eles",!0);J.dragData.possibleDragElements=r0=I0.collection()}if(v0==u0&&!J.dragData.didDrag&&!J.hoverData.selecting){if(v0!=null&&v0._private.selectable){if(J.hoverData.dragging);else if(I0.selectionType()==="additive"||G6)if(v0.selected())v0.unselect(["tapunselect"]);else v0.select(["tapselect"]);else if(!G6)I0.$(Z).unmerge(v0).unselect(["tapunselect"]),v0.select(["tapselect"]);J.redrawHint("eles",!0)}}if(J.hoverData.selecting){var F6=I0.collection(J.getAllInBox($0[0],$0[1],$0[2],$0[3]));if(J.redrawHint("select",!0),F6.length>0)J.redrawHint("eles",!0);I0.emit(A6("boxend"));var P6=function g6(O8){return O8.selectable()&&!O8.selected()};if(I0.selectionType()==="additive")F6.emit(A6("box")).stdFilter(P6).select().emit(A6("boxselect"));else{if(!G6)I0.$(Z).unmerge(F6).unselect();F6.emit(A6("box")).stdFilter(P6).select().emit(A6("boxselect"))}J.redraw()}if(J.hoverData.dragging)J.hoverData.dragging=!1,J.redrawHint("select",!0),J.redrawHint("eles",!0),J.redraw();if(!$0[4]){J.redrawHint("drag",!0),J.redrawHint("eles",!0);var M6=u0&&u0.grabbed();if(R(r0),M6){if(u0.emit(A6("freeon")),r0.emit(A6("free")),J.dragData.didDrag)u0.emit(A6("dragfreeon")),r0.emit(A6("dragfree"))}}}$0[4]=0,J.hoverData.down=null,J.hoverData.cxtStarted=!1,J.hoverData.draggingEles=!1,J.hoverData.selecting=!1,J.hoverData.isOverThresholdDrag=!1,J.dragData.didDrag=!1,J.hoverData.dragged=!1,J.hoverData.dragDelta=[],J.hoverData.mdownPos=null,J.hoverData.mdownGPos=null,J.hoverData.which=null},!1);var x=[],y=4,m,g=1e5,p=function w0(d,L0){for(var I0=0;I0<d.length;I0++)if(d[I0]%L0!==0)return!1;return!0},i=function w0(d){var L0=Math.abs(d[0]);for(var I0=1;I0<d.length;I0++)if(Math.abs(d[I0])!==L0)return!1;return!0},l=function w0(d){var L0=!1,I0=d.deltaY;if(I0==null){if(d.wheelDeltaY!=null)I0=d.wheelDeltaY/4;else if(d.wheelDelta!=null)I0=d.wheelDelta/4}if(I0===0)return;if(m==null)if(x.length>=y){var T0=x;if(m=p(T0,5),!m){var $0=Math.abs(T0[0]);m=i(T0)&&$0>5}if(m)for(var v0=0;v0<T0.length;v0++)g=Math.min(Math.abs(T0[v0]),g)}else x.push(I0),L0=!0;else if(m)g=Math.min(Math.abs(I0),g);if(J.scrollingPage)return;var r0=J.cy,u0=r0.zoom(),G6=r0.pan(),A6=J.projectIntoViewport(d.clientX,d.clientY),r6=[A6[0]*u0+G6.x,A6[1]*u0+G6.y];if(J.hoverData.draggingEles||J.hoverData.dragging||J.hoverData.cxtStarted||b()){d.preventDefault();return}if(r0.panningEnabled()&&r0.userPanningEnabled()&&r0.zoomingEnabled()&&r0.userZoomingEnabled()){d.preventDefault(),J.data.wheelZooming=!0,clearTimeout(J.data.wheelTimeout),J.data.wheelTimeout=setTimeout(function(){J.data.wheelZooming=!1,J.redrawHint("eles",!0),J.redraw()},150);var N6;if(L0&&Math.abs(I0)>5)I0=wJ0(I0)*5;if(N6=I0/-250,m)N6/=g,N6*=3;N6=N6*J.wheelSensitivity;var F6=d.deltaMode===1;if(F6)N6*=33;var P6=r0.zoom()*Math.pow(10,N6);if(d.type==="gesturechange")P6=J.gestureStartZoom*d.scale;r0.zoom({level:P6,renderedPosition:{x:r6[0],y:r6[1]}}),r0.emit({type:d.type==="gesturechange"?"pinchzoom":"scrollzoom",originalEvent:d,position:{x:A6[0],y:A6[1]}})}};J.registerBinding(J.container,"wheel",l,!0),J.registerBinding(Q,"scroll",function w0(d){J.scrollingPage=!0,clearTimeout(J.scrollingPageTimeout),J.scrollingPageTimeout=setTimeout(function(){J.scrollingPage=!1},250)},!0),J.registerBinding(J.container,"gesturestart",function w0(d){if(J.gestureStartZoom=J.cy.zoom(),!J.hasTouchStarted)d.preventDefault()},!0),J.registerBinding(J.container,"gesturechange",function(w0){if(!J.hasTouchStarted)l(w0)},!0),J.registerBinding(J.container,"mouseout",function w0(d){var L0=J.projectIntoViewport(d.clientX,d.clientY);J.cy.emit({originalEvent:d,type:"mouseout",position:{x:L0[0],y:L0[1]}})},!1),J.registerBinding(J.container,"mouseover",function w0(d){var L0=J.projectIntoViewport(d.clientX,d.clientY);J.cy.emit({originalEvent:d,type:"mouseover",position:{x:L0[0],y:L0[1]}})},!1);var a,e,G0,U0,O0,X0,E0,W0,q0,z0,K0,R0,Y0,P0=function w0(d,L0,I0,T0){return Math.sqrt((I0-d)*(I0-d)+(T0-L0)*(T0-L0))},F0=function w0(d,L0,I0,T0){return(I0-d)*(I0-d)+(T0-L0)*(T0-L0)},m0;J.registerBinding(J.container,"touchstart",m0=function w0(d){if(J.hasTouchStarted=!0,!h(d))return;E(),J.touchData.capture=!0,J.data.bgActivePosistion=void 0;var L0=J.cy,I0=J.touchData.now,T0=J.touchData.earlier;if(d.touches[0]){var $0=J.projectIntoViewport(d.touches[0].clientX,d.touches[0].clientY);I0[0]=$0[0],I0[1]=$0[1]}if(d.touches[1]){var $0=J.projectIntoViewport(d.touches[1].clientX,d.touches[1].clientY);I0[2]=$0[0],I0[3]=$0[1]}if(d.touches[2]){var $0=J.projectIntoViewport(d.touches[2].clientX,d.touches[2].clientY);I0[4]=$0[0],I0[5]=$0[1]}var v0=function u6(S0){return{originalEvent:d,type:S0,position:{x:I0[0],y:I0[1]}}};if(d.touches[1]){J.touchData.singleTouchMoved=!0,R(J.dragData.touchDragEles);var r0=J.findContainerClientCoords();q0=r0[0],z0=r0[1],K0=r0[2],R0=r0[3],a=d.touches[0].clientX-q0,e=d.touches[0].clientY-z0,G0=d.touches[1].clientX-q0,U0=d.touches[1].clientY-z0,Y0=0<=a&&a<=K0&&0<=G0&&G0<=K0&&0<=e&&e<=R0&&0<=U0&&U0<=R0;var u0=L0.pan(),G6=L0.zoom();O0=P0(a,e,G0,U0),X0=F0(a,e,G0,U0),E0=[(a+G0)/2,(e+U0)/2],W0=[(E0[0]-u0.x)/G6,(E0[1]-u0.y)/G6];var A6=200,r6=A6*A6;if(X0<r6&&!d.touches[2]){var N6=J.findNearestElement(I0[0],I0[1],!0,!0),F6=J.findNearestElement(I0[2],I0[3],!0,!0);if(N6&&N6.isNode())N6.activate().emit(v0("cxttapstart")),J.touchData.start=N6;else if(F6&&F6.isNode())F6.activate().emit(v0("cxttapstart")),J.touchData.start=F6;else L0.emit(v0("cxttapstart"));if(J.touchData.start)J.touchData.start._private.grabbed=!1;J.touchData.cxt=!0,J.touchData.cxtDragged=!1,J.data.bgActivePosistion=void 0,J.redraw();return}}if(d.touches[2]){if(L0.boxSelectionEnabled())d.preventDefault()}else if(d.touches[1]);else if(d.touches[0]){var P6=J.findNearestElements(I0[0],I0[1],!0,!0),M6=P6[0];if(M6!=null){if(M6.activate(),J.touchData.start=M6,J.touchData.starts=P6,J.nodeIsGrabbable(M6)){var g6=J.dragData.touchDragEles=L0.collection(),O8=null;if(J.redrawHint("eles",!0),J.redrawHint("drag",!0),M6.selected())O8=L0.$(function(u6){return u6.selected()&&J.nodeIsGrabbable(u6)}),A(O8,{addToList:g6});else I(M6,{addToList:g6});if(q(M6),M6.emit(v0("grabon")),O8)O8.forEach(function(u6){u6.emit(v0("grab"))});else M6.emit(v0("grab"))}}if(K(M6,["touchstart","tapstart","vmousedown"],d,{x:I0[0],y:I0[1]}),M6==null)J.data.bgActivePosistion={x:$0[0],y:$0[1]},J.redrawHint("select",!0),J.redraw();J.touchData.singleTouchMoved=!1,J.touchData.singleTouchStartTime=+new Date,clearTimeout(J.touchData.tapholdTimeout),J.touchData.tapholdTimeout=setTimeout(function(){if(J.touchData.singleTouchMoved===!1&&!J.pinching&&!J.touchData.selecting)K(J.touchData.start,["taphold"],d,{x:I0[0],y:I0[1]})},J.tapholdDuration)}if(d.touches.length>=1){var a6=J.touchData.startPosition=[null,null,null,null,null,null];for(var U8=0;U8<I0.length;U8++)a6[U8]=T0[U8]=I0[U8];var p6=d.touches[0];J.touchData.startGPosition=[p6.clientX,p6.clientY]}},!1);var J0;J.registerBinding(Q,"touchmove",J0=function w0(d){var L0=J.touchData.capture;if(!L0&&!h(d))return;var{selection:I0,cy:T0}=J,$0=J.touchData.now,v0=J.touchData.earlier,r0=T0.zoom();if(d.touches[0]){var u0=J.projectIntoViewport(d.touches[0].clientX,d.touches[0].clientY);$0[0]=u0[0],$0[1]=u0[1]}if(d.touches[1]){var u0=J.projectIntoViewport(d.touches[1].clientX,d.touches[1].clientY);$0[2]=u0[0],$0[3]=u0[1]}if(d.touches[2]){var u0=J.projectIntoViewport(d.touches[2].clientX,d.touches[2].clientY);$0[4]=u0[0],$0[5]=u0[1]}var G6=function cK(lK){return{originalEvent:d,type:lK,position:{x:$0[0],y:$0[1]}}},A6=J.touchData.startGPosition,r6;if(L0&&d.touches[0]&&A6){var N6=[];for(var F6=0;F6<$0.length;F6++)N6[F6]=$0[F6]-v0[F6];var P6=d.touches[0].clientX-A6[0],M6=P6*P6,g6=d.touches[0].clientY-A6[1],O8=g6*g6,a6=M6+O8;r6=a6>=J.touchTapThreshold2}if(L0&&J.touchData.cxt){d.preventDefault();var U8=d.touches[0].clientX-q0,p6=d.touches[0].clientY-z0,u6=d.touches[1].clientX-q0,S0=d.touches[1].clientY-z0,Q6=F0(U8,p6,u6,S0),B6=Q6/X0,D0=150,X6=D0*D0,W6=1.5,_6=W6*W6;if(B6>=_6||Q6>=X6){J.touchData.cxt=!1,J.data.bgActivePosistion=void 0,J.redrawHint("select",!0);var c6=G6("cxttapend");if(J.touchData.start)J.touchData.start.unactivate().emit(c6),J.touchData.start=null;else T0.emit(c6)}}if(L0&&J.touchData.cxt){var c6=G6("cxtdrag");if(J.data.bgActivePosistion=void 0,J.redrawHint("select",!0),J.touchData.start)J.touchData.start.emit(c6);else T0.emit(c6);if(J.touchData.start)J.touchData.start._private.grabbed=!1;J.touchData.cxtDragged=!0;var d6=J.findNearestElement($0[0],$0[1],!0,!0);if(!J.touchData.cxtOver||d6!==J.touchData.cxtOver){if(J.touchData.cxtOver)J.touchData.cxtOver.emit(G6("cxtdragout"));if(J.touchData.cxtOver=d6,d6)d6.emit(G6("cxtdragover"))}}else if(L0&&d.touches[2]&&T0.boxSelectionEnabled()){if(d.preventDefault(),J.data.bgActivePosistion=void 0,this.lastThreeTouch=+new Date,!J.touchData.selecting)T0.emit(G6("boxstart"));if(J.touchData.selecting=!0,J.touchData.didSelect=!0,I0[4]=1,!I0||I0.length===0||I0[0]===void 0)I0[0]=($0[0]+$0[2]+$0[4])/3,I0[1]=($0[1]+$0[3]+$0[5])/3,I0[2]=($0[0]+$0[2]+$0[4])/3+1,I0[3]=($0[1]+$0[3]+$0[5])/3+1;else I0[2]=($0[0]+$0[2]+$0[4])/3,I0[3]=($0[1]+$0[3]+$0[5])/3;J.redrawHint("select",!0),J.redraw()}else if(L0&&d.touches[1]&&!J.touchData.didSelect&&T0.zoomingEnabled()&&T0.panningEnabled()&&T0.userZoomingEnabled()&&T0.userPanningEnabled()){d.preventDefault(),J.data.bgActivePosistion=void 0,J.redrawHint("select",!0);var l6=J.dragData.touchDragEles;if(l6){J.redrawHint("drag",!0);for(var t6=0;t6<l6.length;t6++){var g8=l6[t6]._private;g8.grabbed=!1,g8.rscratch.inDragLayer=!1}}var k6=J.touchData.start,U8=d.touches[0].clientX-q0,p6=d.touches[0].clientY-z0,u6=d.touches[1].clientX-q0,S0=d.touches[1].clientY-z0,d0=P0(U8,p6,u6,S0),V6=d0/O0;if(Y0){var Z8=U8-a,qJ=p6-e,ZJ=u6-G0,q8=S0-U0,B9=(Z8+ZJ)/2,m9=(qJ+q8)/2,H7=T0.zoom(),kJ=H7*V6,p0=T0.pan(),T6=W0[0]*H7+p0.x,z8=W0[1]*H7+p0.y,C6={x:-kJ/H7*(T6-p0.x-B9)+T6,y:-kJ/H7*(z8-p0.y-m9)+z8};if(k6&&k6.active()){var l6=J.dragData.touchDragEles;if(R(l6),J.redrawHint("drag",!0),J.redrawHint("eles",!0),k6.unactivate().emit(G6("freeon")),l6.emit(G6("free")),J.dragData.didDrag)k6.emit(G6("dragfreeon")),l6.emit(G6("dragfree"))}T0.viewport({zoom:kJ,pan:C6,cancelOnFailedZoom:!0}),T0.emit(G6("pinchzoom")),O0=d0,a=U8,e=p6,G0=u6,U0=S0,J.pinching=!0}if(d.touches[0]){var u0=J.projectIntoViewport(d.touches[0].clientX,d.touches[0].clientY);$0[0]=u0[0],$0[1]=u0[1]}if(d.touches[1]){var u0=J.projectIntoViewport(d.touches[1].clientX,d.touches[1].clientY);$0[2]=u0[0],$0[3]=u0[1]}if(d.touches[2]){var u0=J.projectIntoViewport(d.touches[2].clientX,d.touches[2].clientY);$0[4]=u0[0],$0[5]=u0[1]}}else if(d.touches[0]&&!J.touchData.didSelect){var wJ=J.touchData.start,x0=J.touchData.last,d6;if(!J.hoverData.draggingEles&&!J.swipePanning)d6=J.findNearestElement($0[0],$0[1],!0,!0);if(L0&&wJ!=null)d.preventDefault();if(L0&&wJ!=null&&J.nodeIsDraggable(wJ))if(r6){var l6=J.dragData.touchDragEles,fQ=!J.dragData.didDrag;if(fQ)A(l6,{inDragLayer:!0});J.dragData.didDrag=!0;var c0={x:0,y:0};if(A8(N6[0])&&A8(N6[1])){if(c0.x+=N6[0],c0.y+=N6[1],fQ){J.redrawHint("eles",!0);var xJ=J.touchData.dragDelta;if(xJ&&A8(xJ[0])&&A8(xJ[1]))c0.x+=xJ[0],c0.y+=xJ[1]}}if(J.hoverData.draggingEles=!0,l6.silentShift(c0).emit(G6("position")).emit(G6("drag")),J.redrawHint("drag",!0),J.touchData.startPosition[0]==v0[0]&&J.touchData.startPosition[1]==v0[1])J.redrawHint("eles",!0);J.redraw()}else{var xJ=J.touchData.dragDelta=J.touchData.dragDelta||[];if(xJ.length===0)xJ.push(N6[0]),xJ.push(N6[1]);else xJ[0]+=N6[0],xJ[1]+=N6[1]}{if(K(wJ||d6,["touchmove","tapdrag","vmousemove"],d,{x:$0[0],y:$0[1]}),(!wJ||!wJ.grabbed())&&d6!=x0){if(x0)x0.emit(G6("tapdragout"));if(d6)d6.emit(G6("tapdragover"))}J.touchData.last=d6}if(L0){for(var t6=0;t6<$0.length;t6++)if($0[t6]&&J.touchData.startPosition[t6]&&r6)J.touchData.singleTouchMoved=!0}if(L0&&(wJ==null||wJ.pannable())&&T0.panningEnabled()&&T0.userPanningEnabled()){var YQ=Y(wJ,J.touchData.starts);if(YQ){if(d.preventDefault(),!J.data.bgActivePosistion)J.data.bgActivePosistion=yA(J.touchData.startPosition);if(J.swipePanning)T0.panBy({x:N6[0]*r0,y:N6[1]*r0}),T0.emit(G6("dragpan"));else if(r6){if(J.swipePanning=!0,T0.panBy({x:P6*r0,y:g6*r0}),T0.emit(G6("dragpan")),wJ)wJ.unactivate(),J.redrawHint("select",!0),J.touchData.start=null}}var u0=J.projectIntoViewport(d.touches[0].clientX,d.touches[0].clientY);$0[0]=u0[0],$0[1]=u0[1]}}for(var F6=0;F6<$0.length;F6++)v0[F6]=$0[F6];if(L0&&d.touches.length>0&&!J.hoverData.draggingEles&&!J.swipePanning&&J.data.bgActivePosistion!=null)J.data.bgActivePosistion=void 0,J.redrawHint("select",!0),J.redraw()},!1);var z6;J.registerBinding(Q,"touchcancel",z6=function w0(d){var L0=J.touchData.start;if(J.touchData.capture=!1,L0)L0.unactivate()});var t,N0,f0,l0;if(J.registerBinding(Q,"touchend",t=function w0(d){var L0=J.touchData.start,I0=J.touchData.capture;if(I0){if(d.touches.length===0)J.touchData.capture=!1;d.preventDefault()}else return;var T0=J.selection;J.swipePanning=!1,J.hoverData.draggingEles=!1;var $0=J.cy,v0=$0.zoom(),r0=J.touchData.now,u0=J.touchData.earlier;if(d.touches[0]){var G6=J.projectIntoViewport(d.touches[0].clientX,d.touches[0].clientY);r0[0]=G6[0],r0[1]=G6[1]}if(d.touches[1]){var G6=J.projectIntoViewport(d.touches[1].clientX,d.touches[1].clientY);r0[2]=G6[0],r0[3]=G6[1]}if(d.touches[2]){var G6=J.projectIntoViewport(d.touches[2].clientX,d.touches[2].clientY);r0[4]=G6[0],r0[5]=G6[1]}var A6=function D0(X6){return{originalEvent:d,type:X6,position:{x:r0[0],y:r0[1]}}};if(L0)L0.unactivate();var r6;if(J.touchData.cxt){if(r6=A6("cxttapend"),L0)L0.emit(r6);else $0.emit(r6);if(!J.touchData.cxtDragged){var N6=A6("cxttap");if(L0)L0.emit(N6);else $0.emit(N6)}if(J.touchData.start)J.touchData.start._private.grabbed=!1;J.touchData.cxt=!1,J.touchData.start=null,J.redraw();return}if(!d.touches[2]&&$0.boxSelectionEnabled()&&J.touchData.selecting){J.touchData.selecting=!1;var F6=$0.collection(J.getAllInBox(T0[0],T0[1],T0[2],T0[3]));T0[0]=void 0,T0[1]=void 0,T0[2]=void 0,T0[3]=void 0,T0[4]=0,J.redrawHint("select",!0),$0.emit(A6("boxend"));var P6=function D0(X6){return X6.selectable()&&!X6.selected()};if(F6.emit(A6("box")).stdFilter(P6).select().emit(A6("boxselect")),F6.nonempty())J.redrawHint("eles",!0);J.redraw()}if(L0!=null)L0.unactivate();if(d.touches[2])J.data.bgActivePosistion=void 0,J.redrawHint("select",!0);else if(d.touches[1]);else if(d.touches[0]);else if(!d.touches[0]){J.data.bgActivePosistion=void 0,J.redrawHint("select",!0);var M6=J.dragData.touchDragEles;if(L0!=null){var g6=L0._private.grabbed;if(R(M6),J.redrawHint("drag",!0),J.redrawHint("eles",!0),g6){if(L0.emit(A6("freeon")),M6.emit(A6("free")),J.dragData.didDrag)L0.emit(A6("dragfreeon")),M6.emit(A6("dragfree"))}K(L0,["touchend","tapend","vmouseup","tapdragout"],d,{x:r0[0],y:r0[1]}),L0.unactivate(),J.touchData.start=null}else{var O8=J.findNearestElement(r0[0],r0[1],!0,!0);K(O8,["touchend","tapend","vmouseup","tapdragout"],d,{x:r0[0],y:r0[1]})}var a6=J.touchData.startPosition[0]-r0[0],U8=a6*a6,p6=J.touchData.startPosition[1]-r0[1],u6=p6*p6,S0=U8+u6,Q6=S0*v0*v0;if(!J.touchData.singleTouchMoved){if(!L0)$0.$(":selected").unselect(["tapunselect"]);if(K(L0,["tap","vclick"],d,{x:r0[0],y:r0[1]}),N0=!1,d.timeStamp-l0<=$0.multiClickDebounceTime())f0&&clearTimeout(f0),N0=!0,l0=null,K(L0,["dbltap","vdblclick"],d,{x:r0[0],y:r0[1]});else f0=setTimeout(function(){if(N0)return;K(L0,["onetap","voneclick"],d,{x:r0[0],y:r0[1]})},$0.multiClickDebounceTime()),l0=d.timeStamp}if(L0!=null&&!J.dragData.didDrag&&L0._private.selectable&&Q6<J.touchTapThreshold2&&!J.pinching){if($0.selectionType()==="single")$0.$(Z).unmerge(L0).unselect(["tapunselect"]),L0.select(["tapselect"]);else if(L0.selected())L0.unselect(["tapunselect"]);else L0.select(["tapselect"]);J.redrawHint("eles",!0)}J.touchData.singleTouchMoved=!0}for(var B6=0;B6<r0.length;B6++)u0[B6]=r0[B6];if(J.dragData.didDrag=!1,d.touches.length===0)J.touchData.dragDelta=[],J.touchData.startPosition=[null,null,null,null,null,null],J.touchData.startGPosition=null,J.touchData.didSelect=!1;if(d.touches.length<2){if(d.touches.length===1)J.touchData.startGPosition=[d.touches[0].clientX,d.touches[0].clientY];J.pinching=!1,J.redrawHint("eles",!0),J.redraw()}},!1),typeof TouchEvent==="undefined"){var k0=[],_0=function w0(d){return{clientX:d.clientX,clientY:d.clientY,force:1,identifier:d.pointerId,pageX:d.pageX,pageY:d.pageY,radiusX:d.width/2,radiusY:d.height/2,screenX:d.screenX,screenY:d.screenY,target:d.target}},g0=function w0(d){return{event:d,touch:_0(d)}},h0=function w0(d){k0.push(g0(d))},t0=function w0(d){for(var L0=0;L0<k0.length;L0++){var I0=k0[L0];if(I0.event.pointerId===d.pointerId){k0.splice(L0,1);return}}},C0=function w0(d){var L0=k0.filter(function(I0){return I0.event.pointerId===d.pointerId})[0];L0.event=d,L0.touch=_0(d)},y0=function w0(d){d.touches=k0.map(function(L0){return L0.touch})},o=function w0(d){return d.pointerType==="mouse"||d.pointerType===4};J.registerBinding(J.container,"pointerdown",function(w0){if(o(w0))return;w0.preventDefault(),h0(w0),y0(w0),m0(w0)}),J.registerBinding(J.container,"pointerup",function(w0){if(o(w0))return;t0(w0),y0(w0),t(w0)}),J.registerBinding(J.container,"pointercancel",function(w0){if(o(w0))return;t0(w0),y0(w0),z6(w0)}),J.registerBinding(J.container,"pointermove",function(w0){if(o(w0))return;w0.preventDefault(),C0(w0),y0(w0),J0(w0)})}};HW={};HW.generatePolygon=function(J,Q){return this.nodeShapes[J]={renderer:this,name:J,points:Q,draw:function Z(U,K,X,Y,z,G){this.renderer.nodeShapeImpl("polygon",U,K,X,Y,z,this.points)},intersectLine:function Z(U,K,X,Y,z,G,W,H){return Bj(z,G,this.points,U,K,X/2,Y/2,W)},checkPoint:function Z(U,K,X,Y,z,G,W,H){return WW(U,K,this.points,G,W,Y,z,[0,-1],X)},hasMiterBounds:J!=="rectangle",miterBounds:function Z(U,K,X,Y,z,G){return kC6(this.points,U,K,X,Y,z)}}};HW.generateEllipse=function(){return this.nodeShapes.ellipse={renderer:this,name:"ellipse",draw:function J(Q,Z,U,K,X,Y){this.renderer.nodeShapeImpl(this.name,Q,Z,U,K,X)},intersectLine:function J(Q,Z,U,K,X,Y,z,G){return mC6(X,Y,Q,Z,U/2+z,K/2+z)},checkPoint:function J(Q,Z,U,K,X,Y,z,G){return fB(Q,Z,K,X,Y,z,U)}}};HW.generateRoundPolygon=function(J,Q){return this.nodeShapes[J]={renderer:this,name:J,points:Q,getOrCreateCorners:function Z(U,K,X,Y,z,G,W){if(G[W]!==void 0&&G[W+"-cx"]===U&&G[W+"-cy"]===K)return G[W];G[W]=new Array(Q.length/2),G[W+"-cx"]=U,G[W+"-cy"]=K;var H=X/2,q=Y/2;z=z==="auto"?ex0(X,Y):z;var F=new Array(Q.length/2);for(var M=0;M<Q.length/2;M++)F[M]={x:U+H*Q[M*2],y:K+q*Q[M*2+1]};var L,A,I,R,N=F.length;A=F[N-1];for(L=0;L<N;L++)I=F[L%N],R=F[(L+1)%N],G[W][L]=bJ0(A,I,R,z),A=I,I=R;return G[W]},draw:function Z(U,K,X,Y,z,G,W){this.renderer.nodeShapeImpl("round-polygon",U,K,X,Y,z,this.points,this.getOrCreateCorners(K,X,Y,z,G,W,"drawCorners"))},intersectLine:function Z(U,K,X,Y,z,G,W,H,q){return pC6(z,G,this.points,U,K,X,Y,W,this.getOrCreateCorners(U,K,X,Y,H,q,"corners"))},checkPoint:function Z(U,K,X,Y,z,G,W,H,q){return gC6(U,K,this.points,G,W,Y,z,this.getOrCreateCorners(G,W,Y,z,H,q,"corners"))}}};HW.generateRoundRectangle=function(){return this.nodeShapes["round-rectangle"]=this.nodeShapes.roundrectangle={renderer:this,name:"round-rectangle",points:kU(4,0),draw:function J(Q,Z,U,K,X,Y){this.renderer.nodeShapeImpl(this.name,Q,Z,U,K,X,this.points,Y)},intersectLine:function J(Q,Z,U,K,X,Y,z,G){return ox0(X,Y,Q,Z,U,K,z,G)},checkPoint:function J(Q,Z,U,K,X,Y,z,G){var W=K/2,H=X/2;G=G==="auto"?gq(K,X):G,G=Math.min(W,H,G);var q=G*2;if(WW(Q,Z,this.points,Y,z,K,X-q,[0,-1],U))return!0;if(WW(Q,Z,this.points,Y,z,K-q,X,[0,-1],U))return!0;if(fB(Q,Z,q,q,Y-W+G,z-H+G,U))return!0;if(fB(Q,Z,q,q,Y+W-G,z-H+G,U))return!0;if(fB(Q,Z,q,q,Y+W-G,z+H-G,U))return!0;if(fB(Q,Z,q,q,Y-W+G,z+H-G,U))return!0;return!1}}};HW.generateCutRectangle=function(){return this.nodeShapes["cut-rectangle"]=this.nodeShapes.cutrectangle={renderer:this,name:"cut-rectangle",cornerLength:jJ0(),points:kU(4,0),draw:function J(Q,Z,U,K,X,Y){this.renderer.nodeShapeImpl(this.name,Q,Z,U,K,X,null,Y)},generateCutTrianglePts:function J(Q,Z,U,K,X){var Y=X==="auto"?this.cornerLength:X,z=Z/2,G=Q/2,W=U-G,H=U+G,q=K-z,F=K+z;return{topLeft:[W,q+Y,W+Y,q,W+Y,q+Y],topRight:[H-Y,q,H,q+Y,H-Y,q+Y],bottomRight:[H,F-Y,H-Y,F,H-Y,F-Y],bottomLeft:[W+Y,F,W,F-Y,W+Y,F-Y]}},intersectLine:function J(Q,Z,U,K,X,Y,z,G){var W=this.generateCutTrianglePts(U+2*z,K+2*z,Q,Z,G),H=[].concat.apply([],[W.topLeft.splice(0,4),W.topRight.splice(0,4),W.bottomRight.splice(0,4),W.bottomLeft.splice(0,4)]);return Bj(X,Y,H,Q,Z)},checkPoint:function J(Q,Z,U,K,X,Y,z,G){var W=G==="auto"?this.cornerLength:G;if(WW(Q,Z,this.points,Y,z,K,X-2*W,[0,-1],U))return!0;if(WW(Q,Z,this.points,Y,z,K-2*W,X,[0,-1],U))return!0;var H=this.generateCutTrianglePts(K,X,Y,z);return _5(Q,Z,H.topLeft)||_5(Q,Z,H.topRight)||_5(Q,Z,H.bottomRight)||_5(Q,Z,H.bottomLeft)}}};HW.generateBarrel=function(){return this.nodeShapes.barrel={renderer:this,name:"barrel",points:kU(4,0),draw:function J(Q,Z,U,K,X,Y){this.renderer.nodeShapeImpl(this.name,Q,Z,U,K,X)},intersectLine:function J(Q,Z,U,K,X,Y,z,G){var W=0.15,H=0.5,q=0.85,F=this.generateBarrelBezierPts(U+2*z,K+2*z,Q,Z),M=function A(I){var R=uA({x:I[0],y:I[1]},{x:I[2],y:I[3]},{x:I[4],y:I[5]},W),N=uA({x:I[0],y:I[1]},{x:I[2],y:I[3]},{x:I[4],y:I[5]},H),E=uA({x:I[0],y:I[1]},{x:I[2],y:I[3]},{x:I[4],y:I[5]},q);return[I[0],I[1],R.x,R.y,N.x,N.y,E.x,E.y,I[4],I[5]]},L=[].concat(M(F.topLeft),M(F.topRight),M(F.bottomRight),M(F.bottomLeft));return Bj(X,Y,L,Q,Z)},generateBarrelBezierPts:function J(Q,Z,U,K){var X=Z/2,Y=Q/2,z=U-Y,G=U+Y,W=K-X,H=K+X,q=a80(Q,Z),F=q.heightOffset,M=q.widthOffset,L=q.ctrlPtOffsetPct*Q,A={topLeft:[z,W+F,z+L,W,z+M,W],topRight:[G-M,W,G-L,W,G,W+F],bottomRight:[G,H-F,G-L,H,G-M,H],bottomLeft:[z+M,H,z+L,H,z,H-F]};return A.topLeft.isTop=!0,A.topRight.isTop=!0,A.bottomLeft.isBottom=!0,A.bottomRight.isBottom=!0,A},checkPoint:function J(Q,Z,U,K,X,Y,z,G){var W=a80(K,X),H=W.heightOffset,q=W.widthOffset;if(WW(Q,Z,this.points,Y,z,K,X-2*H,[0,-1],U))return!0;if(WW(Q,Z,this.points,Y,z,K-2*q,X,[0,-1],U))return!0;var F=this.generateBarrelBezierPts(K,X,Y,z),M=function C($,b,h){var _=h[4],S=h[2],v=h[0],f=h[5],x=h[1],y=Math.min(_,v),m=Math.max(_,v),g=Math.min(f,x),p=Math.max(f,x);if(y<=$&&$<=m&&g<=b&&b<=p){var i=cC6(_,S,v),l=bC6(i[0],i[1],i[2],$),a=l.filter(function(e){return 0<=e&&e<=1});if(a.length>0)return a[0]}return null},L=Object.keys(F);for(var A=0;A<L.length;A++){var I=L[A],R=F[I],N=M(Q,Z,R);if(N==null)continue;var E=R[5],V=R[3],j=R[1],T=sQ(E,V,j,N);if(R.isTop&&T<=Z)return!0;if(R.isBottom&&Z<=T)return!0}return!1}}};HW.generateBottomRoundrectangle=function(){return this.nodeShapes["bottom-round-rectangle"]=this.nodeShapes.bottomroundrectangle={renderer:this,name:"bottom-round-rectangle",points:kU(4,0),draw:function J(Q,Z,U,K,X,Y){this.renderer.nodeShapeImpl(this.name,Q,Z,U,K,X,this.points,Y)},intersectLine:function J(Q,Z,U,K,X,Y,z,G){var W=Q-(U/2+z),H=Z-(K/2+z),q=H,F=Q+(U/2+z),M=_q(X,Y,Q,Z,W,H,F,q,!1);if(M.length>0)return M;return ox0(X,Y,Q,Z,U,K,z,G)},checkPoint:function J(Q,Z,U,K,X,Y,z,G){G=G==="auto"?gq(K,X):G;var W=2*G;if(WW(Q,Z,this.points,Y,z,K,X-W,[0,-1],U))return!0;if(WW(Q,Z,this.points,Y,z,K-W,X,[0,-1],U))return!0;var H=K/2+2*U,q=X/2+2*U,F=[Y-H,z-q,Y-H,z,Y+H,z,Y+H,z-q];if(_5(Q,Z,F))return!0;if(fB(Q,Z,W,W,Y+K/2-G,z+X/2-G,U))return!0;if(fB(Q,Z,W,W,Y-K/2+G,z+X/2-G,U))return!0;return!1}}};HW.registerNodeShapes=function(){var J=this.nodeShapes={},Q=this;this.generateEllipse(),this.generatePolygon("triangle",kU(3,0)),this.generateRoundPolygon("round-triangle",kU(3,0)),this.generatePolygon("rectangle",kU(4,0)),J.square=J.rectangle,this.generateRoundRectangle(),this.generateCutRectangle(),this.generateBarrel(),this.generateBottomRoundrectangle();{var Z=[0,1,1,0,0,-1,-1,0];this.generatePolygon("diamond",Z),this.generateRoundPolygon("round-diamond",Z)}this.generatePolygon("pentagon",kU(5,0)),this.generateRoundPolygon("round-pentagon",kU(5,0)),this.generatePolygon("hexagon",kU(6,0)),this.generateRoundPolygon("round-hexagon",kU(6,0)),this.generatePolygon("heptagon",kU(7,0)),this.generateRoundPolygon("round-heptagon",kU(7,0)),this.generatePolygon("octagon",kU(8,0)),this.generateRoundPolygon("round-octagon",kU(8,0));var U=new Array(20);{var K=s80(5,0),X=s80(5,Math.PI/5),Y=0.5*(3-Math.sqrt(5));Y*=1.57;for(var z=0;z<X.length/2;z++)X[z*2]*=Y,X[z*2+1]*=Y;for(var z=0;z<5;z++)U[z*4]=K[z*2],U[z*4+1]=K[z*2+1],U[z*4+2]=X[z*2],U[z*4+3]=X[z*2+1]}U=tx0(U),this.generatePolygon("star",U),this.generatePolygon("vee",[-1,-1,0,-0.333,1,-1,0,1]),this.generatePolygon("rhomboid",[-1,-1,0.333,-1,1,1,-0.333,1]),this.generatePolygon("right-rhomboid",[-0.333,-1,1,-1,0.333,1,-1,1]),this.nodeShapes.concavehexagon=this.generatePolygon("concave-hexagon",[-1,-0.95,-0.75,0,-1,0.95,1,0.95,0.75,0,1,-0.95]);{var G=[-1,-1,0.25,-1,1,0,0.25,1,-1,1];this.generatePolygon("tag",G),this.generateRoundPolygon("round-tag",G)}J.makePolygon=function(W){var H=W.join("$"),q="polygon-"+H,F;if(F=this[q])return F;return Q.generatePolygon(q,W)}};Sj={};Sj.timeToRender=function(){return this.redrawTotalTime/this.redrawCount};Sj.redraw=function(J){J=J||rx0();var Q=this;if(Q.averageRedrawTime===void 0)Q.averageRedrawTime=0;if(Q.lastRedrawTime===void 0)Q.lastRedrawTime=0;if(Q.lastDrawTime===void 0)Q.lastDrawTime=0;Q.requestedFrame=!0,Q.renderOptions=J};Sj.beforeRender=function(J,Q){if(this.destroyed)return;if(Q==null)U4("Priority is not optional for beforeRender");var Z=this.beforeRenderCallbacks;Z.push({fn:J,priority:Q}),Z.sort(function(U,K){return K.priority-U.priority})};Sj.startRenderLoop=function(){var J=this,Q=J.cy;if(J.renderLoopStarted)return;else J.renderLoopStarted=!0;var Z=function U(K){if(J.destroyed)return;if(Q.batching());else if(J.requestedFrame&&!J.skipFrame){Fx0(J,!0,K);var X=GW();J.render(J.renderOptions);var Y=J.lastDrawTime=GW();if(J.averageRedrawTime===void 0)J.averageRedrawTime=Y-X;if(J.redrawCount===void 0)J.redrawCount=0;if(J.redrawCount++,J.redrawTotalTime===void 0)J.redrawTotalTime=0;var z=Y-X;J.redrawTotalTime+=z,J.lastRedrawTime=z,J.averageRedrawTime=J.averageRedrawTime/2+z/2,J.requestedFrame=!1}else Fx0(J,!1,K);J.skipFrame=!1,ub(Z)};ub(Z)};eh0=Xk6,eA=eh0.prototype;eA.clientFunctions=["redrawHint","render","renderTo","matchCanvasSize","nodeShapeImpl","arrowShapeImpl"];eA.init=function(J){var Q=this;Q.options=J,Q.cy=J.cy;var Z=Q.container=J.cy.container(),U=Q.cy.window();if(U){var K=U.document,X=K.head,Y="__________cytoscape_stylesheet",z="__________cytoscape_container",G=K.getElementById(Y)!=null;if(Z.className.indexOf(z)<0)Z.className=(Z.className||"")+" "+z;if(!G){var W=K.createElement("style");W.id=Y,W.textContent="."+z+" { position: relative; }",X.insertBefore(W,X.children[0])}var H=U.getComputedStyle(Z),q=H.getPropertyValue("position");if(q==="static")e9("A Cytoscape container has style position:static and so can not use UI extensions properly")}Q.selection=[void 0,void 0,void 0,void 0,0],Q.bezierProjPcts=[0.05,0.225,0.4,0.5,0.6,0.775,0.95],Q.hoverData={down:null,last:null,downTime:null,triggerMode:null,dragging:!1,initialPan:[null,null],capture:!1},Q.dragData={possibleDragElements:[]},Q.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]},Q.redraws=0,Q.showFps=J.showFps,Q.debug=J.debug,Q.webgl=J.webgl,Q.hideEdgesOnViewport=J.hideEdgesOnViewport,Q.textureOnViewport=J.textureOnViewport,Q.wheelSensitivity=J.wheelSensitivity,Q.motionBlurEnabled=J.motionBlur,Q.forcedPixelRatio=A8(J.pixelRatio)?J.pixelRatio:null,Q.motionBlur=J.motionBlur,Q.motionBlurOpacity=J.motionBlurOpacity,Q.motionBlurTransparency=1-Q.motionBlurOpacity,Q.motionBlurPxRatio=1,Q.mbPxRBlurry=1,Q.minMbLowQualFrames=4,Q.fullQualityMb=!1,Q.clearedForMotionBlur=[],Q.desktopTapThreshold=J.desktopTapThreshold,Q.desktopTapThreshold2=J.desktopTapThreshold*J.desktopTapThreshold,Q.touchTapThreshold=J.touchTapThreshold,Q.touchTapThreshold2=J.touchTapThreshold*J.touchTapThreshold,Q.tapholdDuration=500,Q.bindings=[],Q.beforeRenderCallbacks=[],Q.beforeRenderPriorities={animations:400,eleCalcs:300,eleTxrDeq:200,lyrTxrDeq:150,lyrTxrSkip:100},Q.registerNodeShapes(),Q.registerArrowShapes(),Q.registerCalculationListeners()};eA.notify=function(J,Q){var Z=this,U=Z.cy;if(this.destroyed)return;if(J==="init"){Z.load();return}if(J==="destroy"){Z.destroy();return}if(J==="add"||J==="remove"||J==="move"&&U.hasCompoundNodes()||J==="load"||J==="zorder"||J==="mount")Z.invalidateCachedZSortedEles();if(J==="viewport")Z.redrawHint("select",!0);if(J==="gc")Z.redrawHint("gc",!0);if(J==="load"||J==="resize"||J==="mount")Z.invalidateContainerClientCoordsCache(),Z.matchCanvasSize(Z.container);Z.redrawHint("eles",!0),Z.redrawHint("drag",!0),this.startRenderLoop(),this.redraw()};eA.destroy=function(){var J=this;J.destroyed=!0,J.cy.stopAnimationLoop();for(var Q=0;Q<J.bindings.length;Q++){var Z=J.bindings[Q],U=Z,K=U.target;(K.off||K.removeEventListener).apply(K,U.args)}if(J.bindings=[],J.beforeRenderCallbacks=[],J.onUpdateEleCalcsFns=[],J.removeObserver)J.removeObserver.disconnect();if(J.styleObserver)J.styleObserver.disconnect();if(J.resizeObserver)J.resizeObserver.disconnect();if(J.labelCalcDiv)try{document.body.removeChild(J.labelCalcDiv)}catch(X){}};eA.isHeadless=function(){return!1};[_J0,oh0,th0,tA,HW,Sj].forEach(function(J){HJ(eA,J)});Jy0={setupDequeueing:function J(Q){return function Z(){var U=this,K=this.renderer;if(U.dequeueingSetup)return;else U.dequeueingSetup=!0;var X=jj(function(){K.redrawHint("eles",!0),K.redrawHint("drag",!0),K.redraw()},Q.deqRedrawThreshold),Y=function G(W,H){var q=GW(),F=K.averageRedrawTime,M=K.lastRedrawTime,L=[],A=K.cy.extent(),I=K.getPixelRatio();if(!W)K.flushRenderedStyleQueue();while(!0){var R=GW(),N=R-q,E=R-H;if(M<m80){var V=m80-(W?F:0);if(E>=Q.deqFastCost*V)break}else if(W){if(N>=Q.deqCost*M||N>=Q.deqAvgCost*F)break}else if(E>=Q.deqNoDrawCost*m80)break;var j=Q.deq(U,I,A);if(j.length>0)for(var T=0;T<j.length;T++)L.push(j[T]);else break}if(L.length>0){if(Q.onDeqd(U,L),!W&&Q.shouldRedraw(U,L,I,A))X()}},z=Q.priority||RJ0;K.beforeRender(Y,z(U))}}},Yk6=function(){function J(Q){var Z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:pb;cq(this,J),this.idsByKey=new zW,this.keyForId=new zW,this.cachesByLvl=new zW,this.lvls=[],this.getKey=Q,this.doesEleInvalidateKey=Z}return lq(J,[{key:"getIdsFor",value:function Q(Z){if(Z==null)U4("Can not get id list for null key");var U=this.idsByKey,K=this.idsByKey.get(Z);if(!K)K=new nA,U.set(Z,K);return K}},{key:"addIdForKey",value:function Q(Z,U){if(Z!=null)this.getIdsFor(Z).add(U)}},{key:"deleteIdForKey",value:function Q(Z,U){if(Z!=null)this.getIdsFor(Z).delete(U)}},{key:"getNumberOfIdsForKey",value:function Q(Z){if(Z==null)return 0;else return this.getIdsFor(Z).size}},{key:"updateKeyMappingFor",value:function Q(Z){var U=Z.id(),K=this.keyForId.get(U),X=this.getKey(Z);this.deleteIdForKey(K,U),this.addIdForKey(X,U),this.keyForId.set(U,X)}},{key:"deleteKeyMappingFor",value:function Q(Z){var U=Z.id(),K=this.keyForId.get(U);this.deleteIdForKey(K,U),this.keyForId.delete(U)}},{key:"keyHasChangedFor",value:function Q(Z){var U=Z.id(),K=this.keyForId.get(U),X=this.getKey(Z);return K!==X}},{key:"isInvalid",value:function Q(Z){return this.keyHasChangedFor(Z)||this.doesEleInvalidateKey(Z)}},{key:"getCachesAt",value:function Q(Z){var U=this.cachesByLvl,K=this.lvls,X=U.get(Z);if(!X)X=new zW,U.set(Z,X),K.push(Z);return X}},{key:"getCache",value:function Q(Z,U){return this.getCachesAt(U).get(Z)}},{key:"get",value:function Q(Z,U){var K=this.getKey(Z),X=this.getCache(K,U);if(X!=null)this.updateKeyMappingFor(Z);return X}},{key:"getForCachedKey",value:function Q(Z,U){var K=this.keyForId.get(Z.id()),X=this.getCache(K,U);return X}},{key:"hasCache",value:function Q(Z,U){return this.getCachesAt(U).has(Z)}},{key:"has",value:function Q(Z,U){var K=this.getKey(Z);return this.hasCache(K,U)}},{key:"setCache",value:function Q(Z,U,K){K.key=Z,this.getCachesAt(U).set(Z,K)}},{key:"set",value:function Q(Z,U,K){var X=this.getKey(Z);this.setCache(X,U,K),this.updateKeyMappingFor(Z)}},{key:"deleteCache",value:function Q(Z,U){this.getCachesAt(U).delete(Z)}},{key:"delete",value:function Q(Z,U){var K=this.getKey(Z);this.deleteCache(K,U)}},{key:"invalidateKey",value:function Q(Z){var U=this;this.lvls.forEach(function(K){return U.deleteCache(Z,K)})}},{key:"invalidate",value:function Q(Z){var U=Z.id(),K=this.keyForId.get(U);this.deleteKeyMappingFor(Z);var X=this.doesEleInvalidateKey(Z);if(X)this.invalidateKey(K);return X||this.getNumberOfIdsForKey(K)===0}}])}(),mA={dequeue:"dequeue",downscale:"downscale",highQuality:"highQuality"},Nk6=fZ({getKey:null,doesEleInvalidateKey:pb,drawElement:null,getBoundingBox:null,getRotationPoint:null,getRotationOffset:null,isVisible:lx0,allowEdgeTxrCaching:!0,allowParentTxrCaching:!0}),CQ=Xj.prototype;CQ.reasons=mA;CQ.getTextureQueue=function(J){var Q=this;return Q.eleImgCaches=Q.eleImgCaches||{},Q.eleImgCaches[J]=Q.eleImgCaches[J]||[]};CQ.getRetiredTextureQueue=function(J){var Q=this,Z=Q.eleImgCaches.retired=Q.eleImgCaches.retired||{},U=Z[J]=Z[J]||[];return U};CQ.getElementQueue=function(){var J=this,Q=J.eleCacheQueue=J.eleCacheQueue||new Pj(function(Z,U){return U.reqs-Z.reqs});return Q};CQ.getElementKeyToQueue=function(){var J=this,Q=J.eleKeyToCacheQueue=J.eleKeyToCacheQueue||{};return Q};CQ.getElement=function(J,Q,Z,U,K){var X=this,Y=this.renderer,z=Y.cy.zoom(),G=this.lookup;if(!Q||Q.w===0||Q.h===0||isNaN(Q.w)||isNaN(Q.h)||!J.visible()||J.removed())return null;if(!X.allowEdgeTxrCaching&&J.isEdge()||!X.allowParentTxrCaching&&J.isParent())return null;if(U==null)U=Math.ceil(DJ0(z*Z));if(U<hb)U=hb;else if(z>=Qy0||U>WJ0)return null;var W=Math.pow(2,U),H=Q.h*W,q=Q.w*W,F=Y.eleTextBiggerThanMin(J,W);if(!this.isVisible(J,F))return null;var M=G.get(J,U);if(M&&M.invalidated)M.invalidated=!1,M.texture.invalidatedWidth-=M.width;if(M)return M;var L;if(H<=Bx0)L=Bx0;else if(H<=Vb)L=Vb;else L=Math.ceil(H/Vb)*Vb;if(H>Hk6||q>Wk6)return null;var A=X.getTextureQueue(L),I=A[A.length-2],R=function x(){return X.recycleTexture(L,q)||X.addTexture(L,q)};if(!I)I=A[A.length-1];if(!I)I=R();if(I.width-I.usedWidth<q)I=R();var N=function x(y){return y&&y.scaledLabelShown===F},E=K&&K===mA.dequeue,V=K&&K===mA.highQuality,j=K&&K===mA.downscale,T;for(var C=U+1;C<=WJ0;C++){var $=G.get(J,C);if($){T=$;break}}var b=T&&T.level===U+1?T:null,h=function x(){I.context.drawImage(b.texture.canvas,b.x,0,b.width,b.height,I.usedWidth,0,q,H)};if(I.context.setTransform(1,0,0,1,0,0),I.context.clearRect(I.usedWidth,0,q,L),N(b))h();else if(N(T))if(V){for(var _=T.level;_>U;_--)b=X.getElement(J,Q,Z,_,mA.downscale);h()}else return X.queueElement(J,T.level-1),T;else{var S;if(!E&&!V&&!j)for(var v=U-1;v>=hb;v--){var f=G.get(J,v);if(f){S=f;break}}if(N(S))return X.queueElement(J,U),S;I.context.translate(I.usedWidth,0),I.context.scale(W,W),this.drawElement(I.context,J,Q,F,!1),I.context.scale(1/W,1/W),I.context.translate(-I.usedWidth,0)}return M={x:I.usedWidth,texture:I,level:U,scale:W,width:q,height:H,scaledLabelShown:F},I.usedWidth+=Math.ceil(q+zk6),I.eleCaches.push(M),G.set(J,U,M),X.checkTextureFullness(I),M};CQ.invalidateElements=function(J){for(var Q=0;Q<J.length;Q++)this.invalidateElement(J[Q])};CQ.invalidateElement=function(J){var Q=this,Z=Q.lookup,U=[],K=Z.isInvalid(J);if(!K)return;for(var X=hb;X<=WJ0;X++){var Y=Z.getForCachedKey(J,X);if(Y)U.push(Y)}var z=Z.invalidate(J);if(z)for(var G=0;G<U.length;G++){var W=U[G],H=W.texture;H.invalidatedWidth+=W.width,W.invalidated=!0,Q.checkTextureUtility(H)}Q.removeFromQueue(J)};CQ.checkTextureUtility=function(J){if(J.invalidatedWidth>=qk6*J.width)this.retireTexture(J)};CQ.checkTextureFullness=function(J){var Q=this,Z=Q.getTextureQueue(J.height);if(J.usedWidth/J.width>Fk6&&J.fullnessChecks>=Bk6)yq(Z,J);else J.fullnessChecks++};CQ.retireTexture=function(J){var Q=this,Z=J.height,U=Q.getTextureQueue(Z),K=this.lookup;yq(U,J),J.retired=!0;var X=J.eleCaches;for(var Y=0;Y<X.length;Y++){var z=X[Y];K.deleteCache(z.key,z.level)}NJ0(X);var G=Q.getRetiredTextureQueue(Z);G.push(J)};CQ.addTexture=function(J,Q){var Z=this,U=Z.getTextureQueue(J),K={};return U.push(K),K.eleCaches=[],K.height=J,K.width=Math.max(Gk6,Q),K.usedWidth=0,K.invalidatedWidth=0,K.fullnessChecks=0,K.canvas=Z.renderer.makeOffscreenCanvas(K.width,K.height),K.context=K.canvas.getContext("2d"),K};CQ.recycleTexture=function(J,Q){var Z=this,U=Z.getTextureQueue(J),K=Z.getRetiredTextureQueue(J);for(var X=0;X<K.length;X++){var Y=K[X];if(Y.width>=Q)return Y.retired=!1,Y.usedWidth=0,Y.invalidatedWidth=0,Y.fullnessChecks=0,NJ0(Y.eleCaches),Y.context.setTransform(1,0,0,1,0,0),Y.context.clearRect(0,0,Y.width,Y.height),yq(K,Y),U.push(Y),Y}};CQ.queueElement=function(J,Q){var Z=this,U=Z.getElementQueue(),K=Z.getElementKeyToQueue(),X=this.getKey(J),Y=K[X];if(Y)Y.level=Math.max(Y.level,Q),Y.eles.merge(J),Y.reqs++,U.updateItem(Y);else{var z={eles:J.spawn().merge(J),level:Q,reqs:1,key:X};U.push(z),K[X]=z}};CQ.dequeue=function(J){var Q=this,Z=Q.getElementQueue(),U=Q.getElementKeyToQueue(),K=[],X=Q.lookup;for(var Y=0;Y<Rk6;Y++)if(Z.size()>0){var z=Z.pop(),G=z.key,W=z.eles[0],H=X.hasCache(W,z.level);if(U[G]=null,H)continue;K.push(z);var q=Q.getBoundingBox(W);Q.getElement(W,q,J,z.level,mA.dequeue)}else break;return K};CQ.removeFromQueue=function(J){var Q=this,Z=Q.getElementQueue(),U=Q.getElementKeyToQueue(),K=this.getKey(J),X=U[K];if(X!=null)if(X.eles.length===1)X.reqs=IJ0,Z.updateItem(X),Z.pop(),U[K]=null;else X.eles.unmerge(J)};CQ.onDequeue=function(J){this.onDequeues.push(J)};CQ.offDequeue=function(J){yq(this.onDequeues,J)};CQ.setupDequeueing=Jy0.setupDequeueing({deqRedrawThreshold:Ik6,deqCost:Mk6,deqAvgCost:Ok6,deqNoDrawCost:Lk6,deqFastCost:Ak6,deq:function J(Q,Z,U){return Q.dequeue(Z,U)},onDeqd:function J(Q,Z){for(var U=0;U<Q.onDequeues.length;U++){var K=Q.onDequeues[U];K(Z)}},shouldRedraw:function J(Q,Z,U,K){for(var X=0;X<Z.length;X++){var Y=Z[X].eles;for(var z=0;z<Y.length;z++){var G=Y[z].boundingBox();if(EJ0(G,K))return!0}}return!1},priority:function J(Q){return Q.renderer.beforeRenderPriorities.eleTxrDeq}});_Z=Zy0.prototype,kk6=Math.pow(2,53)-1;_Z.makeLayer=function(J,Q){var Z=Math.pow(2,Q),U=Math.ceil(J.w*Z),K=Math.ceil(J.h*Z),X=this.renderer.makeOffscreenCanvas(U,K),Y={id:Lx0=++Lx0%kk6,bb:J,level:Q,width:U,height:K,canvas:X,context:X.getContext("2d"),eles:[],elesQueue:[],reqs:0},z=Y.context,G=-Y.bb.x1,W=-Y.bb.y1;return z.scale(Z,Z),z.translate(G,W),Y};_Z.getLayers=function(J,Q,Z){var U=this,K=U.renderer,X=K.cy,Y=X.zoom(),z=U.firstGet;if(U.firstGet=!1,Z==null){if(Z=Math.ceil(DJ0(Y*Q)),Z<zj)Z=zj;else if(Y>=wk6||Z>ab)return null}U.validateLayersElesOrdering(Z,J);var G=U.layersByLevel,W=Math.pow(2,Z),H=G[Z]=G[Z]||[],q,F=U.levelIsComplete(Z,J),M,L=function b(){var h=function f(x){if(U.validateLayersElesOrdering(x,J),U.levelIsComplete(x,J))return M=G[x],!0},_=function f(x){if(M)return;for(var y=Z+x;zj<=y&&y<=ab;y+=x)if(h(y))break};_(1),_(-1);for(var S=H.length-1;S>=0;S--){var v=H[S];if(v.invalid)yq(H,v)}};if(!F)L();else return H;var A=function b(){if(!q){q=fU();for(var h=0;h<J.length;h++)SC6(q,J[h].boundingBox())}return q},I=function b(h){h=h||{};var _=h.after;A();var S=Math.ceil(q.w*W),v=Math.ceil(q.h*W);if(S>Ox0||v>Ox0)return null;var f=S*v;if(f>$k6)return null;var x=U.makeLayer(q,Z);if(_!=null){var y=H.indexOf(_)+1;H.splice(y,0,x)}else if(h.insert===void 0||h.insert)H.unshift(x);return x};if(U.skipping&&!z)return null;var R=null,N=J.length/Dk6,E=!z;for(var V=0;V<J.length;V++){var j=J[V],T=j._private.rscratch,C=T.imgLayerCaches=T.imgLayerCaches||{},$=C[Z];if($){R=$;continue}if(!R||R.eles.length>=N||!ax0(R.bb,j.boundingBox())){if(R=I({insert:!0,after:R}),!R)return null}if(M||E)U.queueLayer(R,j);else U.drawEleInLayer(R,j,Z,Q);R.eles.push(j),C[Z]=R}if(M)return M;if(E)return null;return H};_Z.getEleLevelForLayerLevel=function(J,Q){return J};_Z.drawEleInLayer=function(J,Q,Z,U){var K=this,X=this.renderer,Y=J.context,z=Q.boundingBox();if(z.w===0||z.h===0||!Q.visible())return;Z=K.getEleLevelForLayerLevel(Z,U),X.setImgSmoothing(Y,!1),X.drawCachedElement(Y,Q,null,null,Z,vk6),X.setImgSmoothing(Y,!0)};_Z.levelIsComplete=function(J,Q){var Z=this,U=Z.layersByLevel[J];if(!U||U.length===0)return!1;var K=0;for(var X=0;X<U.length;X++){var Y=U[X];if(Y.reqs>0)return!1;if(Y.invalid)return!1;K+=Y.eles.length}if(K!==Q.length)return!1;return!0};_Z.validateLayersElesOrdering=function(J,Q){var Z=this.layersByLevel[J];if(!Z)return;for(var U=0;U<Z.length;U++){var K=Z[U],X=-1;for(var Y=0;Y<Q.length;Y++)if(K.eles[0]===Q[Y]){X=Y;break}if(X<0){this.invalidateLayer(K);continue}var z=X;for(var Y=0;Y<K.eles.length;Y++)if(K.eles[Y]!==Q[z+Y]){this.invalidateLayer(K);break}}};_Z.updateElementsInLayers=function(J,Q){var Z=this,U=Nj(J[0]);for(var K=0;K<J.length;K++){var X=U?null:J[K],Y=U?J[K]:J[K].ele,z=Y._private.rscratch,G=z.imgLayerCaches=z.imgLayerCaches||{};for(var W=zj;W<=ab;W++){var H=G[W];if(!H)continue;if(X&&Z.getEleLevelForLayerLevel(H.level)!==X.level)continue;Q(H,Y,X)}}};_Z.haveLayers=function(){var J=this,Q=!1;for(var Z=zj;Z<=ab;Z++){var U=J.layersByLevel[Z];if(U&&U.length>0){Q=!0;break}}return Q};_Z.invalidateElements=function(J){var Q=this;if(J.length===0)return;if(Q.lastInvalidationTime=GW(),J.length===0||!Q.haveLayers())return;Q.updateElementsInLayers(J,function Z(U,K,X){Q.invalidateLayer(U)})};_Z.invalidateLayer=function(J){if(this.lastInvalidationTime=GW(),J.invalid)return;var{level:Q,eles:Z}=J,U=this.layersByLevel[Q];if(yq(U,J),J.elesQueue=[],J.invalid=!0,J.replacement)J.replacement.invalid=!0;for(var K=0;K<Z.length;K++){var X=Z[K]._private.rscratch.imgLayerCaches;if(X)X[Q]=null}};_Z.refineElementTextures=function(J){var Q=this;Q.updateElementsInLayers(J,function Z(U,K,X){var Y=U.replacement;if(!Y)Y=U.replacement=Q.makeLayer(U.bb,U.level),Y.replaces=U,Y.eles=U.eles;if(!Y.reqs)for(var z=0;z<Y.eles.length;z++)Q.queueLayer(Y,Y.eles[z])})};_Z.enqueueElementRefinement=function(J){this.eleTxrDeqs.merge(J),this.scheduleElementRefinement()};_Z.queueLayer=function(J,Q){var Z=this,U=Z.layersQueue,K=J.elesQueue,X=K.hasId=K.hasId||{};if(J.replacement)return;if(Q){if(X[Q.id()])return;K.push(Q),X[Q.id()]=!0}if(J.reqs)J.reqs++,U.updateItem(J);else J.reqs=1,U.push(J)};_Z.dequeue=function(J){var Q=this,Z=Q.layersQueue,U=[],K=0;while(K<Sk6){if(Z.size()===0)break;var X=Z.peek();if(X.replacement){Z.pop();continue}if(X.replaces&&X!==X.replaces.replacement){Z.pop();continue}if(X.invalid){Z.pop();continue}var Y=X.elesQueue.shift();if(Y)Q.drawEleInLayer(X,Y,X.level,J),K++;if(U.length===0)U.push(!0);if(X.elesQueue.length===0){if(Z.pop(),X.reqs=0,X.replaces)Q.applyLayerReplacement(X);Q.requestRedraw()}}return U};_Z.applyLayerReplacement=function(J){var Q=this,Z=Q.layersByLevel[J.level],U=J.replaces,K=Z.indexOf(U);if(K<0||U.invalid)return;Z[K]=J;for(var X=0;X<J.eles.length;X++){var Y=J.eles[X]._private,z=Y.imgLayerCaches=Y.imgLayerCaches||{};if(z)z[J.level]=J}Q.requestRedraw()};_Z.requestRedraw=jj(function(){var J=this.renderer;J.redrawHint("eles",!0),J.redrawHint("drag",!0),J.redraw()},100);_Z.setupDequeueing=Jy0.setupDequeueing({deqRedrawThreshold:Ek6,deqCost:Pk6,deqAvgCost:Vk6,deqNoDrawCost:Tk6,deqFastCost:Ck6,deq:function J(Q,Z){return Q.dequeue(Z)},onDeqd:RJ0,shouldRedraw:lx0,priority:function J(Q){return Q.renderer.beforeRenderPriorities.lyrTxrDeq}});Uy0={};Uy0.arrowShapeImpl=function(J){return(Ax0||(Ax0={polygon:fk6,"triangle-backcurve":_k6,"triangle-tee":Ix0,"circle-triangle":bk6,"triangle-cross":Ix0,circle:xk6}))[J]};Nz={};Nz.drawElement=function(J,Q,Z,U,K,X){var Y=this;if(Q.isNode())Y.drawNode(J,Q,Z,U,K,X);else Y.drawEdge(J,Q,Z,U,K,X)};Nz.drawElementOverlay=function(J,Q){var Z=this;if(Q.isNode())Z.drawNodeOverlay(J,Q);else Z.drawEdgeOverlay(J,Q)};Nz.drawElementUnderlay=function(J,Q){var Z=this;if(Q.isNode())Z.drawNodeUnderlay(J,Q);else Z.drawEdgeUnderlay(J,Q)};Nz.drawCachedElementPortion=function(J,Q,Z,U,K,X,Y,z){var G=this,W=Z.getBoundingBox(Q);if(W.w===0||W.h===0)return;var H=Z.getElement(Q,W,U,K,X);if(H!=null){var q=z(G,Q);if(q===0)return;var F=Y(G,Q),M=W.x1,L=W.y1,A=W.w,I=W.h,R,N,E,V,j;if(F!==0){var T=Z.getRotationPoint(Q);if(E=T.x,V=T.y,J.translate(E,V),J.rotate(F),j=G.getImgSmoothing(J),!j)G.setImgSmoothing(J,!0);var C=Z.getRotationOffset(Q);R=C.x,N=C.y}else R=M,N=L;var $;if(q!==1)$=J.globalAlpha,J.globalAlpha=$*q;if(J.drawImage(H.texture.canvas,H.x,0,H.width,H.height,R,N,A,I),q!==1)J.globalAlpha=$;if(F!==0){if(J.rotate(-F),J.translate(-E,-V),!j)G.setImgSmoothing(J,!1)}}else Z.drawElement(J,Q)};Nz.drawCachedElement=function(J,Q,Z,U,K,X){var Y=this,z=Y.data,G=z.eleTxrCache,W=z.lblTxrCache,H=z.slbTxrCache,q=z.tlbTxrCache,F=Q.boundingBox(),M=X===!0?G.reasons.highQuality:null;if(F.w===0||F.h===0||!Q.visible())return;if(!U||EJ0(F,U)){var L=Q.isEdge(),A=Q.element()._private.rscratch.badLine;if(Y.drawElementUnderlay(J,Q),Y.drawCachedElementPortion(J,Q,G,Z,K,M,hk6,uk6),!L||!A)Y.drawCachedElementPortion(J,Q,W,Z,K,M,yk6,u80);if(L&&!A)Y.drawCachedElementPortion(J,Q,H,Z,K,M,gk6,u80),Y.drawCachedElementPortion(J,Q,q,Z,K,M,mk6,u80);Y.drawElementOverlay(J,Q)}};Nz.drawElements=function(J,Q){var Z=this;for(var U=0;U<Q.length;U++){var K=Q[U];Z.drawElement(J,K)}};Nz.drawCachedElements=function(J,Q,Z,U){var K=this;for(var X=0;X<Q.length;X++){var Y=Q[X];K.drawCachedElement(J,Y,Z,U)}};Nz.drawCachedNodes=function(J,Q,Z,U){var K=this;for(var X=0;X<Q.length;X++){var Y=Q[X];if(!Y.isNode())continue;K.drawCachedElement(J,Y,Z,U)}};Nz.drawLayeredElements=function(J,Q,Z,U){var K=this,X=K.data.lyrTxrCache.getLayers(Q,Z);if(X)for(var Y=0;Y<X.length;Y++){var z=X[Y],G=z.bb;if(G.w===0||G.h===0)continue;J.drawImage(z.canvas,G.x1,G.y1,G.w,G.h)}else K.drawCachedElements(J,Q,Z,U)};qW={};qW.drawEdge=function(J,Q,Z){var U=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,K=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,X=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,Y=this,z=Q._private.rscratch;if(X&&!Q.visible())return;if(z.badLine||z.allpts==null||isNaN(z.allpts[0]))return;var G;if(Z)G=Z,J.translate(-G.x1,-G.y1);var W=X?Q.pstyle("opacity").value:1,H=X?Q.pstyle("line-opacity").value:1,q=Q.pstyle("curve-style").value,F=Q.pstyle("line-style").value,M=Q.pstyle("width").pfValue,L=Q.pstyle("line-cap").value,A=Q.pstyle("line-outline-width").value,I=Q.pstyle("line-outline-color").value,R=W*H,N=W*H,E=function f(){var x=arguments.length>0&&arguments[0]!==void 0?arguments[0]:R;if(q==="straight-triangle")Y.eleStrokeStyle(J,Q,x),Y.drawEdgeTrianglePath(Q,J,z.allpts);else J.lineWidth=M,J.lineCap=L,Y.eleStrokeStyle(J,Q,x),Y.drawEdgePath(Q,J,z.allpts,F),J.lineCap="butt"},V=function f(){var x=arguments.length>0&&arguments[0]!==void 0?arguments[0]:R;if(J.lineWidth=M+A,J.lineCap=L,A>0)Y.colorStrokeStyle(J,I[0],I[1],I[2],x);else{J.lineCap="butt";return}if(q==="straight-triangle")Y.drawEdgeTrianglePath(Q,J,z.allpts);else Y.drawEdgePath(Q,J,z.allpts,F),J.lineCap="butt"},j=function f(){if(!K)return;Y.drawEdgeOverlay(J,Q)},T=function f(){if(!K)return;Y.drawEdgeUnderlay(J,Q)},C=function f(){var x=arguments.length>0&&arguments[0]!==void 0?arguments[0]:N;Y.drawArrowheads(J,Q,x)},$=function f(){Y.drawElementText(J,Q,null,U)};J.lineJoin="round";var b=Q.pstyle("ghost").value==="yes";if(b){var h=Q.pstyle("ghost-offset-x").pfValue,_=Q.pstyle("ghost-offset-y").pfValue,S=Q.pstyle("ghost-opacity").value,v=R*S;J.translate(h,_),E(v),C(v),J.translate(-h,-_)}else V();if(T(),E(),C(),j(),$(),Z)J.translate(G.x1,G.y1)};qW.drawEdgeOverlay=Ky0("overlay");qW.drawEdgeUnderlay=Ky0("underlay");qW.drawEdgePath=function(J,Q,Z,U){var K=J._private.rscratch,X=Q,Y,z=!1,G=this.usePaths(),W=J.pstyle("line-dash-pattern").pfValue,H=J.pstyle("line-dash-offset").pfValue;if(G){var q=Z.join("$"),F=K.pathCacheKey&&K.pathCacheKey===q;if(F)Y=Q=K.pathCache,z=!0;else Y=Q=new Path2D,K.pathCacheKey=q,K.pathCache=Y}if(X.setLineDash)switch(U){case"dotted":X.setLineDash([1,1]);break;case"dashed":X.setLineDash(W),X.lineDashOffset=H;break;case"solid":X.setLineDash([]);break}if(!z&&!K.badLine){if(Q.beginPath)Q.beginPath();switch(Q.moveTo(Z[0],Z[1]),K.edgeType){case"bezier":case"self":case"compound":case"multibezier":for(var M=2;M+3<Z.length;M+=4)Q.quadraticCurveTo(Z[M],Z[M+1],Z[M+2],Z[M+3]);break;case"straight":case"haystack":for(var L=2;L+1<Z.length;L+=2)Q.lineTo(Z[L],Z[L+1]);break;case"segments":if(K.isRound){var A=b5(K.roundCorners),I;try{for(A.s();!(I=A.n()).done;){var R=I.value;ih0(Q,R)}}catch(E){A.e(E)}finally{A.f()}Q.lineTo(Z[Z.length-2],Z[Z.length-1])}else for(var N=2;N+1<Z.length;N+=2)Q.lineTo(Z[N],Z[N+1]);break}}if(Q=X,G)Q.stroke(Y);else Q.stroke();if(Q.setLineDash)Q.setLineDash([])};qW.drawEdgeTrianglePath=function(J,Q,Z){Q.fillStyle=Q.strokeStyle;var U=J.pstyle("width").pfValue;for(var K=0;K+1<Z.length;K+=2){var X=[Z[K+2]-Z[K],Z[K+3]-Z[K+1]],Y=Math.sqrt(X[0]*X[0]+X[1]*X[1]),z=[X[1]/Y,-X[0]/Y],G=[z[0]*U/2,z[1]*U/2];Q.beginPath(),Q.moveTo(Z[K]-G[0],Z[K+1]-G[1]),Q.lineTo(Z[K]+G[0],Z[K+1]+G[1]),Q.lineTo(Z[K+2],Z[K+3]),Q.closePath(),Q.fill()}};qW.drawArrowheads=function(J,Q,Z){var U=Q._private.rscratch,K=U.edgeType==="haystack";if(!K)this.drawArrowhead(J,Q,"source",U.arrowStartX,U.arrowStartY,U.srcArrowAngle,Z);if(this.drawArrowhead(J,Q,"mid-target",U.midX,U.midY,U.midtgtArrowAngle,Z),this.drawArrowhead(J,Q,"mid-source",U.midX,U.midY,U.midsrcArrowAngle,Z),!K)this.drawArrowhead(J,Q,"target",U.arrowEndX,U.arrowEndY,U.tgtArrowAngle,Z)};qW.drawArrowhead=function(J,Q,Z,U,K,X,Y){if(isNaN(U)||U==null||isNaN(K)||K==null||isNaN(X)||X==null)return;var z=this,G=Q.pstyle(Z+"-arrow-shape").value;if(G==="none")return;var W=Q.pstyle(Z+"-arrow-fill").value==="hollow"?"both":"filled",H=Q.pstyle(Z+"-arrow-fill").value,q=Q.pstyle("width").pfValue,F=Q.pstyle(Z+"-arrow-width"),M=F.value==="match-line"?q:F.pfValue;if(F.units==="%")M*=q;var L=Q.pstyle("opacity").value;if(Y===void 0)Y=L;var A=J.globalCompositeOperation;if(Y!==1||H==="hollow")J.globalCompositeOperation="destination-out",z.colorFillStyle(J,255,255,255,1),z.colorStrokeStyle(J,255,255,255,1),z.drawArrowShape(Q,J,W,q,G,M,U,K,X),J.globalCompositeOperation=A;var I=Q.pstyle(Z+"-arrow-color").value;z.colorFillStyle(J,I[0],I[1],I[2],Y),z.colorStrokeStyle(J,I[0],I[1],I[2],Y),z.drawArrowShape(Q,J,H,q,G,M,U,K,X)};qW.drawArrowShape=function(J,Q,Z,U,K,X,Y,z,G){var W=this,H=this.usePaths()&&K!=="triangle-cross",q=!1,F,M=Q,L={x:Y,y:z},A=J.pstyle("arrow-scale").value,I=this.getArrowWidth(U,A),R=W.arrowShapes[K];if(H){var N=W.arrowPathCache=W.arrowPathCache||[],E=_B(K),V=N[E];if(V!=null)F=Q=V,q=!0;else F=Q=new Path2D,N[E]=F}if(!q){if(Q.beginPath)Q.beginPath();if(H)R.draw(Q,1,0,{x:0,y:0},1);else R.draw(Q,I,G,L,U);if(Q.closePath)Q.closePath()}if(Q=M,H)Q.translate(Y,z),Q.rotate(G),Q.scale(I,I);if(Z==="filled"||Z==="both")if(H)Q.fill(F);else Q.fill();if(Z==="hollow"||Z==="both")if(Q.lineWidth=X/(H?I:1),Q.lineJoin="miter",H)Q.stroke(F);else Q.stroke();if(H)Q.scale(1/I,1/I),Q.rotate(-G),Q.translate(-Y,-z)};hJ0={};hJ0.safeDrawImage=function(J,Q,Z,U,K,X,Y,z,G,W){if(K<=0||X<=0||G<=0||W<=0)return;try{J.drawImage(Q,Z,U,K,X,Y,z,G,W)}catch(H){e9(H)}};hJ0.drawInscribedImage=function(J,Q,Z,U,K){var X=this,Y=Z.position(),z=Y.x,G=Y.y,W=Z.cy().style(),H=W.getIndexedStyle.bind(W),q=H(Z,"background-fit","value",U),F=H(Z,"background-repeat","value",U),M=Z.width(),L=Z.height(),A=Z.padding()*2,I=M+(H(Z,"background-width-relative-to","value",U)==="inner"?0:A),R=L+(H(Z,"background-height-relative-to","value",U)==="inner"?0:A),N=Z._private.rscratch,E=H(Z,"background-clip","value",U),V=E==="node",j=H(Z,"background-image-opacity","value",U)*K,T=H(Z,"background-image-smoothing","value",U),C=Z.pstyle("corner-radius").value;if(C!=="auto")C=Z.pstyle("corner-radius").pfValue;var $=Q.width||Q.cachedW,b=Q.height||Q.cachedH;if($==null||b==null)document.body.appendChild(Q),$=Q.cachedW=Q.width||Q.offsetWidth,b=Q.cachedH=Q.height||Q.offsetHeight,document.body.removeChild(Q);var h=$,_=b;if(H(Z,"background-width","value",U)!=="auto")if(H(Z,"background-width","units",U)==="%")h=H(Z,"background-width","pfValue",U)*I;else h=H(Z,"background-width","pfValue",U);if(H(Z,"background-height","value",U)!=="auto")if(H(Z,"background-height","units",U)==="%")_=H(Z,"background-height","pfValue",U)*R;else _=H(Z,"background-height","pfValue",U);if(h===0||_===0)return;if(q==="contain"){var S=Math.min(I/h,R/_);h*=S,_*=S}else if(q==="cover"){var S=Math.max(I/h,R/_);h*=S,_*=S}var v=z-I/2,f=H(Z,"background-position-x","units",U),x=H(Z,"background-position-x","pfValue",U);if(f==="%")v+=(I-h)*x;else v+=x;var y=H(Z,"background-offset-x","units",U),m=H(Z,"background-offset-x","pfValue",U);if(y==="%")v+=(I-h)*m;else v+=m;var g=G-R/2,p=H(Z,"background-position-y","units",U),i=H(Z,"background-position-y","pfValue",U);if(p==="%")g+=(R-_)*i;else g+=i;var l=H(Z,"background-offset-y","units",U),a=H(Z,"background-offset-y","pfValue",U);if(l==="%")g+=(R-_)*a;else g+=a;if(N.pathCache)v-=z,g-=G,z=0,G=0;var e=J.globalAlpha;J.globalAlpha=j;var G0=X.getImgSmoothing(J),U0=!1;if(T==="no"&&G0)X.setImgSmoothing(J,!1),U0=!0;else if(T==="yes"&&!G0)X.setImgSmoothing(J,!0),U0=!0;if(F==="no-repeat"){if(V)if(J.save(),N.pathCache)J.clip(N.pathCache);else X.nodeShapes[X.getNodeShape(Z)].draw(J,z,G,I,R,C,N),J.clip();if(X.safeDrawImage(J,Q,0,0,$,b,v,g,h,_),V)J.restore()}else{var O0=J.createPattern(Q,F);J.fillStyle=O0,X.nodeShapes[X.getNodeShape(Z)].draw(J,z,G,I,R,C,N),J.translate(v,g),J.fill(),J.translate(-v,-g)}if(J.globalAlpha=e,U0)X.setImgSmoothing(J,G0)};mB={};mB.eleTextBiggerThanMin=function(J,Q){if(!Q){var Z=J.cy().zoom(),U=this.getPixelRatio(),K=Math.ceil(DJ0(Z*U));Q=Math.pow(2,K)}var X=J.pstyle("font-size").pfValue*Q,Y=J.pstyle("min-zoomed-font-size").pfValue;if(X<Y)return!1;return!0};mB.drawElementText=function(J,Q,Z,U,K){var X=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,Y=this;if(U==null){if(X&&!Y.eleTextBiggerThanMin(Q))return}else if(U===!1)return;if(Q.isNode()){var z=Q.pstyle("label");if(!z||!z.value)return;var G=Y.getLabelJustification(Q);J.textAlign=G,J.textBaseline="bottom"}else{var W=Q.element()._private.rscratch.badLine,H=Q.pstyle("label"),q=Q.pstyle("source-label"),F=Q.pstyle("target-label");if(W||(!H||!H.value)&&(!q||!q.value)&&(!F||!F.value))return;J.textAlign="center",J.textBaseline="bottom"}var M=!Z,L;if(Z)L=Z,J.translate(-L.x1,-L.y1);if(K==null){if(Y.drawText(J,Q,null,M,X),Q.isEdge())Y.drawText(J,Q,"source",M,X),Y.drawText(J,Q,"target",M,X)}else Y.drawText(J,Q,K,M,X);if(Z)J.translate(L.x1,L.y1)};mB.getFontCache=function(J){var Q;this.fontCaches=this.fontCaches||[];for(var Z=0;Z<this.fontCaches.length;Z++)if(Q=this.fontCaches[Z],Q.context===J)return Q;return Q={context:J},this.fontCaches.push(Q),Q};mB.setupTextStyle=function(J,Q){var Z=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,U=Q.pstyle("font-style").strValue,K=Q.pstyle("font-size").pfValue+"px",X=Q.pstyle("font-family").strValue,Y=Q.pstyle("font-weight").strValue,z=Z?Q.effectiveOpacity()*Q.pstyle("text-opacity").value:1,G=Q.pstyle("text-outline-opacity").value*z,W=Q.pstyle("color").value,H=Q.pstyle("text-outline-color").value;J.font=U+" "+Y+" "+K+" "+X,J.lineJoin="round",this.colorFillStyle(J,W[0],W[1],W[2],z),this.colorStrokeStyle(J,H[0],H[1],H[2],G)};mB.getTextAngle=function(J,Q){var Z,U=J._private,K=U.rscratch,X=Q?Q+"-":"",Y=J.pstyle(X+"text-rotation");if(Y.strValue==="autorotate"){var z=f5(K,"labelAngle",Q);Z=J.isEdge()?z:0}else if(Y.strValue==="none")Z=0;else Z=Y.pfValue;return Z};mB.drawText=function(J,Q,Z){var U=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,K=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,X=Q._private,Y=X.rscratch,z=K?Q.effectiveOpacity():1;if(K&&(z===0||Q.pstyle("text-opacity").value===0))return;if(Z==="main")Z=null;var G=f5(Y,"labelX",Z),W=f5(Y,"labelY",Z),H,q,F=this.getLabelText(Q,Z);if(F!=null&&F!==""&&!isNaN(G)&&!isNaN(W)){this.setupTextStyle(J,Q,K);var M=Z?Z+"-":"",L=f5(Y,"labelWidth",Z),A=f5(Y,"labelHeight",Z),I=Q.pstyle(M+"text-margin-x").pfValue,R=Q.pstyle(M+"text-margin-y").pfValue,N=Q.isEdge(),E=Q.pstyle("text-halign").value,V=Q.pstyle("text-valign").value;if(N)E="center",V="center";G+=I,W+=R;var j;if(!U)j=0;else j=this.getTextAngle(Q,Z);if(j!==0)H=G,q=W,J.translate(H,q),J.rotate(j),G=0,W=0;switch(V){case"top":break;case"center":W+=A/2;break;case"bottom":W+=A;break}var T=Q.pstyle("text-background-opacity").value,C=Q.pstyle("text-border-opacity").value,$=Q.pstyle("text-border-width").pfValue,b=Q.pstyle("text-background-padding").pfValue,h=Q.pstyle("text-background-shape").strValue,_=h==="round-rectangle"||h==="roundrectangle",S=h==="circle",v=2;if(T>0||$>0&&C>0){var{fillStyle:f,strokeStyle:x,lineWidth:y}=J,m=Q.pstyle("text-background-color").value,g=Q.pstyle("text-border-color").value,p=Q.pstyle("text-border-style").value,i=T>0,l=$>0&&C>0,a=G-b;switch(E){case"left":a-=L;break;case"center":a-=L/2;break}var e=W-A-b,G0=L+2*b,U0=A+2*b;if(i)J.fillStyle="rgba(".concat(m[0],",").concat(m[1],",").concat(m[2],",").concat(T*z,")");if(l){if(J.strokeStyle="rgba(".concat(g[0],",").concat(g[1],",").concat(g[2],",").concat(C*z,")"),J.lineWidth=$,J.setLineDash)switch(p){case"dotted":J.setLineDash([1,1]);break;case"dashed":J.setLineDash([4,2]);break;case"double":J.lineWidth=$/4,J.setLineDash([]);break;case"solid":default:J.setLineDash([]);break}}if(_)J.beginPath(),Rx0(J,a,e,G0,U0,v);else if(S)J.beginPath(),pk6(J,a,e,G0,U0);else J.beginPath(),J.rect(a,e,G0,U0);if(i)J.fill();if(l)J.stroke();if(l&&p==="double"){var O0=$/2;if(J.beginPath(),_)Rx0(J,a+O0,e+O0,G0-2*O0,U0-2*O0,v);else J.rect(a+O0,e+O0,G0-2*O0,U0-2*O0);J.stroke()}if(J.fillStyle=f,J.strokeStyle=x,J.lineWidth=y,J.setLineDash)J.setLineDash([])}var X0=2*Q.pstyle("text-outline-width").pfValue;if(X0>0)J.lineWidth=X0;if(Q.pstyle("text-wrap").value==="wrap"){var E0=f5(Y,"labelWrapCachedLines",Z),W0=f5(Y,"labelLineHeight",Z),q0=L/2,z0=this.getLabelJustification(Q);if(z0==="auto");else if(E==="left"){if(z0==="left")G+=-L;else if(z0==="center")G+=-q0}else if(E==="center"){if(z0==="left")G+=-q0;else if(z0==="right")G+=q0}else if(E==="right"){if(z0==="center")G+=q0;else if(z0==="right")G+=L}switch(V){case"top":W-=(E0.length-1)*W0;break;case"center":case"bottom":W-=(E0.length-1)*W0;break}for(var K0=0;K0<E0.length;K0++){if(X0>0)J.strokeText(E0[K0],G,W);J.fillText(E0[K0],G,W),W+=W0}}else{if(X0>0)J.strokeText(F,G,W);J.fillText(F,G,W)}if(j!==0)J.rotate(-j),J.translate(-H,-q)}};iq={};iq.drawNode=function(J,Q,Z){var U=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,K=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,X=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,Y=this,z,G,W=Q._private,H=W.rscratch,q=Q.position();if(!A8(q.x)||!A8(q.y))return;if(X&&!Q.visible())return;var F=X?Q.effectiveOpacity():1,M=Y.usePaths(),L,A=!1,I=Q.padding();z=Q.width()+2*I,G=Q.height()+2*I;var R;if(Z)R=Z,J.translate(-R.x1,-R.y1);var N=Q.pstyle("background-image"),E=N.value,V=new Array(E.length),j=new Array(E.length),T=0;for(var C=0;C<E.length;C++){var $=E[C],b=V[C]=$!=null&&$!=="none";if(b){var h=Q.cy().style().getIndexedStyle(Q,"background-image-crossorigin","value",C);T++,j[C]=Y.getCachedImage($,h,function(){W.backgroundTimestamp=Date.now(),Q.emitAndNotify("background")})}}var _=Q.pstyle("background-blacken").value,S=Q.pstyle("border-width").pfValue,v=Q.pstyle("background-opacity").value*F,f=Q.pstyle("border-color").value,x=Q.pstyle("border-style").value,y=Q.pstyle("border-join").value,m=Q.pstyle("border-cap").value,g=Q.pstyle("border-position").value,p=Q.pstyle("border-dash-pattern").pfValue,i=Q.pstyle("border-dash-offset").pfValue,l=Q.pstyle("border-opacity").value*F,a=Q.pstyle("outline-width").pfValue,e=Q.pstyle("outline-color").value,G0=Q.pstyle("outline-style").value,U0=Q.pstyle("outline-opacity").value*F,O0=Q.pstyle("outline-offset").value,X0=Q.pstyle("corner-radius").value;if(X0!=="auto")X0=Q.pstyle("corner-radius").pfValue;var E0=function y0(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:v;Y.eleFillStyle(J,Q,o)},W0=function y0(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:l;Y.colorStrokeStyle(J,f[0],f[1],f[2],o)},q0=function y0(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:U0;Y.colorStrokeStyle(J,e[0],e[1],e[2],o)},z0=function y0(o,w0,d,L0){var I0=Y.nodePathCache=Y.nodePathCache||[],T0=cx0(d==="polygon"?d+","+L0.join(","):d,""+w0,""+o,""+X0),$0=I0[T0],v0,r0=!1;if($0!=null)v0=$0,r0=!0,H.pathCache=v0;else v0=new Path2D,I0[T0]=H.pathCache=v0;return{path:v0,cacheHit:r0}},K0=Q.pstyle("shape").strValue,R0=Q.pstyle("shape-polygon-points").pfValue;if(M){J.translate(q.x,q.y);var Y0=z0(z,G,K0,R0);L=Y0.path,A=Y0.cacheHit}var P0=function y0(){if(!A){var o=q;if(M)o={x:0,y:0};Y.nodeShapes[Y.getNodeShape(Q)].draw(L||J,o.x,o.y,z,G,X0,H)}if(M)J.fill(L);else J.fill()},F0=function y0(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:F,w0=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,d=W.backgrounding,L0=0;for(var I0=0;I0<j.length;I0++){var T0=Q.cy().style().getIndexedStyle(Q,"background-image-containment","value",I0);if(w0&&T0==="over"||!w0&&T0==="inside"){L0++;continue}if(V[I0]&&j[I0].complete&&!j[I0].error)L0++,Y.drawInscribedImage(J,j[I0],Q,I0,o)}if(W.backgrounding=L0!==T,d!==W.backgrounding)Q.updateStyle(!1)},m0=function y0(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,w0=arguments.length>1&&arguments[1]!==void 0?arguments[1]:F;if(Y.hasPie(Q)){if(Y.drawPie(J,Q,w0),o){if(!M)Y.nodeShapes[Y.getNodeShape(Q)].draw(J,q.x,q.y,z,G,X0,H)}}},J0=function y0(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,w0=arguments.length>1&&arguments[1]!==void 0?arguments[1]:F;if(Y.hasStripe(Q)){if(J.save(),M)J.clip(H.pathCache);else Y.nodeShapes[Y.getNodeShape(Q)].draw(J,q.x,q.y,z,G,X0,H),J.clip();if(Y.drawStripe(J,Q,w0),J.restore(),o){if(!M)Y.nodeShapes[Y.getNodeShape(Q)].draw(J,q.x,q.y,z,G,X0,H)}}},z6=function y0(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:F,w0=(_>0?_:-_)*o,d=_>0?0:255;if(_!==0)if(Y.colorFillStyle(J,d,d,d,w0),M)J.fill(L);else J.fill()},t=function y0(){if(S>0){if(J.lineWidth=S,J.lineCap=m,J.lineJoin=y,J.setLineDash)switch(x){case"dotted":J.setLineDash([1,1]);break;case"dashed":J.setLineDash(p),J.lineDashOffset=i;break;case"solid":case"double":J.setLineDash([]);break}if(g!=="center"){if(J.save(),J.lineWidth*=2,g==="inside")M?J.clip(L):J.clip();else{var o=new Path2D;o.rect(-z/2-S,-G/2-S,z+2*S,G+2*S),o.addPath(L),J.clip(o,"evenodd")}M?J.stroke(L):J.stroke(),J.restore()}else M?J.stroke(L):J.stroke();if(x==="double"){J.lineWidth=S/3;var w0=J.globalCompositeOperation;if(J.globalCompositeOperation="destination-out",M)J.stroke(L);else J.stroke();J.globalCompositeOperation=w0}if(J.setLineDash)J.setLineDash([])}},N0=function y0(){if(a>0){if(J.lineWidth=a,J.lineCap="butt",J.setLineDash)switch(G0){case"dotted":J.setLineDash([1,1]);break;case"dashed":J.setLineDash([4,2]);break;case"solid":case"double":J.setLineDash([]);break}var o=q;if(M)o={x:0,y:0};var w0=Y.getNodeShape(Q),d=S;if(g==="inside")d=0;if(g==="outside")d*=2;var L0=(z+d+(a+O0))/z,I0=(G+d+(a+O0))/G,T0=z*L0,$0=G*I0,v0=Y.nodeShapes[w0].points,r0;if(M){var u0=z0(T0,$0,w0,v0);r0=u0.path}if(w0==="ellipse")Y.drawEllipsePath(r0||J,o.x,o.y,T0,$0);else if(["round-diamond","round-heptagon","round-hexagon","round-octagon","round-pentagon","round-polygon","round-triangle","round-tag"].includes(w0)){var G6=0,A6=0,r6=0;if(w0==="round-diamond")G6=(d+O0+a)*1.4;else if(w0==="round-heptagon")G6=(d+O0+a)*1.075,r6=-(d/2+O0+a)/35;else if(w0==="round-hexagon")G6=(d+O0+a)*1.12;else if(w0==="round-pentagon")G6=(d+O0+a)*1.13,r6=-(d/2+O0+a)/15;else if(w0==="round-tag")G6=(d+O0+a)*1.12,A6=(d/2+a+O0)*0.07;else if(w0==="round-triangle")G6=(d+O0+a)*(Math.PI/2),r6=-(d+O0/2+a)/Math.PI;if(G6!==0){if(L0=(z+G6)/z,T0=z*L0,!["round-hexagon","round-tag"].includes(w0))I0=(G+G6)/G,$0=G*I0}X0=X0==="auto"?ex0(T0,$0):X0;var N6=T0/2,F6=$0/2,P6=X0+(d+a+O0)/2,M6=new Array(v0.length/2),g6=new Array(v0.length/2);for(var O8=0;O8<v0.length/2;O8++)M6[O8]={x:o.x+A6+N6*v0[O8*2],y:o.y+r6+F6*v0[O8*2+1]};var a6,U8,p6,u6,S0=M6.length;U8=M6[S0-1];for(a6=0;a6<S0;a6++)p6=M6[a6%S0],u6=M6[(a6+1)%S0],g6[a6]=bJ0(U8,p6,u6,P6),U8=p6,p6=u6;Y.drawRoundPolygonPath(r0||J,o.x+A6,o.y+r6,z*L0,G*I0,v0,g6)}else if(["roundrectangle","round-rectangle"].includes(w0))X0=X0==="auto"?gq(T0,$0):X0,Y.drawRoundRectanglePath(r0||J,o.x,o.y,T0,$0,X0+(d+a+O0)/2);else if(["cutrectangle","cut-rectangle"].includes(w0))X0=X0==="auto"?jJ0():X0,Y.drawCutRectanglePath(r0||J,o.x,o.y,T0,$0,null,X0+(d+a+O0)/4);else if(["bottomroundrectangle","bottom-round-rectangle"].includes(w0))X0=X0==="auto"?gq(T0,$0):X0,Y.drawBottomRoundRectanglePath(r0||J,o.x,o.y,T0,$0,X0+(d+a+O0)/2);else if(w0==="barrel")Y.drawBarrelPath(r0||J,o.x,o.y,T0,$0);else if(w0.startsWith("polygon")||["rhomboid","right-rhomboid","round-tag","tag","vee"].includes(w0)){var Q6=(d+a+O0)/z;v0=cb(lb(v0,Q6)),Y.drawPolygonPath(r0||J,o.x,o.y,z,G,v0)}else{var B6=(d+a+O0)/z;v0=cb(lb(v0,-B6)),Y.drawPolygonPath(r0||J,o.x,o.y,z,G,v0)}if(M)J.stroke(r0);else J.stroke();if(G0==="double"){J.lineWidth=d/3;var D0=J.globalCompositeOperation;if(J.globalCompositeOperation="destination-out",M)J.stroke(r0);else J.stroke();J.globalCompositeOperation=D0}if(J.setLineDash)J.setLineDash([])}},f0=function y0(){if(K)Y.drawNodeOverlay(J,Q,q,z,G)},l0=function y0(){if(K)Y.drawNodeUnderlay(J,Q,q,z,G)},k0=function y0(){Y.drawElementText(J,Q,null,U)},_0=Q.pstyle("ghost").value==="yes";if(_0){var g0=Q.pstyle("ghost-offset-x").pfValue,h0=Q.pstyle("ghost-offset-y").pfValue,t0=Q.pstyle("ghost-opacity").value,C0=t0*F;J.translate(g0,h0),q0(),N0(),E0(t0*v),P0(),F0(C0,!0),W0(t0*l),t(),m0(_!==0||S!==0),J0(_!==0||S!==0),F0(C0,!1),z6(C0),J.translate(-g0,-h0)}if(M)J.translate(-q.x,-q.y);if(l0(),M)J.translate(q.x,q.y);if(q0(),N0(),E0(),P0(),F0(F,!0),W0(),t(),m0(_!==0||S!==0),J0(_!==0||S!==0),F0(F,!1),z6(),M)J.translate(-q.x,-q.y);if(k0(),f0(),Z)J.translate(R.x1,R.y1)};iq.drawNodeOverlay=Xy0("overlay");iq.drawNodeUnderlay=Xy0("underlay");iq.hasPie=function(J){return J=J[0],J._private.hasPie};iq.hasStripe=function(J){return J=J[0],J._private.hasStripe};iq.drawPie=function(J,Q,Z,U){Q=Q[0],U=U||Q.position();var K=Q.cy().style(),X=Q.pstyle("pie-size"),Y=Q.pstyle("pie-hole"),z=Q.pstyle("pie-start-angle").pfValue,G=U.x,W=U.y,H=Q.width(),q=Q.height(),F=Math.min(H,q)/2,M,L=0,A=this.usePaths();if(A)G=0,W=0;if(X.units==="%")F=F*X.pfValue;else if(X.pfValue!==void 0)F=X.pfValue/2;if(Y.units==="%")M=F*Y.pfValue;else if(Y.pfValue!==void 0)M=Y.pfValue/2;if(M>=F)return;for(var I=1;I<=K.pieBackgroundN;I++){var R=Q.pstyle("pie-"+I+"-background-size").value,N=Q.pstyle("pie-"+I+"-background-color").value,E=Q.pstyle("pie-"+I+"-background-opacity").value*Z,V=R/100;if(V+L>1)V=1-L;var j=1.5*Math.PI+2*Math.PI*L;j+=z;var T=2*Math.PI*V,C=j+T;if(R===0||L>=1||L+V>1)continue;if(M===0)J.beginPath(),J.moveTo(G,W),J.arc(G,W,F,j,C),J.closePath();else J.beginPath(),J.arc(G,W,F,j,C),J.arc(G,W,M,C,j,!0),J.closePath();this.colorFillStyle(J,N[0],N[1],N[2],E),J.fill(),L+=V}};iq.drawStripe=function(J,Q,Z,U){Q=Q[0],U=U||Q.position();var K=Q.cy().style(),X=U.x,Y=U.y,z=Q.width(),G=Q.height(),W=0,H=this.usePaths();J.save();var q=Q.pstyle("stripe-direction").value,F=Q.pstyle("stripe-size");switch(q){case"vertical":break;case"righward":J.rotate(-Math.PI/2);break}var M=z,L=G;if(F.units==="%")M=M*F.pfValue,L=L*F.pfValue;else if(F.pfValue!==void 0)M=F.pfValue,L=F.pfValue;if(H)X=0,Y=0;Y-=M/2,X-=L/2;for(var A=1;A<=K.stripeBackgroundN;A++){var I=Q.pstyle("stripe-"+A+"-background-size").value,R=Q.pstyle("stripe-"+A+"-background-color").value,N=Q.pstyle("stripe-"+A+"-background-opacity").value*Z,E=I/100;if(E+W>1)E=1-W;if(I===0||W>=1||W+E>1)continue;J.beginPath(),J.rect(X,Y+L*W,M,L*E),J.closePath(),this.colorFillStyle(J,R[0],R[1],R[2],N),J.fill(),W+=E}J.restore()};_U={};_U.getPixelRatio=function(){var J=this.data.contexts[0];if(this.forcedPixelRatio!=null)return this.forcedPixelRatio;var Q=this.cy.window(),Z=J.backingStorePixelRatio||J.webkitBackingStorePixelRatio||J.mozBackingStorePixelRatio||J.msBackingStorePixelRatio||J.oBackingStorePixelRatio||J.backingStorePixelRatio||1;return(Q.devicePixelRatio||1)/Z};_U.paintCache=function(J){var Q=this.paintCaches=this.paintCaches||[],Z=!0,U;for(var K=0;K<Q.length;K++)if(U=Q[K],U.context===J){Z=!1;break}if(Z)U={context:J},Q.push(U);return U};_U.createGradientStyleFor=function(J,Q,Z,U,K){var X,Y=this.usePaths(),z=Z.pstyle(Q+"-gradient-stop-colors").value,G=Z.pstyle(Q+"-gradient-stop-positions").pfValue;if(U==="radial-gradient")if(Z.isEdge()){var W=Z.sourceEndpoint(),H=Z.targetEndpoint(),q=Z.midpoint(),F=bB(W,q),M=bB(H,q);X=J.createRadialGradient(q.x,q.y,0,q.x,q.y,Math.max(F,M))}else{var L=Y?{x:0,y:0}:Z.position(),A=Z.paddedWidth(),I=Z.paddedHeight();X=J.createRadialGradient(L.x,L.y,0,L.x,L.y,Math.max(A,I))}else if(Z.isEdge()){var R=Z.sourceEndpoint(),N=Z.targetEndpoint();X=J.createLinearGradient(R.x,R.y,N.x,N.y)}else{var E=Y?{x:0,y:0}:Z.position(),V=Z.paddedWidth(),j=Z.paddedHeight(),T=V/2,C=j/2,$=Z.pstyle("background-gradient-direction").value;switch($){case"to-bottom":X=J.createLinearGradient(E.x,E.y-C,E.x,E.y+C);break;case"to-top":X=J.createLinearGradient(E.x,E.y+C,E.x,E.y-C);break;case"to-left":X=J.createLinearGradient(E.x+T,E.y,E.x-T,E.y);break;case"to-right":X=J.createLinearGradient(E.x-T,E.y,E.x+T,E.y);break;case"to-bottom-right":case"to-right-bottom":X=J.createLinearGradient(E.x-T,E.y-C,E.x+T,E.y+C);break;case"to-top-right":case"to-right-top":X=J.createLinearGradient(E.x-T,E.y+C,E.x+T,E.y-C);break;case"to-bottom-left":case"to-left-bottom":X=J.createLinearGradient(E.x+T,E.y-C,E.x-T,E.y+C);break;case"to-top-left":case"to-left-top":X=J.createLinearGradient(E.x+T,E.y+C,E.x-T,E.y-C);break}}if(!X)return null;var b=G.length===z.length,h=z.length;for(var _=0;_<h;_++)X.addColorStop(b?G[_]:_/(h-1),"rgba("+z[_][0]+","+z[_][1]+","+z[_][2]+","+K+")");return X};_U.gradientFillStyle=function(J,Q,Z,U){var K=this.createGradientStyleFor(J,"background",Q,Z,U);if(!K)return null;J.fillStyle=K};_U.colorFillStyle=function(J,Q,Z,U,K){J.fillStyle="rgba("+Q+","+Z+","+U+","+K+")"};_U.eleFillStyle=function(J,Q,Z){var U=Q.pstyle("background-fill").value;if(U==="linear-gradient"||U==="radial-gradient")this.gradientFillStyle(J,Q,U,Z);else{var K=Q.pstyle("background-color").value;this.colorFillStyle(J,K[0],K[1],K[2],Z)}};_U.gradientStrokeStyle=function(J,Q,Z,U){var K=this.createGradientStyleFor(J,"line",Q,Z,U);if(!K)return null;J.strokeStyle=K};_U.colorStrokeStyle=function(J,Q,Z,U,K){J.strokeStyle="rgba("+Q+","+Z+","+U+","+K+")"};_U.eleStrokeStyle=function(J,Q,Z){var U=Q.pstyle("line-fill").value;if(U==="linear-gradient"||U==="radial-gradient")this.gradientStrokeStyle(J,Q,U,Z);else{var K=Q.pstyle("line-color").value;this.colorStrokeStyle(J,K[0],K[1],K[2],Z)}};_U.matchCanvasSize=function(J){var Q=this,Z=Q.data,U=Q.findContainerClientCoords(),K=U[2],X=U[3],Y=Q.getPixelRatio(),z=Q.motionBlurPxRatio;if(J===Q.data.bufferCanvases[Q.MOTIONBLUR_BUFFER_NODE]||J===Q.data.bufferCanvases[Q.MOTIONBLUR_BUFFER_DRAG])Y=z;var G=K*Y,W=X*Y,H;if(G===Q.canvasWidth&&W===Q.canvasHeight)return;Q.fontCaches=null;var q=Z.canvasContainer;q.style.width=K+"px",q.style.height=X+"px";for(var F=0;F<Q.CANVAS_LAYERS;F++)H=Z.canvases[F],H.width=G,H.height=W,H.style.width=K+"px",H.style.height=X+"px";for(var F=0;F<Q.BUFFER_COUNT;F++)H=Z.bufferCanvases[F],H.width=G,H.height=W,H.style.width=K+"px",H.style.height=X+"px";if(Q.textureMult=1,Y<=1)H=Z.bufferCanvases[Q.TEXTURE_BUFFER],Q.textureMult=2,H.width=G*Q.textureMult,H.height=W*Q.textureMult;Q.canvasWidth=G,Q.canvasHeight=W,Q.pixelRatio=Y};_U.renderTo=function(J,Q,Z,U){this.render({forcedContext:J,forcedZoom:Q,forcedPan:Z,drawAllLayers:!0,forcedPxRatio:U})};_U.clearCanvas=function(){var J=this,Q=J.data;function Z(U){U.clearRect(0,0,J.canvasWidth,J.canvasHeight)}Z(Q.contexts[J.NODE]),Z(Q.contexts[J.DRAG])};_U.render=function(J){var Q=this;J=J||rx0();var Z=Q.cy,U=J.forcedContext,K=J.drawAllLayers,X=J.drawOnlyNodeLayer,Y=J.forcedZoom,z=J.forcedPan,G=J.forcedPxRatio===void 0?this.getPixelRatio():J.forcedPxRatio,W=Q.data,H=W.canvasNeedsRedraw,q=Q.textureOnViewport&&!U&&(Q.pinching||Q.hoverData.dragging||Q.swipePanning||Q.data.wheelZooming),F=J.motionBlur!==void 0?J.motionBlur:Q.motionBlur,M=Q.motionBlurPxRatio,L=Z.hasCompoundNodes(),A=Q.hoverData.draggingEles,I=Q.hoverData.selecting||Q.touchData.selecting?!0:!1;F=F&&!U&&Q.motionBlurEnabled&&!I;var R=F;if(!U){if(Q.prevPxRatio!==G)Q.invalidateContainerClientCoordsCache(),Q.matchCanvasSize(Q.container),Q.redrawHint("eles",!0),Q.redrawHint("drag",!0);Q.prevPxRatio=G}if(!U&&Q.motionBlurTimeout)clearTimeout(Q.motionBlurTimeout);if(F){if(Q.mbFrames==null)Q.mbFrames=0;if(Q.mbFrames++,Q.mbFrames<3)R=!1;if(Q.mbFrames>Q.minMbLowQualFrames)Q.motionBlurPxRatio=Q.mbPxRBlurry}if(Q.clearingMotionBlur)Q.motionBlurPxRatio=1;if(Q.textureDrawLastFrame&&!q)H[Q.NODE]=!0,H[Q.SELECT_BOX]=!0;var N=Z.style(),E=Z.zoom(),V=Y!==void 0?Y:E,j=Z.pan(),T={x:j.x,y:j.y},C={zoom:E,pan:{x:j.x,y:j.y}},$=Q.prevViewport,b=$===void 0||C.zoom!==$.zoom||C.pan.x!==$.pan.x||C.pan.y!==$.pan.y;if(!b&&!(A&&!L))Q.motionBlurPxRatio=1;if(z)T=z;V*=G,T.x*=G,T.y*=G;var h=Q.getCachedZSortedEles();function _(W0,q0,z0,K0,R0){var Y0=W0.globalCompositeOperation;W0.globalCompositeOperation="destination-out",Q.colorFillStyle(W0,255,255,255,Q.motionBlurTransparency),W0.fillRect(q0,z0,K0,R0),W0.globalCompositeOperation=Y0}function S(W0,q0){var z0,K0,R0,Y0;if(!Q.clearingMotionBlur&&(W0===W.bufferContexts[Q.MOTIONBLUR_BUFFER_NODE]||W0===W.bufferContexts[Q.MOTIONBLUR_BUFFER_DRAG]))z0={x:j.x*M,y:j.y*M},K0=E*M,R0=Q.canvasWidth*M,Y0=Q.canvasHeight*M;else z0=T,K0=V,R0=Q.canvasWidth,Y0=Q.canvasHeight;if(W0.setTransform(1,0,0,1,0,0),q0==="motionBlur")_(W0,0,0,R0,Y0);else if(!U&&(q0===void 0||q0))W0.clearRect(0,0,R0,Y0);if(!K)W0.translate(z0.x,z0.y),W0.scale(K0,K0);if(z)W0.translate(z.x,z.y);if(Y)W0.scale(Y,Y)}if(!q)Q.textureDrawLastFrame=!1;if(q){if(Q.textureDrawLastFrame=!0,!Q.textureCache){Q.textureCache={},Q.textureCache.bb=Z.mutableElements().boundingBox(),Q.textureCache.texture=Q.data.bufferCanvases[Q.TEXTURE_BUFFER];var v=Q.data.bufferContexts[Q.TEXTURE_BUFFER];v.setTransform(1,0,0,1,0,0),v.clearRect(0,0,Q.canvasWidth*Q.textureMult,Q.canvasHeight*Q.textureMult),Q.render({forcedContext:v,drawOnlyNodeLayer:!0,forcedPxRatio:G*Q.textureMult});var C=Q.textureCache.viewport={zoom:Z.zoom(),pan:Z.pan(),width:Q.canvasWidth,height:Q.canvasHeight};C.mpan={x:(0-C.pan.x)/C.zoom,y:(0-C.pan.y)/C.zoom}}H[Q.DRAG]=!1,H[Q.NODE]=!1;var f=W.contexts[Q.NODE],x=Q.textureCache.texture,C=Q.textureCache.viewport;if(f.setTransform(1,0,0,1,0,0),F)_(f,0,0,C.width,C.height);else f.clearRect(0,0,C.width,C.height);var y=N.core("outside-texture-bg-color").value,m=N.core("outside-texture-bg-opacity").value;Q.colorFillStyle(f,y[0],y[1],y[2],m),f.fillRect(0,0,C.width,C.height);var E=Z.zoom();S(f,!1),f.clearRect(C.mpan.x,C.mpan.y,C.width/C.zoom/G,C.height/C.zoom/G),f.drawImage(x,C.mpan.x,C.mpan.y,C.width/C.zoom/G,C.height/C.zoom/G)}else if(Q.textureOnViewport&&!U)Q.textureCache=null;var g=Z.extent(),p=Q.pinching||Q.hoverData.dragging||Q.swipePanning||Q.data.wheelZooming||Q.hoverData.draggingEles||Q.cy.animated(),i=Q.hideEdgesOnViewport&&p,l=[];if(l[Q.NODE]=!H[Q.NODE]&&F&&!Q.clearedForMotionBlur[Q.NODE]||Q.clearingMotionBlur,l[Q.NODE])Q.clearedForMotionBlur[Q.NODE]=!0;if(l[Q.DRAG]=!H[Q.DRAG]&&F&&!Q.clearedForMotionBlur[Q.DRAG]||Q.clearingMotionBlur,l[Q.DRAG])Q.clearedForMotionBlur[Q.DRAG]=!0;if(H[Q.NODE]||K||X||l[Q.NODE]){var a=F&&!l[Q.NODE]&&M!==1,f=U||(a?Q.data.bufferContexts[Q.MOTIONBLUR_BUFFER_NODE]:W.contexts[Q.NODE]),e=F&&!a?"motionBlur":void 0;if(S(f,e),i)Q.drawCachedNodes(f,h.nondrag,G,g);else Q.drawLayeredElements(f,h.nondrag,G,g);if(Q.debug)Q.drawDebugPoints(f,h.nondrag);if(!K&&!F)H[Q.NODE]=!1}if(!X&&(H[Q.DRAG]||K||l[Q.DRAG])){var a=F&&!l[Q.DRAG]&&M!==1,f=U||(a?Q.data.bufferContexts[Q.MOTIONBLUR_BUFFER_DRAG]:W.contexts[Q.DRAG]);if(S(f,F&&!a?"motionBlur":void 0),i)Q.drawCachedNodes(f,h.drag,G,g);else Q.drawCachedElements(f,h.drag,G,g);if(Q.debug)Q.drawDebugPoints(f,h.drag);if(!K&&!F)H[Q.DRAG]=!1}if(this.drawSelectionRectangle(J,S),F&&M!==1){var G0=W.contexts[Q.NODE],U0=Q.data.bufferCanvases[Q.MOTIONBLUR_BUFFER_NODE],O0=W.contexts[Q.DRAG],X0=Q.data.bufferCanvases[Q.MOTIONBLUR_BUFFER_DRAG],E0=function W0(q0,z0,K0){if(q0.setTransform(1,0,0,1,0,0),K0||!R)q0.clearRect(0,0,Q.canvasWidth,Q.canvasHeight);else _(q0,0,0,Q.canvasWidth,Q.canvasHeight);var R0=M;q0.drawImage(z0,0,0,Q.canvasWidth*R0,Q.canvasHeight*R0,0,0,Q.canvasWidth,Q.canvasHeight)};if(H[Q.NODE]||l[Q.NODE])E0(G0,U0,l[Q.NODE]),H[Q.NODE]=!1;if(H[Q.DRAG]||l[Q.DRAG])E0(O0,X0,l[Q.DRAG]),H[Q.DRAG]=!1}if(Q.prevViewport=C,Q.clearingMotionBlur)Q.clearingMotionBlur=!1,Q.motionBlurCleared=!0,Q.motionBlur=!0;if(F)Q.motionBlurTimeout=setTimeout(function(){Q.motionBlurTimeout=null,Q.clearedForMotionBlur[Q.NODE]=!1,Q.clearedForMotionBlur[Q.DRAG]=!1,Q.motionBlur=!1,Q.clearingMotionBlur=!q,Q.mbFrames=0,H[Q.NODE]=!0,H[Q.DRAG]=!0,Q.redraw()},ck6);if(!U)Z.emit("render")};_U.drawSelectionRectangle=function(J,Q){var Z=this,U=Z.cy,K=Z.data,X=U.style(),Y=J.drawOnlyNodeLayer,z=J.drawAllLayers,G=K.canvasNeedsRedraw,W=J.forcedContext;if(Z.showFps||!Y&&G[Z.SELECT_BOX]&&!z){var H=W||K.contexts[Z.SELECT_BOX];if(Q(H),Z.selection[4]==1&&(Z.hoverData.selecting||Z.touchData.selecting)){var q=Z.cy.zoom(),F=X.core("selection-box-border-width").value/q;if(H.lineWidth=F,H.fillStyle="rgba("+X.core("selection-box-color").value[0]+","+X.core("selection-box-color").value[1]+","+X.core("selection-box-color").value[2]+","+X.core("selection-box-opacity").value+")",H.fillRect(Z.selection[0],Z.selection[1],Z.selection[2]-Z.selection[0],Z.selection[3]-Z.selection[1]),F>0)H.strokeStyle="rgba("+X.core("selection-box-border-color").value[0]+","+X.core("selection-box-border-color").value[1]+","+X.core("selection-box-border-color").value[2]+","+X.core("selection-box-opacity").value+")",H.strokeRect(Z.selection[0],Z.selection[1],Z.selection[2]-Z.selection[0],Z.selection[3]-Z.selection[1])}if(K.bgActivePosistion&&!Z.hoverData.selecting){var q=Z.cy.zoom(),M=K.bgActivePosistion;H.fillStyle="rgba("+X.core("active-bg-color").value[0]+","+X.core("active-bg-color").value[1]+","+X.core("active-bg-color").value[2]+","+X.core("active-bg-opacity").value+")",H.beginPath(),H.arc(M.x,M.y,X.core("active-bg-size").pfValue/q,0,2*Math.PI),H.fill()}var L=Z.lastRedrawTime;if(Z.showFps&&L){L=Math.round(L);var A=Math.round(1000/L),I="1 frame = "+L+" ms = "+A+" 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",!Jj){var R=H.measureText(I);Jj=R.actualBoundingBoxAscent}H.fillText(I,0,Jj);var N=60;H.strokeRect(0,Jj+10,250,20),H.fillRect(0,Jj+10,250*Math.min(A/N,1),20)}if(!z)G[Z.SELECT_BOX]=!1}};Dx0=typeof Float32Array!=="undefined"?Float32Array:Array;if(!Math.hypot)Math.hypot=function(){var J=0,Q=arguments.length;while(Q--)J+=arguments[Q]*arguments[Q];return Math.sqrt(J)};Kf6=function(){function J(Q,Z,U,K){cq(this,J),this.debugID=Math.floor(Math.random()*1e4),this.r=Q,this.texSize=Z,this.texRows=U,this.texHeight=Math.floor(Z/U),this.enableWrapping=!0,this.locked=!1,this.texture=null,this.needsBuffer=!0,this.freePointer={x:0,row:0},this.keyToLocation=new Map,this.canvas=K(Q,Z,Z),this.scratch=K(Q,Z,this.texHeight,"scratch")}return lq(J,[{key:"lock",value:function Q(){this.locked=!0}},{key:"getKeys",value:function Q(){return new Set(this.keyToLocation.keys())}},{key:"getScale",value:function Q(Z){var{w:U,h:K}=Z,X=this.texHeight,Y=this.texSize,z=X/K,G=U*z,W=K*z;if(G>Y)z=Y/U,G=U*z,W=K*z;return{scale:z,texW:G,texH:W}}},{key:"draw",value:function Q(Z,U,K){var X=this;if(this.locked)throw new Error("can't draw, atlas is locked");var Y=this.texSize,z=this.texRows,G=this.texHeight,W=this.getScale(U),H=W.scale,q=W.texW,F=W.texH,M=function N(E,V){if(K&&V){var j=V.context,T=E.x,C=E.row,$=T,b=G*C;j.save(),j.translate($,b),j.scale(H,H),K(j,U),j.restore()}},L=[null,null],A=function N(){if(M(X.freePointer,X.canvas),L[0]={x:X.freePointer.x,y:X.freePointer.row*G,w:q,h:F},L[1]={x:X.freePointer.x+q,y:X.freePointer.row*G,w:0,h:F},X.freePointer.x+=q,X.freePointer.x==Y)X.freePointer.x=0,X.freePointer.row++},I=function N(){var{scratch:E,canvas:V}=X;E.clear(),M({x:0,row:0},E);var j=Y-X.freePointer.x,T=q-j,C=G;{var $=X.freePointer.x,b=X.freePointer.row*G,h=j;V.context.drawImage(E,0,0,h,C,$,b,h,C),L[0]={x:$,y:b,w:h,h:F}}{var _=j,S=(X.freePointer.row+1)*G,v=T;if(V)V.context.drawImage(E,_,0,v,C,0,S,v,C);L[1]={x:0,y:S,w:v,h:F}}X.freePointer.x=T,X.freePointer.row++},R=function N(){X.freePointer.x=0,X.freePointer.row++};if(this.freePointer.x+q<=Y)A();else if(this.freePointer.row>=z-1)return!1;else if(this.freePointer.x===Y)R(),A();else if(this.enableWrapping)I();else R(),A();return this.keyToLocation.set(Z,L),this.needsBuffer=!0,L}},{key:"getOffsets",value:function Q(Z){return this.keyToLocation.get(Z)}},{key:"isEmpty",value:function Q(){return this.freePointer.x===0&&this.freePointer.row===0}},{key:"canFit",value:function Q(Z){if(this.locked)return!1;var U=this.texSize,K=this.texRows,X=this.getScale(Z),Y=X.texW;if(this.freePointer.x+Y>U)return this.freePointer.row<K-1;return!0}},{key:"bufferIfNeeded",value:function Q(Z){if(!this.texture)this.texture=ok6(Z,this.debugID);if(this.needsBuffer){if(this.texture.buffer(this.canvas),this.needsBuffer=!1,this.locked)this.canvas=null,this.scratch=null}}},{key:"dispose",value:function Q(){if(this.texture)this.texture.deleteTexture(),this.texture=null;this.canvas=null,this.scratch=null,this.locked=!0}}])}(),Xf6=function(){function J(Q,Z,U,K){cq(this,J),this.r=Q,this.texSize=Z,this.texRows=U,this.createTextureCanvas=K,this.atlases=[],this.styleKeyToAtlas=new Map,this.markedKeys=new Set}return lq(J,[{key:"getKeys",value:function Q(){return new Set(this.styleKeyToAtlas.keys())}},{key:"_createAtlas",value:function Q(){var Z=this.r,U=this.texSize,K=this.texRows,X=this.createTextureCanvas;return new Kf6(Z,U,K,X)}},{key:"_getScratchCanvas",value:function Q(){if(!this.scratch){var Z=this.r,U=this.texSize,K=this.texRows,X=this.createTextureCanvas,Y=Math.floor(U/K);this.scratch=X(Z,U,Y,"scratch")}return this.scratch}},{key:"draw",value:function Q(Z,U,K){var X=this.styleKeyToAtlas.get(Z);if(!X){if(X=this.atlases[this.atlases.length-1],!X||!X.canFit(U)){if(X)X.lock();X=this._createAtlas(),this.atlases.push(X)}X.draw(Z,U,K),this.styleKeyToAtlas.set(Z,X)}return X}},{key:"getAtlas",value:function Q(Z){return this.styleKeyToAtlas.get(Z)}},{key:"hasAtlas",value:function Q(Z){return this.styleKeyToAtlas.has(Z)}},{key:"markKeyForGC",value:function Q(Z){this.markedKeys.add(Z)}},{key:"gc",value:function Q(){var Z=this,U=this.markedKeys;if(U.size===0){console.log("nothing to garbage collect");return}var K=[],X=new Map,Y=null,z=b5(this.atlases),G;try{var W=function H(){var q=G.value,F=q.getKeys(),M=Yf6(U,F);if(M.size===0)return K.push(q),F.forEach(function(j){return X.set(j,q)}),1;if(!Y)Y=Z._createAtlas(),K.push(Y);var L=b5(F),A;try{for(L.s();!(A=L.n()).done;){var I=A.value;if(!M.has(I)){var R=q.getOffsets(I),N=e4(R,2),E=N[0],V=N[1];if(!Y.canFit({w:E.w+V.w,h:E.h}))Y.lock(),Y=Z._createAtlas(),K.push(Y);if(q.canvas)Z._copyTextureToNewAtlas(I,q,Y),X.set(I,Y)}}}catch(j){L.e(j)}finally{L.f()}q.dispose()};for(z.s();!(G=z.n()).done;)if(W())continue}catch(H){z.e(H)}finally{z.f()}this.atlases=K,this.styleKeyToAtlas=X,this.markedKeys=new Set}},{key:"_copyTextureToNewAtlas",value:function Q(Z,U,K){var X=U.getOffsets(Z),Y=e4(X,2),z=Y[0],G=Y[1];if(G.w===0)K.draw(Z,z,function(F){F.drawImage(U.canvas,z.x,z.y,z.w,z.h,0,0,z.w,z.h)});else{var W=this._getScratchCanvas();W.clear(),W.context.drawImage(U.canvas,z.x,z.y,z.w,z.h,0,0,z.w,z.h),W.context.drawImage(U.canvas,G.x,G.y,G.w,G.h,z.w,0,G.w,G.h);var H=z.w+G.w,q=z.h;K.draw(Z,{w:H,h:q},function(F){F.drawImage(W,0,0,H,q,0,0,H,q)})}}},{key:"getCounts",value:function Q(){return{keyCount:this.styleKeyToAtlas.size,atlasCount:new Set(this.styleKeyToAtlas.values()).size}}}])}();zf6=function(){function J(Q,Z){cq(this,J),this.r=Q,this.globalOptions=Z,this.atlasSize=Z.webglTexSize,this.maxAtlasesPerBatch=Z.webglTexPerBatch,this.renderTypes=new Map,this.collections=new Map,this.typeAndIdToKey=new Map}return lq(J,[{key:"getAtlasSize",value:function Q(){return this.atlasSize}},{key:"addAtlasCollection",value:function Q(Z,U){var K=this.globalOptions,X=K.webglTexSize,Y=K.createTextureCanvas,z=U.texRows,G=this._cacheScratchCanvas(Y),W=new Xf6(this.r,X,z,G);this.collections.set(Z,W)}},{key:"addRenderType",value:function Q(Z,U){var K=U.collection;if(!this.collections.has(K))throw new Error("invalid atlas collection name '".concat(K,"'"));var X=this.collections.get(K),Y=HJ({type:Z,atlasCollection:X},U);this.renderTypes.set(Z,Y)}},{key:"getRenderTypeOpts",value:function Q(Z){return this.renderTypes.get(Z)}},{key:"getAtlasCollection",value:function Q(Z){return this.collections.get(Z)}},{key:"_cacheScratchCanvas",value:function Q(Z){var U=-1,K=-1,X=null;return function(Y,z,G,W){if(W){if(!X||z!=U||G!=K)U=z,K=G,X=Z(Y,z,G);return X}else return Z(Y,z,G)}}},{key:"_key",value:function Q(Z,U){return"".concat(Z,"-").concat(U)}},{key:"invalidate",value:function Q(Z){var U=this,K=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},X=K.forceRedraw,Y=X===void 0?!1:X,z=K.filterEle,G=z===void 0?function(){return!0}:z,W=K.filterType,H=W===void 0?function(){return!0}:W,q=!1,F=!1,M=b5(Z),L;try{for(M.s();!(L=M.n()).done;){var A=L.value;if(G(A)){var I=b5(this.renderTypes.values()),R;try{var N=function E(){var V=R.value,j=V.type;if(H(j)){var T=U.collections.get(V.collection),C=V.getKey(A),$=Array.isArray(C)?C:[C];if(Y)$.forEach(function(S){return T.markKeyForGC(S)}),F=!0;else{var b=V.getID?V.getID(A):A.id(),h=U._key(j,b),_=U.typeAndIdToKey.get(h);if(_!==void 0&&!sk6($,_))q=!0,U.typeAndIdToKey.delete(h),_.forEach(function(S){return T.markKeyForGC(S)})}}};for(I.s();!(R=I.n()).done;)N()}catch(E){I.e(E)}finally{I.f()}}}}catch(E){M.e(E)}finally{M.f()}if(F)this.gc(),q=!1;return q}},{key:"gc",value:function Q(){var Z=b5(this.collections.values()),U;try{for(Z.s();!(U=Z.n()).done;){var K=U.value;K.gc()}}catch(X){Z.e(X)}finally{Z.f()}}},{key:"getOrCreateAtlas",value:function Q(Z,U,K,X){var Y=this.renderTypes.get(U),z=this.collections.get(Y.collection),G=!1,W=z.draw(X,K,function(F){if(Y.drawClipped)F.save(),F.beginPath(),F.rect(0,0,K.w,K.h),F.clip(),Y.drawElement(F,Z,K,!0,!0),F.restore();else Y.drawElement(F,Z,K,!0,!0);G=!0});if(G){var H=Y.getID?Y.getID(Z):Z.id(),q=this._key(U,H);if(this.typeAndIdToKey.has(q))this.typeAndIdToKey.get(q).push(X);else this.typeAndIdToKey.set(q,[X])}return W}},{key:"getAtlasInfo",value:function Q(Z,U){var K=this,X=this.renderTypes.get(U),Y=X.getKey(Z),z=Array.isArray(Y)?Y:[Y];return z.map(function(G){var W=X.getBoundingBox(Z,G),H=K.getOrCreateAtlas(Z,U,W,G),q=H.getOffsets(G),F=e4(q,2),M=F[0],L=F[1];return{atlas:H,tex:M,tex1:M,tex2:L,bb:W}})}},{key:"getDebugInfo",value:function Q(){var Z=[],U=b5(this.collections),K;try{for(U.s();!(K=U.n()).done;){var X=e4(K.value,2),Y=X[0],z=X[1],G=z.getCounts(),W=G.keyCount,H=G.atlasCount;Z.push({type:Y,keyCount:W,atlasCount:H})}}catch(q){U.e(q)}finally{U.f()}return Z}}])}(),Gf6=function(){function J(Q){cq(this,J),this.globalOptions=Q,this.atlasSize=Q.webglTexSize,this.maxAtlasesPerBatch=Q.webglTexPerBatch,this.batchAtlases=[]}return lq(J,[{key:"getMaxAtlasesPerBatch",value:function Q(){return this.maxAtlasesPerBatch}},{key:"getAtlasSize",value:function Q(){return this.atlasSize}},{key:"getIndexArray",value:function Q(){return Array.from({length:this.maxAtlasesPerBatch},function(Z,U){return U})}},{key:"startBatch",value:function Q(){this.batchAtlases=[]}},{key:"getAtlasCount",value:function Q(){return this.batchAtlases.length}},{key:"getAtlases",value:function Q(){return this.batchAtlases}},{key:"canAddToCurrentBatch",value:function Q(Z){if(this.batchAtlases.length===this.maxAtlasesPerBatch)return this.batchAtlases.includes(Z);return!0}},{key:"getAtlasIndexForBatch",value:function Q(Z){var U=this.batchAtlases.indexOf(Z);if(U<0){if(this.batchAtlases.length===this.maxAtlasesPerBatch)throw new Error("cannot add more atlases to batch");this.batchAtlases.push(Z),U=this.batchAtlases.length-1}return U}}])}(),Gj={SCREEN:{name:"screen",screen:!0},PICKING:{name:"picking",picking:!0}},ob={IGNORE:1,USE_BB:2},Bf6=function(){function J(Q,Z,U){cq(this,J),this.r=Q,this.gl=Z,this.maxInstances=U.webglBatchSize,this.atlasSize=U.webglTexSize,this.bgColor=U.bgColor,this.debug=U.webglDebug,this.batchDebugInfo=[],U.enableWrapping=!0,U.createTextureCanvas=dk6,this.atlasManager=new zf6(Q,U),this.batchManager=new Gf6(U),this.simpleShapeOptions=new Map,this.program=this._createShaderProgram(Gj.SCREEN),this.pickingProgram=this._createShaderProgram(Gj.PICKING),this.vao=this._createVAO()}return lq(J,[{key:"addAtlasCollection",value:function Q(Z,U){this.atlasManager.addAtlasCollection(Z,U)}},{key:"addTextureAtlasRenderType",value:function Q(Z,U){this.atlasManager.addRenderType(Z,U)}},{key:"addSimpleShapeRenderType",value:function Q(Z,U){this.simpleShapeOptions.set(Z,U)}},{key:"invalidate",value:function Q(Z){var U=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},K=U.type,X=this.atlasManager;if(K)return X.invalidate(Z,{filterType:function Y(z){return z===K},forceRedraw:!0});else return X.invalidate(Z)}},{key:"gc",value:function Q(){this.atlasManager.gc()}},{key:"_createShaderProgram",value:function Q(Z){var U=this.gl,K=`#version 300 es
|
|
792
792
|
precision highp float;
|
|
793
793
|
|
|
794
794
|
uniform mat3 uPanZoomMatrix;
|
|
@@ -1097,12 +1097,12 @@ Expecting `+Q6.join(", ")+", got '"+(this.terminals_[F6]||F6)+"'";else B6="Parse
|
|
|
1097
1097
|
|
|
1098
1098
|
Initialize mermaid with maxEdges set to a higher number to allow more edges.
|
|
1099
1099
|
You cannot set this config via configuration inside the diagram as it is a secure config.
|
|
1100
|
-
You have to call mermaid.initialize.`)}isLinkData(J){return J!==null&&typeof J==="object"&&"id"in J&&typeof J.id==="string"}addLink(J,Q,Z){let U=this.isLinkData(Z)?Z.id.replace("@",""):void 0;B0.info("addLink",J,Q,U);for(let K of J)for(let X of Q){let Y=K===J[J.length-1],z=X===Q[0];if(Y&&z)this.addSingleLink(K,X,Z,U);else this.addSingleLink(K,X,Z,void 0)}}updateLinkInterpolate(J,Q){J.forEach((Z)=>{if(Z==="default")this.edges.defaultInterpolate=Q;else this.edges[Z].interpolate=Q})}updateLink(J,Q){J.forEach((Z)=>{if(typeof Z==="number"&&Z>=this.edges.length)throw new Error(`The index ${Z} for linkStyle is out of bounds. Valid indices for linkStyle are between 0 and ${this.edges.length-1}. (Help: Ensure that the index is within the range of existing edges.)`);if(Z==="default")this.edges.defaultStyle=Q;else if(this.edges[Z].style=Q,(this.edges[Z]?.style?.length??0)>0&&!this.edges[Z]?.style?.some((U)=>U?.startsWith("fill")))this.edges[Z]?.style?.push("fill:none")})}addClass(J,Q){let Z=Q.join().replace(/\\,/g,"§§§").replace(/,/g,";").replace(/§§§/g,",").split(";");J.split(",").forEach((U)=>{let K=this.classes.get(U);if(K===void 0)K={id:U,styles:[],textStyles:[]},this.classes.set(U,K);if(Z!==void 0&&Z!==null)Z.forEach((X)=>{if(/color/.exec(X)){let Y=X.replace("fill","bgFill");K.textStyles.push(Y)}K.styles.push(X)})})}setDirection(J){if(this.direction=J.trim(),/.*</.exec(this.direction))this.direction="RL";if(/.*\^/.exec(this.direction))this.direction="BT";if(/.*>/.exec(this.direction))this.direction="LR";if(/.*v/.exec(this.direction))this.direction="TB";if(this.direction==="TD")this.direction="TB"}setClass(J,Q){for(let Z of J.split(",")){let U=this.vertices.get(Z);if(U)U.classes.push(Q);let K=this.edges.find((Y)=>Y.id===Z);if(K)K.classes.push(Q);let X=this.subGraphLookup.get(Z);if(X)X.classes.push(Q)}}setTooltip(J,Q){if(Q===void 0)return;Q=this.sanitizeText(Q);for(let Z of J.split(","))this.tooltips.set(this.version==="gen-1"?this.lookUpDomId(Z):Z,Q)}setClickFun(J,Q,Z){let U=this.lookUpDomId(J);if(i0().securityLevel!=="loose")return;if(Q===void 0)return;let K=[];if(typeof Z==="string"){K=Z.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let Y=0;Y<K.length;Y++){let z=K[Y].trim();if(z.startsWith('"')&&z.endsWith('"'))z=z.substr(1,z.length-2);K[Y]=z}}if(K.length===0)K.push(J);let X=this.vertices.get(J);if(X)X.haveCallback=!0,this.funs.push(()=>{let Y=document.querySelector(`[id="${U}"]`);if(Y!==null)Y.addEventListener("click",()=>{n8.runFunc(Q,...K)},!1)})}setLink(J,Q,Z){J.split(",").forEach((U)=>{let K=this.vertices.get(U);if(K!==void 0)K.link=n8.formatUrl(Q,this.config),K.linkTarget=Z}),this.setClass(J,"clickable")}getTooltip(J){return this.tooltips.get(J)}setClickEvent(J,Q,Z){J.split(",").forEach((U)=>{this.setClickFun(U,Q,Z)}),this.setClass(J,"clickable")}bindFunctions(J){this.funs.forEach((Q)=>{Q(J)})}getDirection(){return this.direction?.trim()}getVertices(){return this.vertices}getEdges(){return this.edges}getClasses(){return this.classes}setupToolTips(J){let Q=j6(".mermaidTooltip");if((Q._groups||Q)[0][0]===null)Q=j6("body").append("div").attr("class","mermaidTooltip").style("opacity",0);j6(J).select("svg").selectAll("g.node").on("mouseover",(K)=>{let X=j6(K.currentTarget);if(X.attr("title")===null)return;let z=K.currentTarget?.getBoundingClientRect();Q.transition().duration(200).style("opacity",".9"),Q.text(X.attr("title")).style("left",window.scrollX+z.left+(z.right-z.left)/2+"px").style("top",window.scrollY+z.bottom+"px"),Q.html(Q.html().replace(/<br\/>/g,"<br/>")),X.classed("hover",!0)}).on("mouseout",(K)=>{Q.transition().duration(500).style("opacity",0),j6(K.currentTarget).classed("hover",!1)})}clear(J="gen-2"){this.vertices=new Map,this.classes=new Map,this.edges=[],this.funs=[this.setupToolTips.bind(this)],this.subGraphs=[],this.subGraphLookup=new Map,this.subCount=0,this.tooltips=new Map,this.firstGraphFlag=!0,this.version=J,this.config=i0(),rJ()}setGen(J){this.version=J||"gen-2"}defaultStyle(){return"fill:#ffa;stroke: #f66; stroke-width: 3px; stroke-dasharray: 5, 5;fill:#ffa;stroke: #666;"}addSubGraph(J,Q,Z){let U=J.text.trim(),K=Z.text;if(J===Z&&/\s/.exec(Z.text))U=void 0;let Y=w((q)=>{let F={boolean:{},number:{},string:{}},M=[],L;return{nodeList:q.filter(function(I){let R=typeof I;if(I.stmt&&I.stmt==="dir")return L=I.value,!1;if(I.trim()==="")return!1;if(R in F)return F[R].hasOwnProperty(I)?!1:F[R][I]=!0;else return M.includes(I)?!1:M.push(I)}),dir:L}},"uniq")(Q.flat()),z=Y.nodeList,G=Y.dir,W=i0().flowchart??{};if(G=G??(W.inheritDir?this.getDirection()??i0().direction??void 0:void 0),this.version==="gen-1")for(let q=0;q<z.length;q++)z[q]=this.lookUpDomId(z[q]);U=U??"subGraph"+this.subCount,K=K||"",K=this.sanitizeText(K),this.subCount=this.subCount+1;let H={id:U,nodes:z,title:K.trim(),classes:[],dir:G,labelType:Z.type};return B0.info("Adding",H.id,H.nodes,H.dir),H.nodes=this.makeUniq(H,this.subGraphs).nodes,this.subGraphs.push(H),this.subGraphLookup.set(U,H),U}getPosForId(J){for(let[Q,Z]of this.subGraphs.entries())if(Z.id===J)return Q;return-1}indexNodes2(J,Q){let Z=this.subGraphs[Q].nodes;if(this.secCount=this.secCount+1,this.secCount>2000)return{result:!1,count:0};if(this.posCrossRef[this.secCount]=Q,this.subGraphs[Q].id===J)return{result:!0,count:0};let U=0,K=1;while(U<Z.length){let X=this.getPosForId(Z[U]);if(X>=0){let Y=this.indexNodes2(J,X);if(Y.result)return{result:!0,count:K+Y.count};else K=K+Y.count}U=U+1}return{result:!1,count:K}}getDepthFirstPos(J){return this.posCrossRef[J]}indexNodes(){if(this.secCount=-1,this.subGraphs.length>0)this.indexNodes2("none",this.subGraphs.length-1)}getSubGraphs(){return this.subGraphs}firstGraph(){if(this.firstGraphFlag)return this.firstGraphFlag=!1,!0;return!1}destructStartLink(J){let Q=J.trim(),Z="arrow_open";switch(Q[0]){case"<":Z="arrow_point",Q=Q.slice(1);break;case"x":Z="arrow_cross",Q=Q.slice(1);break;case"o":Z="arrow_circle",Q=Q.slice(1);break}let U="normal";if(Q.includes("="))U="thick";if(Q.includes("."))U="dotted";return{type:Z,stroke:U}}countChar(J,Q){let Z=Q.length,U=0;for(let K=0;K<Z;++K)if(Q[K]===J)++U;return U}destructEndLink(J){let Q=J.trim(),Z=Q.slice(0,-1),U="arrow_open";switch(Q.slice(-1)){case"x":if(U="arrow_cross",Q.startsWith("x"))U="double_"+U,Z=Z.slice(1);break;case">":if(U="arrow_point",Q.startsWith("<"))U="double_"+U,Z=Z.slice(1);break;case"o":if(U="arrow_circle",Q.startsWith("o"))U="double_"+U,Z=Z.slice(1);break}let K="normal",X=Z.length-1;if(Z.startsWith("="))K="thick";if(Z.startsWith("~"))K="invisible";let Y=this.countChar(".",Z);if(Y)K="dotted",X=Y;return{type:U,stroke:K,length:X}}destructLink(J,Q){let Z=this.destructEndLink(J),U;if(Q){if(U=this.destructStartLink(Q),U.stroke!==Z.stroke)return{type:"INVALID",stroke:"INVALID"};if(U.type==="arrow_open")U.type=Z.type;else{if(U.type!==Z.type)return{type:"INVALID",stroke:"INVALID"};U.type="double_"+U.type}if(U.type==="double_arrow")U.type="double_arrow_point";return U.length=Z.length,U}return Z}exists(J,Q){for(let Z of J)if(Z.nodes.includes(Q))return!0;return!1}makeUniq(J,Q){let Z=[];return J.nodes.forEach((U,K)=>{if(!this.exists(Q,U))Z.push(J.nodes[K])}),{nodes:Z}}getTypeFromVertex(J){if(J.img)return"imageSquare";if(J.icon){if(J.form==="circle")return"iconCircle";if(J.form==="square")return"iconSquare";if(J.form==="rounded")return"iconRounded";return"icon"}switch(J.type){case"square":case void 0:return"squareRect";case"round":return"roundedRect";case"ellipse":return"ellipse";default:return J.type}}findNode(J,Q){return J.find((Z)=>Z.id===Q)}destructEdgeType(J){let Q="none",Z="arrow_point";switch(J){case"arrow_point":case"arrow_circle":case"arrow_cross":Z=J;break;case"double_arrow_point":case"double_arrow_circle":case"double_arrow_cross":Q=J.replace("double_",""),Z=Q;break}return{arrowTypeStart:Q,arrowTypeEnd:Z}}addNodeFromVertex(J,Q,Z,U,K,X){let Y=Z.get(J.id),z=U.get(J.id)??!1,G=this.findNode(Q,J.id);if(G)G.cssStyles=J.styles,G.cssCompiledStyles=this.getCompiledStyles(J.classes),G.cssClasses=J.classes.join(" ");else{let W={id:J.id,label:J.text,labelStyle:"",parentId:Y,padding:K.flowchart?.padding||8,cssStyles:J.styles,cssCompiledStyles:this.getCompiledStyles(["default","node",...J.classes]),cssClasses:"default "+J.classes.join(" "),dir:J.dir,domId:J.domId,look:X,link:J.link,linkTarget:J.linkTarget,tooltip:this.getTooltip(J.id),icon:J.icon,pos:J.pos,img:J.img,assetWidth:J.assetWidth,assetHeight:J.assetHeight,constraint:J.constraint};if(z)Q.push({...W,isGroup:!0,shape:"rect"});else Q.push({...W,isGroup:!1,shape:this.getTypeFromVertex(J)})}}getCompiledStyles(J){let Q=[];for(let Z of J){let U=this.classes.get(Z);if(U?.styles)Q=[...Q,...U.styles??[]].map((K)=>K.trim());if(U?.textStyles)Q=[...Q,...U.textStyles??[]].map((K)=>K.trim())}return Q}getData(){let J=i0(),Q=[],Z=[],U=this.getSubGraphs(),K=new Map,X=new Map;for(let G=U.length-1;G>=0;G--){let W=U[G];if(W.nodes.length>0)X.set(W.id,!0);for(let H of W.nodes)K.set(H,W.id)}for(let G=U.length-1;G>=0;G--){let W=U[G];Q.push({id:W.id,label:W.title,labelStyle:"",parentId:K.get(W.id),padding:8,cssCompiledStyles:this.getCompiledStyles(W.classes),cssClasses:W.classes.join(" "),shape:"rect",dir:W.dir,isGroup:!0,look:J.look})}this.getVertices().forEach((G)=>{this.addNodeFromVertex(G,Q,K,X,J,J.look||"classic")});let z=this.getEdges();return z.forEach((G,W)=>{let{arrowTypeStart:H,arrowTypeEnd:q}=this.destructEdgeType(G.type),F=[...z.defaultStyle??[]];if(G.style)F.push(...G.style);let M={id:Gz(G.start,G.end,{counter:W,prefix:"L"},G.id),isUserDefinedId:G.isUserDefinedId,start:G.start,end:G.end,type:G.type??"normal",label:G.text,labelpos:"c",thickness:G.stroke,minlen:G.length,classes:G?.stroke==="invisible"?"":"edge-thickness-normal edge-pattern-solid flowchart-link",arrowTypeStart:G?.stroke==="invisible"||G?.type==="arrow_open"?"none":H,arrowTypeEnd:G?.stroke==="invisible"||G?.type==="arrow_open"?"none":q,arrowheadStyle:"fill: #333",cssCompiledStyles:this.getCompiledStyles(G.classes),labelStyle:F,style:F,pattern:G.stroke,look:J.look,animate:G.animate,animation:G.animation,curve:G.interpolate||this.edges.defaultInterpolate||J.flowchart?.curve};Z.push(M)}),{nodes:Q,edges:Z,other:{},config:J}}defaultConfig(){return ok.flowchart}},b_6=w(function(J,Q){return Q.db.getClasses()},"getClasses"),x_6=w(async function(J,Q,Z,U){B0.info("REF0:"),B0.info("Drawing state diagram (v2)",Q);let{securityLevel:K,flowchart:X,layout:Y}=i0(),z;if(K==="sandbox")z=j6("#i"+Q);let G=K==="sandbox"?z.nodes()[0].contentDocument:document;B0.debug("Before getData: ");let W=U.db.getData();B0.debug("Data: ",W);let H=xX(Q,K),q=U.db.getDirection();if(W.type=U.type,W.layoutAlgorithm=Dz(Y),W.layoutAlgorithm==="dagre"&&Y==="elk")B0.warn("flowchart-elk was moved to an external package in Mermaid v11. Please refer [release notes](https://github.com/mermaid-js/mermaid/releases/tag/v11.0.0) for more details. This diagram will be rendered using `dagre` layout as a fallback.");W.direction=q,W.nodeSpacing=X?.nodeSpacing||50,W.rankSpacing=X?.rankSpacing||50,W.markers=["point","circle","cross"],W.diagramId=Q,B0.debug("REF1:",W),await $X(W,H);let F=W.config.flowchart?.diagramPadding??8;n8.insertTitle(H,"flowchartTitleText",X?.titleTopMargin||0,U.db.getDiagramTitle()),x5(H,F,"flowchart",X?.useMaxWidth||!1);for(let M of W.nodes){let L=j6(`#${Q} [id="${M.id}"]`);if(!L||!M.link)continue;let A=G.createElementNS("http://www.w3.org/2000/svg","a");if(A.setAttributeNS("http://www.w3.org/2000/svg","class",M.cssClasses),A.setAttributeNS("http://www.w3.org/2000/svg","rel","noopener"),K==="sandbox")A.setAttributeNS("http://www.w3.org/2000/svg","target","_top");else if(M.linkTarget)A.setAttributeNS("http://www.w3.org/2000/svg","target",M.linkTarget);let I=L.insert(function(){return A},":first-child"),R=L.select(".label-container");if(R)I.append(function(){return R.node()});let N=L.select(".label");if(N)I.append(function(){return N.node()})}},"draw"),h_6={getClasses:b_6,draw:x_6},U90=function(){var J=w(function(kJ,c0,T6,z8){for(T6=T6||{},z8=kJ.length;z8--;T6[kJ[z8]]=c0);return T6},"o"),Q=[1,4],Z=[1,3],U=[1,5],K=[1,8,9,10,11,27,34,36,38,44,60,84,85,86,87,88,89,102,105,106,109,111,114,115,116,121,122,123,124],X=[2,2],Y=[1,13],z=[1,14],G=[1,15],W=[1,16],H=[1,23],q=[1,25],F=[1,26],M=[1,27],L=[1,49],A=[1,48],I=[1,29],R=[1,30],N=[1,31],E=[1,32],V=[1,33],j=[1,44],T=[1,46],C=[1,42],$=[1,47],b=[1,43],h=[1,50],_=[1,45],S=[1,51],v=[1,52],f=[1,34],x=[1,35],y=[1,36],m=[1,37],g=[1,57],p=[1,8,9,10,11,27,32,34,36,38,44,60,84,85,86,87,88,89,102,105,106,109,111,114,115,116,121,122,123,124],i=[1,61],l=[1,60],a=[1,62],e=[8,9,11,75,77,78],G0=[1,78],U0=[1,91],O0=[1,96],X0=[1,95],E0=[1,92],W0=[1,88],q0=[1,94],z0=[1,90],K0=[1,97],R0=[1,93],Y0=[1,98],P0=[1,89],F0=[8,9,10,11,40,75,77,78],m0=[8,9,10,11,40,46,75,77,78],J0=[8,9,10,11,29,40,44,46,48,50,52,54,56,58,60,63,65,67,68,70,75,77,78,89,102,105,106,109,111,114,115,116],z6=[8,9,11,44,60,75,77,78,89,102,105,106,109,111,114,115,116],t=[44,60,89,102,105,106,109,111,114,115,116],N0=[1,121],f0=[1,122],l0=[1,124],k0=[1,123],_0=[44,60,62,74,89,102,105,106,109,111,114,115,116],g0=[1,133],h0=[1,147],t0=[1,148],C0=[1,149],y0=[1,150],o=[1,135],w0=[1,137],d=[1,141],L0=[1,142],I0=[1,143],T0=[1,144],$0=[1,145],v0=[1,146],r0=[1,151],u0=[1,152],G6=[1,131],A6=[1,132],r6=[1,139],N6=[1,134],F6=[1,138],P6=[1,136],M6=[8,9,10,11,27,32,34,36,38,44,60,84,85,86,87,88,89,102,105,106,109,111,114,115,116,121,122,123,124],g6=[1,154],O8=[1,156],a6=[8,9,11],U8=[8,9,10,11,14,44,60,89,105,106,109,111,114,115,116],p6=[1,176],u6=[1,172],S0=[1,173],Q6=[1,177],B6=[1,174],D0=[1,175],X6=[77,116,119],W6=[8,9,10,11,12,14,27,29,32,44,60,75,84,85,86,87,88,89,90,105,109,111,114,115,116],_6=[10,106],c6=[31,49,51,53,55,57,62,64,66,67,69,71,116,117,118],d6=[1,247],l6=[1,245],t6=[1,249],g8=[1,243],k6=[1,244],d0=[1,246],V6=[1,248],Z8=[1,250],qJ=[1,268],ZJ=[8,9,11,106],q8=[8,9,10,11,60,84,105,106,109,110,111,112],B9={trace:w(function kJ(){},"trace"),yy:{},symbols_:{error:2,start:3,graphConfig:4,document:5,line:6,statement:7,SEMI:8,NEWLINE:9,SPACE:10,EOF:11,GRAPH:12,NODIR:13,DIR:14,FirstStmtSeparator:15,ending:16,endToken:17,spaceList:18,spaceListNewline:19,vertexStatement:20,separator:21,styleStatement:22,linkStyleStatement:23,classDefStatement:24,classStatement:25,clickStatement:26,subgraph:27,textNoTags:28,SQS:29,text:30,SQE:31,end:32,direction:33,acc_title:34,acc_title_value:35,acc_descr:36,acc_descr_value:37,acc_descr_multiline_value:38,shapeData:39,SHAPE_DATA:40,link:41,node:42,styledVertex:43,AMP:44,vertex:45,STYLE_SEPARATOR:46,idString:47,DOUBLECIRCLESTART:48,DOUBLECIRCLEEND:49,PS:50,PE:51,"(-":52,"-)":53,STADIUMSTART:54,STADIUMEND:55,SUBROUTINESTART:56,SUBROUTINEEND:57,VERTEX_WITH_PROPS_START:58,"NODE_STRING[field]":59,COLON:60,"NODE_STRING[value]":61,PIPE:62,CYLINDERSTART:63,CYLINDEREND:64,DIAMOND_START:65,DIAMOND_STOP:66,TAGEND:67,TRAPSTART:68,TRAPEND:69,INVTRAPSTART:70,INVTRAPEND:71,linkStatement:72,arrowText:73,TESTSTR:74,START_LINK:75,edgeText:76,LINK:77,LINK_ID:78,edgeTextToken:79,STR:80,MD_STR:81,textToken:82,keywords:83,STYLE:84,LINKSTYLE:85,CLASSDEF:86,CLASS:87,CLICK:88,DOWN:89,UP:90,textNoTagsToken:91,stylesOpt:92,"idString[vertex]":93,"idString[class]":94,CALLBACKNAME:95,CALLBACKARGS:96,HREF:97,LINK_TARGET:98,"STR[link]":99,"STR[tooltip]":100,alphaNum:101,DEFAULT:102,numList:103,INTERPOLATE:104,NUM:105,COMMA:106,style:107,styleComponent:108,NODE_STRING:109,UNIT:110,BRKT:111,PCT:112,idStringToken:113,MINUS:114,MULT:115,UNICODE_TEXT:116,TEXT:117,TAGSTART:118,EDGE_TEXT:119,alphaNumToken:120,direction_tb:121,direction_bt:122,direction_rl:123,direction_lr:124,$accept:0,$end:1},terminals_:{2:"error",8:"SEMI",9:"NEWLINE",10:"SPACE",11:"EOF",12:"GRAPH",13:"NODIR",14:"DIR",27:"subgraph",29:"SQS",31:"SQE",32:"end",34:"acc_title",35:"acc_title_value",36:"acc_descr",37:"acc_descr_value",38:"acc_descr_multiline_value",40:"SHAPE_DATA",44:"AMP",46:"STYLE_SEPARATOR",48:"DOUBLECIRCLESTART",49:"DOUBLECIRCLEEND",50:"PS",51:"PE",52:"(-",53:"-)",54:"STADIUMSTART",55:"STADIUMEND",56:"SUBROUTINESTART",57:"SUBROUTINEEND",58:"VERTEX_WITH_PROPS_START",59:"NODE_STRING[field]",60:"COLON",61:"NODE_STRING[value]",62:"PIPE",63:"CYLINDERSTART",64:"CYLINDEREND",65:"DIAMOND_START",66:"DIAMOND_STOP",67:"TAGEND",68:"TRAPSTART",69:"TRAPEND",70:"INVTRAPSTART",71:"INVTRAPEND",74:"TESTSTR",75:"START_LINK",77:"LINK",78:"LINK_ID",80:"STR",81:"MD_STR",84:"STYLE",85:"LINKSTYLE",86:"CLASSDEF",87:"CLASS",88:"CLICK",89:"DOWN",90:"UP",93:"idString[vertex]",94:"idString[class]",95:"CALLBACKNAME",96:"CALLBACKARGS",97:"HREF",98:"LINK_TARGET",99:"STR[link]",100:"STR[tooltip]",102:"DEFAULT",104:"INTERPOLATE",105:"NUM",106:"COMMA",109:"NODE_STRING",110:"UNIT",111:"BRKT",112:"PCT",114:"MINUS",115:"MULT",116:"UNICODE_TEXT",117:"TEXT",118:"TAGSTART",119:"EDGE_TEXT",121:"direction_tb",122:"direction_bt",123:"direction_rl",124:"direction_lr"},productions_:[0,[3,2],[5,0],[5,2],[6,1],[6,1],[6,1],[6,1],[6,1],[4,2],[4,2],[4,2],[4,3],[16,2],[16,1],[17,1],[17,1],[17,1],[15,1],[15,1],[15,2],[19,2],[19,2],[19,1],[19,1],[18,2],[18,1],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,9],[7,6],[7,4],[7,1],[7,2],[7,2],[7,1],[21,1],[21,1],[21,1],[39,2],[39,1],[20,4],[20,3],[20,4],[20,2],[20,2],[20,1],[42,1],[42,6],[42,5],[43,1],[43,3],[45,4],[45,4],[45,6],[45,4],[45,4],[45,4],[45,8],[45,4],[45,4],[45,4],[45,6],[45,4],[45,4],[45,4],[45,4],[45,4],[45,1],[41,2],[41,3],[41,3],[41,1],[41,3],[41,4],[76,1],[76,2],[76,1],[76,1],[72,1],[72,2],[73,3],[30,1],[30,2],[30,1],[30,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[28,1],[28,2],[28,1],[28,1],[24,5],[25,5],[26,2],[26,4],[26,3],[26,5],[26,3],[26,5],[26,5],[26,7],[26,2],[26,4],[26,2],[26,4],[26,4],[26,6],[22,5],[23,5],[23,5],[23,9],[23,9],[23,7],[23,7],[103,1],[103,3],[92,1],[92,3],[107,1],[107,2],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[82,1],[82,1],[82,1],[82,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[79,1],[79,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[47,1],[47,2],[101,1],[101,2],[33,1],[33,1],[33,1],[33,1]],performAction:w(function kJ(c0,T6,z8,C6,wJ,x0,fQ){var p0=x0.length-1;switch(wJ){case 2:this.$=[];break;case 3:if(!Array.isArray(x0[p0])||x0[p0].length>0)x0[p0-1].push(x0[p0]);this.$=x0[p0-1];break;case 4:case 183:this.$=x0[p0];break;case 11:C6.setDirection("TB"),this.$="TB";break;case 12:C6.setDirection(x0[p0-1]),this.$=x0[p0-1];break;case 27:this.$=x0[p0-1].nodes;break;case 28:case 29:case 30:case 31:case 32:this.$=[];break;case 33:this.$=C6.addSubGraph(x0[p0-6],x0[p0-1],x0[p0-4]);break;case 34:this.$=C6.addSubGraph(x0[p0-3],x0[p0-1],x0[p0-3]);break;case 35:this.$=C6.addSubGraph(void 0,x0[p0-1],void 0);break;case 37:this.$=x0[p0].trim(),C6.setAccTitle(this.$);break;case 38:case 39:this.$=x0[p0].trim(),C6.setAccDescription(this.$);break;case 43:this.$=x0[p0-1]+x0[p0];break;case 44:this.$=x0[p0];break;case 45:C6.addVertex(x0[p0-1][x0[p0-1].length-1],void 0,void 0,void 0,void 0,void 0,void 0,x0[p0]),C6.addLink(x0[p0-3].stmt,x0[p0-1],x0[p0-2]),this.$={stmt:x0[p0-1],nodes:x0[p0-1].concat(x0[p0-3].nodes)};break;case 46:C6.addLink(x0[p0-2].stmt,x0[p0],x0[p0-1]),this.$={stmt:x0[p0],nodes:x0[p0].concat(x0[p0-2].nodes)};break;case 47:C6.addLink(x0[p0-3].stmt,x0[p0-1],x0[p0-2]),this.$={stmt:x0[p0-1],nodes:x0[p0-1].concat(x0[p0-3].nodes)};break;case 48:this.$={stmt:x0[p0-1],nodes:x0[p0-1]};break;case 49:C6.addVertex(x0[p0-1][x0[p0-1].length-1],void 0,void 0,void 0,void 0,void 0,void 0,x0[p0]),this.$={stmt:x0[p0-1],nodes:x0[p0-1],shapeData:x0[p0]};break;case 50:this.$={stmt:x0[p0],nodes:x0[p0]};break;case 51:this.$=[x0[p0]];break;case 52:C6.addVertex(x0[p0-5][x0[p0-5].length-1],void 0,void 0,void 0,void 0,void 0,void 0,x0[p0-4]),this.$=x0[p0-5].concat(x0[p0]);break;case 53:this.$=x0[p0-4].concat(x0[p0]);break;case 54:this.$=x0[p0];break;case 55:this.$=x0[p0-2],C6.setClass(x0[p0-2],x0[p0]);break;case 56:this.$=x0[p0-3],C6.addVertex(x0[p0-3],x0[p0-1],"square");break;case 57:this.$=x0[p0-3],C6.addVertex(x0[p0-3],x0[p0-1],"doublecircle");break;case 58:this.$=x0[p0-5],C6.addVertex(x0[p0-5],x0[p0-2],"circle");break;case 59:this.$=x0[p0-3],C6.addVertex(x0[p0-3],x0[p0-1],"ellipse");break;case 60:this.$=x0[p0-3],C6.addVertex(x0[p0-3],x0[p0-1],"stadium");break;case 61:this.$=x0[p0-3],C6.addVertex(x0[p0-3],x0[p0-1],"subroutine");break;case 62:this.$=x0[p0-7],C6.addVertex(x0[p0-7],x0[p0-1],"rect",void 0,void 0,void 0,Object.fromEntries([[x0[p0-5],x0[p0-3]]]));break;case 63:this.$=x0[p0-3],C6.addVertex(x0[p0-3],x0[p0-1],"cylinder");break;case 64:this.$=x0[p0-3],C6.addVertex(x0[p0-3],x0[p0-1],"round");break;case 65:this.$=x0[p0-3],C6.addVertex(x0[p0-3],x0[p0-1],"diamond");break;case 66:this.$=x0[p0-5],C6.addVertex(x0[p0-5],x0[p0-2],"hexagon");break;case 67:this.$=x0[p0-3],C6.addVertex(x0[p0-3],x0[p0-1],"odd");break;case 68:this.$=x0[p0-3],C6.addVertex(x0[p0-3],x0[p0-1],"trapezoid");break;case 69:this.$=x0[p0-3],C6.addVertex(x0[p0-3],x0[p0-1],"inv_trapezoid");break;case 70:this.$=x0[p0-3],C6.addVertex(x0[p0-3],x0[p0-1],"lean_right");break;case 71:this.$=x0[p0-3],C6.addVertex(x0[p0-3],x0[p0-1],"lean_left");break;case 72:this.$=x0[p0],C6.addVertex(x0[p0]);break;case 73:x0[p0-1].text=x0[p0],this.$=x0[p0-1];break;case 74:case 75:x0[p0-2].text=x0[p0-1],this.$=x0[p0-2];break;case 76:this.$=x0[p0];break;case 77:var xJ=C6.destructLink(x0[p0],x0[p0-2]);this.$={type:xJ.type,stroke:xJ.stroke,length:xJ.length,text:x0[p0-1]};break;case 78:var xJ=C6.destructLink(x0[p0],x0[p0-2]);this.$={type:xJ.type,stroke:xJ.stroke,length:xJ.length,text:x0[p0-1],id:x0[p0-3]};break;case 79:this.$={text:x0[p0],type:"text"};break;case 80:this.$={text:x0[p0-1].text+""+x0[p0],type:x0[p0-1].type};break;case 81:this.$={text:x0[p0],type:"string"};break;case 82:this.$={text:x0[p0],type:"markdown"};break;case 83:var xJ=C6.destructLink(x0[p0]);this.$={type:xJ.type,stroke:xJ.stroke,length:xJ.length};break;case 84:var xJ=C6.destructLink(x0[p0]);this.$={type:xJ.type,stroke:xJ.stroke,length:xJ.length,id:x0[p0-1]};break;case 85:this.$=x0[p0-1];break;case 86:this.$={text:x0[p0],type:"text"};break;case 87:this.$={text:x0[p0-1].text+""+x0[p0],type:x0[p0-1].type};break;case 88:this.$={text:x0[p0],type:"string"};break;case 89:case 104:this.$={text:x0[p0],type:"markdown"};break;case 101:this.$={text:x0[p0],type:"text"};break;case 102:this.$={text:x0[p0-1].text+""+x0[p0],type:x0[p0-1].type};break;case 103:this.$={text:x0[p0],type:"text"};break;case 105:this.$=x0[p0-4],C6.addClass(x0[p0-2],x0[p0]);break;case 106:this.$=x0[p0-4],C6.setClass(x0[p0-2],x0[p0]);break;case 107:case 115:this.$=x0[p0-1],C6.setClickEvent(x0[p0-1],x0[p0]);break;case 108:case 116:this.$=x0[p0-3],C6.setClickEvent(x0[p0-3],x0[p0-2]),C6.setTooltip(x0[p0-3],x0[p0]);break;case 109:this.$=x0[p0-2],C6.setClickEvent(x0[p0-2],x0[p0-1],x0[p0]);break;case 110:this.$=x0[p0-4],C6.setClickEvent(x0[p0-4],x0[p0-3],x0[p0-2]),C6.setTooltip(x0[p0-4],x0[p0]);break;case 111:this.$=x0[p0-2],C6.setLink(x0[p0-2],x0[p0]);break;case 112:this.$=x0[p0-4],C6.setLink(x0[p0-4],x0[p0-2]),C6.setTooltip(x0[p0-4],x0[p0]);break;case 113:this.$=x0[p0-4],C6.setLink(x0[p0-4],x0[p0-2],x0[p0]);break;case 114:this.$=x0[p0-6],C6.setLink(x0[p0-6],x0[p0-4],x0[p0]),C6.setTooltip(x0[p0-6],x0[p0-2]);break;case 117:this.$=x0[p0-1],C6.setLink(x0[p0-1],x0[p0]);break;case 118:this.$=x0[p0-3],C6.setLink(x0[p0-3],x0[p0-2]),C6.setTooltip(x0[p0-3],x0[p0]);break;case 119:this.$=x0[p0-3],C6.setLink(x0[p0-3],x0[p0-2],x0[p0]);break;case 120:this.$=x0[p0-5],C6.setLink(x0[p0-5],x0[p0-4],x0[p0]),C6.setTooltip(x0[p0-5],x0[p0-2]);break;case 121:this.$=x0[p0-4],C6.addVertex(x0[p0-2],void 0,void 0,x0[p0]);break;case 122:this.$=x0[p0-4],C6.updateLink([x0[p0-2]],x0[p0]);break;case 123:this.$=x0[p0-4],C6.updateLink(x0[p0-2],x0[p0]);break;case 124:this.$=x0[p0-8],C6.updateLinkInterpolate([x0[p0-6]],x0[p0-2]),C6.updateLink([x0[p0-6]],x0[p0]);break;case 125:this.$=x0[p0-8],C6.updateLinkInterpolate(x0[p0-6],x0[p0-2]),C6.updateLink(x0[p0-6],x0[p0]);break;case 126:this.$=x0[p0-6],C6.updateLinkInterpolate([x0[p0-4]],x0[p0]);break;case 127:this.$=x0[p0-6],C6.updateLinkInterpolate(x0[p0-4],x0[p0]);break;case 128:case 130:this.$=[x0[p0]];break;case 129:case 131:x0[p0-2].push(x0[p0]),this.$=x0[p0-2];break;case 133:this.$=x0[p0-1]+x0[p0];break;case 181:this.$=x0[p0];break;case 182:this.$=x0[p0-1]+""+x0[p0];break;case 184:this.$=x0[p0-1]+""+x0[p0];break;case 185:this.$={stmt:"dir",value:"TB"};break;case 186:this.$={stmt:"dir",value:"BT"};break;case 187:this.$={stmt:"dir",value:"RL"};break;case 188:this.$={stmt:"dir",value:"LR"};break}},"anonymous"),table:[{3:1,4:2,9:Q,10:Z,12:U},{1:[3]},J(K,X,{5:6}),{4:7,9:Q,10:Z,12:U},{4:8,9:Q,10:Z,12:U},{13:[1,9],14:[1,10]},{1:[2,1],6:11,7:12,8:Y,9:z,10:G,11:W,20:17,22:18,23:19,24:20,25:21,26:22,27:H,33:24,34:q,36:F,38:M,42:28,43:38,44:L,45:39,47:40,60:A,84:I,85:R,86:N,87:E,88:V,89:j,102:T,105:C,106:$,109:b,111:h,113:41,114:_,115:S,116:v,121:f,122:x,123:y,124:m},J(K,[2,9]),J(K,[2,10]),J(K,[2,11]),{8:[1,54],9:[1,55],10:g,15:53,18:56},J(p,[2,3]),J(p,[2,4]),J(p,[2,5]),J(p,[2,6]),J(p,[2,7]),J(p,[2,8]),{8:i,9:l,11:a,21:58,41:59,72:63,75:[1,64],77:[1,66],78:[1,65]},{8:i,9:l,11:a,21:67},{8:i,9:l,11:a,21:68},{8:i,9:l,11:a,21:69},{8:i,9:l,11:a,21:70},{8:i,9:l,11:a,21:71},{8:i,9:l,10:[1,72],11:a,21:73},J(p,[2,36]),{35:[1,74]},{37:[1,75]},J(p,[2,39]),J(e,[2,50],{18:76,39:77,10:g,40:G0}),{10:[1,79]},{10:[1,80]},{10:[1,81]},{10:[1,82]},{14:U0,44:O0,60:X0,80:[1,86],89:E0,95:[1,83],97:[1,84],101:85,105:W0,106:q0,109:z0,111:K0,114:R0,115:Y0,116:P0,120:87},J(p,[2,185]),J(p,[2,186]),J(p,[2,187]),J(p,[2,188]),J(F0,[2,51]),J(F0,[2,54],{46:[1,99]}),J(m0,[2,72],{113:112,29:[1,100],44:L,48:[1,101],50:[1,102],52:[1,103],54:[1,104],56:[1,105],58:[1,106],60:A,63:[1,107],65:[1,108],67:[1,109],68:[1,110],70:[1,111],89:j,102:T,105:C,106:$,109:b,111:h,114:_,115:S,116:v}),J(J0,[2,181]),J(J0,[2,142]),J(J0,[2,143]),J(J0,[2,144]),J(J0,[2,145]),J(J0,[2,146]),J(J0,[2,147]),J(J0,[2,148]),J(J0,[2,149]),J(J0,[2,150]),J(J0,[2,151]),J(J0,[2,152]),J(K,[2,12]),J(K,[2,18]),J(K,[2,19]),{9:[1,113]},J(z6,[2,26],{18:114,10:g}),J(p,[2,27]),{42:115,43:38,44:L,45:39,47:40,60:A,89:j,102:T,105:C,106:$,109:b,111:h,113:41,114:_,115:S,116:v},J(p,[2,40]),J(p,[2,41]),J(p,[2,42]),J(t,[2,76],{73:116,62:[1,118],74:[1,117]}),{76:119,79:120,80:N0,81:f0,116:l0,119:k0},{75:[1,125],77:[1,126]},J(_0,[2,83]),J(p,[2,28]),J(p,[2,29]),J(p,[2,30]),J(p,[2,31]),J(p,[2,32]),{10:g0,12:h0,14:t0,27:C0,28:127,32:y0,44:o,60:w0,75:d,80:[1,129],81:[1,130],83:140,84:L0,85:I0,86:T0,87:$0,88:v0,89:r0,90:u0,91:128,105:G6,109:A6,111:r6,114:N6,115:F6,116:P6},J(M6,X,{5:153}),J(p,[2,37]),J(p,[2,38]),J(e,[2,48],{44:g6}),J(e,[2,49],{18:155,10:g,40:O8}),J(F0,[2,44]),{44:L,47:157,60:A,89:j,102:T,105:C,106:$,109:b,111:h,113:41,114:_,115:S,116:v},{102:[1,158],103:159,105:[1,160]},{44:L,47:161,60:A,89:j,102:T,105:C,106:$,109:b,111:h,113:41,114:_,115:S,116:v},{44:L,47:162,60:A,89:j,102:T,105:C,106:$,109:b,111:h,113:41,114:_,115:S,116:v},J(a6,[2,107],{10:[1,163],96:[1,164]}),{80:[1,165]},J(a6,[2,115],{120:167,10:[1,166],14:U0,44:O0,60:X0,89:E0,105:W0,106:q0,109:z0,111:K0,114:R0,115:Y0,116:P0}),J(a6,[2,117],{10:[1,168]}),J(U8,[2,183]),J(U8,[2,170]),J(U8,[2,171]),J(U8,[2,172]),J(U8,[2,173]),J(U8,[2,174]),J(U8,[2,175]),J(U8,[2,176]),J(U8,[2,177]),J(U8,[2,178]),J(U8,[2,179]),J(U8,[2,180]),{44:L,47:169,60:A,89:j,102:T,105:C,106:$,109:b,111:h,113:41,114:_,115:S,116:v},{30:170,67:p6,80:u6,81:S0,82:171,116:Q6,117:B6,118:D0},{30:178,67:p6,80:u6,81:S0,82:171,116:Q6,117:B6,118:D0},{30:180,50:[1,179],67:p6,80:u6,81:S0,82:171,116:Q6,117:B6,118:D0},{30:181,67:p6,80:u6,81:S0,82:171,116:Q6,117:B6,118:D0},{30:182,67:p6,80:u6,81:S0,82:171,116:Q6,117:B6,118:D0},{30:183,67:p6,80:u6,81:S0,82:171,116:Q6,117:B6,118:D0},{109:[1,184]},{30:185,67:p6,80:u6,81:S0,82:171,116:Q6,117:B6,118:D0},{30:186,65:[1,187],67:p6,80:u6,81:S0,82:171,116:Q6,117:B6,118:D0},{30:188,67:p6,80:u6,81:S0,82:171,116:Q6,117:B6,118:D0},{30:189,67:p6,80:u6,81:S0,82:171,116:Q6,117:B6,118:D0},{30:190,67:p6,80:u6,81:S0,82:171,116:Q6,117:B6,118:D0},J(J0,[2,182]),J(K,[2,20]),J(z6,[2,25]),J(e,[2,46],{39:191,18:192,10:g,40:G0}),J(t,[2,73],{10:[1,193]}),{10:[1,194]},{30:195,67:p6,80:u6,81:S0,82:171,116:Q6,117:B6,118:D0},{77:[1,196],79:197,116:l0,119:k0},J(X6,[2,79]),J(X6,[2,81]),J(X6,[2,82]),J(X6,[2,168]),J(X6,[2,169]),{76:198,79:120,80:N0,81:f0,116:l0,119:k0},J(_0,[2,84]),{8:i,9:l,10:g0,11:a,12:h0,14:t0,21:200,27:C0,29:[1,199],32:y0,44:o,60:w0,75:d,83:140,84:L0,85:I0,86:T0,87:$0,88:v0,89:r0,90:u0,91:201,105:G6,109:A6,111:r6,114:N6,115:F6,116:P6},J(W6,[2,101]),J(W6,[2,103]),J(W6,[2,104]),J(W6,[2,157]),J(W6,[2,158]),J(W6,[2,159]),J(W6,[2,160]),J(W6,[2,161]),J(W6,[2,162]),J(W6,[2,163]),J(W6,[2,164]),J(W6,[2,165]),J(W6,[2,166]),J(W6,[2,167]),J(W6,[2,90]),J(W6,[2,91]),J(W6,[2,92]),J(W6,[2,93]),J(W6,[2,94]),J(W6,[2,95]),J(W6,[2,96]),J(W6,[2,97]),J(W6,[2,98]),J(W6,[2,99]),J(W6,[2,100]),{6:11,7:12,8:Y,9:z,10:G,11:W,20:17,22:18,23:19,24:20,25:21,26:22,27:H,32:[1,202],33:24,34:q,36:F,38:M,42:28,43:38,44:L,45:39,47:40,60:A,84:I,85:R,86:N,87:E,88:V,89:j,102:T,105:C,106:$,109:b,111:h,113:41,114:_,115:S,116:v,121:f,122:x,123:y,124:m},{10:g,18:203},{44:[1,204]},J(F0,[2,43]),{10:[1,205],44:L,60:A,89:j,102:T,105:C,106:$,109:b,111:h,113:112,114:_,115:S,116:v},{10:[1,206]},{10:[1,207],106:[1,208]},J(_6,[2,128]),{10:[1,209],44:L,60:A,89:j,102:T,105:C,106:$,109:b,111:h,113:112,114:_,115:S,116:v},{10:[1,210],44:L,60:A,89:j,102:T,105:C,106:$,109:b,111:h,113:112,114:_,115:S,116:v},{80:[1,211]},J(a6,[2,109],{10:[1,212]}),J(a6,[2,111],{10:[1,213]}),{80:[1,214]},J(U8,[2,184]),{80:[1,215],98:[1,216]},J(F0,[2,55],{113:112,44:L,60:A,89:j,102:T,105:C,106:$,109:b,111:h,114:_,115:S,116:v}),{31:[1,217],67:p6,82:218,116:Q6,117:B6,118:D0},J(c6,[2,86]),J(c6,[2,88]),J(c6,[2,89]),J(c6,[2,153]),J(c6,[2,154]),J(c6,[2,155]),J(c6,[2,156]),{49:[1,219],67:p6,82:218,116:Q6,117:B6,118:D0},{30:220,67:p6,80:u6,81:S0,82:171,116:Q6,117:B6,118:D0},{51:[1,221],67:p6,82:218,116:Q6,117:B6,118:D0},{53:[1,222],67:p6,82:218,116:Q6,117:B6,118:D0},{55:[1,223],67:p6,82:218,116:Q6,117:B6,118:D0},{57:[1,224],67:p6,82:218,116:Q6,117:B6,118:D0},{60:[1,225]},{64:[1,226],67:p6,82:218,116:Q6,117:B6,118:D0},{66:[1,227],67:p6,82:218,116:Q6,117:B6,118:D0},{30:228,67:p6,80:u6,81:S0,82:171,116:Q6,117:B6,118:D0},{31:[1,229],67:p6,82:218,116:Q6,117:B6,118:D0},{67:p6,69:[1,230],71:[1,231],82:218,116:Q6,117:B6,118:D0},{67:p6,69:[1,233],71:[1,232],82:218,116:Q6,117:B6,118:D0},J(e,[2,45],{18:155,10:g,40:O8}),J(e,[2,47],{44:g6}),J(t,[2,75]),J(t,[2,74]),{62:[1,234],67:p6,82:218,116:Q6,117:B6,118:D0},J(t,[2,77]),J(X6,[2,80]),{77:[1,235],79:197,116:l0,119:k0},{30:236,67:p6,80:u6,81:S0,82:171,116:Q6,117:B6,118:D0},J(M6,X,{5:237}),J(W6,[2,102]),J(p,[2,35]),{43:238,44:L,45:39,47:40,60:A,89:j,102:T,105:C,106:$,109:b,111:h,113:41,114:_,115:S,116:v},{10:g,18:239},{10:d6,60:l6,84:t6,92:240,105:g8,107:241,108:242,109:k6,110:d0,111:V6,112:Z8},{10:d6,60:l6,84:t6,92:251,104:[1,252],105:g8,107:241,108:242,109:k6,110:d0,111:V6,112:Z8},{10:d6,60:l6,84:t6,92:253,104:[1,254],105:g8,107:241,108:242,109:k6,110:d0,111:V6,112:Z8},{105:[1,255]},{10:d6,60:l6,84:t6,92:256,105:g8,107:241,108:242,109:k6,110:d0,111:V6,112:Z8},{44:L,47:257,60:A,89:j,102:T,105:C,106:$,109:b,111:h,113:41,114:_,115:S,116:v},J(a6,[2,108]),{80:[1,258]},{80:[1,259],98:[1,260]},J(a6,[2,116]),J(a6,[2,118],{10:[1,261]}),J(a6,[2,119]),J(m0,[2,56]),J(c6,[2,87]),J(m0,[2,57]),{51:[1,262],67:p6,82:218,116:Q6,117:B6,118:D0},J(m0,[2,64]),J(m0,[2,59]),J(m0,[2,60]),J(m0,[2,61]),{109:[1,263]},J(m0,[2,63]),J(m0,[2,65]),{66:[1,264],67:p6,82:218,116:Q6,117:B6,118:D0},J(m0,[2,67]),J(m0,[2,68]),J(m0,[2,70]),J(m0,[2,69]),J(m0,[2,71]),J([10,44,60,89,102,105,106,109,111,114,115,116],[2,85]),J(t,[2,78]),{31:[1,265],67:p6,82:218,116:Q6,117:B6,118:D0},{6:11,7:12,8:Y,9:z,10:G,11:W,20:17,22:18,23:19,24:20,25:21,26:22,27:H,32:[1,266],33:24,34:q,36:F,38:M,42:28,43:38,44:L,45:39,47:40,60:A,84:I,85:R,86:N,87:E,88:V,89:j,102:T,105:C,106:$,109:b,111:h,113:41,114:_,115:S,116:v,121:f,122:x,123:y,124:m},J(F0,[2,53]),{43:267,44:L,45:39,47:40,60:A,89:j,102:T,105:C,106:$,109:b,111:h,113:41,114:_,115:S,116:v},J(a6,[2,121],{106:qJ}),J(ZJ,[2,130],{108:269,10:d6,60:l6,84:t6,105:g8,109:k6,110:d0,111:V6,112:Z8}),J(q8,[2,132]),J(q8,[2,134]),J(q8,[2,135]),J(q8,[2,136]),J(q8,[2,137]),J(q8,[2,138]),J(q8,[2,139]),J(q8,[2,140]),J(q8,[2,141]),J(a6,[2,122],{106:qJ}),{10:[1,270]},J(a6,[2,123],{106:qJ}),{10:[1,271]},J(_6,[2,129]),J(a6,[2,105],{106:qJ}),J(a6,[2,106],{113:112,44:L,60:A,89:j,102:T,105:C,106:$,109:b,111:h,114:_,115:S,116:v}),J(a6,[2,110]),J(a6,[2,112],{10:[1,272]}),J(a6,[2,113]),{98:[1,273]},{51:[1,274]},{62:[1,275]},{66:[1,276]},{8:i,9:l,11:a,21:277},J(p,[2,34]),J(F0,[2,52]),{10:d6,60:l6,84:t6,105:g8,107:278,108:242,109:k6,110:d0,111:V6,112:Z8},J(q8,[2,133]),{14:U0,44:O0,60:X0,89:E0,101:279,105:W0,106:q0,109:z0,111:K0,114:R0,115:Y0,116:P0,120:87},{14:U0,44:O0,60:X0,89:E0,101:280,105:W0,106:q0,109:z0,111:K0,114:R0,115:Y0,116:P0,120:87},{98:[1,281]},J(a6,[2,120]),J(m0,[2,58]),{30:282,67:p6,80:u6,81:S0,82:171,116:Q6,117:B6,118:D0},J(m0,[2,66]),J(M6,X,{5:283}),J(ZJ,[2,131],{108:269,10:d6,60:l6,84:t6,105:g8,109:k6,110:d0,111:V6,112:Z8}),J(a6,[2,126],{120:167,10:[1,284],14:U0,44:O0,60:X0,89:E0,105:W0,106:q0,109:z0,111:K0,114:R0,115:Y0,116:P0}),J(a6,[2,127],{120:167,10:[1,285],14:U0,44:O0,60:X0,89:E0,105:W0,106:q0,109:z0,111:K0,114:R0,115:Y0,116:P0}),J(a6,[2,114]),{31:[1,286],67:p6,82:218,116:Q6,117:B6,118:D0},{6:11,7:12,8:Y,9:z,10:G,11:W,20:17,22:18,23:19,24:20,25:21,26:22,27:H,32:[1,287],33:24,34:q,36:F,38:M,42:28,43:38,44:L,45:39,47:40,60:A,84:I,85:R,86:N,87:E,88:V,89:j,102:T,105:C,106:$,109:b,111:h,113:41,114:_,115:S,116:v,121:f,122:x,123:y,124:m},{10:d6,60:l6,84:t6,92:288,105:g8,107:241,108:242,109:k6,110:d0,111:V6,112:Z8},{10:d6,60:l6,84:t6,92:289,105:g8,107:241,108:242,109:k6,110:d0,111:V6,112:Z8},J(m0,[2,62]),J(p,[2,33]),J(a6,[2,124],{106:qJ}),J(a6,[2,125],{106:qJ})],defaultActions:{},parseError:w(function kJ(c0,T6){if(T6.recoverable)this.trace(c0);else{var z8=new Error(c0);throw z8.hash=T6,z8}},"parseError"),parse:w(function kJ(c0){var T6=this,z8=[0],C6=[],wJ=[null],x0=[],fQ=this.table,p0="",xJ=0,YQ=0,cK=0,lK=2,cz=1,C2=x0.slice.call(arguments,1),G4=Object.create(this.lexer),a5={yy:{}};for(var S2 in this.yy)if(Object.prototype.hasOwnProperty.call(this.yy,S2))a5.yy[S2]=this.yy[S2];if(G4.setInput(c0,a5.yy),a5.yy.lexer=G4,a5.yy.parser=this,typeof G4.yylloc=="undefined")G4.yylloc={};var dK=G4.yylloc;x0.push(dK);var CM=G4.options&&G4.options.ranges;if(typeof a5.yy.parseError==="function")this.parseError=a5.yy.parseError;else this.parseError=Object.getPrototypeOf(this).parseError;function $2(JZ){z8.length=z8.length-2*JZ,wJ.length=wJ.length-JZ,x0.length=x0.length-JZ}w($2,"popStack");function lz(){var JZ=C6.pop()||G4.lex()||cz;if(typeof JZ!=="number"){if(JZ instanceof Array)C6=JZ,JZ=C6.pop();JZ=T6.symbols_[JZ]||JZ}return JZ}w(lz,"lex");var l4,pJ,iK,_Q,$J,gW,W4={},rK,bQ,v2,H4;while(!0){if(iK=z8[z8.length-1],this.defaultActions[iK])_Q=this.defaultActions[iK];else{if(l4===null||typeof l4=="undefined")l4=lz();_Q=fQ[iK]&&fQ[iK][l4]}if(typeof _Q==="undefined"||!_Q.length||!_Q[0]){var O7="";H4=[];for(rK in fQ[iK])if(this.terminals_[rK]&&rK>lK)H4.push("'"+this.terminals_[rK]+"'");if(G4.showPosition)O7="Parse error on line "+(xJ+1)+`:
|
|
1100
|
+
You have to call mermaid.initialize.`)}isLinkData(J){return J!==null&&typeof J==="object"&&"id"in J&&typeof J.id==="string"}addLink(J,Q,Z){let U=this.isLinkData(Z)?Z.id.replace("@",""):void 0;B0.info("addLink",J,Q,U);for(let K of J)for(let X of Q){let Y=K===J[J.length-1],z=X===Q[0];if(Y&&z)this.addSingleLink(K,X,Z,U);else this.addSingleLink(K,X,Z,void 0)}}updateLinkInterpolate(J,Q){J.forEach((Z)=>{if(Z==="default")this.edges.defaultInterpolate=Q;else this.edges[Z].interpolate=Q})}updateLink(J,Q){J.forEach((Z)=>{if(typeof Z==="number"&&Z>=this.edges.length)throw new Error(`The index ${Z} for linkStyle is out of bounds. Valid indices for linkStyle are between 0 and ${this.edges.length-1}. (Help: Ensure that the index is within the range of existing edges.)`);if(Z==="default")this.edges.defaultStyle=Q;else if(this.edges[Z].style=Q,(this.edges[Z]?.style?.length??0)>0&&!this.edges[Z]?.style?.some((U)=>U?.startsWith("fill")))this.edges[Z]?.style?.push("fill:none")})}addClass(J,Q){let Z=Q.join().replace(/\\,/g,"§§§").replace(/,/g,";").replace(/§§§/g,",").split(";");J.split(",").forEach((U)=>{let K=this.classes.get(U);if(K===void 0)K={id:U,styles:[],textStyles:[]},this.classes.set(U,K);if(Z!==void 0&&Z!==null)Z.forEach((X)=>{if(/color/.exec(X)){let Y=X.replace("fill","bgFill");K.textStyles.push(Y)}K.styles.push(X)})})}setDirection(J){if(this.direction=J.trim(),/.*</.exec(this.direction))this.direction="RL";if(/.*\^/.exec(this.direction))this.direction="BT";if(/.*>/.exec(this.direction))this.direction="LR";if(/.*v/.exec(this.direction))this.direction="TB";if(this.direction==="TD")this.direction="TB"}setClass(J,Q){for(let Z of J.split(",")){let U=this.vertices.get(Z);if(U)U.classes.push(Q);let K=this.edges.find((Y)=>Y.id===Z);if(K)K.classes.push(Q);let X=this.subGraphLookup.get(Z);if(X)X.classes.push(Q)}}setTooltip(J,Q){if(Q===void 0)return;Q=this.sanitizeText(Q);for(let Z of J.split(","))this.tooltips.set(this.version==="gen-1"?this.lookUpDomId(Z):Z,Q)}setClickFun(J,Q,Z){let U=this.lookUpDomId(J);if(i0().securityLevel!=="loose")return;if(Q===void 0)return;let K=[];if(typeof Z==="string"){K=Z.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let Y=0;Y<K.length;Y++){let z=K[Y].trim();if(z.startsWith('"')&&z.endsWith('"'))z=z.substr(1,z.length-2);K[Y]=z}}if(K.length===0)K.push(J);let X=this.vertices.get(J);if(X)X.haveCallback=!0,this.funs.push(()=>{let Y=document.querySelector(`[id="${U}"]`);if(Y!==null)Y.addEventListener("click",()=>{n8.runFunc(Q,...K)},!1)})}setLink(J,Q,Z){J.split(",").forEach((U)=>{let K=this.vertices.get(U);if(K!==void 0)K.link=n8.formatUrl(Q,this.config),K.linkTarget=Z}),this.setClass(J,"clickable")}getTooltip(J){return this.tooltips.get(J)}setClickEvent(J,Q,Z){J.split(",").forEach((U)=>{this.setClickFun(U,Q,Z)}),this.setClass(J,"clickable")}bindFunctions(J){this.funs.forEach((Q)=>{Q(J)})}getDirection(){return this.direction?.trim()}getVertices(){return this.vertices}getEdges(){return this.edges}getClasses(){return this.classes}setupToolTips(J){let Q=j6(".mermaidTooltip");if((Q._groups||Q)[0][0]===null)Q=j6("body").append("div").attr("class","mermaidTooltip").style("opacity",0);j6(J).select("svg").selectAll("g.node").on("mouseover",(K)=>{let X=j6(K.currentTarget);if(X.attr("title")===null)return;let z=K.currentTarget?.getBoundingClientRect();Q.transition().duration(200).style("opacity",".9"),Q.text(X.attr("title")).style("left",window.scrollX+z.left+(z.right-z.left)/2+"px").style("top",window.scrollY+z.bottom+"px"),Q.html(Q.html().replace(/<br\/>/g,"<br/>")),X.classed("hover",!0)}).on("mouseout",(K)=>{Q.transition().duration(500).style("opacity",0),j6(K.currentTarget).classed("hover",!1)})}clear(J="gen-2"){this.vertices=new Map,this.classes=new Map,this.edges=[],this.funs=[this.setupToolTips.bind(this)],this.subGraphs=[],this.subGraphLookup=new Map,this.subCount=0,this.tooltips=new Map,this.firstGraphFlag=!0,this.version=J,this.config=i0(),rJ()}setGen(J){this.version=J||"gen-2"}defaultStyle(){return"fill:#ffa;stroke: #f66; stroke-width: 3px; stroke-dasharray: 5, 5;fill:#ffa;stroke: #666;"}addSubGraph(J,Q,Z){let U=J.text.trim(),K=Z.text;if(J===Z&&/\s/.exec(Z.text))U=void 0;let Y=w((q)=>{let F={boolean:{},number:{},string:{}},M=[],L;return{nodeList:q.filter(function(I){let R=typeof I;if(I.stmt&&I.stmt==="dir")return L=I.value,!1;if(I.trim()==="")return!1;if(R in F)return F[R].hasOwnProperty(I)?!1:F[R][I]=!0;else return M.includes(I)?!1:M.push(I)}),dir:L}},"uniq")(Q.flat()),z=Y.nodeList,G=Y.dir,W=i0().flowchart??{};if(G=G??(W.inheritDir?this.getDirection()??i0().direction??void 0:void 0),this.version==="gen-1")for(let q=0;q<z.length;q++)z[q]=this.lookUpDomId(z[q]);U=U??"subGraph"+this.subCount,K=K||"",K=this.sanitizeText(K),this.subCount=this.subCount+1;let H={id:U,nodes:z,title:K.trim(),classes:[],dir:G,labelType:Z.type};return B0.info("Adding",H.id,H.nodes,H.dir),H.nodes=this.makeUniq(H,this.subGraphs).nodes,this.subGraphs.push(H),this.subGraphLookup.set(U,H),U}getPosForId(J){for(let[Q,Z]of this.subGraphs.entries())if(Z.id===J)return Q;return-1}indexNodes2(J,Q){let Z=this.subGraphs[Q].nodes;if(this.secCount=this.secCount+1,this.secCount>2000)return{result:!1,count:0};if(this.posCrossRef[this.secCount]=Q,this.subGraphs[Q].id===J)return{result:!0,count:0};let U=0,K=1;while(U<Z.length){let X=this.getPosForId(Z[U]);if(X>=0){let Y=this.indexNodes2(J,X);if(Y.result)return{result:!0,count:K+Y.count};else K=K+Y.count}U=U+1}return{result:!1,count:K}}getDepthFirstPos(J){return this.posCrossRef[J]}indexNodes(){if(this.secCount=-1,this.subGraphs.length>0)this.indexNodes2("none",this.subGraphs.length-1)}getSubGraphs(){return this.subGraphs}firstGraph(){if(this.firstGraphFlag)return this.firstGraphFlag=!1,!0;return!1}destructStartLink(J){let Q=J.trim(),Z="arrow_open";switch(Q[0]){case"<":Z="arrow_point",Q=Q.slice(1);break;case"x":Z="arrow_cross",Q=Q.slice(1);break;case"o":Z="arrow_circle",Q=Q.slice(1);break}let U="normal";if(Q.includes("="))U="thick";if(Q.includes("."))U="dotted";return{type:Z,stroke:U}}countChar(J,Q){let Z=Q.length,U=0;for(let K=0;K<Z;++K)if(Q[K]===J)++U;return U}destructEndLink(J){let Q=J.trim(),Z=Q.slice(0,-1),U="arrow_open";switch(Q.slice(-1)){case"x":if(U="arrow_cross",Q.startsWith("x"))U="double_"+U,Z=Z.slice(1);break;case">":if(U="arrow_point",Q.startsWith("<"))U="double_"+U,Z=Z.slice(1);break;case"o":if(U="arrow_circle",Q.startsWith("o"))U="double_"+U,Z=Z.slice(1);break}let K="normal",X=Z.length-1;if(Z.startsWith("="))K="thick";if(Z.startsWith("~"))K="invisible";let Y=this.countChar(".",Z);if(Y)K="dotted",X=Y;return{type:U,stroke:K,length:X}}destructLink(J,Q){let Z=this.destructEndLink(J),U;if(Q){if(U=this.destructStartLink(Q),U.stroke!==Z.stroke)return{type:"INVALID",stroke:"INVALID"};if(U.type==="arrow_open")U.type=Z.type;else{if(U.type!==Z.type)return{type:"INVALID",stroke:"INVALID"};U.type="double_"+U.type}if(U.type==="double_arrow")U.type="double_arrow_point";return U.length=Z.length,U}return Z}exists(J,Q){for(let Z of J)if(Z.nodes.includes(Q))return!0;return!1}makeUniq(J,Q){let Z=[];return J.nodes.forEach((U,K)=>{if(!this.exists(Q,U))Z.push(J.nodes[K])}),{nodes:Z}}getTypeFromVertex(J){if(J.img)return"imageSquare";if(J.icon){if(J.form==="circle")return"iconCircle";if(J.form==="square")return"iconSquare";if(J.form==="rounded")return"iconRounded";return"icon"}switch(J.type){case"square":case void 0:return"squareRect";case"round":return"roundedRect";case"ellipse":return"ellipse";default:return J.type}}findNode(J,Q){return J.find((Z)=>Z.id===Q)}destructEdgeType(J){let Q="none",Z="arrow_point";switch(J){case"arrow_point":case"arrow_circle":case"arrow_cross":Z=J;break;case"double_arrow_point":case"double_arrow_circle":case"double_arrow_cross":Q=J.replace("double_",""),Z=Q;break}return{arrowTypeStart:Q,arrowTypeEnd:Z}}addNodeFromVertex(J,Q,Z,U,K,X){let Y=Z.get(J.id),z=U.get(J.id)??!1,G=this.findNode(Q,J.id);if(G)G.cssStyles=J.styles,G.cssCompiledStyles=this.getCompiledStyles(J.classes),G.cssClasses=J.classes.join(" ");else{let W={id:J.id,label:J.text,labelStyle:"",parentId:Y,padding:K.flowchart?.padding||8,cssStyles:J.styles,cssCompiledStyles:this.getCompiledStyles(["default","node",...J.classes]),cssClasses:"default "+J.classes.join(" "),dir:J.dir,domId:J.domId,look:X,link:J.link,linkTarget:J.linkTarget,tooltip:this.getTooltip(J.id),icon:J.icon,pos:J.pos,img:J.img,assetWidth:J.assetWidth,assetHeight:J.assetHeight,constraint:J.constraint};if(z)Q.push({...W,isGroup:!0,shape:"rect"});else Q.push({...W,isGroup:!1,shape:this.getTypeFromVertex(J)})}}getCompiledStyles(J){let Q=[];for(let Z of J){let U=this.classes.get(Z);if(U?.styles)Q=[...Q,...U.styles??[]].map((K)=>K.trim());if(U?.textStyles)Q=[...Q,...U.textStyles??[]].map((K)=>K.trim())}return Q}getData(){let J=i0(),Q=[],Z=[],U=this.getSubGraphs(),K=new Map,X=new Map;for(let G=U.length-1;G>=0;G--){let W=U[G];if(W.nodes.length>0)X.set(W.id,!0);for(let H of W.nodes)K.set(H,W.id)}for(let G=U.length-1;G>=0;G--){let W=U[G];Q.push({id:W.id,label:W.title,labelStyle:"",parentId:K.get(W.id),padding:8,cssCompiledStyles:this.getCompiledStyles(W.classes),cssClasses:W.classes.join(" "),shape:"rect",dir:W.dir,isGroup:!0,look:J.look})}this.getVertices().forEach((G)=>{this.addNodeFromVertex(G,Q,K,X,J,J.look||"classic")});let z=this.getEdges();return z.forEach((G,W)=>{let{arrowTypeStart:H,arrowTypeEnd:q}=this.destructEdgeType(G.type),F=[...z.defaultStyle??[]];if(G.style)F.push(...G.style);let M={id:Gz(G.start,G.end,{counter:W,prefix:"L"},G.id),isUserDefinedId:G.isUserDefinedId,start:G.start,end:G.end,type:G.type??"normal",label:G.text,labelpos:"c",thickness:G.stroke,minlen:G.length,classes:G?.stroke==="invisible"?"":"edge-thickness-normal edge-pattern-solid flowchart-link",arrowTypeStart:G?.stroke==="invisible"||G?.type==="arrow_open"?"none":H,arrowTypeEnd:G?.stroke==="invisible"||G?.type==="arrow_open"?"none":q,arrowheadStyle:"fill: #333",cssCompiledStyles:this.getCompiledStyles(G.classes),labelStyle:F,style:F,pattern:G.stroke,look:J.look,animate:G.animate,animation:G.animation,curve:G.interpolate||this.edges.defaultInterpolate||J.flowchart?.curve};Z.push(M)}),{nodes:Q,edges:Z,other:{},config:J}}defaultConfig(){return ok.flowchart}},b_6=w(function(J,Q){return Q.db.getClasses()},"getClasses"),x_6=w(async function(J,Q,Z,U){B0.info("REF0:"),B0.info("Drawing state diagram (v2)",Q);let{securityLevel:K,flowchart:X,layout:Y}=i0(),z;if(K==="sandbox")z=j6("#i"+Q);let G=K==="sandbox"?z.nodes()[0].contentDocument:document;B0.debug("Before getData: ");let W=U.db.getData();B0.debug("Data: ",W);let H=xX(Q,K),q=U.db.getDirection();if(W.type=U.type,W.layoutAlgorithm=Dz(Y),W.layoutAlgorithm==="dagre"&&Y==="elk")B0.warn("flowchart-elk was moved to an external package in Mermaid v11. Please refer [release notes](https://github.com/mermaid-js/mermaid/releases/tag/v11.0.0) for more details. This diagram will be rendered using `dagre` layout as a fallback.");W.direction=q,W.nodeSpacing=X?.nodeSpacing||50,W.rankSpacing=X?.rankSpacing||50,W.markers=["point","circle","cross"],W.diagramId=Q,B0.debug("REF1:",W),await $X(W,H);let F=W.config.flowchart?.diagramPadding??8;n8.insertTitle(H,"flowchartTitleText",X?.titleTopMargin||0,U.db.getDiagramTitle()),x5(H,F,"flowchart",X?.useMaxWidth||!1);for(let M of W.nodes){let L=j6(`#${Q} [id="${M.id}"]`);if(!L||!M.link)continue;let A=G.createElementNS("http://www.w3.org/2000/svg","a");if(A.setAttributeNS("http://www.w3.org/2000/svg","class",M.cssClasses),A.setAttributeNS("http://www.w3.org/2000/svg","rel","noopener"),K==="sandbox")A.setAttributeNS("http://www.w3.org/2000/svg","target","_top");else if(M.linkTarget)A.setAttributeNS("http://www.w3.org/2000/svg","target",M.linkTarget);let I=L.insert(function(){return A},":first-child"),R=L.select(".label-container");if(R)I.append(function(){return R.node()});let N=L.select(".label");if(N)I.append(function(){return N.node()})}},"draw"),h_6={getClasses:b_6,draw:x_6},U90=function(){var J=w(function(kJ,p0,T6,z8){for(T6=T6||{},z8=kJ.length;z8--;T6[kJ[z8]]=p0);return T6},"o"),Q=[1,4],Z=[1,3],U=[1,5],K=[1,8,9,10,11,27,34,36,38,44,60,84,85,86,87,88,89,102,105,106,109,111,114,115,116,121,122,123,124],X=[2,2],Y=[1,13],z=[1,14],G=[1,15],W=[1,16],H=[1,23],q=[1,25],F=[1,26],M=[1,27],L=[1,49],A=[1,48],I=[1,29],R=[1,30],N=[1,31],E=[1,32],V=[1,33],j=[1,44],T=[1,46],C=[1,42],$=[1,47],b=[1,43],h=[1,50],_=[1,45],S=[1,51],v=[1,52],f=[1,34],x=[1,35],y=[1,36],m=[1,37],g=[1,57],p=[1,8,9,10,11,27,32,34,36,38,44,60,84,85,86,87,88,89,102,105,106,109,111,114,115,116,121,122,123,124],i=[1,61],l=[1,60],a=[1,62],e=[8,9,11,75,77,78],G0=[1,78],U0=[1,91],O0=[1,96],X0=[1,95],E0=[1,92],W0=[1,88],q0=[1,94],z0=[1,90],K0=[1,97],R0=[1,93],Y0=[1,98],P0=[1,89],F0=[8,9,10,11,40,75,77,78],m0=[8,9,10,11,40,46,75,77,78],J0=[8,9,10,11,29,40,44,46,48,50,52,54,56,58,60,63,65,67,68,70,75,77,78,89,102,105,106,109,111,114,115,116],z6=[8,9,11,44,60,75,77,78,89,102,105,106,109,111,114,115,116],t=[44,60,89,102,105,106,109,111,114,115,116],N0=[1,121],f0=[1,122],l0=[1,124],k0=[1,123],_0=[44,60,62,74,89,102,105,106,109,111,114,115,116],g0=[1,133],h0=[1,147],t0=[1,148],C0=[1,149],y0=[1,150],o=[1,135],w0=[1,137],d=[1,141],L0=[1,142],I0=[1,143],T0=[1,144],$0=[1,145],v0=[1,146],r0=[1,151],u0=[1,152],G6=[1,131],A6=[1,132],r6=[1,139],N6=[1,134],F6=[1,138],P6=[1,136],M6=[8,9,10,11,27,32,34,36,38,44,60,84,85,86,87,88,89,102,105,106,109,111,114,115,116,121,122,123,124],g6=[1,154],O8=[1,156],a6=[8,9,11],U8=[8,9,10,11,14,44,60,89,105,106,109,111,114,115,116],p6=[1,176],u6=[1,172],S0=[1,173],Q6=[1,177],B6=[1,174],D0=[1,175],X6=[77,116,119],W6=[8,9,10,11,12,14,27,29,32,44,60,75,84,85,86,87,88,89,90,105,109,111,114,115,116],_6=[10,106],c6=[31,49,51,53,55,57,62,64,66,67,69,71,116,117,118],d6=[1,247],l6=[1,245],t6=[1,249],g8=[1,243],k6=[1,244],d0=[1,246],V6=[1,248],Z8=[1,250],qJ=[1,268],ZJ=[8,9,11,106],q8=[8,9,10,11,60,84,105,106,109,110,111,112],B9={trace:w(function kJ(){},"trace"),yy:{},symbols_:{error:2,start:3,graphConfig:4,document:5,line:6,statement:7,SEMI:8,NEWLINE:9,SPACE:10,EOF:11,GRAPH:12,NODIR:13,DIR:14,FirstStmtSeparator:15,ending:16,endToken:17,spaceList:18,spaceListNewline:19,vertexStatement:20,separator:21,styleStatement:22,linkStyleStatement:23,classDefStatement:24,classStatement:25,clickStatement:26,subgraph:27,textNoTags:28,SQS:29,text:30,SQE:31,end:32,direction:33,acc_title:34,acc_title_value:35,acc_descr:36,acc_descr_value:37,acc_descr_multiline_value:38,shapeData:39,SHAPE_DATA:40,link:41,node:42,styledVertex:43,AMP:44,vertex:45,STYLE_SEPARATOR:46,idString:47,DOUBLECIRCLESTART:48,DOUBLECIRCLEEND:49,PS:50,PE:51,"(-":52,"-)":53,STADIUMSTART:54,STADIUMEND:55,SUBROUTINESTART:56,SUBROUTINEEND:57,VERTEX_WITH_PROPS_START:58,"NODE_STRING[field]":59,COLON:60,"NODE_STRING[value]":61,PIPE:62,CYLINDERSTART:63,CYLINDEREND:64,DIAMOND_START:65,DIAMOND_STOP:66,TAGEND:67,TRAPSTART:68,TRAPEND:69,INVTRAPSTART:70,INVTRAPEND:71,linkStatement:72,arrowText:73,TESTSTR:74,START_LINK:75,edgeText:76,LINK:77,LINK_ID:78,edgeTextToken:79,STR:80,MD_STR:81,textToken:82,keywords:83,STYLE:84,LINKSTYLE:85,CLASSDEF:86,CLASS:87,CLICK:88,DOWN:89,UP:90,textNoTagsToken:91,stylesOpt:92,"idString[vertex]":93,"idString[class]":94,CALLBACKNAME:95,CALLBACKARGS:96,HREF:97,LINK_TARGET:98,"STR[link]":99,"STR[tooltip]":100,alphaNum:101,DEFAULT:102,numList:103,INTERPOLATE:104,NUM:105,COMMA:106,style:107,styleComponent:108,NODE_STRING:109,UNIT:110,BRKT:111,PCT:112,idStringToken:113,MINUS:114,MULT:115,UNICODE_TEXT:116,TEXT:117,TAGSTART:118,EDGE_TEXT:119,alphaNumToken:120,direction_tb:121,direction_bt:122,direction_rl:123,direction_lr:124,$accept:0,$end:1},terminals_:{2:"error",8:"SEMI",9:"NEWLINE",10:"SPACE",11:"EOF",12:"GRAPH",13:"NODIR",14:"DIR",27:"subgraph",29:"SQS",31:"SQE",32:"end",34:"acc_title",35:"acc_title_value",36:"acc_descr",37:"acc_descr_value",38:"acc_descr_multiline_value",40:"SHAPE_DATA",44:"AMP",46:"STYLE_SEPARATOR",48:"DOUBLECIRCLESTART",49:"DOUBLECIRCLEEND",50:"PS",51:"PE",52:"(-",53:"-)",54:"STADIUMSTART",55:"STADIUMEND",56:"SUBROUTINESTART",57:"SUBROUTINEEND",58:"VERTEX_WITH_PROPS_START",59:"NODE_STRING[field]",60:"COLON",61:"NODE_STRING[value]",62:"PIPE",63:"CYLINDERSTART",64:"CYLINDEREND",65:"DIAMOND_START",66:"DIAMOND_STOP",67:"TAGEND",68:"TRAPSTART",69:"TRAPEND",70:"INVTRAPSTART",71:"INVTRAPEND",74:"TESTSTR",75:"START_LINK",77:"LINK",78:"LINK_ID",80:"STR",81:"MD_STR",84:"STYLE",85:"LINKSTYLE",86:"CLASSDEF",87:"CLASS",88:"CLICK",89:"DOWN",90:"UP",93:"idString[vertex]",94:"idString[class]",95:"CALLBACKNAME",96:"CALLBACKARGS",97:"HREF",98:"LINK_TARGET",99:"STR[link]",100:"STR[tooltip]",102:"DEFAULT",104:"INTERPOLATE",105:"NUM",106:"COMMA",109:"NODE_STRING",110:"UNIT",111:"BRKT",112:"PCT",114:"MINUS",115:"MULT",116:"UNICODE_TEXT",117:"TEXT",118:"TAGSTART",119:"EDGE_TEXT",121:"direction_tb",122:"direction_bt",123:"direction_rl",124:"direction_lr"},productions_:[0,[3,2],[5,0],[5,2],[6,1],[6,1],[6,1],[6,1],[6,1],[4,2],[4,2],[4,2],[4,3],[16,2],[16,1],[17,1],[17,1],[17,1],[15,1],[15,1],[15,2],[19,2],[19,2],[19,1],[19,1],[18,2],[18,1],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,9],[7,6],[7,4],[7,1],[7,2],[7,2],[7,1],[21,1],[21,1],[21,1],[39,2],[39,1],[20,4],[20,3],[20,4],[20,2],[20,2],[20,1],[42,1],[42,6],[42,5],[43,1],[43,3],[45,4],[45,4],[45,6],[45,4],[45,4],[45,4],[45,8],[45,4],[45,4],[45,4],[45,6],[45,4],[45,4],[45,4],[45,4],[45,4],[45,1],[41,2],[41,3],[41,3],[41,1],[41,3],[41,4],[76,1],[76,2],[76,1],[76,1],[72,1],[72,2],[73,3],[30,1],[30,2],[30,1],[30,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[28,1],[28,2],[28,1],[28,1],[24,5],[25,5],[26,2],[26,4],[26,3],[26,5],[26,3],[26,5],[26,5],[26,7],[26,2],[26,4],[26,2],[26,4],[26,4],[26,6],[22,5],[23,5],[23,5],[23,9],[23,9],[23,7],[23,7],[103,1],[103,3],[92,1],[92,3],[107,1],[107,2],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[82,1],[82,1],[82,1],[82,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[79,1],[79,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[47,1],[47,2],[101,1],[101,2],[33,1],[33,1],[33,1],[33,1]],performAction:w(function kJ(p0,T6,z8,C6,wJ,x0,fQ){var c0=x0.length-1;switch(wJ){case 2:this.$=[];break;case 3:if(!Array.isArray(x0[c0])||x0[c0].length>0)x0[c0-1].push(x0[c0]);this.$=x0[c0-1];break;case 4:case 183:this.$=x0[c0];break;case 11:C6.setDirection("TB"),this.$="TB";break;case 12:C6.setDirection(x0[c0-1]),this.$=x0[c0-1];break;case 27:this.$=x0[c0-1].nodes;break;case 28:case 29:case 30:case 31:case 32:this.$=[];break;case 33:this.$=C6.addSubGraph(x0[c0-6],x0[c0-1],x0[c0-4]);break;case 34:this.$=C6.addSubGraph(x0[c0-3],x0[c0-1],x0[c0-3]);break;case 35:this.$=C6.addSubGraph(void 0,x0[c0-1],void 0);break;case 37:this.$=x0[c0].trim(),C6.setAccTitle(this.$);break;case 38:case 39:this.$=x0[c0].trim(),C6.setAccDescription(this.$);break;case 43:this.$=x0[c0-1]+x0[c0];break;case 44:this.$=x0[c0];break;case 45:C6.addVertex(x0[c0-1][x0[c0-1].length-1],void 0,void 0,void 0,void 0,void 0,void 0,x0[c0]),C6.addLink(x0[c0-3].stmt,x0[c0-1],x0[c0-2]),this.$={stmt:x0[c0-1],nodes:x0[c0-1].concat(x0[c0-3].nodes)};break;case 46:C6.addLink(x0[c0-2].stmt,x0[c0],x0[c0-1]),this.$={stmt:x0[c0],nodes:x0[c0].concat(x0[c0-2].nodes)};break;case 47:C6.addLink(x0[c0-3].stmt,x0[c0-1],x0[c0-2]),this.$={stmt:x0[c0-1],nodes:x0[c0-1].concat(x0[c0-3].nodes)};break;case 48:this.$={stmt:x0[c0-1],nodes:x0[c0-1]};break;case 49:C6.addVertex(x0[c0-1][x0[c0-1].length-1],void 0,void 0,void 0,void 0,void 0,void 0,x0[c0]),this.$={stmt:x0[c0-1],nodes:x0[c0-1],shapeData:x0[c0]};break;case 50:this.$={stmt:x0[c0],nodes:x0[c0]};break;case 51:this.$=[x0[c0]];break;case 52:C6.addVertex(x0[c0-5][x0[c0-5].length-1],void 0,void 0,void 0,void 0,void 0,void 0,x0[c0-4]),this.$=x0[c0-5].concat(x0[c0]);break;case 53:this.$=x0[c0-4].concat(x0[c0]);break;case 54:this.$=x0[c0];break;case 55:this.$=x0[c0-2],C6.setClass(x0[c0-2],x0[c0]);break;case 56:this.$=x0[c0-3],C6.addVertex(x0[c0-3],x0[c0-1],"square");break;case 57:this.$=x0[c0-3],C6.addVertex(x0[c0-3],x0[c0-1],"doublecircle");break;case 58:this.$=x0[c0-5],C6.addVertex(x0[c0-5],x0[c0-2],"circle");break;case 59:this.$=x0[c0-3],C6.addVertex(x0[c0-3],x0[c0-1],"ellipse");break;case 60:this.$=x0[c0-3],C6.addVertex(x0[c0-3],x0[c0-1],"stadium");break;case 61:this.$=x0[c0-3],C6.addVertex(x0[c0-3],x0[c0-1],"subroutine");break;case 62:this.$=x0[c0-7],C6.addVertex(x0[c0-7],x0[c0-1],"rect",void 0,void 0,void 0,Object.fromEntries([[x0[c0-5],x0[c0-3]]]));break;case 63:this.$=x0[c0-3],C6.addVertex(x0[c0-3],x0[c0-1],"cylinder");break;case 64:this.$=x0[c0-3],C6.addVertex(x0[c0-3],x0[c0-1],"round");break;case 65:this.$=x0[c0-3],C6.addVertex(x0[c0-3],x0[c0-1],"diamond");break;case 66:this.$=x0[c0-5],C6.addVertex(x0[c0-5],x0[c0-2],"hexagon");break;case 67:this.$=x0[c0-3],C6.addVertex(x0[c0-3],x0[c0-1],"odd");break;case 68:this.$=x0[c0-3],C6.addVertex(x0[c0-3],x0[c0-1],"trapezoid");break;case 69:this.$=x0[c0-3],C6.addVertex(x0[c0-3],x0[c0-1],"inv_trapezoid");break;case 70:this.$=x0[c0-3],C6.addVertex(x0[c0-3],x0[c0-1],"lean_right");break;case 71:this.$=x0[c0-3],C6.addVertex(x0[c0-3],x0[c0-1],"lean_left");break;case 72:this.$=x0[c0],C6.addVertex(x0[c0]);break;case 73:x0[c0-1].text=x0[c0],this.$=x0[c0-1];break;case 74:case 75:x0[c0-2].text=x0[c0-1],this.$=x0[c0-2];break;case 76:this.$=x0[c0];break;case 77:var xJ=C6.destructLink(x0[c0],x0[c0-2]);this.$={type:xJ.type,stroke:xJ.stroke,length:xJ.length,text:x0[c0-1]};break;case 78:var xJ=C6.destructLink(x0[c0],x0[c0-2]);this.$={type:xJ.type,stroke:xJ.stroke,length:xJ.length,text:x0[c0-1],id:x0[c0-3]};break;case 79:this.$={text:x0[c0],type:"text"};break;case 80:this.$={text:x0[c0-1].text+""+x0[c0],type:x0[c0-1].type};break;case 81:this.$={text:x0[c0],type:"string"};break;case 82:this.$={text:x0[c0],type:"markdown"};break;case 83:var xJ=C6.destructLink(x0[c0]);this.$={type:xJ.type,stroke:xJ.stroke,length:xJ.length};break;case 84:var xJ=C6.destructLink(x0[c0]);this.$={type:xJ.type,stroke:xJ.stroke,length:xJ.length,id:x0[c0-1]};break;case 85:this.$=x0[c0-1];break;case 86:this.$={text:x0[c0],type:"text"};break;case 87:this.$={text:x0[c0-1].text+""+x0[c0],type:x0[c0-1].type};break;case 88:this.$={text:x0[c0],type:"string"};break;case 89:case 104:this.$={text:x0[c0],type:"markdown"};break;case 101:this.$={text:x0[c0],type:"text"};break;case 102:this.$={text:x0[c0-1].text+""+x0[c0],type:x0[c0-1].type};break;case 103:this.$={text:x0[c0],type:"text"};break;case 105:this.$=x0[c0-4],C6.addClass(x0[c0-2],x0[c0]);break;case 106:this.$=x0[c0-4],C6.setClass(x0[c0-2],x0[c0]);break;case 107:case 115:this.$=x0[c0-1],C6.setClickEvent(x0[c0-1],x0[c0]);break;case 108:case 116:this.$=x0[c0-3],C6.setClickEvent(x0[c0-3],x0[c0-2]),C6.setTooltip(x0[c0-3],x0[c0]);break;case 109:this.$=x0[c0-2],C6.setClickEvent(x0[c0-2],x0[c0-1],x0[c0]);break;case 110:this.$=x0[c0-4],C6.setClickEvent(x0[c0-4],x0[c0-3],x0[c0-2]),C6.setTooltip(x0[c0-4],x0[c0]);break;case 111:this.$=x0[c0-2],C6.setLink(x0[c0-2],x0[c0]);break;case 112:this.$=x0[c0-4],C6.setLink(x0[c0-4],x0[c0-2]),C6.setTooltip(x0[c0-4],x0[c0]);break;case 113:this.$=x0[c0-4],C6.setLink(x0[c0-4],x0[c0-2],x0[c0]);break;case 114:this.$=x0[c0-6],C6.setLink(x0[c0-6],x0[c0-4],x0[c0]),C6.setTooltip(x0[c0-6],x0[c0-2]);break;case 117:this.$=x0[c0-1],C6.setLink(x0[c0-1],x0[c0]);break;case 118:this.$=x0[c0-3],C6.setLink(x0[c0-3],x0[c0-2]),C6.setTooltip(x0[c0-3],x0[c0]);break;case 119:this.$=x0[c0-3],C6.setLink(x0[c0-3],x0[c0-2],x0[c0]);break;case 120:this.$=x0[c0-5],C6.setLink(x0[c0-5],x0[c0-4],x0[c0]),C6.setTooltip(x0[c0-5],x0[c0-2]);break;case 121:this.$=x0[c0-4],C6.addVertex(x0[c0-2],void 0,void 0,x0[c0]);break;case 122:this.$=x0[c0-4],C6.updateLink([x0[c0-2]],x0[c0]);break;case 123:this.$=x0[c0-4],C6.updateLink(x0[c0-2],x0[c0]);break;case 124:this.$=x0[c0-8],C6.updateLinkInterpolate([x0[c0-6]],x0[c0-2]),C6.updateLink([x0[c0-6]],x0[c0]);break;case 125:this.$=x0[c0-8],C6.updateLinkInterpolate(x0[c0-6],x0[c0-2]),C6.updateLink(x0[c0-6],x0[c0]);break;case 126:this.$=x0[c0-6],C6.updateLinkInterpolate([x0[c0-4]],x0[c0]);break;case 127:this.$=x0[c0-6],C6.updateLinkInterpolate(x0[c0-4],x0[c0]);break;case 128:case 130:this.$=[x0[c0]];break;case 129:case 131:x0[c0-2].push(x0[c0]),this.$=x0[c0-2];break;case 133:this.$=x0[c0-1]+x0[c0];break;case 181:this.$=x0[c0];break;case 182:this.$=x0[c0-1]+""+x0[c0];break;case 184:this.$=x0[c0-1]+""+x0[c0];break;case 185:this.$={stmt:"dir",value:"TB"};break;case 186:this.$={stmt:"dir",value:"BT"};break;case 187:this.$={stmt:"dir",value:"RL"};break;case 188:this.$={stmt:"dir",value:"LR"};break}},"anonymous"),table:[{3:1,4:2,9:Q,10:Z,12:U},{1:[3]},J(K,X,{5:6}),{4:7,9:Q,10:Z,12:U},{4:8,9:Q,10:Z,12:U},{13:[1,9],14:[1,10]},{1:[2,1],6:11,7:12,8:Y,9:z,10:G,11:W,20:17,22:18,23:19,24:20,25:21,26:22,27:H,33:24,34:q,36:F,38:M,42:28,43:38,44:L,45:39,47:40,60:A,84:I,85:R,86:N,87:E,88:V,89:j,102:T,105:C,106:$,109:b,111:h,113:41,114:_,115:S,116:v,121:f,122:x,123:y,124:m},J(K,[2,9]),J(K,[2,10]),J(K,[2,11]),{8:[1,54],9:[1,55],10:g,15:53,18:56},J(p,[2,3]),J(p,[2,4]),J(p,[2,5]),J(p,[2,6]),J(p,[2,7]),J(p,[2,8]),{8:i,9:l,11:a,21:58,41:59,72:63,75:[1,64],77:[1,66],78:[1,65]},{8:i,9:l,11:a,21:67},{8:i,9:l,11:a,21:68},{8:i,9:l,11:a,21:69},{8:i,9:l,11:a,21:70},{8:i,9:l,11:a,21:71},{8:i,9:l,10:[1,72],11:a,21:73},J(p,[2,36]),{35:[1,74]},{37:[1,75]},J(p,[2,39]),J(e,[2,50],{18:76,39:77,10:g,40:G0}),{10:[1,79]},{10:[1,80]},{10:[1,81]},{10:[1,82]},{14:U0,44:O0,60:X0,80:[1,86],89:E0,95:[1,83],97:[1,84],101:85,105:W0,106:q0,109:z0,111:K0,114:R0,115:Y0,116:P0,120:87},J(p,[2,185]),J(p,[2,186]),J(p,[2,187]),J(p,[2,188]),J(F0,[2,51]),J(F0,[2,54],{46:[1,99]}),J(m0,[2,72],{113:112,29:[1,100],44:L,48:[1,101],50:[1,102],52:[1,103],54:[1,104],56:[1,105],58:[1,106],60:A,63:[1,107],65:[1,108],67:[1,109],68:[1,110],70:[1,111],89:j,102:T,105:C,106:$,109:b,111:h,114:_,115:S,116:v}),J(J0,[2,181]),J(J0,[2,142]),J(J0,[2,143]),J(J0,[2,144]),J(J0,[2,145]),J(J0,[2,146]),J(J0,[2,147]),J(J0,[2,148]),J(J0,[2,149]),J(J0,[2,150]),J(J0,[2,151]),J(J0,[2,152]),J(K,[2,12]),J(K,[2,18]),J(K,[2,19]),{9:[1,113]},J(z6,[2,26],{18:114,10:g}),J(p,[2,27]),{42:115,43:38,44:L,45:39,47:40,60:A,89:j,102:T,105:C,106:$,109:b,111:h,113:41,114:_,115:S,116:v},J(p,[2,40]),J(p,[2,41]),J(p,[2,42]),J(t,[2,76],{73:116,62:[1,118],74:[1,117]}),{76:119,79:120,80:N0,81:f0,116:l0,119:k0},{75:[1,125],77:[1,126]},J(_0,[2,83]),J(p,[2,28]),J(p,[2,29]),J(p,[2,30]),J(p,[2,31]),J(p,[2,32]),{10:g0,12:h0,14:t0,27:C0,28:127,32:y0,44:o,60:w0,75:d,80:[1,129],81:[1,130],83:140,84:L0,85:I0,86:T0,87:$0,88:v0,89:r0,90:u0,91:128,105:G6,109:A6,111:r6,114:N6,115:F6,116:P6},J(M6,X,{5:153}),J(p,[2,37]),J(p,[2,38]),J(e,[2,48],{44:g6}),J(e,[2,49],{18:155,10:g,40:O8}),J(F0,[2,44]),{44:L,47:157,60:A,89:j,102:T,105:C,106:$,109:b,111:h,113:41,114:_,115:S,116:v},{102:[1,158],103:159,105:[1,160]},{44:L,47:161,60:A,89:j,102:T,105:C,106:$,109:b,111:h,113:41,114:_,115:S,116:v},{44:L,47:162,60:A,89:j,102:T,105:C,106:$,109:b,111:h,113:41,114:_,115:S,116:v},J(a6,[2,107],{10:[1,163],96:[1,164]}),{80:[1,165]},J(a6,[2,115],{120:167,10:[1,166],14:U0,44:O0,60:X0,89:E0,105:W0,106:q0,109:z0,111:K0,114:R0,115:Y0,116:P0}),J(a6,[2,117],{10:[1,168]}),J(U8,[2,183]),J(U8,[2,170]),J(U8,[2,171]),J(U8,[2,172]),J(U8,[2,173]),J(U8,[2,174]),J(U8,[2,175]),J(U8,[2,176]),J(U8,[2,177]),J(U8,[2,178]),J(U8,[2,179]),J(U8,[2,180]),{44:L,47:169,60:A,89:j,102:T,105:C,106:$,109:b,111:h,113:41,114:_,115:S,116:v},{30:170,67:p6,80:u6,81:S0,82:171,116:Q6,117:B6,118:D0},{30:178,67:p6,80:u6,81:S0,82:171,116:Q6,117:B6,118:D0},{30:180,50:[1,179],67:p6,80:u6,81:S0,82:171,116:Q6,117:B6,118:D0},{30:181,67:p6,80:u6,81:S0,82:171,116:Q6,117:B6,118:D0},{30:182,67:p6,80:u6,81:S0,82:171,116:Q6,117:B6,118:D0},{30:183,67:p6,80:u6,81:S0,82:171,116:Q6,117:B6,118:D0},{109:[1,184]},{30:185,67:p6,80:u6,81:S0,82:171,116:Q6,117:B6,118:D0},{30:186,65:[1,187],67:p6,80:u6,81:S0,82:171,116:Q6,117:B6,118:D0},{30:188,67:p6,80:u6,81:S0,82:171,116:Q6,117:B6,118:D0},{30:189,67:p6,80:u6,81:S0,82:171,116:Q6,117:B6,118:D0},{30:190,67:p6,80:u6,81:S0,82:171,116:Q6,117:B6,118:D0},J(J0,[2,182]),J(K,[2,20]),J(z6,[2,25]),J(e,[2,46],{39:191,18:192,10:g,40:G0}),J(t,[2,73],{10:[1,193]}),{10:[1,194]},{30:195,67:p6,80:u6,81:S0,82:171,116:Q6,117:B6,118:D0},{77:[1,196],79:197,116:l0,119:k0},J(X6,[2,79]),J(X6,[2,81]),J(X6,[2,82]),J(X6,[2,168]),J(X6,[2,169]),{76:198,79:120,80:N0,81:f0,116:l0,119:k0},J(_0,[2,84]),{8:i,9:l,10:g0,11:a,12:h0,14:t0,21:200,27:C0,29:[1,199],32:y0,44:o,60:w0,75:d,83:140,84:L0,85:I0,86:T0,87:$0,88:v0,89:r0,90:u0,91:201,105:G6,109:A6,111:r6,114:N6,115:F6,116:P6},J(W6,[2,101]),J(W6,[2,103]),J(W6,[2,104]),J(W6,[2,157]),J(W6,[2,158]),J(W6,[2,159]),J(W6,[2,160]),J(W6,[2,161]),J(W6,[2,162]),J(W6,[2,163]),J(W6,[2,164]),J(W6,[2,165]),J(W6,[2,166]),J(W6,[2,167]),J(W6,[2,90]),J(W6,[2,91]),J(W6,[2,92]),J(W6,[2,93]),J(W6,[2,94]),J(W6,[2,95]),J(W6,[2,96]),J(W6,[2,97]),J(W6,[2,98]),J(W6,[2,99]),J(W6,[2,100]),{6:11,7:12,8:Y,9:z,10:G,11:W,20:17,22:18,23:19,24:20,25:21,26:22,27:H,32:[1,202],33:24,34:q,36:F,38:M,42:28,43:38,44:L,45:39,47:40,60:A,84:I,85:R,86:N,87:E,88:V,89:j,102:T,105:C,106:$,109:b,111:h,113:41,114:_,115:S,116:v,121:f,122:x,123:y,124:m},{10:g,18:203},{44:[1,204]},J(F0,[2,43]),{10:[1,205],44:L,60:A,89:j,102:T,105:C,106:$,109:b,111:h,113:112,114:_,115:S,116:v},{10:[1,206]},{10:[1,207],106:[1,208]},J(_6,[2,128]),{10:[1,209],44:L,60:A,89:j,102:T,105:C,106:$,109:b,111:h,113:112,114:_,115:S,116:v},{10:[1,210],44:L,60:A,89:j,102:T,105:C,106:$,109:b,111:h,113:112,114:_,115:S,116:v},{80:[1,211]},J(a6,[2,109],{10:[1,212]}),J(a6,[2,111],{10:[1,213]}),{80:[1,214]},J(U8,[2,184]),{80:[1,215],98:[1,216]},J(F0,[2,55],{113:112,44:L,60:A,89:j,102:T,105:C,106:$,109:b,111:h,114:_,115:S,116:v}),{31:[1,217],67:p6,82:218,116:Q6,117:B6,118:D0},J(c6,[2,86]),J(c6,[2,88]),J(c6,[2,89]),J(c6,[2,153]),J(c6,[2,154]),J(c6,[2,155]),J(c6,[2,156]),{49:[1,219],67:p6,82:218,116:Q6,117:B6,118:D0},{30:220,67:p6,80:u6,81:S0,82:171,116:Q6,117:B6,118:D0},{51:[1,221],67:p6,82:218,116:Q6,117:B6,118:D0},{53:[1,222],67:p6,82:218,116:Q6,117:B6,118:D0},{55:[1,223],67:p6,82:218,116:Q6,117:B6,118:D0},{57:[1,224],67:p6,82:218,116:Q6,117:B6,118:D0},{60:[1,225]},{64:[1,226],67:p6,82:218,116:Q6,117:B6,118:D0},{66:[1,227],67:p6,82:218,116:Q6,117:B6,118:D0},{30:228,67:p6,80:u6,81:S0,82:171,116:Q6,117:B6,118:D0},{31:[1,229],67:p6,82:218,116:Q6,117:B6,118:D0},{67:p6,69:[1,230],71:[1,231],82:218,116:Q6,117:B6,118:D0},{67:p6,69:[1,233],71:[1,232],82:218,116:Q6,117:B6,118:D0},J(e,[2,45],{18:155,10:g,40:O8}),J(e,[2,47],{44:g6}),J(t,[2,75]),J(t,[2,74]),{62:[1,234],67:p6,82:218,116:Q6,117:B6,118:D0},J(t,[2,77]),J(X6,[2,80]),{77:[1,235],79:197,116:l0,119:k0},{30:236,67:p6,80:u6,81:S0,82:171,116:Q6,117:B6,118:D0},J(M6,X,{5:237}),J(W6,[2,102]),J(p,[2,35]),{43:238,44:L,45:39,47:40,60:A,89:j,102:T,105:C,106:$,109:b,111:h,113:41,114:_,115:S,116:v},{10:g,18:239},{10:d6,60:l6,84:t6,92:240,105:g8,107:241,108:242,109:k6,110:d0,111:V6,112:Z8},{10:d6,60:l6,84:t6,92:251,104:[1,252],105:g8,107:241,108:242,109:k6,110:d0,111:V6,112:Z8},{10:d6,60:l6,84:t6,92:253,104:[1,254],105:g8,107:241,108:242,109:k6,110:d0,111:V6,112:Z8},{105:[1,255]},{10:d6,60:l6,84:t6,92:256,105:g8,107:241,108:242,109:k6,110:d0,111:V6,112:Z8},{44:L,47:257,60:A,89:j,102:T,105:C,106:$,109:b,111:h,113:41,114:_,115:S,116:v},J(a6,[2,108]),{80:[1,258]},{80:[1,259],98:[1,260]},J(a6,[2,116]),J(a6,[2,118],{10:[1,261]}),J(a6,[2,119]),J(m0,[2,56]),J(c6,[2,87]),J(m0,[2,57]),{51:[1,262],67:p6,82:218,116:Q6,117:B6,118:D0},J(m0,[2,64]),J(m0,[2,59]),J(m0,[2,60]),J(m0,[2,61]),{109:[1,263]},J(m0,[2,63]),J(m0,[2,65]),{66:[1,264],67:p6,82:218,116:Q6,117:B6,118:D0},J(m0,[2,67]),J(m0,[2,68]),J(m0,[2,70]),J(m0,[2,69]),J(m0,[2,71]),J([10,44,60,89,102,105,106,109,111,114,115,116],[2,85]),J(t,[2,78]),{31:[1,265],67:p6,82:218,116:Q6,117:B6,118:D0},{6:11,7:12,8:Y,9:z,10:G,11:W,20:17,22:18,23:19,24:20,25:21,26:22,27:H,32:[1,266],33:24,34:q,36:F,38:M,42:28,43:38,44:L,45:39,47:40,60:A,84:I,85:R,86:N,87:E,88:V,89:j,102:T,105:C,106:$,109:b,111:h,113:41,114:_,115:S,116:v,121:f,122:x,123:y,124:m},J(F0,[2,53]),{43:267,44:L,45:39,47:40,60:A,89:j,102:T,105:C,106:$,109:b,111:h,113:41,114:_,115:S,116:v},J(a6,[2,121],{106:qJ}),J(ZJ,[2,130],{108:269,10:d6,60:l6,84:t6,105:g8,109:k6,110:d0,111:V6,112:Z8}),J(q8,[2,132]),J(q8,[2,134]),J(q8,[2,135]),J(q8,[2,136]),J(q8,[2,137]),J(q8,[2,138]),J(q8,[2,139]),J(q8,[2,140]),J(q8,[2,141]),J(a6,[2,122],{106:qJ}),{10:[1,270]},J(a6,[2,123],{106:qJ}),{10:[1,271]},J(_6,[2,129]),J(a6,[2,105],{106:qJ}),J(a6,[2,106],{113:112,44:L,60:A,89:j,102:T,105:C,106:$,109:b,111:h,114:_,115:S,116:v}),J(a6,[2,110]),J(a6,[2,112],{10:[1,272]}),J(a6,[2,113]),{98:[1,273]},{51:[1,274]},{62:[1,275]},{66:[1,276]},{8:i,9:l,11:a,21:277},J(p,[2,34]),J(F0,[2,52]),{10:d6,60:l6,84:t6,105:g8,107:278,108:242,109:k6,110:d0,111:V6,112:Z8},J(q8,[2,133]),{14:U0,44:O0,60:X0,89:E0,101:279,105:W0,106:q0,109:z0,111:K0,114:R0,115:Y0,116:P0,120:87},{14:U0,44:O0,60:X0,89:E0,101:280,105:W0,106:q0,109:z0,111:K0,114:R0,115:Y0,116:P0,120:87},{98:[1,281]},J(a6,[2,120]),J(m0,[2,58]),{30:282,67:p6,80:u6,81:S0,82:171,116:Q6,117:B6,118:D0},J(m0,[2,66]),J(M6,X,{5:283}),J(ZJ,[2,131],{108:269,10:d6,60:l6,84:t6,105:g8,109:k6,110:d0,111:V6,112:Z8}),J(a6,[2,126],{120:167,10:[1,284],14:U0,44:O0,60:X0,89:E0,105:W0,106:q0,109:z0,111:K0,114:R0,115:Y0,116:P0}),J(a6,[2,127],{120:167,10:[1,285],14:U0,44:O0,60:X0,89:E0,105:W0,106:q0,109:z0,111:K0,114:R0,115:Y0,116:P0}),J(a6,[2,114]),{31:[1,286],67:p6,82:218,116:Q6,117:B6,118:D0},{6:11,7:12,8:Y,9:z,10:G,11:W,20:17,22:18,23:19,24:20,25:21,26:22,27:H,32:[1,287],33:24,34:q,36:F,38:M,42:28,43:38,44:L,45:39,47:40,60:A,84:I,85:R,86:N,87:E,88:V,89:j,102:T,105:C,106:$,109:b,111:h,113:41,114:_,115:S,116:v,121:f,122:x,123:y,124:m},{10:d6,60:l6,84:t6,92:288,105:g8,107:241,108:242,109:k6,110:d0,111:V6,112:Z8},{10:d6,60:l6,84:t6,92:289,105:g8,107:241,108:242,109:k6,110:d0,111:V6,112:Z8},J(m0,[2,62]),J(p,[2,33]),J(a6,[2,124],{106:qJ}),J(a6,[2,125],{106:qJ})],defaultActions:{},parseError:w(function kJ(p0,T6){if(T6.recoverable)this.trace(p0);else{var z8=new Error(p0);throw z8.hash=T6,z8}},"parseError"),parse:w(function kJ(p0){var T6=this,z8=[0],C6=[],wJ=[null],x0=[],fQ=this.table,c0="",xJ=0,YQ=0,cK=0,lK=2,cz=1,C2=x0.slice.call(arguments,1),G4=Object.create(this.lexer),a5={yy:{}};for(var S2 in this.yy)if(Object.prototype.hasOwnProperty.call(this.yy,S2))a5.yy[S2]=this.yy[S2];if(G4.setInput(p0,a5.yy),a5.yy.lexer=G4,a5.yy.parser=this,typeof G4.yylloc=="undefined")G4.yylloc={};var dK=G4.yylloc;x0.push(dK);var CM=G4.options&&G4.options.ranges;if(typeof a5.yy.parseError==="function")this.parseError=a5.yy.parseError;else this.parseError=Object.getPrototypeOf(this).parseError;function $2(JZ){z8.length=z8.length-2*JZ,wJ.length=wJ.length-JZ,x0.length=x0.length-JZ}w($2,"popStack");function lz(){var JZ=C6.pop()||G4.lex()||cz;if(typeof JZ!=="number"){if(JZ instanceof Array)C6=JZ,JZ=C6.pop();JZ=T6.symbols_[JZ]||JZ}return JZ}w(lz,"lex");var l4,pJ,iK,_Q,$J,gW,W4={},rK,bQ,v2,H4;while(!0){if(iK=z8[z8.length-1],this.defaultActions[iK])_Q=this.defaultActions[iK];else{if(l4===null||typeof l4=="undefined")l4=lz();_Q=fQ[iK]&&fQ[iK][l4]}if(typeof _Q==="undefined"||!_Q.length||!_Q[0]){var O7="";H4=[];for(rK in fQ[iK])if(this.terminals_[rK]&&rK>lK)H4.push("'"+this.terminals_[rK]+"'");if(G4.showPosition)O7="Parse error on line "+(xJ+1)+`:
|
|
1101
1101
|
`+G4.showPosition()+`
|
|
1102
|
-
Expecting `+H4.join(", ")+", got '"+(this.terminals_[l4]||l4)+"'";else O7="Parse error on line "+(xJ+1)+": Unexpected "+(l4==cz?"end of input":"'"+(this.terminals_[l4]||l4)+"'");this.parseError(O7,{text:G4.match,token:this.terminals_[l4]||l4,line:G4.yylineno,loc:dK,expected:H4})}if(_Q[0]instanceof Array&&_Q.length>1)throw new Error("Parse Error: multiple actions possible at state: "+iK+", token: "+l4);switch(_Q[0]){case 1:if(z8.push(l4),wJ.push(G4.yytext),x0.push(G4.yylloc),z8.push(_Q[1]),l4=null,!pJ){if(YQ=G4.yyleng,
|
|
1103
|
-
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:w(function(
|
|
1104
|
-
`+T6+"^"},"showPosition"),test_match:w(function(
|
|
1105
|
-
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:w(function c0(){var T6=this.next();if(T6)return T6;else return this.lex()},"lex"),begin:w(function c0(T6){this.conditionStack.push(T6)},"begin"),popState:w(function c0(){var T6=this.conditionStack.length-1;if(T6>0)return this.conditionStack.pop();else return this.conditionStack[0]},"popState"),_currentRules:w(function c0(){if(this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1])return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules;else return this.conditions.INITIAL.rules},"_currentRules"),topState:w(function c0(T6){if(T6=this.conditionStack.length-1-Math.abs(T6||0),T6>=0)return this.conditionStack[T6];else return"INITIAL"},"topState"),pushState:w(function c0(T6){this.begin(T6)},"pushState"),stateStackSize:w(function c0(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:w(function c0(T6,z8,C6,wJ){var x0=wJ;switch(C6){case 0:return this.begin("acc_title"),34;break;case 1:return this.popState(),"acc_title_value";break;case 2:return this.begin("acc_descr"),36;break;case 3:return this.popState(),"acc_descr_value";break;case 4:this.begin("acc_descr_multiline");break;case 5:this.popState();break;case 6:return"acc_descr_multiline_value";case 7:return this.pushState("shapeData"),z8.yytext="",40;break;case 8:return this.pushState("shapeDataStr"),40;break;case 9:return this.popState(),40;break;case 10:let fQ=/\n\s*/g;return z8.yytext=z8.yytext.replace(fQ,"<br/>"),40;break;case 11:return 40;case 12:this.popState();break;case 13:this.begin("callbackname");break;case 14:this.popState();break;case 15:this.popState(),this.begin("callbackargs");break;case 16:return 95;case 17:this.popState();break;case 18:return 96;case 19:return"MD_STR";case 20:this.popState();break;case 21:this.begin("md_string");break;case 22:return"STR";case 23:this.popState();break;case 24:this.pushState("string");break;case 25:return 84;case 26:return 102;case 27:return 85;case 28:return 104;case 29:return 86;case 30:return 87;case 31:return 97;case 32:this.begin("click");break;case 33:this.popState();break;case 34:return 88;case 35:if(T6.lex.firstGraph())this.begin("dir");return 12;case 36:if(T6.lex.firstGraph())this.begin("dir");return 12;case 37:if(T6.lex.firstGraph())this.begin("dir");return 12;case 38:return 27;case 39:return 32;case 40:return 98;case 41:return 98;case 42:return 98;case 43:return 98;case 44:return this.popState(),13;break;case 45:return this.popState(),14;break;case 46:return this.popState(),14;break;case 47:return this.popState(),14;break;case 48:return this.popState(),14;break;case 49:return this.popState(),14;break;case 50:return this.popState(),14;break;case 51:return this.popState(),14;break;case 52:return this.popState(),14;break;case 53:return this.popState(),14;break;case 54:return this.popState(),14;break;case 55:return 121;case 56:return 122;case 57:return 123;case 58:return 124;case 59:return 78;case 60:return 105;case 61:return 111;case 62:return 46;case 63:return 60;case 64:return 44;case 65:return 8;case 66:return 106;case 67:return 115;case 68:return this.popState(),77;break;case 69:return this.pushState("edgeText"),75;break;case 70:return 119;case 71:return this.popState(),77;break;case 72:return this.pushState("thickEdgeText"),75;break;case 73:return 119;case 74:return this.popState(),77;break;case 75:return this.pushState("dottedEdgeText"),75;break;case 76:return 119;case 77:return 77;case 78:return this.popState(),53;break;case 79:return"TEXT";case 80:return this.pushState("ellipseText"),52;break;case 81:return this.popState(),55;break;case 82:return this.pushState("text"),54;break;case 83:return this.popState(),57;break;case 84:return this.pushState("text"),56;break;case 85:return 58;case 86:return this.pushState("text"),67;break;case 87:return this.popState(),64;break;case 88:return this.pushState("text"),63;break;case 89:return this.popState(),49;break;case 90:return this.pushState("text"),48;break;case 91:return this.popState(),69;break;case 92:return this.popState(),71;break;case 93:return 117;case 94:return this.pushState("trapText"),68;break;case 95:return this.pushState("trapText"),70;break;case 96:return 118;case 97:return 67;case 98:return 90;case 99:return"SEP";case 100:return 89;case 101:return 115;case 102:return 111;case 103:return 44;case 104:return 109;case 105:return 114;case 106:return 116;case 107:return this.popState(),62;break;case 108:return this.pushState("text"),62;break;case 109:return this.popState(),51;break;case 110:return this.pushState("text"),50;break;case 111:return this.popState(),31;break;case 112:return this.pushState("text"),29;break;case 113:return this.popState(),66;break;case 114:return this.pushState("text"),65;break;case 115:return"TEXT";case 116:return"QUOTE";case 117:return 9;case 118:return 10;case 119:return 11}},"anonymous"),rules:[/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:@\{)/,/^(?:["])/,/^(?:["])/,/^(?:[^\"]+)/,/^(?:[^}^"]+)/,/^(?:\})/,/^(?:call[\s]+)/,/^(?:\([\s]*\))/,/^(?:\()/,/^(?:[^(]*)/,/^(?:\))/,/^(?:[^)]*)/,/^(?:[^`"]+)/,/^(?:[`]["])/,/^(?:["][`])/,/^(?:[^"]+)/,/^(?:["])/,/^(?:["])/,/^(?:style\b)/,/^(?:default\b)/,/^(?:linkStyle\b)/,/^(?:interpolate\b)/,/^(?:classDef\b)/,/^(?:class\b)/,/^(?:href[\s])/,/^(?:click[\s]+)/,/^(?:[\s\n])/,/^(?:[^\s\n]*)/,/^(?:flowchart-elk\b)/,/^(?:graph\b)/,/^(?:flowchart\b)/,/^(?:subgraph\b)/,/^(?:end\b\s*)/,/^(?:_self\b)/,/^(?:_blank\b)/,/^(?:_parent\b)/,/^(?:_top\b)/,/^(?:(\r?\n)*\s*\n)/,/^(?:\s*LR\b)/,/^(?:\s*RL\b)/,/^(?:\s*TB\b)/,/^(?:\s*BT\b)/,/^(?:\s*TD\b)/,/^(?:\s*BR\b)/,/^(?:\s*<)/,/^(?:\s*>)/,/^(?:\s*\^)/,/^(?:\s*v\b)/,/^(?:.*direction\s+TB[^\n]*)/,/^(?:.*direction\s+BT[^\n]*)/,/^(?:.*direction\s+RL[^\n]*)/,/^(?:.*direction\s+LR[^\n]*)/,/^(?:[^\s\"]+@(?=[^\{\"]))/,/^(?:[0-9]+)/,/^(?:#)/,/^(?::::)/,/^(?::)/,/^(?:&)/,/^(?:;)/,/^(?:,)/,/^(?:\*)/,/^(?:\s*[xo<]?--+[-xo>]\s*)/,/^(?:\s*[xo<]?--\s*)/,/^(?:[^-]|-(?!-)+)/,/^(?:\s*[xo<]?==+[=xo>]\s*)/,/^(?:\s*[xo<]?==\s*)/,/^(?:[^=]|=(?!))/,/^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,/^(?:\s*[xo<]?-\.\s*)/,/^(?:[^\.]|\.(?!))/,/^(?:\s*~~[\~]+\s*)/,/^(?:[-/\)][\)])/,/^(?:[^\(\)\[\]\{\}]|!\)+)/,/^(?:\(-)/,/^(?:\]\))/,/^(?:\(\[)/,/^(?:\]\])/,/^(?:\[\[)/,/^(?:\[\|)/,/^(?:>)/,/^(?:\)\])/,/^(?:\[\()/,/^(?:\)\)\))/,/^(?:\(\(\()/,/^(?:[\\(?=\])][\]])/,/^(?:\/(?=\])\])/,/^(?:\/(?!\])|\\(?!\])|[^\\\[\]\(\)\{\}\/]+)/,/^(?:\[\/)/,/^(?:\[\\)/,/^(?:<)/,/^(?:>)/,/^(?:\^)/,/^(?:\\\|)/,/^(?:v\b)/,/^(?:\*)/,/^(?:#)/,/^(?:&)/,/^(?:([A-Za-z0-9!"\#$%&'*+\.`?\\_\/]|-(?=[^\>\-\.])|(?!))+)/,/^(?:-)/,/^(?:[\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6]|[\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377]|[\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5]|[\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA]|[\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE]|[\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA]|[\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0]|[\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977]|[\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2]|[\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A]|[\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39]|[\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8]|[\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C]|[\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C]|[\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99]|[\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0]|[\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D]|[\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3]|[\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10]|[\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1]|[\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81]|[\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3]|[\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6]|[\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A]|[\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081]|[\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D]|[\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0]|[\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310]|[\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C]|[\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711]|[\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7]|[\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C]|[\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16]|[\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF]|[\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC]|[\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D]|[\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D]|[\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3]|[\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F]|[\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128]|[\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184]|[\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3]|[\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6]|[\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE]|[\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C]|[\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D]|[\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC]|[\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B]|[\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788]|[\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805]|[\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB]|[\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28]|[\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5]|[\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4]|[\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E]|[\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D]|[\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36]|[\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D]|[\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC]|[\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF]|[\uFFD2-\uFFD7\uFFDA-\uFFDC])/,/^(?:\|)/,/^(?:\|)/,/^(?:\))/,/^(?:\()/,/^(?:\])/,/^(?:\[)/,/^(?:(\}))/,/^(?:\{)/,/^(?:[^\[\]\(\)\{\}\|\"]+)/,/^(?:")/,/^(?:(\r?\n)+)/,/^(?:\s)/,/^(?:$)/],conditions:{shapeDataEndBracket:{rules:[21,24,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},shapeDataStr:{rules:[9,10,21,24,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},shapeData:{rules:[8,11,12,21,24,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},callbackargs:{rules:[17,18,21,24,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},callbackname:{rules:[14,15,16,21,24,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},href:{rules:[21,24,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},click:{rules:[21,24,33,34,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},dottedEdgeText:{rules:[21,24,74,76,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},thickEdgeText:{rules:[21,24,71,73,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},edgeText:{rules:[21,24,68,70,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},trapText:{rules:[21,24,77,80,82,84,88,90,91,92,93,94,95,108,110,112,114],inclusive:!1},ellipseText:{rules:[21,24,77,78,79,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},text:{rules:[21,24,77,80,81,82,83,84,87,88,89,90,94,95,107,108,109,110,111,112,113,114,115],inclusive:!1},vertex:{rules:[21,24,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},dir:{rules:[21,24,44,45,46,47,48,49,50,51,52,53,54,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},acc_descr_multiline:{rules:[5,6,21,24,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},acc_descr:{rules:[3,21,24,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},acc_title:{rules:[1,21,24,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},md_string:{rules:[19,20,21,24,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},string:{rules:[21,22,23,24,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},INITIAL:{rules:[0,2,4,7,13,21,24,25,26,27,28,29,30,31,32,35,36,37,38,39,40,41,42,43,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,71,72,74,75,77,80,82,84,85,86,88,90,94,95,96,97,98,99,100,101,102,103,104,105,106,108,110,112,114,116,117,118,119],inclusive:!0}}};return kJ}();B9.lexer=m9;function H7(){this.yy={}}return w(H7,"Parser"),H7.prototype=B9,B9.Parser=H7,new H7}();U90.parser=U90;Og0=U90,Lg0=Object.assign({},Og0);Lg0.parse=(J)=>{let Q=J.replace(/}\s*\n/g,`}
|
|
1102
|
+
Expecting `+H4.join(", ")+", got '"+(this.terminals_[l4]||l4)+"'";else O7="Parse error on line "+(xJ+1)+": Unexpected "+(l4==cz?"end of input":"'"+(this.terminals_[l4]||l4)+"'");this.parseError(O7,{text:G4.match,token:this.terminals_[l4]||l4,line:G4.yylineno,loc:dK,expected:H4})}if(_Q[0]instanceof Array&&_Q.length>1)throw new Error("Parse Error: multiple actions possible at state: "+iK+", token: "+l4);switch(_Q[0]){case 1:if(z8.push(l4),wJ.push(G4.yytext),x0.push(G4.yylloc),z8.push(_Q[1]),l4=null,!pJ){if(YQ=G4.yyleng,c0=G4.yytext,xJ=G4.yylineno,dK=G4.yylloc,cK>0)cK--}else l4=pJ,pJ=null;break;case 2:if(bQ=this.productions_[_Q[1]][1],W4.$=wJ[wJ.length-bQ],W4._$={first_line:x0[x0.length-(bQ||1)].first_line,last_line:x0[x0.length-1].last_line,first_column:x0[x0.length-(bQ||1)].first_column,last_column:x0[x0.length-1].last_column},CM)W4._$.range=[x0[x0.length-(bQ||1)].range[0],x0[x0.length-1].range[1]];if(gW=this.performAction.apply(W4,[c0,YQ,xJ,a5.yy,_Q[1],wJ,x0].concat(C2)),typeof gW!=="undefined")return gW;if(bQ)z8=z8.slice(0,-1*bQ*2),wJ=wJ.slice(0,-1*bQ),x0=x0.slice(0,-1*bQ);z8.push(this.productions_[_Q[1]][0]),wJ.push(W4.$),x0.push(W4._$),v2=fQ[z8[z8.length-2]][z8[z8.length-1]],z8.push(v2);break;case 3:return!0}}return!0},"parse")},m9=function(){var kJ={EOF:1,parseError:w(function p0(T6,z8){if(this.yy.parser)this.yy.parser.parseError(T6,z8);else throw new Error(T6)},"parseError"),setInput:w(function(p0,T6){if(this.yy=T6||this.yy||{},this._input=p0,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges)this.yylloc.range=[0,0];return this.offset=0,this},"setInput"),input:w(function(){var p0=this._input[0];this.yytext+=p0,this.yyleng++,this.offset++,this.match+=p0,this.matched+=p0;var T6=p0.match(/(?:\r\n?|\n).*/g);if(T6)this.yylineno++,this.yylloc.last_line++;else this.yylloc.last_column++;if(this.options.ranges)this.yylloc.range[1]++;return this._input=this._input.slice(1),p0},"input"),unput:w(function(p0){var T6=p0.length,z8=p0.split(/(?:\r\n?|\n)/g);this._input=p0+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-T6),this.offset-=T6;var C6=this.match.split(/(?:\r\n?|\n)/g);if(this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),z8.length-1)this.yylineno-=z8.length-1;var wJ=this.yylloc.range;if(this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:z8?(z8.length===C6.length?this.yylloc.first_column:0)+C6[C6.length-z8.length].length-z8[0].length:this.yylloc.first_column-T6},this.options.ranges)this.yylloc.range=[wJ[0],wJ[0]+this.yyleng-T6];return this.yyleng=this.yytext.length,this},"unput"),more:w(function(){return this._more=!0,this},"more"),reject:w(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
|
|
1103
|
+
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:w(function(p0){this.unput(this.match.slice(p0))},"less"),pastInput:w(function(){var p0=this.matched.substr(0,this.matched.length-this.match.length);return(p0.length>20?"...":"")+p0.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:w(function(){var p0=this.match;if(p0.length<20)p0+=this._input.substr(0,20-p0.length);return(p0.substr(0,20)+(p0.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:w(function(){var p0=this.pastInput(),T6=new Array(p0.length+1).join("-");return p0+this.upcomingInput()+`
|
|
1104
|
+
`+T6+"^"},"showPosition"),test_match:w(function(p0,T6){var z8,C6,wJ;if(this.options.backtrack_lexer){if(wJ={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges)wJ.yylloc.range=this.yylloc.range.slice(0)}if(C6=p0[0].match(/(?:\r\n?|\n).*/g),C6)this.yylineno+=C6.length;if(this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:C6?C6[C6.length-1].length-C6[C6.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+p0[0].length},this.yytext+=p0[0],this.match+=p0[0],this.matches=p0,this.yyleng=this.yytext.length,this.options.ranges)this.yylloc.range=[this.offset,this.offset+=this.yyleng];if(this._more=!1,this._backtrack=!1,this._input=this._input.slice(p0[0].length),this.matched+=p0[0],z8=this.performAction.call(this,this.yy,this,T6,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input)this.done=!1;if(z8)return z8;else if(this._backtrack){for(var x0 in wJ)this[x0]=wJ[x0];return!1}return!1},"test_match"),next:w(function(){if(this.done)return this.EOF;if(!this._input)this.done=!0;var p0,T6,z8,C6;if(!this._more)this.yytext="",this.match="";var wJ=this._currentRules();for(var x0=0;x0<wJ.length;x0++)if(z8=this._input.match(this.rules[wJ[x0]]),z8&&(!T6||z8[0].length>T6[0].length)){if(T6=z8,C6=x0,this.options.backtrack_lexer)if(p0=this.test_match(z8,wJ[x0]),p0!==!1)return p0;else if(this._backtrack){T6=!1;continue}else return!1;else if(!this.options.flex)break}if(T6){if(p0=this.test_match(T6,wJ[C6]),p0!==!1)return p0;return!1}if(this._input==="")return this.EOF;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
|
|
1105
|
+
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:w(function p0(){var T6=this.next();if(T6)return T6;else return this.lex()},"lex"),begin:w(function p0(T6){this.conditionStack.push(T6)},"begin"),popState:w(function p0(){var T6=this.conditionStack.length-1;if(T6>0)return this.conditionStack.pop();else return this.conditionStack[0]},"popState"),_currentRules:w(function p0(){if(this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1])return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules;else return this.conditions.INITIAL.rules},"_currentRules"),topState:w(function p0(T6){if(T6=this.conditionStack.length-1-Math.abs(T6||0),T6>=0)return this.conditionStack[T6];else return"INITIAL"},"topState"),pushState:w(function p0(T6){this.begin(T6)},"pushState"),stateStackSize:w(function p0(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:w(function p0(T6,z8,C6,wJ){var x0=wJ;switch(C6){case 0:return this.begin("acc_title"),34;break;case 1:return this.popState(),"acc_title_value";break;case 2:return this.begin("acc_descr"),36;break;case 3:return this.popState(),"acc_descr_value";break;case 4:this.begin("acc_descr_multiline");break;case 5:this.popState();break;case 6:return"acc_descr_multiline_value";case 7:return this.pushState("shapeData"),z8.yytext="",40;break;case 8:return this.pushState("shapeDataStr"),40;break;case 9:return this.popState(),40;break;case 10:let fQ=/\n\s*/g;return z8.yytext=z8.yytext.replace(fQ,"<br/>"),40;break;case 11:return 40;case 12:this.popState();break;case 13:this.begin("callbackname");break;case 14:this.popState();break;case 15:this.popState(),this.begin("callbackargs");break;case 16:return 95;case 17:this.popState();break;case 18:return 96;case 19:return"MD_STR";case 20:this.popState();break;case 21:this.begin("md_string");break;case 22:return"STR";case 23:this.popState();break;case 24:this.pushState("string");break;case 25:return 84;case 26:return 102;case 27:return 85;case 28:return 104;case 29:return 86;case 30:return 87;case 31:return 97;case 32:this.begin("click");break;case 33:this.popState();break;case 34:return 88;case 35:if(T6.lex.firstGraph())this.begin("dir");return 12;case 36:if(T6.lex.firstGraph())this.begin("dir");return 12;case 37:if(T6.lex.firstGraph())this.begin("dir");return 12;case 38:return 27;case 39:return 32;case 40:return 98;case 41:return 98;case 42:return 98;case 43:return 98;case 44:return this.popState(),13;break;case 45:return this.popState(),14;break;case 46:return this.popState(),14;break;case 47:return this.popState(),14;break;case 48:return this.popState(),14;break;case 49:return this.popState(),14;break;case 50:return this.popState(),14;break;case 51:return this.popState(),14;break;case 52:return this.popState(),14;break;case 53:return this.popState(),14;break;case 54:return this.popState(),14;break;case 55:return 121;case 56:return 122;case 57:return 123;case 58:return 124;case 59:return 78;case 60:return 105;case 61:return 111;case 62:return 46;case 63:return 60;case 64:return 44;case 65:return 8;case 66:return 106;case 67:return 115;case 68:return this.popState(),77;break;case 69:return this.pushState("edgeText"),75;break;case 70:return 119;case 71:return this.popState(),77;break;case 72:return this.pushState("thickEdgeText"),75;break;case 73:return 119;case 74:return this.popState(),77;break;case 75:return this.pushState("dottedEdgeText"),75;break;case 76:return 119;case 77:return 77;case 78:return this.popState(),53;break;case 79:return"TEXT";case 80:return this.pushState("ellipseText"),52;break;case 81:return this.popState(),55;break;case 82:return this.pushState("text"),54;break;case 83:return this.popState(),57;break;case 84:return this.pushState("text"),56;break;case 85:return 58;case 86:return this.pushState("text"),67;break;case 87:return this.popState(),64;break;case 88:return this.pushState("text"),63;break;case 89:return this.popState(),49;break;case 90:return this.pushState("text"),48;break;case 91:return this.popState(),69;break;case 92:return this.popState(),71;break;case 93:return 117;case 94:return this.pushState("trapText"),68;break;case 95:return this.pushState("trapText"),70;break;case 96:return 118;case 97:return 67;case 98:return 90;case 99:return"SEP";case 100:return 89;case 101:return 115;case 102:return 111;case 103:return 44;case 104:return 109;case 105:return 114;case 106:return 116;case 107:return this.popState(),62;break;case 108:return this.pushState("text"),62;break;case 109:return this.popState(),51;break;case 110:return this.pushState("text"),50;break;case 111:return this.popState(),31;break;case 112:return this.pushState("text"),29;break;case 113:return this.popState(),66;break;case 114:return this.pushState("text"),65;break;case 115:return"TEXT";case 116:return"QUOTE";case 117:return 9;case 118:return 10;case 119:return 11}},"anonymous"),rules:[/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:@\{)/,/^(?:["])/,/^(?:["])/,/^(?:[^\"]+)/,/^(?:[^}^"]+)/,/^(?:\})/,/^(?:call[\s]+)/,/^(?:\([\s]*\))/,/^(?:\()/,/^(?:[^(]*)/,/^(?:\))/,/^(?:[^)]*)/,/^(?:[^`"]+)/,/^(?:[`]["])/,/^(?:["][`])/,/^(?:[^"]+)/,/^(?:["])/,/^(?:["])/,/^(?:style\b)/,/^(?:default\b)/,/^(?:linkStyle\b)/,/^(?:interpolate\b)/,/^(?:classDef\b)/,/^(?:class\b)/,/^(?:href[\s])/,/^(?:click[\s]+)/,/^(?:[\s\n])/,/^(?:[^\s\n]*)/,/^(?:flowchart-elk\b)/,/^(?:graph\b)/,/^(?:flowchart\b)/,/^(?:subgraph\b)/,/^(?:end\b\s*)/,/^(?:_self\b)/,/^(?:_blank\b)/,/^(?:_parent\b)/,/^(?:_top\b)/,/^(?:(\r?\n)*\s*\n)/,/^(?:\s*LR\b)/,/^(?:\s*RL\b)/,/^(?:\s*TB\b)/,/^(?:\s*BT\b)/,/^(?:\s*TD\b)/,/^(?:\s*BR\b)/,/^(?:\s*<)/,/^(?:\s*>)/,/^(?:\s*\^)/,/^(?:\s*v\b)/,/^(?:.*direction\s+TB[^\n]*)/,/^(?:.*direction\s+BT[^\n]*)/,/^(?:.*direction\s+RL[^\n]*)/,/^(?:.*direction\s+LR[^\n]*)/,/^(?:[^\s\"]+@(?=[^\{\"]))/,/^(?:[0-9]+)/,/^(?:#)/,/^(?::::)/,/^(?::)/,/^(?:&)/,/^(?:;)/,/^(?:,)/,/^(?:\*)/,/^(?:\s*[xo<]?--+[-xo>]\s*)/,/^(?:\s*[xo<]?--\s*)/,/^(?:[^-]|-(?!-)+)/,/^(?:\s*[xo<]?==+[=xo>]\s*)/,/^(?:\s*[xo<]?==\s*)/,/^(?:[^=]|=(?!))/,/^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,/^(?:\s*[xo<]?-\.\s*)/,/^(?:[^\.]|\.(?!))/,/^(?:\s*~~[\~]+\s*)/,/^(?:[-/\)][\)])/,/^(?:[^\(\)\[\]\{\}]|!\)+)/,/^(?:\(-)/,/^(?:\]\))/,/^(?:\(\[)/,/^(?:\]\])/,/^(?:\[\[)/,/^(?:\[\|)/,/^(?:>)/,/^(?:\)\])/,/^(?:\[\()/,/^(?:\)\)\))/,/^(?:\(\(\()/,/^(?:[\\(?=\])][\]])/,/^(?:\/(?=\])\])/,/^(?:\/(?!\])|\\(?!\])|[^\\\[\]\(\)\{\}\/]+)/,/^(?:\[\/)/,/^(?:\[\\)/,/^(?:<)/,/^(?:>)/,/^(?:\^)/,/^(?:\\\|)/,/^(?:v\b)/,/^(?:\*)/,/^(?:#)/,/^(?:&)/,/^(?:([A-Za-z0-9!"\#$%&'*+\.`?\\_\/]|-(?=[^\>\-\.])|(?!))+)/,/^(?:-)/,/^(?:[\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6]|[\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377]|[\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5]|[\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA]|[\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE]|[\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA]|[\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0]|[\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977]|[\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2]|[\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A]|[\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39]|[\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8]|[\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C]|[\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C]|[\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99]|[\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0]|[\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D]|[\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3]|[\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10]|[\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1]|[\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81]|[\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3]|[\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6]|[\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A]|[\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081]|[\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D]|[\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0]|[\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310]|[\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C]|[\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711]|[\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7]|[\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C]|[\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16]|[\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF]|[\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC]|[\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D]|[\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D]|[\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3]|[\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F]|[\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128]|[\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184]|[\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3]|[\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6]|[\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE]|[\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C]|[\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D]|[\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC]|[\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B]|[\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788]|[\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805]|[\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB]|[\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28]|[\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5]|[\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4]|[\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E]|[\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D]|[\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36]|[\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D]|[\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC]|[\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF]|[\uFFD2-\uFFD7\uFFDA-\uFFDC])/,/^(?:\|)/,/^(?:\|)/,/^(?:\))/,/^(?:\()/,/^(?:\])/,/^(?:\[)/,/^(?:(\}))/,/^(?:\{)/,/^(?:[^\[\]\(\)\{\}\|\"]+)/,/^(?:")/,/^(?:(\r?\n)+)/,/^(?:\s)/,/^(?:$)/],conditions:{shapeDataEndBracket:{rules:[21,24,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},shapeDataStr:{rules:[9,10,21,24,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},shapeData:{rules:[8,11,12,21,24,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},callbackargs:{rules:[17,18,21,24,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},callbackname:{rules:[14,15,16,21,24,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},href:{rules:[21,24,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},click:{rules:[21,24,33,34,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},dottedEdgeText:{rules:[21,24,74,76,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},thickEdgeText:{rules:[21,24,71,73,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},edgeText:{rules:[21,24,68,70,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},trapText:{rules:[21,24,77,80,82,84,88,90,91,92,93,94,95,108,110,112,114],inclusive:!1},ellipseText:{rules:[21,24,77,78,79,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},text:{rules:[21,24,77,80,81,82,83,84,87,88,89,90,94,95,107,108,109,110,111,112,113,114,115],inclusive:!1},vertex:{rules:[21,24,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},dir:{rules:[21,24,44,45,46,47,48,49,50,51,52,53,54,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},acc_descr_multiline:{rules:[5,6,21,24,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},acc_descr:{rules:[3,21,24,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},acc_title:{rules:[1,21,24,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},md_string:{rules:[19,20,21,24,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},string:{rules:[21,22,23,24,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},INITIAL:{rules:[0,2,4,7,13,21,24,25,26,27,28,29,30,31,32,35,36,37,38,39,40,41,42,43,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,71,72,74,75,77,80,82,84,85,86,88,90,94,95,96,97,98,99,100,101,102,103,104,105,106,108,110,112,114,116,117,118,119],inclusive:!0}}};return kJ}();B9.lexer=m9;function H7(){this.yy={}}return w(H7,"Parser"),H7.prototype=B9,B9.Parser=H7,new H7}();U90.parser=U90;Og0=U90,Lg0=Object.assign({},Og0);Lg0.parse=(J)=>{let Q=J.replace(/}\s*\n/g,`}
|
|
1106
1106
|
`);return Og0.parse(Q)};y_6=Lg0,g_6=w((J,Q)=>{let Z=rF,U=Z(J,"r"),K=Z(J,"g"),X=Z(J,"b");return EU(U,K,X,Q)},"fade"),m_6=w((J)=>`.label {
|
|
1107
1107
|
font-family: ${J.fontFamily};
|
|
1108
1108
|
color: ${J.nodeTextColor||J.textColor};
|
|
@@ -2947,7 +2947,7 @@ Expecting `+P0.join(", ")+", got '"+(this.terminals_[U0]||U0)+"'";else F0="Parse
|
|
|
2947
2947
|
`,"getStyles"),cd6=pd6,ld6=w((J,Q,Z,U)=>{Q.forEach((K)=>{Ji6[K](J,Z,U)})},"insertMarkers"),dd6=w((J,Q,Z)=>{B0.trace("Making markers for ",Z),J.append("defs").append("marker").attr("id",Z+"_"+Q+"-extensionStart").attr("class","marker extension "+Q).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 1,7 L18,13 V 1 Z"),J.append("defs").append("marker").attr("id",Z+"_"+Q+"-extensionEnd").attr("class","marker extension "+Q).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 1,1 V 13 L18,7 Z")},"extension"),id6=w((J,Q,Z)=>{J.append("defs").append("marker").attr("id",Z+"_"+Q+"-compositionStart").attr("class","marker composition "+Q).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),J.append("defs").append("marker").attr("id",Z+"_"+Q+"-compositionEnd").attr("class","marker composition "+Q).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"composition"),rd6=w((J,Q,Z)=>{J.append("defs").append("marker").attr("id",Z+"_"+Q+"-aggregationStart").attr("class","marker aggregation "+Q).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),J.append("defs").append("marker").attr("id",Z+"_"+Q+"-aggregationEnd").attr("class","marker aggregation "+Q).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"aggregation"),nd6=w((J,Q,Z)=>{J.append("defs").append("marker").attr("id",Z+"_"+Q+"-dependencyStart").attr("class","marker dependency "+Q).attr("refX",6).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 5,7 L9,13 L1,7 L9,1 Z"),J.append("defs").append("marker").attr("id",Z+"_"+Q+"-dependencyEnd").attr("class","marker dependency "+Q).attr("refX",13).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},"dependency"),sd6=w((J,Q,Z)=>{J.append("defs").append("marker").attr("id",Z+"_"+Q+"-lollipopStart").attr("class","marker lollipop "+Q).attr("refX",13).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("stroke","black").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6),J.append("defs").append("marker").attr("id",Z+"_"+Q+"-lollipopEnd").attr("class","marker lollipop "+Q).attr("refX",1).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("stroke","black").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6)},"lollipop"),ad6=w((J,Q,Z)=>{J.append("marker").attr("id",Z+"_"+Q+"-pointEnd").attr("class","marker "+Q).attr("viewBox","0 0 10 10").attr("refX",6).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),J.append("marker").attr("id",Z+"_"+Q+"-pointStart").attr("class","marker "+Q).attr("viewBox","0 0 10 10").attr("refX",4.5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 0 5 L 10 10 L 10 0 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0")},"point"),od6=w((J,Q,Z)=>{J.append("marker").attr("id",Z+"_"+Q+"-circleEnd").attr("class","marker "+Q).attr("viewBox","0 0 10 10").attr("refX",11).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),J.append("marker").attr("id",Z+"_"+Q+"-circleStart").attr("class","marker "+Q).attr("viewBox","0 0 10 10").attr("refX",-1).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0")},"circle"),td6=w((J,Q,Z)=>{J.append("marker").attr("id",Z+"_"+Q+"-crossEnd").attr("class","marker cross "+Q).attr("viewBox","0 0 11 11").attr("refX",12).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0"),J.append("marker").attr("id",Z+"_"+Q+"-crossStart").attr("class","marker cross "+Q).attr("viewBox","0 0 11 11").attr("refX",-1).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0")},"cross"),ed6=w((J,Q,Z)=>{J.append("defs").append("marker").attr("id",Z+"_"+Q+"-barbEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","strokeWidth").attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"barb"),Ji6={extension:dd6,composition:id6,aggregation:rd6,dependency:nd6,lollipop:sd6,point:ad6,circle:od6,cross:td6,barb:ed6},Qi6=ld6,p4=i0()?.block?.padding??8;w(wn0,"calculateBlockPosition");Zi6=w((J)=>{let Q=0,Z=0;for(let U of J.children){let{width:K,height:X,x:Y,y:z}=U.size??{width:0,height:0,x:0,y:0};if(B0.debug("getMaxChildSize abc95 child:",U.id,"width:",K,"height:",X,"x:",Y,"y:",z,U.type),U.type==="space")continue;if(K>Q)Q=K/(J.widthInColumns??1);if(X>Z)Z=X}return{width:Q,height:Z}},"getMaxChildSize");w(ag,"setBlockSizes");w(KU0,"layoutBlocks");w(XU0,"findBounds");w(En0,"layout");w(eZ0,"applyStyle");w(jn0,"addHtmlLabel");Ui6=w(async(J,Q,Z,U)=>{let K=J||"";if(typeof K==="object")K=K[0];let X=i0();if(V9(X.flowchart.htmlLabels)){K=K.replace(/\\n|\n/g,"<br />"),B0.debug("vertexText"+K);let Y=await c_($5(K)),z={isNode:U,label:Y,labelStyle:Q.replace("fill:","color:")};return jn0(z,X)}else{let Y=document.createElementNS("http://www.w3.org/2000/svg","text");Y.setAttribute("style",Q.replace("color:","fill:"));let z=[];if(typeof K==="string")z=K.split(/\\n|\n|<br\s*\/?>/gi);else if(Array.isArray(K))z=K;else z=[];for(let G of z){let W=document.createElementNS("http://www.w3.org/2000/svg","tspan");if(W.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),W.setAttribute("dy","1em"),W.setAttribute("x","0"),Z)W.setAttribute("class","title-row");else W.setAttribute("class","row");W.textContent=G.trim(),Y.appendChild(W)}return Y}},"createLabel"),rX=Ui6,Ki6=w((J,Q,Z,U,K)=>{if(Q.arrowTypeStart)qn0(J,"start",Q.arrowTypeStart,Z,U,K);if(Q.arrowTypeEnd)qn0(J,"end",Q.arrowTypeEnd,Z,U,K)},"addEdgeMarkers"),Xi6={arrow_cross:"cross",arrow_point:"point",arrow_barb:"barb",arrow_circle:"circle",aggregation:"aggregation",extension:"extension",composition:"composition",dependency:"dependency",lollipop:"lollipop"},qn0=w((J,Q,Z,U,K,X)=>{let Y=Xi6[Z];if(!Y){B0.warn(`Unknown arrow type: ${Z}`);return}let z=Q==="start"?"Start":"End";J.attr(`marker-${Q}`,`url(${U}#${K}_${X}-${Y}${z})`)},"addEdgeMarker"),JU0={},WU={},Yi6=w(async(J,Q)=>{let Z=i0(),U=V9(Z.flowchart.htmlLabels),K=Q.labelType==="markdown"?TZ(J,Q.label,{style:Q.labelStyle,useHtmlLabels:U,addSvgBackground:!0},Z):await rX(Q.label,Q.labelStyle),X=J.insert("g").attr("class","edgeLabel"),Y=X.insert("g").attr("class","label");Y.node().appendChild(K);let z=K.getBBox();if(U){let W=K.children[0],H=j6(K);z=W.getBoundingClientRect(),H.attr("width",z.width),H.attr("height",z.height)}Y.attr("transform","translate("+-z.width/2+", "+-z.height/2+")"),JU0[Q.id]=X,Q.width=z.width,Q.height=z.height;let G;if(Q.startLabelLeft){let W=await rX(Q.startLabelLeft,Q.labelStyle),H=J.insert("g").attr("class","edgeTerminals"),q=H.insert("g").attr("class","inner");G=q.node().appendChild(W);let F=W.getBBox();if(q.attr("transform","translate("+-F.width/2+", "+-F.height/2+")"),!WU[Q.id])WU[Q.id]={};WU[Q.id].startLeft=H,FV(G,Q.startLabelLeft)}if(Q.startLabelRight){let W=await rX(Q.startLabelRight,Q.labelStyle),H=J.insert("g").attr("class","edgeTerminals"),q=H.insert("g").attr("class","inner");G=H.node().appendChild(W),q.node().appendChild(W);let F=W.getBBox();if(q.attr("transform","translate("+-F.width/2+", "+-F.height/2+")"),!WU[Q.id])WU[Q.id]={};WU[Q.id].startRight=H,FV(G,Q.startLabelRight)}if(Q.endLabelLeft){let W=await rX(Q.endLabelLeft,Q.labelStyle),H=J.insert("g").attr("class","edgeTerminals"),q=H.insert("g").attr("class","inner");G=q.node().appendChild(W);let F=W.getBBox();if(q.attr("transform","translate("+-F.width/2+", "+-F.height/2+")"),H.node().appendChild(W),!WU[Q.id])WU[Q.id]={};WU[Q.id].endLeft=H,FV(G,Q.endLabelLeft)}if(Q.endLabelRight){let W=await rX(Q.endLabelRight,Q.labelStyle),H=J.insert("g").attr("class","edgeTerminals"),q=H.insert("g").attr("class","inner");G=q.node().appendChild(W);let F=W.getBBox();if(q.attr("transform","translate("+-F.width/2+", "+-F.height/2+")"),H.node().appendChild(W),!WU[Q.id])WU[Q.id]={};WU[Q.id].endRight=H,FV(G,Q.endLabelRight)}return K},"insertEdgeLabel");w(FV,"setTerminalWidth");zi6=w((J,Q)=>{B0.debug("Moving label abc88 ",J.id,J.label,JU0[J.id],Q);let Z=Q.updatedPath?Q.updatedPath:Q.originalPath,U=i0(),{subGraphTitleTotalMargin:K}=ZW(U);if(J.label){let X=JU0[J.id],Y=J.x,z=J.y;if(Z){let G=n8.calcLabelPosition(Z);if(B0.debug("Moving label "+J.label+" from (",Y,",",z,") to (",G.x,",",G.y,") abc88"),Q.updatedPath)Y=G.x,z=G.y}X.attr("transform",`translate(${Y}, ${z+K/2})`)}if(J.startLabelLeft){let X=WU[J.id].startLeft,Y=J.x,z=J.y;if(Z){let G=n8.calcTerminalLabelPosition(J.arrowTypeStart?10:0,"start_left",Z);Y=G.x,z=G.y}X.attr("transform",`translate(${Y}, ${z})`)}if(J.startLabelRight){let X=WU[J.id].startRight,Y=J.x,z=J.y;if(Z){let G=n8.calcTerminalLabelPosition(J.arrowTypeStart?10:0,"start_right",Z);Y=G.x,z=G.y}X.attr("transform",`translate(${Y}, ${z})`)}if(J.endLabelLeft){let X=WU[J.id].endLeft,Y=J.x,z=J.y;if(Z){let G=n8.calcTerminalLabelPosition(J.arrowTypeEnd?10:0,"end_left",Z);Y=G.x,z=G.y}X.attr("transform",`translate(${Y}, ${z})`)}if(J.endLabelRight){let X=WU[J.id].endRight,Y=J.x,z=J.y;if(Z){let G=n8.calcTerminalLabelPosition(J.arrowTypeEnd?10:0,"end_right",Z);Y=G.x,z=G.y}X.attr("transform",`translate(${Y}, ${z})`)}},"positionEdgeLabel"),Gi6=w((J,Q)=>{let{x:Z,y:U}=J,K=Math.abs(Q.x-Z),X=Math.abs(Q.y-U),Y=J.width/2,z=J.height/2;if(K>=Y||X>=z)return!0;return!1},"outsideNode"),Wi6=w((J,Q,Z)=>{B0.debug(`intersection calc abc89:
|
|
2948
2948
|
outsidePoint: ${JSON.stringify(Q)}
|
|
2949
2949
|
insidePoint : ${JSON.stringify(Z)}
|
|
2950
|
-
node : x:${J.x} y:${J.y} w:${J.width} h:${J.height}`);let{x:U,y:K}=J,X=Math.abs(U-Z.x),Y=J.width/2,z=Z.x<Q.x?Y-X:Y+X,G=J.height/2,W=Math.abs(Q.y-Z.y),H=Math.abs(Q.x-Z.x);if(Math.abs(K-Q.y)*Y>Math.abs(U-Q.x)*G){let q=Z.y<Q.y?Q.y-G-K:K-G-Q.y;z=H*q/W;let F={x:Z.x<Q.x?Z.x+z:Z.x-H+z,y:Z.y<Q.y?Z.y+W-q:Z.y-W+q};if(z===0)F.x=Q.x,F.y=Q.y;if(H===0)F.x=Q.x;if(W===0)F.y=Q.y;return B0.debug(`abc89 topp/bott calc, Q ${W}, q ${q}, R ${H}, r ${z}`,F),F}else{if(Z.x<Q.x)z=Q.x-Y-U;else z=U-Y-Q.x;let q=W*z/H,F=Z.x<Q.x?Z.x+H-z:Z.x-H+z,M=Z.y<Q.y?Z.y+q:Z.y-q;if(B0.debug(`sides calc abc89, Q ${W}, q ${q}, R ${H}, r ${z}`,{_x:F,_y:M}),z===0)F=Q.x,M=Q.y;if(H===0)F=Q.x;if(W===0)M=Q.y;return{x:F,y:M}}},"intersection"),Fn0=w((J,Q)=>{B0.debug("abc88 cutPathAtIntersect",J,Q);let Z=[],U=J[0],K=!1;return J.forEach((X)=>{if(!Gi6(Q,X)&&!K){let Y=Wi6(Q,U,X),z=!1;if(Z.forEach((G)=>{z=z||G.x===Y.x&&G.y===Y.y}),!Z.some((G)=>G.x===Y.x&&G.y===Y.y))Z.push(Y);K=!0}else if(U=X,!K)Z.push(X)}),Z},"cutPathAtIntersect"),Hi6=w(function(J,Q,Z,U,K,X,Y){let z=Z.points;B0.debug("abc88 InsertEdge: edge=",Z,"e=",Q);let G=!1,W=X.node(Q.v);var H=X.node(Q.w);if(H?.intersect&&W?.intersect)z=z.slice(1,Z.points.length-1),z.unshift(W.intersect(z[0])),z.push(H.intersect(z[z.length-1]));if(Z.toCluster)B0.debug("to cluster abc88",U[Z.toCluster]),z=Fn0(Z.points,U[Z.toCluster].node),G=!0;if(Z.fromCluster)B0.debug("from cluster abc88",U[Z.fromCluster]),z=Fn0(z.reverse(),U[Z.fromCluster].node).reverse(),G=!0;let q=z.filter((V)=>!Number.isNaN(V.y)),F=wX;if(Z.curve&&(K==="graph"||K==="flowchart"))F=Z.curve;let{x:M,y:L}=P_(Z),A=x1().x(M).y(L).curve(F),I;switch(Z.thickness){case"normal":I="edge-thickness-normal";break;case"thick":I="edge-thickness-thick";break;case"invisible":I="edge-thickness-thick";break;default:I=""}switch(Z.pattern){case"solid":I+=" edge-pattern-solid";break;case"dotted":I+=" edge-pattern-dotted";break;case"dashed":I+=" edge-pattern-dashed";break}let R=J.append("path").attr("d",A(q)).attr("id",Z.id).attr("class"," "+I+(Z.classes?" "+Z.classes:"")).attr("style",Z.style),N="";if(i0().flowchart.arrowMarkerAbsolute||i0().state.arrowMarkerAbsolute)N=JB(!0);Ki6(R,Z,N,Y,K);let E={};if(G)E.updatedPath=z;return E.originalPath=Z.points,E},"insertEdge"),qi6=w((J)=>{let Q=new Set;for(let Z of J)switch(Z){case"x":Q.add("right"),Q.add("left");break;case"y":Q.add("up"),Q.add("down");break;default:Q.add(Z);break}return Q},"expandAndDeduplicateDirections"),Fi6=w((J,Q,Z)=>{let U=qi6(J),K=2,X=Q.height+2*Z.padding,Y=X/2,z=Q.width+2*Y+Z.padding,G=Z.padding/2;if(U.has("right")&&U.has("left")&&U.has("up")&&U.has("down"))return[{x:0,y:0},{x:Y,y:0},{x:z/2,y:2*G},{x:z-Y,y:0},{x:z,y:0},{x:z,y:-X/3},{x:z+2*G,y:-X/2},{x:z,y:-2*X/3},{x:z,y:-X},{x:z-Y,y:-X},{x:z/2,y:-X-2*G},{x:Y,y:-X},{x:0,y:-X},{x:0,y:-2*X/3},{x:-2*G,y:-X/2},{x:0,y:-X/3}];if(U.has("right")&&U.has("left")&&U.has("up"))return[{x:Y,y:0},{x:z-Y,y:0},{x:z,y:-X/2},{x:z-Y,y:-X},{x:Y,y:-X},{x:0,y:-X/2}];if(U.has("right")&&U.has("left")&&U.has("down"))return[{x:0,y:0},{x:Y,y:-X},{x:z-Y,y:-X},{x:z,y:0}];if(U.has("right")&&U.has("up")&&U.has("down"))return[{x:0,y:0},{x:z,y:-Y},{x:z,y:-X+Y},{x:0,y:-X}];if(U.has("left")&&U.has("up")&&U.has("down"))return[{x:z,y:0},{x:0,y:-Y},{x:0,y:-X+Y},{x:z,y:-X}];if(U.has("right")&&U.has("left"))return[{x:Y,y:0},{x:Y,y:-G},{x:z-Y,y:-G},{x:z-Y,y:0},{x:z,y:-X/2},{x:z-Y,y:-X},{x:z-Y,y:-X+G},{x:Y,y:-X+G},{x:Y,y:-X},{x:0,y:-X/2}];if(U.has("up")&&U.has("down"))return[{x:z/2,y:0},{x:0,y:-G},{x:Y,y:-G},{x:Y,y:-X+G},{x:0,y:-X+G},{x:z/2,y:-X},{x:z,y:-X+G},{x:z-Y,y:-X+G},{x:z-Y,y:-G},{x:z,y:-G}];if(U.has("right")&&U.has("up"))return[{x:0,y:0},{x:z,y:-Y},{x:0,y:-X}];if(U.has("right")&&U.has("down"))return[{x:0,y:0},{x:z,y:0},{x:0,y:-X}];if(U.has("left")&&U.has("up"))return[{x:z,y:0},{x:0,y:-Y},{x:z,y:-X}];if(U.has("left")&&U.has("down"))return[{x:z,y:0},{x:0,y:0},{x:z,y:-X}];if(U.has("right"))return[{x:Y,y:-G},{x:Y,y:-G},{x:z-Y,y:-G},{x:z-Y,y:0},{x:z,y:-X/2},{x:z-Y,y:-X},{x:z-Y,y:-X+G},{x:Y,y:-X+G},{x:Y,y:-X+G}];if(U.has("left"))return[{x:Y,y:0},{x:Y,y:-G},{x:z-Y,y:-G},{x:z-Y,y:-X+G},{x:Y,y:-X+G},{x:Y,y:-X},{x:0,y:-X/2}];if(U.has("up"))return[{x:Y,y:-G},{x:Y,y:-X+G},{x:0,y:-X+G},{x:z/2,y:-X},{x:z,y:-X+G},{x:z-Y,y:-X+G},{x:z-Y,y:-G}];if(U.has("down"))return[{x:z/2,y:0},{x:0,y:-G},{x:Y,y:-G},{x:Y,y:-X+G},{x:z-Y,y:-X+G},{x:z-Y,y:-G},{x:z,y:-G}];return[{x:0,y:0}]},"getArrowPoints");w(Pn0,"intersectNode");Bi6=Pn0;w(Vn0,"intersectEllipse");Tn0=Vn0;w(Cn0,"intersectCircle");Mi6=Cn0;w(Sn0,"intersectLine");w(QU0,"sameSign");Oi6=Sn0,Li6=$n0;w($n0,"intersectPolygon");Ai6=w((J,Q)=>{var{x:Z,y:U}=J,K=Q.x-Z,X=Q.y-U,Y=J.width/2,z=J.height/2,G,W;if(Math.abs(X)*Y>Math.abs(K)*z){if(X<0)z=-z;G=X===0?0:z*K/X,W=z}else{if(K<0)Y=-Y;G=Y,W=K===0?0:Y*X/K}return{x:Z+G,y:U+W}},"intersectRect"),Ii6=Ai6,z4={node:Bi6,circle:Mi6,ellipse:Tn0,polygon:Li6,rect:Ii6},eQ=w(async(J,Q,Z,U)=>{let K=i0(),X,Y=Q.useHtmlLabels||V9(K.flowchart.htmlLabels);if(!Z)X="node default";else X=Z;let z=J.insert("g").attr("class",X).attr("id",Q.domId||Q.id),G=z.insert("g").attr("class","label").attr("style",Q.labelStyle),W;if(Q.labelText===void 0)W="";else W=typeof Q.labelText==="string"?Q.labelText:Q.labelText[0];let H=G.node(),q;if(Q.labelType==="markdown")q=TZ(G,VJ($5(W),K),{useHtmlLabels:Y,width:Q.width||K.flowchart.wrappingWidth,classes:"markdown-node-label"},K);else q=H.appendChild(await rX(VJ($5(W),K),Q.labelStyle,!1,U));let F=q.getBBox(),M=Q.padding/2;if(V9(K.flowchart.htmlLabels)){let L=q.children[0],A=j6(q),I=L.getElementsByTagName("img");if(I){let R=W.replace(/<img[^>]*>/g,"").trim()==="";await Promise.all([...I].map((N)=>new Promise((E)=>{function V(){if(N.style.display="flex",N.style.flexDirection="column",R){let j=K.fontSize?K.fontSize:window.getComputedStyle(document.body).fontSize,T=5,C=parseInt(j,10)*5+"px";N.style.minWidth=C,N.style.maxWidth=C}else N.style.width="100%";E(N)}w(V,"setupImage"),setTimeout(()=>{if(N.complete)V()}),N.addEventListener("error",V),N.addEventListener("load",V)})))}F=L.getBoundingClientRect(),A.attr("width",F.width),A.attr("height",F.height)}if(Y)G.attr("transform","translate("+-F.width/2+", "+-F.height/2+")");else G.attr("transform","translate(0, "+-F.height/2+")");if(Q.centerLabel)G.attr("transform","translate("+-F.width/2+", "+-F.height/2+")");return G.insert("rect",":first-child"),{shapeSvg:z,bbox:F,halfPadding:M,label:G}},"labelHelper"),k4=w((J,Q)=>{let Z=Q.node().getBBox();J.width=Z.width,J.height=Z.height},"updateNodeBounds");w(ZY,"insertPolygonShape");Ri6=w(async(J,Q)=>{if(!(Q.useHtmlLabels||i0().flowchart.htmlLabels))Q.centerLabel=!0;let{shapeSvg:U,bbox:K,halfPadding:X}=await eQ(J,Q,"node "+Q.classes,!0);B0.info("Classes = ",Q.classes);let Y=U.insert("rect",":first-child");return Y.attr("rx",Q.rx).attr("ry",Q.ry).attr("x",-K.width/2-X).attr("y",-K.height/2-X).attr("width",K.width+Q.padding).attr("height",K.height+Q.padding),k4(Q,Y),Q.intersect=function(z){return z4.rect(Q,z)},U},"note"),Ni6=Ri6,Bn0=w((J)=>{if(J)return" "+J;return""},"formatClass"),_K=w((J,Q)=>{return`${Q?Q:"node default"}${Bn0(J.classes)} ${Bn0(J.class)}`},"getClassesFromNode"),Mn0=w(async(J,Q)=>{let{shapeSvg:Z,bbox:U}=await eQ(J,Q,_K(Q,void 0),!0),K=U.width+Q.padding,X=U.height+Q.padding,Y=K+X,z=[{x:Y/2,y:0},{x:Y,y:-Y/2},{x:Y/2,y:-Y},{x:0,y:-Y/2}];B0.info("Question main (Circle)");let G=ZY(Z,Y,Y,z);return G.attr("style",Q.style),k4(Q,G),Q.intersect=function(W){return B0.warn("Intersect called"),z4.polygon(Q,z,W)},Z},"question"),Di6=w((J,Q)=>{let Z=J.insert("g").attr("class","node default").attr("id",Q.domId||Q.id),U=28,K=[{x:0,y:14},{x:14,y:0},{x:0,y:-14},{x:-14,y:0}];return Z.insert("polygon",":first-child").attr("points",K.map(function(Y){return Y.x+","+Y.y}).join(" ")).attr("class","state-start").attr("r",7).attr("width",28).attr("height",28),Q.width=28,Q.height=28,Q.intersect=function(Y){return z4.circle(Q,14,Y)},Z},"choice"),wi6=w(async(J,Q)=>{let{shapeSvg:Z,bbox:U}=await eQ(J,Q,_K(Q,void 0),!0),K=4,X=U.height+Q.padding,Y=X/4,z=U.width+2*Y+Q.padding,G=[{x:Y,y:0},{x:z-Y,y:0},{x:z,y:-X/2},{x:z-Y,y:-X},{x:Y,y:-X},{x:0,y:-X/2}],W=ZY(Z,z,X,G);return W.attr("style",Q.style),k4(Q,W),Q.intersect=function(H){return z4.polygon(Q,G,H)},Z},"hexagon"),Ei6=w(async(J,Q)=>{let{shapeSvg:Z,bbox:U}=await eQ(J,Q,void 0,!0),K=2,X=U.height+2*Q.padding,Y=X/2,z=U.width+2*Y+Q.padding,G=Fi6(Q.directions,U,Q),W=ZY(Z,z,X,G);return W.attr("style",Q.style),k4(Q,W),Q.intersect=function(H){return z4.polygon(Q,G,H)},Z},"block_arrow"),ji6=w(async(J,Q)=>{let{shapeSvg:Z,bbox:U}=await eQ(J,Q,_K(Q,void 0),!0),K=U.width+Q.padding,X=U.height+Q.padding,Y=[{x:-X/2,y:0},{x:K,y:0},{x:K,y:-X},{x:-X/2,y:-X},{x:0,y:-X/2}];return ZY(Z,K,X,Y).attr("style",Q.style),Q.width=K+X,Q.height=X,Q.intersect=function(G){return z4.polygon(Q,Y,G)},Z},"rect_left_inv_arrow"),Pi6=w(async(J,Q)=>{let{shapeSvg:Z,bbox:U}=await eQ(J,Q,_K(Q),!0),K=U.width+Q.padding,X=U.height+Q.padding,Y=[{x:-2*X/6,y:0},{x:K-X/6,y:0},{x:K+2*X/6,y:-X},{x:X/6,y:-X}],z=ZY(Z,K,X,Y);return z.attr("style",Q.style),k4(Q,z),Q.intersect=function(G){return z4.polygon(Q,Y,G)},Z},"lean_right"),Vi6=w(async(J,Q)=>{let{shapeSvg:Z,bbox:U}=await eQ(J,Q,_K(Q,void 0),!0),K=U.width+Q.padding,X=U.height+Q.padding,Y=[{x:2*X/6,y:0},{x:K+X/6,y:0},{x:K-2*X/6,y:-X},{x:-X/6,y:-X}],z=ZY(Z,K,X,Y);return z.attr("style",Q.style),k4(Q,z),Q.intersect=function(G){return z4.polygon(Q,Y,G)},Z},"lean_left"),Ti6=w(async(J,Q)=>{let{shapeSvg:Z,bbox:U}=await eQ(J,Q,_K(Q,void 0),!0),K=U.width+Q.padding,X=U.height+Q.padding,Y=[{x:-2*X/6,y:0},{x:K+2*X/6,y:0},{x:K-X/6,y:-X},{x:X/6,y:-X}],z=ZY(Z,K,X,Y);return z.attr("style",Q.style),k4(Q,z),Q.intersect=function(G){return z4.polygon(Q,Y,G)},Z},"trapezoid"),Ci6=w(async(J,Q)=>{let{shapeSvg:Z,bbox:U}=await eQ(J,Q,_K(Q,void 0),!0),K=U.width+Q.padding,X=U.height+Q.padding,Y=[{x:X/6,y:0},{x:K-X/6,y:0},{x:K+2*X/6,y:-X},{x:-2*X/6,y:-X}],z=ZY(Z,K,X,Y);return z.attr("style",Q.style),k4(Q,z),Q.intersect=function(G){return z4.polygon(Q,Y,G)},Z},"inv_trapezoid"),Si6=w(async(J,Q)=>{let{shapeSvg:Z,bbox:U}=await eQ(J,Q,_K(Q,void 0),!0),K=U.width+Q.padding,X=U.height+Q.padding,Y=[{x:0,y:0},{x:K+X/2,y:0},{x:K,y:-X/2},{x:K+X/2,y:-X},{x:0,y:-X}],z=ZY(Z,K,X,Y);return z.attr("style",Q.style),k4(Q,z),Q.intersect=function(G){return z4.polygon(Q,Y,G)},Z},"rect_right_inv_arrow"),$i6=w(async(J,Q)=>{let{shapeSvg:Z,bbox:U}=await eQ(J,Q,_K(Q,void 0),!0),K=U.width+Q.padding,X=K/2,Y=X/(2.5+K/50),z=U.height+Y+Q.padding,G="M 0,"+Y+" a "+X+","+Y+" 0,0,0 "+K+" 0 a "+X+","+Y+" 0,0,0 "+-K+" 0 l 0,"+z+" a "+X+","+Y+" 0,0,0 "+K+" 0 l 0,"+-z,W=Z.attr("label-offset-y",Y).insert("path",":first-child").attr("style",Q.style).attr("d",G).attr("transform","translate("+-K/2+","+-(z/2+Y)+")");return k4(Q,W),Q.intersect=function(H){let q=z4.rect(Q,H),F=q.x-Q.x;if(X!=0&&(Math.abs(F)<Q.width/2||Math.abs(F)==Q.width/2&&Math.abs(q.y-Q.y)>Q.height/2-Y)){let M=Y*Y*(1-F*F/(X*X));if(M!=0)M=Math.sqrt(M);if(M=Y-M,H.y-Q.y>0)M=-M;q.y+=M}return q},Z},"cylinder"),vi6=w(async(J,Q)=>{let{shapeSvg:Z,bbox:U,halfPadding:K}=await eQ(J,Q,"node "+Q.classes+" "+Q.class,!0),X=Z.insert("rect",":first-child"),Y=Q.positioned?Q.width:U.width+Q.padding,z=Q.positioned?Q.height:U.height+Q.padding,G=Q.positioned?-Y/2:-U.width/2-K,W=Q.positioned?-z/2:-U.height/2-K;if(X.attr("class","basic label-container").attr("style",Q.style).attr("rx",Q.rx).attr("ry",Q.ry).attr("x",G).attr("y",W).attr("width",Y).attr("height",z),Q.props){let H=new Set(Object.keys(Q.props));if(Q.props.borders)og(X,Q.props.borders,Y,z),H.delete("borders");H.forEach((q)=>{B0.warn(`Unknown node property ${q}`)})}return k4(Q,X),Q.intersect=function(H){return z4.rect(Q,H)},Z},"rect"),ki6=w(async(J,Q)=>{let{shapeSvg:Z,bbox:U,halfPadding:K}=await eQ(J,Q,"node "+Q.classes,!0),X=Z.insert("rect",":first-child"),Y=Q.positioned?Q.width:U.width+Q.padding,z=Q.positioned?Q.height:U.height+Q.padding,G=Q.positioned?-Y/2:-U.width/2-K,W=Q.positioned?-z/2:-U.height/2-K;if(X.attr("class","basic cluster composite label-container").attr("style",Q.style).attr("rx",Q.rx).attr("ry",Q.ry).attr("x",G).attr("y",W).attr("width",Y).attr("height",z),Q.props){let H=new Set(Object.keys(Q.props));if(Q.props.borders)og(X,Q.props.borders,Y,z),H.delete("borders");H.forEach((q)=>{B0.warn(`Unknown node property ${q}`)})}return k4(Q,X),Q.intersect=function(H){return z4.rect(Q,H)},Z},"composite"),fi6=w(async(J,Q)=>{let{shapeSvg:Z}=await eQ(J,Q,"label",!0);B0.trace("Classes = ",Q.class);let U=Z.insert("rect",":first-child"),K=0,X=0;if(U.attr("width",K).attr("height",X),Z.attr("class","label edgeLabel"),Q.props){let Y=new Set(Object.keys(Q.props));if(Q.props.borders)og(U,Q.props.borders,K,X),Y.delete("borders");Y.forEach((z)=>{B0.warn(`Unknown node property ${z}`)})}return k4(Q,U),Q.intersect=function(Y){return z4.rect(Q,Y)},Z},"labelRect");w(og,"applyNodePropertyBorders");_i6=w(async(J,Q)=>{let Z;if(!Q.classes)Z="node default";else Z="node "+Q.classes;let U=J.insert("g").attr("class",Z).attr("id",Q.domId||Q.id),K=U.insert("rect",":first-child"),X=U.insert("line"),Y=U.insert("g").attr("class","label"),z=Q.labelText.flat?Q.labelText.flat():Q.labelText,G="";if(typeof z==="object")G=z[0];else G=z;B0.info("Label text abc79",G,z,typeof z==="object");let W=Y.node().appendChild(await rX(G,Q.labelStyle,!0,!0)),H={width:0,height:0};if(V9(i0().flowchart.htmlLabels)){let A=W.children[0],I=j6(W);H=A.getBoundingClientRect(),I.attr("width",H.width),I.attr("height",H.height)}B0.info("Text 2",z);let q=z.slice(1,z.length),F=W.getBBox(),M=Y.node().appendChild(await rX(q.join?q.join("<br/>"):q,Q.labelStyle,!0,!0));if(V9(i0().flowchart.htmlLabels)){let A=M.children[0],I=j6(M);H=A.getBoundingClientRect(),I.attr("width",H.width),I.attr("height",H.height)}let L=Q.padding/2;return j6(M).attr("transform","translate( "+(H.width>F.width?0:(F.width-H.width)/2)+", "+(F.height+L+5)+")"),j6(W).attr("transform","translate( "+(H.width<F.width?0:-(F.width-H.width)/2)+", 0)"),H=Y.node().getBBox(),Y.attr("transform","translate("+-H.width/2+", "+(-H.height/2-L+3)+")"),K.attr("class","outer title-state").attr("x",-H.width/2-L).attr("y",-H.height/2-L).attr("width",H.width+Q.padding).attr("height",H.height+Q.padding),X.attr("class","divider").attr("x1",-H.width/2-L).attr("x2",H.width/2+L).attr("y1",-H.height/2-L+F.height+L).attr("y2",-H.height/2-L+F.height+L),k4(Q,K),Q.intersect=function(A){return z4.rect(Q,A)},U},"rectWithTitle"),bi6=w(async(J,Q)=>{let{shapeSvg:Z,bbox:U}=await eQ(J,Q,_K(Q,void 0),!0),K=U.height+Q.padding,X=U.width+K/4+Q.padding,Y=Z.insert("rect",":first-child").attr("style",Q.style).attr("rx",K/2).attr("ry",K/2).attr("x",-X/2).attr("y",-K/2).attr("width",X).attr("height",K);return k4(Q,Y),Q.intersect=function(z){return z4.rect(Q,z)},Z},"stadium"),xi6=w(async(J,Q)=>{let{shapeSvg:Z,bbox:U,halfPadding:K}=await eQ(J,Q,_K(Q,void 0),!0),X=Z.insert("circle",":first-child");return X.attr("style",Q.style).attr("rx",Q.rx).attr("ry",Q.ry).attr("r",U.width/2+K).attr("width",U.width+Q.padding).attr("height",U.height+Q.padding),B0.info("Circle main"),k4(Q,X),Q.intersect=function(Y){return B0.info("Circle intersect",Q,U.width/2+K,Y),z4.circle(Q,U.width/2+K,Y)},Z},"circle"),hi6=w(async(J,Q)=>{let{shapeSvg:Z,bbox:U,halfPadding:K}=await eQ(J,Q,_K(Q,void 0),!0),X=5,Y=Z.insert("g",":first-child"),z=Y.insert("circle"),G=Y.insert("circle");return Y.attr("class",Q.class),z.attr("style",Q.style).attr("rx",Q.rx).attr("ry",Q.ry).attr("r",U.width/2+K+5).attr("width",U.width+Q.padding+10).attr("height",U.height+Q.padding+10),G.attr("style",Q.style).attr("rx",Q.rx).attr("ry",Q.ry).attr("r",U.width/2+K).attr("width",U.width+Q.padding).attr("height",U.height+Q.padding),B0.info("DoubleCircle main"),k4(Q,z),Q.intersect=function(W){return B0.info("DoubleCircle intersect",Q,U.width/2+K+5,W),z4.circle(Q,U.width/2+K+5,W)},Z},"doublecircle"),yi6=w(async(J,Q)=>{let{shapeSvg:Z,bbox:U}=await eQ(J,Q,_K(Q,void 0),!0),K=U.width+Q.padding,X=U.height+Q.padding,Y=[{x:0,y:0},{x:K,y:0},{x:K,y:-X},{x:0,y:-X},{x:0,y:0},{x:-8,y:0},{x:K+8,y:0},{x:K+8,y:-X},{x:-8,y:-X},{x:-8,y:0}],z=ZY(Z,K,X,Y);return z.attr("style",Q.style),k4(Q,z),Q.intersect=function(G){return z4.polygon(Q,Y,G)},Z},"subroutine"),gi6=w((J,Q)=>{let Z=J.insert("g").attr("class","node default").attr("id",Q.domId||Q.id),U=Z.insert("circle",":first-child");return U.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14),k4(Q,U),Q.intersect=function(K){return z4.circle(Q,7,K)},Z},"start"),On0=w((J,Q,Z)=>{let U=J.insert("g").attr("class","node default").attr("id",Q.domId||Q.id),K=70,X=10;if(Z==="LR")K=10,X=70;let Y=U.append("rect").attr("x",-1*K/2).attr("y",-1*X/2).attr("width",K).attr("height",X).attr("class","fork-join");return k4(Q,Y),Q.height=Q.height+Q.padding/2,Q.width=Q.width+Q.padding/2,Q.intersect=function(z){return z4.rect(Q,z)},U},"forkJoin"),mi6=w((J,Q)=>{let Z=J.insert("g").attr("class","node default").attr("id",Q.domId||Q.id),U=Z.insert("circle",":first-child"),K=Z.insert("circle",":first-child");return K.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14),U.attr("class","state-end").attr("r",5).attr("width",10).attr("height",10),k4(Q,K),Q.intersect=function(X){return z4.circle(Q,7,X)},Z},"end"),ui6=w(async(J,Q)=>{let Z=Q.padding/2,U=4,K=8,X;if(!Q.classes)X="node default";else X="node "+Q.classes;let Y=J.insert("g").attr("class",X).attr("id",Q.domId||Q.id),z=Y.insert("rect",":first-child"),G=Y.insert("line"),W=Y.insert("line"),H=0,q=4,F=Y.insert("g").attr("class","label"),M=0,L=Q.classData.annotations?.[0],A=Q.classData.annotations[0]?"«"+Q.classData.annotations[0]+"»":"",I=F.node().appendChild(await rX(A,Q.labelStyle,!0,!0)),R=I.getBBox();if(V9(i0().flowchart.htmlLabels)){let $=I.children[0],b=j6(I);R=$.getBoundingClientRect(),b.attr("width",R.width),b.attr("height",R.height)}if(Q.classData.annotations[0])q+=R.height+4,H+=R.width;let N=Q.classData.label;if(Q.classData.type!==void 0&&Q.classData.type!=="")if(i0().flowchart.htmlLabels)N+="<"+Q.classData.type+">";else N+="<"+Q.classData.type+">";let E=F.node().appendChild(await rX(N,Q.labelStyle,!0,!0));j6(E).attr("class","classTitle");let V=E.getBBox();if(V9(i0().flowchart.htmlLabels)){let $=E.children[0],b=j6(E);V=$.getBoundingClientRect(),b.attr("width",V.width),b.attr("height",V.height)}if(q+=V.height+4,V.width>H)H=V.width;let j=[];Q.classData.members.forEach(async($)=>{let b=$.getDisplayDetails(),h=b.displayText;if(i0().flowchart.htmlLabels)h=h.replace(/</g,"<").replace(/>/g,">");let _=F.node().appendChild(await rX(h,b.cssStyle?b.cssStyle:Q.labelStyle,!0,!0)),S=_.getBBox();if(V9(i0().flowchart.htmlLabels)){let v=_.children[0],f=j6(_);S=v.getBoundingClientRect(),f.attr("width",S.width),f.attr("height",S.height)}if(S.width>H)H=S.width;q+=S.height+4,j.push(_)}),q+=8;let T=[];if(Q.classData.methods.forEach(async($)=>{let b=$.getDisplayDetails(),h=b.displayText;if(i0().flowchart.htmlLabels)h=h.replace(/</g,"<").replace(/>/g,">");let _=F.node().appendChild(await rX(h,b.cssStyle?b.cssStyle:Q.labelStyle,!0,!0)),S=_.getBBox();if(V9(i0().flowchart.htmlLabels)){let v=_.children[0],f=j6(_);S=v.getBoundingClientRect(),f.attr("width",S.width),f.attr("height",S.height)}if(S.width>H)H=S.width;q+=S.height+4,T.push(_)}),q+=8,L){let $=(H-R.width)/2;j6(I).attr("transform","translate( "+(-1*H/2+$)+", "+-1*q/2+")"),M=R.height+4}let C=(H-V.width)/2;return j6(E).attr("transform","translate( "+(-1*H/2+C)+", "+(-1*q/2+M)+")"),M+=V.height+4,G.attr("class","divider").attr("x1",-H/2-Z).attr("x2",H/2+Z).attr("y1",-q/2-Z+8+M).attr("y2",-q/2-Z+8+M),M+=8,j.forEach(($)=>{j6($).attr("transform","translate( "+-H/2+", "+(-1*q/2+M+4)+")");let b=$?.getBBox();M+=(b?.height??0)+4}),M+=8,W.attr("class","divider").attr("x1",-H/2-Z).attr("x2",H/2+Z).attr("y1",-q/2-Z+8+M).attr("y2",-q/2-Z+8+M),M+=8,T.forEach(($)=>{j6($).attr("transform","translate( "+-H/2+", "+(-1*q/2+M)+")");let b=$?.getBBox();M+=(b?.height??0)+4}),z.attr("style",Q.style).attr("class","outer title-state").attr("x",-H/2-Z).attr("y",-(q/2)-Z).attr("width",H+Q.padding).attr("height",q+Q.padding),k4(Q,z),Q.intersect=function($){return z4.rect(Q,$)},Y},"class_box"),Ln0={rhombus:Mn0,composite:ki6,question:Mn0,rect:vi6,labelRect:fi6,rectWithTitle:_i6,choice:Di6,circle:xi6,doublecircle:hi6,stadium:bi6,hexagon:wi6,block_arrow:Ei6,rect_left_inv_arrow:ji6,lean_right:Pi6,lean_left:Vi6,trapezoid:Ti6,inv_trapezoid:Ci6,rect_right_inv_arrow:Si6,cylinder:$i6,start:gi6,end:mi6,note:Ni6,subroutine:yi6,fork:On0,join:On0,class_box:ui6},ng={},vn0=w(async(J,Q,Z)=>{let U,K;if(Q.link){let X;if(i0().securityLevel==="sandbox")X="_top";else if(Q.linkTarget)X=Q.linkTarget||"_blank";U=J.insert("svg:a").attr("xlink:href",Q.link).attr("target",X),K=await Ln0[Q.shape](U,Q,Z)}else K=await Ln0[Q.shape](J,Q,Z),U=K;if(Q.tooltip)K.attr("title",Q.tooltip);if(Q.class)K.attr("class","node default "+Q.class);if(ng[Q.id]=U,Q.haveCallback)ng[Q.id].attr("class",ng[Q.id].attr("class")+" clickable");return U},"insertNode"),pi6=w((J)=>{let Q=ng[J.id];B0.trace("Transforming node",J.diff,J,"translate("+(J.x-J.width/2-5)+", "+J.width/2+")");let Z=8,U=J.diff||0;if(J.clusterNode)Q.attr("transform","translate("+(J.x+U-J.width/2)+", "+(J.y-J.height/2-Z)+")");else Q.attr("transform","translate("+J.x+", "+J.y+")");return U},"positionNode");w(YU0,"getNodeFromBlock");w(kn0,"calculateBlockSize");w(fn0,"insertBlockPositioned");w(tg,"performOperations");w(_n0,"calculateBlockSizes");w(bn0,"insertBlocks");w(xn0,"insertEdges");ci6=w(function(J,Q){return Q.db.getClasses()},"getClasses"),li6=w(async function(J,Q,Z,U){let{securityLevel:K,block:X}=CJ(),Y=U.db,z;if(K==="sandbox")z=j6("#i"+Q);let G=K==="sandbox"?j6(z.nodes()[0].contentDocument.body):j6("body"),W=K==="sandbox"?G.select(`[id="${Q}"]`):j6(`[id="${Q}"]`);Qi6(W,["point","circle","cross"],U.type,Q);let q=Y.getBlocks(),F=Y.getBlocksFlat(),M=Y.getEdges(),L=W.insert("g").attr("class","block");await _n0(L,q,Y);let A=En0(Y);if(await bn0(L,q,Y),await xn0(L,M,F,Y,Q),A){let I=A,R=Math.max(1,Math.round(0.125*(I.width/I.height))),N=I.height+R+10,E=I.width+10,{useMaxWidth:V}=X;K7(W,N,E,!!V),B0.debug("Here Bounds",A,I),W.attr("viewBox",`${I.x-5} ${I.y-5} ${I.width+10} ${I.height+10}`)}},"draw"),di6={draw:li6,getClasses:ci6},ii6={parser:wd6,db:ud6,renderer:di6,styles:cd6}});var GU0=F4((MV,zU0)=>{(function J(Q,Z){if(typeof MV==="object"&&typeof zU0==="object")zU0.exports=Z();else if(typeof define==="function"&&define.amd)define([],Z);else if(typeof MV==="object")MV.layoutBase=Z();else Q.layoutBase=Z()})(MV,function(){return function(J){var Q={};function Z(U){if(Q[U])return Q[U].exports;var K=Q[U]={i:U,l:!1,exports:{}};return J[U].call(K.exports,K,K.exports,Z),K.l=!0,K.exports}return Z.m=J,Z.c=Q,Z.i=function(U){return U},Z.d=function(U,K,X){if(!Z.o(U,K))Object.defineProperty(U,K,{configurable:!1,enumerable:!0,get:X})},Z.n=function(U){var K=U&&U.__esModule?function X(){return U.default}:function X(){return U};return Z.d(K,"a",K),K},Z.o=function(U,K){return Object.prototype.hasOwnProperty.call(U,K)},Z.p="",Z(Z.s=28)}([function(J,Q,Z){function U(){}U.QUALITY=1,U.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,U.DEFAULT_INCREMENTAL=!1,U.DEFAULT_ANIMATION_ON_LAYOUT=!0,U.DEFAULT_ANIMATION_DURING_LAYOUT=!1,U.DEFAULT_ANIMATION_PERIOD=50,U.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,U.DEFAULT_GRAPH_MARGIN=15,U.NODE_DIMENSIONS_INCLUDE_LABELS=!1,U.SIMPLE_NODE_SIZE=40,U.SIMPLE_NODE_HALF_SIZE=U.SIMPLE_NODE_SIZE/2,U.EMPTY_COMPOUND_NODE_SIZE=40,U.MIN_EDGE_LENGTH=1,U.WORLD_BOUNDARY=1e6,U.INITIAL_WORLD_BOUNDARY=U.WORLD_BOUNDARY/1000,U.WORLD_CENTER_X=1200,U.WORLD_CENTER_Y=900,J.exports=U},function(J,Q,Z){var U=Z(2),K=Z(8),X=Z(9);function Y(G,W,H){U.call(this,H),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=H,this.bendpoints=[],this.source=G,this.target=W}Y.prototype=Object.create(U.prototype);for(var z in U)Y[z]=U[z];Y.prototype.getSource=function(){return this.source},Y.prototype.getTarget=function(){return this.target},Y.prototype.isInterGraph=function(){return this.isInterGraph},Y.prototype.getLength=function(){return this.length},Y.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},Y.prototype.getBendpoints=function(){return this.bendpoints},Y.prototype.getLca=function(){return this.lca},Y.prototype.getSourceInLca=function(){return this.sourceInLca},Y.prototype.getTargetInLca=function(){return this.targetInLca},Y.prototype.getOtherEnd=function(G){if(this.source===G)return this.target;else if(this.target===G)return this.source;else throw"Node is not incident with this edge"},Y.prototype.getOtherEndInGraph=function(G,W){var H=this.getOtherEnd(G),q=W.getGraphManager().getRoot();while(!0){if(H.getOwner()==W)return H;if(H.getOwner()==q)break;H=H.getOwner().getParent()}return null},Y.prototype.updateLength=function(){var G=new Array(4);if(this.isOverlapingSourceAndTarget=K.getIntersection(this.target.getRect(),this.source.getRect(),G),!this.isOverlapingSourceAndTarget){if(this.lengthX=G[0]-G[2],this.lengthY=G[1]-G[3],Math.abs(this.lengthX)<1)this.lengthX=X.sign(this.lengthX);if(Math.abs(this.lengthY)<1)this.lengthY=X.sign(this.lengthY);this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)}},Y.prototype.updateLengthSimple=function(){if(this.lengthX=this.target.getCenterX()-this.source.getCenterX(),this.lengthY=this.target.getCenterY()-this.source.getCenterY(),Math.abs(this.lengthX)<1)this.lengthX=X.sign(this.lengthX);if(Math.abs(this.lengthY)<1)this.lengthY=X.sign(this.lengthY);this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},J.exports=Y},function(J,Q,Z){function U(K){this.vGraphObject=K}J.exports=U},function(J,Q,Z){var U=Z(2),K=Z(10),X=Z(13),Y=Z(0),z=Z(16),G=Z(5);function W(q,F,M,L){if(M==null&&L==null)L=F;if(U.call(this,L),q.graphManager!=null)q=q.graphManager;if(this.estimatedSize=K.MIN_VALUE,this.inclusionTreeDepth=K.MAX_VALUE,this.vGraphObject=L,this.edges=[],this.graphManager=q,M!=null&&F!=null)this.rect=new X(F.x,F.y,M.width,M.height);else this.rect=new X}W.prototype=Object.create(U.prototype);for(var H in U)W[H]=U[H];W.prototype.getEdges=function(){return this.edges},W.prototype.getChild=function(){return this.child},W.prototype.getOwner=function(){return this.owner},W.prototype.getWidth=function(){return this.rect.width},W.prototype.setWidth=function(q){this.rect.width=q},W.prototype.getHeight=function(){return this.rect.height},W.prototype.setHeight=function(q){this.rect.height=q},W.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},W.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},W.prototype.getCenter=function(){return new G(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},W.prototype.getLocation=function(){return new G(this.rect.x,this.rect.y)},W.prototype.getRect=function(){return this.rect},W.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},W.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},W.prototype.setRect=function(q,F){this.rect.x=q.x,this.rect.y=q.y,this.rect.width=F.width,this.rect.height=F.height},W.prototype.setCenter=function(q,F){this.rect.x=q-this.rect.width/2,this.rect.y=F-this.rect.height/2},W.prototype.setLocation=function(q,F){this.rect.x=q,this.rect.y=F},W.prototype.moveBy=function(q,F){this.rect.x+=q,this.rect.y+=F},W.prototype.getEdgeListToNode=function(q){var F=[],M,L=this;return L.edges.forEach(function(A){if(A.target==q){if(A.source!=L)throw"Incorrect edge source!";F.push(A)}}),F},W.prototype.getEdgesBetween=function(q){var F=[],M,L=this;return L.edges.forEach(function(A){if(!(A.source==L||A.target==L))throw"Incorrect edge source and/or target";if(A.target==q||A.source==q)F.push(A)}),F},W.prototype.getNeighborsList=function(){var q=new Set,F=this;return F.edges.forEach(function(M){if(M.source==F)q.add(M.target);else{if(M.target!=F)throw"Incorrect incidency!";q.add(M.source)}}),q},W.prototype.withChildren=function(){var q=new Set,F,M;if(q.add(this),this.child!=null){var L=this.child.getNodes();for(var A=0;A<L.length;A++)F=L[A],M=F.withChildren(),M.forEach(function(I){q.add(I)})}return q},W.prototype.getNoOfChildren=function(){var q=0,F;if(this.child==null)q=1;else{var M=this.child.getNodes();for(var L=0;L<M.length;L++)F=M[L],q+=F.getNoOfChildren()}if(q==0)q=1;return q},W.prototype.getEstimatedSize=function(){if(this.estimatedSize==K.MIN_VALUE)throw"assert failed";return this.estimatedSize},W.prototype.calcEstimatedSize=function(){if(this.child==null)return this.estimatedSize=(this.rect.width+this.rect.height)/2;else return this.estimatedSize=this.child.calcEstimatedSize(),this.rect.width=this.estimatedSize,this.rect.height=this.estimatedSize,this.estimatedSize},W.prototype.scatter=function(){var q,F,M=-Y.INITIAL_WORLD_BOUNDARY,L=Y.INITIAL_WORLD_BOUNDARY;q=Y.WORLD_CENTER_X+z.nextDouble()*(L-M)+M;var A=-Y.INITIAL_WORLD_BOUNDARY,I=Y.INITIAL_WORLD_BOUNDARY;F=Y.WORLD_CENTER_Y+z.nextDouble()*(I-A)+A,this.rect.x=q,this.rect.y=F},W.prototype.updateBounds=function(){if(this.getChild()==null)throw"assert failed";if(this.getChild().getNodes().length!=0){var q=this.getChild();if(q.updateBounds(!0),this.rect.x=q.getLeft(),this.rect.y=q.getTop(),this.setWidth(q.getRight()-q.getLeft()),this.setHeight(q.getBottom()-q.getTop()),Y.NODE_DIMENSIONS_INCLUDE_LABELS){var F=q.getRight()-q.getLeft(),M=q.getBottom()-q.getTop();if(this.labelWidth){if(this.labelPosHorizontal=="left")this.rect.x-=this.labelWidth,this.setWidth(F+this.labelWidth);else if(this.labelPosHorizontal=="center"&&this.labelWidth>F)this.rect.x-=(this.labelWidth-F)/2,this.setWidth(this.labelWidth);else if(this.labelPosHorizontal=="right")this.setWidth(F+this.labelWidth)}if(this.labelHeight){if(this.labelPosVertical=="top")this.rect.y-=this.labelHeight,this.setHeight(M+this.labelHeight);else if(this.labelPosVertical=="center"&&this.labelHeight>M)this.rect.y-=(this.labelHeight-M)/2,this.setHeight(this.labelHeight);else if(this.labelPosVertical=="bottom")this.setHeight(M+this.labelHeight)}}}},W.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==K.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},W.prototype.transform=function(q){var F=this.rect.x;if(F>Y.WORLD_BOUNDARY)F=Y.WORLD_BOUNDARY;else if(F<-Y.WORLD_BOUNDARY)F=-Y.WORLD_BOUNDARY;var M=this.rect.y;if(M>Y.WORLD_BOUNDARY)M=Y.WORLD_BOUNDARY;else if(M<-Y.WORLD_BOUNDARY)M=-Y.WORLD_BOUNDARY;var L=new G(F,M),A=q.inverseTransformPoint(L);this.setLocation(A.x,A.y)},W.prototype.getLeft=function(){return this.rect.x},W.prototype.getRight=function(){return this.rect.x+this.rect.width},W.prototype.getTop=function(){return this.rect.y},W.prototype.getBottom=function(){return this.rect.y+this.rect.height},W.prototype.getParent=function(){if(this.owner==null)return null;return this.owner.getParent()},J.exports=W},function(J,Q,Z){var U=Z(0);function K(){}for(var X in U)K[X]=U[X];K.MAX_ITERATIONS=2500,K.DEFAULT_EDGE_LENGTH=50,K.DEFAULT_SPRING_STRENGTH=0.45,K.DEFAULT_REPULSION_STRENGTH=4500,K.DEFAULT_GRAVITY_STRENGTH=0.4,K.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,K.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,K.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,K.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=!0,K.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=!0,K.DEFAULT_COOLING_FACTOR_INCREMENTAL=0.3,K.COOLING_ADAPTATION_FACTOR=0.33,K.ADAPTATION_LOWER_NODE_LIMIT=1000,K.ADAPTATION_UPPER_NODE_LIMIT=5000,K.MAX_NODE_DISPLACEMENT_INCREMENTAL=100,K.MAX_NODE_DISPLACEMENT=K.MAX_NODE_DISPLACEMENT_INCREMENTAL*3,K.MIN_REPULSION_DIST=K.DEFAULT_EDGE_LENGTH/10,K.CONVERGENCE_CHECK_PERIOD=100,K.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=0.1,K.MIN_EDGE_LENGTH=1,K.GRID_CALCULATION_CHECK_PERIOD=10,J.exports=K},function(J,Q,Z){function U(K,X){if(K==null&&X==null)this.x=0,this.y=0;else this.x=K,this.y=X}U.prototype.getX=function(){return this.x},U.prototype.getY=function(){return this.y},U.prototype.setX=function(K){this.x=K},U.prototype.setY=function(K){this.y=K},U.prototype.getDifference=function(K){return new DimensionD(this.x-K.x,this.y-K.y)},U.prototype.getCopy=function(){return new U(this.x,this.y)},U.prototype.translate=function(K){return this.x+=K.width,this.y+=K.height,this},J.exports=U},function(J,Q,Z){var U=Z(2),K=Z(10),X=Z(0),Y=Z(7),z=Z(3),G=Z(1),W=Z(13),H=Z(12),q=Z(11);function F(L,A,I){if(U.call(this,I),this.estimatedSize=K.MIN_VALUE,this.margin=X.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=L,A!=null&&A instanceof Y)this.graphManager=A;else if(A!=null&&A instanceof Layout)this.graphManager=A.graphManager}F.prototype=Object.create(U.prototype);for(var M in U)F[M]=U[M];F.prototype.getNodes=function(){return this.nodes},F.prototype.getEdges=function(){return this.edges},F.prototype.getGraphManager=function(){return this.graphManager},F.prototype.getParent=function(){return this.parent},F.prototype.getLeft=function(){return this.left},F.prototype.getRight=function(){return this.right},F.prototype.getTop=function(){return this.top},F.prototype.getBottom=function(){return this.bottom},F.prototype.isConnected=function(){return this.isConnected},F.prototype.add=function(L,A,I){if(A==null&&I==null){var R=L;if(this.graphManager==null)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(R)>-1)throw"Node already in graph!";return R.owner=this,this.getNodes().push(R),R}else{var N=L;if(!(this.getNodes().indexOf(A)>-1&&this.getNodes().indexOf(I)>-1))throw"Source or target not in graph!";if(!(A.owner==I.owner&&A.owner==this))throw"Both owners must be this graph!";if(A.owner!=I.owner)return null;if(N.source=A,N.target=I,N.isInterGraph=!1,this.getEdges().push(N),A.edges.push(N),I!=A)I.edges.push(N);return N}},F.prototype.remove=function(L){var A=L;if(L instanceof z){if(A==null)throw"Node is null!";if(!(A.owner!=null&&A.owner==this))throw"Owner graph is invalid!";if(this.graphManager==null)throw"Owner graph manager is invalid!";var I=A.edges.slice(),R,N=I.length;for(var E=0;E<N;E++)if(R=I[E],R.isInterGraph)this.graphManager.remove(R);else R.source.owner.remove(R);var V=this.nodes.indexOf(A);if(V==-1)throw"Node not in owner node list!";this.nodes.splice(V,1)}else if(L instanceof G){var R=L;if(R==null)throw"Edge is null!";if(!(R.source!=null&&R.target!=null))throw"Source and/or target is null!";if(!(R.source.owner!=null&&R.target.owner!=null&&R.source.owner==this&&R.target.owner==this))throw"Source and/or target owner is invalid!";var j=R.source.edges.indexOf(R),T=R.target.edges.indexOf(R);if(!(j>-1&&T>-1))throw"Source and/or target doesn't know this edge!";if(R.source.edges.splice(j,1),R.target!=R.source)R.target.edges.splice(T,1);var V=R.source.owner.getEdges().indexOf(R);if(V==-1)throw"Not in owner's edge list!";R.source.owner.getEdges().splice(V,1)}},F.prototype.updateLeftTop=function(){var{MAX_VALUE:L,MAX_VALUE:A}=K,I,R,N,E=this.getNodes(),V=E.length;for(var j=0;j<V;j++){var T=E[j];if(I=T.getTop(),R=T.getLeft(),L>I)L=I;if(A>R)A=R}if(L==K.MAX_VALUE)return null;if(E[0].getParent().paddingLeft!=null)N=E[0].getParent().paddingLeft;else N=this.margin;return this.left=A-N,this.top=L-N,new H(this.left,this.top)},F.prototype.updateBounds=function(L){var A=K.MAX_VALUE,I=-K.MAX_VALUE,R=K.MAX_VALUE,N=-K.MAX_VALUE,E,V,j,T,C,$=this.nodes,b=$.length;for(var h=0;h<b;h++){var _=$[h];if(L&&_.child!=null)_.updateBounds();if(E=_.getLeft(),V=_.getRight(),j=_.getTop(),T=_.getBottom(),A>E)A=E;if(I<V)I=V;if(R>j)R=j;if(N<T)N=T}var S=new W(A,R,I-A,N-R);if(A==K.MAX_VALUE)this.left=this.parent.getLeft(),this.right=this.parent.getRight(),this.top=this.parent.getTop(),this.bottom=this.parent.getBottom();if($[0].getParent().paddingLeft!=null)C=$[0].getParent().paddingLeft;else C=this.margin;this.left=S.x-C,this.right=S.x+S.width+C,this.top=S.y-C,this.bottom=S.y+S.height+C},F.calculateBounds=function(L){var A=K.MAX_VALUE,I=-K.MAX_VALUE,R=K.MAX_VALUE,N=-K.MAX_VALUE,E,V,j,T,C=L.length;for(var $=0;$<C;$++){var b=L[$];if(E=b.getLeft(),V=b.getRight(),j=b.getTop(),T=b.getBottom(),A>E)A=E;if(I<V)I=V;if(R>j)R=j;if(N<T)N=T}var h=new W(A,R,I-A,N-R);return h},F.prototype.getInclusionTreeDepth=function(){if(this==this.graphManager.getRoot())return 1;else return this.parent.getInclusionTreeDepth()},F.prototype.getEstimatedSize=function(){if(this.estimatedSize==K.MIN_VALUE)throw"assert failed";return this.estimatedSize},F.prototype.calcEstimatedSize=function(){var L=0,A=this.nodes,I=A.length;for(var R=0;R<I;R++){var N=A[R];L+=N.calcEstimatedSize()}if(L==0)this.estimatedSize=X.EMPTY_COMPOUND_NODE_SIZE;else this.estimatedSize=L/Math.sqrt(this.nodes.length);return this.estimatedSize},F.prototype.updateConnected=function(){var L=this;if(this.nodes.length==0){this.isConnected=!0;return}var A=new q,I=new Set,R=this.nodes[0],N,E,V=R.withChildren();V.forEach(function(h){A.push(h),I.add(h)});while(A.length!==0){R=A.shift(),N=R.getEdges();var j=N.length;for(var T=0;T<j;T++){var C=N[T];if(E=C.getOtherEndInGraph(R,this),E!=null&&!I.has(E)){var $=E.withChildren();$.forEach(function(h){A.push(h),I.add(h)})}}}if(this.isConnected=!1,I.size>=this.nodes.length){var b=0;if(I.forEach(function(h){if(h.owner==L)b++}),b==this.nodes.length)this.isConnected=!0}},J.exports=F},function(J,Q,Z){var U,K=Z(1);function X(Y){U=Z(6),this.layout=Y,this.graphs=[],this.edges=[]}X.prototype.addRoot=function(){var Y=this.layout.newGraph(),z=this.layout.newNode(null),G=this.add(Y,z);return this.setRootGraph(G),this.rootGraph},X.prototype.add=function(Y,z,G,W,H){if(G==null&&W==null&&H==null){if(Y==null)throw"Graph is null!";if(z==null)throw"Parent node is null!";if(this.graphs.indexOf(Y)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(Y),Y.parent!=null)throw"Already has a parent!";if(z.child!=null)throw"Already has a child!";return Y.parent=z,z.child=Y,Y}else{H=G,W=z,G=Y;var q=W.getOwner(),F=H.getOwner();if(!(q!=null&&q.getGraphManager()==this))throw"Source not in this graph mgr!";if(!(F!=null&&F.getGraphManager()==this))throw"Target not in this graph mgr!";if(q==F)return G.isInterGraph=!1,q.add(G,W,H);else{if(G.isInterGraph=!0,G.source=W,G.target=H,this.edges.indexOf(G)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(G),!(G.source!=null&&G.target!=null))throw"Edge source and/or target is null!";if(!(G.source.edges.indexOf(G)==-1&&G.target.edges.indexOf(G)==-1))throw"Edge already in source and/or target incidency list!";return G.source.edges.push(G),G.target.edges.push(G),G}}},X.prototype.remove=function(Y){if(Y instanceof U){var z=Y;if(z.getGraphManager()!=this)throw"Graph not in this graph mgr";if(!(z==this.rootGraph||z.parent!=null&&z.parent.graphManager==this))throw"Invalid parent node!";var G=[];G=G.concat(z.getEdges());var W,H=G.length;for(var q=0;q<H;q++)W=G[q],z.remove(W);var F=[];F=F.concat(z.getNodes());var M;H=F.length;for(var q=0;q<H;q++)M=F[q],z.remove(M);if(z==this.rootGraph)this.setRootGraph(null);var L=this.graphs.indexOf(z);this.graphs.splice(L,1),z.parent=null}else if(Y instanceof K){if(W=Y,W==null)throw"Edge is null!";if(!W.isInterGraph)throw"Not an inter-graph edge!";if(!(W.source!=null&&W.target!=null))throw"Source and/or target is null!";if(!(W.source.edges.indexOf(W)!=-1&&W.target.edges.indexOf(W)!=-1))throw"Source and/or target doesn't know this edge!";var L=W.source.edges.indexOf(W);if(W.source.edges.splice(L,1),L=W.target.edges.indexOf(W),W.target.edges.splice(L,1),!(W.source.owner!=null&&W.source.owner.getGraphManager()!=null))throw"Edge owner graph or owner graph manager is null!";if(W.source.owner.getGraphManager().edges.indexOf(W)==-1)throw"Not in owner graph manager's edge list!";var L=W.source.owner.getGraphManager().edges.indexOf(W);W.source.owner.getGraphManager().edges.splice(L,1)}},X.prototype.updateBounds=function(){this.rootGraph.updateBounds(!0)},X.prototype.getGraphs=function(){return this.graphs},X.prototype.getAllNodes=function(){if(this.allNodes==null){var Y=[],z=this.getGraphs(),G=z.length;for(var W=0;W<G;W++)Y=Y.concat(z[W].getNodes());this.allNodes=Y}return this.allNodes},X.prototype.resetAllNodes=function(){this.allNodes=null},X.prototype.resetAllEdges=function(){this.allEdges=null},X.prototype.resetAllNodesToApplyGravitation=function(){this.allNodesToApplyGravitation=null},X.prototype.getAllEdges=function(){if(this.allEdges==null){var Y=[],z=this.getGraphs(),G=z.length;for(var W=0;W<z.length;W++)Y=Y.concat(z[W].getEdges());Y=Y.concat(this.edges),this.allEdges=Y}return this.allEdges},X.prototype.getAllNodesToApplyGravitation=function(){return this.allNodesToApplyGravitation},X.prototype.setAllNodesToApplyGravitation=function(Y){if(this.allNodesToApplyGravitation!=null)throw"assert failed";this.allNodesToApplyGravitation=Y},X.prototype.getRoot=function(){return this.rootGraph},X.prototype.setRootGraph=function(Y){if(Y.getGraphManager()!=this)throw"Root not in this graph mgr!";if(this.rootGraph=Y,Y.parent==null)Y.parent=this.layout.newNode("Root node")},X.prototype.getLayout=function(){return this.layout},X.prototype.isOneAncestorOfOther=function(Y,z){if(!(Y!=null&&z!=null))throw"assert failed";if(Y==z)return!0;var G=Y.getOwner(),W;do{if(W=G.getParent(),W==null)break;if(W==z)return!0;if(G=W.getOwner(),G==null)break}while(!0);G=z.getOwner();do{if(W=G.getParent(),W==null)break;if(W==Y)return!0;if(G=W.getOwner(),G==null)break}while(!0);return!1},X.prototype.calcLowestCommonAncestors=function(){var Y,z,G,W,H,q=this.getAllEdges(),F=q.length;for(var M=0;M<F;M++){if(Y=q[M],z=Y.source,G=Y.target,Y.lca=null,Y.sourceInLca=z,Y.targetInLca=G,z==G){Y.lca=z.getOwner();continue}W=z.getOwner();while(Y.lca==null){Y.targetInLca=G,H=G.getOwner();while(Y.lca==null){if(H==W){Y.lca=H;break}if(H==this.rootGraph)break;if(Y.lca!=null)throw"assert failed";Y.targetInLca=H.getParent(),H=Y.targetInLca.getOwner()}if(W==this.rootGraph)break;if(Y.lca==null)Y.sourceInLca=W.getParent(),W=Y.sourceInLca.getOwner()}if(Y.lca==null)throw"assert failed"}},X.prototype.calcLowestCommonAncestor=function(Y,z){if(Y==z)return Y.getOwner();var G=Y.getOwner();do{if(G==null)break;var W=z.getOwner();do{if(W==null)break;if(W==G)return W;W=W.getParent().getOwner()}while(!0);G=G.getParent().getOwner()}while(!0);return G},X.prototype.calcInclusionTreeDepths=function(Y,z){if(Y==null&&z==null)Y=this.rootGraph,z=1;var G,W=Y.getNodes(),H=W.length;for(var q=0;q<H;q++)if(G=W[q],G.inclusionTreeDepth=z,G.child!=null)this.calcInclusionTreeDepths(G.child,z+1)},X.prototype.includesInvalidEdge=function(){var Y,z=[],G=this.edges.length;for(var W=0;W<G;W++)if(Y=this.edges[W],this.isOneAncestorOfOther(Y.source,Y.target))z.push(Y);for(var W=0;W<z.length;W++)this.remove(z[W]);return!1},J.exports=X},function(J,Q,Z){var U=Z(12);function K(){}K.calcSeparationAmount=function(X,Y,z,G){if(!X.intersects(Y))throw"assert failed";var W=new Array(2);if(this.decideDirectionsForOverlappingNodes(X,Y,W),z[0]=Math.min(X.getRight(),Y.getRight())-Math.max(X.x,Y.x),z[1]=Math.min(X.getBottom(),Y.getBottom())-Math.max(X.y,Y.y),X.getX()<=Y.getX()&&X.getRight()>=Y.getRight())z[0]+=Math.min(Y.getX()-X.getX(),X.getRight()-Y.getRight());else if(Y.getX()<=X.getX()&&Y.getRight()>=X.getRight())z[0]+=Math.min(X.getX()-Y.getX(),Y.getRight()-X.getRight());if(X.getY()<=Y.getY()&&X.getBottom()>=Y.getBottom())z[1]+=Math.min(Y.getY()-X.getY(),X.getBottom()-Y.getBottom());else if(Y.getY()<=X.getY()&&Y.getBottom()>=X.getBottom())z[1]+=Math.min(X.getY()-Y.getY(),Y.getBottom()-X.getBottom());var H=Math.abs((Y.getCenterY()-X.getCenterY())/(Y.getCenterX()-X.getCenterX()));if(Y.getCenterY()===X.getCenterY()&&Y.getCenterX()===X.getCenterX())H=1;var q=H*z[0],F=z[1]/H;if(z[0]<F)F=z[0];else q=z[1];z[0]=-1*W[0]*(F/2+G),z[1]=-1*W[1]*(q/2+G)},K.decideDirectionsForOverlappingNodes=function(X,Y,z){if(X.getCenterX()<Y.getCenterX())z[0]=-1;else z[0]=1;if(X.getCenterY()<Y.getCenterY())z[1]=-1;else z[1]=1},K.getIntersection2=function(X,Y,z){var G=X.getCenterX(),W=X.getCenterY(),H=Y.getCenterX(),q=Y.getCenterY();if(X.intersects(Y))return z[0]=G,z[1]=W,z[2]=H,z[3]=q,!0;var F=X.getX(),M=X.getY(),L=X.getRight(),A=X.getX(),I=X.getBottom(),R=X.getRight(),N=X.getWidthHalf(),E=X.getHeightHalf(),V=Y.getX(),j=Y.getY(),T=Y.getRight(),C=Y.getX(),$=Y.getBottom(),b=Y.getRight(),h=Y.getWidthHalf(),_=Y.getHeightHalf(),S=!1,v=!1;if(G===H){if(W>q)return z[0]=G,z[1]=M,z[2]=H,z[3]=$,!1;else if(W<q)return z[0]=G,z[1]=I,z[2]=H,z[3]=j,!1}else if(W===q){if(G>H)return z[0]=F,z[1]=W,z[2]=T,z[3]=q,!1;else if(G<H)return z[0]=L,z[1]=W,z[2]=V,z[3]=q,!1}else{var f=X.height/X.width,x=Y.height/Y.width,y=(q-W)/(H-G),m=void 0,g=void 0,p=void 0,i=void 0,l=void 0,a=void 0;if(-f===y)if(G>H)z[0]=A,z[1]=I,S=!0;else z[0]=L,z[1]=M,S=!0;else if(f===y)if(G>H)z[0]=F,z[1]=M,S=!0;else z[0]=R,z[1]=I,S=!0;if(-x===y)if(H>G)z[2]=C,z[3]=$,v=!0;else z[2]=T,z[3]=j,v=!0;else if(x===y)if(H>G)z[2]=V,z[3]=j,v=!0;else z[2]=b,z[3]=$,v=!0;if(S&&v)return!1;if(G>H)if(W>q)m=this.getCardinalDirection(f,y,4),g=this.getCardinalDirection(x,y,2);else m=this.getCardinalDirection(-f,y,3),g=this.getCardinalDirection(-x,y,1);else if(W>q)m=this.getCardinalDirection(-f,y,1),g=this.getCardinalDirection(-x,y,3);else m=this.getCardinalDirection(f,y,2),g=this.getCardinalDirection(x,y,4);if(!S)switch(m){case 1:i=M,p=G+-E/y,z[0]=p,z[1]=i;break;case 2:p=R,i=W+N*y,z[0]=p,z[1]=i;break;case 3:i=I,p=G+E/y,z[0]=p,z[1]=i;break;case 4:p=A,i=W+-N*y,z[0]=p,z[1]=i;break}if(!v)switch(g){case 1:a=j,l=H+-_/y,z[2]=l,z[3]=a;break;case 2:l=b,a=q+h*y,z[2]=l,z[3]=a;break;case 3:a=$,l=H+_/y,z[2]=l,z[3]=a;break;case 4:l=C,a=q+-h*y,z[2]=l,z[3]=a;break}}return!1},K.getCardinalDirection=function(X,Y,z){if(X>Y)return z;else return 1+z%4},K.getIntersection=function(X,Y,z,G){if(G==null)return this.getIntersection2(X,Y,z);var{x:W,y:H}=X,q=Y.x,F=Y.y,M=z.x,L=z.y,A=G.x,I=G.y,R=void 0,N=void 0,E=void 0,V=void 0,j=void 0,T=void 0,C=void 0,$=void 0,b=void 0;if(E=F-H,j=W-q,C=q*H-W*F,V=I-L,T=M-A,$=A*L-M*I,b=E*T-V*j,b===0)return null;return R=(j*$-T*C)/b,N=(V*C-E*$)/b,new U(R,N)},K.angleOfVector=function(X,Y,z,G){var W=void 0;if(X!==z){if(W=Math.atan((G-Y)/(z-X)),z<X)W+=Math.PI;else if(G<Y)W+=this.TWO_PI}else if(G<Y)W=this.ONE_AND_HALF_PI;else W=this.HALF_PI;return W},K.doIntersect=function(X,Y,z,G){var{x:W,y:H}=X,q=Y.x,F=Y.y,M=z.x,L=z.y,A=G.x,I=G.y,R=(q-W)*(I-L)-(A-M)*(F-H);if(R===0)return!1;else{var N=((I-L)*(A-W)+(M-A)*(I-H))/R,E=((H-F)*(A-W)+(q-W)*(I-H))/R;return 0<N&&N<1&&0<E&&E<1}},K.findCircleLineIntersections=function(X,Y,z,G,W,H,q){var F=(z-X)*(z-X)+(G-Y)*(G-Y),M=2*((X-W)*(z-X)+(Y-H)*(G-Y)),L=(X-W)*(X-W)+(Y-H)*(Y-H)-q*q,A=M*M-4*F*L;if(A>=0){var I=(-M+Math.sqrt(M*M-4*F*L))/(2*F),R=(-M-Math.sqrt(M*M-4*F*L))/(2*F),N=null;if(I>=0&&I<=1)return[I];if(R>=0&&R<=1)return[R];return N}else return null},K.HALF_PI=0.5*Math.PI,K.ONE_AND_HALF_PI=1.5*Math.PI,K.TWO_PI=2*Math.PI,K.THREE_PI=3*Math.PI,J.exports=K},function(J,Q,Z){function U(){}U.sign=function(K){if(K>0)return 1;else if(K<0)return-1;else return 0},U.floor=function(K){return K<0?Math.ceil(K):Math.floor(K)},U.ceil=function(K){return K<0?Math.floor(K):Math.ceil(K)},J.exports=U},function(J,Q,Z){function U(){}U.MAX_VALUE=2147483647,U.MIN_VALUE=-2147483648,J.exports=U},function(J,Q,Z){var U=function(){function W(H,q){for(var F=0;F<q.length;F++){var M=q[F];if(M.enumerable=M.enumerable||!1,M.configurable=!0,"value"in M)M.writable=!0;Object.defineProperty(H,M.key,M)}}return function(H,q,F){if(q)W(H.prototype,q);if(F)W(H,F);return H}}();function K(W,H){if(!(W instanceof H))throw new TypeError("Cannot call a class as a function")}var X=function W(H){return{value:H,next:null,prev:null}},Y=function W(H,q,F,M){if(H!==null)H.next=q;else M.head=q;if(F!==null)F.prev=q;else M.tail=q;return q.prev=H,q.next=F,M.length++,q},z=function W(H,q){var{prev:F,next:M}=H;if(F!==null)F.next=M;else q.head=M;if(M!==null)M.prev=F;else q.tail=F;return H.prev=H.next=null,q.length--,H},G=function(){function W(H){var q=this;if(K(this,W),this.length=0,this.head=null,this.tail=null,H!=null)H.forEach(function(F){return q.push(F)})}return U(W,[{key:"size",value:function H(){return this.length}},{key:"insertBefore",value:function H(q,F){return Y(F.prev,X(q),F,this)}},{key:"insertAfter",value:function H(q,F){return Y(F,X(q),F.next,this)}},{key:"insertNodeBefore",value:function H(q,F){return Y(F.prev,q,F,this)}},{key:"insertNodeAfter",value:function H(q,F){return Y(F,q,F.next,this)}},{key:"push",value:function H(q){return Y(this.tail,X(q),null,this)}},{key:"unshift",value:function H(q){return Y(null,X(q),this.head,this)}},{key:"remove",value:function H(q){return z(q,this)}},{key:"pop",value:function H(){return z(this.tail,this).value}},{key:"popNode",value:function H(){return z(this.tail,this)}},{key:"shift",value:function H(){return z(this.head,this).value}},{key:"shiftNode",value:function H(){return z(this.head,this)}},{key:"get_object_at",value:function H(q){if(q<=this.length()){var F=1,M=this.head;while(F<q)M=M.next,F++;return M.value}}},{key:"set_object_at",value:function H(q,F){if(q<=this.length()){var M=1,L=this.head;while(M<q)L=L.next,M++;L.value=F}}}]),W}();J.exports=G},function(J,Q,Z){function U(K,X,Y){if(this.x=null,this.y=null,K==null&&X==null&&Y==null)this.x=0,this.y=0;else if(typeof K=="number"&&typeof X=="number"&&Y==null)this.x=K,this.y=X;else if(K.constructor.name=="Point"&&X==null&&Y==null)Y=K,this.x=Y.x,this.y=Y.y}U.prototype.getX=function(){return this.x},U.prototype.getY=function(){return this.y},U.prototype.getLocation=function(){return new U(this.x,this.y)},U.prototype.setLocation=function(K,X,Y){if(K.constructor.name=="Point"&&X==null&&Y==null)Y=K,this.setLocation(Y.x,Y.y);else if(typeof K=="number"&&typeof X=="number"&&Y==null)if(parseInt(K)==K&&parseInt(X)==X)this.move(K,X);else this.x=Math.floor(K+0.5),this.y=Math.floor(X+0.5)},U.prototype.move=function(K,X){this.x=K,this.y=X},U.prototype.translate=function(K,X){this.x+=K,this.y+=X},U.prototype.equals=function(K){if(K.constructor.name=="Point"){var X=K;return this.x==X.x&&this.y==X.y}return this==K},U.prototype.toString=function(){return new U().constructor.name+"[x="+this.x+",y="+this.y+"]"},J.exports=U},function(J,Q,Z){function U(K,X,Y,z){if(this.x=0,this.y=0,this.width=0,this.height=0,K!=null&&X!=null&&Y!=null&&z!=null)this.x=K,this.y=X,this.width=Y,this.height=z}U.prototype.getX=function(){return this.x},U.prototype.setX=function(K){this.x=K},U.prototype.getY=function(){return this.y},U.prototype.setY=function(K){this.y=K},U.prototype.getWidth=function(){return this.width},U.prototype.setWidth=function(K){this.width=K},U.prototype.getHeight=function(){return this.height},U.prototype.setHeight=function(K){this.height=K},U.prototype.getRight=function(){return this.x+this.width},U.prototype.getBottom=function(){return this.y+this.height},U.prototype.intersects=function(K){if(this.getRight()<K.x)return!1;if(this.getBottom()<K.y)return!1;if(K.getRight()<this.x)return!1;if(K.getBottom()<this.y)return!1;return!0},U.prototype.getCenterX=function(){return this.x+this.width/2},U.prototype.getMinX=function(){return this.getX()},U.prototype.getMaxX=function(){return this.getX()+this.width},U.prototype.getCenterY=function(){return this.y+this.height/2},U.prototype.getMinY=function(){return this.getY()},U.prototype.getMaxY=function(){return this.getY()+this.height},U.prototype.getWidthHalf=function(){return this.width/2},U.prototype.getHeightHalf=function(){return this.height/2},J.exports=U},function(J,Q,Z){var U=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(X){return typeof X}:function(X){return X&&typeof Symbol==="function"&&X.constructor===Symbol&&X!==Symbol.prototype?"symbol":typeof X};function K(){}K.lastID=0,K.createID=function(X){if(K.isPrimitive(X))return X;if(X.uniqueID!=null)return X.uniqueID;return X.uniqueID=K.getString(),K.lastID++,X.uniqueID},K.getString=function(X){if(X==null)X=K.lastID;return"Object#"+X},K.isPrimitive=function(X){var Y=typeof X==="undefined"?"undefined":U(X);return X==null||Y!="object"&&Y!="function"},J.exports=K},function(J,Q,Z){function U(M){if(Array.isArray(M)){for(var L=0,A=Array(M.length);L<M.length;L++)A[L]=M[L];return A}else return Array.from(M)}var K=Z(0),X=Z(7),Y=Z(3),z=Z(1),G=Z(6),W=Z(5),H=Z(17),q=Z(29);function F(M){if(q.call(this),this.layoutQuality=K.QUALITY,this.createBendsAsNeeded=K.DEFAULT_CREATE_BENDS_AS_NEEDED,this.incremental=K.DEFAULT_INCREMENTAL,this.animationOnLayout=K.DEFAULT_ANIMATION_ON_LAYOUT,this.animationDuringLayout=K.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=K.DEFAULT_ANIMATION_PERIOD,this.uniformLeafNodeSizes=K.DEFAULT_UNIFORM_LEAF_NODE_SIZES,this.edgeToDummyNodes=new Map,this.graphManager=new X(this),this.isLayoutFinished=!1,this.isSubLayout=!1,this.isRemoteUse=!1,M!=null)this.isRemoteUse=M}F.RANDOM_SEED=1,F.prototype=Object.create(q.prototype),F.prototype.getGraphManager=function(){return this.graphManager},F.prototype.getAllNodes=function(){return this.graphManager.getAllNodes()},F.prototype.getAllEdges=function(){return this.graphManager.getAllEdges()},F.prototype.getAllNodesToApplyGravitation=function(){return this.graphManager.getAllNodesToApplyGravitation()},F.prototype.newGraphManager=function(){var M=new X(this);return this.graphManager=M,M},F.prototype.newGraph=function(M){return new G(null,this.graphManager,M)},F.prototype.newNode=function(M){return new Y(this.graphManager,M)},F.prototype.newEdge=function(M){return new z(null,null,M)},F.prototype.checkLayoutSuccess=function(){return this.graphManager.getRoot()==null||this.graphManager.getRoot().getNodes().length==0||this.graphManager.includesInvalidEdge()},F.prototype.runLayout=function(){if(this.isLayoutFinished=!1,this.tilingPreLayout)this.tilingPreLayout();this.initParameters();var M;if(this.checkLayoutSuccess())M=!1;else M=this.layout();if(K.ANIMATE==="during")return!1;if(M){if(!this.isSubLayout)this.doPostLayout()}if(this.tilingPostLayout)this.tilingPostLayout();return this.isLayoutFinished=!0,M},F.prototype.doPostLayout=function(){if(!this.incremental)this.transform();this.update()},F.prototype.update2=function(){if(this.createBendsAsNeeded)this.createBendpointsFromDummyNodes(),this.graphManager.resetAllEdges();if(!this.isRemoteUse){var M,L=this.graphManager.getAllEdges();for(var A=0;A<L.length;A++)M=L[A];var I,R=this.graphManager.getRoot().getNodes();for(var A=0;A<R.length;A++)I=R[A];this.update(this.graphManager.getRoot())}},F.prototype.update=function(M){if(M==null)this.update2();else if(M instanceof Y){var L=M;if(L.getChild()!=null){var A=L.getChild().getNodes();for(var I=0;I<A.length;I++)update(A[I])}if(L.vGraphObject!=null){var R=L.vGraphObject;R.update(L)}}else if(M instanceof z){var N=M;if(N.vGraphObject!=null){var E=N.vGraphObject;E.update(N)}}else if(M instanceof G){var V=M;if(V.vGraphObject!=null){var j=V.vGraphObject;j.update(V)}}},F.prototype.initParameters=function(){if(!this.isSubLayout)this.layoutQuality=K.QUALITY,this.animationDuringLayout=K.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=K.DEFAULT_ANIMATION_PERIOD,this.animationOnLayout=K.DEFAULT_ANIMATION_ON_LAYOUT,this.incremental=K.DEFAULT_INCREMENTAL,this.createBendsAsNeeded=K.DEFAULT_CREATE_BENDS_AS_NEEDED,this.uniformLeafNodeSizes=K.DEFAULT_UNIFORM_LEAF_NODE_SIZES;if(this.animationDuringLayout)this.animationOnLayout=!1},F.prototype.transform=function(M){if(M==null)this.transform(new W(0,0));else{var L=new H,A=this.graphManager.getRoot().updateLeftTop();if(A!=null){L.setWorldOrgX(M.x),L.setWorldOrgY(M.y),L.setDeviceOrgX(A.x),L.setDeviceOrgY(A.y);var I=this.getAllNodes(),R;for(var N=0;N<I.length;N++)R=I[N],R.transform(L)}}},F.prototype.positionNodesRandomly=function(M){if(M==null)this.positionNodesRandomly(this.getGraphManager().getRoot()),this.getGraphManager().getRoot().updateBounds(!0);else{var L,A,I=M.getNodes();for(var R=0;R<I.length;R++)if(L=I[R],A=L.getChild(),A==null)L.scatter();else if(A.getNodes().length==0)L.scatter();else this.positionNodesRandomly(A),L.updateBounds()}},F.prototype.getFlatForest=function(){var M=[],L=!0,A=this.graphManager.getRoot().getNodes(),I=!0;for(var R=0;R<A.length;R++)if(A[R].getChild()!=null)I=!1;if(!I)return M;var N=new Set,E=[],V=new Map,j=[];j=j.concat(A);while(j.length>0&&L){E.push(j[0]);while(E.length>0&&L){var T=E[0];E.splice(0,1),N.add(T);var C=T.getEdges();for(var R=0;R<C.length;R++){var $=C[R].getOtherEnd(T);if(V.get(T)!=$)if(!N.has($))E.push($),V.set($,T);else{L=!1;break}}}if(!L)M=[];else{var b=[].concat(U(N));M.push(b);for(var R=0;R<b.length;R++){var h=b[R],_=j.indexOf(h);if(_>-1)j.splice(_,1)}N=new Set,V=new Map}}return M},F.prototype.createDummyNodesForBendpoints=function(M){var L=[],A=M.source,I=this.graphManager.calcLowestCommonAncestor(M.source,M.target);for(var R=0;R<M.bendpoints.length;R++){var N=this.newNode(null);N.setRect(new Point(0,0),new Dimension(1,1)),I.add(N);var E=this.newEdge(null);this.graphManager.add(E,A,N),L.add(N),A=N}var E=this.newEdge(null);if(this.graphManager.add(E,A,M.target),this.edgeToDummyNodes.set(M,L),M.isInterGraph())this.graphManager.remove(M);else I.remove(M);return L},F.prototype.createBendpointsFromDummyNodes=function(){var M=[];M=M.concat(this.graphManager.getAllEdges()),M=[].concat(U(this.edgeToDummyNodes.keys())).concat(M);for(var L=0;L<M.length;L++){var A=M[L];if(A.bendpoints.length>0){var I=this.edgeToDummyNodes.get(A);for(var R=0;R<I.length;R++){var N=I[R],E=new W(N.getCenterX(),N.getCenterY()),V=A.bendpoints.get(R);V.x=E.x,V.y=E.y,N.getOwner().remove(N)}this.graphManager.add(A,A.source,A.target)}}},F.transform=function(M,L,A,I){if(A!=null&&I!=null){var R=L;if(M<=50){var N=L/A;R-=(L-N)/50*(50-M)}else{var E=L*I;R+=(E-L)/50*(M-50)}return R}else{var V,j;if(M<=50)V=9*L/500,j=L/10;else V=9*L/50,j=-8*L;return V*M+j}},F.findCenterOfTree=function(M){var L=[];L=L.concat(M);var A=[],I=new Map,R=!1,N=null;if(L.length==1||L.length==2)R=!0,N=L[0];for(var E=0;E<L.length;E++){var V=L[E],j=V.getNeighborsList().size;if(I.set(V,V.getNeighborsList().size),j==1)A.push(V)}var T=[];T=T.concat(A);while(!R){var C=[];C=C.concat(T),T=[];for(var E=0;E<L.length;E++){var V=L[E],$=L.indexOf(V);if($>=0)L.splice($,1);var b=V.getNeighborsList();b.forEach(function(S){if(A.indexOf(S)<0){var v=I.get(S),f=v-1;if(f==1)T.push(S);I.set(S,f)}})}if(A=A.concat(T),L.length==1||L.length==2)R=!0,N=L[0]}return N},F.prototype.setGraphManager=function(M){this.graphManager=M},J.exports=F},function(J,Q,Z){function U(){}U.seed=1,U.x=0,U.nextDouble=function(){return U.x=Math.sin(U.seed++)*1e4,U.x-Math.floor(U.x)},J.exports=U},function(J,Q,Z){var U=Z(5);function K(X,Y){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}K.prototype.getWorldOrgX=function(){return this.lworldOrgX},K.prototype.setWorldOrgX=function(X){this.lworldOrgX=X},K.prototype.getWorldOrgY=function(){return this.lworldOrgY},K.prototype.setWorldOrgY=function(X){this.lworldOrgY=X},K.prototype.getWorldExtX=function(){return this.lworldExtX},K.prototype.setWorldExtX=function(X){this.lworldExtX=X},K.prototype.getWorldExtY=function(){return this.lworldExtY},K.prototype.setWorldExtY=function(X){this.lworldExtY=X},K.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},K.prototype.setDeviceOrgX=function(X){this.ldeviceOrgX=X},K.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},K.prototype.setDeviceOrgY=function(X){this.ldeviceOrgY=X},K.prototype.getDeviceExtX=function(){return this.ldeviceExtX},K.prototype.setDeviceExtX=function(X){this.ldeviceExtX=X},K.prototype.getDeviceExtY=function(){return this.ldeviceExtY},K.prototype.setDeviceExtY=function(X){this.ldeviceExtY=X},K.prototype.transformX=function(X){var Y=0,z=this.lworldExtX;if(z!=0)Y=this.ldeviceOrgX+(X-this.lworldOrgX)*this.ldeviceExtX/z;return Y},K.prototype.transformY=function(X){var Y=0,z=this.lworldExtY;if(z!=0)Y=this.ldeviceOrgY+(X-this.lworldOrgY)*this.ldeviceExtY/z;return Y},K.prototype.inverseTransformX=function(X){var Y=0,z=this.ldeviceExtX;if(z!=0)Y=this.lworldOrgX+(X-this.ldeviceOrgX)*this.lworldExtX/z;return Y},K.prototype.inverseTransformY=function(X){var Y=0,z=this.ldeviceExtY;if(z!=0)Y=this.lworldOrgY+(X-this.ldeviceOrgY)*this.lworldExtY/z;return Y},K.prototype.inverseTransformPoint=function(X){var Y=new U(this.inverseTransformX(X.x),this.inverseTransformY(X.y));return Y},J.exports=K},function(J,Q,Z){function U(q){if(Array.isArray(q)){for(var F=0,M=Array(q.length);F<q.length;F++)M[F]=q[F];return M}else return Array.from(q)}var K=Z(15),X=Z(4),Y=Z(0),z=Z(8),G=Z(9);function W(){K.call(this),this.useSmartIdealEdgeLengthCalculation=X.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=X.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=X.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=X.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=X.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.displacementThresholdPerNode=3*X.DEFAULT_EDGE_LENGTH/100,this.coolingFactor=X.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.initialCoolingFactor=X.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.totalDisplacement=0,this.oldTotalDisplacement=0,this.maxIterations=X.MAX_ITERATIONS}W.prototype=Object.create(K.prototype);for(var H in K)W[H]=K[H];W.prototype.initParameters=function(){K.prototype.initParameters.call(this,arguments),this.totalIterations=0,this.notAnimatedIterations=0,this.useFRGridVariant=X.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION,this.grid=[]},W.prototype.calcIdealEdgeLengths=function(){var q,F,M,L,A,I,R,N=this.getGraphManager().getAllEdges();for(var E=0;E<N.length;E++)if(q=N[E],F=q.idealLength,q.isInterGraph){if(L=q.getSource(),A=q.getTarget(),I=q.getSourceInLca().getEstimatedSize(),R=q.getTargetInLca().getEstimatedSize(),this.useSmartIdealEdgeLengthCalculation)q.idealLength+=I+R-2*Y.SIMPLE_NODE_SIZE;M=q.getLca().getInclusionTreeDepth(),q.idealLength+=F*X.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR*(L.getInclusionTreeDepth()+A.getInclusionTreeDepth()-2*M)}},W.prototype.initSpringEmbedder=function(){var q=this.getAllNodes().length;if(this.incremental){if(q>X.ADAPTATION_LOWER_NODE_LIMIT)this.coolingFactor=Math.max(this.coolingFactor*X.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(q-X.ADAPTATION_LOWER_NODE_LIMIT)/(X.ADAPTATION_UPPER_NODE_LIMIT-X.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-X.COOLING_ADAPTATION_FACTOR));this.maxNodeDisplacement=X.MAX_NODE_DISPLACEMENT_INCREMENTAL}else{if(q>X.ADAPTATION_LOWER_NODE_LIMIT)this.coolingFactor=Math.max(X.COOLING_ADAPTATION_FACTOR,1-(q-X.ADAPTATION_LOWER_NODE_LIMIT)/(X.ADAPTATION_UPPER_NODE_LIMIT-X.ADAPTATION_LOWER_NODE_LIMIT)*(1-X.COOLING_ADAPTATION_FACTOR));else this.coolingFactor=1;this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=X.MAX_NODE_DISPLACEMENT}this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.displacementThresholdPerNode=3*X.DEFAULT_EDGE_LENGTH/100,this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},W.prototype.calcSpringForces=function(){var q=this.getAllEdges(),F;for(var M=0;M<q.length;M++)F=q[M],this.calcSpringForce(F,F.idealLength)},W.prototype.calcRepulsionForces=function(){var q=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,F=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,M,L,A,I,R=this.getAllNodes(),N;if(this.useFRGridVariant){if(this.totalIterations%X.GRID_CALCULATION_CHECK_PERIOD==1&&q)this.updateGrid();N=new Set;for(M=0;M<R.length;M++)A=R[M],this.calculateRepulsionForceOfANode(A,N,q,F),N.add(A)}else for(M=0;M<R.length;M++){A=R[M];for(L=M+1;L<R.length;L++){if(I=R[L],A.getOwner()!=I.getOwner())continue;this.calcRepulsionForce(A,I)}}},W.prototype.calcGravitationalForces=function(){var q,F=this.getAllNodesToApplyGravitation();for(var M=0;M<F.length;M++)q=F[M],this.calcGravitationalForce(q)},W.prototype.moveNodes=function(){var q=this.getAllNodes(),F;for(var M=0;M<q.length;M++)F=q[M],F.move()},W.prototype.calcSpringForce=function(q,F){var M=q.getSource(),L=q.getTarget(),A,I,R,N;if(this.uniformLeafNodeSizes&&M.getChild()==null&&L.getChild()==null)q.updateLengthSimple();else if(q.updateLength(),q.isOverlapingSourceAndTarget)return;if(A=q.getLength(),A==0)return;I=q.edgeElasticity*(A-F),R=I*(q.lengthX/A),N=I*(q.lengthY/A),M.springForceX+=R,M.springForceY+=N,L.springForceX-=R,L.springForceY-=N},W.prototype.calcRepulsionForce=function(q,F){var M=q.getRect(),L=F.getRect(),A=new Array(2),I=new Array(4),R,N,E,V,j,T,C;if(M.intersects(L)){z.calcSeparationAmount(M,L,A,X.DEFAULT_EDGE_LENGTH/2),T=2*A[0],C=2*A[1];var $=q.noOfChildren*F.noOfChildren/(q.noOfChildren+F.noOfChildren);q.repulsionForceX-=$*T,q.repulsionForceY-=$*C,F.repulsionForceX+=$*T,F.repulsionForceY+=$*C}else{if(this.uniformLeafNodeSizes&&q.getChild()==null&&F.getChild()==null)R=L.getCenterX()-M.getCenterX(),N=L.getCenterY()-M.getCenterY();else z.getIntersection(M,L,I),R=I[2]-I[0],N=I[3]-I[1];if(Math.abs(R)<X.MIN_REPULSION_DIST)R=G.sign(R)*X.MIN_REPULSION_DIST;if(Math.abs(N)<X.MIN_REPULSION_DIST)N=G.sign(N)*X.MIN_REPULSION_DIST;E=R*R+N*N,V=Math.sqrt(E),j=(q.nodeRepulsion/2+F.nodeRepulsion/2)*q.noOfChildren*F.noOfChildren/E,T=j*R/V,C=j*N/V,q.repulsionForceX-=T,q.repulsionForceY-=C,F.repulsionForceX+=T,F.repulsionForceY+=C}},W.prototype.calcGravitationalForce=function(q){var F,M,L,A,I,R,N,E;if(F=q.getOwner(),M=(F.getRight()+F.getLeft())/2,L=(F.getTop()+F.getBottom())/2,A=q.getCenterX()-M,I=q.getCenterY()-L,R=Math.abs(A)+q.getWidth()/2,N=Math.abs(I)+q.getHeight()/2,q.getOwner()==this.graphManager.getRoot()){if(E=F.getEstimatedSize()*this.gravityRangeFactor,R>E||N>E)q.gravitationForceX=-this.gravityConstant*A,q.gravitationForceY=-this.gravityConstant*I}else if(E=F.getEstimatedSize()*this.compoundGravityRangeFactor,R>E||N>E)q.gravitationForceX=-this.gravityConstant*A*this.compoundGravityConstant,q.gravitationForceY=-this.gravityConstant*I*this.compoundGravityConstant},W.prototype.isConverged=function(){var q,F=!1;if(this.totalIterations>this.maxIterations/3)F=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2;return q=this.totalDisplacement<this.totalDisplacementThreshold,this.oldTotalDisplacement=this.totalDisplacement,q||F},W.prototype.animate=function(){if(this.animationDuringLayout&&!this.isSubLayout)if(this.notAnimatedIterations==this.animationPeriod)this.update(),this.notAnimatedIterations=0;else this.notAnimatedIterations++},W.prototype.calcNoOfChildrenForAllNodes=function(){var q,F=this.graphManager.getAllNodes();for(var M=0;M<F.length;M++)q=F[M],q.noOfChildren=q.getNoOfChildren()},W.prototype.calcGrid=function(q){var F=0,M=0;F=parseInt(Math.ceil((q.getRight()-q.getLeft())/this.repulsionRange)),M=parseInt(Math.ceil((q.getBottom()-q.getTop())/this.repulsionRange));var L=new Array(F);for(var A=0;A<F;A++)L[A]=new Array(M);for(var A=0;A<F;A++)for(var I=0;I<M;I++)L[A][I]=new Array;return L},W.prototype.addNodeToGrid=function(q,F,M){var L=0,A=0,I=0,R=0;L=parseInt(Math.floor((q.getRect().x-F)/this.repulsionRange)),A=parseInt(Math.floor((q.getRect().width+q.getRect().x-F)/this.repulsionRange)),I=parseInt(Math.floor((q.getRect().y-M)/this.repulsionRange)),R=parseInt(Math.floor((q.getRect().height+q.getRect().y-M)/this.repulsionRange));for(var N=L;N<=A;N++)for(var E=I;E<=R;E++)this.grid[N][E].push(q),q.setGridCoordinates(L,A,I,R)},W.prototype.updateGrid=function(){var q,F,M=this.getAllNodes();this.grid=this.calcGrid(this.graphManager.getRoot());for(q=0;q<M.length;q++)F=M[q],this.addNodeToGrid(F,this.graphManager.getRoot().getLeft(),this.graphManager.getRoot().getTop())},W.prototype.calculateRepulsionForceOfANode=function(q,F,M,L){if(this.totalIterations%X.GRID_CALCULATION_CHECK_PERIOD==1&&M||L){var A=new Set;q.surrounding=new Array;var I,R=this.grid;for(var N=q.startX-1;N<q.finishX+2;N++)for(var E=q.startY-1;E<q.finishY+2;E++)if(!(N<0||E<0||N>=R.length||E>=R[0].length))for(var V=0;V<R[N][E].length;V++){if(I=R[N][E][V],q.getOwner()!=I.getOwner()||q==I)continue;if(!F.has(I)&&!A.has(I)){var j=Math.abs(q.getCenterX()-I.getCenterX())-(q.getWidth()/2+I.getWidth()/2),T=Math.abs(q.getCenterY()-I.getCenterY())-(q.getHeight()/2+I.getHeight()/2);if(j<=this.repulsionRange&&T<=this.repulsionRange)A.add(I)}}q.surrounding=[].concat(U(A))}for(N=0;N<q.surrounding.length;N++)this.calcRepulsionForce(q,q.surrounding[N])},W.prototype.calcRepulsionRange=function(){return 0},J.exports=W},function(J,Q,Z){var U=Z(1),K=Z(4);function X(z,G,W){U.call(this,z,G,W),this.idealLength=K.DEFAULT_EDGE_LENGTH,this.edgeElasticity=K.DEFAULT_SPRING_STRENGTH}X.prototype=Object.create(U.prototype);for(var Y in U)X[Y]=U[Y];J.exports=X},function(J,Q,Z){var U=Z(3),K=Z(4);function X(z,G,W,H){U.call(this,z,G,W,H),this.nodeRepulsion=K.DEFAULT_REPULSION_STRENGTH,this.springForceX=0,this.springForceY=0,this.repulsionForceX=0,this.repulsionForceY=0,this.gravitationForceX=0,this.gravitationForceY=0,this.displacementX=0,this.displacementY=0,this.startX=0,this.finishX=0,this.startY=0,this.finishY=0,this.surrounding=[]}X.prototype=Object.create(U.prototype);for(var Y in U)X[Y]=U[Y];X.prototype.setGridCoordinates=function(z,G,W,H){this.startX=z,this.finishX=G,this.startY=W,this.finishY=H},J.exports=X},function(J,Q,Z){function U(K,X){if(this.width=0,this.height=0,K!==null&&X!==null)this.height=X,this.width=K}U.prototype.getWidth=function(){return this.width},U.prototype.setWidth=function(K){this.width=K},U.prototype.getHeight=function(){return this.height},U.prototype.setHeight=function(K){this.height=K},J.exports=U},function(J,Q,Z){var U=Z(14);function K(){this.map={},this.keys=[]}K.prototype.put=function(X,Y){var z=U.createID(X);if(!this.contains(z))this.map[z]=Y,this.keys.push(X)},K.prototype.contains=function(X){var Y=U.createID(X);return this.map[X]!=null},K.prototype.get=function(X){var Y=U.createID(X);return this.map[Y]},K.prototype.keySet=function(){return this.keys},J.exports=K},function(J,Q,Z){var U=Z(14);function K(){this.set={}}K.prototype.add=function(X){var Y=U.createID(X);if(!this.contains(Y))this.set[Y]=X},K.prototype.remove=function(X){delete this.set[U.createID(X)]},K.prototype.clear=function(){this.set={}},K.prototype.contains=function(X){return this.set[U.createID(X)]==X},K.prototype.isEmpty=function(){return this.size()===0},K.prototype.size=function(){return Object.keys(this.set).length},K.prototype.addAllTo=function(X){var Y=Object.keys(this.set),z=Y.length;for(var G=0;G<z;G++)X.push(this.set[Y[G]])},K.prototype.size=function(){return Object.keys(this.set).length},K.prototype.addAll=function(X){var Y=X.length;for(var z=0;z<Y;z++){var G=X[z];this.add(G)}},J.exports=K},function(J,Q,Z){function U(){}U.multMat=function(K,X){var Y=[];for(var z=0;z<K.length;z++){Y[z]=[];for(var G=0;G<X[0].length;G++){Y[z][G]=0;for(var W=0;W<K[0].length;W++)Y[z][G]+=K[z][W]*X[W][G]}}return Y},U.transpose=function(K){var X=[];for(var Y=0;Y<K[0].length;Y++){X[Y]=[];for(var z=0;z<K.length;z++)X[Y][z]=K[z][Y]}return X},U.multCons=function(K,X){var Y=[];for(var z=0;z<K.length;z++)Y[z]=K[z]*X;return Y},U.minusOp=function(K,X){var Y=[];for(var z=0;z<K.length;z++)Y[z]=K[z]-X[z];return Y},U.dotProduct=function(K,X){var Y=0;for(var z=0;z<K.length;z++)Y+=K[z]*X[z];return Y},U.mag=function(K){return Math.sqrt(this.dotProduct(K,K))},U.normalize=function(K){var X=[],Y=this.mag(K);for(var z=0;z<K.length;z++)X[z]=K[z]/Y;return X},U.multGamma=function(K){var X=[],Y=0;for(var z=0;z<K.length;z++)Y+=K[z];Y*=-1/K.length;for(var G=0;G<K.length;G++)X[G]=Y+K[G];return X},U.multL=function(K,X,Y){var z=[],G=[],W=[];for(var H=0;H<X[0].length;H++){var q=0;for(var F=0;F<X.length;F++)q+=-0.5*X[F][H]*K[F];G[H]=q}for(var M=0;M<Y.length;M++){var L=0;for(var A=0;A<Y.length;A++)L+=Y[M][A]*G[A];W[M]=L}for(var I=0;I<X.length;I++){var R=0;for(var N=0;N<X[0].length;N++)R+=X[I][N]*W[N];z[I]=R}return z},J.exports=U},function(J,Q,Z){var U=function(){function z(G,W){for(var H=0;H<W.length;H++){var q=W[H];if(q.enumerable=q.enumerable||!1,q.configurable=!0,"value"in q)q.writable=!0;Object.defineProperty(G,q.key,q)}}return function(G,W,H){if(W)z(G.prototype,W);if(H)z(G,H);return G}}();function K(z,G){if(!(z instanceof G))throw new TypeError("Cannot call a class as a function")}var X=Z(11),Y=function(){function z(G,W){if(K(this,z),W!==null||W!==void 0)this.compareFunction=this._defaultCompareFunction;var H=void 0;if(G instanceof X)H=G.size();else H=G.length;this._quicksort(G,0,H-1)}return U(z,[{key:"_quicksort",value:function G(W,H,q){if(H<q){var F=this._partition(W,H,q);this._quicksort(W,H,F),this._quicksort(W,F+1,q)}}},{key:"_partition",value:function G(W,H,q){var F=this._get(W,H),M=H,L=q;while(!0){while(this.compareFunction(F,this._get(W,L)))L--;while(this.compareFunction(this._get(W,M),F))M++;if(M<L)this._swap(W,M,L),M++,L--;else return L}}},{key:"_get",value:function G(W,H){if(W instanceof X)return W.get_object_at(H);else return W[H]}},{key:"_set",value:function G(W,H,q){if(W instanceof X)W.set_object_at(H,q);else W[H]=q}},{key:"_swap",value:function G(W,H,q){var F=this._get(W,H);this._set(W,H,this._get(W,q)),this._set(W,q,F)}},{key:"_defaultCompareFunction",value:function G(W,H){return H>W}}]),z}();J.exports=Y},function(J,Q,Z){function U(){}U.svd=function(K){this.U=null,this.V=null,this.s=null,this.m=0,this.n=0,this.m=K.length,this.n=K[0].length;var X=Math.min(this.m,this.n);this.s=function(p6){var u6=[];while(p6-- >0)u6.push(0);return u6}(Math.min(this.m+1,this.n)),this.U=function(p6){var u6=function S0(Q6){if(Q6.length==0)return 0;else{var B6=[];for(var D0=0;D0<Q6[0];D0++)B6.push(S0(Q6.slice(1)));return B6}};return u6(p6)}([this.m,X]),this.V=function(p6){var u6=function S0(Q6){if(Q6.length==0)return 0;else{var B6=[];for(var D0=0;D0<Q6[0];D0++)B6.push(S0(Q6.slice(1)));return B6}};return u6(p6)}([this.n,this.n]);var Y=function(p6){var u6=[];while(p6-- >0)u6.push(0);return u6}(this.n),z=function(p6){var u6=[];while(p6-- >0)u6.push(0);return u6}(this.m),G=!0,W=!0,H=Math.min(this.m-1,this.n),q=Math.max(0,Math.min(this.n-2,this.m));for(var F=0;F<Math.max(H,q);F++){if(F<H){this.s[F]=0;for(var M=F;M<this.m;M++)this.s[F]=U.hypot(this.s[F],K[M][F]);if(this.s[F]!==0){if(K[F][F]<0)this.s[F]=-this.s[F];for(var L=F;L<this.m;L++)K[L][F]/=this.s[F];K[F][F]+=1}this.s[F]=-this.s[F]}for(var A=F+1;A<this.n;A++){if(function(p6,u6){return p6&&u6}(F<H,this.s[F]!==0)){var I=0;for(var R=F;R<this.m;R++)I+=K[R][F]*K[R][A];I=-I/K[F][F];for(var N=F;N<this.m;N++)K[N][A]+=I*K[N][F]}Y[A]=K[F][A]}if(function(p6,u6){return p6&&u6}(G,F<H))for(var E=F;E<this.m;E++)this.U[E][F]=K[E][F];if(F<q){Y[F]=0;for(var V=F+1;V<this.n;V++)Y[F]=U.hypot(Y[F],Y[V]);if(Y[F]!==0){if(Y[F+1]<0)Y[F]=-Y[F];for(var j=F+1;j<this.n;j++)Y[j]/=Y[F];Y[F+1]+=1}if(Y[F]=-Y[F],function(p6,u6){return p6&&u6}(F+1<this.m,Y[F]!==0)){for(var T=F+1;T<this.m;T++)z[T]=0;for(var C=F+1;C<this.n;C++)for(var $=F+1;$<this.m;$++)z[$]+=Y[C]*K[$][C];for(var b=F+1;b<this.n;b++){var h=-Y[b]/Y[F+1];for(var _=F+1;_<this.m;_++)K[_][b]+=h*z[_]}}if(W)for(var S=F+1;S<this.n;S++)this.V[S][F]=Y[S]}}var v=Math.min(this.n,this.m+1);if(H<this.n)this.s[H]=K[H][H];if(this.m<v)this.s[v-1]=0;if(q+1<v)Y[q]=K[q][v-1];if(Y[v-1]=0,G){for(var f=H;f<X;f++){for(var x=0;x<this.m;x++)this.U[x][f]=0;this.U[f][f]=1}for(var y=H-1;y>=0;y--)if(this.s[y]!==0){for(var m=y+1;m<X;m++){var g=0;for(var p=y;p<this.m;p++)g+=this.U[p][y]*this.U[p][m];g=-g/this.U[y][y];for(var i=y;i<this.m;i++)this.U[i][m]+=g*this.U[i][y]}for(var l=y;l<this.m;l++)this.U[l][y]=-this.U[l][y];this.U[y][y]=1+this.U[y][y];for(var a=0;a<y-1;a++)this.U[a][y]=0}else{for(var e=0;e<this.m;e++)this.U[e][y]=0;this.U[y][y]=1}}if(W)for(var G0=this.n-1;G0>=0;G0--){if(function(p6,u6){return p6&&u6}(G0<q,Y[G0]!==0))for(var U0=G0+1;U0<X;U0++){var O0=0;for(var X0=G0+1;X0<this.n;X0++)O0+=this.V[X0][G0]*this.V[X0][U0];O0=-O0/this.V[G0+1][G0];for(var E0=G0+1;E0<this.n;E0++)this.V[E0][U0]+=O0*this.V[E0][G0]}for(var W0=0;W0<this.n;W0++)this.V[W0][G0]=0;this.V[G0][G0]=1}var q0=v-1,z0=0,K0=Math.pow(2,-52),R0=Math.pow(2,-966);while(v>0){var Y0=void 0,P0=void 0;for(Y0=v-2;Y0>=-1;Y0--){if(Y0===-1)break;if(Math.abs(Y[Y0])<=R0+K0*(Math.abs(this.s[Y0])+Math.abs(this.s[Y0+1]))){Y[Y0]=0;break}}if(Y0===v-2)P0=4;else{var F0=void 0;for(F0=v-1;F0>=Y0;F0--){if(F0===Y0)break;var m0=(F0!==v?Math.abs(Y[F0]):0)+(F0!==Y0+1?Math.abs(Y[F0-1]):0);if(Math.abs(this.s[F0])<=R0+K0*m0){this.s[F0]=0;break}}if(F0===Y0)P0=3;else if(F0===v-1)P0=1;else P0=2,Y0=F0}switch(Y0++,P0){case 1:{var J0=Y[v-2];Y[v-2]=0;for(var z6=v-2;z6>=Y0;z6--){var t=U.hypot(this.s[z6],J0),N0=this.s[z6]/t,f0=J0/t;if(this.s[z6]=t,z6!==Y0)J0=-f0*Y[z6-1],Y[z6-1]=N0*Y[z6-1];if(W)for(var l0=0;l0<this.n;l0++)t=N0*this.V[l0][z6]+f0*this.V[l0][v-1],this.V[l0][v-1]=-f0*this.V[l0][z6]+N0*this.V[l0][v-1],this.V[l0][z6]=t}}break;case 2:{var k0=Y[Y0-1];Y[Y0-1]=0;for(var _0=Y0;_0<v;_0++){var g0=U.hypot(this.s[_0],k0),h0=this.s[_0]/g0,t0=k0/g0;if(this.s[_0]=g0,k0=-t0*Y[_0],Y[_0]=h0*Y[_0],G)for(var C0=0;C0<this.m;C0++)g0=h0*this.U[C0][_0]+t0*this.U[C0][Y0-1],this.U[C0][Y0-1]=-t0*this.U[C0][_0]+h0*this.U[C0][Y0-1],this.U[C0][_0]=g0}}break;case 3:{var y0=Math.max(Math.max(Math.max(Math.max(Math.abs(this.s[v-1]),Math.abs(this.s[v-2])),Math.abs(Y[v-2])),Math.abs(this.s[Y0])),Math.abs(Y[Y0])),o=this.s[v-1]/y0,w0=this.s[v-2]/y0,d=Y[v-2]/y0,L0=this.s[Y0]/y0,I0=Y[Y0]/y0,T0=((w0+o)*(w0-o)+d*d)/2,$0=o*d*(o*d),v0=0;if(function(p6,u6){return p6||u6}(T0!==0,$0!==0)){if(v0=Math.sqrt(T0*T0+$0),T0<0)v0=-v0;v0=$0/(T0+v0)}var r0=(L0+o)*(L0-o)+v0,u0=L0*I0;for(var G6=Y0;G6<v-1;G6++){var A6=U.hypot(r0,u0),r6=r0/A6,N6=u0/A6;if(G6!==Y0)Y[G6-1]=A6;if(r0=r6*this.s[G6]+N6*Y[G6],Y[G6]=r6*Y[G6]-N6*this.s[G6],u0=N6*this.s[G6+1],this.s[G6+1]=r6*this.s[G6+1],W)for(var F6=0;F6<this.n;F6++)A6=r6*this.V[F6][G6]+N6*this.V[F6][G6+1],this.V[F6][G6+1]=-N6*this.V[F6][G6]+r6*this.V[F6][G6+1],this.V[F6][G6]=A6;if(A6=U.hypot(r0,u0),r6=r0/A6,N6=u0/A6,this.s[G6]=A6,r0=r6*Y[G6]+N6*this.s[G6+1],this.s[G6+1]=-N6*Y[G6]+r6*this.s[G6+1],u0=N6*Y[G6+1],Y[G6+1]=r6*Y[G6+1],G&&G6<this.m-1)for(var P6=0;P6<this.m;P6++)A6=r6*this.U[P6][G6]+N6*this.U[P6][G6+1],this.U[P6][G6+1]=-N6*this.U[P6][G6]+r6*this.U[P6][G6+1],this.U[P6][G6]=A6}Y[v-2]=r0,z0=z0+1}break;case 4:{if(this.s[Y0]<=0){if(this.s[Y0]=this.s[Y0]<0?-this.s[Y0]:0,W)for(var M6=0;M6<=q0;M6++)this.V[M6][Y0]=-this.V[M6][Y0]}while(Y0<q0){if(this.s[Y0]>=this.s[Y0+1])break;var g6=this.s[Y0];if(this.s[Y0]=this.s[Y0+1],this.s[Y0+1]=g6,W&&Y0<this.n-1)for(var O8=0;O8<this.n;O8++)g6=this.V[O8][Y0+1],this.V[O8][Y0+1]=this.V[O8][Y0],this.V[O8][Y0]=g6;if(G&&Y0<this.m-1)for(var a6=0;a6<this.m;a6++)g6=this.U[a6][Y0+1],this.U[a6][Y0+1]=this.U[a6][Y0],this.U[a6][Y0]=g6;Y0++}z0=0,v--}break}}var U8={U:this.U,V:this.V,S:this.s};return U8},U.hypot=function(K,X){var Y=void 0;if(Math.abs(K)>Math.abs(X))Y=X/K,Y=Math.abs(K)*Math.sqrt(1+Y*Y);else if(X!=0)Y=K/X,Y=Math.abs(X)*Math.sqrt(1+Y*Y);else Y=0;return Y},J.exports=U},function(J,Q,Z){var U=function(){function Y(z,G){for(var W=0;W<G.length;W++){var H=G[W];if(H.enumerable=H.enumerable||!1,H.configurable=!0,"value"in H)H.writable=!0;Object.defineProperty(z,H.key,H)}}return function(z,G,W){if(G)Y(z.prototype,G);if(W)Y(z,W);return z}}();function K(Y,z){if(!(Y instanceof z))throw new TypeError("Cannot call a class as a function")}var X=function(){function Y(z,G){var W=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,H=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,q=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;K(this,Y),this.sequence1=z,this.sequence2=G,this.match_score=W,this.mismatch_penalty=H,this.gap_penalty=q,this.iMax=z.length+1,this.jMax=G.length+1,this.grid=new Array(this.iMax);for(var F=0;F<this.iMax;F++){this.grid[F]=new Array(this.jMax);for(var M=0;M<this.jMax;M++)this.grid[F][M]=0}this.tracebackGrid=new Array(this.iMax);for(var L=0;L<this.iMax;L++){this.tracebackGrid[L]=new Array(this.jMax);for(var A=0;A<this.jMax;A++)this.tracebackGrid[L][A]=[null,null,null]}this.alignments=[],this.score=-1,this.computeGrids()}return U(Y,[{key:"getScore",value:function z(){return this.score}},{key:"getAlignments",value:function z(){return this.alignments}},{key:"computeGrids",value:function z(){for(var G=1;G<this.jMax;G++)this.grid[0][G]=this.grid[0][G-1]+this.gap_penalty,this.tracebackGrid[0][G]=[!1,!1,!0];for(var W=1;W<this.iMax;W++)this.grid[W][0]=this.grid[W-1][0]+this.gap_penalty,this.tracebackGrid[W][0]=[!1,!0,!1];for(var H=1;H<this.iMax;H++)for(var q=1;q<this.jMax;q++){var F=void 0;if(this.sequence1[H-1]===this.sequence2[q-1])F=this.grid[H-1][q-1]+this.match_score;else F=this.grid[H-1][q-1]+this.mismatch_penalty;var M=this.grid[H-1][q]+this.gap_penalty,L=this.grid[H][q-1]+this.gap_penalty,A=[F,M,L],I=this.arrayAllMaxIndexes(A);this.grid[H][q]=A[I[0]],this.tracebackGrid[H][q]=[I.includes(0),I.includes(1),I.includes(2)]}this.score=this.grid[this.iMax-1][this.jMax-1]}},{key:"alignmentTraceback",value:function z(){var G=[];G.push({pos:[this.sequence1.length,this.sequence2.length],seq1:"",seq2:""});while(G[0]){var W=G[0],H=this.tracebackGrid[W.pos[0]][W.pos[1]];if(H[0])G.push({pos:[W.pos[0]-1,W.pos[1]-1],seq1:this.sequence1[W.pos[0]-1]+W.seq1,seq2:this.sequence2[W.pos[1]-1]+W.seq2});if(H[1])G.push({pos:[W.pos[0]-1,W.pos[1]],seq1:this.sequence1[W.pos[0]-1]+W.seq1,seq2:"-"+W.seq2});if(H[2])G.push({pos:[W.pos[0],W.pos[1]-1],seq1:"-"+W.seq1,seq2:this.sequence2[W.pos[1]-1]+W.seq2});if(W.pos[0]===0&&W.pos[1]===0)this.alignments.push({sequence1:W.seq1,sequence2:W.seq2});G.shift()}return this.alignments}},{key:"getAllIndexes",value:function z(G,W){var H=[],q=-1;while((q=G.indexOf(W,q+1))!==-1)H.push(q);return H}},{key:"arrayAllMaxIndexes",value:function z(G){return this.getAllIndexes(G,Math.max.apply(null,G))}}]),Y}();J.exports=X},function(J,Q,Z){var U=function K(){return};U.FDLayout=Z(18),U.FDLayoutConstants=Z(4),U.FDLayoutEdge=Z(19),U.FDLayoutNode=Z(20),U.DimensionD=Z(21),U.HashMap=Z(22),U.HashSet=Z(23),U.IGeometry=Z(8),U.IMath=Z(9),U.Integer=Z(10),U.Point=Z(12),U.PointD=Z(5),U.RandomSeed=Z(16),U.RectangleD=Z(13),U.Transform=Z(17),U.UniqueIDGeneretor=Z(14),U.Quicksort=Z(25),U.LinkedList=Z(11),U.LGraphObject=Z(2),U.LGraph=Z(6),U.LEdge=Z(1),U.LGraphManager=Z(7),U.LNode=Z(3),U.Layout=Z(15),U.LayoutConstants=Z(0),U.NeedlemanWunsch=Z(27),U.Matrix=Z(24),U.SVD=Z(26),J.exports=U},function(J,Q,Z){function U(){this.listeners=[]}var K=U.prototype;K.addListener=function(X,Y){this.listeners.push({event:X,callback:Y})},K.removeListener=function(X,Y){for(var z=this.listeners.length;z>=0;z--){var G=this.listeners[z];if(G.event===X&&G.callback===Y)this.listeners.splice(z,1)}},K.emit=function(X,Y){for(var z=0;z<this.listeners.length;z++){var G=this.listeners[z];if(X===G.event)G.callback(Y)}},J.exports=U}])})});var HU0=F4((OV,WU0)=>{(function J(Q,Z){if(typeof OV==="object"&&typeof WU0==="object")WU0.exports=Z(GU0());else if(typeof define==="function"&&define.amd)define(["layout-base"],Z);else if(typeof OV==="object")OV.coseBase=Z(GU0());else Q.coseBase=Z(Q.layoutBase)})(OV,function(J){return(()=>{var Q={45:(X,Y,z)=>{var G={};G.layoutBase=z(551),G.CoSEConstants=z(806),G.CoSEEdge=z(767),G.CoSEGraph=z(880),G.CoSEGraphManager=z(578),G.CoSELayout=z(765),G.CoSENode=z(991),G.ConstraintHandler=z(902),X.exports=G},806:(X,Y,z)=>{var G=z(551).FDLayoutConstants;function W(){}for(var H in G)W[H]=G[H];W.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,W.DEFAULT_RADIAL_SEPARATION=G.DEFAULT_EDGE_LENGTH,W.DEFAULT_COMPONENT_SEPERATION=60,W.TILE=!0,W.TILING_PADDING_VERTICAL=10,W.TILING_PADDING_HORIZONTAL=10,W.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,W.ENFORCE_CONSTRAINTS=!0,W.APPLY_LAYOUT=!0,W.RELAX_MOVEMENT_ON_CONSTRAINTS=!0,W.TREE_REDUCTION_ON_INCREMENTAL=!0,W.PURE_INCREMENTAL=W.DEFAULT_INCREMENTAL,X.exports=W},767:(X,Y,z)=>{var G=z(551).FDLayoutEdge;function W(q,F,M){G.call(this,q,F,M)}W.prototype=Object.create(G.prototype);for(var H in G)W[H]=G[H];X.exports=W},880:(X,Y,z)=>{var G=z(551).LGraph;function W(q,F,M){G.call(this,q,F,M)}W.prototype=Object.create(G.prototype);for(var H in G)W[H]=G[H];X.exports=W},578:(X,Y,z)=>{var G=z(551).LGraphManager;function W(q){G.call(this,q)}W.prototype=Object.create(G.prototype);for(var H in G)W[H]=G[H];X.exports=W},765:(X,Y,z)=>{var G=z(551).FDLayout,W=z(578),H=z(880),q=z(991),F=z(767),M=z(806),L=z(902),A=z(551).FDLayoutConstants,I=z(551).LayoutConstants,R=z(551).Point,N=z(551).PointD,E=z(551).DimensionD,V=z(551).Layout,j=z(551).Integer,T=z(551).IGeometry,C=z(551).LGraph,$=z(551).Transform,b=z(551).LinkedList;function h(){G.call(this),this.toBeTiled={},this.constraints={}}h.prototype=Object.create(G.prototype);for(var _ in G)h[_]=G[_];h.prototype.newGraphManager=function(){var S=new W(this);return this.graphManager=S,S},h.prototype.newGraph=function(S){return new H(null,this.graphManager,S)},h.prototype.newNode=function(S){return new q(this.graphManager,S)},h.prototype.newEdge=function(S){return new F(null,null,S)},h.prototype.initParameters=function(){if(G.prototype.initParameters.call(this,arguments),!this.isSubLayout){if(M.DEFAULT_EDGE_LENGTH<10)this.idealEdgeLength=10;else this.idealEdgeLength=M.DEFAULT_EDGE_LENGTH;this.useSmartIdealEdgeLengthCalculation=M.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=A.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=A.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=A.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=A.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.prunedNodesAll=[],this.growTreeIterations=0,this.afterGrowthIterations=0,this.isTreeGrowing=!1,this.isGrowthFinished=!1}},h.prototype.initSpringEmbedder=function(){G.prototype.initSpringEmbedder.call(this),this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/A.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=0.04,this.coolingAdjuster=1},h.prototype.layout=function(){var S=I.DEFAULT_CREATE_BENDS_AS_NEEDED;if(S)this.createBendpoints(),this.graphManager.resetAllEdges();return this.level=0,this.classicLayout()},h.prototype.classicLayout=function(){if(this.nodesWithGravity=this.calculateNodesToApplyGravitationTo(),this.graphManager.setAllNodesToApplyGravitation(this.nodesWithGravity),this.calcNoOfChildrenForAllNodes(),this.graphManager.calcLowestCommonAncestors(),this.graphManager.calcInclusionTreeDepths(),this.graphManager.getRoot().calcEstimatedSize(),this.calcIdealEdgeLengths(),!this.incremental){var S=this.getFlatForest();if(S.length>0)this.positionNodesRadially(S);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var v=new Set(this.getAllNodes()),f=this.nodesWithGravity.filter(function(x){return v.has(x)});this.graphManager.setAllNodesToApplyGravitation(f),this.positionNodesRandomly()}}else if(M.TREE_REDUCTION_ON_INCREMENTAL){this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var v=new Set(this.getAllNodes()),f=this.nodesWithGravity.filter(function(m){return v.has(m)});this.graphManager.setAllNodesToApplyGravitation(f)}if(Object.keys(this.constraints).length>0)L.handleConstraints(this),this.initConstraintVariables();if(this.initSpringEmbedder(),M.APPLY_LAYOUT)this.runSpringEmbedder();return!0},h.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished)if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;if(this.totalIterations%A.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged())if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;if(this.coolingCycle++,this.layoutQuality==0)this.coolingAdjuster=this.coolingCycle;else if(this.layoutQuality==1)this.coolingAdjuster=this.coolingCycle/3;this.coolingFactor=Math.max(this.initialCoolingFactor-Math.pow(this.coolingCycle,Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature),this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0)if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var S=new Set(this.getAllNodes()),v=this.nodesWithGravity.filter(function(y){return S.has(y)});if(this.graphManager.setAllNodesToApplyGravitation(v),this.graphManager.updateBounds(),this.updateGrid(),M.PURE_INCREMENTAL)this.coolingFactor=A.DEFAULT_COOLING_FACTOR_INCREMENTAL/2;else this.coolingFactor=A.DEFAULT_COOLING_FACTOR_INCREMENTAL}else this.isTreeGrowing=!1,this.isGrowthFinished=!0;this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged())return!0;if(this.afterGrowthIterations%10==0)this.graphManager.updateBounds(),this.updateGrid();if(M.PURE_INCREMENTAL)this.coolingFactor=A.DEFAULT_COOLING_FACTOR_INCREMENTAL/2*((100-this.afterGrowthIterations)/100);else this.coolingFactor=A.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100);this.afterGrowthIterations++}var f=!this.isTreeGrowing&&!this.isGrowthFinished,x=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(f,x),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},h.prototype.getPositionsData=function(){var S=this.graphManager.getAllNodes(),v={};for(var f=0;f<S.length;f++){var x=S[f].rect,y=S[f].id;v[y]={id:y,x:x.getCenterX(),y:x.getCenterY(),w:x.width,h:x.height}}return v},h.prototype.runSpringEmbedder=function(){this.initialAnimationPeriod=25,this.animationPeriod=this.initialAnimationPeriod;var S=!1;if(A.ANIMATE==="during")this.emit("layoutstarted");else{while(!S)S=this.tick();this.graphManager.updateBounds()}},h.prototype.moveNodes=function(){var S=this.getAllNodes(),v;for(var f=0;f<S.length;f++)v=S[f],v.calculateDisplacement();if(Object.keys(this.constraints).length>0)this.updateDisplacements();for(var f=0;f<S.length;f++)v=S[f],v.move()},h.prototype.initConstraintVariables=function(){var S=this;this.idToNodeMap=new Map,this.fixedNodeSet=new Set;var v=this.graphManager.getAllNodes();for(var f=0;f<v.length;f++){var x=v[f];this.idToNodeMap.set(x.id,x)}var y=function X0(E0){var W0=E0.getChild().getNodes(),q0,z0=0;for(var K0=0;K0<W0.length;K0++)if(q0=W0[K0],q0.getChild()==null){if(S.fixedNodeSet.has(q0.id))z0+=100}else z0+=X0(q0);return z0};if(this.constraints.fixedNodeConstraint){this.constraints.fixedNodeConstraint.forEach(function(W0){S.fixedNodeSet.add(W0.nodeId)});var v=this.graphManager.getAllNodes(),x;for(var f=0;f<v.length;f++)if(x=v[f],x.getChild()!=null){var m=y(x);if(m>0)x.fixedNodeWeight=m}}if(this.constraints.relativePlacementConstraint){var g=new Map,p=new Map;if(this.dummyToNodeForVerticalAlignment=new Map,this.dummyToNodeForHorizontalAlignment=new Map,this.fixedNodesOnHorizontal=new Set,this.fixedNodesOnVertical=new Set,this.fixedNodeSet.forEach(function(X0){S.fixedNodesOnHorizontal.add(X0),S.fixedNodesOnVertical.add(X0)}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical){var i=this.constraints.alignmentConstraint.vertical;for(var f=0;f<i.length;f++)this.dummyToNodeForVerticalAlignment.set("dummy"+f,[]),i[f].forEach(function(E0){if(g.set(E0,"dummy"+f),S.dummyToNodeForVerticalAlignment.get("dummy"+f).push(E0),S.fixedNodeSet.has(E0))S.fixedNodesOnHorizontal.add("dummy"+f)})}if(this.constraints.alignmentConstraint.horizontal){var l=this.constraints.alignmentConstraint.horizontal;for(var f=0;f<l.length;f++)this.dummyToNodeForHorizontalAlignment.set("dummy"+f,[]),l[f].forEach(function(E0){if(p.set(E0,"dummy"+f),S.dummyToNodeForHorizontalAlignment.get("dummy"+f).push(E0),S.fixedNodeSet.has(E0))S.fixedNodesOnVertical.add("dummy"+f)})}}if(M.RELAX_MOVEMENT_ON_CONSTRAINTS)this.shuffle=function(X0){var E0,W0,q0;for(q0=X0.length-1;q0>=2*X0.length/3;q0--)E0=Math.floor(Math.random()*(q0+1)),W0=X0[q0],X0[q0]=X0[E0],X0[E0]=W0;return X0},this.nodesInRelativeHorizontal=[],this.nodesInRelativeVertical=[],this.nodeToRelativeConstraintMapHorizontal=new Map,this.nodeToRelativeConstraintMapVertical=new Map,this.nodeToTempPositionMapHorizontal=new Map,this.nodeToTempPositionMapVertical=new Map,this.constraints.relativePlacementConstraint.forEach(function(X0){if(X0.left){var E0=g.has(X0.left)?g.get(X0.left):X0.left,W0=g.has(X0.right)?g.get(X0.right):X0.right;if(!S.nodesInRelativeHorizontal.includes(E0))if(S.nodesInRelativeHorizontal.push(E0),S.nodeToRelativeConstraintMapHorizontal.set(E0,[]),S.dummyToNodeForVerticalAlignment.has(E0))S.nodeToTempPositionMapHorizontal.set(E0,S.idToNodeMap.get(S.dummyToNodeForVerticalAlignment.get(E0)[0]).getCenterX());else S.nodeToTempPositionMapHorizontal.set(E0,S.idToNodeMap.get(E0).getCenterX());if(!S.nodesInRelativeHorizontal.includes(W0))if(S.nodesInRelativeHorizontal.push(W0),S.nodeToRelativeConstraintMapHorizontal.set(W0,[]),S.dummyToNodeForVerticalAlignment.has(W0))S.nodeToTempPositionMapHorizontal.set(W0,S.idToNodeMap.get(S.dummyToNodeForVerticalAlignment.get(W0)[0]).getCenterX());else S.nodeToTempPositionMapHorizontal.set(W0,S.idToNodeMap.get(W0).getCenterX());S.nodeToRelativeConstraintMapHorizontal.get(E0).push({right:W0,gap:X0.gap}),S.nodeToRelativeConstraintMapHorizontal.get(W0).push({left:E0,gap:X0.gap})}else{var q0=p.has(X0.top)?p.get(X0.top):X0.top,z0=p.has(X0.bottom)?p.get(X0.bottom):X0.bottom;if(!S.nodesInRelativeVertical.includes(q0))if(S.nodesInRelativeVertical.push(q0),S.nodeToRelativeConstraintMapVertical.set(q0,[]),S.dummyToNodeForHorizontalAlignment.has(q0))S.nodeToTempPositionMapVertical.set(q0,S.idToNodeMap.get(S.dummyToNodeForHorizontalAlignment.get(q0)[0]).getCenterY());else S.nodeToTempPositionMapVertical.set(q0,S.idToNodeMap.get(q0).getCenterY());if(!S.nodesInRelativeVertical.includes(z0))if(S.nodesInRelativeVertical.push(z0),S.nodeToRelativeConstraintMapVertical.set(z0,[]),S.dummyToNodeForHorizontalAlignment.has(z0))S.nodeToTempPositionMapVertical.set(z0,S.idToNodeMap.get(S.dummyToNodeForHorizontalAlignment.get(z0)[0]).getCenterY());else S.nodeToTempPositionMapVertical.set(z0,S.idToNodeMap.get(z0).getCenterY());S.nodeToRelativeConstraintMapVertical.get(q0).push({bottom:z0,gap:X0.gap}),S.nodeToRelativeConstraintMapVertical.get(z0).push({top:q0,gap:X0.gap})}});else{var a=new Map,e=new Map;this.constraints.relativePlacementConstraint.forEach(function(X0){if(X0.left){var E0=g.has(X0.left)?g.get(X0.left):X0.left,W0=g.has(X0.right)?g.get(X0.right):X0.right;if(a.has(E0))a.get(E0).push(W0);else a.set(E0,[W0]);if(a.has(W0))a.get(W0).push(E0);else a.set(W0,[E0])}else{var q0=p.has(X0.top)?p.get(X0.top):X0.top,z0=p.has(X0.bottom)?p.get(X0.bottom):X0.bottom;if(e.has(q0))e.get(q0).push(z0);else e.set(q0,[z0]);if(e.has(z0))e.get(z0).push(q0);else e.set(z0,[q0])}});var G0=function X0(E0,W0){var q0=[],z0=[],K0=new b,R0=new Set,Y0=0;return E0.forEach(function(P0,F0){if(!R0.has(F0)){q0[Y0]=[],z0[Y0]=!1;var m0=F0;K0.push(m0),R0.add(m0),q0[Y0].push(m0);while(K0.length!=0){if(m0=K0.shift(),W0.has(m0))z0[Y0]=!0;var J0=E0.get(m0);J0.forEach(function(z6){if(!R0.has(z6))K0.push(z6),R0.add(z6),q0[Y0].push(z6)})}Y0++}}),{components:q0,isFixed:z0}},U0=G0(a,S.fixedNodesOnHorizontal);this.componentsOnHorizontal=U0.components,this.fixedComponentsOnHorizontal=U0.isFixed;var O0=G0(e,S.fixedNodesOnVertical);this.componentsOnVertical=O0.components,this.fixedComponentsOnVertical=O0.isFixed}}},h.prototype.updateDisplacements=function(){var S=this;if(this.constraints.fixedNodeConstraint)this.constraints.fixedNodeConstraint.forEach(function(O0){var X0=S.idToNodeMap.get(O0.nodeId);X0.displacementX=0,X0.displacementY=0});if(this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical){var v=this.constraints.alignmentConstraint.vertical;for(var f=0;f<v.length;f++){var x=0;for(var y=0;y<v[f].length;y++){if(this.fixedNodeSet.has(v[f][y])){x=0;break}x+=this.idToNodeMap.get(v[f][y]).displacementX}var m=x/v[f].length;for(var y=0;y<v[f].length;y++)this.idToNodeMap.get(v[f][y]).displacementX=m}}if(this.constraints.alignmentConstraint.horizontal){var g=this.constraints.alignmentConstraint.horizontal;for(var f=0;f<g.length;f++){var p=0;for(var y=0;y<g[f].length;y++){if(this.fixedNodeSet.has(g[f][y])){p=0;break}p+=this.idToNodeMap.get(g[f][y]).displacementY}var i=p/g[f].length;for(var y=0;y<g[f].length;y++)this.idToNodeMap.get(g[f][y]).displacementY=i}}}if(this.constraints.relativePlacementConstraint)if(M.RELAX_MOVEMENT_ON_CONSTRAINTS){if(this.totalIterations%10==0)this.shuffle(this.nodesInRelativeHorizontal),this.shuffle(this.nodesInRelativeVertical);this.nodesInRelativeHorizontal.forEach(function(O0){if(!S.fixedNodesOnHorizontal.has(O0)){var X0=0;if(S.dummyToNodeForVerticalAlignment.has(O0))X0=S.idToNodeMap.get(S.dummyToNodeForVerticalAlignment.get(O0)[0]).displacementX;else X0=S.idToNodeMap.get(O0).displacementX;if(S.nodeToRelativeConstraintMapHorizontal.get(O0).forEach(function(E0){if(E0.right){var W0=S.nodeToTempPositionMapHorizontal.get(E0.right)-S.nodeToTempPositionMapHorizontal.get(O0)-X0;if(W0<E0.gap)X0-=E0.gap-W0}else{var W0=S.nodeToTempPositionMapHorizontal.get(O0)-S.nodeToTempPositionMapHorizontal.get(E0.left)+X0;if(W0<E0.gap)X0+=E0.gap-W0}}),S.nodeToTempPositionMapHorizontal.set(O0,S.nodeToTempPositionMapHorizontal.get(O0)+X0),S.dummyToNodeForVerticalAlignment.has(O0))S.dummyToNodeForVerticalAlignment.get(O0).forEach(function(E0){S.idToNodeMap.get(E0).displacementX=X0});else S.idToNodeMap.get(O0).displacementX=X0}}),this.nodesInRelativeVertical.forEach(function(O0){if(!S.fixedNodesOnHorizontal.has(O0)){var X0=0;if(S.dummyToNodeForHorizontalAlignment.has(O0))X0=S.idToNodeMap.get(S.dummyToNodeForHorizontalAlignment.get(O0)[0]).displacementY;else X0=S.idToNodeMap.get(O0).displacementY;if(S.nodeToRelativeConstraintMapVertical.get(O0).forEach(function(E0){if(E0.bottom){var W0=S.nodeToTempPositionMapVertical.get(E0.bottom)-S.nodeToTempPositionMapVertical.get(O0)-X0;if(W0<E0.gap)X0-=E0.gap-W0}else{var W0=S.nodeToTempPositionMapVertical.get(O0)-S.nodeToTempPositionMapVertical.get(E0.top)+X0;if(W0<E0.gap)X0+=E0.gap-W0}}),S.nodeToTempPositionMapVertical.set(O0,S.nodeToTempPositionMapVertical.get(O0)+X0),S.dummyToNodeForHorizontalAlignment.has(O0))S.dummyToNodeForHorizontalAlignment.get(O0).forEach(function(E0){S.idToNodeMap.get(E0).displacementY=X0});else S.idToNodeMap.get(O0).displacementY=X0}})}else{for(var f=0;f<this.componentsOnHorizontal.length;f++){var l=this.componentsOnHorizontal[f];if(this.fixedComponentsOnHorizontal[f])for(var y=0;y<l.length;y++)if(this.dummyToNodeForVerticalAlignment.has(l[y]))this.dummyToNodeForVerticalAlignment.get(l[y]).forEach(function(E0){S.idToNodeMap.get(E0).displacementX=0});else this.idToNodeMap.get(l[y]).displacementX=0;else{var a=0,e=0;for(var y=0;y<l.length;y++)if(this.dummyToNodeForVerticalAlignment.has(l[y])){var G0=this.dummyToNodeForVerticalAlignment.get(l[y]);a+=G0.length*this.idToNodeMap.get(G0[0]).displacementX,e+=G0.length}else a+=this.idToNodeMap.get(l[y]).displacementX,e++;var U0=a/e;for(var y=0;y<l.length;y++)if(this.dummyToNodeForVerticalAlignment.has(l[y]))this.dummyToNodeForVerticalAlignment.get(l[y]).forEach(function(E0){S.idToNodeMap.get(E0).displacementX=U0});else this.idToNodeMap.get(l[y]).displacementX=U0}}for(var f=0;f<this.componentsOnVertical.length;f++){var l=this.componentsOnVertical[f];if(this.fixedComponentsOnVertical[f])for(var y=0;y<l.length;y++)if(this.dummyToNodeForHorizontalAlignment.has(l[y]))this.dummyToNodeForHorizontalAlignment.get(l[y]).forEach(function(W0){S.idToNodeMap.get(W0).displacementY=0});else this.idToNodeMap.get(l[y]).displacementY=0;else{var a=0,e=0;for(var y=0;y<l.length;y++)if(this.dummyToNodeForHorizontalAlignment.has(l[y])){var G0=this.dummyToNodeForHorizontalAlignment.get(l[y]);a+=G0.length*this.idToNodeMap.get(G0[0]).displacementY,e+=G0.length}else a+=this.idToNodeMap.get(l[y]).displacementY,e++;var U0=a/e;for(var y=0;y<l.length;y++)if(this.dummyToNodeForHorizontalAlignment.has(l[y]))this.dummyToNodeForHorizontalAlignment.get(l[y]).forEach(function(K0){S.idToNodeMap.get(K0).displacementY=U0});else this.idToNodeMap.get(l[y]).displacementY=U0}}}},h.prototype.calculateNodesToApplyGravitationTo=function(){var S=[],v,f=this.graphManager.getGraphs(),x=f.length,y;for(y=0;y<x;y++)if(v=f[y],v.updateConnected(),!v.isConnected)S=S.concat(v.getNodes());return S},h.prototype.createBendpoints=function(){var S=[];S=S.concat(this.graphManager.getAllEdges());var v=new Set,f;for(f=0;f<S.length;f++){var x=S[f];if(!v.has(x)){var y=x.getSource(),m=x.getTarget();if(y==m)x.getBendpoints().push(new N),x.getBendpoints().push(new N),this.createDummyNodesForBendpoints(x),v.add(x);else{var g=[];if(g=g.concat(y.getEdgeListToNode(m)),g=g.concat(m.getEdgeListToNode(y)),!v.has(g[0])){if(g.length>1){var p;for(p=0;p<g.length;p++){var i=g[p];i.getBendpoints().push(new N),this.createDummyNodesForBendpoints(i)}}g.forEach(function(l){v.add(l)})}}}if(v.size==S.length)break}},h.prototype.positionNodesRadially=function(S){var v=new R(0,0),f=Math.ceil(Math.sqrt(S.length)),x=0,y=0,m=0,g=new N(0,0);for(var p=0;p<S.length;p++){if(p%f==0){if(m=0,y=x,p!=0)y+=M.DEFAULT_COMPONENT_SEPERATION;x=0}var i=S[p],l=V.findCenterOfTree(i);if(v.x=m,v.y=y,g=h.radialLayout(i,l,v),g.y>x)x=Math.floor(g.y);m=Math.floor(g.x+M.DEFAULT_COMPONENT_SEPERATION)}this.transform(new N(I.WORLD_CENTER_X-g.x/2,I.WORLD_CENTER_Y-g.y/2))},h.radialLayout=function(S,v,f){var x=Math.max(this.maxDiagonalInTree(S),M.DEFAULT_RADIAL_SEPARATION);h.branchRadialLayout(v,null,0,359,0,x);var y=C.calculateBounds(S),m=new $;m.setDeviceOrgX(y.getMinX()),m.setDeviceOrgY(y.getMinY()),m.setWorldOrgX(f.x),m.setWorldOrgY(f.y);for(var g=0;g<S.length;g++){var p=S[g];p.transform(m)}var i=new N(y.getMaxX(),y.getMaxY());return m.inverseTransformPoint(i)},h.branchRadialLayout=function(S,v,f,x,y,m){var g=(x-f+1)/2;if(g<0)g+=180;var p=(g+f)%360,i=p*T.TWO_PI/360,l=Math.cos(i),a=y*Math.cos(i),e=y*Math.sin(i);S.setCenter(a,e);var G0=[];G0=G0.concat(S.getEdges());var U0=G0.length;if(v!=null)U0--;var O0=0,X0=G0.length,E0,W0=S.getEdgesBetween(v);while(W0.length>1){var q0=W0[0];W0.splice(0,1);var z0=G0.indexOf(q0);if(z0>=0)G0.splice(z0,1);X0--,U0--}if(v!=null)E0=(G0.indexOf(W0[0])+1)%X0;else E0=0;var K0=Math.abs(x-f)/U0;for(var R0=E0;O0!=U0;R0=++R0%X0){var Y0=G0[R0].getOtherEnd(S);if(Y0==v)continue;var P0=(f+O0*K0)%360,F0=(P0+K0)%360;h.branchRadialLayout(Y0,S,P0,F0,y+m,m),O0++}},h.maxDiagonalInTree=function(S){var v=j.MIN_VALUE;for(var f=0;f<S.length;f++){var x=S[f],y=x.getDiagonal();if(y>v)v=y}return v},h.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},h.prototype.groupZeroDegreeMembers=function(){var S=this,v={};this.memberGroups={},this.idToDummyNode={};var f=[],x=this.graphManager.getAllNodes();for(var y=0;y<x.length;y++){var m=x[y],g=m.getParent();if(this.getNodeDegreeWithChildren(m)===0&&(g.id==null||!this.getToBeTiled(g)))f.push(m)}for(var y=0;y<f.length;y++){var m=f[y],p=m.getParent().id;if(typeof v[p]==="undefined")v[p]=[];v[p]=v[p].concat(m)}Object.keys(v).forEach(function(i){if(v[i].length>1){var l="DummyCompound_"+i;S.memberGroups[l]=v[i];var a=v[i][0].getParent(),e=new q(S.graphManager);e.id=l,e.paddingLeft=a.paddingLeft||0,e.paddingRight=a.paddingRight||0,e.paddingBottom=a.paddingBottom||0,e.paddingTop=a.paddingTop||0,S.idToDummyNode[l]=e;var G0=S.getGraphManager().add(S.newGraph(),e),U0=a.getChild();U0.add(e);for(var O0=0;O0<v[i].length;O0++){var X0=v[i][O0];U0.remove(X0),G0.add(X0)}}})},h.prototype.clearCompounds=function(){var S={},v={};this.performDFSOnCompounds();for(var f=0;f<this.compoundOrder.length;f++)v[this.compoundOrder[f].id]=this.compoundOrder[f],S[this.compoundOrder[f].id]=[].concat(this.compoundOrder[f].getChild().getNodes()),this.graphManager.remove(this.compoundOrder[f].getChild()),this.compoundOrder[f].child=null;this.graphManager.resetAllNodes(),this.tileCompoundMembers(S,v)},h.prototype.clearZeroDegreeMembers=function(){var S=this,v=this.tiledZeroDegreePack=[];Object.keys(this.memberGroups).forEach(function(f){var x=S.idToDummyNode[f];if(v[f]=S.tileNodes(S.memberGroups[f],x.paddingLeft+x.paddingRight),x.rect.width=v[f].width,x.rect.height=v[f].height,x.setCenter(v[f].centerX,v[f].centerY),x.labelMarginLeft=0,x.labelMarginTop=0,M.NODE_DIMENSIONS_INCLUDE_LABELS){var y=x.rect.width,m=x.rect.height;if(x.labelWidth){if(x.labelPosHorizontal=="left")x.rect.x-=x.labelWidth,x.setWidth(y+x.labelWidth),x.labelMarginLeft=x.labelWidth;else if(x.labelPosHorizontal=="center"&&x.labelWidth>y)x.rect.x-=(x.labelWidth-y)/2,x.setWidth(x.labelWidth),x.labelMarginLeft=(x.labelWidth-y)/2;else if(x.labelPosHorizontal=="right")x.setWidth(y+x.labelWidth)}if(x.labelHeight){if(x.labelPosVertical=="top")x.rect.y-=x.labelHeight,x.setHeight(m+x.labelHeight),x.labelMarginTop=x.labelHeight;else if(x.labelPosVertical=="center"&&x.labelHeight>m)x.rect.y-=(x.labelHeight-m)/2,x.setHeight(x.labelHeight),x.labelMarginTop=(x.labelHeight-m)/2;else if(x.labelPosVertical=="bottom")x.setHeight(m+x.labelHeight)}}})},h.prototype.repopulateCompounds=function(){for(var S=this.compoundOrder.length-1;S>=0;S--){var v=this.compoundOrder[S],f=v.id,x=v.paddingLeft,y=v.paddingTop,m=v.labelMarginLeft,g=v.labelMarginTop;this.adjustLocations(this.tiledMemberPack[f],v.rect.x,v.rect.y,x,y,m,g)}},h.prototype.repopulateZeroDegreeMembers=function(){var S=this,v=this.tiledZeroDegreePack;Object.keys(v).forEach(function(f){var x=S.idToDummyNode[f],y=x.paddingLeft,m=x.paddingTop,g=x.labelMarginLeft,p=x.labelMarginTop;S.adjustLocations(v[f],x.rect.x,x.rect.y,y,m,g,p)})},h.prototype.getToBeTiled=function(S){var v=S.id;if(this.toBeTiled[v]!=null)return this.toBeTiled[v];var f=S.getChild();if(f==null)return this.toBeTiled[v]=!1,!1;var x=f.getNodes();for(var y=0;y<x.length;y++){var m=x[y];if(this.getNodeDegree(m)>0)return this.toBeTiled[v]=!1,!1;if(m.getChild()==null){this.toBeTiled[m.id]=!1;continue}if(!this.getToBeTiled(m))return this.toBeTiled[v]=!1,!1}return this.toBeTiled[v]=!0,!0},h.prototype.getNodeDegree=function(S){var v=S.id,f=S.getEdges(),x=0;for(var y=0;y<f.length;y++){var m=f[y];if(m.getSource().id!==m.getTarget().id)x=x+1}return x},h.prototype.getNodeDegreeWithChildren=function(S){var v=this.getNodeDegree(S);if(S.getChild()==null)return v;var f=S.getChild().getNodes();for(var x=0;x<f.length;x++){var y=f[x];v+=this.getNodeDegreeWithChildren(y)}return v},h.prototype.performDFSOnCompounds=function(){this.compoundOrder=[],this.fillCompexOrderByDFS(this.graphManager.getRoot().getNodes())},h.prototype.fillCompexOrderByDFS=function(S){for(var v=0;v<S.length;v++){var f=S[v];if(f.getChild()!=null)this.fillCompexOrderByDFS(f.getChild().getNodes());if(this.getToBeTiled(f))this.compoundOrder.push(f)}},h.prototype.adjustLocations=function(S,v,f,x,y,m,g){v+=x+m,f+=y+g;var p=v;for(var i=0;i<S.rows.length;i++){var l=S.rows[i];v=p;var a=0;for(var e=0;e<l.length;e++){var G0=l[e];if(G0.rect.x=v,G0.rect.y=f,v+=G0.rect.width+S.horizontalPadding,G0.rect.height>a)a=G0.rect.height}f+=a+S.verticalPadding}},h.prototype.tileCompoundMembers=function(S,v){var f=this;this.tiledMemberPack=[],Object.keys(S).forEach(function(x){var y=v[x];if(f.tiledMemberPack[x]=f.tileNodes(S[x],y.paddingLeft+y.paddingRight),y.rect.width=f.tiledMemberPack[x].width,y.rect.height=f.tiledMemberPack[x].height,y.setCenter(f.tiledMemberPack[x].centerX,f.tiledMemberPack[x].centerY),y.labelMarginLeft=0,y.labelMarginTop=0,M.NODE_DIMENSIONS_INCLUDE_LABELS){var m=y.rect.width,g=y.rect.height;if(y.labelWidth){if(y.labelPosHorizontal=="left")y.rect.x-=y.labelWidth,y.setWidth(m+y.labelWidth),y.labelMarginLeft=y.labelWidth;else if(y.labelPosHorizontal=="center"&&y.labelWidth>m)y.rect.x-=(y.labelWidth-m)/2,y.setWidth(y.labelWidth),y.labelMarginLeft=(y.labelWidth-m)/2;else if(y.labelPosHorizontal=="right")y.setWidth(m+y.labelWidth)}if(y.labelHeight){if(y.labelPosVertical=="top")y.rect.y-=y.labelHeight,y.setHeight(g+y.labelHeight),y.labelMarginTop=y.labelHeight;else if(y.labelPosVertical=="center"&&y.labelHeight>g)y.rect.y-=(y.labelHeight-g)/2,y.setHeight(y.labelHeight),y.labelMarginTop=(y.labelHeight-g)/2;else if(y.labelPosVertical=="bottom")y.setHeight(g+y.labelHeight)}}})},h.prototype.tileNodes=function(S,v){var f=this.tileNodesByFavoringDim(S,v,!0),x=this.tileNodesByFavoringDim(S,v,!1),y=this.getOrgRatio(f),m=this.getOrgRatio(x),g;if(m<y)g=x;else g=f;return g},h.prototype.getOrgRatio=function(S){var{width:v,height:f}=S,x=v/f;if(x<1)x=1/x;return x},h.prototype.calcIdealRowWidth=function(S,v){var{TILING_PADDING_VERTICAL:f,TILING_PADDING_HORIZONTAL:x}=M,y=S.length,m=0,g=0,p=0;S.forEach(function(O0){if(m+=O0.getWidth(),g+=O0.getHeight(),O0.getWidth()>p)p=O0.getWidth()});var i=m/y,l=g/y,a=Math.pow(f-x,2)+4*(i+x)*(l+f)*y,e=(x-f+Math.sqrt(a))/(2*(i+x)),G0;if(v){if(G0=Math.ceil(e),G0==e)G0++}else G0=Math.floor(e);var U0=G0*(i+x)-x;if(p>U0)U0=p;return U0+=x*2,U0},h.prototype.tileNodesByFavoringDim=function(S,v,f){var{TILING_PADDING_VERTICAL:x,TILING_PADDING_HORIZONTAL:y,TILING_COMPARE_BY:m}=M,g={rows:[],rowWidth:[],rowHeight:[],width:0,height:v,verticalPadding:x,horizontalPadding:y,centerX:0,centerY:0};if(m)g.idealRowWidth=this.calcIdealRowWidth(S,f);var p=function O0(X0){return X0.rect.width*X0.rect.height},i=function O0(X0,E0){return p(E0)-p(X0)};S.sort(function(O0,X0){var E0=i;if(g.idealRowWidth)return E0=m,E0(O0.id,X0.id);return E0(O0,X0)});var l=0,a=0;for(var e=0;e<S.length;e++){var G0=S[e];l+=G0.getCenterX(),a+=G0.getCenterY()}g.centerX=l/S.length,g.centerY=a/S.length;for(var e=0;e<S.length;e++){var G0=S[e];if(g.rows.length==0)this.insertNodeToRow(g,G0,0,v);else if(this.canAddHorizontal(g,G0.rect.width,G0.rect.height)){var U0=g.rows.length-1;if(!g.idealRowWidth)U0=this.getShortestRowIndex(g);this.insertNodeToRow(g,G0,U0,v)}else this.insertNodeToRow(g,G0,g.rows.length,v);this.shiftToLastRow(g)}return g},h.prototype.insertNodeToRow=function(S,v,f,x){var y=x;if(f==S.rows.length){var m=[];S.rows.push(m),S.rowWidth.push(y),S.rowHeight.push(0)}var g=S.rowWidth[f]+v.rect.width;if(S.rows[f].length>0)g+=S.horizontalPadding;if(S.rowWidth[f]=g,S.width<g)S.width=g;var p=v.rect.height;if(f>0)p+=S.verticalPadding;var i=0;if(p>S.rowHeight[f])i=S.rowHeight[f],S.rowHeight[f]=p,i=S.rowHeight[f]-i;S.height+=i,S.rows[f].push(v)},h.prototype.getShortestRowIndex=function(S){var v=-1,f=Number.MAX_VALUE;for(var x=0;x<S.rows.length;x++)if(S.rowWidth[x]<f)v=x,f=S.rowWidth[x];return v},h.prototype.getLongestRowIndex=function(S){var v=-1,f=Number.MIN_VALUE;for(var x=0;x<S.rows.length;x++)if(S.rowWidth[x]>f)v=x,f=S.rowWidth[x];return v},h.prototype.canAddHorizontal=function(S,v,f){if(S.idealRowWidth){var x=S.rows.length-1,y=S.rowWidth[x];return y+v+S.horizontalPadding<=S.idealRowWidth}var m=this.getShortestRowIndex(S);if(m<0)return!0;var g=S.rowWidth[m];if(g+S.horizontalPadding+v<=S.width)return!0;var p=0;if(S.rowHeight[m]<f){if(m>0)p=f+S.verticalPadding-S.rowHeight[m]}var i;if(S.width-g>=v+S.horizontalPadding)i=(S.height+p)/(g+v+S.horizontalPadding);else i=(S.height+p)/S.width;p=f+S.verticalPadding;var l;if(S.width<v)l=(S.height+p)/v;else l=(S.height+p)/S.width;if(l<1)l=1/l;if(i<1)i=1/i;return i<l},h.prototype.shiftToLastRow=function(S){var v=this.getLongestRowIndex(S),f=S.rowWidth.length-1,x=S.rows[v],y=x[x.length-1],m=y.width+S.horizontalPadding;if(S.width-S.rowWidth[f]>m&&v!=f){x.splice(-1,1),S.rows[f].push(y),S.rowWidth[v]=S.rowWidth[v]-m,S.rowWidth[f]=S.rowWidth[f]+m,S.width=S.rowWidth[instance.getLongestRowIndex(S)];var g=Number.MIN_VALUE;for(var p=0;p<x.length;p++)if(x[p].height>g)g=x[p].height;if(v>0)g+=S.verticalPadding;var i=S.rowHeight[v]+S.rowHeight[f];if(S.rowHeight[v]=g,S.rowHeight[f]<y.height+S.verticalPadding)S.rowHeight[f]=y.height+S.verticalPadding;var l=S.rowHeight[v]+S.rowHeight[f];S.height+=l-i,this.shiftToLastRow(S)}},h.prototype.tilingPreLayout=function(){if(M.TILE)this.groupZeroDegreeMembers(),this.clearCompounds(),this.clearZeroDegreeMembers()},h.prototype.tilingPostLayout=function(){if(M.TILE)this.repopulateZeroDegreeMembers(),this.repopulateCompounds()},h.prototype.reduceTrees=function(){var S=[],v=!0,f;while(v){var x=this.graphManager.getAllNodes(),y=[];v=!1;for(var m=0;m<x.length;m++)if(f=x[m],f.getEdges().length==1&&!f.getEdges()[0].isInterGraph&&f.getChild()==null){if(M.PURE_INCREMENTAL){var g=f.getEdges()[0].getOtherEnd(f),p=new E(f.getCenterX()-g.getCenterX(),f.getCenterY()-g.getCenterY());y.push([f,f.getEdges()[0],f.getOwner(),p])}else y.push([f,f.getEdges()[0],f.getOwner()]);v=!0}if(v==!0){var i=[];for(var l=0;l<y.length;l++)if(y[l][0].getEdges().length==1)i.push(y[l]),y[l][0].getOwner().remove(y[l][0]);S.push(i),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()}}this.prunedNodesAll=S},h.prototype.growTree=function(S){var v=S.length,f=S[v-1],x;for(var y=0;y<f.length;y++)x=f[y],this.findPlaceforPrunedNode(x),x[2].add(x[0]),x[2].add(x[1],x[1].source,x[1].target);S.splice(S.length-1,1),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()},h.prototype.findPlaceforPrunedNode=function(S){var v,f,x=S[0];if(x==S[1].source)f=S[1].target;else f=S[1].source;if(M.PURE_INCREMENTAL)x.setCenter(f.getCenterX()+S[3].getWidth(),f.getCenterY()+S[3].getHeight());else{var{startX:y,finishX:m,startY:g,finishY:p}=f,i=0,l=0,a=0,e=0,G0=[i,a,l,e];if(g>0)for(var U0=y;U0<=m;U0++)G0[0]+=this.grid[U0][g-1].length+this.grid[U0][g].length-1;if(m<this.grid.length-1)for(var U0=g;U0<=p;U0++)G0[1]+=this.grid[m+1][U0].length+this.grid[m][U0].length-1;if(p<this.grid[0].length-1)for(var U0=y;U0<=m;U0++)G0[2]+=this.grid[U0][p+1].length+this.grid[U0][p].length-1;if(y>0)for(var U0=g;U0<=p;U0++)G0[3]+=this.grid[y-1][U0].length+this.grid[y][U0].length-1;var O0=j.MAX_VALUE,X0,E0;for(var W0=0;W0<G0.length;W0++)if(G0[W0]<O0)O0=G0[W0],X0=1,E0=W0;else if(G0[W0]==O0)X0++;if(X0==3&&O0==0){if(G0[0]==0&&G0[1]==0&&G0[2]==0)v=1;else if(G0[0]==0&&G0[1]==0&&G0[3]==0)v=0;else if(G0[0]==0&&G0[2]==0&&G0[3]==0)v=3;else if(G0[1]==0&&G0[2]==0&&G0[3]==0)v=2}else if(X0==2&&O0==0){var q0=Math.floor(Math.random()*2);if(G0[0]==0&&G0[1]==0)if(q0==0)v=0;else v=1;else if(G0[0]==0&&G0[2]==0)if(q0==0)v=0;else v=2;else if(G0[0]==0&&G0[3]==0)if(q0==0)v=0;else v=3;else if(G0[1]==0&&G0[2]==0)if(q0==0)v=1;else v=2;else if(G0[1]==0&&G0[3]==0)if(q0==0)v=1;else v=3;else if(q0==0)v=2;else v=3}else if(X0==4&&O0==0){var q0=Math.floor(Math.random()*4);v=q0}else v=E0;if(v==0)x.setCenter(f.getCenterX(),f.getCenterY()-f.getHeight()/2-A.DEFAULT_EDGE_LENGTH-x.getHeight()/2);else if(v==1)x.setCenter(f.getCenterX()+f.getWidth()/2+A.DEFAULT_EDGE_LENGTH+x.getWidth()/2,f.getCenterY());else if(v==2)x.setCenter(f.getCenterX(),f.getCenterY()+f.getHeight()/2+A.DEFAULT_EDGE_LENGTH+x.getHeight()/2);else x.setCenter(f.getCenterX()-f.getWidth()/2-A.DEFAULT_EDGE_LENGTH-x.getWidth()/2,f.getCenterY())}},X.exports=h},991:(X,Y,z)=>{var G=z(551).FDLayoutNode,W=z(551).IMath;function H(F,M,L,A){G.call(this,F,M,L,A)}H.prototype=Object.create(G.prototype);for(var q in G)H[q]=G[q];H.prototype.calculateDisplacement=function(){var F=this.graphManager.getLayout();if(this.getChild()!=null&&this.fixedNodeWeight)this.displacementX+=F.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.fixedNodeWeight,this.displacementY+=F.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.fixedNodeWeight;else this.displacementX+=F.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY+=F.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren;if(Math.abs(this.displacementX)>F.coolingFactor*F.maxNodeDisplacement)this.displacementX=F.coolingFactor*F.maxNodeDisplacement*W.sign(this.displacementX);if(Math.abs(this.displacementY)>F.coolingFactor*F.maxNodeDisplacement)this.displacementY=F.coolingFactor*F.maxNodeDisplacement*W.sign(this.displacementY);if(this.child&&this.child.getNodes().length>0)this.propogateDisplacementToChildren(this.displacementX,this.displacementY)},H.prototype.propogateDisplacementToChildren=function(F,M){var L=this.getChild().getNodes(),A;for(var I=0;I<L.length;I++)if(A=L[I],A.getChild()==null)A.displacementX+=F,A.displacementY+=M;else A.propogateDisplacementToChildren(F,M)},H.prototype.move=function(){var F=this.graphManager.getLayout();if(this.child==null||this.child.getNodes().length==0)this.moveBy(this.displacementX,this.displacementY),F.totalDisplacement+=Math.abs(this.displacementX)+Math.abs(this.displacementY);this.springForceX=0,this.springForceY=0,this.repulsionForceX=0,this.repulsionForceY=0,this.gravitationForceX=0,this.gravitationForceY=0,this.displacementX=0,this.displacementY=0},H.prototype.setPred1=function(F){this.pred1=F},H.prototype.getPred1=function(){return pred1},H.prototype.getPred2=function(){return pred2},H.prototype.setNext=function(F){this.next=F},H.prototype.getNext=function(){return next},H.prototype.setProcessed=function(F){this.processed=F},H.prototype.isProcessed=function(){return processed},X.exports=H},902:(X,Y,z)=>{function G(L){if(Array.isArray(L)){for(var A=0,I=Array(L.length);A<L.length;A++)I[A]=L[A];return I}else return Array.from(L)}var W=z(806),H=z(551).LinkedList,q=z(551).Matrix,F=z(551).SVD;function M(){}M.handleConstraints=function(L){var A={};A.fixedNodeConstraint=L.constraints.fixedNodeConstraint,A.alignmentConstraint=L.constraints.alignmentConstraint,A.relativePlacementConstraint=L.constraints.relativePlacementConstraint;var I=new Map,R=new Map,N=[],E=[],V=L.getAllNodes(),j=0;for(var T=0;T<V.length;T++){var C=V[T];if(C.getChild()==null)R.set(C.id,j++),N.push(C.getCenterX()),E.push(C.getCenterY()),I.set(C.id,C)}if(A.relativePlacementConstraint)A.relativePlacementConstraint.forEach(function(y0){if(!y0.gap&&y0.gap!=0)if(y0.left)y0.gap=W.DEFAULT_EDGE_LENGTH+I.get(y0.left).getWidth()/2+I.get(y0.right).getWidth()/2;else y0.gap=W.DEFAULT_EDGE_LENGTH+I.get(y0.top).getHeight()/2+I.get(y0.bottom).getHeight()/2});var $=function y0(o,w0){return{x:o.x-w0.x,y:o.y-w0.y}},b=function y0(o){var w0=0,d=0;return o.forEach(function(L0){w0+=N[R.get(L0)],d+=E[R.get(L0)]}),{x:w0/o.size,y:d/o.size}},h=function y0(o,w0,d,L0,I0){function T0(N6,F6){var P6=new Set(N6),M6=!0,g6=!1,O8=void 0;try{for(var a6=F6[Symbol.iterator](),U8;!(M6=(U8=a6.next()).done);M6=!0){var p6=U8.value;P6.add(p6)}}catch(u6){g6=!0,O8=u6}finally{try{if(!M6&&a6.return)a6.return()}finally{if(g6)throw O8}}return P6}var $0=new Map;o.forEach(function(N6,F6){$0.set(F6,0)}),o.forEach(function(N6,F6){N6.forEach(function(P6){$0.set(P6.id,$0.get(P6.id)+1)})});var v0=new Map,r0=new Map,u0=new H;if($0.forEach(function(N6,F6){if(N6==0){if(u0.push(F6),!d)if(w0=="horizontal")v0.set(F6,R.has(F6)?N[R.get(F6)]:L0.get(F6));else v0.set(F6,R.has(F6)?E[R.get(F6)]:L0.get(F6))}else v0.set(F6,Number.NEGATIVE_INFINITY);if(d)r0.set(F6,new Set([F6]))}),d)I0.forEach(function(N6){var F6=[];if(N6.forEach(function(g6){if(d.has(g6))F6.push(g6)}),F6.length>0){var P6=0;F6.forEach(function(g6){if(w0=="horizontal")v0.set(g6,R.has(g6)?N[R.get(g6)]:L0.get(g6)),P6+=v0.get(g6);else v0.set(g6,R.has(g6)?E[R.get(g6)]:L0.get(g6)),P6+=v0.get(g6)}),P6=P6/F6.length,N6.forEach(function(g6){if(!d.has(g6))v0.set(g6,P6)})}else{var M6=0;N6.forEach(function(g6){if(w0=="horizontal")M6+=R.has(g6)?N[R.get(g6)]:L0.get(g6);else M6+=R.has(g6)?E[R.get(g6)]:L0.get(g6)}),M6=M6/N6.length,N6.forEach(function(g6){v0.set(g6,M6)})}});var G6=function N6(){var F6=u0.shift(),P6=o.get(F6);P6.forEach(function(M6){if(v0.get(M6.id)<v0.get(F6)+M6.gap)if(d&&d.has(M6.id)){var g6=void 0;if(w0=="horizontal")g6=R.has(M6.id)?N[R.get(M6.id)]:L0.get(M6.id);else g6=R.has(M6.id)?E[R.get(M6.id)]:L0.get(M6.id);if(v0.set(M6.id,g6),g6<v0.get(F6)+M6.gap){var O8=v0.get(F6)+M6.gap-g6;r0.get(F6).forEach(function(a6){v0.set(a6,v0.get(a6)-O8)})}}else v0.set(M6.id,v0.get(F6)+M6.gap);if($0.set(M6.id,$0.get(M6.id)-1),$0.get(M6.id)==0)u0.push(M6.id);if(d)r0.set(M6.id,T0(r0.get(F6),r0.get(M6.id)))})};while(u0.length!=0)G6();if(d){var A6=new Set;o.forEach(function(N6,F6){if(N6.length==0)A6.add(F6)});var r6=[];r0.forEach(function(N6,F6){if(A6.has(F6)){var P6=!1,M6=!0,g6=!1,O8=void 0;try{for(var a6=N6[Symbol.iterator](),U8;!(M6=(U8=a6.next()).done);M6=!0){var p6=U8.value;if(d.has(p6))P6=!0}}catch(Q6){g6=!0,O8=Q6}finally{try{if(!M6&&a6.return)a6.return()}finally{if(g6)throw O8}}if(!P6){var u6=!1,S0=void 0;if(r6.forEach(function(Q6,B6){if(Q6.has([].concat(G(N6))[0]))u6=!0,S0=B6}),!u6)r6.push(new Set(N6));else N6.forEach(function(Q6){r6[S0].add(Q6)})}}}),r6.forEach(function(N6,F6){var{POSITIVE_INFINITY:P6,POSITIVE_INFINITY:M6,NEGATIVE_INFINITY:g6,NEGATIVE_INFINITY:O8}=Number,a6=!0,U8=!1,p6=void 0;try{for(var u6=N6[Symbol.iterator](),S0;!(a6=(S0=u6.next()).done);a6=!0){var Q6=S0.value,B6=void 0;if(w0=="horizontal")B6=R.has(Q6)?N[R.get(Q6)]:L0.get(Q6);else B6=R.has(Q6)?E[R.get(Q6)]:L0.get(Q6);var D0=v0.get(Q6);if(B6<P6)P6=B6;if(B6>g6)g6=B6;if(D0<M6)M6=D0;if(D0>O8)O8=D0}}catch(g8){U8=!0,p6=g8}finally{try{if(!a6&&u6.return)u6.return()}finally{if(U8)throw p6}}var X6=(P6+g6)/2-(M6+O8)/2,W6=!0,_6=!1,c6=void 0;try{for(var d6=N6[Symbol.iterator](),l6;!(W6=(l6=d6.next()).done);W6=!0){var t6=l6.value;v0.set(t6,v0.get(t6)+X6)}}catch(g8){_6=!0,c6=g8}finally{try{if(!W6&&d6.return)d6.return()}finally{if(_6)throw c6}}})}return v0},_=function y0(o){var w0=0,d=0,L0=0,I0=0;if(o.forEach(function(r0){if(r0.left)N[R.get(r0.left)]-N[R.get(r0.right)]>=0?w0++:d++;else E[R.get(r0.top)]-E[R.get(r0.bottom)]>=0?L0++:I0++}),w0>d&&L0>I0)for(var T0=0;T0<R.size;T0++)N[T0]=-1*N[T0],E[T0]=-1*E[T0];else if(w0>d)for(var $0=0;$0<R.size;$0++)N[$0]=-1*N[$0];else if(L0>I0)for(var v0=0;v0<R.size;v0++)E[v0]=-1*E[v0]},S=function y0(o){var w0=[],d=new H,L0=new Set,I0=0;return o.forEach(function(T0,$0){if(!L0.has($0)){w0[I0]=[];var v0=$0;d.push(v0),L0.add(v0),w0[I0].push(v0);while(d.length!=0){v0=d.shift();var r0=o.get(v0);r0.forEach(function(u0){if(!L0.has(u0.id))d.push(u0.id),L0.add(u0.id),w0[I0].push(u0.id)})}I0++}}),w0},v=function y0(o){var w0=new Map;return o.forEach(function(d,L0){w0.set(L0,[])}),o.forEach(function(d,L0){d.forEach(function(I0){w0.get(L0).push(I0),w0.get(I0.id).push({id:L0,gap:I0.gap,direction:I0.direction})})}),w0},f=function y0(o){var w0=new Map;return o.forEach(function(d,L0){w0.set(L0,[])}),o.forEach(function(d,L0){d.forEach(function(I0){w0.get(I0.id).push({id:L0,gap:I0.gap,direction:I0.direction})})}),w0},x=[],y=[],m=!1,g=!1,p=new Set,i=new Map,l=new Map,a=[];if(A.fixedNodeConstraint)A.fixedNodeConstraint.forEach(function(y0){p.add(y0.nodeId)});if(A.relativePlacementConstraint)A.relativePlacementConstraint.forEach(function(y0){if(y0.left){if(i.has(y0.left))i.get(y0.left).push({id:y0.right,gap:y0.gap,direction:"horizontal"});else i.set(y0.left,[{id:y0.right,gap:y0.gap,direction:"horizontal"}]);if(!i.has(y0.right))i.set(y0.right,[])}else{if(i.has(y0.top))i.get(y0.top).push({id:y0.bottom,gap:y0.gap,direction:"vertical"});else i.set(y0.top,[{id:y0.bottom,gap:y0.gap,direction:"vertical"}]);if(!i.has(y0.bottom))i.set(y0.bottom,[])}}),l=v(i),a=S(l);if(W.TRANSFORM_ON_CONSTRAINT_HANDLING){if(A.fixedNodeConstraint&&A.fixedNodeConstraint.length>1)A.fixedNodeConstraint.forEach(function(y0,o){x[o]=[y0.position.x,y0.position.y],y[o]=[N[R.get(y0.nodeId)],E[R.get(y0.nodeId)]]}),m=!0;else if(A.alignmentConstraint)(function(){var y0=0;if(A.alignmentConstraint.vertical){var o=A.alignmentConstraint.vertical,w0=function $0(v0){var r0=new Set;o[v0].forEach(function(A6){r0.add(A6)});var u0=new Set([].concat(G(r0)).filter(function(A6){return p.has(A6)})),G6=void 0;if(u0.size>0)G6=N[R.get(u0.values().next().value)];else G6=b(r0).x;o[v0].forEach(function(A6){x[y0]=[G6,E[R.get(A6)]],y[y0]=[N[R.get(A6)],E[R.get(A6)]],y0++})};for(var d=0;d<o.length;d++)w0(d);m=!0}if(A.alignmentConstraint.horizontal){var L0=A.alignmentConstraint.horizontal,I0=function $0(v0){var r0=new Set;L0[v0].forEach(function(A6){r0.add(A6)});var u0=new Set([].concat(G(r0)).filter(function(A6){return p.has(A6)})),G6=void 0;if(u0.size>0)G6=N[R.get(u0.values().next().value)];else G6=b(r0).y;L0[v0].forEach(function(A6){x[y0]=[N[R.get(A6)],G6],y[y0]=[N[R.get(A6)],E[R.get(A6)]],y0++})};for(var T0=0;T0<L0.length;T0++)I0(T0);m=!0}if(A.relativePlacementConstraint)g=!0})();else if(A.relativePlacementConstraint){var e=0,G0=0;for(var U0=0;U0<a.length;U0++)if(a[U0].length>e)e=a[U0].length,G0=U0;if(e<l.size/2)_(A.relativePlacementConstraint),m=!1,g=!1;else{var O0=new Map,X0=new Map,E0=[];a[G0].forEach(function(y0){i.get(y0).forEach(function(o){if(o.direction=="horizontal"){if(O0.has(y0))O0.get(y0).push(o);else O0.set(y0,[o]);if(!O0.has(o.id))O0.set(o.id,[]);E0.push({left:y0,right:o.id})}else{if(X0.has(y0))X0.get(y0).push(o);else X0.set(y0,[o]);if(!X0.has(o.id))X0.set(o.id,[]);E0.push({top:y0,bottom:o.id})}})}),_(E0),g=!1;var W0=h(O0,"horizontal"),q0=h(X0,"vertical");a[G0].forEach(function(y0,o){if(y[o]=[N[R.get(y0)],E[R.get(y0)]],x[o]=[],W0.has(y0))x[o][0]=W0.get(y0);else x[o][0]=N[R.get(y0)];if(q0.has(y0))x[o][1]=q0.get(y0);else x[o][1]=E[R.get(y0)]}),m=!0}}if(m){var z0=void 0,K0=q.transpose(x),R0=q.transpose(y);for(var Y0=0;Y0<K0.length;Y0++)K0[Y0]=q.multGamma(K0[Y0]),R0[Y0]=q.multGamma(R0[Y0]);var P0=q.multMat(K0,q.transpose(R0)),F0=F.svd(P0);z0=q.multMat(F0.V,q.transpose(F0.U));for(var m0=0;m0<R.size;m0++){var J0=[N[m0],E[m0]],z6=[z0[0][0],z0[1][0]],t=[z0[0][1],z0[1][1]];N[m0]=q.dotProduct(J0,z6),E[m0]=q.dotProduct(J0,t)}if(g)_(A.relativePlacementConstraint)}}if(W.ENFORCE_CONSTRAINTS){if(A.fixedNodeConstraint&&A.fixedNodeConstraint.length>0){var N0={x:0,y:0};A.fixedNodeConstraint.forEach(function(y0,o){var w0={x:N[R.get(y0.nodeId)],y:E[R.get(y0.nodeId)]},d=y0.position,L0=$(d,w0);N0.x+=L0.x,N0.y+=L0.y}),N0.x/=A.fixedNodeConstraint.length,N0.y/=A.fixedNodeConstraint.length,N.forEach(function(y0,o){N[o]+=N0.x}),E.forEach(function(y0,o){E[o]+=N0.y}),A.fixedNodeConstraint.forEach(function(y0){N[R.get(y0.nodeId)]=y0.position.x,E[R.get(y0.nodeId)]=y0.position.y})}if(A.alignmentConstraint){if(A.alignmentConstraint.vertical){var f0=A.alignmentConstraint.vertical,l0=function y0(o){var w0=new Set;f0[o].forEach(function(I0){w0.add(I0)});var d=new Set([].concat(G(w0)).filter(function(I0){return p.has(I0)})),L0=void 0;if(d.size>0)L0=N[R.get(d.values().next().value)];else L0=b(w0).x;w0.forEach(function(I0){if(!p.has(I0))N[R.get(I0)]=L0})};for(var k0=0;k0<f0.length;k0++)l0(k0)}if(A.alignmentConstraint.horizontal){var _0=A.alignmentConstraint.horizontal,g0=function y0(o){var w0=new Set;_0[o].forEach(function(I0){w0.add(I0)});var d=new Set([].concat(G(w0)).filter(function(I0){return p.has(I0)})),L0=void 0;if(d.size>0)L0=E[R.get(d.values().next().value)];else L0=b(w0).y;w0.forEach(function(I0){if(!p.has(I0))E[R.get(I0)]=L0})};for(var h0=0;h0<_0.length;h0++)g0(h0)}}if(A.relativePlacementConstraint)(function(){var y0=new Map,o=new Map,w0=new Map,d=new Map,L0=new Map,I0=new Map,T0=new Set,$0=new Set;if(p.forEach(function(kJ){T0.add(kJ),$0.add(kJ)}),A.alignmentConstraint){if(A.alignmentConstraint.vertical){var v0=A.alignmentConstraint.vertical,r0=function kJ(c0){w0.set("dummy"+c0,[]),v0[c0].forEach(function(T6){if(y0.set(T6,"dummy"+c0),w0.get("dummy"+c0).push(T6),p.has(T6))T0.add("dummy"+c0)}),L0.set("dummy"+c0,N[R.get(v0[c0][0])])};for(var u0=0;u0<v0.length;u0++)r0(u0)}if(A.alignmentConstraint.horizontal){var G6=A.alignmentConstraint.horizontal,A6=function kJ(c0){d.set("dummy"+c0,[]),G6[c0].forEach(function(T6){if(o.set(T6,"dummy"+c0),d.get("dummy"+c0).push(T6),p.has(T6))$0.add("dummy"+c0)}),I0.set("dummy"+c0,E[R.get(G6[c0][0])])};for(var r6=0;r6<G6.length;r6++)A6(r6)}}var N6=new Map,F6=new Map,P6=function kJ(c0){i.get(c0).forEach(function(T6){var z8=void 0,C6=void 0;if(T6.direction=="horizontal"){if(z8=y0.get(c0)?y0.get(c0):c0,y0.get(T6.id))C6={id:y0.get(T6.id),gap:T6.gap,direction:T6.direction};else C6=T6;if(N6.has(z8))N6.get(z8).push(C6);else N6.set(z8,[C6]);if(!N6.has(C6.id))N6.set(C6.id,[])}else{if(z8=o.get(c0)?o.get(c0):c0,o.get(T6.id))C6={id:o.get(T6.id),gap:T6.gap,direction:T6.direction};else C6=T6;if(F6.has(z8))F6.get(z8).push(C6);else F6.set(z8,[C6]);if(!F6.has(C6.id))F6.set(C6.id,[])}})},M6=!0,g6=!1,O8=void 0;try{for(var a6=i.keys()[Symbol.iterator](),U8;!(M6=(U8=a6.next()).done);M6=!0){var p6=U8.value;P6(p6)}}catch(kJ){g6=!0,O8=kJ}finally{try{if(!M6&&a6.return)a6.return()}finally{if(g6)throw O8}}var u6=v(N6),S0=v(F6),Q6=S(u6),B6=S(S0),D0=f(N6),X6=f(F6),W6=[],_6=[];Q6.forEach(function(kJ,c0){W6[c0]=[],kJ.forEach(function(T6){if(D0.get(T6).length==0)W6[c0].push(T6)})}),B6.forEach(function(kJ,c0){_6[c0]=[],kJ.forEach(function(T6){if(X6.get(T6).length==0)_6[c0].push(T6)})});var c6=h(N6,"horizontal",T0,L0,W6),d6=h(F6,"vertical",$0,I0,_6),l6=function kJ(c0){if(w0.get(c0))w0.get(c0).forEach(function(T6){N[R.get(T6)]=c6.get(c0)});else N[R.get(c0)]=c6.get(c0)},t6=!0,g8=!1,k6=void 0;try{for(var d0=c6.keys()[Symbol.iterator](),V6;!(t6=(V6=d0.next()).done);t6=!0){var Z8=V6.value;l6(Z8)}}catch(kJ){g8=!0,k6=kJ}finally{try{if(!t6&&d0.return)d0.return()}finally{if(g8)throw k6}}var qJ=function kJ(c0){if(d.get(c0))d.get(c0).forEach(function(T6){E[R.get(T6)]=d6.get(c0)});else E[R.get(c0)]=d6.get(c0)},ZJ=!0,q8=!1,B9=void 0;try{for(var m9=d6.keys()[Symbol.iterator](),H7;!(ZJ=(H7=m9.next()).done);ZJ=!0){var Z8=H7.value;qJ(Z8)}}catch(kJ){q8=!0,B9=kJ}finally{try{if(!ZJ&&m9.return)m9.return()}finally{if(q8)throw B9}}})()}for(var t0=0;t0<V.length;t0++){var C0=V[t0];if(C0.getChild()==null)C0.setCenter(N[R.get(C0.id)],E[R.get(C0.id)])}},X.exports=M},551:(X)=>{X.exports=J}},Z={};function U(X){var Y=Z[X];if(Y!==void 0)return Y.exports;var z=Z[X]={exports:{}};return Q[X](z,z.exports,U),z.exports}var K=U(45);return K})()})});var gn0=F4((LV,qU0)=>{(function J(Q,Z){if(typeof LV==="object"&&typeof qU0==="object")qU0.exports=Z(HU0());else if(typeof define==="function"&&define.amd)define(["cose-base"],Z);else if(typeof LV==="object")LV.cytoscapeFcose=Z(HU0());else Q.cytoscapeFcose=Z(Q.coseBase)})(LV,function(J){return(()=>{var Q={658:(X)=>{X.exports=Object.assign!=null?Object.assign.bind(Object):function(Y){for(var z=arguments.length,G=Array(z>1?z-1:0),W=1;W<z;W++)G[W-1]=arguments[W];return G.forEach(function(H){Object.keys(H).forEach(function(q){return Y[q]=H[q]})}),Y}},548:(X,Y,z)=>{var G=function(){function q(F,M){var L=[],A=!0,I=!1,R=void 0;try{for(var N=F[Symbol.iterator](),E;!(A=(E=N.next()).done);A=!0)if(L.push(E.value),M&&L.length===M)break}catch(V){I=!0,R=V}finally{try{if(!A&&N.return)N.return()}finally{if(I)throw R}}return L}return function(F,M){if(Array.isArray(F))return F;else if(Symbol.iterator in Object(F))return q(F,M);else throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),W=z(140).layoutBase.LinkedList,H={};H.getTopMostNodes=function(q){var F={};for(var M=0;M<q.length;M++)F[q[M].id()]=!0;var L=q.filter(function(A,I){if(typeof A==="number")A=I;var R=A.parent()[0];while(R!=null){if(F[R.id()])return!1;R=R.parent()[0]}return!0});return L},H.connectComponents=function(q,F,M,L){var A=new W,I=new Set,R=[],N=void 0,E=void 0,V=void 0,j=!1,T=1,C=[],$=[],b=function h(){var _=q.collection();$.push(_);var S=M[0],v=q.collection();v.merge(S).merge(S.descendants().intersection(F)),R.push(S),v.forEach(function(y){A.push(y),I.add(y),_.merge(y)});var f=function y(){S=A.shift();var m=q.collection();S.neighborhood().nodes().forEach(function(l){if(F.intersection(S.edgesWith(l)).length>0)m.merge(l)});for(var g=0;g<m.length;g++){var p=m[g];if(N=M.intersection(p.union(p.ancestors())),N!=null&&!I.has(N[0])){var i=N.union(N.descendants());i.forEach(function(l){if(A.push(l),I.add(l),_.merge(l),M.has(l))R.push(l)})}}};while(A.length!=0)f();if(_.forEach(function(y){F.intersection(y.connectedEdges()).forEach(function(m){if(_.has(m.source())&&_.has(m.target()))_.merge(m)})}),R.length==M.length)j=!0;if(!j||j&&T>1){E=R[0],V=E.connectedEdges().length,R.forEach(function(y){if(y.connectedEdges().length<V)V=y.connectedEdges().length,E=y}),C.push(E.id());var x=q.collection();x.merge(R[0]),R.forEach(function(y){x.merge(y)}),R=[],M=M.difference(x),T++}};do b();while(!j);if(L){if(C.length>0)L.set("dummy"+(L.size+1),C)}return $},H.relocateComponent=function(q,F,M){if(!M.fixedNodeConstraint){var{POSITIVE_INFINITY:L,NEGATIVE_INFINITY:A,POSITIVE_INFINITY:I,NEGATIVE_INFINITY:R}=Number;if(M.quality=="draft"){var N=!0,E=!1,V=void 0;try{for(var j=F.nodeIndexes[Symbol.iterator](),T;!(N=(T=j.next()).done);N=!0){var C=T.value,$=G(C,2),b=$[0],h=$[1],_=M.cy.getElementById(b);if(_){var S=_.boundingBox(),v=F.xCoords[h]-S.w/2,f=F.xCoords[h]+S.w/2,x=F.yCoords[h]-S.h/2,y=F.yCoords[h]+S.h/2;if(v<L)L=v;if(f>A)A=f;if(x<I)I=x;if(y>R)R=y}}}catch(l){E=!0,V=l}finally{try{if(!N&&j.return)j.return()}finally{if(E)throw V}}var m=q.x-(A+L)/2,g=q.y-(R+I)/2;F.xCoords=F.xCoords.map(function(l){return l+m}),F.yCoords=F.yCoords.map(function(l){return l+g})}else{Object.keys(F).forEach(function(l){var a=F[l],e=a.getRect().x,G0=a.getRect().x+a.getRect().width,U0=a.getRect().y,O0=a.getRect().y+a.getRect().height;if(e<L)L=e;if(G0>A)A=G0;if(U0<I)I=U0;if(O0>R)R=O0});var p=q.x-(A+L)/2,i=q.y-(R+I)/2;Object.keys(F).forEach(function(l){var a=F[l];a.setCenter(a.getCenterX()+p,a.getCenterY()+i)})}}},H.calcBoundingBox=function(q,F,M,L){var{MAX_SAFE_INTEGER:A,MIN_SAFE_INTEGER:I,MAX_SAFE_INTEGER:R,MIN_SAFE_INTEGER:N}=Number,E=void 0,V=void 0,j=void 0,T=void 0,C=q.descendants().not(":parent"),$=C.length;for(var b=0;b<$;b++){var h=C[b];if(E=F[L.get(h.id())]-h.width()/2,V=F[L.get(h.id())]+h.width()/2,j=M[L.get(h.id())]-h.height()/2,T=M[L.get(h.id())]+h.height()/2,A>E)A=E;if(I<V)I=V;if(R>j)R=j;if(N<T)N=T}var _={};return _.topLeftX=A,_.topLeftY=R,_.width=I-A,_.height=N-R,_},H.calcParentsWithoutChildren=function(q,F){var M=q.collection();return F.nodes(":parent").forEach(function(L){var A=!1;if(L.children().forEach(function(I){if(I.css("display")!="none")A=!0}),!A)M.merge(L)}),M},X.exports=H},816:(X,Y,z)=>{var G=z(548),W=z(140).CoSELayout,H=z(140).CoSENode,q=z(140).layoutBase.PointD,F=z(140).layoutBase.DimensionD,M=z(140).layoutBase.LayoutConstants,L=z(140).layoutBase.FDLayoutConstants,A=z(140).CoSEConstants,I=function R(N,E){var{cy:V,eles:j}=N,T=j.nodes(),C=j.edges(),$=void 0,b=void 0,h=void 0,_={};if(N.randomize)$=E.nodeIndexes,b=E.xCoords,h=E.yCoords;var S=function i(l){return typeof l==="function"},v=function i(l,a){if(S(l))return l(a);else return l},f=G.calcParentsWithoutChildren(V,j),x=function i(l,a,e,G0){var U0=a.length;for(var O0=0;O0<U0;O0++){var X0=a[O0],E0=null;if(X0.intersection(f).length==0)E0=X0.children();var W0=void 0,q0=X0.layoutDimensions({nodeDimensionsIncludeLabels:G0.nodeDimensionsIncludeLabels});if(X0.outerWidth()!=null&&X0.outerHeight()!=null)if(G0.randomize)if(!X0.isParent())W0=l.add(new H(e.graphManager,new q(b[$.get(X0.id())]-q0.w/2,h[$.get(X0.id())]-q0.h/2),new F(parseFloat(q0.w),parseFloat(q0.h))));else{var z0=G.calcBoundingBox(X0,b,h,$);if(X0.intersection(f).length==0)W0=l.add(new H(e.graphManager,new q(z0.topLeftX,z0.topLeftY),new F(z0.width,z0.height)));else W0=l.add(new H(e.graphManager,new q(z0.topLeftX,z0.topLeftY),new F(parseFloat(q0.w),parseFloat(q0.h))))}else W0=l.add(new H(e.graphManager,new q(X0.position("x")-q0.w/2,X0.position("y")-q0.h/2),new F(parseFloat(q0.w),parseFloat(q0.h))));else W0=l.add(new H(this.graphManager));if(W0.id=X0.data("id"),W0.nodeRepulsion=v(G0.nodeRepulsion,X0),W0.paddingLeft=parseInt(X0.css("padding")),W0.paddingTop=parseInt(X0.css("padding")),W0.paddingRight=parseInt(X0.css("padding")),W0.paddingBottom=parseInt(X0.css("padding")),G0.nodeDimensionsIncludeLabels)W0.labelWidth=X0.boundingBox({includeLabels:!0,includeNodes:!1,includeOverlays:!1}).w,W0.labelHeight=X0.boundingBox({includeLabels:!0,includeNodes:!1,includeOverlays:!1}).h,W0.labelPosVertical=X0.css("text-valign"),W0.labelPosHorizontal=X0.css("text-halign");if(_[X0.data("id")]=W0,isNaN(W0.rect.x))W0.rect.x=0;if(isNaN(W0.rect.y))W0.rect.y=0;if(E0!=null&&E0.length>0){var K0=void 0;K0=e.getGraphManager().add(e.newGraph(),W0),i(K0,E0,e,G0)}}},y=function i(l,a,e){var G0=0,U0=0;for(var O0=0;O0<e.length;O0++){var X0=e[O0],E0=_[X0.data("source")],W0=_[X0.data("target")];if(E0&&W0&&E0!==W0&&E0.getEdgesBetween(W0).length==0){var q0=a.add(l.newEdge(),E0,W0);q0.id=X0.id(),q0.idealLength=v(N.idealEdgeLength,X0),q0.edgeElasticity=v(N.edgeElasticity,X0),G0+=q0.idealLength,U0++}}if(N.idealEdgeLength!=null){if(U0>0)A.DEFAULT_EDGE_LENGTH=L.DEFAULT_EDGE_LENGTH=G0/U0;else if(!S(N.idealEdgeLength))A.DEFAULT_EDGE_LENGTH=L.DEFAULT_EDGE_LENGTH=N.idealEdgeLength;else A.DEFAULT_EDGE_LENGTH=L.DEFAULT_EDGE_LENGTH=50;A.MIN_REPULSION_DIST=L.MIN_REPULSION_DIST=L.DEFAULT_EDGE_LENGTH/10,A.DEFAULT_RADIAL_SEPARATION=L.DEFAULT_EDGE_LENGTH}},m=function i(l,a){if(a.fixedNodeConstraint)l.constraints.fixedNodeConstraint=a.fixedNodeConstraint;if(a.alignmentConstraint)l.constraints.alignmentConstraint=a.alignmentConstraint;if(a.relativePlacementConstraint)l.constraints.relativePlacementConstraint=a.relativePlacementConstraint};if(N.nestingFactor!=null)A.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=L.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=N.nestingFactor;if(N.gravity!=null)A.DEFAULT_GRAVITY_STRENGTH=L.DEFAULT_GRAVITY_STRENGTH=N.gravity;if(N.numIter!=null)A.MAX_ITERATIONS=L.MAX_ITERATIONS=N.numIter;if(N.gravityRange!=null)A.DEFAULT_GRAVITY_RANGE_FACTOR=L.DEFAULT_GRAVITY_RANGE_FACTOR=N.gravityRange;if(N.gravityCompound!=null)A.DEFAULT_COMPOUND_GRAVITY_STRENGTH=L.DEFAULT_COMPOUND_GRAVITY_STRENGTH=N.gravityCompound;if(N.gravityRangeCompound!=null)A.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=L.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=N.gravityRangeCompound;if(N.initialEnergyOnIncremental!=null)A.DEFAULT_COOLING_FACTOR_INCREMENTAL=L.DEFAULT_COOLING_FACTOR_INCREMENTAL=N.initialEnergyOnIncremental;if(N.tilingCompareBy!=null)A.TILING_COMPARE_BY=N.tilingCompareBy;if(N.quality=="proof")M.QUALITY=2;else M.QUALITY=0;if(A.NODE_DIMENSIONS_INCLUDE_LABELS=L.NODE_DIMENSIONS_INCLUDE_LABELS=M.NODE_DIMENSIONS_INCLUDE_LABELS=N.nodeDimensionsIncludeLabels,A.DEFAULT_INCREMENTAL=L.DEFAULT_INCREMENTAL=M.DEFAULT_INCREMENTAL=!N.randomize,A.ANIMATE=L.ANIMATE=M.ANIMATE=N.animate,A.TILE=N.tile,A.TILING_PADDING_VERTICAL=typeof N.tilingPaddingVertical==="function"?N.tilingPaddingVertical.call():N.tilingPaddingVertical,A.TILING_PADDING_HORIZONTAL=typeof N.tilingPaddingHorizontal==="function"?N.tilingPaddingHorizontal.call():N.tilingPaddingHorizontal,A.DEFAULT_INCREMENTAL=L.DEFAULT_INCREMENTAL=M.DEFAULT_INCREMENTAL=!0,A.PURE_INCREMENTAL=!N.randomize,M.DEFAULT_UNIFORM_LEAF_NODE_SIZES=N.uniformNodeDimensions,N.step=="transformed")A.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,A.ENFORCE_CONSTRAINTS=!1,A.APPLY_LAYOUT=!1;if(N.step=="enforced")A.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,A.ENFORCE_CONSTRAINTS=!0,A.APPLY_LAYOUT=!1;if(N.step=="cose")A.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,A.ENFORCE_CONSTRAINTS=!1,A.APPLY_LAYOUT=!0;if(N.step=="all"){if(N.randomize)A.TRANSFORM_ON_CONSTRAINT_HANDLING=!0;else A.TRANSFORM_ON_CONSTRAINT_HANDLING=!1;A.ENFORCE_CONSTRAINTS=!0,A.APPLY_LAYOUT=!0}if(N.fixedNodeConstraint||N.alignmentConstraint||N.relativePlacementConstraint)A.TREE_REDUCTION_ON_INCREMENTAL=!1;else A.TREE_REDUCTION_ON_INCREMENTAL=!0;var g=new W,p=g.newGraphManager();return x(p.addRoot(),G.getTopMostNodes(T),g,N),y(g,p,C),m(g,N),g.runLayout(),_};X.exports={coseLayout:I}},212:(X,Y,z)=>{var G=function(){function N(E,V){for(var j=0;j<V.length;j++){var T=V[j];if(T.enumerable=T.enumerable||!1,T.configurable=!0,"value"in T)T.writable=!0;Object.defineProperty(E,T.key,T)}}return function(E,V,j){if(V)N(E.prototype,V);if(j)N(E,j);return E}}();function W(N,E){if(!(N instanceof E))throw new TypeError("Cannot call a class as a function")}var H=z(658),q=z(548),F=z(657),M=F.spectralLayout,L=z(816),A=L.coseLayout,I=Object.freeze({quality:"default",randomize:!0,animate:!0,animationDuration:1000,animationEasing:void 0,fit:!0,padding:30,nodeDimensionsIncludeLabels:!1,uniformNodeDimensions:!1,packComponents:!0,step:"all",samplingType:!0,sampleSize:25,nodeSeparation:75,piTol:0.0000001,nodeRepulsion:function N(E){return 4500},idealEdgeLength:function N(E){return 50},edgeElasticity:function N(E){return 0.45},nestingFactor:0.1,gravity:0.25,numIter:2500,tile:!0,tilingCompareBy:void 0,tilingPaddingVertical:10,tilingPaddingHorizontal:10,gravityRangeCompound:1.5,gravityCompound:1,gravityRange:3.8,initialEnergyOnIncremental:0.3,fixedNodeConstraint:void 0,alignmentConstraint:void 0,relativePlacementConstraint:void 0,ready:function N(){},stop:function N(){}}),R=function(){function N(E){W(this,N),this.options=H({},I,E)}return G(N,[{key:"run",value:function E(){var V=this,j=this.options,T=j.cy,C=j.eles,$=[],b=void 0,h=void 0,_=[],S=void 0,v=[];if(j.fixedNodeConstraint&&(!Array.isArray(j.fixedNodeConstraint)||j.fixedNodeConstraint.length==0))j.fixedNodeConstraint=void 0;if(j.alignmentConstraint){if(j.alignmentConstraint.vertical&&(!Array.isArray(j.alignmentConstraint.vertical)||j.alignmentConstraint.vertical.length==0))j.alignmentConstraint.vertical=void 0;if(j.alignmentConstraint.horizontal&&(!Array.isArray(j.alignmentConstraint.horizontal)||j.alignmentConstraint.horizontal.length==0))j.alignmentConstraint.horizontal=void 0}if(j.relativePlacementConstraint&&(!Array.isArray(j.relativePlacementConstraint)||j.relativePlacementConstraint.length==0))j.relativePlacementConstraint=void 0;var f=j.fixedNodeConstraint||j.alignmentConstraint||j.relativePlacementConstraint;if(f)j.tile=!1,j.packComponents=!1;var x=void 0,y=!1;if(T.layoutUtilities&&j.packComponents){if(x=T.layoutUtilities("get"),!x)x=T.layoutUtilities();y=!0}if(C.nodes().length>0)if(!y){var m=j.eles.boundingBox();if(v.push({x:m.x1+m.w/2,y:m.y1+m.h/2}),j.randomize){var g=M(j);$.push(g)}if(j.quality=="default"||j.quality=="proof")_.push(A(j,$[0])),q.relocateComponent(v[0],_[0],j);else q.relocateComponent(v[0],$[0],j)}else{var p=q.getTopMostNodes(j.eles.nodes());if(S=q.connectComponents(T,j.eles,p),S.forEach(function(m0){var J0=m0.boundingBox();v.push({x:J0.x1+J0.w/2,y:J0.y1+J0.h/2})}),j.randomize)S.forEach(function(m0){j.eles=m0,$.push(M(j))});if(j.quality=="default"||j.quality=="proof"){var i=T.collection();if(j.tile){var l=new Map,a=[],e=[],G0=0,U0={nodeIndexes:l,xCoords:a,yCoords:e},O0=[];if(S.forEach(function(m0,J0){if(m0.edges().length==0)m0.nodes().forEach(function(z6,t){if(i.merge(m0.nodes()[t]),!z6.isParent())U0.nodeIndexes.set(m0.nodes()[t].id(),G0++),U0.xCoords.push(m0.nodes()[0].position().x),U0.yCoords.push(m0.nodes()[0].position().y)}),O0.push(J0)}),i.length>1){var X0=i.boundingBox();v.push({x:X0.x1+X0.w/2,y:X0.y1+X0.h/2}),S.push(i),$.push(U0);for(var E0=O0.length-1;E0>=0;E0--)S.splice(O0[E0],1),$.splice(O0[E0],1),v.splice(O0[E0],1)}}S.forEach(function(m0,J0){j.eles=m0,_.push(A(j,$[J0])),q.relocateComponent(v[J0],_[J0],j)})}else S.forEach(function(m0,J0){q.relocateComponent(v[J0],$[J0],j)});var W0=new Set;if(S.length>1){var q0=[],z0=C.filter(function(m0){return m0.css("display")=="none"});S.forEach(function(m0,J0){var z6=void 0;if(j.quality=="draft")z6=$[J0].nodeIndexes;if(m0.nodes().not(z0).length>0){var t={};t.edges=[],t.nodes=[];var N0=void 0;if(m0.nodes().not(z0).forEach(function(f0){if(j.quality=="draft")if(!f0.isParent())N0=z6.get(f0.id()),t.nodes.push({x:$[J0].xCoords[N0]-f0.boundingbox().w/2,y:$[J0].yCoords[N0]-f0.boundingbox().h/2,width:f0.boundingbox().w,height:f0.boundingbox().h});else{var l0=q.calcBoundingBox(f0,$[J0].xCoords,$[J0].yCoords,z6);t.nodes.push({x:l0.topLeftX,y:l0.topLeftY,width:l0.width,height:l0.height})}else if(_[J0][f0.id()])t.nodes.push({x:_[J0][f0.id()].getLeft(),y:_[J0][f0.id()].getTop(),width:_[J0][f0.id()].getWidth(),height:_[J0][f0.id()].getHeight()})}),m0.edges().forEach(function(f0){var l0=f0.source(),k0=f0.target();if(l0.css("display")!="none"&&k0.css("display")!="none"){if(j.quality=="draft"){var _0=z6.get(l0.id()),g0=z6.get(k0.id()),h0=[],t0=[];if(l0.isParent()){var C0=q.calcBoundingBox(l0,$[J0].xCoords,$[J0].yCoords,z6);h0.push(C0.topLeftX+C0.width/2),h0.push(C0.topLeftY+C0.height/2)}else h0.push($[J0].xCoords[_0]),h0.push($[J0].yCoords[_0]);if(k0.isParent()){var y0=q.calcBoundingBox(k0,$[J0].xCoords,$[J0].yCoords,z6);t0.push(y0.topLeftX+y0.width/2),t0.push(y0.topLeftY+y0.height/2)}else t0.push($[J0].xCoords[g0]),t0.push($[J0].yCoords[g0]);t.edges.push({startX:h0[0],startY:h0[1],endX:t0[0],endY:t0[1]})}else if(_[J0][l0.id()]&&_[J0][k0.id()])t.edges.push({startX:_[J0][l0.id()].getCenterX(),startY:_[J0][l0.id()].getCenterY(),endX:_[J0][k0.id()].getCenterX(),endY:_[J0][k0.id()].getCenterY()})}}),t.nodes.length>0)q0.push(t),W0.add(J0)}});var K0=x.packComponents(q0,j.randomize).shifts;if(j.quality=="draft")$.forEach(function(m0,J0){var z6=m0.xCoords.map(function(N0){return N0+K0[J0].dx}),t=m0.yCoords.map(function(N0){return N0+K0[J0].dy});m0.xCoords=z6,m0.yCoords=t});else{var R0=0;W0.forEach(function(m0){Object.keys(_[m0]).forEach(function(J0){var z6=_[m0][J0];z6.setCenter(z6.getCenterX()+K0[R0].dx,z6.getCenterY()+K0[R0].dy)}),R0++})}}}var Y0=function m0(J0,z6){if(j.quality=="default"||j.quality=="proof"){if(typeof J0==="number")J0=z6;var t=void 0,N0=void 0,f0=J0.data("id");if(_.forEach(function(k0){if(f0 in k0)t={x:k0[f0].getRect().getCenterX(),y:k0[f0].getRect().getCenterY()},N0=k0[f0]}),j.nodeDimensionsIncludeLabels){if(N0.labelWidth){if(N0.labelPosHorizontal=="left")t.x+=N0.labelWidth/2;else if(N0.labelPosHorizontal=="right")t.x-=N0.labelWidth/2}if(N0.labelHeight){if(N0.labelPosVertical=="top")t.y+=N0.labelHeight/2;else if(N0.labelPosVertical=="bottom")t.y-=N0.labelHeight/2}}if(t==null)t={x:J0.position("x"),y:J0.position("y")};return{x:t.x,y:t.y}}else{var l0=void 0;if($.forEach(function(k0){var _0=k0.nodeIndexes.get(J0.id());if(_0!=null)l0={x:k0.xCoords[_0],y:k0.yCoords[_0]}}),l0==null)l0={x:J0.position("x"),y:J0.position("y")};return{x:l0.x,y:l0.y}}};if(j.quality=="default"||j.quality=="proof"||j.randomize){var P0=q.calcParentsWithoutChildren(T,C),F0=C.filter(function(m0){return m0.css("display")=="none"});if(j.eles=C.not(F0),C.nodes().not(":parent").not(F0).layoutPositions(V,j,Y0),P0.length>0)P0.forEach(function(m0){m0.position(Y0(m0))})}else console.log("If randomize option is set to false, then quality option must be 'default' or 'proof'.")}}]),N}();X.exports=R},657:(X,Y,z)=>{var G=z(548),W=z(140).layoutBase.Matrix,H=z(140).layoutBase.SVD,q=function F(M){var{cy:L,eles:A}=M,I=A.nodes(),R=A.nodes(":parent"),N=new Map,E=new Map,V=new Map,j=[],T=[],C=[],$=[],b=[],h=[],_=[],S=[],v=void 0,f=void 0,x=1e8,y=0.000000001,m=M.piTol,g=M.samplingType,p=M.nodeSeparation,i=void 0,l=function o(){var w0=0,d=0,L0=!1;while(d<i){w0=Math.floor(Math.random()*f),L0=!1;for(var I0=0;I0<d;I0++)if($[I0]==w0){L0=!0;break}if(!L0)$[d]=w0,d++;else continue}},a=function o(w0,d,L0){var I0=[],T0=0,$0=0,v0=0,r0=void 0,u0=[],G6=0,A6=1;for(var r6=0;r6<f;r6++)u0[r6]=x;I0[$0]=w0,u0[w0]=0;while($0>=T0){v0=I0[T0++];var N6=j[v0];for(var F6=0;F6<N6.length;F6++)if(r0=E.get(N6[F6]),u0[r0]==x)u0[r0]=u0[v0]+1,I0[++$0]=r0;h[v0][d]=u0[v0]*p}if(L0){for(var P6=0;P6<f;P6++)if(h[P6][d]<b[P6])b[P6]=h[P6][d];for(var M6=0;M6<f;M6++)if(b[M6]>G6)G6=b[M6],A6=M6}return A6},e=function o(w0){var d=void 0;if(!w0){l();for(var L0=0;L0<i;L0++)a($[L0],L0,w0,!1)}else{d=Math.floor(Math.random()*f),v=d;for(var I0=0;I0<f;I0++)b[I0]=x;for(var T0=0;T0<i;T0++)$[T0]=d,d=a(d,T0,w0)}for(var $0=0;$0<f;$0++)for(var v0=0;v0<i;v0++)h[$0][v0]*=h[$0][v0];for(var r0=0;r0<i;r0++)_[r0]=[];for(var u0=0;u0<i;u0++)for(var G6=0;G6<i;G6++)_[u0][G6]=h[$[G6]][u0]},G0=function o(){var w0=H.svd(_),d=w0.S,L0=w0.U,I0=w0.V,T0=d[0]*d[0]*d[0],$0=[];for(var v0=0;v0<i;v0++){$0[v0]=[];for(var r0=0;r0<i;r0++)if($0[v0][r0]=0,v0==r0)$0[v0][r0]=d[v0]/(d[v0]*d[v0]+T0/(d[v0]*d[v0]))}S=W.multMat(W.multMat(I0,$0),W.transpose(L0))},U0=function o(){var w0=void 0,d=void 0,L0=[],I0=[],T0=[],$0=[];for(var v0=0;v0<f;v0++)L0[v0]=Math.random(),I0[v0]=Math.random();L0=W.normalize(L0),I0=W.normalize(I0);var r0=0,u0=y,G6=y,A6=void 0;while(!0){r0++;for(var r6=0;r6<f;r6++)T0[r6]=L0[r6];if(L0=W.multGamma(W.multL(W.multGamma(T0),h,S)),w0=W.dotProduct(T0,L0),L0=W.normalize(L0),u0=W.dotProduct(T0,L0),A6=Math.abs(u0/G6),A6<=1+m&&A6>=1)break;G6=u0}for(var N6=0;N6<f;N6++)T0[N6]=L0[N6];r0=0,G6=y;while(!0){r0++;for(var F6=0;F6<f;F6++)$0[F6]=I0[F6];if($0=W.minusOp($0,W.multCons(T0,W.dotProduct(T0,$0))),I0=W.multGamma(W.multL(W.multGamma($0),h,S)),d=W.dotProduct($0,I0),I0=W.normalize(I0),u0=W.dotProduct($0,I0),A6=Math.abs(u0/G6),A6<=1+m&&A6>=1)break;G6=u0}for(var P6=0;P6<f;P6++)$0[P6]=I0[P6];T=W.multCons(T0,Math.sqrt(Math.abs(w0))),C=W.multCons($0,Math.sqrt(Math.abs(d)))};G.connectComponents(L,A,G.getTopMostNodes(I),N),R.forEach(function(o){G.connectComponents(L,A,G.getTopMostNodes(o.descendants().intersection(A)),N)});var O0=0;for(var X0=0;X0<I.length;X0++)if(!I[X0].isParent())E.set(I[X0].id(),O0++);var E0=!0,W0=!1,q0=void 0;try{for(var z0=N.keys()[Symbol.iterator](),K0;!(E0=(K0=z0.next()).done);E0=!0){var R0=K0.value;E.set(R0,O0++)}}catch(o){W0=!0,q0=o}finally{try{if(!E0&&z0.return)z0.return()}finally{if(W0)throw q0}}for(var Y0=0;Y0<E.size;Y0++)j[Y0]=[];R.forEach(function(o){var w0=o.children().intersection(A);while(w0.nodes(":childless").length==0)w0=w0.nodes()[0].children().intersection(A);var d=0,L0=w0.nodes(":childless")[0].connectedEdges().length;w0.nodes(":childless").forEach(function(I0,T0){if(I0.connectedEdges().length<L0)L0=I0.connectedEdges().length,d=T0}),V.set(o.id(),w0.nodes(":childless")[d].id())}),I.forEach(function(o){var w0=void 0;if(o.isParent())w0=E.get(V.get(o.id()));else w0=E.get(o.id());o.neighborhood().nodes().forEach(function(d){if(A.intersection(o.edgesWith(d)).length>0)if(d.isParent())j[w0].push(V.get(d.id()));else j[w0].push(d.id())})});var P0=function o(w0){var d=E.get(w0),L0=void 0;N.get(w0).forEach(function(I0){if(L.getElementById(I0).isParent())L0=V.get(I0);else L0=I0;j[d].push(L0),j[E.get(L0)].push(w0)})},F0=!0,m0=!1,J0=void 0;try{for(var z6=N.keys()[Symbol.iterator](),t;!(F0=(t=z6.next()).done);F0=!0){var N0=t.value;P0(N0)}}catch(o){m0=!0,J0=o}finally{try{if(!F0&&z6.return)z6.return()}finally{if(m0)throw J0}}f=E.size;var f0=void 0;if(f>2){i=f<M.sampleSize?f:M.sampleSize;for(var l0=0;l0<f;l0++)h[l0]=[];for(var k0=0;k0<i;k0++)S[k0]=[];if(M.quality=="draft"||M.step=="all")e(g),G0(),U0(),f0={nodeIndexes:E,xCoords:T,yCoords:C};else E.forEach(function(o,w0){T.push(L.getElementById(w0).position("x")),C.push(L.getElementById(w0).position("y"))}),f0={nodeIndexes:E,xCoords:T,yCoords:C};return f0}else{var _0=E.keys(),g0=L.getElementById(_0.next().value),h0=g0.position(),t0=g0.outerWidth();if(T.push(h0.x),C.push(h0.y),f==2){var C0=L.getElementById(_0.next().value),y0=C0.outerWidth();T.push(h0.x+t0/2+y0/2+M.idealEdgeLength),C.push(h0.y)}return f0={nodeIndexes:E,xCoords:T,yCoords:C},f0}};X.exports={spectralLayout:q}},579:(X,Y,z)=>{var G=z(212),W=function H(q){if(!q)return;q("layout","fcose",G)};if(typeof cytoscape!=="undefined")W(cytoscape);X.exports=W},140:(X)=>{X.exports=J}},Z={};function U(X){var Y=Z[X];if(Y!==void 0)return Y.exports;var z=Z[X]={exports:{}};return Q[X](z,z.exports,U),z.exports}var K=U(579);return K})()})});var Qs0={};QJ(Qs0,{diagram:()=>qr6});function rn0(J,Q,Z){J.forEach((U)=>{Q.add({group:"nodes",data:{type:"service",id:U.id,icon:U.icon,label:U.title,parent:U.in,width:Z.getConfigField("iconSize"),height:Z.getConfigField("iconSize")},classes:"node-service"})})}function nn0(J,Q,Z){J.forEach((U)=>{Q.add({group:"nodes",data:{type:"junction",id:U.id,parent:U.in,width:Z.getConfigField("iconSize"),height:Z.getConfigField("iconSize")},classes:"node-junction"})})}function sn0(J,Q){Q.nodes().map((Z)=>{let U=tI(Z);if(U.type==="group")return;U.x=Z.position().x,U.y=Z.position().y,J.getElementById(U.id).attr("transform","translate("+(U.x||0)+","+(U.y||0)+")")})}function an0(J,Q){J.forEach((Z)=>{Q.add({group:"nodes",data:{type:"group",id:Z.id,icon:Z.icon,label:Z.title,parent:Z.in},classes:"node-group"})})}function on0(J,Q){J.forEach((Z)=>{let{lhsId:U,rhsId:K,lhsInto:X,lhsGroup:Y,rhsInto:z,lhsDir:G,rhsDir:W,rhsGroup:H,title:q}=Z,F=BU0(Z.lhsDir,Z.rhsDir)?"segments":"straight",M={id:`${U}-${K}`,label:q,source:U,sourceDir:G,sourceArrow:X,sourceGroup:Y,sourceEndpoint:G==="L"?"0 50%":G==="R"?"100% 50%":G==="T"?"50% 0":"50% 100%",target:K,targetDir:W,targetArrow:z,targetGroup:H,targetEndpoint:W==="L"?"0 50%":W==="R"?"100% 50%":W==="T"?"50% 0":"50% 100%"};Q.add({group:"edges",data:M,classes:F})})}function tn0(J,Q,Z){let U=w((z,G)=>{return Object.entries(z).reduce((W,[H,q])=>{let F=0,M=Object.entries(q);if(M.length===1)return W[H]=M[0][1],W;for(let L=0;L<M.length-1;L++)for(let A=L+1;A<M.length;A++){let[I,R]=M[L],[N,E]=M[A];if(Z[I]?.[N]===G)W[H]??=[],W[H]=[...W[H],...R,...E];else if(I==="default"||N==="default")W[H]??=[],W[H]=[...W[H],...R,...E];else{let j=`${H}-${F++}`;W[j]=R;let T=`${H}-${F++}`;W[T]=E}}return W},{})},"flattenAlignments"),K=Q.map((z)=>{let G={},W={};return Object.entries(z).forEach(([H,[q,F]])=>{let M=J.getNode(H)?.in??"default";G[F]??={},G[F][M]??=[],G[F][M].push(H),W[q]??={},W[q][M]??=[],W[q][M].push(H)}),{horiz:Object.values(U(G,"horizontal")).filter((H)=>H.length>1),vert:Object.values(U(W,"vertical")).filter((H)=>H.length>1)}}),[X,Y]=K.reduce(([z,G],{horiz:W,vert:H})=>{return[[...z,...W],[...G,...H]]},[[],[]]);return{horizontal:X,vertical:Y}}function en0(J,Q){let Z=[],U=w((X)=>`${X[0]},${X[1]}`,"posToStr"),K=w((X)=>X.split(",").map((Y)=>parseInt(Y)),"strToPos");return J.forEach((X)=>{let Y=Object.fromEntries(Object.entries(X).map(([H,q])=>[U(q),H])),z=[U([0,0])],G={},W={L:[-1,0],R:[1,0],T:[0,1],B:[0,-1]};while(z.length>0){let H=z.shift();if(H){G[H]=1;let q=Y[H];if(q){let F=K(H);Object.entries(W).forEach(([M,L])=>{let A=U([F[0]+L[0],F[1]+L[1]]),I=Y[A];if(I&&!G[A])z.push(A),Z.push({[mn0[M]]:I,[mn0[ri6(M)]]:q,gap:1.5*Q.getConfigField("iconSize")})})}}}}),Z}function Js0(J,Q,Z,U,K,{spatialMaps:X,groupAlignments:Y}){return new Promise((z)=>{let G=j6("body").append("div").attr("id","cy").attr("style","display:none"),W=SX({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"straight",label:"data(label)","source-endpoint":"data(sourceEndpoint)","target-endpoint":"data(targetEndpoint)"}},{selector:"edge.segments",style:{"curve-style":"segments","segment-weights":"0","segment-distances":[0.5],"edge-distances":"endpoints","source-endpoint":"data(sourceEndpoint)","target-endpoint":"data(targetEndpoint)"}},{selector:"node",style:{"compound-sizing-wrt-labels":"include"}},{selector:"node[label]",style:{"text-valign":"bottom","text-halign":"center","font-size":`${K.getConfigField("fontSize")}px`}},{selector:".node-service",style:{label:"data(label)",width:"data(width)",height:"data(height)"}},{selector:".node-junction",style:{width:"data(width)",height:"data(height)"}},{selector:".node-group",style:{padding:`${K.getConfigField("padding")}px`}}],layout:{name:"grid",boundingBox:{x1:0,x2:100,y1:0,y2:100}}});G.remove(),an0(Z,W),rn0(J,W,K),nn0(Q,W,K),on0(U,W);let H=tn0(K,X,Y),q=en0(X,K),F=W.layout({name:"fcose",quality:"proof",styleEnabled:!1,animate:!1,nodeDimensionsIncludeLabels:!1,idealEdgeLength(M){let[L,A]=M.connectedNodes(),{parent:I}=tI(L),{parent:R}=tI(A);return I===R?1.5*K.getConfigField("iconSize"):0.5*K.getConfigField("iconSize")},edgeElasticity(M){let[L,A]=M.connectedNodes(),{parent:I}=tI(L),{parent:R}=tI(A);return I===R?0.45:0.001},alignmentConstraint:H,relativePlacementConstraint:q});F.one("layoutstop",()=>{function M(L,A,I,R){let N,E,{x:V,y:j}=L,{x:T,y:C}=A;E=(R-j+(V-I)*(j-C)/(V-T))/Math.sqrt(1+Math.pow((j-C)/(V-T),2)),N=Math.sqrt(Math.pow(R-j,2)+Math.pow(I-V,2)-Math.pow(E,2));let $=Math.sqrt(Math.pow(T-V,2)+Math.pow(C-j,2));N=N/$;let b=(T-V)*(R-j)-(C-j)*(I-V);switch(!0){case b>=0:b=1;break;case b<0:b=-1;break}let h=(T-V)*(I-V)+(C-j)*(R-j);switch(!0){case h>=0:h=1;break;case h<0:h=-1;break}return E=Math.abs(E)*b,N=N*h,{distances:E,weights:N}}w(M,"getSegmentWeights"),W.startBatch();for(let L of Object.values(W.edges()))if(L.data?.()){let{x:A,y:I}=L.source().position(),{x:R,y:N}=L.target().position();if(A!==R&&I!==N){let E=L.sourceEndpoint(),V=L.targetEndpoint(),{sourceDir:j}=cn0(L),[T,C]=N2(j)?[E.x,V.y]:[V.x,E.y],{weights:$,distances:b}=M(E,V,T,C);L.style("segment-distances",b),L.style("segment-weights",$)}}W.endBatch(),F.run()}),F.run(),W.ready((M)=>{B0.info("Ready",M),z(W)})})}var in0,mn0,un0,eg,ri6,pn0,dU,N2,BU0,ni6,si6,FU0,ai6,oi6,ti6,ei6,Jr6,cn0,tI,Qr6,ln0,Zr6,dn0,Ur6,Kr6,oI,AV,Xr6,Yr6,zr6,Gr6,Wr6,Hr6,qr6;var Zs0=r(()=>{Xz();CZ();pB();X7();nJ();NJ();q2();gJ0();in0=J6(gn0(),1);vJ();mn0={L:"left",R:"right",T:"top",B:"bottom"},un0={L:w((J)=>`${J},${J/2} 0,${J} 0,0`,"L"),R:w((J)=>`0,${J/2} ${J},0 ${J},${J}`,"R"),T:w((J)=>`0,0 ${J},0 ${J/2},${J}`,"T"),B:w((J)=>`${J/2},0 ${J},${J} 0,${J}`,"B")},eg={L:w((J,Q)=>J-Q+2,"L"),R:w((J,Q)=>J-2,"R"),T:w((J,Q)=>J-Q+2,"T"),B:w((J,Q)=>J-2,"B")},ri6=w(function(J){if(dU(J))return J==="L"?"R":"L";else return J==="T"?"B":"T"},"getOppositeArchitectureDirection"),pn0=w(function(J){let Q=J;return Q==="L"||Q==="R"||Q==="T"||Q==="B"},"isArchitectureDirection"),dU=w(function(J){let Q=J;return Q==="L"||Q==="R"},"isArchitectureDirectionX"),N2=w(function(J){let Q=J;return Q==="T"||Q==="B"},"isArchitectureDirectionY"),BU0=w(function(J,Q){let Z=dU(J)&&N2(Q),U=N2(J)&&dU(Q);return Z||U},"isArchitectureDirectionXY"),ni6=w(function(J){let Q=J[0],Z=J[1],U=dU(Q)&&N2(Z),K=N2(Q)&&dU(Z);return U||K},"isArchitecturePairXY"),si6=w(function(J){return J!=="LL"&&J!=="RR"&&J!=="TT"&&J!=="BB"},"isValidArchitectureDirectionPair"),FU0=w(function(J,Q){let Z=`${J}${Q}`;return si6(Z)?Z:void 0},"getArchitectureDirectionPair"),ai6=w(function([J,Q],Z){let U=Z[0],K=Z[1];if(dU(U))if(N2(K))return[J+(U==="L"?-1:1),Q+(K==="T"?1:-1)];else return[J+(U==="L"?-1:1),Q];else if(dU(K))return[J+(K==="L"?1:-1),Q+(U==="T"?1:-1)];else return[J,Q+(U==="T"?1:-1)]},"shiftPositionByArchitectureDirectionPair"),oi6=w(function(J){if(J==="LT"||J==="TL")return[1,1];else if(J==="BL"||J==="LB")return[1,-1];else if(J==="BR"||J==="RB")return[-1,-1];else return[-1,1]},"getArchitectureDirectionXYFactors"),ti6=w(function(J,Q){if(BU0(J,Q))return"bend";else if(dU(J))return"horizontal";return"vertical"},"getArchitectureDirectionAlignment"),ei6=w(function(J){return J.type==="service"},"isArchitectureService"),Jr6=w(function(J){return J.type==="junction"},"isArchitectureJunction"),cn0=w((J)=>{return J.data()},"edgeData"),tI=w((J)=>{return J.data()},"nodeData"),Qr6=TJ.architecture,ln0=class{constructor(){this.nodes={},this.groups={},this.edges=[],this.registeredIds={},this.elements={},this.setAccTitle=tJ,this.getAccTitle=X9,this.setDiagramTitle=M9,this.getDiagramTitle=G9,this.getAccDescription=z9,this.setAccDescription=Y9,this.clear()}static{w(this,"ArchitectureDB")}clear(){this.nodes={},this.groups={},this.edges=[],this.registeredIds={},this.dataStructures=void 0,this.elements={},rJ()}addService({id:J,icon:Q,in:Z,title:U,iconText:K}){if(this.registeredIds[J]!==void 0)throw new Error(`The service id [${J}] is already in use by another ${this.registeredIds[J]}`);if(Z!==void 0){if(J===Z)throw new Error(`The service [${J}] cannot be placed within itself`);if(this.registeredIds[Z]===void 0)throw new Error(`The service [${J}]'s parent does not exist. Please make sure the parent is created before this service`);if(this.registeredIds[Z]==="node")throw new Error(`The service [${J}]'s parent is not a group`)}this.registeredIds[J]="node",this.nodes[J]={id:J,type:"service",icon:Q,iconText:K,title:U,edges:[],in:Z}}getServices(){return Object.values(this.nodes).filter(ei6)}addJunction({id:J,in:Q}){this.registeredIds[J]="node",this.nodes[J]={id:J,type:"junction",edges:[],in:Q}}getJunctions(){return Object.values(this.nodes).filter(Jr6)}getNodes(){return Object.values(this.nodes)}getNode(J){return this.nodes[J]??null}addGroup({id:J,icon:Q,in:Z,title:U}){if(this.registeredIds?.[J]!==void 0)throw new Error(`The group id [${J}] is already in use by another ${this.registeredIds[J]}`);if(Z!==void 0){if(J===Z)throw new Error(`The group [${J}] cannot be placed within itself`);if(this.registeredIds?.[Z]===void 0)throw new Error(`The group [${J}]'s parent does not exist. Please make sure the parent is created before this group`);if(this.registeredIds?.[Z]==="node")throw new Error(`The group [${J}]'s parent is not a group`)}this.registeredIds[J]="group",this.groups[J]={id:J,icon:Q,title:U,in:Z}}getGroups(){return Object.values(this.groups)}addEdge({lhsId:J,rhsId:Q,lhsDir:Z,rhsDir:U,lhsInto:K,rhsInto:X,lhsGroup:Y,rhsGroup:z,title:G}){if(!pn0(Z))throw new Error(`Invalid direction given for left hand side of edge ${J}--${Q}. Expected (L,R,T,B) got ${String(Z)}`);if(!pn0(U))throw new Error(`Invalid direction given for right hand side of edge ${J}--${Q}. Expected (L,R,T,B) got ${String(U)}`);if(this.nodes[J]===void 0&&this.groups[J]===void 0)throw new Error(`The left-hand id [${J}] does not yet exist. Please create the service/group before declaring an edge to it.`);if(this.nodes[Q]===void 0&&this.groups[Q]===void 0)throw new Error(`The right-hand id [${Q}] does not yet exist. Please create the service/group before declaring an edge to it.`);let W=this.nodes[J].in,H=this.nodes[Q].in;if(Y&&W&&H&&W==H)throw new Error(`The left-hand id [${J}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);if(z&&W&&H&&W==H)throw new Error(`The right-hand id [${Q}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);let q={lhsId:J,lhsDir:Z,lhsInto:K,lhsGroup:Y,rhsId:Q,rhsDir:U,rhsInto:X,rhsGroup:z,title:G};if(this.edges.push(q),this.nodes[J]&&this.nodes[Q])this.nodes[J].edges.push(this.edges[this.edges.length-1]),this.nodes[Q].edges.push(this.edges[this.edges.length-1])}getEdges(){return this.edges}getDataStructures(){if(this.dataStructures===void 0){let J={},Q=Object.entries(this.nodes).reduce((z,[G,W])=>{return z[G]=W.edges.reduce((H,q)=>{let F=this.getNode(q.lhsId)?.in,M=this.getNode(q.rhsId)?.in;if(F&&M&&F!==M){let L=ti6(q.lhsDir,q.rhsDir);if(L!=="bend")J[F]??={},J[F][M]=L,J[M]??={},J[M][F]=L}if(q.lhsId===G){let L=FU0(q.lhsDir,q.rhsDir);if(L)H[L]=q.rhsId}else{let L=FU0(q.rhsDir,q.lhsDir);if(L)H[L]=q.lhsId}return H},{}),z},{}),Z=Object.keys(Q)[0],U={[Z]:1},K=Object.keys(Q).reduce((z,G)=>G===Z?z:{...z,[G]:1},{}),X=w((z)=>{let G={[z]:[0,0]},W=[z];while(W.length>0){let H=W.shift();if(H){U[H]=1,delete K[H];let q=Q[H],[F,M]=G[H];Object.entries(q).forEach(([L,A])=>{if(!U[A])G[A]=ai6([F,M],L),W.push(A)})}}return G},"BFS"),Y=[X(Z)];while(Object.keys(K).length>0)Y.push(X(Object.keys(K)[0]));this.dataStructures={adjList:Q,spatialMaps:Y,groupAlignments:J}}return this.dataStructures}setElementForId(J,Q){this.elements[J]=Q}getElementById(J){return this.elements[J]}getConfig(){return R4({...Qr6,...CJ().architecture})}getConfigField(J){return this.getConfig()[J]}},Zr6=w((J,Q)=>{CK(J,Q),J.groups.map((Z)=>Q.addGroup(Z)),J.services.map((Z)=>Q.addService({...Z,type:"service"})),J.junctions.map((Z)=>Q.addJunction({...Z,type:"junction"})),J.edges.map((Z)=>Q.addEdge(Z))},"populateDb"),dn0={parser:{yy:void 0},parse:w(async(J)=>{let Q=await pU("architecture",J);B0.debug(Q);let Z=dn0.parser?.yy;if(!(Z instanceof ln0))throw new Error("parser.parser?.yy was not a ArchitectureDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");Zr6(Q,Z)},"parse")},Ur6=w((J)=>`
|
|
2950
|
+
node : x:${J.x} y:${J.y} w:${J.width} h:${J.height}`);let{x:U,y:K}=J,X=Math.abs(U-Z.x),Y=J.width/2,z=Z.x<Q.x?Y-X:Y+X,G=J.height/2,W=Math.abs(Q.y-Z.y),H=Math.abs(Q.x-Z.x);if(Math.abs(K-Q.y)*Y>Math.abs(U-Q.x)*G){let q=Z.y<Q.y?Q.y-G-K:K-G-Q.y;z=H*q/W;let F={x:Z.x<Q.x?Z.x+z:Z.x-H+z,y:Z.y<Q.y?Z.y+W-q:Z.y-W+q};if(z===0)F.x=Q.x,F.y=Q.y;if(H===0)F.x=Q.x;if(W===0)F.y=Q.y;return B0.debug(`abc89 topp/bott calc, Q ${W}, q ${q}, R ${H}, r ${z}`,F),F}else{if(Z.x<Q.x)z=Q.x-Y-U;else z=U-Y-Q.x;let q=W*z/H,F=Z.x<Q.x?Z.x+H-z:Z.x-H+z,M=Z.y<Q.y?Z.y+q:Z.y-q;if(B0.debug(`sides calc abc89, Q ${W}, q ${q}, R ${H}, r ${z}`,{_x:F,_y:M}),z===0)F=Q.x,M=Q.y;if(H===0)F=Q.x;if(W===0)M=Q.y;return{x:F,y:M}}},"intersection"),Fn0=w((J,Q)=>{B0.debug("abc88 cutPathAtIntersect",J,Q);let Z=[],U=J[0],K=!1;return J.forEach((X)=>{if(!Gi6(Q,X)&&!K){let Y=Wi6(Q,U,X),z=!1;if(Z.forEach((G)=>{z=z||G.x===Y.x&&G.y===Y.y}),!Z.some((G)=>G.x===Y.x&&G.y===Y.y))Z.push(Y);K=!0}else if(U=X,!K)Z.push(X)}),Z},"cutPathAtIntersect"),Hi6=w(function(J,Q,Z,U,K,X,Y){let z=Z.points;B0.debug("abc88 InsertEdge: edge=",Z,"e=",Q);let G=!1,W=X.node(Q.v);var H=X.node(Q.w);if(H?.intersect&&W?.intersect)z=z.slice(1,Z.points.length-1),z.unshift(W.intersect(z[0])),z.push(H.intersect(z[z.length-1]));if(Z.toCluster)B0.debug("to cluster abc88",U[Z.toCluster]),z=Fn0(Z.points,U[Z.toCluster].node),G=!0;if(Z.fromCluster)B0.debug("from cluster abc88",U[Z.fromCluster]),z=Fn0(z.reverse(),U[Z.fromCluster].node).reverse(),G=!0;let q=z.filter((V)=>!Number.isNaN(V.y)),F=wX;if(Z.curve&&(K==="graph"||K==="flowchart"))F=Z.curve;let{x:M,y:L}=P_(Z),A=x1().x(M).y(L).curve(F),I;switch(Z.thickness){case"normal":I="edge-thickness-normal";break;case"thick":I="edge-thickness-thick";break;case"invisible":I="edge-thickness-thick";break;default:I=""}switch(Z.pattern){case"solid":I+=" edge-pattern-solid";break;case"dotted":I+=" edge-pattern-dotted";break;case"dashed":I+=" edge-pattern-dashed";break}let R=J.append("path").attr("d",A(q)).attr("id",Z.id).attr("class"," "+I+(Z.classes?" "+Z.classes:"")).attr("style",Z.style),N="";if(i0().flowchart.arrowMarkerAbsolute||i0().state.arrowMarkerAbsolute)N=JB(!0);Ki6(R,Z,N,Y,K);let E={};if(G)E.updatedPath=z;return E.originalPath=Z.points,E},"insertEdge"),qi6=w((J)=>{let Q=new Set;for(let Z of J)switch(Z){case"x":Q.add("right"),Q.add("left");break;case"y":Q.add("up"),Q.add("down");break;default:Q.add(Z);break}return Q},"expandAndDeduplicateDirections"),Fi6=w((J,Q,Z)=>{let U=qi6(J),K=2,X=Q.height+2*Z.padding,Y=X/2,z=Q.width+2*Y+Z.padding,G=Z.padding/2;if(U.has("right")&&U.has("left")&&U.has("up")&&U.has("down"))return[{x:0,y:0},{x:Y,y:0},{x:z/2,y:2*G},{x:z-Y,y:0},{x:z,y:0},{x:z,y:-X/3},{x:z+2*G,y:-X/2},{x:z,y:-2*X/3},{x:z,y:-X},{x:z-Y,y:-X},{x:z/2,y:-X-2*G},{x:Y,y:-X},{x:0,y:-X},{x:0,y:-2*X/3},{x:-2*G,y:-X/2},{x:0,y:-X/3}];if(U.has("right")&&U.has("left")&&U.has("up"))return[{x:Y,y:0},{x:z-Y,y:0},{x:z,y:-X/2},{x:z-Y,y:-X},{x:Y,y:-X},{x:0,y:-X/2}];if(U.has("right")&&U.has("left")&&U.has("down"))return[{x:0,y:0},{x:Y,y:-X},{x:z-Y,y:-X},{x:z,y:0}];if(U.has("right")&&U.has("up")&&U.has("down"))return[{x:0,y:0},{x:z,y:-Y},{x:z,y:-X+Y},{x:0,y:-X}];if(U.has("left")&&U.has("up")&&U.has("down"))return[{x:z,y:0},{x:0,y:-Y},{x:0,y:-X+Y},{x:z,y:-X}];if(U.has("right")&&U.has("left"))return[{x:Y,y:0},{x:Y,y:-G},{x:z-Y,y:-G},{x:z-Y,y:0},{x:z,y:-X/2},{x:z-Y,y:-X},{x:z-Y,y:-X+G},{x:Y,y:-X+G},{x:Y,y:-X},{x:0,y:-X/2}];if(U.has("up")&&U.has("down"))return[{x:z/2,y:0},{x:0,y:-G},{x:Y,y:-G},{x:Y,y:-X+G},{x:0,y:-X+G},{x:z/2,y:-X},{x:z,y:-X+G},{x:z-Y,y:-X+G},{x:z-Y,y:-G},{x:z,y:-G}];if(U.has("right")&&U.has("up"))return[{x:0,y:0},{x:z,y:-Y},{x:0,y:-X}];if(U.has("right")&&U.has("down"))return[{x:0,y:0},{x:z,y:0},{x:0,y:-X}];if(U.has("left")&&U.has("up"))return[{x:z,y:0},{x:0,y:-Y},{x:z,y:-X}];if(U.has("left")&&U.has("down"))return[{x:z,y:0},{x:0,y:0},{x:z,y:-X}];if(U.has("right"))return[{x:Y,y:-G},{x:Y,y:-G},{x:z-Y,y:-G},{x:z-Y,y:0},{x:z,y:-X/2},{x:z-Y,y:-X},{x:z-Y,y:-X+G},{x:Y,y:-X+G},{x:Y,y:-X+G}];if(U.has("left"))return[{x:Y,y:0},{x:Y,y:-G},{x:z-Y,y:-G},{x:z-Y,y:-X+G},{x:Y,y:-X+G},{x:Y,y:-X},{x:0,y:-X/2}];if(U.has("up"))return[{x:Y,y:-G},{x:Y,y:-X+G},{x:0,y:-X+G},{x:z/2,y:-X},{x:z,y:-X+G},{x:z-Y,y:-X+G},{x:z-Y,y:-G}];if(U.has("down"))return[{x:z/2,y:0},{x:0,y:-G},{x:Y,y:-G},{x:Y,y:-X+G},{x:z-Y,y:-X+G},{x:z-Y,y:-G},{x:z,y:-G}];return[{x:0,y:0}]},"getArrowPoints");w(Pn0,"intersectNode");Bi6=Pn0;w(Vn0,"intersectEllipse");Tn0=Vn0;w(Cn0,"intersectCircle");Mi6=Cn0;w(Sn0,"intersectLine");w(QU0,"sameSign");Oi6=Sn0,Li6=$n0;w($n0,"intersectPolygon");Ai6=w((J,Q)=>{var{x:Z,y:U}=J,K=Q.x-Z,X=Q.y-U,Y=J.width/2,z=J.height/2,G,W;if(Math.abs(X)*Y>Math.abs(K)*z){if(X<0)z=-z;G=X===0?0:z*K/X,W=z}else{if(K<0)Y=-Y;G=Y,W=K===0?0:Y*X/K}return{x:Z+G,y:U+W}},"intersectRect"),Ii6=Ai6,z4={node:Bi6,circle:Mi6,ellipse:Tn0,polygon:Li6,rect:Ii6},eQ=w(async(J,Q,Z,U)=>{let K=i0(),X,Y=Q.useHtmlLabels||V9(K.flowchart.htmlLabels);if(!Z)X="node default";else X=Z;let z=J.insert("g").attr("class",X).attr("id",Q.domId||Q.id),G=z.insert("g").attr("class","label").attr("style",Q.labelStyle),W;if(Q.labelText===void 0)W="";else W=typeof Q.labelText==="string"?Q.labelText:Q.labelText[0];let H=G.node(),q;if(Q.labelType==="markdown")q=TZ(G,VJ($5(W),K),{useHtmlLabels:Y,width:Q.width||K.flowchart.wrappingWidth,classes:"markdown-node-label"},K);else q=H.appendChild(await rX(VJ($5(W),K),Q.labelStyle,!1,U));let F=q.getBBox(),M=Q.padding/2;if(V9(K.flowchart.htmlLabels)){let L=q.children[0],A=j6(q),I=L.getElementsByTagName("img");if(I){let R=W.replace(/<img[^>]*>/g,"").trim()==="";await Promise.all([...I].map((N)=>new Promise((E)=>{function V(){if(N.style.display="flex",N.style.flexDirection="column",R){let j=K.fontSize?K.fontSize:window.getComputedStyle(document.body).fontSize,T=5,C=parseInt(j,10)*5+"px";N.style.minWidth=C,N.style.maxWidth=C}else N.style.width="100%";E(N)}w(V,"setupImage"),setTimeout(()=>{if(N.complete)V()}),N.addEventListener("error",V),N.addEventListener("load",V)})))}F=L.getBoundingClientRect(),A.attr("width",F.width),A.attr("height",F.height)}if(Y)G.attr("transform","translate("+-F.width/2+", "+-F.height/2+")");else G.attr("transform","translate(0, "+-F.height/2+")");if(Q.centerLabel)G.attr("transform","translate("+-F.width/2+", "+-F.height/2+")");return G.insert("rect",":first-child"),{shapeSvg:z,bbox:F,halfPadding:M,label:G}},"labelHelper"),k4=w((J,Q)=>{let Z=Q.node().getBBox();J.width=Z.width,J.height=Z.height},"updateNodeBounds");w(ZY,"insertPolygonShape");Ri6=w(async(J,Q)=>{if(!(Q.useHtmlLabels||i0().flowchart.htmlLabels))Q.centerLabel=!0;let{shapeSvg:U,bbox:K,halfPadding:X}=await eQ(J,Q,"node "+Q.classes,!0);B0.info("Classes = ",Q.classes);let Y=U.insert("rect",":first-child");return Y.attr("rx",Q.rx).attr("ry",Q.ry).attr("x",-K.width/2-X).attr("y",-K.height/2-X).attr("width",K.width+Q.padding).attr("height",K.height+Q.padding),k4(Q,Y),Q.intersect=function(z){return z4.rect(Q,z)},U},"note"),Ni6=Ri6,Bn0=w((J)=>{if(J)return" "+J;return""},"formatClass"),_K=w((J,Q)=>{return`${Q?Q:"node default"}${Bn0(J.classes)} ${Bn0(J.class)}`},"getClassesFromNode"),Mn0=w(async(J,Q)=>{let{shapeSvg:Z,bbox:U}=await eQ(J,Q,_K(Q,void 0),!0),K=U.width+Q.padding,X=U.height+Q.padding,Y=K+X,z=[{x:Y/2,y:0},{x:Y,y:-Y/2},{x:Y/2,y:-Y},{x:0,y:-Y/2}];B0.info("Question main (Circle)");let G=ZY(Z,Y,Y,z);return G.attr("style",Q.style),k4(Q,G),Q.intersect=function(W){return B0.warn("Intersect called"),z4.polygon(Q,z,W)},Z},"question"),Di6=w((J,Q)=>{let Z=J.insert("g").attr("class","node default").attr("id",Q.domId||Q.id),U=28,K=[{x:0,y:14},{x:14,y:0},{x:0,y:-14},{x:-14,y:0}];return Z.insert("polygon",":first-child").attr("points",K.map(function(Y){return Y.x+","+Y.y}).join(" ")).attr("class","state-start").attr("r",7).attr("width",28).attr("height",28),Q.width=28,Q.height=28,Q.intersect=function(Y){return z4.circle(Q,14,Y)},Z},"choice"),wi6=w(async(J,Q)=>{let{shapeSvg:Z,bbox:U}=await eQ(J,Q,_K(Q,void 0),!0),K=4,X=U.height+Q.padding,Y=X/4,z=U.width+2*Y+Q.padding,G=[{x:Y,y:0},{x:z-Y,y:0},{x:z,y:-X/2},{x:z-Y,y:-X},{x:Y,y:-X},{x:0,y:-X/2}],W=ZY(Z,z,X,G);return W.attr("style",Q.style),k4(Q,W),Q.intersect=function(H){return z4.polygon(Q,G,H)},Z},"hexagon"),Ei6=w(async(J,Q)=>{let{shapeSvg:Z,bbox:U}=await eQ(J,Q,void 0,!0),K=2,X=U.height+2*Q.padding,Y=X/2,z=U.width+2*Y+Q.padding,G=Fi6(Q.directions,U,Q),W=ZY(Z,z,X,G);return W.attr("style",Q.style),k4(Q,W),Q.intersect=function(H){return z4.polygon(Q,G,H)},Z},"block_arrow"),ji6=w(async(J,Q)=>{let{shapeSvg:Z,bbox:U}=await eQ(J,Q,_K(Q,void 0),!0),K=U.width+Q.padding,X=U.height+Q.padding,Y=[{x:-X/2,y:0},{x:K,y:0},{x:K,y:-X},{x:-X/2,y:-X},{x:0,y:-X/2}];return ZY(Z,K,X,Y).attr("style",Q.style),Q.width=K+X,Q.height=X,Q.intersect=function(G){return z4.polygon(Q,Y,G)},Z},"rect_left_inv_arrow"),Pi6=w(async(J,Q)=>{let{shapeSvg:Z,bbox:U}=await eQ(J,Q,_K(Q),!0),K=U.width+Q.padding,X=U.height+Q.padding,Y=[{x:-2*X/6,y:0},{x:K-X/6,y:0},{x:K+2*X/6,y:-X},{x:X/6,y:-X}],z=ZY(Z,K,X,Y);return z.attr("style",Q.style),k4(Q,z),Q.intersect=function(G){return z4.polygon(Q,Y,G)},Z},"lean_right"),Vi6=w(async(J,Q)=>{let{shapeSvg:Z,bbox:U}=await eQ(J,Q,_K(Q,void 0),!0),K=U.width+Q.padding,X=U.height+Q.padding,Y=[{x:2*X/6,y:0},{x:K+X/6,y:0},{x:K-2*X/6,y:-X},{x:-X/6,y:-X}],z=ZY(Z,K,X,Y);return z.attr("style",Q.style),k4(Q,z),Q.intersect=function(G){return z4.polygon(Q,Y,G)},Z},"lean_left"),Ti6=w(async(J,Q)=>{let{shapeSvg:Z,bbox:U}=await eQ(J,Q,_K(Q,void 0),!0),K=U.width+Q.padding,X=U.height+Q.padding,Y=[{x:-2*X/6,y:0},{x:K+2*X/6,y:0},{x:K-X/6,y:-X},{x:X/6,y:-X}],z=ZY(Z,K,X,Y);return z.attr("style",Q.style),k4(Q,z),Q.intersect=function(G){return z4.polygon(Q,Y,G)},Z},"trapezoid"),Ci6=w(async(J,Q)=>{let{shapeSvg:Z,bbox:U}=await eQ(J,Q,_K(Q,void 0),!0),K=U.width+Q.padding,X=U.height+Q.padding,Y=[{x:X/6,y:0},{x:K-X/6,y:0},{x:K+2*X/6,y:-X},{x:-2*X/6,y:-X}],z=ZY(Z,K,X,Y);return z.attr("style",Q.style),k4(Q,z),Q.intersect=function(G){return z4.polygon(Q,Y,G)},Z},"inv_trapezoid"),Si6=w(async(J,Q)=>{let{shapeSvg:Z,bbox:U}=await eQ(J,Q,_K(Q,void 0),!0),K=U.width+Q.padding,X=U.height+Q.padding,Y=[{x:0,y:0},{x:K+X/2,y:0},{x:K,y:-X/2},{x:K+X/2,y:-X},{x:0,y:-X}],z=ZY(Z,K,X,Y);return z.attr("style",Q.style),k4(Q,z),Q.intersect=function(G){return z4.polygon(Q,Y,G)},Z},"rect_right_inv_arrow"),$i6=w(async(J,Q)=>{let{shapeSvg:Z,bbox:U}=await eQ(J,Q,_K(Q,void 0),!0),K=U.width+Q.padding,X=K/2,Y=X/(2.5+K/50),z=U.height+Y+Q.padding,G="M 0,"+Y+" a "+X+","+Y+" 0,0,0 "+K+" 0 a "+X+","+Y+" 0,0,0 "+-K+" 0 l 0,"+z+" a "+X+","+Y+" 0,0,0 "+K+" 0 l 0,"+-z,W=Z.attr("label-offset-y",Y).insert("path",":first-child").attr("style",Q.style).attr("d",G).attr("transform","translate("+-K/2+","+-(z/2+Y)+")");return k4(Q,W),Q.intersect=function(H){let q=z4.rect(Q,H),F=q.x-Q.x;if(X!=0&&(Math.abs(F)<Q.width/2||Math.abs(F)==Q.width/2&&Math.abs(q.y-Q.y)>Q.height/2-Y)){let M=Y*Y*(1-F*F/(X*X));if(M!=0)M=Math.sqrt(M);if(M=Y-M,H.y-Q.y>0)M=-M;q.y+=M}return q},Z},"cylinder"),vi6=w(async(J,Q)=>{let{shapeSvg:Z,bbox:U,halfPadding:K}=await eQ(J,Q,"node "+Q.classes+" "+Q.class,!0),X=Z.insert("rect",":first-child"),Y=Q.positioned?Q.width:U.width+Q.padding,z=Q.positioned?Q.height:U.height+Q.padding,G=Q.positioned?-Y/2:-U.width/2-K,W=Q.positioned?-z/2:-U.height/2-K;if(X.attr("class","basic label-container").attr("style",Q.style).attr("rx",Q.rx).attr("ry",Q.ry).attr("x",G).attr("y",W).attr("width",Y).attr("height",z),Q.props){let H=new Set(Object.keys(Q.props));if(Q.props.borders)og(X,Q.props.borders,Y,z),H.delete("borders");H.forEach((q)=>{B0.warn(`Unknown node property ${q}`)})}return k4(Q,X),Q.intersect=function(H){return z4.rect(Q,H)},Z},"rect"),ki6=w(async(J,Q)=>{let{shapeSvg:Z,bbox:U,halfPadding:K}=await eQ(J,Q,"node "+Q.classes,!0),X=Z.insert("rect",":first-child"),Y=Q.positioned?Q.width:U.width+Q.padding,z=Q.positioned?Q.height:U.height+Q.padding,G=Q.positioned?-Y/2:-U.width/2-K,W=Q.positioned?-z/2:-U.height/2-K;if(X.attr("class","basic cluster composite label-container").attr("style",Q.style).attr("rx",Q.rx).attr("ry",Q.ry).attr("x",G).attr("y",W).attr("width",Y).attr("height",z),Q.props){let H=new Set(Object.keys(Q.props));if(Q.props.borders)og(X,Q.props.borders,Y,z),H.delete("borders");H.forEach((q)=>{B0.warn(`Unknown node property ${q}`)})}return k4(Q,X),Q.intersect=function(H){return z4.rect(Q,H)},Z},"composite"),fi6=w(async(J,Q)=>{let{shapeSvg:Z}=await eQ(J,Q,"label",!0);B0.trace("Classes = ",Q.class);let U=Z.insert("rect",":first-child"),K=0,X=0;if(U.attr("width",K).attr("height",X),Z.attr("class","label edgeLabel"),Q.props){let Y=new Set(Object.keys(Q.props));if(Q.props.borders)og(U,Q.props.borders,K,X),Y.delete("borders");Y.forEach((z)=>{B0.warn(`Unknown node property ${z}`)})}return k4(Q,U),Q.intersect=function(Y){return z4.rect(Q,Y)},Z},"labelRect");w(og,"applyNodePropertyBorders");_i6=w(async(J,Q)=>{let Z;if(!Q.classes)Z="node default";else Z="node "+Q.classes;let U=J.insert("g").attr("class",Z).attr("id",Q.domId||Q.id),K=U.insert("rect",":first-child"),X=U.insert("line"),Y=U.insert("g").attr("class","label"),z=Q.labelText.flat?Q.labelText.flat():Q.labelText,G="";if(typeof z==="object")G=z[0];else G=z;B0.info("Label text abc79",G,z,typeof z==="object");let W=Y.node().appendChild(await rX(G,Q.labelStyle,!0,!0)),H={width:0,height:0};if(V9(i0().flowchart.htmlLabels)){let A=W.children[0],I=j6(W);H=A.getBoundingClientRect(),I.attr("width",H.width),I.attr("height",H.height)}B0.info("Text 2",z);let q=z.slice(1,z.length),F=W.getBBox(),M=Y.node().appendChild(await rX(q.join?q.join("<br/>"):q,Q.labelStyle,!0,!0));if(V9(i0().flowchart.htmlLabels)){let A=M.children[0],I=j6(M);H=A.getBoundingClientRect(),I.attr("width",H.width),I.attr("height",H.height)}let L=Q.padding/2;return j6(M).attr("transform","translate( "+(H.width>F.width?0:(F.width-H.width)/2)+", "+(F.height+L+5)+")"),j6(W).attr("transform","translate( "+(H.width<F.width?0:-(F.width-H.width)/2)+", 0)"),H=Y.node().getBBox(),Y.attr("transform","translate("+-H.width/2+", "+(-H.height/2-L+3)+")"),K.attr("class","outer title-state").attr("x",-H.width/2-L).attr("y",-H.height/2-L).attr("width",H.width+Q.padding).attr("height",H.height+Q.padding),X.attr("class","divider").attr("x1",-H.width/2-L).attr("x2",H.width/2+L).attr("y1",-H.height/2-L+F.height+L).attr("y2",-H.height/2-L+F.height+L),k4(Q,K),Q.intersect=function(A){return z4.rect(Q,A)},U},"rectWithTitle"),bi6=w(async(J,Q)=>{let{shapeSvg:Z,bbox:U}=await eQ(J,Q,_K(Q,void 0),!0),K=U.height+Q.padding,X=U.width+K/4+Q.padding,Y=Z.insert("rect",":first-child").attr("style",Q.style).attr("rx",K/2).attr("ry",K/2).attr("x",-X/2).attr("y",-K/2).attr("width",X).attr("height",K);return k4(Q,Y),Q.intersect=function(z){return z4.rect(Q,z)},Z},"stadium"),xi6=w(async(J,Q)=>{let{shapeSvg:Z,bbox:U,halfPadding:K}=await eQ(J,Q,_K(Q,void 0),!0),X=Z.insert("circle",":first-child");return X.attr("style",Q.style).attr("rx",Q.rx).attr("ry",Q.ry).attr("r",U.width/2+K).attr("width",U.width+Q.padding).attr("height",U.height+Q.padding),B0.info("Circle main"),k4(Q,X),Q.intersect=function(Y){return B0.info("Circle intersect",Q,U.width/2+K,Y),z4.circle(Q,U.width/2+K,Y)},Z},"circle"),hi6=w(async(J,Q)=>{let{shapeSvg:Z,bbox:U,halfPadding:K}=await eQ(J,Q,_K(Q,void 0),!0),X=5,Y=Z.insert("g",":first-child"),z=Y.insert("circle"),G=Y.insert("circle");return Y.attr("class",Q.class),z.attr("style",Q.style).attr("rx",Q.rx).attr("ry",Q.ry).attr("r",U.width/2+K+5).attr("width",U.width+Q.padding+10).attr("height",U.height+Q.padding+10),G.attr("style",Q.style).attr("rx",Q.rx).attr("ry",Q.ry).attr("r",U.width/2+K).attr("width",U.width+Q.padding).attr("height",U.height+Q.padding),B0.info("DoubleCircle main"),k4(Q,z),Q.intersect=function(W){return B0.info("DoubleCircle intersect",Q,U.width/2+K+5,W),z4.circle(Q,U.width/2+K+5,W)},Z},"doublecircle"),yi6=w(async(J,Q)=>{let{shapeSvg:Z,bbox:U}=await eQ(J,Q,_K(Q,void 0),!0),K=U.width+Q.padding,X=U.height+Q.padding,Y=[{x:0,y:0},{x:K,y:0},{x:K,y:-X},{x:0,y:-X},{x:0,y:0},{x:-8,y:0},{x:K+8,y:0},{x:K+8,y:-X},{x:-8,y:-X},{x:-8,y:0}],z=ZY(Z,K,X,Y);return z.attr("style",Q.style),k4(Q,z),Q.intersect=function(G){return z4.polygon(Q,Y,G)},Z},"subroutine"),gi6=w((J,Q)=>{let Z=J.insert("g").attr("class","node default").attr("id",Q.domId||Q.id),U=Z.insert("circle",":first-child");return U.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14),k4(Q,U),Q.intersect=function(K){return z4.circle(Q,7,K)},Z},"start"),On0=w((J,Q,Z)=>{let U=J.insert("g").attr("class","node default").attr("id",Q.domId||Q.id),K=70,X=10;if(Z==="LR")K=10,X=70;let Y=U.append("rect").attr("x",-1*K/2).attr("y",-1*X/2).attr("width",K).attr("height",X).attr("class","fork-join");return k4(Q,Y),Q.height=Q.height+Q.padding/2,Q.width=Q.width+Q.padding/2,Q.intersect=function(z){return z4.rect(Q,z)},U},"forkJoin"),mi6=w((J,Q)=>{let Z=J.insert("g").attr("class","node default").attr("id",Q.domId||Q.id),U=Z.insert("circle",":first-child"),K=Z.insert("circle",":first-child");return K.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14),U.attr("class","state-end").attr("r",5).attr("width",10).attr("height",10),k4(Q,K),Q.intersect=function(X){return z4.circle(Q,7,X)},Z},"end"),ui6=w(async(J,Q)=>{let Z=Q.padding/2,U=4,K=8,X;if(!Q.classes)X="node default";else X="node "+Q.classes;let Y=J.insert("g").attr("class",X).attr("id",Q.domId||Q.id),z=Y.insert("rect",":first-child"),G=Y.insert("line"),W=Y.insert("line"),H=0,q=4,F=Y.insert("g").attr("class","label"),M=0,L=Q.classData.annotations?.[0],A=Q.classData.annotations[0]?"«"+Q.classData.annotations[0]+"»":"",I=F.node().appendChild(await rX(A,Q.labelStyle,!0,!0)),R=I.getBBox();if(V9(i0().flowchart.htmlLabels)){let $=I.children[0],b=j6(I);R=$.getBoundingClientRect(),b.attr("width",R.width),b.attr("height",R.height)}if(Q.classData.annotations[0])q+=R.height+4,H+=R.width;let N=Q.classData.label;if(Q.classData.type!==void 0&&Q.classData.type!=="")if(i0().flowchart.htmlLabels)N+="<"+Q.classData.type+">";else N+="<"+Q.classData.type+">";let E=F.node().appendChild(await rX(N,Q.labelStyle,!0,!0));j6(E).attr("class","classTitle");let V=E.getBBox();if(V9(i0().flowchart.htmlLabels)){let $=E.children[0],b=j6(E);V=$.getBoundingClientRect(),b.attr("width",V.width),b.attr("height",V.height)}if(q+=V.height+4,V.width>H)H=V.width;let j=[];Q.classData.members.forEach(async($)=>{let b=$.getDisplayDetails(),h=b.displayText;if(i0().flowchart.htmlLabels)h=h.replace(/</g,"<").replace(/>/g,">");let _=F.node().appendChild(await rX(h,b.cssStyle?b.cssStyle:Q.labelStyle,!0,!0)),S=_.getBBox();if(V9(i0().flowchart.htmlLabels)){let v=_.children[0],f=j6(_);S=v.getBoundingClientRect(),f.attr("width",S.width),f.attr("height",S.height)}if(S.width>H)H=S.width;q+=S.height+4,j.push(_)}),q+=8;let T=[];if(Q.classData.methods.forEach(async($)=>{let b=$.getDisplayDetails(),h=b.displayText;if(i0().flowchart.htmlLabels)h=h.replace(/</g,"<").replace(/>/g,">");let _=F.node().appendChild(await rX(h,b.cssStyle?b.cssStyle:Q.labelStyle,!0,!0)),S=_.getBBox();if(V9(i0().flowchart.htmlLabels)){let v=_.children[0],f=j6(_);S=v.getBoundingClientRect(),f.attr("width",S.width),f.attr("height",S.height)}if(S.width>H)H=S.width;q+=S.height+4,T.push(_)}),q+=8,L){let $=(H-R.width)/2;j6(I).attr("transform","translate( "+(-1*H/2+$)+", "+-1*q/2+")"),M=R.height+4}let C=(H-V.width)/2;return j6(E).attr("transform","translate( "+(-1*H/2+C)+", "+(-1*q/2+M)+")"),M+=V.height+4,G.attr("class","divider").attr("x1",-H/2-Z).attr("x2",H/2+Z).attr("y1",-q/2-Z+8+M).attr("y2",-q/2-Z+8+M),M+=8,j.forEach(($)=>{j6($).attr("transform","translate( "+-H/2+", "+(-1*q/2+M+4)+")");let b=$?.getBBox();M+=(b?.height??0)+4}),M+=8,W.attr("class","divider").attr("x1",-H/2-Z).attr("x2",H/2+Z).attr("y1",-q/2-Z+8+M).attr("y2",-q/2-Z+8+M),M+=8,T.forEach(($)=>{j6($).attr("transform","translate( "+-H/2+", "+(-1*q/2+M)+")");let b=$?.getBBox();M+=(b?.height??0)+4}),z.attr("style",Q.style).attr("class","outer title-state").attr("x",-H/2-Z).attr("y",-(q/2)-Z).attr("width",H+Q.padding).attr("height",q+Q.padding),k4(Q,z),Q.intersect=function($){return z4.rect(Q,$)},Y},"class_box"),Ln0={rhombus:Mn0,composite:ki6,question:Mn0,rect:vi6,labelRect:fi6,rectWithTitle:_i6,choice:Di6,circle:xi6,doublecircle:hi6,stadium:bi6,hexagon:wi6,block_arrow:Ei6,rect_left_inv_arrow:ji6,lean_right:Pi6,lean_left:Vi6,trapezoid:Ti6,inv_trapezoid:Ci6,rect_right_inv_arrow:Si6,cylinder:$i6,start:gi6,end:mi6,note:Ni6,subroutine:yi6,fork:On0,join:On0,class_box:ui6},ng={},vn0=w(async(J,Q,Z)=>{let U,K;if(Q.link){let X;if(i0().securityLevel==="sandbox")X="_top";else if(Q.linkTarget)X=Q.linkTarget||"_blank";U=J.insert("svg:a").attr("xlink:href",Q.link).attr("target",X),K=await Ln0[Q.shape](U,Q,Z)}else K=await Ln0[Q.shape](J,Q,Z),U=K;if(Q.tooltip)K.attr("title",Q.tooltip);if(Q.class)K.attr("class","node default "+Q.class);if(ng[Q.id]=U,Q.haveCallback)ng[Q.id].attr("class",ng[Q.id].attr("class")+" clickable");return U},"insertNode"),pi6=w((J)=>{let Q=ng[J.id];B0.trace("Transforming node",J.diff,J,"translate("+(J.x-J.width/2-5)+", "+J.width/2+")");let Z=8,U=J.diff||0;if(J.clusterNode)Q.attr("transform","translate("+(J.x+U-J.width/2)+", "+(J.y-J.height/2-Z)+")");else Q.attr("transform","translate("+J.x+", "+J.y+")");return U},"positionNode");w(YU0,"getNodeFromBlock");w(kn0,"calculateBlockSize");w(fn0,"insertBlockPositioned");w(tg,"performOperations");w(_n0,"calculateBlockSizes");w(bn0,"insertBlocks");w(xn0,"insertEdges");ci6=w(function(J,Q){return Q.db.getClasses()},"getClasses"),li6=w(async function(J,Q,Z,U){let{securityLevel:K,block:X}=CJ(),Y=U.db,z;if(K==="sandbox")z=j6("#i"+Q);let G=K==="sandbox"?j6(z.nodes()[0].contentDocument.body):j6("body"),W=K==="sandbox"?G.select(`[id="${Q}"]`):j6(`[id="${Q}"]`);Qi6(W,["point","circle","cross"],U.type,Q);let q=Y.getBlocks(),F=Y.getBlocksFlat(),M=Y.getEdges(),L=W.insert("g").attr("class","block");await _n0(L,q,Y);let A=En0(Y);if(await bn0(L,q,Y),await xn0(L,M,F,Y,Q),A){let I=A,R=Math.max(1,Math.round(0.125*(I.width/I.height))),N=I.height+R+10,E=I.width+10,{useMaxWidth:V}=X;K7(W,N,E,!!V),B0.debug("Here Bounds",A,I),W.attr("viewBox",`${I.x-5} ${I.y-5} ${I.width+10} ${I.height+10}`)}},"draw"),di6={draw:li6,getClasses:ci6},ii6={parser:wd6,db:ud6,renderer:di6,styles:cd6}});var GU0=F4((MV,zU0)=>{(function J(Q,Z){if(typeof MV==="object"&&typeof zU0==="object")zU0.exports=Z();else if(typeof define==="function"&&define.amd)define([],Z);else if(typeof MV==="object")MV.layoutBase=Z();else Q.layoutBase=Z()})(MV,function(){return function(J){var Q={};function Z(U){if(Q[U])return Q[U].exports;var K=Q[U]={i:U,l:!1,exports:{}};return J[U].call(K.exports,K,K.exports,Z),K.l=!0,K.exports}return Z.m=J,Z.c=Q,Z.i=function(U){return U},Z.d=function(U,K,X){if(!Z.o(U,K))Object.defineProperty(U,K,{configurable:!1,enumerable:!0,get:X})},Z.n=function(U){var K=U&&U.__esModule?function X(){return U.default}:function X(){return U};return Z.d(K,"a",K),K},Z.o=function(U,K){return Object.prototype.hasOwnProperty.call(U,K)},Z.p="",Z(Z.s=28)}([function(J,Q,Z){function U(){}U.QUALITY=1,U.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,U.DEFAULT_INCREMENTAL=!1,U.DEFAULT_ANIMATION_ON_LAYOUT=!0,U.DEFAULT_ANIMATION_DURING_LAYOUT=!1,U.DEFAULT_ANIMATION_PERIOD=50,U.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,U.DEFAULT_GRAPH_MARGIN=15,U.NODE_DIMENSIONS_INCLUDE_LABELS=!1,U.SIMPLE_NODE_SIZE=40,U.SIMPLE_NODE_HALF_SIZE=U.SIMPLE_NODE_SIZE/2,U.EMPTY_COMPOUND_NODE_SIZE=40,U.MIN_EDGE_LENGTH=1,U.WORLD_BOUNDARY=1e6,U.INITIAL_WORLD_BOUNDARY=U.WORLD_BOUNDARY/1000,U.WORLD_CENTER_X=1200,U.WORLD_CENTER_Y=900,J.exports=U},function(J,Q,Z){var U=Z(2),K=Z(8),X=Z(9);function Y(G,W,H){U.call(this,H),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=H,this.bendpoints=[],this.source=G,this.target=W}Y.prototype=Object.create(U.prototype);for(var z in U)Y[z]=U[z];Y.prototype.getSource=function(){return this.source},Y.prototype.getTarget=function(){return this.target},Y.prototype.isInterGraph=function(){return this.isInterGraph},Y.prototype.getLength=function(){return this.length},Y.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},Y.prototype.getBendpoints=function(){return this.bendpoints},Y.prototype.getLca=function(){return this.lca},Y.prototype.getSourceInLca=function(){return this.sourceInLca},Y.prototype.getTargetInLca=function(){return this.targetInLca},Y.prototype.getOtherEnd=function(G){if(this.source===G)return this.target;else if(this.target===G)return this.source;else throw"Node is not incident with this edge"},Y.prototype.getOtherEndInGraph=function(G,W){var H=this.getOtherEnd(G),q=W.getGraphManager().getRoot();while(!0){if(H.getOwner()==W)return H;if(H.getOwner()==q)break;H=H.getOwner().getParent()}return null},Y.prototype.updateLength=function(){var G=new Array(4);if(this.isOverlapingSourceAndTarget=K.getIntersection(this.target.getRect(),this.source.getRect(),G),!this.isOverlapingSourceAndTarget){if(this.lengthX=G[0]-G[2],this.lengthY=G[1]-G[3],Math.abs(this.lengthX)<1)this.lengthX=X.sign(this.lengthX);if(Math.abs(this.lengthY)<1)this.lengthY=X.sign(this.lengthY);this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)}},Y.prototype.updateLengthSimple=function(){if(this.lengthX=this.target.getCenterX()-this.source.getCenterX(),this.lengthY=this.target.getCenterY()-this.source.getCenterY(),Math.abs(this.lengthX)<1)this.lengthX=X.sign(this.lengthX);if(Math.abs(this.lengthY)<1)this.lengthY=X.sign(this.lengthY);this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},J.exports=Y},function(J,Q,Z){function U(K){this.vGraphObject=K}J.exports=U},function(J,Q,Z){var U=Z(2),K=Z(10),X=Z(13),Y=Z(0),z=Z(16),G=Z(5);function W(q,F,M,L){if(M==null&&L==null)L=F;if(U.call(this,L),q.graphManager!=null)q=q.graphManager;if(this.estimatedSize=K.MIN_VALUE,this.inclusionTreeDepth=K.MAX_VALUE,this.vGraphObject=L,this.edges=[],this.graphManager=q,M!=null&&F!=null)this.rect=new X(F.x,F.y,M.width,M.height);else this.rect=new X}W.prototype=Object.create(U.prototype);for(var H in U)W[H]=U[H];W.prototype.getEdges=function(){return this.edges},W.prototype.getChild=function(){return this.child},W.prototype.getOwner=function(){return this.owner},W.prototype.getWidth=function(){return this.rect.width},W.prototype.setWidth=function(q){this.rect.width=q},W.prototype.getHeight=function(){return this.rect.height},W.prototype.setHeight=function(q){this.rect.height=q},W.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},W.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},W.prototype.getCenter=function(){return new G(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},W.prototype.getLocation=function(){return new G(this.rect.x,this.rect.y)},W.prototype.getRect=function(){return this.rect},W.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},W.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},W.prototype.setRect=function(q,F){this.rect.x=q.x,this.rect.y=q.y,this.rect.width=F.width,this.rect.height=F.height},W.prototype.setCenter=function(q,F){this.rect.x=q-this.rect.width/2,this.rect.y=F-this.rect.height/2},W.prototype.setLocation=function(q,F){this.rect.x=q,this.rect.y=F},W.prototype.moveBy=function(q,F){this.rect.x+=q,this.rect.y+=F},W.prototype.getEdgeListToNode=function(q){var F=[],M,L=this;return L.edges.forEach(function(A){if(A.target==q){if(A.source!=L)throw"Incorrect edge source!";F.push(A)}}),F},W.prototype.getEdgesBetween=function(q){var F=[],M,L=this;return L.edges.forEach(function(A){if(!(A.source==L||A.target==L))throw"Incorrect edge source and/or target";if(A.target==q||A.source==q)F.push(A)}),F},W.prototype.getNeighborsList=function(){var q=new Set,F=this;return F.edges.forEach(function(M){if(M.source==F)q.add(M.target);else{if(M.target!=F)throw"Incorrect incidency!";q.add(M.source)}}),q},W.prototype.withChildren=function(){var q=new Set,F,M;if(q.add(this),this.child!=null){var L=this.child.getNodes();for(var A=0;A<L.length;A++)F=L[A],M=F.withChildren(),M.forEach(function(I){q.add(I)})}return q},W.prototype.getNoOfChildren=function(){var q=0,F;if(this.child==null)q=1;else{var M=this.child.getNodes();for(var L=0;L<M.length;L++)F=M[L],q+=F.getNoOfChildren()}if(q==0)q=1;return q},W.prototype.getEstimatedSize=function(){if(this.estimatedSize==K.MIN_VALUE)throw"assert failed";return this.estimatedSize},W.prototype.calcEstimatedSize=function(){if(this.child==null)return this.estimatedSize=(this.rect.width+this.rect.height)/2;else return this.estimatedSize=this.child.calcEstimatedSize(),this.rect.width=this.estimatedSize,this.rect.height=this.estimatedSize,this.estimatedSize},W.prototype.scatter=function(){var q,F,M=-Y.INITIAL_WORLD_BOUNDARY,L=Y.INITIAL_WORLD_BOUNDARY;q=Y.WORLD_CENTER_X+z.nextDouble()*(L-M)+M;var A=-Y.INITIAL_WORLD_BOUNDARY,I=Y.INITIAL_WORLD_BOUNDARY;F=Y.WORLD_CENTER_Y+z.nextDouble()*(I-A)+A,this.rect.x=q,this.rect.y=F},W.prototype.updateBounds=function(){if(this.getChild()==null)throw"assert failed";if(this.getChild().getNodes().length!=0){var q=this.getChild();if(q.updateBounds(!0),this.rect.x=q.getLeft(),this.rect.y=q.getTop(),this.setWidth(q.getRight()-q.getLeft()),this.setHeight(q.getBottom()-q.getTop()),Y.NODE_DIMENSIONS_INCLUDE_LABELS){var F=q.getRight()-q.getLeft(),M=q.getBottom()-q.getTop();if(this.labelWidth){if(this.labelPosHorizontal=="left")this.rect.x-=this.labelWidth,this.setWidth(F+this.labelWidth);else if(this.labelPosHorizontal=="center"&&this.labelWidth>F)this.rect.x-=(this.labelWidth-F)/2,this.setWidth(this.labelWidth);else if(this.labelPosHorizontal=="right")this.setWidth(F+this.labelWidth)}if(this.labelHeight){if(this.labelPosVertical=="top")this.rect.y-=this.labelHeight,this.setHeight(M+this.labelHeight);else if(this.labelPosVertical=="center"&&this.labelHeight>M)this.rect.y-=(this.labelHeight-M)/2,this.setHeight(this.labelHeight);else if(this.labelPosVertical=="bottom")this.setHeight(M+this.labelHeight)}}}},W.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==K.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},W.prototype.transform=function(q){var F=this.rect.x;if(F>Y.WORLD_BOUNDARY)F=Y.WORLD_BOUNDARY;else if(F<-Y.WORLD_BOUNDARY)F=-Y.WORLD_BOUNDARY;var M=this.rect.y;if(M>Y.WORLD_BOUNDARY)M=Y.WORLD_BOUNDARY;else if(M<-Y.WORLD_BOUNDARY)M=-Y.WORLD_BOUNDARY;var L=new G(F,M),A=q.inverseTransformPoint(L);this.setLocation(A.x,A.y)},W.prototype.getLeft=function(){return this.rect.x},W.prototype.getRight=function(){return this.rect.x+this.rect.width},W.prototype.getTop=function(){return this.rect.y},W.prototype.getBottom=function(){return this.rect.y+this.rect.height},W.prototype.getParent=function(){if(this.owner==null)return null;return this.owner.getParent()},J.exports=W},function(J,Q,Z){var U=Z(0);function K(){}for(var X in U)K[X]=U[X];K.MAX_ITERATIONS=2500,K.DEFAULT_EDGE_LENGTH=50,K.DEFAULT_SPRING_STRENGTH=0.45,K.DEFAULT_REPULSION_STRENGTH=4500,K.DEFAULT_GRAVITY_STRENGTH=0.4,K.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,K.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,K.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,K.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=!0,K.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=!0,K.DEFAULT_COOLING_FACTOR_INCREMENTAL=0.3,K.COOLING_ADAPTATION_FACTOR=0.33,K.ADAPTATION_LOWER_NODE_LIMIT=1000,K.ADAPTATION_UPPER_NODE_LIMIT=5000,K.MAX_NODE_DISPLACEMENT_INCREMENTAL=100,K.MAX_NODE_DISPLACEMENT=K.MAX_NODE_DISPLACEMENT_INCREMENTAL*3,K.MIN_REPULSION_DIST=K.DEFAULT_EDGE_LENGTH/10,K.CONVERGENCE_CHECK_PERIOD=100,K.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=0.1,K.MIN_EDGE_LENGTH=1,K.GRID_CALCULATION_CHECK_PERIOD=10,J.exports=K},function(J,Q,Z){function U(K,X){if(K==null&&X==null)this.x=0,this.y=0;else this.x=K,this.y=X}U.prototype.getX=function(){return this.x},U.prototype.getY=function(){return this.y},U.prototype.setX=function(K){this.x=K},U.prototype.setY=function(K){this.y=K},U.prototype.getDifference=function(K){return new DimensionD(this.x-K.x,this.y-K.y)},U.prototype.getCopy=function(){return new U(this.x,this.y)},U.prototype.translate=function(K){return this.x+=K.width,this.y+=K.height,this},J.exports=U},function(J,Q,Z){var U=Z(2),K=Z(10),X=Z(0),Y=Z(7),z=Z(3),G=Z(1),W=Z(13),H=Z(12),q=Z(11);function F(L,A,I){if(U.call(this,I),this.estimatedSize=K.MIN_VALUE,this.margin=X.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=L,A!=null&&A instanceof Y)this.graphManager=A;else if(A!=null&&A instanceof Layout)this.graphManager=A.graphManager}F.prototype=Object.create(U.prototype);for(var M in U)F[M]=U[M];F.prototype.getNodes=function(){return this.nodes},F.prototype.getEdges=function(){return this.edges},F.prototype.getGraphManager=function(){return this.graphManager},F.prototype.getParent=function(){return this.parent},F.prototype.getLeft=function(){return this.left},F.prototype.getRight=function(){return this.right},F.prototype.getTop=function(){return this.top},F.prototype.getBottom=function(){return this.bottom},F.prototype.isConnected=function(){return this.isConnected},F.prototype.add=function(L,A,I){if(A==null&&I==null){var R=L;if(this.graphManager==null)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(R)>-1)throw"Node already in graph!";return R.owner=this,this.getNodes().push(R),R}else{var N=L;if(!(this.getNodes().indexOf(A)>-1&&this.getNodes().indexOf(I)>-1))throw"Source or target not in graph!";if(!(A.owner==I.owner&&A.owner==this))throw"Both owners must be this graph!";if(A.owner!=I.owner)return null;if(N.source=A,N.target=I,N.isInterGraph=!1,this.getEdges().push(N),A.edges.push(N),I!=A)I.edges.push(N);return N}},F.prototype.remove=function(L){var A=L;if(L instanceof z){if(A==null)throw"Node is null!";if(!(A.owner!=null&&A.owner==this))throw"Owner graph is invalid!";if(this.graphManager==null)throw"Owner graph manager is invalid!";var I=A.edges.slice(),R,N=I.length;for(var E=0;E<N;E++)if(R=I[E],R.isInterGraph)this.graphManager.remove(R);else R.source.owner.remove(R);var V=this.nodes.indexOf(A);if(V==-1)throw"Node not in owner node list!";this.nodes.splice(V,1)}else if(L instanceof G){var R=L;if(R==null)throw"Edge is null!";if(!(R.source!=null&&R.target!=null))throw"Source and/or target is null!";if(!(R.source.owner!=null&&R.target.owner!=null&&R.source.owner==this&&R.target.owner==this))throw"Source and/or target owner is invalid!";var j=R.source.edges.indexOf(R),T=R.target.edges.indexOf(R);if(!(j>-1&&T>-1))throw"Source and/or target doesn't know this edge!";if(R.source.edges.splice(j,1),R.target!=R.source)R.target.edges.splice(T,1);var V=R.source.owner.getEdges().indexOf(R);if(V==-1)throw"Not in owner's edge list!";R.source.owner.getEdges().splice(V,1)}},F.prototype.updateLeftTop=function(){var{MAX_VALUE:L,MAX_VALUE:A}=K,I,R,N,E=this.getNodes(),V=E.length;for(var j=0;j<V;j++){var T=E[j];if(I=T.getTop(),R=T.getLeft(),L>I)L=I;if(A>R)A=R}if(L==K.MAX_VALUE)return null;if(E[0].getParent().paddingLeft!=null)N=E[0].getParent().paddingLeft;else N=this.margin;return this.left=A-N,this.top=L-N,new H(this.left,this.top)},F.prototype.updateBounds=function(L){var A=K.MAX_VALUE,I=-K.MAX_VALUE,R=K.MAX_VALUE,N=-K.MAX_VALUE,E,V,j,T,C,$=this.nodes,b=$.length;for(var h=0;h<b;h++){var _=$[h];if(L&&_.child!=null)_.updateBounds();if(E=_.getLeft(),V=_.getRight(),j=_.getTop(),T=_.getBottom(),A>E)A=E;if(I<V)I=V;if(R>j)R=j;if(N<T)N=T}var S=new W(A,R,I-A,N-R);if(A==K.MAX_VALUE)this.left=this.parent.getLeft(),this.right=this.parent.getRight(),this.top=this.parent.getTop(),this.bottom=this.parent.getBottom();if($[0].getParent().paddingLeft!=null)C=$[0].getParent().paddingLeft;else C=this.margin;this.left=S.x-C,this.right=S.x+S.width+C,this.top=S.y-C,this.bottom=S.y+S.height+C},F.calculateBounds=function(L){var A=K.MAX_VALUE,I=-K.MAX_VALUE,R=K.MAX_VALUE,N=-K.MAX_VALUE,E,V,j,T,C=L.length;for(var $=0;$<C;$++){var b=L[$];if(E=b.getLeft(),V=b.getRight(),j=b.getTop(),T=b.getBottom(),A>E)A=E;if(I<V)I=V;if(R>j)R=j;if(N<T)N=T}var h=new W(A,R,I-A,N-R);return h},F.prototype.getInclusionTreeDepth=function(){if(this==this.graphManager.getRoot())return 1;else return this.parent.getInclusionTreeDepth()},F.prototype.getEstimatedSize=function(){if(this.estimatedSize==K.MIN_VALUE)throw"assert failed";return this.estimatedSize},F.prototype.calcEstimatedSize=function(){var L=0,A=this.nodes,I=A.length;for(var R=0;R<I;R++){var N=A[R];L+=N.calcEstimatedSize()}if(L==0)this.estimatedSize=X.EMPTY_COMPOUND_NODE_SIZE;else this.estimatedSize=L/Math.sqrt(this.nodes.length);return this.estimatedSize},F.prototype.updateConnected=function(){var L=this;if(this.nodes.length==0){this.isConnected=!0;return}var A=new q,I=new Set,R=this.nodes[0],N,E,V=R.withChildren();V.forEach(function(h){A.push(h),I.add(h)});while(A.length!==0){R=A.shift(),N=R.getEdges();var j=N.length;for(var T=0;T<j;T++){var C=N[T];if(E=C.getOtherEndInGraph(R,this),E!=null&&!I.has(E)){var $=E.withChildren();$.forEach(function(h){A.push(h),I.add(h)})}}}if(this.isConnected=!1,I.size>=this.nodes.length){var b=0;if(I.forEach(function(h){if(h.owner==L)b++}),b==this.nodes.length)this.isConnected=!0}},J.exports=F},function(J,Q,Z){var U,K=Z(1);function X(Y){U=Z(6),this.layout=Y,this.graphs=[],this.edges=[]}X.prototype.addRoot=function(){var Y=this.layout.newGraph(),z=this.layout.newNode(null),G=this.add(Y,z);return this.setRootGraph(G),this.rootGraph},X.prototype.add=function(Y,z,G,W,H){if(G==null&&W==null&&H==null){if(Y==null)throw"Graph is null!";if(z==null)throw"Parent node is null!";if(this.graphs.indexOf(Y)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(Y),Y.parent!=null)throw"Already has a parent!";if(z.child!=null)throw"Already has a child!";return Y.parent=z,z.child=Y,Y}else{H=G,W=z,G=Y;var q=W.getOwner(),F=H.getOwner();if(!(q!=null&&q.getGraphManager()==this))throw"Source not in this graph mgr!";if(!(F!=null&&F.getGraphManager()==this))throw"Target not in this graph mgr!";if(q==F)return G.isInterGraph=!1,q.add(G,W,H);else{if(G.isInterGraph=!0,G.source=W,G.target=H,this.edges.indexOf(G)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(G),!(G.source!=null&&G.target!=null))throw"Edge source and/or target is null!";if(!(G.source.edges.indexOf(G)==-1&&G.target.edges.indexOf(G)==-1))throw"Edge already in source and/or target incidency list!";return G.source.edges.push(G),G.target.edges.push(G),G}}},X.prototype.remove=function(Y){if(Y instanceof U){var z=Y;if(z.getGraphManager()!=this)throw"Graph not in this graph mgr";if(!(z==this.rootGraph||z.parent!=null&&z.parent.graphManager==this))throw"Invalid parent node!";var G=[];G=G.concat(z.getEdges());var W,H=G.length;for(var q=0;q<H;q++)W=G[q],z.remove(W);var F=[];F=F.concat(z.getNodes());var M;H=F.length;for(var q=0;q<H;q++)M=F[q],z.remove(M);if(z==this.rootGraph)this.setRootGraph(null);var L=this.graphs.indexOf(z);this.graphs.splice(L,1),z.parent=null}else if(Y instanceof K){if(W=Y,W==null)throw"Edge is null!";if(!W.isInterGraph)throw"Not an inter-graph edge!";if(!(W.source!=null&&W.target!=null))throw"Source and/or target is null!";if(!(W.source.edges.indexOf(W)!=-1&&W.target.edges.indexOf(W)!=-1))throw"Source and/or target doesn't know this edge!";var L=W.source.edges.indexOf(W);if(W.source.edges.splice(L,1),L=W.target.edges.indexOf(W),W.target.edges.splice(L,1),!(W.source.owner!=null&&W.source.owner.getGraphManager()!=null))throw"Edge owner graph or owner graph manager is null!";if(W.source.owner.getGraphManager().edges.indexOf(W)==-1)throw"Not in owner graph manager's edge list!";var L=W.source.owner.getGraphManager().edges.indexOf(W);W.source.owner.getGraphManager().edges.splice(L,1)}},X.prototype.updateBounds=function(){this.rootGraph.updateBounds(!0)},X.prototype.getGraphs=function(){return this.graphs},X.prototype.getAllNodes=function(){if(this.allNodes==null){var Y=[],z=this.getGraphs(),G=z.length;for(var W=0;W<G;W++)Y=Y.concat(z[W].getNodes());this.allNodes=Y}return this.allNodes},X.prototype.resetAllNodes=function(){this.allNodes=null},X.prototype.resetAllEdges=function(){this.allEdges=null},X.prototype.resetAllNodesToApplyGravitation=function(){this.allNodesToApplyGravitation=null},X.prototype.getAllEdges=function(){if(this.allEdges==null){var Y=[],z=this.getGraphs(),G=z.length;for(var W=0;W<z.length;W++)Y=Y.concat(z[W].getEdges());Y=Y.concat(this.edges),this.allEdges=Y}return this.allEdges},X.prototype.getAllNodesToApplyGravitation=function(){return this.allNodesToApplyGravitation},X.prototype.setAllNodesToApplyGravitation=function(Y){if(this.allNodesToApplyGravitation!=null)throw"assert failed";this.allNodesToApplyGravitation=Y},X.prototype.getRoot=function(){return this.rootGraph},X.prototype.setRootGraph=function(Y){if(Y.getGraphManager()!=this)throw"Root not in this graph mgr!";if(this.rootGraph=Y,Y.parent==null)Y.parent=this.layout.newNode("Root node")},X.prototype.getLayout=function(){return this.layout},X.prototype.isOneAncestorOfOther=function(Y,z){if(!(Y!=null&&z!=null))throw"assert failed";if(Y==z)return!0;var G=Y.getOwner(),W;do{if(W=G.getParent(),W==null)break;if(W==z)return!0;if(G=W.getOwner(),G==null)break}while(!0);G=z.getOwner();do{if(W=G.getParent(),W==null)break;if(W==Y)return!0;if(G=W.getOwner(),G==null)break}while(!0);return!1},X.prototype.calcLowestCommonAncestors=function(){var Y,z,G,W,H,q=this.getAllEdges(),F=q.length;for(var M=0;M<F;M++){if(Y=q[M],z=Y.source,G=Y.target,Y.lca=null,Y.sourceInLca=z,Y.targetInLca=G,z==G){Y.lca=z.getOwner();continue}W=z.getOwner();while(Y.lca==null){Y.targetInLca=G,H=G.getOwner();while(Y.lca==null){if(H==W){Y.lca=H;break}if(H==this.rootGraph)break;if(Y.lca!=null)throw"assert failed";Y.targetInLca=H.getParent(),H=Y.targetInLca.getOwner()}if(W==this.rootGraph)break;if(Y.lca==null)Y.sourceInLca=W.getParent(),W=Y.sourceInLca.getOwner()}if(Y.lca==null)throw"assert failed"}},X.prototype.calcLowestCommonAncestor=function(Y,z){if(Y==z)return Y.getOwner();var G=Y.getOwner();do{if(G==null)break;var W=z.getOwner();do{if(W==null)break;if(W==G)return W;W=W.getParent().getOwner()}while(!0);G=G.getParent().getOwner()}while(!0);return G},X.prototype.calcInclusionTreeDepths=function(Y,z){if(Y==null&&z==null)Y=this.rootGraph,z=1;var G,W=Y.getNodes(),H=W.length;for(var q=0;q<H;q++)if(G=W[q],G.inclusionTreeDepth=z,G.child!=null)this.calcInclusionTreeDepths(G.child,z+1)},X.prototype.includesInvalidEdge=function(){var Y,z=[],G=this.edges.length;for(var W=0;W<G;W++)if(Y=this.edges[W],this.isOneAncestorOfOther(Y.source,Y.target))z.push(Y);for(var W=0;W<z.length;W++)this.remove(z[W]);return!1},J.exports=X},function(J,Q,Z){var U=Z(12);function K(){}K.calcSeparationAmount=function(X,Y,z,G){if(!X.intersects(Y))throw"assert failed";var W=new Array(2);if(this.decideDirectionsForOverlappingNodes(X,Y,W),z[0]=Math.min(X.getRight(),Y.getRight())-Math.max(X.x,Y.x),z[1]=Math.min(X.getBottom(),Y.getBottom())-Math.max(X.y,Y.y),X.getX()<=Y.getX()&&X.getRight()>=Y.getRight())z[0]+=Math.min(Y.getX()-X.getX(),X.getRight()-Y.getRight());else if(Y.getX()<=X.getX()&&Y.getRight()>=X.getRight())z[0]+=Math.min(X.getX()-Y.getX(),Y.getRight()-X.getRight());if(X.getY()<=Y.getY()&&X.getBottom()>=Y.getBottom())z[1]+=Math.min(Y.getY()-X.getY(),X.getBottom()-Y.getBottom());else if(Y.getY()<=X.getY()&&Y.getBottom()>=X.getBottom())z[1]+=Math.min(X.getY()-Y.getY(),Y.getBottom()-X.getBottom());var H=Math.abs((Y.getCenterY()-X.getCenterY())/(Y.getCenterX()-X.getCenterX()));if(Y.getCenterY()===X.getCenterY()&&Y.getCenterX()===X.getCenterX())H=1;var q=H*z[0],F=z[1]/H;if(z[0]<F)F=z[0];else q=z[1];z[0]=-1*W[0]*(F/2+G),z[1]=-1*W[1]*(q/2+G)},K.decideDirectionsForOverlappingNodes=function(X,Y,z){if(X.getCenterX()<Y.getCenterX())z[0]=-1;else z[0]=1;if(X.getCenterY()<Y.getCenterY())z[1]=-1;else z[1]=1},K.getIntersection2=function(X,Y,z){var G=X.getCenterX(),W=X.getCenterY(),H=Y.getCenterX(),q=Y.getCenterY();if(X.intersects(Y))return z[0]=G,z[1]=W,z[2]=H,z[3]=q,!0;var F=X.getX(),M=X.getY(),L=X.getRight(),A=X.getX(),I=X.getBottom(),R=X.getRight(),N=X.getWidthHalf(),E=X.getHeightHalf(),V=Y.getX(),j=Y.getY(),T=Y.getRight(),C=Y.getX(),$=Y.getBottom(),b=Y.getRight(),h=Y.getWidthHalf(),_=Y.getHeightHalf(),S=!1,v=!1;if(G===H){if(W>q)return z[0]=G,z[1]=M,z[2]=H,z[3]=$,!1;else if(W<q)return z[0]=G,z[1]=I,z[2]=H,z[3]=j,!1}else if(W===q){if(G>H)return z[0]=F,z[1]=W,z[2]=T,z[3]=q,!1;else if(G<H)return z[0]=L,z[1]=W,z[2]=V,z[3]=q,!1}else{var f=X.height/X.width,x=Y.height/Y.width,y=(q-W)/(H-G),m=void 0,g=void 0,p=void 0,i=void 0,l=void 0,a=void 0;if(-f===y)if(G>H)z[0]=A,z[1]=I,S=!0;else z[0]=L,z[1]=M,S=!0;else if(f===y)if(G>H)z[0]=F,z[1]=M,S=!0;else z[0]=R,z[1]=I,S=!0;if(-x===y)if(H>G)z[2]=C,z[3]=$,v=!0;else z[2]=T,z[3]=j,v=!0;else if(x===y)if(H>G)z[2]=V,z[3]=j,v=!0;else z[2]=b,z[3]=$,v=!0;if(S&&v)return!1;if(G>H)if(W>q)m=this.getCardinalDirection(f,y,4),g=this.getCardinalDirection(x,y,2);else m=this.getCardinalDirection(-f,y,3),g=this.getCardinalDirection(-x,y,1);else if(W>q)m=this.getCardinalDirection(-f,y,1),g=this.getCardinalDirection(-x,y,3);else m=this.getCardinalDirection(f,y,2),g=this.getCardinalDirection(x,y,4);if(!S)switch(m){case 1:i=M,p=G+-E/y,z[0]=p,z[1]=i;break;case 2:p=R,i=W+N*y,z[0]=p,z[1]=i;break;case 3:i=I,p=G+E/y,z[0]=p,z[1]=i;break;case 4:p=A,i=W+-N*y,z[0]=p,z[1]=i;break}if(!v)switch(g){case 1:a=j,l=H+-_/y,z[2]=l,z[3]=a;break;case 2:l=b,a=q+h*y,z[2]=l,z[3]=a;break;case 3:a=$,l=H+_/y,z[2]=l,z[3]=a;break;case 4:l=C,a=q+-h*y,z[2]=l,z[3]=a;break}}return!1},K.getCardinalDirection=function(X,Y,z){if(X>Y)return z;else return 1+z%4},K.getIntersection=function(X,Y,z,G){if(G==null)return this.getIntersection2(X,Y,z);var{x:W,y:H}=X,q=Y.x,F=Y.y,M=z.x,L=z.y,A=G.x,I=G.y,R=void 0,N=void 0,E=void 0,V=void 0,j=void 0,T=void 0,C=void 0,$=void 0,b=void 0;if(E=F-H,j=W-q,C=q*H-W*F,V=I-L,T=M-A,$=A*L-M*I,b=E*T-V*j,b===0)return null;return R=(j*$-T*C)/b,N=(V*C-E*$)/b,new U(R,N)},K.angleOfVector=function(X,Y,z,G){var W=void 0;if(X!==z){if(W=Math.atan((G-Y)/(z-X)),z<X)W+=Math.PI;else if(G<Y)W+=this.TWO_PI}else if(G<Y)W=this.ONE_AND_HALF_PI;else W=this.HALF_PI;return W},K.doIntersect=function(X,Y,z,G){var{x:W,y:H}=X,q=Y.x,F=Y.y,M=z.x,L=z.y,A=G.x,I=G.y,R=(q-W)*(I-L)-(A-M)*(F-H);if(R===0)return!1;else{var N=((I-L)*(A-W)+(M-A)*(I-H))/R,E=((H-F)*(A-W)+(q-W)*(I-H))/R;return 0<N&&N<1&&0<E&&E<1}},K.findCircleLineIntersections=function(X,Y,z,G,W,H,q){var F=(z-X)*(z-X)+(G-Y)*(G-Y),M=2*((X-W)*(z-X)+(Y-H)*(G-Y)),L=(X-W)*(X-W)+(Y-H)*(Y-H)-q*q,A=M*M-4*F*L;if(A>=0){var I=(-M+Math.sqrt(M*M-4*F*L))/(2*F),R=(-M-Math.sqrt(M*M-4*F*L))/(2*F),N=null;if(I>=0&&I<=1)return[I];if(R>=0&&R<=1)return[R];return N}else return null},K.HALF_PI=0.5*Math.PI,K.ONE_AND_HALF_PI=1.5*Math.PI,K.TWO_PI=2*Math.PI,K.THREE_PI=3*Math.PI,J.exports=K},function(J,Q,Z){function U(){}U.sign=function(K){if(K>0)return 1;else if(K<0)return-1;else return 0},U.floor=function(K){return K<0?Math.ceil(K):Math.floor(K)},U.ceil=function(K){return K<0?Math.floor(K):Math.ceil(K)},J.exports=U},function(J,Q,Z){function U(){}U.MAX_VALUE=2147483647,U.MIN_VALUE=-2147483648,J.exports=U},function(J,Q,Z){var U=function(){function W(H,q){for(var F=0;F<q.length;F++){var M=q[F];if(M.enumerable=M.enumerable||!1,M.configurable=!0,"value"in M)M.writable=!0;Object.defineProperty(H,M.key,M)}}return function(H,q,F){if(q)W(H.prototype,q);if(F)W(H,F);return H}}();function K(W,H){if(!(W instanceof H))throw new TypeError("Cannot call a class as a function")}var X=function W(H){return{value:H,next:null,prev:null}},Y=function W(H,q,F,M){if(H!==null)H.next=q;else M.head=q;if(F!==null)F.prev=q;else M.tail=q;return q.prev=H,q.next=F,M.length++,q},z=function W(H,q){var{prev:F,next:M}=H;if(F!==null)F.next=M;else q.head=M;if(M!==null)M.prev=F;else q.tail=F;return H.prev=H.next=null,q.length--,H},G=function(){function W(H){var q=this;if(K(this,W),this.length=0,this.head=null,this.tail=null,H!=null)H.forEach(function(F){return q.push(F)})}return U(W,[{key:"size",value:function H(){return this.length}},{key:"insertBefore",value:function H(q,F){return Y(F.prev,X(q),F,this)}},{key:"insertAfter",value:function H(q,F){return Y(F,X(q),F.next,this)}},{key:"insertNodeBefore",value:function H(q,F){return Y(F.prev,q,F,this)}},{key:"insertNodeAfter",value:function H(q,F){return Y(F,q,F.next,this)}},{key:"push",value:function H(q){return Y(this.tail,X(q),null,this)}},{key:"unshift",value:function H(q){return Y(null,X(q),this.head,this)}},{key:"remove",value:function H(q){return z(q,this)}},{key:"pop",value:function H(){return z(this.tail,this).value}},{key:"popNode",value:function H(){return z(this.tail,this)}},{key:"shift",value:function H(){return z(this.head,this).value}},{key:"shiftNode",value:function H(){return z(this.head,this)}},{key:"get_object_at",value:function H(q){if(q<=this.length()){var F=1,M=this.head;while(F<q)M=M.next,F++;return M.value}}},{key:"set_object_at",value:function H(q,F){if(q<=this.length()){var M=1,L=this.head;while(M<q)L=L.next,M++;L.value=F}}}]),W}();J.exports=G},function(J,Q,Z){function U(K,X,Y){if(this.x=null,this.y=null,K==null&&X==null&&Y==null)this.x=0,this.y=0;else if(typeof K=="number"&&typeof X=="number"&&Y==null)this.x=K,this.y=X;else if(K.constructor.name=="Point"&&X==null&&Y==null)Y=K,this.x=Y.x,this.y=Y.y}U.prototype.getX=function(){return this.x},U.prototype.getY=function(){return this.y},U.prototype.getLocation=function(){return new U(this.x,this.y)},U.prototype.setLocation=function(K,X,Y){if(K.constructor.name=="Point"&&X==null&&Y==null)Y=K,this.setLocation(Y.x,Y.y);else if(typeof K=="number"&&typeof X=="number"&&Y==null)if(parseInt(K)==K&&parseInt(X)==X)this.move(K,X);else this.x=Math.floor(K+0.5),this.y=Math.floor(X+0.5)},U.prototype.move=function(K,X){this.x=K,this.y=X},U.prototype.translate=function(K,X){this.x+=K,this.y+=X},U.prototype.equals=function(K){if(K.constructor.name=="Point"){var X=K;return this.x==X.x&&this.y==X.y}return this==K},U.prototype.toString=function(){return new U().constructor.name+"[x="+this.x+",y="+this.y+"]"},J.exports=U},function(J,Q,Z){function U(K,X,Y,z){if(this.x=0,this.y=0,this.width=0,this.height=0,K!=null&&X!=null&&Y!=null&&z!=null)this.x=K,this.y=X,this.width=Y,this.height=z}U.prototype.getX=function(){return this.x},U.prototype.setX=function(K){this.x=K},U.prototype.getY=function(){return this.y},U.prototype.setY=function(K){this.y=K},U.prototype.getWidth=function(){return this.width},U.prototype.setWidth=function(K){this.width=K},U.prototype.getHeight=function(){return this.height},U.prototype.setHeight=function(K){this.height=K},U.prototype.getRight=function(){return this.x+this.width},U.prototype.getBottom=function(){return this.y+this.height},U.prototype.intersects=function(K){if(this.getRight()<K.x)return!1;if(this.getBottom()<K.y)return!1;if(K.getRight()<this.x)return!1;if(K.getBottom()<this.y)return!1;return!0},U.prototype.getCenterX=function(){return this.x+this.width/2},U.prototype.getMinX=function(){return this.getX()},U.prototype.getMaxX=function(){return this.getX()+this.width},U.prototype.getCenterY=function(){return this.y+this.height/2},U.prototype.getMinY=function(){return this.getY()},U.prototype.getMaxY=function(){return this.getY()+this.height},U.prototype.getWidthHalf=function(){return this.width/2},U.prototype.getHeightHalf=function(){return this.height/2},J.exports=U},function(J,Q,Z){var U=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(X){return typeof X}:function(X){return X&&typeof Symbol==="function"&&X.constructor===Symbol&&X!==Symbol.prototype?"symbol":typeof X};function K(){}K.lastID=0,K.createID=function(X){if(K.isPrimitive(X))return X;if(X.uniqueID!=null)return X.uniqueID;return X.uniqueID=K.getString(),K.lastID++,X.uniqueID},K.getString=function(X){if(X==null)X=K.lastID;return"Object#"+X},K.isPrimitive=function(X){var Y=typeof X==="undefined"?"undefined":U(X);return X==null||Y!="object"&&Y!="function"},J.exports=K},function(J,Q,Z){function U(M){if(Array.isArray(M)){for(var L=0,A=Array(M.length);L<M.length;L++)A[L]=M[L];return A}else return Array.from(M)}var K=Z(0),X=Z(7),Y=Z(3),z=Z(1),G=Z(6),W=Z(5),H=Z(17),q=Z(29);function F(M){if(q.call(this),this.layoutQuality=K.QUALITY,this.createBendsAsNeeded=K.DEFAULT_CREATE_BENDS_AS_NEEDED,this.incremental=K.DEFAULT_INCREMENTAL,this.animationOnLayout=K.DEFAULT_ANIMATION_ON_LAYOUT,this.animationDuringLayout=K.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=K.DEFAULT_ANIMATION_PERIOD,this.uniformLeafNodeSizes=K.DEFAULT_UNIFORM_LEAF_NODE_SIZES,this.edgeToDummyNodes=new Map,this.graphManager=new X(this),this.isLayoutFinished=!1,this.isSubLayout=!1,this.isRemoteUse=!1,M!=null)this.isRemoteUse=M}F.RANDOM_SEED=1,F.prototype=Object.create(q.prototype),F.prototype.getGraphManager=function(){return this.graphManager},F.prototype.getAllNodes=function(){return this.graphManager.getAllNodes()},F.prototype.getAllEdges=function(){return this.graphManager.getAllEdges()},F.prototype.getAllNodesToApplyGravitation=function(){return this.graphManager.getAllNodesToApplyGravitation()},F.prototype.newGraphManager=function(){var M=new X(this);return this.graphManager=M,M},F.prototype.newGraph=function(M){return new G(null,this.graphManager,M)},F.prototype.newNode=function(M){return new Y(this.graphManager,M)},F.prototype.newEdge=function(M){return new z(null,null,M)},F.prototype.checkLayoutSuccess=function(){return this.graphManager.getRoot()==null||this.graphManager.getRoot().getNodes().length==0||this.graphManager.includesInvalidEdge()},F.prototype.runLayout=function(){if(this.isLayoutFinished=!1,this.tilingPreLayout)this.tilingPreLayout();this.initParameters();var M;if(this.checkLayoutSuccess())M=!1;else M=this.layout();if(K.ANIMATE==="during")return!1;if(M){if(!this.isSubLayout)this.doPostLayout()}if(this.tilingPostLayout)this.tilingPostLayout();return this.isLayoutFinished=!0,M},F.prototype.doPostLayout=function(){if(!this.incremental)this.transform();this.update()},F.prototype.update2=function(){if(this.createBendsAsNeeded)this.createBendpointsFromDummyNodes(),this.graphManager.resetAllEdges();if(!this.isRemoteUse){var M,L=this.graphManager.getAllEdges();for(var A=0;A<L.length;A++)M=L[A];var I,R=this.graphManager.getRoot().getNodes();for(var A=0;A<R.length;A++)I=R[A];this.update(this.graphManager.getRoot())}},F.prototype.update=function(M){if(M==null)this.update2();else if(M instanceof Y){var L=M;if(L.getChild()!=null){var A=L.getChild().getNodes();for(var I=0;I<A.length;I++)update(A[I])}if(L.vGraphObject!=null){var R=L.vGraphObject;R.update(L)}}else if(M instanceof z){var N=M;if(N.vGraphObject!=null){var E=N.vGraphObject;E.update(N)}}else if(M instanceof G){var V=M;if(V.vGraphObject!=null){var j=V.vGraphObject;j.update(V)}}},F.prototype.initParameters=function(){if(!this.isSubLayout)this.layoutQuality=K.QUALITY,this.animationDuringLayout=K.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=K.DEFAULT_ANIMATION_PERIOD,this.animationOnLayout=K.DEFAULT_ANIMATION_ON_LAYOUT,this.incremental=K.DEFAULT_INCREMENTAL,this.createBendsAsNeeded=K.DEFAULT_CREATE_BENDS_AS_NEEDED,this.uniformLeafNodeSizes=K.DEFAULT_UNIFORM_LEAF_NODE_SIZES;if(this.animationDuringLayout)this.animationOnLayout=!1},F.prototype.transform=function(M){if(M==null)this.transform(new W(0,0));else{var L=new H,A=this.graphManager.getRoot().updateLeftTop();if(A!=null){L.setWorldOrgX(M.x),L.setWorldOrgY(M.y),L.setDeviceOrgX(A.x),L.setDeviceOrgY(A.y);var I=this.getAllNodes(),R;for(var N=0;N<I.length;N++)R=I[N],R.transform(L)}}},F.prototype.positionNodesRandomly=function(M){if(M==null)this.positionNodesRandomly(this.getGraphManager().getRoot()),this.getGraphManager().getRoot().updateBounds(!0);else{var L,A,I=M.getNodes();for(var R=0;R<I.length;R++)if(L=I[R],A=L.getChild(),A==null)L.scatter();else if(A.getNodes().length==0)L.scatter();else this.positionNodesRandomly(A),L.updateBounds()}},F.prototype.getFlatForest=function(){var M=[],L=!0,A=this.graphManager.getRoot().getNodes(),I=!0;for(var R=0;R<A.length;R++)if(A[R].getChild()!=null)I=!1;if(!I)return M;var N=new Set,E=[],V=new Map,j=[];j=j.concat(A);while(j.length>0&&L){E.push(j[0]);while(E.length>0&&L){var T=E[0];E.splice(0,1),N.add(T);var C=T.getEdges();for(var R=0;R<C.length;R++){var $=C[R].getOtherEnd(T);if(V.get(T)!=$)if(!N.has($))E.push($),V.set($,T);else{L=!1;break}}}if(!L)M=[];else{var b=[].concat(U(N));M.push(b);for(var R=0;R<b.length;R++){var h=b[R],_=j.indexOf(h);if(_>-1)j.splice(_,1)}N=new Set,V=new Map}}return M},F.prototype.createDummyNodesForBendpoints=function(M){var L=[],A=M.source,I=this.graphManager.calcLowestCommonAncestor(M.source,M.target);for(var R=0;R<M.bendpoints.length;R++){var N=this.newNode(null);N.setRect(new Point(0,0),new Dimension(1,1)),I.add(N);var E=this.newEdge(null);this.graphManager.add(E,A,N),L.add(N),A=N}var E=this.newEdge(null);if(this.graphManager.add(E,A,M.target),this.edgeToDummyNodes.set(M,L),M.isInterGraph())this.graphManager.remove(M);else I.remove(M);return L},F.prototype.createBendpointsFromDummyNodes=function(){var M=[];M=M.concat(this.graphManager.getAllEdges()),M=[].concat(U(this.edgeToDummyNodes.keys())).concat(M);for(var L=0;L<M.length;L++){var A=M[L];if(A.bendpoints.length>0){var I=this.edgeToDummyNodes.get(A);for(var R=0;R<I.length;R++){var N=I[R],E=new W(N.getCenterX(),N.getCenterY()),V=A.bendpoints.get(R);V.x=E.x,V.y=E.y,N.getOwner().remove(N)}this.graphManager.add(A,A.source,A.target)}}},F.transform=function(M,L,A,I){if(A!=null&&I!=null){var R=L;if(M<=50){var N=L/A;R-=(L-N)/50*(50-M)}else{var E=L*I;R+=(E-L)/50*(M-50)}return R}else{var V,j;if(M<=50)V=9*L/500,j=L/10;else V=9*L/50,j=-8*L;return V*M+j}},F.findCenterOfTree=function(M){var L=[];L=L.concat(M);var A=[],I=new Map,R=!1,N=null;if(L.length==1||L.length==2)R=!0,N=L[0];for(var E=0;E<L.length;E++){var V=L[E],j=V.getNeighborsList().size;if(I.set(V,V.getNeighborsList().size),j==1)A.push(V)}var T=[];T=T.concat(A);while(!R){var C=[];C=C.concat(T),T=[];for(var E=0;E<L.length;E++){var V=L[E],$=L.indexOf(V);if($>=0)L.splice($,1);var b=V.getNeighborsList();b.forEach(function(S){if(A.indexOf(S)<0){var v=I.get(S),f=v-1;if(f==1)T.push(S);I.set(S,f)}})}if(A=A.concat(T),L.length==1||L.length==2)R=!0,N=L[0]}return N},F.prototype.setGraphManager=function(M){this.graphManager=M},J.exports=F},function(J,Q,Z){function U(){}U.seed=1,U.x=0,U.nextDouble=function(){return U.x=Math.sin(U.seed++)*1e4,U.x-Math.floor(U.x)},J.exports=U},function(J,Q,Z){var U=Z(5);function K(X,Y){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}K.prototype.getWorldOrgX=function(){return this.lworldOrgX},K.prototype.setWorldOrgX=function(X){this.lworldOrgX=X},K.prototype.getWorldOrgY=function(){return this.lworldOrgY},K.prototype.setWorldOrgY=function(X){this.lworldOrgY=X},K.prototype.getWorldExtX=function(){return this.lworldExtX},K.prototype.setWorldExtX=function(X){this.lworldExtX=X},K.prototype.getWorldExtY=function(){return this.lworldExtY},K.prototype.setWorldExtY=function(X){this.lworldExtY=X},K.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},K.prototype.setDeviceOrgX=function(X){this.ldeviceOrgX=X},K.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},K.prototype.setDeviceOrgY=function(X){this.ldeviceOrgY=X},K.prototype.getDeviceExtX=function(){return this.ldeviceExtX},K.prototype.setDeviceExtX=function(X){this.ldeviceExtX=X},K.prototype.getDeviceExtY=function(){return this.ldeviceExtY},K.prototype.setDeviceExtY=function(X){this.ldeviceExtY=X},K.prototype.transformX=function(X){var Y=0,z=this.lworldExtX;if(z!=0)Y=this.ldeviceOrgX+(X-this.lworldOrgX)*this.ldeviceExtX/z;return Y},K.prototype.transformY=function(X){var Y=0,z=this.lworldExtY;if(z!=0)Y=this.ldeviceOrgY+(X-this.lworldOrgY)*this.ldeviceExtY/z;return Y},K.prototype.inverseTransformX=function(X){var Y=0,z=this.ldeviceExtX;if(z!=0)Y=this.lworldOrgX+(X-this.ldeviceOrgX)*this.lworldExtX/z;return Y},K.prototype.inverseTransformY=function(X){var Y=0,z=this.ldeviceExtY;if(z!=0)Y=this.lworldOrgY+(X-this.ldeviceOrgY)*this.lworldExtY/z;return Y},K.prototype.inverseTransformPoint=function(X){var Y=new U(this.inverseTransformX(X.x),this.inverseTransformY(X.y));return Y},J.exports=K},function(J,Q,Z){function U(q){if(Array.isArray(q)){for(var F=0,M=Array(q.length);F<q.length;F++)M[F]=q[F];return M}else return Array.from(q)}var K=Z(15),X=Z(4),Y=Z(0),z=Z(8),G=Z(9);function W(){K.call(this),this.useSmartIdealEdgeLengthCalculation=X.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=X.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=X.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=X.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=X.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.displacementThresholdPerNode=3*X.DEFAULT_EDGE_LENGTH/100,this.coolingFactor=X.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.initialCoolingFactor=X.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.totalDisplacement=0,this.oldTotalDisplacement=0,this.maxIterations=X.MAX_ITERATIONS}W.prototype=Object.create(K.prototype);for(var H in K)W[H]=K[H];W.prototype.initParameters=function(){K.prototype.initParameters.call(this,arguments),this.totalIterations=0,this.notAnimatedIterations=0,this.useFRGridVariant=X.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION,this.grid=[]},W.prototype.calcIdealEdgeLengths=function(){var q,F,M,L,A,I,R,N=this.getGraphManager().getAllEdges();for(var E=0;E<N.length;E++)if(q=N[E],F=q.idealLength,q.isInterGraph){if(L=q.getSource(),A=q.getTarget(),I=q.getSourceInLca().getEstimatedSize(),R=q.getTargetInLca().getEstimatedSize(),this.useSmartIdealEdgeLengthCalculation)q.idealLength+=I+R-2*Y.SIMPLE_NODE_SIZE;M=q.getLca().getInclusionTreeDepth(),q.idealLength+=F*X.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR*(L.getInclusionTreeDepth()+A.getInclusionTreeDepth()-2*M)}},W.prototype.initSpringEmbedder=function(){var q=this.getAllNodes().length;if(this.incremental){if(q>X.ADAPTATION_LOWER_NODE_LIMIT)this.coolingFactor=Math.max(this.coolingFactor*X.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(q-X.ADAPTATION_LOWER_NODE_LIMIT)/(X.ADAPTATION_UPPER_NODE_LIMIT-X.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-X.COOLING_ADAPTATION_FACTOR));this.maxNodeDisplacement=X.MAX_NODE_DISPLACEMENT_INCREMENTAL}else{if(q>X.ADAPTATION_LOWER_NODE_LIMIT)this.coolingFactor=Math.max(X.COOLING_ADAPTATION_FACTOR,1-(q-X.ADAPTATION_LOWER_NODE_LIMIT)/(X.ADAPTATION_UPPER_NODE_LIMIT-X.ADAPTATION_LOWER_NODE_LIMIT)*(1-X.COOLING_ADAPTATION_FACTOR));else this.coolingFactor=1;this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=X.MAX_NODE_DISPLACEMENT}this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.displacementThresholdPerNode=3*X.DEFAULT_EDGE_LENGTH/100,this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},W.prototype.calcSpringForces=function(){var q=this.getAllEdges(),F;for(var M=0;M<q.length;M++)F=q[M],this.calcSpringForce(F,F.idealLength)},W.prototype.calcRepulsionForces=function(){var q=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,F=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,M,L,A,I,R=this.getAllNodes(),N;if(this.useFRGridVariant){if(this.totalIterations%X.GRID_CALCULATION_CHECK_PERIOD==1&&q)this.updateGrid();N=new Set;for(M=0;M<R.length;M++)A=R[M],this.calculateRepulsionForceOfANode(A,N,q,F),N.add(A)}else for(M=0;M<R.length;M++){A=R[M];for(L=M+1;L<R.length;L++){if(I=R[L],A.getOwner()!=I.getOwner())continue;this.calcRepulsionForce(A,I)}}},W.prototype.calcGravitationalForces=function(){var q,F=this.getAllNodesToApplyGravitation();for(var M=0;M<F.length;M++)q=F[M],this.calcGravitationalForce(q)},W.prototype.moveNodes=function(){var q=this.getAllNodes(),F;for(var M=0;M<q.length;M++)F=q[M],F.move()},W.prototype.calcSpringForce=function(q,F){var M=q.getSource(),L=q.getTarget(),A,I,R,N;if(this.uniformLeafNodeSizes&&M.getChild()==null&&L.getChild()==null)q.updateLengthSimple();else if(q.updateLength(),q.isOverlapingSourceAndTarget)return;if(A=q.getLength(),A==0)return;I=q.edgeElasticity*(A-F),R=I*(q.lengthX/A),N=I*(q.lengthY/A),M.springForceX+=R,M.springForceY+=N,L.springForceX-=R,L.springForceY-=N},W.prototype.calcRepulsionForce=function(q,F){var M=q.getRect(),L=F.getRect(),A=new Array(2),I=new Array(4),R,N,E,V,j,T,C;if(M.intersects(L)){z.calcSeparationAmount(M,L,A,X.DEFAULT_EDGE_LENGTH/2),T=2*A[0],C=2*A[1];var $=q.noOfChildren*F.noOfChildren/(q.noOfChildren+F.noOfChildren);q.repulsionForceX-=$*T,q.repulsionForceY-=$*C,F.repulsionForceX+=$*T,F.repulsionForceY+=$*C}else{if(this.uniformLeafNodeSizes&&q.getChild()==null&&F.getChild()==null)R=L.getCenterX()-M.getCenterX(),N=L.getCenterY()-M.getCenterY();else z.getIntersection(M,L,I),R=I[2]-I[0],N=I[3]-I[1];if(Math.abs(R)<X.MIN_REPULSION_DIST)R=G.sign(R)*X.MIN_REPULSION_DIST;if(Math.abs(N)<X.MIN_REPULSION_DIST)N=G.sign(N)*X.MIN_REPULSION_DIST;E=R*R+N*N,V=Math.sqrt(E),j=(q.nodeRepulsion/2+F.nodeRepulsion/2)*q.noOfChildren*F.noOfChildren/E,T=j*R/V,C=j*N/V,q.repulsionForceX-=T,q.repulsionForceY-=C,F.repulsionForceX+=T,F.repulsionForceY+=C}},W.prototype.calcGravitationalForce=function(q){var F,M,L,A,I,R,N,E;if(F=q.getOwner(),M=(F.getRight()+F.getLeft())/2,L=(F.getTop()+F.getBottom())/2,A=q.getCenterX()-M,I=q.getCenterY()-L,R=Math.abs(A)+q.getWidth()/2,N=Math.abs(I)+q.getHeight()/2,q.getOwner()==this.graphManager.getRoot()){if(E=F.getEstimatedSize()*this.gravityRangeFactor,R>E||N>E)q.gravitationForceX=-this.gravityConstant*A,q.gravitationForceY=-this.gravityConstant*I}else if(E=F.getEstimatedSize()*this.compoundGravityRangeFactor,R>E||N>E)q.gravitationForceX=-this.gravityConstant*A*this.compoundGravityConstant,q.gravitationForceY=-this.gravityConstant*I*this.compoundGravityConstant},W.prototype.isConverged=function(){var q,F=!1;if(this.totalIterations>this.maxIterations/3)F=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2;return q=this.totalDisplacement<this.totalDisplacementThreshold,this.oldTotalDisplacement=this.totalDisplacement,q||F},W.prototype.animate=function(){if(this.animationDuringLayout&&!this.isSubLayout)if(this.notAnimatedIterations==this.animationPeriod)this.update(),this.notAnimatedIterations=0;else this.notAnimatedIterations++},W.prototype.calcNoOfChildrenForAllNodes=function(){var q,F=this.graphManager.getAllNodes();for(var M=0;M<F.length;M++)q=F[M],q.noOfChildren=q.getNoOfChildren()},W.prototype.calcGrid=function(q){var F=0,M=0;F=parseInt(Math.ceil((q.getRight()-q.getLeft())/this.repulsionRange)),M=parseInt(Math.ceil((q.getBottom()-q.getTop())/this.repulsionRange));var L=new Array(F);for(var A=0;A<F;A++)L[A]=new Array(M);for(var A=0;A<F;A++)for(var I=0;I<M;I++)L[A][I]=new Array;return L},W.prototype.addNodeToGrid=function(q,F,M){var L=0,A=0,I=0,R=0;L=parseInt(Math.floor((q.getRect().x-F)/this.repulsionRange)),A=parseInt(Math.floor((q.getRect().width+q.getRect().x-F)/this.repulsionRange)),I=parseInt(Math.floor((q.getRect().y-M)/this.repulsionRange)),R=parseInt(Math.floor((q.getRect().height+q.getRect().y-M)/this.repulsionRange));for(var N=L;N<=A;N++)for(var E=I;E<=R;E++)this.grid[N][E].push(q),q.setGridCoordinates(L,A,I,R)},W.prototype.updateGrid=function(){var q,F,M=this.getAllNodes();this.grid=this.calcGrid(this.graphManager.getRoot());for(q=0;q<M.length;q++)F=M[q],this.addNodeToGrid(F,this.graphManager.getRoot().getLeft(),this.graphManager.getRoot().getTop())},W.prototype.calculateRepulsionForceOfANode=function(q,F,M,L){if(this.totalIterations%X.GRID_CALCULATION_CHECK_PERIOD==1&&M||L){var A=new Set;q.surrounding=new Array;var I,R=this.grid;for(var N=q.startX-1;N<q.finishX+2;N++)for(var E=q.startY-1;E<q.finishY+2;E++)if(!(N<0||E<0||N>=R.length||E>=R[0].length))for(var V=0;V<R[N][E].length;V++){if(I=R[N][E][V],q.getOwner()!=I.getOwner()||q==I)continue;if(!F.has(I)&&!A.has(I)){var j=Math.abs(q.getCenterX()-I.getCenterX())-(q.getWidth()/2+I.getWidth()/2),T=Math.abs(q.getCenterY()-I.getCenterY())-(q.getHeight()/2+I.getHeight()/2);if(j<=this.repulsionRange&&T<=this.repulsionRange)A.add(I)}}q.surrounding=[].concat(U(A))}for(N=0;N<q.surrounding.length;N++)this.calcRepulsionForce(q,q.surrounding[N])},W.prototype.calcRepulsionRange=function(){return 0},J.exports=W},function(J,Q,Z){var U=Z(1),K=Z(4);function X(z,G,W){U.call(this,z,G,W),this.idealLength=K.DEFAULT_EDGE_LENGTH,this.edgeElasticity=K.DEFAULT_SPRING_STRENGTH}X.prototype=Object.create(U.prototype);for(var Y in U)X[Y]=U[Y];J.exports=X},function(J,Q,Z){var U=Z(3),K=Z(4);function X(z,G,W,H){U.call(this,z,G,W,H),this.nodeRepulsion=K.DEFAULT_REPULSION_STRENGTH,this.springForceX=0,this.springForceY=0,this.repulsionForceX=0,this.repulsionForceY=0,this.gravitationForceX=0,this.gravitationForceY=0,this.displacementX=0,this.displacementY=0,this.startX=0,this.finishX=0,this.startY=0,this.finishY=0,this.surrounding=[]}X.prototype=Object.create(U.prototype);for(var Y in U)X[Y]=U[Y];X.prototype.setGridCoordinates=function(z,G,W,H){this.startX=z,this.finishX=G,this.startY=W,this.finishY=H},J.exports=X},function(J,Q,Z){function U(K,X){if(this.width=0,this.height=0,K!==null&&X!==null)this.height=X,this.width=K}U.prototype.getWidth=function(){return this.width},U.prototype.setWidth=function(K){this.width=K},U.prototype.getHeight=function(){return this.height},U.prototype.setHeight=function(K){this.height=K},J.exports=U},function(J,Q,Z){var U=Z(14);function K(){this.map={},this.keys=[]}K.prototype.put=function(X,Y){var z=U.createID(X);if(!this.contains(z))this.map[z]=Y,this.keys.push(X)},K.prototype.contains=function(X){var Y=U.createID(X);return this.map[X]!=null},K.prototype.get=function(X){var Y=U.createID(X);return this.map[Y]},K.prototype.keySet=function(){return this.keys},J.exports=K},function(J,Q,Z){var U=Z(14);function K(){this.set={}}K.prototype.add=function(X){var Y=U.createID(X);if(!this.contains(Y))this.set[Y]=X},K.prototype.remove=function(X){delete this.set[U.createID(X)]},K.prototype.clear=function(){this.set={}},K.prototype.contains=function(X){return this.set[U.createID(X)]==X},K.prototype.isEmpty=function(){return this.size()===0},K.prototype.size=function(){return Object.keys(this.set).length},K.prototype.addAllTo=function(X){var Y=Object.keys(this.set),z=Y.length;for(var G=0;G<z;G++)X.push(this.set[Y[G]])},K.prototype.size=function(){return Object.keys(this.set).length},K.prototype.addAll=function(X){var Y=X.length;for(var z=0;z<Y;z++){var G=X[z];this.add(G)}},J.exports=K},function(J,Q,Z){function U(){}U.multMat=function(K,X){var Y=[];for(var z=0;z<K.length;z++){Y[z]=[];for(var G=0;G<X[0].length;G++){Y[z][G]=0;for(var W=0;W<K[0].length;W++)Y[z][G]+=K[z][W]*X[W][G]}}return Y},U.transpose=function(K){var X=[];for(var Y=0;Y<K[0].length;Y++){X[Y]=[];for(var z=0;z<K.length;z++)X[Y][z]=K[z][Y]}return X},U.multCons=function(K,X){var Y=[];for(var z=0;z<K.length;z++)Y[z]=K[z]*X;return Y},U.minusOp=function(K,X){var Y=[];for(var z=0;z<K.length;z++)Y[z]=K[z]-X[z];return Y},U.dotProduct=function(K,X){var Y=0;for(var z=0;z<K.length;z++)Y+=K[z]*X[z];return Y},U.mag=function(K){return Math.sqrt(this.dotProduct(K,K))},U.normalize=function(K){var X=[],Y=this.mag(K);for(var z=0;z<K.length;z++)X[z]=K[z]/Y;return X},U.multGamma=function(K){var X=[],Y=0;for(var z=0;z<K.length;z++)Y+=K[z];Y*=-1/K.length;for(var G=0;G<K.length;G++)X[G]=Y+K[G];return X},U.multL=function(K,X,Y){var z=[],G=[],W=[];for(var H=0;H<X[0].length;H++){var q=0;for(var F=0;F<X.length;F++)q+=-0.5*X[F][H]*K[F];G[H]=q}for(var M=0;M<Y.length;M++){var L=0;for(var A=0;A<Y.length;A++)L+=Y[M][A]*G[A];W[M]=L}for(var I=0;I<X.length;I++){var R=0;for(var N=0;N<X[0].length;N++)R+=X[I][N]*W[N];z[I]=R}return z},J.exports=U},function(J,Q,Z){var U=function(){function z(G,W){for(var H=0;H<W.length;H++){var q=W[H];if(q.enumerable=q.enumerable||!1,q.configurable=!0,"value"in q)q.writable=!0;Object.defineProperty(G,q.key,q)}}return function(G,W,H){if(W)z(G.prototype,W);if(H)z(G,H);return G}}();function K(z,G){if(!(z instanceof G))throw new TypeError("Cannot call a class as a function")}var X=Z(11),Y=function(){function z(G,W){if(K(this,z),W!==null||W!==void 0)this.compareFunction=this._defaultCompareFunction;var H=void 0;if(G instanceof X)H=G.size();else H=G.length;this._quicksort(G,0,H-1)}return U(z,[{key:"_quicksort",value:function G(W,H,q){if(H<q){var F=this._partition(W,H,q);this._quicksort(W,H,F),this._quicksort(W,F+1,q)}}},{key:"_partition",value:function G(W,H,q){var F=this._get(W,H),M=H,L=q;while(!0){while(this.compareFunction(F,this._get(W,L)))L--;while(this.compareFunction(this._get(W,M),F))M++;if(M<L)this._swap(W,M,L),M++,L--;else return L}}},{key:"_get",value:function G(W,H){if(W instanceof X)return W.get_object_at(H);else return W[H]}},{key:"_set",value:function G(W,H,q){if(W instanceof X)W.set_object_at(H,q);else W[H]=q}},{key:"_swap",value:function G(W,H,q){var F=this._get(W,H);this._set(W,H,this._get(W,q)),this._set(W,q,F)}},{key:"_defaultCompareFunction",value:function G(W,H){return H>W}}]),z}();J.exports=Y},function(J,Q,Z){function U(){}U.svd=function(K){this.U=null,this.V=null,this.s=null,this.m=0,this.n=0,this.m=K.length,this.n=K[0].length;var X=Math.min(this.m,this.n);this.s=function(p6){var u6=[];while(p6-- >0)u6.push(0);return u6}(Math.min(this.m+1,this.n)),this.U=function(p6){var u6=function S0(Q6){if(Q6.length==0)return 0;else{var B6=[];for(var D0=0;D0<Q6[0];D0++)B6.push(S0(Q6.slice(1)));return B6}};return u6(p6)}([this.m,X]),this.V=function(p6){var u6=function S0(Q6){if(Q6.length==0)return 0;else{var B6=[];for(var D0=0;D0<Q6[0];D0++)B6.push(S0(Q6.slice(1)));return B6}};return u6(p6)}([this.n,this.n]);var Y=function(p6){var u6=[];while(p6-- >0)u6.push(0);return u6}(this.n),z=function(p6){var u6=[];while(p6-- >0)u6.push(0);return u6}(this.m),G=!0,W=!0,H=Math.min(this.m-1,this.n),q=Math.max(0,Math.min(this.n-2,this.m));for(var F=0;F<Math.max(H,q);F++){if(F<H){this.s[F]=0;for(var M=F;M<this.m;M++)this.s[F]=U.hypot(this.s[F],K[M][F]);if(this.s[F]!==0){if(K[F][F]<0)this.s[F]=-this.s[F];for(var L=F;L<this.m;L++)K[L][F]/=this.s[F];K[F][F]+=1}this.s[F]=-this.s[F]}for(var A=F+1;A<this.n;A++){if(function(p6,u6){return p6&&u6}(F<H,this.s[F]!==0)){var I=0;for(var R=F;R<this.m;R++)I+=K[R][F]*K[R][A];I=-I/K[F][F];for(var N=F;N<this.m;N++)K[N][A]+=I*K[N][F]}Y[A]=K[F][A]}if(function(p6,u6){return p6&&u6}(G,F<H))for(var E=F;E<this.m;E++)this.U[E][F]=K[E][F];if(F<q){Y[F]=0;for(var V=F+1;V<this.n;V++)Y[F]=U.hypot(Y[F],Y[V]);if(Y[F]!==0){if(Y[F+1]<0)Y[F]=-Y[F];for(var j=F+1;j<this.n;j++)Y[j]/=Y[F];Y[F+1]+=1}if(Y[F]=-Y[F],function(p6,u6){return p6&&u6}(F+1<this.m,Y[F]!==0)){for(var T=F+1;T<this.m;T++)z[T]=0;for(var C=F+1;C<this.n;C++)for(var $=F+1;$<this.m;$++)z[$]+=Y[C]*K[$][C];for(var b=F+1;b<this.n;b++){var h=-Y[b]/Y[F+1];for(var _=F+1;_<this.m;_++)K[_][b]+=h*z[_]}}if(W)for(var S=F+1;S<this.n;S++)this.V[S][F]=Y[S]}}var v=Math.min(this.n,this.m+1);if(H<this.n)this.s[H]=K[H][H];if(this.m<v)this.s[v-1]=0;if(q+1<v)Y[q]=K[q][v-1];if(Y[v-1]=0,G){for(var f=H;f<X;f++){for(var x=0;x<this.m;x++)this.U[x][f]=0;this.U[f][f]=1}for(var y=H-1;y>=0;y--)if(this.s[y]!==0){for(var m=y+1;m<X;m++){var g=0;for(var p=y;p<this.m;p++)g+=this.U[p][y]*this.U[p][m];g=-g/this.U[y][y];for(var i=y;i<this.m;i++)this.U[i][m]+=g*this.U[i][y]}for(var l=y;l<this.m;l++)this.U[l][y]=-this.U[l][y];this.U[y][y]=1+this.U[y][y];for(var a=0;a<y-1;a++)this.U[a][y]=0}else{for(var e=0;e<this.m;e++)this.U[e][y]=0;this.U[y][y]=1}}if(W)for(var G0=this.n-1;G0>=0;G0--){if(function(p6,u6){return p6&&u6}(G0<q,Y[G0]!==0))for(var U0=G0+1;U0<X;U0++){var O0=0;for(var X0=G0+1;X0<this.n;X0++)O0+=this.V[X0][G0]*this.V[X0][U0];O0=-O0/this.V[G0+1][G0];for(var E0=G0+1;E0<this.n;E0++)this.V[E0][U0]+=O0*this.V[E0][G0]}for(var W0=0;W0<this.n;W0++)this.V[W0][G0]=0;this.V[G0][G0]=1}var q0=v-1,z0=0,K0=Math.pow(2,-52),R0=Math.pow(2,-966);while(v>0){var Y0=void 0,P0=void 0;for(Y0=v-2;Y0>=-1;Y0--){if(Y0===-1)break;if(Math.abs(Y[Y0])<=R0+K0*(Math.abs(this.s[Y0])+Math.abs(this.s[Y0+1]))){Y[Y0]=0;break}}if(Y0===v-2)P0=4;else{var F0=void 0;for(F0=v-1;F0>=Y0;F0--){if(F0===Y0)break;var m0=(F0!==v?Math.abs(Y[F0]):0)+(F0!==Y0+1?Math.abs(Y[F0-1]):0);if(Math.abs(this.s[F0])<=R0+K0*m0){this.s[F0]=0;break}}if(F0===Y0)P0=3;else if(F0===v-1)P0=1;else P0=2,Y0=F0}switch(Y0++,P0){case 1:{var J0=Y[v-2];Y[v-2]=0;for(var z6=v-2;z6>=Y0;z6--){var t=U.hypot(this.s[z6],J0),N0=this.s[z6]/t,f0=J0/t;if(this.s[z6]=t,z6!==Y0)J0=-f0*Y[z6-1],Y[z6-1]=N0*Y[z6-1];if(W)for(var l0=0;l0<this.n;l0++)t=N0*this.V[l0][z6]+f0*this.V[l0][v-1],this.V[l0][v-1]=-f0*this.V[l0][z6]+N0*this.V[l0][v-1],this.V[l0][z6]=t}}break;case 2:{var k0=Y[Y0-1];Y[Y0-1]=0;for(var _0=Y0;_0<v;_0++){var g0=U.hypot(this.s[_0],k0),h0=this.s[_0]/g0,t0=k0/g0;if(this.s[_0]=g0,k0=-t0*Y[_0],Y[_0]=h0*Y[_0],G)for(var C0=0;C0<this.m;C0++)g0=h0*this.U[C0][_0]+t0*this.U[C0][Y0-1],this.U[C0][Y0-1]=-t0*this.U[C0][_0]+h0*this.U[C0][Y0-1],this.U[C0][_0]=g0}}break;case 3:{var y0=Math.max(Math.max(Math.max(Math.max(Math.abs(this.s[v-1]),Math.abs(this.s[v-2])),Math.abs(Y[v-2])),Math.abs(this.s[Y0])),Math.abs(Y[Y0])),o=this.s[v-1]/y0,w0=this.s[v-2]/y0,d=Y[v-2]/y0,L0=this.s[Y0]/y0,I0=Y[Y0]/y0,T0=((w0+o)*(w0-o)+d*d)/2,$0=o*d*(o*d),v0=0;if(function(p6,u6){return p6||u6}(T0!==0,$0!==0)){if(v0=Math.sqrt(T0*T0+$0),T0<0)v0=-v0;v0=$0/(T0+v0)}var r0=(L0+o)*(L0-o)+v0,u0=L0*I0;for(var G6=Y0;G6<v-1;G6++){var A6=U.hypot(r0,u0),r6=r0/A6,N6=u0/A6;if(G6!==Y0)Y[G6-1]=A6;if(r0=r6*this.s[G6]+N6*Y[G6],Y[G6]=r6*Y[G6]-N6*this.s[G6],u0=N6*this.s[G6+1],this.s[G6+1]=r6*this.s[G6+1],W)for(var F6=0;F6<this.n;F6++)A6=r6*this.V[F6][G6]+N6*this.V[F6][G6+1],this.V[F6][G6+1]=-N6*this.V[F6][G6]+r6*this.V[F6][G6+1],this.V[F6][G6]=A6;if(A6=U.hypot(r0,u0),r6=r0/A6,N6=u0/A6,this.s[G6]=A6,r0=r6*Y[G6]+N6*this.s[G6+1],this.s[G6+1]=-N6*Y[G6]+r6*this.s[G6+1],u0=N6*Y[G6+1],Y[G6+1]=r6*Y[G6+1],G&&G6<this.m-1)for(var P6=0;P6<this.m;P6++)A6=r6*this.U[P6][G6]+N6*this.U[P6][G6+1],this.U[P6][G6+1]=-N6*this.U[P6][G6]+r6*this.U[P6][G6+1],this.U[P6][G6]=A6}Y[v-2]=r0,z0=z0+1}break;case 4:{if(this.s[Y0]<=0){if(this.s[Y0]=this.s[Y0]<0?-this.s[Y0]:0,W)for(var M6=0;M6<=q0;M6++)this.V[M6][Y0]=-this.V[M6][Y0]}while(Y0<q0){if(this.s[Y0]>=this.s[Y0+1])break;var g6=this.s[Y0];if(this.s[Y0]=this.s[Y0+1],this.s[Y0+1]=g6,W&&Y0<this.n-1)for(var O8=0;O8<this.n;O8++)g6=this.V[O8][Y0+1],this.V[O8][Y0+1]=this.V[O8][Y0],this.V[O8][Y0]=g6;if(G&&Y0<this.m-1)for(var a6=0;a6<this.m;a6++)g6=this.U[a6][Y0+1],this.U[a6][Y0+1]=this.U[a6][Y0],this.U[a6][Y0]=g6;Y0++}z0=0,v--}break}}var U8={U:this.U,V:this.V,S:this.s};return U8},U.hypot=function(K,X){var Y=void 0;if(Math.abs(K)>Math.abs(X))Y=X/K,Y=Math.abs(K)*Math.sqrt(1+Y*Y);else if(X!=0)Y=K/X,Y=Math.abs(X)*Math.sqrt(1+Y*Y);else Y=0;return Y},J.exports=U},function(J,Q,Z){var U=function(){function Y(z,G){for(var W=0;W<G.length;W++){var H=G[W];if(H.enumerable=H.enumerable||!1,H.configurable=!0,"value"in H)H.writable=!0;Object.defineProperty(z,H.key,H)}}return function(z,G,W){if(G)Y(z.prototype,G);if(W)Y(z,W);return z}}();function K(Y,z){if(!(Y instanceof z))throw new TypeError("Cannot call a class as a function")}var X=function(){function Y(z,G){var W=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,H=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,q=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;K(this,Y),this.sequence1=z,this.sequence2=G,this.match_score=W,this.mismatch_penalty=H,this.gap_penalty=q,this.iMax=z.length+1,this.jMax=G.length+1,this.grid=new Array(this.iMax);for(var F=0;F<this.iMax;F++){this.grid[F]=new Array(this.jMax);for(var M=0;M<this.jMax;M++)this.grid[F][M]=0}this.tracebackGrid=new Array(this.iMax);for(var L=0;L<this.iMax;L++){this.tracebackGrid[L]=new Array(this.jMax);for(var A=0;A<this.jMax;A++)this.tracebackGrid[L][A]=[null,null,null]}this.alignments=[],this.score=-1,this.computeGrids()}return U(Y,[{key:"getScore",value:function z(){return this.score}},{key:"getAlignments",value:function z(){return this.alignments}},{key:"computeGrids",value:function z(){for(var G=1;G<this.jMax;G++)this.grid[0][G]=this.grid[0][G-1]+this.gap_penalty,this.tracebackGrid[0][G]=[!1,!1,!0];for(var W=1;W<this.iMax;W++)this.grid[W][0]=this.grid[W-1][0]+this.gap_penalty,this.tracebackGrid[W][0]=[!1,!0,!1];for(var H=1;H<this.iMax;H++)for(var q=1;q<this.jMax;q++){var F=void 0;if(this.sequence1[H-1]===this.sequence2[q-1])F=this.grid[H-1][q-1]+this.match_score;else F=this.grid[H-1][q-1]+this.mismatch_penalty;var M=this.grid[H-1][q]+this.gap_penalty,L=this.grid[H][q-1]+this.gap_penalty,A=[F,M,L],I=this.arrayAllMaxIndexes(A);this.grid[H][q]=A[I[0]],this.tracebackGrid[H][q]=[I.includes(0),I.includes(1),I.includes(2)]}this.score=this.grid[this.iMax-1][this.jMax-1]}},{key:"alignmentTraceback",value:function z(){var G=[];G.push({pos:[this.sequence1.length,this.sequence2.length],seq1:"",seq2:""});while(G[0]){var W=G[0],H=this.tracebackGrid[W.pos[0]][W.pos[1]];if(H[0])G.push({pos:[W.pos[0]-1,W.pos[1]-1],seq1:this.sequence1[W.pos[0]-1]+W.seq1,seq2:this.sequence2[W.pos[1]-1]+W.seq2});if(H[1])G.push({pos:[W.pos[0]-1,W.pos[1]],seq1:this.sequence1[W.pos[0]-1]+W.seq1,seq2:"-"+W.seq2});if(H[2])G.push({pos:[W.pos[0],W.pos[1]-1],seq1:"-"+W.seq1,seq2:this.sequence2[W.pos[1]-1]+W.seq2});if(W.pos[0]===0&&W.pos[1]===0)this.alignments.push({sequence1:W.seq1,sequence2:W.seq2});G.shift()}return this.alignments}},{key:"getAllIndexes",value:function z(G,W){var H=[],q=-1;while((q=G.indexOf(W,q+1))!==-1)H.push(q);return H}},{key:"arrayAllMaxIndexes",value:function z(G){return this.getAllIndexes(G,Math.max.apply(null,G))}}]),Y}();J.exports=X},function(J,Q,Z){var U=function K(){return};U.FDLayout=Z(18),U.FDLayoutConstants=Z(4),U.FDLayoutEdge=Z(19),U.FDLayoutNode=Z(20),U.DimensionD=Z(21),U.HashMap=Z(22),U.HashSet=Z(23),U.IGeometry=Z(8),U.IMath=Z(9),U.Integer=Z(10),U.Point=Z(12),U.PointD=Z(5),U.RandomSeed=Z(16),U.RectangleD=Z(13),U.Transform=Z(17),U.UniqueIDGeneretor=Z(14),U.Quicksort=Z(25),U.LinkedList=Z(11),U.LGraphObject=Z(2),U.LGraph=Z(6),U.LEdge=Z(1),U.LGraphManager=Z(7),U.LNode=Z(3),U.Layout=Z(15),U.LayoutConstants=Z(0),U.NeedlemanWunsch=Z(27),U.Matrix=Z(24),U.SVD=Z(26),J.exports=U},function(J,Q,Z){function U(){this.listeners=[]}var K=U.prototype;K.addListener=function(X,Y){this.listeners.push({event:X,callback:Y})},K.removeListener=function(X,Y){for(var z=this.listeners.length;z>=0;z--){var G=this.listeners[z];if(G.event===X&&G.callback===Y)this.listeners.splice(z,1)}},K.emit=function(X,Y){for(var z=0;z<this.listeners.length;z++){var G=this.listeners[z];if(X===G.event)G.callback(Y)}},J.exports=U}])})});var HU0=F4((OV,WU0)=>{(function J(Q,Z){if(typeof OV==="object"&&typeof WU0==="object")WU0.exports=Z(GU0());else if(typeof define==="function"&&define.amd)define(["layout-base"],Z);else if(typeof OV==="object")OV.coseBase=Z(GU0());else Q.coseBase=Z(Q.layoutBase)})(OV,function(J){return(()=>{var Q={45:(X,Y,z)=>{var G={};G.layoutBase=z(551),G.CoSEConstants=z(806),G.CoSEEdge=z(767),G.CoSEGraph=z(880),G.CoSEGraphManager=z(578),G.CoSELayout=z(765),G.CoSENode=z(991),G.ConstraintHandler=z(902),X.exports=G},806:(X,Y,z)=>{var G=z(551).FDLayoutConstants;function W(){}for(var H in G)W[H]=G[H];W.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,W.DEFAULT_RADIAL_SEPARATION=G.DEFAULT_EDGE_LENGTH,W.DEFAULT_COMPONENT_SEPERATION=60,W.TILE=!0,W.TILING_PADDING_VERTICAL=10,W.TILING_PADDING_HORIZONTAL=10,W.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,W.ENFORCE_CONSTRAINTS=!0,W.APPLY_LAYOUT=!0,W.RELAX_MOVEMENT_ON_CONSTRAINTS=!0,W.TREE_REDUCTION_ON_INCREMENTAL=!0,W.PURE_INCREMENTAL=W.DEFAULT_INCREMENTAL,X.exports=W},767:(X,Y,z)=>{var G=z(551).FDLayoutEdge;function W(q,F,M){G.call(this,q,F,M)}W.prototype=Object.create(G.prototype);for(var H in G)W[H]=G[H];X.exports=W},880:(X,Y,z)=>{var G=z(551).LGraph;function W(q,F,M){G.call(this,q,F,M)}W.prototype=Object.create(G.prototype);for(var H in G)W[H]=G[H];X.exports=W},578:(X,Y,z)=>{var G=z(551).LGraphManager;function W(q){G.call(this,q)}W.prototype=Object.create(G.prototype);for(var H in G)W[H]=G[H];X.exports=W},765:(X,Y,z)=>{var G=z(551).FDLayout,W=z(578),H=z(880),q=z(991),F=z(767),M=z(806),L=z(902),A=z(551).FDLayoutConstants,I=z(551).LayoutConstants,R=z(551).Point,N=z(551).PointD,E=z(551).DimensionD,V=z(551).Layout,j=z(551).Integer,T=z(551).IGeometry,C=z(551).LGraph,$=z(551).Transform,b=z(551).LinkedList;function h(){G.call(this),this.toBeTiled={},this.constraints={}}h.prototype=Object.create(G.prototype);for(var _ in G)h[_]=G[_];h.prototype.newGraphManager=function(){var S=new W(this);return this.graphManager=S,S},h.prototype.newGraph=function(S){return new H(null,this.graphManager,S)},h.prototype.newNode=function(S){return new q(this.graphManager,S)},h.prototype.newEdge=function(S){return new F(null,null,S)},h.prototype.initParameters=function(){if(G.prototype.initParameters.call(this,arguments),!this.isSubLayout){if(M.DEFAULT_EDGE_LENGTH<10)this.idealEdgeLength=10;else this.idealEdgeLength=M.DEFAULT_EDGE_LENGTH;this.useSmartIdealEdgeLengthCalculation=M.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=A.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=A.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=A.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=A.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.prunedNodesAll=[],this.growTreeIterations=0,this.afterGrowthIterations=0,this.isTreeGrowing=!1,this.isGrowthFinished=!1}},h.prototype.initSpringEmbedder=function(){G.prototype.initSpringEmbedder.call(this),this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/A.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=0.04,this.coolingAdjuster=1},h.prototype.layout=function(){var S=I.DEFAULT_CREATE_BENDS_AS_NEEDED;if(S)this.createBendpoints(),this.graphManager.resetAllEdges();return this.level=0,this.classicLayout()},h.prototype.classicLayout=function(){if(this.nodesWithGravity=this.calculateNodesToApplyGravitationTo(),this.graphManager.setAllNodesToApplyGravitation(this.nodesWithGravity),this.calcNoOfChildrenForAllNodes(),this.graphManager.calcLowestCommonAncestors(),this.graphManager.calcInclusionTreeDepths(),this.graphManager.getRoot().calcEstimatedSize(),this.calcIdealEdgeLengths(),!this.incremental){var S=this.getFlatForest();if(S.length>0)this.positionNodesRadially(S);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var v=new Set(this.getAllNodes()),f=this.nodesWithGravity.filter(function(x){return v.has(x)});this.graphManager.setAllNodesToApplyGravitation(f),this.positionNodesRandomly()}}else if(M.TREE_REDUCTION_ON_INCREMENTAL){this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var v=new Set(this.getAllNodes()),f=this.nodesWithGravity.filter(function(m){return v.has(m)});this.graphManager.setAllNodesToApplyGravitation(f)}if(Object.keys(this.constraints).length>0)L.handleConstraints(this),this.initConstraintVariables();if(this.initSpringEmbedder(),M.APPLY_LAYOUT)this.runSpringEmbedder();return!0},h.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished)if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;if(this.totalIterations%A.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged())if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;if(this.coolingCycle++,this.layoutQuality==0)this.coolingAdjuster=this.coolingCycle;else if(this.layoutQuality==1)this.coolingAdjuster=this.coolingCycle/3;this.coolingFactor=Math.max(this.initialCoolingFactor-Math.pow(this.coolingCycle,Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature),this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0)if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var S=new Set(this.getAllNodes()),v=this.nodesWithGravity.filter(function(y){return S.has(y)});if(this.graphManager.setAllNodesToApplyGravitation(v),this.graphManager.updateBounds(),this.updateGrid(),M.PURE_INCREMENTAL)this.coolingFactor=A.DEFAULT_COOLING_FACTOR_INCREMENTAL/2;else this.coolingFactor=A.DEFAULT_COOLING_FACTOR_INCREMENTAL}else this.isTreeGrowing=!1,this.isGrowthFinished=!0;this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged())return!0;if(this.afterGrowthIterations%10==0)this.graphManager.updateBounds(),this.updateGrid();if(M.PURE_INCREMENTAL)this.coolingFactor=A.DEFAULT_COOLING_FACTOR_INCREMENTAL/2*((100-this.afterGrowthIterations)/100);else this.coolingFactor=A.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100);this.afterGrowthIterations++}var f=!this.isTreeGrowing&&!this.isGrowthFinished,x=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(f,x),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},h.prototype.getPositionsData=function(){var S=this.graphManager.getAllNodes(),v={};for(var f=0;f<S.length;f++){var x=S[f].rect,y=S[f].id;v[y]={id:y,x:x.getCenterX(),y:x.getCenterY(),w:x.width,h:x.height}}return v},h.prototype.runSpringEmbedder=function(){this.initialAnimationPeriod=25,this.animationPeriod=this.initialAnimationPeriod;var S=!1;if(A.ANIMATE==="during")this.emit("layoutstarted");else{while(!S)S=this.tick();this.graphManager.updateBounds()}},h.prototype.moveNodes=function(){var S=this.getAllNodes(),v;for(var f=0;f<S.length;f++)v=S[f],v.calculateDisplacement();if(Object.keys(this.constraints).length>0)this.updateDisplacements();for(var f=0;f<S.length;f++)v=S[f],v.move()},h.prototype.initConstraintVariables=function(){var S=this;this.idToNodeMap=new Map,this.fixedNodeSet=new Set;var v=this.graphManager.getAllNodes();for(var f=0;f<v.length;f++){var x=v[f];this.idToNodeMap.set(x.id,x)}var y=function X0(E0){var W0=E0.getChild().getNodes(),q0,z0=0;for(var K0=0;K0<W0.length;K0++)if(q0=W0[K0],q0.getChild()==null){if(S.fixedNodeSet.has(q0.id))z0+=100}else z0+=X0(q0);return z0};if(this.constraints.fixedNodeConstraint){this.constraints.fixedNodeConstraint.forEach(function(W0){S.fixedNodeSet.add(W0.nodeId)});var v=this.graphManager.getAllNodes(),x;for(var f=0;f<v.length;f++)if(x=v[f],x.getChild()!=null){var m=y(x);if(m>0)x.fixedNodeWeight=m}}if(this.constraints.relativePlacementConstraint){var g=new Map,p=new Map;if(this.dummyToNodeForVerticalAlignment=new Map,this.dummyToNodeForHorizontalAlignment=new Map,this.fixedNodesOnHorizontal=new Set,this.fixedNodesOnVertical=new Set,this.fixedNodeSet.forEach(function(X0){S.fixedNodesOnHorizontal.add(X0),S.fixedNodesOnVertical.add(X0)}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical){var i=this.constraints.alignmentConstraint.vertical;for(var f=0;f<i.length;f++)this.dummyToNodeForVerticalAlignment.set("dummy"+f,[]),i[f].forEach(function(E0){if(g.set(E0,"dummy"+f),S.dummyToNodeForVerticalAlignment.get("dummy"+f).push(E0),S.fixedNodeSet.has(E0))S.fixedNodesOnHorizontal.add("dummy"+f)})}if(this.constraints.alignmentConstraint.horizontal){var l=this.constraints.alignmentConstraint.horizontal;for(var f=0;f<l.length;f++)this.dummyToNodeForHorizontalAlignment.set("dummy"+f,[]),l[f].forEach(function(E0){if(p.set(E0,"dummy"+f),S.dummyToNodeForHorizontalAlignment.get("dummy"+f).push(E0),S.fixedNodeSet.has(E0))S.fixedNodesOnVertical.add("dummy"+f)})}}if(M.RELAX_MOVEMENT_ON_CONSTRAINTS)this.shuffle=function(X0){var E0,W0,q0;for(q0=X0.length-1;q0>=2*X0.length/3;q0--)E0=Math.floor(Math.random()*(q0+1)),W0=X0[q0],X0[q0]=X0[E0],X0[E0]=W0;return X0},this.nodesInRelativeHorizontal=[],this.nodesInRelativeVertical=[],this.nodeToRelativeConstraintMapHorizontal=new Map,this.nodeToRelativeConstraintMapVertical=new Map,this.nodeToTempPositionMapHorizontal=new Map,this.nodeToTempPositionMapVertical=new Map,this.constraints.relativePlacementConstraint.forEach(function(X0){if(X0.left){var E0=g.has(X0.left)?g.get(X0.left):X0.left,W0=g.has(X0.right)?g.get(X0.right):X0.right;if(!S.nodesInRelativeHorizontal.includes(E0))if(S.nodesInRelativeHorizontal.push(E0),S.nodeToRelativeConstraintMapHorizontal.set(E0,[]),S.dummyToNodeForVerticalAlignment.has(E0))S.nodeToTempPositionMapHorizontal.set(E0,S.idToNodeMap.get(S.dummyToNodeForVerticalAlignment.get(E0)[0]).getCenterX());else S.nodeToTempPositionMapHorizontal.set(E0,S.idToNodeMap.get(E0).getCenterX());if(!S.nodesInRelativeHorizontal.includes(W0))if(S.nodesInRelativeHorizontal.push(W0),S.nodeToRelativeConstraintMapHorizontal.set(W0,[]),S.dummyToNodeForVerticalAlignment.has(W0))S.nodeToTempPositionMapHorizontal.set(W0,S.idToNodeMap.get(S.dummyToNodeForVerticalAlignment.get(W0)[0]).getCenterX());else S.nodeToTempPositionMapHorizontal.set(W0,S.idToNodeMap.get(W0).getCenterX());S.nodeToRelativeConstraintMapHorizontal.get(E0).push({right:W0,gap:X0.gap}),S.nodeToRelativeConstraintMapHorizontal.get(W0).push({left:E0,gap:X0.gap})}else{var q0=p.has(X0.top)?p.get(X0.top):X0.top,z0=p.has(X0.bottom)?p.get(X0.bottom):X0.bottom;if(!S.nodesInRelativeVertical.includes(q0))if(S.nodesInRelativeVertical.push(q0),S.nodeToRelativeConstraintMapVertical.set(q0,[]),S.dummyToNodeForHorizontalAlignment.has(q0))S.nodeToTempPositionMapVertical.set(q0,S.idToNodeMap.get(S.dummyToNodeForHorizontalAlignment.get(q0)[0]).getCenterY());else S.nodeToTempPositionMapVertical.set(q0,S.idToNodeMap.get(q0).getCenterY());if(!S.nodesInRelativeVertical.includes(z0))if(S.nodesInRelativeVertical.push(z0),S.nodeToRelativeConstraintMapVertical.set(z0,[]),S.dummyToNodeForHorizontalAlignment.has(z0))S.nodeToTempPositionMapVertical.set(z0,S.idToNodeMap.get(S.dummyToNodeForHorizontalAlignment.get(z0)[0]).getCenterY());else S.nodeToTempPositionMapVertical.set(z0,S.idToNodeMap.get(z0).getCenterY());S.nodeToRelativeConstraintMapVertical.get(q0).push({bottom:z0,gap:X0.gap}),S.nodeToRelativeConstraintMapVertical.get(z0).push({top:q0,gap:X0.gap})}});else{var a=new Map,e=new Map;this.constraints.relativePlacementConstraint.forEach(function(X0){if(X0.left){var E0=g.has(X0.left)?g.get(X0.left):X0.left,W0=g.has(X0.right)?g.get(X0.right):X0.right;if(a.has(E0))a.get(E0).push(W0);else a.set(E0,[W0]);if(a.has(W0))a.get(W0).push(E0);else a.set(W0,[E0])}else{var q0=p.has(X0.top)?p.get(X0.top):X0.top,z0=p.has(X0.bottom)?p.get(X0.bottom):X0.bottom;if(e.has(q0))e.get(q0).push(z0);else e.set(q0,[z0]);if(e.has(z0))e.get(z0).push(q0);else e.set(z0,[q0])}});var G0=function X0(E0,W0){var q0=[],z0=[],K0=new b,R0=new Set,Y0=0;return E0.forEach(function(P0,F0){if(!R0.has(F0)){q0[Y0]=[],z0[Y0]=!1;var m0=F0;K0.push(m0),R0.add(m0),q0[Y0].push(m0);while(K0.length!=0){if(m0=K0.shift(),W0.has(m0))z0[Y0]=!0;var J0=E0.get(m0);J0.forEach(function(z6){if(!R0.has(z6))K0.push(z6),R0.add(z6),q0[Y0].push(z6)})}Y0++}}),{components:q0,isFixed:z0}},U0=G0(a,S.fixedNodesOnHorizontal);this.componentsOnHorizontal=U0.components,this.fixedComponentsOnHorizontal=U0.isFixed;var O0=G0(e,S.fixedNodesOnVertical);this.componentsOnVertical=O0.components,this.fixedComponentsOnVertical=O0.isFixed}}},h.prototype.updateDisplacements=function(){var S=this;if(this.constraints.fixedNodeConstraint)this.constraints.fixedNodeConstraint.forEach(function(O0){var X0=S.idToNodeMap.get(O0.nodeId);X0.displacementX=0,X0.displacementY=0});if(this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical){var v=this.constraints.alignmentConstraint.vertical;for(var f=0;f<v.length;f++){var x=0;for(var y=0;y<v[f].length;y++){if(this.fixedNodeSet.has(v[f][y])){x=0;break}x+=this.idToNodeMap.get(v[f][y]).displacementX}var m=x/v[f].length;for(var y=0;y<v[f].length;y++)this.idToNodeMap.get(v[f][y]).displacementX=m}}if(this.constraints.alignmentConstraint.horizontal){var g=this.constraints.alignmentConstraint.horizontal;for(var f=0;f<g.length;f++){var p=0;for(var y=0;y<g[f].length;y++){if(this.fixedNodeSet.has(g[f][y])){p=0;break}p+=this.idToNodeMap.get(g[f][y]).displacementY}var i=p/g[f].length;for(var y=0;y<g[f].length;y++)this.idToNodeMap.get(g[f][y]).displacementY=i}}}if(this.constraints.relativePlacementConstraint)if(M.RELAX_MOVEMENT_ON_CONSTRAINTS){if(this.totalIterations%10==0)this.shuffle(this.nodesInRelativeHorizontal),this.shuffle(this.nodesInRelativeVertical);this.nodesInRelativeHorizontal.forEach(function(O0){if(!S.fixedNodesOnHorizontal.has(O0)){var X0=0;if(S.dummyToNodeForVerticalAlignment.has(O0))X0=S.idToNodeMap.get(S.dummyToNodeForVerticalAlignment.get(O0)[0]).displacementX;else X0=S.idToNodeMap.get(O0).displacementX;if(S.nodeToRelativeConstraintMapHorizontal.get(O0).forEach(function(E0){if(E0.right){var W0=S.nodeToTempPositionMapHorizontal.get(E0.right)-S.nodeToTempPositionMapHorizontal.get(O0)-X0;if(W0<E0.gap)X0-=E0.gap-W0}else{var W0=S.nodeToTempPositionMapHorizontal.get(O0)-S.nodeToTempPositionMapHorizontal.get(E0.left)+X0;if(W0<E0.gap)X0+=E0.gap-W0}}),S.nodeToTempPositionMapHorizontal.set(O0,S.nodeToTempPositionMapHorizontal.get(O0)+X0),S.dummyToNodeForVerticalAlignment.has(O0))S.dummyToNodeForVerticalAlignment.get(O0).forEach(function(E0){S.idToNodeMap.get(E0).displacementX=X0});else S.idToNodeMap.get(O0).displacementX=X0}}),this.nodesInRelativeVertical.forEach(function(O0){if(!S.fixedNodesOnHorizontal.has(O0)){var X0=0;if(S.dummyToNodeForHorizontalAlignment.has(O0))X0=S.idToNodeMap.get(S.dummyToNodeForHorizontalAlignment.get(O0)[0]).displacementY;else X0=S.idToNodeMap.get(O0).displacementY;if(S.nodeToRelativeConstraintMapVertical.get(O0).forEach(function(E0){if(E0.bottom){var W0=S.nodeToTempPositionMapVertical.get(E0.bottom)-S.nodeToTempPositionMapVertical.get(O0)-X0;if(W0<E0.gap)X0-=E0.gap-W0}else{var W0=S.nodeToTempPositionMapVertical.get(O0)-S.nodeToTempPositionMapVertical.get(E0.top)+X0;if(W0<E0.gap)X0+=E0.gap-W0}}),S.nodeToTempPositionMapVertical.set(O0,S.nodeToTempPositionMapVertical.get(O0)+X0),S.dummyToNodeForHorizontalAlignment.has(O0))S.dummyToNodeForHorizontalAlignment.get(O0).forEach(function(E0){S.idToNodeMap.get(E0).displacementY=X0});else S.idToNodeMap.get(O0).displacementY=X0}})}else{for(var f=0;f<this.componentsOnHorizontal.length;f++){var l=this.componentsOnHorizontal[f];if(this.fixedComponentsOnHorizontal[f])for(var y=0;y<l.length;y++)if(this.dummyToNodeForVerticalAlignment.has(l[y]))this.dummyToNodeForVerticalAlignment.get(l[y]).forEach(function(E0){S.idToNodeMap.get(E0).displacementX=0});else this.idToNodeMap.get(l[y]).displacementX=0;else{var a=0,e=0;for(var y=0;y<l.length;y++)if(this.dummyToNodeForVerticalAlignment.has(l[y])){var G0=this.dummyToNodeForVerticalAlignment.get(l[y]);a+=G0.length*this.idToNodeMap.get(G0[0]).displacementX,e+=G0.length}else a+=this.idToNodeMap.get(l[y]).displacementX,e++;var U0=a/e;for(var y=0;y<l.length;y++)if(this.dummyToNodeForVerticalAlignment.has(l[y]))this.dummyToNodeForVerticalAlignment.get(l[y]).forEach(function(E0){S.idToNodeMap.get(E0).displacementX=U0});else this.idToNodeMap.get(l[y]).displacementX=U0}}for(var f=0;f<this.componentsOnVertical.length;f++){var l=this.componentsOnVertical[f];if(this.fixedComponentsOnVertical[f])for(var y=0;y<l.length;y++)if(this.dummyToNodeForHorizontalAlignment.has(l[y]))this.dummyToNodeForHorizontalAlignment.get(l[y]).forEach(function(W0){S.idToNodeMap.get(W0).displacementY=0});else this.idToNodeMap.get(l[y]).displacementY=0;else{var a=0,e=0;for(var y=0;y<l.length;y++)if(this.dummyToNodeForHorizontalAlignment.has(l[y])){var G0=this.dummyToNodeForHorizontalAlignment.get(l[y]);a+=G0.length*this.idToNodeMap.get(G0[0]).displacementY,e+=G0.length}else a+=this.idToNodeMap.get(l[y]).displacementY,e++;var U0=a/e;for(var y=0;y<l.length;y++)if(this.dummyToNodeForHorizontalAlignment.has(l[y]))this.dummyToNodeForHorizontalAlignment.get(l[y]).forEach(function(K0){S.idToNodeMap.get(K0).displacementY=U0});else this.idToNodeMap.get(l[y]).displacementY=U0}}}},h.prototype.calculateNodesToApplyGravitationTo=function(){var S=[],v,f=this.graphManager.getGraphs(),x=f.length,y;for(y=0;y<x;y++)if(v=f[y],v.updateConnected(),!v.isConnected)S=S.concat(v.getNodes());return S},h.prototype.createBendpoints=function(){var S=[];S=S.concat(this.graphManager.getAllEdges());var v=new Set,f;for(f=0;f<S.length;f++){var x=S[f];if(!v.has(x)){var y=x.getSource(),m=x.getTarget();if(y==m)x.getBendpoints().push(new N),x.getBendpoints().push(new N),this.createDummyNodesForBendpoints(x),v.add(x);else{var g=[];if(g=g.concat(y.getEdgeListToNode(m)),g=g.concat(m.getEdgeListToNode(y)),!v.has(g[0])){if(g.length>1){var p;for(p=0;p<g.length;p++){var i=g[p];i.getBendpoints().push(new N),this.createDummyNodesForBendpoints(i)}}g.forEach(function(l){v.add(l)})}}}if(v.size==S.length)break}},h.prototype.positionNodesRadially=function(S){var v=new R(0,0),f=Math.ceil(Math.sqrt(S.length)),x=0,y=0,m=0,g=new N(0,0);for(var p=0;p<S.length;p++){if(p%f==0){if(m=0,y=x,p!=0)y+=M.DEFAULT_COMPONENT_SEPERATION;x=0}var i=S[p],l=V.findCenterOfTree(i);if(v.x=m,v.y=y,g=h.radialLayout(i,l,v),g.y>x)x=Math.floor(g.y);m=Math.floor(g.x+M.DEFAULT_COMPONENT_SEPERATION)}this.transform(new N(I.WORLD_CENTER_X-g.x/2,I.WORLD_CENTER_Y-g.y/2))},h.radialLayout=function(S,v,f){var x=Math.max(this.maxDiagonalInTree(S),M.DEFAULT_RADIAL_SEPARATION);h.branchRadialLayout(v,null,0,359,0,x);var y=C.calculateBounds(S),m=new $;m.setDeviceOrgX(y.getMinX()),m.setDeviceOrgY(y.getMinY()),m.setWorldOrgX(f.x),m.setWorldOrgY(f.y);for(var g=0;g<S.length;g++){var p=S[g];p.transform(m)}var i=new N(y.getMaxX(),y.getMaxY());return m.inverseTransformPoint(i)},h.branchRadialLayout=function(S,v,f,x,y,m){var g=(x-f+1)/2;if(g<0)g+=180;var p=(g+f)%360,i=p*T.TWO_PI/360,l=Math.cos(i),a=y*Math.cos(i),e=y*Math.sin(i);S.setCenter(a,e);var G0=[];G0=G0.concat(S.getEdges());var U0=G0.length;if(v!=null)U0--;var O0=0,X0=G0.length,E0,W0=S.getEdgesBetween(v);while(W0.length>1){var q0=W0[0];W0.splice(0,1);var z0=G0.indexOf(q0);if(z0>=0)G0.splice(z0,1);X0--,U0--}if(v!=null)E0=(G0.indexOf(W0[0])+1)%X0;else E0=0;var K0=Math.abs(x-f)/U0;for(var R0=E0;O0!=U0;R0=++R0%X0){var Y0=G0[R0].getOtherEnd(S);if(Y0==v)continue;var P0=(f+O0*K0)%360,F0=(P0+K0)%360;h.branchRadialLayout(Y0,S,P0,F0,y+m,m),O0++}},h.maxDiagonalInTree=function(S){var v=j.MIN_VALUE;for(var f=0;f<S.length;f++){var x=S[f],y=x.getDiagonal();if(y>v)v=y}return v},h.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},h.prototype.groupZeroDegreeMembers=function(){var S=this,v={};this.memberGroups={},this.idToDummyNode={};var f=[],x=this.graphManager.getAllNodes();for(var y=0;y<x.length;y++){var m=x[y],g=m.getParent();if(this.getNodeDegreeWithChildren(m)===0&&(g.id==null||!this.getToBeTiled(g)))f.push(m)}for(var y=0;y<f.length;y++){var m=f[y],p=m.getParent().id;if(typeof v[p]==="undefined")v[p]=[];v[p]=v[p].concat(m)}Object.keys(v).forEach(function(i){if(v[i].length>1){var l="DummyCompound_"+i;S.memberGroups[l]=v[i];var a=v[i][0].getParent(),e=new q(S.graphManager);e.id=l,e.paddingLeft=a.paddingLeft||0,e.paddingRight=a.paddingRight||0,e.paddingBottom=a.paddingBottom||0,e.paddingTop=a.paddingTop||0,S.idToDummyNode[l]=e;var G0=S.getGraphManager().add(S.newGraph(),e),U0=a.getChild();U0.add(e);for(var O0=0;O0<v[i].length;O0++){var X0=v[i][O0];U0.remove(X0),G0.add(X0)}}})},h.prototype.clearCompounds=function(){var S={},v={};this.performDFSOnCompounds();for(var f=0;f<this.compoundOrder.length;f++)v[this.compoundOrder[f].id]=this.compoundOrder[f],S[this.compoundOrder[f].id]=[].concat(this.compoundOrder[f].getChild().getNodes()),this.graphManager.remove(this.compoundOrder[f].getChild()),this.compoundOrder[f].child=null;this.graphManager.resetAllNodes(),this.tileCompoundMembers(S,v)},h.prototype.clearZeroDegreeMembers=function(){var S=this,v=this.tiledZeroDegreePack=[];Object.keys(this.memberGroups).forEach(function(f){var x=S.idToDummyNode[f];if(v[f]=S.tileNodes(S.memberGroups[f],x.paddingLeft+x.paddingRight),x.rect.width=v[f].width,x.rect.height=v[f].height,x.setCenter(v[f].centerX,v[f].centerY),x.labelMarginLeft=0,x.labelMarginTop=0,M.NODE_DIMENSIONS_INCLUDE_LABELS){var y=x.rect.width,m=x.rect.height;if(x.labelWidth){if(x.labelPosHorizontal=="left")x.rect.x-=x.labelWidth,x.setWidth(y+x.labelWidth),x.labelMarginLeft=x.labelWidth;else if(x.labelPosHorizontal=="center"&&x.labelWidth>y)x.rect.x-=(x.labelWidth-y)/2,x.setWidth(x.labelWidth),x.labelMarginLeft=(x.labelWidth-y)/2;else if(x.labelPosHorizontal=="right")x.setWidth(y+x.labelWidth)}if(x.labelHeight){if(x.labelPosVertical=="top")x.rect.y-=x.labelHeight,x.setHeight(m+x.labelHeight),x.labelMarginTop=x.labelHeight;else if(x.labelPosVertical=="center"&&x.labelHeight>m)x.rect.y-=(x.labelHeight-m)/2,x.setHeight(x.labelHeight),x.labelMarginTop=(x.labelHeight-m)/2;else if(x.labelPosVertical=="bottom")x.setHeight(m+x.labelHeight)}}})},h.prototype.repopulateCompounds=function(){for(var S=this.compoundOrder.length-1;S>=0;S--){var v=this.compoundOrder[S],f=v.id,x=v.paddingLeft,y=v.paddingTop,m=v.labelMarginLeft,g=v.labelMarginTop;this.adjustLocations(this.tiledMemberPack[f],v.rect.x,v.rect.y,x,y,m,g)}},h.prototype.repopulateZeroDegreeMembers=function(){var S=this,v=this.tiledZeroDegreePack;Object.keys(v).forEach(function(f){var x=S.idToDummyNode[f],y=x.paddingLeft,m=x.paddingTop,g=x.labelMarginLeft,p=x.labelMarginTop;S.adjustLocations(v[f],x.rect.x,x.rect.y,y,m,g,p)})},h.prototype.getToBeTiled=function(S){var v=S.id;if(this.toBeTiled[v]!=null)return this.toBeTiled[v];var f=S.getChild();if(f==null)return this.toBeTiled[v]=!1,!1;var x=f.getNodes();for(var y=0;y<x.length;y++){var m=x[y];if(this.getNodeDegree(m)>0)return this.toBeTiled[v]=!1,!1;if(m.getChild()==null){this.toBeTiled[m.id]=!1;continue}if(!this.getToBeTiled(m))return this.toBeTiled[v]=!1,!1}return this.toBeTiled[v]=!0,!0},h.prototype.getNodeDegree=function(S){var v=S.id,f=S.getEdges(),x=0;for(var y=0;y<f.length;y++){var m=f[y];if(m.getSource().id!==m.getTarget().id)x=x+1}return x},h.prototype.getNodeDegreeWithChildren=function(S){var v=this.getNodeDegree(S);if(S.getChild()==null)return v;var f=S.getChild().getNodes();for(var x=0;x<f.length;x++){var y=f[x];v+=this.getNodeDegreeWithChildren(y)}return v},h.prototype.performDFSOnCompounds=function(){this.compoundOrder=[],this.fillCompexOrderByDFS(this.graphManager.getRoot().getNodes())},h.prototype.fillCompexOrderByDFS=function(S){for(var v=0;v<S.length;v++){var f=S[v];if(f.getChild()!=null)this.fillCompexOrderByDFS(f.getChild().getNodes());if(this.getToBeTiled(f))this.compoundOrder.push(f)}},h.prototype.adjustLocations=function(S,v,f,x,y,m,g){v+=x+m,f+=y+g;var p=v;for(var i=0;i<S.rows.length;i++){var l=S.rows[i];v=p;var a=0;for(var e=0;e<l.length;e++){var G0=l[e];if(G0.rect.x=v,G0.rect.y=f,v+=G0.rect.width+S.horizontalPadding,G0.rect.height>a)a=G0.rect.height}f+=a+S.verticalPadding}},h.prototype.tileCompoundMembers=function(S,v){var f=this;this.tiledMemberPack=[],Object.keys(S).forEach(function(x){var y=v[x];if(f.tiledMemberPack[x]=f.tileNodes(S[x],y.paddingLeft+y.paddingRight),y.rect.width=f.tiledMemberPack[x].width,y.rect.height=f.tiledMemberPack[x].height,y.setCenter(f.tiledMemberPack[x].centerX,f.tiledMemberPack[x].centerY),y.labelMarginLeft=0,y.labelMarginTop=0,M.NODE_DIMENSIONS_INCLUDE_LABELS){var m=y.rect.width,g=y.rect.height;if(y.labelWidth){if(y.labelPosHorizontal=="left")y.rect.x-=y.labelWidth,y.setWidth(m+y.labelWidth),y.labelMarginLeft=y.labelWidth;else if(y.labelPosHorizontal=="center"&&y.labelWidth>m)y.rect.x-=(y.labelWidth-m)/2,y.setWidth(y.labelWidth),y.labelMarginLeft=(y.labelWidth-m)/2;else if(y.labelPosHorizontal=="right")y.setWidth(m+y.labelWidth)}if(y.labelHeight){if(y.labelPosVertical=="top")y.rect.y-=y.labelHeight,y.setHeight(g+y.labelHeight),y.labelMarginTop=y.labelHeight;else if(y.labelPosVertical=="center"&&y.labelHeight>g)y.rect.y-=(y.labelHeight-g)/2,y.setHeight(y.labelHeight),y.labelMarginTop=(y.labelHeight-g)/2;else if(y.labelPosVertical=="bottom")y.setHeight(g+y.labelHeight)}}})},h.prototype.tileNodes=function(S,v){var f=this.tileNodesByFavoringDim(S,v,!0),x=this.tileNodesByFavoringDim(S,v,!1),y=this.getOrgRatio(f),m=this.getOrgRatio(x),g;if(m<y)g=x;else g=f;return g},h.prototype.getOrgRatio=function(S){var{width:v,height:f}=S,x=v/f;if(x<1)x=1/x;return x},h.prototype.calcIdealRowWidth=function(S,v){var{TILING_PADDING_VERTICAL:f,TILING_PADDING_HORIZONTAL:x}=M,y=S.length,m=0,g=0,p=0;S.forEach(function(O0){if(m+=O0.getWidth(),g+=O0.getHeight(),O0.getWidth()>p)p=O0.getWidth()});var i=m/y,l=g/y,a=Math.pow(f-x,2)+4*(i+x)*(l+f)*y,e=(x-f+Math.sqrt(a))/(2*(i+x)),G0;if(v){if(G0=Math.ceil(e),G0==e)G0++}else G0=Math.floor(e);var U0=G0*(i+x)-x;if(p>U0)U0=p;return U0+=x*2,U0},h.prototype.tileNodesByFavoringDim=function(S,v,f){var{TILING_PADDING_VERTICAL:x,TILING_PADDING_HORIZONTAL:y,TILING_COMPARE_BY:m}=M,g={rows:[],rowWidth:[],rowHeight:[],width:0,height:v,verticalPadding:x,horizontalPadding:y,centerX:0,centerY:0};if(m)g.idealRowWidth=this.calcIdealRowWidth(S,f);var p=function O0(X0){return X0.rect.width*X0.rect.height},i=function O0(X0,E0){return p(E0)-p(X0)};S.sort(function(O0,X0){var E0=i;if(g.idealRowWidth)return E0=m,E0(O0.id,X0.id);return E0(O0,X0)});var l=0,a=0;for(var e=0;e<S.length;e++){var G0=S[e];l+=G0.getCenterX(),a+=G0.getCenterY()}g.centerX=l/S.length,g.centerY=a/S.length;for(var e=0;e<S.length;e++){var G0=S[e];if(g.rows.length==0)this.insertNodeToRow(g,G0,0,v);else if(this.canAddHorizontal(g,G0.rect.width,G0.rect.height)){var U0=g.rows.length-1;if(!g.idealRowWidth)U0=this.getShortestRowIndex(g);this.insertNodeToRow(g,G0,U0,v)}else this.insertNodeToRow(g,G0,g.rows.length,v);this.shiftToLastRow(g)}return g},h.prototype.insertNodeToRow=function(S,v,f,x){var y=x;if(f==S.rows.length){var m=[];S.rows.push(m),S.rowWidth.push(y),S.rowHeight.push(0)}var g=S.rowWidth[f]+v.rect.width;if(S.rows[f].length>0)g+=S.horizontalPadding;if(S.rowWidth[f]=g,S.width<g)S.width=g;var p=v.rect.height;if(f>0)p+=S.verticalPadding;var i=0;if(p>S.rowHeight[f])i=S.rowHeight[f],S.rowHeight[f]=p,i=S.rowHeight[f]-i;S.height+=i,S.rows[f].push(v)},h.prototype.getShortestRowIndex=function(S){var v=-1,f=Number.MAX_VALUE;for(var x=0;x<S.rows.length;x++)if(S.rowWidth[x]<f)v=x,f=S.rowWidth[x];return v},h.prototype.getLongestRowIndex=function(S){var v=-1,f=Number.MIN_VALUE;for(var x=0;x<S.rows.length;x++)if(S.rowWidth[x]>f)v=x,f=S.rowWidth[x];return v},h.prototype.canAddHorizontal=function(S,v,f){if(S.idealRowWidth){var x=S.rows.length-1,y=S.rowWidth[x];return y+v+S.horizontalPadding<=S.idealRowWidth}var m=this.getShortestRowIndex(S);if(m<0)return!0;var g=S.rowWidth[m];if(g+S.horizontalPadding+v<=S.width)return!0;var p=0;if(S.rowHeight[m]<f){if(m>0)p=f+S.verticalPadding-S.rowHeight[m]}var i;if(S.width-g>=v+S.horizontalPadding)i=(S.height+p)/(g+v+S.horizontalPadding);else i=(S.height+p)/S.width;p=f+S.verticalPadding;var l;if(S.width<v)l=(S.height+p)/v;else l=(S.height+p)/S.width;if(l<1)l=1/l;if(i<1)i=1/i;return i<l},h.prototype.shiftToLastRow=function(S){var v=this.getLongestRowIndex(S),f=S.rowWidth.length-1,x=S.rows[v],y=x[x.length-1],m=y.width+S.horizontalPadding;if(S.width-S.rowWidth[f]>m&&v!=f){x.splice(-1,1),S.rows[f].push(y),S.rowWidth[v]=S.rowWidth[v]-m,S.rowWidth[f]=S.rowWidth[f]+m,S.width=S.rowWidth[instance.getLongestRowIndex(S)];var g=Number.MIN_VALUE;for(var p=0;p<x.length;p++)if(x[p].height>g)g=x[p].height;if(v>0)g+=S.verticalPadding;var i=S.rowHeight[v]+S.rowHeight[f];if(S.rowHeight[v]=g,S.rowHeight[f]<y.height+S.verticalPadding)S.rowHeight[f]=y.height+S.verticalPadding;var l=S.rowHeight[v]+S.rowHeight[f];S.height+=l-i,this.shiftToLastRow(S)}},h.prototype.tilingPreLayout=function(){if(M.TILE)this.groupZeroDegreeMembers(),this.clearCompounds(),this.clearZeroDegreeMembers()},h.prototype.tilingPostLayout=function(){if(M.TILE)this.repopulateZeroDegreeMembers(),this.repopulateCompounds()},h.prototype.reduceTrees=function(){var S=[],v=!0,f;while(v){var x=this.graphManager.getAllNodes(),y=[];v=!1;for(var m=0;m<x.length;m++)if(f=x[m],f.getEdges().length==1&&!f.getEdges()[0].isInterGraph&&f.getChild()==null){if(M.PURE_INCREMENTAL){var g=f.getEdges()[0].getOtherEnd(f),p=new E(f.getCenterX()-g.getCenterX(),f.getCenterY()-g.getCenterY());y.push([f,f.getEdges()[0],f.getOwner(),p])}else y.push([f,f.getEdges()[0],f.getOwner()]);v=!0}if(v==!0){var i=[];for(var l=0;l<y.length;l++)if(y[l][0].getEdges().length==1)i.push(y[l]),y[l][0].getOwner().remove(y[l][0]);S.push(i),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()}}this.prunedNodesAll=S},h.prototype.growTree=function(S){var v=S.length,f=S[v-1],x;for(var y=0;y<f.length;y++)x=f[y],this.findPlaceforPrunedNode(x),x[2].add(x[0]),x[2].add(x[1],x[1].source,x[1].target);S.splice(S.length-1,1),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()},h.prototype.findPlaceforPrunedNode=function(S){var v,f,x=S[0];if(x==S[1].source)f=S[1].target;else f=S[1].source;if(M.PURE_INCREMENTAL)x.setCenter(f.getCenterX()+S[3].getWidth(),f.getCenterY()+S[3].getHeight());else{var{startX:y,finishX:m,startY:g,finishY:p}=f,i=0,l=0,a=0,e=0,G0=[i,a,l,e];if(g>0)for(var U0=y;U0<=m;U0++)G0[0]+=this.grid[U0][g-1].length+this.grid[U0][g].length-1;if(m<this.grid.length-1)for(var U0=g;U0<=p;U0++)G0[1]+=this.grid[m+1][U0].length+this.grid[m][U0].length-1;if(p<this.grid[0].length-1)for(var U0=y;U0<=m;U0++)G0[2]+=this.grid[U0][p+1].length+this.grid[U0][p].length-1;if(y>0)for(var U0=g;U0<=p;U0++)G0[3]+=this.grid[y-1][U0].length+this.grid[y][U0].length-1;var O0=j.MAX_VALUE,X0,E0;for(var W0=0;W0<G0.length;W0++)if(G0[W0]<O0)O0=G0[W0],X0=1,E0=W0;else if(G0[W0]==O0)X0++;if(X0==3&&O0==0){if(G0[0]==0&&G0[1]==0&&G0[2]==0)v=1;else if(G0[0]==0&&G0[1]==0&&G0[3]==0)v=0;else if(G0[0]==0&&G0[2]==0&&G0[3]==0)v=3;else if(G0[1]==0&&G0[2]==0&&G0[3]==0)v=2}else if(X0==2&&O0==0){var q0=Math.floor(Math.random()*2);if(G0[0]==0&&G0[1]==0)if(q0==0)v=0;else v=1;else if(G0[0]==0&&G0[2]==0)if(q0==0)v=0;else v=2;else if(G0[0]==0&&G0[3]==0)if(q0==0)v=0;else v=3;else if(G0[1]==0&&G0[2]==0)if(q0==0)v=1;else v=2;else if(G0[1]==0&&G0[3]==0)if(q0==0)v=1;else v=3;else if(q0==0)v=2;else v=3}else if(X0==4&&O0==0){var q0=Math.floor(Math.random()*4);v=q0}else v=E0;if(v==0)x.setCenter(f.getCenterX(),f.getCenterY()-f.getHeight()/2-A.DEFAULT_EDGE_LENGTH-x.getHeight()/2);else if(v==1)x.setCenter(f.getCenterX()+f.getWidth()/2+A.DEFAULT_EDGE_LENGTH+x.getWidth()/2,f.getCenterY());else if(v==2)x.setCenter(f.getCenterX(),f.getCenterY()+f.getHeight()/2+A.DEFAULT_EDGE_LENGTH+x.getHeight()/2);else x.setCenter(f.getCenterX()-f.getWidth()/2-A.DEFAULT_EDGE_LENGTH-x.getWidth()/2,f.getCenterY())}},X.exports=h},991:(X,Y,z)=>{var G=z(551).FDLayoutNode,W=z(551).IMath;function H(F,M,L,A){G.call(this,F,M,L,A)}H.prototype=Object.create(G.prototype);for(var q in G)H[q]=G[q];H.prototype.calculateDisplacement=function(){var F=this.graphManager.getLayout();if(this.getChild()!=null&&this.fixedNodeWeight)this.displacementX+=F.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.fixedNodeWeight,this.displacementY+=F.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.fixedNodeWeight;else this.displacementX+=F.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY+=F.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren;if(Math.abs(this.displacementX)>F.coolingFactor*F.maxNodeDisplacement)this.displacementX=F.coolingFactor*F.maxNodeDisplacement*W.sign(this.displacementX);if(Math.abs(this.displacementY)>F.coolingFactor*F.maxNodeDisplacement)this.displacementY=F.coolingFactor*F.maxNodeDisplacement*W.sign(this.displacementY);if(this.child&&this.child.getNodes().length>0)this.propogateDisplacementToChildren(this.displacementX,this.displacementY)},H.prototype.propogateDisplacementToChildren=function(F,M){var L=this.getChild().getNodes(),A;for(var I=0;I<L.length;I++)if(A=L[I],A.getChild()==null)A.displacementX+=F,A.displacementY+=M;else A.propogateDisplacementToChildren(F,M)},H.prototype.move=function(){var F=this.graphManager.getLayout();if(this.child==null||this.child.getNodes().length==0)this.moveBy(this.displacementX,this.displacementY),F.totalDisplacement+=Math.abs(this.displacementX)+Math.abs(this.displacementY);this.springForceX=0,this.springForceY=0,this.repulsionForceX=0,this.repulsionForceY=0,this.gravitationForceX=0,this.gravitationForceY=0,this.displacementX=0,this.displacementY=0},H.prototype.setPred1=function(F){this.pred1=F},H.prototype.getPred1=function(){return pred1},H.prototype.getPred2=function(){return pred2},H.prototype.setNext=function(F){this.next=F},H.prototype.getNext=function(){return next},H.prototype.setProcessed=function(F){this.processed=F},H.prototype.isProcessed=function(){return processed},X.exports=H},902:(X,Y,z)=>{function G(L){if(Array.isArray(L)){for(var A=0,I=Array(L.length);A<L.length;A++)I[A]=L[A];return I}else return Array.from(L)}var W=z(806),H=z(551).LinkedList,q=z(551).Matrix,F=z(551).SVD;function M(){}M.handleConstraints=function(L){var A={};A.fixedNodeConstraint=L.constraints.fixedNodeConstraint,A.alignmentConstraint=L.constraints.alignmentConstraint,A.relativePlacementConstraint=L.constraints.relativePlacementConstraint;var I=new Map,R=new Map,N=[],E=[],V=L.getAllNodes(),j=0;for(var T=0;T<V.length;T++){var C=V[T];if(C.getChild()==null)R.set(C.id,j++),N.push(C.getCenterX()),E.push(C.getCenterY()),I.set(C.id,C)}if(A.relativePlacementConstraint)A.relativePlacementConstraint.forEach(function(y0){if(!y0.gap&&y0.gap!=0)if(y0.left)y0.gap=W.DEFAULT_EDGE_LENGTH+I.get(y0.left).getWidth()/2+I.get(y0.right).getWidth()/2;else y0.gap=W.DEFAULT_EDGE_LENGTH+I.get(y0.top).getHeight()/2+I.get(y0.bottom).getHeight()/2});var $=function y0(o,w0){return{x:o.x-w0.x,y:o.y-w0.y}},b=function y0(o){var w0=0,d=0;return o.forEach(function(L0){w0+=N[R.get(L0)],d+=E[R.get(L0)]}),{x:w0/o.size,y:d/o.size}},h=function y0(o,w0,d,L0,I0){function T0(N6,F6){var P6=new Set(N6),M6=!0,g6=!1,O8=void 0;try{for(var a6=F6[Symbol.iterator](),U8;!(M6=(U8=a6.next()).done);M6=!0){var p6=U8.value;P6.add(p6)}}catch(u6){g6=!0,O8=u6}finally{try{if(!M6&&a6.return)a6.return()}finally{if(g6)throw O8}}return P6}var $0=new Map;o.forEach(function(N6,F6){$0.set(F6,0)}),o.forEach(function(N6,F6){N6.forEach(function(P6){$0.set(P6.id,$0.get(P6.id)+1)})});var v0=new Map,r0=new Map,u0=new H;if($0.forEach(function(N6,F6){if(N6==0){if(u0.push(F6),!d)if(w0=="horizontal")v0.set(F6,R.has(F6)?N[R.get(F6)]:L0.get(F6));else v0.set(F6,R.has(F6)?E[R.get(F6)]:L0.get(F6))}else v0.set(F6,Number.NEGATIVE_INFINITY);if(d)r0.set(F6,new Set([F6]))}),d)I0.forEach(function(N6){var F6=[];if(N6.forEach(function(g6){if(d.has(g6))F6.push(g6)}),F6.length>0){var P6=0;F6.forEach(function(g6){if(w0=="horizontal")v0.set(g6,R.has(g6)?N[R.get(g6)]:L0.get(g6)),P6+=v0.get(g6);else v0.set(g6,R.has(g6)?E[R.get(g6)]:L0.get(g6)),P6+=v0.get(g6)}),P6=P6/F6.length,N6.forEach(function(g6){if(!d.has(g6))v0.set(g6,P6)})}else{var M6=0;N6.forEach(function(g6){if(w0=="horizontal")M6+=R.has(g6)?N[R.get(g6)]:L0.get(g6);else M6+=R.has(g6)?E[R.get(g6)]:L0.get(g6)}),M6=M6/N6.length,N6.forEach(function(g6){v0.set(g6,M6)})}});var G6=function N6(){var F6=u0.shift(),P6=o.get(F6);P6.forEach(function(M6){if(v0.get(M6.id)<v0.get(F6)+M6.gap)if(d&&d.has(M6.id)){var g6=void 0;if(w0=="horizontal")g6=R.has(M6.id)?N[R.get(M6.id)]:L0.get(M6.id);else g6=R.has(M6.id)?E[R.get(M6.id)]:L0.get(M6.id);if(v0.set(M6.id,g6),g6<v0.get(F6)+M6.gap){var O8=v0.get(F6)+M6.gap-g6;r0.get(F6).forEach(function(a6){v0.set(a6,v0.get(a6)-O8)})}}else v0.set(M6.id,v0.get(F6)+M6.gap);if($0.set(M6.id,$0.get(M6.id)-1),$0.get(M6.id)==0)u0.push(M6.id);if(d)r0.set(M6.id,T0(r0.get(F6),r0.get(M6.id)))})};while(u0.length!=0)G6();if(d){var A6=new Set;o.forEach(function(N6,F6){if(N6.length==0)A6.add(F6)});var r6=[];r0.forEach(function(N6,F6){if(A6.has(F6)){var P6=!1,M6=!0,g6=!1,O8=void 0;try{for(var a6=N6[Symbol.iterator](),U8;!(M6=(U8=a6.next()).done);M6=!0){var p6=U8.value;if(d.has(p6))P6=!0}}catch(Q6){g6=!0,O8=Q6}finally{try{if(!M6&&a6.return)a6.return()}finally{if(g6)throw O8}}if(!P6){var u6=!1,S0=void 0;if(r6.forEach(function(Q6,B6){if(Q6.has([].concat(G(N6))[0]))u6=!0,S0=B6}),!u6)r6.push(new Set(N6));else N6.forEach(function(Q6){r6[S0].add(Q6)})}}}),r6.forEach(function(N6,F6){var{POSITIVE_INFINITY:P6,POSITIVE_INFINITY:M6,NEGATIVE_INFINITY:g6,NEGATIVE_INFINITY:O8}=Number,a6=!0,U8=!1,p6=void 0;try{for(var u6=N6[Symbol.iterator](),S0;!(a6=(S0=u6.next()).done);a6=!0){var Q6=S0.value,B6=void 0;if(w0=="horizontal")B6=R.has(Q6)?N[R.get(Q6)]:L0.get(Q6);else B6=R.has(Q6)?E[R.get(Q6)]:L0.get(Q6);var D0=v0.get(Q6);if(B6<P6)P6=B6;if(B6>g6)g6=B6;if(D0<M6)M6=D0;if(D0>O8)O8=D0}}catch(g8){U8=!0,p6=g8}finally{try{if(!a6&&u6.return)u6.return()}finally{if(U8)throw p6}}var X6=(P6+g6)/2-(M6+O8)/2,W6=!0,_6=!1,c6=void 0;try{for(var d6=N6[Symbol.iterator](),l6;!(W6=(l6=d6.next()).done);W6=!0){var t6=l6.value;v0.set(t6,v0.get(t6)+X6)}}catch(g8){_6=!0,c6=g8}finally{try{if(!W6&&d6.return)d6.return()}finally{if(_6)throw c6}}})}return v0},_=function y0(o){var w0=0,d=0,L0=0,I0=0;if(o.forEach(function(r0){if(r0.left)N[R.get(r0.left)]-N[R.get(r0.right)]>=0?w0++:d++;else E[R.get(r0.top)]-E[R.get(r0.bottom)]>=0?L0++:I0++}),w0>d&&L0>I0)for(var T0=0;T0<R.size;T0++)N[T0]=-1*N[T0],E[T0]=-1*E[T0];else if(w0>d)for(var $0=0;$0<R.size;$0++)N[$0]=-1*N[$0];else if(L0>I0)for(var v0=0;v0<R.size;v0++)E[v0]=-1*E[v0]},S=function y0(o){var w0=[],d=new H,L0=new Set,I0=0;return o.forEach(function(T0,$0){if(!L0.has($0)){w0[I0]=[];var v0=$0;d.push(v0),L0.add(v0),w0[I0].push(v0);while(d.length!=0){v0=d.shift();var r0=o.get(v0);r0.forEach(function(u0){if(!L0.has(u0.id))d.push(u0.id),L0.add(u0.id),w0[I0].push(u0.id)})}I0++}}),w0},v=function y0(o){var w0=new Map;return o.forEach(function(d,L0){w0.set(L0,[])}),o.forEach(function(d,L0){d.forEach(function(I0){w0.get(L0).push(I0),w0.get(I0.id).push({id:L0,gap:I0.gap,direction:I0.direction})})}),w0},f=function y0(o){var w0=new Map;return o.forEach(function(d,L0){w0.set(L0,[])}),o.forEach(function(d,L0){d.forEach(function(I0){w0.get(I0.id).push({id:L0,gap:I0.gap,direction:I0.direction})})}),w0},x=[],y=[],m=!1,g=!1,p=new Set,i=new Map,l=new Map,a=[];if(A.fixedNodeConstraint)A.fixedNodeConstraint.forEach(function(y0){p.add(y0.nodeId)});if(A.relativePlacementConstraint)A.relativePlacementConstraint.forEach(function(y0){if(y0.left){if(i.has(y0.left))i.get(y0.left).push({id:y0.right,gap:y0.gap,direction:"horizontal"});else i.set(y0.left,[{id:y0.right,gap:y0.gap,direction:"horizontal"}]);if(!i.has(y0.right))i.set(y0.right,[])}else{if(i.has(y0.top))i.get(y0.top).push({id:y0.bottom,gap:y0.gap,direction:"vertical"});else i.set(y0.top,[{id:y0.bottom,gap:y0.gap,direction:"vertical"}]);if(!i.has(y0.bottom))i.set(y0.bottom,[])}}),l=v(i),a=S(l);if(W.TRANSFORM_ON_CONSTRAINT_HANDLING){if(A.fixedNodeConstraint&&A.fixedNodeConstraint.length>1)A.fixedNodeConstraint.forEach(function(y0,o){x[o]=[y0.position.x,y0.position.y],y[o]=[N[R.get(y0.nodeId)],E[R.get(y0.nodeId)]]}),m=!0;else if(A.alignmentConstraint)(function(){var y0=0;if(A.alignmentConstraint.vertical){var o=A.alignmentConstraint.vertical,w0=function $0(v0){var r0=new Set;o[v0].forEach(function(A6){r0.add(A6)});var u0=new Set([].concat(G(r0)).filter(function(A6){return p.has(A6)})),G6=void 0;if(u0.size>0)G6=N[R.get(u0.values().next().value)];else G6=b(r0).x;o[v0].forEach(function(A6){x[y0]=[G6,E[R.get(A6)]],y[y0]=[N[R.get(A6)],E[R.get(A6)]],y0++})};for(var d=0;d<o.length;d++)w0(d);m=!0}if(A.alignmentConstraint.horizontal){var L0=A.alignmentConstraint.horizontal,I0=function $0(v0){var r0=new Set;L0[v0].forEach(function(A6){r0.add(A6)});var u0=new Set([].concat(G(r0)).filter(function(A6){return p.has(A6)})),G6=void 0;if(u0.size>0)G6=N[R.get(u0.values().next().value)];else G6=b(r0).y;L0[v0].forEach(function(A6){x[y0]=[N[R.get(A6)],G6],y[y0]=[N[R.get(A6)],E[R.get(A6)]],y0++})};for(var T0=0;T0<L0.length;T0++)I0(T0);m=!0}if(A.relativePlacementConstraint)g=!0})();else if(A.relativePlacementConstraint){var e=0,G0=0;for(var U0=0;U0<a.length;U0++)if(a[U0].length>e)e=a[U0].length,G0=U0;if(e<l.size/2)_(A.relativePlacementConstraint),m=!1,g=!1;else{var O0=new Map,X0=new Map,E0=[];a[G0].forEach(function(y0){i.get(y0).forEach(function(o){if(o.direction=="horizontal"){if(O0.has(y0))O0.get(y0).push(o);else O0.set(y0,[o]);if(!O0.has(o.id))O0.set(o.id,[]);E0.push({left:y0,right:o.id})}else{if(X0.has(y0))X0.get(y0).push(o);else X0.set(y0,[o]);if(!X0.has(o.id))X0.set(o.id,[]);E0.push({top:y0,bottom:o.id})}})}),_(E0),g=!1;var W0=h(O0,"horizontal"),q0=h(X0,"vertical");a[G0].forEach(function(y0,o){if(y[o]=[N[R.get(y0)],E[R.get(y0)]],x[o]=[],W0.has(y0))x[o][0]=W0.get(y0);else x[o][0]=N[R.get(y0)];if(q0.has(y0))x[o][1]=q0.get(y0);else x[o][1]=E[R.get(y0)]}),m=!0}}if(m){var z0=void 0,K0=q.transpose(x),R0=q.transpose(y);for(var Y0=0;Y0<K0.length;Y0++)K0[Y0]=q.multGamma(K0[Y0]),R0[Y0]=q.multGamma(R0[Y0]);var P0=q.multMat(K0,q.transpose(R0)),F0=F.svd(P0);z0=q.multMat(F0.V,q.transpose(F0.U));for(var m0=0;m0<R.size;m0++){var J0=[N[m0],E[m0]],z6=[z0[0][0],z0[1][0]],t=[z0[0][1],z0[1][1]];N[m0]=q.dotProduct(J0,z6),E[m0]=q.dotProduct(J0,t)}if(g)_(A.relativePlacementConstraint)}}if(W.ENFORCE_CONSTRAINTS){if(A.fixedNodeConstraint&&A.fixedNodeConstraint.length>0){var N0={x:0,y:0};A.fixedNodeConstraint.forEach(function(y0,o){var w0={x:N[R.get(y0.nodeId)],y:E[R.get(y0.nodeId)]},d=y0.position,L0=$(d,w0);N0.x+=L0.x,N0.y+=L0.y}),N0.x/=A.fixedNodeConstraint.length,N0.y/=A.fixedNodeConstraint.length,N.forEach(function(y0,o){N[o]+=N0.x}),E.forEach(function(y0,o){E[o]+=N0.y}),A.fixedNodeConstraint.forEach(function(y0){N[R.get(y0.nodeId)]=y0.position.x,E[R.get(y0.nodeId)]=y0.position.y})}if(A.alignmentConstraint){if(A.alignmentConstraint.vertical){var f0=A.alignmentConstraint.vertical,l0=function y0(o){var w0=new Set;f0[o].forEach(function(I0){w0.add(I0)});var d=new Set([].concat(G(w0)).filter(function(I0){return p.has(I0)})),L0=void 0;if(d.size>0)L0=N[R.get(d.values().next().value)];else L0=b(w0).x;w0.forEach(function(I0){if(!p.has(I0))N[R.get(I0)]=L0})};for(var k0=0;k0<f0.length;k0++)l0(k0)}if(A.alignmentConstraint.horizontal){var _0=A.alignmentConstraint.horizontal,g0=function y0(o){var w0=new Set;_0[o].forEach(function(I0){w0.add(I0)});var d=new Set([].concat(G(w0)).filter(function(I0){return p.has(I0)})),L0=void 0;if(d.size>0)L0=E[R.get(d.values().next().value)];else L0=b(w0).y;w0.forEach(function(I0){if(!p.has(I0))E[R.get(I0)]=L0})};for(var h0=0;h0<_0.length;h0++)g0(h0)}}if(A.relativePlacementConstraint)(function(){var y0=new Map,o=new Map,w0=new Map,d=new Map,L0=new Map,I0=new Map,T0=new Set,$0=new Set;if(p.forEach(function(kJ){T0.add(kJ),$0.add(kJ)}),A.alignmentConstraint){if(A.alignmentConstraint.vertical){var v0=A.alignmentConstraint.vertical,r0=function kJ(p0){w0.set("dummy"+p0,[]),v0[p0].forEach(function(T6){if(y0.set(T6,"dummy"+p0),w0.get("dummy"+p0).push(T6),p.has(T6))T0.add("dummy"+p0)}),L0.set("dummy"+p0,N[R.get(v0[p0][0])])};for(var u0=0;u0<v0.length;u0++)r0(u0)}if(A.alignmentConstraint.horizontal){var G6=A.alignmentConstraint.horizontal,A6=function kJ(p0){d.set("dummy"+p0,[]),G6[p0].forEach(function(T6){if(o.set(T6,"dummy"+p0),d.get("dummy"+p0).push(T6),p.has(T6))$0.add("dummy"+p0)}),I0.set("dummy"+p0,E[R.get(G6[p0][0])])};for(var r6=0;r6<G6.length;r6++)A6(r6)}}var N6=new Map,F6=new Map,P6=function kJ(p0){i.get(p0).forEach(function(T6){var z8=void 0,C6=void 0;if(T6.direction=="horizontal"){if(z8=y0.get(p0)?y0.get(p0):p0,y0.get(T6.id))C6={id:y0.get(T6.id),gap:T6.gap,direction:T6.direction};else C6=T6;if(N6.has(z8))N6.get(z8).push(C6);else N6.set(z8,[C6]);if(!N6.has(C6.id))N6.set(C6.id,[])}else{if(z8=o.get(p0)?o.get(p0):p0,o.get(T6.id))C6={id:o.get(T6.id),gap:T6.gap,direction:T6.direction};else C6=T6;if(F6.has(z8))F6.get(z8).push(C6);else F6.set(z8,[C6]);if(!F6.has(C6.id))F6.set(C6.id,[])}})},M6=!0,g6=!1,O8=void 0;try{for(var a6=i.keys()[Symbol.iterator](),U8;!(M6=(U8=a6.next()).done);M6=!0){var p6=U8.value;P6(p6)}}catch(kJ){g6=!0,O8=kJ}finally{try{if(!M6&&a6.return)a6.return()}finally{if(g6)throw O8}}var u6=v(N6),S0=v(F6),Q6=S(u6),B6=S(S0),D0=f(N6),X6=f(F6),W6=[],_6=[];Q6.forEach(function(kJ,p0){W6[p0]=[],kJ.forEach(function(T6){if(D0.get(T6).length==0)W6[p0].push(T6)})}),B6.forEach(function(kJ,p0){_6[p0]=[],kJ.forEach(function(T6){if(X6.get(T6).length==0)_6[p0].push(T6)})});var c6=h(N6,"horizontal",T0,L0,W6),d6=h(F6,"vertical",$0,I0,_6),l6=function kJ(p0){if(w0.get(p0))w0.get(p0).forEach(function(T6){N[R.get(T6)]=c6.get(p0)});else N[R.get(p0)]=c6.get(p0)},t6=!0,g8=!1,k6=void 0;try{for(var d0=c6.keys()[Symbol.iterator](),V6;!(t6=(V6=d0.next()).done);t6=!0){var Z8=V6.value;l6(Z8)}}catch(kJ){g8=!0,k6=kJ}finally{try{if(!t6&&d0.return)d0.return()}finally{if(g8)throw k6}}var qJ=function kJ(p0){if(d.get(p0))d.get(p0).forEach(function(T6){E[R.get(T6)]=d6.get(p0)});else E[R.get(p0)]=d6.get(p0)},ZJ=!0,q8=!1,B9=void 0;try{for(var m9=d6.keys()[Symbol.iterator](),H7;!(ZJ=(H7=m9.next()).done);ZJ=!0){var Z8=H7.value;qJ(Z8)}}catch(kJ){q8=!0,B9=kJ}finally{try{if(!ZJ&&m9.return)m9.return()}finally{if(q8)throw B9}}})()}for(var t0=0;t0<V.length;t0++){var C0=V[t0];if(C0.getChild()==null)C0.setCenter(N[R.get(C0.id)],E[R.get(C0.id)])}},X.exports=M},551:(X)=>{X.exports=J}},Z={};function U(X){var Y=Z[X];if(Y!==void 0)return Y.exports;var z=Z[X]={exports:{}};return Q[X](z,z.exports,U),z.exports}var K=U(45);return K})()})});var gn0=F4((LV,qU0)=>{(function J(Q,Z){if(typeof LV==="object"&&typeof qU0==="object")qU0.exports=Z(HU0());else if(typeof define==="function"&&define.amd)define(["cose-base"],Z);else if(typeof LV==="object")LV.cytoscapeFcose=Z(HU0());else Q.cytoscapeFcose=Z(Q.coseBase)})(LV,function(J){return(()=>{var Q={658:(X)=>{X.exports=Object.assign!=null?Object.assign.bind(Object):function(Y){for(var z=arguments.length,G=Array(z>1?z-1:0),W=1;W<z;W++)G[W-1]=arguments[W];return G.forEach(function(H){Object.keys(H).forEach(function(q){return Y[q]=H[q]})}),Y}},548:(X,Y,z)=>{var G=function(){function q(F,M){var L=[],A=!0,I=!1,R=void 0;try{for(var N=F[Symbol.iterator](),E;!(A=(E=N.next()).done);A=!0)if(L.push(E.value),M&&L.length===M)break}catch(V){I=!0,R=V}finally{try{if(!A&&N.return)N.return()}finally{if(I)throw R}}return L}return function(F,M){if(Array.isArray(F))return F;else if(Symbol.iterator in Object(F))return q(F,M);else throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),W=z(140).layoutBase.LinkedList,H={};H.getTopMostNodes=function(q){var F={};for(var M=0;M<q.length;M++)F[q[M].id()]=!0;var L=q.filter(function(A,I){if(typeof A==="number")A=I;var R=A.parent()[0];while(R!=null){if(F[R.id()])return!1;R=R.parent()[0]}return!0});return L},H.connectComponents=function(q,F,M,L){var A=new W,I=new Set,R=[],N=void 0,E=void 0,V=void 0,j=!1,T=1,C=[],$=[],b=function h(){var _=q.collection();$.push(_);var S=M[0],v=q.collection();v.merge(S).merge(S.descendants().intersection(F)),R.push(S),v.forEach(function(y){A.push(y),I.add(y),_.merge(y)});var f=function y(){S=A.shift();var m=q.collection();S.neighborhood().nodes().forEach(function(l){if(F.intersection(S.edgesWith(l)).length>0)m.merge(l)});for(var g=0;g<m.length;g++){var p=m[g];if(N=M.intersection(p.union(p.ancestors())),N!=null&&!I.has(N[0])){var i=N.union(N.descendants());i.forEach(function(l){if(A.push(l),I.add(l),_.merge(l),M.has(l))R.push(l)})}}};while(A.length!=0)f();if(_.forEach(function(y){F.intersection(y.connectedEdges()).forEach(function(m){if(_.has(m.source())&&_.has(m.target()))_.merge(m)})}),R.length==M.length)j=!0;if(!j||j&&T>1){E=R[0],V=E.connectedEdges().length,R.forEach(function(y){if(y.connectedEdges().length<V)V=y.connectedEdges().length,E=y}),C.push(E.id());var x=q.collection();x.merge(R[0]),R.forEach(function(y){x.merge(y)}),R=[],M=M.difference(x),T++}};do b();while(!j);if(L){if(C.length>0)L.set("dummy"+(L.size+1),C)}return $},H.relocateComponent=function(q,F,M){if(!M.fixedNodeConstraint){var{POSITIVE_INFINITY:L,NEGATIVE_INFINITY:A,POSITIVE_INFINITY:I,NEGATIVE_INFINITY:R}=Number;if(M.quality=="draft"){var N=!0,E=!1,V=void 0;try{for(var j=F.nodeIndexes[Symbol.iterator](),T;!(N=(T=j.next()).done);N=!0){var C=T.value,$=G(C,2),b=$[0],h=$[1],_=M.cy.getElementById(b);if(_){var S=_.boundingBox(),v=F.xCoords[h]-S.w/2,f=F.xCoords[h]+S.w/2,x=F.yCoords[h]-S.h/2,y=F.yCoords[h]+S.h/2;if(v<L)L=v;if(f>A)A=f;if(x<I)I=x;if(y>R)R=y}}}catch(l){E=!0,V=l}finally{try{if(!N&&j.return)j.return()}finally{if(E)throw V}}var m=q.x-(A+L)/2,g=q.y-(R+I)/2;F.xCoords=F.xCoords.map(function(l){return l+m}),F.yCoords=F.yCoords.map(function(l){return l+g})}else{Object.keys(F).forEach(function(l){var a=F[l],e=a.getRect().x,G0=a.getRect().x+a.getRect().width,U0=a.getRect().y,O0=a.getRect().y+a.getRect().height;if(e<L)L=e;if(G0>A)A=G0;if(U0<I)I=U0;if(O0>R)R=O0});var p=q.x-(A+L)/2,i=q.y-(R+I)/2;Object.keys(F).forEach(function(l){var a=F[l];a.setCenter(a.getCenterX()+p,a.getCenterY()+i)})}}},H.calcBoundingBox=function(q,F,M,L){var{MAX_SAFE_INTEGER:A,MIN_SAFE_INTEGER:I,MAX_SAFE_INTEGER:R,MIN_SAFE_INTEGER:N}=Number,E=void 0,V=void 0,j=void 0,T=void 0,C=q.descendants().not(":parent"),$=C.length;for(var b=0;b<$;b++){var h=C[b];if(E=F[L.get(h.id())]-h.width()/2,V=F[L.get(h.id())]+h.width()/2,j=M[L.get(h.id())]-h.height()/2,T=M[L.get(h.id())]+h.height()/2,A>E)A=E;if(I<V)I=V;if(R>j)R=j;if(N<T)N=T}var _={};return _.topLeftX=A,_.topLeftY=R,_.width=I-A,_.height=N-R,_},H.calcParentsWithoutChildren=function(q,F){var M=q.collection();return F.nodes(":parent").forEach(function(L){var A=!1;if(L.children().forEach(function(I){if(I.css("display")!="none")A=!0}),!A)M.merge(L)}),M},X.exports=H},816:(X,Y,z)=>{var G=z(548),W=z(140).CoSELayout,H=z(140).CoSENode,q=z(140).layoutBase.PointD,F=z(140).layoutBase.DimensionD,M=z(140).layoutBase.LayoutConstants,L=z(140).layoutBase.FDLayoutConstants,A=z(140).CoSEConstants,I=function R(N,E){var{cy:V,eles:j}=N,T=j.nodes(),C=j.edges(),$=void 0,b=void 0,h=void 0,_={};if(N.randomize)$=E.nodeIndexes,b=E.xCoords,h=E.yCoords;var S=function i(l){return typeof l==="function"},v=function i(l,a){if(S(l))return l(a);else return l},f=G.calcParentsWithoutChildren(V,j),x=function i(l,a,e,G0){var U0=a.length;for(var O0=0;O0<U0;O0++){var X0=a[O0],E0=null;if(X0.intersection(f).length==0)E0=X0.children();var W0=void 0,q0=X0.layoutDimensions({nodeDimensionsIncludeLabels:G0.nodeDimensionsIncludeLabels});if(X0.outerWidth()!=null&&X0.outerHeight()!=null)if(G0.randomize)if(!X0.isParent())W0=l.add(new H(e.graphManager,new q(b[$.get(X0.id())]-q0.w/2,h[$.get(X0.id())]-q0.h/2),new F(parseFloat(q0.w),parseFloat(q0.h))));else{var z0=G.calcBoundingBox(X0,b,h,$);if(X0.intersection(f).length==0)W0=l.add(new H(e.graphManager,new q(z0.topLeftX,z0.topLeftY),new F(z0.width,z0.height)));else W0=l.add(new H(e.graphManager,new q(z0.topLeftX,z0.topLeftY),new F(parseFloat(q0.w),parseFloat(q0.h))))}else W0=l.add(new H(e.graphManager,new q(X0.position("x")-q0.w/2,X0.position("y")-q0.h/2),new F(parseFloat(q0.w),parseFloat(q0.h))));else W0=l.add(new H(this.graphManager));if(W0.id=X0.data("id"),W0.nodeRepulsion=v(G0.nodeRepulsion,X0),W0.paddingLeft=parseInt(X0.css("padding")),W0.paddingTop=parseInt(X0.css("padding")),W0.paddingRight=parseInt(X0.css("padding")),W0.paddingBottom=parseInt(X0.css("padding")),G0.nodeDimensionsIncludeLabels)W0.labelWidth=X0.boundingBox({includeLabels:!0,includeNodes:!1,includeOverlays:!1}).w,W0.labelHeight=X0.boundingBox({includeLabels:!0,includeNodes:!1,includeOverlays:!1}).h,W0.labelPosVertical=X0.css("text-valign"),W0.labelPosHorizontal=X0.css("text-halign");if(_[X0.data("id")]=W0,isNaN(W0.rect.x))W0.rect.x=0;if(isNaN(W0.rect.y))W0.rect.y=0;if(E0!=null&&E0.length>0){var K0=void 0;K0=e.getGraphManager().add(e.newGraph(),W0),i(K0,E0,e,G0)}}},y=function i(l,a,e){var G0=0,U0=0;for(var O0=0;O0<e.length;O0++){var X0=e[O0],E0=_[X0.data("source")],W0=_[X0.data("target")];if(E0&&W0&&E0!==W0&&E0.getEdgesBetween(W0).length==0){var q0=a.add(l.newEdge(),E0,W0);q0.id=X0.id(),q0.idealLength=v(N.idealEdgeLength,X0),q0.edgeElasticity=v(N.edgeElasticity,X0),G0+=q0.idealLength,U0++}}if(N.idealEdgeLength!=null){if(U0>0)A.DEFAULT_EDGE_LENGTH=L.DEFAULT_EDGE_LENGTH=G0/U0;else if(!S(N.idealEdgeLength))A.DEFAULT_EDGE_LENGTH=L.DEFAULT_EDGE_LENGTH=N.idealEdgeLength;else A.DEFAULT_EDGE_LENGTH=L.DEFAULT_EDGE_LENGTH=50;A.MIN_REPULSION_DIST=L.MIN_REPULSION_DIST=L.DEFAULT_EDGE_LENGTH/10,A.DEFAULT_RADIAL_SEPARATION=L.DEFAULT_EDGE_LENGTH}},m=function i(l,a){if(a.fixedNodeConstraint)l.constraints.fixedNodeConstraint=a.fixedNodeConstraint;if(a.alignmentConstraint)l.constraints.alignmentConstraint=a.alignmentConstraint;if(a.relativePlacementConstraint)l.constraints.relativePlacementConstraint=a.relativePlacementConstraint};if(N.nestingFactor!=null)A.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=L.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=N.nestingFactor;if(N.gravity!=null)A.DEFAULT_GRAVITY_STRENGTH=L.DEFAULT_GRAVITY_STRENGTH=N.gravity;if(N.numIter!=null)A.MAX_ITERATIONS=L.MAX_ITERATIONS=N.numIter;if(N.gravityRange!=null)A.DEFAULT_GRAVITY_RANGE_FACTOR=L.DEFAULT_GRAVITY_RANGE_FACTOR=N.gravityRange;if(N.gravityCompound!=null)A.DEFAULT_COMPOUND_GRAVITY_STRENGTH=L.DEFAULT_COMPOUND_GRAVITY_STRENGTH=N.gravityCompound;if(N.gravityRangeCompound!=null)A.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=L.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=N.gravityRangeCompound;if(N.initialEnergyOnIncremental!=null)A.DEFAULT_COOLING_FACTOR_INCREMENTAL=L.DEFAULT_COOLING_FACTOR_INCREMENTAL=N.initialEnergyOnIncremental;if(N.tilingCompareBy!=null)A.TILING_COMPARE_BY=N.tilingCompareBy;if(N.quality=="proof")M.QUALITY=2;else M.QUALITY=0;if(A.NODE_DIMENSIONS_INCLUDE_LABELS=L.NODE_DIMENSIONS_INCLUDE_LABELS=M.NODE_DIMENSIONS_INCLUDE_LABELS=N.nodeDimensionsIncludeLabels,A.DEFAULT_INCREMENTAL=L.DEFAULT_INCREMENTAL=M.DEFAULT_INCREMENTAL=!N.randomize,A.ANIMATE=L.ANIMATE=M.ANIMATE=N.animate,A.TILE=N.tile,A.TILING_PADDING_VERTICAL=typeof N.tilingPaddingVertical==="function"?N.tilingPaddingVertical.call():N.tilingPaddingVertical,A.TILING_PADDING_HORIZONTAL=typeof N.tilingPaddingHorizontal==="function"?N.tilingPaddingHorizontal.call():N.tilingPaddingHorizontal,A.DEFAULT_INCREMENTAL=L.DEFAULT_INCREMENTAL=M.DEFAULT_INCREMENTAL=!0,A.PURE_INCREMENTAL=!N.randomize,M.DEFAULT_UNIFORM_LEAF_NODE_SIZES=N.uniformNodeDimensions,N.step=="transformed")A.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,A.ENFORCE_CONSTRAINTS=!1,A.APPLY_LAYOUT=!1;if(N.step=="enforced")A.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,A.ENFORCE_CONSTRAINTS=!0,A.APPLY_LAYOUT=!1;if(N.step=="cose")A.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,A.ENFORCE_CONSTRAINTS=!1,A.APPLY_LAYOUT=!0;if(N.step=="all"){if(N.randomize)A.TRANSFORM_ON_CONSTRAINT_HANDLING=!0;else A.TRANSFORM_ON_CONSTRAINT_HANDLING=!1;A.ENFORCE_CONSTRAINTS=!0,A.APPLY_LAYOUT=!0}if(N.fixedNodeConstraint||N.alignmentConstraint||N.relativePlacementConstraint)A.TREE_REDUCTION_ON_INCREMENTAL=!1;else A.TREE_REDUCTION_ON_INCREMENTAL=!0;var g=new W,p=g.newGraphManager();return x(p.addRoot(),G.getTopMostNodes(T),g,N),y(g,p,C),m(g,N),g.runLayout(),_};X.exports={coseLayout:I}},212:(X,Y,z)=>{var G=function(){function N(E,V){for(var j=0;j<V.length;j++){var T=V[j];if(T.enumerable=T.enumerable||!1,T.configurable=!0,"value"in T)T.writable=!0;Object.defineProperty(E,T.key,T)}}return function(E,V,j){if(V)N(E.prototype,V);if(j)N(E,j);return E}}();function W(N,E){if(!(N instanceof E))throw new TypeError("Cannot call a class as a function")}var H=z(658),q=z(548),F=z(657),M=F.spectralLayout,L=z(816),A=L.coseLayout,I=Object.freeze({quality:"default",randomize:!0,animate:!0,animationDuration:1000,animationEasing:void 0,fit:!0,padding:30,nodeDimensionsIncludeLabels:!1,uniformNodeDimensions:!1,packComponents:!0,step:"all",samplingType:!0,sampleSize:25,nodeSeparation:75,piTol:0.0000001,nodeRepulsion:function N(E){return 4500},idealEdgeLength:function N(E){return 50},edgeElasticity:function N(E){return 0.45},nestingFactor:0.1,gravity:0.25,numIter:2500,tile:!0,tilingCompareBy:void 0,tilingPaddingVertical:10,tilingPaddingHorizontal:10,gravityRangeCompound:1.5,gravityCompound:1,gravityRange:3.8,initialEnergyOnIncremental:0.3,fixedNodeConstraint:void 0,alignmentConstraint:void 0,relativePlacementConstraint:void 0,ready:function N(){},stop:function N(){}}),R=function(){function N(E){W(this,N),this.options=H({},I,E)}return G(N,[{key:"run",value:function E(){var V=this,j=this.options,T=j.cy,C=j.eles,$=[],b=void 0,h=void 0,_=[],S=void 0,v=[];if(j.fixedNodeConstraint&&(!Array.isArray(j.fixedNodeConstraint)||j.fixedNodeConstraint.length==0))j.fixedNodeConstraint=void 0;if(j.alignmentConstraint){if(j.alignmentConstraint.vertical&&(!Array.isArray(j.alignmentConstraint.vertical)||j.alignmentConstraint.vertical.length==0))j.alignmentConstraint.vertical=void 0;if(j.alignmentConstraint.horizontal&&(!Array.isArray(j.alignmentConstraint.horizontal)||j.alignmentConstraint.horizontal.length==0))j.alignmentConstraint.horizontal=void 0}if(j.relativePlacementConstraint&&(!Array.isArray(j.relativePlacementConstraint)||j.relativePlacementConstraint.length==0))j.relativePlacementConstraint=void 0;var f=j.fixedNodeConstraint||j.alignmentConstraint||j.relativePlacementConstraint;if(f)j.tile=!1,j.packComponents=!1;var x=void 0,y=!1;if(T.layoutUtilities&&j.packComponents){if(x=T.layoutUtilities("get"),!x)x=T.layoutUtilities();y=!0}if(C.nodes().length>0)if(!y){var m=j.eles.boundingBox();if(v.push({x:m.x1+m.w/2,y:m.y1+m.h/2}),j.randomize){var g=M(j);$.push(g)}if(j.quality=="default"||j.quality=="proof")_.push(A(j,$[0])),q.relocateComponent(v[0],_[0],j);else q.relocateComponent(v[0],$[0],j)}else{var p=q.getTopMostNodes(j.eles.nodes());if(S=q.connectComponents(T,j.eles,p),S.forEach(function(m0){var J0=m0.boundingBox();v.push({x:J0.x1+J0.w/2,y:J0.y1+J0.h/2})}),j.randomize)S.forEach(function(m0){j.eles=m0,$.push(M(j))});if(j.quality=="default"||j.quality=="proof"){var i=T.collection();if(j.tile){var l=new Map,a=[],e=[],G0=0,U0={nodeIndexes:l,xCoords:a,yCoords:e},O0=[];if(S.forEach(function(m0,J0){if(m0.edges().length==0)m0.nodes().forEach(function(z6,t){if(i.merge(m0.nodes()[t]),!z6.isParent())U0.nodeIndexes.set(m0.nodes()[t].id(),G0++),U0.xCoords.push(m0.nodes()[0].position().x),U0.yCoords.push(m0.nodes()[0].position().y)}),O0.push(J0)}),i.length>1){var X0=i.boundingBox();v.push({x:X0.x1+X0.w/2,y:X0.y1+X0.h/2}),S.push(i),$.push(U0);for(var E0=O0.length-1;E0>=0;E0--)S.splice(O0[E0],1),$.splice(O0[E0],1),v.splice(O0[E0],1)}}S.forEach(function(m0,J0){j.eles=m0,_.push(A(j,$[J0])),q.relocateComponent(v[J0],_[J0],j)})}else S.forEach(function(m0,J0){q.relocateComponent(v[J0],$[J0],j)});var W0=new Set;if(S.length>1){var q0=[],z0=C.filter(function(m0){return m0.css("display")=="none"});S.forEach(function(m0,J0){var z6=void 0;if(j.quality=="draft")z6=$[J0].nodeIndexes;if(m0.nodes().not(z0).length>0){var t={};t.edges=[],t.nodes=[];var N0=void 0;if(m0.nodes().not(z0).forEach(function(f0){if(j.quality=="draft")if(!f0.isParent())N0=z6.get(f0.id()),t.nodes.push({x:$[J0].xCoords[N0]-f0.boundingbox().w/2,y:$[J0].yCoords[N0]-f0.boundingbox().h/2,width:f0.boundingbox().w,height:f0.boundingbox().h});else{var l0=q.calcBoundingBox(f0,$[J0].xCoords,$[J0].yCoords,z6);t.nodes.push({x:l0.topLeftX,y:l0.topLeftY,width:l0.width,height:l0.height})}else if(_[J0][f0.id()])t.nodes.push({x:_[J0][f0.id()].getLeft(),y:_[J0][f0.id()].getTop(),width:_[J0][f0.id()].getWidth(),height:_[J0][f0.id()].getHeight()})}),m0.edges().forEach(function(f0){var l0=f0.source(),k0=f0.target();if(l0.css("display")!="none"&&k0.css("display")!="none"){if(j.quality=="draft"){var _0=z6.get(l0.id()),g0=z6.get(k0.id()),h0=[],t0=[];if(l0.isParent()){var C0=q.calcBoundingBox(l0,$[J0].xCoords,$[J0].yCoords,z6);h0.push(C0.topLeftX+C0.width/2),h0.push(C0.topLeftY+C0.height/2)}else h0.push($[J0].xCoords[_0]),h0.push($[J0].yCoords[_0]);if(k0.isParent()){var y0=q.calcBoundingBox(k0,$[J0].xCoords,$[J0].yCoords,z6);t0.push(y0.topLeftX+y0.width/2),t0.push(y0.topLeftY+y0.height/2)}else t0.push($[J0].xCoords[g0]),t0.push($[J0].yCoords[g0]);t.edges.push({startX:h0[0],startY:h0[1],endX:t0[0],endY:t0[1]})}else if(_[J0][l0.id()]&&_[J0][k0.id()])t.edges.push({startX:_[J0][l0.id()].getCenterX(),startY:_[J0][l0.id()].getCenterY(),endX:_[J0][k0.id()].getCenterX(),endY:_[J0][k0.id()].getCenterY()})}}),t.nodes.length>0)q0.push(t),W0.add(J0)}});var K0=x.packComponents(q0,j.randomize).shifts;if(j.quality=="draft")$.forEach(function(m0,J0){var z6=m0.xCoords.map(function(N0){return N0+K0[J0].dx}),t=m0.yCoords.map(function(N0){return N0+K0[J0].dy});m0.xCoords=z6,m0.yCoords=t});else{var R0=0;W0.forEach(function(m0){Object.keys(_[m0]).forEach(function(J0){var z6=_[m0][J0];z6.setCenter(z6.getCenterX()+K0[R0].dx,z6.getCenterY()+K0[R0].dy)}),R0++})}}}var Y0=function m0(J0,z6){if(j.quality=="default"||j.quality=="proof"){if(typeof J0==="number")J0=z6;var t=void 0,N0=void 0,f0=J0.data("id");if(_.forEach(function(k0){if(f0 in k0)t={x:k0[f0].getRect().getCenterX(),y:k0[f0].getRect().getCenterY()},N0=k0[f0]}),j.nodeDimensionsIncludeLabels){if(N0.labelWidth){if(N0.labelPosHorizontal=="left")t.x+=N0.labelWidth/2;else if(N0.labelPosHorizontal=="right")t.x-=N0.labelWidth/2}if(N0.labelHeight){if(N0.labelPosVertical=="top")t.y+=N0.labelHeight/2;else if(N0.labelPosVertical=="bottom")t.y-=N0.labelHeight/2}}if(t==null)t={x:J0.position("x"),y:J0.position("y")};return{x:t.x,y:t.y}}else{var l0=void 0;if($.forEach(function(k0){var _0=k0.nodeIndexes.get(J0.id());if(_0!=null)l0={x:k0.xCoords[_0],y:k0.yCoords[_0]}}),l0==null)l0={x:J0.position("x"),y:J0.position("y")};return{x:l0.x,y:l0.y}}};if(j.quality=="default"||j.quality=="proof"||j.randomize){var P0=q.calcParentsWithoutChildren(T,C),F0=C.filter(function(m0){return m0.css("display")=="none"});if(j.eles=C.not(F0),C.nodes().not(":parent").not(F0).layoutPositions(V,j,Y0),P0.length>0)P0.forEach(function(m0){m0.position(Y0(m0))})}else console.log("If randomize option is set to false, then quality option must be 'default' or 'proof'.")}}]),N}();X.exports=R},657:(X,Y,z)=>{var G=z(548),W=z(140).layoutBase.Matrix,H=z(140).layoutBase.SVD,q=function F(M){var{cy:L,eles:A}=M,I=A.nodes(),R=A.nodes(":parent"),N=new Map,E=new Map,V=new Map,j=[],T=[],C=[],$=[],b=[],h=[],_=[],S=[],v=void 0,f=void 0,x=1e8,y=0.000000001,m=M.piTol,g=M.samplingType,p=M.nodeSeparation,i=void 0,l=function o(){var w0=0,d=0,L0=!1;while(d<i){w0=Math.floor(Math.random()*f),L0=!1;for(var I0=0;I0<d;I0++)if($[I0]==w0){L0=!0;break}if(!L0)$[d]=w0,d++;else continue}},a=function o(w0,d,L0){var I0=[],T0=0,$0=0,v0=0,r0=void 0,u0=[],G6=0,A6=1;for(var r6=0;r6<f;r6++)u0[r6]=x;I0[$0]=w0,u0[w0]=0;while($0>=T0){v0=I0[T0++];var N6=j[v0];for(var F6=0;F6<N6.length;F6++)if(r0=E.get(N6[F6]),u0[r0]==x)u0[r0]=u0[v0]+1,I0[++$0]=r0;h[v0][d]=u0[v0]*p}if(L0){for(var P6=0;P6<f;P6++)if(h[P6][d]<b[P6])b[P6]=h[P6][d];for(var M6=0;M6<f;M6++)if(b[M6]>G6)G6=b[M6],A6=M6}return A6},e=function o(w0){var d=void 0;if(!w0){l();for(var L0=0;L0<i;L0++)a($[L0],L0,w0,!1)}else{d=Math.floor(Math.random()*f),v=d;for(var I0=0;I0<f;I0++)b[I0]=x;for(var T0=0;T0<i;T0++)$[T0]=d,d=a(d,T0,w0)}for(var $0=0;$0<f;$0++)for(var v0=0;v0<i;v0++)h[$0][v0]*=h[$0][v0];for(var r0=0;r0<i;r0++)_[r0]=[];for(var u0=0;u0<i;u0++)for(var G6=0;G6<i;G6++)_[u0][G6]=h[$[G6]][u0]},G0=function o(){var w0=H.svd(_),d=w0.S,L0=w0.U,I0=w0.V,T0=d[0]*d[0]*d[0],$0=[];for(var v0=0;v0<i;v0++){$0[v0]=[];for(var r0=0;r0<i;r0++)if($0[v0][r0]=0,v0==r0)$0[v0][r0]=d[v0]/(d[v0]*d[v0]+T0/(d[v0]*d[v0]))}S=W.multMat(W.multMat(I0,$0),W.transpose(L0))},U0=function o(){var w0=void 0,d=void 0,L0=[],I0=[],T0=[],$0=[];for(var v0=0;v0<f;v0++)L0[v0]=Math.random(),I0[v0]=Math.random();L0=W.normalize(L0),I0=W.normalize(I0);var r0=0,u0=y,G6=y,A6=void 0;while(!0){r0++;for(var r6=0;r6<f;r6++)T0[r6]=L0[r6];if(L0=W.multGamma(W.multL(W.multGamma(T0),h,S)),w0=W.dotProduct(T0,L0),L0=W.normalize(L0),u0=W.dotProduct(T0,L0),A6=Math.abs(u0/G6),A6<=1+m&&A6>=1)break;G6=u0}for(var N6=0;N6<f;N6++)T0[N6]=L0[N6];r0=0,G6=y;while(!0){r0++;for(var F6=0;F6<f;F6++)$0[F6]=I0[F6];if($0=W.minusOp($0,W.multCons(T0,W.dotProduct(T0,$0))),I0=W.multGamma(W.multL(W.multGamma($0),h,S)),d=W.dotProduct($0,I0),I0=W.normalize(I0),u0=W.dotProduct($0,I0),A6=Math.abs(u0/G6),A6<=1+m&&A6>=1)break;G6=u0}for(var P6=0;P6<f;P6++)$0[P6]=I0[P6];T=W.multCons(T0,Math.sqrt(Math.abs(w0))),C=W.multCons($0,Math.sqrt(Math.abs(d)))};G.connectComponents(L,A,G.getTopMostNodes(I),N),R.forEach(function(o){G.connectComponents(L,A,G.getTopMostNodes(o.descendants().intersection(A)),N)});var O0=0;for(var X0=0;X0<I.length;X0++)if(!I[X0].isParent())E.set(I[X0].id(),O0++);var E0=!0,W0=!1,q0=void 0;try{for(var z0=N.keys()[Symbol.iterator](),K0;!(E0=(K0=z0.next()).done);E0=!0){var R0=K0.value;E.set(R0,O0++)}}catch(o){W0=!0,q0=o}finally{try{if(!E0&&z0.return)z0.return()}finally{if(W0)throw q0}}for(var Y0=0;Y0<E.size;Y0++)j[Y0]=[];R.forEach(function(o){var w0=o.children().intersection(A);while(w0.nodes(":childless").length==0)w0=w0.nodes()[0].children().intersection(A);var d=0,L0=w0.nodes(":childless")[0].connectedEdges().length;w0.nodes(":childless").forEach(function(I0,T0){if(I0.connectedEdges().length<L0)L0=I0.connectedEdges().length,d=T0}),V.set(o.id(),w0.nodes(":childless")[d].id())}),I.forEach(function(o){var w0=void 0;if(o.isParent())w0=E.get(V.get(o.id()));else w0=E.get(o.id());o.neighborhood().nodes().forEach(function(d){if(A.intersection(o.edgesWith(d)).length>0)if(d.isParent())j[w0].push(V.get(d.id()));else j[w0].push(d.id())})});var P0=function o(w0){var d=E.get(w0),L0=void 0;N.get(w0).forEach(function(I0){if(L.getElementById(I0).isParent())L0=V.get(I0);else L0=I0;j[d].push(L0),j[E.get(L0)].push(w0)})},F0=!0,m0=!1,J0=void 0;try{for(var z6=N.keys()[Symbol.iterator](),t;!(F0=(t=z6.next()).done);F0=!0){var N0=t.value;P0(N0)}}catch(o){m0=!0,J0=o}finally{try{if(!F0&&z6.return)z6.return()}finally{if(m0)throw J0}}f=E.size;var f0=void 0;if(f>2){i=f<M.sampleSize?f:M.sampleSize;for(var l0=0;l0<f;l0++)h[l0]=[];for(var k0=0;k0<i;k0++)S[k0]=[];if(M.quality=="draft"||M.step=="all")e(g),G0(),U0(),f0={nodeIndexes:E,xCoords:T,yCoords:C};else E.forEach(function(o,w0){T.push(L.getElementById(w0).position("x")),C.push(L.getElementById(w0).position("y"))}),f0={nodeIndexes:E,xCoords:T,yCoords:C};return f0}else{var _0=E.keys(),g0=L.getElementById(_0.next().value),h0=g0.position(),t0=g0.outerWidth();if(T.push(h0.x),C.push(h0.y),f==2){var C0=L.getElementById(_0.next().value),y0=C0.outerWidth();T.push(h0.x+t0/2+y0/2+M.idealEdgeLength),C.push(h0.y)}return f0={nodeIndexes:E,xCoords:T,yCoords:C},f0}};X.exports={spectralLayout:q}},579:(X,Y,z)=>{var G=z(212),W=function H(q){if(!q)return;q("layout","fcose",G)};if(typeof cytoscape!=="undefined")W(cytoscape);X.exports=W},140:(X)=>{X.exports=J}},Z={};function U(X){var Y=Z[X];if(Y!==void 0)return Y.exports;var z=Z[X]={exports:{}};return Q[X](z,z.exports,U),z.exports}var K=U(579);return K})()})});var Qs0={};QJ(Qs0,{diagram:()=>qr6});function rn0(J,Q,Z){J.forEach((U)=>{Q.add({group:"nodes",data:{type:"service",id:U.id,icon:U.icon,label:U.title,parent:U.in,width:Z.getConfigField("iconSize"),height:Z.getConfigField("iconSize")},classes:"node-service"})})}function nn0(J,Q,Z){J.forEach((U)=>{Q.add({group:"nodes",data:{type:"junction",id:U.id,parent:U.in,width:Z.getConfigField("iconSize"),height:Z.getConfigField("iconSize")},classes:"node-junction"})})}function sn0(J,Q){Q.nodes().map((Z)=>{let U=tI(Z);if(U.type==="group")return;U.x=Z.position().x,U.y=Z.position().y,J.getElementById(U.id).attr("transform","translate("+(U.x||0)+","+(U.y||0)+")")})}function an0(J,Q){J.forEach((Z)=>{Q.add({group:"nodes",data:{type:"group",id:Z.id,icon:Z.icon,label:Z.title,parent:Z.in},classes:"node-group"})})}function on0(J,Q){J.forEach((Z)=>{let{lhsId:U,rhsId:K,lhsInto:X,lhsGroup:Y,rhsInto:z,lhsDir:G,rhsDir:W,rhsGroup:H,title:q}=Z,F=BU0(Z.lhsDir,Z.rhsDir)?"segments":"straight",M={id:`${U}-${K}`,label:q,source:U,sourceDir:G,sourceArrow:X,sourceGroup:Y,sourceEndpoint:G==="L"?"0 50%":G==="R"?"100% 50%":G==="T"?"50% 0":"50% 100%",target:K,targetDir:W,targetArrow:z,targetGroup:H,targetEndpoint:W==="L"?"0 50%":W==="R"?"100% 50%":W==="T"?"50% 0":"50% 100%"};Q.add({group:"edges",data:M,classes:F})})}function tn0(J,Q,Z){let U=w((z,G)=>{return Object.entries(z).reduce((W,[H,q])=>{let F=0,M=Object.entries(q);if(M.length===1)return W[H]=M[0][1],W;for(let L=0;L<M.length-1;L++)for(let A=L+1;A<M.length;A++){let[I,R]=M[L],[N,E]=M[A];if(Z[I]?.[N]===G)W[H]??=[],W[H]=[...W[H],...R,...E];else if(I==="default"||N==="default")W[H]??=[],W[H]=[...W[H],...R,...E];else{let j=`${H}-${F++}`;W[j]=R;let T=`${H}-${F++}`;W[T]=E}}return W},{})},"flattenAlignments"),K=Q.map((z)=>{let G={},W={};return Object.entries(z).forEach(([H,[q,F]])=>{let M=J.getNode(H)?.in??"default";G[F]??={},G[F][M]??=[],G[F][M].push(H),W[q]??={},W[q][M]??=[],W[q][M].push(H)}),{horiz:Object.values(U(G,"horizontal")).filter((H)=>H.length>1),vert:Object.values(U(W,"vertical")).filter((H)=>H.length>1)}}),[X,Y]=K.reduce(([z,G],{horiz:W,vert:H})=>{return[[...z,...W],[...G,...H]]},[[],[]]);return{horizontal:X,vertical:Y}}function en0(J,Q){let Z=[],U=w((X)=>`${X[0]},${X[1]}`,"posToStr"),K=w((X)=>X.split(",").map((Y)=>parseInt(Y)),"strToPos");return J.forEach((X)=>{let Y=Object.fromEntries(Object.entries(X).map(([H,q])=>[U(q),H])),z=[U([0,0])],G={},W={L:[-1,0],R:[1,0],T:[0,1],B:[0,-1]};while(z.length>0){let H=z.shift();if(H){G[H]=1;let q=Y[H];if(q){let F=K(H);Object.entries(W).forEach(([M,L])=>{let A=U([F[0]+L[0],F[1]+L[1]]),I=Y[A];if(I&&!G[A])z.push(A),Z.push({[mn0[M]]:I,[mn0[ri6(M)]]:q,gap:1.5*Q.getConfigField("iconSize")})})}}}}),Z}function Js0(J,Q,Z,U,K,{spatialMaps:X,groupAlignments:Y}){return new Promise((z)=>{let G=j6("body").append("div").attr("id","cy").attr("style","display:none"),W=SX({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"straight",label:"data(label)","source-endpoint":"data(sourceEndpoint)","target-endpoint":"data(targetEndpoint)"}},{selector:"edge.segments",style:{"curve-style":"segments","segment-weights":"0","segment-distances":[0.5],"edge-distances":"endpoints","source-endpoint":"data(sourceEndpoint)","target-endpoint":"data(targetEndpoint)"}},{selector:"node",style:{"compound-sizing-wrt-labels":"include"}},{selector:"node[label]",style:{"text-valign":"bottom","text-halign":"center","font-size":`${K.getConfigField("fontSize")}px`}},{selector:".node-service",style:{label:"data(label)",width:"data(width)",height:"data(height)"}},{selector:".node-junction",style:{width:"data(width)",height:"data(height)"}},{selector:".node-group",style:{padding:`${K.getConfigField("padding")}px`}}],layout:{name:"grid",boundingBox:{x1:0,x2:100,y1:0,y2:100}}});G.remove(),an0(Z,W),rn0(J,W,K),nn0(Q,W,K),on0(U,W);let H=tn0(K,X,Y),q=en0(X,K),F=W.layout({name:"fcose",quality:"proof",styleEnabled:!1,animate:!1,nodeDimensionsIncludeLabels:!1,idealEdgeLength(M){let[L,A]=M.connectedNodes(),{parent:I}=tI(L),{parent:R}=tI(A);return I===R?1.5*K.getConfigField("iconSize"):0.5*K.getConfigField("iconSize")},edgeElasticity(M){let[L,A]=M.connectedNodes(),{parent:I}=tI(L),{parent:R}=tI(A);return I===R?0.45:0.001},alignmentConstraint:H,relativePlacementConstraint:q});F.one("layoutstop",()=>{function M(L,A,I,R){let N,E,{x:V,y:j}=L,{x:T,y:C}=A;E=(R-j+(V-I)*(j-C)/(V-T))/Math.sqrt(1+Math.pow((j-C)/(V-T),2)),N=Math.sqrt(Math.pow(R-j,2)+Math.pow(I-V,2)-Math.pow(E,2));let $=Math.sqrt(Math.pow(T-V,2)+Math.pow(C-j,2));N=N/$;let b=(T-V)*(R-j)-(C-j)*(I-V);switch(!0){case b>=0:b=1;break;case b<0:b=-1;break}let h=(T-V)*(I-V)+(C-j)*(R-j);switch(!0){case h>=0:h=1;break;case h<0:h=-1;break}return E=Math.abs(E)*b,N=N*h,{distances:E,weights:N}}w(M,"getSegmentWeights"),W.startBatch();for(let L of Object.values(W.edges()))if(L.data?.()){let{x:A,y:I}=L.source().position(),{x:R,y:N}=L.target().position();if(A!==R&&I!==N){let E=L.sourceEndpoint(),V=L.targetEndpoint(),{sourceDir:j}=cn0(L),[T,C]=N2(j)?[E.x,V.y]:[V.x,E.y],{weights:$,distances:b}=M(E,V,T,C);L.style("segment-distances",b),L.style("segment-weights",$)}}W.endBatch(),F.run()}),F.run(),W.ready((M)=>{B0.info("Ready",M),z(W)})})}var in0,mn0,un0,eg,ri6,pn0,dU,N2,BU0,ni6,si6,FU0,ai6,oi6,ti6,ei6,Jr6,cn0,tI,Qr6,ln0,Zr6,dn0,Ur6,Kr6,oI,AV,Xr6,Yr6,zr6,Gr6,Wr6,Hr6,qr6;var Zs0=r(()=>{Xz();CZ();pB();X7();nJ();NJ();q2();gJ0();in0=J6(gn0(),1);vJ();mn0={L:"left",R:"right",T:"top",B:"bottom"},un0={L:w((J)=>`${J},${J/2} 0,${J} 0,0`,"L"),R:w((J)=>`0,${J/2} ${J},0 ${J},${J}`,"R"),T:w((J)=>`0,0 ${J},0 ${J/2},${J}`,"T"),B:w((J)=>`${J/2},0 ${J},${J} 0,${J}`,"B")},eg={L:w((J,Q)=>J-Q+2,"L"),R:w((J,Q)=>J-2,"R"),T:w((J,Q)=>J-Q+2,"T"),B:w((J,Q)=>J-2,"B")},ri6=w(function(J){if(dU(J))return J==="L"?"R":"L";else return J==="T"?"B":"T"},"getOppositeArchitectureDirection"),pn0=w(function(J){let Q=J;return Q==="L"||Q==="R"||Q==="T"||Q==="B"},"isArchitectureDirection"),dU=w(function(J){let Q=J;return Q==="L"||Q==="R"},"isArchitectureDirectionX"),N2=w(function(J){let Q=J;return Q==="T"||Q==="B"},"isArchitectureDirectionY"),BU0=w(function(J,Q){let Z=dU(J)&&N2(Q),U=N2(J)&&dU(Q);return Z||U},"isArchitectureDirectionXY"),ni6=w(function(J){let Q=J[0],Z=J[1],U=dU(Q)&&N2(Z),K=N2(Q)&&dU(Z);return U||K},"isArchitecturePairXY"),si6=w(function(J){return J!=="LL"&&J!=="RR"&&J!=="TT"&&J!=="BB"},"isValidArchitectureDirectionPair"),FU0=w(function(J,Q){let Z=`${J}${Q}`;return si6(Z)?Z:void 0},"getArchitectureDirectionPair"),ai6=w(function([J,Q],Z){let U=Z[0],K=Z[1];if(dU(U))if(N2(K))return[J+(U==="L"?-1:1),Q+(K==="T"?1:-1)];else return[J+(U==="L"?-1:1),Q];else if(dU(K))return[J+(K==="L"?1:-1),Q+(U==="T"?1:-1)];else return[J,Q+(U==="T"?1:-1)]},"shiftPositionByArchitectureDirectionPair"),oi6=w(function(J){if(J==="LT"||J==="TL")return[1,1];else if(J==="BL"||J==="LB")return[1,-1];else if(J==="BR"||J==="RB")return[-1,-1];else return[-1,1]},"getArchitectureDirectionXYFactors"),ti6=w(function(J,Q){if(BU0(J,Q))return"bend";else if(dU(J))return"horizontal";return"vertical"},"getArchitectureDirectionAlignment"),ei6=w(function(J){return J.type==="service"},"isArchitectureService"),Jr6=w(function(J){return J.type==="junction"},"isArchitectureJunction"),cn0=w((J)=>{return J.data()},"edgeData"),tI=w((J)=>{return J.data()},"nodeData"),Qr6=TJ.architecture,ln0=class{constructor(){this.nodes={},this.groups={},this.edges=[],this.registeredIds={},this.elements={},this.setAccTitle=tJ,this.getAccTitle=X9,this.setDiagramTitle=M9,this.getDiagramTitle=G9,this.getAccDescription=z9,this.setAccDescription=Y9,this.clear()}static{w(this,"ArchitectureDB")}clear(){this.nodes={},this.groups={},this.edges=[],this.registeredIds={},this.dataStructures=void 0,this.elements={},rJ()}addService({id:J,icon:Q,in:Z,title:U,iconText:K}){if(this.registeredIds[J]!==void 0)throw new Error(`The service id [${J}] is already in use by another ${this.registeredIds[J]}`);if(Z!==void 0){if(J===Z)throw new Error(`The service [${J}] cannot be placed within itself`);if(this.registeredIds[Z]===void 0)throw new Error(`The service [${J}]'s parent does not exist. Please make sure the parent is created before this service`);if(this.registeredIds[Z]==="node")throw new Error(`The service [${J}]'s parent is not a group`)}this.registeredIds[J]="node",this.nodes[J]={id:J,type:"service",icon:Q,iconText:K,title:U,edges:[],in:Z}}getServices(){return Object.values(this.nodes).filter(ei6)}addJunction({id:J,in:Q}){this.registeredIds[J]="node",this.nodes[J]={id:J,type:"junction",edges:[],in:Q}}getJunctions(){return Object.values(this.nodes).filter(Jr6)}getNodes(){return Object.values(this.nodes)}getNode(J){return this.nodes[J]??null}addGroup({id:J,icon:Q,in:Z,title:U}){if(this.registeredIds?.[J]!==void 0)throw new Error(`The group id [${J}] is already in use by another ${this.registeredIds[J]}`);if(Z!==void 0){if(J===Z)throw new Error(`The group [${J}] cannot be placed within itself`);if(this.registeredIds?.[Z]===void 0)throw new Error(`The group [${J}]'s parent does not exist. Please make sure the parent is created before this group`);if(this.registeredIds?.[Z]==="node")throw new Error(`The group [${J}]'s parent is not a group`)}this.registeredIds[J]="group",this.groups[J]={id:J,icon:Q,title:U,in:Z}}getGroups(){return Object.values(this.groups)}addEdge({lhsId:J,rhsId:Q,lhsDir:Z,rhsDir:U,lhsInto:K,rhsInto:X,lhsGroup:Y,rhsGroup:z,title:G}){if(!pn0(Z))throw new Error(`Invalid direction given for left hand side of edge ${J}--${Q}. Expected (L,R,T,B) got ${String(Z)}`);if(!pn0(U))throw new Error(`Invalid direction given for right hand side of edge ${J}--${Q}. Expected (L,R,T,B) got ${String(U)}`);if(this.nodes[J]===void 0&&this.groups[J]===void 0)throw new Error(`The left-hand id [${J}] does not yet exist. Please create the service/group before declaring an edge to it.`);if(this.nodes[Q]===void 0&&this.groups[Q]===void 0)throw new Error(`The right-hand id [${Q}] does not yet exist. Please create the service/group before declaring an edge to it.`);let W=this.nodes[J].in,H=this.nodes[Q].in;if(Y&&W&&H&&W==H)throw new Error(`The left-hand id [${J}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);if(z&&W&&H&&W==H)throw new Error(`The right-hand id [${Q}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);let q={lhsId:J,lhsDir:Z,lhsInto:K,lhsGroup:Y,rhsId:Q,rhsDir:U,rhsInto:X,rhsGroup:z,title:G};if(this.edges.push(q),this.nodes[J]&&this.nodes[Q])this.nodes[J].edges.push(this.edges[this.edges.length-1]),this.nodes[Q].edges.push(this.edges[this.edges.length-1])}getEdges(){return this.edges}getDataStructures(){if(this.dataStructures===void 0){let J={},Q=Object.entries(this.nodes).reduce((z,[G,W])=>{return z[G]=W.edges.reduce((H,q)=>{let F=this.getNode(q.lhsId)?.in,M=this.getNode(q.rhsId)?.in;if(F&&M&&F!==M){let L=ti6(q.lhsDir,q.rhsDir);if(L!=="bend")J[F]??={},J[F][M]=L,J[M]??={},J[M][F]=L}if(q.lhsId===G){let L=FU0(q.lhsDir,q.rhsDir);if(L)H[L]=q.rhsId}else{let L=FU0(q.rhsDir,q.lhsDir);if(L)H[L]=q.lhsId}return H},{}),z},{}),Z=Object.keys(Q)[0],U={[Z]:1},K=Object.keys(Q).reduce((z,G)=>G===Z?z:{...z,[G]:1},{}),X=w((z)=>{let G={[z]:[0,0]},W=[z];while(W.length>0){let H=W.shift();if(H){U[H]=1,delete K[H];let q=Q[H],[F,M]=G[H];Object.entries(q).forEach(([L,A])=>{if(!U[A])G[A]=ai6([F,M],L),W.push(A)})}}return G},"BFS"),Y=[X(Z)];while(Object.keys(K).length>0)Y.push(X(Object.keys(K)[0]));this.dataStructures={adjList:Q,spatialMaps:Y,groupAlignments:J}}return this.dataStructures}setElementForId(J,Q){this.elements[J]=Q}getElementById(J){return this.elements[J]}getConfig(){return R4({...Qr6,...CJ().architecture})}getConfigField(J){return this.getConfig()[J]}},Zr6=w((J,Q)=>{CK(J,Q),J.groups.map((Z)=>Q.addGroup(Z)),J.services.map((Z)=>Q.addService({...Z,type:"service"})),J.junctions.map((Z)=>Q.addJunction({...Z,type:"junction"})),J.edges.map((Z)=>Q.addEdge(Z))},"populateDb"),dn0={parser:{yy:void 0},parse:w(async(J)=>{let Q=await pU("architecture",J);B0.debug(Q);let Z=dn0.parser?.yy;if(!(Z instanceof ln0))throw new Error("parser.parser?.yy was not a ArchitectureDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");Zr6(Q,Z)},"parse")},Ur6=w((J)=>`
|
|
2951
2951
|
.edge {
|
|
2952
2952
|
stroke-width: ${J.archEdgeWidth};
|
|
2953
2953
|
stroke: ${J.archEdgeColor};
|
|
@@ -3062,7 +3062,7 @@ Please change the parent <Route path="${N}"> to <Route path="${N==="/"?"*":`${N}
|
|
|
3062
3062
|
|
|
3063
3063
|
If you want to hide the \`${Q.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
3064
3064
|
|
|
3065
|
-
For more information, see https://radix-ui.com/primitives/docs/components/${Q.docsSlug}`;return $7.useEffect(()=>{if(J){if(!document.getElementById(J))console.error(Z)}},[Z,J]),null},mB6="DialogDescriptionWarning",uB6=({contentRef:J,descriptionId:Q})=>{let U=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${gR0(mB6).contentName}}.`;return $7.useEffect(()=>{let K=J.current?.getAttribute("aria-describedby");if(Q&&K){if(!document.getElementById(Q))console.warn(U)}},[U,J,Q]),null},mR0=VR0;var uR0=SR0,pR0=$R0,cR0=vR0,lR0=fR0,dR0=bR0,iR0=hR0;var BX=J6(MJ(),1),gY=mR0;var cB6=uR0;var rR0=nD.default.forwardRef(({className:J,...Q},Z)=>BX.jsxDEV(pR0,{ref:Z,className:_J("fixed inset-0 z-50 bg-black/50 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",J),...Q},void 0,!1,void 0,this));rR0.displayName="DialogOverlay";var N1=nD.default.forwardRef(({className:J,children:Q,...Z},U)=>BX.jsxDEV(cB6,{children:[BX.jsxDEV(rR0,{},void 0,!1,void 0,this),BX.jsxDEV(cR0,{ref:U,"aria-describedby":void 0,className:_J("fixed left-[50%] top-[50%] z-50 w-full max-w-md translate-x-[-50%] translate-y-[-50%] border border-border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] rounded-lg",J),...Z,children:[Q,BX.jsxDEV(iR0,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[BX.jsxDEV(FZ,{className:"h-4 w-4"},void 0,!1,void 0,this),BX.jsxDEV("span",{className:"sr-only",children:"Close"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this));N1.displayName="DialogContent";var D1=({className:J,...Q})=>BX.jsxDEV("div",{className:_J("flex flex-col space-y-1.5 text-center sm:text-left",J),...Q},void 0,!1,void 0,this);D1.displayName="DialogHeader";var TG=({className:J,...Q})=>BX.jsxDEV("div",{className:_J("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",J),...Q},void 0,!1,void 0,this);TG.displayName="DialogFooter";var w1=nD.default.forwardRef(({className:J,...Q},Z)=>BX.jsxDEV(lR0,{ref:Z,className:_J("text-lg font-semibold leading-none tracking-tight",J),...Q},void 0,!1,void 0,this));w1.displayName="DialogTitle";var cv=nD.default.forwardRef(({className:J,...Q},Z)=>BX.jsxDEV(dR0,{ref:Z,className:_J("text-sm text-muted-foreground",J),...Q},void 0,!1,void 0,this));cv.displayName="DialogDescription";var mY=()=>{let J=localStorage.getItem("caw_client_id");if(!J)J=crypto.randomUUID(),localStorage.setItem("caw_client_id",J);return J};var x6=J6(MJ(),1),kn=["name-asc","name-desc","id-asc","id-desc"],lB6={"name-asc":MH,"name-desc":OH,"id-asc":FD,"id-desc":BD},dB6={"name-asc":"Sorted by name (A-Z)","name-desc":"Sorted by name (Z-A)","id-asc":"Sorted by ID (oldest first)","id-desc":"Sorted by ID (newest first)"},iB6=(J,Q)=>{return[...J].sort((Z,U)=>{if(Z.isFolder&&!U.isFolder)return-1;if(!Z.isFolder&&U.isFolder)return 1;switch(Q){case"name-asc":return(Z.name||"").localeCompare(U.name||"");case"name-desc":return(U.name||"").localeCompare(Z.name||"");case"id-asc":return(Z.id||"").localeCompare(U.id||"");case"id-desc":return(U.id||"").localeCompare(Z.id||"");default:return(Z.name||"").localeCompare(U.name||"")}})},lv=({status:J,onRetry:Q})=>{if(J==="error")return x6.jsxDEV("span",{className:"text-xs text-destructive flex items-center gap-2",children:[x6.jsxDEV(N7,{className:"w-3 h-3"},void 0,!1,void 0,this),"Save failed",x6.jsxDEV("button",{onClick:Q,className:"underline hover:no-underline",children:"Retry"},void 0,!1,void 0,this)]},void 0,!0,void 0,this);return null},dv=({type:J,typeName:Q,typeNamePlural:Z,DetailPanel:U,hooks:K,enableCollectionMode:X=!1,renderTreeItemExtras:Y})=>{return()=>{let{id:G,storeCode:W}=OF(),H=y7(),{data:q}=wH(G);TI0(G);let F=W??"A",[M,L]=iJ.useState("name-asc"),{expandedFolderIds:A,selectedId:I,setSelectedId:R,expandFolder:N,retryFolder:E}=yI0(),{treeData:V,isInitialLoading:j,isRootError:T,rootError:C}=hI0(G,F,A,J),$=iJ.useMemo(()=>{let c0=(T6)=>{return iB6(T6,M).map((C6)=>{if(C6.children&&C6.children.length>0)return{...C6,children:c0(C6.children)};return C6})};return c0(V)},[V,M]),b=iJ.useCallback((c0,T6)=>{if(!c0.isFolder)return;if(T6)N(c0.id)},[N]),[h,_]=iJ.useState(!1),[S,v]=iJ.useState(0),f=()=>{_(!h),v((c0)=>c0+1)},x=()=>{let T6=(kn.indexOf(M)+1)%kn.length;L(kn[T6])},[y,m]=iJ.useState(null),[g,p]=iJ.useState(""),[i,l]=iJ.useState(""),[a,e]=iJ.useState(!1),[G0,U0]=iJ.useState(null),[O0,X0]=iJ.useState(null),[E0,W0]=iJ.useState(!1),[q0,z0]=iJ.useState(!1),[K0,R0]=iJ.useState(!1),[Y0,P0]=iJ.useState(""),[F0,m0]=iJ.useState(""),[J0,z6]=iJ.useState(!1),[t,N0]=iJ.useState(null),[f0,l0]=iJ.useState(!1),[k0,_0]=iJ.useState(""),[g0,h0]=iJ.useState(null),[t0,C0]=iJ.useState(null),[y0,o]=iJ.useState(!1),[w0,d]=iJ.useState("idle"),[L0,I0]=iJ.useState(!1),[T0,$0]=iJ.useState([]),v0=iJ.useRef(Promise.resolve()),r0=iJ.useRef(null),u0=y&&!y.isFolder,G6=y&&y.isFolder,{data:A6}=K.useItem(G,u0?I:null),{data:r6=[]}=K.useVersions(G,u0?I:null),N6=K.useCreate(G),F6=K.useSaveDraft(G),P6=K.usePublish(G),M6=K.useDiscard(G),g6=K.useDelete(G),O8=K.useUpdatePath(G),a6=fI0(G),U8=_I0(G),p6=bI0(G),u6=xI0(G),S0=iJ.useMemo(()=>gr((c0,T6)=>{d("saving");let z8=F6.mutateAsync({id:c0,content:T6,clientId:mY()}).then(()=>{d("saved"),l(T6)}).catch((C6)=>{d("error")});v0.current=z8},15000),[F6]),Q6=(c0)=>{if(p(c0),c0!==i)S0(I,c0);else S0.cancel(),d("saved")};iJ.useEffect(()=>{return()=>{S0.flush()}},[S0]),iJ.useEffect(()=>{if(!A6||!I)return;if(r0.current!==I){r0.current=I;let c0=A6.draftContent??A6.publishedContent??"";p(c0),l(c0)}},[A6,I]);let B6=g!==i,D0=A6?.hasDraft??!1;iJ.useEffect(()=>{U0(null),X0(null),e(!1),z6(!1),N0(null),d("idle")},[I]);let X6=async(c0)=>{if(!G||!I)return;N0(null),U0(c0);try{let T6=await K.getVersion(G,I,c0);X0(T6.content)}catch(T6){N0(T6.message),U0(null)}},W6=()=>{U0(null),X0(null),e(!1)},_6=async()=>{if(!I)return;N0(null),S0.flush(),await v0.current;try{await P6.mutateAsync({id:I}),z6(!1)}catch(c0){N0(c0.message)}},c6=()=>{if(I)S0.cancel(),M6.mutate({id:I},{onSuccess:()=>{let c0=A6?.publishedContent??"";p(c0),l(c0),d("saved")}})},d6=()=>{S0(I,g)},l6=()=>{if(!I)return;let c0=I;if(G6)u6.mutate({id:c0},{onSuccess:()=>{R(null),m(null),W0(!1)},onError:(T6)=>{N0(T6.message),W0(!1)}});else g6.mutate({id:c0},{onSuccess:()=>{R(null),m(null),W0(!1)},onError:(T6)=>{N0(T6.message),W0(!1)}})},t6=()=>{let c0=Y0.trim();if(!c0||c0.includes("/"))return;let T6=G6&&y?.path?y.path:"",z8=T6?`${T6}/${c0}`:c0;N6.mutate({type:J,path:z8,store:F},{onSuccess:(C6)=>{z0(!1),P0(""),R(C6.id),m({id:C6.id,name:c0,isFolder:!1,path:z8,storeCode:F}),z6(!0),p(""),l(""),I0(!0)}})},g8=()=>{let c0=F0.trim();if(!c0||c0.includes("/"))return;let T6=G6&&y?.path?y.path:"",z8=T6?`${T6}/${c0}`:c0;a6.mutate({path:z8,store:F,type:J},{onSuccess:(C6)=>{R0(!1),m0(""),R(C6.id),m({id:C6.id,name:c0,isFolder:!0,path:z8,storeCode:F})},onError:(C6)=>{N0(C6.message)}})},k6=()=>{m0(""),R0(!0)},d0=()=>{P0(""),z0(!0)},V6=()=>{if(!y)return;if(u0&&A6){let c0=A6.path.split("/"),T6=c0[c0.length-1];_0(T6)}else if(G6)_0(y.name);l0(!0)},Z8=()=>{if(!y||!k0.trim())return;let c0=k0.trim();if(G6){U8.mutate({id:I,name:c0},{onSuccess:()=>{m((C6)=>({...C6,name:c0})),l0(!1),_0("")},onError:(C6)=>{N0(C6.message)}});return}if(!A6)return;let T6=A6.path.split("/");T6[T6.length-1]=c0;let z8=T6.join("/");O8.mutate({id:I,path:z8},{onSuccess:()=>{m((C6)=>({...C6,name:c0,path:z8})),l0(!1),_0("")},onError:(C6)=>{N0(C6.message)}})},qJ=(c0)=>{h0(c0)},ZJ=(c0,T6)=>{if(!c0)return;if(I&&I!==c0.id)S0.flush();if(X&&(T6?.metaKey||T6?.ctrlKey)&&!c0.isFolder)$0((z8)=>{if(z8.includes(c0.id))return z8.filter((C6)=>C6!==c0.id);else return[...z8,c0.id]});else if(R(c0.id),m(c0),!c0.isFolder&&X)$0([])},q8=(c0)=>{C0(c0),setTimeout(()=>C0(null),2000)},B9=async()=>{if(!I||!A6)return;let c0=A6.draftContent??A6.publishedContent??"";try{await navigator.clipboard.writeText(c0),q8("Content copied")}catch(T6){N0("Failed to copy content")}},m9=async()=>{if(X&&T0.length>0)try{await navigator.clipboard.writeText(T0.join(",")),q8("IDs copied"),$0([])}catch(c0){N0("Failed to copy IDs")}else if(I)try{await navigator.clipboard.writeText(I),q8("ID copied")}catch(c0){N0("Failed to copy ID")}},H7=async()=>{if(!I)return;o(!0);try{let T6=(await Cv(G,{folderId:I,type:J})).map((z8)=>z8.id);if(T6.length===0){q8("Folder is empty");return}await navigator.clipboard.writeText(T6.join(",")),q8(`${T6.length} ID${T6.length===1?"":"s"} copied`)}catch(c0){N0("Failed to copy IDs")}finally{o(!1)}},kJ=(c0)=>{if(!g0){h0(null);return}if(!c0.isFolder){h0(null);return}if(g0.storeCode&&c0.storeCode&&g0.storeCode!==c0.storeCode){q8("Cannot move between stores"),h0(null);return}if(g0.isFolder){let T6=c0.id;if(!T6){q8("Cannot move folder - invalid target"),h0(null);return}p6.mutate({id:g0.id,parentId:T6},{onSuccess:()=>{h0(null)},onError:(z8)=>{N0(z8.message),h0(null)}})}else{let T6=c0.path?`${c0.path}/${g0.name}`:g0.name;if(T6===g0.path){h0(null);return}O8.mutate({id:g0.id,path:T6},{onSuccess:()=>{h0(null)},onError:(z8)=>{N0(z8.message),h0(null)}})}};if(j)return x6.jsxDEV("div",{className:"p-6",children:x6.jsxDEV("p",{className:"text-muted-foreground",children:"Loading..."},void 0,!1,void 0,this)},void 0,!1,void 0,this);if(T){let c0=yY(F,J);return x6.jsxDEV("div",{className:"p-6",children:[x6.jsxDEV("p",{className:"text-destructive",children:["Error: ",C?.message??`Failed to load ${Z.toLowerCase()}`]},void 0,!0,void 0,this),x6.jsxDEV(D8,{variant:"outline",size:"sm",className:"mt-2",onClick:()=>E(c0,H,G,F),children:"Retry"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}if($.length===0&&!q0&&!K0)return x6.jsxDEV("div",{className:"p-6",children:x6.jsxDEV("div",{className:"flex items-center justify-center h-96",children:x6.jsxDEV("div",{className:"text-center",children:[x6.jsxDEV(DF,{className:"w-12 h-12 text-muted-foreground/50 mx-auto mb-3"},void 0,!1,void 0,this),x6.jsxDEV("h3",{className:"text-lg font-medium text-foreground mb-1",children:["No ",Z]},void 0,!0,void 0,this),x6.jsxDEV("p",{className:"text-sm text-muted-foreground mb-4",children:["Create a ",Q.toLowerCase()," or folder to get started."]},void 0,!0,void 0,this),x6.jsxDEV("div",{className:"flex gap-2 justify-center",children:[x6.jsxDEV(D8,{variant:"outline",onClick:d0,children:[x6.jsxDEV(DH,{className:"w-4 h-4 mr-2"},void 0,!1,void 0,this),"New ",Q]},void 0,!0,void 0,this),x6.jsxDEV(D8,{variant:"outline",onClick:k6,children:[x6.jsxDEV(jY,{className:"w-4 h-4 mr-2"},void 0,!1,void 0,this),"New Folder"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this);return x6.jsxDEV("div",{className:"h-full flex gap-6 p-6",children:[x6.jsxDEV("div",{className:"w-80 flex-shrink-0 flex flex-col",children:[x6.jsxDEV("div",{className:"flex items-center justify-between mb-4",children:[x6.jsxDEV("div",{className:"flex items-center gap-2",children:[x6.jsxDEV("h2",{className:"text-lg font-semibold text-foreground",children:Z},void 0,!1,void 0,this),x6.jsxDEV(D8,{size:"icon",variant:"ghost",onClick:x,title:dB6[M],className:"h-8 w-8",children:iJ.default.createElement(lB6[M],{className:"w-4 h-4"})},void 0,!1,void 0,this),x6.jsxDEV(D8,{size:"icon",variant:"ghost",onClick:f,title:h?"Collapse all folders":"Expand all folders",className:"h-8 w-8",children:h?x6.jsxDEV(AD,{className:"w-4 h-4"},void 0,!1,void 0,this):x6.jsxDEV(ID,{className:"w-4 h-4"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),x6.jsxDEV("div",{className:"flex gap-1",children:[x6.jsxDEV(D8,{size:"sm",variant:"warning",onClick:d0,title:`New ${Q}`,children:x6.jsxDEV(DH,{className:"w-4 h-4"},void 0,!1,void 0,this)},void 0,!1,void 0,this),x6.jsxDEV(D8,{size:"sm",variant:"outline",onClick:k6,title:"New Folder",children:x6.jsxDEV(jY,{className:"w-4 h-4"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),x6.jsxDEV("div",{className:"flex-1 overflow-auto min-h-0",onClick:(c0)=>{if(c0.target===c0.currentTarget){if(R(null),m(null),X)$0([])}},onDragOver:(c0)=>{if(g0)c0.preventDefault()},onDrop:(c0)=>{if(g0){c0.preventDefault();let T6=yY(F,J);kJ({isFolder:!0,path:"",storeCode:F,id:T6})}},children:$.length>0?x6.jsxDEV(wD,{data:$,initialSelectedItemId:I,onSelectChange:ZJ,onExpand:b,expandAll:h,defaultLeafIcon:yO,defaultNodeIcon:DF,handleDragStart:qJ,handleDrop:kJ,draggedItem:g0,renderItem:({item:c0,isLeaf:T6,isOpen:z8})=>{let C6=c0.isFolder&&c0.isLoading,wJ=c0.isFolder&&c0.isError,x0=c0.isFolder?C6?mQ:z8?RF:DF:c0.hasDraft?IH:yO,fQ=X&&!c0.isFolder&&T0.includes(c0.id),p0=fQ?T0.indexOf(c0.id)+1:null,xJ=`h-4 w-4 shrink-0 ${C6?"animate-spin text-blue-500":""}`,YQ=()=>{if(c0.isFolder&&!C6){if(wJ)return{fill:"#fee2e2",stroke:"#dc2626"};return{fill:"#dbeafe",stroke:"#000000"}}if(!c0.isFolder&&c0.hasDraft)return{fill:"#fcd34d",stroke:"#000000"};return{}};return x6.jsxDEV("div",{className:`flex items-center gap-2 min-w-0 ${fQ?"text-primary font-medium":""}`,children:[x6.jsxDEV(x0,{className:_J(xJ,!c0.isFolder&&!c0.hasDraft&&"text-muted-foreground"),...YQ()},void 0,!1,void 0,this),x6.jsxDEV("span",{className:"text-sm truncate",children:c0.name},void 0,!1,void 0,this),wJ&&x6.jsxDEV("span",{className:"inline-flex items-center rounded border px-1.5 py-0.5 text-[10px] font-mono text-red-700 border-red-300 bg-red-50",title:"Failed to load - click to expand and retry",children:"Failed"},void 0,!1,void 0,this),x6.jsxDEV("span",{className:"inline-flex items-center rounded border px-1.5 py-0.5 text-[10px] font-mono text-muted-foreground border-border/60 bg-muted/40",title:`${c0.isFolder?"Folder":Q} ID: ${c0.id}`,children:c0.id},void 0,!1,void 0,this),!c0.isFolder&&c0.versionCount>0&&x6.jsxDEV("span",{className:"inline-flex items-center rounded border px-1.5 py-0.5 text-[10px] font-mono text-green-700 border-green-300 bg-green-50",title:`Published version ${c0.versionCount}`,children:["v",c0.versionCount]},void 0,!0,void 0,this),!c0.isFolder&&c0.isBeingEdited&&x6.jsxDEV("span",{className:"inline-flex items-center",title:`${Q} is being edited`,children:x6.jsxDEV(q5,{className:"h-3 w-3 text-orange-500"},void 0,!1,void 0,this)},void 0,!1,void 0,this),fQ&&x6.jsxDEV("span",{className:"inline-flex items-center justify-center w-5 h-5 rounded-full text-[10px] font-bold text-white bg-primary",title:`Selected #${p0}`,children:p0},void 0,!1,void 0,this),Y&&Y({item:c0})]},void 0,!0,void 0,this)}},S,!1,void 0,this):x6.jsxDEV("p",{className:"text-sm text-muted-foreground py-4",children:["No ",Z.toLowerCase()," or folders"]},void 0,!0,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),u0&&A6&&x6.jsxDEV(U,{projectId:G,selectedId:I,selectedItem:y,selectedItemData:A6,versions:r6,draftContent:g,serverContent:i,isDirty:B6,hasDraft:D0,isEditing:J0,setIsEditing:z6,viewingVersion:G0,versionContent:O0,showVersions:a,setShowVersions:e,showRename:f0,setShowRename:l0,renameFilename:k0,setRenameFilename:_0,actionError:t,setActionError:N0,saveStatus:w0,handleEditorChange:Q6,handleViewVersion:X6,handleBackToEdit:W6,handlePublish:_6,handleDiscardDraft:c6,handleRetry:d6,handleOpenRename:V6,handleRename:Z8,handleCopyContent:B9,handleCopyIds:m9,setShowDeleteConfirm:W0,publishMutation:P6,discardMutation:M6,updatePathMutation:O8,debouncedSave:S0,collectedIds:T0,showToast:q8,typeName:Q,triggerEditMode:L0,setTriggerEditMode:I0},void 0,!1,void 0,this),G6&&y&&x6.jsxDEV("div",{className:"flex-1 flex flex-col min-h-0",children:[x6.jsxDEV("div",{className:"flex items-center gap-2 mb-3",children:[!y.isRoot&&x6.jsxDEV(D8,{onClick:V6,variant:"outline",size:"sm",children:[x6.jsxDEV(RH,{className:"w-4 h-4 mr-1"},void 0,!1,void 0,this),"Rename"]},void 0,!0,void 0,this),!y.isRoot&&x6.jsxDEV(D8,{onClick:()=>W0(!0),variant:"destructive",size:"sm",children:[x6.jsxDEV(M1,{className:"w-4 h-4 mr-1"},void 0,!1,void 0,this),"Delete"]},void 0,!0,void 0,this),x6.jsxDEV(D8,{onClick:H7,variant:"outline",size:"sm",disabled:y0,title:"Copy IDs of immediate children",children:[y0?x6.jsxDEV(mQ,{className:"w-4 h-4 mr-1 animate-spin"},void 0,!1,void 0,this):x6.jsxDEV(WK,{className:"w-4 h-4 mr-1"},void 0,!1,void 0,this),y0?"Copying...":"Copy"]},void 0,!0,void 0,this),x6.jsxDEV(D8,{onClick:m9,variant:"outline",size:"sm",title:"Copy folder ID",children:[x6.jsxDEV(AG,{className:"w-4 h-4 mr-1"},void 0,!1,void 0,this),"IDs"]},void 0,!0,void 0,this),x6.jsxDEV("div",{className:"flex-1"},void 0,!1,void 0,this),x6.jsxDEV("div",{className:"text-right",children:[x6.jsxDEV("div",{className:"font-medium text-base text-foreground",children:y.name},void 0,!1,void 0,this),x6.jsxDEV("div",{className:"text-xs text-muted-foreground",children:y.id},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),t&&x6.jsxDEV("div",{className:"mb-3 p-3 border border-destructive rounded-md bg-destructive/10 flex items-center justify-between",children:[x6.jsxDEV("div",{className:"flex items-center gap-2 text-destructive",children:[x6.jsxDEV(N7,{className:"w-4 h-4"},void 0,!1,void 0,this),x6.jsxDEV("span",{className:"text-sm",children:t},void 0,!1,void 0,this)]},void 0,!0,void 0,this),x6.jsxDEV(D8,{variant:"ghost",size:"icon",onClick:()=>N0(null),className:"h-6 w-6",children:x6.jsxDEV(FZ,{className:"w-4 h-4"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),f0&&x6.jsxDEV("div",{className:"mb-3 p-3 border border-border rounded-md bg-muted",children:[x6.jsxDEV("div",{className:"flex items-center gap-2 text-foreground mb-2",children:[x6.jsxDEV(q5,{className:"w-4 h-4"},void 0,!1,void 0,this),x6.jsxDEV("span",{className:"font-medium",children:"Rename folder"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),x6.jsxDEV("input",{type:"text",value:k0,onChange:(c0)=>_0(c0.target.value),placeholder:"New folder name",className:"w-full px-3 py-2 text-sm border border-border rounded bg-background text-foreground mb-3",autoFocus:!0,onKeyDown:(c0)=>{if(c0.key==="Enter")Z8();if(c0.key==="Escape")l0(!1)}},void 0,!1,void 0,this),x6.jsxDEV("div",{className:"flex gap-2",children:[x6.jsxDEV(D8,{onClick:Z8,variant:"default",size:"sm",disabled:U8.isPending||!k0.trim(),children:U8.isPending?"Renaming...":"Rename"},void 0,!1,void 0,this),x6.jsxDEV(D8,{onClick:()=>l0(!1),variant:"outline",size:"sm",children:"Cancel"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),t0&&x6.jsxDEV("div",{className:"fixed bottom-4 right-4 bg-foreground text-background px-4 py-2 rounded-md shadow-lg text-sm animate-in fade-in slide-in-from-bottom-2",children:t0},void 0,!1,void 0,this),x6.jsxDEV(gY,{open:G6&&E0,onOpenChange:(c0)=>W0(c0),children:x6.jsxDEV(N1,{children:[x6.jsxDEV(D1,{children:x6.jsxDEV(w1,{className:"flex items-center gap-2 text-destructive",children:[x6.jsxDEV(N7,{className:"w-5 h-5"},void 0,!1,void 0,this),"Delete Folder"]},void 0,!0,void 0,this)},void 0,!1,void 0,this),x6.jsxDEV("div",{className:"py-4",children:[x6.jsxDEV("p",{className:"text-sm text-muted-foreground",children:["Are you sure you want to delete ",x6.jsxDEV("span",{className:"font-medium text-foreground",children:y?.name},void 0,!1,void 0,this),"?"]},void 0,!0,void 0,this),x6.jsxDEV("p",{className:"text-sm text-muted-foreground mt-2",children:"This will delete the folder and all its contents. It can be restored later."},void 0,!1,void 0,this)]},void 0,!0,void 0,this),x6.jsxDEV(TG,{children:[x6.jsxDEV(D8,{variant:"outline",onClick:()=>W0(!1),children:"Cancel"},void 0,!1,void 0,this),x6.jsxDEV(D8,{variant:"destructive",onClick:l6,disabled:u6.isPending,children:u6.isPending?"Deleting...":"Delete"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),x6.jsxDEV(gY,{open:u0&&E0,onOpenChange:(c0)=>W0(c0),children:x6.jsxDEV(N1,{children:[x6.jsxDEV(D1,{children:x6.jsxDEV(w1,{className:"flex items-center gap-2 text-destructive",children:[x6.jsxDEV(N7,{className:"w-5 h-5"},void 0,!1,void 0,this),"Delete ",Q]},void 0,!0,void 0,this)},void 0,!1,void 0,this),x6.jsxDEV("div",{className:"py-4",children:[x6.jsxDEV("p",{className:"text-sm text-muted-foreground",children:["Are you sure you want to delete ",x6.jsxDEV("span",{className:"font-medium text-foreground",children:A6?.path},void 0,!1,void 0,this),"?"]},void 0,!0,void 0,this),x6.jsxDEV("p",{className:"text-sm text-muted-foreground mt-2",children:["This will soft-delete the ",Q.toLowerCase(),". It can be restored later."]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),x6.jsxDEV(TG,{children:[x6.jsxDEV(D8,{variant:"outline",onClick:()=>W0(!1),children:"Cancel"},void 0,!1,void 0,this),x6.jsxDEV(D8,{variant:"destructive",onClick:l6,disabled:g6.isPending,children:g6.isPending?"Deleting...":"Delete"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),x6.jsxDEV(gY,{open:q0,onOpenChange:(c0)=>{if(z0(c0),!c0)P0("")},children:x6.jsxDEV(N1,{children:[x6.jsxDEV(D1,{children:x6.jsxDEV(w1,{children:["New ",Q]},void 0,!0,void 0,this)},void 0,!1,void 0,this),x6.jsxDEV("div",{className:"py-4",children:[G6&&y?.path&&x6.jsxDEV("p",{className:"text-xs text-muted-foreground mb-2",children:["Creating in: ",x6.jsxDEV("span",{className:"font-mono",children:[y.path,"/"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),x6.jsxDEV("input",{type:"text",value:Y0,onChange:(c0)=>P0(c0.target.value.replace(/\//g,"")),placeholder:J==="d"?"example.md":"greeting.md",className:"w-full px-3 py-2 border border-input rounded-md bg-background text-foreground text-sm focus:outline-none focus:ring-2 focus:ring-ring",onKeyDown:(c0)=>c0.key==="Enter"&&t6(),autoFocus:!0},void 0,!1,void 0,this)]},void 0,!0,void 0,this),x6.jsxDEV(TG,{children:[x6.jsxDEV(D8,{variant:"outline",onClick:()=>{z0(!1),P0("")},children:"Cancel"},void 0,!1,void 0,this),x6.jsxDEV(D8,{onClick:t6,disabled:N6.isPending||!Y0.trim(),children:N6.isPending?"Creating...":"Create"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),x6.jsxDEV(gY,{open:K0,onOpenChange:(c0)=>{if(R0(c0),!c0)m0("")},children:x6.jsxDEV(N1,{children:[x6.jsxDEV(D1,{children:x6.jsxDEV(w1,{children:"New Folder"},void 0,!1,void 0,this)},void 0,!1,void 0,this),x6.jsxDEV("div",{className:"py-4",children:[G6&&y?.path&&x6.jsxDEV("p",{className:"text-xs text-muted-foreground mb-2",children:["Creating in: ",x6.jsxDEV("span",{className:"font-mono",children:[y.path,"/"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),x6.jsxDEV("input",{type:"text",value:F0,onChange:(c0)=>m0(c0.target.value.replace(/\//g,"")),placeholder:"my-folder",className:"w-full px-3 py-2 border border-input rounded-md bg-background text-foreground text-sm focus:outline-none focus:ring-2 focus:ring-ring",onKeyDown:(c0)=>c0.key==="Enter"&&g8(),autoFocus:!0},void 0,!1,void 0,this)]},void 0,!0,void 0,this),x6.jsxDEV(TG,{children:[x6.jsxDEV(D8,{variant:"outline",onClick:()=>{R0(!1),m0("")},children:"Cancel"},void 0,!1,void 0,this),x6.jsxDEV(D8,{onClick:g8,disabled:a6.isPending||!F0.trim(),children:a6.isPending?"Creating...":"Create"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}};var hK=J6(n6(),1);var sZ=J6(n6(),1);function nR0(J,Q){(Q==null||Q>J.length)&&(Q=J.length);for(var Z=0,U=Array(Q);Z<Q;Z++)U[Z]=J[Z];return U}function rB6(J){if(Array.isArray(J))return J}function nB6(J,Q,Z){return(Q=eB6(Q))in J?Object.defineProperty(J,Q,{value:Z,enumerable:!0,configurable:!0,writable:!0}):J[Q]=Z,J}function sB6(J,Q){var Z=J==null?null:typeof Symbol!="undefined"&&J[Symbol.iterator]||J["@@iterator"];if(Z!=null){var U,K,X,Y,z=[],G=!0,W=!1;try{if(X=(Z=Z.call(J)).next,Q===0);else for(;!(G=(U=X.call(Z)).done)&&(z.push(U.value),z.length!==Q);G=!0);}catch(H){W=!0,K=H}finally{try{if(!G&&Z.return!=null&&(Y=Z.return(),Object(Y)!==Y))return}finally{if(W)throw K}}return z}}function aB6(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
3065
|
+
For more information, see https://radix-ui.com/primitives/docs/components/${Q.docsSlug}`;return $7.useEffect(()=>{if(J){if(!document.getElementById(J))console.error(Z)}},[Z,J]),null},mB6="DialogDescriptionWarning",uB6=({contentRef:J,descriptionId:Q})=>{let U=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${gR0(mB6).contentName}}.`;return $7.useEffect(()=>{let K=J.current?.getAttribute("aria-describedby");if(Q&&K){if(!document.getElementById(Q))console.warn(U)}},[U,J,Q]),null},mR0=VR0;var uR0=SR0,pR0=$R0,cR0=vR0,lR0=fR0,dR0=bR0,iR0=hR0;var BX=J6(MJ(),1),gY=mR0;var cB6=uR0;var rR0=nD.default.forwardRef(({className:J,...Q},Z)=>BX.jsxDEV(pR0,{ref:Z,className:_J("fixed inset-0 z-50 bg-black/50 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",J),...Q},void 0,!1,void 0,this));rR0.displayName="DialogOverlay";var N1=nD.default.forwardRef(({className:J,children:Q,...Z},U)=>BX.jsxDEV(cB6,{children:[BX.jsxDEV(rR0,{},void 0,!1,void 0,this),BX.jsxDEV(cR0,{ref:U,"aria-describedby":void 0,className:_J("fixed left-[50%] top-[50%] z-50 w-full max-w-md translate-x-[-50%] translate-y-[-50%] border border-border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] rounded-lg",J),...Z,children:[Q,BX.jsxDEV(iR0,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[BX.jsxDEV(FZ,{className:"h-4 w-4"},void 0,!1,void 0,this),BX.jsxDEV("span",{className:"sr-only",children:"Close"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this));N1.displayName="DialogContent";var D1=({className:J,...Q})=>BX.jsxDEV("div",{className:_J("flex flex-col space-y-1.5 text-center sm:text-left",J),...Q},void 0,!1,void 0,this);D1.displayName="DialogHeader";var TG=({className:J,...Q})=>BX.jsxDEV("div",{className:_J("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",J),...Q},void 0,!1,void 0,this);TG.displayName="DialogFooter";var w1=nD.default.forwardRef(({className:J,...Q},Z)=>BX.jsxDEV(lR0,{ref:Z,className:_J("text-lg font-semibold leading-none tracking-tight",J),...Q},void 0,!1,void 0,this));w1.displayName="DialogTitle";var cv=nD.default.forwardRef(({className:J,...Q},Z)=>BX.jsxDEV(dR0,{ref:Z,className:_J("text-sm text-muted-foreground",J),...Q},void 0,!1,void 0,this));cv.displayName="DialogDescription";var mY=()=>{let J=localStorage.getItem("caw_client_id");if(!J)J=crypto.randomUUID(),localStorage.setItem("caw_client_id",J);return J};var x6=J6(MJ(),1),kn=["name-asc","name-desc","id-asc","id-desc"],lB6={"name-asc":MH,"name-desc":OH,"id-asc":FD,"id-desc":BD},dB6={"name-asc":"Sorted by name (A-Z)","name-desc":"Sorted by name (Z-A)","id-asc":"Sorted by ID (oldest first)","id-desc":"Sorted by ID (newest first)"},iB6=(J,Q)=>{return[...J].sort((Z,U)=>{if(Z.isFolder&&!U.isFolder)return-1;if(!Z.isFolder&&U.isFolder)return 1;switch(Q){case"name-asc":return(Z.name||"").localeCompare(U.name||"");case"name-desc":return(U.name||"").localeCompare(Z.name||"");case"id-asc":return(Z.id||"").localeCompare(U.id||"");case"id-desc":return(U.id||"").localeCompare(Z.id||"");default:return(Z.name||"").localeCompare(U.name||"")}})},lv=({status:J,onRetry:Q})=>{if(J==="error")return x6.jsxDEV("span",{className:"text-xs text-destructive flex items-center gap-2",children:[x6.jsxDEV(N7,{className:"w-3 h-3"},void 0,!1,void 0,this),"Save failed",x6.jsxDEV("button",{onClick:Q,className:"underline hover:no-underline",children:"Retry"},void 0,!1,void 0,this)]},void 0,!0,void 0,this);return null},dv=({type:J,typeName:Q,typeNamePlural:Z,DetailPanel:U,hooks:K,enableCollectionMode:X=!1,renderTreeItemExtras:Y})=>{return()=>{let{id:G,storeCode:W}=OF(),H=y7(),{data:q}=wH(G);TI0(G);let F=W??"A",[M,L]=iJ.useState("name-asc"),{expandedFolderIds:A,selectedId:I,setSelectedId:R,expandFolder:N,retryFolder:E}=yI0(),{treeData:V,isInitialLoading:j,isRootError:T,rootError:C}=hI0(G,F,A,J),$=iJ.useMemo(()=>{let p0=(T6)=>{return iB6(T6,M).map((C6)=>{if(C6.children&&C6.children.length>0)return{...C6,children:p0(C6.children)};return C6})};return p0(V)},[V,M]),b=iJ.useCallback((p0,T6)=>{if(!p0.isFolder)return;if(T6)N(p0.id)},[N]),[h,_]=iJ.useState(!1),[S,v]=iJ.useState(0),f=()=>{_(!h),v((p0)=>p0+1)},x=()=>{let T6=(kn.indexOf(M)+1)%kn.length;L(kn[T6])},[y,m]=iJ.useState(null),[g,p]=iJ.useState(""),[i,l]=iJ.useState(""),[a,e]=iJ.useState(!1),[G0,U0]=iJ.useState(null),[O0,X0]=iJ.useState(null),[E0,W0]=iJ.useState(!1),[q0,z0]=iJ.useState(!1),[K0,R0]=iJ.useState(!1),[Y0,P0]=iJ.useState(""),[F0,m0]=iJ.useState(""),[J0,z6]=iJ.useState(!1),[t,N0]=iJ.useState(null),[f0,l0]=iJ.useState(!1),[k0,_0]=iJ.useState(""),[g0,h0]=iJ.useState(null),[t0,C0]=iJ.useState(null),[y0,o]=iJ.useState(!1),[w0,d]=iJ.useState("idle"),[L0,I0]=iJ.useState(!1),[T0,$0]=iJ.useState([]),v0=iJ.useRef(Promise.resolve()),r0=iJ.useRef(null),u0=y&&!y.isFolder,G6=y&&y.isFolder,{data:A6}=K.useItem(G,u0?I:null),{data:r6=[]}=K.useVersions(G,u0?I:null),N6=K.useCreate(G),F6=K.useSaveDraft(G),P6=K.usePublish(G),M6=K.useDiscard(G),g6=K.useDelete(G),O8=K.useUpdatePath(G),a6=fI0(G),U8=_I0(G),p6=bI0(G),u6=xI0(G),S0=iJ.useMemo(()=>gr((p0,T6)=>{d("saving");let z8=F6.mutateAsync({id:p0,content:T6,clientId:mY()}).then(()=>{d("saved"),l(T6)}).catch((C6)=>{d("error")});v0.current=z8},15000),[F6]),Q6=(p0)=>{if(p(p0),p0!==i)S0(I,p0);else S0.cancel(),d("saved")};iJ.useEffect(()=>{return()=>{S0.flush()}},[S0]),iJ.useEffect(()=>{if(!A6||!I)return;let p0=A6.draftContent??A6.publishedContent??"";if(r0.current!==I){r0.current=I,p(p0),l(p0);return}if(p0!==i&&g===i)p(p0),l(p0)},[A6,I,i,g]);let B6=g!==i,D0=A6?.hasDraft??!1;iJ.useEffect(()=>{U0(null),X0(null),e(!1),z6(!1),N0(null),d("idle")},[I]);let X6=async(p0)=>{if(!G||!I)return;N0(null),U0(p0);try{let T6=await K.getVersion(G,I,p0);X0(T6.content)}catch(T6){N0(T6.message),U0(null)}},W6=()=>{U0(null),X0(null),e(!1)},_6=async()=>{if(!I)return;N0(null),S0.flush(),await v0.current;try{await P6.mutateAsync({id:I}),z6(!1)}catch(p0){N0(p0.message)}},c6=()=>{if(I)S0.cancel(),M6.mutate({id:I},{onSuccess:()=>{let p0=A6?.publishedContent??"";p(p0),l(p0),d("saved")}})},d6=()=>{S0(I,g)},l6=()=>{if(!I)return;let p0=I;if(G6)u6.mutate({id:p0},{onSuccess:()=>{R(null),m(null),W0(!1)},onError:(T6)=>{N0(T6.message),W0(!1)}});else g6.mutate({id:p0},{onSuccess:()=>{R(null),m(null),W0(!1)},onError:(T6)=>{N0(T6.message),W0(!1)}})},t6=()=>{let p0=Y0.trim();if(!p0||p0.includes("/"))return;let T6=G6&&y?.path?y.path:"",z8=T6?`${T6}/${p0}`:p0;N6.mutate({type:J,path:z8,store:F},{onSuccess:(C6)=>{z0(!1),P0(""),R(C6.id),m({id:C6.id,name:p0,isFolder:!1,path:z8,storeCode:F}),z6(!0),p(""),l(""),I0(!0)}})},g8=()=>{let p0=F0.trim();if(!p0||p0.includes("/"))return;let T6=G6&&y?.path?y.path:"",z8=T6?`${T6}/${p0}`:p0;a6.mutate({path:z8,store:F,type:J},{onSuccess:(C6)=>{R0(!1),m0(""),R(C6.id),m({id:C6.id,name:p0,isFolder:!0,path:z8,storeCode:F})},onError:(C6)=>{N0(C6.message)}})},k6=()=>{m0(""),R0(!0)},d0=()=>{P0(""),z0(!0)},V6=()=>{if(!y)return;if(u0&&A6){let p0=A6.path.split("/"),T6=p0[p0.length-1];_0(T6)}else if(G6)_0(y.name);l0(!0)},Z8=()=>{if(!y||!k0.trim())return;let p0=k0.trim();if(G6){U8.mutate({id:I,name:p0},{onSuccess:()=>{m((C6)=>({...C6,name:p0})),l0(!1),_0("")},onError:(C6)=>{N0(C6.message)}});return}if(!A6)return;let T6=A6.path.split("/");T6[T6.length-1]=p0;let z8=T6.join("/");O8.mutate({id:I,path:z8},{onSuccess:()=>{m((C6)=>({...C6,name:p0,path:z8})),l0(!1),_0("")},onError:(C6)=>{N0(C6.message)}})},qJ=(p0)=>{h0(p0)},ZJ=(p0,T6)=>{if(!p0)return;if(I&&I!==p0.id)S0.flush();if(X&&(T6?.metaKey||T6?.ctrlKey)&&!p0.isFolder)$0((z8)=>{if(z8.includes(p0.id))return z8.filter((C6)=>C6!==p0.id);else return[...z8,p0.id]});else if(R(p0.id),m(p0),!p0.isFolder&&X)$0([])},q8=(p0)=>{C0(p0),setTimeout(()=>C0(null),2000)},B9=async()=>{if(!I||!A6)return;let p0=A6.draftContent??A6.publishedContent??"";try{await navigator.clipboard.writeText(p0),q8("Content copied")}catch(T6){N0("Failed to copy content")}},m9=async()=>{if(X&&T0.length>0)try{await navigator.clipboard.writeText(T0.join(",")),q8("IDs copied"),$0([])}catch(p0){N0("Failed to copy IDs")}else if(I)try{await navigator.clipboard.writeText(I),q8("ID copied")}catch(p0){N0("Failed to copy ID")}},H7=async()=>{if(!I)return;o(!0);try{let T6=(await Cv(G,{folderId:I,type:J})).map((z8)=>z8.id);if(T6.length===0){q8("Folder is empty");return}await navigator.clipboard.writeText(T6.join(",")),q8(`${T6.length} ID${T6.length===1?"":"s"} copied`)}catch(p0){N0("Failed to copy IDs")}finally{o(!1)}},kJ=(p0)=>{if(!g0){h0(null);return}if(!p0.isFolder){h0(null);return}if(g0.storeCode&&p0.storeCode&&g0.storeCode!==p0.storeCode){q8("Cannot move between stores"),h0(null);return}if(g0.isFolder){let T6=p0.id;if(!T6){q8("Cannot move folder - invalid target"),h0(null);return}p6.mutate({id:g0.id,parentId:T6},{onSuccess:()=>{h0(null)},onError:(z8)=>{N0(z8.message),h0(null)}})}else{let T6=p0.path?`${p0.path}/${g0.name}`:g0.name;if(T6===g0.path){h0(null);return}O8.mutate({id:g0.id,path:T6},{onSuccess:()=>{h0(null)},onError:(z8)=>{N0(z8.message),h0(null)}})}};if(j)return x6.jsxDEV("div",{className:"p-6",children:x6.jsxDEV("p",{className:"text-muted-foreground",children:"Loading..."},void 0,!1,void 0,this)},void 0,!1,void 0,this);if(T){let p0=yY(F,J);return x6.jsxDEV("div",{className:"p-6",children:[x6.jsxDEV("p",{className:"text-destructive",children:["Error: ",C?.message??`Failed to load ${Z.toLowerCase()}`]},void 0,!0,void 0,this),x6.jsxDEV(D8,{variant:"outline",size:"sm",className:"mt-2",onClick:()=>E(p0,H,G,F),children:"Retry"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}if($.length===0&&!q0&&!K0)return x6.jsxDEV("div",{className:"p-6",children:x6.jsxDEV("div",{className:"flex items-center justify-center h-96",children:x6.jsxDEV("div",{className:"text-center",children:[x6.jsxDEV(DF,{className:"w-12 h-12 text-muted-foreground/50 mx-auto mb-3"},void 0,!1,void 0,this),x6.jsxDEV("h3",{className:"text-lg font-medium text-foreground mb-1",children:["No ",Z]},void 0,!0,void 0,this),x6.jsxDEV("p",{className:"text-sm text-muted-foreground mb-4",children:["Create a ",Q.toLowerCase()," or folder to get started."]},void 0,!0,void 0,this),x6.jsxDEV("div",{className:"flex gap-2 justify-center",children:[x6.jsxDEV(D8,{variant:"outline",onClick:d0,children:[x6.jsxDEV(DH,{className:"w-4 h-4 mr-2"},void 0,!1,void 0,this),"New ",Q]},void 0,!0,void 0,this),x6.jsxDEV(D8,{variant:"outline",onClick:k6,children:[x6.jsxDEV(jY,{className:"w-4 h-4 mr-2"},void 0,!1,void 0,this),"New Folder"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this);return x6.jsxDEV("div",{className:"h-full flex gap-6 p-6",children:[x6.jsxDEV("div",{className:"w-80 flex-shrink-0 flex flex-col",children:[x6.jsxDEV("div",{className:"flex items-center justify-between mb-4",children:[x6.jsxDEV("div",{className:"flex items-center gap-2",children:[x6.jsxDEV("h2",{className:"text-lg font-semibold text-foreground",children:Z},void 0,!1,void 0,this),x6.jsxDEV(D8,{size:"icon",variant:"ghost",onClick:x,title:dB6[M],className:"h-8 w-8",children:iJ.default.createElement(lB6[M],{className:"w-4 h-4"})},void 0,!1,void 0,this),x6.jsxDEV(D8,{size:"icon",variant:"ghost",onClick:f,title:h?"Collapse all folders":"Expand all folders",className:"h-8 w-8",children:h?x6.jsxDEV(AD,{className:"w-4 h-4"},void 0,!1,void 0,this):x6.jsxDEV(ID,{className:"w-4 h-4"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),x6.jsxDEV("div",{className:"flex gap-1",children:[x6.jsxDEV(D8,{size:"sm",variant:"warning",onClick:d0,title:`New ${Q}`,children:x6.jsxDEV(DH,{className:"w-4 h-4"},void 0,!1,void 0,this)},void 0,!1,void 0,this),x6.jsxDEV(D8,{size:"sm",variant:"outline",onClick:k6,title:"New Folder",children:x6.jsxDEV(jY,{className:"w-4 h-4"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),x6.jsxDEV("div",{className:"flex-1 overflow-auto min-h-0",onClick:(p0)=>{if(p0.target===p0.currentTarget){if(R(null),m(null),X)$0([])}},onDragOver:(p0)=>{if(g0)p0.preventDefault()},onDrop:(p0)=>{if(g0){p0.preventDefault();let T6=yY(F,J);kJ({isFolder:!0,path:"",storeCode:F,id:T6})}},children:$.length>0?x6.jsxDEV(wD,{data:$,initialSelectedItemId:I,onSelectChange:ZJ,onExpand:b,expandAll:h,defaultLeafIcon:yO,defaultNodeIcon:DF,handleDragStart:qJ,handleDrop:kJ,draggedItem:g0,renderItem:({item:p0,isLeaf:T6,isOpen:z8})=>{let C6=p0.isFolder&&p0.isLoading,wJ=p0.isFolder&&p0.isError,x0=p0.isFolder?C6?mQ:z8?RF:DF:p0.hasDraft?IH:yO,fQ=X&&!p0.isFolder&&T0.includes(p0.id),c0=fQ?T0.indexOf(p0.id)+1:null,xJ=`h-4 w-4 shrink-0 ${C6?"animate-spin text-blue-500":""}`,YQ=()=>{if(p0.isFolder&&!C6){if(wJ)return{fill:"#fee2e2",stroke:"#dc2626"};return{fill:"#dbeafe",stroke:"#000000"}}if(!p0.isFolder&&p0.hasDraft)return{fill:"#fcd34d",stroke:"#000000"};return{}};return x6.jsxDEV("div",{className:`flex items-center gap-2 min-w-0 ${fQ?"text-primary font-medium":""}`,children:[x6.jsxDEV(x0,{className:_J(xJ,!p0.isFolder&&!p0.hasDraft&&"text-muted-foreground"),...YQ()},void 0,!1,void 0,this),x6.jsxDEV("span",{className:"text-sm truncate",children:p0.name},void 0,!1,void 0,this),wJ&&x6.jsxDEV("span",{className:"inline-flex items-center rounded border px-1.5 py-0.5 text-[10px] font-mono text-red-700 border-red-300 bg-red-50",title:"Failed to load - click to expand and retry",children:"Failed"},void 0,!1,void 0,this),x6.jsxDEV("span",{className:"inline-flex items-center rounded border px-1.5 py-0.5 text-[10px] font-mono text-muted-foreground border-border/60 bg-muted/40",title:`${p0.isFolder?"Folder":Q} ID: ${p0.id}`,children:p0.id},void 0,!1,void 0,this),!p0.isFolder&&p0.versionCount>0&&x6.jsxDEV("span",{className:"inline-flex items-center rounded border px-1.5 py-0.5 text-[10px] font-mono text-green-700 border-green-300 bg-green-50",title:`Published version ${p0.versionCount}`,children:["v",p0.versionCount]},void 0,!0,void 0,this),!p0.isFolder&&p0.isBeingEdited&&x6.jsxDEV("span",{className:"inline-flex items-center",title:`${Q} is being edited`,children:x6.jsxDEV(q5,{className:"h-3 w-3 text-orange-500"},void 0,!1,void 0,this)},void 0,!1,void 0,this),fQ&&x6.jsxDEV("span",{className:"inline-flex items-center justify-center w-5 h-5 rounded-full text-[10px] font-bold text-white bg-primary",title:`Selected #${c0}`,children:c0},void 0,!1,void 0,this),Y&&Y({item:p0})]},void 0,!0,void 0,this)}},S,!1,void 0,this):x6.jsxDEV("p",{className:"text-sm text-muted-foreground py-4",children:["No ",Z.toLowerCase()," or folders"]},void 0,!0,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),u0&&A6&&x6.jsxDEV(U,{projectId:G,selectedId:I,selectedItem:y,selectedItemData:A6,versions:r6,draftContent:g,serverContent:i,isDirty:B6,hasDraft:D0,isEditing:J0,setIsEditing:z6,viewingVersion:G0,versionContent:O0,showVersions:a,setShowVersions:e,showRename:f0,setShowRename:l0,renameFilename:k0,setRenameFilename:_0,actionError:t,setActionError:N0,saveStatus:w0,handleEditorChange:Q6,handleViewVersion:X6,handleBackToEdit:W6,handlePublish:_6,handleDiscardDraft:c6,handleRetry:d6,handleOpenRename:V6,handleRename:Z8,handleCopyContent:B9,handleCopyIds:m9,setShowDeleteConfirm:W0,publishMutation:P6,discardMutation:M6,updatePathMutation:O8,debouncedSave:S0,collectedIds:T0,showToast:q8,typeName:Q,triggerEditMode:L0,setTriggerEditMode:I0},void 0,!1,void 0,this),G6&&y&&x6.jsxDEV("div",{className:"flex-1 flex flex-col min-h-0",children:[x6.jsxDEV("div",{className:"flex items-center gap-2 mb-3",children:[!y.isRoot&&x6.jsxDEV(D8,{onClick:V6,variant:"outline",size:"sm",children:[x6.jsxDEV(RH,{className:"w-4 h-4 mr-1"},void 0,!1,void 0,this),"Rename"]},void 0,!0,void 0,this),!y.isRoot&&x6.jsxDEV(D8,{onClick:()=>W0(!0),variant:"destructive",size:"sm",children:[x6.jsxDEV(M1,{className:"w-4 h-4 mr-1"},void 0,!1,void 0,this),"Delete"]},void 0,!0,void 0,this),x6.jsxDEV(D8,{onClick:H7,variant:"outline",size:"sm",disabled:y0,title:"Copy IDs of immediate children",children:[y0?x6.jsxDEV(mQ,{className:"w-4 h-4 mr-1 animate-spin"},void 0,!1,void 0,this):x6.jsxDEV(WK,{className:"w-4 h-4 mr-1"},void 0,!1,void 0,this),y0?"Copying...":"Copy"]},void 0,!0,void 0,this),x6.jsxDEV(D8,{onClick:m9,variant:"outline",size:"sm",title:"Copy folder ID",children:[x6.jsxDEV(AG,{className:"w-4 h-4 mr-1"},void 0,!1,void 0,this),"IDs"]},void 0,!0,void 0,this),x6.jsxDEV("div",{className:"flex-1"},void 0,!1,void 0,this),x6.jsxDEV("div",{className:"text-right",children:[x6.jsxDEV("div",{className:"font-medium text-base text-foreground",children:y.name},void 0,!1,void 0,this),x6.jsxDEV("div",{className:"text-xs text-muted-foreground",children:y.id},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),t&&x6.jsxDEV("div",{className:"mb-3 p-3 border border-destructive rounded-md bg-destructive/10 flex items-center justify-between",children:[x6.jsxDEV("div",{className:"flex items-center gap-2 text-destructive",children:[x6.jsxDEV(N7,{className:"w-4 h-4"},void 0,!1,void 0,this),x6.jsxDEV("span",{className:"text-sm",children:t},void 0,!1,void 0,this)]},void 0,!0,void 0,this),x6.jsxDEV(D8,{variant:"ghost",size:"icon",onClick:()=>N0(null),className:"h-6 w-6",children:x6.jsxDEV(FZ,{className:"w-4 h-4"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),f0&&x6.jsxDEV("div",{className:"mb-3 p-3 border border-border rounded-md bg-muted",children:[x6.jsxDEV("div",{className:"flex items-center gap-2 text-foreground mb-2",children:[x6.jsxDEV(q5,{className:"w-4 h-4"},void 0,!1,void 0,this),x6.jsxDEV("span",{className:"font-medium",children:"Rename folder"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),x6.jsxDEV("input",{type:"text",value:k0,onChange:(p0)=>_0(p0.target.value),placeholder:"New folder name",className:"w-full px-3 py-2 text-sm border border-border rounded bg-background text-foreground mb-3",autoFocus:!0,onKeyDown:(p0)=>{if(p0.key==="Enter")Z8();if(p0.key==="Escape")l0(!1)}},void 0,!1,void 0,this),x6.jsxDEV("div",{className:"flex gap-2",children:[x6.jsxDEV(D8,{onClick:Z8,variant:"default",size:"sm",disabled:U8.isPending||!k0.trim(),children:U8.isPending?"Renaming...":"Rename"},void 0,!1,void 0,this),x6.jsxDEV(D8,{onClick:()=>l0(!1),variant:"outline",size:"sm",children:"Cancel"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),t0&&x6.jsxDEV("div",{className:"fixed bottom-4 right-4 bg-foreground text-background px-4 py-2 rounded-md shadow-lg text-sm animate-in fade-in slide-in-from-bottom-2",children:t0},void 0,!1,void 0,this),x6.jsxDEV(gY,{open:G6&&E0,onOpenChange:(p0)=>W0(p0),children:x6.jsxDEV(N1,{children:[x6.jsxDEV(D1,{children:x6.jsxDEV(w1,{className:"flex items-center gap-2 text-destructive",children:[x6.jsxDEV(N7,{className:"w-5 h-5"},void 0,!1,void 0,this),"Delete Folder"]},void 0,!0,void 0,this)},void 0,!1,void 0,this),x6.jsxDEV("div",{className:"py-4",children:[x6.jsxDEV("p",{className:"text-sm text-muted-foreground",children:["Are you sure you want to delete ",x6.jsxDEV("span",{className:"font-medium text-foreground",children:y?.name},void 0,!1,void 0,this),"?"]},void 0,!0,void 0,this),x6.jsxDEV("p",{className:"text-sm text-muted-foreground mt-2",children:"This will delete the folder and all its contents. It can be restored later."},void 0,!1,void 0,this)]},void 0,!0,void 0,this),x6.jsxDEV(TG,{children:[x6.jsxDEV(D8,{variant:"outline",onClick:()=>W0(!1),children:"Cancel"},void 0,!1,void 0,this),x6.jsxDEV(D8,{variant:"destructive",onClick:l6,disabled:u6.isPending,children:u6.isPending?"Deleting...":"Delete"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),x6.jsxDEV(gY,{open:u0&&E0,onOpenChange:(p0)=>W0(p0),children:x6.jsxDEV(N1,{children:[x6.jsxDEV(D1,{children:x6.jsxDEV(w1,{className:"flex items-center gap-2 text-destructive",children:[x6.jsxDEV(N7,{className:"w-5 h-5"},void 0,!1,void 0,this),"Delete ",Q]},void 0,!0,void 0,this)},void 0,!1,void 0,this),x6.jsxDEV("div",{className:"py-4",children:[x6.jsxDEV("p",{className:"text-sm text-muted-foreground",children:["Are you sure you want to delete ",x6.jsxDEV("span",{className:"font-medium text-foreground",children:A6?.path},void 0,!1,void 0,this),"?"]},void 0,!0,void 0,this),x6.jsxDEV("p",{className:"text-sm text-muted-foreground mt-2",children:["This will soft-delete the ",Q.toLowerCase(),". It can be restored later."]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),x6.jsxDEV(TG,{children:[x6.jsxDEV(D8,{variant:"outline",onClick:()=>W0(!1),children:"Cancel"},void 0,!1,void 0,this),x6.jsxDEV(D8,{variant:"destructive",onClick:l6,disabled:g6.isPending,children:g6.isPending?"Deleting...":"Delete"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),x6.jsxDEV(gY,{open:q0,onOpenChange:(p0)=>{if(z0(p0),!p0)P0("")},children:x6.jsxDEV(N1,{children:[x6.jsxDEV(D1,{children:x6.jsxDEV(w1,{children:["New ",Q]},void 0,!0,void 0,this)},void 0,!1,void 0,this),x6.jsxDEV("div",{className:"py-4",children:[G6&&y?.path&&x6.jsxDEV("p",{className:"text-xs text-muted-foreground mb-2",children:["Creating in: ",x6.jsxDEV("span",{className:"font-mono",children:[y.path,"/"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),x6.jsxDEV("input",{type:"text",value:Y0,onChange:(p0)=>P0(p0.target.value.replace(/\//g,"")),placeholder:J==="d"?"example.md":"greeting.md",className:"w-full px-3 py-2 border border-input rounded-md bg-background text-foreground text-sm focus:outline-none focus:ring-2 focus:ring-ring",onKeyDown:(p0)=>p0.key==="Enter"&&t6(),autoFocus:!0},void 0,!1,void 0,this)]},void 0,!0,void 0,this),x6.jsxDEV(TG,{children:[x6.jsxDEV(D8,{variant:"outline",onClick:()=>{z0(!1),P0("")},children:"Cancel"},void 0,!1,void 0,this),x6.jsxDEV(D8,{onClick:t6,disabled:N6.isPending||!Y0.trim(),children:N6.isPending?"Creating...":"Create"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),x6.jsxDEV(gY,{open:K0,onOpenChange:(p0)=>{if(R0(p0),!p0)m0("")},children:x6.jsxDEV(N1,{children:[x6.jsxDEV(D1,{children:x6.jsxDEV(w1,{children:"New Folder"},void 0,!1,void 0,this)},void 0,!1,void 0,this),x6.jsxDEV("div",{className:"py-4",children:[G6&&y?.path&&x6.jsxDEV("p",{className:"text-xs text-muted-foreground mb-2",children:["Creating in: ",x6.jsxDEV("span",{className:"font-mono",children:[y.path,"/"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),x6.jsxDEV("input",{type:"text",value:F0,onChange:(p0)=>m0(p0.target.value.replace(/\//g,"")),placeholder:"my-folder",className:"w-full px-3 py-2 border border-input rounded-md bg-background text-foreground text-sm focus:outline-none focus:ring-2 focus:ring-ring",onKeyDown:(p0)=>p0.key==="Enter"&&g8(),autoFocus:!0},void 0,!1,void 0,this)]},void 0,!0,void 0,this),x6.jsxDEV(TG,{children:[x6.jsxDEV(D8,{variant:"outline",onClick:()=>{R0(!1),m0("")},children:"Cancel"},void 0,!1,void 0,this),x6.jsxDEV(D8,{onClick:g8,disabled:a6.isPending||!F0.trim(),children:a6.isPending?"Creating...":"Create"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}};var hK=J6(n6(),1);var sZ=J6(n6(),1);function nR0(J,Q){(Q==null||Q>J.length)&&(Q=J.length);for(var Z=0,U=Array(Q);Z<Q;Z++)U[Z]=J[Z];return U}function rB6(J){if(Array.isArray(J))return J}function nB6(J,Q,Z){return(Q=eB6(Q))in J?Object.defineProperty(J,Q,{value:Z,enumerable:!0,configurable:!0,writable:!0}):J[Q]=Z,J}function sB6(J,Q){var Z=J==null?null:typeof Symbol!="undefined"&&J[Symbol.iterator]||J["@@iterator"];if(Z!=null){var U,K,X,Y,z=[],G=!0,W=!1;try{if(X=(Z=Z.call(J)).next,Q===0);else for(;!(G=(U=X.call(Z)).done)&&(z.push(U.value),z.length!==Q);G=!0);}catch(H){W=!0,K=H}finally{try{if(!G&&Z.return!=null&&(Y=Z.return(),Object(Y)!==Y))return}finally{if(W)throw K}}return z}}function aB6(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
3066
3066
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function sR0(J,Q){var Z=Object.keys(J);if(Object.getOwnPropertySymbols){var U=Object.getOwnPropertySymbols(J);Q&&(U=U.filter(function(K){return Object.getOwnPropertyDescriptor(J,K).enumerable})),Z.push.apply(Z,U)}return Z}function fn(J){for(var Q=1;Q<arguments.length;Q++){var Z=arguments[Q]!=null?arguments[Q]:{};Q%2?sR0(Object(Z),!0).forEach(function(U){nB6(J,U,Z[U])}):Object.getOwnPropertyDescriptors?Object.defineProperties(J,Object.getOwnPropertyDescriptors(Z)):sR0(Object(Z)).forEach(function(U){Object.defineProperty(J,U,Object.getOwnPropertyDescriptor(Z,U))})}return J}function aR0(J,Q){if(J==null)return{};var Z,U,K=oB6(J,Q);if(Object.getOwnPropertySymbols){var X=Object.getOwnPropertySymbols(J);for(U=0;U<X.length;U++)Z=X[U],Q.indexOf(Z)===-1&&{}.propertyIsEnumerable.call(J,Z)&&(K[Z]=J[Z])}return K}function oB6(J,Q){if(J==null)return{};var Z={};for(var U in J)if({}.hasOwnProperty.call(J,U)){if(Q.indexOf(U)!==-1)continue;Z[U]=J[U]}return Z}function oR0(J,Q){return rB6(J)||sB6(J,Q)||JM6(J,Q)||aB6()}function tB6(J,Q){if(typeof J!="object"||!J)return J;var Z=J[Symbol.toPrimitive];if(Z!==void 0){var U=Z.call(J,Q);if(typeof U!="object")return U;throw new TypeError("@@toPrimitive must return a primitive value.")}return(Q==="string"?String:Number)(J)}function eB6(J){var Q=tB6(J,"string");return typeof Q=="symbol"?Q:Q+""}function JM6(J,Q){if(J){if(typeof J=="string")return nR0(J,Q);var Z={}.toString.call(J).slice(8,-1);return Z==="Object"&&J.constructor&&(Z=J.constructor.name),Z==="Map"||Z==="Set"?Array.from(J):Z==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(Z)?nR0(J,Q):void 0}}function QM6(J,Q,Z){if(Q in J)Object.defineProperty(J,Q,{value:Z,enumerable:!0,configurable:!0,writable:!0});else J[Q]=Z;return J}function tR0(J,Q){var Z=Object.keys(J);if(Object.getOwnPropertySymbols){var U=Object.getOwnPropertySymbols(J);if(Q)U=U.filter(function(K){return Object.getOwnPropertyDescriptor(J,K).enumerable});Z.push.apply(Z,U)}return Z}function eR0(J){for(var Q=1;Q<arguments.length;Q++){var Z=arguments[Q]!=null?arguments[Q]:{};if(Q%2)tR0(Object(Z),!0).forEach(function(U){QM6(J,U,Z[U])});else if(Object.getOwnPropertyDescriptors)Object.defineProperties(J,Object.getOwnPropertyDescriptors(Z));else tR0(Object(Z)).forEach(function(U){Object.defineProperty(J,U,Object.getOwnPropertyDescriptor(Z,U))})}return J}function ZM6(){for(var J=arguments.length,Q=new Array(J),Z=0;Z<J;Z++)Q[Z]=arguments[Z];return function(U){return Q.reduceRight(function(K,X){return X(K)},U)}}function sD(J){return function Q(){var Z=this;for(var U=arguments.length,K=new Array(U),X=0;X<U;X++)K[X]=arguments[X];return K.length>=J.length?J.apply(this,K):function(){for(var Y=arguments.length,z=new Array(Y),G=0;G<Y;G++)z[G]=arguments[G];return Q.apply(Z,[].concat(K,z))}}}function rv(J){return{}.toString.call(J).includes("Object")}function UM6(J){return!Object.keys(J).length}function aD(J){return typeof J==="function"}function KM6(J,Q){return Object.prototype.hasOwnProperty.call(J,Q)}function XM6(J,Q){if(!rv(Q))rH("changeType");if(Object.keys(Q).some(function(Z){return!KM6(J,Z)}))rH("changeField");return Q}function YM6(J){if(!aD(J))rH("selectorType")}function zM6(J){if(!(aD(J)||rv(J)))rH("handlerType");if(rv(J)&&Object.values(J).some(function(Q){return!aD(Q)}))rH("handlersType")}function GM6(J){if(!J)rH("initialIsRequired");if(!rv(J))rH("initialType");if(UM6(J))rH("initialContent")}function WM6(J,Q){throw new Error(J[Q]||J.default)}var HM6={initialIsRequired:"initial state is required",initialType:"initial state should be an object",initialContent:"initial state shouldn't be an empty object",handlerType:"handler should be an object or a function",handlersType:"all handlers should be a functions",selectorType:"selector should be a function",changeType:"provided value of changes should be an object",changeField:'it seams you want to change a field in the state which is not specified in the "initial" state',default:"an unknown error accured in `state-local` package"},rH=sD(WM6)(HM6),iv={changes:XM6,selector:YM6,handler:zM6,initial:GM6};function qM6(J){var Q=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};iv.initial(J),iv.handler(Q);var Z={current:J},U=sD(MM6)(Z,Q),K=sD(BM6)(Z),X=sD(iv.changes)(J),Y=sD(FM6)(Z);function z(){var W=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(H){return H};return iv.selector(W),W(Z.current)}function G(W){ZM6(U,K,X,Y)(W)}return[z,G]}function FM6(J,Q){return aD(Q)?Q(J.current):Q}function BM6(J,Q){return J.current=eR0(eR0({},J.current),Q),Q}function MM6(J,Q,Z){return aD(Q)?Q(J.current):Object.keys(Z).forEach(function(U){var K;return(K=Q[U])===null||K===void 0?void 0:K.call(Q,J.current[U])}),Z}var OM6={create:qM6},JN0=OM6;var QN0={paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.55.1/min/vs"}};function ZN0(J){return function Q(){var Z=this;for(var U=arguments.length,K=new Array(U),X=0;X<U;X++)K[X]=arguments[X];return K.length>=J.length?J.apply(this,K):function(){for(var Y=arguments.length,z=new Array(Y),G=0;G<Y;G++)z[G]=arguments[G];return Q.apply(Z,[].concat(K,z))}}}function UN0(J){return{}.toString.call(J).includes("Object")}function LM6(J){if(!J)KN0("configIsRequired");if(!UN0(J))KN0("configType");if(J.urls)return AM6(),{paths:{vs:J.urls.monacoBase}};return J}function AM6(){console.warn(XN0.deprecation)}function IM6(J,Q){throw new Error(J[Q]||J.default)}var XN0={configIsRequired:"the configuration object is required",configType:"the configuration object should be an object",default:"an unknown error accured in `@monaco-editor/loader` package",deprecation:`Deprecation warning!
|
|
3067
3067
|
You are using deprecated way of configuration.
|
|
3068
3068
|
|