@hamak/smart-data-dico 1.0.3 → 1.0.4
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.
|
@@ -0,0 +1,431 @@
|
|
|
1
|
+
var UB=Object.defineProperty;var $B=(t,e,r)=>e in t?UB(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var Yo=(t,e,r)=>($B(t,typeof e!="symbol"?e+"":e,r),r);function VB(t,e){for(var r=0;r<e.length;r++){const n=e[r];if(typeof n!="string"&&!Array.isArray(n)){for(const a in n)if(a!=="default"&&!(a in t)){const i=Object.getOwnPropertyDescriptor(n,a);i&&Object.defineProperty(t,a,i.get?i:{enumerable:!0,get:()=>n[a]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))n(a);new MutationObserver(a=>{for(const i of a)if(i.type==="childList")for(const s of i.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&n(s)}).observe(document,{childList:!0,subtree:!0});function r(a){const i={};return a.integrity&&(i.integrity=a.integrity),a.referrerPolicy&&(i.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?i.credentials="include":a.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function n(a){if(a.ep)return;a.ep=!0;const i=r(a);fetch(a.href,i)}})();var Ja=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Sw(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var v_={exports:{}},Sf={},p_={exports:{}},Je={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react.production.min.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var Nu=Symbol.for("react.element"),GB=Symbol.for("react.portal"),HB=Symbol.for("react.fragment"),WB=Symbol.for("react.strict_mode"),YB=Symbol.for("react.profiler"),XB=Symbol.for("react.provider"),KB=Symbol.for("react.context"),QB=Symbol.for("react.forward_ref"),ZB=Symbol.for("react.suspense"),JB=Symbol.for("react.memo"),ez=Symbol.for("react.lazy"),MS=Symbol.iterator;function tz(t){return t===null||typeof t!="object"?null:(t=MS&&t[MS]||t["@@iterator"],typeof t=="function"?t:null)}var g_={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},m_=Object.assign,y_={};function To(t,e,r){this.props=t,this.context=e,this.refs=y_,this.updater=r||g_}To.prototype.isReactComponent={};To.prototype.setState=function(t,e){if(typeof t!="object"&&typeof t!="function"&&t!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,t,e,"setState")};To.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function x_(){}x_.prototype=To.prototype;function Cw(t,e,r){this.props=t,this.context=e,this.refs=y_,this.updater=r||g_}var Nw=Cw.prototype=new x_;Nw.constructor=Cw;m_(Nw,To.prototype);Nw.isPureReactComponent=!0;var IS=Array.isArray,b_=Object.prototype.hasOwnProperty,Tw={current:null},w_={key:!0,ref:!0,__self:!0,__source:!0};function E_(t,e,r){var n,a={},i=null,s=null;if(e!=null)for(n in e.ref!==void 0&&(s=e.ref),e.key!==void 0&&(i=""+e.key),e)b_.call(e,n)&&!w_.hasOwnProperty(n)&&(a[n]=e[n]);var o=arguments.length-2;if(o===1)a.children=r;else if(1<o){for(var l=Array(o),u=0;u<o;u++)l[u]=arguments[u+2];a.children=l}if(t&&t.defaultProps)for(n in o=t.defaultProps,o)a[n]===void 0&&(a[n]=o[n]);return{$$typeof:Nu,type:t,key:i,ref:s,props:a,_owner:Tw.current}}function rz(t,e){return{$$typeof:Nu,type:t.type,key:e,ref:t.ref,props:t.props,_owner:t._owner}}function Rw(t){return typeof t=="object"&&t!==null&&t.$$typeof===Nu}function nz(t){var e={"=":"=0",":":"=2"};return"$"+t.replace(/[=:]/g,function(r){return e[r]})}var FS=/\/+/g;function Bh(t,e){return typeof t=="object"&&t!==null&&t.key!=null?nz(""+t.key):e.toString(36)}function $c(t,e,r,n,a){var i=typeof t;(i==="undefined"||i==="boolean")&&(t=null);var s=!1;if(t===null)s=!0;else switch(i){case"string":case"number":s=!0;break;case"object":switch(t.$$typeof){case Nu:case GB:s=!0}}if(s)return s=t,a=a(s),t=n===""?"."+Bh(s,0):n,IS(a)?(r="",t!=null&&(r=t.replace(FS,"$&/")+"/"),$c(a,e,r,"",function(u){return u})):a!=null&&(Rw(a)&&(a=rz(a,r+(!a.key||s&&s.key===a.key?"":(""+a.key).replace(FS,"$&/")+"/")+t)),e.push(a)),1;if(s=0,n=n===""?".":n+":",IS(t))for(var o=0;o<t.length;o++){i=t[o];var l=n+Bh(i,o);s+=$c(i,e,r,l,a)}else if(l=tz(t),typeof l=="function")for(t=l.call(t),o=0;!(i=t.next()).done;)i=i.value,l=n+Bh(i,o++),s+=$c(i,e,r,l,a);else if(i==="object")throw e=String(t),Error("Objects are not valid as a React child (found: "+(e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)+"). If you meant to render a collection of children, use an array instead.");return s}function sc(t,e,r){if(t==null)return t;var n=[],a=0;return $c(t,n,"","",function(i){return e.call(r,i,a++)}),n}function az(t){if(t._status===-1){var e=t._result;e=e(),e.then(function(r){(t._status===0||t._status===-1)&&(t._status=1,t._result=r)},function(r){(t._status===0||t._status===-1)&&(t._status=2,t._result=r)}),t._status===-1&&(t._status=0,t._result=e)}if(t._status===1)return t._result.default;throw t._result}var Br={current:null},Vc={transition:null},iz={ReactCurrentDispatcher:Br,ReactCurrentBatchConfig:Vc,ReactCurrentOwner:Tw};function S_(){throw Error("act(...) is not supported in production builds of React.")}Je.Children={map:sc,forEach:function(t,e,r){sc(t,function(){e.apply(this,arguments)},r)},count:function(t){var e=0;return sc(t,function(){e++}),e},toArray:function(t){return sc(t,function(e){return e})||[]},only:function(t){if(!Rw(t))throw Error("React.Children.only expected to receive a single React element child.");return t}};Je.Component=To;Je.Fragment=HB;Je.Profiler=YB;Je.PureComponent=Cw;Je.StrictMode=WB;Je.Suspense=ZB;Je.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=iz;Je.act=S_;Je.cloneElement=function(t,e,r){if(t==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+t+".");var n=m_({},t.props),a=t.key,i=t.ref,s=t._owner;if(e!=null){if(e.ref!==void 0&&(i=e.ref,s=Tw.current),e.key!==void 0&&(a=""+e.key),t.type&&t.type.defaultProps)var o=t.type.defaultProps;for(l in e)b_.call(e,l)&&!w_.hasOwnProperty(l)&&(n[l]=e[l]===void 0&&o!==void 0?o[l]:e[l])}var l=arguments.length-2;if(l===1)n.children=r;else if(1<l){o=Array(l);for(var u=0;u<l;u++)o[u]=arguments[u+2];n.children=o}return{$$typeof:Nu,type:t.type,key:a,ref:i,props:n,_owner:s}};Je.createContext=function(t){return t={$$typeof:KB,_currentValue:t,_currentValue2:t,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},t.Provider={$$typeof:XB,_context:t},t.Consumer=t};Je.createElement=E_;Je.createFactory=function(t){var e=E_.bind(null,t);return e.type=t,e};Je.createRef=function(){return{current:null}};Je.forwardRef=function(t){return{$$typeof:QB,render:t}};Je.isValidElement=Rw;Je.lazy=function(t){return{$$typeof:ez,_payload:{_status:-1,_result:t},_init:az}};Je.memo=function(t,e){return{$$typeof:JB,type:t,compare:e===void 0?null:e}};Je.startTransition=function(t){var e=Vc.transition;Vc.transition={};try{t()}finally{Vc.transition=e}};Je.unstable_act=S_;Je.useCallback=function(t,e){return Br.current.useCallback(t,e)};Je.useContext=function(t){return Br.current.useContext(t)};Je.useDebugValue=function(){};Je.useDeferredValue=function(t){return Br.current.useDeferredValue(t)};Je.useEffect=function(t,e){return Br.current.useEffect(t,e)};Je.useId=function(){return Br.current.useId()};Je.useImperativeHandle=function(t,e,r){return Br.current.useImperativeHandle(t,e,r)};Je.useInsertionEffect=function(t,e){return Br.current.useInsertionEffect(t,e)};Je.useLayoutEffect=function(t,e){return Br.current.useLayoutEffect(t,e)};Je.useMemo=function(t,e){return Br.current.useMemo(t,e)};Je.useReducer=function(t,e,r){return Br.current.useReducer(t,e,r)};Je.useRef=function(t){return Br.current.useRef(t)};Je.useState=function(t){return Br.current.useState(t)};Je.useSyncExternalStore=function(t,e,r){return Br.current.useSyncExternalStore(t,e,r)};Je.useTransition=function(){return Br.current.useTransition()};Je.version="18.3.1";p_.exports=Je;var U=p_.exports;const ir=Sw(U),sz=VB({__proto__:null,default:ir},[U]);/**
|
|
10
|
+
* @license React
|
|
11
|
+
* react-jsx-runtime.production.min.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the MIT license found in the
|
|
16
|
+
* LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/var oz=U,lz=Symbol.for("react.element"),uz=Symbol.for("react.fragment"),cz=Object.prototype.hasOwnProperty,dz=oz.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,fz={key:!0,ref:!0,__self:!0,__source:!0};function C_(t,e,r){var n,a={},i=null,s=null;r!==void 0&&(i=""+r),e.key!==void 0&&(i=""+e.key),e.ref!==void 0&&(s=e.ref);for(n in e)cz.call(e,n)&&!fz.hasOwnProperty(n)&&(a[n]=e[n]);if(t&&t.defaultProps)for(n in e=t.defaultProps,e)a[n]===void 0&&(a[n]=e[n]);return{$$typeof:lz,type:t,key:i,ref:s,props:a,_owner:dz.current}}Sf.Fragment=uz;Sf.jsx=C_;Sf.jsxs=C_;v_.exports=Sf;var h=v_.exports,xd={},N_={exports:{}},fn={},T_={exports:{}},R_={};/**
|
|
18
|
+
* @license React
|
|
19
|
+
* scheduler.production.min.js
|
|
20
|
+
*
|
|
21
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
22
|
+
*
|
|
23
|
+
* This source code is licensed under the MIT license found in the
|
|
24
|
+
* LICENSE file in the root directory of this source tree.
|
|
25
|
+
*/(function(t){function e(k,I){var F=k.length;k.push(I);e:for(;0<F;){var B=F-1>>>1,$=k[B];if(0<a($,I))k[B]=I,k[F]=$,F=B;else break e}}function r(k){return k.length===0?null:k[0]}function n(k){if(k.length===0)return null;var I=k[0],F=k.pop();if(F!==I){k[0]=F;e:for(var B=0,$=k.length,W=$>>>1;B<W;){var z=2*(B+1)-1,q=k[z],G=z+1,J=k[G];if(0>a(q,F))G<$&&0>a(J,q)?(k[B]=J,k[G]=F,B=G):(k[B]=q,k[z]=F,B=z);else if(G<$&&0>a(J,F))k[B]=J,k[G]=F,B=G;else break e}}return I}function a(k,I){var F=k.sortIndex-I.sortIndex;return F!==0?F:k.id-I.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;t.unstable_now=function(){return i.now()}}else{var s=Date,o=s.now();t.unstable_now=function(){return s.now()-o}}var l=[],u=[],c=1,d=null,f=3,v=!1,p=!1,y=!1,m=typeof setTimeout=="function"?setTimeout:null,g=typeof clearTimeout=="function"?clearTimeout:null,x=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function b(k){for(var I=r(u);I!==null;){if(I.callback===null)n(u);else if(I.startTime<=k)n(u),I.sortIndex=I.expirationTime,e(l,I);else break;I=r(u)}}function w(k){if(y=!1,b(k),!p)if(r(l)!==null)p=!0,L(E);else{var I=r(u);I!==null&&_(w,I.startTime-k)}}function E(k,I){p=!1,y&&(y=!1,g(T),T=-1),v=!0;var F=f;try{for(b(I),d=r(l);d!==null&&(!(d.expirationTime>I)||k&&!j());){var B=d.callback;if(typeof B=="function"){d.callback=null,f=d.priorityLevel;var $=B(d.expirationTime<=I);I=t.unstable_now(),typeof $=="function"?d.callback=$:d===r(l)&&n(l),b(I)}else n(l);d=r(l)}if(d!==null)var W=!0;else{var z=r(u);z!==null&&_(w,z.startTime-I),W=!1}return W}finally{d=null,f=F,v=!1}}var C=!1,S=null,T=-1,P=5,A=-1;function j(){return!(t.unstable_now()-A<P)}function R(){if(S!==null){var k=t.unstable_now();A=k;var I=!0;try{I=S(!0,k)}finally{I?O():(C=!1,S=null)}}else C=!1}var O;if(typeof x=="function")O=function(){x(R)};else if(typeof MessageChannel<"u"){var N=new MessageChannel,D=N.port2;N.port1.onmessage=R,O=function(){D.postMessage(null)}}else O=function(){m(R,0)};function L(k){S=k,C||(C=!0,O())}function _(k,I){T=m(function(){k(t.unstable_now())},I)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(k){k.callback=null},t.unstable_continueExecution=function(){p||v||(p=!0,L(E))},t.unstable_forceFrameRate=function(k){0>k||125<k?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):P=0<k?Math.floor(1e3/k):5},t.unstable_getCurrentPriorityLevel=function(){return f},t.unstable_getFirstCallbackNode=function(){return r(l)},t.unstable_next=function(k){switch(f){case 1:case 2:case 3:var I=3;break;default:I=f}var F=f;f=I;try{return k()}finally{f=F}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function(k,I){switch(k){case 1:case 2:case 3:case 4:case 5:break;default:k=3}var F=f;f=k;try{return I()}finally{f=F}},t.unstable_scheduleCallback=function(k,I,F){var B=t.unstable_now();switch(typeof F=="object"&&F!==null?(F=F.delay,F=typeof F=="number"&&0<F?B+F:B):F=B,k){case 1:var $=-1;break;case 2:$=250;break;case 5:$=1073741823;break;case 4:$=1e4;break;default:$=5e3}return $=F+$,k={id:c++,callback:I,priorityLevel:k,startTime:F,expirationTime:$,sortIndex:-1},F>B?(k.sortIndex=F,e(u,k),r(l)===null&&k===r(u)&&(y?(g(T),T=-1):y=!0,_(w,F-B))):(k.sortIndex=$,e(l,k),p||v||(p=!0,L(E))),k},t.unstable_shouldYield=j,t.unstable_wrapCallback=function(k){var I=f;return function(){var F=f;f=I;try{return k.apply(this,arguments)}finally{f=F}}}})(R_);T_.exports=R_;var hz=T_.exports;/**
|
|
26
|
+
* @license React
|
|
27
|
+
* react-dom.production.min.js
|
|
28
|
+
*
|
|
29
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
30
|
+
*
|
|
31
|
+
* This source code is licensed under the MIT license found in the
|
|
32
|
+
* LICENSE file in the root directory of this source tree.
|
|
33
|
+
*/var vz=U,dn=hz;function Pe(t){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+t,r=1;r<arguments.length;r++)e+="&args[]="+encodeURIComponent(arguments[r]);return"Minified React error #"+t+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var P_=new Set,$l={};function ys(t,e){vo(t,e),vo(t+"Capture",e)}function vo(t,e){for($l[t]=e,t=0;t<e.length;t++)P_.add(e[t])}var Pa=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Fb=Object.prototype.hasOwnProperty,pz=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,BS={},zS={};function gz(t){return Fb.call(zS,t)?!0:Fb.call(BS,t)?!1:pz.test(t)?zS[t]=!0:(BS[t]=!0,!1)}function mz(t,e,r,n){if(r!==null&&r.type===0)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return n?!1:r!==null?!r.acceptsBooleans:(t=t.toLowerCase().slice(0,5),t!=="data-"&&t!=="aria-");default:return!1}}function yz(t,e,r,n){if(e===null||typeof e>"u"||mz(t,e,r,n))return!0;if(n)return!1;if(r!==null)switch(r.type){case 3:return!e;case 4:return e===!1;case 5:return isNaN(e);case 6:return isNaN(e)||1>e}return!1}function zr(t,e,r,n,a,i,s){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=n,this.attributeNamespace=a,this.mustUseProperty=r,this.propertyName=t,this.type=e,this.sanitizeURL=i,this.removeEmptyString=s}var gr={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){gr[t]=new zr(t,0,!1,t,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var e=t[0];gr[e]=new zr(e,1,!1,t[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(t){gr[t]=new zr(t,2,!1,t.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){gr[t]=new zr(t,2,!1,t,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".split(" ").forEach(function(t){gr[t]=new zr(t,3,!1,t.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(t){gr[t]=new zr(t,3,!0,t,null,!1,!1)});["capture","download"].forEach(function(t){gr[t]=new zr(t,4,!1,t,null,!1,!1)});["cols","rows","size","span"].forEach(function(t){gr[t]=new zr(t,6,!1,t,null,!1,!1)});["rowSpan","start"].forEach(function(t){gr[t]=new zr(t,5,!1,t.toLowerCase(),null,!1,!1)});var Pw=/[\-:]([a-z])/g;function Aw(t){return t[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".split(" ").forEach(function(t){var e=t.replace(Pw,Aw);gr[e]=new zr(e,1,!1,t,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(t){var e=t.replace(Pw,Aw);gr[e]=new zr(e,1,!1,t,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(t){var e=t.replace(Pw,Aw);gr[e]=new zr(e,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(t){gr[t]=new zr(t,1,!1,t.toLowerCase(),null,!1,!1)});gr.xlinkHref=new zr("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(t){gr[t]=new zr(t,1,!1,t.toLowerCase(),null,!0,!0)});function kw(t,e,r,n){var a=gr.hasOwnProperty(e)?gr[e]:null;(a!==null?a.type!==0:n||!(2<e.length)||e[0]!=="o"&&e[0]!=="O"||e[1]!=="n"&&e[1]!=="N")&&(yz(e,r,a,n)&&(r=null),n||a===null?gz(e)&&(r===null?t.removeAttribute(e):t.setAttribute(e,""+r)):a.mustUseProperty?t[a.propertyName]=r===null?a.type===3?!1:"":r:(e=a.attributeName,n=a.attributeNamespace,r===null?t.removeAttribute(e):(a=a.type,r=a===3||a===4&&r===!0?"":""+r,n?t.setAttributeNS(n,e,r):t.setAttribute(e,r))))}var Ma=vz.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,oc=Symbol.for("react.element"),qs=Symbol.for("react.portal"),Us=Symbol.for("react.fragment"),Lw=Symbol.for("react.strict_mode"),Bb=Symbol.for("react.profiler"),A_=Symbol.for("react.provider"),k_=Symbol.for("react.context"),Dw=Symbol.for("react.forward_ref"),zb=Symbol.for("react.suspense"),qb=Symbol.for("react.suspense_list"),_w=Symbol.for("react.memo"),Wa=Symbol.for("react.lazy"),L_=Symbol.for("react.offscreen"),qS=Symbol.iterator;function Xo(t){return t===null||typeof t!="object"?null:(t=qS&&t[qS]||t["@@iterator"],typeof t=="function"?t:null)}var _t=Object.assign,zh;function pl(t){if(zh===void 0)try{throw Error()}catch(r){var e=r.stack.trim().match(/\n( *(at )?)/);zh=e&&e[1]||""}return`
|
|
34
|
+
`+zh+t}var qh=!1;function Uh(t,e){if(!t||qh)return"";qh=!0;var r=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(e)if(e=function(){throw Error()},Object.defineProperty(e.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(e,[])}catch(u){var n=u}Reflect.construct(t,[],e)}else{try{e.call()}catch(u){n=u}t.call(e.prototype)}else{try{throw Error()}catch(u){n=u}t()}}catch(u){if(u&&n&&typeof u.stack=="string"){for(var a=u.stack.split(`
|
|
35
|
+
`),i=n.stack.split(`
|
|
36
|
+
`),s=a.length-1,o=i.length-1;1<=s&&0<=o&&a[s]!==i[o];)o--;for(;1<=s&&0<=o;s--,o--)if(a[s]!==i[o]){if(s!==1||o!==1)do if(s--,o--,0>o||a[s]!==i[o]){var l=`
|
|
37
|
+
`+a[s].replace(" at new "," at ");return t.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",t.displayName)),l}while(1<=s&&0<=o);break}}}finally{qh=!1,Error.prepareStackTrace=r}return(t=t?t.displayName||t.name:"")?pl(t):""}function xz(t){switch(t.tag){case 5:return pl(t.type);case 16:return pl("Lazy");case 13:return pl("Suspense");case 19:return pl("SuspenseList");case 0:case 2:case 15:return t=Uh(t.type,!1),t;case 11:return t=Uh(t.type.render,!1),t;case 1:return t=Uh(t.type,!0),t;default:return""}}function Ub(t){if(t==null)return null;if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case Us:return"Fragment";case qs:return"Portal";case Bb:return"Profiler";case Lw:return"StrictMode";case zb:return"Suspense";case qb:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case k_:return(t.displayName||"Context")+".Consumer";case A_:return(t._context.displayName||"Context")+".Provider";case Dw:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case _w:return e=t.displayName||null,e!==null?e:Ub(t.type)||"Memo";case Wa:e=t._payload,t=t._init;try{return Ub(t(e))}catch{}}return null}function bz(t){var e=t.type;switch(t.tag){case 24:return"Cache";case 9:return(e.displayName||"Context")+".Consumer";case 10:return(e._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return t=e.render,t=t.displayName||t.name||"",e.displayName||(t!==""?"ForwardRef("+t+")":"ForwardRef");case 7:return"Fragment";case 5:return e;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Ub(e);case 8:return e===Lw?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e}return null}function mi(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function D_(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function wz(t){var e=D_(t)?"checked":"value",r=Object.getOwnPropertyDescriptor(t.constructor.prototype,e),n=""+t[e];if(!t.hasOwnProperty(e)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var a=r.get,i=r.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return a.call(this)},set:function(s){n=""+s,i.call(this,s)}}),Object.defineProperty(t,e,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(s){n=""+s},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function lc(t){t._valueTracker||(t._valueTracker=wz(t))}function __(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var r=e.getValue(),n="";return t&&(n=D_(t)?t.checked?"true":"false":t.value),t=n,t!==r?(e.setValue(t),!0):!1}function bd(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}function $b(t,e){var r=e.checked;return _t({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??t._wrapperState.initialChecked})}function US(t,e){var r=e.defaultValue==null?"":e.defaultValue,n=e.checked!=null?e.checked:e.defaultChecked;r=mi(e.value!=null?e.value:r),t._wrapperState={initialChecked:n,initialValue:r,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function j_(t,e){e=e.checked,e!=null&&kw(t,"checked",e,!1)}function Vb(t,e){j_(t,e);var r=mi(e.value),n=e.type;if(r!=null)n==="number"?(r===0&&t.value===""||t.value!=r)&&(t.value=""+r):t.value!==""+r&&(t.value=""+r);else if(n==="submit"||n==="reset"){t.removeAttribute("value");return}e.hasOwnProperty("value")?Gb(t,e.type,r):e.hasOwnProperty("defaultValue")&&Gb(t,e.type,mi(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(t.defaultChecked=!!e.defaultChecked)}function $S(t,e,r){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var n=e.type;if(!(n!=="submit"&&n!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+t._wrapperState.initialValue,r||e===t.value||(t.value=e),t.defaultValue=e}r=t.name,r!==""&&(t.name=""),t.defaultChecked=!!t._wrapperState.initialChecked,r!==""&&(t.name=r)}function Gb(t,e,r){(e!=="number"||bd(t.ownerDocument)!==t)&&(r==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+r&&(t.defaultValue=""+r))}var gl=Array.isArray;function no(t,e,r,n){if(t=t.options,e){e={};for(var a=0;a<r.length;a++)e["$"+r[a]]=!0;for(r=0;r<t.length;r++)a=e.hasOwnProperty("$"+t[r].value),t[r].selected!==a&&(t[r].selected=a),a&&n&&(t[r].defaultSelected=!0)}else{for(r=""+mi(r),e=null,a=0;a<t.length;a++){if(t[a].value===r){t[a].selected=!0,n&&(t[a].defaultSelected=!0);return}e!==null||t[a].disabled||(e=t[a])}e!==null&&(e.selected=!0)}}function Hb(t,e){if(e.dangerouslySetInnerHTML!=null)throw Error(Pe(91));return _t({},e,{value:void 0,defaultValue:void 0,children:""+t._wrapperState.initialValue})}function VS(t,e){var r=e.value;if(r==null){if(r=e.children,e=e.defaultValue,r!=null){if(e!=null)throw Error(Pe(92));if(gl(r)){if(1<r.length)throw Error(Pe(93));r=r[0]}e=r}e==null&&(e=""),r=e}t._wrapperState={initialValue:mi(r)}}function O_(t,e){var r=mi(e.value),n=mi(e.defaultValue);r!=null&&(r=""+r,r!==t.value&&(t.value=r),e.defaultValue==null&&t.defaultValue!==r&&(t.defaultValue=r)),n!=null&&(t.defaultValue=""+n)}function GS(t){var e=t.textContent;e===t._wrapperState.initialValue&&e!==""&&e!==null&&(t.value=e)}function M_(t){switch(t){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Wb(t,e){return t==null||t==="http://www.w3.org/1999/xhtml"?M_(e):t==="http://www.w3.org/2000/svg"&&e==="foreignObject"?"http://www.w3.org/1999/xhtml":t}var uc,I_=function(t){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(e,r,n,a){MSApp.execUnsafeLocalFunction(function(){return t(e,r,n,a)})}:t}(function(t,e){if(t.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in t)t.innerHTML=e;else{for(uc=uc||document.createElement("div"),uc.innerHTML="<svg>"+e.valueOf().toString()+"</svg>",e=uc.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;e.firstChild;)t.appendChild(e.firstChild)}});function Vl(t,e){if(e){var r=t.firstChild;if(r&&r===t.lastChild&&r.nodeType===3){r.nodeValue=e;return}}t.textContent=e}var Rl={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Ez=["Webkit","ms","Moz","O"];Object.keys(Rl).forEach(function(t){Ez.forEach(function(e){e=e+t.charAt(0).toUpperCase()+t.substring(1),Rl[e]=Rl[t]})});function F_(t,e,r){return e==null||typeof e=="boolean"||e===""?"":r||typeof e!="number"||e===0||Rl.hasOwnProperty(t)&&Rl[t]?(""+e).trim():e+"px"}function B_(t,e){t=t.style;for(var r in e)if(e.hasOwnProperty(r)){var n=r.indexOf("--")===0,a=F_(r,e[r],n);r==="float"&&(r="cssFloat"),n?t.setProperty(r,a):t[r]=a}}var Sz=_t({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Yb(t,e){if(e){if(Sz[t]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(Pe(137,t));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(Pe(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(Pe(61))}if(e.style!=null&&typeof e.style!="object")throw Error(Pe(62))}}function Xb(t,e){if(t.indexOf("-")===-1)return typeof e.is=="string";switch(t){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Kb=null;function jw(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var Qb=null,ao=null,io=null;function HS(t){if(t=Pu(t)){if(typeof Qb!="function")throw Error(Pe(280));var e=t.stateNode;e&&(e=Pf(e),Qb(t.stateNode,t.type,e))}}function z_(t){ao?io?io.push(t):io=[t]:ao=t}function q_(){if(ao){var t=ao,e=io;if(io=ao=null,HS(t),e)for(t=0;t<e.length;t++)HS(e[t])}}function U_(t,e){return t(e)}function $_(){}var $h=!1;function V_(t,e,r){if($h)return t(e,r);$h=!0;try{return U_(t,e,r)}finally{$h=!1,(ao!==null||io!==null)&&($_(),q_())}}function Gl(t,e){var r=t.stateNode;if(r===null)return null;var n=Pf(r);if(n===null)return null;r=n[e];e:switch(e){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(n=!n.disabled)||(t=t.type,n=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!n;break e;default:t=!1}if(t)return null;if(r&&typeof r!="function")throw Error(Pe(231,e,typeof r));return r}var Zb=!1;if(Pa)try{var Ko={};Object.defineProperty(Ko,"passive",{get:function(){Zb=!0}}),window.addEventListener("test",Ko,Ko),window.removeEventListener("test",Ko,Ko)}catch{Zb=!1}function Cz(t,e,r,n,a,i,s,o,l){var u=Array.prototype.slice.call(arguments,3);try{e.apply(r,u)}catch(c){this.onError(c)}}var Pl=!1,wd=null,Ed=!1,Jb=null,Nz={onError:function(t){Pl=!0,wd=t}};function Tz(t,e,r,n,a,i,s,o,l){Pl=!1,wd=null,Cz.apply(Nz,arguments)}function Rz(t,e,r,n,a,i,s,o,l){if(Tz.apply(this,arguments),Pl){if(Pl){var u=wd;Pl=!1,wd=null}else throw Error(Pe(198));Ed||(Ed=!0,Jb=u)}}function xs(t){var e=t,r=t;if(t.alternate)for(;e.return;)e=e.return;else{t=e;do e=t,e.flags&4098&&(r=e.return),t=e.return;while(t)}return e.tag===3?r:null}function G_(t){if(t.tag===13){var e=t.memoizedState;if(e===null&&(t=t.alternate,t!==null&&(e=t.memoizedState)),e!==null)return e.dehydrated}return null}function WS(t){if(xs(t)!==t)throw Error(Pe(188))}function Pz(t){var e=t.alternate;if(!e){if(e=xs(t),e===null)throw Error(Pe(188));return e!==t?null:t}for(var r=t,n=e;;){var a=r.return;if(a===null)break;var i=a.alternate;if(i===null){if(n=a.return,n!==null){r=n;continue}break}if(a.child===i.child){for(i=a.child;i;){if(i===r)return WS(a),t;if(i===n)return WS(a),e;i=i.sibling}throw Error(Pe(188))}if(r.return!==n.return)r=a,n=i;else{for(var s=!1,o=a.child;o;){if(o===r){s=!0,r=a,n=i;break}if(o===n){s=!0,n=a,r=i;break}o=o.sibling}if(!s){for(o=i.child;o;){if(o===r){s=!0,r=i,n=a;break}if(o===n){s=!0,n=i,r=a;break}o=o.sibling}if(!s)throw Error(Pe(189))}}if(r.alternate!==n)throw Error(Pe(190))}if(r.tag!==3)throw Error(Pe(188));return r.stateNode.current===r?t:e}function H_(t){return t=Pz(t),t!==null?W_(t):null}function W_(t){if(t.tag===5||t.tag===6)return t;for(t=t.child;t!==null;){var e=W_(t);if(e!==null)return e;t=t.sibling}return null}var Y_=dn.unstable_scheduleCallback,YS=dn.unstable_cancelCallback,Az=dn.unstable_shouldYield,kz=dn.unstable_requestPaint,Ft=dn.unstable_now,Lz=dn.unstable_getCurrentPriorityLevel,Ow=dn.unstable_ImmediatePriority,X_=dn.unstable_UserBlockingPriority,Sd=dn.unstable_NormalPriority,Dz=dn.unstable_LowPriority,K_=dn.unstable_IdlePriority,Cf=null,oa=null;function _z(t){if(oa&&typeof oa.onCommitFiberRoot=="function")try{oa.onCommitFiberRoot(Cf,t,void 0,(t.current.flags&128)===128)}catch{}}var qn=Math.clz32?Math.clz32:Mz,jz=Math.log,Oz=Math.LN2;function Mz(t){return t>>>=0,t===0?32:31-(jz(t)/Oz|0)|0}var cc=64,dc=4194304;function ml(t){switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return t&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return t}}function Cd(t,e){var r=t.pendingLanes;if(r===0)return 0;var n=0,a=t.suspendedLanes,i=t.pingedLanes,s=r&268435455;if(s!==0){var o=s&~a;o!==0?n=ml(o):(i&=s,i!==0&&(n=ml(i)))}else s=r&~a,s!==0?n=ml(s):i!==0&&(n=ml(i));if(n===0)return 0;if(e!==0&&e!==n&&!(e&a)&&(a=n&-n,i=e&-e,a>=i||a===16&&(i&4194240)!==0))return e;if(n&4&&(n|=r&16),e=t.entangledLanes,e!==0)for(t=t.entanglements,e&=n;0<e;)r=31-qn(e),a=1<<r,n|=t[r],e&=~a;return n}function Iz(t,e){switch(t){case 1:case 2:case 4:return e+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Fz(t,e){for(var r=t.suspendedLanes,n=t.pingedLanes,a=t.expirationTimes,i=t.pendingLanes;0<i;){var s=31-qn(i),o=1<<s,l=a[s];l===-1?(!(o&r)||o&n)&&(a[s]=Iz(o,e)):l<=e&&(t.expiredLanes|=o),i&=~o}}function e1(t){return t=t.pendingLanes&-1073741825,t!==0?t:t&1073741824?1073741824:0}function Q_(){var t=cc;return cc<<=1,!(cc&4194240)&&(cc=64),t}function Vh(t){for(var e=[],r=0;31>r;r++)e.push(t);return e}function Tu(t,e,r){t.pendingLanes|=e,e!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,e=31-qn(e),t[e]=r}function Bz(t,e){var r=t.pendingLanes&~e;t.pendingLanes=e,t.suspendedLanes=0,t.pingedLanes=0,t.expiredLanes&=e,t.mutableReadLanes&=e,t.entangledLanes&=e,e=t.entanglements;var n=t.eventTimes;for(t=t.expirationTimes;0<r;){var a=31-qn(r),i=1<<a;e[a]=0,n[a]=-1,t[a]=-1,r&=~i}}function Mw(t,e){var r=t.entangledLanes|=e;for(t=t.entanglements;r;){var n=31-qn(r),a=1<<n;a&e|t[n]&e&&(t[n]|=e),r&=~a}}var vt=0;function Z_(t){return t&=-t,1<t?4<t?t&268435455?16:536870912:4:1}var J_,Iw,ej,tj,rj,t1=!1,fc=[],si=null,oi=null,li=null,Hl=new Map,Wl=new Map,Ka=[],zz="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function XS(t,e){switch(t){case"focusin":case"focusout":si=null;break;case"dragenter":case"dragleave":oi=null;break;case"mouseover":case"mouseout":li=null;break;case"pointerover":case"pointerout":Hl.delete(e.pointerId);break;case"gotpointercapture":case"lostpointercapture":Wl.delete(e.pointerId)}}function Qo(t,e,r,n,a,i){return t===null||t.nativeEvent!==i?(t={blockedOn:e,domEventName:r,eventSystemFlags:n,nativeEvent:i,targetContainers:[a]},e!==null&&(e=Pu(e),e!==null&&Iw(e)),t):(t.eventSystemFlags|=n,e=t.targetContainers,a!==null&&e.indexOf(a)===-1&&e.push(a),t)}function qz(t,e,r,n,a){switch(e){case"focusin":return si=Qo(si,t,e,r,n,a),!0;case"dragenter":return oi=Qo(oi,t,e,r,n,a),!0;case"mouseover":return li=Qo(li,t,e,r,n,a),!0;case"pointerover":var i=a.pointerId;return Hl.set(i,Qo(Hl.get(i)||null,t,e,r,n,a)),!0;case"gotpointercapture":return i=a.pointerId,Wl.set(i,Qo(Wl.get(i)||null,t,e,r,n,a)),!0}return!1}function nj(t){var e=Xi(t.target);if(e!==null){var r=xs(e);if(r!==null){if(e=r.tag,e===13){if(e=G_(r),e!==null){t.blockedOn=e,rj(t.priority,function(){ej(r)});return}}else if(e===3&&r.stateNode.current.memoizedState.isDehydrated){t.blockedOn=r.tag===3?r.stateNode.containerInfo:null;return}}}t.blockedOn=null}function Gc(t){if(t.blockedOn!==null)return!1;for(var e=t.targetContainers;0<e.length;){var r=r1(t.domEventName,t.eventSystemFlags,e[0],t.nativeEvent);if(r===null){r=t.nativeEvent;var n=new r.constructor(r.type,r);Kb=n,r.target.dispatchEvent(n),Kb=null}else return e=Pu(r),e!==null&&Iw(e),t.blockedOn=r,!1;e.shift()}return!0}function KS(t,e,r){Gc(t)&&r.delete(e)}function Uz(){t1=!1,si!==null&&Gc(si)&&(si=null),oi!==null&&Gc(oi)&&(oi=null),li!==null&&Gc(li)&&(li=null),Hl.forEach(KS),Wl.forEach(KS)}function Zo(t,e){t.blockedOn===e&&(t.blockedOn=null,t1||(t1=!0,dn.unstable_scheduleCallback(dn.unstable_NormalPriority,Uz)))}function Yl(t){function e(a){return Zo(a,t)}if(0<fc.length){Zo(fc[0],t);for(var r=1;r<fc.length;r++){var n=fc[r];n.blockedOn===t&&(n.blockedOn=null)}}for(si!==null&&Zo(si,t),oi!==null&&Zo(oi,t),li!==null&&Zo(li,t),Hl.forEach(e),Wl.forEach(e),r=0;r<Ka.length;r++)n=Ka[r],n.blockedOn===t&&(n.blockedOn=null);for(;0<Ka.length&&(r=Ka[0],r.blockedOn===null);)nj(r),r.blockedOn===null&&Ka.shift()}var so=Ma.ReactCurrentBatchConfig,Nd=!0;function $z(t,e,r,n){var a=vt,i=so.transition;so.transition=null;try{vt=1,Fw(t,e,r,n)}finally{vt=a,so.transition=i}}function Vz(t,e,r,n){var a=vt,i=so.transition;so.transition=null;try{vt=4,Fw(t,e,r,n)}finally{vt=a,so.transition=i}}function Fw(t,e,r,n){if(Nd){var a=r1(t,e,r,n);if(a===null)ev(t,e,n,Td,r),XS(t,n);else if(qz(a,t,e,r,n))n.stopPropagation();else if(XS(t,n),e&4&&-1<zz.indexOf(t)){for(;a!==null;){var i=Pu(a);if(i!==null&&J_(i),i=r1(t,e,r,n),i===null&&ev(t,e,n,Td,r),i===a)break;a=i}a!==null&&n.stopPropagation()}else ev(t,e,n,null,r)}}var Td=null;function r1(t,e,r,n){if(Td=null,t=jw(n),t=Xi(t),t!==null)if(e=xs(t),e===null)t=null;else if(r=e.tag,r===13){if(t=G_(e),t!==null)return t;t=null}else if(r===3){if(e.stateNode.current.memoizedState.isDehydrated)return e.tag===3?e.stateNode.containerInfo:null;t=null}else e!==t&&(t=null);return Td=t,null}function aj(t){switch(t){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(Lz()){case Ow:return 1;case X_:return 4;case Sd:case Dz:return 16;case K_:return 536870912;default:return 16}default:return 16}}var ei=null,Bw=null,Hc=null;function ij(){if(Hc)return Hc;var t,e=Bw,r=e.length,n,a="value"in ei?ei.value:ei.textContent,i=a.length;for(t=0;t<r&&e[t]===a[t];t++);var s=r-t;for(n=1;n<=s&&e[r-n]===a[i-n];n++);return Hc=a.slice(t,1<n?1-n:void 0)}function Wc(t){var e=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&e===13&&(t=13)):t=e,t===10&&(t=13),32<=t||t===13?t:0}function hc(){return!0}function QS(){return!1}function hn(t){function e(r,n,a,i,s){this._reactName=r,this._targetInst=a,this.type=n,this.nativeEvent=i,this.target=s,this.currentTarget=null;for(var o in t)t.hasOwnProperty(o)&&(r=t[o],this[o]=r?r(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?hc:QS,this.isPropagationStopped=QS,this}return _t(e.prototype,{preventDefault:function(){this.defaultPrevented=!0;var r=this.nativeEvent;r&&(r.preventDefault?r.preventDefault():typeof r.returnValue!="unknown"&&(r.returnValue=!1),this.isDefaultPrevented=hc)},stopPropagation:function(){var r=this.nativeEvent;r&&(r.stopPropagation?r.stopPropagation():typeof r.cancelBubble!="unknown"&&(r.cancelBubble=!0),this.isPropagationStopped=hc)},persist:function(){},isPersistent:hc}),e}var Ro={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},zw=hn(Ro),Ru=_t({},Ro,{view:0,detail:0}),Gz=hn(Ru),Gh,Hh,Jo,Nf=_t({},Ru,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:qw,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==Jo&&(Jo&&t.type==="mousemove"?(Gh=t.screenX-Jo.screenX,Hh=t.screenY-Jo.screenY):Hh=Gh=0,Jo=t),Gh)},movementY:function(t){return"movementY"in t?t.movementY:Hh}}),ZS=hn(Nf),Hz=_t({},Nf,{dataTransfer:0}),Wz=hn(Hz),Yz=_t({},Ru,{relatedTarget:0}),Wh=hn(Yz),Xz=_t({},Ro,{animationName:0,elapsedTime:0,pseudoElement:0}),Kz=hn(Xz),Qz=_t({},Ro,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),Zz=hn(Qz),Jz=_t({},Ro,{data:0}),JS=hn(Jz),eq={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},tq={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},rq={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function nq(t){var e=this.nativeEvent;return e.getModifierState?e.getModifierState(t):(t=rq[t])?!!e[t]:!1}function qw(){return nq}var aq=_t({},Ru,{key:function(t){if(t.key){var e=eq[t.key]||t.key;if(e!=="Unidentified")return e}return t.type==="keypress"?(t=Wc(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?tq[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:qw,charCode:function(t){return t.type==="keypress"?Wc(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?Wc(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),iq=hn(aq),sq=_t({},Nf,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),eC=hn(sq),oq=_t({},Ru,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:qw}),lq=hn(oq),uq=_t({},Ro,{propertyName:0,elapsedTime:0,pseudoElement:0}),cq=hn(uq),dq=_t({},Nf,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),fq=hn(dq),hq=[9,13,27,32],Uw=Pa&&"CompositionEvent"in window,Al=null;Pa&&"documentMode"in document&&(Al=document.documentMode);var vq=Pa&&"TextEvent"in window&&!Al,sj=Pa&&(!Uw||Al&&8<Al&&11>=Al),tC=String.fromCharCode(32),rC=!1;function oj(t,e){switch(t){case"keyup":return hq.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function lj(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var $s=!1;function pq(t,e){switch(t){case"compositionend":return lj(e);case"keypress":return e.which!==32?null:(rC=!0,tC);case"textInput":return t=e.data,t===tC&&rC?null:t;default:return null}}function gq(t,e){if($s)return t==="compositionend"||!Uw&&oj(t,e)?(t=ij(),Hc=Bw=ei=null,$s=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1<e.char.length)return e.char;if(e.which)return String.fromCharCode(e.which)}return null;case"compositionend":return sj&&e.locale!=="ko"?null:e.data;default:return null}}var mq={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function nC(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e==="input"?!!mq[t.type]:e==="textarea"}function uj(t,e,r,n){z_(n),e=Rd(e,"onChange"),0<e.length&&(r=new zw("onChange","change",null,r,n),t.push({event:r,listeners:e}))}var kl=null,Xl=null;function yq(t){bj(t,0)}function Tf(t){var e=Hs(t);if(__(e))return t}function xq(t,e){if(t==="change")return e}var cj=!1;if(Pa){var Yh;if(Pa){var Xh="oninput"in document;if(!Xh){var aC=document.createElement("div");aC.setAttribute("oninput","return;"),Xh=typeof aC.oninput=="function"}Yh=Xh}else Yh=!1;cj=Yh&&(!document.documentMode||9<document.documentMode)}function iC(){kl&&(kl.detachEvent("onpropertychange",dj),Xl=kl=null)}function dj(t){if(t.propertyName==="value"&&Tf(Xl)){var e=[];uj(e,Xl,t,jw(t)),V_(yq,e)}}function bq(t,e,r){t==="focusin"?(iC(),kl=e,Xl=r,kl.attachEvent("onpropertychange",dj)):t==="focusout"&&iC()}function wq(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return Tf(Xl)}function Eq(t,e){if(t==="click")return Tf(e)}function Sq(t,e){if(t==="input"||t==="change")return Tf(e)}function Cq(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var Gn=typeof Object.is=="function"?Object.is:Cq;function Kl(t,e){if(Gn(t,e))return!0;if(typeof t!="object"||t===null||typeof e!="object"||e===null)return!1;var r=Object.keys(t),n=Object.keys(e);if(r.length!==n.length)return!1;for(n=0;n<r.length;n++){var a=r[n];if(!Fb.call(e,a)||!Gn(t[a],e[a]))return!1}return!0}function sC(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function oC(t,e){var r=sC(t);t=0;for(var n;r;){if(r.nodeType===3){if(n=t+r.textContent.length,t<=e&&n>=e)return{node:r,offset:e-t};t=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=sC(r)}}function fj(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?fj(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function hj(){for(var t=window,e=bd();e instanceof t.HTMLIFrameElement;){try{var r=typeof e.contentWindow.location.href=="string"}catch{r=!1}if(r)t=e.contentWindow;else break;e=bd(t.document)}return e}function $w(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&(e==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||e==="textarea"||t.contentEditable==="true")}function Nq(t){var e=hj(),r=t.focusedElem,n=t.selectionRange;if(e!==r&&r&&r.ownerDocument&&fj(r.ownerDocument.documentElement,r)){if(n!==null&&$w(r)){if(e=n.start,t=n.end,t===void 0&&(t=e),"selectionStart"in r)r.selectionStart=e,r.selectionEnd=Math.min(t,r.value.length);else if(t=(e=r.ownerDocument||document)&&e.defaultView||window,t.getSelection){t=t.getSelection();var a=r.textContent.length,i=Math.min(n.start,a);n=n.end===void 0?i:Math.min(n.end,a),!t.extend&&i>n&&(a=n,n=i,i=a),a=oC(r,i);var s=oC(r,n);a&&s&&(t.rangeCount!==1||t.anchorNode!==a.node||t.anchorOffset!==a.offset||t.focusNode!==s.node||t.focusOffset!==s.offset)&&(e=e.createRange(),e.setStart(a.node,a.offset),t.removeAllRanges(),i>n?(t.addRange(e),t.extend(s.node,s.offset)):(e.setEnd(s.node,s.offset),t.addRange(e)))}}for(e=[],t=r;t=t.parentNode;)t.nodeType===1&&e.push({element:t,left:t.scrollLeft,top:t.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r<e.length;r++)t=e[r],t.element.scrollLeft=t.left,t.element.scrollTop=t.top}}var Tq=Pa&&"documentMode"in document&&11>=document.documentMode,Vs=null,n1=null,Ll=null,a1=!1;function lC(t,e,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;a1||Vs==null||Vs!==bd(n)||(n=Vs,"selectionStart"in n&&$w(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),Ll&&Kl(Ll,n)||(Ll=n,n=Rd(n1,"onSelect"),0<n.length&&(e=new zw("onSelect","select",null,e,r),t.push({event:e,listeners:n}),e.target=Vs)))}function vc(t,e){var r={};return r[t.toLowerCase()]=e.toLowerCase(),r["Webkit"+t]="webkit"+e,r["Moz"+t]="moz"+e,r}var Gs={animationend:vc("Animation","AnimationEnd"),animationiteration:vc("Animation","AnimationIteration"),animationstart:vc("Animation","AnimationStart"),transitionend:vc("Transition","TransitionEnd")},Kh={},vj={};Pa&&(vj=document.createElement("div").style,"AnimationEvent"in window||(delete Gs.animationend.animation,delete Gs.animationiteration.animation,delete Gs.animationstart.animation),"TransitionEvent"in window||delete Gs.transitionend.transition);function Rf(t){if(Kh[t])return Kh[t];if(!Gs[t])return t;var e=Gs[t],r;for(r in e)if(e.hasOwnProperty(r)&&r in vj)return Kh[t]=e[r];return t}var pj=Rf("animationend"),gj=Rf("animationiteration"),mj=Rf("animationstart"),yj=Rf("transitionend"),xj=new Map,uC="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function Ti(t,e){xj.set(t,e),ys(e,[t])}for(var Qh=0;Qh<uC.length;Qh++){var Zh=uC[Qh],Rq=Zh.toLowerCase(),Pq=Zh[0].toUpperCase()+Zh.slice(1);Ti(Rq,"on"+Pq)}Ti(pj,"onAnimationEnd");Ti(gj,"onAnimationIteration");Ti(mj,"onAnimationStart");Ti("dblclick","onDoubleClick");Ti("focusin","onFocus");Ti("focusout","onBlur");Ti(yj,"onTransitionEnd");vo("onMouseEnter",["mouseout","mouseover"]);vo("onMouseLeave",["mouseout","mouseover"]);vo("onPointerEnter",["pointerout","pointerover"]);vo("onPointerLeave",["pointerout","pointerover"]);ys("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));ys("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));ys("onBeforeInput",["compositionend","keypress","textInput","paste"]);ys("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));ys("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));ys("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var yl="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),Aq=new Set("cancel close invalid load scroll toggle".split(" ").concat(yl));function cC(t,e,r){var n=t.type||"unknown-event";t.currentTarget=r,Rz(n,e,void 0,t),t.currentTarget=null}function bj(t,e){e=(e&4)!==0;for(var r=0;r<t.length;r++){var n=t[r],a=n.event;n=n.listeners;e:{var i=void 0;if(e)for(var s=n.length-1;0<=s;s--){var o=n[s],l=o.instance,u=o.currentTarget;if(o=o.listener,l!==i&&a.isPropagationStopped())break e;cC(a,o,u),i=l}else for(s=0;s<n.length;s++){if(o=n[s],l=o.instance,u=o.currentTarget,o=o.listener,l!==i&&a.isPropagationStopped())break e;cC(a,o,u),i=l}}}if(Ed)throw t=Jb,Ed=!1,Jb=null,t}function wt(t,e){var r=e[u1];r===void 0&&(r=e[u1]=new Set);var n=t+"__bubble";r.has(n)||(wj(e,t,2,!1),r.add(n))}function Jh(t,e,r){var n=0;e&&(n|=4),wj(r,t,n,e)}var pc="_reactListening"+Math.random().toString(36).slice(2);function Ql(t){if(!t[pc]){t[pc]=!0,P_.forEach(function(r){r!=="selectionchange"&&(Aq.has(r)||Jh(r,!1,t),Jh(r,!0,t))});var e=t.nodeType===9?t:t.ownerDocument;e===null||e[pc]||(e[pc]=!0,Jh("selectionchange",!1,e))}}function wj(t,e,r,n){switch(aj(e)){case 1:var a=$z;break;case 4:a=Vz;break;default:a=Fw}r=a.bind(null,e,r,t),a=void 0,!Zb||e!=="touchstart"&&e!=="touchmove"&&e!=="wheel"||(a=!0),n?a!==void 0?t.addEventListener(e,r,{capture:!0,passive:a}):t.addEventListener(e,r,!0):a!==void 0?t.addEventListener(e,r,{passive:a}):t.addEventListener(e,r,!1)}function ev(t,e,r,n,a){var i=n;if(!(e&1)&&!(e&2)&&n!==null)e:for(;;){if(n===null)return;var s=n.tag;if(s===3||s===4){var o=n.stateNode.containerInfo;if(o===a||o.nodeType===8&&o.parentNode===a)break;if(s===4)for(s=n.return;s!==null;){var l=s.tag;if((l===3||l===4)&&(l=s.stateNode.containerInfo,l===a||l.nodeType===8&&l.parentNode===a))return;s=s.return}for(;o!==null;){if(s=Xi(o),s===null)return;if(l=s.tag,l===5||l===6){n=i=s;continue e}o=o.parentNode}}n=n.return}V_(function(){var u=i,c=jw(r),d=[];e:{var f=xj.get(t);if(f!==void 0){var v=zw,p=t;switch(t){case"keypress":if(Wc(r)===0)break e;case"keydown":case"keyup":v=iq;break;case"focusin":p="focus",v=Wh;break;case"focusout":p="blur",v=Wh;break;case"beforeblur":case"afterblur":v=Wh;break;case"click":if(r.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":v=ZS;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":v=Wz;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":v=lq;break;case pj:case gj:case mj:v=Kz;break;case yj:v=cq;break;case"scroll":v=Gz;break;case"wheel":v=fq;break;case"copy":case"cut":case"paste":v=Zz;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":v=eC}var y=(e&4)!==0,m=!y&&t==="scroll",g=y?f!==null?f+"Capture":null:f;y=[];for(var x=u,b;x!==null;){b=x;var w=b.stateNode;if(b.tag===5&&w!==null&&(b=w,g!==null&&(w=Gl(x,g),w!=null&&y.push(Zl(x,w,b)))),m)break;x=x.return}0<y.length&&(f=new v(f,p,null,r,c),d.push({event:f,listeners:y}))}}if(!(e&7)){e:{if(f=t==="mouseover"||t==="pointerover",v=t==="mouseout"||t==="pointerout",f&&r!==Kb&&(p=r.relatedTarget||r.fromElement)&&(Xi(p)||p[Aa]))break e;if((v||f)&&(f=c.window===c?c:(f=c.ownerDocument)?f.defaultView||f.parentWindow:window,v?(p=r.relatedTarget||r.toElement,v=u,p=p?Xi(p):null,p!==null&&(m=xs(p),p!==m||p.tag!==5&&p.tag!==6)&&(p=null)):(v=null,p=u),v!==p)){if(y=ZS,w="onMouseLeave",g="onMouseEnter",x="mouse",(t==="pointerout"||t==="pointerover")&&(y=eC,w="onPointerLeave",g="onPointerEnter",x="pointer"),m=v==null?f:Hs(v),b=p==null?f:Hs(p),f=new y(w,x+"leave",v,r,c),f.target=m,f.relatedTarget=b,w=null,Xi(c)===u&&(y=new y(g,x+"enter",p,r,c),y.target=b,y.relatedTarget=m,w=y),m=w,v&&p)t:{for(y=v,g=p,x=0,b=y;b;b=Ts(b))x++;for(b=0,w=g;w;w=Ts(w))b++;for(;0<x-b;)y=Ts(y),x--;for(;0<b-x;)g=Ts(g),b--;for(;x--;){if(y===g||g!==null&&y===g.alternate)break t;y=Ts(y),g=Ts(g)}y=null}else y=null;v!==null&&dC(d,f,v,y,!1),p!==null&&m!==null&&dC(d,m,p,y,!0)}}e:{if(f=u?Hs(u):window,v=f.nodeName&&f.nodeName.toLowerCase(),v==="select"||v==="input"&&f.type==="file")var E=xq;else if(nC(f))if(cj)E=Sq;else{E=wq;var C=bq}else(v=f.nodeName)&&v.toLowerCase()==="input"&&(f.type==="checkbox"||f.type==="radio")&&(E=Eq);if(E&&(E=E(t,u))){uj(d,E,r,c);break e}C&&C(t,f,u),t==="focusout"&&(C=f._wrapperState)&&C.controlled&&f.type==="number"&&Gb(f,"number",f.value)}switch(C=u?Hs(u):window,t){case"focusin":(nC(C)||C.contentEditable==="true")&&(Vs=C,n1=u,Ll=null);break;case"focusout":Ll=n1=Vs=null;break;case"mousedown":a1=!0;break;case"contextmenu":case"mouseup":case"dragend":a1=!1,lC(d,r,c);break;case"selectionchange":if(Tq)break;case"keydown":case"keyup":lC(d,r,c)}var S;if(Uw)e:{switch(t){case"compositionstart":var T="onCompositionStart";break e;case"compositionend":T="onCompositionEnd";break e;case"compositionupdate":T="onCompositionUpdate";break e}T=void 0}else $s?oj(t,r)&&(T="onCompositionEnd"):t==="keydown"&&r.keyCode===229&&(T="onCompositionStart");T&&(sj&&r.locale!=="ko"&&($s||T!=="onCompositionStart"?T==="onCompositionEnd"&&$s&&(S=ij()):(ei=c,Bw="value"in ei?ei.value:ei.textContent,$s=!0)),C=Rd(u,T),0<C.length&&(T=new JS(T,t,null,r,c),d.push({event:T,listeners:C}),S?T.data=S:(S=lj(r),S!==null&&(T.data=S)))),(S=vq?pq(t,r):gq(t,r))&&(u=Rd(u,"onBeforeInput"),0<u.length&&(c=new JS("onBeforeInput","beforeinput",null,r,c),d.push({event:c,listeners:u}),c.data=S))}bj(d,e)})}function Zl(t,e,r){return{instance:t,listener:e,currentTarget:r}}function Rd(t,e){for(var r=e+"Capture",n=[];t!==null;){var a=t,i=a.stateNode;a.tag===5&&i!==null&&(a=i,i=Gl(t,r),i!=null&&n.unshift(Zl(t,i,a)),i=Gl(t,e),i!=null&&n.push(Zl(t,i,a))),t=t.return}return n}function Ts(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5);return t||null}function dC(t,e,r,n,a){for(var i=e._reactName,s=[];r!==null&&r!==n;){var o=r,l=o.alternate,u=o.stateNode;if(l!==null&&l===n)break;o.tag===5&&u!==null&&(o=u,a?(l=Gl(r,i),l!=null&&s.unshift(Zl(r,l,o))):a||(l=Gl(r,i),l!=null&&s.push(Zl(r,l,o)))),r=r.return}s.length!==0&&t.push({event:e,listeners:s})}var kq=/\r\n?/g,Lq=/\u0000|\uFFFD/g;function fC(t){return(typeof t=="string"?t:""+t).replace(kq,`
|
|
38
|
+
`).replace(Lq,"")}function gc(t,e,r){if(e=fC(e),fC(t)!==e&&r)throw Error(Pe(425))}function Pd(){}var i1=null,s1=null;function o1(t,e){return t==="textarea"||t==="noscript"||typeof e.children=="string"||typeof e.children=="number"||typeof e.dangerouslySetInnerHTML=="object"&&e.dangerouslySetInnerHTML!==null&&e.dangerouslySetInnerHTML.__html!=null}var l1=typeof setTimeout=="function"?setTimeout:void 0,Dq=typeof clearTimeout=="function"?clearTimeout:void 0,hC=typeof Promise=="function"?Promise:void 0,_q=typeof queueMicrotask=="function"?queueMicrotask:typeof hC<"u"?function(t){return hC.resolve(null).then(t).catch(jq)}:l1;function jq(t){setTimeout(function(){throw t})}function tv(t,e){var r=e,n=0;do{var a=r.nextSibling;if(t.removeChild(r),a&&a.nodeType===8)if(r=a.data,r==="/$"){if(n===0){t.removeChild(a),Yl(e);return}n--}else r!=="$"&&r!=="$?"&&r!=="$!"||n++;r=a}while(r);Yl(e)}function ui(t){for(;t!=null;t=t.nextSibling){var e=t.nodeType;if(e===1||e===3)break;if(e===8){if(e=t.data,e==="$"||e==="$!"||e==="$?")break;if(e==="/$")return null}}return t}function vC(t){t=t.previousSibling;for(var e=0;t;){if(t.nodeType===8){var r=t.data;if(r==="$"||r==="$!"||r==="$?"){if(e===0)return t;e--}else r==="/$"&&e++}t=t.previousSibling}return null}var Po=Math.random().toString(36).slice(2),ia="__reactFiber$"+Po,Jl="__reactProps$"+Po,Aa="__reactContainer$"+Po,u1="__reactEvents$"+Po,Oq="__reactListeners$"+Po,Mq="__reactHandles$"+Po;function Xi(t){var e=t[ia];if(e)return e;for(var r=t.parentNode;r;){if(e=r[Aa]||r[ia]){if(r=e.alternate,e.child!==null||r!==null&&r.child!==null)for(t=vC(t);t!==null;){if(r=t[ia])return r;t=vC(t)}return e}t=r,r=t.parentNode}return null}function Pu(t){return t=t[ia]||t[Aa],!t||t.tag!==5&&t.tag!==6&&t.tag!==13&&t.tag!==3?null:t}function Hs(t){if(t.tag===5||t.tag===6)return t.stateNode;throw Error(Pe(33))}function Pf(t){return t[Jl]||null}var c1=[],Ws=-1;function Ri(t){return{current:t}}function St(t){0>Ws||(t.current=c1[Ws],c1[Ws]=null,Ws--)}function xt(t,e){Ws++,c1[Ws]=t.current,t.current=e}var yi={},Nr=Ri(yi),Kr=Ri(!1),ns=yi;function po(t,e){var r=t.type.contextTypes;if(!r)return yi;var n=t.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===e)return n.__reactInternalMemoizedMaskedChildContext;var a={},i;for(i in r)a[i]=e[i];return n&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=e,t.__reactInternalMemoizedMaskedChildContext=a),a}function Qr(t){return t=t.childContextTypes,t!=null}function Ad(){St(Kr),St(Nr)}function pC(t,e,r){if(Nr.current!==yi)throw Error(Pe(168));xt(Nr,e),xt(Kr,r)}function Ej(t,e,r){var n=t.stateNode;if(e=e.childContextTypes,typeof n.getChildContext!="function")return r;n=n.getChildContext();for(var a in n)if(!(a in e))throw Error(Pe(108,bz(t)||"Unknown",a));return _t({},r,n)}function kd(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||yi,ns=Nr.current,xt(Nr,t),xt(Kr,Kr.current),!0}function gC(t,e,r){var n=t.stateNode;if(!n)throw Error(Pe(169));r?(t=Ej(t,e,ns),n.__reactInternalMemoizedMergedChildContext=t,St(Kr),St(Nr),xt(Nr,t)):St(Kr),xt(Kr,r)}var ya=null,Af=!1,rv=!1;function Sj(t){ya===null?ya=[t]:ya.push(t)}function Iq(t){Af=!0,Sj(t)}function Pi(){if(!rv&&ya!==null){rv=!0;var t=0,e=vt;try{var r=ya;for(vt=1;t<r.length;t++){var n=r[t];do n=n(!0);while(n!==null)}ya=null,Af=!1}catch(a){throw ya!==null&&(ya=ya.slice(t+1)),Y_(Ow,Pi),a}finally{vt=e,rv=!1}}return null}var Ys=[],Xs=0,Ld=null,Dd=0,mn=[],yn=0,as=null,Ea=1,Sa="";function Ui(t,e){Ys[Xs++]=Dd,Ys[Xs++]=Ld,Ld=t,Dd=e}function Cj(t,e,r){mn[yn++]=Ea,mn[yn++]=Sa,mn[yn++]=as,as=t;var n=Ea;t=Sa;var a=32-qn(n)-1;n&=~(1<<a),r+=1;var i=32-qn(e)+a;if(30<i){var s=a-a%5;i=(n&(1<<s)-1).toString(32),n>>=s,a-=s,Ea=1<<32-qn(e)+a|r<<a|n,Sa=i+t}else Ea=1<<i|r<<a|n,Sa=t}function Vw(t){t.return!==null&&(Ui(t,1),Cj(t,1,0))}function Gw(t){for(;t===Ld;)Ld=Ys[--Xs],Ys[Xs]=null,Dd=Ys[--Xs],Ys[Xs]=null;for(;t===as;)as=mn[--yn],mn[yn]=null,Sa=mn[--yn],mn[yn]=null,Ea=mn[--yn],mn[yn]=null}var ln=null,sn=null,Nt=!1,On=null;function Nj(t,e){var r=wn(5,null,null,0);r.elementType="DELETED",r.stateNode=e,r.return=t,e=t.deletions,e===null?(t.deletions=[r],t.flags|=16):e.push(r)}function mC(t,e){switch(t.tag){case 5:var r=t.type;return e=e.nodeType!==1||r.toLowerCase()!==e.nodeName.toLowerCase()?null:e,e!==null?(t.stateNode=e,ln=t,sn=ui(e.firstChild),!0):!1;case 6:return e=t.pendingProps===""||e.nodeType!==3?null:e,e!==null?(t.stateNode=e,ln=t,sn=null,!0):!1;case 13:return e=e.nodeType!==8?null:e,e!==null?(r=as!==null?{id:Ea,overflow:Sa}:null,t.memoizedState={dehydrated:e,treeContext:r,retryLane:1073741824},r=wn(18,null,null,0),r.stateNode=e,r.return=t,t.child=r,ln=t,sn=null,!0):!1;default:return!1}}function d1(t){return(t.mode&1)!==0&&(t.flags&128)===0}function f1(t){if(Nt){var e=sn;if(e){var r=e;if(!mC(t,e)){if(d1(t))throw Error(Pe(418));e=ui(r.nextSibling);var n=ln;e&&mC(t,e)?Nj(n,r):(t.flags=t.flags&-4097|2,Nt=!1,ln=t)}}else{if(d1(t))throw Error(Pe(418));t.flags=t.flags&-4097|2,Nt=!1,ln=t}}}function yC(t){for(t=t.return;t!==null&&t.tag!==5&&t.tag!==3&&t.tag!==13;)t=t.return;ln=t}function mc(t){if(t!==ln)return!1;if(!Nt)return yC(t),Nt=!0,!1;var e;if((e=t.tag!==3)&&!(e=t.tag!==5)&&(e=t.type,e=e!=="head"&&e!=="body"&&!o1(t.type,t.memoizedProps)),e&&(e=sn)){if(d1(t))throw Tj(),Error(Pe(418));for(;e;)Nj(t,e),e=ui(e.nextSibling)}if(yC(t),t.tag===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(Pe(317));e:{for(t=t.nextSibling,e=0;t;){if(t.nodeType===8){var r=t.data;if(r==="/$"){if(e===0){sn=ui(t.nextSibling);break e}e--}else r!=="$"&&r!=="$!"&&r!=="$?"||e++}t=t.nextSibling}sn=null}}else sn=ln?ui(t.stateNode.nextSibling):null;return!0}function Tj(){for(var t=sn;t;)t=ui(t.nextSibling)}function go(){sn=ln=null,Nt=!1}function Hw(t){On===null?On=[t]:On.push(t)}var Fq=Ma.ReactCurrentBatchConfig;function el(t,e,r){if(t=r.ref,t!==null&&typeof t!="function"&&typeof t!="object"){if(r._owner){if(r=r._owner,r){if(r.tag!==1)throw Error(Pe(309));var n=r.stateNode}if(!n)throw Error(Pe(147,t));var a=n,i=""+t;return e!==null&&e.ref!==null&&typeof e.ref=="function"&&e.ref._stringRef===i?e.ref:(e=function(s){var o=a.refs;s===null?delete o[i]:o[i]=s},e._stringRef=i,e)}if(typeof t!="string")throw Error(Pe(284));if(!r._owner)throw Error(Pe(290,t))}return t}function yc(t,e){throw t=Object.prototype.toString.call(e),Error(Pe(31,t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t))}function xC(t){var e=t._init;return e(t._payload)}function Rj(t){function e(g,x){if(t){var b=g.deletions;b===null?(g.deletions=[x],g.flags|=16):b.push(x)}}function r(g,x){if(!t)return null;for(;x!==null;)e(g,x),x=x.sibling;return null}function n(g,x){for(g=new Map;x!==null;)x.key!==null?g.set(x.key,x):g.set(x.index,x),x=x.sibling;return g}function a(g,x){return g=hi(g,x),g.index=0,g.sibling=null,g}function i(g,x,b){return g.index=b,t?(b=g.alternate,b!==null?(b=b.index,b<x?(g.flags|=2,x):b):(g.flags|=2,x)):(g.flags|=1048576,x)}function s(g){return t&&g.alternate===null&&(g.flags|=2),g}function o(g,x,b,w){return x===null||x.tag!==6?(x=uv(b,g.mode,w),x.return=g,x):(x=a(x,b),x.return=g,x)}function l(g,x,b,w){var E=b.type;return E===Us?c(g,x,b.props.children,w,b.key):x!==null&&(x.elementType===E||typeof E=="object"&&E!==null&&E.$$typeof===Wa&&xC(E)===x.type)?(w=a(x,b.props),w.ref=el(g,x,b),w.return=g,w):(w=ed(b.type,b.key,b.props,null,g.mode,w),w.ref=el(g,x,b),w.return=g,w)}function u(g,x,b,w){return x===null||x.tag!==4||x.stateNode.containerInfo!==b.containerInfo||x.stateNode.implementation!==b.implementation?(x=cv(b,g.mode,w),x.return=g,x):(x=a(x,b.children||[]),x.return=g,x)}function c(g,x,b,w,E){return x===null||x.tag!==7?(x=rs(b,g.mode,w,E),x.return=g,x):(x=a(x,b),x.return=g,x)}function d(g,x,b){if(typeof x=="string"&&x!==""||typeof x=="number")return x=uv(""+x,g.mode,b),x.return=g,x;if(typeof x=="object"&&x!==null){switch(x.$$typeof){case oc:return b=ed(x.type,x.key,x.props,null,g.mode,b),b.ref=el(g,null,x),b.return=g,b;case qs:return x=cv(x,g.mode,b),x.return=g,x;case Wa:var w=x._init;return d(g,w(x._payload),b)}if(gl(x)||Xo(x))return x=rs(x,g.mode,b,null),x.return=g,x;yc(g,x)}return null}function f(g,x,b,w){var E=x!==null?x.key:null;if(typeof b=="string"&&b!==""||typeof b=="number")return E!==null?null:o(g,x,""+b,w);if(typeof b=="object"&&b!==null){switch(b.$$typeof){case oc:return b.key===E?l(g,x,b,w):null;case qs:return b.key===E?u(g,x,b,w):null;case Wa:return E=b._init,f(g,x,E(b._payload),w)}if(gl(b)||Xo(b))return E!==null?null:c(g,x,b,w,null);yc(g,b)}return null}function v(g,x,b,w,E){if(typeof w=="string"&&w!==""||typeof w=="number")return g=g.get(b)||null,o(x,g,""+w,E);if(typeof w=="object"&&w!==null){switch(w.$$typeof){case oc:return g=g.get(w.key===null?b:w.key)||null,l(x,g,w,E);case qs:return g=g.get(w.key===null?b:w.key)||null,u(x,g,w,E);case Wa:var C=w._init;return v(g,x,b,C(w._payload),E)}if(gl(w)||Xo(w))return g=g.get(b)||null,c(x,g,w,E,null);yc(x,w)}return null}function p(g,x,b,w){for(var E=null,C=null,S=x,T=x=0,P=null;S!==null&&T<b.length;T++){S.index>T?(P=S,S=null):P=S.sibling;var A=f(g,S,b[T],w);if(A===null){S===null&&(S=P);break}t&&S&&A.alternate===null&&e(g,S),x=i(A,x,T),C===null?E=A:C.sibling=A,C=A,S=P}if(T===b.length)return r(g,S),Nt&&Ui(g,T),E;if(S===null){for(;T<b.length;T++)S=d(g,b[T],w),S!==null&&(x=i(S,x,T),C===null?E=S:C.sibling=S,C=S);return Nt&&Ui(g,T),E}for(S=n(g,S);T<b.length;T++)P=v(S,g,T,b[T],w),P!==null&&(t&&P.alternate!==null&&S.delete(P.key===null?T:P.key),x=i(P,x,T),C===null?E=P:C.sibling=P,C=P);return t&&S.forEach(function(j){return e(g,j)}),Nt&&Ui(g,T),E}function y(g,x,b,w){var E=Xo(b);if(typeof E!="function")throw Error(Pe(150));if(b=E.call(b),b==null)throw Error(Pe(151));for(var C=E=null,S=x,T=x=0,P=null,A=b.next();S!==null&&!A.done;T++,A=b.next()){S.index>T?(P=S,S=null):P=S.sibling;var j=f(g,S,A.value,w);if(j===null){S===null&&(S=P);break}t&&S&&j.alternate===null&&e(g,S),x=i(j,x,T),C===null?E=j:C.sibling=j,C=j,S=P}if(A.done)return r(g,S),Nt&&Ui(g,T),E;if(S===null){for(;!A.done;T++,A=b.next())A=d(g,A.value,w),A!==null&&(x=i(A,x,T),C===null?E=A:C.sibling=A,C=A);return Nt&&Ui(g,T),E}for(S=n(g,S);!A.done;T++,A=b.next())A=v(S,g,T,A.value,w),A!==null&&(t&&A.alternate!==null&&S.delete(A.key===null?T:A.key),x=i(A,x,T),C===null?E=A:C.sibling=A,C=A);return t&&S.forEach(function(R){return e(g,R)}),Nt&&Ui(g,T),E}function m(g,x,b,w){if(typeof b=="object"&&b!==null&&b.type===Us&&b.key===null&&(b=b.props.children),typeof b=="object"&&b!==null){switch(b.$$typeof){case oc:e:{for(var E=b.key,C=x;C!==null;){if(C.key===E){if(E=b.type,E===Us){if(C.tag===7){r(g,C.sibling),x=a(C,b.props.children),x.return=g,g=x;break e}}else if(C.elementType===E||typeof E=="object"&&E!==null&&E.$$typeof===Wa&&xC(E)===C.type){r(g,C.sibling),x=a(C,b.props),x.ref=el(g,C,b),x.return=g,g=x;break e}r(g,C);break}else e(g,C);C=C.sibling}b.type===Us?(x=rs(b.props.children,g.mode,w,b.key),x.return=g,g=x):(w=ed(b.type,b.key,b.props,null,g.mode,w),w.ref=el(g,x,b),w.return=g,g=w)}return s(g);case qs:e:{for(C=b.key;x!==null;){if(x.key===C)if(x.tag===4&&x.stateNode.containerInfo===b.containerInfo&&x.stateNode.implementation===b.implementation){r(g,x.sibling),x=a(x,b.children||[]),x.return=g,g=x;break e}else{r(g,x);break}else e(g,x);x=x.sibling}x=cv(b,g.mode,w),x.return=g,g=x}return s(g);case Wa:return C=b._init,m(g,x,C(b._payload),w)}if(gl(b))return p(g,x,b,w);if(Xo(b))return y(g,x,b,w);yc(g,b)}return typeof b=="string"&&b!==""||typeof b=="number"?(b=""+b,x!==null&&x.tag===6?(r(g,x.sibling),x=a(x,b),x.return=g,g=x):(r(g,x),x=uv(b,g.mode,w),x.return=g,g=x),s(g)):r(g,x)}return m}var mo=Rj(!0),Pj=Rj(!1),_d=Ri(null),jd=null,Ks=null,Ww=null;function Yw(){Ww=Ks=jd=null}function Xw(t){var e=_d.current;St(_d),t._currentValue=e}function h1(t,e,r){for(;t!==null;){var n=t.alternate;if((t.childLanes&e)!==e?(t.childLanes|=e,n!==null&&(n.childLanes|=e)):n!==null&&(n.childLanes&e)!==e&&(n.childLanes|=e),t===r)break;t=t.return}}function oo(t,e){jd=t,Ww=Ks=null,t=t.dependencies,t!==null&&t.firstContext!==null&&(t.lanes&e&&(Yr=!0),t.firstContext=null)}function Nn(t){var e=t._currentValue;if(Ww!==t)if(t={context:t,memoizedValue:e,next:null},Ks===null){if(jd===null)throw Error(Pe(308));Ks=t,jd.dependencies={lanes:0,firstContext:t}}else Ks=Ks.next=t;return e}var Ki=null;function Kw(t){Ki===null?Ki=[t]:Ki.push(t)}function Aj(t,e,r,n){var a=e.interleaved;return a===null?(r.next=r,Kw(e)):(r.next=a.next,a.next=r),e.interleaved=r,ka(t,n)}function ka(t,e){t.lanes|=e;var r=t.alternate;for(r!==null&&(r.lanes|=e),r=t,t=t.return;t!==null;)t.childLanes|=e,r=t.alternate,r!==null&&(r.childLanes|=e),r=t,t=t.return;return r.tag===3?r.stateNode:null}var Ya=!1;function Qw(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function kj(t,e){t=t.updateQueue,e.updateQueue===t&&(e.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,effects:t.effects})}function Ta(t,e){return{eventTime:t,lane:e,tag:0,payload:null,callback:null,next:null}}function ci(t,e,r){var n=t.updateQueue;if(n===null)return null;if(n=n.shared,it&2){var a=n.pending;return a===null?e.next=e:(e.next=a.next,a.next=e),n.pending=e,ka(t,r)}return a=n.interleaved,a===null?(e.next=e,Kw(n)):(e.next=a.next,a.next=e),n.interleaved=e,ka(t,r)}function Yc(t,e,r){if(e=e.updateQueue,e!==null&&(e=e.shared,(r&4194240)!==0)){var n=e.lanes;n&=t.pendingLanes,r|=n,e.lanes=r,Mw(t,r)}}function bC(t,e){var r=t.updateQueue,n=t.alternate;if(n!==null&&(n=n.updateQueue,r===n)){var a=null,i=null;if(r=r.firstBaseUpdate,r!==null){do{var s={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};i===null?a=i=s:i=i.next=s,r=r.next}while(r!==null);i===null?a=i=e:i=i.next=e}else a=i=e;r={baseState:n.baseState,firstBaseUpdate:a,lastBaseUpdate:i,shared:n.shared,effects:n.effects},t.updateQueue=r;return}t=r.lastBaseUpdate,t===null?r.firstBaseUpdate=e:t.next=e,r.lastBaseUpdate=e}function Od(t,e,r,n){var a=t.updateQueue;Ya=!1;var i=a.firstBaseUpdate,s=a.lastBaseUpdate,o=a.shared.pending;if(o!==null){a.shared.pending=null;var l=o,u=l.next;l.next=null,s===null?i=u:s.next=u,s=l;var c=t.alternate;c!==null&&(c=c.updateQueue,o=c.lastBaseUpdate,o!==s&&(o===null?c.firstBaseUpdate=u:o.next=u,c.lastBaseUpdate=l))}if(i!==null){var d=a.baseState;s=0,c=u=l=null,o=i;do{var f=o.lane,v=o.eventTime;if((n&f)===f){c!==null&&(c=c.next={eventTime:v,lane:0,tag:o.tag,payload:o.payload,callback:o.callback,next:null});e:{var p=t,y=o;switch(f=e,v=r,y.tag){case 1:if(p=y.payload,typeof p=="function"){d=p.call(v,d,f);break e}d=p;break e;case 3:p.flags=p.flags&-65537|128;case 0:if(p=y.payload,f=typeof p=="function"?p.call(v,d,f):p,f==null)break e;d=_t({},d,f);break e;case 2:Ya=!0}}o.callback!==null&&o.lane!==0&&(t.flags|=64,f=a.effects,f===null?a.effects=[o]:f.push(o))}else v={eventTime:v,lane:f,tag:o.tag,payload:o.payload,callback:o.callback,next:null},c===null?(u=c=v,l=d):c=c.next=v,s|=f;if(o=o.next,o===null){if(o=a.shared.pending,o===null)break;f=o,o=f.next,f.next=null,a.lastBaseUpdate=f,a.shared.pending=null}}while(1);if(c===null&&(l=d),a.baseState=l,a.firstBaseUpdate=u,a.lastBaseUpdate=c,e=a.shared.interleaved,e!==null){a=e;do s|=a.lane,a=a.next;while(a!==e)}else i===null&&(a.shared.lanes=0);ss|=s,t.lanes=s,t.memoizedState=d}}function wC(t,e,r){if(t=e.effects,e.effects=null,t!==null)for(e=0;e<t.length;e++){var n=t[e],a=n.callback;if(a!==null){if(n.callback=null,n=r,typeof a!="function")throw Error(Pe(191,a));a.call(n)}}}var Au={},la=Ri(Au),eu=Ri(Au),tu=Ri(Au);function Qi(t){if(t===Au)throw Error(Pe(174));return t}function Zw(t,e){switch(xt(tu,e),xt(eu,t),xt(la,Au),t=e.nodeType,t){case 9:case 11:e=(e=e.documentElement)?e.namespaceURI:Wb(null,"");break;default:t=t===8?e.parentNode:e,e=t.namespaceURI||null,t=t.tagName,e=Wb(e,t)}St(la),xt(la,e)}function yo(){St(la),St(eu),St(tu)}function Lj(t){Qi(tu.current);var e=Qi(la.current),r=Wb(e,t.type);e!==r&&(xt(eu,t),xt(la,r))}function Jw(t){eu.current===t&&(St(la),St(eu))}var kt=Ri(0);function Md(t){for(var e=t;e!==null;){if(e.tag===13){var r=e.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||r.data==="$?"||r.data==="$!"))return e}else if(e.tag===19&&e.memoizedProps.revealOrder!==void 0){if(e.flags&128)return e}else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}return null}var nv=[];function eE(){for(var t=0;t<nv.length;t++)nv[t]._workInProgressVersionPrimary=null;nv.length=0}var Xc=Ma.ReactCurrentDispatcher,av=Ma.ReactCurrentBatchConfig,is=0,Lt=null,Jt=null,sr=null,Id=!1,Dl=!1,ru=0,Bq=0;function br(){throw Error(Pe(321))}function tE(t,e){if(e===null)return!1;for(var r=0;r<e.length&&r<t.length;r++)if(!Gn(t[r],e[r]))return!1;return!0}function rE(t,e,r,n,a,i){if(is=i,Lt=e,e.memoizedState=null,e.updateQueue=null,e.lanes=0,Xc.current=t===null||t.memoizedState===null?$q:Vq,t=r(n,a),Dl){i=0;do{if(Dl=!1,ru=0,25<=i)throw Error(Pe(301));i+=1,sr=Jt=null,e.updateQueue=null,Xc.current=Gq,t=r(n,a)}while(Dl)}if(Xc.current=Fd,e=Jt!==null&&Jt.next!==null,is=0,sr=Jt=Lt=null,Id=!1,e)throw Error(Pe(300));return t}function nE(){var t=ru!==0;return ru=0,t}function na(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return sr===null?Lt.memoizedState=sr=t:sr=sr.next=t,sr}function Tn(){if(Jt===null){var t=Lt.alternate;t=t!==null?t.memoizedState:null}else t=Jt.next;var e=sr===null?Lt.memoizedState:sr.next;if(e!==null)sr=e,Jt=t;else{if(t===null)throw Error(Pe(310));Jt=t,t={memoizedState:Jt.memoizedState,baseState:Jt.baseState,baseQueue:Jt.baseQueue,queue:Jt.queue,next:null},sr===null?Lt.memoizedState=sr=t:sr=sr.next=t}return sr}function nu(t,e){return typeof e=="function"?e(t):e}function iv(t){var e=Tn(),r=e.queue;if(r===null)throw Error(Pe(311));r.lastRenderedReducer=t;var n=Jt,a=n.baseQueue,i=r.pending;if(i!==null){if(a!==null){var s=a.next;a.next=i.next,i.next=s}n.baseQueue=a=i,r.pending=null}if(a!==null){i=a.next,n=n.baseState;var o=s=null,l=null,u=i;do{var c=u.lane;if((is&c)===c)l!==null&&(l=l.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),n=u.hasEagerState?u.eagerState:t(n,u.action);else{var d={lane:c,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};l===null?(o=l=d,s=n):l=l.next=d,Lt.lanes|=c,ss|=c}u=u.next}while(u!==null&&u!==i);l===null?s=n:l.next=o,Gn(n,e.memoizedState)||(Yr=!0),e.memoizedState=n,e.baseState=s,e.baseQueue=l,r.lastRenderedState=n}if(t=r.interleaved,t!==null){a=t;do i=a.lane,Lt.lanes|=i,ss|=i,a=a.next;while(a!==t)}else a===null&&(r.lanes=0);return[e.memoizedState,r.dispatch]}function sv(t){var e=Tn(),r=e.queue;if(r===null)throw Error(Pe(311));r.lastRenderedReducer=t;var n=r.dispatch,a=r.pending,i=e.memoizedState;if(a!==null){r.pending=null;var s=a=a.next;do i=t(i,s.action),s=s.next;while(s!==a);Gn(i,e.memoizedState)||(Yr=!0),e.memoizedState=i,e.baseQueue===null&&(e.baseState=i),r.lastRenderedState=i}return[i,n]}function Dj(){}function _j(t,e){var r=Lt,n=Tn(),a=e(),i=!Gn(n.memoizedState,a);if(i&&(n.memoizedState=a,Yr=!0),n=n.queue,aE(Mj.bind(null,r,n,t),[t]),n.getSnapshot!==e||i||sr!==null&&sr.memoizedState.tag&1){if(r.flags|=2048,au(9,Oj.bind(null,r,n,a,e),void 0,null),or===null)throw Error(Pe(349));is&30||jj(r,e,a)}return a}function jj(t,e,r){t.flags|=16384,t={getSnapshot:e,value:r},e=Lt.updateQueue,e===null?(e={lastEffect:null,stores:null},Lt.updateQueue=e,e.stores=[t]):(r=e.stores,r===null?e.stores=[t]:r.push(t))}function Oj(t,e,r,n){e.value=r,e.getSnapshot=n,Ij(e)&&Fj(t)}function Mj(t,e,r){return r(function(){Ij(e)&&Fj(t)})}function Ij(t){var e=t.getSnapshot;t=t.value;try{var r=e();return!Gn(t,r)}catch{return!0}}function Fj(t){var e=ka(t,1);e!==null&&Un(e,t,1,-1)}function EC(t){var e=na();return typeof t=="function"&&(t=t()),e.memoizedState=e.baseState=t,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:nu,lastRenderedState:t},e.queue=t,t=t.dispatch=Uq.bind(null,Lt,t),[e.memoizedState,t]}function au(t,e,r,n){return t={tag:t,create:e,destroy:r,deps:n,next:null},e=Lt.updateQueue,e===null?(e={lastEffect:null,stores:null},Lt.updateQueue=e,e.lastEffect=t.next=t):(r=e.lastEffect,r===null?e.lastEffect=t.next=t:(n=r.next,r.next=t,t.next=n,e.lastEffect=t)),t}function Bj(){return Tn().memoizedState}function Kc(t,e,r,n){var a=na();Lt.flags|=t,a.memoizedState=au(1|e,r,void 0,n===void 0?null:n)}function kf(t,e,r,n){var a=Tn();n=n===void 0?null:n;var i=void 0;if(Jt!==null){var s=Jt.memoizedState;if(i=s.destroy,n!==null&&tE(n,s.deps)){a.memoizedState=au(e,r,i,n);return}}Lt.flags|=t,a.memoizedState=au(1|e,r,i,n)}function SC(t,e){return Kc(8390656,8,t,e)}function aE(t,e){return kf(2048,8,t,e)}function zj(t,e){return kf(4,2,t,e)}function qj(t,e){return kf(4,4,t,e)}function Uj(t,e){if(typeof e=="function")return t=t(),e(t),function(){e(null)};if(e!=null)return t=t(),e.current=t,function(){e.current=null}}function $j(t,e,r){return r=r!=null?r.concat([t]):null,kf(4,4,Uj.bind(null,e,t),r)}function iE(){}function Vj(t,e){var r=Tn();e=e===void 0?null:e;var n=r.memoizedState;return n!==null&&e!==null&&tE(e,n[1])?n[0]:(r.memoizedState=[t,e],t)}function Gj(t,e){var r=Tn();e=e===void 0?null:e;var n=r.memoizedState;return n!==null&&e!==null&&tE(e,n[1])?n[0]:(t=t(),r.memoizedState=[t,e],t)}function Hj(t,e,r){return is&21?(Gn(r,e)||(r=Q_(),Lt.lanes|=r,ss|=r,t.baseState=!0),e):(t.baseState&&(t.baseState=!1,Yr=!0),t.memoizedState=r)}function zq(t,e){var r=vt;vt=r!==0&&4>r?r:4,t(!0);var n=av.transition;av.transition={};try{t(!1),e()}finally{vt=r,av.transition=n}}function Wj(){return Tn().memoizedState}function qq(t,e,r){var n=fi(t);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},Yj(t))Xj(e,r);else if(r=Aj(t,e,r,n),r!==null){var a=Mr();Un(r,t,n,a),Kj(r,e,n)}}function Uq(t,e,r){var n=fi(t),a={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(Yj(t))Xj(e,a);else{var i=t.alternate;if(t.lanes===0&&(i===null||i.lanes===0)&&(i=e.lastRenderedReducer,i!==null))try{var s=e.lastRenderedState,o=i(s,r);if(a.hasEagerState=!0,a.eagerState=o,Gn(o,s)){var l=e.interleaved;l===null?(a.next=a,Kw(e)):(a.next=l.next,l.next=a),e.interleaved=a;return}}catch{}finally{}r=Aj(t,e,a,n),r!==null&&(a=Mr(),Un(r,t,n,a),Kj(r,e,n))}}function Yj(t){var e=t.alternate;return t===Lt||e!==null&&e===Lt}function Xj(t,e){Dl=Id=!0;var r=t.pending;r===null?e.next=e:(e.next=r.next,r.next=e),t.pending=e}function Kj(t,e,r){if(r&4194240){var n=e.lanes;n&=t.pendingLanes,r|=n,e.lanes=r,Mw(t,r)}}var Fd={readContext:Nn,useCallback:br,useContext:br,useEffect:br,useImperativeHandle:br,useInsertionEffect:br,useLayoutEffect:br,useMemo:br,useReducer:br,useRef:br,useState:br,useDebugValue:br,useDeferredValue:br,useTransition:br,useMutableSource:br,useSyncExternalStore:br,useId:br,unstable_isNewReconciler:!1},$q={readContext:Nn,useCallback:function(t,e){return na().memoizedState=[t,e===void 0?null:e],t},useContext:Nn,useEffect:SC,useImperativeHandle:function(t,e,r){return r=r!=null?r.concat([t]):null,Kc(4194308,4,Uj.bind(null,e,t),r)},useLayoutEffect:function(t,e){return Kc(4194308,4,t,e)},useInsertionEffect:function(t,e){return Kc(4,2,t,e)},useMemo:function(t,e){var r=na();return e=e===void 0?null:e,t=t(),r.memoizedState=[t,e],t},useReducer:function(t,e,r){var n=na();return e=r!==void 0?r(e):e,n.memoizedState=n.baseState=e,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:e},n.queue=t,t=t.dispatch=qq.bind(null,Lt,t),[n.memoizedState,t]},useRef:function(t){var e=na();return t={current:t},e.memoizedState=t},useState:EC,useDebugValue:iE,useDeferredValue:function(t){return na().memoizedState=t},useTransition:function(){var t=EC(!1),e=t[0];return t=zq.bind(null,t[1]),na().memoizedState=t,[e,t]},useMutableSource:function(){},useSyncExternalStore:function(t,e,r){var n=Lt,a=na();if(Nt){if(r===void 0)throw Error(Pe(407));r=r()}else{if(r=e(),or===null)throw Error(Pe(349));is&30||jj(n,e,r)}a.memoizedState=r;var i={value:r,getSnapshot:e};return a.queue=i,SC(Mj.bind(null,n,i,t),[t]),n.flags|=2048,au(9,Oj.bind(null,n,i,r,e),void 0,null),r},useId:function(){var t=na(),e=or.identifierPrefix;if(Nt){var r=Sa,n=Ea;r=(n&~(1<<32-qn(n)-1)).toString(32)+r,e=":"+e+"R"+r,r=ru++,0<r&&(e+="H"+r.toString(32)),e+=":"}else r=Bq++,e=":"+e+"r"+r.toString(32)+":";return t.memoizedState=e},unstable_isNewReconciler:!1},Vq={readContext:Nn,useCallback:Vj,useContext:Nn,useEffect:aE,useImperativeHandle:$j,useInsertionEffect:zj,useLayoutEffect:qj,useMemo:Gj,useReducer:iv,useRef:Bj,useState:function(){return iv(nu)},useDebugValue:iE,useDeferredValue:function(t){var e=Tn();return Hj(e,Jt.memoizedState,t)},useTransition:function(){var t=iv(nu)[0],e=Tn().memoizedState;return[t,e]},useMutableSource:Dj,useSyncExternalStore:_j,useId:Wj,unstable_isNewReconciler:!1},Gq={readContext:Nn,useCallback:Vj,useContext:Nn,useEffect:aE,useImperativeHandle:$j,useInsertionEffect:zj,useLayoutEffect:qj,useMemo:Gj,useReducer:sv,useRef:Bj,useState:function(){return sv(nu)},useDebugValue:iE,useDeferredValue:function(t){var e=Tn();return Jt===null?e.memoizedState=t:Hj(e,Jt.memoizedState,t)},useTransition:function(){var t=sv(nu)[0],e=Tn().memoizedState;return[t,e]},useMutableSource:Dj,useSyncExternalStore:_j,useId:Wj,unstable_isNewReconciler:!1};function Dn(t,e){if(t&&t.defaultProps){e=_t({},e),t=t.defaultProps;for(var r in t)e[r]===void 0&&(e[r]=t[r]);return e}return e}function v1(t,e,r,n){e=t.memoizedState,r=r(n,e),r=r==null?e:_t({},e,r),t.memoizedState=r,t.lanes===0&&(t.updateQueue.baseState=r)}var Lf={isMounted:function(t){return(t=t._reactInternals)?xs(t)===t:!1},enqueueSetState:function(t,e,r){t=t._reactInternals;var n=Mr(),a=fi(t),i=Ta(n,a);i.payload=e,r!=null&&(i.callback=r),e=ci(t,i,a),e!==null&&(Un(e,t,a,n),Yc(e,t,a))},enqueueReplaceState:function(t,e,r){t=t._reactInternals;var n=Mr(),a=fi(t),i=Ta(n,a);i.tag=1,i.payload=e,r!=null&&(i.callback=r),e=ci(t,i,a),e!==null&&(Un(e,t,a,n),Yc(e,t,a))},enqueueForceUpdate:function(t,e){t=t._reactInternals;var r=Mr(),n=fi(t),a=Ta(r,n);a.tag=2,e!=null&&(a.callback=e),e=ci(t,a,n),e!==null&&(Un(e,t,n,r),Yc(e,t,n))}};function CC(t,e,r,n,a,i,s){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(n,i,s):e.prototype&&e.prototype.isPureReactComponent?!Kl(r,n)||!Kl(a,i):!0}function Qj(t,e,r){var n=!1,a=yi,i=e.contextType;return typeof i=="object"&&i!==null?i=Nn(i):(a=Qr(e)?ns:Nr.current,n=e.contextTypes,i=(n=n!=null)?po(t,a):yi),e=new e(r,i),t.memoizedState=e.state!==null&&e.state!==void 0?e.state:null,e.updater=Lf,t.stateNode=e,e._reactInternals=t,n&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=a,t.__reactInternalMemoizedMaskedChildContext=i),e}function NC(t,e,r,n){t=e.state,typeof e.componentWillReceiveProps=="function"&&e.componentWillReceiveProps(r,n),typeof e.UNSAFE_componentWillReceiveProps=="function"&&e.UNSAFE_componentWillReceiveProps(r,n),e.state!==t&&Lf.enqueueReplaceState(e,e.state,null)}function p1(t,e,r,n){var a=t.stateNode;a.props=r,a.state=t.memoizedState,a.refs={},Qw(t);var i=e.contextType;typeof i=="object"&&i!==null?a.context=Nn(i):(i=Qr(e)?ns:Nr.current,a.context=po(t,i)),a.state=t.memoizedState,i=e.getDerivedStateFromProps,typeof i=="function"&&(v1(t,e,i,r),a.state=t.memoizedState),typeof e.getDerivedStateFromProps=="function"||typeof a.getSnapshotBeforeUpdate=="function"||typeof a.UNSAFE_componentWillMount!="function"&&typeof a.componentWillMount!="function"||(e=a.state,typeof a.componentWillMount=="function"&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount=="function"&&a.UNSAFE_componentWillMount(),e!==a.state&&Lf.enqueueReplaceState(a,a.state,null),Od(t,r,a,n),a.state=t.memoizedState),typeof a.componentDidMount=="function"&&(t.flags|=4194308)}function xo(t,e){try{var r="",n=e;do r+=xz(n),n=n.return;while(n);var a=r}catch(i){a=`
|
|
39
|
+
Error generating stack: `+i.message+`
|
|
40
|
+
`+i.stack}return{value:t,source:e,stack:a,digest:null}}function ov(t,e,r){return{value:t,source:null,stack:r??null,digest:e??null}}function g1(t,e){try{console.error(e.value)}catch(r){setTimeout(function(){throw r})}}var Hq=typeof WeakMap=="function"?WeakMap:Map;function Zj(t,e,r){r=Ta(-1,r),r.tag=3,r.payload={element:null};var n=e.value;return r.callback=function(){zd||(zd=!0,T1=n),g1(t,e)},r}function Jj(t,e,r){r=Ta(-1,r),r.tag=3;var n=t.type.getDerivedStateFromError;if(typeof n=="function"){var a=e.value;r.payload=function(){return n(a)},r.callback=function(){g1(t,e)}}var i=t.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(r.callback=function(){g1(t,e),typeof n!="function"&&(di===null?di=new Set([this]):di.add(this));var s=e.stack;this.componentDidCatch(e.value,{componentStack:s!==null?s:""})}),r}function TC(t,e,r){var n=t.pingCache;if(n===null){n=t.pingCache=new Hq;var a=new Set;n.set(e,a)}else a=n.get(e),a===void 0&&(a=new Set,n.set(e,a));a.has(r)||(a.add(r),t=s4.bind(null,t,e,r),e.then(t,t))}function RC(t){do{var e;if((e=t.tag===13)&&(e=t.memoizedState,e=e!==null?e.dehydrated!==null:!0),e)return t;t=t.return}while(t!==null);return null}function PC(t,e,r,n,a){return t.mode&1?(t.flags|=65536,t.lanes=a,t):(t===e?t.flags|=65536:(t.flags|=128,r.flags|=131072,r.flags&=-52805,r.tag===1&&(r.alternate===null?r.tag=17:(e=Ta(-1,1),e.tag=2,ci(r,e,1))),r.lanes|=1),t)}var Wq=Ma.ReactCurrentOwner,Yr=!1;function _r(t,e,r,n){e.child=t===null?Pj(e,null,r,n):mo(e,t.child,r,n)}function AC(t,e,r,n,a){r=r.render;var i=e.ref;return oo(e,a),n=rE(t,e,r,n,i,a),r=nE(),t!==null&&!Yr?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~a,La(t,e,a)):(Nt&&r&&Vw(e),e.flags|=1,_r(t,e,n,a),e.child)}function kC(t,e,r,n,a){if(t===null){var i=r.type;return typeof i=="function"&&!hE(i)&&i.defaultProps===void 0&&r.compare===null&&r.defaultProps===void 0?(e.tag=15,e.type=i,eO(t,e,i,n,a)):(t=ed(r.type,null,n,e,e.mode,a),t.ref=e.ref,t.return=e,e.child=t)}if(i=t.child,!(t.lanes&a)){var s=i.memoizedProps;if(r=r.compare,r=r!==null?r:Kl,r(s,n)&&t.ref===e.ref)return La(t,e,a)}return e.flags|=1,t=hi(i,n),t.ref=e.ref,t.return=e,e.child=t}function eO(t,e,r,n,a){if(t!==null){var i=t.memoizedProps;if(Kl(i,n)&&t.ref===e.ref)if(Yr=!1,e.pendingProps=n=i,(t.lanes&a)!==0)t.flags&131072&&(Yr=!0);else return e.lanes=t.lanes,La(t,e,a)}return m1(t,e,r,n,a)}function tO(t,e,r){var n=e.pendingProps,a=n.children,i=t!==null?t.memoizedState:null;if(n.mode==="hidden")if(!(e.mode&1))e.memoizedState={baseLanes:0,cachePool:null,transitions:null},xt(Zs,an),an|=r;else{if(!(r&1073741824))return t=i!==null?i.baseLanes|r:r,e.lanes=e.childLanes=1073741824,e.memoizedState={baseLanes:t,cachePool:null,transitions:null},e.updateQueue=null,xt(Zs,an),an|=t,null;e.memoizedState={baseLanes:0,cachePool:null,transitions:null},n=i!==null?i.baseLanes:r,xt(Zs,an),an|=n}else i!==null?(n=i.baseLanes|r,e.memoizedState=null):n=r,xt(Zs,an),an|=n;return _r(t,e,a,r),e.child}function rO(t,e){var r=e.ref;(t===null&&r!==null||t!==null&&t.ref!==r)&&(e.flags|=512,e.flags|=2097152)}function m1(t,e,r,n,a){var i=Qr(r)?ns:Nr.current;return i=po(e,i),oo(e,a),r=rE(t,e,r,n,i,a),n=nE(),t!==null&&!Yr?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~a,La(t,e,a)):(Nt&&n&&Vw(e),e.flags|=1,_r(t,e,r,a),e.child)}function LC(t,e,r,n,a){if(Qr(r)){var i=!0;kd(e)}else i=!1;if(oo(e,a),e.stateNode===null)Qc(t,e),Qj(e,r,n),p1(e,r,n,a),n=!0;else if(t===null){var s=e.stateNode,o=e.memoizedProps;s.props=o;var l=s.context,u=r.contextType;typeof u=="object"&&u!==null?u=Nn(u):(u=Qr(r)?ns:Nr.current,u=po(e,u));var c=r.getDerivedStateFromProps,d=typeof c=="function"||typeof s.getSnapshotBeforeUpdate=="function";d||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(o!==n||l!==u)&&NC(e,s,n,u),Ya=!1;var f=e.memoizedState;s.state=f,Od(e,n,s,a),l=e.memoizedState,o!==n||f!==l||Kr.current||Ya?(typeof c=="function"&&(v1(e,r,c,n),l=e.memoizedState),(o=Ya||CC(e,r,o,n,f,l,u))?(d||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount()),typeof s.componentDidMount=="function"&&(e.flags|=4194308)):(typeof s.componentDidMount=="function"&&(e.flags|=4194308),e.memoizedProps=n,e.memoizedState=l),s.props=n,s.state=l,s.context=u,n=o):(typeof s.componentDidMount=="function"&&(e.flags|=4194308),n=!1)}else{s=e.stateNode,kj(t,e),o=e.memoizedProps,u=e.type===e.elementType?o:Dn(e.type,o),s.props=u,d=e.pendingProps,f=s.context,l=r.contextType,typeof l=="object"&&l!==null?l=Nn(l):(l=Qr(r)?ns:Nr.current,l=po(e,l));var v=r.getDerivedStateFromProps;(c=typeof v=="function"||typeof s.getSnapshotBeforeUpdate=="function")||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(o!==d||f!==l)&&NC(e,s,n,l),Ya=!1,f=e.memoizedState,s.state=f,Od(e,n,s,a);var p=e.memoizedState;o!==d||f!==p||Kr.current||Ya?(typeof v=="function"&&(v1(e,r,v,n),p=e.memoizedState),(u=Ya||CC(e,r,u,n,f,p,l)||!1)?(c||typeof s.UNSAFE_componentWillUpdate!="function"&&typeof s.componentWillUpdate!="function"||(typeof s.componentWillUpdate=="function"&&s.componentWillUpdate(n,p,l),typeof s.UNSAFE_componentWillUpdate=="function"&&s.UNSAFE_componentWillUpdate(n,p,l)),typeof s.componentDidUpdate=="function"&&(e.flags|=4),typeof s.getSnapshotBeforeUpdate=="function"&&(e.flags|=1024)):(typeof s.componentDidUpdate!="function"||o===t.memoizedProps&&f===t.memoizedState||(e.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||o===t.memoizedProps&&f===t.memoizedState||(e.flags|=1024),e.memoizedProps=n,e.memoizedState=p),s.props=n,s.state=p,s.context=l,n=u):(typeof s.componentDidUpdate!="function"||o===t.memoizedProps&&f===t.memoizedState||(e.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||o===t.memoizedProps&&f===t.memoizedState||(e.flags|=1024),n=!1)}return y1(t,e,r,n,i,a)}function y1(t,e,r,n,a,i){rO(t,e);var s=(e.flags&128)!==0;if(!n&&!s)return a&&gC(e,r,!1),La(t,e,i);n=e.stateNode,Wq.current=e;var o=s&&typeof r.getDerivedStateFromError!="function"?null:n.render();return e.flags|=1,t!==null&&s?(e.child=mo(e,t.child,null,i),e.child=mo(e,null,o,i)):_r(t,e,o,i),e.memoizedState=n.state,a&&gC(e,r,!0),e.child}function nO(t){var e=t.stateNode;e.pendingContext?pC(t,e.pendingContext,e.pendingContext!==e.context):e.context&&pC(t,e.context,!1),Zw(t,e.containerInfo)}function DC(t,e,r,n,a){return go(),Hw(a),e.flags|=256,_r(t,e,r,n),e.child}var x1={dehydrated:null,treeContext:null,retryLane:0};function b1(t){return{baseLanes:t,cachePool:null,transitions:null}}function aO(t,e,r){var n=e.pendingProps,a=kt.current,i=!1,s=(e.flags&128)!==0,o;if((o=s)||(o=t!==null&&t.memoizedState===null?!1:(a&2)!==0),o?(i=!0,e.flags&=-129):(t===null||t.memoizedState!==null)&&(a|=1),xt(kt,a&1),t===null)return f1(e),t=e.memoizedState,t!==null&&(t=t.dehydrated,t!==null)?(e.mode&1?t.data==="$!"?e.lanes=8:e.lanes=1073741824:e.lanes=1,null):(s=n.children,t=n.fallback,i?(n=e.mode,i=e.child,s={mode:"hidden",children:s},!(n&1)&&i!==null?(i.childLanes=0,i.pendingProps=s):i=jf(s,n,0,null),t=rs(t,n,r,null),i.return=e,t.return=e,i.sibling=t,e.child=i,e.child.memoizedState=b1(r),e.memoizedState=x1,t):sE(e,s));if(a=t.memoizedState,a!==null&&(o=a.dehydrated,o!==null))return Yq(t,e,s,n,o,a,r);if(i){i=n.fallback,s=e.mode,a=t.child,o=a.sibling;var l={mode:"hidden",children:n.children};return!(s&1)&&e.child!==a?(n=e.child,n.childLanes=0,n.pendingProps=l,e.deletions=null):(n=hi(a,l),n.subtreeFlags=a.subtreeFlags&14680064),o!==null?i=hi(o,i):(i=rs(i,s,r,null),i.flags|=2),i.return=e,n.return=e,n.sibling=i,e.child=n,n=i,i=e.child,s=t.child.memoizedState,s=s===null?b1(r):{baseLanes:s.baseLanes|r,cachePool:null,transitions:s.transitions},i.memoizedState=s,i.childLanes=t.childLanes&~r,e.memoizedState=x1,n}return i=t.child,t=i.sibling,n=hi(i,{mode:"visible",children:n.children}),!(e.mode&1)&&(n.lanes=r),n.return=e,n.sibling=null,t!==null&&(r=e.deletions,r===null?(e.deletions=[t],e.flags|=16):r.push(t)),e.child=n,e.memoizedState=null,n}function sE(t,e){return e=jf({mode:"visible",children:e},t.mode,0,null),e.return=t,t.child=e}function xc(t,e,r,n){return n!==null&&Hw(n),mo(e,t.child,null,r),t=sE(e,e.pendingProps.children),t.flags|=2,e.memoizedState=null,t}function Yq(t,e,r,n,a,i,s){if(r)return e.flags&256?(e.flags&=-257,n=ov(Error(Pe(422))),xc(t,e,s,n)):e.memoizedState!==null?(e.child=t.child,e.flags|=128,null):(i=n.fallback,a=e.mode,n=jf({mode:"visible",children:n.children},a,0,null),i=rs(i,a,s,null),i.flags|=2,n.return=e,i.return=e,n.sibling=i,e.child=n,e.mode&1&&mo(e,t.child,null,s),e.child.memoizedState=b1(s),e.memoizedState=x1,i);if(!(e.mode&1))return xc(t,e,s,null);if(a.data==="$!"){if(n=a.nextSibling&&a.nextSibling.dataset,n)var o=n.dgst;return n=o,i=Error(Pe(419)),n=ov(i,n,void 0),xc(t,e,s,n)}if(o=(s&t.childLanes)!==0,Yr||o){if(n=or,n!==null){switch(s&-s){case 4:a=2;break;case 16:a=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:a=32;break;case 536870912:a=268435456;break;default:a=0}a=a&(n.suspendedLanes|s)?0:a,a!==0&&a!==i.retryLane&&(i.retryLane=a,ka(t,a),Un(n,t,a,-1))}return fE(),n=ov(Error(Pe(421))),xc(t,e,s,n)}return a.data==="$?"?(e.flags|=128,e.child=t.child,e=o4.bind(null,t),a._reactRetry=e,null):(t=i.treeContext,sn=ui(a.nextSibling),ln=e,Nt=!0,On=null,t!==null&&(mn[yn++]=Ea,mn[yn++]=Sa,mn[yn++]=as,Ea=t.id,Sa=t.overflow,as=e),e=sE(e,n.children),e.flags|=4096,e)}function _C(t,e,r){t.lanes|=e;var n=t.alternate;n!==null&&(n.lanes|=e),h1(t.return,e,r)}function lv(t,e,r,n,a){var i=t.memoizedState;i===null?t.memoizedState={isBackwards:e,rendering:null,renderingStartTime:0,last:n,tail:r,tailMode:a}:(i.isBackwards=e,i.rendering=null,i.renderingStartTime=0,i.last=n,i.tail=r,i.tailMode=a)}function iO(t,e,r){var n=e.pendingProps,a=n.revealOrder,i=n.tail;if(_r(t,e,n.children,r),n=kt.current,n&2)n=n&1|2,e.flags|=128;else{if(t!==null&&t.flags&128)e:for(t=e.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&_C(t,r,e);else if(t.tag===19)_C(t,r,e);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}n&=1}if(xt(kt,n),!(e.mode&1))e.memoizedState=null;else switch(a){case"forwards":for(r=e.child,a=null;r!==null;)t=r.alternate,t!==null&&Md(t)===null&&(a=r),r=r.sibling;r=a,r===null?(a=e.child,e.child=null):(a=r.sibling,r.sibling=null),lv(e,!1,a,r,i);break;case"backwards":for(r=null,a=e.child,e.child=null;a!==null;){if(t=a.alternate,t!==null&&Md(t)===null){e.child=a;break}t=a.sibling,a.sibling=r,r=a,a=t}lv(e,!0,r,null,i);break;case"together":lv(e,!1,null,null,void 0);break;default:e.memoizedState=null}return e.child}function Qc(t,e){!(e.mode&1)&&t!==null&&(t.alternate=null,e.alternate=null,e.flags|=2)}function La(t,e,r){if(t!==null&&(e.dependencies=t.dependencies),ss|=e.lanes,!(r&e.childLanes))return null;if(t!==null&&e.child!==t.child)throw Error(Pe(153));if(e.child!==null){for(t=e.child,r=hi(t,t.pendingProps),e.child=r,r.return=e;t.sibling!==null;)t=t.sibling,r=r.sibling=hi(t,t.pendingProps),r.return=e;r.sibling=null}return e.child}function Xq(t,e,r){switch(e.tag){case 3:nO(e),go();break;case 5:Lj(e);break;case 1:Qr(e.type)&&kd(e);break;case 4:Zw(e,e.stateNode.containerInfo);break;case 10:var n=e.type._context,a=e.memoizedProps.value;xt(_d,n._currentValue),n._currentValue=a;break;case 13:if(n=e.memoizedState,n!==null)return n.dehydrated!==null?(xt(kt,kt.current&1),e.flags|=128,null):r&e.child.childLanes?aO(t,e,r):(xt(kt,kt.current&1),t=La(t,e,r),t!==null?t.sibling:null);xt(kt,kt.current&1);break;case 19:if(n=(r&e.childLanes)!==0,t.flags&128){if(n)return iO(t,e,r);e.flags|=128}if(a=e.memoizedState,a!==null&&(a.rendering=null,a.tail=null,a.lastEffect=null),xt(kt,kt.current),n)break;return null;case 22:case 23:return e.lanes=0,tO(t,e,r)}return La(t,e,r)}var sO,w1,oO,lO;sO=function(t,e){for(var r=e.child;r!==null;){if(r.tag===5||r.tag===6)t.appendChild(r.stateNode);else if(r.tag!==4&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===e)break;for(;r.sibling===null;){if(r.return===null||r.return===e)return;r=r.return}r.sibling.return=r.return,r=r.sibling}};w1=function(){};oO=function(t,e,r,n){var a=t.memoizedProps;if(a!==n){t=e.stateNode,Qi(la.current);var i=null;switch(r){case"input":a=$b(t,a),n=$b(t,n),i=[];break;case"select":a=_t({},a,{value:void 0}),n=_t({},n,{value:void 0}),i=[];break;case"textarea":a=Hb(t,a),n=Hb(t,n),i=[];break;default:typeof a.onClick!="function"&&typeof n.onClick=="function"&&(t.onclick=Pd)}Yb(r,n);var s;r=null;for(u in a)if(!n.hasOwnProperty(u)&&a.hasOwnProperty(u)&&a[u]!=null)if(u==="style"){var o=a[u];for(s in o)o.hasOwnProperty(s)&&(r||(r={}),r[s]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&($l.hasOwnProperty(u)?i||(i=[]):(i=i||[]).push(u,null));for(u in n){var l=n[u];if(o=a!=null?a[u]:void 0,n.hasOwnProperty(u)&&l!==o&&(l!=null||o!=null))if(u==="style")if(o){for(s in o)!o.hasOwnProperty(s)||l&&l.hasOwnProperty(s)||(r||(r={}),r[s]="");for(s in l)l.hasOwnProperty(s)&&o[s]!==l[s]&&(r||(r={}),r[s]=l[s])}else r||(i||(i=[]),i.push(u,r)),r=l;else u==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,o=o?o.__html:void 0,l!=null&&o!==l&&(i=i||[]).push(u,l)):u==="children"?typeof l!="string"&&typeof l!="number"||(i=i||[]).push(u,""+l):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&($l.hasOwnProperty(u)?(l!=null&&u==="onScroll"&&wt("scroll",t),i||o===l||(i=[])):(i=i||[]).push(u,l))}r&&(i=i||[]).push("style",r);var u=i;(e.updateQueue=u)&&(e.flags|=4)}};lO=function(t,e,r,n){r!==n&&(e.flags|=4)};function tl(t,e){if(!Nt)switch(t.tailMode){case"hidden":e=t.tail;for(var r=null;e!==null;)e.alternate!==null&&(r=e),e=e.sibling;r===null?t.tail=null:r.sibling=null;break;case"collapsed":r=t.tail;for(var n=null;r!==null;)r.alternate!==null&&(n=r),r=r.sibling;n===null?e||t.tail===null?t.tail=null:t.tail.sibling=null:n.sibling=null}}function wr(t){var e=t.alternate!==null&&t.alternate.child===t.child,r=0,n=0;if(e)for(var a=t.child;a!==null;)r|=a.lanes|a.childLanes,n|=a.subtreeFlags&14680064,n|=a.flags&14680064,a.return=t,a=a.sibling;else for(a=t.child;a!==null;)r|=a.lanes|a.childLanes,n|=a.subtreeFlags,n|=a.flags,a.return=t,a=a.sibling;return t.subtreeFlags|=n,t.childLanes=r,e}function Kq(t,e,r){var n=e.pendingProps;switch(Gw(e),e.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return wr(e),null;case 1:return Qr(e.type)&&Ad(),wr(e),null;case 3:return n=e.stateNode,yo(),St(Kr),St(Nr),eE(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(t===null||t.child===null)&&(mc(e)?e.flags|=4:t===null||t.memoizedState.isDehydrated&&!(e.flags&256)||(e.flags|=1024,On!==null&&(A1(On),On=null))),w1(t,e),wr(e),null;case 5:Jw(e);var a=Qi(tu.current);if(r=e.type,t!==null&&e.stateNode!=null)oO(t,e,r,n,a),t.ref!==e.ref&&(e.flags|=512,e.flags|=2097152);else{if(!n){if(e.stateNode===null)throw Error(Pe(166));return wr(e),null}if(t=Qi(la.current),mc(e)){n=e.stateNode,r=e.type;var i=e.memoizedProps;switch(n[ia]=e,n[Jl]=i,t=(e.mode&1)!==0,r){case"dialog":wt("cancel",n),wt("close",n);break;case"iframe":case"object":case"embed":wt("load",n);break;case"video":case"audio":for(a=0;a<yl.length;a++)wt(yl[a],n);break;case"source":wt("error",n);break;case"img":case"image":case"link":wt("error",n),wt("load",n);break;case"details":wt("toggle",n);break;case"input":US(n,i),wt("invalid",n);break;case"select":n._wrapperState={wasMultiple:!!i.multiple},wt("invalid",n);break;case"textarea":VS(n,i),wt("invalid",n)}Yb(r,i),a=null;for(var s in i)if(i.hasOwnProperty(s)){var o=i[s];s==="children"?typeof o=="string"?n.textContent!==o&&(i.suppressHydrationWarning!==!0&&gc(n.textContent,o,t),a=["children",o]):typeof o=="number"&&n.textContent!==""+o&&(i.suppressHydrationWarning!==!0&&gc(n.textContent,o,t),a=["children",""+o]):$l.hasOwnProperty(s)&&o!=null&&s==="onScroll"&&wt("scroll",n)}switch(r){case"input":lc(n),$S(n,i,!0);break;case"textarea":lc(n),GS(n);break;case"select":case"option":break;default:typeof i.onClick=="function"&&(n.onclick=Pd)}n=a,e.updateQueue=n,n!==null&&(e.flags|=4)}else{s=a.nodeType===9?a:a.ownerDocument,t==="http://www.w3.org/1999/xhtml"&&(t=M_(r)),t==="http://www.w3.org/1999/xhtml"?r==="script"?(t=s.createElement("div"),t.innerHTML="<script><\/script>",t=t.removeChild(t.firstChild)):typeof n.is=="string"?t=s.createElement(r,{is:n.is}):(t=s.createElement(r),r==="select"&&(s=t,n.multiple?s.multiple=!0:n.size&&(s.size=n.size))):t=s.createElementNS(t,r),t[ia]=e,t[Jl]=n,sO(t,e,!1,!1),e.stateNode=t;e:{switch(s=Xb(r,n),r){case"dialog":wt("cancel",t),wt("close",t),a=n;break;case"iframe":case"object":case"embed":wt("load",t),a=n;break;case"video":case"audio":for(a=0;a<yl.length;a++)wt(yl[a],t);a=n;break;case"source":wt("error",t),a=n;break;case"img":case"image":case"link":wt("error",t),wt("load",t),a=n;break;case"details":wt("toggle",t),a=n;break;case"input":US(t,n),a=$b(t,n),wt("invalid",t);break;case"option":a=n;break;case"select":t._wrapperState={wasMultiple:!!n.multiple},a=_t({},n,{value:void 0}),wt("invalid",t);break;case"textarea":VS(t,n),a=Hb(t,n),wt("invalid",t);break;default:a=n}Yb(r,a),o=a;for(i in o)if(o.hasOwnProperty(i)){var l=o[i];i==="style"?B_(t,l):i==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&I_(t,l)):i==="children"?typeof l=="string"?(r!=="textarea"||l!=="")&&Vl(t,l):typeof l=="number"&&Vl(t,""+l):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&($l.hasOwnProperty(i)?l!=null&&i==="onScroll"&&wt("scroll",t):l!=null&&kw(t,i,l,s))}switch(r){case"input":lc(t),$S(t,n,!1);break;case"textarea":lc(t),GS(t);break;case"option":n.value!=null&&t.setAttribute("value",""+mi(n.value));break;case"select":t.multiple=!!n.multiple,i=n.value,i!=null?no(t,!!n.multiple,i,!1):n.defaultValue!=null&&no(t,!!n.multiple,n.defaultValue,!0);break;default:typeof a.onClick=="function"&&(t.onclick=Pd)}switch(r){case"button":case"input":case"select":case"textarea":n=!!n.autoFocus;break e;case"img":n=!0;break e;default:n=!1}}n&&(e.flags|=4)}e.ref!==null&&(e.flags|=512,e.flags|=2097152)}return wr(e),null;case 6:if(t&&e.stateNode!=null)lO(t,e,t.memoizedProps,n);else{if(typeof n!="string"&&e.stateNode===null)throw Error(Pe(166));if(r=Qi(tu.current),Qi(la.current),mc(e)){if(n=e.stateNode,r=e.memoizedProps,n[ia]=e,(i=n.nodeValue!==r)&&(t=ln,t!==null))switch(t.tag){case 3:gc(n.nodeValue,r,(t.mode&1)!==0);break;case 5:t.memoizedProps.suppressHydrationWarning!==!0&&gc(n.nodeValue,r,(t.mode&1)!==0)}i&&(e.flags|=4)}else n=(r.nodeType===9?r:r.ownerDocument).createTextNode(n),n[ia]=e,e.stateNode=n}return wr(e),null;case 13:if(St(kt),n=e.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(Nt&&sn!==null&&e.mode&1&&!(e.flags&128))Tj(),go(),e.flags|=98560,i=!1;else if(i=mc(e),n!==null&&n.dehydrated!==null){if(t===null){if(!i)throw Error(Pe(318));if(i=e.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(Pe(317));i[ia]=e}else go(),!(e.flags&128)&&(e.memoizedState=null),e.flags|=4;wr(e),i=!1}else On!==null&&(A1(On),On=null),i=!0;if(!i)return e.flags&65536?e:null}return e.flags&128?(e.lanes=r,e):(n=n!==null,n!==(t!==null&&t.memoizedState!==null)&&n&&(e.child.flags|=8192,e.mode&1&&(t===null||kt.current&1?er===0&&(er=3):fE())),e.updateQueue!==null&&(e.flags|=4),wr(e),null);case 4:return yo(),w1(t,e),t===null&&Ql(e.stateNode.containerInfo),wr(e),null;case 10:return Xw(e.type._context),wr(e),null;case 17:return Qr(e.type)&&Ad(),wr(e),null;case 19:if(St(kt),i=e.memoizedState,i===null)return wr(e),null;if(n=(e.flags&128)!==0,s=i.rendering,s===null)if(n)tl(i,!1);else{if(er!==0||t!==null&&t.flags&128)for(t=e.child;t!==null;){if(s=Md(t),s!==null){for(e.flags|=128,tl(i,!1),n=s.updateQueue,n!==null&&(e.updateQueue=n,e.flags|=4),e.subtreeFlags=0,n=r,r=e.child;r!==null;)i=r,t=n,i.flags&=14680066,s=i.alternate,s===null?(i.childLanes=0,i.lanes=t,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=s.childLanes,i.lanes=s.lanes,i.child=s.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=s.memoizedProps,i.memoizedState=s.memoizedState,i.updateQueue=s.updateQueue,i.type=s.type,t=s.dependencies,i.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),r=r.sibling;return xt(kt,kt.current&1|2),e.child}t=t.sibling}i.tail!==null&&Ft()>bo&&(e.flags|=128,n=!0,tl(i,!1),e.lanes=4194304)}else{if(!n)if(t=Md(s),t!==null){if(e.flags|=128,n=!0,r=t.updateQueue,r!==null&&(e.updateQueue=r,e.flags|=4),tl(i,!0),i.tail===null&&i.tailMode==="hidden"&&!s.alternate&&!Nt)return wr(e),null}else 2*Ft()-i.renderingStartTime>bo&&r!==1073741824&&(e.flags|=128,n=!0,tl(i,!1),e.lanes=4194304);i.isBackwards?(s.sibling=e.child,e.child=s):(r=i.last,r!==null?r.sibling=s:e.child=s,i.last=s)}return i.tail!==null?(e=i.tail,i.rendering=e,i.tail=e.sibling,i.renderingStartTime=Ft(),e.sibling=null,r=kt.current,xt(kt,n?r&1|2:r&1),e):(wr(e),null);case 22:case 23:return dE(),n=e.memoizedState!==null,t!==null&&t.memoizedState!==null!==n&&(e.flags|=8192),n&&e.mode&1?an&1073741824&&(wr(e),e.subtreeFlags&6&&(e.flags|=8192)):wr(e),null;case 24:return null;case 25:return null}throw Error(Pe(156,e.tag))}function Qq(t,e){switch(Gw(e),e.tag){case 1:return Qr(e.type)&&Ad(),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return yo(),St(Kr),St(Nr),eE(),t=e.flags,t&65536&&!(t&128)?(e.flags=t&-65537|128,e):null;case 5:return Jw(e),null;case 13:if(St(kt),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(Pe(340));go()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return St(kt),null;case 4:return yo(),null;case 10:return Xw(e.type._context),null;case 22:case 23:return dE(),null;case 24:return null;default:return null}}var bc=!1,Er=!1,Zq=typeof WeakSet=="function"?WeakSet:Set,Fe=null;function Qs(t,e){var r=t.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(n){Ot(t,e,n)}else r.current=null}function E1(t,e,r){try{r()}catch(n){Ot(t,e,n)}}var jC=!1;function Jq(t,e){if(i1=Nd,t=hj(),$w(t)){if("selectionStart"in t)var r={start:t.selectionStart,end:t.selectionEnd};else e:{r=(r=t.ownerDocument)&&r.defaultView||window;var n=r.getSelection&&r.getSelection();if(n&&n.rangeCount!==0){r=n.anchorNode;var a=n.anchorOffset,i=n.focusNode;n=n.focusOffset;try{r.nodeType,i.nodeType}catch{r=null;break e}var s=0,o=-1,l=-1,u=0,c=0,d=t,f=null;t:for(;;){for(var v;d!==r||a!==0&&d.nodeType!==3||(o=s+a),d!==i||n!==0&&d.nodeType!==3||(l=s+n),d.nodeType===3&&(s+=d.nodeValue.length),(v=d.firstChild)!==null;)f=d,d=v;for(;;){if(d===t)break t;if(f===r&&++u===a&&(o=s),f===i&&++c===n&&(l=s),(v=d.nextSibling)!==null)break;d=f,f=d.parentNode}d=v}r=o===-1||l===-1?null:{start:o,end:l}}else r=null}r=r||{start:0,end:0}}else r=null;for(s1={focusedElem:t,selectionRange:r},Nd=!1,Fe=e;Fe!==null;)if(e=Fe,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,Fe=t;else for(;Fe!==null;){e=Fe;try{var p=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(p!==null){var y=p.memoizedProps,m=p.memoizedState,g=e.stateNode,x=g.getSnapshotBeforeUpdate(e.elementType===e.type?y:Dn(e.type,y),m);g.__reactInternalSnapshotBeforeUpdate=x}break;case 3:var b=e.stateNode.containerInfo;b.nodeType===1?b.textContent="":b.nodeType===9&&b.documentElement&&b.removeChild(b.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(Pe(163))}}catch(w){Ot(e,e.return,w)}if(t=e.sibling,t!==null){t.return=e.return,Fe=t;break}Fe=e.return}return p=jC,jC=!1,p}function _l(t,e,r){var n=e.updateQueue;if(n=n!==null?n.lastEffect:null,n!==null){var a=n=n.next;do{if((a.tag&t)===t){var i=a.destroy;a.destroy=void 0,i!==void 0&&E1(e,r,i)}a=a.next}while(a!==n)}}function Df(t,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var r=e=e.next;do{if((r.tag&t)===t){var n=r.create;r.destroy=n()}r=r.next}while(r!==e)}}function S1(t){var e=t.ref;if(e!==null){var r=t.stateNode;switch(t.tag){case 5:t=r;break;default:t=r}typeof e=="function"?e(t):e.current=t}}function uO(t){var e=t.alternate;e!==null&&(t.alternate=null,uO(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&(delete e[ia],delete e[Jl],delete e[u1],delete e[Oq],delete e[Mq])),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}function cO(t){return t.tag===5||t.tag===3||t.tag===4}function OC(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||cO(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function C1(t,e,r){var n=t.tag;if(n===5||n===6)t=t.stateNode,e?r.nodeType===8?r.parentNode.insertBefore(t,e):r.insertBefore(t,e):(r.nodeType===8?(e=r.parentNode,e.insertBefore(t,r)):(e=r,e.appendChild(t)),r=r._reactRootContainer,r!=null||e.onclick!==null||(e.onclick=Pd));else if(n!==4&&(t=t.child,t!==null))for(C1(t,e,r),t=t.sibling;t!==null;)C1(t,e,r),t=t.sibling}function N1(t,e,r){var n=t.tag;if(n===5||n===6)t=t.stateNode,e?r.insertBefore(t,e):r.appendChild(t);else if(n!==4&&(t=t.child,t!==null))for(N1(t,e,r),t=t.sibling;t!==null;)N1(t,e,r),t=t.sibling}var fr=null,_n=!1;function Va(t,e,r){for(r=r.child;r!==null;)dO(t,e,r),r=r.sibling}function dO(t,e,r){if(oa&&typeof oa.onCommitFiberUnmount=="function")try{oa.onCommitFiberUnmount(Cf,r)}catch{}switch(r.tag){case 5:Er||Qs(r,e);case 6:var n=fr,a=_n;fr=null,Va(t,e,r),fr=n,_n=a,fr!==null&&(_n?(t=fr,r=r.stateNode,t.nodeType===8?t.parentNode.removeChild(r):t.removeChild(r)):fr.removeChild(r.stateNode));break;case 18:fr!==null&&(_n?(t=fr,r=r.stateNode,t.nodeType===8?tv(t.parentNode,r):t.nodeType===1&&tv(t,r),Yl(t)):tv(fr,r.stateNode));break;case 4:n=fr,a=_n,fr=r.stateNode.containerInfo,_n=!0,Va(t,e,r),fr=n,_n=a;break;case 0:case 11:case 14:case 15:if(!Er&&(n=r.updateQueue,n!==null&&(n=n.lastEffect,n!==null))){a=n=n.next;do{var i=a,s=i.destroy;i=i.tag,s!==void 0&&(i&2||i&4)&&E1(r,e,s),a=a.next}while(a!==n)}Va(t,e,r);break;case 1:if(!Er&&(Qs(r,e),n=r.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(o){Ot(r,e,o)}Va(t,e,r);break;case 21:Va(t,e,r);break;case 22:r.mode&1?(Er=(n=Er)||r.memoizedState!==null,Va(t,e,r),Er=n):Va(t,e,r);break;default:Va(t,e,r)}}function MC(t){var e=t.updateQueue;if(e!==null){t.updateQueue=null;var r=t.stateNode;r===null&&(r=t.stateNode=new Zq),e.forEach(function(n){var a=l4.bind(null,t,n);r.has(n)||(r.add(n),n.then(a,a))})}}function kn(t,e){var r=e.deletions;if(r!==null)for(var n=0;n<r.length;n++){var a=r[n];try{var i=t,s=e,o=s;e:for(;o!==null;){switch(o.tag){case 5:fr=o.stateNode,_n=!1;break e;case 3:fr=o.stateNode.containerInfo,_n=!0;break e;case 4:fr=o.stateNode.containerInfo,_n=!0;break e}o=o.return}if(fr===null)throw Error(Pe(160));dO(i,s,a),fr=null,_n=!1;var l=a.alternate;l!==null&&(l.return=null),a.return=null}catch(u){Ot(a,e,u)}}if(e.subtreeFlags&12854)for(e=e.child;e!==null;)fO(e,t),e=e.sibling}function fO(t,e){var r=t.alternate,n=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:if(kn(e,t),Jn(t),n&4){try{_l(3,t,t.return),Df(3,t)}catch(y){Ot(t,t.return,y)}try{_l(5,t,t.return)}catch(y){Ot(t,t.return,y)}}break;case 1:kn(e,t),Jn(t),n&512&&r!==null&&Qs(r,r.return);break;case 5:if(kn(e,t),Jn(t),n&512&&r!==null&&Qs(r,r.return),t.flags&32){var a=t.stateNode;try{Vl(a,"")}catch(y){Ot(t,t.return,y)}}if(n&4&&(a=t.stateNode,a!=null)){var i=t.memoizedProps,s=r!==null?r.memoizedProps:i,o=t.type,l=t.updateQueue;if(t.updateQueue=null,l!==null)try{o==="input"&&i.type==="radio"&&i.name!=null&&j_(a,i),Xb(o,s);var u=Xb(o,i);for(s=0;s<l.length;s+=2){var c=l[s],d=l[s+1];c==="style"?B_(a,d):c==="dangerouslySetInnerHTML"?I_(a,d):c==="children"?Vl(a,d):kw(a,c,d,u)}switch(o){case"input":Vb(a,i);break;case"textarea":O_(a,i);break;case"select":var f=a._wrapperState.wasMultiple;a._wrapperState.wasMultiple=!!i.multiple;var v=i.value;v!=null?no(a,!!i.multiple,v,!1):f!==!!i.multiple&&(i.defaultValue!=null?no(a,!!i.multiple,i.defaultValue,!0):no(a,!!i.multiple,i.multiple?[]:"",!1))}a[Jl]=i}catch(y){Ot(t,t.return,y)}}break;case 6:if(kn(e,t),Jn(t),n&4){if(t.stateNode===null)throw Error(Pe(162));a=t.stateNode,i=t.memoizedProps;try{a.nodeValue=i}catch(y){Ot(t,t.return,y)}}break;case 3:if(kn(e,t),Jn(t),n&4&&r!==null&&r.memoizedState.isDehydrated)try{Yl(e.containerInfo)}catch(y){Ot(t,t.return,y)}break;case 4:kn(e,t),Jn(t);break;case 13:kn(e,t),Jn(t),a=t.child,a.flags&8192&&(i=a.memoizedState!==null,a.stateNode.isHidden=i,!i||a.alternate!==null&&a.alternate.memoizedState!==null||(uE=Ft())),n&4&&MC(t);break;case 22:if(c=r!==null&&r.memoizedState!==null,t.mode&1?(Er=(u=Er)||c,kn(e,t),Er=u):kn(e,t),Jn(t),n&8192){if(u=t.memoizedState!==null,(t.stateNode.isHidden=u)&&!c&&t.mode&1)for(Fe=t,c=t.child;c!==null;){for(d=Fe=c;Fe!==null;){switch(f=Fe,v=f.child,f.tag){case 0:case 11:case 14:case 15:_l(4,f,f.return);break;case 1:Qs(f,f.return);var p=f.stateNode;if(typeof p.componentWillUnmount=="function"){n=f,r=f.return;try{e=n,p.props=e.memoizedProps,p.state=e.memoizedState,p.componentWillUnmount()}catch(y){Ot(n,r,y)}}break;case 5:Qs(f,f.return);break;case 22:if(f.memoizedState!==null){FC(d);continue}}v!==null?(v.return=f,Fe=v):FC(d)}c=c.sibling}e:for(c=null,d=t;;){if(d.tag===5){if(c===null){c=d;try{a=d.stateNode,u?(i=a.style,typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none"):(o=d.stateNode,l=d.memoizedProps.style,s=l!=null&&l.hasOwnProperty("display")?l.display:null,o.style.display=F_("display",s))}catch(y){Ot(t,t.return,y)}}}else if(d.tag===6){if(c===null)try{d.stateNode.nodeValue=u?"":d.memoizedProps}catch(y){Ot(t,t.return,y)}}else if((d.tag!==22&&d.tag!==23||d.memoizedState===null||d===t)&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===t)break e;for(;d.sibling===null;){if(d.return===null||d.return===t)break e;c===d&&(c=null),d=d.return}c===d&&(c=null),d.sibling.return=d.return,d=d.sibling}}break;case 19:kn(e,t),Jn(t),n&4&&MC(t);break;case 21:break;default:kn(e,t),Jn(t)}}function Jn(t){var e=t.flags;if(e&2){try{e:{for(var r=t.return;r!==null;){if(cO(r)){var n=r;break e}r=r.return}throw Error(Pe(160))}switch(n.tag){case 5:var a=n.stateNode;n.flags&32&&(Vl(a,""),n.flags&=-33);var i=OC(t);N1(t,i,a);break;case 3:case 4:var s=n.stateNode.containerInfo,o=OC(t);C1(t,o,s);break;default:throw Error(Pe(161))}}catch(l){Ot(t,t.return,l)}t.flags&=-3}e&4096&&(t.flags&=-4097)}function e4(t,e,r){Fe=t,hO(t)}function hO(t,e,r){for(var n=(t.mode&1)!==0;Fe!==null;){var a=Fe,i=a.child;if(a.tag===22&&n){var s=a.memoizedState!==null||bc;if(!s){var o=a.alternate,l=o!==null&&o.memoizedState!==null||Er;o=bc;var u=Er;if(bc=s,(Er=l)&&!u)for(Fe=a;Fe!==null;)s=Fe,l=s.child,s.tag===22&&s.memoizedState!==null?BC(a):l!==null?(l.return=s,Fe=l):BC(a);for(;i!==null;)Fe=i,hO(i),i=i.sibling;Fe=a,bc=o,Er=u}IC(t)}else a.subtreeFlags&8772&&i!==null?(i.return=a,Fe=i):IC(t)}}function IC(t){for(;Fe!==null;){var e=Fe;if(e.flags&8772){var r=e.alternate;try{if(e.flags&8772)switch(e.tag){case 0:case 11:case 15:Er||Df(5,e);break;case 1:var n=e.stateNode;if(e.flags&4&&!Er)if(r===null)n.componentDidMount();else{var a=e.elementType===e.type?r.memoizedProps:Dn(e.type,r.memoizedProps);n.componentDidUpdate(a,r.memoizedState,n.__reactInternalSnapshotBeforeUpdate)}var i=e.updateQueue;i!==null&&wC(e,i,n);break;case 3:var s=e.updateQueue;if(s!==null){if(r=null,e.child!==null)switch(e.child.tag){case 5:r=e.child.stateNode;break;case 1:r=e.child.stateNode}wC(e,s,r)}break;case 5:var o=e.stateNode;if(r===null&&e.flags&4){r=o;var l=e.memoizedProps;switch(e.type){case"button":case"input":case"select":case"textarea":l.autoFocus&&r.focus();break;case"img":l.src&&(r.src=l.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(e.memoizedState===null){var u=e.alternate;if(u!==null){var c=u.memoizedState;if(c!==null){var d=c.dehydrated;d!==null&&Yl(d)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(Pe(163))}Er||e.flags&512&&S1(e)}catch(f){Ot(e,e.return,f)}}if(e===t){Fe=null;break}if(r=e.sibling,r!==null){r.return=e.return,Fe=r;break}Fe=e.return}}function FC(t){for(;Fe!==null;){var e=Fe;if(e===t){Fe=null;break}var r=e.sibling;if(r!==null){r.return=e.return,Fe=r;break}Fe=e.return}}function BC(t){for(;Fe!==null;){var e=Fe;try{switch(e.tag){case 0:case 11:case 15:var r=e.return;try{Df(4,e)}catch(l){Ot(e,r,l)}break;case 1:var n=e.stateNode;if(typeof n.componentDidMount=="function"){var a=e.return;try{n.componentDidMount()}catch(l){Ot(e,a,l)}}var i=e.return;try{S1(e)}catch(l){Ot(e,i,l)}break;case 5:var s=e.return;try{S1(e)}catch(l){Ot(e,s,l)}}}catch(l){Ot(e,e.return,l)}if(e===t){Fe=null;break}var o=e.sibling;if(o!==null){o.return=e.return,Fe=o;break}Fe=e.return}}var t4=Math.ceil,Bd=Ma.ReactCurrentDispatcher,oE=Ma.ReactCurrentOwner,Sn=Ma.ReactCurrentBatchConfig,it=0,or=null,Wt=null,hr=0,an=0,Zs=Ri(0),er=0,iu=null,ss=0,_f=0,lE=0,jl=null,Gr=null,uE=0,bo=1/0,ma=null,zd=!1,T1=null,di=null,wc=!1,ti=null,qd=0,Ol=0,R1=null,Zc=-1,Jc=0;function Mr(){return it&6?Ft():Zc!==-1?Zc:Zc=Ft()}function fi(t){return t.mode&1?it&2&&hr!==0?hr&-hr:Fq.transition!==null?(Jc===0&&(Jc=Q_()),Jc):(t=vt,t!==0||(t=window.event,t=t===void 0?16:aj(t.type)),t):1}function Un(t,e,r,n){if(50<Ol)throw Ol=0,R1=null,Error(Pe(185));Tu(t,r,n),(!(it&2)||t!==or)&&(t===or&&(!(it&2)&&(_f|=r),er===4&&Qa(t,hr)),Zr(t,n),r===1&&it===0&&!(e.mode&1)&&(bo=Ft()+500,Af&&Pi()))}function Zr(t,e){var r=t.callbackNode;Fz(t,e);var n=Cd(t,t===or?hr:0);if(n===0)r!==null&&YS(r),t.callbackNode=null,t.callbackPriority=0;else if(e=n&-n,t.callbackPriority!==e){if(r!=null&&YS(r),e===1)t.tag===0?Iq(zC.bind(null,t)):Sj(zC.bind(null,t)),_q(function(){!(it&6)&&Pi()}),r=null;else{switch(Z_(n)){case 1:r=Ow;break;case 4:r=X_;break;case 16:r=Sd;break;case 536870912:r=K_;break;default:r=Sd}r=wO(r,vO.bind(null,t))}t.callbackPriority=e,t.callbackNode=r}}function vO(t,e){if(Zc=-1,Jc=0,it&6)throw Error(Pe(327));var r=t.callbackNode;if(lo()&&t.callbackNode!==r)return null;var n=Cd(t,t===or?hr:0);if(n===0)return null;if(n&30||n&t.expiredLanes||e)e=Ud(t,n);else{e=n;var a=it;it|=2;var i=gO();(or!==t||hr!==e)&&(ma=null,bo=Ft()+500,ts(t,e));do try{a4();break}catch(o){pO(t,o)}while(1);Yw(),Bd.current=i,it=a,Wt!==null?e=0:(or=null,hr=0,e=er)}if(e!==0){if(e===2&&(a=e1(t),a!==0&&(n=a,e=P1(t,a))),e===1)throw r=iu,ts(t,0),Qa(t,n),Zr(t,Ft()),r;if(e===6)Qa(t,n);else{if(a=t.current.alternate,!(n&30)&&!r4(a)&&(e=Ud(t,n),e===2&&(i=e1(t),i!==0&&(n=i,e=P1(t,i))),e===1))throw r=iu,ts(t,0),Qa(t,n),Zr(t,Ft()),r;switch(t.finishedWork=a,t.finishedLanes=n,e){case 0:case 1:throw Error(Pe(345));case 2:$i(t,Gr,ma);break;case 3:if(Qa(t,n),(n&130023424)===n&&(e=uE+500-Ft(),10<e)){if(Cd(t,0)!==0)break;if(a=t.suspendedLanes,(a&n)!==n){Mr(),t.pingedLanes|=t.suspendedLanes&a;break}t.timeoutHandle=l1($i.bind(null,t,Gr,ma),e);break}$i(t,Gr,ma);break;case 4:if(Qa(t,n),(n&4194240)===n)break;for(e=t.eventTimes,a=-1;0<n;){var s=31-qn(n);i=1<<s,s=e[s],s>a&&(a=s),n&=~i}if(n=a,n=Ft()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*t4(n/1960))-n,10<n){t.timeoutHandle=l1($i.bind(null,t,Gr,ma),n);break}$i(t,Gr,ma);break;case 5:$i(t,Gr,ma);break;default:throw Error(Pe(329))}}}return Zr(t,Ft()),t.callbackNode===r?vO.bind(null,t):null}function P1(t,e){var r=jl;return t.current.memoizedState.isDehydrated&&(ts(t,e).flags|=256),t=Ud(t,e),t!==2&&(e=Gr,Gr=r,e!==null&&A1(e)),t}function A1(t){Gr===null?Gr=t:Gr.push.apply(Gr,t)}function r4(t){for(var e=t;;){if(e.flags&16384){var r=e.updateQueue;if(r!==null&&(r=r.stores,r!==null))for(var n=0;n<r.length;n++){var a=r[n],i=a.getSnapshot;a=a.value;try{if(!Gn(i(),a))return!1}catch{return!1}}}if(r=e.child,e.subtreeFlags&16384&&r!==null)r.return=e,e=r;else{if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return!0;e=e.return}e.sibling.return=e.return,e=e.sibling}}return!0}function Qa(t,e){for(e&=~lE,e&=~_f,t.suspendedLanes|=e,t.pingedLanes&=~e,t=t.expirationTimes;0<e;){var r=31-qn(e),n=1<<r;t[r]=-1,e&=~n}}function zC(t){if(it&6)throw Error(Pe(327));lo();var e=Cd(t,0);if(!(e&1))return Zr(t,Ft()),null;var r=Ud(t,e);if(t.tag!==0&&r===2){var n=e1(t);n!==0&&(e=n,r=P1(t,n))}if(r===1)throw r=iu,ts(t,0),Qa(t,e),Zr(t,Ft()),r;if(r===6)throw Error(Pe(345));return t.finishedWork=t.current.alternate,t.finishedLanes=e,$i(t,Gr,ma),Zr(t,Ft()),null}function cE(t,e){var r=it;it|=1;try{return t(e)}finally{it=r,it===0&&(bo=Ft()+500,Af&&Pi())}}function os(t){ti!==null&&ti.tag===0&&!(it&6)&&lo();var e=it;it|=1;var r=Sn.transition,n=vt;try{if(Sn.transition=null,vt=1,t)return t()}finally{vt=n,Sn.transition=r,it=e,!(it&6)&&Pi()}}function dE(){an=Zs.current,St(Zs)}function ts(t,e){t.finishedWork=null,t.finishedLanes=0;var r=t.timeoutHandle;if(r!==-1&&(t.timeoutHandle=-1,Dq(r)),Wt!==null)for(r=Wt.return;r!==null;){var n=r;switch(Gw(n),n.tag){case 1:n=n.type.childContextTypes,n!=null&&Ad();break;case 3:yo(),St(Kr),St(Nr),eE();break;case 5:Jw(n);break;case 4:yo();break;case 13:St(kt);break;case 19:St(kt);break;case 10:Xw(n.type._context);break;case 22:case 23:dE()}r=r.return}if(or=t,Wt=t=hi(t.current,null),hr=an=e,er=0,iu=null,lE=_f=ss=0,Gr=jl=null,Ki!==null){for(e=0;e<Ki.length;e++)if(r=Ki[e],n=r.interleaved,n!==null){r.interleaved=null;var a=n.next,i=r.pending;if(i!==null){var s=i.next;i.next=a,n.next=s}r.pending=n}Ki=null}return t}function pO(t,e){do{var r=Wt;try{if(Yw(),Xc.current=Fd,Id){for(var n=Lt.memoizedState;n!==null;){var a=n.queue;a!==null&&(a.pending=null),n=n.next}Id=!1}if(is=0,sr=Jt=Lt=null,Dl=!1,ru=0,oE.current=null,r===null||r.return===null){er=1,iu=e,Wt=null;break}e:{var i=t,s=r.return,o=r,l=e;if(e=hr,o.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){var u=l,c=o,d=c.tag;if(!(c.mode&1)&&(d===0||d===11||d===15)){var f=c.alternate;f?(c.updateQueue=f.updateQueue,c.memoizedState=f.memoizedState,c.lanes=f.lanes):(c.updateQueue=null,c.memoizedState=null)}var v=RC(s);if(v!==null){v.flags&=-257,PC(v,s,o,i,e),v.mode&1&&TC(i,u,e),e=v,l=u;var p=e.updateQueue;if(p===null){var y=new Set;y.add(l),e.updateQueue=y}else p.add(l);break e}else{if(!(e&1)){TC(i,u,e),fE();break e}l=Error(Pe(426))}}else if(Nt&&o.mode&1){var m=RC(s);if(m!==null){!(m.flags&65536)&&(m.flags|=256),PC(m,s,o,i,e),Hw(xo(l,o));break e}}i=l=xo(l,o),er!==4&&(er=2),jl===null?jl=[i]:jl.push(i),i=s;do{switch(i.tag){case 3:i.flags|=65536,e&=-e,i.lanes|=e;var g=Zj(i,l,e);bC(i,g);break e;case 1:o=l;var x=i.type,b=i.stateNode;if(!(i.flags&128)&&(typeof x.getDerivedStateFromError=="function"||b!==null&&typeof b.componentDidCatch=="function"&&(di===null||!di.has(b)))){i.flags|=65536,e&=-e,i.lanes|=e;var w=Jj(i,o,e);bC(i,w);break e}}i=i.return}while(i!==null)}yO(r)}catch(E){e=E,Wt===r&&r!==null&&(Wt=r=r.return);continue}break}while(1)}function gO(){var t=Bd.current;return Bd.current=Fd,t===null?Fd:t}function fE(){(er===0||er===3||er===2)&&(er=4),or===null||!(ss&268435455)&&!(_f&268435455)||Qa(or,hr)}function Ud(t,e){var r=it;it|=2;var n=gO();(or!==t||hr!==e)&&(ma=null,ts(t,e));do try{n4();break}catch(a){pO(t,a)}while(1);if(Yw(),it=r,Bd.current=n,Wt!==null)throw Error(Pe(261));return or=null,hr=0,er}function n4(){for(;Wt!==null;)mO(Wt)}function a4(){for(;Wt!==null&&!Az();)mO(Wt)}function mO(t){var e=bO(t.alternate,t,an);t.memoizedProps=t.pendingProps,e===null?yO(t):Wt=e,oE.current=null}function yO(t){var e=t;do{var r=e.alternate;if(t=e.return,e.flags&32768){if(r=Qq(r,e),r!==null){r.flags&=32767,Wt=r;return}if(t!==null)t.flags|=32768,t.subtreeFlags=0,t.deletions=null;else{er=6,Wt=null;return}}else if(r=Kq(r,e,an),r!==null){Wt=r;return}if(e=e.sibling,e!==null){Wt=e;return}Wt=e=t}while(e!==null);er===0&&(er=5)}function $i(t,e,r){var n=vt,a=Sn.transition;try{Sn.transition=null,vt=1,i4(t,e,r,n)}finally{Sn.transition=a,vt=n}return null}function i4(t,e,r,n){do lo();while(ti!==null);if(it&6)throw Error(Pe(327));r=t.finishedWork;var a=t.finishedLanes;if(r===null)return null;if(t.finishedWork=null,t.finishedLanes=0,r===t.current)throw Error(Pe(177));t.callbackNode=null,t.callbackPriority=0;var i=r.lanes|r.childLanes;if(Bz(t,i),t===or&&(Wt=or=null,hr=0),!(r.subtreeFlags&2064)&&!(r.flags&2064)||wc||(wc=!0,wO(Sd,function(){return lo(),null})),i=(r.flags&15990)!==0,r.subtreeFlags&15990||i){i=Sn.transition,Sn.transition=null;var s=vt;vt=1;var o=it;it|=4,oE.current=null,Jq(t,r),fO(r,t),Nq(s1),Nd=!!i1,s1=i1=null,t.current=r,e4(r),kz(),it=o,vt=s,Sn.transition=i}else t.current=r;if(wc&&(wc=!1,ti=t,qd=a),i=t.pendingLanes,i===0&&(di=null),_z(r.stateNode),Zr(t,Ft()),e!==null)for(n=t.onRecoverableError,r=0;r<e.length;r++)a=e[r],n(a.value,{componentStack:a.stack,digest:a.digest});if(zd)throw zd=!1,t=T1,T1=null,t;return qd&1&&t.tag!==0&&lo(),i=t.pendingLanes,i&1?t===R1?Ol++:(Ol=0,R1=t):Ol=0,Pi(),null}function lo(){if(ti!==null){var t=Z_(qd),e=Sn.transition,r=vt;try{if(Sn.transition=null,vt=16>t?16:t,ti===null)var n=!1;else{if(t=ti,ti=null,qd=0,it&6)throw Error(Pe(331));var a=it;for(it|=4,Fe=t.current;Fe!==null;){var i=Fe,s=i.child;if(Fe.flags&16){var o=i.deletions;if(o!==null){for(var l=0;l<o.length;l++){var u=o[l];for(Fe=u;Fe!==null;){var c=Fe;switch(c.tag){case 0:case 11:case 15:_l(8,c,i)}var d=c.child;if(d!==null)d.return=c,Fe=d;else for(;Fe!==null;){c=Fe;var f=c.sibling,v=c.return;if(uO(c),c===u){Fe=null;break}if(f!==null){f.return=v,Fe=f;break}Fe=v}}}var p=i.alternate;if(p!==null){var y=p.child;if(y!==null){p.child=null;do{var m=y.sibling;y.sibling=null,y=m}while(y!==null)}}Fe=i}}if(i.subtreeFlags&2064&&s!==null)s.return=i,Fe=s;else e:for(;Fe!==null;){if(i=Fe,i.flags&2048)switch(i.tag){case 0:case 11:case 15:_l(9,i,i.return)}var g=i.sibling;if(g!==null){g.return=i.return,Fe=g;break e}Fe=i.return}}var x=t.current;for(Fe=x;Fe!==null;){s=Fe;var b=s.child;if(s.subtreeFlags&2064&&b!==null)b.return=s,Fe=b;else e:for(s=x;Fe!==null;){if(o=Fe,o.flags&2048)try{switch(o.tag){case 0:case 11:case 15:Df(9,o)}}catch(E){Ot(o,o.return,E)}if(o===s){Fe=null;break e}var w=o.sibling;if(w!==null){w.return=o.return,Fe=w;break e}Fe=o.return}}if(it=a,Pi(),oa&&typeof oa.onPostCommitFiberRoot=="function")try{oa.onPostCommitFiberRoot(Cf,t)}catch{}n=!0}return n}finally{vt=r,Sn.transition=e}}return!1}function qC(t,e,r){e=xo(r,e),e=Zj(t,e,1),t=ci(t,e,1),e=Mr(),t!==null&&(Tu(t,1,e),Zr(t,e))}function Ot(t,e,r){if(t.tag===3)qC(t,t,r);else for(;e!==null;){if(e.tag===3){qC(e,t,r);break}else if(e.tag===1){var n=e.stateNode;if(typeof e.type.getDerivedStateFromError=="function"||typeof n.componentDidCatch=="function"&&(di===null||!di.has(n))){t=xo(r,t),t=Jj(e,t,1),e=ci(e,t,1),t=Mr(),e!==null&&(Tu(e,1,t),Zr(e,t));break}}e=e.return}}function s4(t,e,r){var n=t.pingCache;n!==null&&n.delete(e),e=Mr(),t.pingedLanes|=t.suspendedLanes&r,or===t&&(hr&r)===r&&(er===4||er===3&&(hr&130023424)===hr&&500>Ft()-uE?ts(t,0):lE|=r),Zr(t,e)}function xO(t,e){e===0&&(t.mode&1?(e=dc,dc<<=1,!(dc&130023424)&&(dc=4194304)):e=1);var r=Mr();t=ka(t,e),t!==null&&(Tu(t,e,r),Zr(t,r))}function o4(t){var e=t.memoizedState,r=0;e!==null&&(r=e.retryLane),xO(t,r)}function l4(t,e){var r=0;switch(t.tag){case 13:var n=t.stateNode,a=t.memoizedState;a!==null&&(r=a.retryLane);break;case 19:n=t.stateNode;break;default:throw Error(Pe(314))}n!==null&&n.delete(e),xO(t,r)}var bO;bO=function(t,e,r){if(t!==null)if(t.memoizedProps!==e.pendingProps||Kr.current)Yr=!0;else{if(!(t.lanes&r)&&!(e.flags&128))return Yr=!1,Xq(t,e,r);Yr=!!(t.flags&131072)}else Yr=!1,Nt&&e.flags&1048576&&Cj(e,Dd,e.index);switch(e.lanes=0,e.tag){case 2:var n=e.type;Qc(t,e),t=e.pendingProps;var a=po(e,Nr.current);oo(e,r),a=rE(null,e,n,t,a,r);var i=nE();return e.flags|=1,typeof a=="object"&&a!==null&&typeof a.render=="function"&&a.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,Qr(n)?(i=!0,kd(e)):i=!1,e.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,Qw(e),a.updater=Lf,e.stateNode=a,a._reactInternals=e,p1(e,n,t,r),e=y1(null,e,n,!0,i,r)):(e.tag=0,Nt&&i&&Vw(e),_r(null,e,a,r),e=e.child),e;case 16:n=e.elementType;e:{switch(Qc(t,e),t=e.pendingProps,a=n._init,n=a(n._payload),e.type=n,a=e.tag=c4(n),t=Dn(n,t),a){case 0:e=m1(null,e,n,t,r);break e;case 1:e=LC(null,e,n,t,r);break e;case 11:e=AC(null,e,n,t,r);break e;case 14:e=kC(null,e,n,Dn(n.type,t),r);break e}throw Error(Pe(306,n,""))}return e;case 0:return n=e.type,a=e.pendingProps,a=e.elementType===n?a:Dn(n,a),m1(t,e,n,a,r);case 1:return n=e.type,a=e.pendingProps,a=e.elementType===n?a:Dn(n,a),LC(t,e,n,a,r);case 3:e:{if(nO(e),t===null)throw Error(Pe(387));n=e.pendingProps,i=e.memoizedState,a=i.element,kj(t,e),Od(e,n,null,r);var s=e.memoizedState;if(n=s.element,i.isDehydrated)if(i={element:n,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},e.updateQueue.baseState=i,e.memoizedState=i,e.flags&256){a=xo(Error(Pe(423)),e),e=DC(t,e,n,r,a);break e}else if(n!==a){a=xo(Error(Pe(424)),e),e=DC(t,e,n,r,a);break e}else for(sn=ui(e.stateNode.containerInfo.firstChild),ln=e,Nt=!0,On=null,r=Pj(e,null,n,r),e.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(go(),n===a){e=La(t,e,r);break e}_r(t,e,n,r)}e=e.child}return e;case 5:return Lj(e),t===null&&f1(e),n=e.type,a=e.pendingProps,i=t!==null?t.memoizedProps:null,s=a.children,o1(n,a)?s=null:i!==null&&o1(n,i)&&(e.flags|=32),rO(t,e),_r(t,e,s,r),e.child;case 6:return t===null&&f1(e),null;case 13:return aO(t,e,r);case 4:return Zw(e,e.stateNode.containerInfo),n=e.pendingProps,t===null?e.child=mo(e,null,n,r):_r(t,e,n,r),e.child;case 11:return n=e.type,a=e.pendingProps,a=e.elementType===n?a:Dn(n,a),AC(t,e,n,a,r);case 7:return _r(t,e,e.pendingProps,r),e.child;case 8:return _r(t,e,e.pendingProps.children,r),e.child;case 12:return _r(t,e,e.pendingProps.children,r),e.child;case 10:e:{if(n=e.type._context,a=e.pendingProps,i=e.memoizedProps,s=a.value,xt(_d,n._currentValue),n._currentValue=s,i!==null)if(Gn(i.value,s)){if(i.children===a.children&&!Kr.current){e=La(t,e,r);break e}}else for(i=e.child,i!==null&&(i.return=e);i!==null;){var o=i.dependencies;if(o!==null){s=i.child;for(var l=o.firstContext;l!==null;){if(l.context===n){if(i.tag===1){l=Ta(-1,r&-r),l.tag=2;var u=i.updateQueue;if(u!==null){u=u.shared;var c=u.pending;c===null?l.next=l:(l.next=c.next,c.next=l),u.pending=l}}i.lanes|=r,l=i.alternate,l!==null&&(l.lanes|=r),h1(i.return,r,e),o.lanes|=r;break}l=l.next}}else if(i.tag===10)s=i.type===e.type?null:i.child;else if(i.tag===18){if(s=i.return,s===null)throw Error(Pe(341));s.lanes|=r,o=s.alternate,o!==null&&(o.lanes|=r),h1(s,r,e),s=i.sibling}else s=i.child;if(s!==null)s.return=i;else for(s=i;s!==null;){if(s===e){s=null;break}if(i=s.sibling,i!==null){i.return=s.return,s=i;break}s=s.return}i=s}_r(t,e,a.children,r),e=e.child}return e;case 9:return a=e.type,n=e.pendingProps.children,oo(e,r),a=Nn(a),n=n(a),e.flags|=1,_r(t,e,n,r),e.child;case 14:return n=e.type,a=Dn(n,e.pendingProps),a=Dn(n.type,a),kC(t,e,n,a,r);case 15:return eO(t,e,e.type,e.pendingProps,r);case 17:return n=e.type,a=e.pendingProps,a=e.elementType===n?a:Dn(n,a),Qc(t,e),e.tag=1,Qr(n)?(t=!0,kd(e)):t=!1,oo(e,r),Qj(e,n,a),p1(e,n,a,r),y1(null,e,n,!0,t,r);case 19:return iO(t,e,r);case 22:return tO(t,e,r)}throw Error(Pe(156,e.tag))};function wO(t,e){return Y_(t,e)}function u4(t,e,r,n){this.tag=t,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function wn(t,e,r,n){return new u4(t,e,r,n)}function hE(t){return t=t.prototype,!(!t||!t.isReactComponent)}function c4(t){if(typeof t=="function")return hE(t)?1:0;if(t!=null){if(t=t.$$typeof,t===Dw)return 11;if(t===_w)return 14}return 2}function hi(t,e){var r=t.alternate;return r===null?(r=wn(t.tag,e,t.key,t.mode),r.elementType=t.elementType,r.type=t.type,r.stateNode=t.stateNode,r.alternate=t,t.alternate=r):(r.pendingProps=e,r.type=t.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=t.flags&14680064,r.childLanes=t.childLanes,r.lanes=t.lanes,r.child=t.child,r.memoizedProps=t.memoizedProps,r.memoizedState=t.memoizedState,r.updateQueue=t.updateQueue,e=t.dependencies,r.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},r.sibling=t.sibling,r.index=t.index,r.ref=t.ref,r}function ed(t,e,r,n,a,i){var s=2;if(n=t,typeof t=="function")hE(t)&&(s=1);else if(typeof t=="string")s=5;else e:switch(t){case Us:return rs(r.children,a,i,e);case Lw:s=8,a|=8;break;case Bb:return t=wn(12,r,e,a|2),t.elementType=Bb,t.lanes=i,t;case zb:return t=wn(13,r,e,a),t.elementType=zb,t.lanes=i,t;case qb:return t=wn(19,r,e,a),t.elementType=qb,t.lanes=i,t;case L_:return jf(r,a,i,e);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case A_:s=10;break e;case k_:s=9;break e;case Dw:s=11;break e;case _w:s=14;break e;case Wa:s=16,n=null;break e}throw Error(Pe(130,t==null?t:typeof t,""))}return e=wn(s,r,e,a),e.elementType=t,e.type=n,e.lanes=i,e}function rs(t,e,r,n){return t=wn(7,t,n,e),t.lanes=r,t}function jf(t,e,r,n){return t=wn(22,t,n,e),t.elementType=L_,t.lanes=r,t.stateNode={isHidden:!1},t}function uv(t,e,r){return t=wn(6,t,null,e),t.lanes=r,t}function cv(t,e,r){return e=wn(4,t.children!==null?t.children:[],t.key,e),e.lanes=r,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}function d4(t,e,r,n,a){this.tag=e,this.containerInfo=t,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Vh(0),this.expirationTimes=Vh(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Vh(0),this.identifierPrefix=n,this.onRecoverableError=a,this.mutableSourceEagerHydrationData=null}function vE(t,e,r,n,a,i,s,o,l){return t=new d4(t,e,r,o,l),e===1?(e=1,i===!0&&(e|=8)):e=0,i=wn(3,null,null,e),t.current=i,i.stateNode=t,i.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},Qw(i),t}function f4(t,e,r){var n=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:qs,key:n==null?null:""+n,children:t,containerInfo:e,implementation:r}}function EO(t){if(!t)return yi;t=t._reactInternals;e:{if(xs(t)!==t||t.tag!==1)throw Error(Pe(170));var e=t;do{switch(e.tag){case 3:e=e.stateNode.context;break e;case 1:if(Qr(e.type)){e=e.stateNode.__reactInternalMemoizedMergedChildContext;break e}}e=e.return}while(e!==null);throw Error(Pe(171))}if(t.tag===1){var r=t.type;if(Qr(r))return Ej(t,r,e)}return e}function SO(t,e,r,n,a,i,s,o,l){return t=vE(r,n,!0,t,a,i,s,o,l),t.context=EO(null),r=t.current,n=Mr(),a=fi(r),i=Ta(n,a),i.callback=e??null,ci(r,i,a),t.current.lanes=a,Tu(t,a,n),Zr(t,n),t}function Of(t,e,r,n){var a=e.current,i=Mr(),s=fi(a);return r=EO(r),e.context===null?e.context=r:e.pendingContext=r,e=Ta(i,s),e.payload={element:t},n=n===void 0?null:n,n!==null&&(e.callback=n),t=ci(a,e,s),t!==null&&(Un(t,a,s,i),Yc(t,a,s)),s}function $d(t){if(t=t.current,!t.child)return null;switch(t.child.tag){case 5:return t.child.stateNode;default:return t.child.stateNode}}function UC(t,e){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var r=t.retryLane;t.retryLane=r!==0&&r<e?r:e}}function pE(t,e){UC(t,e),(t=t.alternate)&&UC(t,e)}function h4(){return null}var CO=typeof reportError=="function"?reportError:function(t){console.error(t)};function gE(t){this._internalRoot=t}Mf.prototype.render=gE.prototype.render=function(t){var e=this._internalRoot;if(e===null)throw Error(Pe(409));Of(t,e,null,null)};Mf.prototype.unmount=gE.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var e=t.containerInfo;os(function(){Of(null,t,null,null)}),e[Aa]=null}};function Mf(t){this._internalRoot=t}Mf.prototype.unstable_scheduleHydration=function(t){if(t){var e=tj();t={blockedOn:null,target:t,priority:e};for(var r=0;r<Ka.length&&e!==0&&e<Ka[r].priority;r++);Ka.splice(r,0,t),r===0&&nj(t)}};function mE(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function If(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11&&(t.nodeType!==8||t.nodeValue!==" react-mount-point-unstable "))}function $C(){}function v4(t,e,r,n,a){if(a){if(typeof n=="function"){var i=n;n=function(){var u=$d(s);i.call(u)}}var s=SO(e,n,t,0,null,!1,!1,"",$C);return t._reactRootContainer=s,t[Aa]=s.current,Ql(t.nodeType===8?t.parentNode:t),os(),s}for(;a=t.lastChild;)t.removeChild(a);if(typeof n=="function"){var o=n;n=function(){var u=$d(l);o.call(u)}}var l=vE(t,0,!1,null,null,!1,!1,"",$C);return t._reactRootContainer=l,t[Aa]=l.current,Ql(t.nodeType===8?t.parentNode:t),os(function(){Of(e,l,r,n)}),l}function Ff(t,e,r,n,a){var i=r._reactRootContainer;if(i){var s=i;if(typeof a=="function"){var o=a;a=function(){var l=$d(s);o.call(l)}}Of(e,s,t,a)}else s=v4(r,e,t,a,n);return $d(s)}J_=function(t){switch(t.tag){case 3:var e=t.stateNode;if(e.current.memoizedState.isDehydrated){var r=ml(e.pendingLanes);r!==0&&(Mw(e,r|1),Zr(e,Ft()),!(it&6)&&(bo=Ft()+500,Pi()))}break;case 13:os(function(){var n=ka(t,1);if(n!==null){var a=Mr();Un(n,t,1,a)}}),pE(t,1)}};Iw=function(t){if(t.tag===13){var e=ka(t,134217728);if(e!==null){var r=Mr();Un(e,t,134217728,r)}pE(t,134217728)}};ej=function(t){if(t.tag===13){var e=fi(t),r=ka(t,e);if(r!==null){var n=Mr();Un(r,t,e,n)}pE(t,e)}};tj=function(){return vt};rj=function(t,e){var r=vt;try{return vt=t,e()}finally{vt=r}};Qb=function(t,e,r){switch(e){case"input":if(Vb(t,r),e=r.name,r.type==="radio"&&e!=null){for(r=t;r.parentNode;)r=r.parentNode;for(r=r.querySelectorAll("input[name="+JSON.stringify(""+e)+'][type="radio"]'),e=0;e<r.length;e++){var n=r[e];if(n!==t&&n.form===t.form){var a=Pf(n);if(!a)throw Error(Pe(90));__(n),Vb(n,a)}}}break;case"textarea":O_(t,r);break;case"select":e=r.value,e!=null&&no(t,!!r.multiple,e,!1)}};U_=cE;$_=os;var p4={usingClientEntryPoint:!1,Events:[Pu,Hs,Pf,z_,q_,cE]},rl={findFiberByHostInstance:Xi,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},g4={bundleType:rl.bundleType,version:rl.version,rendererPackageName:rl.rendererPackageName,rendererConfig:rl.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Ma.ReactCurrentDispatcher,findHostInstanceByFiber:function(t){return t=H_(t),t===null?null:t.stateNode},findFiberByHostInstance:rl.findFiberByHostInstance||h4,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Ec=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ec.isDisabled&&Ec.supportsFiber)try{Cf=Ec.inject(g4),oa=Ec}catch{}}fn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=p4;fn.createPortal=function(t,e){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!mE(e))throw Error(Pe(200));return f4(t,e,null,r)};fn.createRoot=function(t,e){if(!mE(t))throw Error(Pe(299));var r=!1,n="",a=CO;return e!=null&&(e.unstable_strictMode===!0&&(r=!0),e.identifierPrefix!==void 0&&(n=e.identifierPrefix),e.onRecoverableError!==void 0&&(a=e.onRecoverableError)),e=vE(t,1,!1,null,null,r,!1,n,a),t[Aa]=e.current,Ql(t.nodeType===8?t.parentNode:t),new gE(e)};fn.findDOMNode=function(t){if(t==null)return null;if(t.nodeType===1)return t;var e=t._reactInternals;if(e===void 0)throw typeof t.render=="function"?Error(Pe(188)):(t=Object.keys(t).join(","),Error(Pe(268,t)));return t=H_(e),t=t===null?null:t.stateNode,t};fn.flushSync=function(t){return os(t)};fn.hydrate=function(t,e,r){if(!If(e))throw Error(Pe(200));return Ff(null,t,e,!0,r)};fn.hydrateRoot=function(t,e,r){if(!mE(t))throw Error(Pe(405));var n=r!=null&&r.hydratedSources||null,a=!1,i="",s=CO;if(r!=null&&(r.unstable_strictMode===!0&&(a=!0),r.identifierPrefix!==void 0&&(i=r.identifierPrefix),r.onRecoverableError!==void 0&&(s=r.onRecoverableError)),e=SO(e,null,t,1,r??null,a,!1,i,s),t[Aa]=e.current,Ql(t),n)for(t=0;t<n.length;t++)r=n[t],a=r._getVersion,a=a(r._source),e.mutableSourceEagerHydrationData==null?e.mutableSourceEagerHydrationData=[r,a]:e.mutableSourceEagerHydrationData.push(r,a);return new Mf(e)};fn.render=function(t,e,r){if(!If(e))throw Error(Pe(200));return Ff(null,t,e,!1,r)};fn.unmountComponentAtNode=function(t){if(!If(t))throw Error(Pe(40));return t._reactRootContainer?(os(function(){Ff(null,null,t,!1,function(){t._reactRootContainer=null,t[Aa]=null})}),!0):!1};fn.unstable_batchedUpdates=cE;fn.unstable_renderSubtreeIntoContainer=function(t,e,r,n){if(!If(r))throw Error(Pe(200));if(t==null||t._reactInternals===void 0)throw Error(Pe(38));return Ff(t,e,r,!1,n)};fn.version="18.3.1-next-f1338f8080-20240426";function NO(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(NO)}catch(t){console.error(t)}}NO(),N_.exports=fn;var m4=N_.exports,VC=m4;xd.createRoot=VC.createRoot,xd.hydrateRoot=VC.hydrateRoot;/**
|
|
41
|
+
* @remix-run/router v1.23.2
|
|
42
|
+
*
|
|
43
|
+
* Copyright (c) Remix Software Inc.
|
|
44
|
+
*
|
|
45
|
+
* This source code is licensed under the MIT license found in the
|
|
46
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
47
|
+
*
|
|
48
|
+
* @license MIT
|
|
49
|
+
*/function su(){return su=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},su.apply(this,arguments)}var ri;(function(t){t.Pop="POP",t.Push="PUSH",t.Replace="REPLACE"})(ri||(ri={}));const GC="popstate";function y4(t){t===void 0&&(t={});function e(n,a){let{pathname:i,search:s,hash:o}=n.location;return k1("",{pathname:i,search:s,hash:o},a.state&&a.state.usr||null,a.state&&a.state.key||"default")}function r(n,a){return typeof a=="string"?a:Vd(a)}return b4(e,r,null,t)}function zt(t,e){if(t===!1||t===null||typeof t>"u")throw new Error(e)}function yE(t,e){if(!t){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function x4(){return Math.random().toString(36).substr(2,8)}function HC(t,e){return{usr:t.state,key:t.key,idx:e}}function k1(t,e,r,n){return r===void 0&&(r=null),su({pathname:typeof t=="string"?t:t.pathname,search:"",hash:""},typeof e=="string"?Ao(e):e,{state:r,key:e&&e.key||n||x4()})}function Vd(t){let{pathname:e="/",search:r="",hash:n=""}=t;return r&&r!=="?"&&(e+=r.charAt(0)==="?"?r:"?"+r),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function Ao(t){let e={};if(t){let r=t.indexOf("#");r>=0&&(e.hash=t.substr(r),t=t.substr(0,r));let n=t.indexOf("?");n>=0&&(e.search=t.substr(n),t=t.substr(0,n)),t&&(e.pathname=t)}return e}function b4(t,e,r,n){n===void 0&&(n={});let{window:a=document.defaultView,v5Compat:i=!1}=n,s=a.history,o=ri.Pop,l=null,u=c();u==null&&(u=0,s.replaceState(su({},s.state,{idx:u}),""));function c(){return(s.state||{idx:null}).idx}function d(){o=ri.Pop;let m=c(),g=m==null?null:m-u;u=m,l&&l({action:o,location:y.location,delta:g})}function f(m,g){o=ri.Push;let x=k1(y.location,m,g);r&&r(x,m),u=c()+1;let b=HC(x,u),w=y.createHref(x);try{s.pushState(b,"",w)}catch(E){if(E instanceof DOMException&&E.name==="DataCloneError")throw E;a.location.assign(w)}i&&l&&l({action:o,location:y.location,delta:1})}function v(m,g){o=ri.Replace;let x=k1(y.location,m,g);r&&r(x,m),u=c();let b=HC(x,u),w=y.createHref(x);s.replaceState(b,"",w),i&&l&&l({action:o,location:y.location,delta:0})}function p(m){let g=a.location.origin!=="null"?a.location.origin:a.location.href,x=typeof m=="string"?m:Vd(m);return x=x.replace(/ $/,"%20"),zt(g,"No window.location.(origin|href) available to create URL for href: "+x),new URL(x,g)}let y={get action(){return o},get location(){return t(a,s)},listen(m){if(l)throw new Error("A history only accepts one active listener");return a.addEventListener(GC,d),l=m,()=>{a.removeEventListener(GC,d),l=null}},createHref(m){return e(a,m)},createURL:p,encodeLocation(m){let g=p(m);return{pathname:g.pathname,search:g.search,hash:g.hash}},push:f,replace:v,go(m){return s.go(m)}};return y}var WC;(function(t){t.data="data",t.deferred="deferred",t.redirect="redirect",t.error="error"})(WC||(WC={}));function w4(t,e,r){return r===void 0&&(r="/"),E4(t,e,r,!1)}function E4(t,e,r,n){let a=typeof e=="string"?Ao(e):e,i=xE(a.pathname||"/",r);if(i==null)return null;let s=TO(t);S4(s);let o=null;for(let l=0;o==null&&l<s.length;++l){let u=j4(i);o=D4(s[l],u,n)}return o}function TO(t,e,r,n){e===void 0&&(e=[]),r===void 0&&(r=[]),n===void 0&&(n="");let a=(i,s,o)=>{let l={relativePath:o===void 0?i.path||"":o,caseSensitive:i.caseSensitive===!0,childrenIndex:s,route:i};l.relativePath.startsWith("/")&&(zt(l.relativePath.startsWith(n),'Absolute route path "'+l.relativePath+'" nested under path '+('"'+n+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),l.relativePath=l.relativePath.slice(n.length));let u=vi([n,l.relativePath]),c=r.concat(l);i.children&&i.children.length>0&&(zt(i.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),TO(i.children,e,c,u)),!(i.path==null&&!i.index)&&e.push({path:u,score:k4(u,i.index),routesMeta:c})};return t.forEach((i,s)=>{var o;if(i.path===""||!((o=i.path)!=null&&o.includes("?")))a(i,s);else for(let l of RO(i.path))a(i,s,l)}),e}function RO(t){let e=t.split("/");if(e.length===0)return[];let[r,...n]=e,a=r.endsWith("?"),i=r.replace(/\?$/,"");if(n.length===0)return a?[i,""]:[i];let s=RO(n.join("/")),o=[];return o.push(...s.map(l=>l===""?i:[i,l].join("/"))),a&&o.push(...s),o.map(l=>t.startsWith("/")&&l===""?"/":l)}function S4(t){t.sort((e,r)=>e.score!==r.score?r.score-e.score:L4(e.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}const C4=/^:[\w-]+$/,N4=3,T4=2,R4=1,P4=10,A4=-2,YC=t=>t==="*";function k4(t,e){let r=t.split("/"),n=r.length;return r.some(YC)&&(n+=A4),e&&(n+=T4),r.filter(a=>!YC(a)).reduce((a,i)=>a+(C4.test(i)?N4:i===""?R4:P4),n)}function L4(t,e){return t.length===e.length&&t.slice(0,-1).every((n,a)=>n===e[a])?t[t.length-1]-e[e.length-1]:0}function D4(t,e,r){r===void 0&&(r=!1);let{routesMeta:n}=t,a={},i="/",s=[];for(let o=0;o<n.length;++o){let l=n[o],u=o===n.length-1,c=i==="/"?e:e.slice(i.length)||"/",d=XC({path:l.relativePath,caseSensitive:l.caseSensitive,end:u},c),f=l.route;if(!d&&u&&r&&!n[n.length-1].route.index&&(d=XC({path:l.relativePath,caseSensitive:l.caseSensitive,end:!1},c)),!d)return null;Object.assign(a,d.params),s.push({params:a,pathname:vi([i,d.pathname]),pathnameBase:B4(vi([i,d.pathnameBase])),route:f}),d.pathnameBase!=="/"&&(i=vi([i,d.pathnameBase]))}return s}function XC(t,e){typeof t=="string"&&(t={path:t,caseSensitive:!1,end:!0});let[r,n]=_4(t.path,t.caseSensitive,t.end),a=e.match(r);if(!a)return null;let i=a[0],s=i.replace(/(.)\/+$/,"$1"),o=a.slice(1);return{params:n.reduce((u,c,d)=>{let{paramName:f,isOptional:v}=c;if(f==="*"){let y=o[d]||"";s=i.slice(0,i.length-y.length).replace(/(.)\/+$/,"$1")}const p=o[d];return v&&!p?u[f]=void 0:u[f]=(p||"").replace(/%2F/g,"/"),u},{}),pathname:i,pathnameBase:s,pattern:t}}function _4(t,e,r){e===void 0&&(e=!1),r===void 0&&(r=!0),yE(t==="*"||!t.endsWith("*")||t.endsWith("/*"),'Route path "'+t+'" will be treated as if it were '+('"'+t.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+t.replace(/\*$/,"/*")+'".'));let n=[],a="^"+t.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(s,o,l)=>(n.push({paramName:o,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)"));return t.endsWith("*")?(n.push({paramName:"*"}),a+=t==="*"||t==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?a+="\\/*$":t!==""&&t!=="/"&&(a+="(?:(?=\\/|$))"),[new RegExp(a,e?void 0:"i"),n]}function j4(t){try{return t.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(e){return yE(!1,'The URL path "'+t+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+e+").")),t}}function xE(t,e){if(e==="/")return t;if(!t.toLowerCase().startsWith(e.toLowerCase()))return null;let r=e.endsWith("/")?e.length-1:e.length,n=t.charAt(r);return n&&n!=="/"?null:t.slice(r)||"/"}const O4=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,M4=t=>O4.test(t);function I4(t,e){e===void 0&&(e="/");let{pathname:r,search:n="",hash:a=""}=typeof t=="string"?Ao(t):t,i;if(r)if(M4(r))i=r;else{if(r.includes("//")){let s=r;r=r.replace(/\/\/+/g,"/"),yE(!1,"Pathnames cannot have embedded double slashes - normalizing "+(s+" -> "+r))}r.startsWith("/")?i=KC(r.substring(1),"/"):i=KC(r,e)}else i=e;return{pathname:i,search:z4(n),hash:q4(a)}}function KC(t,e){let r=e.replace(/\/+$/,"").split("/");return t.split("/").forEach(a=>{a===".."?r.length>1&&r.pop():a!=="."&&r.push(a)}),r.length>1?r.join("/"):"/"}function dv(t,e,r,n){return"Cannot include a '"+t+"' character in a manually specified "+("`to."+e+"` field ["+JSON.stringify(n)+"]. Please separate it out to the ")+("`to."+r+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function F4(t){return t.filter((e,r)=>r===0||e.route.path&&e.route.path.length>0)}function bE(t,e){let r=F4(t);return e?r.map((n,a)=>a===r.length-1?n.pathname:n.pathnameBase):r.map(n=>n.pathnameBase)}function wE(t,e,r,n){n===void 0&&(n=!1);let a;typeof t=="string"?a=Ao(t):(a=su({},t),zt(!a.pathname||!a.pathname.includes("?"),dv("?","pathname","search",a)),zt(!a.pathname||!a.pathname.includes("#"),dv("#","pathname","hash",a)),zt(!a.search||!a.search.includes("#"),dv("#","search","hash",a)));let i=t===""||a.pathname==="",s=i?"/":a.pathname,o;if(s==null)o=r;else{let d=e.length-1;if(!n&&s.startsWith("..")){let f=s.split("/");for(;f[0]==="..";)f.shift(),d-=1;a.pathname=f.join("/")}o=d>=0?e[d]:"/"}let l=I4(a,o),u=s&&s!=="/"&&s.endsWith("/"),c=(i||s===".")&&r.endsWith("/");return!l.pathname.endsWith("/")&&(u||c)&&(l.pathname+="/"),l}const vi=t=>t.join("/").replace(/\/\/+/g,"/"),B4=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),z4=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,q4=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t;function U4(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}const PO=["post","put","patch","delete"];new Set(PO);const $4=["get",...PO];new Set($4);/**
|
|
50
|
+
* React Router v6.30.3
|
|
51
|
+
*
|
|
52
|
+
* Copyright (c) Remix Software Inc.
|
|
53
|
+
*
|
|
54
|
+
* This source code is licensed under the MIT license found in the
|
|
55
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
56
|
+
*
|
|
57
|
+
* @license MIT
|
|
58
|
+
*/function ou(){return ou=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},ou.apply(this,arguments)}const EE=U.createContext(null),V4=U.createContext(null),Ai=U.createContext(null),Bf=U.createContext(null),ca=U.createContext({outlet:null,matches:[],isDataRoute:!1}),AO=U.createContext(null);function G4(t,e){let{relative:r}=e===void 0?{}:e;ko()||zt(!1);let{basename:n,navigator:a}=U.useContext(Ai),{hash:i,pathname:s,search:o}=LO(t,{relative:r}),l=s;return n!=="/"&&(l=s==="/"?n:vi([n,s])),a.createHref({pathname:l,search:o,hash:i})}function ko(){return U.useContext(Bf)!=null}function Ia(){return ko()||zt(!1),U.useContext(Bf).location}function kO(t){U.useContext(Ai).static||U.useLayoutEffect(t)}function vn(){let{isDataRoute:t}=U.useContext(ca);return t?sU():H4()}function H4(){ko()||zt(!1);let t=U.useContext(EE),{basename:e,future:r,navigator:n}=U.useContext(Ai),{matches:a}=U.useContext(ca),{pathname:i}=Ia(),s=JSON.stringify(bE(a,r.v7_relativeSplatPath)),o=U.useRef(!1);return kO(()=>{o.current=!0}),U.useCallback(function(u,c){if(c===void 0&&(c={}),!o.current)return;if(typeof u=="number"){n.go(u);return}let d=wE(u,JSON.parse(s),i,c.relative==="path");t==null&&e!=="/"&&(d.pathname=d.pathname==="/"?e:vi([e,d.pathname])),(c.replace?n.replace:n.push)(d,c.state,c)},[e,n,s,i,t])}const W4=U.createContext(null);function Y4(t){let e=U.useContext(ca).outlet;return e&&U.createElement(W4.Provider,{value:t},e)}function ku(){let{matches:t}=U.useContext(ca),e=t[t.length-1];return e?e.params:{}}function LO(t,e){let{relative:r}=e===void 0?{}:e,{future:n}=U.useContext(Ai),{matches:a}=U.useContext(ca),{pathname:i}=Ia(),s=JSON.stringify(bE(a,n.v7_relativeSplatPath));return U.useMemo(()=>wE(t,JSON.parse(s),i,r==="path"),[t,s,i,r])}function X4(t,e){return K4(t,e)}function K4(t,e,r,n){ko()||zt(!1);let{navigator:a}=U.useContext(Ai),{matches:i}=U.useContext(ca),s=i[i.length-1],o=s?s.params:{};s&&s.pathname;let l=s?s.pathnameBase:"/";s&&s.route;let u=Ia(),c;if(e){var d;let m=typeof e=="string"?Ao(e):e;l==="/"||(d=m.pathname)!=null&&d.startsWith(l)||zt(!1),c=m}else c=u;let f=c.pathname||"/",v=f;if(l!=="/"){let m=l.replace(/^\//,"").split("/");v="/"+f.replace(/^\//,"").split("/").slice(m.length).join("/")}let p=w4(t,{pathname:v}),y=tU(p&&p.map(m=>Object.assign({},m,{params:Object.assign({},o,m.params),pathname:vi([l,a.encodeLocation?a.encodeLocation(m.pathname).pathname:m.pathname]),pathnameBase:m.pathnameBase==="/"?l:vi([l,a.encodeLocation?a.encodeLocation(m.pathnameBase).pathname:m.pathnameBase])})),i,r,n);return e&&y?U.createElement(Bf.Provider,{value:{location:ou({pathname:"/",search:"",hash:"",state:null,key:"default"},c),navigationType:ri.Pop}},y):y}function Q4(){let t=iU(),e=U4(t)?t.status+" "+t.statusText:t instanceof Error?t.message:JSON.stringify(t),r=t instanceof Error?t.stack:null,a={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"},i=null;return U.createElement(U.Fragment,null,U.createElement("h2",null,"Unexpected Application Error!"),U.createElement("h3",{style:{fontStyle:"italic"}},e),r?U.createElement("pre",{style:a},r):null,i)}const Z4=U.createElement(Q4,null);class J4 extends U.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,r){return r.location!==e.location||r.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:r.error,location:r.location,revalidation:e.revalidation||r.revalidation}}componentDidCatch(e,r){console.error("React Router caught the following error during render",e,r)}render(){return this.state.error!==void 0?U.createElement(ca.Provider,{value:this.props.routeContext},U.createElement(AO.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function eU(t){let{routeContext:e,match:r,children:n}=t,a=U.useContext(EE);return a&&a.static&&a.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=r.route.id),U.createElement(ca.Provider,{value:e},n)}function tU(t,e,r,n){var a;if(e===void 0&&(e=[]),r===void 0&&(r=null),n===void 0&&(n=null),t==null){var i;if(!r)return null;if(r.errors)t=r.matches;else if((i=n)!=null&&i.v7_partialHydration&&e.length===0&&!r.initialized&&r.matches.length>0)t=r.matches;else return null}let s=t,o=(a=r)==null?void 0:a.errors;if(o!=null){let c=s.findIndex(d=>d.route.id&&(o==null?void 0:o[d.route.id])!==void 0);c>=0||zt(!1),s=s.slice(0,Math.min(s.length,c+1))}let l=!1,u=-1;if(r&&n&&n.v7_partialHydration)for(let c=0;c<s.length;c++){let d=s[c];if((d.route.HydrateFallback||d.route.hydrateFallbackElement)&&(u=c),d.route.id){let{loaderData:f,errors:v}=r,p=d.route.loader&&f[d.route.id]===void 0&&(!v||v[d.route.id]===void 0);if(d.route.lazy||p){l=!0,u>=0?s=s.slice(0,u+1):s=[s[0]];break}}}return s.reduceRight((c,d,f)=>{let v,p=!1,y=null,m=null;r&&(v=o&&d.route.id?o[d.route.id]:void 0,y=d.route.errorElement||Z4,l&&(u<0&&f===0?(oU("route-fallback",!1),p=!0,m=null):u===f&&(p=!0,m=d.route.hydrateFallbackElement||null)));let g=e.concat(s.slice(0,f+1)),x=()=>{let b;return v?b=y:p?b=m:d.route.Component?b=U.createElement(d.route.Component,null):d.route.element?b=d.route.element:b=c,U.createElement(eU,{match:d,routeContext:{outlet:c,matches:g,isDataRoute:r!=null},children:b})};return r&&(d.route.ErrorBoundary||d.route.errorElement||f===0)?U.createElement(J4,{location:r.location,revalidation:r.revalidation,component:y,error:v,children:x(),routeContext:{outlet:null,matches:g,isDataRoute:!0}}):x()},null)}var DO=function(t){return t.UseBlocker="useBlocker",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t}(DO||{}),Gd=function(t){return t.UseBlocker="useBlocker",t.UseLoaderData="useLoaderData",t.UseActionData="useActionData",t.UseRouteError="useRouteError",t.UseNavigation="useNavigation",t.UseRouteLoaderData="useRouteLoaderData",t.UseMatches="useMatches",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t.UseRouteId="useRouteId",t}(Gd||{});function rU(t){let e=U.useContext(EE);return e||zt(!1),e}function nU(t){let e=U.useContext(V4);return e||zt(!1),e}function aU(t){let e=U.useContext(ca);return e||zt(!1),e}function _O(t){let e=aU(),r=e.matches[e.matches.length-1];return r.route.id||zt(!1),r.route.id}function iU(){var t;let e=U.useContext(AO),r=nU(Gd.UseRouteError),n=_O(Gd.UseRouteError);return e!==void 0?e:(t=r.errors)==null?void 0:t[n]}function sU(){let{router:t}=rU(DO.UseNavigateStable),e=_O(Gd.UseNavigateStable),r=U.useRef(!1);return kO(()=>{r.current=!0}),U.useCallback(function(a,i){i===void 0&&(i={}),r.current&&(typeof a=="number"?t.navigate(a):t.navigate(a,ou({fromRouteId:e},i)))},[t,e])}const QC={};function oU(t,e,r){!e&&!QC[t]&&(QC[t]=!0)}function lU(t,e){t==null||t.v7_startTransition,(t==null?void 0:t.v7_relativeSplatPath)===void 0&&(!e||e.v7_relativeSplatPath),e&&(e.v7_fetcherPersist,e.v7_normalizeFormMethod,e.v7_partialHydration,e.v7_skipActionErrorRevalidation)}function uU(t){let{to:e,replace:r,state:n,relative:a}=t;ko()||zt(!1);let{future:i,static:s}=U.useContext(Ai),{matches:o}=U.useContext(ca),{pathname:l}=Ia(),u=vn(),c=wE(e,bE(o,i.v7_relativeSplatPath),l,a==="path"),d=JSON.stringify(c);return U.useEffect(()=>u(JSON.parse(d),{replace:r,state:n,relative:a}),[u,d,a,r,n]),null}function cU(t){return Y4(t.context)}function rt(t){zt(!1)}function dU(t){let{basename:e="/",children:r=null,location:n,navigationType:a=ri.Pop,navigator:i,static:s=!1,future:o}=t;ko()&&zt(!1);let l=e.replace(/^\/*/,"/"),u=U.useMemo(()=>({basename:l,navigator:i,static:s,future:ou({v7_relativeSplatPath:!1},o)}),[l,o,i,s]);typeof n=="string"&&(n=Ao(n));let{pathname:c="/",search:d="",hash:f="",state:v=null,key:p="default"}=n,y=U.useMemo(()=>{let m=xE(c,l);return m==null?null:{location:{pathname:m,search:d,hash:f,state:v,key:p},navigationType:a}},[l,c,d,f,v,p,a]);return y==null?null:U.createElement(Ai.Provider,{value:u},U.createElement(Bf.Provider,{children:r,value:y}))}function fU(t){let{children:e,location:r}=t;return X4(L1(e),r)}new Promise(()=>{});function L1(t,e){e===void 0&&(e=[]);let r=[];return U.Children.forEach(t,(n,a)=>{if(!U.isValidElement(n))return;let i=[...e,a];if(n.type===U.Fragment){r.push.apply(r,L1(n.props.children,i));return}n.type!==rt&&zt(!1),!n.props.index||!n.props.children||zt(!1);let s={id:n.props.id||i.join("-"),caseSensitive:n.props.caseSensitive,element:n.props.element,Component:n.props.Component,index:n.props.index,path:n.props.path,loader:n.props.loader,action:n.props.action,errorElement:n.props.errorElement,ErrorBoundary:n.props.ErrorBoundary,hasErrorBoundary:n.props.ErrorBoundary!=null||n.props.errorElement!=null,shouldRevalidate:n.props.shouldRevalidate,handle:n.props.handle,lazy:n.props.lazy};n.props.children&&(s.children=L1(n.props.children,i)),r.push(s)}),r}/**
|
|
59
|
+
* React Router DOM v6.30.3
|
|
60
|
+
*
|
|
61
|
+
* Copyright (c) Remix Software Inc.
|
|
62
|
+
*
|
|
63
|
+
* This source code is licensed under the MIT license found in the
|
|
64
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
65
|
+
*
|
|
66
|
+
* @license MIT
|
|
67
|
+
*/function D1(){return D1=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},D1.apply(this,arguments)}function hU(t,e){if(t==null)return{};var r={},n=Object.keys(t),a,i;for(i=0;i<n.length;i++)a=n[i],!(e.indexOf(a)>=0)&&(r[a]=t[a]);return r}function vU(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function pU(t,e){return t.button===0&&(!e||e==="_self")&&!vU(t)}function _1(t){return t===void 0&&(t=""),new URLSearchParams(typeof t=="string"||Array.isArray(t)||t instanceof URLSearchParams?t:Object.keys(t).reduce((e,r)=>{let n=t[r];return e.concat(Array.isArray(n)?n.map(a=>[r,a]):[[r,n]])},[]))}function gU(t,e){let r=_1(t);return e&&e.forEach((n,a)=>{r.has(a)||e.getAll(a).forEach(i=>{r.append(a,i)})}),r}const mU=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],yU="6";try{window.__reactRouterVersion=yU}catch{}const xU="startTransition",ZC=sz[xU];function JC(t){let{basename:e,children:r,future:n,window:a}=t,i=U.useRef();i.current==null&&(i.current=y4({window:a,v5Compat:!0}));let s=i.current,[o,l]=U.useState({action:s.action,location:s.location}),{v7_startTransition:u}=n||{},c=U.useCallback(d=>{u&&ZC?ZC(()=>l(d)):l(d)},[l,u]);return U.useLayoutEffect(()=>s.listen(c),[s,c]),U.useEffect(()=>lU(n),[n]),U.createElement(dU,{basename:e,children:r,location:o.location,navigationType:o.action,navigator:s,future:n})}const bU=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",wU=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ze=U.forwardRef(function(e,r){let{onClick:n,relative:a,reloadDocument:i,replace:s,state:o,target:l,to:u,preventScrollReset:c,viewTransition:d}=e,f=hU(e,mU),{basename:v}=U.useContext(Ai),p,y=!1;if(typeof u=="string"&&wU.test(u)&&(p=u,bU))try{let b=new URL(window.location.href),w=u.startsWith("//")?new URL(b.protocol+u):new URL(u),E=xE(w.pathname,v);w.origin===b.origin&&E!=null?u=E+w.search+w.hash:y=!0}catch{}let m=G4(u,{relative:a}),g=EU(u,{replace:s,state:o,target:l,preventScrollReset:c,relative:a,viewTransition:d});function x(b){n&&n(b),b.defaultPrevented||g(b)}return U.createElement("a",D1({},f,{href:p||m,onClick:y||i?n:x,ref:r,target:l}))});var eN;(function(t){t.UseScrollRestoration="useScrollRestoration",t.UseSubmit="useSubmit",t.UseSubmitFetcher="useSubmitFetcher",t.UseFetcher="useFetcher",t.useViewTransitionState="useViewTransitionState"})(eN||(eN={}));var tN;(function(t){t.UseFetcher="useFetcher",t.UseFetchers="useFetchers",t.UseScrollRestoration="useScrollRestoration"})(tN||(tN={}));function EU(t,e){let{target:r,replace:n,state:a,preventScrollReset:i,relative:s,viewTransition:o}=e===void 0?{}:e,l=vn(),u=Ia(),c=LO(t,{relative:s});return U.useCallback(d=>{if(pU(d,r)){d.preventDefault();let f=n!==void 0?n:Vd(u)===Vd(c);l(t,{replace:f,state:a,preventScrollReset:i,relative:s,viewTransition:o})}},[u,l,c,n,a,r,t,i,s,o])}function jO(t){let e=U.useRef(_1(t)),r=U.useRef(!1),n=Ia(),a=U.useMemo(()=>gU(n.search,r.current?null:e.current),[n.search]),i=vn(),s=U.useCallback((o,l)=>{const u=_1(typeof o=="function"?o(a):o);r.current=!0,i("?"+u,l)},[i,a]);return[a,s]}var SU={};/**
|
|
68
|
+
* @license React
|
|
69
|
+
* use-sync-external-store-with-selector.production.js
|
|
70
|
+
*
|
|
71
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
72
|
+
*
|
|
73
|
+
* This source code is licensed under the MIT license found in the
|
|
74
|
+
* LICENSE file in the root directory of this source tree.
|
|
75
|
+
*/var Lu=U;function CU(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var NU=typeof Object.is=="function"?Object.is:CU,TU=Lu.useSyncExternalStore,RU=Lu.useRef,PU=Lu.useEffect,AU=Lu.useMemo,kU=Lu.useDebugValue;SU.useSyncExternalStoreWithSelector=function(t,e,r,n,a){var i=RU(null);if(i.current===null){var s={hasValue:!1,value:null};i.current=s}else s=i.current;i=AU(function(){function l(v){if(!u){if(u=!0,c=v,v=n(v),a!==void 0&&s.hasValue){var p=s.value;if(a(p,v))return d=p}return d=v}if(p=d,NU(c,v))return p;var y=n(v);return a!==void 0&&a(p,y)?(c=v,p):(c=v,d=y)}var u=!1,c,d,f=r===void 0?null:r;return[function(){return l(e())},f===null?void 0:function(){return l(f())}]},[e,r,n,a]);var o=TU(t,i[0],i[1]);return PU(function(){s.hasValue=!0,s.value=o},[o]),kU(o),o};function LU(t){t()}function DU(){let t=null,e=null;return{clear(){t=null,e=null},notify(){LU(()=>{let r=t;for(;r;)r.callback(),r=r.next})},get(){const r=[];let n=t;for(;n;)r.push(n),n=n.next;return r},subscribe(r){let n=!0;const a=e={callback:r,next:null,prev:e};return a.prev?a.prev.next=a:t=a,function(){!n||t===null||(n=!1,a.next?a.next.prev=a.prev:e=a.prev,a.prev?a.prev.next=a.next:t=a.next)}}}}var rN={notify(){},get:()=>[]};function _U(t,e){let r,n=rN,a=0,i=!1;function s(y){c();const m=n.subscribe(y);let g=!1;return()=>{g||(g=!0,m(),d())}}function o(){n.notify()}function l(){p.onStateChange&&p.onStateChange()}function u(){return i}function c(){a++,r||(r=e?e.addNestedSub(l):t.subscribe(l),n=DU())}function d(){a--,r&&a===0&&(r(),r=void 0,n.clear(),n=rN)}function f(){i||(i=!0,c())}function v(){i&&(i=!1,d())}const p={addNestedSub:s,notifyNestedSubs:o,handleChangeWrapper:l,isSubscribed:u,trySubscribe:f,tryUnsubscribe:v,getListeners:()=>n};return p}var jU=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",OU=jU(),MU=()=>typeof navigator<"u"&&navigator.product==="ReactNative",IU=MU(),FU=()=>OU||IU?U.useLayoutEffect:U.useEffect,BU=FU(),fv=Symbol.for("react-redux-context"),hv=typeof globalThis<"u"?globalThis:{};function zU(){if(!U.createContext)return{};const t=hv[fv]??(hv[fv]=new Map);let e=t.get(U.createContext);return e||(e=U.createContext(null),t.set(U.createContext,e)),e}var qU=zU();function UU(t){const{children:e,context:r,serverState:n,store:a}=t,i=U.useMemo(()=>{const l=_U(a);return{store:a,subscription:l,getServerState:n?()=>n:void 0}},[a,n]),s=U.useMemo(()=>a.getState(),[a]);BU(()=>{const{subscription:l}=i;return l.onStateChange=l.notifyNestedSubs,l.trySubscribe(),s!==a.getState()&&l.notifyNestedSubs(),()=>{l.tryUnsubscribe(),l.onStateChange=void 0}},[i,s]);const o=r||qU;return U.createElement(o.Provider,{value:i},e)}var $U=UU;function OO(t,e){return function(){return t.apply(e,arguments)}}const{toString:VU}=Object.prototype,{getPrototypeOf:SE}=Object,{iterator:zf,toStringTag:MO}=Symbol,qf=(t=>e=>{const r=VU.call(e);return t[r]||(t[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),Kn=t=>(t=t.toLowerCase(),e=>qf(e)===t),Uf=t=>e=>typeof e===t,{isArray:Lo}=Array,wo=Uf("undefined");function Du(t){return t!==null&&!wo(t)&&t.constructor!==null&&!wo(t.constructor)&&Jr(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const IO=Kn("ArrayBuffer");function GU(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&IO(t.buffer),e}const HU=Uf("string"),Jr=Uf("function"),FO=Uf("number"),_u=t=>t!==null&&typeof t=="object",WU=t=>t===!0||t===!1,td=t=>{if(qf(t)!=="object")return!1;const e=SE(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(MO in t)&&!(zf in t)},YU=t=>{if(!_u(t)||Du(t))return!1;try{return Object.keys(t).length===0&&Object.getPrototypeOf(t)===Object.prototype}catch{return!1}},XU=Kn("Date"),KU=Kn("File"),QU=t=>!!(t&&typeof t.uri<"u"),ZU=t=>t&&typeof t.getParts<"u",JU=Kn("Blob"),e3=Kn("FileList"),t3=t=>_u(t)&&Jr(t.pipe);function r3(){return typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}}const nN=r3(),aN=typeof nN.FormData<"u"?nN.FormData:void 0,n3=t=>{let e;return t&&(aN&&t instanceof aN||Jr(t.append)&&((e=qf(t))==="formdata"||e==="object"&&Jr(t.toString)&&t.toString()==="[object FormData]"))},a3=Kn("URLSearchParams"),[i3,s3,o3,l3]=["ReadableStream","Request","Response","Headers"].map(Kn),u3=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function ju(t,e,{allOwnKeys:r=!1}={}){if(t===null||typeof t>"u")return;let n,a;if(typeof t!="object"&&(t=[t]),Lo(t))for(n=0,a=t.length;n<a;n++)e.call(null,t[n],n,t);else{if(Du(t))return;const i=r?Object.getOwnPropertyNames(t):Object.keys(t),s=i.length;let o;for(n=0;n<s;n++)o=i[n],e.call(null,t[o],o,t)}}function BO(t,e){if(Du(t))return null;e=e.toLowerCase();const r=Object.keys(t);let n=r.length,a;for(;n-- >0;)if(a=r[n],e===a.toLowerCase())return a;return null}const Zi=(()=>typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global)(),zO=t=>!wo(t)&&t!==Zi;function j1(){const{caseless:t,skipUndefined:e}=zO(this)&&this||{},r={},n=(a,i)=>{if(i==="__proto__"||i==="constructor"||i==="prototype")return;const s=t&&BO(r,i)||i;td(r[s])&&td(a)?r[s]=j1(r[s],a):td(a)?r[s]=j1({},a):Lo(a)?r[s]=a.slice():(!e||!wo(a))&&(r[s]=a)};for(let a=0,i=arguments.length;a<i;a++)arguments[a]&&ju(arguments[a],n);return r}const c3=(t,e,r,{allOwnKeys:n}={})=>(ju(e,(a,i)=>{r&&Jr(a)?Object.defineProperty(t,i,{value:OO(a,r),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(t,i,{value:a,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:n}),t),d3=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),f3=(t,e,r,n)=>{t.prototype=Object.create(e.prototype,n),Object.defineProperty(t.prototype,"constructor",{value:t,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(t,"super",{value:e.prototype}),r&&Object.assign(t.prototype,r)},h3=(t,e,r,n)=>{let a,i,s;const o={};if(e=e||{},t==null)return e;do{for(a=Object.getOwnPropertyNames(t),i=a.length;i-- >0;)s=a[i],(!n||n(s,t,e))&&!o[s]&&(e[s]=t[s],o[s]=!0);t=r!==!1&&SE(t)}while(t&&(!r||r(t,e))&&t!==Object.prototype);return e},v3=(t,e,r)=>{t=String(t),(r===void 0||r>t.length)&&(r=t.length),r-=e.length;const n=t.indexOf(e,r);return n!==-1&&n===r},p3=t=>{if(!t)return null;if(Lo(t))return t;let e=t.length;if(!FO(e))return null;const r=new Array(e);for(;e-- >0;)r[e]=t[e];return r},g3=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&SE(Uint8Array)),m3=(t,e)=>{const n=(t&&t[zf]).call(t);let a;for(;(a=n.next())&&!a.done;){const i=a.value;e.call(t,i[0],i[1])}},y3=(t,e)=>{let r;const n=[];for(;(r=t.exec(e))!==null;)n.push(r);return n},x3=Kn("HTMLFormElement"),b3=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,n,a){return n.toUpperCase()+a}),iN=(({hasOwnProperty:t})=>(e,r)=>t.call(e,r))(Object.prototype),w3=Kn("RegExp"),qO=(t,e)=>{const r=Object.getOwnPropertyDescriptors(t),n={};ju(r,(a,i)=>{let s;(s=e(a,i,t))!==!1&&(n[i]=s||a)}),Object.defineProperties(t,n)},E3=t=>{qO(t,(e,r)=>{if(Jr(t)&&["arguments","caller","callee"].indexOf(r)!==-1)return!1;const n=t[r];if(Jr(n)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},S3=(t,e)=>{const r={},n=a=>{a.forEach(i=>{r[i]=!0})};return Lo(t)?n(t):n(String(t).split(e)),r},C3=()=>{},N3=(t,e)=>t!=null&&Number.isFinite(t=+t)?t:e;function T3(t){return!!(t&&Jr(t.append)&&t[MO]==="FormData"&&t[zf])}const R3=t=>{const e=new Array(10),r=(n,a)=>{if(_u(n)){if(e.indexOf(n)>=0)return;if(Du(n))return n;if(!("toJSON"in n)){e[a]=n;const i=Lo(n)?[]:{};return ju(n,(s,o)=>{const l=r(s,a+1);!wo(l)&&(i[o]=l)}),e[a]=void 0,i}}return n};return r(t,0)},P3=Kn("AsyncFunction"),A3=t=>t&&(_u(t)||Jr(t))&&Jr(t.then)&&Jr(t.catch),UO=((t,e)=>t?setImmediate:e?((r,n)=>(Zi.addEventListener("message",({source:a,data:i})=>{a===Zi&&i===r&&n.length&&n.shift()()},!1),a=>{n.push(a),Zi.postMessage(r,"*")}))(`axios@${Math.random()}`,[]):r=>setTimeout(r))(typeof setImmediate=="function",Jr(Zi.postMessage)),k3=typeof queueMicrotask<"u"?queueMicrotask.bind(Zi):typeof process<"u"&&process.nextTick||UO,L3=t=>t!=null&&Jr(t[zf]),ce={isArray:Lo,isArrayBuffer:IO,isBuffer:Du,isFormData:n3,isArrayBufferView:GU,isString:HU,isNumber:FO,isBoolean:WU,isObject:_u,isPlainObject:td,isEmptyObject:YU,isReadableStream:i3,isRequest:s3,isResponse:o3,isHeaders:l3,isUndefined:wo,isDate:XU,isFile:KU,isReactNativeBlob:QU,isReactNative:ZU,isBlob:JU,isRegExp:w3,isFunction:Jr,isStream:t3,isURLSearchParams:a3,isTypedArray:g3,isFileList:e3,forEach:ju,merge:j1,extend:c3,trim:u3,stripBOM:d3,inherits:f3,toFlatObject:h3,kindOf:qf,kindOfTest:Kn,endsWith:v3,toArray:p3,forEachEntry:m3,matchAll:y3,isHTMLForm:x3,hasOwnProperty:iN,hasOwnProp:iN,reduceDescriptors:qO,freezeMethods:E3,toObjectSet:S3,toCamelCase:b3,noop:C3,toFiniteNumber:N3,findKey:BO,global:Zi,isContextDefined:zO,isSpecCompliantForm:T3,toJSONObject:R3,isAsyncFn:P3,isThenable:A3,setImmediate:UO,asap:k3,isIterable:L3};class qr extends Error{static from(e,r,n,a,i,s){const o=new qr(e.message,r||e.code,n,a,i);return o.cause=e,o.name=e.name,e.status!=null&&o.status==null&&(o.status=e.status),s&&Object.assign(o,s),o}constructor(e,r,n,a,i){super(e),Object.defineProperty(this,"message",{value:e,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,r&&(this.code=r),n&&(this.config=n),a&&(this.request=a),i&&(this.response=i,this.status=i.status)}toJSON(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:ce.toJSONObject(this.config),code:this.code,status:this.status}}}qr.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE";qr.ERR_BAD_OPTION="ERR_BAD_OPTION";qr.ECONNABORTED="ECONNABORTED";qr.ETIMEDOUT="ETIMEDOUT";qr.ERR_NETWORK="ERR_NETWORK";qr.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS";qr.ERR_DEPRECATED="ERR_DEPRECATED";qr.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE";qr.ERR_BAD_REQUEST="ERR_BAD_REQUEST";qr.ERR_CANCELED="ERR_CANCELED";qr.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT";qr.ERR_INVALID_URL="ERR_INVALID_URL";const et=qr,D3=null;function O1(t){return ce.isPlainObject(t)||ce.isArray(t)}function $O(t){return ce.endsWith(t,"[]")?t.slice(0,-2):t}function vv(t,e,r){return t?t.concat(e).map(function(a,i){return a=$O(a),!r&&i?"["+a+"]":a}).join(r?".":""):e}function _3(t){return ce.isArray(t)&&!t.some(O1)}const j3=ce.toFlatObject(ce,{},null,function(e){return/^is[A-Z]/.test(e)});function $f(t,e,r){if(!ce.isObject(t))throw new TypeError("target must be an object");e=e||new FormData,r=ce.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(y,m){return!ce.isUndefined(m[y])});const n=r.metaTokens,a=r.visitor||c,i=r.dots,s=r.indexes,l=(r.Blob||typeof Blob<"u"&&Blob)&&ce.isSpecCompliantForm(e);if(!ce.isFunction(a))throw new TypeError("visitor must be a function");function u(p){if(p===null)return"";if(ce.isDate(p))return p.toISOString();if(ce.isBoolean(p))return p.toString();if(!l&&ce.isBlob(p))throw new et("Blob is not supported. Use a Buffer instead.");return ce.isArrayBuffer(p)||ce.isTypedArray(p)?l&&typeof Blob=="function"?new Blob([p]):Buffer.from(p):p}function c(p,y,m){let g=p;if(ce.isReactNative(e)&&ce.isReactNativeBlob(p))return e.append(vv(m,y,i),u(p)),!1;if(p&&!m&&typeof p=="object"){if(ce.endsWith(y,"{}"))y=n?y:y.slice(0,-2),p=JSON.stringify(p);else if(ce.isArray(p)&&_3(p)||(ce.isFileList(p)||ce.endsWith(y,"[]"))&&(g=ce.toArray(p)))return y=$O(y),g.forEach(function(b,w){!(ce.isUndefined(b)||b===null)&&e.append(s===!0?vv([y],w,i):s===null?y:y+"[]",u(b))}),!1}return O1(p)?!0:(e.append(vv(m,y,i),u(p)),!1)}const d=[],f=Object.assign(j3,{defaultVisitor:c,convertValue:u,isVisitable:O1});function v(p,y){if(!ce.isUndefined(p)){if(d.indexOf(p)!==-1)throw Error("Circular reference detected in "+y.join("."));d.push(p),ce.forEach(p,function(g,x){(!(ce.isUndefined(g)||g===null)&&a.call(e,g,ce.isString(x)?x.trim():x,y,f))===!0&&v(g,y?y.concat(x):[x])}),d.pop()}}if(!ce.isObject(t))throw new TypeError("data must be an object");return v(t),e}function sN(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(n){return e[n]})}function CE(t,e){this._pairs=[],t&&$f(t,this,e)}const VO=CE.prototype;VO.append=function(e,r){this._pairs.push([e,r])};VO.toString=function(e){const r=e?function(n){return e.call(this,n,sN)}:sN;return this._pairs.map(function(a){return r(a[0])+"="+r(a[1])},"").join("&")};function O3(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function GO(t,e,r){if(!e)return t;const n=r&&r.encode||O3,a=ce.isFunction(r)?{serialize:r}:r,i=a&&a.serialize;let s;if(i?s=i(e,a):s=ce.isURLSearchParams(e)?e.toString():new CE(e,a).toString(n),s){const o=t.indexOf("#");o!==-1&&(t=t.slice(0,o)),t+=(t.indexOf("?")===-1?"?":"&")+s}return t}class M3{constructor(){this.handlers=[]}use(e,r,n){return this.handlers.push({fulfilled:e,rejected:r,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){ce.forEach(this.handlers,function(n){n!==null&&e(n)})}}const oN=M3,NE={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0},I3=typeof URLSearchParams<"u"?URLSearchParams:CE,F3=typeof FormData<"u"?FormData:null,B3=typeof Blob<"u"?Blob:null,z3={isBrowser:!0,classes:{URLSearchParams:I3,FormData:F3,Blob:B3},protocols:["http","https","file","blob","url","data"]},TE=typeof window<"u"&&typeof document<"u",M1=typeof navigator=="object"&&navigator||void 0,q3=TE&&(!M1||["ReactNative","NativeScript","NS"].indexOf(M1.product)<0),U3=(()=>typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function")(),$3=TE&&window.location.href||"http://localhost",V3=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:TE,hasStandardBrowserEnv:q3,hasStandardBrowserWebWorkerEnv:U3,navigator:M1,origin:$3},Symbol.toStringTag,{value:"Module"})),Cr={...V3,...z3};function G3(t,e){return $f(t,new Cr.classes.URLSearchParams,{visitor:function(r,n,a,i){return Cr.isNode&&ce.isBuffer(r)?(this.append(n,r.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)},...e})}function H3(t){return ce.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function W3(t){const e={},r=Object.keys(t);let n;const a=r.length;let i;for(n=0;n<a;n++)i=r[n],e[i]=t[i];return e}function HO(t){function e(r,n,a,i){let s=r[i++];if(s==="__proto__")return!0;const o=Number.isFinite(+s),l=i>=r.length;return s=!s&&ce.isArray(a)?a.length:s,l?(ce.hasOwnProp(a,s)?a[s]=[a[s],n]:a[s]=n,!o):((!a[s]||!ce.isObject(a[s]))&&(a[s]=[]),e(r,n,a[s],i)&&ce.isArray(a[s])&&(a[s]=W3(a[s])),!o)}if(ce.isFormData(t)&&ce.isFunction(t.entries)){const r={};return ce.forEachEntry(t,(n,a)=>{e(H3(n),a,r,0)}),r}return null}function Y3(t,e,r){if(ce.isString(t))try{return(e||JSON.parse)(t),ce.trim(t)}catch(n){if(n.name!=="SyntaxError")throw n}return(r||JSON.stringify)(t)}const RE={transitional:NE,adapter:["xhr","http","fetch"],transformRequest:[function(e,r){const n=r.getContentType()||"",a=n.indexOf("application/json")>-1,i=ce.isObject(e);if(i&&ce.isHTMLForm(e)&&(e=new FormData(e)),ce.isFormData(e))return a?JSON.stringify(HO(e)):e;if(ce.isArrayBuffer(e)||ce.isBuffer(e)||ce.isStream(e)||ce.isFile(e)||ce.isBlob(e)||ce.isReadableStream(e))return e;if(ce.isArrayBufferView(e))return e.buffer;if(ce.isURLSearchParams(e))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let o;if(i){if(n.indexOf("application/x-www-form-urlencoded")>-1)return G3(e,this.formSerializer).toString();if((o=ce.isFileList(e))||n.indexOf("multipart/form-data")>-1){const l=this.env&&this.env.FormData;return $f(o?{"files[]":e}:e,l&&new l,this.formSerializer)}}return i||a?(r.setContentType("application/json",!1),Y3(e)):e}],transformResponse:[function(e){const r=this.transitional||RE.transitional,n=r&&r.forcedJSONParsing,a=this.responseType==="json";if(ce.isResponse(e)||ce.isReadableStream(e))return e;if(e&&ce.isString(e)&&(n&&!this.responseType||a)){const s=!(r&&r.silentJSONParsing)&&a;try{return JSON.parse(e,this.parseReviver)}catch(o){if(s)throw o.name==="SyntaxError"?et.from(o,et.ERR_BAD_RESPONSE,this,null,this.response):o}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Cr.classes.FormData,Blob:Cr.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};ce.forEach(["delete","get","head","post","put","patch"],t=>{RE.headers[t]={}});const PE=RE,X3=ce.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),K3=t=>{const e={};let r,n,a;return t&&t.split(`
|
|
76
|
+
`).forEach(function(s){a=s.indexOf(":"),r=s.substring(0,a).trim().toLowerCase(),n=s.substring(a+1).trim(),!(!r||e[r]&&X3[r])&&(r==="set-cookie"?e[r]?e[r].push(n):e[r]=[n]:e[r]=e[r]?e[r]+", "+n:n)}),e},lN=Symbol("internals");function nl(t){return t&&String(t).trim().toLowerCase()}function rd(t){return t===!1||t==null?t:ce.isArray(t)?t.map(rd):String(t).replace(/[\r\n]+$/,"")}function Q3(t){const e=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=r.exec(t);)e[n[1]]=n[2];return e}const Z3=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function pv(t,e,r,n,a){if(ce.isFunction(n))return n.call(this,e,r);if(a&&(e=r),!!ce.isString(e)){if(ce.isString(n))return e.indexOf(n)!==-1;if(ce.isRegExp(n))return n.test(e)}}function J3(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,r,n)=>r.toUpperCase()+n)}function e5(t,e){const r=ce.toCamelCase(" "+e);["get","set","has"].forEach(n=>{Object.defineProperty(t,n+r,{value:function(a,i,s){return this[n].call(this,e,a,i,s)},configurable:!0})})}class Vf{constructor(e){e&&this.set(e)}set(e,r,n){const a=this;function i(o,l,u){const c=nl(l);if(!c)throw new Error("header name must be a non-empty string");const d=ce.findKey(a,c);(!d||a[d]===void 0||u===!0||u===void 0&&a[d]!==!1)&&(a[d||l]=rd(o))}const s=(o,l)=>ce.forEach(o,(u,c)=>i(u,c,l));if(ce.isPlainObject(e)||e instanceof this.constructor)s(e,r);else if(ce.isString(e)&&(e=e.trim())&&!Z3(e))s(K3(e),r);else if(ce.isObject(e)&&ce.isIterable(e)){let o={},l,u;for(const c of e){if(!ce.isArray(c))throw TypeError("Object iterator must return a key-value pair");o[u=c[0]]=(l=o[u])?ce.isArray(l)?[...l,c[1]]:[l,c[1]]:c[1]}s(o,r)}else e!=null&&i(r,e,n);return this}get(e,r){if(e=nl(e),e){const n=ce.findKey(this,e);if(n){const a=this[n];if(!r)return a;if(r===!0)return Q3(a);if(ce.isFunction(r))return r.call(this,a,n);if(ce.isRegExp(r))return r.exec(a);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,r){if(e=nl(e),e){const n=ce.findKey(this,e);return!!(n&&this[n]!==void 0&&(!r||pv(this,this[n],n,r)))}return!1}delete(e,r){const n=this;let a=!1;function i(s){if(s=nl(s),s){const o=ce.findKey(n,s);o&&(!r||pv(n,n[o],o,r))&&(delete n[o],a=!0)}}return ce.isArray(e)?e.forEach(i):i(e),a}clear(e){const r=Object.keys(this);let n=r.length,a=!1;for(;n--;){const i=r[n];(!e||pv(this,this[i],i,e,!0))&&(delete this[i],a=!0)}return a}normalize(e){const r=this,n={};return ce.forEach(this,(a,i)=>{const s=ce.findKey(n,i);if(s){r[s]=rd(a),delete r[i];return}const o=e?J3(i):String(i).trim();o!==i&&delete r[i],r[o]=rd(a),n[o]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const r=Object.create(null);return ce.forEach(this,(n,a)=>{n!=null&&n!==!1&&(r[a]=e&&ce.isArray(n)?n.join(", "):n)}),r}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,r])=>e+": "+r).join(`
|
|
77
|
+
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...r){const n=new this(e);return r.forEach(a=>n.set(a)),n}static accessor(e){const n=(this[lN]=this[lN]={accessors:{}}).accessors,a=this.prototype;function i(s){const o=nl(s);n[o]||(e5(a,s),n[o]=!0)}return ce.isArray(e)?e.forEach(i):i(e),this}}Vf.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);ce.reduceDescriptors(Vf.prototype,({value:t},e)=>{let r=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(n){this[r]=n}}});ce.freezeMethods(Vf);const $n=Vf;function gv(t,e){const r=this||PE,n=e||r,a=$n.from(n.headers);let i=n.data;return ce.forEach(t,function(o){i=o.call(r,i,a.normalize(),e?e.status:void 0)}),a.normalize(),i}function WO(t){return!!(t&&t.__CANCEL__)}class t5 extends et{constructor(e,r,n){super(e??"canceled",et.ERR_CANCELED,r,n),this.name="CanceledError",this.__CANCEL__=!0}}const Ou=t5;function YO(t,e,r){const n=r.config.validateStatus;!r.status||!n||n(r.status)?t(r):e(new et("Request failed with status code "+r.status,[et.ERR_BAD_REQUEST,et.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}function r5(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function n5(t,e){t=t||10;const r=new Array(t),n=new Array(t);let a=0,i=0,s;return e=e!==void 0?e:1e3,function(l){const u=Date.now(),c=n[i];s||(s=u),r[a]=l,n[a]=u;let d=i,f=0;for(;d!==a;)f+=r[d++],d=d%t;if(a=(a+1)%t,a===i&&(i=(i+1)%t),u-s<e)return;const v=c&&u-c;return v?Math.round(f*1e3/v):void 0}}function a5(t,e){let r=0,n=1e3/e,a,i;const s=(u,c=Date.now())=>{r=c,a=null,i&&(clearTimeout(i),i=null),t(...u)};return[(...u)=>{const c=Date.now(),d=c-r;d>=n?s(u,c):(a=u,i||(i=setTimeout(()=>{i=null,s(a)},n-d)))},()=>a&&s(a)]}const Hd=(t,e,r=3)=>{let n=0;const a=n5(50,250);return a5(i=>{const s=i.loaded,o=i.lengthComputable?i.total:void 0,l=s-n,u=a(l),c=s<=o;n=s;const d={loaded:s,total:o,progress:o?s/o:void 0,bytes:l,rate:u||void 0,estimated:u&&o&&c?(o-s)/u:void 0,event:i,lengthComputable:o!=null,[e?"download":"upload"]:!0};t(d)},r)},uN=(t,e)=>{const r=t!=null;return[n=>e[0]({lengthComputable:r,total:t,loaded:n}),e[1]]},cN=t=>(...e)=>ce.asap(()=>t(...e)),i5=Cr.hasStandardBrowserEnv?((t,e)=>r=>(r=new URL(r,Cr.origin),t.protocol===r.protocol&&t.host===r.host&&(e||t.port===r.port)))(new URL(Cr.origin),Cr.navigator&&/(msie|trident)/i.test(Cr.navigator.userAgent)):()=>!0,s5=Cr.hasStandardBrowserEnv?{write(t,e,r,n,a,i,s){if(typeof document>"u")return;const o=[`${t}=${encodeURIComponent(e)}`];ce.isNumber(r)&&o.push(`expires=${new Date(r).toUTCString()}`),ce.isString(n)&&o.push(`path=${n}`),ce.isString(a)&&o.push(`domain=${a}`),i===!0&&o.push("secure"),ce.isString(s)&&o.push(`SameSite=${s}`),document.cookie=o.join("; ")},read(t){if(typeof document>"u")return null;const e=document.cookie.match(new RegExp("(?:^|; )"+t+"=([^;]*)"));return e?decodeURIComponent(e[1]):null},remove(t){this.write(t,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function o5(t){return typeof t!="string"?!1:/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function l5(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}function XO(t,e,r){let n=!o5(e);return t&&(n||r==!1)?l5(t,e):e}const dN=t=>t instanceof $n?{...t}:t;function ls(t,e){e=e||{};const r={};function n(u,c,d,f){return ce.isPlainObject(u)&&ce.isPlainObject(c)?ce.merge.call({caseless:f},u,c):ce.isPlainObject(c)?ce.merge({},c):ce.isArray(c)?c.slice():c}function a(u,c,d,f){if(ce.isUndefined(c)){if(!ce.isUndefined(u))return n(void 0,u,d,f)}else return n(u,c,d,f)}function i(u,c){if(!ce.isUndefined(c))return n(void 0,c)}function s(u,c){if(ce.isUndefined(c)){if(!ce.isUndefined(u))return n(void 0,u)}else return n(void 0,c)}function o(u,c,d){if(d in e)return n(u,c);if(d in t)return n(void 0,u)}const l={url:i,method:i,data:i,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:o,headers:(u,c,d)=>a(dN(u),dN(c),d,!0)};return ce.forEach(Object.keys({...t,...e}),function(c){if(c==="__proto__"||c==="constructor"||c==="prototype")return;const d=ce.hasOwnProp(l,c)?l[c]:a,f=d(t[c],e[c],c);ce.isUndefined(f)&&d!==o||(r[c]=f)}),r}const KO=t=>{const e=ls({},t);let{data:r,withXSRFToken:n,xsrfHeaderName:a,xsrfCookieName:i,headers:s,auth:o}=e;if(e.headers=s=$n.from(s),e.url=GO(XO(e.baseURL,e.url,e.allowAbsoluteUrls),t.params,t.paramsSerializer),o&&s.set("Authorization","Basic "+btoa((o.username||"")+":"+(o.password?unescape(encodeURIComponent(o.password)):""))),ce.isFormData(r)){if(Cr.hasStandardBrowserEnv||Cr.hasStandardBrowserWebWorkerEnv)s.setContentType(void 0);else if(ce.isFunction(r.getHeaders)){const l=r.getHeaders(),u=["content-type","content-length"];Object.entries(l).forEach(([c,d])=>{u.includes(c.toLowerCase())&&s.set(c,d)})}}if(Cr.hasStandardBrowserEnv&&(n&&ce.isFunction(n)&&(n=n(e)),n||n!==!1&&i5(e.url))){const l=a&&i&&s5.read(i);l&&s.set(a,l)}return e},u5=typeof XMLHttpRequest<"u",c5=u5&&function(t){return new Promise(function(r,n){const a=KO(t);let i=a.data;const s=$n.from(a.headers).normalize();let{responseType:o,onUploadProgress:l,onDownloadProgress:u}=a,c,d,f,v,p;function y(){v&&v(),p&&p(),a.cancelToken&&a.cancelToken.unsubscribe(c),a.signal&&a.signal.removeEventListener("abort",c)}let m=new XMLHttpRequest;m.open(a.method.toUpperCase(),a.url,!0),m.timeout=a.timeout;function g(){if(!m)return;const b=$n.from("getAllResponseHeaders"in m&&m.getAllResponseHeaders()),E={data:!o||o==="text"||o==="json"?m.responseText:m.response,status:m.status,statusText:m.statusText,headers:b,config:t,request:m};YO(function(S){r(S),y()},function(S){n(S),y()},E),m=null}"onloadend"in m?m.onloadend=g:m.onreadystatechange=function(){!m||m.readyState!==4||m.status===0&&!(m.responseURL&&m.responseURL.indexOf("file:")===0)||setTimeout(g)},m.onabort=function(){m&&(n(new et("Request aborted",et.ECONNABORTED,t,m)),m=null)},m.onerror=function(w){const E=w&&w.message?w.message:"Network Error",C=new et(E,et.ERR_NETWORK,t,m);C.event=w||null,n(C),m=null},m.ontimeout=function(){let w=a.timeout?"timeout of "+a.timeout+"ms exceeded":"timeout exceeded";const E=a.transitional||NE;a.timeoutErrorMessage&&(w=a.timeoutErrorMessage),n(new et(w,E.clarifyTimeoutError?et.ETIMEDOUT:et.ECONNABORTED,t,m)),m=null},i===void 0&&s.setContentType(null),"setRequestHeader"in m&&ce.forEach(s.toJSON(),function(w,E){m.setRequestHeader(E,w)}),ce.isUndefined(a.withCredentials)||(m.withCredentials=!!a.withCredentials),o&&o!=="json"&&(m.responseType=a.responseType),u&&([f,p]=Hd(u,!0),m.addEventListener("progress",f)),l&&m.upload&&([d,v]=Hd(l),m.upload.addEventListener("progress",d),m.upload.addEventListener("loadend",v)),(a.cancelToken||a.signal)&&(c=b=>{m&&(n(!b||b.type?new Ou(null,t,m):b),m.abort(),m=null)},a.cancelToken&&a.cancelToken.subscribe(c),a.signal&&(a.signal.aborted?c():a.signal.addEventListener("abort",c)));const x=r5(a.url);if(x&&Cr.protocols.indexOf(x)===-1){n(new et("Unsupported protocol "+x+":",et.ERR_BAD_REQUEST,t));return}m.send(i||null)})},d5=(t,e)=>{const{length:r}=t=t?t.filter(Boolean):[];if(e||r){let n=new AbortController,a;const i=function(u){if(!a){a=!0,o();const c=u instanceof Error?u:this.reason;n.abort(c instanceof et?c:new Ou(c instanceof Error?c.message:c))}};let s=e&&setTimeout(()=>{s=null,i(new et(`timeout of ${e}ms exceeded`,et.ETIMEDOUT))},e);const o=()=>{t&&(s&&clearTimeout(s),s=null,t.forEach(u=>{u.unsubscribe?u.unsubscribe(i):u.removeEventListener("abort",i)}),t=null)};t.forEach(u=>u.addEventListener("abort",i));const{signal:l}=n;return l.unsubscribe=()=>ce.asap(o),l}},f5=d5,h5=function*(t,e){let r=t.byteLength;if(!e||r<e){yield t;return}let n=0,a;for(;n<r;)a=n+e,yield t.slice(n,a),n=a},v5=async function*(t,e){for await(const r of p5(t))yield*h5(r,e)},p5=async function*(t){if(t[Symbol.asyncIterator]){yield*t;return}const e=t.getReader();try{for(;;){const{done:r,value:n}=await e.read();if(r)break;yield n}}finally{await e.cancel()}},fN=(t,e,r,n)=>{const a=v5(t,e);let i=0,s,o=l=>{s||(s=!0,n&&n(l))};return new ReadableStream({async pull(l){try{const{done:u,value:c}=await a.next();if(u){o(),l.close();return}let d=c.byteLength;if(r){let f=i+=d;r(f)}l.enqueue(new Uint8Array(c))}catch(u){throw o(u),u}},cancel(l){return o(l),a.return()}},{highWaterMark:2})},hN=64*1024,{isFunction:Sc}=ce,g5=(({Request:t,Response:e})=>({Request:t,Response:e}))(ce.global),{ReadableStream:vN,TextEncoder:pN}=ce.global,gN=(t,...e)=>{try{return!!t(...e)}catch{return!1}},m5=t=>{t=ce.merge.call({skipUndefined:!0},g5,t);const{fetch:e,Request:r,Response:n}=t,a=e?Sc(e):typeof fetch=="function",i=Sc(r),s=Sc(n);if(!a)return!1;const o=a&&Sc(vN),l=a&&(typeof pN=="function"?(p=>y=>p.encode(y))(new pN):async p=>new Uint8Array(await new r(p).arrayBuffer())),u=i&&o&&gN(()=>{let p=!1;const y=new vN,m=new r(Cr.origin,{body:y,method:"POST",get duplex(){return p=!0,"half"}}).headers.has("Content-Type");return y.cancel(),p&&!m}),c=s&&o&&gN(()=>ce.isReadableStream(new n("").body)),d={stream:c&&(p=>p.body)};a&&["text","arrayBuffer","blob","formData","stream"].forEach(p=>{!d[p]&&(d[p]=(y,m)=>{let g=y&&y[p];if(g)return g.call(y);throw new et(`Response type '${p}' is not supported`,et.ERR_NOT_SUPPORT,m)})});const f=async p=>{if(p==null)return 0;if(ce.isBlob(p))return p.size;if(ce.isSpecCompliantForm(p))return(await new r(Cr.origin,{method:"POST",body:p}).arrayBuffer()).byteLength;if(ce.isArrayBufferView(p)||ce.isArrayBuffer(p))return p.byteLength;if(ce.isURLSearchParams(p)&&(p=p+""),ce.isString(p))return(await l(p)).byteLength},v=async(p,y)=>{const m=ce.toFiniteNumber(p.getContentLength());return m??f(y)};return async p=>{let{url:y,method:m,data:g,signal:x,cancelToken:b,timeout:w,onDownloadProgress:E,onUploadProgress:C,responseType:S,headers:T,withCredentials:P="same-origin",fetchOptions:A}=KO(p),j=e||fetch;S=S?(S+"").toLowerCase():"text";let R=f5([x,b&&b.toAbortSignal()],w),O=null;const N=R&&R.unsubscribe&&(()=>{R.unsubscribe()});let D;try{if(C&&u&&m!=="get"&&m!=="head"&&(D=await v(T,g))!==0){let B=new r(y,{method:"POST",body:g,duplex:"half"}),$;if(ce.isFormData(g)&&($=B.headers.get("content-type"))&&T.setContentType($),B.body){const[W,z]=uN(D,Hd(cN(C)));g=fN(B.body,hN,W,z)}}ce.isString(P)||(P=P?"include":"omit");const L=i&&"credentials"in r.prototype,_={...A,signal:R,method:m.toUpperCase(),headers:T.normalize().toJSON(),body:g,duplex:"half",credentials:L?P:void 0};O=i&&new r(y,_);let k=await(i?j(O,A):j(y,_));const I=c&&(S==="stream"||S==="response");if(c&&(E||I&&N)){const B={};["status","statusText","headers"].forEach(q=>{B[q]=k[q]});const $=ce.toFiniteNumber(k.headers.get("content-length")),[W,z]=E&&uN($,Hd(cN(E),!0))||[];k=new n(fN(k.body,hN,W,()=>{z&&z(),N&&N()}),B)}S=S||"text";let F=await d[ce.findKey(d,S)||"text"](k,p);return!I&&N&&N(),await new Promise((B,$)=>{YO(B,$,{data:F,headers:$n.from(k.headers),status:k.status,statusText:k.statusText,config:p,request:O})})}catch(L){throw N&&N(),L&&L.name==="TypeError"&&/Load failed|fetch/i.test(L.message)?Object.assign(new et("Network Error",et.ERR_NETWORK,p,O,L&&L.response),{cause:L.cause||L}):et.from(L,L&&L.code,p,O,L&&L.response)}}},y5=new Map,QO=t=>{let e=t&&t.env||{};const{fetch:r,Request:n,Response:a}=e,i=[n,a,r];let s=i.length,o=s,l,u,c=y5;for(;o--;)l=i[o],u=c.get(l),u===void 0&&c.set(l,u=o?new Map:m5(e)),c=u;return u};QO();const AE={http:D3,xhr:c5,fetch:{get:QO}};ce.forEach(AE,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});const mN=t=>`- ${t}`,x5=t=>ce.isFunction(t)||t===null||t===!1;function b5(t,e){t=ce.isArray(t)?t:[t];const{length:r}=t;let n,a;const i={};for(let s=0;s<r;s++){n=t[s];let o;if(a=n,!x5(n)&&(a=AE[(o=String(n)).toLowerCase()],a===void 0))throw new et(`Unknown adapter '${o}'`);if(a&&(ce.isFunction(a)||(a=a.get(e))))break;i[o||"#"+s]=a}if(!a){const s=Object.entries(i).map(([l,u])=>`adapter ${l} `+(u===!1?"is not supported by the environment":"is not available in the build"));let o=r?s.length>1?`since :
|
|
78
|
+
`+s.map(mN).join(`
|
|
79
|
+
`):" "+mN(s[0]):"as no adapter specified";throw new et("There is no suitable adapter to dispatch the request "+o,"ERR_NOT_SUPPORT")}return a}const ZO={getAdapter:b5,adapters:AE};function mv(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new Ou(null,t)}function yN(t){return mv(t),t.headers=$n.from(t.headers),t.data=gv.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),ZO.getAdapter(t.adapter||PE.adapter,t)(t).then(function(n){return mv(t),n.data=gv.call(t,t.transformResponse,n),n.headers=$n.from(n.headers),n},function(n){return WO(n)||(mv(t),n&&n.response&&(n.response.data=gv.call(t,t.transformResponse,n.response),n.response.headers=$n.from(n.response.headers))),Promise.reject(n)})}const JO="1.14.0",Gf={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{Gf[t]=function(n){return typeof n===t||"a"+(e<1?"n ":" ")+t}});const xN={};Gf.transitional=function(e,r,n){function a(i,s){return"[Axios v"+JO+"] Transitional option '"+i+"'"+s+(n?". "+n:"")}return(i,s,o)=>{if(e===!1)throw new et(a(s," has been removed"+(r?" in "+r:"")),et.ERR_DEPRECATED);return r&&!xN[s]&&(xN[s]=!0,console.warn(a(s," has been deprecated since v"+r+" and will be removed in the near future"))),e?e(i,s,o):!0}};Gf.spelling=function(e){return(r,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};function w5(t,e,r){if(typeof t!="object")throw new et("options must be an object",et.ERR_BAD_OPTION_VALUE);const n=Object.keys(t);let a=n.length;for(;a-- >0;){const i=n[a],s=e[i];if(s){const o=t[i],l=o===void 0||s(o,i,t);if(l!==!0)throw new et("option "+i+" must be "+l,et.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new et("Unknown option "+i,et.ERR_BAD_OPTION)}}const nd={assertOptions:w5,validators:Gf},pn=nd.validators;class Wd{constructor(e){this.defaults=e||{},this.interceptors={request:new oN,response:new oN}}async request(e,r){try{return await this._request(e,r)}catch(n){if(n instanceof Error){let a={};Error.captureStackTrace?Error.captureStackTrace(a):a=new Error;const i=a.stack?a.stack.replace(/^.+\n/,""):"";try{n.stack?i&&!String(n.stack).endsWith(i.replace(/^.+\n.+\n/,""))&&(n.stack+=`
|
|
80
|
+
`+i):n.stack=i}catch{}}throw n}}_request(e,r){typeof e=="string"?(r=r||{},r.url=e):r=e||{},r=ls(this.defaults,r);const{transitional:n,paramsSerializer:a,headers:i}=r;n!==void 0&&nd.assertOptions(n,{silentJSONParsing:pn.transitional(pn.boolean),forcedJSONParsing:pn.transitional(pn.boolean),clarifyTimeoutError:pn.transitional(pn.boolean),legacyInterceptorReqResOrdering:pn.transitional(pn.boolean)},!1),a!=null&&(ce.isFunction(a)?r.paramsSerializer={serialize:a}:nd.assertOptions(a,{encode:pn.function,serialize:pn.function},!0)),r.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?r.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:r.allowAbsoluteUrls=!0),nd.assertOptions(r,{baseUrl:pn.spelling("baseURL"),withXsrfToken:pn.spelling("withXSRFToken")},!0),r.method=(r.method||this.defaults.method||"get").toLowerCase();let s=i&&ce.merge(i.common,i[r.method]);i&&ce.forEach(["delete","get","head","post","put","patch","common"],p=>{delete i[p]}),r.headers=$n.concat(s,i);const o=[];let l=!0;this.interceptors.request.forEach(function(y){if(typeof y.runWhen=="function"&&y.runWhen(r)===!1)return;l=l&&y.synchronous;const m=r.transitional||NE;m&&m.legacyInterceptorReqResOrdering?o.unshift(y.fulfilled,y.rejected):o.push(y.fulfilled,y.rejected)});const u=[];this.interceptors.response.forEach(function(y){u.push(y.fulfilled,y.rejected)});let c,d=0,f;if(!l){const p=[yN.bind(this),void 0];for(p.unshift(...o),p.push(...u),f=p.length,c=Promise.resolve(r);d<f;)c=c.then(p[d++],p[d++]);return c}f=o.length;let v=r;for(;d<f;){const p=o[d++],y=o[d++];try{v=p(v)}catch(m){y.call(this,m);break}}try{c=yN.call(this,v)}catch(p){return Promise.reject(p)}for(d=0,f=u.length;d<f;)c=c.then(u[d++],u[d++]);return c}getUri(e){e=ls(this.defaults,e);const r=XO(e.baseURL,e.url,e.allowAbsoluteUrls);return GO(r,e.params,e.paramsSerializer)}}ce.forEach(["delete","get","head","options"],function(e){Wd.prototype[e]=function(r,n){return this.request(ls(n||{},{method:e,url:r,data:(n||{}).data}))}});ce.forEach(["post","put","patch"],function(e){function r(n){return function(i,s,o){return this.request(ls(o||{},{method:e,headers:n?{"Content-Type":"multipart/form-data"}:{},url:i,data:s}))}}Wd.prototype[e]=r(),Wd.prototype[e+"Form"]=r(!0)});const ad=Wd;class kE{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(i){r=i});const n=this;this.promise.then(a=>{if(!n._listeners)return;let i=n._listeners.length;for(;i-- >0;)n._listeners[i](a);n._listeners=null}),this.promise.then=a=>{let i;const s=new Promise(o=>{n.subscribe(o),i=o}).then(a);return s.cancel=function(){n.unsubscribe(i)},s},e(function(i,s,o){n.reason||(n.reason=new Ou(i,s,o),r(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const r=this._listeners.indexOf(e);r!==-1&&this._listeners.splice(r,1)}toAbortSignal(){const e=new AbortController,r=n=>{e.abort(n)};return this.subscribe(r),e.signal.unsubscribe=()=>this.unsubscribe(r),e.signal}static source(){let e;return{token:new kE(function(a){e=a}),cancel:e}}}const E5=kE;function S5(t){return function(r){return t.apply(null,r)}}function C5(t){return ce.isObject(t)&&t.isAxiosError===!0}const I1={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(I1).forEach(([t,e])=>{I1[e]=t});const N5=I1;function eM(t){const e=new ad(t),r=OO(ad.prototype.request,e);return ce.extend(r,ad.prototype,e,{allOwnKeys:!0}),ce.extend(r,e,null,{allOwnKeys:!0}),r.create=function(a){return eM(ls(t,a))},r}const Yt=eM(PE);Yt.Axios=ad;Yt.CanceledError=Ou;Yt.CancelToken=E5;Yt.isCancel=WO;Yt.VERSION=JO;Yt.toFormData=$f;Yt.AxiosError=et;Yt.Cancel=Yt.CanceledError;Yt.all=function(e){return Promise.all(e)};Yt.spread=S5;Yt.isAxiosError=C5;Yt.mergeConfig=ls;Yt.AxiosHeaders=$n;Yt.formToJSON=t=>HO(ce.isHTMLForm(t)?new FormData(t):t);Yt.getAdapter=ZO.getAdapter;Yt.HttpStatusCode=N5;Yt.default=Yt;const lu=Yt,T5=async()=>(await je.get("/packages/all")).data.data,je=lu.create({baseURL:"/api",headers:{"Content-Type":"application/json"}});je.interceptors.request.use(t=>{const e=localStorage.getItem("auth_token")||"mock-token-for-testing";return e&&(t.headers.Authorization=`Bearer ${e}`),t});const at={getAllServices:async()=>(await je.get("/services")).data,getServiceEntities:async t=>(await je.get(`/services/${t}/entities`)).data,getEntitySchema:async(t,e)=>(await je.get(`/services/${t}/entities/${e}`)).data,createEntity:async(t,e)=>(await je.post(`/services/${t}/entities`,e)).data,updateEntity:async(t,e,r)=>(await je.put(`/services/${t}/entities/${e}`,r)).data,deleteEntity:async(t,e)=>(await je.delete(`/services/${t}/entities/${e}`)).data,searchEntities:async(t,e)=>{const r=new URLSearchParams({q:t});return e!=null&&e.type&&r.append("type",e.type),e!=null&&e.service&&r.append("service",e.service),e!=null&&e.stereotype&&r.append("stereotype",e.stereotype),e!=null&&e.hasMetadata&&r.append("hasMetadata",e.hasMetadata),(await je.get(`/search?${r.toString()}`)).data},getLineage:async t=>(await je.get(`/entities/${t}/lineage`)).data.data,getImpactAnalysis:async t=>(await je.get(`/entities/${t}/impact`)).data.data,submitEntity:async(t,e)=>(await je.post(`/services/${t}/entities/${e}/submit`)).data,approveEntity:async(t,e)=>(await je.post(`/services/${t}/entities/${e}/approve`)).data,returnEntity:async(t,e,r,n)=>(await je.post(`/services/${t}/entities/${e}/return`,{comment:r,author:n})).data,getComments:async(t,e)=>(await je.get(`/services/${t}/entities/${e}/comments`)).data.data,addComment:async(t,e,r)=>(await je.post(`/services/${t}/entities/${e}/comments`,r)).data,resolveComment:async(t,e,r)=>(await je.put(`/services/${t}/entities/${e}/comments/${r}`)).data,getGraphData:async t=>(await je.get(`/graph/${t}`)).data},Ca={saveDiagramLayout:async t=>(await je.post("/diagrams",t)).data,loadDiagramLayout:async t=>(await je.get(`/diagrams/${t}`)).data,updateDiagramLayout:async(t,e)=>(await je.put(`/diagrams/${t}`,e)).data,deleteDiagramLayout:async t=>(await je.delete(`/diagrams/${t}`)).data,listDiagramLayouts:async t=>{const e=t?`?service=${encodeURIComponent(t)}`:"";return(await je.get(`/diagrams${e}`)).data}},Do={getAllDictionaries:async()=>(await je.get("/dictionaries")).data,getDictionaryById:async t=>(await je.get(`/dictionaries/${t}`)).data,createDictionary:async t=>(await je.post("/dictionaries",t)).data,updateDictionary:async(t,e)=>(await je.put(`/dictionaries/${t}`,e)).data,deleteDictionary:async t=>(await je.delete(`/dictionaries/${t}`)).data,getDictionaryEntries:async t=>(await je.get(`/dictionaries/${t}/entries`)).data,getEntityAttributes:async(t,e)=>(await je.get(`/dictionaries/${t}/${e}/attributes`)).data,saveEntity:async t=>(await je.post("/dictionaries/entity",t)).data,getRelatedEntities:async(t,e)=>(await je.get(`/dictionaries/${t}/${e}/related`)).data},us={commitChanges:async t=>(await je.post("/commit",{message:t})).data,getCommitHistory:async(t=10)=>(await je.get(`/history?limit=${t}`)).data,revertToCommit:async t=>(await je.post("/revert",{commitHash:t})).data},Or={login:async(t,e)=>{const r=await je.post("/auth/login",{username:t,password:e});return r.data.token&&localStorage.setItem("auth_token",r.data.token),r.data},logout:()=>{localStorage.removeItem("auth_token")},getCurrentUser:async()=>(await je.get("/auth/me")).data,isAuthenticated:()=>!!localStorage.getItem("auth_token")},id={getPackageRelationships:async t=>(await je.get(`/packages/${encodeURIComponent(t)}/relationships`)).data.data,createRelationship:async(t,e)=>(await je.post(`/packages/${encodeURIComponent(t)}/relationships`,e)).data,updateRelationship:async(t,e,r)=>(await je.put(`/packages/${encodeURIComponent(t)}/relationships/${e}`,r)).data,deleteRelationship:async(t,e)=>(await je.delete(`/packages/${encodeURIComponent(t)}/relationships/${e}`)).data},xi={getAllPackages:async()=>(await je.get("/packages/all")).data.data,getFlatEntities:async t=>{const e=new URLSearchParams;return t!=null&&t.name&&e.append("name",t.name),t!=null&&t.type&&e.append("type",t.type),t!=null&&t.package&&e.append("package",t.package),(await je.get(`/entities/flat${e.toString()?"?"+e.toString():""}`)).data.data},getEntityHierarchy:async(t,e)=>(await je.get(`/entities/hierarchy/${encodeURIComponent(t)}/${encodeURIComponent(e)}`)).data.data},xl={importJsonSchema:async(t,e)=>(await je.post("/import/json-schema",{schema:t,service:e})).data,importSqlDdl:async(t,e)=>(await je.post("/import/sql-ddl",{sql:t,service:e})).data,exportJsonSchema:async t=>(await je.get(`/export/json-schema/${t}`)).data,exportMarkdown:async t=>(await je.get(`/export/markdown/${t}`,{responseType:"text"})).data,getQualityReport:async t=>{const e=t?`?service=${t}`:"";return(await je.get(`/quality/report${e}`)).data.data}},Cn={getStatus:async()=>(await je.get("/git/dictionaries/status/.")).data,getBranches:async()=>(await je.get("/git/dictionaries/branches/.")).data,checkout:async(t,e)=>(await je.post("/git/dictionaries/checkout/.",{branch:t,create:e})).data,createBranch:async t=>(await je.post("/git/dictionaries/branch/.",{branch:t})).data,commit:async t=>(await je.post("/git/dictionaries/commit/.",{message:t})).data,pull:async t=>(await je.post("/git/dictionaries/pull/.",{remote:t})).data,push:async t=>(await je.post("/git/dictionaries/push/.",{remote:t})).data,fetch:async t=>(await je.post("/git/dictionaries/fetch/.",{remote:t})).data,getDiff:async t=>(await je.get("/git/dictionaries/diff/.",{params:t?{file:t}:{}})).data},un={getAll:async()=>(await je.get("/perspectives")).data.data,getById:async t=>(await je.get(`/perspectives/${t}`)).data.data,create:async t=>(await je.post("/perspectives",t)).data,update:async(t,e)=>(await je.put(`/perspectives/${t}`,e)).data,delete:async t=>(await je.delete(`/perspectives/${t}`)).data,resolve:async t=>(await je.get(`/perspectives/${t}/resolve`)).data.data,getGraphData:async t=>(await je.get(`/perspectives/${t}/graph`)).data.data,upsertNode:async(t,e)=>(await je.put(`/perspectives/${t}/nodes`,e)).data},zn={getAll:async t=>{const e=t?`?appliesTo=${t}`:"";return(await je.get(`/stereotypes${e}`)).data.data},getById:async t=>(await je.get(`/stereotypes/${t}`)).data.data,create:async t=>(await je.post("/stereotypes",t)).data,update:async(t,e)=>(await je.put(`/stereotypes/${t}`,e)).data,delete:async t=>(await je.delete(`/stereotypes/${t}`)).data},Mn={createPackage:async t=>(await je.post("/packages",t)).data,createSubPackage:async(t,e,r)=>{const n=e.join("/"),a=n?`/packages/${encodeURIComponent(t)}/subpackages/${n}`:`/packages/${encodeURIComponent(t)}/subpackages/`;return(await je.post(a,r)).data},updatePackage:async(t,e,r)=>{const n=e.join("/"),a=n?`/packages/${encodeURIComponent(t)}/path/${n}`:`/packages/${encodeURIComponent(t)}/path/`;return(await je.put(a,r)).data},deletePackage:async(t,e,r=!1)=>{const n=e.join("/"),a=r?"?force=true":"",i=n?`/packages/${encodeURIComponent(t)}/path/${n}${a}`:`/packages/${encodeURIComponent(t)}/path/${a}`;return(await je.delete(i)).data},getPackageByPath:async(t,e)=>{const r=e.join("/"),n=r?`/packages/${encodeURIComponent(t)}/path/${r}`:`/packages/hierarchy/${encodeURIComponent(t)}`;return(await je.get(n)).data.data}};function R5(){var d;const[t,e]=U.useState(null),[r,n]=U.useState(!1),[a,i]=U.useState(!1),s=async()=>{var f;try{const v=await Cn.getStatus(),p=typeof v.branch=="object"?v.branch:null;e({branch:(p==null?void 0:p.current)||(typeof v.branch=="string"?v.branch:v.current)||"main",ahead:(p==null?void 0:p.ahead)||v.ahead||0,behind:(p==null?void 0:p.behind)||v.behind||0,hasUncommittedChanges:v.hasUncommittedChanges??((f=v.files)==null?void 0:f.length)>0,files:v.files||[]})}catch{e(null)}};U.useEffect(()=>{s();const f=setInterval(s,3e4);return()=>clearInterval(f)},[]);const o=async()=>{i(!0);try{await Cn.pull(),s()}catch{}finally{i(!1)}},l=async()=>{i(!0);try{await Cn.push(),s()}catch{}finally{i(!1)}};if(!t)return null;const u=((d=t.files)==null?void 0:d.length)||0,c=!t.hasUncommittedChanges&&t.ahead===0&&t.behind===0;return h.jsxs("div",{className:"dropdown dropdown-end",children:[h.jsxs("button",{className:"btn btn-ghost btn-sm gap-1 text-primary-content",onClick:()=>n(!r),children:[h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4",viewBox:"0 0 20 20",fill:"currentColor",children:h.jsx("path",{fillRule:"evenodd",d:"M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z",clipRule:"evenodd"})}),h.jsx("span",{className:"text-xs font-mono",children:t.branch||"main"}),c?h.jsx("span",{className:"text-success text-xs",children:"✓"}):h.jsxs("span",{className:"flex gap-0.5",children:[u>0&&h.jsx("span",{className:"badge badge-xs badge-warning",children:u}),(t.ahead||0)>0&&h.jsxs("span",{className:"badge badge-xs badge-info",children:["↑",t.ahead]}),(t.behind||0)>0&&h.jsxs("span",{className:"badge badge-xs badge-error",children:["↓",t.behind]})]})]}),r&&h.jsxs("div",{className:"dropdown-content z-50 bg-base-200 rounded-box shadow-lg p-3 w-64 mt-1",children:[h.jsxs("div",{className:"text-sm font-semibold mb-2",children:["Workspace: ",t.branch]}),h.jsxs("div",{className:"space-y-1 text-xs mb-3",children:[u>0&&h.jsxs("div",{className:"text-warning",children:[u," unsaved change",u>1?"s":""]}),(t.ahead||0)>0&&h.jsxs("div",{className:"text-info",children:[t.ahead," save",t.ahead>1?"s":""," ahead of shared"]}),(t.behind||0)>0&&h.jsxs("div",{className:"text-error",children:[t.behind," update",t.behind>1?"s":""," available"]}),c&&h.jsx("div",{className:"text-success",children:"Up to date"})]}),h.jsxs("div",{className:"flex gap-1",children:[h.jsx(ze,{to:"/version/save",className:"btn btn-xs btn-primary flex-1",onClick:()=>n(!1),children:"Save"}),h.jsx("button",{className:"btn btn-xs btn-outline flex-1",onClick:l,disabled:a,children:a?h.jsx("span",{className:"loading loading-spinner loading-xs"}):"Publish"}),h.jsx("button",{className:"btn btn-xs btn-ghost flex-1",onClick:o,disabled:a,children:"Sync"})]}),h.jsx("div",{className:"divider my-1"}),h.jsxs("div",{className:"flex flex-col gap-1",children:[h.jsx(ze,{to:"/version/save",className:"btn btn-xs btn-ghost justify-start",onClick:()=>n(!1),children:"Save & Publish"}),h.jsx(ze,{to:"/version/workspaces",className:"btn btn-xs btn-ghost justify-start",onClick:()=>n(!1),children:"Workspaces"}),h.jsx(ze,{to:"/version/merge",className:"btn btn-xs btn-ghost justify-start",onClick:()=>n(!1),children:"Merge"}),h.jsx(ze,{to:"/version/history",className:"btn btn-xs btn-ghost justify-start",onClick:()=>n(!1),children:"History"})]})]})]})}const P5=({toggleSidebar:t})=>{const[e,r]=U.useState(Or.isAuthenticated()),[n,a]=U.useState(""),i=vn(),s=l=>{l.preventDefault(),n.trim()&&i(`/search?q=${encodeURIComponent(n.trim())}`)},o=()=>{Or.logout(),r(!1),i("/login")};return h.jsxs("div",{className:"navbar bg-primary text-primary-content shadow-md min-h-0 h-10 px-2",children:[h.jsxs("div",{className:"navbar-start",children:[h.jsx("button",{className:"btn btn-ghost btn-sm btn-circle md:hidden",onClick:t,children:h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M4 6h16M4 12h16M4 18h7"})})}),h.jsx(ze,{to:"/",className:"btn btn-ghost btn-sm normal-case text-base font-bold px-2",children:"Data Dictionary"})]}),h.jsx("div",{className:"navbar-center hidden lg:flex",children:h.jsxs("ul",{className:"menu menu-horizontal menu-sm px-1 gap-0",children:[h.jsx("li",{children:h.jsx(ze,{to:"/packages",children:"Packages"})}),h.jsx("li",{children:h.jsx(ze,{to:"/perspectives",children:"Perspectives"})}),h.jsx("li",{children:h.jsx(ze,{to:"/quality",children:"Quality"})})]})}),h.jsxs("div",{className:"navbar-end gap-1",children:[h.jsx(R5,{}),h.jsx("form",{onSubmit:s,className:"hidden md:flex",children:h.jsx("div",{className:"form-control",children:h.jsxs("div",{className:"input-group",children:[h.jsx("input",{type:"text",placeholder:"Search...",className:"input input-xs input-bordered text-base-content w-36",value:n,onChange:l=>a(l.target.value)}),h.jsx("button",{type:"submit",className:"btn btn-xs btn-square",children:h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-3.5 w-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})})})]})})}),h.jsx(ze,{to:"/search",className:"btn btn-ghost btn-sm btn-circle md:hidden",children:h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})})}),h.jsxs("div",{className:"dropdown dropdown-end",children:[h.jsxs("label",{tabIndex:0,className:"btn btn-ghost btn-sm text-primary-content gap-1",children:[h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4",viewBox:"0 0 20 20",fill:"currentColor",children:h.jsx("path",{fillRule:"evenodd",d:"M11.49 3.17c-.38-1.56-2.6-1.56-2.98 0a1.532 1.532 0 01-2.286.948c-1.372-.836-2.942.734-2.106 2.106.54.886.061 2.042-.947 2.287-1.561.379-1.561 2.6 0 2.978a1.532 1.532 0 01.947 2.287c-.836 1.372.734 2.942 2.106 2.106a1.532 1.532 0 012.287.947c.379 1.561 2.6 1.561 2.978 0a1.533 1.533 0 012.287-.947c1.372.836 2.942-.734 2.106-2.106a1.533 1.533 0 01.947-2.287c1.561-.379 1.561-2.6 0-2.978a1.532 1.532 0 01-.947-2.287c.836-1.372-.734-2.942-2.106-2.106a1.532 1.532 0 01-2.287-.947zM10 13a3 3 0 100-6 3 3 0 000 6z",clipRule:"evenodd"})}),h.jsx("span",{className:"hidden md:inline text-xs",children:"Admin"})]}),h.jsxs("ul",{tabIndex:0,className:"menu menu-sm dropdown-content mt-3 z-[1] p-2 shadow bg-base-100 rounded-box w-52 text-base-content",children:[h.jsx("li",{children:h.jsx(ze,{to:"/stereotypes",children:"Stereotypes"})}),h.jsx("li",{children:h.jsx(ze,{to:"/import-export",children:"Import / Export"})}),h.jsx("li",{className:"border-t border-base-300 mt-1 pt-1",children:h.jsx(ze,{to:"/version/history",children:"Version History"})}),h.jsx("li",{children:h.jsx(ze,{to:"/version/commit",children:"Manual Commit"})})]})]}),h.jsxs("div",{className:"dropdown dropdown-end",children:[h.jsx("label",{tabIndex:0,className:"btn btn-ghost btn-sm btn-circle avatar",children:h.jsx("div",{className:"w-7 rounded-full bg-primary-focus flex items-center justify-center",children:h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z"})})})}),h.jsx("ul",{tabIndex:0,className:"menu menu-sm dropdown-content mt-3 z-[1] p-2 shadow bg-base-100 rounded-box w-52 text-base-content",children:e?h.jsxs(h.Fragment,{children:[h.jsx("li",{children:h.jsx(ze,{to:"/profile",children:"Profile"})}),h.jsx("li",{children:h.jsx(ze,{to:"/settings",children:"Settings"})}),h.jsx("li",{children:h.jsx("button",{onClick:o,children:"Logout"})})]}):h.jsxs(h.Fragment,{children:[h.jsx("li",{children:h.jsx(ze,{to:"/login",children:"Login"})}),h.jsx("li",{children:h.jsx(ze,{to:"/register",children:"Register"})})]})})]})]})]})},A5=({collapsed:t=!1})=>{const[e,r]=U.useState([]),[n,a]=U.useState([]),[i,s]=U.useState({}),[o,l]=U.useState(!0),[u,c]=U.useState(null),d=Ia(),[f,v]=U.useState({packages:!0,perspectives:!1,views:!1,versionControl:!1}),p=b=>{v(w=>({...w,[b]:!w[b]}))};U.useEffect(()=>{(async()=>{try{l(!0);const w=await xi.getAllPackages();r(w),c(null)}catch(w){console.error("Error fetching packages:",w),c("Failed to load packages")}finally{l(!1)}})(),un.getAll().then(a).catch(()=>{})},[]);const y=b=>d.pathname.startsWith(b),m=b=>{s(w=>({...w,[b]:!w[b]}))},g=(b,w=[])=>Array.isArray(b)?h.jsx("ul",{children:b.map(E=>{const C=[...w,E.name],S=`/packages/${C.join("/")}`;return h.jsxs("li",{children:[h.jsxs("div",{className:"flex items-center",children:[E.subPackages&&E.subPackages.length>0||E.entities&&E.entities.length>0?h.jsx("button",{className:"mr-1 btn btn-xs btn-ghost",onClick:()=>m(E.id),"aria-label":i[E.id]?"Collapse":"Expand",type:"button",children:i[E.id]?"▼":"▶"}):null,h.jsx(ze,{to:S,className:`font-semibold ${y(S)?"active":""}`,children:E.name})]}),i[E.id]&&h.jsxs("div",{className:"ml-4",children:[E.entities&&E.entities.length>0&&h.jsx("ul",{children:E.entities.map(T=>{const P=`${S}/entities/${T.name}`;return h.jsx("li",{children:h.jsx(ze,{to:P,className:y(P)?"active":"",children:T.name})},T.uuid)})}),E.subPackages&&E.subPackages.length>0&&g(E.subPackages,C)]})]},E.id)})}):h.jsx("ul",{});if(t)return h.jsxs("div",{className:"h-full flex flex-col items-center py-4 gap-2",children:[h.jsx(ze,{to:"/",className:"btn btn-ghost btn-sm btn-square",title:"Home",children:h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor",children:h.jsx("path",{d:"M10.707 2.293a1 1 0 00-1.414 0l-7 7a1 1 0 001.414 1.414L4 10.414V17a1 1 0 001 1h2a1 1 0 001-1v-2a1 1 0 011-1h2a1 1 0 011 1v2a1 1 0 001 1h2a1 1 0 001-1v-6.586l.293.293a1 1 0 001.414-1.414l-7-7z"})})}),h.jsx(ze,{to:"/services",className:"btn btn-ghost btn-sm btn-square",title:"Services",children:h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor",children:h.jsx("path",{d:"M2 6a2 2 0 012-2h5l2 2h5a2 2 0 012 2v6a2 2 0 01-2 2H4a2 2 0 01-2-2V6z"})})}),h.jsx(ze,{to:"/visualization",className:"btn btn-ghost btn-sm btn-square",title:"Visualization",children:h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor",children:h.jsx("path",{d:"M2 11a1 1 0 011-1h2a1 1 0 011 1v5a1 1 0 01-1 1H3a1 1 0 01-1-1v-5zM8 7a1 1 0 011-1h2a1 1 0 011 1v9a1 1 0 01-1 1H9a1 1 0 01-1-1V7zM14 4a1 1 0 011-1h2a1 1 0 011 1v12a1 1 0 01-1 1h-2a1 1 0 01-1-1V4z"})})}),h.jsx(ze,{to:"/version/history",className:"btn btn-ghost btn-sm btn-square",title:"History",children:h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor",children:h.jsx("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm1-12a1 1 0 10-2 0v4a1 1 0 00.293.707l2.828 2.829a1 1 0 101.415-1.415L11 9.586V6z",clipRule:"evenodd"})})})]});const x=({id:b,title:w})=>h.jsxs("button",{className:"menu-title flex items-center justify-between w-full cursor-pointer hover:bg-base-300/30 rounded px-1 transition-colors",onClick:()=>p(b),type:"button",children:[h.jsx("span",{children:w}),h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:`h-3 w-3 transition-transform ${f[b]?"rotate-180":""}`,viewBox:"0 0 20 20",fill:"currentColor",children:h.jsx("path",{fillRule:"evenodd",d:"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z",clipRule:"evenodd"})})]});return h.jsx("div",{className:"h-full flex flex-col",children:h.jsx("nav",{className:"flex-1 overflow-y-auto p-2 pt-3",children:h.jsxs("ul",{className:"menu menu-sm p-0 [--tw-bg-opacity:0.05]",children:[h.jsx("li",{children:h.jsxs(ze,{to:"/",className:d.pathname==="/"?"active":"",children:[h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4",viewBox:"0 0 20 20",fill:"currentColor",children:h.jsx("path",{d:"M10.707 2.293a1 1 0 00-1.414 0l-7 7a1 1 0 001.414 1.414L4 10.414V17a1 1 0 001 1h2a1 1 0 001-1v-2a1 1 0 011-1h2a1 1 0 011 1v2a1 1 0 001 1h2a1 1 0 001-1v-6.586l.293.293a1 1 0 001.414-1.414l-7-7z"})}),"Home"]})}),h.jsxs("li",{className:"mt-2",children:[h.jsx(x,{id:"packages",title:"Packages"}),f.packages&&h.jsx(h.Fragment,{children:o?h.jsx("div",{className:"flex justify-center p-2",children:h.jsx("span",{className:"loading loading-spinner loading-sm"})}):u?h.jsx("div",{className:"text-error p-2 text-xs",children:u}):e.length>0?h.jsx("div",{className:"ml-1",children:g(e)}):h.jsx("div",{className:"text-base-content/50 px-3 py-1 text-xs",children:"No packages"})})]}),h.jsxs("li",{className:"mt-1",children:[h.jsx(x,{id:"perspectives",title:"Perspectives"}),f.perspectives&&h.jsxs("ul",{children:[n.map(b=>h.jsx("li",{children:h.jsx(ze,{to:`/perspectives/${b.uuid}`,className:y(`/perspectives/${b.uuid}`)?"active":"",children:b.name})},b.uuid)),n.length===0&&h.jsx("li",{className:"text-base-content/50 px-3 py-1 text-xs",children:"No perspectives"}),h.jsx("li",{children:h.jsx(ze,{to:"/perspectives/create",className:"text-primary text-xs",children:"+ Create"})})]})]}),h.jsxs("li",{className:"mt-1",children:[h.jsx(x,{id:"views",title:"Flat Views"}),f.views&&h.jsxs("ul",{children:[h.jsx("li",{children:h.jsx(ze,{to:"/flat/packages",className:y("/flat/packages")?"active":"",children:"Package List"})}),h.jsx("li",{children:h.jsx(ze,{to:"/flat/entities",className:y("/flat/entities")?"active":"",children:"Entity List"})}),h.jsx("li",{children:h.jsx(ze,{to:"/flat/attributes",className:y("/flat/attributes")?"active":"",children:"Attribute List"})})]})]})]})})})},k5=()=>{const t=Ia(),e=U.useMemo(()=>{const r=t.pathname.split("/").filter(Boolean),n=[{label:"Home",path:"/"}];if(r[0]==="packages"){n.push({label:"Packages",path:"/packages"});const a=r.indexOf("entities"),i=a>0?r.slice(1,a):r.slice(1);if(i.forEach((s,o)=>{const l="/packages/"+i.slice(0,o+1).join("/");n.push({label:s,path:l})}),a>0){const s="/packages/"+i.join("/")+"/entities";if(n.push({label:"Entities",path:s}),r[a+1]){const o=r[a+1];n.push({label:o,path:s+"/"+o}),r[a+2]==="edit"&&n.push({label:"Edit",path:s+"/"+o+"/edit"})}}}else if(r[0]==="services")n.push({label:"Services",path:"/services"}),r[1]&&n.push({label:r[1],path:`/services/${r[1]}`}),r[2]==="entities"&&(n.push({label:"Entities",path:`/services/${r[1]}/entities`}),r[3]&&n.push({label:r[3],path:`/services/${r[1]}/entities/${r[3]}`}));else if(r[0]==="version"){if(n.push({label:"Version Control",path:"/version"}),r[1]){const a=r[1]==="history"?"History":r[1]==="commit"?"Commit Changes":r[1];n.push({label:a,path:`/version/${r[1]}`})}}else if(r[0]==="visualization")n.push({label:"Visualization",path:"/visualization"}),r[1]&&n.push({label:r[1],path:`/visualization/${r[1]}`});else if(r[0]==="diagram")n.push({label:"Diagram",path:"/diagram"}),r[1]&&n.push({label:r[1],path:`/diagram/${r[1]}`});else{let a="";r.forEach(i=>{a+=`/${i}`,n.push({label:i.charAt(0).toUpperCase()+i.slice(1),path:a})})}return n},[t.pathname]);return e.length<=1?null:h.jsx("div",{className:"text-xs breadcrumbs py-0",children:h.jsx("ul",{children:e.map((r,n)=>h.jsx("li",{children:n<e.length-1?h.jsx(ze,{to:r.path,children:r.label}):h.jsx("span",{className:"font-medium",children:r.label})},r.path))})})},L5=()=>{const t=new Date().getFullYear();return h.jsx("footer",{className:"footer footer-center p-4 bg-base-200 text-base-content border-t border-base-300",children:h.jsxs("div",{className:"flex flex-col md:flex-row items-center justify-between w-full",children:[h.jsx("div",{className:"text-sm",children:h.jsxs("p",{children:["Copyright © ",t," - Data Dictionary Management System"]})}),h.jsxs("div",{className:"flex gap-4 text-sm",children:[h.jsx(ze,{to:"/about",children:"About"}),h.jsx(ze,{to:"/help",children:"Help"}),h.jsx(ze,{to:"/privacy",children:"Privacy"}),h.jsx("a",{href:"https://github.com/yourusername/data-dictionary",target:"_blank",rel:"noopener noreferrer",children:h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",fill:"currentColor",viewBox:"0 0 16 16",children:h.jsx("path",{d:"M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.012 8.012 0 0 0 16 8c0-4.42-3.58-8-8-8z"})})})]})]})})},D5=()=>{const[t,e]=U.useState(!1),[r,n]=U.useState(!1),a=()=>e(!t),i=()=>n(!r);return h.jsxs("div",{className:"min-h-screen flex flex-col bg-base-200",children:[h.jsx(P5,{toggleSidebar:a}),h.jsxs("div",{className:"flex flex-1 overflow-hidden",children:[t&&h.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 z-20 md:hidden",onClick:()=>e(!1)}),h.jsxs("div",{className:`fixed md:relative z-30 md:z-0 h-full transform transition-all duration-300 ease-in-out bg-base-100 border-r border-base-300 ${t?"translate-x-0":"-translate-x-full"} md:translate-x-0 ${r?"w-14":"w-56"}`,children:[h.jsx("button",{className:"hidden md:flex absolute -right-3 top-3 z-10 btn btn-circle btn-xs bg-base-100 border border-base-300 shadow-sm hover:bg-base-200",onClick:i,title:r?"Expand sidebar":"Collapse sidebar",children:h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:`h-3 w-3 transition-transform ${r?"rotate-180":""}`,viewBox:"0 0 20 20",fill:"currentColor",children:h.jsx("path",{fillRule:"evenodd",d:"M12.707 5.293a1 1 0 010 1.414L9.414 10l3.293 3.293a1 1 0 01-1.414 1.414l-4-4a1 1 0 010-1.414l4-4a1 1 0 011.414 0z",clipRule:"evenodd"})})}),h.jsx(A5,{collapsed:r})]}),h.jsxs("main",{className:"flex-1 overflow-auto flex flex-col px-4 md:px-5 py-2",children:[h.jsx(k5,{}),h.jsx("div",{className:"flex-1 min-h-0 flex flex-col mt-1",children:h.jsx(cU,{})})]})]}),h.jsx(L5,{})]})},_5=()=>{const[t,e]=U.useState([]),[r,n]=U.useState(!0);U.useEffect(()=>{(async()=>{try{const o=(await at.getAllServices()).data||[],l=await Promise.all(o.map(async u=>{var c;try{const d=await at.getServiceEntities(u);return{name:u,entityCount:((c=d.data)==null?void 0:c.length)||0}}catch{return{name:u,entityCount:0}}}));e(l)}catch{}n(!1)})()},[]);const a=t.reduce((i,s)=>i+s.entityCount,0);return h.jsxs("div",{className:"space-y-6",children:[h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsxs("div",{children:[h.jsx("h1",{className:"text-3xl font-bold",children:"Data Dictionary"}),h.jsxs("p",{className:"text-base-content/70 mt-1",children:[t.length," packages, ",a," entities"]})]}),h.jsx(ze,{to:"/packages",className:"btn btn-primary btn-sm",children:"Create Package"})]}),r?h.jsx("div",{className:"flex justify-center py-12",children:h.jsx("span",{className:"loading loading-spinner loading-lg"})}):t.length===0?h.jsxs("div",{className:"text-center py-16 bg-base-200 rounded-lg",children:[h.jsx("h2",{className:"text-xl font-semibold",children:"No packages yet"}),h.jsx("p",{className:"text-base-content/60 mt-2",children:"Create your first package to start modeling your data."}),h.jsx(ze,{to:"/packages",className:"btn btn-primary btn-sm mt-4",children:"Get Started"})]}):h.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:t.map(i=>h.jsx("div",{className:"card bg-base-200 shadow-sm hover:shadow-md transition-shadow",children:h.jsxs("div",{className:"card-body p-5",children:[h.jsx("h3",{className:"card-title text-lg font-mono",children:i.name}),h.jsxs("div",{className:"text-xs text-base-content/60 mt-1",children:[i.entityCount," entities"]}),h.jsxs("div",{className:"card-actions justify-end mt-3",children:[h.jsx(ze,{to:`/packages/${i.name}`,className:"btn btn-primary btn-sm",children:"Browse"}),h.jsx(ze,{to:`/packages/${i.name}?view=graph`,className:"btn btn-outline btn-sm",children:"Diagram"})]})]})},i.name))})]})},j5=()=>h.jsx("div",{className:"hero min-h-[70vh] bg-base-200 rounded-lg",children:h.jsx("div",{className:"hero-content text-center",children:h.jsxs("div",{className:"max-w-md",children:[h.jsx("h1",{className:"text-5xl font-bold",children:"404"}),h.jsx("h2",{className:"text-2xl mt-4",children:"Page Not Found"}),h.jsx("p",{className:"py-6",children:"The page you are looking for doesn't exist or has been moved."}),h.jsx(ze,{to:"/",className:"btn btn-primary",children:"Go Home"})]})})}),O5=()=>{const t=vn(),[e,r]=U.useState({name:"",description:"",version:"1.0.0"}),[n,a]=U.useState(!1),[i,s]=U.useState(""),o=u=>{const{name:c,value:d}=u.target;r(f=>({...f,[c]:d}))},l=async u=>{var c,d;u.preventDefault(),a(!0),s("");try{const f=await Do.createDictionary(e);console.log("Dictionary created:",f),t("/dictionaries")}catch(f){console.error("Error creating dictionary:",f),s(((d=(c=f.response)==null?void 0:c.data)==null?void 0:d.message)||"Failed to create dictionary")}finally{a(!1)}};return h.jsxs("div",{className:"container mx-auto p-4",children:[h.jsx("h1",{className:"text-2xl font-bold mb-6",children:"Create New Dictionary"}),i&&h.jsx("div",{className:"alert alert-error mb-4",children:h.jsx("span",{children:i})}),h.jsxs("form",{onSubmit:l,className:"card bg-base-100 shadow-xl p-6",children:[h.jsxs("div",{className:"form-control mb-4",children:[h.jsx("label",{className:"label",children:h.jsx("span",{className:"label-text",children:"Dictionary Name"})}),h.jsx("input",{type:"text",name:"name",value:e.name,onChange:o,className:"input input-bordered",required:!0})]}),h.jsxs("div",{className:"form-control mb-4",children:[h.jsx("label",{className:"label",children:h.jsx("span",{className:"label-text",children:"Description"})}),h.jsx("textarea",{name:"description",value:e.description,onChange:o,className:"textarea textarea-bordered",rows:3})]}),h.jsxs("div",{className:"form-control mb-6",children:[h.jsx("label",{className:"label",children:h.jsx("span",{className:"label-text",children:"Version"})}),h.jsx("input",{type:"text",name:"version",value:e.version,onChange:o,className:"input input-bordered"})]}),h.jsx("div",{className:"form-control",children:h.jsx("button",{type:"submit",className:"btn btn-primary",disabled:n,children:n?"Creating...":"Create Dictionary"})})]})]})};var kr=(t=>(t.STRING="string",t.NUMBER="number",t.INTEGER="integer",t.BOOLEAN="boolean",t.DATETIME="datetime",t.DATE="date",t.TIME="time",t.DATE_TIME="date-time",t.TIMESTAMP="timestamp",t.DURATION="duration",t.ENUM="enum",t.OBJECT="object",t.ARRAY="array",t))(kr||{}),cr=(t=>(t.ONE="one",t.MANY="many",t))(cr||{}),xa=(t=>(t.STRING="string",t.NUMBER="number",t.BOOLEAN="boolean",t.DATE="date",t.FLAG="flag",t.RULE="rule",t))(xa||{});function bN({initialValues:t,onSubmit:e,onCancel:r,isEdit:n}){const[a,i]=U.useState((t==null?void 0:t.id)||""),[s,o]=U.useState((t==null?void 0:t.name)||""),[l,u]=U.useState((t==null?void 0:t.description)||""),[c,d]=U.useState((t==null?void 0:t.appliesTo)||"entity"),[f,v]=U.useState((t==null?void 0:t.metadataDefinitions)||[]),p=()=>{v([...f,{name:"",type:xa.STRING}])},y=(x,b,w)=>{const E=[...f];E[x]={...E[x],[b]:w},v(E)},m=x=>{v(f.filter((b,w)=>w!==x))},g=x=>{x.preventDefault(),!(!a||!s)&&e({id:a,name:s,description:l,appliesTo:c,metadataDefinitions:f.filter(b=>b.name)})};return h.jsxs("form",{onSubmit:g,className:"space-y-4",children:[h.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[h.jsxs("div",{className:"form-control",children:[h.jsx("label",{className:"label",children:h.jsx("span",{className:"label-text",children:"ID"})}),h.jsx("input",{type:"text",className:"input input-bordered input-sm",value:a,onChange:x=>i(x.target.value),placeholder:"kebab-case-id",disabled:n,required:!0})]}),h.jsxs("div",{className:"form-control",children:[h.jsx("label",{className:"label",children:h.jsx("span",{className:"label-text",children:"Name"})}),h.jsx("input",{type:"text",className:"input input-bordered input-sm",value:s,onChange:x=>o(x.target.value),placeholder:"Display Name",required:!0})]})]}),h.jsxs("div",{className:"form-control",children:[h.jsx("label",{className:"label",children:h.jsx("span",{className:"label-text",children:"Description"})}),h.jsx("textarea",{className:"textarea textarea-bordered textarea-sm",value:l,onChange:x=>u(x.target.value),rows:2})]}),h.jsxs("div",{className:"form-control",children:[h.jsx("label",{className:"label",children:h.jsx("span",{className:"label-text",children:"Applies To"})}),h.jsxs("select",{className:"select select-bordered select-sm",value:c,onChange:x=>d(x.target.value),children:[h.jsx("option",{value:"entity",children:"Entity"}),h.jsx("option",{value:"attribute",children:"Attribute"}),h.jsx("option",{value:"package",children:"Package"})]})]}),h.jsxs("div",{children:[h.jsxs("div",{className:"flex items-center justify-between mb-2",children:[h.jsx("label",{className:"label-text font-semibold",children:"Metadata Definitions"}),h.jsx("button",{type:"button",className:"btn btn-xs btn-primary",onClick:p,children:"Add Field"})]}),h.jsxs("div",{className:"space-y-2",children:[f.map((x,b)=>h.jsxs("div",{className:"flex items-center gap-2 p-2 bg-base-200 rounded",children:[h.jsx("input",{type:"text",className:"input input-bordered input-xs w-32",value:x.name,onChange:w=>y(b,"name",w.target.value),placeholder:"field-name"}),h.jsx("select",{className:"select select-bordered select-xs",value:x.type,onChange:w=>y(b,"type",w.target.value),children:Object.values(xa).map(w=>h.jsx("option",{value:w,children:w},w))}),h.jsxs("label",{className:"flex items-center gap-1 text-xs cursor-pointer",children:[h.jsx("input",{type:"checkbox",className:"checkbox checkbox-xs",checked:x.required||!1,onChange:w=>y(b,"required",w.target.checked)}),"Required"]}),h.jsx("input",{type:"text",className:"input input-bordered input-xs flex-1",value:x.description||"",onChange:w=>y(b,"description",w.target.value),placeholder:"Description"}),h.jsx("button",{type:"button",className:"btn btn-ghost btn-xs text-error",onClick:()=>m(b),children:"×"})]},b)),f.length===0&&h.jsx("p",{className:"text-xs text-base-content/50 p-2",children:'No metadata fields defined. Click "Add Field" above.'})]})]}),h.jsxs("div",{className:"flex gap-2 justify-end pt-2",children:[h.jsx("button",{type:"button",className:"btn btn-ghost btn-sm",onClick:r,children:"Cancel"}),h.jsx("button",{type:"submit",className:"btn btn-primary btn-sm",disabled:!a||!s,children:n?"Update":"Create"})]})]})}const M5={entity:"Entity Stereotypes",attribute:"Attribute Stereotypes",package:"Package Stereotypes"};function I5(){const[t,e]=U.useState([]),[r,n]=U.useState(!0),[a,i]=U.useState(!1),[s,o]=U.useState(null),[l,u]=U.useState(null),c=async()=>{try{n(!0);const y=await zn.getAll();e(y)}catch{u("Failed to load stereotypes")}finally{n(!1)}};U.useEffect(()=>{c()},[]);const d=async y=>{var m,g,x;try{await zn.create(y),i(!1),c()}catch(b){u(((x=(g=(m=b.response)==null?void 0:m.data)==null?void 0:g.errors)==null?void 0:x[0])||"Failed to create")}},f=async y=>{var m,g,x;try{await zn.update(y.id,y),o(null),c()}catch(b){u(((x=(g=(m=b.response)==null?void 0:m.data)==null?void 0:g.errors)==null?void 0:x[0])||"Failed to update")}},v=async y=>{var m,g,x;if(confirm(`Delete stereotype "${y}"?`))try{await zn.delete(y),c()}catch(b){u(((x=(g=(m=b.response)==null?void 0:m.data)==null?void 0:g.errors)==null?void 0:x[0])||"Failed to delete")}},p=["entity","attribute","package"].map(y=>({target:y,label:M5[y],items:t.filter(m=>m.appliesTo===y)}));return r?h.jsx("div",{className:"flex items-center justify-center h-64",children:h.jsx("span",{className:"loading loading-spinner loading-lg"})}):h.jsxs("div",{className:"p-6 space-y-6",children:[h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsxs("div",{children:[h.jsx("h1",{className:"text-2xl font-bold",children:"Stereotypes"}),h.jsx("p",{className:"text-base-content/70",children:"Define metadata schemas for packages, entities, and attributes"})]}),h.jsx("button",{className:"btn btn-primary btn-sm",onClick:()=>i(!0),children:"Create Stereotype"})]}),l&&h.jsxs("div",{className:"alert alert-error",children:[h.jsx("span",{children:l}),h.jsx("button",{className:"btn btn-ghost btn-xs",onClick:()=>u(null),children:"×"})]}),p.map(({target:y,label:m,items:g})=>h.jsxs("div",{children:[h.jsx("h2",{className:"text-lg font-semibold mb-3",children:m}),g.length===0?h.jsxs("p",{className:"text-base-content/50 text-sm mb-4",children:["No ",y," stereotypes defined."]}):h.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-3 mb-4",children:g.map(x=>h.jsx("div",{className:"card bg-base-200 shadow-sm",children:h.jsxs("div",{className:"card-body p-4",children:[h.jsxs("div",{className:"flex items-start justify-between",children:[h.jsxs("div",{children:[h.jsx("h3",{className:"font-bold",children:x.name}),h.jsx("span",{className:"badge badge-xs badge-outline",children:x.id})]}),h.jsxs("div",{className:"flex gap-1",children:[h.jsx("button",{className:"btn btn-ghost btn-xs",onClick:()=>o(x.id),children:"Edit"}),h.jsx("button",{className:"btn btn-ghost btn-xs text-error",onClick:()=>v(x.id),children:"×"})]})]}),x.description&&h.jsx("p",{className:"text-sm text-base-content/70 mt-1",children:x.description}),h.jsxs("div",{className:"mt-2",children:[h.jsxs("span",{className:"text-xs font-semibold",children:["Fields (",x.metadataDefinitions.length,"):"]}),h.jsx("div",{className:"flex flex-wrap gap-1 mt-1",children:x.metadataDefinitions.map(b=>h.jsxs("span",{className:`badge badge-sm ${b.required?"badge-primary":"badge-ghost"}`,children:[b.name,": ",b.type]},b.name))})]})]})},x.id))})]},y)),a&&h.jsxs("dialog",{className:"modal modal-open",children:[h.jsxs("div",{className:"modal-box max-w-2xl",children:[h.jsx("h3",{className:"font-bold text-lg",children:"Create Stereotype"}),h.jsx("div",{className:"mt-4",children:h.jsx(bN,{onSubmit:d,onCancel:()=>i(!1)})})]}),h.jsx("form",{method:"dialog",className:"modal-backdrop",children:h.jsx("button",{onClick:()=>i(!1),children:"close"})})]}),s&&h.jsxs("dialog",{className:"modal modal-open",children:[h.jsxs("div",{className:"modal-box max-w-2xl",children:[h.jsx("h3",{className:"font-bold text-lg",children:"Edit Stereotype"}),h.jsx("div",{className:"mt-4",children:h.jsx(bN,{initialValues:t.find(y=>y.id===s),onSubmit:f,onCancel:()=>o(null),isEdit:!0})})]}),h.jsx("form",{method:"dialog",className:"modal-backdrop",children:h.jsx("button",{onClick:()=>o(null),children:"close"})})]})]})}function F5(){const[t,e]=U.useState(null),[r,n]=U.useState(""),[a,i]=U.useState(!1),[s,o]=U.useState(!1),[l,u]=U.useState(null),c=async()=>{try{const b=await Cn.getStatus();e(b)}catch{e(null)}};U.useEffect(()=>{c()},[]);const d=(t==null?void 0:t.files)||[],f=d.length,v=typeof(t==null?void 0:t.branch)=="object"?t.branch:null,p=(v==null?void 0:v.ahead)||(t==null?void 0:t.ahead)||0,y=(v==null?void 0:v.current)||(typeof(t==null?void 0:t.branch)=="string"?t.branch:t==null?void 0:t.current)||"main",m=async()=>{var b,w;i(!0),u(null);try{const E=r.trim()||`Updated data dictionary — ${f} file${f!==1?"s":""} changed`;await us.commitChanges(E),u({type:"success",text:"Changes saved successfully."}),n(""),c()}catch(E){u({type:"error",text:((w=(b=E.response)==null?void 0:b.data)==null?void 0:w.message)||"Failed to save."})}finally{i(!1)}},g=async()=>{var b,w;o(!0),u(null);try{await Cn.push(),u({type:"success",text:"Published to shared repository."}),c()}catch(E){u({type:"error",text:((w=(b=E.response)==null?void 0:b.data)==null?void 0:w.message)||"Failed to publish. Try syncing first."})}finally{o(!1)}},x=async()=>{var b,w;u(null);try{await Cn.pull(),u({type:"success",text:"Synced with shared repository."}),c()}catch(E){u({type:"error",text:((w=(b=E.response)==null?void 0:b.data)==null?void 0:w.message)||"Failed to sync."})}};return h.jsxs("div",{className:"p-6 max-w-2xl space-y-6",children:[h.jsxs("div",{children:[h.jsx("h1",{className:"text-2xl font-bold",children:"Save & Publish"}),h.jsx("p",{className:"text-base-content/70",children:"Save your changes locally, then publish to share with the team."})]}),l&&h.jsx("div",{className:`alert ${l.type==="success"?"alert-success":"alert-error"}`,children:h.jsx("span",{children:l.text})}),h.jsxs("div",{className:"stats shadow w-full",children:[h.jsxs("div",{className:"stat",children:[h.jsx("div",{className:"stat-title",children:"Unsaved Changes"}),h.jsx("div",{className:`stat-value text-lg ${f>0?"text-warning":"text-success"}`,children:f})]}),h.jsxs("div",{className:"stat",children:[h.jsx("div",{className:"stat-title",children:"Saves Ahead"}),h.jsx("div",{className:`stat-value text-lg ${p>0?"text-info":""}`,children:p}),h.jsx("div",{className:"stat-desc",children:"Not yet published"})]}),h.jsxs("div",{className:"stat",children:[h.jsx("div",{className:"stat-title",children:"Workspace"}),h.jsx("div",{className:"stat-value text-lg font-mono",children:y})]})]}),f>0&&h.jsx("div",{className:"card bg-base-200",children:h.jsxs("div",{className:"card-body p-4",children:[h.jsx("h3",{className:"font-semibold",children:"Changed Files"}),h.jsx("ul",{className:"space-y-1 mt-2",children:d.map((b,w)=>h.jsxs("li",{className:"text-sm flex gap-2",children:[h.jsx("span",{className:`badge badge-xs ${b.status==="added"||b.working_dir==="?"?"badge-success":b.status==="deleted"?"badge-error":"badge-warning"}`,children:b.status||b.working_dir||"M"}),h.jsx("span",{className:"font-mono",children:b.path||b})]},w))})]})}),h.jsx("div",{className:"card bg-base-200",children:h.jsxs("div",{className:"card-body p-4",children:[h.jsx("h3",{className:"font-semibold",children:"Save Changes"}),h.jsx("p",{className:"text-sm text-base-content/70",children:"Save creates a checkpoint of your current changes."}),h.jsx("textarea",{className:"textarea textarea-bordered textarea-sm mt-2",placeholder:"Describe what changed (optional)...",value:r,onChange:b=>n(b.target.value),rows:2}),h.jsxs("button",{className:"btn btn-primary btn-sm mt-2 w-fit",onClick:m,disabled:a||f===0,children:[a&&h.jsx("span",{className:"loading loading-spinner loading-xs"}),"Save ",f>0?`(${f} changes)`:""]})]})}),h.jsx("div",{className:"card bg-base-200",children:h.jsxs("div",{className:"card-body p-4",children:[h.jsx("h3",{className:"font-semibold",children:"Publish & Sync"}),h.jsx("p",{className:"text-sm text-base-content/70",children:"Publish shares your saved changes with the team. Sync pulls the latest from the team."}),h.jsxs("div",{className:"flex gap-2 mt-2",children:[h.jsxs("button",{className:"btn btn-sm btn-primary",onClick:g,disabled:s||p===0,children:[s&&h.jsx("span",{className:"loading loading-spinner loading-xs"}),"Publish (",p," save",p!==1?"s":"",")"]}),h.jsx("button",{className:"btn btn-sm btn-ghost",onClick:x,children:"Sync from Team"})]})]})})]})}function B5(){const[t,e]=U.useState({current:"main",local:[],remote:[]}),[r,n]=U.useState(!0),[a,i]=U.useState(""),[s,o]=U.useState(!1),[l,u]=U.useState(null),[c,d]=U.useState(null),f=async()=>{var b;try{n(!0);const w=await Cn.getBranches(),E=typeof w.current=="object"?(b=w.current)==null?void 0:b.name:w.current||w.branch||"main";e({current:E,local:w.local||w.branches||w.all||[],remote:w.remote||[]})}catch{u("Failed to load workspaces")}finally{n(!1)}};U.useEffect(()=>{f()},[]);const v=async()=>{var w,E;if(!a.trim())return;const b=`workspace/${a.trim().replace(/\s+/g,"-").toLowerCase()}`;o(!0),u(null);try{await Cn.checkout(b,!0),d(`Workspace "${a}" created and activated.`),i(""),f()}catch(C){u(((E=(w=C.response)==null?void 0:w.data)==null?void 0:E.message)||"Failed to create workspace")}finally{o(!1)}},p=async b=>{var w,E;u(null);try{await Cn.checkout(b),d(`Switched to "${y(b)}".`),f()}catch(C){u(((E=(w=C.response)==null?void 0:w.data)==null?void 0:E.message)||"Failed to switch workspace")}},y=b=>b.startsWith("workspace/")?b.replace("workspace/",""):b,m=b=>b.startsWith("workspace/");if(r)return h.jsx("div",{className:"flex items-center justify-center h-64",children:h.jsx("span",{className:"loading loading-spinner loading-lg"})});const g=t.local.filter(m),x=t.local.filter(b=>!m(b));return h.jsxs("div",{className:"p-6 max-w-2xl space-y-6",children:[h.jsxs("div",{children:[h.jsx("h1",{className:"text-2xl font-bold",children:"Workspaces"}),h.jsx("p",{className:"text-base-content/70",children:"Work in isolated workspaces, then publish when ready."})]}),l&&h.jsx("div",{className:"alert alert-error",children:h.jsx("span",{children:l})}),c&&h.jsx("div",{className:"alert alert-success",children:h.jsx("span",{children:c})}),h.jsx("div",{className:"card bg-base-200",children:h.jsxs("div",{className:"card-body p-4",children:[h.jsx("h3",{className:"font-semibold",children:"Current Workspace"}),h.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[h.jsx("span",{className:"font-mono text-lg",children:y(t.current)}),t.current==="main"&&h.jsx("span",{className:"badge badge-primary badge-sm",children:"shared"}),m(t.current)&&h.jsx("span",{className:"badge badge-info badge-sm",children:"workspace"})]})]})}),h.jsx("div",{className:"card bg-base-200",children:h.jsxs("div",{className:"card-body p-4",children:[h.jsx("h3",{className:"font-semibold",children:"Create New Workspace"}),h.jsxs("div",{className:"flex gap-2 mt-2",children:[h.jsx("input",{type:"text",className:"input input-bordered input-sm flex-1",placeholder:"Workspace name (e.g. billing-v2)",value:a,onChange:b=>i(b.target.value)}),h.jsxs("button",{className:"btn btn-sm btn-primary",onClick:v,disabled:s||!a.trim(),children:[s&&h.jsx("span",{className:"loading loading-spinner loading-xs"}),"Create"]})]}),h.jsxs("p",{className:"text-xs text-base-content/60 mt-1",children:["Will create: workspace/",a.trim().replace(/\s+/g,"-").toLowerCase()||"..."]})]})}),g.length>0&&h.jsxs("div",{children:[h.jsx("h3",{className:"font-semibold mb-2",children:"Your Workspaces"}),h.jsx("div",{className:"space-y-2",children:g.map(b=>h.jsxs("div",{className:"flex items-center justify-between p-3 bg-base-200 rounded-lg",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("span",{className:"font-mono",children:y(b)}),b===t.current&&h.jsx("span",{className:"badge badge-success badge-xs",children:"active"})]}),b!==t.current&&h.jsx("button",{className:"btn btn-xs btn-ghost",onClick:()=>p(b),children:"Switch"})]},b))})]}),h.jsxs("div",{children:[h.jsx("h3",{className:"font-semibold mb-2",children:"Shared Branches"}),h.jsx("div",{className:"space-y-2",children:x.map(b=>h.jsxs("div",{className:"flex items-center justify-between p-3 bg-base-200 rounded-lg",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("span",{className:"font-mono",children:b}),b===t.current&&h.jsx("span",{className:"badge badge-success badge-xs",children:"active"}),b==="main"&&h.jsx("span",{className:"badge badge-primary badge-xs",children:"default"})]}),b!==t.current&&h.jsx("button",{className:"btn btn-xs btn-ghost",onClick:()=>p(b),children:"Switch"})]},b))})]})]})}function z5(){var y;const[t,e]=U.useState({current:"main",local:[]}),[r,n]=U.useState(""),[a,i]=U.useState(null),[s,o]=U.useState(!0),[l,u]=U.useState(!1),[c,d]=U.useState(null);U.useEffect(()=>{Cn.getBranches().then(m=>{e({current:m.current||m.branch||"main",local:m.local||m.branches||[]}),o(!1)}).catch(()=>o(!1))},[]);const f=async()=>{if(r)try{const m=await Cn.getDiff();i(m)}catch{i({error:"Failed to get diff preview"})}},v=async()=>{var m,g;if(r){u(!0),d(null);try{await Cn.pull(void 0),d({type:"success",text:`Merged changes from "${r}" successfully.`})}catch(x){const b=((g=(m=x.response)==null?void 0:m.data)==null?void 0:g.message)||"Merge failed. There may be conflicts to resolve.";d({type:"error",text:b})}finally{u(!1)}}};if(s)return h.jsx("div",{className:"flex items-center justify-center h-64",children:h.jsx("span",{className:"loading loading-spinner loading-lg"})});const p=t.local.filter(m=>m!==t.current);return h.jsxs("div",{className:"p-6 max-w-2xl space-y-6",children:[h.jsxs("div",{children:[h.jsx("h1",{className:"text-2xl font-bold",children:"Merge Workspaces"}),h.jsxs("p",{className:"text-base-content/70",children:["Merge changes from another workspace into your current workspace (",t.current,")."]})]}),c&&h.jsx("div",{className:`alert ${c.type==="success"?"alert-success":"alert-error"}`,children:h.jsx("span",{children:c.text})}),h.jsx("div",{className:"card bg-base-200",children:h.jsxs("div",{className:"card-body p-4",children:[h.jsx("h3",{className:"font-semibold",children:"Select Source Workspace"}),h.jsxs("div",{className:"flex gap-2 mt-2",children:[h.jsxs("select",{className:"select select-bordered select-sm flex-1",value:r,onChange:m=>n(m.target.value),children:[h.jsx("option",{value:"",children:"Choose a workspace..."}),p.map(m=>h.jsx("option",{value:m,children:m},m))]}),h.jsx("button",{className:"btn btn-sm btn-ghost",onClick:f,disabled:!r,children:"Preview"})]}),r&&h.jsx("div",{className:"mt-3 text-sm",children:h.jsxs("p",{children:["Merging ",h.jsx("span",{className:"font-mono font-bold",children:r})," ","→"," ",h.jsx("span",{className:"font-mono font-bold",children:t.current})]})})]})}),a&&!a.error&&h.jsx("div",{className:"card bg-base-200",children:h.jsxs("div",{className:"card-body p-4",children:[h.jsx("h3",{className:"font-semibold",children:"Changes Preview"}),h.jsx("div",{className:"mt-2 max-h-64 overflow-y-auto",children:((y=a.files)==null?void 0:y.length)>0?h.jsx("ul",{className:"space-y-1",children:a.files.map((m,g)=>h.jsxs("li",{className:"text-sm font-mono flex gap-2",children:[h.jsx("span",{className:`badge badge-xs ${m.status==="added"?"badge-success":m.status==="deleted"?"badge-error":"badge-warning"}`,children:m.status||"M"}),m.path||m.file||m]},g))}):h.jsx("p",{className:"text-base-content/50",children:"No differences found or diff data not available."})})]})}),r&&h.jsx("div",{className:"flex gap-2",children:h.jsxs("button",{className:"btn btn-primary",onClick:v,disabled:l,children:[l&&h.jsx("span",{className:"loading loading-spinner loading-sm"}),"Merge into ",t.current]})}),h.jsx("div",{className:"text-sm text-base-content/50",children:h.jsx("p",{children:"If the merge encounters conflicts, you will need to resolve them manually in the YAML files, then save again."})})]})}function q5(){const[t,e]=U.useState("import"),[r,n]=U.useState([]),[a,i]=U.useState(""),[s,o]=U.useState("json-schema"),[l,u]=U.useState(""),[c,d]=U.useState("json-schema"),[f,v]=U.useState(null),[p,y]=U.useState(!1);U.useEffect(()=>{at.getAllServices().then(w=>n(w.data)).catch(()=>{})},[]);const m=async()=>{var w,E,C;if(!(!l.trim()||!a)){y(!0),v(null);try{let S;if(s==="json-schema"){const A=JSON.parse(l);S=await xl.importJsonSchema(A,a)}else S=await xl.importSqlDdl(l,a);const T=((E=(w=S.data)==null?void 0:w.entities)==null?void 0:E.length)||0,P=((C=S.data)==null?void 0:C.errors)||[];v({type:P.length>0?"error":"success",text:`Imported ${T} entities.${P.length>0?` Errors: ${P.join(", ")}`:""}`})}catch(S){v({type:"error",text:S.message||"Import failed"})}finally{y(!1)}}},g=async()=>{if(a){y(!0),v(null);try{if(c==="json-schema"){const w=await xl.exportJsonSchema(a),E=new Blob([JSON.stringify(w,null,2)],{type:"application/json"});x(E,`${a}-schema.json`)}else{const w=await xl.exportMarkdown(a),E=new Blob([w],{type:"text/markdown"});x(E,`${a}-data-dictionary.md`)}v({type:"success",text:"Export downloaded."})}catch(w){v({type:"error",text:w.message||"Export failed"})}finally{y(!1)}}},x=(w,E)=>{const C=URL.createObjectURL(w),S=document.createElement("a");S.href=C,S.download=E,S.click(),URL.revokeObjectURL(C)},b=w=>{var S;const E=(S=w.target.files)==null?void 0:S[0];if(!E)return;const C=new FileReader;C.onload=()=>u(C.result),C.readAsText(E)};return h.jsxs("div",{className:"p-6 max-w-3xl space-y-6",children:[h.jsxs("div",{children:[h.jsx("h1",{className:"text-2xl font-bold",children:"Import & Export"}),h.jsx("p",{className:"text-base-content/70",children:"Import from existing schemas or export your data dictionary."})]}),f&&h.jsx("div",{className:`alert ${f.type==="success"?"alert-success":"alert-error"}`,children:h.jsx("span",{children:f.text})}),h.jsxs("div",{className:"tabs tabs-bordered",children:[h.jsx("button",{className:`tab ${t==="import"?"tab-active":""}`,onClick:()=>e("import"),children:"Import"}),h.jsx("button",{className:`tab ${t==="export"?"tab-active":""}`,onClick:()=>e("export"),children:"Export"})]}),h.jsxs("div",{className:"form-control",children:[h.jsx("label",{className:"label",children:h.jsx("span",{className:"label-text",children:"Target Service"})}),h.jsxs("select",{className:"select select-bordered",value:a,onChange:w=>i(w.target.value),children:[h.jsx("option",{value:"",children:"Select a service..."}),r.map(w=>h.jsx("option",{value:w,children:w},w))]})]}),t==="import"&&h.jsxs("div",{className:"space-y-4",children:[h.jsxs("div",{className:"form-control",children:[h.jsx("label",{className:"label",children:h.jsx("span",{className:"label-text",children:"Format"})}),h.jsxs("select",{className:"select select-bordered",value:s,onChange:w=>o(w.target.value),children:[h.jsx("option",{value:"json-schema",children:"JSON Schema"}),h.jsx("option",{value:"sql-ddl",children:"SQL DDL (CREATE TABLE)"})]})]}),h.jsxs("div",{className:"form-control",children:[h.jsx("label",{className:"label",children:h.jsx("span",{className:"label-text",children:"Upload File or Paste"})}),h.jsx("input",{type:"file",className:"file-input file-input-bordered file-input-sm",accept:".json,.sql,.txt",onChange:b})]}),h.jsx("div",{className:"form-control",children:h.jsx("textarea",{className:"textarea textarea-bordered font-mono text-sm",rows:12,placeholder:s==="json-schema"?'{"definitions": {"User": {"type": "object", "properties": {"name": {"type": "string"}}}}}':`CREATE TABLE users (
|
|
81
|
+
id SERIAL PRIMARY KEY,
|
|
82
|
+
name VARCHAR(100) NOT NULL
|
|
83
|
+
);`,value:l,onChange:w=>u(w.target.value)})}),h.jsxs("button",{className:"btn btn-primary",onClick:m,disabled:p||!l.trim()||!a,children:[p&&h.jsx("span",{className:"loading loading-spinner loading-sm"}),"Import"]})]}),t==="export"&&h.jsxs("div",{className:"space-y-4",children:[h.jsxs("div",{className:"form-control",children:[h.jsx("label",{className:"label",children:h.jsx("span",{className:"label-text",children:"Format"})}),h.jsxs("select",{className:"select select-bordered",value:c,onChange:w=>d(w.target.value),children:[h.jsx("option",{value:"json-schema",children:"JSON Schema"}),h.jsx("option",{value:"markdown",children:"Markdown Documentation"})]})]}),h.jsxs("button",{className:"btn btn-primary",onClick:g,disabled:p||!a,children:[p&&h.jsx("span",{className:"loading loading-spinner loading-sm"}),"Export & Download"]})]})]})}const U5=t=>t>=80?"text-success":t>=50?"text-warning":"text-error",wN=t=>t>=80?"badge-success":t>=50?"badge-warning":"badge-error";function $5(){const[t,e]=U.useState(null),[r,n]=U.useState(!0),[a,i]=U.useState(null);return U.useEffect(()=>{xl.getQualityReport().then(e).catch(()=>{}).finally(()=>n(!1))},[]),r?h.jsx("div",{className:"flex items-center justify-center h-64",children:h.jsx("span",{className:"loading loading-spinner loading-lg"})}):t?h.jsxs("div",{className:"p-6 space-y-6",children:[h.jsxs("div",{children:[h.jsx("h1",{className:"text-2xl font-bold",children:"Quality Dashboard"}),h.jsx("p",{className:"text-base-content/70",children:"Track documentation completeness across your data dictionary."})]}),h.jsxs("div",{className:"stats shadow w-full",children:[h.jsxs("div",{className:"stat",children:[h.jsx("div",{className:"stat-title",children:"Overall Score"}),h.jsxs("div",{className:`stat-value ${U5(t.overall)}`,children:[t.overall,"%"]})]}),h.jsxs("div",{className:"stat",children:[h.jsx("div",{className:"stat-title",children:"Packages"}),h.jsx("div",{className:"stat-value text-lg",children:t.packages.length})]}),h.jsxs("div",{className:"stat",children:[h.jsx("div",{className:"stat-title",children:"Total Entities"}),h.jsx("div",{className:"stat-value text-lg",children:t.totalEntities})]})]}),h.jsx("div",{className:"space-y-3",children:t.packages.map(s=>h.jsx("div",{className:"card bg-base-200",children:h.jsxs("div",{className:"card-body p-4",children:[h.jsxs("div",{className:"flex items-center justify-between cursor-pointer",onClick:()=>i(a===s.name?null:s.name),children:[h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsx(ze,{to:`/packages/${s.name}`,className:"font-bold text-lg link link-hover",onClick:o=>o.stopPropagation(),children:s.name}),h.jsxs("span",{className:`badge ${wN(s.overallScore)}`,children:[s.overallScore,"%"]}),h.jsxs("span",{className:"text-sm text-base-content/60",children:[s.entityCount," entities"]})]}),h.jsxs("div",{className:"flex gap-4 text-sm",children:[h.jsxs("span",{title:"Description coverage",children:["Desc: ",s.descriptionCoverage,"%"]}),h.jsxs("span",{title:"Metadata compliance",children:["Meta: ",s.metadataCoverage,"%"]}),h.jsxs("span",{title:"Relationship coverage",children:["Rels: ",s.relationshipCoverage,"%"]}),h.jsx("span",{className:"text-base-content/40",children:a===s.name?"▲":"▼"})]})]}),a===s.name&&h.jsx("div",{className:"mt-3 overflow-x-auto",children:h.jsxs("table",{className:"table table-sm",children:[h.jsx("thead",{children:h.jsxs("tr",{children:[h.jsx("th",{children:"Entity"}),h.jsx("th",{children:"Description"}),h.jsx("th",{children:"Attr Descriptions"}),h.jsx("th",{children:"Stereotype"}),h.jsx("th",{children:"Relationships"}),h.jsx("th",{children:"Score"})]})}),h.jsx("tbody",{children:s.entities.map(o=>h.jsxs("tr",{children:[h.jsx("td",{children:h.jsx(ze,{to:`/packages/${s.name}/entities/${o.name}`,className:"link link-primary font-mono",children:o.name})}),h.jsx("td",{children:o.descriptionFilled?h.jsx("span",{className:"text-success",children:"Yes"}):h.jsx("span",{className:"text-error",children:"Missing"})}),h.jsxs("td",{children:[o.attributeDescriptionRate,"%"]}),h.jsx("td",{children:o.stereotypeCompliant?h.jsx("span",{className:"text-success",children:"OK"}):h.jsx("span",{className:"text-warning",children:"Incomplete"})}),h.jsx("td",{children:o.hasRelationships?h.jsx("span",{className:"text-success",children:"Yes"}):h.jsx("span",{className:"text-error",children:"None"})}),h.jsx("td",{children:h.jsxs("span",{className:`badge badge-sm ${wN(o.score)}`,children:[o.score,"%"]})})]},o.uuid))})]})})]})},s.name))})]}):h.jsx("div",{className:"p-6",children:h.jsx("div",{className:"alert alert-error",children:"Failed to load quality report."})})}function V5(){const[t,e]=U.useState([]),[r,n]=U.useState(!0);return U.useEffect(()=>{un.getAll().then(e).catch(()=>{}).finally(()=>n(!1))},[]),r?h.jsx("div",{className:"flex items-center justify-center h-64",children:h.jsx("span",{className:"loading loading-spinner loading-lg"})}):h.jsxs("div",{className:"p-6 space-y-6",children:[h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsxs("div",{children:[h.jsx("h1",{className:"text-2xl font-bold",children:"Perspectives"}),h.jsx("p",{className:"text-base-content/70",children:"Business views over the data model"})]}),h.jsx(ze,{to:"/perspectives/create",className:"btn btn-primary btn-sm",children:"Create Perspective"})]}),t.length===0?h.jsxs("div",{className:"text-center py-12 text-base-content/50",children:[h.jsx("p",{className:"text-lg",children:"No perspectives defined yet."}),h.jsx("p",{className:"text-sm mt-1",children:"Create one to define a business view over your data model."})]}):h.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:t.map(a=>{var i;return h.jsx(ze,{to:`/perspectives/${a.uuid}`,className:"card bg-base-200 shadow-sm hover:shadow-md transition-shadow",children:h.jsxs("div",{className:"card-body p-5",children:[h.jsx("h3",{className:"card-title text-lg",children:a.name}),a.description&&h.jsx("p",{className:"text-sm text-base-content/70 line-clamp-2",children:a.description}),h.jsxs("div",{className:"flex gap-3 text-xs text-base-content/60 mt-2",children:[h.jsxs("span",{children:[a.rootEntities.length," root",a.rootEntities.length!==1?"s":""]}),h.jsxs("span",{children:[((i=a.nodes)==null?void 0:i.length)||0," annotations"]})]})]})},a.uuid)})})]})}function G5(){var p;const{id:t}=ku(),e=vn(),[r,n]=U.useState(null),[a,i]=U.useState(!0),[s,o]=U.useState(null),[l,u]=U.useState("paths");U.useEffect(()=>{t&&(i(!0),un.resolve(t).then(n).catch(()=>o("Failed to load perspective")).finally(()=>i(!1)))},[t]);const c=async()=>{if(!(!t||!confirm("Delete this perspective?")))try{await un.delete(t),e("/perspectives")}catch{o("Failed to delete")}};if(a)return h.jsx("div",{className:"flex items-center justify-center h-64",children:h.jsx("span",{className:"loading loading-spinner loading-lg"})});if(s||!r)return h.jsx("div",{className:"p-6",children:h.jsx("div",{className:"alert alert-error",children:h.jsx("span",{children:s||"Not found"})})});const d=r.resolvedNodes.filter(y=>y.isRoot),f=r.resolvedNodes.filter(y=>y.isFrontier),v=((p=r.nodes)==null?void 0:p.filter(y=>y.metadata&&y.metadata.length>0))||[];return h.jsxs("div",{className:"p-6 space-y-6",children:[h.jsxs("div",{className:"flex items-start justify-between",children:[h.jsxs("div",{children:[h.jsx("h1",{className:"text-2xl font-bold",children:r.name}),r.description&&h.jsx("p",{className:"text-base-content/70 mt-1",children:r.description})]}),h.jsxs("div",{className:"flex gap-2",children:[h.jsx(ze,{to:`/perspectives/${t}/edit`,className:"btn btn-sm btn-ghost",children:"Edit"}),h.jsx("button",{className:"btn btn-sm btn-error btn-ghost",onClick:c,children:"Delete"})]})]}),h.jsxs("div",{className:"stats stats-horizontal shadow w-full",children:[h.jsxs("div",{className:"stat",children:[h.jsx("div",{className:"stat-title",children:"Root Entities"}),h.jsx("div",{className:"stat-value text-lg",children:d.length})]}),h.jsxs("div",{className:"stat",children:[h.jsx("div",{className:"stat-title",children:"Resolved Paths"}),h.jsx("div",{className:"stat-value text-lg",children:r.resolvedNodes.length})]}),h.jsxs("div",{className:"stat",children:[h.jsx("div",{className:"stat-title",children:"Frontier Nodes"}),h.jsx("div",{className:"stat-value text-lg",children:f.length})]}),h.jsxs("div",{className:"stat",children:[h.jsx("div",{className:"stat-title",children:"Annotations"}),h.jsx("div",{className:"stat-value text-lg",children:v.length})]})]}),h.jsxs("div",{children:[h.jsxs("div",{className:"tabs tabs-bordered",children:[h.jsxs("button",{className:`tab ${l==="paths"?"tab-active":""}`,onClick:()=>u("paths"),children:["Resolved Paths (",r.resolvedNodes.length,")"]}),h.jsx("button",{className:`tab ${l==="graph"?"tab-active":""}`,onClick:()=>u("graph"),children:"Graph"}),h.jsxs("button",{className:`tab ${l==="annotations"?"tab-active":""}`,onClick:()=>u("annotations"),children:["Annotations (",v.length,")"]})]}),h.jsxs("div",{className:"mt-4",children:[l==="paths"&&h.jsx("div",{className:"overflow-x-auto",children:h.jsxs("table",{className:"table table-sm",children:[h.jsx("thead",{children:h.jsxs("tr",{children:[h.jsx("th",{children:"Path"}),h.jsx("th",{children:"Entity"}),h.jsx("th",{children:"Service"}),h.jsx("th",{children:"Hops"}),h.jsx("th",{children:"Status"})]})}),h.jsx("tbody",{children:r.resolvedNodes.map(y=>h.jsxs("tr",{className:"hover",children:[h.jsx("td",{className:"font-mono text-sm",children:y.path}),h.jsx("td",{children:h.jsx(ze,{to:`/packages/${y.service}/entities/${y.entityName}`,className:"link link-primary",children:y.entityName})}),h.jsx("td",{children:h.jsx("span",{className:"badge badge-ghost badge-sm",children:y.service})}),h.jsx("td",{children:y.hopDistance}),h.jsxs("td",{children:[y.isRoot&&h.jsx("span",{className:"badge badge-primary badge-sm mr-1",children:"root"}),y.isFrontier&&h.jsx("span",{className:"badge badge-warning badge-sm mr-1",children:"frontier"}),y.isManualInclusion&&h.jsx("span",{className:"badge badge-info badge-sm",children:"included"})]})]},y.path))})]})}),l==="graph"&&h.jsxs("div",{className:"text-center py-12 text-base-content/50",children:[h.jsx("p",{children:"Graph visualization for this perspective."}),h.jsx(ze,{to:`/visualization?perspective=${t}`,className:"btn btn-sm btn-primary mt-2",children:"Open in Visualization"})]}),l==="annotations"&&h.jsx("div",{children:v.length===0?h.jsx("p",{className:"text-base-content/50 py-4",children:"No annotations defined. Edit the perspective to add path-scoped metadata."}):h.jsx("div",{className:"space-y-3",children:v.map(y=>{var m;return h.jsxs("div",{className:"card bg-base-200 p-4",children:[h.jsx("div",{className:"font-mono text-sm font-bold",children:y.path}),y.traverse===!1&&h.jsx("span",{className:"badge badge-warning badge-xs",children:"frontier"}),y.exclude&&h.jsx("span",{className:"badge badge-error badge-xs",children:"excluded"}),h.jsx("div",{className:"mt-2 space-y-1",children:(m=y.metadata)==null?void 0:m.map((g,x)=>h.jsxs("div",{className:"flex gap-2 text-sm",children:[h.jsxs("span",{className:"font-semibold",children:[g.name,":"]}),h.jsx("span",{children:String(g.value)}),g.severity&&h.jsx("span",{className:"badge badge-xs",children:g.severity})]},x))})]},y.path)})})})]})]})]})}function H5({selected:t,onChange:e}){const[r,n]=U.useState([]),[a,i]=U.useState(""),[s,o]=U.useState(!0);U.useEffect(()=>{(async()=>{try{const f=await xi.getAllPackages(),v=[],p=(y,m)=>{for(const g of y){const x=m||g.name;if(g.entities)for(const b of g.entities)v.push({uuid:b.uuid,name:b.name,service:x});g.subPackages&&p(g.subPackages,x)}};p(f),n(v)}catch{}finally{o(!1)}})()},[]);const l=d=>{t.includes(d)?e(t.filter(f=>f!==d)):e([...t,d])},u=a?r.filter(d=>d.name.toLowerCase().includes(a.toLowerCase())||d.service.toLowerCase().includes(a.toLowerCase())):r,c=new Map;for(const d of u)c.has(d.service)||c.set(d.service,[]),c.get(d.service).push(d);return s?h.jsx("span",{className:"loading loading-spinner loading-sm"}):h.jsxs("div",{className:"space-y-2",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("input",{type:"text",className:"input input-bordered input-sm flex-1",placeholder:"Search entities...",value:a,onChange:d=>i(d.target.value)}),h.jsxs("span",{className:"text-xs text-base-content/60",children:[t.length," selected"]})]}),t.length>0&&h.jsx("div",{className:"flex flex-wrap gap-1",children:t.map(d=>{const f=r.find(v=>v.uuid===d);return h.jsxs("span",{className:"badge badge-primary badge-sm gap-1",children:[(f==null?void 0:f.name)||d.slice(0,8),h.jsx("button",{className:"text-xs",onClick:()=>l(d),children:"×"})]},d)})}),h.jsxs("div",{className:"max-h-60 overflow-y-auto border border-base-300 rounded p-2 space-y-2",children:[[...c.entries()].map(([d,f])=>h.jsxs("div",{children:[h.jsx("div",{className:"text-xs font-semibold text-base-content/60 mb-1",children:d}),f.map(v=>h.jsxs("label",{className:"flex items-center gap-2 cursor-pointer py-0.5 hover:bg-base-200 rounded px-1",children:[h.jsx("input",{type:"checkbox",className:"checkbox checkbox-xs checkbox-primary",checked:t.includes(v.uuid),onChange:()=>l(v.uuid)}),h.jsx("span",{className:"text-sm",children:v.name})]},v.uuid))]},d)),u.length===0&&h.jsx("p",{className:"text-xs text-base-content/50",children:"No entities found."})]})]})}function tM({entries:t,stereotype:e,onChange:r,readOnly:n}){const[a,i]=U.useState(""),[s,o]=U.useState(""),l=(e==null?void 0:e.metadataDefinitions)||[],u=[...t];for(const y of l)u.find(m=>m.name===y.name)||u.push({name:y.name,value:y.type==="flag"?!1:""});const c=y=>l.find(m=>m.name===y),d=(y,m,g)=>{const x=t.map(b=>b.name===y?{...b,value:m,...g!==void 0?{severity:g}:{}}:b);x.find(b=>b.name===y)||x.push({name:y,value:m,...g?{severity:g}:{}}),r(x)},f=y=>{const m=c(y);m!=null&&m.required||r(t.filter(g=>g.name!==y))},v=()=>{a.trim()&&(t.find(y=>y.name===a)||(r([...t,{name:a.trim(),value:s}]),i(""),o("")))},p=(y,m)=>{switch((m==null?void 0:m.type)||xa.STRING){case xa.FLAG:return h.jsx("input",{type:"checkbox",className:"toggle toggle-primary toggle-sm",checked:!!y.value,onChange:x=>d(y.name,x.target.checked),disabled:n});case xa.BOOLEAN:return h.jsx("input",{type:"checkbox",className:"checkbox checkbox-sm",checked:!!y.value,onChange:x=>d(y.name,x.target.checked),disabled:n});case xa.NUMBER:return h.jsx("input",{type:"number",className:"input input-bordered input-sm w-32",value:y.value,onChange:x=>d(y.name,Number(x.target.value)),disabled:n});case xa.DATE:return h.jsx("input",{type:"date",className:"input input-bordered input-sm",value:String(y.value||""),onChange:x=>d(y.name,x.target.value),disabled:n});case xa.RULE:return h.jsxs("div",{className:"flex gap-2 items-start",children:[h.jsx("textarea",{className:"textarea textarea-bordered textarea-sm flex-1",value:String(y.value||""),onChange:x=>d(y.name,x.target.value,y.severity),placeholder:"Describe the rule...",rows:2,disabled:n}),h.jsxs("select",{className:"select select-bordered select-sm",value:y.severity||"info",onChange:x=>d(y.name,y.value,x.target.value),disabled:n,children:[h.jsx("option",{value:"info",children:"Info"}),h.jsx("option",{value:"warning",children:"Warning"}),h.jsx("option",{value:"error",children:"Error"})]})]});default:return h.jsx("input",{type:"text",className:"input input-bordered input-sm flex-1",value:String(y.value||""),onChange:x=>d(y.name,x.target.value),disabled:n})}};return h.jsxs("div",{className:"space-y-3",children:[u.map(y=>{const m=c(y.name),g=m==null?void 0:m.required,x=!!m;return h.jsxs("div",{className:"flex items-start gap-3",children:[h.jsxs("div",{className:"min-w-[140px]",children:[h.jsxs("div",{className:"flex items-center gap-1",children:[h.jsx("span",{className:"font-mono text-sm",children:y.name}),g&&h.jsx("span",{className:"text-error text-xs",children:"*"})]}),(m==null?void 0:m.description)&&h.jsx("p",{className:"text-xs text-base-content/50",children:m.description}),x&&h.jsx("span",{className:"badge badge-xs badge-outline mt-0.5",children:"stereotype"})]}),h.jsx("div",{className:"flex-1",children:p(y,m)}),!n&&!g&&h.jsx("button",{className:"btn btn-ghost btn-xs text-error",onClick:()=>f(y.name),title:"Remove",children:"×"})]},y.name)}),!n&&h.jsxs("div",{className:"flex items-center gap-2 pt-2 border-t border-base-300",children:[h.jsx("input",{type:"text",className:"input input-bordered input-sm w-36",placeholder:"Key",value:a,onChange:y=>i(y.target.value)}),h.jsx("input",{type:"text",className:"input input-bordered input-sm flex-1",placeholder:"Value",value:s,onChange:y=>o(y.target.value)}),h.jsx("button",{className:"btn btn-sm btn-ghost",onClick:v,disabled:!a.trim(),children:"Add"})]}),u.length===0&&!n&&h.jsx("p",{className:"text-sm text-base-content/50",children:"No metadata. Add entries above or assign a stereotype."})]})}function EN(){const t=vn(),{id:e}=ku(),r=!!e,[n,a]=U.useState(""),[i,s]=U.useState(""),[o,l]=U.useState([]),[u,c]=U.useState(10),[d,f]=U.useState([]),[v,p]=U.useState(null),[y,m]=U.useState(!1),[g,x]=U.useState(!r);r&&!g&&un.getById(e).then(w=>{a(w.name),s(w.description||""),l(w.rootEntities),c(w.maxDepth??10),f(w.metadata||[]),x(!0)}).catch(()=>{p("Failed to load perspective"),x(!0)});const b=async w=>{var E,C,S;if(w.preventDefault(),!n||o.length===0){p("Name and at least one root entity are required");return}m(!0),p(null);try{if(r)await un.update(e,{name:n,description:i,rootEntities:o,maxDepth:u,metadata:d}),t(`/perspectives/${e}`);else{const T=await un.create({name:n,description:i,rootEntities:o,maxDepth:u,metadata:d});t(`/perspectives/${T.data.uuid}`)}}catch(T){p(((S=(C=(E=T.response)==null?void 0:E.data)==null?void 0:C.errors)==null?void 0:S[0])||"Failed to save")}finally{m(!1)}};return g?h.jsxs("div",{className:"p-6 max-w-2xl",children:[h.jsxs("h1",{className:"text-2xl font-bold mb-6",children:[r?"Edit":"Create"," Perspective"]}),v&&h.jsx("div",{className:"alert alert-error mb-4",children:h.jsx("span",{children:v})}),h.jsxs("form",{onSubmit:b,className:"space-y-5",children:[h.jsxs("div",{className:"form-control",children:[h.jsx("label",{className:"label",children:h.jsx("span",{className:"label-text",children:"Name"})}),h.jsx("input",{type:"text",className:"input input-bordered",value:n,onChange:w=>a(w.target.value),placeholder:"e.g. Ordering, Billing",required:!0})]}),h.jsxs("div",{className:"form-control",children:[h.jsx("label",{className:"label",children:h.jsx("span",{className:"label-text",children:"Description"})}),h.jsx("textarea",{className:"textarea textarea-bordered",value:i,onChange:w=>s(w.target.value),placeholder:"What business process does this perspective capture?",rows:3})]}),h.jsxs("div",{className:"form-control",children:[h.jsx("label",{className:"label",children:h.jsx("span",{className:"label-text",children:"Max Traversal Depth"})}),h.jsx("input",{type:"number",className:"input input-bordered w-24",value:u,onChange:w=>c(Number(w.target.value)),min:1,max:20}),h.jsx("label",{className:"label",children:h.jsx("span",{className:"label-text-alt",children:"How many relationship hops to follow from root entities"})})]}),h.jsxs("div",{className:"form-control",children:[h.jsx("label",{className:"label",children:h.jsx("span",{className:"label-text",children:"Root Entities"})}),h.jsx(H5,{selected:o,onChange:l})]}),h.jsxs("div",{className:"form-control",children:[h.jsx("label",{className:"label",children:h.jsx("span",{className:"label-text",children:"Perspective Metadata"})}),h.jsx(tM,{entries:d,onChange:f})]}),h.jsxs("div",{className:"flex gap-2 justify-end pt-4",children:[h.jsx("button",{type:"button",className:"btn btn-ghost",onClick:()=>t("/perspectives"),children:"Cancel"}),h.jsxs("button",{type:"submit",className:"btn btn-primary",disabled:y||!n||o.length===0,children:[y&&h.jsx("span",{className:"loading loading-spinner loading-sm"}),r?"Update":"Create"]})]})]})]}):h.jsx("div",{className:"flex items-center justify-center h-64",children:h.jsx("span",{className:"loading loading-spinner loading-lg"})})}function W5(t,e){const[r,n]=U.useState([]),[a,i]=U.useState([]),[s,o]=U.useState([]),[l,u]=U.useState(!0),[c,d]=U.useState(null);return U.useEffect(()=>{let f=!1;return(async()=>{try{u(!0),d(null);const p=[],y=[],m={},g=[];if(t&&e){const C=(await at.getEntitySchema(t,e)).data;p.push(C),m[C.uuid]=t,g.push(t);try{const S=await id.getPackageRelationships(t);y.push(...S);const T=new Set;if(S.forEach(P=>{P.source.entity===C.uuid&&T.add(P.target.entity),P.target.entity===C.uuid&&T.add(P.source.entity)}),T.size>0){const A=(await at.getServiceEntities(t)).data||[];for(const j of A)T.has(j.uuid)&&!p.find(R=>R.uuid===j.uuid)&&(p.push(j),m[j.uuid]=t)}}catch{}}else if(t){const C=(await at.getServiceEntities(t)).data||[];p.push(...C),C.forEach(S=>{m[S.uuid]=t}),g.push(t);try{const S=await id.getPackageRelationships(t);y.push(...S)}catch{}}else{const E=await at.getAllServices(),C=E.data||E,S=await Promise.all(C.map(async T=>{try{const A=(await at.getServiceEntities(T)).data||[];A.forEach(R=>{m[R.uuid]=T});let j=[];try{j=await id.getPackageRelationships(T)}catch{}return{entities:A,relationships:j,service:T}}catch{return{entities:[],relationships:[],service:T}}}));for(const T of S)p.push(...T.entities),y.push(...T.relationships),T.entities.length>0&&g.push(T.service)}if(f)return;const x=p.map(E=>({id:E.uuid,label:E.name,type:"entity",service:m[E.uuid]||"",data:E})),b=new Set(p.map(E=>E.uuid)),w=y.filter(E=>b.has(E.source.entity)&&b.has(E.target.entity)).map(E=>{const C=p.find(T=>T.uuid===E.source.entity),S=p.find(T=>T.uuid===E.target.entity);return{id:E.uuid,source:E.source.entity,target:E.target.entity,label:E.description||`${(C==null?void 0:C.name)||"?"} -> ${(S==null?void 0:S.name)||"?"}`,sourceCardinality:E.source.cardinality,targetCardinality:E.target.cardinality}});n(x),i(w),o(g)}catch(p){f||d(p.message||"Failed to fetch graph data")}finally{f||u(!1)}})(),()=>{f=!0}},[t,e]),{nodes:r,edges:a,loading:l,error:c,services:s}}function Y5(t,e,r){var a,i;const n=[];for(const s of t){const o=s.data,l=((a=o==null?void 0:o.attributes)==null?void 0:a.filter(c=>c.primaryKey).length)??0,u=((i=o==null?void 0:o.attributes)==null?void 0:i.length)??0;n.push({group:"nodes",data:{id:s.id,label:s.label,service:s.service,type:s.type,attrCount:u,pkCount:l,description:(o==null?void 0:o.description)??"",attributes:(o==null?void 0:o.attributes)??[],expanded:!1,...r!=null&&r[s.id]?{parent:r[s.id]}:{}}})}for(const s of e)n.push({group:"edges",data:{id:s.id,source:s.source,target:s.target,label:s.label||"",sourceCardinality:s.sourceCardinality??"",targetCardinality:s.targetCardinality??""}});return n}function X5(t){const e=[],r={};function n(a,i){const s=`pkg-${a.id||a.name}`;if(e.push({group:"nodes",data:{id:s,label:a.name,type:"package",...i?{parent:i}:{}}}),a.entities)for(const o of a.entities)r[o.uuid]=s;if(a.subPackages)for(const o of a.subPackages)n(o,s)}for(const a of t)n(a);return{compoundNodes:e,parentMapping:r}}function F1(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function K5(t){if(Array.isArray(t))return t}function Q5(t){if(Array.isArray(t))return F1(t)}function ki(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Z5(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,nM(n.key),n)}}function Li(t,e,r){return e&&Z5(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function Xr(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=LE(t))||e){r&&(t=r);var n=0,a=function(){};return{s:a,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:a}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
84
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i,s=!0,o=!1;return{s:function(){r=r.call(t)},n:function(){var l=r.next();return s=l.done,l},e:function(l){o=!0,i=l},f:function(){try{s||r.return==null||r.return()}finally{if(o)throw i}}}}function rM(t,e,r){return(e=nM(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function J5(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function e$(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,a,i,s,o=[],l=!0,u=!1;try{if(i=(r=r.call(t)).next,e===0){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=i.call(r)).done)&&(o.push(n.value),o.length!==e);l=!0);}catch(c){u=!0,a=c}finally{try{if(!l&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(u)throw a}}return o}}function t$(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
85
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function r$(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
86
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ht(t,e){return K5(t)||e$(t,e)||LE(t,e)||t$()}function Yd(t){return Q5(t)||J5(t)||LE(t)||r$()}function n$(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}function nM(t){var e=n$(t,"string");return typeof e=="symbol"?e:e+""}function rr(t){"@babel/helpers - typeof";return rr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},rr(t)}function LE(t,e){if(t){if(typeof t=="string")return F1(t,e);var r={}.toString.call(t).slice(8,-1);return r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set"?Array.from(t):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?F1(t,e):void 0}}var Zt=typeof window>"u"?null:window,SN=Zt?Zt.navigator:null;Zt&&Zt.document;var a$=rr(""),aM=rr({}),i$=rr(function(){}),s$=typeof HTMLElement>"u"?"undefined":rr(HTMLElement),Mu=function(e){return e&&e.instanceString&&Dt(e.instanceString)?e.instanceString():null},Ve=function(e){return e!=null&&rr(e)==a$},Dt=function(e){return e!=null&&rr(e)===i$},mt=function(e){return!cn(e)&&(Array.isArray?Array.isArray(e):e!=null&&e instanceof Array)},st=function(e){return e!=null&&rr(e)===aM&&!mt(e)&&e.constructor===Object},o$=function(e){return e!=null&&rr(e)===aM},_e=function(e){return e!=null&&rr(e)===rr(1)&&!isNaN(e)},l$=function(e){return _e(e)&&Math.floor(e)===e},Xd=function(e){if(s$!=="undefined")return e!=null&&e instanceof HTMLElement},cn=function(e){return Iu(e)||iM(e)},Iu=function(e){return Mu(e)==="collection"&&e._private.single},iM=function(e){return Mu(e)==="collection"&&!e._private.single},DE=function(e){return Mu(e)==="core"},sM=function(e){return Mu(e)==="stylesheet"},u$=function(e){return Mu(e)==="event"},bi=function(e){return e==null?!0:!!(e===""||e.match(/^\s+$/))},c$=function(e){return typeof HTMLElement>"u"?!1:e instanceof HTMLElement},d$=function(e){return st(e)&&_e(e.x1)&&_e(e.x2)&&_e(e.y1)&&_e(e.y2)},f$=function(e){return o$(e)&&Dt(e.then)},h$=function(){return SN&&SN.userAgent.match(/msie|trident|edge/i)},Eo=function(e,r){r||(r=function(){if(arguments.length===1)return arguments[0];if(arguments.length===0)return"undefined";for(var i=[],s=0;s<arguments.length;s++)i.push(arguments[s]);return i.join("$")});var n=function(){var i=this,s=arguments,o,l=r.apply(i,s),u=n.cache;return(o=u[l])||(o=u[l]=e.apply(i,s)),o};return n.cache={},n},_E=Eo(function(t){return t.replace(/([A-Z])/g,function(e){return"-"+e.toLowerCase()})}),Hf=Eo(function(t){return t.replace(/(-\w)/g,function(e){return e[1].toUpperCase()})}),oM=Eo(function(t,e){return t+e[0].toUpperCase()+e.substring(1)},function(t,e){return t+"$"+e}),CN=function(e){return bi(e)?e:e.charAt(0).toUpperCase()+e.substring(1)},ni=function(e,r){return e.slice(-1*r.length)===r},tr="(?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))",v$="rgb[a]?\\(("+tr+"[%]?)\\s*,\\s*("+tr+"[%]?)\\s*,\\s*("+tr+"[%]?)(?:\\s*,\\s*("+tr+"))?\\)",p$="rgb[a]?\\((?:"+tr+"[%]?)\\s*,\\s*(?:"+tr+"[%]?)\\s*,\\s*(?:"+tr+"[%]?)(?:\\s*,\\s*(?:"+tr+"))?\\)",g$="hsl[a]?\\(("+tr+")\\s*,\\s*("+tr+"[%])\\s*,\\s*("+tr+"[%])(?:\\s*,\\s*("+tr+"))?\\)",m$="hsl[a]?\\((?:"+tr+")\\s*,\\s*(?:"+tr+"[%])\\s*,\\s*(?:"+tr+"[%])(?:\\s*,\\s*(?:"+tr+"))?\\)",y$="\\#[0-9a-fA-F]{3}",x$="\\#[0-9a-fA-F]{6}",lM=function(e,r){return e<r?-1:e>r?1:0},b$=function(e,r){return-1*lM(e,r)},We=Object.assign!=null?Object.assign.bind(Object):function(t){for(var e=arguments,r=1;r<e.length;r++){var n=e[r];if(n!=null)for(var a=Object.keys(n),i=0;i<a.length;i++){var s=a[i];t[s]=n[s]}}return t},w$=function(e){if(!(!(e.length===4||e.length===7)||e[0]!=="#")){var r=e.length===4,n,a,i,s=16;return r?(n=parseInt(e[1]+e[1],s),a=parseInt(e[2]+e[2],s),i=parseInt(e[3]+e[3],s)):(n=parseInt(e[1]+e[2],s),a=parseInt(e[3]+e[4],s),i=parseInt(e[5]+e[6],s)),[n,a,i]}},E$=function(e){var r,n,a,i,s,o,l,u;function c(p,y,m){return m<0&&(m+=1),m>1&&(m-=1),m<1/6?p+(y-p)*6*m:m<1/2?y:m<2/3?p+(y-p)*(2/3-m)*6:p}var d=new RegExp("^"+g$+"$").exec(e);if(d){if(n=parseInt(d[1]),n<0?n=(360- -1*n%360)%360:n>360&&(n=n%360),n/=360,a=parseFloat(d[2]),a<0||a>100||(a=a/100,i=parseFloat(d[3]),i<0||i>100)||(i=i/100,s=d[4],s!==void 0&&(s=parseFloat(s),s<0||s>1)))return;if(a===0)o=l=u=Math.round(i*255);else{var f=i<.5?i*(1+a):i+a-i*a,v=2*i-f;o=Math.round(255*c(v,f,n+1/3)),l=Math.round(255*c(v,f,n)),u=Math.round(255*c(v,f,n-1/3))}r=[o,l,u,s]}return r},S$=function(e){var r,n=new RegExp("^"+v$+"$").exec(e);if(n){r=[];for(var a=[],i=1;i<=3;i++){var s=n[i];if(s[s.length-1]==="%"&&(a[i]=!0),s=parseFloat(s),a[i]&&(s=s/100*255),s<0||s>255)return;r.push(Math.floor(s))}var o=a[1]||a[2]||a[3],l=a[1]&&a[2]&&a[3];if(o&&!l)return;var u=n[4];if(u!==void 0){if(u=parseFloat(u),u<0||u>1)return;r.push(u)}}return r},C$=function(e){return N$[e.toLowerCase()]},uM=function(e){return(mt(e)?e:null)||C$(e)||w$(e)||S$(e)||E$(e)},N$={transparent:[0,0,0,0],aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],grey:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},cM=function(e){for(var r=e.map,n=e.keys,a=n.length,i=0;i<a;i++){var s=n[i];if(st(s))throw Error("Tried to set map with object key");i<n.length-1?(r[s]==null&&(r[s]={}),r=r[s]):r[s]=e.value}},dM=function(e){for(var r=e.map,n=e.keys,a=n.length,i=0;i<a;i++){var s=n[i];if(st(s))throw Error("Tried to get map with object key");if(r=r[s],r==null)return r}return r},Cc=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Fu(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var yv,NN;function Bu(){if(NN)return yv;NN=1;function t(e){var r=typeof e;return e!=null&&(r=="object"||r=="function")}return yv=t,yv}var xv,TN;function T$(){if(TN)return xv;TN=1;var t=typeof Cc=="object"&&Cc&&Cc.Object===Object&&Cc;return xv=t,xv}var bv,RN;function Wf(){if(RN)return bv;RN=1;var t=T$(),e=typeof self=="object"&&self&&self.Object===Object&&self,r=t||e||Function("return this")();return bv=r,bv}var wv,PN;function R$(){if(PN)return wv;PN=1;var t=Wf(),e=function(){return t.Date.now()};return wv=e,wv}var Ev,AN;function P$(){if(AN)return Ev;AN=1;var t=/\s/;function e(r){for(var n=r.length;n--&&t.test(r.charAt(n)););return n}return Ev=e,Ev}var Sv,kN;function A$(){if(kN)return Sv;kN=1;var t=P$(),e=/^\s+/;function r(n){return n&&n.slice(0,t(n)+1).replace(e,"")}return Sv=r,Sv}var Cv,LN;function jE(){if(LN)return Cv;LN=1;var t=Wf(),e=t.Symbol;return Cv=e,Cv}var Nv,DN;function k$(){if(DN)return Nv;DN=1;var t=jE(),e=Object.prototype,r=e.hasOwnProperty,n=e.toString,a=t?t.toStringTag:void 0;function i(s){var o=r.call(s,a),l=s[a];try{s[a]=void 0;var u=!0}catch{}var c=n.call(s);return u&&(o?s[a]=l:delete s[a]),c}return Nv=i,Nv}var Tv,_N;function L$(){if(_N)return Tv;_N=1;var t=Object.prototype,e=t.toString;function r(n){return e.call(n)}return Tv=r,Tv}var Rv,jN;function fM(){if(jN)return Rv;jN=1;var t=jE(),e=k$(),r=L$(),n="[object Null]",a="[object Undefined]",i=t?t.toStringTag:void 0;function s(o){return o==null?o===void 0?a:n:i&&i in Object(o)?e(o):r(o)}return Rv=s,Rv}var Pv,ON;function D$(){if(ON)return Pv;ON=1;function t(e){return e!=null&&typeof e=="object"}return Pv=t,Pv}var Av,MN;function zu(){if(MN)return Av;MN=1;var t=fM(),e=D$(),r="[object Symbol]";function n(a){return typeof a=="symbol"||e(a)&&t(a)==r}return Av=n,Av}var kv,IN;function _$(){if(IN)return kv;IN=1;var t=A$(),e=Bu(),r=zu(),n=0/0,a=/^[-+]0x[0-9a-f]+$/i,i=/^0b[01]+$/i,s=/^0o[0-7]+$/i,o=parseInt;function l(u){if(typeof u=="number")return u;if(r(u))return n;if(e(u)){var c=typeof u.valueOf=="function"?u.valueOf():u;u=e(c)?c+"":c}if(typeof u!="string")return u===0?u:+u;u=t(u);var d=i.test(u);return d||s.test(u)?o(u.slice(2),d?2:8):a.test(u)?n:+u}return kv=l,kv}var Lv,FN;function j$(){if(FN)return Lv;FN=1;var t=Bu(),e=R$(),r=_$(),n="Expected a function",a=Math.max,i=Math.min;function s(o,l,u){var c,d,f,v,p,y,m=0,g=!1,x=!1,b=!0;if(typeof o!="function")throw new TypeError(n);l=r(l)||0,t(u)&&(g=!!u.leading,x="maxWait"in u,f=x?a(r(u.maxWait)||0,l):f,b="trailing"in u?!!u.trailing:b);function w(O){var N=c,D=d;return c=d=void 0,m=O,v=o.apply(D,N),v}function E(O){return m=O,p=setTimeout(T,l),g?w(O):v}function C(O){var N=O-y,D=O-m,L=l-N;return x?i(L,f-D):L}function S(O){var N=O-y,D=O-m;return y===void 0||N>=l||N<0||x&&D>=f}function T(){var O=e();if(S(O))return P(O);p=setTimeout(T,C(O))}function P(O){return p=void 0,b&&c?w(O):(c=d=void 0,v)}function A(){p!==void 0&&clearTimeout(p),m=0,c=y=d=p=void 0}function j(){return p===void 0?v:P(e())}function R(){var O=e(),N=S(O);if(c=arguments,d=this,y=O,N){if(p===void 0)return E(y);if(x)return clearTimeout(p),p=setTimeout(T,l),w(y)}return p===void 0&&(p=setTimeout(T,l)),v}return R.cancel=A,R.flush=j,R}return Lv=s,Lv}var O$=j$(),qu=Fu(O$),Dv=Zt?Zt.performance:null,hM=Dv&&Dv.now?function(){return Dv.now()}:function(){return Date.now()},M$=function(){if(Zt){if(Zt.requestAnimationFrame)return function(t){Zt.requestAnimationFrame(t)};if(Zt.mozRequestAnimationFrame)return function(t){Zt.mozRequestAnimationFrame(t)};if(Zt.webkitRequestAnimationFrame)return function(t){Zt.webkitRequestAnimationFrame(t)};if(Zt.msRequestAnimationFrame)return function(t){Zt.msRequestAnimationFrame(t)}}return function(t){t&&setTimeout(function(){t(hM())},1e3/60)}}(),Kd=function(e){return M$(e)},Da=hM,Wi=9261,vM=65599,Fs=5381,pM=function(e){for(var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Wi,n=r,a;a=e.next(),!a.done;)n=n*vM+a.value|0;return n},uu=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Wi;return r*vM+e|0},cu=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Fs;return(r<<5)+r+e|0},I$=function(e,r){return e*2097152+r},Ga=function(e){return e[0]*2097152+e[1]},Nc=function(e,r){return[uu(e[0],r[0]),cu(e[1],r[1])]},BN=function(e,r){var n={value:0,done:!1},a=0,i=e.length,s={next:function(){return a<i?n.value=e[a++]:n.done=!0,n}};return pM(s,r)},cs=function(e,r){var n={value:0,done:!1},a=0,i=e.length,s={next:function(){return a<i?n.value=e.charCodeAt(a++):n.done=!0,n}};return pM(s,r)},gM=function(){return F$(arguments)},F$=function(e){for(var r,n=0;n<e.length;n++){var a=e[n];n===0?r=cs(a):r=cs(a,r)}return r};function B$(t,e,r,n,a){var i=a*Math.PI/180,s=Math.cos(i)*(t-r)-Math.sin(i)*(e-n)+r,o=Math.sin(i)*(t-r)+Math.cos(i)*(e-n)+n;return{x:s,y:o}}var z$=function(e,r,n,a,i,s){return{x:(e-n)*i+n,y:(r-a)*s+a}};function q$(t,e,r){if(r===0)return t;var n=(e.x1+e.x2)/2,a=(e.y1+e.y2)/2,i=e.w/e.h,s=1/i,o=B$(t.x,t.y,n,a,r),l=z$(o.x,o.y,n,a,i,s);return{x:l.x,y:l.y}}var zN=!0,U$=console.warn!=null,$$=console.trace!=null,OE=Number.MAX_SAFE_INTEGER||9007199254740991,mM=function(){return!0},Qd=function(){return!1},qN=function(){return 0},ME=function(){},Tt=function(e){throw new Error(e)},yM=function(e){if(e!==void 0)zN=!!e;else return zN},ht=function(e){yM()&&(U$?console.warn(e):(console.log(e),$$&&console.trace()))},V$=function(e){return We({},e)},sa=function(e){return e==null?e:mt(e)?e.slice():st(e)?V$(e):e},G$=function(e){return e.slice()},xM=function(e,r){for(r=e="";e++<36;r+=e*51&52?(e^15?8^Math.random()*(e^20?16:4):4).toString(16):"-");return r},H$={},bM=function(){return H$},mr=function(e){var r=Object.keys(e);return function(n){for(var a={},i=0;i<r.length;i++){var s=r[i],o=n==null?void 0:n[s];a[s]=o===void 0?e[s]:o}return a}},wi=function(e,r,n){for(var a=e.length-1;a>=0;a--)e[a]===r&&e.splice(a,1)},IE=function(e){e.splice(0,e.length)},W$=function(e,r){for(var n=0;n<r.length;n++){var a=r[n];e.push(a)}},Hr=function(e,r,n){return n&&(r=oM(n,r)),e[r]},ba=function(e,r,n,a){n&&(r=oM(n,r)),e[r]=a},Y$=function(){function t(){ki(this,t),this._obj={}}return Li(t,[{key:"set",value:function(r,n){return this._obj[r]=n,this}},{key:"delete",value:function(r){return this._obj[r]=void 0,this}},{key:"clear",value:function(){this._obj={}}},{key:"has",value:function(r){return this._obj[r]!==void 0}},{key:"get",value:function(r){return this._obj[r]}}])}(),Na=typeof Map<"u"?Map:Y$,X$="undefined",K$=function(){function t(e){if(ki(this,t),this._obj=Object.create(null),this.size=0,e!=null){var r;e.instanceString!=null&&e.instanceString()===this.instanceString()?r=e.toArray():r=e;for(var n=0;n<r.length;n++)this.add(r[n])}}return Li(t,[{key:"instanceString",value:function(){return"set"}},{key:"add",value:function(r){var n=this._obj;n[r]!==1&&(n[r]=1,this.size++)}},{key:"delete",value:function(r){var n=this._obj;n[r]===1&&(n[r]=0,this.size--)}},{key:"clear",value:function(){this._obj=Object.create(null)}},{key:"has",value:function(r){return this._obj[r]===1}},{key:"toArray",value:function(){var r=this;return Object.keys(this._obj).filter(function(n){return r.has(n)})}},{key:"forEach",value:function(r,n){return this.toArray().forEach(r,n)}}])}(),_o=(typeof Set>"u"?"undefined":rr(Set))!==X$?Set:K$,Yf=function(e,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(e===void 0||r===void 0||!DE(e)){Tt("An element must have a core reference and parameters set");return}var a=r.group;if(a==null&&(r.data&&r.data.source!=null&&r.data.target!=null?a="edges":a="nodes"),a!=="nodes"&&a!=="edges"){Tt("An element must be of type `nodes` or `edges`; you specified `"+a+"`");return}this.length=1,this[0]=this;var i=this._private={cy:e,single:!0,data:r.data||{},position:r.position||{x:0,y:0},autoWidth:void 0,autoHeight:void 0,autoPadding:void 0,compoundBoundsClean:!1,listeners:[],group:a,style:{},rstyle:{},styleCxts:[],styleKeys:{},removed:!0,selected:!!r.selected,selectable:r.selectable===void 0?!0:!!r.selectable,locked:!!r.locked,grabbed:!1,grabbable:r.grabbable===void 0?!0:!!r.grabbable,pannable:r.pannable===void 0?a==="edges":!!r.pannable,active:!1,classes:new _o,animation:{current:[],queue:[]},rscratch:{},scratch:r.scratch||{},edges:[],children:[],parent:r.parent&&r.parent.isNode()?r.parent:null,traversalCache:{},backgrounding:!1,bbCache:null,bbCacheShift:{x:0,y:0},bodyBounds:null,overlayBounds:null,labelBounds:{all:null,source:null,target:null,main:null},arrowBounds:{source:null,target:null,"mid-source":null,"mid-target":null}};if(i.position.x==null&&(i.position.x=0),i.position.y==null&&(i.position.y=0),r.renderedPosition){var s=r.renderedPosition,o=e.pan(),l=e.zoom();i.position={x:(s.x-o.x)/l,y:(s.y-o.y)/l}}var u=[];mt(r.classes)?u=r.classes:Ve(r.classes)&&(u=r.classes.split(/\s+/));for(var c=0,d=u.length;c<d;c++){var f=u[c];!f||f===""||i.classes.add(f)}this.createEmitter(),(n===void 0||n)&&this.restore();var v=r.style||r.css;v&&(ht("Setting a `style` bypass at element creation should be done only when absolutely necessary. Try to use the stylesheet instead."),this.style(v))},UN=function(e){return e={bfs:e.bfs||!e.dfs,dfs:e.dfs||!e.bfs},function(n,a,i){var s;st(n)&&!cn(n)&&(s=n,n=s.roots||s.root,a=s.visit,i=s.directed),i=arguments.length===2&&!Dt(a)?a:i,a=Dt(a)?a:function(){};for(var o=this._private.cy,l=n=Ve(n)?this.filter(n):n,u=[],c=[],d={},f={},v={},p=0,y,m=this.byGroup(),g=m.nodes,x=m.edges,b=0;b<l.length;b++){var w=l[b],E=w.id();w.isNode()&&(u.unshift(w),e.bfs&&(v[E]=!0,c.push(w)),f[E]=0)}for(var C=function(){var O=e.bfs?u.shift():u.pop(),N=O.id();if(e.dfs){if(v[N])return 0;v[N]=!0,c.push(O)}var D=f[N],L=d[N],_=L!=null?L.source():null,k=L!=null?L.target():null,I=L==null?void 0:O.same(_)?k[0]:_[0],F;if(F=a(O,L,I,p++,D),F===!0)return y=O,1;if(F===!1)return 1;for(var B=O.connectedEdges().filter(function(G){return(!i||G.source().same(O))&&x.has(G)}),$=0;$<B.length;$++){var W=B[$],z=W.connectedNodes().filter(function(G){return!G.same(O)&&g.has(G)}),q=z.id();z.length!==0&&!v[q]&&(z=z[0],u.push(z),e.bfs&&(v[q]=!0,c.push(z)),d[q]=W,f[q]=f[N]+1)}},S;u.length!==0&&(S=C(),!(S!==0&&S===1)););for(var T=o.collection(),P=0;P<c.length;P++){var A=c[P],j=d[A.id()];j!=null&&T.push(j),T.push(A)}return{path:o.collection(T),found:o.collection(y)}}},du={breadthFirstSearch:UN({bfs:!0}),depthFirstSearch:UN({dfs:!0})};du.bfs=du.breadthFirstSearch;du.dfs=du.depthFirstSearch;var sd={exports:{}},Q$=sd.exports,$N;function Z$(){return $N||($N=1,function(t,e){(function(){var r,n,a,i,s,o,l,u,c,d,f,v,p,y,m;a=Math.floor,d=Math.min,n=function(g,x){return g<x?-1:g>x?1:0},c=function(g,x,b,w,E){var C;if(b==null&&(b=0),E==null&&(E=n),b<0)throw new Error("lo must be non-negative");for(w==null&&(w=g.length);b<w;)C=a((b+w)/2),E(x,g[C])<0?w=C:b=C+1;return[].splice.apply(g,[b,b-b].concat(x)),x},o=function(g,x,b){return b==null&&(b=n),g.push(x),y(g,0,g.length-1,b)},s=function(g,x){var b,w;return x==null&&(x=n),b=g.pop(),g.length?(w=g[0],g[0]=b,m(g,0,x)):w=b,w},u=function(g,x,b){var w;return b==null&&(b=n),w=g[0],g[0]=x,m(g,0,b),w},l=function(g,x,b){var w;return b==null&&(b=n),g.length&&b(g[0],x)<0&&(w=[g[0],x],x=w[0],g[0]=w[1],m(g,0,b)),x},i=function(g,x){var b,w,E,C,S,T;for(x==null&&(x=n),C=(function(){T=[];for(var P=0,A=a(g.length/2);0<=A?P<A:P>A;0<=A?P++:P--)T.push(P);return T}).apply(this).reverse(),S=[],w=0,E=C.length;w<E;w++)b=C[w],S.push(m(g,b,x));return S},p=function(g,x,b){var w;if(b==null&&(b=n),w=g.indexOf(x),w!==-1)return y(g,0,w,b),m(g,w,b)},f=function(g,x,b){var w,E,C,S,T;if(b==null&&(b=n),E=g.slice(0,x),!E.length)return E;for(i(E,b),T=g.slice(x),C=0,S=T.length;C<S;C++)w=T[C],l(E,w,b);return E.sort(b).reverse()},v=function(g,x,b){var w,E,C,S,T,P,A,j,R;if(b==null&&(b=n),x*10<=g.length){if(C=g.slice(0,x).sort(b),!C.length)return C;for(E=C[C.length-1],A=g.slice(x),S=0,P=A.length;S<P;S++)w=A[S],b(w,E)<0&&(c(C,w,0,null,b),C.pop(),E=C[C.length-1]);return C}for(i(g,b),R=[],T=0,j=d(x,g.length);0<=j?T<j:T>j;0<=j?++T:--T)R.push(s(g,b));return R},y=function(g,x,b,w){var E,C,S;for(w==null&&(w=n),E=g[b];b>x;){if(S=b-1>>1,C=g[S],w(E,C)<0){g[b]=C,b=S;continue}break}return g[b]=E},m=function(g,x,b){var w,E,C,S,T;for(b==null&&(b=n),E=g.length,T=x,C=g[x],w=2*x+1;w<E;)S=w+1,S<E&&!(b(g[w],g[S])<0)&&(w=S),g[x]=g[w],x=w,w=2*x+1;return g[x]=C,y(g,T,x,b)},r=function(){g.push=o,g.pop=s,g.replace=u,g.pushpop=l,g.heapify=i,g.updateItem=p,g.nlargest=f,g.nsmallest=v;function g(x){this.cmp=x??n,this.nodes=[]}return g.prototype.push=function(x){return o(this.nodes,x,this.cmp)},g.prototype.pop=function(){return s(this.nodes,this.cmp)},g.prototype.peek=function(){return this.nodes[0]},g.prototype.contains=function(x){return this.nodes.indexOf(x)!==-1},g.prototype.replace=function(x){return u(this.nodes,x,this.cmp)},g.prototype.pushpop=function(x){return l(this.nodes,x,this.cmp)},g.prototype.heapify=function(){return i(this.nodes,this.cmp)},g.prototype.updateItem=function(x){return p(this.nodes,x,this.cmp)},g.prototype.clear=function(){return this.nodes=[]},g.prototype.empty=function(){return this.nodes.length===0},g.prototype.size=function(){return this.nodes.length},g.prototype.clone=function(){var x;return x=new g,x.nodes=this.nodes.slice(0),x},g.prototype.toArray=function(){return this.nodes.slice(0)},g.prototype.insert=g.prototype.push,g.prototype.top=g.prototype.peek,g.prototype.front=g.prototype.peek,g.prototype.has=g.prototype.contains,g.prototype.copy=g.prototype.clone,g}(),function(g,x){return t.exports=x()}(this,function(){return r})}).call(Q$)}(sd)),sd.exports}var _v,VN;function J$(){return VN||(VN=1,_v=Z$()),_v}var eV=J$(),Uu=Fu(eV),tV=mr({root:null,weight:function(e){return 1},directed:!1}),rV={dijkstra:function(e){if(!st(e)){var r=arguments;e={root:r[0],weight:r[1],directed:r[2]}}var n=tV(e),a=n.root,i=n.weight,s=n.directed,o=this,l=i,u=Ve(a)?this.filter(a)[0]:a[0],c={},d={},f={},v=this.byGroup(),p=v.nodes,y=v.edges;y.unmergeBy(function(D){return D.isLoop()});for(var m=function(L){return c[L.id()]},g=function(L,_){c[L.id()]=_,x.updateItem(L)},x=new Uu(function(D,L){return m(D)-m(L)}),b=0;b<p.length;b++){var w=p[b];c[w.id()]=w.same(u)?0:1/0,x.push(w)}for(var E=function(L,_){for(var k=(s?L.edgesTo(_):L.edgesWith(_)).intersect(y),I=1/0,F,B=0;B<k.length;B++){var $=k[B],W=l($);(W<I||!F)&&(I=W,F=$)}return{edge:F,dist:I}};x.size()>0;){var C=x.pop(),S=m(C),T=C.id();if(f[T]=S,S!==1/0)for(var P=C.neighborhood().intersect(p),A=0;A<P.length;A++){var j=P[A],R=j.id(),O=E(C,j),N=S+O.dist;N<m(j)&&(g(j,N),d[R]={node:C,edge:O.edge})}}return{distanceTo:function(L){var _=Ve(L)?p.filter(L)[0]:L[0];return f[_.id()]},pathTo:function(L){var _=Ve(L)?p.filter(L)[0]:L[0],k=[],I=_,F=I.id();if(_.length>0)for(k.unshift(_);d[F];){var B=d[F];k.unshift(B.edge),k.unshift(B.node),I=B.node,F=I.id()}return o.spawn(k)}}}},nV={kruskal:function(e){e=e||function(b){return 1};for(var r=this.byGroup(),n=r.nodes,a=r.edges,i=n.length,s=new Array(i),o=n,l=function(w){for(var E=0;E<s.length;E++){var C=s[E];if(C.has(w))return E}},u=0;u<i;u++)s[u]=this.spawn(n[u]);for(var c=a.sort(function(b,w){return e(b)-e(w)}),d=0;d<c.length;d++){var f=c[d],v=f.source()[0],p=f.target()[0],y=l(v),m=l(p),g=s[y],x=s[m];y!==m&&(o.merge(f),g.merge(x),s.splice(m,1))}return o}},aV=mr({root:null,goal:null,weight:function(e){return 1},heuristic:function(e){return 0},directed:!1}),iV={aStar:function(e){var r=this.cy(),n=aV(e),a=n.root,i=n.goal,s=n.heuristic,o=n.directed,l=n.weight;a=r.collection(a)[0],i=r.collection(i)[0];var u=a.id(),c=i.id(),d={},f={},v={},p=new Uu(function(F,B){return f[F.id()]-f[B.id()]}),y=new _o,m={},g={},x=function(B,$){p.push(B),y.add($)},b,w,E=function(){b=p.pop(),w=b.id(),y.delete(w)},C=function(B){return y.has(B)};x(a,u),d[u]=0,f[u]=s(a);for(var S=0;p.size()>0;){if(E(),S++,w===c){for(var T=[],P=i,A=c,j=g[A];T.unshift(P),j!=null&&T.unshift(j),P=m[A],P!=null;)A=P.id(),j=g[A];return{found:!0,distance:d[w],path:this.spawn(T),steps:S}}v[w]=!0;for(var R=b._private.edges,O=0;O<R.length;O++){var N=R[O];if(this.hasElementWithId(N.id())&&!(o&&N.data("source")!==w)){var D=N.source(),L=N.target(),_=D.id()!==w?D:L,k=_.id();if(this.hasElementWithId(k)&&!v[k]){var I=d[w]+l(N);if(!C(k)){d[k]=I,f[k]=I+s(_),x(_,k),m[k]=b,g[k]=N;continue}I<d[k]&&(d[k]=I,f[k]=I+s(_),m[k]=b,g[k]=N)}}}}return{found:!1,distance:void 0,path:void 0,steps:S}}},sV=mr({weight:function(e){return 1},directed:!1}),oV={floydWarshall:function(e){for(var r=this.cy(),n=sV(e),a=n.weight,i=n.directed,s=a,o=this.byGroup(),l=o.nodes,u=o.edges,c=l.length,d=c*c,f=function(W){return l.indexOf(W)},v=function(W){return l[W]},p=new Array(d),y=0;y<d;y++){var m=y%c,g=(y-m)/c;g===m?p[y]=0:p[y]=1/0}for(var x=new Array(d),b=new Array(d),w=0;w<u.length;w++){var E=u[w],C=E.source()[0],S=E.target()[0];if(C!==S){var T=f(C),P=f(S),A=T*c+P,j=s(E);if(p[A]>j&&(p[A]=j,x[A]=P,b[A]=E),!i){var R=P*c+T;!i&&p[R]>j&&(p[R]=j,x[R]=T,b[R]=E)}}}for(var O=0;O<c;O++)for(var N=0;N<c;N++)for(var D=N*c+O,L=0;L<c;L++){var _=N*c+L,k=O*c+L;p[D]+p[k]<p[_]&&(p[_]=p[D]+p[k],x[_]=x[D])}var I=function(W){return(Ve(W)?r.filter(W):W)[0]},F=function(W){return f(I(W))},B={distance:function(W,z){var q=F(W),G=F(z);return p[q*c+G]},path:function(W,z){var q=F(W),G=F(z),J=v(q);if(q===G)return J.collection();if(x[q*c+G]==null)return r.collection();var ae=r.collection(),Y=q,H;for(ae.merge(J);q!==G;)Y=q,q=x[q*c+G],H=b[Y*c+q],ae.merge(H),ae.merge(v(q));return ae}};return B}},lV=mr({weight:function(e){return 1},directed:!1,root:null}),uV={bellmanFord:function(e){var r=this,n=lV(e),a=n.weight,i=n.directed,s=n.root,o=a,l=this,u=this.cy(),c=this.byGroup(),d=c.edges,f=c.nodes,v=f.length,p=new Na,y=!1,m=[];s=u.collection(s)[0],d.unmergeBy(function(ge){return ge.isLoop()});for(var g=d.length,x=function(pe){var we=p.get(pe.id());return we||(we={},p.set(pe.id(),we)),we},b=function(pe){return(Ve(pe)?u.$(pe):pe)[0]},w=function(pe){return x(b(pe)).dist},E=function(pe){for(var we=arguments.length>1&&arguments[1]!==void 0?arguments[1]:s,xe=b(pe),Ee=[],V=xe;;){if(V==null)return r.spawn();var K=x(V),te=K.edge,ue=K.pred;if(Ee.unshift(V[0]),V.same(we)&&Ee.length>0)break;te!=null&&Ee.unshift(te),V=ue}return l.spawn(Ee)},C=0;C<v;C++){var S=f[C],T=x(S);S.same(s)?T.dist=0:T.dist=1/0,T.pred=null,T.edge=null}for(var P=!1,A=function(pe,we,xe,Ee,V,K){var te=Ee.dist+K;te<V.dist&&!xe.same(Ee.edge)&&(V.dist=te,V.pred=pe,V.edge=xe,P=!0)},j=1;j<v;j++){P=!1;for(var R=0;R<g;R++){var O=d[R],N=O.source(),D=O.target(),L=o(O),_=x(N),k=x(D);A(N,D,O,_,k,L),i||A(D,N,O,k,_,L)}if(!P)break}if(P)for(var I=[],F=0;F<g;F++){var B=d[F],$=B.source(),W=B.target(),z=o(B),q=x($).dist,G=x(W).dist;if(q+z<G||!i&&G+z<q)if(y||(ht("Graph contains a negative weight cycle for Bellman-Ford"),y=!0),e.findNegativeWeightCycles!==!1){var J=[];q+z<G&&J.push($),!i&&G+z<q&&J.push(W);for(var ae=J.length,Y=0;Y<ae;Y++){var H=J[Y],X=[H];X.push(x(H).edge);for(var ee=x(H).pred;X.indexOf(ee)===-1;)X.push(ee),X.push(x(ee).edge),ee=x(ee).pred;X=X.slice(X.indexOf(ee));for(var ie=X[0].id(),oe=0,me=2;me<X.length;me+=2)X[me].id()<ie&&(ie=X[me].id(),oe=me);X=X.slice(oe).concat(X.slice(0,oe)),X.push(X[0]);var De=X.map(function(ge){return ge.id()}).join(",");I.indexOf(De)===-1&&(m.push(l.spawn(X)),I.push(De))}}else break}return{distanceTo:w,pathTo:E,hasNegativeWeightCycle:y,negativeWeightCycles:m}}},cV=Math.sqrt(2),dV=function(e,r,n){n.length===0&&Tt("Karger-Stein must be run on a connected (sub)graph");for(var a=n[e],i=a[1],s=a[2],o=r[i],l=r[s],u=n,c=u.length-1;c>=0;c--){var d=u[c],f=d[1],v=d[2];(r[f]===o&&r[v]===l||r[f]===l&&r[v]===o)&&u.splice(c,1)}for(var p=0;p<u.length;p++){var y=u[p];y[1]===l?(u[p]=y.slice(),u[p][1]=o):y[2]===l&&(u[p]=y.slice(),u[p][2]=o)}for(var m=0;m<r.length;m++)r[m]===l&&(r[m]=o);return u},jv=function(e,r,n,a){for(;n>a;){var i=Math.floor(Math.random()*r.length);r=dV(i,e,r),n--}return r},fV={kargerStein:function(){var e=this,r=this.byGroup(),n=r.nodes,a=r.edges;a.unmergeBy(function(k){return k.isLoop()});var i=n.length,s=a.length,o=Math.ceil(Math.pow(Math.log(i)/Math.LN2,2)),l=Math.floor(i/cV);if(i<2){Tt("At least 2 nodes are required for Karger-Stein algorithm");return}for(var u=[],c=0;c<s;c++){var d=a[c];u.push([c,n.indexOf(d.source()),n.indexOf(d.target())])}for(var f=1/0,v=[],p=new Array(i),y=new Array(i),m=new Array(i),g=function(I,F){for(var B=0;B<i;B++)F[B]=I[B]},x=0;x<=o;x++){for(var b=0;b<i;b++)y[b]=b;var w=jv(y,u.slice(),i,l),E=w.slice();g(y,m);var C=jv(y,w,l,2),S=jv(m,E,l,2);C.length<=S.length&&C.length<f?(f=C.length,v=C,g(y,p)):S.length<=C.length&&S.length<f&&(f=S.length,v=S,g(m,p))}for(var T=this.spawn(v.map(function(k){return a[k[0]]})),P=this.spawn(),A=this.spawn(),j=p[0],R=0;R<p.length;R++){var O=p[R],N=n[R];O===j?P.merge(N):A.merge(N)}var D=function(I){var F=e.spawn();return I.forEach(function(B){F.merge(B),B.connectedEdges().forEach(function($){e.contains($)&&!T.contains($)&&F.merge($)})}),F},L=[D(P),D(A)],_={cut:T,components:L,partition1:P,partition2:A};return _}},Ov,hV=function(e){return{x:e.x,y:e.y}},Xf=function(e,r,n){return{x:e.x*r+n.x,y:e.y*r+n.y}},wM=function(e,r,n){return{x:(e.x-n.x)/r,y:(e.y-n.y)/r}},Js=function(e){return{x:e[0],y:e[1]}},vV=function(e){for(var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,a=1/0,i=r;i<n;i++){var s=e[i];isFinite(s)&&(a=Math.min(s,a))}return a},pV=function(e){for(var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,a=-1/0,i=r;i<n;i++){var s=e[i];isFinite(s)&&(a=Math.max(s,a))}return a},gV=function(e){for(var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,a=0,i=0,s=r;s<n;s++){var o=e[s];isFinite(o)&&(a+=o,i++)}return a/i},mV=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0;a?e=e.slice(r,n):(n<e.length&&e.splice(n,e.length-n),r>0&&e.splice(0,r));for(var o=0,l=e.length-1;l>=0;l--){var u=e[l];s?isFinite(u)||(e[l]=-1/0,o++):e.splice(l,1)}i&&e.sort(function(f,v){return f-v});var c=e.length,d=Math.floor(c/2);return c%2!==0?e[d+1+o]:(e[d-1+o]+e[d+o])/2},yV=function(e){return Math.PI*e/180},Tc=function(e,r){return Math.atan2(r,e)-Math.PI/2},FE=Math.log2||function(t){return Math.log(t)/Math.log(2)},BE=function(e){return e>0?1:e<0?-1:0},ds=function(e,r){return Math.sqrt(Vi(e,r))},Vi=function(e,r){var n=r.x-e.x,a=r.y-e.y;return n*n+a*a},xV=function(e){for(var r=e.length,n=0,a=0;a<r;a++)n+=e[a];for(var i=0;i<r;i++)e[i]=e[i]/n;return e},ar=function(e,r,n,a){return(1-a)*(1-a)*e+2*(1-a)*a*r+a*a*n},uo=function(e,r,n,a){return{x:ar(e.x,r.x,n.x,a),y:ar(e.y,r.y,n.y,a)}},bV=function(e,r,n,a){var i={x:r.x-e.x,y:r.y-e.y},s=ds(e,r),o={x:i.x/s,y:i.y/s};return n=n??0,a=a??n*s,{x:e.x+o.x*a,y:e.y+o.y*a}},fu=function(e,r,n){return Math.max(e,Math.min(n,r))},Ir=function(e){if(e==null)return{x1:1/0,y1:1/0,x2:-1/0,y2:-1/0,w:0,h:0};if(e.x1!=null&&e.y1!=null){if(e.x2!=null&&e.y2!=null&&e.x2>=e.x1&&e.y2>=e.y1)return{x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2,w:e.x2-e.x1,h:e.y2-e.y1};if(e.w!=null&&e.h!=null&&e.w>=0&&e.h>=0)return{x1:e.x1,y1:e.y1,x2:e.x1+e.w,y2:e.y1+e.h,w:e.w,h:e.h}}},wV=function(e){return{x1:e.x1,x2:e.x2,w:e.w,y1:e.y1,y2:e.y2,h:e.h}},EV=function(e){e.x1=1/0,e.y1=1/0,e.x2=-1/0,e.y2=-1/0,e.w=0,e.h=0},SV=function(e,r){e.x1=Math.min(e.x1,r.x1),e.x2=Math.max(e.x2,r.x2),e.w=e.x2-e.x1,e.y1=Math.min(e.y1,r.y1),e.y2=Math.max(e.y2,r.y2),e.h=e.y2-e.y1},EM=function(e,r,n){e.x1=Math.min(e.x1,r),e.x2=Math.max(e.x2,r),e.w=e.x2-e.x1,e.y1=Math.min(e.y1,n),e.y2=Math.max(e.y2,n),e.h=e.y2-e.y1},od=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return e.x1-=r,e.x2+=r,e.y1-=r,e.y2+=r,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},ld=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0],n,a,i,s;if(r.length===1)n=a=i=s=r[0];else if(r.length===2)n=i=r[0],s=a=r[1];else if(r.length===4){var o=Ht(r,4);n=o[0],a=o[1],i=o[2],s=o[3]}return e.x1-=s,e.x2+=a,e.y1-=n,e.y2+=i,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},GN=function(e,r){e.x1=r.x1,e.y1=r.y1,e.x2=r.x2,e.y2=r.y2,e.w=e.x2-e.x1,e.h=e.y2-e.y1},zE=function(e,r){return!(e.x1>r.x2||r.x1>e.x2||e.x2<r.x1||r.x2<e.x1||e.y2<r.y1||r.y2<e.y1||e.y1>r.y2||r.y1>e.y2)},ai=function(e,r,n){return e.x1<=r&&r<=e.x2&&e.y1<=n&&n<=e.y2},HN=function(e,r){return ai(e,r.x,r.y)},SM=function(e,r){return ai(e,r.x1,r.y1)&&ai(e,r.x2,r.y2)},CV=(Ov=Math.hypot)!==null&&Ov!==void 0?Ov:function(t,e){return Math.sqrt(t*t+e*e)};function NV(t,e){if(t.length<3)throw new Error("Need at least 3 vertices");var r=function(T,P){return{x:T.x+P.x,y:T.y+P.y}},n=function(T,P){return{x:T.x-P.x,y:T.y-P.y}},a=function(T,P){return{x:T.x*P,y:T.y*P}},i=function(T,P){return T.x*P.y-T.y*P.x},s=function(T){var P=CV(T.x,T.y);return P===0?{x:0,y:0}:{x:T.x/P,y:T.y/P}},o=function(T){for(var P=0,A=0;A<T.length;A++){var j=T[A],R=T[(A+1)%T.length];P+=j.x*R.y-R.x*j.y}return P/2},l=function(T,P,A,j){var R=n(P,T),O=n(j,A),N=i(R,O);if(Math.abs(N)<1e-9)return r(T,a(R,.5));var D=i(n(A,T),O)/N;return r(T,a(R,D))},u=t.map(function(S){return{x:S.x,y:S.y}});o(u)<0&&u.reverse();for(var c=u.length,d=[],f=0;f<c;f++){var v=u[f],p=u[(f+1)%c],y=n(p,v),m=s({x:y.y,y:-y.x});d.push(m)}for(var g=d.map(function(S,T){var P=r(u[T],a(S,e)),A=r(u[(T+1)%c],a(S,e));return{p1:P,p2:A}}),x=[],b=0;b<c;b++){var w=g[(b-1+c)%c],E=g[b],C=l(w.p1,w.p2,E.p1,E.p2);x.push(C)}return x}function TV(t,e,r,n,a,i){var s=OV(t,e,r,n,a),o=NV(s,i),l=Ir();return o.forEach(function(u){return EM(l,u.x,u.y)}),l}var CM=function(e,r,n,a,i,s,o){var l=arguments.length>7&&arguments[7]!==void 0?arguments[7]:"auto",u=l==="auto"?Ei(i,s):l,c=i/2,d=s/2;u=Math.min(u,c,d);var f=u!==c,v=u!==d,p;if(f){var y=n-c+u-o,m=a-d-o,g=n+c-u+o,x=m;if(p=ii(e,r,n,a,y,m,g,x,!1),p.length>0)return p}if(v){var b=n+c+o,w=a-d+u-o,E=b,C=a+d-u+o;if(p=ii(e,r,n,a,b,w,E,C,!1),p.length>0)return p}if(f){var S=n-c+u-o,T=a+d+o,P=n+c-u+o,A=T;if(p=ii(e,r,n,a,S,T,P,A,!1),p.length>0)return p}if(v){var j=n-c-o,R=a-d+u-o,O=j,N=a+d-u+o;if(p=ii(e,r,n,a,j,R,O,N,!1),p.length>0)return p}var D;{var L=n-c+u,_=a-d+u;if(D=bl(e,r,n,a,L,_,u+o),D.length>0&&D[0]<=L&&D[1]<=_)return[D[0],D[1]]}{var k=n+c-u,I=a-d+u;if(D=bl(e,r,n,a,k,I,u+o),D.length>0&&D[0]>=k&&D[1]<=I)return[D[0],D[1]]}{var F=n+c-u,B=a+d-u;if(D=bl(e,r,n,a,F,B,u+o),D.length>0&&D[0]>=F&&D[1]>=B)return[D[0],D[1]]}{var $=n-c+u,W=a+d-u;if(D=bl(e,r,n,a,$,W,u+o),D.length>0&&D[0]<=$&&D[1]>=W)return[D[0],D[1]]}return[]},RV=function(e,r,n,a,i,s,o){var l=o,u=Math.min(n,i),c=Math.max(n,i),d=Math.min(a,s),f=Math.max(a,s);return u-l<=e&&e<=c+l&&d-l<=r&&r<=f+l},PV=function(e,r,n,a,i,s,o,l,u){var c={x1:Math.min(n,o,i)-u,x2:Math.max(n,o,i)+u,y1:Math.min(a,l,s)-u,y2:Math.max(a,l,s)+u};return!(e<c.x1||e>c.x2||r<c.y1||r>c.y2)},AV=function(e,r,n,a){n-=a;var i=r*r-4*e*n;if(i<0)return[];var s=Math.sqrt(i),o=2*e,l=(-r+s)/o,u=(-r-s)/o;return[l,u]},kV=function(e,r,n,a,i){var s=1e-5;e===0&&(e=s),r/=e,n/=e,a/=e;var o,l,u,c,d,f,v,p;if(l=(3*n-r*r)/9,u=-(27*a)+r*(9*n-2*(r*r)),u/=54,o=l*l*l+u*u,i[1]=0,v=r/3,o>0){d=u+Math.sqrt(o),d=d<0?-Math.pow(-d,1/3):Math.pow(d,1/3),f=u-Math.sqrt(o),f=f<0?-Math.pow(-f,1/3):Math.pow(f,1/3),i[0]=-v+d+f,v+=(d+f)/2,i[4]=i[2]=-v,v=Math.sqrt(3)*(-f+d)/2,i[3]=v,i[5]=-v;return}if(i[5]=i[3]=0,o===0){p=u<0?-Math.pow(-u,1/3):Math.pow(u,1/3),i[0]=-v+2*p,i[4]=i[2]=-(p+v);return}l=-l,c=l*l*l,c=Math.acos(u/Math.sqrt(c)),p=2*Math.sqrt(l),i[0]=-v+p*Math.cos(c/3),i[2]=-v+p*Math.cos((c+2*Math.PI)/3),i[4]=-v+p*Math.cos((c+4*Math.PI)/3)},LV=function(e,r,n,a,i,s,o,l){var u=1*n*n-4*n*i+2*n*o+4*i*i-4*i*o+o*o+a*a-4*a*s+2*a*l+4*s*s-4*s*l+l*l,c=1*9*n*i-3*n*n-3*n*o-6*i*i+3*i*o+9*a*s-3*a*a-3*a*l-6*s*s+3*s*l,d=1*3*n*n-6*n*i+n*o-n*e+2*i*i+2*i*e-o*e+3*a*a-6*a*s+a*l-a*r+2*s*s+2*s*r-l*r,f=1*n*i-n*n+n*e-i*e+a*s-a*a+a*r-s*r,v=[];kV(u,c,d,f,v);for(var p=1e-7,y=[],m=0;m<6;m+=2)Math.abs(v[m+1])<p&&v[m]>=0&&v[m]<=1&&y.push(v[m]);y.push(1),y.push(0);for(var g=-1,x,b,w,E=0;E<y.length;E++)x=Math.pow(1-y[E],2)*n+2*(1-y[E])*y[E]*i+y[E]*y[E]*o,b=Math.pow(1-y[E],2)*a+2*(1-y[E])*y[E]*s+y[E]*y[E]*l,w=Math.pow(x-e,2)+Math.pow(b-r,2),g>=0?w<g&&(g=w):g=w;return g},DV=function(e,r,n,a,i,s){var o=[e-n,r-a],l=[i-n,s-a],u=l[0]*l[0]+l[1]*l[1],c=o[0]*o[0]+o[1]*o[1],d=o[0]*l[0]+o[1]*l[1],f=d*d/u;return d<0?c:f>u?(e-i)*(e-i)+(r-s)*(r-s):c-f},Wr=function(e,r,n){for(var a,i,s,o,l,u=0,c=0;c<n.length/2;c++)if(a=n[c*2],i=n[c*2+1],c+1<n.length/2?(s=n[(c+1)*2],o=n[(c+1)*2+1]):(s=n[(c+1-n.length/2)*2],o=n[(c+1-n.length/2)*2+1]),!(a==e&&s==e))if(a>=e&&e>=s||a<=e&&e<=s)l=(e-a)/(s-a)*(o-i)+i,l>r&&u++;else continue;return u%2!==0},_a=function(e,r,n,a,i,s,o,l,u){var c=new Array(n.length),d;l[0]!=null?(d=Math.atan(l[1]/l[0]),l[0]<0?d=d+Math.PI/2:d=-d-Math.PI/2):d=l;for(var f=Math.cos(-d),v=Math.sin(-d),p=0;p<c.length/2;p++)c[p*2]=s/2*(n[p*2]*f-n[p*2+1]*v),c[p*2+1]=o/2*(n[p*2+1]*f+n[p*2]*v),c[p*2]+=a,c[p*2+1]+=i;var y;if(u>0){var m=Jd(c,-u);y=Zd(m)}else y=c;return Wr(e,r,y)},_V=function(e,r,n,a,i,s,o,l){for(var u=new Array(n.length*2),c=0;c<l.length;c++){var d=l[c];u[c*4+0]=d.startX,u[c*4+1]=d.startY,u[c*4+2]=d.stopX,u[c*4+3]=d.stopY;var f=Math.pow(d.cx-e,2)+Math.pow(d.cy-r,2);if(f<=Math.pow(d.radius,2))return!0}return Wr(e,r,u)},Zd=function(e){for(var r=new Array(e.length/2),n,a,i,s,o,l,u,c,d=0;d<e.length/4;d++){n=e[d*4],a=e[d*4+1],i=e[d*4+2],s=e[d*4+3],d<e.length/4-1?(o=e[(d+1)*4],l=e[(d+1)*4+1],u=e[(d+1)*4+2],c=e[(d+1)*4+3]):(o=e[0],l=e[1],u=e[2],c=e[3]);var f=ii(n,a,i,s,o,l,u,c,!0);r[d*2]=f[0],r[d*2+1]=f[1]}return r},Jd=function(e,r){for(var n=new Array(e.length*2),a,i,s,o,l=0;l<e.length/2;l++){a=e[l*2],i=e[l*2+1],l<e.length/2-1?(s=e[(l+1)*2],o=e[(l+1)*2+1]):(s=e[0],o=e[1]);var u=o-i,c=-(s-a),d=Math.sqrt(u*u+c*c),f=u/d,v=c/d;n[l*4]=a+f*r,n[l*4+1]=i+v*r,n[l*4+2]=s+f*r,n[l*4+3]=o+v*r}return n},jV=function(e,r,n,a,i,s){var o=n-e,l=a-r;o/=i,l/=s;var u=Math.sqrt(o*o+l*l),c=u-1;if(c<0)return[];var d=c/u;return[(n-e)*d+e,(a-r)*d+r]},Ji=function(e,r,n,a,i,s,o){return e-=i,r-=s,e/=n/2+o,r/=a/2+o,e*e+r*r<=1},bl=function(e,r,n,a,i,s,o){var l=[n-e,a-r],u=[e-i,r-s],c=l[0]*l[0]+l[1]*l[1],d=2*(u[0]*l[0]+u[1]*l[1]),f=u[0]*u[0]+u[1]*u[1]-o*o,v=d*d-4*c*f;if(v<0)return[];var p=(-d+Math.sqrt(v))/(2*c),y=(-d-Math.sqrt(v))/(2*c),m=Math.min(p,y),g=Math.max(p,y),x=[];if(m>=0&&m<=1&&x.push(m),g>=0&&g<=1&&x.push(g),x.length===0)return[];var b=x[0]*l[0]+e,w=x[0]*l[1]+r;if(x.length>1){if(x[0]==x[1])return[b,w];var E=x[1]*l[0]+e,C=x[1]*l[1]+r;return[b,w,E,C]}else return[b,w]},Mv=function(e,r,n){return r<=e&&e<=n||n<=e&&e<=r?e:e<=r&&r<=n||n<=r&&r<=e?r:n},ii=function(e,r,n,a,i,s,o,l,u){var c=e-i,d=n-e,f=o-i,v=r-s,p=a-r,y=l-s,m=f*v-y*c,g=d*v-p*c,x=y*d-f*p;if(x!==0){var b=m/x,w=g/x,E=.001,C=0-E,S=1+E;return C<=b&&b<=S&&C<=w&&w<=S?[e+b*d,r+b*p]:u?[e+b*d,r+b*p]:[]}else return m===0||g===0?Mv(e,n,o)===o?[o,l]:Mv(e,n,i)===i?[i,s]:Mv(i,o,n)===n?[n,a]:[]:[]},OV=function(e,r,n,a,i){var s=[],o=a/2,l=i/2,u=r,c=n;s.push({x:u+o*e[0],y:c+l*e[1]});for(var d=1;d<e.length/2;d++)s.push({x:u+o*e[d*2],y:c+l*e[d*2+1]});return s},hu=function(e,r,n,a,i,s,o,l){var u=[],c,d=new Array(n.length),f=!0;s==null&&(f=!1);var v;if(f){for(var p=0;p<d.length/2;p++)d[p*2]=n[p*2]*s+a,d[p*2+1]=n[p*2+1]*o+i;if(l>0){var y=Jd(d,-l);v=Zd(y)}else v=d}else v=n;for(var m,g,x,b,w=0;w<v.length/2;w++)m=v[w*2],g=v[w*2+1],w<v.length/2-1?(x=v[(w+1)*2],b=v[(w+1)*2+1]):(x=v[0],b=v[1]),c=ii(e,r,a,i,m,g,x,b),c.length!==0&&u.push(c[0],c[1]);return u},MV=function(e,r,n,a,i,s,o,l,u){var c=[],d,f=new Array(n.length*2);u.forEach(function(x,b){b===0?(f[f.length-2]=x.startX,f[f.length-1]=x.startY):(f[b*4-2]=x.startX,f[b*4-1]=x.startY),f[b*4]=x.stopX,f[b*4+1]=x.stopY,d=bl(e,r,a,i,x.cx,x.cy,x.radius),d.length!==0&&c.push(d[0],d[1])});for(var v=0;v<f.length/4;v++)d=ii(e,r,a,i,f[v*4],f[v*4+1],f[v*4+2],f[v*4+3],!1),d.length!==0&&c.push(d[0],d[1]);if(c.length>2){for(var p=[c[0],c[1]],y=Math.pow(p[0]-e,2)+Math.pow(p[1]-r,2),m=1;m<c.length/2;m++){var g=Math.pow(c[m*2]-e,2)+Math.pow(c[m*2+1]-r,2);g<=y&&(p[0]=c[m*2],p[1]=c[m*2+1],y=g)}return p}return c},Rc=function(e,r,n){var a=[e[0]-r[0],e[1]-r[1]],i=Math.sqrt(a[0]*a[0]+a[1]*a[1]),s=(i-n)/i;return s<0&&(s=1e-5),[r[0]+s*a[0],r[1]+s*a[1]]},Lr=function(e,r){var n=B1(e,r);return n=NM(n),n},NM=function(e){for(var r,n,a=e.length/2,i=1/0,s=1/0,o=-1/0,l=-1/0,u=0;u<a;u++)r=e[2*u],n=e[2*u+1],i=Math.min(i,r),o=Math.max(o,r),s=Math.min(s,n),l=Math.max(l,n);for(var c=2/(o-i),d=2/(l-s),f=0;f<a;f++)r=e[2*f]=e[2*f]*c,n=e[2*f+1]=e[2*f+1]*d,i=Math.min(i,r),o=Math.max(o,r),s=Math.min(s,n),l=Math.max(l,n);if(s<-1)for(var v=0;v<a;v++)n=e[2*v+1]=e[2*v+1]+(-1-s);return e},B1=function(e,r){var n=1/e*2*Math.PI,a=e%2===0?Math.PI/2+n/2:Math.PI/2;a+=r;for(var i=new Array(e*2),s,o=0;o<e;o++)s=o*n+a,i[2*o]=Math.cos(s),i[2*o+1]=Math.sin(-s);return i},Ei=function(e,r){return Math.min(e/4,r/4,8)},TM=function(e,r){return Math.min(e/10,r/10,8)},qE=function(){return 8},IV=function(e,r,n){return[e-2*r+n,2*(r-e),e]},z1=function(e,r){return{heightOffset:Math.min(15,.05*r),widthOffset:Math.min(100,.25*e),ctrlPtOffsetPct:.05}};function Iv(t,e){function r(d){for(var f=[],v=0;v<d.length;v++){var p=d[v],y=d[(v+1)%d.length],m={x:y.x-p.x,y:y.y-p.y},g={x:-m.y,y:m.x},x=Math.sqrt(g.x*g.x+g.y*g.y);f.push({x:g.x/x,y:g.y/x})}return f}function n(d,f){var v=1/0,p=-1/0,y=Xr(d),m;try{for(y.s();!(m=y.n()).done;){var g=m.value,x=g.x*f.x+g.y*f.y;v=Math.min(v,x),p=Math.max(p,x)}}catch(b){y.e(b)}finally{y.f()}return{min:v,max:p}}function a(d,f){return!(d.max<f.min||f.max<d.min)}var i=[].concat(Yd(r(t)),Yd(r(e))),s=Xr(i),o;try{for(s.s();!(o=s.n()).done;){var l=o.value,u=n(t,l),c=n(e,l);if(!a(u,c))return!1}}catch(d){s.e(d)}finally{s.f()}return!0}var FV=mr({dampingFactor:.8,precision:1e-6,iterations:200,weight:function(e){return 1}}),BV={pageRank:function(e){for(var r=FV(e),n=r.dampingFactor,a=r.precision,i=r.iterations,s=r.weight,o=this._private.cy,l=this.byGroup(),u=l.nodes,c=l.edges,d=u.length,f=d*d,v=c.length,p=new Array(f),y=new Array(d),m=(1-n)/d,g=0;g<d;g++){for(var x=0;x<d;x++){var b=g*d+x;p[b]=0}y[g]=0}for(var w=0;w<v;w++){var E=c[w],C=E.data("source"),S=E.data("target");if(C!==S){var T=u.indexOfId(C),P=u.indexOfId(S),A=s(E),j=P*d+T;p[j]+=A,y[T]+=A}}for(var R=1/d+m,O=0;O<d;O++)if(y[O]===0)for(var N=0;N<d;N++){var D=N*d+O;p[D]=R}else for(var L=0;L<d;L++){var _=L*d+O;p[_]=p[_]/y[O]+m}for(var k=new Array(d),I=new Array(d),F,B=0;B<d;B++)k[B]=1;for(var $=0;$<i;$++){for(var W=0;W<d;W++)I[W]=0;for(var z=0;z<d;z++)for(var q=0;q<d;q++){var G=z*d+q;I[z]+=p[G]*k[q]}xV(I),F=k,k=I,I=F;for(var J=0,ae=0;ae<d;ae++){var Y=F[ae]-k[ae];J+=Y*Y}if(J<a)break}var H={rank:function(ee){return ee=o.collection(ee)[0],k[u.indexOf(ee)]}};return H}},WN=mr({root:null,weight:function(e){return 1},directed:!1,alpha:0}),co={degreeCentralityNormalized:function(e){e=WN(e);var r=this.cy(),n=this.nodes(),a=n.length;if(e.directed){for(var c={},d={},f=0,v=0,p=0;p<a;p++){var y=n[p],m=y.id();e.root=y;var g=this.degreeCentrality(e);f<g.indegree&&(f=g.indegree),v<g.outdegree&&(v=g.outdegree),c[m]=g.indegree,d[m]=g.outdegree}return{indegree:function(b){return f==0?0:(Ve(b)&&(b=r.filter(b)),c[b.id()]/f)},outdegree:function(b){return v===0?0:(Ve(b)&&(b=r.filter(b)),d[b.id()]/v)}}}else{for(var i={},s=0,o=0;o<a;o++){var l=n[o];e.root=l;var u=this.degreeCentrality(e);s<u.degree&&(s=u.degree),i[l.id()]=u.degree}return{degree:function(b){return s===0?0:(Ve(b)&&(b=r.filter(b)),i[b.id()]/s)}}}},degreeCentrality:function(e){e=WN(e);var r=this.cy(),n=this,a=e,i=a.root,s=a.weight,o=a.directed,l=a.alpha;if(i=r.collection(i)[0],o){for(var v=i.connectedEdges(),p=v.filter(function(C){return C.target().same(i)&&n.has(C)}),y=v.filter(function(C){return C.source().same(i)&&n.has(C)}),m=p.length,g=y.length,x=0,b=0,w=0;w<p.length;w++)x+=s(p[w]);for(var E=0;E<y.length;E++)b+=s(y[E]);return{indegree:Math.pow(m,1-l)*Math.pow(x,l),outdegree:Math.pow(g,1-l)*Math.pow(b,l)}}else{for(var u=i.connectedEdges().intersection(n),c=u.length,d=0,f=0;f<u.length;f++)d+=s(u[f]);return{degree:Math.pow(c,1-l)*Math.pow(d,l)}}}};co.dc=co.degreeCentrality;co.dcn=co.degreeCentralityNormalised=co.degreeCentralityNormalized;var YN=mr({harmonic:!0,weight:function(){return 1},directed:!1,root:null}),fo={closenessCentralityNormalized:function(e){for(var r=YN(e),n=r.harmonic,a=r.weight,i=r.directed,s=this.cy(),o={},l=0,u=this.nodes(),c=this.floydWarshall({weight:a,directed:i}),d=0;d<u.length;d++){for(var f=0,v=u[d],p=0;p<u.length;p++)if(d!==p){var y=c.distance(v,u[p]);n?f+=1/y:f+=y}n||(f=1/f),l<f&&(l=f),o[v.id()]=f}return{closeness:function(g){return l==0?0:(Ve(g)?g=s.filter(g)[0].id():g=g.id(),o[g]/l)}}},closenessCentrality:function(e){var r=YN(e),n=r.root,a=r.weight,i=r.directed,s=r.harmonic;n=this.filter(n)[0];for(var o=this.dijkstra({root:n,weight:a,directed:i}),l=0,u=this.nodes(),c=0;c<u.length;c++){var d=u[c];if(!d.same(n)){var f=o.distanceTo(d);s?l+=1/f:l+=f}}return s?l:1/l}};fo.cc=fo.closenessCentrality;fo.ccn=fo.closenessCentralityNormalised=fo.closenessCentralityNormalized;var zV=mr({weight:null,directed:!1}),q1={betweennessCentrality:function(e){for(var r=zV(e),n=r.directed,a=r.weight,i=a!=null,s=this.cy(),o=this.nodes(),l={},u={},c=0,d={set:function(b,w){u[b]=w,w>c&&(c=w)},get:function(b){return u[b]}},f=0;f<o.length;f++){var v=o[f],p=v.id();n?l[p]=v.outgoers().nodes():l[p]=v.openNeighborhood().nodes(),d.set(p,0)}for(var y=function(){for(var b=o[m].id(),w=[],E={},C={},S={},T=new Uu(function(z,q){return S[z]-S[q]}),P=0;P<o.length;P++){var A=o[P].id();E[A]=[],C[A]=0,S[A]=1/0}for(C[b]=1,S[b]=0,T.push(b);!T.empty();){var j=T.pop();if(w.push(j),i)for(var R=0;R<l[j].length;R++){var O=l[j][R],N=s.getElementById(j),D=void 0;N.edgesTo(O).length>0?D=N.edgesTo(O)[0]:D=O.edgesTo(N)[0];var L=a(D);O=O.id(),S[O]>S[j]+L&&(S[O]=S[j]+L,T.nodes.indexOf(O)<0?T.push(O):T.updateItem(O),C[O]=0,E[O]=[]),S[O]==S[j]+L&&(C[O]=C[O]+C[j],E[O].push(j))}else for(var _=0;_<l[j].length;_++){var k=l[j][_].id();S[k]==1/0&&(T.push(k),S[k]=S[j]+1),S[k]==S[j]+1&&(C[k]=C[k]+C[j],E[k].push(j))}}for(var I={},F=0;F<o.length;F++)I[o[F].id()]=0;for(;w.length>0;){for(var B=w.pop(),$=0;$<E[B].length;$++){var W=E[B][$];I[W]=I[W]+C[W]/C[B]*(1+I[B])}B!=o[m].id()&&d.set(B,d.get(B)+I[B])}},m=0;m<o.length;m++)y();var g={betweenness:function(b){var w=s.collection(b).id();return d.get(w)},betweennessNormalized:function(b){if(c==0)return 0;var w=s.collection(b).id();return d.get(w)/c}};return g.betweennessNormalised=g.betweennessNormalized,g}};q1.bc=q1.betweennessCentrality;var qV=mr({expandFactor:2,inflateFactor:2,multFactor:1,maxIterations:20,attributes:[function(t){return 1}]}),UV=function(e){return qV(e)},$V=function(e,r){for(var n=0,a=0;a<r.length;a++)n+=r[a](e);return n},VV=function(e,r,n){for(var a=0;a<r;a++)e[a*r+a]=n},RM=function(e,r){for(var n,a=0;a<r;a++){n=0;for(var i=0;i<r;i++)n+=e[i*r+a];for(var s=0;s<r;s++)e[s*r+a]=e[s*r+a]/n}},GV=function(e,r,n){for(var a=new Array(n*n),i=0;i<n;i++){for(var s=0;s<n;s++)a[i*n+s]=0;for(var o=0;o<n;o++)for(var l=0;l<n;l++)a[i*n+l]+=e[i*n+o]*r[o*n+l]}return a},HV=function(e,r,n){for(var a=e.slice(0),i=1;i<n;i++)e=GV(e,a,r);return e},WV=function(e,r,n){for(var a=new Array(r*r),i=0;i<r*r;i++)a[i]=Math.pow(e[i],n);return RM(a,r),a},YV=function(e,r,n,a){for(var i=0;i<n;i++){var s=Math.round(e[i]*Math.pow(10,a))/Math.pow(10,a),o=Math.round(r[i]*Math.pow(10,a))/Math.pow(10,a);if(s!==o)return!1}return!0},XV=function(e,r,n,a){for(var i=[],s=0;s<r;s++){for(var o=[],l=0;l<r;l++)Math.round(e[s*r+l]*1e3)/1e3>0&&o.push(n[l]);o.length!==0&&i.push(a.collection(o))}return i},KV=function(e,r){for(var n=0;n<e.length;n++)if(!r[n]||e[n].id()!==r[n].id())return!1;return!0},QV=function(e){for(var r=0;r<e.length;r++)for(var n=0;n<e.length;n++)r!=n&&KV(e[r],e[n])&&e.splice(n,1);return e},XN=function(e){for(var r=this.nodes(),n=this.edges(),a=this.cy(),i=UV(e),s={},o=0;o<r.length;o++)s[r[o].id()]=o;for(var l=r.length,u=l*l,c=new Array(u),d,f=0;f<u;f++)c[f]=0;for(var v=0;v<n.length;v++){var p=n[v],y=s[p.source().id()],m=s[p.target().id()],g=$V(p,i.attributes);c[y*l+m]+=g,c[m*l+y]+=g}VV(c,l,i.multFactor),RM(c,l);for(var x=!0,b=0;x&&b<i.maxIterations;)x=!1,d=HV(c,l,i.expandFactor),c=WV(d,l,i.inflateFactor),YV(c,d,u,4)||(x=!0),b++;var w=XV(c,l,r,a);return w=QV(w),w},ZV={markovClustering:XN,mcl:XN},JV=function(e){return e},PM=function(e,r){return Math.abs(r-e)},KN=function(e,r,n){return e+PM(r,n)},QN=function(e,r,n){return e+Math.pow(n-r,2)},eG=function(e){return Math.sqrt(e)},tG=function(e,r,n){return Math.max(e,PM(r,n))},al=function(e,r,n,a,i){for(var s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:JV,o=a,l,u,c=0;c<e;c++)l=r(c),u=n(c),o=i(o,l,u);return s(o)},So={euclidean:function(e,r,n){return e>=2?al(e,r,n,0,QN,eG):al(e,r,n,0,KN)},squaredEuclidean:function(e,r,n){return al(e,r,n,0,QN)},manhattan:function(e,r,n){return al(e,r,n,0,KN)},max:function(e,r,n){return al(e,r,n,-1/0,tG)}};So["squared-euclidean"]=So.squaredEuclidean;So.squaredeuclidean=So.squaredEuclidean;function Kf(t,e,r,n,a,i){var s;return Dt(t)?s=t:s=So[t]||So.euclidean,e===0&&Dt(t)?s(a,i):s(e,r,n,a,i)}var rG=mr({k:2,m:2,sensitivityThreshold:1e-4,distance:"euclidean",maxIterations:10,attributes:[],testMode:!1,testCentroids:null}),UE=function(e){return rG(e)},ef=function(e,r,n,a,i){var s=i!=="kMedoids",o=s?function(d){return n[d]}:function(d){return a[d](n)},l=function(f){return a[f](r)},u=n,c=r;return Kf(e,a.length,o,l,u,c)},Fv=function(e,r,n){for(var a=n.length,i=new Array(a),s=new Array(a),o=new Array(r),l=null,u=0;u<a;u++)i[u]=e.min(n[u]).value,s[u]=e.max(n[u]).value;for(var c=0;c<r;c++){l=[];for(var d=0;d<a;d++)l[d]=Math.random()*(s[d]-i[d])+i[d];o[c]=l}return o},AM=function(e,r,n,a,i){for(var s=1/0,o=0,l=0;l<r.length;l++){var u=ef(n,e,r[l],a,i);u<s&&(s=u,o=l)}return o},kM=function(e,r,n){for(var a=[],i=null,s=0;s<r.length;s++)i=r[s],n[i.id()]===e&&a.push(i);return a},nG=function(e,r,n){return Math.abs(r-e)<=n},aG=function(e,r,n){for(var a=0;a<e.length;a++)for(var i=0;i<e[a].length;i++){var s=Math.abs(e[a][i]-r[a][i]);if(s>n)return!1}return!0},iG=function(e,r,n){for(var a=0;a<n;a++)if(e===r[a])return!0;return!1},ZN=function(e,r){var n=new Array(r);if(e.length<50)for(var a=0;a<r;a++){for(var i=e[Math.floor(Math.random()*e.length)];iG(i,n,a);)i=e[Math.floor(Math.random()*e.length)];n[a]=i}else for(var s=0;s<r;s++)n[s]=e[Math.floor(Math.random()*e.length)];return n},JN=function(e,r,n){for(var a=0,i=0;i<r.length;i++)a+=ef("manhattan",r[i],e,n,"kMedoids");return a},sG=function(e){var r=this.cy(),n=this.nodes(),a=null,i=UE(e),s=new Array(i.k),o={},l;i.testMode?typeof i.testCentroids=="number"?(i.testCentroids,l=Fv(n,i.k,i.attributes)):rr(i.testCentroids)==="object"?l=i.testCentroids:l=Fv(n,i.k,i.attributes):l=Fv(n,i.k,i.attributes);for(var u=!0,c=0;u&&c<i.maxIterations;){for(var d=0;d<n.length;d++)a=n[d],o[a.id()]=AM(a,l,i.distance,i.attributes,"kMeans");u=!1;for(var f=0;f<i.k;f++){var v=kM(f,n,o);if(v.length!==0){for(var p=i.attributes.length,y=l[f],m=new Array(p),g=new Array(p),x=0;x<p;x++){g[x]=0;for(var b=0;b<v.length;b++)a=v[b],g[x]+=i.attributes[x](a);m[x]=g[x]/v.length,nG(m[x],y[x],i.sensitivityThreshold)||(u=!0)}l[f]=m,s[f]=r.collection(v)}}c++}return s},oG=function(e){var r=this.cy(),n=this.nodes(),a=null,i=UE(e),s=new Array(i.k),o,l={},u,c=new Array(i.k);i.testMode?typeof i.testCentroids=="number"||(rr(i.testCentroids)==="object"?o=i.testCentroids:o=ZN(n,i.k)):o=ZN(n,i.k);for(var d=!0,f=0;d&&f<i.maxIterations;){for(var v=0;v<n.length;v++)a=n[v],l[a.id()]=AM(a,o,i.distance,i.attributes,"kMedoids");d=!1;for(var p=0;p<o.length;p++){var y=kM(p,n,l);if(y.length!==0){c[p]=JN(o[p],y,i.attributes);for(var m=0;m<y.length;m++)u=JN(y[m],y,i.attributes),u<c[p]&&(c[p]=u,o[p]=y[m],d=!0);s[p]=r.collection(y)}}f++}return s},lG=function(e,r,n,a,i){for(var s,o,l=0;l<r.length;l++)for(var u=0;u<e.length;u++)a[l][u]=Math.pow(n[l][u],i.m);for(var c=0;c<e.length;c++)for(var d=0;d<i.attributes.length;d++){s=0,o=0;for(var f=0;f<r.length;f++)s+=a[f][c]*i.attributes[d](r[f]),o+=a[f][c];e[c][d]=s/o}},uG=function(e,r,n,a,i){for(var s=0;s<e.length;s++)r[s]=e[s].slice();for(var o,l,u,c=2/(i.m-1),d=0;d<n.length;d++)for(var f=0;f<a.length;f++){o=0;for(var v=0;v<n.length;v++)l=ef(i.distance,a[f],n[d],i.attributes,"cmeans"),u=ef(i.distance,a[f],n[v],i.attributes,"cmeans"),o+=Math.pow(l/u,c);e[f][d]=1/o}},cG=function(e,r,n,a){for(var i=new Array(n.k),s=0;s<i.length;s++)i[s]=[];for(var o,l,u=0;u<r.length;u++){o=-1/0,l=-1;for(var c=0;c<r[0].length;c++)r[u][c]>o&&(o=r[u][c],l=c);i[l].push(e[u])}for(var d=0;d<i.length;d++)i[d]=a.collection(i[d]);return i},eT=function(e){var r=this.cy(),n=this.nodes(),a=UE(e),i,s,o,l,u;l=new Array(n.length);for(var c=0;c<n.length;c++)l[c]=new Array(a.k);o=new Array(n.length);for(var d=0;d<n.length;d++)o[d]=new Array(a.k);for(var f=0;f<n.length;f++){for(var v=0,p=0;p<a.k;p++)o[f][p]=Math.random(),v+=o[f][p];for(var y=0;y<a.k;y++)o[f][y]=o[f][y]/v}s=new Array(a.k);for(var m=0;m<a.k;m++)s[m]=new Array(a.attributes.length);u=new Array(n.length);for(var g=0;g<n.length;g++)u[g]=new Array(a.k);for(var x=!0,b=0;x&&b<a.maxIterations;)x=!1,lG(s,n,o,u,a),uG(o,l,s,n,a),aG(o,l,a.sensitivityThreshold)||(x=!0),b++;return i=cG(n,o,a,r),{clusters:i,degreeOfMembership:o}},dG={kMeans:sG,kMedoids:oG,fuzzyCMeans:eT,fcm:eT},fG=mr({distance:"euclidean",linkage:"min",mode:"threshold",threshold:1/0,addDendrogram:!1,dendrogramDepth:0,attributes:[]}),hG={single:"min",complete:"max"},vG=function(e){var r=fG(e),n=hG[r.linkage];return n!=null&&(r.linkage=n),r},tT=function(e,r,n,a,i){for(var s=0,o=1/0,l,u=i.attributes,c=function(P,A){return Kf(i.distance,u.length,function(j){return u[j](P)},function(j){return u[j](A)},P,A)},d=0;d<e.length;d++){var f=e[d].key,v=n[f][a[f]];v<o&&(s=f,o=v)}if(i.mode==="threshold"&&o>=i.threshold||i.mode==="dendrogram"&&e.length===1)return!1;var p=r[s],y=r[a[s]],m;i.mode==="dendrogram"?m={left:p,right:y,key:p.key}:m={value:p.value.concat(y.value),key:p.key},e[p.index]=m,e.splice(y.index,1),r[p.key]=m;for(var g=0;g<e.length;g++){var x=e[g];p.key===x.key?l=1/0:i.linkage==="min"?(l=n[p.key][x.key],n[p.key][x.key]>n[y.key][x.key]&&(l=n[y.key][x.key])):i.linkage==="max"?(l=n[p.key][x.key],n[p.key][x.key]<n[y.key][x.key]&&(l=n[y.key][x.key])):i.linkage==="mean"?l=(n[p.key][x.key]*p.size+n[y.key][x.key]*y.size)/(p.size+y.size):i.mode==="dendrogram"?l=c(x.value,p.value):l=c(x.value[0],p.value[0]),n[p.key][x.key]=n[x.key][p.key]=l}for(var b=0;b<e.length;b++){var w=e[b].key;if(a[w]===p.key||a[w]===y.key){for(var E=w,C=0;C<e.length;C++){var S=e[C].key;n[w][S]<n[w][E]&&(E=S)}a[w]=E}e[b].index=b}return p.key=y.key=p.index=y.index=null,!0},eo=function(e,r,n){e&&(e.value?r.push(e.value):(e.left&&eo(e.left,r),e.right&&eo(e.right,r)))},U1=function(e,r){if(!e)return"";if(e.left&&e.right){var n=U1(e.left,r),a=U1(e.right,r),i=r.add({group:"nodes",data:{id:n+","+a}});return r.add({group:"edges",data:{source:n,target:i.id()}}),r.add({group:"edges",data:{source:a,target:i.id()}}),i.id()}else if(e.value)return e.value.id()},$1=function(e,r,n){if(!e)return[];var a=[],i=[],s=[];return r===0?(e.left&&eo(e.left,a),e.right&&eo(e.right,i),s=a.concat(i),[n.collection(s)]):r===1?e.value?[n.collection(e.value)]:(e.left&&eo(e.left,a),e.right&&eo(e.right,i),[n.collection(a),n.collection(i)]):e.value?[n.collection(e.value)]:(e.left&&(a=$1(e.left,r-1,n)),e.right&&(i=$1(e.right,r-1,n)),a.concat(i))},rT=function(e){for(var r=this.cy(),n=this.nodes(),a=vG(e),i=a.attributes,s=function(b,w){return Kf(a.distance,i.length,function(E){return i[E](b)},function(E){return i[E](w)},b,w)},o=[],l=[],u=[],c=[],d=0;d<n.length;d++){var f={value:a.mode==="dendrogram"?n[d]:[n[d]],key:d,index:d};o[d]=f,c[d]=f,l[d]=[],u[d]=0}for(var v=0;v<o.length;v++)for(var p=0;p<=v;p++){var y=void 0;a.mode==="dendrogram"?y=v===p?1/0:s(o[v].value,o[p].value):y=v===p?1/0:s(o[v].value[0],o[p].value[0]),l[v][p]=y,l[p][v]=y,y<l[v][u[v]]&&(u[v]=p)}for(var m=tT(o,c,l,u,a);m;)m=tT(o,c,l,u,a);var g;return a.mode==="dendrogram"?(g=$1(o[0],a.dendrogramDepth,r),a.addDendrogram&&U1(o[0],r)):(g=new Array(o.length),o.forEach(function(x,b){x.key=x.index=null,g[b]=r.collection(x.value)})),g},pG={hierarchicalClustering:rT,hca:rT},gG=mr({distance:"euclidean",preference:"median",damping:.8,maxIterations:1e3,minIterations:100,attributes:[]}),mG=function(e){var r=e.damping,n=e.preference;.5<=r&&r<1||Tt("Damping must range on [0.5, 1). Got: ".concat(r));var a=["median","mean","min","max"];return a.some(function(i){return i===n})||_e(n)||Tt("Preference must be one of [".concat(a.map(function(i){return"'".concat(i,"'")}).join(", "),"] or a number. Got: ").concat(n)),gG(e)},yG=function(e,r,n,a){var i=function(o,l){return a[l](o)};return-Kf(e,a.length,function(s){return i(r,s)},function(s){return i(n,s)},r,n)},xG=function(e,r){var n=null;return r==="median"?n=mV(e):r==="mean"?n=gV(e):r==="min"?n=vV(e):r==="max"?n=pV(e):n=r,n},bG=function(e,r,n){for(var a=[],i=0;i<e;i++)r[i*e+i]+n[i*e+i]>0&&a.push(i);return a},nT=function(e,r,n){for(var a=[],i=0;i<e;i++){for(var s=-1,o=-1/0,l=0;l<n.length;l++){var u=n[l];r[i*e+u]>o&&(s=u,o=r[i*e+u])}s>0&&a.push(s)}for(var c=0;c<n.length;c++)a[n[c]]=n[c];return a},wG=function(e,r,n){for(var a=nT(e,r,n),i=0;i<n.length;i++){for(var s=[],o=0;o<a.length;o++)a[o]===n[i]&&s.push(o);for(var l=-1,u=-1/0,c=0;c<s.length;c++){for(var d=0,f=0;f<s.length;f++)d+=r[s[f]*e+s[c]];d>u&&(l=c,u=d)}n[i]=s[l]}return a=nT(e,r,n),a},aT=function(e){for(var r=this.cy(),n=this.nodes(),a=mG(e),i={},s=0;s<n.length;s++)i[n[s].id()]=s;var o,l,u,c,d,f;o=n.length,l=o*o,u=new Array(l);for(var v=0;v<l;v++)u[v]=-1/0;for(var p=0;p<o;p++)for(var y=0;y<o;y++)p!==y&&(u[p*o+y]=yG(a.distance,n[p],n[y],a.attributes));c=xG(u,a.preference);for(var m=0;m<o;m++)u[m*o+m]=c;d=new Array(l);for(var g=0;g<l;g++)d[g]=0;f=new Array(l);for(var x=0;x<l;x++)f[x]=0;for(var b=new Array(o),w=new Array(o),E=new Array(o),C=0;C<o;C++)b[C]=0,w[C]=0,E[C]=0;for(var S=new Array(o*a.minIterations),T=0;T<S.length;T++)S[T]=0;var P;for(P=0;P<a.maxIterations;P++){for(var A=0;A<o;A++){for(var j=-1/0,R=-1/0,O=-1,N=0,D=0;D<o;D++)b[D]=d[A*o+D],N=f[A*o+D]+u[A*o+D],N>=j?(R=j,j=N,O=D):N>R&&(R=N);for(var L=0;L<o;L++)d[A*o+L]=(1-a.damping)*(u[A*o+L]-j)+a.damping*b[L];d[A*o+O]=(1-a.damping)*(u[A*o+O]-R)+a.damping*b[O]}for(var _=0;_<o;_++){for(var k=0,I=0;I<o;I++)b[I]=f[I*o+_],w[I]=Math.max(0,d[I*o+_]),k+=w[I];k-=w[_],w[_]=d[_*o+_],k+=w[_];for(var F=0;F<o;F++)f[F*o+_]=(1-a.damping)*Math.min(0,k-w[F])+a.damping*b[F];f[_*o+_]=(1-a.damping)*(k-w[_])+a.damping*b[_]}for(var B=0,$=0;$<o;$++){var W=f[$*o+$]+d[$*o+$]>0?1:0;S[P%a.minIterations*o+$]=W,B+=W}if(B>0&&(P>=a.minIterations-1||P==a.maxIterations-1)){for(var z=0,q=0;q<o;q++){E[q]=0;for(var G=0;G<a.minIterations;G++)E[q]+=S[G*o+q];(E[q]===0||E[q]===a.minIterations)&&z++}if(z===o)break}}for(var J=bG(o,d,f),ae=wG(o,u,J),Y={},H=0;H<J.length;H++)Y[J[H]]=[];for(var X=0;X<n.length;X++){var ee=i[n[X].id()],ie=ae[ee];ie!=null&&Y[ie].push(n[X])}for(var oe=new Array(J.length),me=0;me<J.length;me++)oe[me]=r.collection(Y[J[me]]);return oe},EG={affinityPropagation:aT,ap:aT},SG=mr({root:void 0,directed:!1}),CG={hierholzer:function(e){if(!st(e)){var r=arguments;e={root:r[0],directed:r[1]}}var n=SG(e),a=n.root,i=n.directed,s=this,o=!1,l,u,c;a&&(c=Ve(a)?this.filter(a)[0].id():a[0].id());var d={},f={};i?s.forEach(function(x){var b=x.id();if(x.isNode()){var w=x.indegree(!0),E=x.outdegree(!0),C=w-E,S=E-w;C==1?l?o=!0:l=b:S==1?u?o=!0:u=b:(S>1||C>1)&&(o=!0),d[b]=[],x.outgoers().forEach(function(T){T.isEdge()&&d[b].push(T.id())})}else f[b]=[void 0,x.target().id()]}):s.forEach(function(x){var b=x.id();if(x.isNode()){var w=x.degree(!0);w%2&&(l?u?o=!0:u=b:l=b),d[b]=[],x.connectedEdges().forEach(function(E){return d[b].push(E.id())})}else f[b]=[x.source().id(),x.target().id()]});var v={found:!1,trail:void 0};if(o)return v;if(u&&l)if(i){if(c&&u!=c)return v;c=u}else{if(c&&u!=c&&l!=c)return v;c||(c=u)}else c||(c=s[0].id());var p=function(b){for(var w=b,E=[b],C,S,T;d[w].length;)C=d[w].shift(),S=f[C][0],T=f[C][1],w!=T?(d[T]=d[T].filter(function(P){return P!=C}),w=T):!i&&w!=S&&(d[S]=d[S].filter(function(P){return P!=C}),w=S),E.unshift(C),E.unshift(w);return E},y=[],m=[];for(m=p(c);m.length!=1;)d[m[0]].length==0?(y.unshift(s.getElementById(m.shift())),y.unshift(s.getElementById(m.shift()))):m=p(m.shift()).concat(m);y.unshift(s.getElementById(m.shift()));for(var g in d)if(d[g].length)return v;return v.found=!0,v.trail=this.spawn(y,!0),v}},Pc=function(){var e=this,r={},n=0,a=0,i=[],s=[],o={},l=function(f,v){for(var p=s.length-1,y=[],m=e.spawn();s[p].x!=f||s[p].y!=v;)y.push(s.pop().edge),p--;y.push(s.pop().edge),y.forEach(function(g){var x=g.connectedNodes().intersection(e);m.merge(g),x.forEach(function(b){var w=b.id(),E=b.connectedEdges().intersection(e);m.merge(b),r[w].cutVertex?m.merge(E.filter(function(C){return C.isLoop()})):m.merge(E)})}),i.push(m)},u=function(f,v,p){f===p&&(a+=1),r[v]={id:n,low:n++,cutVertex:!1};var y=e.getElementById(v).connectedEdges().intersection(e);if(y.size()===0)i.push(e.spawn(e.getElementById(v)));else{var m,g,x,b;y.forEach(function(w){m=w.source().id(),g=w.target().id(),x=m===v?g:m,x!==p&&(b=w.id(),o[b]||(o[b]=!0,s.push({x:v,y:x,edge:w})),x in r?r[v].low=Math.min(r[v].low,r[x].id):(u(f,x,v),r[v].low=Math.min(r[v].low,r[x].low),r[v].id<=r[x].low&&(r[v].cutVertex=!0,l(v,x))))})}};e.forEach(function(d){if(d.isNode()){var f=d.id();f in r||(a=0,u(f,f),r[f].cutVertex=a>1)}});var c=Object.keys(r).filter(function(d){return r[d].cutVertex}).map(function(d){return e.getElementById(d)});return{cut:e.spawn(c),components:i}},NG={hopcroftTarjanBiconnected:Pc,htbc:Pc,htb:Pc,hopcroftTarjanBiconnectedComponents:Pc},Ac=function(){var e=this,r={},n=0,a=[],i=[],s=e.spawn(e),o=function(u){i.push(u),r[u]={index:n,low:n++,explored:!1};var c=e.getElementById(u).connectedEdges().intersection(e);if(c.forEach(function(y){var m=y.target().id();m!==u&&(m in r||o(m),r[m].explored||(r[u].low=Math.min(r[u].low,r[m].low)))}),r[u].index===r[u].low){for(var d=e.spawn();;){var f=i.pop();if(d.merge(e.getElementById(f)),r[f].low=r[u].index,r[f].explored=!0,f===u)break}var v=d.edgesWith(d),p=d.merge(v);a.push(p),s=s.difference(p)}};return e.forEach(function(l){if(l.isNode()){var u=l.id();u in r||o(u)}}),{cut:s,components:a}},TG={tarjanStronglyConnected:Ac,tsc:Ac,tscc:Ac,tarjanStronglyConnectedComponents:Ac},LM={};[du,rV,nV,iV,oV,uV,fV,BV,co,fo,q1,ZV,dG,pG,EG,CG,NG,TG].forEach(function(t){We(LM,t)});/*!
|
|
87
|
+
Embeddable Minimum Strictly-Compliant Promises/A+ 1.1.1 Thenable
|
|
88
|
+
Copyright (c) 2013-2014 Ralf S. Engelschall (http://engelschall.com)
|
|
89
|
+
Licensed under The MIT License (http://opensource.org/licenses/MIT)
|
|
90
|
+
*/var DM=0,_M=1,jM=2,Hn=function(e){if(!(this instanceof Hn))return new Hn(e);this.id="Thenable/1.0.7",this.state=DM,this.fulfillValue=void 0,this.rejectReason=void 0,this.onFulfilled=[],this.onRejected=[],this.proxy={then:this.then.bind(this)},typeof e=="function"&&e.call(this,this.fulfill.bind(this),this.reject.bind(this))};Hn.prototype={fulfill:function(e){return iT(this,_M,"fulfillValue",e)},reject:function(e){return iT(this,jM,"rejectReason",e)},then:function(e,r){var n=this,a=new Hn;return n.onFulfilled.push(oT(e,a,"fulfill")),n.onRejected.push(oT(r,a,"reject")),OM(n),a.proxy}};var iT=function(e,r,n,a){return e.state===DM&&(e.state=r,e[n]=a,OM(e)),e},OM=function(e){e.state===_M?sT(e,"onFulfilled",e.fulfillValue):e.state===jM&&sT(e,"onRejected",e.rejectReason)},sT=function(e,r,n){if(e[r].length!==0){var a=e[r];e[r]=[];var i=function(){for(var o=0;o<a.length;o++)a[o](n)};typeof setImmediate=="function"?setImmediate(i):setTimeout(i,0)}},oT=function(e,r,n){return function(a){if(typeof e!="function")r[n].call(r,a);else{var i;try{i=e(a)}catch(s){r.reject(s);return}MM(r,i)}}},MM=function(e,r){if(e===r||e.proxy===r){e.reject(new TypeError("cannot resolve promise with itself"));return}var n;if(rr(r)==="object"&&r!==null||typeof r=="function")try{n=r.then}catch(i){e.reject(i);return}if(typeof n=="function"){var a=!1;try{n.call(r,function(i){a||(a=!0,i===r?e.reject(new TypeError("circular thenable chain")):MM(e,i))},function(i){a||(a=!0,e.reject(i))})}catch(i){a||e.reject(i)}return}e.fulfill(r)};Hn.all=function(t){return new Hn(function(e,r){for(var n=new Array(t.length),a=0,i=function(l,u){n[l]=u,a++,a===t.length&&e(n)},s=0;s<t.length;s++)(function(o){var l=t[o],u=l!=null&&l.then!=null;if(u)l.then(function(d){i(o,d)},function(d){r(d)});else{var c=l;i(o,c)}})(s)})};Hn.resolve=function(t){return new Hn(function(e,r){e(t)})};Hn.reject=function(t){return new Hn(function(e,r){r(t)})};var jo=typeof Promise<"u"?Promise:Hn,V1=function(e,r,n){var a=DE(e),i=!a,s=this._private=We({duration:1e3},r,n);if(s.target=e,s.style=s.style||s.css,s.started=!1,s.playing=!1,s.hooked=!1,s.applying=!1,s.progress=0,s.completes=[],s.frames=[],s.complete&&Dt(s.complete)&&s.completes.push(s.complete),i){var o=e.position();s.startPosition=s.startPosition||{x:o.x,y:o.y},s.startStyle=s.startStyle||e.cy().style().getAnimationStartStyle(e,s.style)}if(a){var l=e.pan();s.startPan={x:l.x,y:l.y},s.startZoom=e.zoom()}this.length=1,this[0]=this},fs=V1.prototype;We(fs,{instanceString:function(){return"animation"},hook:function(){var e=this._private;if(!e.hooked){var r,n=e.target._private.animation;e.queue?r=n.queue:r=n.current,r.push(this),cn(e.target)&&e.target.cy().addToAnimationPool(e.target),e.hooked=!0}return this},play:function(){var e=this._private;return e.progress===1&&(e.progress=0),e.playing=!0,e.started=!1,e.stopped=!1,this.hook(),this},playing:function(){return this._private.playing},apply:function(){var e=this._private;return e.applying=!0,e.started=!1,e.stopped=!1,this.hook(),this},applying:function(){return this._private.applying},pause:function(){var e=this._private;return e.playing=!1,e.started=!1,this},stop:function(){var e=this._private;return e.playing=!1,e.started=!1,e.stopped=!0,this},rewind:function(){return this.progress(0)},fastforward:function(){return this.progress(1)},time:function(e){var r=this._private;return e===void 0?r.progress*r.duration:this.progress(e/r.duration)},progress:function(e){var r=this._private,n=r.playing;return e===void 0?r.progress:(n&&this.pause(),r.progress=e,r.started=!1,n&&this.play(),this)},completed:function(){return this._private.progress===1},reverse:function(){var e=this._private,r=e.playing;r&&this.pause(),e.progress=1-e.progress,e.started=!1;var n=function(u,c){var d=e[u];d!=null&&(e[u]=e[c],e[c]=d)};if(n("zoom","startZoom"),n("pan","startPan"),n("position","startPosition"),e.style)for(var a=0;a<e.style.length;a++){var i=e.style[a],s=i.name,o=e.startStyle[s];e.startStyle[s]=i,e.style[a]=o}return r&&this.play(),this},promise:function(e){var r=this._private,n;switch(e){case"frame":n=r.frames;break;default:case"complete":case"completed":n=r.completes}return new jo(function(a,i){n.push(function(){a()})})}});fs.complete=fs.completed;fs.run=fs.play;fs.running=fs.playing;var RG={animated:function(){return function(){var r=this,n=r.length!==void 0,a=n?r:[r],i=this._private.cy||this;if(!i.styleEnabled())return!1;var s=a[0];if(s)return s._private.animation.current.length>0}},clearQueue:function(){return function(){var r=this,n=r.length!==void 0,a=n?r:[r],i=this._private.cy||this;if(!i.styleEnabled())return this;for(var s=0;s<a.length;s++){var o=a[s];o._private.animation.queue=[]}return this}},delay:function(){return function(r,n){var a=this._private.cy||this;return a.styleEnabled()?this.animate({delay:r,duration:r,complete:n}):this}},delayAnimation:function(){return function(r,n){var a=this._private.cy||this;return a.styleEnabled()?this.animation({delay:r,duration:r,complete:n}):this}},animation:function(){return function(r,n){var a=this,i=a.length!==void 0,s=i?a:[a],o=this._private.cy||this,l=!i,u=!l;if(!o.styleEnabled())return this;var c=o.style();r=We({},r,n);var d=Object.keys(r).length===0;if(d)return new V1(s[0],r);switch(r.duration===void 0&&(r.duration=400),r.duration){case"slow":r.duration=600;break;case"fast":r.duration=200;break}if(u&&(r.style=c.getPropsList(r.style||r.css),r.css=void 0),u&&r.renderedPosition!=null){var f=r.renderedPosition,v=o.pan(),p=o.zoom();r.position=wM(f,p,v)}if(l&&r.panBy!=null){var y=r.panBy,m=o.pan();r.pan={x:m.x+y.x,y:m.y+y.y}}var g=r.center||r.centre;if(l&&g!=null){var x=o.getCenterPan(g.eles,r.zoom);x!=null&&(r.pan=x)}if(l&&r.fit!=null){var b=r.fit,w=o.getFitViewport(b.eles||b.boundingBox,b.padding);w!=null&&(r.pan=w.pan,r.zoom=w.zoom)}if(l&&st(r.zoom)){var E=o.getZoomedViewport(r.zoom);E!=null?(E.zoomed&&(r.zoom=E.zoom),E.panned&&(r.pan=E.pan)):r.zoom=null}return new V1(s[0],r)}},animate:function(){return function(r,n){var a=this,i=a.length!==void 0,s=i?a:[a],o=this._private.cy||this;if(!o.styleEnabled())return this;n&&(r=We({},r,n));for(var l=0;l<s.length;l++){var u=s[l],c=u.animated()&&(r.queue===void 0||r.queue),d=u.animation(r,c?{queue:!0}:void 0);d.play()}return this}},stop:function(){return function(r,n){var a=this,i=a.length!==void 0,s=i?a:[a],o=this._private.cy||this;if(!o.styleEnabled())return this;for(var l=0;l<s.length;l++){for(var u=s[l],c=u._private,d=c.animation.current,f=0;f<d.length;f++){var v=d[f],p=v._private;n&&(p.duration=0)}r&&(c.animation.queue=[]),n||(c.animation.current=[])}return o.notify("draw"),this}}},Bv,lT;function Qf(){if(lT)return Bv;lT=1;var t=Array.isArray;return Bv=t,Bv}var zv,uT;function PG(){if(uT)return zv;uT=1;var t=Qf(),e=zu(),r=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,n=/^\w*$/;function a(i,s){if(t(i))return!1;var o=typeof i;return o=="number"||o=="symbol"||o=="boolean"||i==null||e(i)?!0:n.test(i)||!r.test(i)||s!=null&&i in Object(s)}return zv=a,zv}var qv,cT;function AG(){if(cT)return qv;cT=1;var t=fM(),e=Bu(),r="[object AsyncFunction]",n="[object Function]",a="[object GeneratorFunction]",i="[object Proxy]";function s(o){if(!e(o))return!1;var l=t(o);return l==n||l==a||l==r||l==i}return qv=s,qv}var Uv,dT;function kG(){if(dT)return Uv;dT=1;var t=Wf(),e=t["__core-js_shared__"];return Uv=e,Uv}var $v,fT;function LG(){if(fT)return $v;fT=1;var t=kG(),e=function(){var n=/[^.]+$/.exec(t&&t.keys&&t.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""}();function r(n){return!!e&&e in n}return $v=r,$v}var Vv,hT;function DG(){if(hT)return Vv;hT=1;var t=Function.prototype,e=t.toString;function r(n){if(n!=null){try{return e.call(n)}catch{}try{return n+""}catch{}}return""}return Vv=r,Vv}var Gv,vT;function _G(){if(vT)return Gv;vT=1;var t=AG(),e=LG(),r=Bu(),n=DG(),a=/[\\^$.*+?()[\]{}|]/g,i=/^\[object .+?Constructor\]$/,s=Function.prototype,o=Object.prototype,l=s.toString,u=o.hasOwnProperty,c=RegExp("^"+l.call(u).replace(a,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function d(f){if(!r(f)||e(f))return!1;var v=t(f)?c:i;return v.test(n(f))}return Gv=d,Gv}var Hv,pT;function jG(){if(pT)return Hv;pT=1;function t(e,r){return e==null?void 0:e[r]}return Hv=t,Hv}var Wv,gT;function $E(){if(gT)return Wv;gT=1;var t=_G(),e=jG();function r(n,a){var i=e(n,a);return t(i)?i:void 0}return Wv=r,Wv}var Yv,mT;function Zf(){if(mT)return Yv;mT=1;var t=$E(),e=t(Object,"create");return Yv=e,Yv}var Xv,yT;function OG(){if(yT)return Xv;yT=1;var t=Zf();function e(){this.__data__=t?t(null):{},this.size=0}return Xv=e,Xv}var Kv,xT;function MG(){if(xT)return Kv;xT=1;function t(e){var r=this.has(e)&&delete this.__data__[e];return this.size-=r?1:0,r}return Kv=t,Kv}var Qv,bT;function IG(){if(bT)return Qv;bT=1;var t=Zf(),e="__lodash_hash_undefined__",r=Object.prototype,n=r.hasOwnProperty;function a(i){var s=this.__data__;if(t){var o=s[i];return o===e?void 0:o}return n.call(s,i)?s[i]:void 0}return Qv=a,Qv}var Zv,wT;function FG(){if(wT)return Zv;wT=1;var t=Zf(),e=Object.prototype,r=e.hasOwnProperty;function n(a){var i=this.__data__;return t?i[a]!==void 0:r.call(i,a)}return Zv=n,Zv}var Jv,ET;function BG(){if(ET)return Jv;ET=1;var t=Zf(),e="__lodash_hash_undefined__";function r(n,a){var i=this.__data__;return this.size+=this.has(n)?0:1,i[n]=t&&a===void 0?e:a,this}return Jv=r,Jv}var ep,ST;function zG(){if(ST)return ep;ST=1;var t=OG(),e=MG(),r=IG(),n=FG(),a=BG();function i(s){var o=-1,l=s==null?0:s.length;for(this.clear();++o<l;){var u=s[o];this.set(u[0],u[1])}}return i.prototype.clear=t,i.prototype.delete=e,i.prototype.get=r,i.prototype.has=n,i.prototype.set=a,ep=i,ep}var tp,CT;function qG(){if(CT)return tp;CT=1;function t(){this.__data__=[],this.size=0}return tp=t,tp}var rp,NT;function IM(){if(NT)return rp;NT=1;function t(e,r){return e===r||e!==e&&r!==r}return rp=t,rp}var np,TT;function Jf(){if(TT)return np;TT=1;var t=IM();function e(r,n){for(var a=r.length;a--;)if(t(r[a][0],n))return a;return-1}return np=e,np}var ap,RT;function UG(){if(RT)return ap;RT=1;var t=Jf(),e=Array.prototype,r=e.splice;function n(a){var i=this.__data__,s=t(i,a);if(s<0)return!1;var o=i.length-1;return s==o?i.pop():r.call(i,s,1),--this.size,!0}return ap=n,ap}var ip,PT;function $G(){if(PT)return ip;PT=1;var t=Jf();function e(r){var n=this.__data__,a=t(n,r);return a<0?void 0:n[a][1]}return ip=e,ip}var sp,AT;function VG(){if(AT)return sp;AT=1;var t=Jf();function e(r){return t(this.__data__,r)>-1}return sp=e,sp}var op,kT;function GG(){if(kT)return op;kT=1;var t=Jf();function e(r,n){var a=this.__data__,i=t(a,r);return i<0?(++this.size,a.push([r,n])):a[i][1]=n,this}return op=e,op}var lp,LT;function HG(){if(LT)return lp;LT=1;var t=qG(),e=UG(),r=$G(),n=VG(),a=GG();function i(s){var o=-1,l=s==null?0:s.length;for(this.clear();++o<l;){var u=s[o];this.set(u[0],u[1])}}return i.prototype.clear=t,i.prototype.delete=e,i.prototype.get=r,i.prototype.has=n,i.prototype.set=a,lp=i,lp}var up,DT;function WG(){if(DT)return up;DT=1;var t=$E(),e=Wf(),r=t(e,"Map");return up=r,up}var cp,_T;function YG(){if(_T)return cp;_T=1;var t=zG(),e=HG(),r=WG();function n(){this.size=0,this.__data__={hash:new t,map:new(r||e),string:new t}}return cp=n,cp}var dp,jT;function XG(){if(jT)return dp;jT=1;function t(e){var r=typeof e;return r=="string"||r=="number"||r=="symbol"||r=="boolean"?e!=="__proto__":e===null}return dp=t,dp}var fp,OT;function eh(){if(OT)return fp;OT=1;var t=XG();function e(r,n){var a=r.__data__;return t(n)?a[typeof n=="string"?"string":"hash"]:a.map}return fp=e,fp}var hp,MT;function KG(){if(MT)return hp;MT=1;var t=eh();function e(r){var n=t(this,r).delete(r);return this.size-=n?1:0,n}return hp=e,hp}var vp,IT;function QG(){if(IT)return vp;IT=1;var t=eh();function e(r){return t(this,r).get(r)}return vp=e,vp}var pp,FT;function ZG(){if(FT)return pp;FT=1;var t=eh();function e(r){return t(this,r).has(r)}return pp=e,pp}var gp,BT;function JG(){if(BT)return gp;BT=1;var t=eh();function e(r,n){var a=t(this,r),i=a.size;return a.set(r,n),this.size+=a.size==i?0:1,this}return gp=e,gp}var mp,zT;function eH(){if(zT)return mp;zT=1;var t=YG(),e=KG(),r=QG(),n=ZG(),a=JG();function i(s){var o=-1,l=s==null?0:s.length;for(this.clear();++o<l;){var u=s[o];this.set(u[0],u[1])}}return i.prototype.clear=t,i.prototype.delete=e,i.prototype.get=r,i.prototype.has=n,i.prototype.set=a,mp=i,mp}var yp,qT;function tH(){if(qT)return yp;qT=1;var t=eH(),e="Expected a function";function r(n,a){if(typeof n!="function"||a!=null&&typeof a!="function")throw new TypeError(e);var i=function(){var s=arguments,o=a?a.apply(this,s):s[0],l=i.cache;if(l.has(o))return l.get(o);var u=n.apply(this,s);return i.cache=l.set(o,u)||l,u};return i.cache=new(r.Cache||t),i}return r.Cache=t,yp=r,yp}var xp,UT;function rH(){if(UT)return xp;UT=1;var t=tH(),e=500;function r(n){var a=t(n,function(s){return i.size===e&&i.clear(),s}),i=a.cache;return a}return xp=r,xp}var bp,$T;function FM(){if($T)return bp;$T=1;var t=rH(),e=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,r=/\\(\\)?/g,n=t(function(a){var i=[];return a.charCodeAt(0)===46&&i.push(""),a.replace(e,function(s,o,l,u){i.push(l?u.replace(r,"$1"):o||s)}),i});return bp=n,bp}var wp,VT;function BM(){if(VT)return wp;VT=1;function t(e,r){for(var n=-1,a=e==null?0:e.length,i=Array(a);++n<a;)i[n]=r(e[n],n,e);return i}return wp=t,wp}var Ep,GT;function nH(){if(GT)return Ep;GT=1;var t=jE(),e=BM(),r=Qf(),n=zu(),a=t?t.prototype:void 0,i=a?a.toString:void 0;function s(o){if(typeof o=="string")return o;if(r(o))return e(o,s)+"";if(n(o))return i?i.call(o):"";var l=o+"";return l=="0"&&1/o==-1/0?"-0":l}return Ep=s,Ep}var Sp,HT;function zM(){if(HT)return Sp;HT=1;var t=nH();function e(r){return r==null?"":t(r)}return Sp=e,Sp}var Cp,WT;function qM(){if(WT)return Cp;WT=1;var t=Qf(),e=PG(),r=FM(),n=zM();function a(i,s){return t(i)?i:e(i,s)?[i]:r(n(i))}return Cp=a,Cp}var Np,YT;function VE(){if(YT)return Np;YT=1;var t=zu();function e(r){if(typeof r=="string"||t(r))return r;var n=r+"";return n=="0"&&1/r==-1/0?"-0":n}return Np=e,Np}var Tp,XT;function aH(){if(XT)return Tp;XT=1;var t=qM(),e=VE();function r(n,a){a=t(a,n);for(var i=0,s=a.length;n!=null&&i<s;)n=n[e(a[i++])];return i&&i==s?n:void 0}return Tp=r,Tp}var Rp,KT;function iH(){if(KT)return Rp;KT=1;var t=aH();function e(r,n,a){var i=r==null?void 0:t(r,n);return i===void 0?a:i}return Rp=e,Rp}var sH=iH(),oH=Fu(sH),Pp,QT;function lH(){if(QT)return Pp;QT=1;var t=$E(),e=function(){try{var r=t(Object,"defineProperty");return r({},"",{}),r}catch{}}();return Pp=e,Pp}var Ap,ZT;function uH(){if(ZT)return Ap;ZT=1;var t=lH();function e(r,n,a){n=="__proto__"&&t?t(r,n,{configurable:!0,enumerable:!0,value:a,writable:!0}):r[n]=a}return Ap=e,Ap}var kp,JT;function cH(){if(JT)return kp;JT=1;var t=uH(),e=IM(),r=Object.prototype,n=r.hasOwnProperty;function a(i,s,o){var l=i[s];(!(n.call(i,s)&&e(l,o))||o===void 0&&!(s in i))&&t(i,s,o)}return kp=a,kp}var Lp,eR;function dH(){if(eR)return Lp;eR=1;var t=9007199254740991,e=/^(?:0|[1-9]\d*)$/;function r(n,a){var i=typeof n;return a=a??t,!!a&&(i=="number"||i!="symbol"&&e.test(n))&&n>-1&&n%1==0&&n<a}return Lp=r,Lp}var Dp,tR;function fH(){if(tR)return Dp;tR=1;var t=cH(),e=qM(),r=dH(),n=Bu(),a=VE();function i(s,o,l,u){if(!n(s))return s;o=e(o,s);for(var c=-1,d=o.length,f=d-1,v=s;v!=null&&++c<d;){var p=a(o[c]),y=l;if(p==="__proto__"||p==="constructor"||p==="prototype")return s;if(c!=f){var m=v[p];y=u?u(m,p,v):void 0,y===void 0&&(y=n(m)?m:r(o[c+1])?[]:{})}t(v,p,y),v=v[p]}return s}return Dp=i,Dp}var _p,rR;function hH(){if(rR)return _p;rR=1;var t=fH();function e(r,n,a){return r==null?r:t(r,n,a)}return _p=e,_p}var vH=hH(),pH=Fu(vH),jp,nR;function gH(){if(nR)return jp;nR=1;function t(e,r){var n=-1,a=e.length;for(r||(r=Array(a));++n<a;)r[n]=e[n];return r}return jp=t,jp}var Op,aR;function mH(){if(aR)return Op;aR=1;var t=BM(),e=gH(),r=Qf(),n=zu(),a=FM(),i=VE(),s=zM();function o(l){return r(l)?t(l,i):n(l)?[l]:e(a(s(l)))}return Op=o,Op}var yH=mH(),xH=Fu(yH),bH={data:function(e){var r={field:"data",bindingEvent:"data",allowBinding:!1,allowSetting:!1,allowGetting:!1,settingEvent:"data",settingTriggersEvent:!1,triggerFnName:"trigger",immutableKeys:{},updateStyle:!1,beforeGet:function(a){},beforeSet:function(a,i){},onSet:function(a){},canSet:function(a){return!0}};return e=We({},r,e),function(a,i){var s=e,o=this,l=o.length!==void 0,u=l?o:[o],c=l?o[0]:o;if(Ve(a)){var d=a.indexOf(".")!==-1,f=d&&xH(a);if(s.allowGetting&&i===void 0){var v;return c&&(s.beforeGet(c),f&&c._private[s.field][a]===void 0?v=oH(c._private[s.field],f):v=c._private[s.field][a]),v}else if(s.allowSetting&&i!==void 0){var p=!s.immutableKeys[a];if(p){var y=rM({},a,i);s.beforeSet(o,y);for(var m=0,g=u.length;m<g;m++){var x=u[m];s.canSet(x)&&(f&&c._private[s.field][a]===void 0?pH(x._private[s.field],f,i):x._private[s.field][a]=i)}s.updateStyle&&o.updateStyle(),s.onSet(o),s.settingTriggersEvent&&o[s.triggerFnName](s.settingEvent)}}}else if(s.allowSetting&&st(a)){var b=a,w,E,C=Object.keys(b);s.beforeSet(o,b);for(var S=0;S<C.length;S++){w=C[S],E=b[w];var T=!s.immutableKeys[w];if(T)for(var P=0;P<u.length;P++){var A=u[P];s.canSet(A)&&(A._private[s.field][w]=E)}}s.updateStyle&&o.updateStyle(),s.onSet(o),s.settingTriggersEvent&&o[s.triggerFnName](s.settingEvent)}else if(s.allowBinding&&Dt(a)){var j=a;o.on(s.bindingEvent,j)}else if(s.allowGetting&&a===void 0){var R;return c&&(s.beforeGet(c),R=c._private[s.field]),R}return o}},removeData:function(e){var r={field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!1,immutableKeys:{}};return e=We({},r,e),function(a){var i=e,s=this,o=s.length!==void 0,l=o?s:[s];if(Ve(a)){for(var u=a.split(/\s+/),c=u.length,d=0;d<c;d++){var f=u[d];if(!bi(f)){var v=!i.immutableKeys[f];if(v)for(var p=0,y=l.length;p<y;p++)l[p]._private[i.field][f]=void 0}}i.triggerEvent&&s[i.triggerFnName](i.event)}else if(a===void 0){for(var m=0,g=l.length;m<g;m++)for(var x=l[m]._private[i.field],b=Object.keys(x),w=0;w<b.length;w++){var E=b[w],C=!i.immutableKeys[E];C&&(x[E]=void 0)}i.triggerEvent&&s[i.triggerFnName](i.event)}return s}}},wH={eventAliasesOn:function(e){var r=e;r.addListener=r.listen=r.bind=r.on,r.unlisten=r.unbind=r.off=r.removeListener,r.trigger=r.emit,r.pon=r.promiseOn=function(n,a){var i=this,s=Array.prototype.slice.call(arguments,0);return new jo(function(o,l){var u=function(v){i.off.apply(i,d),o(v)},c=s.concat([u]),d=c.concat([]);i.on.apply(i,c)})}}},ft={};[RG,bH,wH].forEach(function(t){We(ft,t)});var EH={animate:ft.animate(),animation:ft.animation(),animated:ft.animated(),clearQueue:ft.clearQueue(),delay:ft.delay(),delayAnimation:ft.delayAnimation(),stop:ft.stop()},ud={classes:function(e){var r=this;if(e===void 0){var n=[];return r[0]._private.classes.forEach(function(p){return n.push(p)}),n}else mt(e)||(e=(e||"").match(/\S+/g)||[]);for(var a=[],i=new _o(e),s=0;s<r.length;s++){for(var o=r[s],l=o._private,u=l.classes,c=!1,d=0;d<e.length;d++){var f=e[d],v=u.has(f);if(!v){c=!0;break}}c||(c=u.size!==e.length),c&&(l.classes=i,a.push(o))}return a.length>0&&this.spawn(a).updateStyle().emit("class"),r},addClass:function(e){return this.toggleClass(e,!0)},hasClass:function(e){var r=this[0];return r!=null&&r._private.classes.has(e)},toggleClass:function(e,r){mt(e)||(e=e.match(/\S+/g)||[]);for(var n=this,a=r===void 0,i=[],s=0,o=n.length;s<o;s++)for(var l=n[s],u=l._private.classes,c=!1,d=0;d<e.length;d++){var f=e[d],v=u.has(f),p=!1;r||a&&!v?(u.add(f),p=!0):(!r||a&&v)&&(u.delete(f),p=!0),!c&&p&&(i.push(l),c=!0)}return i.length>0&&this.spawn(i).updateStyle().emit("class"),n},removeClass:function(e){return this.toggleClass(e,!1)},flashClass:function(e,r){var n=this;if(r==null)r=250;else if(r===0)return n;return n.addClass(e),setTimeout(function(){n.removeClass(e)},r),n}};ud.className=ud.classNames=ud.classes;var nt={metaChar:"[\\!\\\"\\#\\$\\%\\&\\'\\(\\)\\*\\+\\,\\.\\/\\:\\;\\<\\=\\>\\?\\@\\[\\]\\^\\`\\{\\|\\}\\~]",comparatorOp:"=|\\!=|>|>=|<|<=|\\$=|\\^=|\\*=",boolOp:"\\?|\\!|\\^",string:`"(?:\\\\"|[^"])*"|'(?:\\\\'|[^'])*'`,number:tr,meta:"degree|indegree|outdegree",separator:"\\s*,\\s*",descendant:"\\s+",child:"\\s+>\\s+",subject:"\\$",group:"node|edge|\\*",directedEdge:"\\s+->\\s+",undirectedEdge:"\\s+<->\\s+"};nt.variable="(?:[\\w-.]|(?:\\\\"+nt.metaChar+"))+";nt.className="(?:[\\w-]|(?:\\\\"+nt.metaChar+"))+";nt.value=nt.string+"|"+nt.number;nt.id=nt.variable;(function(){var t,e,r;for(t=nt.comparatorOp.split("|"),r=0;r<t.length;r++)e=t[r],nt.comparatorOp+="|@"+e;for(t=nt.comparatorOp.split("|"),r=0;r<t.length;r++)e=t[r],!(e.indexOf("!")>=0)&&e!=="="&&(nt.comparatorOp+="|\\!"+e)})();var pt=function(){return{checks:[]}},Be={GROUP:0,COLLECTION:1,FILTER:2,DATA_COMPARE:3,DATA_EXIST:4,DATA_BOOL:5,META_COMPARE:6,STATE:7,ID:8,CLASS:9,UNDIRECTED_EDGE:10,DIRECTED_EDGE:11,NODE_SOURCE:12,NODE_TARGET:13,NODE_NEIGHBOR:14,CHILD:15,DESCENDANT:16,PARENT:17,ANCESTOR:18,COMPOUND_SPLIT:19,TRUE:20},G1=[{selector:":selected",matches:function(e){return e.selected()}},{selector:":unselected",matches:function(e){return!e.selected()}},{selector:":selectable",matches:function(e){return e.selectable()}},{selector:":unselectable",matches:function(e){return!e.selectable()}},{selector:":locked",matches:function(e){return e.locked()}},{selector:":unlocked",matches:function(e){return!e.locked()}},{selector:":visible",matches:function(e){return e.visible()}},{selector:":hidden",matches:function(e){return!e.visible()}},{selector:":transparent",matches:function(e){return e.transparent()}},{selector:":grabbed",matches:function(e){return e.grabbed()}},{selector:":free",matches:function(e){return!e.grabbed()}},{selector:":removed",matches:function(e){return e.removed()}},{selector:":inside",matches:function(e){return!e.removed()}},{selector:":grabbable",matches:function(e){return e.grabbable()}},{selector:":ungrabbable",matches:function(e){return!e.grabbable()}},{selector:":animated",matches:function(e){return e.animated()}},{selector:":unanimated",matches:function(e){return!e.animated()}},{selector:":parent",matches:function(e){return e.isParent()}},{selector:":childless",matches:function(e){return e.isChildless()}},{selector:":child",matches:function(e){return e.isChild()}},{selector:":orphan",matches:function(e){return e.isOrphan()}},{selector:":nonorphan",matches:function(e){return e.isChild()}},{selector:":compound",matches:function(e){return e.isNode()?e.isParent():e.source().isParent()||e.target().isParent()}},{selector:":loop",matches:function(e){return e.isLoop()}},{selector:":simple",matches:function(e){return e.isSimple()}},{selector:":active",matches:function(e){return e.active()}},{selector:":inactive",matches:function(e){return!e.active()}},{selector:":backgrounding",matches:function(e){return e.backgrounding()}},{selector:":nonbackgrounding",matches:function(e){return!e.backgrounding()}}].sort(function(t,e){return b$(t.selector,e.selector)}),SH=function(){for(var t={},e,r=0;r<G1.length;r++)e=G1[r],t[e.selector]=e.matches;return t}(),CH=function(e,r){return SH[e](r)},NH="("+G1.map(function(t){return t.selector}).join("|")+")",Rs=function(e){return e.replace(new RegExp("\\\\("+nt.metaChar+")","g"),function(r,n){return n})},Ha=function(e,r,n){e[e.length-1]=n},H1=[{name:"group",query:!0,regex:"("+nt.group+")",populate:function(e,r,n){var a=Ht(n,1),i=a[0];r.checks.push({type:Be.GROUP,value:i==="*"?i:i+"s"})}},{name:"state",query:!0,regex:NH,populate:function(e,r,n){var a=Ht(n,1),i=a[0];r.checks.push({type:Be.STATE,value:i})}},{name:"id",query:!0,regex:"\\#("+nt.id+")",populate:function(e,r,n){var a=Ht(n,1),i=a[0];r.checks.push({type:Be.ID,value:Rs(i)})}},{name:"className",query:!0,regex:"\\.("+nt.className+")",populate:function(e,r,n){var a=Ht(n,1),i=a[0];r.checks.push({type:Be.CLASS,value:Rs(i)})}},{name:"dataExists",query:!0,regex:"\\[\\s*("+nt.variable+")\\s*\\]",populate:function(e,r,n){var a=Ht(n,1),i=a[0];r.checks.push({type:Be.DATA_EXIST,field:Rs(i)})}},{name:"dataCompare",query:!0,regex:"\\[\\s*("+nt.variable+")\\s*("+nt.comparatorOp+")\\s*("+nt.value+")\\s*\\]",populate:function(e,r,n){var a=Ht(n,3),i=a[0],s=a[1],o=a[2],l=new RegExp("^"+nt.string+"$").exec(o)!=null;l?o=o.substring(1,o.length-1):o=parseFloat(o),r.checks.push({type:Be.DATA_COMPARE,field:Rs(i),operator:s,value:o})}},{name:"dataBool",query:!0,regex:"\\[\\s*("+nt.boolOp+")\\s*("+nt.variable+")\\s*\\]",populate:function(e,r,n){var a=Ht(n,2),i=a[0],s=a[1];r.checks.push({type:Be.DATA_BOOL,field:Rs(s),operator:i})}},{name:"metaCompare",query:!0,regex:"\\[\\[\\s*("+nt.meta+")\\s*("+nt.comparatorOp+")\\s*("+nt.number+")\\s*\\]\\]",populate:function(e,r,n){var a=Ht(n,3),i=a[0],s=a[1],o=a[2];r.checks.push({type:Be.META_COMPARE,field:Rs(i),operator:s,value:parseFloat(o)})}},{name:"nextQuery",separator:!0,regex:nt.separator,populate:function(e,r){var n=e.currentSubject,a=e.edgeCount,i=e.compoundCount,s=e[e.length-1];n!=null&&(s.subject=n,e.currentSubject=null),s.edgeCount=a,s.compoundCount=i,e.edgeCount=0,e.compoundCount=0;var o=e[e.length++]=pt();return o}},{name:"directedEdge",separator:!0,regex:nt.directedEdge,populate:function(e,r){if(e.currentSubject==null){var n=pt(),a=r,i=pt();return n.checks.push({type:Be.DIRECTED_EDGE,source:a,target:i}),Ha(e,r,n),e.edgeCount++,i}else{var s=pt(),o=r,l=pt();return s.checks.push({type:Be.NODE_SOURCE,source:o,target:l}),Ha(e,r,s),e.edgeCount++,l}}},{name:"undirectedEdge",separator:!0,regex:nt.undirectedEdge,populate:function(e,r){if(e.currentSubject==null){var n=pt(),a=r,i=pt();return n.checks.push({type:Be.UNDIRECTED_EDGE,nodes:[a,i]}),Ha(e,r,n),e.edgeCount++,i}else{var s=pt(),o=r,l=pt();return s.checks.push({type:Be.NODE_NEIGHBOR,node:o,neighbor:l}),Ha(e,r,s),l}}},{name:"child",separator:!0,regex:nt.child,populate:function(e,r){if(e.currentSubject==null){var n=pt(),a=pt(),i=e[e.length-1];return n.checks.push({type:Be.CHILD,parent:i,child:a}),Ha(e,r,n),e.compoundCount++,a}else if(e.currentSubject===r){var s=pt(),o=e[e.length-1],l=pt(),u=pt(),c=pt(),d=pt();return s.checks.push({type:Be.COMPOUND_SPLIT,left:o,right:l,subject:u}),u.checks=r.checks,r.checks=[{type:Be.TRUE}],d.checks.push({type:Be.TRUE}),l.checks.push({type:Be.PARENT,parent:d,child:c}),Ha(e,o,s),e.currentSubject=u,e.compoundCount++,c}else{var f=pt(),v=pt(),p=[{type:Be.PARENT,parent:f,child:v}];return f.checks=r.checks,r.checks=p,e.compoundCount++,v}}},{name:"descendant",separator:!0,regex:nt.descendant,populate:function(e,r){if(e.currentSubject==null){var n=pt(),a=pt(),i=e[e.length-1];return n.checks.push({type:Be.DESCENDANT,ancestor:i,descendant:a}),Ha(e,r,n),e.compoundCount++,a}else if(e.currentSubject===r){var s=pt(),o=e[e.length-1],l=pt(),u=pt(),c=pt(),d=pt();return s.checks.push({type:Be.COMPOUND_SPLIT,left:o,right:l,subject:u}),u.checks=r.checks,r.checks=[{type:Be.TRUE}],d.checks.push({type:Be.TRUE}),l.checks.push({type:Be.ANCESTOR,ancestor:d,descendant:c}),Ha(e,o,s),e.currentSubject=u,e.compoundCount++,c}else{var f=pt(),v=pt(),p=[{type:Be.ANCESTOR,ancestor:f,descendant:v}];return f.checks=r.checks,r.checks=p,e.compoundCount++,v}}},{name:"subject",modifier:!0,regex:nt.subject,populate:function(e,r){if(e.currentSubject!=null&&e.currentSubject!==r)return ht("Redefinition of subject in selector `"+e.toString()+"`"),!1;e.currentSubject=r;var n=e[e.length-1],a=n.checks[0],i=a==null?null:a.type;i===Be.DIRECTED_EDGE?a.type=Be.NODE_TARGET:i===Be.UNDIRECTED_EDGE&&(a.type=Be.NODE_NEIGHBOR,a.node=a.nodes[1],a.neighbor=a.nodes[0],a.nodes=null)}}];H1.forEach(function(t){return t.regexObj=new RegExp("^"+t.regex)});var TH=function(e){for(var r,n,a,i=0;i<H1.length;i++){var s=H1[i],o=s.name,l=e.match(s.regexObj);if(l!=null){n=l,r=s,a=o;var u=l[0];e=e.substring(u.length);break}}return{expr:r,match:n,name:a,remaining:e}},RH=function(e){var r=e.match(/^\s+/);if(r){var n=r[0];e=e.substring(n.length)}return e},PH=function(e){var r=this,n=r.inputText=e,a=r[0]=pt();for(r.length=1,n=RH(n);;){var i=TH(n);if(i.expr==null)return ht("The selector `"+e+"`is invalid"),!1;var s=i.match.slice(1),o=i.expr.populate(r,a,s);if(o===!1)return!1;if(o!=null&&(a=o),n=i.remaining,n.match(/^\s*$/))break}var l=r[r.length-1];r.currentSubject!=null&&(l.subject=r.currentSubject),l.edgeCount=r.edgeCount,l.compoundCount=r.compoundCount;for(var u=0;u<r.length;u++){var c=r[u];if(c.compoundCount>0&&c.edgeCount>0)return ht("The selector `"+e+"` is invalid because it uses both a compound selector and an edge selector"),!1;if(c.edgeCount>1)return ht("The selector `"+e+"` is invalid because it uses multiple edge selectors"),!1;c.edgeCount===1&&ht("The selector `"+e+"` is deprecated. Edge selectors do not take effect on changes to source and target nodes after an edge is added, for performance reasons. Use a class or data selector on edges instead, updating the class or data of an edge when your app detects a change in source or target nodes.")}return!0},AH=function(){if(this.toStringCache!=null)return this.toStringCache;for(var e=function(c){return c??""},r=function(c){return Ve(c)?'"'+c+'"':e(c)},n=function(c){return" "+c+" "},a=function(c,d){var f=c.type,v=c.value;switch(f){case Be.GROUP:{var p=e(v);return p.substring(0,p.length-1)}case Be.DATA_COMPARE:{var y=c.field,m=c.operator;return"["+y+n(e(m))+r(v)+"]"}case Be.DATA_BOOL:{var g=c.operator,x=c.field;return"["+e(g)+x+"]"}case Be.DATA_EXIST:{var b=c.field;return"["+b+"]"}case Be.META_COMPARE:{var w=c.operator,E=c.field;return"[["+E+n(e(w))+r(v)+"]]"}case Be.STATE:return v;case Be.ID:return"#"+v;case Be.CLASS:return"."+v;case Be.PARENT:case Be.CHILD:return i(c.parent,d)+n(">")+i(c.child,d);case Be.ANCESTOR:case Be.DESCENDANT:return i(c.ancestor,d)+" "+i(c.descendant,d);case Be.COMPOUND_SPLIT:{var C=i(c.left,d),S=i(c.subject,d),T=i(c.right,d);return C+(C.length>0?" ":"")+S+T}case Be.TRUE:return""}},i=function(c,d){return c.checks.reduce(function(f,v,p){return f+(d===c&&p===0?"$":"")+a(v,d)},"")},s="",o=0;o<this.length;o++){var l=this[o];s+=i(l,l.subject),this.length>1&&o<this.length-1&&(s+=", ")}return this.toStringCache=s,s},kH={parse:PH,toString:AH},UM=function(e,r,n){var a,i=Ve(e),s=_e(e),o=Ve(n),l,u,c=!1,d=!1,f=!1;switch(r.indexOf("!")>=0&&(r=r.replace("!",""),d=!0),r.indexOf("@")>=0&&(r=r.replace("@",""),c=!0),(i||o||c)&&(l=!i&&!s?"":""+e,u=""+n),c&&(e=l=l.toLowerCase(),n=u=u.toLowerCase()),r){case"*=":a=l.indexOf(u)>=0;break;case"$=":a=l.indexOf(u,l.length-u.length)>=0;break;case"^=":a=l.indexOf(u)===0;break;case"=":a=e===n;break;case">":f=!0,a=e>n;break;case">=":f=!0,a=e>=n;break;case"<":f=!0,a=e<n;break;case"<=":f=!0,a=e<=n;break;default:a=!1;break}return d&&(e!=null||!f)&&(a=!a),a},LH=function(e,r){switch(r){case"?":return!!e;case"!":return!e;case"^":return e===void 0}},DH=function(e){return e!==void 0},GE=function(e,r){return e.data(r)},_H=function(e,r){return e[r]()},Mt=[],Ct=function(e,r){return e.checks.every(function(n){return Mt[n.type](n,r)})};Mt[Be.GROUP]=function(t,e){var r=t.value;return r==="*"||r===e.group()};Mt[Be.STATE]=function(t,e){var r=t.value;return CH(r,e)};Mt[Be.ID]=function(t,e){var r=t.value;return e.id()===r};Mt[Be.CLASS]=function(t,e){var r=t.value;return e.hasClass(r)};Mt[Be.META_COMPARE]=function(t,e){var r=t.field,n=t.operator,a=t.value;return UM(_H(e,r),n,a)};Mt[Be.DATA_COMPARE]=function(t,e){var r=t.field,n=t.operator,a=t.value;return UM(GE(e,r),n,a)};Mt[Be.DATA_BOOL]=function(t,e){var r=t.field,n=t.operator;return LH(GE(e,r),n)};Mt[Be.DATA_EXIST]=function(t,e){var r=t.field;return t.operator,DH(GE(e,r))};Mt[Be.UNDIRECTED_EDGE]=function(t,e){var r=t.nodes[0],n=t.nodes[1],a=e.source(),i=e.target();return Ct(r,a)&&Ct(n,i)||Ct(n,a)&&Ct(r,i)};Mt[Be.NODE_NEIGHBOR]=function(t,e){return Ct(t.node,e)&&e.neighborhood().some(function(r){return r.isNode()&&Ct(t.neighbor,r)})};Mt[Be.DIRECTED_EDGE]=function(t,e){return Ct(t.source,e.source())&&Ct(t.target,e.target())};Mt[Be.NODE_SOURCE]=function(t,e){return Ct(t.source,e)&&e.outgoers().some(function(r){return r.isNode()&&Ct(t.target,r)})};Mt[Be.NODE_TARGET]=function(t,e){return Ct(t.target,e)&&e.incomers().some(function(r){return r.isNode()&&Ct(t.source,r)})};Mt[Be.CHILD]=function(t,e){return Ct(t.child,e)&&Ct(t.parent,e.parent())};Mt[Be.PARENT]=function(t,e){return Ct(t.parent,e)&&e.children().some(function(r){return Ct(t.child,r)})};Mt[Be.DESCENDANT]=function(t,e){return Ct(t.descendant,e)&&e.ancestors().some(function(r){return Ct(t.ancestor,r)})};Mt[Be.ANCESTOR]=function(t,e){return Ct(t.ancestor,e)&&e.descendants().some(function(r){return Ct(t.descendant,r)})};Mt[Be.COMPOUND_SPLIT]=function(t,e){return Ct(t.subject,e)&&Ct(t.left,e)&&Ct(t.right,e)};Mt[Be.TRUE]=function(){return!0};Mt[Be.COLLECTION]=function(t,e){var r=t.value;return r.has(e)};Mt[Be.FILTER]=function(t,e){var r=t.value;return r(e)};var jH=function(e){var r=this;if(r.length===1&&r[0].checks.length===1&&r[0].checks[0].type===Be.ID)return e.getElementById(r[0].checks[0].value).collection();var n=function(i){for(var s=0;s<r.length;s++){var o=r[s];if(Ct(o,i))return!0}return!1};return r.text()==null&&(n=function(){return!0}),e.filter(n)},OH=function(e){for(var r=this,n=0;n<r.length;n++){var a=r[n];if(Ct(a,e))return!0}return!1},MH={matches:OH,filter:jH},Si=function(e){this.inputText=e,this.currentSubject=null,this.compoundCount=0,this.edgeCount=0,this.length=0,e==null||Ve(e)&&e.match(/^\s*$/)||(cn(e)?this.addQuery({checks:[{type:Be.COLLECTION,value:e.collection()}]}):Dt(e)?this.addQuery({checks:[{type:Be.FILTER,value:e}]}):Ve(e)?this.parse(e)||(this.invalid=!0):Tt("A selector must be created from a string; found "))},Ci=Si.prototype;[kH,MH].forEach(function(t){return We(Ci,t)});Ci.text=function(){return this.inputText};Ci.size=function(){return this.length};Ci.eq=function(t){return this[t]};Ci.sameText=function(t){return!this.invalid&&!t.invalid&&this.text()===t.text()};Ci.addQuery=function(t){this[this.length++]=t};Ci.selector=Ci.toString;var pi={allAre:function(e){var r=new Si(e);return this.every(function(n){return r.matches(n)})},is:function(e){var r=new Si(e);return this.some(function(n){return r.matches(n)})},some:function(e,r){for(var n=0;n<this.length;n++){var a=r?e.apply(r,[this[n],n,this]):e(this[n],n,this);if(a)return!0}return!1},every:function(e,r){for(var n=0;n<this.length;n++){var a=r?e.apply(r,[this[n],n,this]):e(this[n],n,this);if(!a)return!1}return!0},same:function(e){if(this===e)return!0;e=this.cy().collection(e);var r=this.length,n=e.length;return r!==n?!1:r===1?this[0]===e[0]:this.every(function(a){return e.hasElementWithId(a.id())})},anySame:function(e){return e=this.cy().collection(e),this.some(function(r){return e.hasElementWithId(r.id())})},allAreNeighbors:function(e){e=this.cy().collection(e);var r=this.neighborhood();return e.every(function(n){return r.hasElementWithId(n.id())})},contains:function(e){e=this.cy().collection(e);var r=this;return e.every(function(n){return r.hasElementWithId(n.id())})}};pi.allAreNeighbours=pi.allAreNeighbors;pi.has=pi.contains;pi.equal=pi.equals=pi.same;var En=function(e,r){return function(a,i,s,o){var l=a,u=this,c;if(l==null?c="":cn(l)&&l.length===1&&(c=l.id()),u.length===1&&c){var d=u[0]._private,f=d.traversalCache=d.traversalCache||{},v=f[r]=f[r]||[],p=cs(c),y=v[p];return y||(v[p]=e.call(u,a,i,s,o))}else return e.call(u,a,i,s,o)}},Co={parent:function(e){var r=[];if(this.length===1){var n=this[0]._private.parent;if(n)return n}for(var a=0;a<this.length;a++){var i=this[a],s=i._private.parent;s&&r.push(s)}return this.spawn(r,!0).filter(e)},parents:function(e){for(var r=[],n=this.parent();n.nonempty();){for(var a=0;a<n.length;a++){var i=n[a];r.push(i)}n=n.parent()}return this.spawn(r,!0).filter(e)},commonAncestors:function(e){for(var r,n=0;n<this.length;n++){var a=this[n],i=a.parents();r=r||i,r=r.intersect(i)}return r.filter(e)},orphans:function(e){return this.stdFilter(function(r){return r.isOrphan()}).filter(e)},nonorphans:function(e){return this.stdFilter(function(r){return r.isChild()}).filter(e)},children:En(function(t){for(var e=[],r=0;r<this.length;r++)for(var n=this[r],a=n._private.children,i=0;i<a.length;i++)e.push(a[i]);return this.spawn(e,!0).filter(t)},"children"),siblings:function(e){return this.parent().children().not(this).filter(e)},isParent:function(){var e=this[0];if(e)return e.isNode()&&e._private.children.length!==0},isChildless:function(){var e=this[0];if(e)return e.isNode()&&e._private.children.length===0},isChild:function(){var e=this[0];if(e)return e.isNode()&&e._private.parent!=null},isOrphan:function(){var e=this[0];if(e)return e.isNode()&&e._private.parent==null},descendants:function(e){var r=[];function n(a){for(var i=0;i<a.length;i++){var s=a[i];r.push(s),s.children().nonempty()&&n(s.children())}}return n(this.children()),this.spawn(r,!0).filter(e)}};function HE(t,e,r,n){for(var a=[],i=new _o,s=t.cy(),o=s.hasCompoundNodes(),l=0;l<t.length;l++){var u=t[l];r?a.push(u):o&&n(a,i,u)}for(;a.length>0;){var c=a.shift();e(c),i.add(c.id()),o&&n(a,i,c)}return t}function $M(t,e,r){if(r.isParent())for(var n=r._private.children,a=0;a<n.length;a++){var i=n[a];e.has(i.id())||t.push(i)}}Co.forEachDown=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return HE(this,t,e,$M)};function VM(t,e,r){if(r.isChild()){var n=r._private.parent;e.has(n.id())||t.push(n)}}Co.forEachUp=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return HE(this,t,e,VM)};function IH(t,e,r){VM(t,e,r),$M(t,e,r)}Co.forEachUpAndDown=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return HE(this,t,e,IH)};Co.ancestors=Co.parents;var vu,GM;vu=GM={data:ft.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),removeData:ft.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),scratch:ft.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:ft.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),rscratch:ft.data({field:"rscratch",allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!0}),removeRscratch:ft.removeData({field:"rscratch",triggerEvent:!1}),id:function(){var e=this[0];if(e)return e._private.data.id}};vu.attr=vu.data;vu.removeAttr=vu.removeData;var FH=GM,th={};function Mp(t){return function(e){var r=this;if(e===void 0&&(e=!0),r.length!==0)if(r.isNode()&&!r.removed()){for(var n=0,a=r[0],i=a._private.edges,s=0;s<i.length;s++){var o=i[s];!e&&o.isLoop()||(n+=t(a,o))}return n}else return}}We(th,{degree:Mp(function(t,e){return e.source().same(e.target())?2:1}),indegree:Mp(function(t,e){return e.target().same(t)?1:0}),outdegree:Mp(function(t,e){return e.source().same(t)?1:0})});function Ps(t,e){return function(r){for(var n,a=this.nodes(),i=0;i<a.length;i++){var s=a[i],o=s[t](r);o!==void 0&&(n===void 0||e(o,n))&&(n=o)}return n}}We(th,{minDegree:Ps("degree",function(t,e){return t<e}),maxDegree:Ps("degree",function(t,e){return t>e}),minIndegree:Ps("indegree",function(t,e){return t<e}),maxIndegree:Ps("indegree",function(t,e){return t>e}),minOutdegree:Ps("outdegree",function(t,e){return t<e}),maxOutdegree:Ps("outdegree",function(t,e){return t>e})});We(th,{totalDegree:function(e){for(var r=0,n=this.nodes(),a=0;a<n.length;a++)r+=n[a].degree(e);return r}});var Vn,HM,WM=function(e,r,n){for(var a=0;a<e.length;a++){var i=e[a];if(!i.locked()){var s=i._private.position,o={x:r.x!=null?r.x-s.x:0,y:r.y!=null?r.y-s.y:0};i.isParent()&&!(o.x===0&&o.y===0)&&i.children().shift(o,n),i.dirtyBoundingBoxCache()}}},iR={field:"position",bindingEvent:"position",allowBinding:!0,allowSetting:!0,settingEvent:"position",settingTriggersEvent:!0,triggerFnName:"emitAndNotify",allowGetting:!0,validKeys:["x","y"],beforeGet:function(e){e.updateCompoundBounds()},beforeSet:function(e,r){WM(e,r,!1)},onSet:function(e){e.dirtyCompoundBoundsCache()},canSet:function(e){return!e.locked()}};Vn=HM={position:ft.data(iR),silentPosition:ft.data(We({},iR,{allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!1,beforeSet:function(e,r){WM(e,r,!0)},onSet:function(e){e.dirtyCompoundBoundsCache()}})),positions:function(e,r){if(st(e))r?this.silentPosition(e):this.position(e);else if(Dt(e)){var n=e,a=this.cy();a.startBatch();for(var i=0;i<this.length;i++){var s=this[i],o=void 0;(o=n(s,i))&&(r?s.silentPosition(o):s.position(o))}a.endBatch()}return this},silentPositions:function(e){return this.positions(e,!0)},shift:function(e,r,n){var a;if(st(e)?(a={x:_e(e.x)?e.x:0,y:_e(e.y)?e.y:0},n=r):Ve(e)&&_e(r)&&(a={x:0,y:0},a[e]=r),a!=null){var i=this.cy();i.startBatch();for(var s=0;s<this.length;s++){var o=this[s];if(!(i.hasCompoundNodes()&&o.isChild()&&o.ancestors().anySame(this))){var l=o.position(),u={x:l.x+a.x,y:l.y+a.y};n?o.silentPosition(u):o.position(u)}}i.endBatch()}return this},silentShift:function(e,r){return st(e)?this.shift(e,!0):Ve(e)&&_e(r)&&this.shift(e,r,!0),this},renderedPosition:function(e,r){var n=this[0],a=this.cy(),i=a.zoom(),s=a.pan(),o=st(e)?e:void 0,l=o!==void 0||r!==void 0&&Ve(e);if(n&&n.isNode())if(l)for(var u=0;u<this.length;u++){var c=this[u];r!==void 0?c.position(e,(r-s[e])/i):o!==void 0&&c.position(wM(o,i,s))}else{var d=n.position();return o=Xf(d,i,s),e===void 0?o:o[e]}else if(!l)return;return this},relativePosition:function(e,r){var n=this[0],a=this.cy(),i=st(e)?e:void 0,s=i!==void 0||r!==void 0&&Ve(e),o=a.hasCompoundNodes();if(n&&n.isNode())if(s)for(var l=0;l<this.length;l++){var u=this[l],c=o?u.parent():null,d=c&&c.length>0,f=d;d&&(c=c[0]);var v=f?c.position():{x:0,y:0};r!==void 0?u.position(e,r+v[e]):i!==void 0&&u.position({x:i.x+v.x,y:i.y+v.y})}else{var p=n.position(),y=o?n.parent():null,m=y&&y.length>0,g=m;m&&(y=y[0]);var x=g?y.position():{x:0,y:0};return i={x:p.x-x.x,y:p.y-x.y},e===void 0?i:i[e]}else if(!s)return;return this}};Vn.modelPosition=Vn.point=Vn.position;Vn.modelPositions=Vn.points=Vn.positions;Vn.renderedPoint=Vn.renderedPosition;Vn.relativePoint=Vn.relativePosition;var BH=HM,ho,Di;ho=Di={};Di.renderedBoundingBox=function(t){var e=this.boundingBox(t),r=this.cy(),n=r.zoom(),a=r.pan(),i=e.x1*n+a.x,s=e.x2*n+a.x,o=e.y1*n+a.y,l=e.y2*n+a.y;return{x1:i,x2:s,y1:o,y2:l,w:s-i,h:l-o}};Di.dirtyCompoundBoundsCache=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,e=this.cy();return!e.styleEnabled()||!e.hasCompoundNodes()?this:(this.forEachUp(function(r){if(r.isParent()){var n=r._private;n.compoundBoundsClean=!1,n.bbCache=null,t||r.emitAndNotify("bounds")}}),this)};Di.updateCompoundBounds=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,e=this.cy();if(!e.styleEnabled()||!e.hasCompoundNodes())return this;if(!t&&e.batching())return this;function r(s){if(!s.isParent())return;var o=s._private,l=s.children(),u=s.pstyle("compound-sizing-wrt-labels").value==="include",c={width:{val:s.pstyle("min-width").pfValue,left:s.pstyle("min-width-bias-left"),right:s.pstyle("min-width-bias-right")},height:{val:s.pstyle("min-height").pfValue,top:s.pstyle("min-height-bias-top"),bottom:s.pstyle("min-height-bias-bottom")}},d=l.boundingBox({includeLabels:u,includeOverlays:!1,useCache:!1}),f=o.position;(d.w===0||d.h===0)&&(d={w:s.pstyle("width").pfValue,h:s.pstyle("height").pfValue},d.x1=f.x-d.w/2,d.x2=f.x+d.w/2,d.y1=f.y-d.h/2,d.y2=f.y+d.h/2);function v(P,A,j){var R=0,O=0,N=A+j;return P>0&&N>0&&(R=A/N*P,O=j/N*P),{biasDiff:R,biasComplementDiff:O}}function p(P,A,j,R){if(j.units==="%")switch(R){case"width":return P>0?j.pfValue*P:0;case"height":return A>0?j.pfValue*A:0;case"average":return P>0&&A>0?j.pfValue*(P+A)/2:0;case"min":return P>0&&A>0?P>A?j.pfValue*A:j.pfValue*P:0;case"max":return P>0&&A>0?P>A?j.pfValue*P:j.pfValue*A:0;default:return 0}else return j.units==="px"?j.pfValue:0}var y=c.width.left.value;c.width.left.units==="px"&&c.width.val>0&&(y=y*100/c.width.val);var m=c.width.right.value;c.width.right.units==="px"&&c.width.val>0&&(m=m*100/c.width.val);var g=c.height.top.value;c.height.top.units==="px"&&c.height.val>0&&(g=g*100/c.height.val);var x=c.height.bottom.value;c.height.bottom.units==="px"&&c.height.val>0&&(x=x*100/c.height.val);var b=v(c.width.val-d.w,y,m),w=b.biasDiff,E=b.biasComplementDiff,C=v(c.height.val-d.h,g,x),S=C.biasDiff,T=C.biasComplementDiff;o.autoPadding=p(d.w,d.h,s.pstyle("padding"),s.pstyle("padding-relative-to").value),o.autoWidth=Math.max(d.w,c.width.val),f.x=(-w+d.x1+d.x2+E)/2,o.autoHeight=Math.max(d.h,c.height.val),f.y=(-S+d.y1+d.y2+T)/2}for(var n=0;n<this.length;n++){var a=this[n],i=a._private;(!i.compoundBoundsClean||t)&&(r(a),e.batching()||(i.compoundBoundsClean=!0))}return this};var xn=function(e){return e===1/0||e===-1/0?0:e},jn=function(e,r,n,a,i){a-r===0||i-n===0||r==null||n==null||a==null||i==null||(e.x1=r<e.x1?r:e.x1,e.x2=a>e.x2?a:e.x2,e.y1=n<e.y1?n:e.y1,e.y2=i>e.y2?i:e.y2,e.w=e.x2-e.x1,e.h=e.y2-e.y1)},Xa=function(e,r){return r==null?e:jn(e,r.x1,r.y1,r.x2,r.y2)},il=function(e,r,n){return Hr(e,r,n)},kc=function(e,r,n){if(!r.cy().headless()){var a=r._private,i=a.rstyle,s=i.arrowWidth/2,o=r.pstyle(n+"-arrow-shape").value,l,u;if(o!=="none"){n==="source"?(l=i.srcX,u=i.srcY):n==="target"?(l=i.tgtX,u=i.tgtY):(l=i.midX,u=i.midY);var c=a.arrowBounds=a.arrowBounds||{},d=c[n]=c[n]||{};d.x1=l-s,d.y1=u-s,d.x2=l+s,d.y2=u+s,d.w=d.x2-d.x1,d.h=d.y2-d.y1,od(d,1),jn(e,d.x1,d.y1,d.x2,d.y2)}}},Ip=function(e,r,n){if(!r.cy().headless()){var a;n?a=n+"-":a="";var i=r._private,s=i.rstyle,o=r.pstyle(a+"label").strValue;if(o){var l=r.pstyle("text-halign"),u=r.pstyle("text-valign"),c=il(s,"labelWidth",n),d=il(s,"labelHeight",n),f=il(s,"labelX",n),v=il(s,"labelY",n),p=r.pstyle(a+"text-margin-x").pfValue,y=r.pstyle(a+"text-margin-y").pfValue,m=r.isEdge(),g=r.pstyle(a+"text-rotation"),x=r.pstyle("text-outline-width").pfValue,b=r.pstyle("text-border-width").pfValue,w=b/2,E=r.pstyle("text-background-padding").pfValue,C=2,S=d,T=c,P=T/2,A=S/2,j,R,O,N;if(m)j=f-P,R=f+P,O=v-A,N=v+A;else{switch(l.value){case"left":j=f-T,R=f;break;case"center":j=f-P,R=f+P;break;case"right":j=f,R=f+T;break}switch(u.value){case"top":O=v-S,N=v;break;case"center":O=v-A,N=v+A;break;case"bottom":O=v,N=v+S;break}}var D=p-Math.max(x,w)-E-C,L=p+Math.max(x,w)+E+C,_=y-Math.max(x,w)-E-C,k=y+Math.max(x,w)+E+C;j+=D,R+=L,O+=_,N+=k;var I=n||"main",F=i.labelBounds,B=F[I]=F[I]||{};B.x1=j,B.y1=O,B.x2=R,B.y2=N,B.w=R-j,B.h=N-O,B.leftPad=D,B.rightPad=L,B.topPad=_,B.botPad=k;var $=m&&g.strValue==="autorotate",W=g.pfValue!=null&&g.pfValue!==0;if($||W){var z=$?il(i.rstyle,"labelAngle",n):g.pfValue,q=Math.cos(z),G=Math.sin(z),J=(j+R)/2,ae=(O+N)/2;if(!m){switch(l.value){case"left":J=R;break;case"right":J=j;break}switch(u.value){case"top":ae=N;break;case"bottom":ae=O;break}}var Y=function(ge,pe){return ge=ge-J,pe=pe-ae,{x:ge*q-pe*G+J,y:ge*G+pe*q+ae}},H=Y(j,O),X=Y(j,N),ee=Y(R,O),ie=Y(R,N);j=Math.min(H.x,X.x,ee.x,ie.x),R=Math.max(H.x,X.x,ee.x,ie.x),O=Math.min(H.y,X.y,ee.y,ie.y),N=Math.max(H.y,X.y,ee.y,ie.y)}var oe=I+"Rot",me=F[oe]=F[oe]||{};me.x1=j,me.y1=O,me.x2=R,me.y2=N,me.w=R-j,me.h=N-O,jn(e,j,O,R,N),jn(i.labelBounds.all,j,O,R,N)}return e}},sR=function(e,r){if(!r.cy().headless()){var n=r.pstyle("outline-opacity").value,a=r.pstyle("outline-width").value,i=r.pstyle("outline-offset").value,s=a+i;YM(e,r,n,s,"outside",s/2)}},YM=function(e,r,n,a,i,s){if(!(n===0||a<=0||i==="inside")){var o=r.cy(),l=r.pstyle("shape").value,u=o.renderer().nodeShapes[l],c=r.position(),d=c.x,f=c.y,v=r.width(),p=r.height();if(u.hasMiterBounds){i==="center"&&(a/=2);var y=u.miterBounds(d,f,v,p,a);Xa(e,y)}else s!=null&&s>0&&ld(e,[s,s,s,s])}},zH=function(e,r){if(!r.cy().headless()){var n=r.pstyle("border-opacity").value,a=r.pstyle("border-width").pfValue,i=r.pstyle("border-position").value;YM(e,r,n,a,i)}},qH=function(e,r){var n=e._private.cy,a=n.styleEnabled(),i=n.headless(),s=Ir(),o=e._private,l=e.isNode(),u=e.isEdge(),c,d,f,v,p,y,m=o.rstyle,g=l&&a?e.pstyle("bounds-expansion").pfValue:[0],x=function(De){return De.pstyle("display").value!=="none"},b=!a||x(e)&&(!u||x(e.source())&&x(e.target()));if(b){var w=0,E=0;a&&r.includeOverlays&&(w=e.pstyle("overlay-opacity").value,w!==0&&(E=e.pstyle("overlay-padding").value));var C=0,S=0;a&&r.includeUnderlays&&(C=e.pstyle("underlay-opacity").value,C!==0&&(S=e.pstyle("underlay-padding").value));var T=Math.max(E,S),P=0,A=0;if(a&&(P=e.pstyle("width").pfValue,A=P/2),l&&r.includeNodes){var j=e.position();p=j.x,y=j.y;var R=e.outerWidth(),O=R/2,N=e.outerHeight(),D=N/2;c=p-O,d=p+O,f=y-D,v=y+D,jn(s,c,f,d,v),a&&sR(s,e),a&&r.includeOutlines&&!i&&sR(s,e),a&&zH(s,e)}else if(u&&r.includeEdges)if(a&&!i){var L=e.pstyle("curve-style").strValue;if(c=Math.min(m.srcX,m.midX,m.tgtX),d=Math.max(m.srcX,m.midX,m.tgtX),f=Math.min(m.srcY,m.midY,m.tgtY),v=Math.max(m.srcY,m.midY,m.tgtY),c-=A,d+=A,f-=A,v+=A,jn(s,c,f,d,v),L==="haystack"){var _=m.haystackPts;if(_&&_.length===2){if(c=_[0].x,f=_[0].y,d=_[1].x,v=_[1].y,c>d){var k=c;c=d,d=k}if(f>v){var I=f;f=v,v=I}jn(s,c-A,f-A,d+A,v+A)}}else if(L==="bezier"||L==="unbundled-bezier"||ni(L,"segments")||ni(L,"taxi")){var F;switch(L){case"bezier":case"unbundled-bezier":F=m.bezierPts;break;case"segments":case"taxi":case"round-segments":case"round-taxi":F=m.linePts;break}if(F!=null)for(var B=0;B<F.length;B++){var $=F[B];c=$.x-A,d=$.x+A,f=$.y-A,v=$.y+A,jn(s,c,f,d,v)}}}else{var W=e.source(),z=W.position(),q=e.target(),G=q.position();if(c=z.x,d=G.x,f=z.y,v=G.y,c>d){var J=c;c=d,d=J}if(f>v){var ae=f;f=v,v=ae}c-=A,d+=A,f-=A,v+=A,jn(s,c,f,d,v)}if(a&&r.includeEdges&&u&&(kc(s,e,"mid-source"),kc(s,e,"mid-target"),kc(s,e,"source"),kc(s,e,"target")),a){var Y=e.pstyle("ghost").value==="yes";if(Y){var H=e.pstyle("ghost-offset-x").pfValue,X=e.pstyle("ghost-offset-y").pfValue;jn(s,s.x1+H,s.y1+X,s.x2+H,s.y2+X)}}var ee=o.bodyBounds=o.bodyBounds||{};GN(ee,s),ld(ee,g),od(ee,1),a&&(c=s.x1,d=s.x2,f=s.y1,v=s.y2,jn(s,c-T,f-T,d+T,v+T));var ie=o.overlayBounds=o.overlayBounds||{};GN(ie,s),ld(ie,g),od(ie,1);var oe=o.labelBounds=o.labelBounds||{};oe.all!=null?EV(oe.all):oe.all=Ir(),a&&r.includeLabels&&(r.includeMainLabels&&Ip(s,e,null),u&&(r.includeSourceLabels&&Ip(s,e,"source"),r.includeTargetLabels&&Ip(s,e,"target")))}return s.x1=xn(s.x1),s.y1=xn(s.y1),s.x2=xn(s.x2),s.y2=xn(s.y2),s.w=xn(s.x2-s.x1),s.h=xn(s.y2-s.y1),s.w>0&&s.h>0&&b&&(ld(s,g),od(s,1)),s},XM=function(e){var r=0,n=function(s){return(s?1:0)<<r++},a=0;return a+=n(e.incudeNodes),a+=n(e.includeEdges),a+=n(e.includeLabels),a+=n(e.includeMainLabels),a+=n(e.includeSourceLabels),a+=n(e.includeTargetLabels),a+=n(e.includeOverlays),a+=n(e.includeOutlines),a},KM=function(e){var r=function(o){return Math.round(o)};if(e.isEdge()){var n=e.source().position(),a=e.target().position();return BN([r(n.x),r(n.y),r(a.x),r(a.y)])}else{var i=e.position();return BN([r(i.x),r(i.y)])}},oR=function(e,r){var n=e._private,a,i=e.isEdge(),s=r==null?lR:XM(r),o=s===lR;if(n.bbCache==null?(a=qH(e,pu),n.bbCache=a,n.bbCachePosKey=KM(e)):a=n.bbCache,!o){var l=e.isNode();a=Ir(),(r.includeNodes&&l||r.includeEdges&&!l)&&(r.includeOverlays?Xa(a,n.overlayBounds):Xa(a,n.bodyBounds)),r.includeLabels&&(r.includeMainLabels&&(!i||r.includeSourceLabels&&r.includeTargetLabels)?Xa(a,n.labelBounds.all):(r.includeMainLabels&&Xa(a,n.labelBounds.mainRot),r.includeSourceLabels&&Xa(a,n.labelBounds.sourceRot),r.includeTargetLabels&&Xa(a,n.labelBounds.targetRot))),a.w=a.x2-a.x1,a.h=a.y2-a.y1}return a},pu={includeNodes:!0,includeEdges:!0,includeLabels:!0,includeMainLabels:!0,includeSourceLabels:!0,includeTargetLabels:!0,includeOverlays:!0,includeUnderlays:!0,includeOutlines:!0,useCache:!0},lR=XM(pu),uR=mr(pu);Di.boundingBox=function(t){var e,r=t===void 0||t.useCache===void 0||t.useCache===!0,n=Eo(function(c){var d=c._private;return d.bbCache==null||d.styleDirty||d.bbCachePosKey!==KM(c)},function(c){return c.id()});if(r&&this.length===1&&!n(this[0]))t===void 0?t=pu:t=uR(t),e=oR(this[0],t);else{e=Ir(),t=t||pu;var a=uR(t),i=this,s=i.cy(),o=s.styleEnabled();this.edges().forEach(n),this.nodes().forEach(n),o&&this.recalculateRenderedStyle(r),this.updateCompoundBounds(!r);for(var l=0;l<i.length;l++){var u=i[l];n(u)&&u.dirtyBoundingBoxCache(),Xa(e,oR(u,a))}}return e.x1=xn(e.x1),e.y1=xn(e.y1),e.x2=xn(e.x2),e.y2=xn(e.y2),e.w=xn(e.x2-e.x1),e.h=xn(e.y2-e.y1),e};Di.dirtyBoundingBoxCache=function(){for(var t=0;t<this.length;t++){var e=this[t]._private;e.bbCache=null,e.bbCachePosKey=null,e.bodyBounds=null,e.overlayBounds=null,e.labelBounds.all=null,e.labelBounds.source=null,e.labelBounds.target=null,e.labelBounds.main=null,e.labelBounds.sourceRot=null,e.labelBounds.targetRot=null,e.labelBounds.mainRot=null,e.arrowBounds.source=null,e.arrowBounds.target=null,e.arrowBounds["mid-source"]=null,e.arrowBounds["mid-target"]=null}return this.emitAndNotify("bounds"),this};Di.boundingBoxAt=function(t){var e=this.nodes(),r=this.cy(),n=r.hasCompoundNodes(),a=r.collection();if(n&&(a=e.filter(function(u){return u.isParent()}),e=e.not(a)),st(t)){var i=t;t=function(){return i}}var s=function(c,d){return c._private.bbAtOldPos=t(c,d)},o=function(c){return c._private.bbAtOldPos};r.startBatch(),e.forEach(s).silentPositions(t),n&&(a.dirtyCompoundBoundsCache(),a.dirtyBoundingBoxCache(),a.updateCompoundBounds(!0));var l=wV(this.boundingBox({useCache:!1}));return e.silentPositions(o),n&&(a.dirtyCompoundBoundsCache(),a.dirtyBoundingBoxCache(),a.updateCompoundBounds(!0)),r.endBatch(),l};ho.boundingbox=ho.bb=ho.boundingBox;ho.renderedBoundingbox=ho.renderedBoundingBox;var UH=Di,wl,$u;wl=$u={};var QM=function(e){e.uppercaseName=CN(e.name),e.autoName="auto"+e.uppercaseName,e.labelName="label"+e.uppercaseName,e.outerName="outer"+e.uppercaseName,e.uppercaseOuterName=CN(e.outerName),wl[e.name]=function(){var n=this[0],a=n._private,i=a.cy,s=i._private.styleEnabled;if(n)if(s){if(n.isParent())return n.updateCompoundBounds(),a[e.autoName]||0;var o=n.pstyle(e.name);switch(o.strValue){case"label":return n.recalculateRenderedStyle(),a.rstyle[e.labelName]||0;default:return o.pfValue}}else return 1},wl["outer"+e.uppercaseName]=function(){var n=this[0],a=n._private,i=a.cy,s=i._private.styleEnabled;if(n)if(s){var o=n[e.name](),l=n.pstyle("border-position").value,u;l==="center"?u=n.pstyle("border-width").pfValue:l==="outside"?u=2*n.pstyle("border-width").pfValue:u=0;var c=2*n.padding();return o+u+c}else return 1},wl["rendered"+e.uppercaseName]=function(){var n=this[0];if(n){var a=n[e.name]();return a*this.cy().zoom()}},wl["rendered"+e.uppercaseOuterName]=function(){var n=this[0];if(n){var a=n[e.outerName]();return a*this.cy().zoom()}}};QM({name:"width"});QM({name:"height"});$u.padding=function(){var t=this[0],e=t._private;return t.isParent()?(t.updateCompoundBounds(),e.autoPadding!==void 0?e.autoPadding:t.pstyle("padding").pfValue):t.pstyle("padding").pfValue};$u.paddedHeight=function(){var t=this[0];return t.height()+2*t.padding()};$u.paddedWidth=function(){var t=this[0];return t.width()+2*t.padding()};var $H=$u,VH=function(e,r){if(e.isEdge()&&e.takesUpSpace())return r(e)},GH=function(e,r){if(e.isEdge()&&e.takesUpSpace()){var n=e.cy();return Xf(r(e),n.zoom(),n.pan())}},HH=function(e,r){if(e.isEdge()&&e.takesUpSpace()){var n=e.cy(),a=n.pan(),i=n.zoom();return r(e).map(function(s){return Xf(s,i,a)})}},WH=function(e){return e.renderer().getControlPoints(e)},YH=function(e){return e.renderer().getSegmentPoints(e)},XH=function(e){return e.renderer().getSourceEndpoint(e)},KH=function(e){return e.renderer().getTargetEndpoint(e)},QH=function(e){return e.renderer().getEdgeMidpoint(e)},cR={controlPoints:{get:WH,mult:!0},segmentPoints:{get:YH,mult:!0},sourceEndpoint:{get:XH},targetEndpoint:{get:KH},midpoint:{get:QH}},ZH=function(e){return"rendered"+e[0].toUpperCase()+e.substr(1)},JH=Object.keys(cR).reduce(function(t,e){var r=cR[e],n=ZH(e);return t[e]=function(){return VH(this,r.get)},r.mult?t[n]=function(){return HH(this,r.get)}:t[n]=function(){return GH(this,r.get)},t},{}),e6=We({},BH,UH,$H,JH);/*!
|
|
91
|
+
Event object based on jQuery events, MIT license
|
|
92
|
+
|
|
93
|
+
https://jquery.org/license/
|
|
94
|
+
https://tldrlegal.com/license/mit-license
|
|
95
|
+
https://github.com/jquery/jquery/blob/master/src/event.js
|
|
96
|
+
*/var ZM=function(e,r){this.recycle(e,r)};function sl(){return!1}function Lc(){return!0}ZM.prototype={instanceString:function(){return"event"},recycle:function(e,r){if(this.isImmediatePropagationStopped=this.isPropagationStopped=this.isDefaultPrevented=sl,e!=null&&e.preventDefault?(this.type=e.type,this.isDefaultPrevented=e.defaultPrevented?Lc:sl):e!=null&&e.type?r=e:this.type=e,r!=null&&(this.originalEvent=r.originalEvent,this.type=r.type!=null?r.type:this.type,this.cy=r.cy,this.target=r.target,this.position=r.position,this.renderedPosition=r.renderedPosition,this.namespace=r.namespace,this.layout=r.layout),this.cy!=null&&this.position!=null&&this.renderedPosition==null){var n=this.position,a=this.cy.zoom(),i=this.cy.pan();this.renderedPosition={x:n.x*a+i.x,y:n.y*a+i.y}}this.timeStamp=e&&e.timeStamp||Date.now()},preventDefault:function(){this.isDefaultPrevented=Lc;var e=this.originalEvent;e&&e.preventDefault&&e.preventDefault()},stopPropagation:function(){this.isPropagationStopped=Lc;var e=this.originalEvent;e&&e.stopPropagation&&e.stopPropagation()},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=Lc,this.stopPropagation()},isDefaultPrevented:sl,isPropagationStopped:sl,isImmediatePropagationStopped:sl};var JM=/^([^.]+)(\.(?:[^.]+))?$/,t6=".*",eI={qualifierCompare:function(e,r){return e===r},eventMatches:function(){return!0},addEventFields:function(){},callbackContext:function(e){return e},beforeEmit:function(){},afterEmit:function(){},bubble:function(){return!1},parent:function(){return null},context:null},dR=Object.keys(eI),r6={};function rh(){for(var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:r6,e=arguments.length>1?arguments[1]:void 0,r=0;r<dR.length;r++){var n=dR[r];this[n]=t[n]||eI[n]}this.context=e||this.context,this.listeners=[],this.emitting=0}var Ni=rh.prototype,tI=function(e,r,n,a,i,s,o){Dt(a)&&(i=a,a=null),o&&(s==null?s=o:s=We({},s,o));for(var l=mt(n)?n:n.split(/\s+/),u=0;u<l.length;u++){var c=l[u];if(!bi(c)){var d=c.match(JM);if(d){var f=d[1],v=d[2]?d[2]:null,p=r(e,c,f,v,a,i,s);if(p===!1)break}}}},fR=function(e,r){return e.addEventFields(e.context,r),new ZM(r.type,r)},n6=function(e,r,n){if(u$(n)){r(e,n);return}else if(st(n)){r(e,fR(e,n));return}for(var a=mt(n)?n:n.split(/\s+/),i=0;i<a.length;i++){var s=a[i];if(!bi(s)){var o=s.match(JM);if(o){var l=o[1],u=o[2]?o[2]:null,c=fR(e,{type:l,namespace:u,target:e.context});r(e,c)}}}};Ni.on=Ni.addListener=function(t,e,r,n,a){return tI(this,function(i,s,o,l,u,c,d){Dt(c)&&i.listeners.push({event:s,callback:c,type:o,namespace:l,qualifier:u,conf:d})},t,e,r,n,a),this};Ni.one=function(t,e,r,n){return this.on(t,e,r,n,{one:!0})};Ni.removeListener=Ni.off=function(t,e,r,n){var a=this;this.emitting!==0&&(this.listeners=G$(this.listeners));for(var i=this.listeners,s=function(u){var c=i[u];tI(a,function(d,f,v,p,y,m){if((c.type===v||t==="*")&&(!p&&c.namespace!==".*"||c.namespace===p)&&(!y||d.qualifierCompare(c.qualifier,y))&&(!m||c.callback===m))return i.splice(u,1),!1},t,e,r,n)},o=i.length-1;o>=0;o--)s(o);return this};Ni.removeAllListeners=function(){return this.removeListener("*")};Ni.emit=Ni.trigger=function(t,e,r){var n=this.listeners,a=n.length;return this.emitting++,mt(e)||(e=[e]),n6(this,function(i,s){r!=null&&(n=[{event:s.event,type:s.type,namespace:s.namespace,callback:r}],a=n.length);for(var o=function(){var c=n[l];if(c.type===s.type&&(!c.namespace||c.namespace===s.namespace||c.namespace===t6)&&i.eventMatches(i.context,c,s)){var d=[s];e!=null&&W$(d,e),i.beforeEmit(i.context,c,s),c.conf&&c.conf.one&&(i.listeners=i.listeners.filter(function(p){return p!==c}));var f=i.callbackContext(i.context,c,s),v=c.callback.apply(f,d);i.afterEmit(i.context,c,s),v===!1&&(s.stopPropagation(),s.preventDefault())}},l=0;l<a;l++)o();i.bubble(i.context)&&!s.isPropagationStopped()&&i.parent(i.context).emit(s,e)},t),this.emitting--,this};var a6={qualifierCompare:function(e,r){return e==null||r==null?e==null&&r==null:e.sameText(r)},eventMatches:function(e,r,n){var a=r.qualifier;return a!=null?e!==n.target&&Iu(n.target)&&a.matches(n.target):!0},addEventFields:function(e,r){r.cy=e.cy(),r.target=e},callbackContext:function(e,r,n){return r.qualifier!=null?n.target:e},beforeEmit:function(e,r){r.conf&&r.conf.once&&r.conf.onceCollection.removeListener(r.event,r.qualifier,r.callback)},bubble:function(){return!0},parent:function(e){return e.isChild()?e.parent():e.cy()}},Dc=function(e){return Ve(e)?new Si(e):e},rI={createEmitter:function(){for(var e=0;e<this.length;e++){var r=this[e],n=r._private;n.emitter||(n.emitter=new rh(a6,r))}return this},emitter:function(){return this._private.emitter},on:function(e,r,n){for(var a=Dc(r),i=0;i<this.length;i++){var s=this[i];s.emitter().on(e,a,n)}return this},removeListener:function(e,r,n){for(var a=Dc(r),i=0;i<this.length;i++){var s=this[i];s.emitter().removeListener(e,a,n)}return this},removeAllListeners:function(){for(var e=0;e<this.length;e++){var r=this[e];r.emitter().removeAllListeners()}return this},one:function(e,r,n){for(var a=Dc(r),i=0;i<this.length;i++){var s=this[i];s.emitter().one(e,a,n)}return this},once:function(e,r,n){for(var a=Dc(r),i=0;i<this.length;i++){var s=this[i];s.emitter().on(e,a,n,{once:!0,onceCollection:this})}},emit:function(e,r){for(var n=0;n<this.length;n++){var a=this[n];a.emitter().emit(e,r)}return this},emitAndNotify:function(e,r){if(this.length!==0)return this.cy().notify(e,this),this.emit(e,r),this}};ft.eventAliasesOn(rI);var nI={nodes:function(e){return this.filter(function(r){return r.isNode()}).filter(e)},edges:function(e){return this.filter(function(r){return r.isEdge()}).filter(e)},byGroup:function(){for(var e=this.spawn(),r=this.spawn(),n=0;n<this.length;n++){var a=this[n];a.isNode()?e.push(a):r.push(a)}return{nodes:e,edges:r}},filter:function(e,r){if(e===void 0)return this;if(Ve(e)||cn(e))return new Si(e).filter(this);if(Dt(e)){for(var n=this.spawn(),a=this,i=0;i<a.length;i++){var s=a[i],o=r?e.apply(r,[s,i,a]):e(s,i,a);o&&n.push(s)}return n}return this.spawn()},not:function(e){if(e){Ve(e)&&(e=this.filter(e));for(var r=this.spawn(),n=0;n<this.length;n++){var a=this[n],i=e.has(a);i||r.push(a)}return r}else return this},absoluteComplement:function(){var e=this.cy();return e.mutableElements().not(this)},intersect:function(e){if(Ve(e)){var r=e;return this.filter(r)}for(var n=this.spawn(),a=this,i=e,s=this.length<e.length,o=s?a:i,l=s?i:a,u=0;u<o.length;u++){var c=o[u];l.has(c)&&n.push(c)}return n},xor:function(e){var r=this._private.cy;Ve(e)&&(e=r.$(e));var n=this.spawn(),a=this,i=e,s=function(l,u){for(var c=0;c<l.length;c++){var d=l[c],f=d._private.data.id,v=u.hasElementWithId(f);v||n.push(d)}};return s(a,i),s(i,a),n},diff:function(e){var r=this._private.cy;Ve(e)&&(e=r.$(e));var n=this.spawn(),a=this.spawn(),i=this.spawn(),s=this,o=e,l=function(c,d,f){for(var v=0;v<c.length;v++){var p=c[v],y=p._private.data.id,m=d.hasElementWithId(y);m?i.merge(p):f.push(p)}};return l(s,o,n),l(o,s,a),{left:n,right:a,both:i}},add:function(e){var r=this._private.cy;if(!e)return this;if(Ve(e)){var n=e;e=r.mutableElements().filter(n)}for(var a=this.spawnSelf(),i=0;i<e.length;i++){var s=e[i],o=!this.has(s);o&&a.push(s)}return a},merge:function(e){var r=this._private,n=r.cy;if(!e)return this;if(e&&Ve(e)){var a=e;e=n.mutableElements().filter(a)}for(var i=r.map,s=0;s<e.length;s++){var o=e[s],l=o._private.data.id,u=!i.has(l);if(u){var c=this.length++;this[c]=o,i.set(l,{ele:o,index:c})}}return this},unmergeAt:function(e){var r=this[e],n=r.id(),a=this._private,i=a.map;this[e]=void 0,i.delete(n);var s=e===this.length-1;if(this.length>1&&!s){var o=this.length-1,l=this[o],u=l._private.data.id;this[o]=void 0,this[e]=l,i.set(u,{ele:l,index:e})}return this.length--,this},unmergeOne:function(e){e=e[0];var r=this._private,n=e._private.data.id,a=r.map,i=a.get(n);if(!i)return this;var s=i.index;return this.unmergeAt(s),this},unmerge:function(e){var r=this._private.cy;if(!e)return this;if(e&&Ve(e)){var n=e;e=r.mutableElements().filter(n)}for(var a=0;a<e.length;a++)this.unmergeOne(e[a]);return this},unmergeBy:function(e){for(var r=this.length-1;r>=0;r--){var n=this[r];e(n)&&this.unmergeAt(r)}return this},map:function(e,r){for(var n=[],a=this,i=0;i<a.length;i++){var s=a[i],o=r?e.apply(r,[s,i,a]):e(s,i,a);n.push(o)}return n},reduce:function(e,r){for(var n=r,a=this,i=0;i<a.length;i++)n=e(n,a[i],i,a);return n},max:function(e,r){for(var n=-1/0,a,i=this,s=0;s<i.length;s++){var o=i[s],l=r?e.apply(r,[o,s,i]):e(o,s,i);l>n&&(n=l,a=o)}return{value:n,ele:a}},min:function(e,r){for(var n=1/0,a,i=this,s=0;s<i.length;s++){var o=i[s],l=r?e.apply(r,[o,s,i]):e(o,s,i);l<n&&(n=l,a=o)}return{value:n,ele:a}}},ot=nI;ot.u=ot["|"]=ot["+"]=ot.union=ot.or=ot.add;ot["\\"]=ot["!"]=ot["-"]=ot.difference=ot.relativeComplement=ot.subtract=ot.not;ot.n=ot["&"]=ot["."]=ot.and=ot.intersection=ot.intersect;ot["^"]=ot["(+)"]=ot["(-)"]=ot.symmetricDifference=ot.symdiff=ot.xor;ot.fnFilter=ot.filterFn=ot.stdFilter=ot.filter;ot.complement=ot.abscomp=ot.absoluteComplement;var i6={isNode:function(){return this.group()==="nodes"},isEdge:function(){return this.group()==="edges"},isLoop:function(){return this.isEdge()&&this.source()[0]===this.target()[0]},isSimple:function(){return this.isEdge()&&this.source()[0]!==this.target()[0]},group:function(){var e=this[0];if(e)return e._private.group}},aI=function(e,r){var n=e.cy(),a=n.hasCompoundNodes();function i(c){var d=c.pstyle("z-compound-depth");return d.value==="auto"?a?c.zDepth():0:d.value==="bottom"?-1:d.value==="top"?OE:0}var s=i(e)-i(r);if(s!==0)return s;function o(c){var d=c.pstyle("z-index-compare");return d.value==="auto"&&c.isNode()?1:0}var l=o(e)-o(r);if(l!==0)return l;var u=e.pstyle("z-index").value-r.pstyle("z-index").value;return u!==0?u:e.poolIndex()-r.poolIndex()},tf={forEach:function(e,r){if(Dt(e))for(var n=this.length,a=0;a<n;a++){var i=this[a],s=r?e.apply(r,[i,a,this]):e(i,a,this);if(s===!1)break}return this},toArray:function(){for(var e=[],r=0;r<this.length;r++)e.push(this[r]);return e},slice:function(e,r){var n=[],a=this.length;r==null&&(r=a),e==null&&(e=0),e<0&&(e=a+e),r<0&&(r=a+r);for(var i=e;i>=0&&i<r&&i<a;i++)n.push(this[i]);return this.spawn(n)},size:function(){return this.length},eq:function(e){return this[e]||this.spawn()},first:function(){return this[0]||this.spawn()},last:function(){return this[this.length-1]||this.spawn()},empty:function(){return this.length===0},nonempty:function(){return!this.empty()},sort:function(e){if(!Dt(e))return this;var r=this.toArray().sort(e);return this.spawn(r)},sortByZIndex:function(){return this.sort(aI)},zDepth:function(){var e=this[0];if(e){var r=e._private,n=r.group;if(n==="nodes"){var a=r.data.parent?e.parents().size():0;return e.isParent()?a:OE-1}else{var i=r.source,s=r.target,o=i.zDepth(),l=s.zDepth();return Math.max(o,l,0)}}}};tf.each=tf.forEach;var s6=function(){var e="undefined",r=(typeof Symbol>"u"?"undefined":rr(Symbol))!=e&&rr(Symbol.iterator)!=e;r&&(tf[Symbol.iterator]=function(){var n=this,a={value:void 0,done:!1},i=0,s=this.length;return rM({next:function(){return i<s?a.value=n[i++]:(a.value=void 0,a.done=!0),a}},Symbol.iterator,function(){return this})})};s6();var o6=mr({nodeDimensionsIncludeLabels:!1}),cd={layoutDimensions:function(e){e=o6(e);var r;if(!this.takesUpSpace())r={w:0,h:0};else if(e.nodeDimensionsIncludeLabels){var n=this.boundingBox();r={w:n.w,h:n.h}}else r={w:this.outerWidth(),h:this.outerHeight()};return(r.w===0||r.h===0)&&(r.w=r.h=1),r},layoutPositions:function(e,r,n){var a=this.nodes().filter(function(E){return!E.isParent()}),i=this.cy(),s=r.eles,o=function(C){return C.id()},l=Eo(n,o);e.emit({type:"layoutstart",layout:e}),e.animations=[];var u=function(C,S,T){var P={x:S.x1+S.w/2,y:S.y1+S.h/2},A={x:(T.x-P.x)*C,y:(T.y-P.y)*C};return{x:P.x+A.x,y:P.y+A.y}},c=r.spacingFactor&&r.spacingFactor!==1,d=function(){if(!c)return null;for(var C=Ir(),S=0;S<a.length;S++){var T=a[S],P=l(T,S);EM(C,P.x,P.y)}return C},f=d(),v=Eo(function(E,C){var S=l(E,C);if(c){var T=Math.abs(r.spacingFactor);S=u(T,f,S)}return r.transform!=null&&(S=r.transform(E,S)),S},o);if(r.animate){for(var p=0;p<a.length;p++){var y=a[p],m=v(y,p),g=r.animateFilter==null||r.animateFilter(y,p);if(g){var x=y.animation({position:m,duration:r.animationDuration,easing:r.animationEasing});e.animations.push(x)}else y.position(m)}if(r.fit){var b=i.animation({fit:{boundingBox:s.boundingBoxAt(v),padding:r.padding},duration:r.animationDuration,easing:r.animationEasing});e.animations.push(b)}else if(r.zoom!==void 0&&r.pan!==void 0){var w=i.animation({zoom:r.zoom,pan:r.pan,duration:r.animationDuration,easing:r.animationEasing});e.animations.push(w)}e.animations.forEach(function(E){return E.play()}),e.one("layoutready",r.ready),e.emit({type:"layoutready",layout:e}),jo.all(e.animations.map(function(E){return E.promise()})).then(function(){e.one("layoutstop",r.stop),e.emit({type:"layoutstop",layout:e})})}else a.positions(v),r.fit&&i.fit(r.eles,r.padding),r.zoom!=null&&i.zoom(r.zoom),r.pan&&i.pan(r.pan),e.one("layoutready",r.ready),e.emit({type:"layoutready",layout:e}),e.one("layoutstop",r.stop),e.emit({type:"layoutstop",layout:e});return this},layout:function(e){var r=this.cy();return r.makeLayout(We({},e,{eles:this}))}};cd.createLayout=cd.makeLayout=cd.layout;function iI(t,e,r){var n=r._private,a=n.styleCache=n.styleCache||[],i;return(i=a[t])!=null||(i=a[t]=e(r)),i}function nh(t,e){return t=cs(t),function(n){return iI(t,e,n)}}function ah(t,e){t=cs(t);var r=function(a){return e.call(a)};return function(){var a=this[0];if(a)return iI(t,r,a)}}var vr={recalculateRenderedStyle:function(e){var r=this.cy(),n=r.renderer(),a=r.styleEnabled();return n&&a&&n.recalculateRenderedStyle(this,e),this},dirtyStyleCache:function(){var e=this.cy(),r=function(i){return i._private.styleCache=null};if(e.hasCompoundNodes()){var n;n=this.spawnSelf().merge(this.descendants()).merge(this.parents()),n.merge(n.connectedEdges()),n.forEach(r)}else this.forEach(function(a){r(a),a.connectedEdges().forEach(r)});return this},updateStyle:function(e){var r=this._private.cy;if(!r.styleEnabled())return this;if(r.batching()){var n=r._private.batchStyleEles;return n.merge(this),this}var a=r.hasCompoundNodes(),i=this;e=!!(e||e===void 0),a&&(i=this.spawnSelf().merge(this.descendants()).merge(this.parents()));var s=i;return e?s.emitAndNotify("style"):s.emit("style"),i.forEach(function(o){return o._private.styleDirty=!0}),this},cleanStyle:function(){var e=this.cy();if(e.styleEnabled())for(var r=0;r<this.length;r++){var n=this[r];n._private.styleDirty&&(n._private.styleDirty=!1,e.style().apply(n))}},parsedStyle:function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,n=this[0],a=n.cy();if(a.styleEnabled()&&n){n._private.styleDirty&&(n._private.styleDirty=!1,a.style().apply(n));var i=n._private.style[e];return i??(r?a.style().getDefaultProperty(e):null)}},numericStyle:function(e){var r=this[0];if(r.cy().styleEnabled()&&r){var n=r.pstyle(e);return n.pfValue!==void 0?n.pfValue:n.value}},numericStyleUnits:function(e){var r=this[0];if(r.cy().styleEnabled()&&r)return r.pstyle(e).units},renderedStyle:function(e){var r=this.cy();if(!r.styleEnabled())return this;var n=this[0];if(n)return r.style().getRenderedStyle(n,e)},style:function(e,r){var n=this.cy();if(!n.styleEnabled())return this;var a=!1,i=n.style();if(st(e)){var s=e;i.applyBypass(this,s,a),this.emitAndNotify("style")}else if(Ve(e))if(r===void 0){var o=this[0];return o?i.getStylePropertyValue(o,e):void 0}else i.applyBypass(this,e,r,a),this.emitAndNotify("style");else if(e===void 0){var l=this[0];return l?i.getRawStyle(l):void 0}return this},removeStyle:function(e){var r=this.cy();if(!r.styleEnabled())return this;var n=!1,a=r.style(),i=this;if(e===void 0)for(var s=0;s<i.length;s++){var o=i[s];a.removeAllBypasses(o,n)}else{e=e.split(/\s+/);for(var l=0;l<i.length;l++){var u=i[l];a.removeBypasses(u,e,n)}}return this.emitAndNotify("style"),this},show:function(){return this.css("display","element"),this},hide:function(){return this.css("display","none"),this},effectiveOpacity:function(){var e=this.cy();if(!e.styleEnabled())return 1;var r=e.hasCompoundNodes(),n=this[0];if(n){var a=n._private,i=n.pstyle("opacity").value;if(!r)return i;var s=a.data.parent?n.parents():null;if(s)for(var o=0;o<s.length;o++){var l=s[o],u=l.pstyle("opacity").value;i=u*i}return i}},transparent:function(){var e=this.cy();if(!e.styleEnabled())return!1;var r=this[0],n=r.cy().hasCompoundNodes();if(r)return n?r.effectiveOpacity()===0:r.pstyle("opacity").value===0},backgrounding:function(){var e=this.cy();if(!e.styleEnabled())return!1;var r=this[0];return!!r._private.backgrounding}};function Fp(t,e){var r=t._private,n=r.data.parent?t.parents():null;if(n)for(var a=0;a<n.length;a++){var i=n[a];if(!e(i))return!1}return!0}function WE(t){var e=t.ok,r=t.edgeOkViaNode||t.ok,n=t.parentOk||t.ok;return function(){var a=this.cy();if(!a.styleEnabled())return!0;var i=this[0],s=a.hasCompoundNodes();if(i){var o=i._private;if(!e(i))return!1;if(i.isNode())return!s||Fp(i,n);var l=o.source,u=o.target;return r(l)&&(!s||Fp(l,r))&&(l===u||r(u)&&(!s||Fp(u,r)))}}}var Oo=nh("eleTakesUpSpace",function(t){return t.pstyle("display").value==="element"&&t.width()!==0&&(t.isNode()?t.height()!==0:!0)});vr.takesUpSpace=ah("takesUpSpace",WE({ok:Oo}));var l6=nh("eleInteractive",function(t){return t.pstyle("events").value==="yes"&&t.pstyle("visibility").value==="visible"&&Oo(t)}),u6=nh("parentInteractive",function(t){return t.pstyle("visibility").value==="visible"&&Oo(t)});vr.interactive=ah("interactive",WE({ok:l6,parentOk:u6,edgeOkViaNode:Oo}));vr.noninteractive=function(){var t=this[0];if(t)return!t.interactive()};var c6=nh("eleVisible",function(t){return t.pstyle("visibility").value==="visible"&&t.pstyle("opacity").pfValue!==0&&Oo(t)}),d6=Oo;vr.visible=ah("visible",WE({ok:c6,edgeOkViaNode:d6}));vr.hidden=function(){var t=this[0];if(t)return!t.visible()};vr.isBundledBezier=ah("isBundledBezier",function(){return this.cy().styleEnabled()?!this.removed()&&this.pstyle("curve-style").value==="bezier"&&this.takesUpSpace():!1});vr.bypass=vr.css=vr.style;vr.renderedCss=vr.renderedStyle;vr.removeBypass=vr.removeCss=vr.removeStyle;vr.pstyle=vr.parsedStyle;var gi={};function hR(t){return function(){var e=arguments,r=[];if(e.length===2){var n=e[0],a=e[1];this.on(t.event,n,a)}else if(e.length===1&&Dt(e[0])){var i=e[0];this.on(t.event,i)}else if(e.length===0||e.length===1&&mt(e[0])){for(var s=e.length===1?e[0]:null,o=0;o<this.length;o++){var l=this[o],u=!t.ableField||l._private[t.ableField],c=l._private[t.field]!=t.value;if(t.overrideAble){var d=t.overrideAble(l);if(d!==void 0&&(u=d,!d))return this}u&&(l._private[t.field]=t.value,c&&r.push(l))}var f=this.spawn(r);f.updateStyle(),f.emit(t.event),s&&f.emit(s)}return this}}function Mo(t){gi[t.field]=function(){var e=this[0];if(e){if(t.overrideField){var r=t.overrideField(e);if(r!==void 0)return r}return e._private[t.field]}},gi[t.on]=hR({event:t.on,field:t.field,ableField:t.ableField,overrideAble:t.overrideAble,value:!0}),gi[t.off]=hR({event:t.off,field:t.field,ableField:t.ableField,overrideAble:t.overrideAble,value:!1})}Mo({field:"locked",overrideField:function(e){return e.cy().autolock()?!0:void 0},on:"lock",off:"unlock"});Mo({field:"grabbable",overrideField:function(e){return e.cy().autoungrabify()||e.pannable()?!1:void 0},on:"grabify",off:"ungrabify"});Mo({field:"selected",ableField:"selectable",overrideAble:function(e){return e.cy().autounselectify()?!1:void 0},on:"select",off:"unselect"});Mo({field:"selectable",overrideField:function(e){return e.cy().autounselectify()?!1:void 0},on:"selectify",off:"unselectify"});gi.deselect=gi.unselect;gi.grabbed=function(){var t=this[0];if(t)return t._private.grabbed};Mo({field:"active",on:"activate",off:"unactivate"});Mo({field:"pannable",on:"panify",off:"unpanify"});gi.inactive=function(){var t=this[0];if(t)return!t._private.active};var Tr={},vR=function(e){return function(n){for(var a=this,i=[],s=0;s<a.length;s++){var o=a[s];if(o.isNode()){for(var l=!1,u=o.connectedEdges(),c=0;c<u.length;c++){var d=u[c],f=d.source(),v=d.target();if(e.noIncomingEdges&&v===o&&f!==o||e.noOutgoingEdges&&f===o&&v!==o){l=!0;break}}l||i.push(o)}}return this.spawn(i,!0).filter(n)}},pR=function(e){return function(r){for(var n=this,a=[],i=0;i<n.length;i++){var s=n[i];if(s.isNode())for(var o=s.connectedEdges(),l=0;l<o.length;l++){var u=o[l],c=u.source(),d=u.target();e.outgoing&&c===s?(a.push(u),a.push(d)):e.incoming&&d===s&&(a.push(u),a.push(c))}}return this.spawn(a,!0).filter(r)}},gR=function(e){return function(r){for(var n=this,a=[],i={};;){var s=e.outgoing?n.outgoers():n.incomers();if(s.length===0)break;for(var o=!1,l=0;l<s.length;l++){var u=s[l],c=u.id();i[c]||(i[c]=!0,a.push(u),o=!0)}if(!o)break;n=s}return this.spawn(a,!0).filter(r)}};Tr.clearTraversalCache=function(){for(var t=0;t<this.length;t++)this[t]._private.traversalCache=null};We(Tr,{roots:vR({noIncomingEdges:!0}),leaves:vR({noOutgoingEdges:!0}),outgoers:En(pR({outgoing:!0}),"outgoers"),successors:gR({outgoing:!0}),incomers:En(pR({incoming:!0}),"incomers"),predecessors:gR({})});We(Tr,{neighborhood:En(function(t){for(var e=[],r=this.nodes(),n=0;n<r.length;n++)for(var a=r[n],i=a.connectedEdges(),s=0;s<i.length;s++){var o=i[s],l=o.source(),u=o.target(),c=a===l?u:l;c.length>0&&e.push(c[0]),e.push(o[0])}return this.spawn(e,!0).filter(t)},"neighborhood"),closedNeighborhood:function(e){return this.neighborhood().add(this).filter(e)},openNeighborhood:function(e){return this.neighborhood(e)}});Tr.neighbourhood=Tr.neighborhood;Tr.closedNeighbourhood=Tr.closedNeighborhood;Tr.openNeighbourhood=Tr.openNeighborhood;We(Tr,{source:En(function(e){var r=this[0],n;return r&&(n=r._private.source||r.cy().collection()),n&&e?n.filter(e):n},"source"),target:En(function(e){var r=this[0],n;return r&&(n=r._private.target||r.cy().collection()),n&&e?n.filter(e):n},"target"),sources:mR({attr:"source"}),targets:mR({attr:"target"})});function mR(t){return function(r){for(var n=[],a=0;a<this.length;a++){var i=this[a],s=i._private[t.attr];s&&n.push(s)}return this.spawn(n,!0).filter(r)}}We(Tr,{edgesWith:En(yR(),"edgesWith"),edgesTo:En(yR({thisIsSrc:!0}),"edgesTo")});function yR(t){return function(r){var n=[],a=this._private.cy,i=t||{};Ve(r)&&(r=a.$(r));for(var s=0;s<r.length;s++)for(var o=r[s]._private.edges,l=0;l<o.length;l++){var u=o[l],c=u._private.data,d=this.hasElementWithId(c.source)&&r.hasElementWithId(c.target),f=r.hasElementWithId(c.source)&&this.hasElementWithId(c.target),v=d||f;v&&((i.thisIsSrc||i.thisIsTgt)&&(i.thisIsSrc&&!d||i.thisIsTgt&&!f)||n.push(u))}return this.spawn(n,!0)}}We(Tr,{connectedEdges:En(function(t){for(var e=[],r=this,n=0;n<r.length;n++){var a=r[n];if(a.isNode())for(var i=a._private.edges,s=0;s<i.length;s++){var o=i[s];e.push(o)}}return this.spawn(e,!0).filter(t)},"connectedEdges"),connectedNodes:En(function(t){for(var e=[],r=this,n=0;n<r.length;n++){var a=r[n];a.isEdge()&&(e.push(a.source()[0]),e.push(a.target()[0]))}return this.spawn(e,!0).filter(t)},"connectedNodes"),parallelEdges:En(xR(),"parallelEdges"),codirectedEdges:En(xR({codirected:!0}),"codirectedEdges")});function xR(t){var e={codirected:!1};return t=We({},e,t),function(n){for(var a=[],i=this.edges(),s=t,o=0;o<i.length;o++)for(var l=i[o],u=l._private,c=u.source,d=c._private.data.id,f=u.data.target,v=c._private.edges,p=0;p<v.length;p++){var y=v[p],m=y._private.data,g=m.target,x=m.source,b=g===f&&x===d,w=d===g&&f===x;(s.codirected&&b||!s.codirected&&(b||w))&&a.push(y)}return this.spawn(a,!0).filter(n)}}We(Tr,{components:function(e){var r=this,n=r.cy(),a=n.collection(),i=e==null?r.nodes():e.nodes(),s=[];e!=null&&i.empty()&&(i=e.sources());var o=function(c,d){a.merge(c),i.unmerge(c),d.merge(c)};if(i.empty())return r.spawn();var l=function(){var c=n.collection();s.push(c);var d=i[0];o(d,c),r.bfs({directed:!1,roots:d,visit:function(v){return o(v,c)}}),c.forEach(function(f){f.connectedEdges().forEach(function(v){r.has(v)&&c.has(v.source())&&c.has(v.target())&&c.merge(v)})})};do l();while(i.length>0);return s},component:function(){var e=this[0];return e.cy().mutableElements().components(e)[0]}});Tr.componentsOf=Tr.components;var pr=function(e,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(e===void 0){Tt("A collection must have a reference to the core");return}var i=new Na,s=!1;if(!r)r=[];else if(r.length>0&&st(r[0])&&!Iu(r[0])){s=!0;for(var o=[],l=new _o,u=0,c=r.length;u<c;u++){var d=r[u];d.data==null&&(d.data={});var f=d.data;if(f.id==null)f.id=xM();else if(e.hasElementWithId(f.id)||l.has(f.id))continue;var v=new Yf(e,d,!1);o.push(v),l.add(f.id)}r=o}this.length=0;for(var p=0,y=r.length;p<y;p++){var m=r[p][0];if(m!=null){var g=m._private.data.id;(!n||!i.has(g))&&(n&&i.set(g,{index:this.length,ele:m}),this[this.length]=m,this.length++)}}this._private={eles:this,cy:e,get map(){return this.lazyMap==null&&this.rebuildMap(),this.lazyMap},set map(x){this.lazyMap=x},rebuildMap:function(){for(var b=this.lazyMap=new Na,w=this.eles,E=0;E<w.length;E++){var C=w[E];b.set(C.id(),{index:E,ele:C})}}},n&&(this._private.map=i),s&&!a&&this.restore()},bt=Yf.prototype=pr.prototype=Object.create(Array.prototype);bt.instanceString=function(){return"collection"};bt.spawn=function(t,e){return new pr(this.cy(),t,e)};bt.spawnSelf=function(){return this.spawn(this)};bt.cy=function(){return this._private.cy};bt.renderer=function(){return this._private.cy.renderer()};bt.element=function(){return this[0]};bt.collection=function(){return iM(this)?this:new pr(this._private.cy,[this])};bt.unique=function(){return new pr(this._private.cy,this,!0)};bt.hasElementWithId=function(t){return t=""+t,this._private.map.has(t)};bt.getElementById=function(t){t=""+t;var e=this._private.cy,r=this._private.map.get(t);return r?r.ele:new pr(e)};bt.$id=bt.getElementById;bt.poolIndex=function(){var t=this._private.cy,e=t._private.elements,r=this[0]._private.data.id;return e._private.map.get(r).index};bt.indexOf=function(t){var e=t[0]._private.data.id;return this._private.map.get(e).index};bt.indexOfId=function(t){return t=""+t,this._private.map.get(t).index};bt.json=function(t){var e=this.element(),r=this.cy();if(e==null&&t)return this;if(e!=null){var n=e._private;if(st(t)){if(r.startBatch(),t.data){e.data(t.data);var a=n.data;if(e.isEdge()){var i=!1,s={},o=t.data.source,l=t.data.target;o!=null&&o!=a.source&&(s.source=""+o,i=!0),l!=null&&l!=a.target&&(s.target=""+l,i=!0),i&&(e=e.move(s))}else{var u="parent"in t.data,c=t.data.parent;u&&(c!=null||a.parent!=null)&&c!=a.parent&&(c===void 0&&(c=null),c!=null&&(c=""+c),e=e.move({parent:c}))}}t.position&&e.position(t.position);var d=function(y,m,g){var x=t[y];x!=null&&x!==n[y]&&(x?e[m]():e[g]())};return d("removed","remove","restore"),d("selected","select","unselect"),d("selectable","selectify","unselectify"),d("locked","lock","unlock"),d("grabbable","grabify","ungrabify"),d("pannable","panify","unpanify"),t.classes!=null&&e.classes(t.classes),r.endBatch(),this}else if(t===void 0){var f={data:sa(n.data),position:sa(n.position),group:n.group,removed:n.removed,selected:n.selected,selectable:n.selectable,locked:n.locked,grabbable:n.grabbable,pannable:n.pannable,classes:null};f.classes="";var v=0;return n.classes.forEach(function(p){return f.classes+=v++===0?p:" "+p}),f}}};bt.jsons=function(){for(var t=[],e=0;e<this.length;e++){var r=this[e],n=r.json();t.push(n)}return t};bt.clone=function(){for(var t=this.cy(),e=[],r=0;r<this.length;r++){var n=this[r],a=n.json(),i=new Yf(t,a,!1);e.push(i)}return new pr(t,e)};bt.copy=bt.clone;bt.restore=function(){for(var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,r=this,n=r.cy(),a=n._private,i=[],s=[],o,l=0,u=r.length;l<u;l++){var c=r[l];e&&!c.removed()||(c.isNode()?i.push(c):s.push(c))}o=i.concat(s);var d,f=function(){o.splice(d,1),d--};for(d=0;d<o.length;d++){var v=o[d],p=v._private,y=p.data;if(v.clearTraversalCache(),!(!e&&!p.removed)){if(y.id===void 0)y.id=xM();else if(_e(y.id))y.id=""+y.id;else if(bi(y.id)||!Ve(y.id)){Tt("Can not create element with invalid string ID `"+y.id+"`"),f();continue}else if(n.hasElementWithId(y.id)){Tt("Can not create second element with ID `"+y.id+"`"),f();continue}}var m=y.id;if(v.isNode()){var g=p.position;g.x==null&&(g.x=0),g.y==null&&(g.y=0)}if(v.isEdge()){for(var x=v,b=["source","target"],w=b.length,E=!1,C=0;C<w;C++){var S=b[C],T=y[S];_e(T)&&(T=y[S]=""+y[S]),T==null||T===""?(Tt("Can not create edge `"+m+"` with unspecified "+S),E=!0):n.hasElementWithId(T)||(Tt("Can not create edge `"+m+"` with nonexistant "+S+" `"+T+"`"),E=!0)}if(E){f();continue}var P=n.getElementById(y.source),A=n.getElementById(y.target);P.same(A)?P._private.edges.push(x):(P._private.edges.push(x),A._private.edges.push(x)),x._private.source=P,x._private.target=A}p.map=new Na,p.map.set(m,{ele:v,index:0}),p.removed=!1,e&&n.addToPool(v)}for(var j=0;j<i.length;j++){var R=i[j],O=R._private.data;_e(O.parent)&&(O.parent=""+O.parent);var N=O.parent,D=N!=null;if(D||R._private.parent){var L=R._private.parent?n.collection().merge(R._private.parent):n.getElementById(N);if(L.empty())O.parent=void 0;else if(L[0].removed())ht("Node added with missing parent, reference to parent removed"),O.parent=void 0,R._private.parent=null;else{for(var _=!1,k=L;!k.empty();){if(R.same(k)){_=!0,O.parent=void 0;break}k=k.parent()}_||(L[0]._private.children.push(R),R._private.parent=L[0],a.hasCompoundNodes=!0)}}}if(o.length>0){for(var I=o.length===r.length?r:new pr(n,o),F=0;F<I.length;F++){var B=I[F];B.isNode()||(B.parallelEdges().clearTraversalCache(),B.source().clearTraversalCache(),B.target().clearTraversalCache())}var $;a.hasCompoundNodes?$=n.collection().merge(I).merge(I.connectedNodes()).merge(I.parent()):$=I,$.dirtyCompoundBoundsCache().dirtyBoundingBoxCache().updateStyle(t),t?I.emitAndNotify("add"):e&&I.emit("add")}return r};bt.removed=function(){var t=this[0];return t&&t._private.removed};bt.inside=function(){var t=this[0];return t&&!t._private.removed};bt.remove=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,r=this,n=[],a={},i=r._private.cy;function s(N){for(var D=N._private.edges,L=0;L<D.length;L++)l(D[L])}function o(N){for(var D=N._private.children,L=0;L<D.length;L++)l(D[L])}function l(N){var D=a[N.id()];e&&N.removed()||D||(a[N.id()]=!0,N.isNode()?(n.push(N),s(N),o(N)):n.unshift(N))}for(var u=0,c=r.length;u<c;u++){var d=r[u];l(d)}function f(N,D){var L=N._private.edges;wi(L,D),N.clearTraversalCache()}function v(N){N.clearTraversalCache()}var p=[];p.ids={};function y(N,D){D=D[0],N=N[0];var L=N._private.children,_=N.id();wi(L,D),D._private.parent=null,p.ids[_]||(p.ids[_]=!0,p.push(N))}r.dirtyCompoundBoundsCache(),e&&i.removeFromPool(n);for(var m=0;m<n.length;m++){var g=n[m];if(g.isEdge()){var x=g.source()[0],b=g.target()[0];f(x,g),f(b,g);for(var w=g.parallelEdges(),E=0;E<w.length;E++){var C=w[E];v(C),C.isBundledBezier()&&C.dirtyBoundingBoxCache()}}else{var S=g.parent();S.length!==0&&y(S,g)}e&&(g._private.removed=!0)}var T=i._private.elements;i._private.hasCompoundNodes=!1;for(var P=0;P<T.length;P++){var A=T[P];if(A.isParent()){i._private.hasCompoundNodes=!0;break}}var j=new pr(this.cy(),n);j.size()>0&&(t?j.emitAndNotify("remove"):e&&j.emit("remove"));for(var R=0;R<p.length;R++){var O=p[R];(!e||!O.removed())&&O.updateStyle()}return j};bt.move=function(t){var e=this._private.cy,r=this,n=!1,a=!1,i=function(p){return p==null?p:""+p};if(t.source!==void 0||t.target!==void 0){var s=i(t.source),o=i(t.target),l=s!=null&&e.hasElementWithId(s),u=o!=null&&e.hasElementWithId(o);(l||u)&&(e.batch(function(){r.remove(n,a),r.emitAndNotify("moveout");for(var v=0;v<r.length;v++){var p=r[v],y=p._private.data;p.isEdge()&&(l&&(y.source=s),u&&(y.target=o))}r.restore(n,a)}),r.emitAndNotify("move"))}else if(t.parent!==void 0){var c=i(t.parent),d=c===null||e.hasElementWithId(c);if(d){var f=c===null?void 0:c;e.batch(function(){var v=r.remove(n,a);v.emitAndNotify("moveout");for(var p=0;p<r.length;p++){var y=r[p],m=y._private.data;y.isNode()&&(m.parent=f)}v.restore(n,a)}),r.emitAndNotify("move")}}return this};[LM,EH,ud,pi,Co,FH,th,e6,rI,nI,i6,tf,cd,vr,gi,Tr].forEach(function(t){We(bt,t)});var f6={add:function(e){var r,n=this;if(cn(e)){var a=e;if(a._private.cy===n)r=a.restore();else{for(var i=[],s=0;s<a.length;s++){var o=a[s];i.push(o.json())}r=new pr(n,i)}}else if(mt(e)){var l=e;r=new pr(n,l)}else if(st(e)&&(mt(e.nodes)||mt(e.edges))){for(var u=e,c=[],d=["nodes","edges"],f=0,v=d.length;f<v;f++){var p=d[f],y=u[p];if(mt(y))for(var m=0,g=y.length;m<g;m++){var x=We({group:p},y[m]);c.push(x)}}r=new pr(n,c)}else{var b=e;r=new Yf(n,b).collection()}return r},remove:function(e){if(!cn(e)){if(Ve(e)){var r=e;e=this.$(r)}}return e.remove()}};/*! Bezier curve function generator. Copyright Gaetan Renaudeau. MIT License: http://en.wikipedia.org/wiki/MIT_License */function h6(t,e,r,n){var a=4,i=.001,s=1e-7,o=10,l=11,u=1/(l-1),c=typeof Float32Array<"u";if(arguments.length!==4)return!1;for(var d=0;d<4;++d)if(typeof arguments[d]!="number"||isNaN(arguments[d])||!isFinite(arguments[d]))return!1;t=Math.min(t,1),r=Math.min(r,1),t=Math.max(t,0),r=Math.max(r,0);var f=c?new Float32Array(l):new Array(l);function v(A,j){return 1-3*j+3*A}function p(A,j){return 3*j-6*A}function y(A){return 3*A}function m(A,j,R){return((v(j,R)*A+p(j,R))*A+y(j))*A}function g(A,j,R){return 3*v(j,R)*A*A+2*p(j,R)*A+y(j)}function x(A,j){for(var R=0;R<a;++R){var O=g(j,t,r);if(O===0)return j;var N=m(j,t,r)-A;j-=N/O}return j}function b(){for(var A=0;A<l;++A)f[A]=m(A*u,t,r)}function w(A,j,R){var O,N,D=0;do N=j+(R-j)/2,O=m(N,t,r)-A,O>0?R=N:j=N;while(Math.abs(O)>s&&++D<o);return N}function E(A){for(var j=0,R=1,O=l-1;R!==O&&f[R]<=A;++R)j+=u;--R;var N=(A-f[R])/(f[R+1]-f[R]),D=j+N*u,L=g(D,t,r);return L>=i?x(A,D):L===0?D:w(A,j,j+u)}var C=!1;function S(){C=!0,(t!==e||r!==n)&&b()}var T=function(j){return C||S(),t===e&&r===n?j:j===0?0:j===1?1:m(E(j),e,n)};T.getControlPoints=function(){return[{x:t,y:e},{x:r,y:n}]};var P="generateBezier("+[t,e,r,n]+")";return T.toString=function(){return P},T}/*! Runge-Kutta spring physics function generator. Adapted from Framer.js, copyright Koen Bok. MIT License: http://en.wikipedia.org/wiki/MIT_License */var v6=function(){function t(n){return-n.tension*n.x-n.friction*n.v}function e(n,a,i){var s={x:n.x+i.dx*a,v:n.v+i.dv*a,tension:n.tension,friction:n.friction};return{dx:s.v,dv:t(s)}}function r(n,a){var i={dx:n.v,dv:t(n)},s=e(n,a*.5,i),o=e(n,a*.5,s),l=e(n,a,o),u=1/6*(i.dx+2*(s.dx+o.dx)+l.dx),c=1/6*(i.dv+2*(s.dv+o.dv)+l.dv);return n.x=n.x+u*a,n.v=n.v+c*a,n}return function n(a,i,s){var o={x:-1,v:0,tension:null,friction:null},l=[0],u=0,c=1/1e4,d=16/1e3,f,v,p;for(a=parseFloat(a)||500,i=parseFloat(i)||20,s=s||null,o.tension=a,o.friction=i,f=s!==null,f?(u=n(a,i),v=u/s*d):v=d;p=r(p||o,v),l.push(1+p.x),u+=16,Math.abs(p.x)>c&&Math.abs(p.v)>c;);return f?function(y){return l[y*(l.length-1)|0]}:u}}(),yt=function(e,r,n,a){var i=h6(e,r,n,a);return function(s,o,l){return s+(o-s)*i(l)}},dd={linear:function(e,r,n){return e+(r-e)*n},ease:yt(.25,.1,.25,1),"ease-in":yt(.42,0,1,1),"ease-out":yt(0,0,.58,1),"ease-in-out":yt(.42,0,.58,1),"ease-in-sine":yt(.47,0,.745,.715),"ease-out-sine":yt(.39,.575,.565,1),"ease-in-out-sine":yt(.445,.05,.55,.95),"ease-in-quad":yt(.55,.085,.68,.53),"ease-out-quad":yt(.25,.46,.45,.94),"ease-in-out-quad":yt(.455,.03,.515,.955),"ease-in-cubic":yt(.55,.055,.675,.19),"ease-out-cubic":yt(.215,.61,.355,1),"ease-in-out-cubic":yt(.645,.045,.355,1),"ease-in-quart":yt(.895,.03,.685,.22),"ease-out-quart":yt(.165,.84,.44,1),"ease-in-out-quart":yt(.77,0,.175,1),"ease-in-quint":yt(.755,.05,.855,.06),"ease-out-quint":yt(.23,1,.32,1),"ease-in-out-quint":yt(.86,0,.07,1),"ease-in-expo":yt(.95,.05,.795,.035),"ease-out-expo":yt(.19,1,.22,1),"ease-in-out-expo":yt(1,0,0,1),"ease-in-circ":yt(.6,.04,.98,.335),"ease-out-circ":yt(.075,.82,.165,1),"ease-in-out-circ":yt(.785,.135,.15,.86),spring:function(e,r,n){if(n===0)return dd.linear;var a=v6(e,r,n);return function(i,s,o){return i+(s-i)*a(o)}},"cubic-bezier":yt};function bR(t,e,r,n,a){if(n===1||e===r)return r;var i=a(e,r,n);return t==null||((t.roundValue||t.color)&&(i=Math.round(i)),t.min!==void 0&&(i=Math.max(i,t.min)),t.max!==void 0&&(i=Math.min(i,t.max))),i}function wR(t,e){return t.pfValue!=null||t.value!=null?t.pfValue!=null&&(e==null||e.type.units!=="%")?t.pfValue:t.value:t}function As(t,e,r,n,a){var i=a!=null?a.type:null;r<0?r=0:r>1&&(r=1);var s=wR(t,a),o=wR(e,a);if(_e(s)&&_e(o))return bR(i,s,o,r,n);if(mt(s)&&mt(o)){for(var l=[],u=0;u<o.length;u++){var c=s[u],d=o[u];if(c!=null&&d!=null){var f=bR(i,c,d,r,n);l.push(f)}else l.push(d)}return l}}function p6(t,e,r,n){var a=!n,i=t._private,s=e._private,o=s.easing,l=s.startTime,u=n?t:t.cy(),c=u.style();if(!s.easingImpl)if(o==null)s.easingImpl=dd.linear;else{var d;if(Ve(o)){var f=c.parse("transition-timing-function",o);d=f.value}else d=o;var v,p;Ve(d)?(v=d,p=[]):(v=d[1],p=d.slice(2).map(function(I){return+I})),p.length>0?(v==="spring"&&p.push(s.duration),s.easingImpl=dd[v].apply(null,p)):s.easingImpl=dd[v]}var y=s.easingImpl,m;if(s.duration===0?m=1:m=(r-l)/s.duration,s.applying&&(m=s.progress),m<0?m=0:m>1&&(m=1),s.delay==null){var g=s.startPosition,x=s.position;if(x&&a&&!t.locked()){var b={};ol(g.x,x.x)&&(b.x=As(g.x,x.x,m,y)),ol(g.y,x.y)&&(b.y=As(g.y,x.y,m,y)),t.position(b)}var w=s.startPan,E=s.pan,C=i.pan,S=E!=null&&n;S&&(ol(w.x,E.x)&&(C.x=As(w.x,E.x,m,y)),ol(w.y,E.y)&&(C.y=As(w.y,E.y,m,y)),t.emit("pan"));var T=s.startZoom,P=s.zoom,A=P!=null&&n;A&&(ol(T,P)&&(i.zoom=fu(i.minZoom,As(T,P,m,y),i.maxZoom)),t.emit("zoom")),(S||A)&&t.emit("viewport");var j=s.style;if(j&&j.length>0&&a){for(var R=0;R<j.length;R++){var O=j[R],N=O.name,D=O,L=s.startStyle[N],_=c.properties[L.name],k=As(L,D,m,y,_);c.overrideBypass(t,N,k)}t.emit("style")}}return s.progress=m,m}function ol(t,e){return t==null||e==null?!1:_e(t)&&_e(e)?!0:!!(t&&e)}function g6(t,e,r,n){var a=e._private;a.started=!0,a.startTime=r-a.progress*a.duration}function ER(t,e){var r=e._private.aniEles,n=[];function a(c,d){var f=c._private,v=f.animation.current,p=f.animation.queue,y=!1;if(v.length===0){var m=p.shift();m&&v.push(m)}for(var g=function(C){for(var S=C.length-1;S>=0;S--){var T=C[S];T()}C.splice(0,C.length)},x=v.length-1;x>=0;x--){var b=v[x],w=b._private;if(w.stopped){v.splice(x,1),w.hooked=!1,w.playing=!1,w.started=!1,g(w.frames);continue}!w.playing&&!w.applying||(w.playing&&w.applying&&(w.applying=!1),w.started||g6(c,b,t),p6(c,b,t,d),w.applying&&(w.applying=!1),g(w.frames),w.step!=null&&w.step(t),b.completed()&&(v.splice(x,1),w.hooked=!1,w.playing=!1,w.started=!1,g(w.completes)),y=!0)}return!d&&v.length===0&&p.length===0&&n.push(c),y}for(var i=!1,s=0;s<r.length;s++){var o=r[s],l=a(o);i=i||l}var u=a(e,!0);(i||u)&&(r.length>0?e.notify("draw",r):e.notify("draw")),r.unmerge(n),e.emit("step")}var m6={animate:ft.animate(),animation:ft.animation(),animated:ft.animated(),clearQueue:ft.clearQueue(),delay:ft.delay(),delayAnimation:ft.delayAnimation(),stop:ft.stop(),addToAnimationPool:function(e){var r=this;r.styleEnabled()&&r._private.aniEles.merge(e)},stopAnimationLoop:function(){this._private.animationsRunning=!1},startAnimationLoop:function(){var e=this;if(e._private.animationsRunning=!0,!e.styleEnabled())return;function r(){e._private.animationsRunning&&Kd(function(i){ER(i,e),r()})}var n=e.renderer();n&&n.beforeRender?n.beforeRender(function(i,s){ER(s,e)},n.beforeRenderPriorities.animations):r()}},y6={qualifierCompare:function(e,r){return e==null||r==null?e==null&&r==null:e.sameText(r)},eventMatches:function(e,r,n){var a=r.qualifier;return a!=null?e!==n.target&&Iu(n.target)&&a.matches(n.target):!0},addEventFields:function(e,r){r.cy=e,r.target=e},callbackContext:function(e,r,n){return r.qualifier!=null?n.target:e}},_c=function(e){return Ve(e)?new Si(e):e},sI={createEmitter:function(){var e=this._private;return e.emitter||(e.emitter=new rh(y6,this)),this},emitter:function(){return this._private.emitter},on:function(e,r,n){return this.emitter().on(e,_c(r),n),this},removeListener:function(e,r,n){return this.emitter().removeListener(e,_c(r),n),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},one:function(e,r,n){return this.emitter().one(e,_c(r),n),this},once:function(e,r,n){return this.emitter().one(e,_c(r),n),this},emit:function(e,r){return this.emitter().emit(e,r),this},emitAndNotify:function(e,r){return this.emit(e),this.notify(e,r),this}};ft.eventAliasesOn(sI);var W1={png:function(e){var r=this._private.renderer;return e=e||{},r.png(e)},jpg:function(e){var r=this._private.renderer;return e=e||{},e.bg=e.bg||"#fff",r.jpg(e)}};W1.jpeg=W1.jpg;var fd={layout:function(e){var r=this;if(e==null){Tt("Layout options must be specified to make a layout");return}if(e.name==null){Tt("A `name` must be specified to make a layout");return}var n=e.name,a=r.extension("layout",n);if(a==null){Tt("No such layout `"+n+"` found. Did you forget to import it and `cytoscape.use()` it?");return}var i;Ve(e.eles)?i=r.$(e.eles):i=e.eles!=null?e.eles:r.$();var s=new a(We({},e,{cy:r,eles:i}));return s}};fd.createLayout=fd.makeLayout=fd.layout;var x6={notify:function(e,r){var n=this._private;if(this.batching()){n.batchNotifications=n.batchNotifications||{};var a=n.batchNotifications[e]=n.batchNotifications[e]||this.collection();r!=null&&a.merge(r);return}if(n.notificationsEnabled){var i=this.renderer();this.destroyed()||!i||i.notify(e,r)}},notifications:function(e){var r=this._private;return e===void 0?r.notificationsEnabled:(r.notificationsEnabled=!!e,this)},noNotifications:function(e){this.notifications(!1),e(),this.notifications(!0)},batching:function(){return this._private.batchCount>0},startBatch:function(){var e=this._private;return e.batchCount==null&&(e.batchCount=0),e.batchCount===0&&(e.batchStyleEles=this.collection(),e.batchNotifications={}),e.batchCount++,this},endBatch:function(){var e=this._private;if(e.batchCount===0)return this;if(e.batchCount--,e.batchCount===0){e.batchStyleEles.updateStyle();var r=this.renderer();Object.keys(e.batchNotifications).forEach(function(n){var a=e.batchNotifications[n];a.empty()?r.notify(n):r.notify(n,a)})}return this},batch:function(e){return this.startBatch(),e(),this.endBatch(),this},batchData:function(e){var r=this;return this.batch(function(){for(var n=Object.keys(e),a=0;a<n.length;a++){var i=n[a],s=e[i],o=r.getElementById(i);o.data(s)}})}},b6=mr({hideEdgesOnViewport:!1,textureOnViewport:!1,motionBlur:!1,motionBlurOpacity:.05,pixelRatio:void 0,desktopTapThreshold:4,touchTapThreshold:8,wheelSensitivity:1,debug:!1,showFps:!1,webgl:!1,webglDebug:!1,webglDebugShowAtlases:!1,webglTexSize:2048,webglTexRows:36,webglTexRowsNodes:18,webglBatchSize:2048,webglTexPerBatch:14,webglBgColor:[255,255,255]}),Y1={renderTo:function(e,r,n,a){var i=this._private.renderer;return i.renderTo(e,r,n,a),this},renderer:function(){return this._private.renderer},forceRender:function(){return this.notify("draw"),this},resize:function(){return this.invalidateSize(),this.emitAndNotify("resize"),this},initRenderer:function(e){var r=this,n=r.extension("renderer",e.name);if(n==null){Tt("Can not initialise: No such renderer `".concat(e.name,"` found. Did you forget to import it and `cytoscape.use()` it?"));return}e.wheelSensitivity!==void 0&&ht("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 a=b6(e);a.cy=r,r._private.renderer=new n(a),this.notify("init")},destroyRenderer:function(){var e=this;e.notify("destroy");var r=e.container();if(r)for(r._cyreg=null;r.childNodes.length>0;)r.removeChild(r.childNodes[0]);e._private.renderer=null,e.mutableElements().forEach(function(n){var a=n._private;a.rscratch={},a.rstyle={},a.animation.current=[],a.animation.queue=[]})},onRender:function(e){return this.on("render",e)},offRender:function(e){return this.off("render",e)}};Y1.invalidateDimensions=Y1.resize;var hd={collection:function(e,r){return Ve(e)?this.$(e):cn(e)?e.collection():mt(e)?(r||(r={}),new pr(this,e,r.unique,r.removed)):new pr(this)},nodes:function(e){var r=this.$(function(n){return n.isNode()});return e?r.filter(e):r},edges:function(e){var r=this.$(function(n){return n.isEdge()});return e?r.filter(e):r},$:function(e){var r=this._private.elements;return e?r.filter(e):r.spawnSelf()},mutableElements:function(){return this._private.elements}};hd.elements=hd.filter=hd.$;var ur={},Ml="t",w6="f";ur.apply=function(t){for(var e=this,r=e._private,n=r.cy,a=n.collection(),i=0;i<t.length;i++){var s=t[i],o=e.getContextMeta(s);if(!o.empty){var l=e.getContextStyle(o),u=e.applyContextStyle(o,l,s);s._private.appliedInitStyle?e.updateTransitions(s,u.diffProps):s._private.appliedInitStyle=!0;var c=e.updateStyleHints(s);c&&a.push(s)}}return a};ur.getPropertiesDiff=function(t,e){var r=this,n=r._private.propDiffs=r._private.propDiffs||{},a=t+"-"+e,i=n[a];if(i)return i;for(var s=[],o={},l=0;l<r.length;l++){var u=r[l],c=t[l]===Ml,d=e[l]===Ml,f=c!==d,v=u.mappedProperties.length>0;if(f||d&&v){var p=void 0;f&&v||f?p=u.properties:v&&(p=u.mappedProperties);for(var y=0;y<p.length;y++){for(var m=p[y],g=m.name,x=!1,b=l+1;b<r.length;b++){var w=r[b],E=e[b]===Ml;if(E&&(x=w.properties[m.name]!=null,x))break}!o[g]&&!x&&(o[g]=!0,s.push(g))}}}return n[a]=s,s};ur.getContextMeta=function(t){for(var e=this,r="",n,a=t._private.styleCxtKey||"",i=0;i<e.length;i++){var s=e[i],o=s.selector&&s.selector.matches(t);o?r+=Ml:r+=w6}return n=e.getPropertiesDiff(a,r),t._private.styleCxtKey=r,{key:r,diffPropNames:n,empty:n.length===0}};ur.getContextStyle=function(t){var e=t.key,r=this,n=this._private.contextStyles=this._private.contextStyles||{};if(n[e])return n[e];for(var a={_private:{key:e}},i=0;i<r.length;i++){var s=r[i],o=e[i]===Ml;if(o)for(var l=0;l<s.properties.length;l++){var u=s.properties[l];a[u.name]=u}}return n[e]=a,a};ur.applyContextStyle=function(t,e,r){for(var n=this,a=t.diffPropNames,i={},s=n.types,o=0;o<a.length;o++){var l=a[o],u=e[l],c=r.pstyle(l);if(!u)if(c)c.bypass?u={name:l,deleteBypassed:!0}:u={name:l,delete:!0};else continue;if(c!==u){if(u.mapped===s.fn&&c!=null&&c.mapping!=null&&c.mapping.value===u.value){var d=c.mapping,f=d.fnValue=u.value(r);if(f===d.prevFnValue)continue}var v=i[l]={prev:c};n.applyParsedProperty(r,u),v.next=r.pstyle(l),v.next&&v.next.bypass&&(v.next=v.next.bypassed)}}return{diffProps:i}};ur.updateStyleHints=function(t){var e=t._private,r=this,n=r.propertyGroupNames,a=r.propertyGroupKeys,i=function(ee,ie,oe){return r.getPropertiesHash(ee,ie,oe)},s=e.styleKey;if(t.removed())return!1;var o=e.group==="nodes",l=t._private.style;n=Object.keys(l);for(var u=0;u<a.length;u++){var c=a[u];e.styleKeys[c]=[Wi,Fs]}for(var d=function(ee,ie){return e.styleKeys[ie][0]=uu(ee,e.styleKeys[ie][0])},f=function(ee,ie){return e.styleKeys[ie][1]=cu(ee,e.styleKeys[ie][1])},v=function(ee,ie){d(ee,ie),f(ee,ie)},p=function(ee,ie){for(var oe=0;oe<ee.length;oe++){var me=ee.charCodeAt(oe);d(me,ie),f(me,ie)}},y=2e9,m=function(ee){return-128<ee&&ee<128&&Math.floor(ee)!==ee?y-(ee*1024|0):ee},g=0;g<n.length;g++){var x=n[g],b=l[x];if(b!=null){var w=this.properties[x],E=w.type,C=w.groupKey,S=void 0;w.hashOverride!=null?S=w.hashOverride(t,b):b.pfValue!=null&&(S=b.pfValue);var T=w.enums==null?b.value:null,P=S!=null,A=T!=null,j=P||A,R=b.units;if(E.number&&j&&!E.multiple){var O=P?S:T;v(m(O),C),!P&&R!=null&&p(R,C)}else p(b.strValue,C)}}for(var N=[Wi,Fs],D=0;D<a.length;D++){var L=a[D],_=e.styleKeys[L];N[0]=uu(_[0],N[0]),N[1]=cu(_[1],N[1])}e.styleKey=I$(N[0],N[1]);var k=e.styleKeys;e.labelDimsKey=Ga(k.labelDimensions);var I=i(t,["label"],k.labelDimensions);if(e.labelKey=Ga(I),e.labelStyleKey=Ga(Nc(k.commonLabel,I)),!o){var F=i(t,["source-label"],k.labelDimensions);e.sourceLabelKey=Ga(F),e.sourceLabelStyleKey=Ga(Nc(k.commonLabel,F));var B=i(t,["target-label"],k.labelDimensions);e.targetLabelKey=Ga(B),e.targetLabelStyleKey=Ga(Nc(k.commonLabel,B))}if(o){var $=e.styleKeys,W=$.nodeBody,z=$.nodeBorder,q=$.nodeOutline,G=$.backgroundImage,J=$.compound,ae=$.pie,Y=$.stripe,H=[W,z,q,G,J,ae,Y].filter(function(X){return X!=null}).reduce(Nc,[Wi,Fs]);e.nodeKey=Ga(H),e.hasPie=ae!=null&&ae[0]!==Wi&&ae[1]!==Fs,e.hasStripe=Y!=null&&Y[0]!==Wi&&Y[1]!==Fs}return s!==e.styleKey};ur.clearStyleHints=function(t){var e=t._private;e.styleCxtKey="",e.styleKeys={},e.styleKey=null,e.labelKey=null,e.labelStyleKey=null,e.sourceLabelKey=null,e.sourceLabelStyleKey=null,e.targetLabelKey=null,e.targetLabelStyleKey=null,e.nodeKey=null,e.hasPie=null,e.hasStripe=null};ur.applyParsedProperty=function(t,e){var r=this,n=e,a=t._private.style,i,s=r.types,o=r.properties[n.name].type,l=n.bypass,u=a[n.name],c=u&&u.bypass,d=t._private,f="mapping",v=function(W){return W==null?null:W.pfValue!=null?W.pfValue:W.value},p=function(){var W=v(u),z=v(n);r.checkTriggers(t,n.name,W,z)};if(e.name==="curve-style"&&t.isEdge()&&(e.value!=="bezier"&&t.isLoop()||e.value==="haystack"&&(t.source().isParent()||t.target().isParent()))&&(n=e=this.parse(e.name,"bezier",l)),n.delete)return a[n.name]=void 0,p(),!0;if(n.deleteBypassed)return u?u.bypass?(u.bypassed=void 0,p(),!0):!1:(p(),!0);if(n.deleteBypass)return u?u.bypass?(a[n.name]=u.bypassed,p(),!0):!1:(p(),!0);var y=function(){ht("Do not assign mappings to elements without corresponding data (i.e. ele `"+t.id()+"` has no mapping for property `"+n.name+"` with data field `"+n.field+"`); try a `["+n.field+"]` selector to limit scope to elements with `"+n.field+"` defined")};switch(n.mapped){case s.mapData:{for(var m=n.field.split("."),g=d.data,x=0;x<m.length&&g;x++){var b=m[x];g=g[b]}if(g==null)return y(),!1;var w;if(_e(g)){var E=n.fieldMax-n.fieldMin;E===0?w=0:w=(g-n.fieldMin)/E}else return ht("Do not use continuous mappers without specifying numeric data (i.e. `"+n.field+": "+g+"` for `"+t.id()+"` is non-numeric)"),!1;if(w<0?w=0:w>1&&(w=1),o.color){var C=n.valueMin[0],S=n.valueMax[0],T=n.valueMin[1],P=n.valueMax[1],A=n.valueMin[2],j=n.valueMax[2],R=n.valueMin[3]==null?1:n.valueMin[3],O=n.valueMax[3]==null?1:n.valueMax[3],N=[Math.round(C+(S-C)*w),Math.round(T+(P-T)*w),Math.round(A+(j-A)*w),Math.round(R+(O-R)*w)];i={bypass:n.bypass,name:n.name,value:N,strValue:"rgb("+N[0]+", "+N[1]+", "+N[2]+")"}}else if(o.number){var D=n.valueMin+(n.valueMax-n.valueMin)*w;i=this.parse(n.name,D,n.bypass,f)}else return!1;if(!i)return y(),!1;i.mapping=n,n=i;break}case s.data:{for(var L=n.field.split("."),_=d.data,k=0;k<L.length&&_;k++){var I=L[k];_=_[I]}if(_!=null&&(i=this.parse(n.name,_,n.bypass,f)),!i)return y(),!1;i.mapping=n,n=i;break}case s.fn:{var F=n.value,B=n.fnValue!=null?n.fnValue:F(t);if(n.prevFnValue=B,B==null)return ht("Custom function mappers may not return null (i.e. `"+n.name+"` for ele `"+t.id()+"` is null)"),!1;if(i=this.parse(n.name,B,n.bypass,f),!i)return ht("Custom function mappers may not return invalid values for the property type (i.e. `"+n.name+"` for ele `"+t.id()+"` is invalid)"),!1;i.mapping=sa(n),n=i;break}case void 0:break;default:return!1}return l?(c?n.bypassed=u.bypassed:n.bypassed=u,a[n.name]=n):c?u.bypassed=n:a[n.name]=n,p(),!0};ur.cleanElements=function(t,e){for(var r=0;r<t.length;r++){var n=t[r];if(this.clearStyleHints(n),n.dirtyCompoundBoundsCache(),n.dirtyBoundingBoxCache(),!e)n._private.style={};else for(var a=n._private.style,i=Object.keys(a),s=0;s<i.length;s++){var o=i[s],l=a[o];l!=null&&(l.bypass?l.bypassed=null:a[o]=null)}}};ur.update=function(){var t=this._private.cy,e=t.mutableElements();e.updateStyle()};ur.updateTransitions=function(t,e){var r=this,n=t._private,a=t.pstyle("transition-property").value,i=t.pstyle("transition-duration").pfValue,s=t.pstyle("transition-delay").pfValue;if(a.length>0&&i>0){for(var o={},l=!1,u=0;u<a.length;u++){var c=a[u],d=t.pstyle(c),f=e[c];if(f){var v=f.prev,p=v,y=f.next!=null?f.next:d,m=!1,g=void 0,x=1e-6;p&&(_e(p.pfValue)&&_e(y.pfValue)?(m=y.pfValue-p.pfValue,g=p.pfValue+x*m):_e(p.value)&&_e(y.value)?(m=y.value-p.value,g=p.value+x*m):mt(p.value)&&mt(y.value)&&(m=p.value[0]!==y.value[0]||p.value[1]!==y.value[1]||p.value[2]!==y.value[2],g=p.strValue),m&&(o[c]=y.strValue,this.applyBypass(t,c,g),l=!0))}}if(!l)return;n.transitioning=!0,new jo(function(b){s>0?t.delayAnimation(s).play().promise().then(b):b()}).then(function(){return t.animation({style:o,duration:i,easing:t.pstyle("transition-timing-function").value,queue:!1}).play().promise()}).then(function(){r.removeBypasses(t,a),t.emitAndNotify("style"),n.transitioning=!1})}else n.transitioning&&(this.removeBypasses(t,a),t.emitAndNotify("style"),n.transitioning=!1)};ur.checkTrigger=function(t,e,r,n,a,i){var s=this.properties[e],o=a(s);t.removed()||o!=null&&o(r,n,t)&&i(s)};ur.checkZOrderTrigger=function(t,e,r,n){var a=this;this.checkTrigger(t,e,r,n,function(i){return i.triggersZOrder},function(){a._private.cy.notify("zorder",t)})};ur.checkBoundsTrigger=function(t,e,r,n){this.checkTrigger(t,e,r,n,function(a){return a.triggersBounds},function(a){t.dirtyCompoundBoundsCache(),t.dirtyBoundingBoxCache()})};ur.checkConnectedEdgesBoundsTrigger=function(t,e,r,n){this.checkTrigger(t,e,r,n,function(a){return a.triggersBoundsOfConnectedEdges},function(a){t.connectedEdges().forEach(function(i){i.dirtyBoundingBoxCache()})})};ur.checkParallelEdgesBoundsTrigger=function(t,e,r,n){this.checkTrigger(t,e,r,n,function(a){return a.triggersBoundsOfParallelEdges},function(a){t.parallelEdges().forEach(function(i){i.dirtyBoundingBoxCache()})})};ur.checkTriggers=function(t,e,r,n){t.dirtyStyleCache(),this.checkZOrderTrigger(t,e,r,n),this.checkBoundsTrigger(t,e,r,n),this.checkConnectedEdgesBoundsTrigger(t,e,r,n),this.checkParallelEdgesBoundsTrigger(t,e,r,n)};var Vu={};Vu.applyBypass=function(t,e,r,n){var a=this,i=[],s=!0;if(e==="*"||e==="**"){if(r!==void 0)for(var o=0;o<a.properties.length;o++){var l=a.properties[o],u=l.name,c=this.parse(u,r,!0);c&&i.push(c)}}else if(Ve(e)){var d=this.parse(e,r,!0);d&&i.push(d)}else if(st(e)){var f=e;n=r;for(var v=Object.keys(f),p=0;p<v.length;p++){var y=v[p],m=f[y];if(m===void 0&&(m=f[Hf(y)]),m!==void 0){var g=this.parse(y,m,!0);g&&i.push(g)}}}else return!1;if(i.length===0)return!1;for(var x=!1,b=0;b<t.length;b++){for(var w=t[b],E={},C=void 0,S=0;S<i.length;S++){var T=i[S];if(n){var P=w.pstyle(T.name);C=E[T.name]={prev:P}}x=this.applyParsedProperty(w,sa(T))||x,n&&(C.next=w.pstyle(T.name))}x&&this.updateStyleHints(w),n&&this.updateTransitions(w,E,s)}return x};Vu.overrideBypass=function(t,e,r){e=_E(e);for(var n=0;n<t.length;n++){var a=t[n],i=a._private.style[e],s=this.properties[e].type,o=s.color,l=s.mutiple,u=i?i.pfValue!=null?i.pfValue:i.value:null;!i||!i.bypass?this.applyBypass(a,e,r):(i.value=r,i.pfValue!=null&&(i.pfValue=r),o?i.strValue="rgb("+r.join(",")+")":l?i.strValue=r.join(" "):i.strValue=""+r,this.updateStyleHints(a)),this.checkTriggers(a,e,u,r)}};Vu.removeAllBypasses=function(t,e){return this.removeBypasses(t,this.propertyNames,e)};Vu.removeBypasses=function(t,e,r){for(var n=!0,a=0;a<t.length;a++){for(var i=t[a],s={},o=0;o<e.length;o++){var l=e[o],u=this.properties[l],c=i.pstyle(u.name);if(!(!c||!c.bypass)){var d="",f=this.parse(l,d,!0),v=s[u.name]={prev:c};this.applyParsedProperty(i,f),v.next=i.pstyle(u.name)}}this.updateStyleHints(i),r&&this.updateTransitions(i,s,n)}};var YE={};YE.getEmSizeInPixels=function(){var t=this.containerCss("font-size");return t!=null?parseFloat(t):1};YE.containerCss=function(t){var e=this._private.cy,r=e.container(),n=e.window();if(n&&r&&n.getComputedStyle)return n.getComputedStyle(r).getPropertyValue(t)};var ua={};ua.getRenderedStyle=function(t,e){return e?this.getStylePropertyValue(t,e,!0):this.getRawStyle(t,!0)};ua.getRawStyle=function(t,e){var r=this;if(t=t[0],t){for(var n={},a=0;a<r.properties.length;a++){var i=r.properties[a],s=r.getStylePropertyValue(t,i.name,e);s!=null&&(n[i.name]=s,n[Hf(i.name)]=s)}return n}};ua.getIndexedStyle=function(t,e,r,n){var a=t.pstyle(e)[r][n];return a??t.cy().style().getDefaultProperty(e)[r][0]};ua.getStylePropertyValue=function(t,e,r){var n=this;if(t=t[0],t){var a=n.properties[e];a.alias&&(a=a.pointsTo);var i=a.type,s=t.pstyle(a.name);if(s){var o=s.value,l=s.units,u=s.strValue;if(r&&i.number&&o!=null&&_e(o)){var c=t.cy().zoom(),d=function(m){return m*c},f=function(m,g){return d(m)+g},v=mt(o),p=v?l.every(function(y){return y!=null}):l!=null;return p?v?o.map(function(y,m){return f(y,l[m])}).join(" "):f(o,l):v?o.map(function(y){return Ve(y)?y:""+d(y)}).join(" "):""+d(o)}else if(u!=null)return u}return null}};ua.getAnimationStartStyle=function(t,e){for(var r={},n=0;n<e.length;n++){var a=e[n],i=a.name,s=t.pstyle(i);s!==void 0&&(st(s)?s=this.parse(i,s.strValue):s=this.parse(i,s)),s&&(r[i]=s)}return r};ua.getPropsList=function(t){var e=this,r=[],n=t,a=e.properties;if(n)for(var i=Object.keys(n),s=0;s<i.length;s++){var o=i[s],l=n[o],u=a[o]||a[_E(o)],c=this.parse(u.name,l);c&&r.push(c)}return r};ua.getNonDefaultPropertiesHash=function(t,e,r){var n=r.slice(),a,i,s,o,l,u;for(l=0;l<e.length;l++)if(a=e[l],i=t.pstyle(a,!1),i!=null)if(i.pfValue!=null)n[0]=uu(o,n[0]),n[1]=cu(o,n[1]);else for(s=i.strValue,u=0;u<s.length;u++)o=s.charCodeAt(u),n[0]=uu(o,n[0]),n[1]=cu(o,n[1]);return n};ua.getPropertiesHash=ua.getNonDefaultPropertiesHash;var ih={};ih.appendFromJson=function(t){for(var e=this,r=0;r<t.length;r++){var n=t[r],a=n.selector,i=n.style||n.css,s=Object.keys(i);e.selector(a);for(var o=0;o<s.length;o++){var l=s[o],u=i[l];e.css(l,u)}}return e};ih.fromJson=function(t){var e=this;return e.resetToDefault(),e.appendFromJson(t),e};ih.json=function(){for(var t=[],e=this.defaultLength;e<this.length;e++){for(var r=this[e],n=r.selector,a=r.properties,i={},s=0;s<a.length;s++){var o=a[s];i[o.name]=o.strValue}t.push({selector:n?n.toString():"core",style:i})}return t};var XE={};XE.appendFromString=function(t){var e=this,r=this,n=""+t,a,i,s;n=n.replace(/[/][*](\s|.)+?[*][/]/g,"");function o(){n.length>a.length?n=n.substr(a.length):n=""}function l(){i.length>s.length?i=i.substr(s.length):i=""}for(;;){var u=n.match(/^\s*$/);if(u)break;var c=n.match(/^\s*((?:.|\s)+?)\s*\{((?:.|\s)+?)\}/);if(!c){ht("Halting stylesheet parsing: String stylesheet contains more to parse but no selector and block found in: "+n);break}a=c[0];var d=c[1];if(d!=="core"){var f=new Si(d);if(f.invalid){ht("Skipping parsing of block: Invalid selector found in string stylesheet: "+d),o();continue}}var v=c[2],p=!1;i=v;for(var y=[];;){var m=i.match(/^\s*$/);if(m)break;var g=i.match(/^\s*(.+?)\s*:\s*(.+?)(?:\s*;|\s*$)/);if(!g){ht("Skipping parsing of block: Invalid formatting of style property and value definitions found in:"+v),p=!0;break}s=g[0];var x=g[1],b=g[2],w=e.properties[x];if(!w){ht("Skipping property: Invalid property name in: "+s),l();continue}var E=r.parse(x,b);if(!E){ht("Skipping property: Invalid property definition in: "+s),l();continue}y.push({name:x,val:b}),l()}if(p){o();break}r.selector(d);for(var C=0;C<y.length;C++){var S=y[C];r.css(S.name,S.val)}o()}return r};XE.fromString=function(t){var e=this;return e.resetToDefault(),e.appendFromString(t),e};var Gt={};(function(){var t=tr,e=p$,r=m$,n=y$,a=x$,i=function(X){return"^"+X+"\\s*\\(\\s*([\\w\\.]+)\\s*\\)$"},s=function(X){var ee=t+"|\\w+|"+e+"|"+r+"|"+n+"|"+a;return"^"+X+"\\s*\\(([\\w\\.]+)\\s*\\,\\s*("+t+")\\s*\\,\\s*("+t+")\\s*,\\s*("+ee+")\\s*\\,\\s*("+ee+")\\)$"},o=[`^url\\s*\\(\\s*['"]?(.+?)['"]?\\s*\\)$`,"^(none)$","^(.+)$"];Gt.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:i("data")},layoutData:{mapping:!0,regex:i("layoutData")},scratch:{mapping:!0,regex:i("scratch")},mapData:{mapping:!0,regex:s("mapData")},mapLayoutData:{mapping:!0,regex:s("mapLayoutData")},mapScratch:{mapping:!0,regex:s("mapScratch")},fn:{mapping:!0,fn:!0},url:{regexes:o,singleRegexMatchValue:!0},urls:{regexes:o,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(X,ee){switch(X.length){case 2:return ee[0]!=="deg"&&ee[0]!=="rad"&&ee[1]!=="deg"&&ee[1]!=="rad";case 1:return Ve(X[0])||ee[0]==="deg"||ee[0]==="rad";default:return!1}}},easing:{regexes:["^(spring)\\s*\\(\\s*("+t+")\\s*,\\s*("+t+")\\s*\\)$","^(cubic-bezier)\\s*\\(\\s*("+t+")\\s*,\\s*("+t+")\\s*,\\s*("+t+")\\s*,\\s*("+t+")\\s*\\)$"],enums:["linear","ease","ease-in","ease-out","ease-in-out","ease-in-sine","ease-out-sine","ease-in-out-sine","ease-in-quad","ease-out-quad","ease-in-out-quad","ease-in-cubic","ease-out-cubic","ease-in-out-cubic","ease-in-quart","ease-out-quart","ease-in-out-quart","ease-in-quint","ease-out-quint","ease-in-out-quint","ease-in-expo","ease-out-expo","ease-in-out-expo","ease-in-circ","ease-out-circ","ease-in-out-circ"]},gradientDirection:{enums:["to-bottom","to-top","to-left","to-right","to-bottom-right","to-bottom-left","to-top-right","to-top-left","to-right-bottom","to-left-bottom","to-right-top","to-left-top"]},boundsExpansion:{number:!0,multiple:!0,min:0,validate:function(X){var ee=X.length;return ee===1||ee===2||ee===4}}};var l={zeroNonZero:function(X,ee){return(X==null||ee==null)&&X!==ee||X==0&&ee!=0?!0:X!=0&&ee==0},any:function(X,ee){return X!=ee},emptyNonEmpty:function(X,ee){var ie=bi(X),oe=bi(ee);return ie&&!oe||!ie&&oe}},u=Gt.types,c=[{name:"label",type:u.text,triggersBounds:l.any,triggersZOrder:l.emptyNonEmpty},{name:"text-rotation",type:u.textRotation,triggersBounds:l.any},{name:"text-margin-x",type:u.bidirectionalSize,triggersBounds:l.any},{name:"text-margin-y",type:u.bidirectionalSize,triggersBounds:l.any}],d=[{name:"source-label",type:u.text,triggersBounds:l.any},{name:"source-text-rotation",type:u.textRotation,triggersBounds:l.any},{name:"source-text-margin-x",type:u.bidirectionalSize,triggersBounds:l.any},{name:"source-text-margin-y",type:u.bidirectionalSize,triggersBounds:l.any},{name:"source-text-offset",type:u.size,triggersBounds:l.any}],f=[{name:"target-label",type:u.text,triggersBounds:l.any},{name:"target-text-rotation",type:u.textRotation,triggersBounds:l.any},{name:"target-text-margin-x",type:u.bidirectionalSize,triggersBounds:l.any},{name:"target-text-margin-y",type:u.bidirectionalSize,triggersBounds:l.any},{name:"target-text-offset",type:u.size,triggersBounds:l.any}],v=[{name:"font-family",type:u.fontFamily,triggersBounds:l.any},{name:"font-style",type:u.fontStyle,triggersBounds:l.any},{name:"font-weight",type:u.fontWeight,triggersBounds:l.any},{name:"font-size",type:u.size,triggersBounds:l.any},{name:"text-transform",type:u.textTransform,triggersBounds:l.any},{name:"text-wrap",type:u.textWrap,triggersBounds:l.any},{name:"text-overflow-wrap",type:u.textOverflowWrap,triggersBounds:l.any},{name:"text-max-width",type:u.size,triggersBounds:l.any},{name:"text-outline-width",type:u.size,triggersBounds:l.any},{name:"line-height",type:u.positiveNumber,triggersBounds:l.any}],p=[{name:"text-valign",type:u.valign,triggersBounds:l.any},{name:"text-halign",type:u.halign,triggersBounds:l.any},{name:"color",type:u.color},{name:"text-outline-color",type:u.color},{name:"text-outline-opacity",type:u.zeroOneNumber},{name:"text-background-color",type:u.color},{name:"text-background-opacity",type:u.zeroOneNumber},{name:"text-background-padding",type:u.size,triggersBounds:l.any},{name:"text-border-opacity",type:u.zeroOneNumber},{name:"text-border-color",type:u.color},{name:"text-border-width",type:u.size,triggersBounds:l.any},{name:"text-border-style",type:u.borderStyle,triggersBounds:l.any},{name:"text-background-shape",type:u.textBackgroundShape,triggersBounds:l.any},{name:"text-justification",type:u.justification},{name:"box-select-labels",type:u.bool,triggersBounds:l.any}],y=[{name:"events",type:u.bool,triggersZOrder:l.any},{name:"text-events",type:u.bool,triggersZOrder:l.any},{name:"box-selection",type:u.boxSelection,triggersZOrder:l.any}],m=[{name:"display",type:u.display,triggersZOrder:l.any,triggersBounds:l.any,triggersBoundsOfConnectedEdges:l.any,triggersBoundsOfParallelEdges:function(X,ee,ie){return X===ee?!1:ie.pstyle("curve-style").value==="bezier"}},{name:"visibility",type:u.visibility,triggersZOrder:l.any},{name:"opacity",type:u.zeroOneNumber,triggersZOrder:l.zeroNonZero},{name:"text-opacity",type:u.zeroOneNumber},{name:"min-zoomed-font-size",type:u.size},{name:"z-compound-depth",type:u.zCompoundDepth,triggersZOrder:l.any},{name:"z-index-compare",type:u.zIndexCompare,triggersZOrder:l.any},{name:"z-index",type:u.number,triggersZOrder:l.any}],g=[{name:"overlay-padding",type:u.size,triggersBounds:l.any},{name:"overlay-color",type:u.color},{name:"overlay-opacity",type:u.zeroOneNumber,triggersBounds:l.zeroNonZero},{name:"overlay-shape",type:u.overlayShape,triggersBounds:l.any},{name:"overlay-corner-radius",type:u.cornerRadius}],x=[{name:"underlay-padding",type:u.size,triggersBounds:l.any},{name:"underlay-color",type:u.color},{name:"underlay-opacity",type:u.zeroOneNumber,triggersBounds:l.zeroNonZero},{name:"underlay-shape",type:u.overlayShape,triggersBounds:l.any},{name:"underlay-corner-radius",type:u.cornerRadius}],b=[{name:"transition-property",type:u.propList},{name:"transition-duration",type:u.time},{name:"transition-delay",type:u.time},{name:"transition-timing-function",type:u.easing}],w=function(X,ee){return ee.value==="label"?-X.poolIndex():ee.pfValue},E=[{name:"height",type:u.nodeSize,triggersBounds:l.any,hashOverride:w},{name:"width",type:u.nodeSize,triggersBounds:l.any,hashOverride:w},{name:"shape",type:u.nodeShape,triggersBounds:l.any},{name:"shape-polygon-points",type:u.polygonPointList,triggersBounds:l.any},{name:"corner-radius",type:u.cornerRadius},{name:"background-color",type:u.color},{name:"background-fill",type:u.fill},{name:"background-opacity",type:u.zeroOneNumber},{name:"background-blacken",type:u.nOneOneNumber},{name:"background-gradient-stop-colors",type:u.colors},{name:"background-gradient-stop-positions",type:u.percentages},{name:"background-gradient-direction",type:u.gradientDirection},{name:"padding",type:u.sizeMaybePercent,triggersBounds:l.any},{name:"padding-relative-to",type:u.paddingRelativeTo,triggersBounds:l.any},{name:"bounds-expansion",type:u.boundsExpansion,triggersBounds:l.any}],C=[{name:"border-color",type:u.color},{name:"border-opacity",type:u.zeroOneNumber},{name:"border-width",type:u.size,triggersBounds:l.any},{name:"border-style",type:u.borderStyle},{name:"border-cap",type:u.lineCap},{name:"border-join",type:u.lineJoin},{name:"border-dash-pattern",type:u.numbers},{name:"border-dash-offset",type:u.number},{name:"border-position",type:u.linePosition}],S=[{name:"outline-color",type:u.color},{name:"outline-opacity",type:u.zeroOneNumber},{name:"outline-width",type:u.size,triggersBounds:l.any},{name:"outline-style",type:u.borderStyle},{name:"outline-offset",type:u.size,triggersBounds:l.any}],T=[{name:"background-image",type:u.urls},{name:"background-image-crossorigin",type:u.bgCrossOrigin},{name:"background-image-opacity",type:u.zeroOneNumbers},{name:"background-image-containment",type:u.bgContainment},{name:"background-image-smoothing",type:u.bools},{name:"background-position-x",type:u.bgPos},{name:"background-position-y",type:u.bgPos},{name:"background-width-relative-to",type:u.bgRelativeTo},{name:"background-height-relative-to",type:u.bgRelativeTo},{name:"background-repeat",type:u.bgRepeat},{name:"background-fit",type:u.bgFit},{name:"background-clip",type:u.bgClip},{name:"background-width",type:u.bgWH},{name:"background-height",type:u.bgWH},{name:"background-offset-x",type:u.bgPos},{name:"background-offset-y",type:u.bgPos}],P=[{name:"position",type:u.position,triggersBounds:l.any},{name:"compound-sizing-wrt-labels",type:u.compoundIncludeLabels,triggersBounds:l.any},{name:"min-width",type:u.size,triggersBounds:l.any},{name:"min-width-bias-left",type:u.sizeMaybePercent,triggersBounds:l.any},{name:"min-width-bias-right",type:u.sizeMaybePercent,triggersBounds:l.any},{name:"min-height",type:u.size,triggersBounds:l.any},{name:"min-height-bias-top",type:u.sizeMaybePercent,triggersBounds:l.any},{name:"min-height-bias-bottom",type:u.sizeMaybePercent,triggersBounds:l.any}],A=[{name:"line-style",type:u.lineStyle},{name:"line-color",type:u.color},{name:"line-fill",type:u.fill},{name:"line-cap",type:u.lineCap},{name:"line-opacity",type:u.zeroOneNumber},{name:"line-dash-pattern",type:u.numbers},{name:"line-dash-offset",type:u.number},{name:"line-outline-width",type:u.size},{name:"line-outline-color",type:u.color},{name:"line-gradient-stop-colors",type:u.colors},{name:"line-gradient-stop-positions",type:u.percentages},{name:"curve-style",type:u.curveStyle,triggersBounds:l.any,triggersBoundsOfParallelEdges:function(X,ee){return X===ee?!1:X==="bezier"||ee==="bezier"}},{name:"haystack-radius",type:u.zeroOneNumber,triggersBounds:l.any},{name:"source-endpoint",type:u.edgeEndpoint,triggersBounds:l.any},{name:"target-endpoint",type:u.edgeEndpoint,triggersBounds:l.any},{name:"control-point-step-size",type:u.size,triggersBounds:l.any},{name:"control-point-distances",type:u.bidirectionalSizes,triggersBounds:l.any},{name:"control-point-weights",type:u.numbers,triggersBounds:l.any},{name:"segment-distances",type:u.bidirectionalSizes,triggersBounds:l.any},{name:"segment-weights",type:u.numbers,triggersBounds:l.any},{name:"segment-radii",type:u.numbers,triggersBounds:l.any},{name:"radius-type",type:u.radiusType,triggersBounds:l.any},{name:"taxi-turn",type:u.bidirectionalSizeMaybePercent,triggersBounds:l.any},{name:"taxi-turn-min-distance",type:u.size,triggersBounds:l.any},{name:"taxi-direction",type:u.axisDirection,triggersBounds:l.any},{name:"taxi-radius",type:u.number,triggersBounds:l.any},{name:"edge-distances",type:u.edgeDistances,triggersBounds:l.any},{name:"arrow-scale",type:u.positiveNumber,triggersBounds:l.any},{name:"loop-direction",type:u.angle,triggersBounds:l.any},{name:"loop-sweep",type:u.angle,triggersBounds:l.any},{name:"source-distance-from-node",type:u.size,triggersBounds:l.any},{name:"target-distance-from-node",type:u.size,triggersBounds:l.any}],j=[{name:"ghost",type:u.bool,triggersBounds:l.any},{name:"ghost-offset-x",type:u.bidirectionalSize,triggersBounds:l.any},{name:"ghost-offset-y",type:u.bidirectionalSize,triggersBounds:l.any},{name:"ghost-opacity",type:u.zeroOneNumber}],R=[{name:"selection-box-color",type:u.color},{name:"selection-box-opacity",type:u.zeroOneNumber},{name:"selection-box-border-color",type:u.color},{name:"selection-box-border-width",type:u.size},{name:"active-bg-color",type:u.color},{name:"active-bg-opacity",type:u.zeroOneNumber},{name:"active-bg-size",type:u.size},{name:"outside-texture-bg-color",type:u.color},{name:"outside-texture-bg-opacity",type:u.zeroOneNumber}],O=[];Gt.pieBackgroundN=16,O.push({name:"pie-size",type:u.sizeMaybePercent}),O.push({name:"pie-hole",type:u.sizeMaybePercent}),O.push({name:"pie-start-angle",type:u.angle});for(var N=1;N<=Gt.pieBackgroundN;N++)O.push({name:"pie-"+N+"-background-color",type:u.color}),O.push({name:"pie-"+N+"-background-size",type:u.percent}),O.push({name:"pie-"+N+"-background-opacity",type:u.zeroOneNumber});var D=[];Gt.stripeBackgroundN=16,D.push({name:"stripe-size",type:u.sizeMaybePercent}),D.push({name:"stripe-direction",type:u.axisDirectionPrimary});for(var L=1;L<=Gt.stripeBackgroundN;L++)D.push({name:"stripe-"+L+"-background-color",type:u.color}),D.push({name:"stripe-"+L+"-background-size",type:u.percent}),D.push({name:"stripe-"+L+"-background-opacity",type:u.zeroOneNumber});var _=[],k=Gt.arrowPrefixes=["source","mid-source","target","mid-target"];[{name:"arrow-shape",type:u.arrowShape,triggersBounds:l.any},{name:"arrow-color",type:u.color},{name:"arrow-fill",type:u.arrowFill},{name:"arrow-width",type:u.arrowWidth}].forEach(function(H){k.forEach(function(X){var ee=X+"-"+H.name,ie=H.type,oe=H.triggersBounds;_.push({name:ee,type:ie,triggersBounds:oe})})},{});var I=Gt.properties=[].concat(y,b,m,g,x,j,p,v,c,d,f,E,C,S,T,O,D,P,A,_,R),F=Gt.propertyGroups={behavior:y,transition:b,visibility:m,overlay:g,underlay:x,ghost:j,commonLabel:p,labelDimensions:v,mainLabel:c,sourceLabel:d,targetLabel:f,nodeBody:E,nodeBorder:C,nodeOutline:S,backgroundImage:T,pie:O,stripe:D,compound:P,edgeLine:A,edgeArrow:_,core:R},B=Gt.propertyGroupNames={},$=Gt.propertyGroupKeys=Object.keys(F);$.forEach(function(H){B[H]=F[H].map(function(X){return X.name}),F[H].forEach(function(X){return X.groupKey=H})});var W=Gt.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"}];Gt.propertyNames=I.map(function(H){return H.name});for(var z=0;z<I.length;z++){var q=I[z];I[q.name]=q}for(var G=0;G<W.length;G++){var J=W[G],ae=I[J.pointsTo],Y={name:J.name,alias:!0,pointsTo:ae};I.push(Y),I[J.name]=Y}})();Gt.getDefaultProperty=function(t){return this.getDefaultProperties()[t]};Gt.getDefaultProperties=function(){var t=this._private;if(t.defaultProperties!=null)return t.defaultProperties;for(var e=We({"selection-box-color":"#ddd","selection-box-opacity":.65,"selection-box-border-color":"#aaa","selection-box-border-width":1,"active-bg-color":"black","active-bg-opacity":.15,"active-bg-size":30,"outside-texture-bg-color":"#000","outside-texture-bg-opacity":.125,events:"yes","text-events":"no","text-valign":"top","text-halign":"center","text-justification":"auto","line-height":1,color:"#000","box-selection":"contain","text-outline-color":"#000","text-outline-width":0,"text-outline-opacity":1,"text-opacity":1,"text-decoration":"none","text-transform":"none","text-wrap":"none","text-overflow-wrap":"whitespace","text-max-width":9999,"text-background-color":"#000","text-background-opacity":0,"text-background-shape":"rectangle","text-background-padding":0,"text-border-opacity":0,"text-border-width":0,"text-border-style":"solid","text-border-color":"#000","font-family":"Helvetica Neue, Helvetica, sans-serif","font-style":"normal","font-weight":"normal","font-size":16,"min-zoomed-font-size":0,"text-rotation":"none","source-text-rotation":"none","target-text-rotation":"none",visibility:"visible",display:"element",opacity:1,"z-compound-depth":"auto","z-index-compare":"auto","z-index":0,label:"","text-margin-x":0,"text-margin-y":0,"source-label":"","source-text-offset":0,"source-text-margin-x":0,"source-text-margin-y":0,"target-label":"","target-text-offset":0,"target-text-margin-x":0,"target-text-margin-y":0,"overlay-opacity":0,"overlay-color":"#000","overlay-padding":10,"overlay-shape":"round-rectangle","overlay-corner-radius":"auto","underlay-opacity":0,"underlay-color":"#000","underlay-padding":10,"underlay-shape":"round-rectangle","underlay-corner-radius":"auto","transition-property":"none","transition-duration":0,"transition-delay":0,"transition-timing-function":"linear","box-select-labels":"no","background-blacken":0,"background-color":"#999","background-fill":"solid","background-opacity":1,"background-image":"none","background-image-crossorigin":"anonymous","background-image-opacity":1,"background-image-containment":"inside","background-image-smoothing":"yes","background-position-x":"50%","background-position-y":"50%","background-offset-x":0,"background-offset-y":0,"background-width-relative-to":"include-padding","background-height-relative-to":"include-padding","background-repeat":"no-repeat","background-fit":"none","background-clip":"node","background-width":"auto","background-height":"auto","border-color":"#000","border-opacity":1,"border-width":0,"border-style":"solid","border-dash-pattern":[4,2],"border-dash-offset":0,"border-cap":"butt","border-join":"miter","border-position":"center","outline-color":"#999","outline-opacity":1,"outline-width":0,"outline-offset":0,"outline-style":"solid",height:30,width:30,shape:"ellipse","shape-polygon-points":"-1, -1, 1, -1, 1, 1, -1, 1","corner-radius":"auto","bounds-expansion":0,"background-gradient-direction":"to-bottom","background-gradient-stop-colors":"#999","background-gradient-stop-positions":"0%",ghost:"no","ghost-offset-y":0,"ghost-offset-x":0,"ghost-opacity":0,padding:0,"padding-relative-to":"width",position:"origin","compound-sizing-wrt-labels":"include","min-width":0,"min-width-bias-left":0,"min-width-bias-right":0,"min-height":0,"min-height-bias-top":0,"min-height-bias-bottom":0},{"pie-size":"100%","pie-hole":0,"pie-start-angle":"0deg"},[{name:"pie-{{i}}-background-color",value:"black"},{name:"pie-{{i}}-background-size",value:"0%"},{name:"pie-{{i}}-background-opacity",value:1}].reduce(function(l,u){for(var c=1;c<=Gt.pieBackgroundN;c++){var d=u.name.replace("{{i}}",c),f=u.value;l[d]=f}return l},{}),{"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(l,u){for(var c=1;c<=Gt.stripeBackgroundN;c++){var d=u.name.replace("{{i}}",c),f=u.value;l[d]=f}return l},{}),{"line-style":"solid","line-color":"#999","line-fill":"solid","line-cap":"butt","line-opacity":1,"line-outline-width":0,"line-outline-color":"#000","line-gradient-stop-colors":"#999","line-gradient-stop-positions":"0%","control-point-step-size":40,"control-point-weights":.5,"segment-weights":.5,"segment-distances":20,"segment-radii":15,"radius-type":"arc-radius","taxi-turn":"50%","taxi-radius":15,"taxi-turn-min-distance":10,"taxi-direction":"auto","edge-distances":"intersection","curve-style":"haystack","haystack-radius":0,"arrow-scale":1,"loop-direction":"-45deg","loop-sweep":"-90deg","source-distance-from-node":0,"target-distance-from-node":0,"source-endpoint":"outside-to-node","target-endpoint":"outside-to-node","line-dash-pattern":[6,3],"line-dash-offset":0},[{name:"arrow-shape",value:"none"},{name:"arrow-color",value:"#999"},{name:"arrow-fill",value:"filled"},{name:"arrow-width",value:1}].reduce(function(l,u){return Gt.arrowPrefixes.forEach(function(c){var d=c+"-"+u.name,f=u.value;l[d]=f}),l},{})),r={},n=0;n<this.properties.length;n++){var a=this.properties[n];if(!a.pointsTo){var i=a.name,s=e[i],o=this.parse(i,s);r[i]=o}}return t.defaultProperties=r,t.defaultProperties};Gt.addDefaultStylesheet=function(){this.selector(":parent").css({shape:"rectangle",padding:10,"background-color":"#eee","border-color":"#ccc","border-width":1}).selector("edge").css({width:3}).selector(":loop").css({"curve-style":"bezier"}).selector("edge:compound").css({"curve-style":"bezier","source-endpoint":"outside-to-line","target-endpoint":"outside-to-line"}).selector(":selected").css({"background-color":"#0169D9","line-color":"#0169D9","source-arrow-color":"#0169D9","target-arrow-color":"#0169D9","mid-source-arrow-color":"#0169D9","mid-target-arrow-color":"#0169D9"}).selector(":parent:selected").css({"background-color":"#CCE1F9","border-color":"#aec8e5"}).selector(":active").css({"overlay-color":"black","overlay-padding":10,"overlay-opacity":.25}),this.defaultLength=this.length};var sh={};sh.parse=function(t,e,r,n){var a=this;if(Dt(e))return a.parseImplWarn(t,e,r,n);var i=n==="mapping"||n===!0||n===!1||n==null?"dontcare":n,s=r?"t":"f",o=""+e,l=gM(t,o,s,i),u=a.propCache=a.propCache||[],c;return(c=u[l])||(c=u[l]=a.parseImplWarn(t,e,r,n)),(r||n==="mapping")&&(c=sa(c),c&&(c.value=sa(c.value))),c};sh.parseImplWarn=function(t,e,r,n){var a=this.parseImpl(t,e,r,n);return!a&&e!=null&&ht("The style property `".concat(t,": ").concat(e,"` is invalid")),a&&(a.name==="width"||a.name==="height")&&e==="label"&&ht("The style value of `label` is deprecated for `"+a.name+"`"),a};sh.parseImpl=function(t,e,r,n){var a=this;t=_E(t);var i=a.properties[t],s=e,o=a.types;if(!i||e===void 0)return null;i.alias&&(i=i.pointsTo,t=i.name);var l=Ve(e);l&&(e=e.trim());var u=i.type;if(!u)return null;if(r&&(e===""||e===null))return{name:t,value:e,bypass:!0,deleteBypass:!0};if(Dt(e))return{name:t,value:e,strValue:"fn",mapped:o.fn,bypass:r};var c,d;if(!(!l||n||e.length<7||e[1]!=="a")){if(e.length>=7&&e[0]==="d"&&(c=new RegExp(o.data.regex).exec(e))){if(r)return!1;var f=o.data;return{name:t,value:c,strValue:""+e,mapped:f,field:c[1],bypass:r}}else if(e.length>=10&&e[0]==="m"&&(d=new RegExp(o.mapData.regex).exec(e))){if(r||u.multiple)return!1;var v=o.mapData;if(!(u.color||u.number))return!1;var p=this.parse(t,d[4]);if(!p||p.mapped)return!1;var y=this.parse(t,d[5]);if(!y||y.mapped)return!1;if(p.pfValue===y.pfValue||p.strValue===y.strValue)return ht("`"+t+": "+e+"` is not a valid mapper because the output range is zero; converting to `"+t+": "+p.strValue+"`"),this.parse(t,p.strValue);if(u.color){var m=p.value,g=y.value,x=m[0]===g[0]&&m[1]===g[1]&&m[2]===g[2]&&(m[3]===g[3]||(m[3]==null||m[3]===1)&&(g[3]==null||g[3]===1));if(x)return!1}return{name:t,value:d,strValue:""+e,mapped:v,field:d[1],fieldMin:parseFloat(d[2]),fieldMax:parseFloat(d[3]),valueMin:p.value,valueMax:y.value,bypass:r}}}if(u.multiple&&n!=="multiple"){var b;if(l?b=e.split(/\s+/):mt(e)?b=e:b=[e],u.evenMultiple&&b.length%2!==0)return null;for(var w=[],E=[],C=[],S="",T=!1,P=0;P<b.length;P++){var A=a.parse(t,b[P],r,"multiple");T=T||Ve(A.value),w.push(A.value),C.push(A.pfValue!=null?A.pfValue:A.value),E.push(A.units),S+=(P>0?" ":"")+A.strValue}return u.validate&&!u.validate(w,E)?null:u.singleEnum&&T?w.length===1&&Ve(w[0])?{name:t,value:w[0],strValue:w[0],bypass:r}:null:{name:t,value:w,pfValue:C,strValue:S,bypass:r,units:E}}var j=function(){for(var Y=0;Y<u.enums.length;Y++){var H=u.enums[Y];if(H===e)return{name:t,value:e,strValue:""+e,bypass:r}}return null};if(u.number){var R,O="px";if(u.units&&(R=u.units),u.implicitUnits&&(O=u.implicitUnits),!u.unitless)if(l){var N="px|em"+(u.allowPercent?"|\\%":"");R&&(N=R);var D=e.match("^("+tr+")("+N+")?$");D&&(e=D[1],R=D[2]||O)}else(!R||u.implicitUnits)&&(R=O);if(e=parseFloat(e),isNaN(e)&&u.enums===void 0)return null;if(isNaN(e)&&u.enums!==void 0)return e=s,j();if(u.integer&&!l$(e)||u.min!==void 0&&(e<u.min||u.strictMin&&e===u.min)||u.max!==void 0&&(e>u.max||u.strictMax&&e===u.max))return null;var L={name:t,value:e,strValue:""+e+(R||""),units:R,bypass:r};return u.unitless||R!=="px"&&R!=="em"?L.pfValue=e:L.pfValue=R==="px"||!R?e:this.getEmSizeInPixels()*e,(R==="ms"||R==="s")&&(L.pfValue=R==="ms"?e:1e3*e),(R==="deg"||R==="rad")&&(L.pfValue=R==="rad"?e:yV(e)),R==="%"&&(L.pfValue=e/100),L}else if(u.propList){var _=[],k=""+e;if(k!=="none"){for(var I=k.split(/\s*,\s*|\s+/),F=0;F<I.length;F++){var B=I[F].trim();a.properties[B]?_.push(B):ht("`"+B+"` is not a valid property name")}if(_.length===0)return null}return{name:t,value:_,strValue:_.length===0?"none":_.join(" "),bypass:r}}else if(u.color){var $=uM(e);return $?{name:t,value:$,pfValue:$,strValue:"rgb("+$[0]+","+$[1]+","+$[2]+")",bypass:r}:null}else if(u.regex||u.regexes){if(u.enums){var W=j();if(W)return W}for(var z=u.regexes?u.regexes:[u.regex],q=0;q<z.length;q++){var G=new RegExp(z[q]),J=G.exec(e);if(J)return{name:t,value:u.singleRegexMatchValue?J[1]:J,strValue:""+e,bypass:r}}return null}else return u.string?{name:t,value:""+e,strValue:""+e,bypass:r}:u.enums?j():null};var lr=function(e){if(!(this instanceof lr))return new lr(e);if(!DE(e)){Tt("A style must have a core reference");return}this._private={cy:e,coreStyle:{}},this.length=0,this.resetToDefault()},Rr=lr.prototype;Rr.instanceString=function(){return"style"};Rr.clear=function(){for(var t=this._private,e=t.cy,r=e.elements(),n=0;n<this.length;n++)this[n]=void 0;return this.length=0,t.contextStyles={},t.propDiffs={},this.cleanElements(r,!0),r.forEach(function(a){var i=a[0]._private;i.styleDirty=!0,i.appliedInitStyle=!1}),this};Rr.resetToDefault=function(){return this.clear(),this.addDefaultStylesheet(),this};Rr.core=function(t){return this._private.coreStyle[t]||this.getDefaultProperty(t)};Rr.selector=function(t){var e=t==="core"?null:new Si(t),r=this.length++;return this[r]={selector:e,properties:[],mappedProperties:[],index:r},this};Rr.css=function(){var t=this,e=arguments;if(e.length===1)for(var r=e[0],n=0;n<t.properties.length;n++){var a=t.properties[n],i=r[a.name];i===void 0&&(i=r[Hf(a.name)]),i!==void 0&&this.cssRule(a.name,i)}else e.length===2&&this.cssRule(e[0],e[1]);return this};Rr.style=Rr.css;Rr.cssRule=function(t,e){var r=this.parse(t,e);if(r){var n=this.length-1;this[n].properties.push(r),this[n].properties[r.name]=r,r.name.match(/pie-(\d+)-background-size/)&&r.value&&(this._private.hasPie=!0),r.name.match(/stripe-(\d+)-background-size/)&&r.value&&(this._private.hasStripe=!0),r.mapped&&this[n].mappedProperties.push(r);var a=!this[n].selector;a&&(this._private.coreStyle[r.name]=r)}return this};Rr.append=function(t){return sM(t)?t.appendToStyle(this):mt(t)?this.appendFromJson(t):Ve(t)&&this.appendFromString(t),this};lr.fromJson=function(t,e){var r=new lr(t);return r.fromJson(e),r};lr.fromString=function(t,e){return new lr(t).fromString(e)};[ur,Vu,YE,ua,ih,XE,Gt,sh].forEach(function(t){We(Rr,t)});lr.types=Rr.types;lr.properties=Rr.properties;lr.propertyGroups=Rr.propertyGroups;lr.propertyGroupNames=Rr.propertyGroupNames;lr.propertyGroupKeys=Rr.propertyGroupKeys;var E6={style:function(e){if(e){var r=this.setStyle(e);r.update()}return this._private.style},setStyle:function(e){var r=this._private;return sM(e)?r.style=e.generateStyle(this):mt(e)?r.style=lr.fromJson(this,e):Ve(e)?r.style=lr.fromString(this,e):r.style=lr(this),r.style},updateStyle:function(){this.mutableElements().updateStyle()}},S6="single",hs={autolock:function(e){if(e!==void 0)this._private.autolock=!!e;else return this._private.autolock;return this},autoungrabify:function(e){if(e!==void 0)this._private.autoungrabify=!!e;else return this._private.autoungrabify;return this},autounselectify:function(e){if(e!==void 0)this._private.autounselectify=!!e;else return this._private.autounselectify;return this},selectionType:function(e){var r=this._private;if(r.selectionType==null&&(r.selectionType=S6),e!==void 0)(e==="additive"||e==="single")&&(r.selectionType=e);else return r.selectionType;return this},panningEnabled:function(e){if(e!==void 0)this._private.panningEnabled=!!e;else return this._private.panningEnabled;return this},userPanningEnabled:function(e){if(e!==void 0)this._private.userPanningEnabled=!!e;else return this._private.userPanningEnabled;return this},zoomingEnabled:function(e){if(e!==void 0)this._private.zoomingEnabled=!!e;else return this._private.zoomingEnabled;return this},userZoomingEnabled:function(e){if(e!==void 0)this._private.userZoomingEnabled=!!e;else return this._private.userZoomingEnabled;return this},boxSelectionEnabled:function(e){if(e!==void 0)this._private.boxSelectionEnabled=!!e;else return this._private.boxSelectionEnabled;return this},pan:function(){var e=arguments,r=this._private.pan,n,a,i,s,o;switch(e.length){case 0:return r;case 1:if(Ve(e[0]))return n=e[0],r[n];if(st(e[0])){if(!this._private.panningEnabled)return this;i=e[0],s=i.x,o=i.y,_e(s)&&(r.x=s),_e(o)&&(r.y=o),this.emit("pan viewport")}break;case 2:if(!this._private.panningEnabled)return this;n=e[0],a=e[1],(n==="x"||n==="y")&&_e(a)&&(r[n]=a),this.emit("pan viewport");break}return this.notify("viewport"),this},panBy:function(e,r){var n=arguments,a=this._private.pan,i,s,o,l,u;if(!this._private.panningEnabled)return this;switch(n.length){case 1:st(e)&&(o=n[0],l=o.x,u=o.y,_e(l)&&(a.x+=l),_e(u)&&(a.y+=u),this.emit("pan viewport"));break;case 2:i=e,s=r,(i==="x"||i==="y")&&_e(s)&&(a[i]+=s),this.emit("pan viewport");break}return this.notify("viewport"),this},gc:function(){this.notify("gc")},fit:function(e,r){var n=this.getFitViewport(e,r);if(n){var a=this._private;a.zoom=n.zoom,a.pan=n.pan,this.emit("pan zoom viewport"),this.notify("viewport")}return this},getFitViewport:function(e,r){if(_e(e)&&r===void 0&&(r=e,e=void 0),!(!this._private.panningEnabled||!this._private.zoomingEnabled)){var n;if(Ve(e)){var a=e;e=this.$(a)}else if(d$(e)){var i=e;n={x1:i.x1,y1:i.y1,x2:i.x2,y2:i.y2},n.w=n.x2-n.x1,n.h=n.y2-n.y1}else cn(e)||(e=this.mutableElements());if(!(cn(e)&&e.empty())){n=n||e.boundingBox();var s=this.width(),o=this.height(),l;if(r=_e(r)?r:0,!isNaN(s)&&!isNaN(o)&&s>0&&o>0&&!isNaN(n.w)&&!isNaN(n.h)&&n.w>0&&n.h>0){l=Math.min((s-2*r)/n.w,(o-2*r)/n.h),l=l>this._private.maxZoom?this._private.maxZoom:l,l=l<this._private.minZoom?this._private.minZoom:l;var u={x:(s-l*(n.x1+n.x2))/2,y:(o-l*(n.y1+n.y2))/2};return{zoom:l,pan:u}}}}},zoomRange:function(e,r){var n=this._private;if(r==null){var a=e;e=a.min,r=a.max}return _e(e)&&_e(r)&&e<=r?(n.minZoom=e,n.maxZoom=r):_e(e)&&r===void 0&&e<=n.maxZoom?n.minZoom=e:_e(r)&&e===void 0&&r>=n.minZoom&&(n.maxZoom=r),this},minZoom:function(e){return e===void 0?this._private.minZoom:this.zoomRange({min:e})},maxZoom:function(e){return e===void 0?this._private.maxZoom:this.zoomRange({max:e})},getZoomedViewport:function(e){var r=this._private,n=r.pan,a=r.zoom,i,s,o=!1;if(r.zoomingEnabled||(o=!0),_e(e)?s=e:st(e)&&(s=e.level,e.position!=null?i=Xf(e.position,a,n):e.renderedPosition!=null&&(i=e.renderedPosition),i!=null&&!r.panningEnabled&&(o=!0)),s=s>r.maxZoom?r.maxZoom:s,s=s<r.minZoom?r.minZoom:s,o||!_e(s)||s===a||i!=null&&(!_e(i.x)||!_e(i.y)))return null;if(i!=null){var l=n,u=a,c=s,d={x:-c/u*(i.x-l.x)+i.x,y:-c/u*(i.y-l.y)+i.y};return{zoomed:!0,panned:!0,zoom:c,pan:d}}else return{zoomed:!0,panned:!1,zoom:s,pan:n}},zoom:function(e){if(e===void 0)return this._private.zoom;var r=this.getZoomedViewport(e),n=this._private;return r==null||!r.zoomed?this:(n.zoom=r.zoom,r.panned&&(n.pan.x=r.pan.x,n.pan.y=r.pan.y),this.emit("zoom"+(r.panned?" pan":"")+" viewport"),this.notify("viewport"),this)},viewport:function(e){var r=this._private,n=!0,a=!0,i=[],s=!1,o=!1;if(!e)return this;if(_e(e.zoom)||(n=!1),st(e.pan)||(a=!1),!n&&!a)return this;if(n){var l=e.zoom;l<r.minZoom||l>r.maxZoom||!r.zoomingEnabled?s=!0:(r.zoom=l,i.push("zoom"))}if(a&&(!s||!e.cancelOnFailedZoom)&&r.panningEnabled){var u=e.pan;_e(u.x)&&(r.pan.x=u.x,o=!1),_e(u.y)&&(r.pan.y=u.y,o=!1),o||i.push("pan")}return i.length>0&&(i.push("viewport"),this.emit(i.join(" ")),this.notify("viewport")),this},center:function(e){var r=this.getCenterPan(e);return r&&(this._private.pan=r,this.emit("pan viewport"),this.notify("viewport")),this},getCenterPan:function(e,r){if(this._private.panningEnabled){if(Ve(e)){var n=e;e=this.mutableElements().filter(n)}else cn(e)||(e=this.mutableElements());if(e.length!==0){var a=e.boundingBox(),i=this.width(),s=this.height();r=r===void 0?this._private.zoom:r;var o={x:(i-r*(a.x1+a.x2))/2,y:(s-r*(a.y1+a.y2))/2};return o}}},reset:function(){return!this._private.panningEnabled||!this._private.zoomingEnabled?this:(this.viewport({pan:{x:0,y:0},zoom:1}),this)},invalidateSize:function(){this._private.sizeCache=null},size:function(){var e=this._private,r=e.container,n=this;return e.sizeCache=e.sizeCache||(r?function(){var a=n.window().getComputedStyle(r),i=function(o){return parseFloat(a.getPropertyValue(o))};return{width:r.clientWidth-i("padding-left")-i("padding-right"),height:r.clientHeight-i("padding-top")-i("padding-bottom")}}():{width:1,height:1})},width:function(){return this.size().width},height:function(){return this.size().height},extent:function(){var e=this._private.pan,r=this._private.zoom,n=this.renderedExtent(),a={x1:(n.x1-e.x)/r,x2:(n.x2-e.x)/r,y1:(n.y1-e.y)/r,y2:(n.y2-e.y)/r};return a.w=a.x2-a.x1,a.h=a.y2-a.y1,a},renderedExtent:function(){var e=this.width(),r=this.height();return{x1:0,y1:0,x2:e,y2:r,w:e,h:r}},multiClickDebounceTime:function(e){if(e)this._private.multiClickDebounceTime=e;else return this._private.multiClickDebounceTime;return this}};hs.centre=hs.center;hs.autolockNodes=hs.autolock;hs.autoungrabifyNodes=hs.autoungrabify;var gu={data:ft.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeData:ft.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),scratch:ft.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:ft.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0})};gu.attr=gu.data;gu.removeAttr=gu.removeData;var mu=function(e){var r=this;e=We({},e);var n=e.container;n&&!Xd(n)&&Xd(n[0])&&(n=n[0]);var a=n?n._cyreg:null;a=a||{},a&&a.cy&&(a.cy.destroy(),a={});var i=a.readies=a.readies||[];n&&(n._cyreg=a),a.cy=r;var s=Zt!==void 0&&n!==void 0&&!e.headless,o=e;o.layout=We({name:s?"grid":"null"},o.layout),o.renderer=We({name:s?"canvas":"null"},o.renderer);var l=function(p,y,m){return y!==void 0?y:m!==void 0?m:p},u=this._private={container:n,ready:!1,options:o,elements:new pr(this),listeners:[],aniEles:new pr(this),data:o.data||{},scratch:{},layout:null,renderer:null,destroyed:!1,notificationsEnabled:!0,minZoom:1e-50,maxZoom:1e50,zoomingEnabled:l(!0,o.zoomingEnabled),userZoomingEnabled:l(!0,o.userZoomingEnabled),panningEnabled:l(!0,o.panningEnabled),userPanningEnabled:l(!0,o.userPanningEnabled),boxSelectionEnabled:l(!0,o.boxSelectionEnabled),autolock:l(!1,o.autolock,o.autolockNodes),autoungrabify:l(!1,o.autoungrabify,o.autoungrabifyNodes),autounselectify:l(!1,o.autounselectify),styleEnabled:o.styleEnabled===void 0?s:o.styleEnabled,zoom:_e(o.zoom)?o.zoom:1,pan:{x:st(o.pan)&&_e(o.pan.x)?o.pan.x:0,y:st(o.pan)&&_e(o.pan.y)?o.pan.y:0},animation:{current:[],queue:[]},hasCompoundNodes:!1,multiClickDebounceTime:l(250,o.multiClickDebounceTime)};this.createEmitter(),this.selectionType(o.selectionType),this.zoomRange({min:o.minZoom,max:o.maxZoom});var c=function(p,y){var m=p.some(f$);if(m)return jo.all(p).then(y);y(p)};u.styleEnabled&&r.setStyle([]);var d=We({},o,o.renderer);r.initRenderer(d);var f=function(p,y,m){r.notifications(!1);var g=r.mutableElements();g.length>0&&g.remove(),p!=null&&(st(p)||mt(p))&&r.add(p),r.one("layoutready",function(b){r.notifications(!0),r.emit(b),r.one("load",y),r.emitAndNotify("load")}).one("layoutstop",function(){r.one("done",m),r.emit("done")});var x=We({},r._private.options.layout);x.eles=r.elements(),r.layout(x).run()};c([o.style,o.elements],function(v){var p=v[0],y=v[1];u.styleEnabled&&r.style().append(p),f(y,function(){r.startAnimationLoop(),u.ready=!0,Dt(o.ready)&&r.on("ready",o.ready);for(var m=0;m<i.length;m++){var g=i[m];r.on("ready",g)}a&&(a.readies=[]),r.emit("ready")},o.done)})},rf=mu.prototype;We(rf,{instanceString:function(){return"core"},isReady:function(){return this._private.ready},destroyed:function(){return this._private.destroyed},ready:function(e){return this.isReady()?this.emitter().emit("ready",[],e):this.on("ready",e),this},destroy:function(){var e=this;if(!e.destroyed())return e.stopAnimationLoop(),e.destroyRenderer(),this.emit("destroy"),e._private.destroyed=!0,e},hasElementWithId:function(e){return this._private.elements.hasElementWithId(e)},getElementById:function(e){return this._private.elements.getElementById(e)},hasCompoundNodes:function(){return this._private.hasCompoundNodes},headless:function(){return this._private.renderer.isHeadless()},styleEnabled:function(){return this._private.styleEnabled},addToPool:function(e){return this._private.elements.merge(e),this},removeFromPool:function(e){return this._private.elements.unmerge(e),this},container:function(){return this._private.container||null},window:function(){var e=this._private.container;if(e==null)return Zt;var r=this._private.container.ownerDocument;return r===void 0||r==null?Zt:r.defaultView||Zt},mount:function(e){if(e!=null){var r=this,n=r._private,a=n.options;return!Xd(e)&&Xd(e[0])&&(e=e[0]),r.stopAnimationLoop(),r.destroyRenderer(),n.container=e,n.styleEnabled=!0,r.invalidateSize(),r.initRenderer(We({},a,a.renderer,{name:a.renderer.name==="null"?"canvas":a.renderer.name})),r.startAnimationLoop(),r.style(a.style),r.emit("mount"),r}},unmount:function(){var e=this;return e.stopAnimationLoop(),e.destroyRenderer(),e.initRenderer({name:"null"}),e.emit("unmount"),e},options:function(){return sa(this._private.options)},json:function(e){var r=this,n=r._private,a=r.mutableElements(),i=function(w){return r.getElementById(w.id())};if(st(e)){if(r.startBatch(),e.elements){var s={},o=function(w,E){for(var C=[],S=[],T=0;T<w.length;T++){var P=w[T];if(!P.data.id){ht("cy.json() cannot handle elements without an ID attribute");continue}var A=""+P.data.id,j=r.getElementById(A);s[A]=!0,j.length!==0?S.push({ele:j,json:P}):(E&&(P.group=E),C.push(P))}r.add(C);for(var R=0;R<S.length;R++){var O=S[R],N=O.ele,D=O.json;N.json(D)}};if(mt(e.elements))o(e.elements);else for(var l=["nodes","edges"],u=0;u<l.length;u++){var c=l[u],d=e.elements[c];mt(d)&&o(d,c)}var f=r.collection();a.filter(function(b){return!s[b.id()]}).forEach(function(b){b.isParent()?f.merge(b):b.remove()}),f.forEach(function(b){return b.children().move({parent:null})}),f.forEach(function(b){return i(b).remove()})}e.style&&r.style(e.style),e.zoom!=null&&e.zoom!==n.zoom&&r.zoom(e.zoom),e.pan&&(e.pan.x!==n.pan.x||e.pan.y!==n.pan.y)&&r.pan(e.pan),e.data&&r.data(e.data);for(var v=["minZoom","maxZoom","zoomingEnabled","userZoomingEnabled","panningEnabled","userPanningEnabled","boxSelectionEnabled","autolock","autoungrabify","autounselectify","multiClickDebounceTime"],p=0;p<v.length;p++){var y=v[p];e[y]!=null&&r[y](e[y])}return r.endBatch(),this}else{var m=!!e,g={};m?g.elements=this.elements().map(function(b){return b.json()}):(g.elements={},a.forEach(function(b){var w=b.group();g.elements[w]||(g.elements[w]=[]),g.elements[w].push(b.json())})),this._private.styleEnabled&&(g.style=r.style().json()),g.data=sa(r.data());var x=n.options;return g.zoomingEnabled=n.zoomingEnabled,g.userZoomingEnabled=n.userZoomingEnabled,g.zoom=n.zoom,g.minZoom=n.minZoom,g.maxZoom=n.maxZoom,g.panningEnabled=n.panningEnabled,g.userPanningEnabled=n.userPanningEnabled,g.pan=sa(n.pan),g.boxSelectionEnabled=n.boxSelectionEnabled,g.renderer=sa(x.renderer),g.hideEdgesOnViewport=x.hideEdgesOnViewport,g.textureOnViewport=x.textureOnViewport,g.wheelSensitivity=x.wheelSensitivity,g.motionBlur=x.motionBlur,g.multiClickDebounceTime=x.multiClickDebounceTime,g}}});rf.$id=rf.getElementById;[f6,m6,sI,W1,fd,x6,Y1,hd,E6,hs,gu].forEach(function(t){We(rf,t)});var C6={fit:!0,directed:!1,direction:"downward",padding:30,circle:!1,grid:!1,spacingFactor:1.75,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,roots:void 0,depthSort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,r){return!0},ready:void 0,stop:void 0,transform:function(e,r){return r}},N6={maximal:!1,acyclic:!1},ks=function(e){return e.scratch("breadthfirst")},SR=function(e,r){return e.scratch("breadthfirst",r)};function oI(t){this.options=We({},C6,N6,t)}oI.prototype.run=function(){var t=this.options,e=t.cy,r=t.eles,n=r.nodes().filter(function(we){return we.isChildless()}),a=r,i=t.directed,s=t.acyclic||t.maximal||t.maximalAdjustments>0,o=!!t.boundingBox,l=Ir(o?t.boundingBox:structuredClone(e.extent())),u;if(cn(t.roots))u=t.roots;else if(mt(t.roots)){for(var c=[],d=0;d<t.roots.length;d++){var f=t.roots[d],v=e.getElementById(f);c.push(v)}u=e.collection(c)}else if(Ve(t.roots))u=e.$(t.roots);else if(i)u=n.roots();else{var p=r.components();u=e.collection();for(var y=function(){var xe=p[m],Ee=xe.maxDegree(!1),V=xe.filter(function(K){return K.degree(!1)===Ee});u=u.add(V)},m=0;m<p.length;m++)y()}var g=[],x={},b=function(xe,Ee){g[Ee]==null&&(g[Ee]=[]);var V=g[Ee].length;g[Ee].push(xe),SR(xe,{index:V,depth:Ee})},w=function(xe,Ee){var V=ks(xe),K=V.depth,te=V.index;g[K][te]=null,xe.isChildless()&&b(xe,Ee)};a.bfs({roots:u,directed:t.directed,visit:function(xe,Ee,V,K,te){var ue=xe[0],fe=ue.id();ue.isChildless()&&b(ue,te),x[fe]=!0}});for(var E=[],C=0;C<n.length;C++){var S=n[C];x[S.id()]||E.push(S)}var T=function(xe){for(var Ee=g[xe],V=0;V<Ee.length;V++){var K=Ee[V];if(K==null){Ee.splice(V,1),V--;continue}SR(K,{depth:xe,index:V})}},P=function(xe,Ee){for(var V=ks(xe),K=xe.incomers().filter(function(Ce){return Ce.isNode()&&r.has(Ce)}),te=-1,ue=xe.id(),fe=0;fe<K.length;fe++){var ve=K[fe],be=ks(ve);te=Math.max(te,be.depth)}if(V.depth<=te){if(!t.acyclic&&Ee[ue])return null;var Ne=te+1;return w(xe,Ne),Ee[ue]=Ne,!0}return!1};if(i&&s){var A=[],j={},R=function(xe){return A.push(xe)},O=function(){return A.shift()};for(n.forEach(function(we){return A.push(we)});A.length>0;){var N=O(),D=P(N,j);if(D)N.outgoers().filter(function(we){return we.isNode()&&r.has(we)}).forEach(R);else if(D===null){ht("Detected double maximal shift for node `"+N.id()+"`. Bailing maximal adjustment due to cycle. Use `options.maximal: true` only on DAGs.");break}}}var L=0;if(t.avoidOverlap)for(var _=0;_<n.length;_++){var k=n[_],I=k.layoutDimensions(t),F=I.w,B=I.h;L=Math.max(L,F,B)}var $={},W=function(xe){if($[xe.id()])return $[xe.id()];for(var Ee=ks(xe).depth,V=xe.neighborhood(),K=0,te=0,ue=0;ue<V.length;ue++){var fe=V[ue];if(!(fe.isEdge()||fe.isParent()||!n.has(fe))){var ve=ks(fe);if(ve!=null){var be=ve.index,Ne=ve.depth;if(!(be==null||Ne==null)){var Ce=g[Ne].length;Ne<Ee&&(K+=be/Ce,te++)}}}}return te=Math.max(1,te),K=K/te,te===0&&(K=0),$[xe.id()]=K,K},z=function(xe,Ee){var V=W(xe),K=W(Ee),te=V-K;return te===0?lM(xe.id(),Ee.id()):te};t.depthSort!==void 0&&(z=t.depthSort);for(var q=g.length,G=0;G<q;G++)g[G].sort(z),T(G);for(var J=[],ae=0;ae<E.length;ae++)J.push(E[ae]);var Y=function(){for(var xe=0;xe<q;xe++)T(xe)};J.length&&(g.unshift(J),q=g.length,Y());for(var H=0,X=0;X<q;X++)H=Math.max(g[X].length,H);var ee={x:l.x1+l.w/2,y:l.y1+l.h/2},ie=n.reduce(function(we,xe){return function(Ee){return{w:we.w===-1?Ee.w:(we.w+Ee.w)/2,h:we.h===-1?Ee.h:(we.h+Ee.h)/2}}(xe.boundingBox({includeLabels:t.nodeDimensionsIncludeLabels}))},{w:-1,h:-1}),oe=Math.max(q===1?0:o?(l.h-t.padding*2-ie.h)/(q-1):(l.h-t.padding*2-ie.h)/(q+1),L),me=g.reduce(function(we,xe){return Math.max(we,xe.length)},0),De=function(xe){var Ee=ks(xe),V=Ee.depth,K=Ee.index;if(t.circle){var te=Math.min(l.w/2/q,l.h/2/q);te=Math.max(te,L);var ue=te*V+te-(q>0&&g[0].length<=3?te/2:0),fe=2*Math.PI/g[V].length*K;return V===0&&g[0].length===1&&(ue=1),{x:ee.x+ue*Math.cos(fe),y:ee.y+ue*Math.sin(fe)}}else{var ve=g[V].length,be=Math.max(ve===1?0:o?(l.w-t.padding*2-ie.w)/((t.grid?me:ve)-1):(l.w-t.padding*2-ie.w)/((t.grid?me:ve)+1),L),Ne={x:ee.x+(K+1-(ve+1)/2)*be,y:ee.y+(V+1-(q+1)/2)*oe};return Ne}},ge={downward:0,leftward:90,upward:180,rightward:-90};Object.keys(ge).indexOf(t.direction)===-1&&Tt("Invalid direction '".concat(t.direction,"' specified for breadthfirst layout. Valid values are: ").concat(Object.keys(ge).join(", ")));var pe=function(xe){return q$(De(xe),l,ge[t.direction])};return r.nodes().layoutPositions(this,t,pe),this};var T6={fit:!0,padding:30,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,spacingFactor:void 0,radius:void 0,startAngle:3/2*Math.PI,sweep:void 0,clockwise:!0,sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,r){return!0},ready:void 0,stop:void 0,transform:function(e,r){return r}};function lI(t){this.options=We({},T6,t)}lI.prototype.run=function(){var t=this.options,e=t,r=t.cy,n=e.eles,a=e.counterclockwise!==void 0?!e.counterclockwise:e.clockwise,i=n.nodes().not(":parent");e.sort&&(i=i.sort(e.sort));for(var s=Ir(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()}),o={x:s.x1+s.w/2,y:s.y1+s.h/2},l=e.sweep===void 0?2*Math.PI-2*Math.PI/i.length:e.sweep,u=l/Math.max(1,i.length-1),c,d=0,f=0;f<i.length;f++){var v=i[f],p=v.layoutDimensions(e),y=p.w,m=p.h;d=Math.max(d,y,m)}if(_e(e.radius)?c=e.radius:i.length<=1?c=0:c=Math.min(s.h,s.w)/2-d,i.length>1&&e.avoidOverlap){d*=1.75;var g=Math.cos(u)-Math.cos(0),x=Math.sin(u)-Math.sin(0),b=Math.sqrt(d*d/(g*g+x*x));c=Math.max(b,c)}var w=function(C,S){var T=e.startAngle+S*u*(a?1:-1),P=c*Math.cos(T),A=c*Math.sin(T),j={x:o.x+P,y:o.y+A};return j};return n.nodes().layoutPositions(this,e,w),this};var R6={fit:!0,padding:30,startAngle:3/2*Math.PI,sweep:void 0,clockwise:!0,equidistant:!1,minNodeSpacing:10,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,height:void 0,width:void 0,spacingFactor:void 0,concentric:function(e){return e.degree()},levelWidth:function(e){return e.maxDegree()/4},animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,r){return!0},ready:void 0,stop:void 0,transform:function(e,r){return r}};function uI(t){this.options=We({},R6,t)}uI.prototype.run=function(){for(var t=this.options,e=t,r=e.counterclockwise!==void 0?!e.counterclockwise:e.clockwise,n=t.cy,a=e.eles,i=a.nodes().not(":parent"),s=Ir(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:n.width(),h:n.height()}),o={x:s.x1+s.w/2,y:s.y1+s.h/2},l=[],u=0,c=0;c<i.length;c++){var d=i[c],f=void 0;f=e.concentric(d),l.push({value:f,node:d}),d._private.scratch.concentric=f}i.updateStyle();for(var v=0;v<i.length;v++){var p=i[v],y=p.layoutDimensions(e);u=Math.max(u,y.w,y.h)}l.sort(function(oe,me){return me.value-oe.value});for(var m=e.levelWidth(i),g=[[]],x=g[0],b=0;b<l.length;b++){var w=l[b];if(x.length>0){var E=Math.abs(x[0].value-w.value);E>=m&&(x=[],g.push(x))}x.push(w)}var C=u+e.minNodeSpacing;if(!e.avoidOverlap){var S=g.length>0&&g[0].length>1,T=Math.min(s.w,s.h)/2-C,P=T/(g.length+S?1:0);C=Math.min(C,P)}for(var A=0,j=0;j<g.length;j++){var R=g[j],O=e.sweep===void 0?2*Math.PI-2*Math.PI/R.length:e.sweep,N=R.dTheta=O/Math.max(1,R.length-1);if(R.length>1&&e.avoidOverlap){var D=Math.cos(N)-Math.cos(0),L=Math.sin(N)-Math.sin(0),_=Math.sqrt(C*C/(D*D+L*L));A=Math.max(_,A)}R.r=A,A+=C}if(e.equidistant){for(var k=0,I=0,F=0;F<g.length;F++){var B=g[F],$=B.r-I;k=Math.max(k,$)}I=0;for(var W=0;W<g.length;W++){var z=g[W];W===0&&(I=z.r),z.r=I,I+=k}}for(var q={},G=0;G<g.length;G++)for(var J=g[G],ae=J.dTheta,Y=J.r,H=0;H<J.length;H++){var X=J[H],ee=e.startAngle+(r?1:-1)*ae*H,ie={x:o.x+Y*Math.cos(ee),y:o.y+Y*Math.sin(ee)};q[X.node.id()]=ie}return a.nodes().layoutPositions(this,e,function(oe){var me=oe.id();return q[me]}),this};var Bp,P6={ready:function(){},stop:function(){},animate:!0,animationEasing:void 0,animationDuration:void 0,animateFilter:function(e,r){return!0},animationThreshold:250,refresh:20,fit:!0,padding:30,boundingBox:void 0,nodeDimensionsIncludeLabels:!1,randomize:!1,componentSpacing:40,nodeRepulsion:function(e){return 2048},nodeOverlap:4,idealEdgeLength:function(e){return 32},edgeElasticity:function(e){return 32},nestingFactor:1.2,gravity:1,numIter:1e3,initialTemp:1e3,coolingFactor:.99,minTemp:1};function oh(t){this.options=We({},P6,t),this.options.layout=this;var e=this.options.eles.nodes(),r=this.options.eles.edges(),n=r.filter(function(a){var i=a.source().data("id"),s=a.target().data("id"),o=e.some(function(u){return u.data("id")===i}),l=e.some(function(u){return u.data("id")===s});return!o||!l});this.options.eles=this.options.eles.not(n)}oh.prototype.run=function(){var t=this.options,e=t.cy,r=this;r.stopped=!1,(t.animate===!0||t.animate===!1)&&r.emit({type:"layoutstart",layout:r}),t.debug===!0?Bp=!0:Bp=!1;var n=A6(e,r,t);Bp&&L6(n),t.randomize&&D6(n);var a=Da(),i=function(){_6(n,e,t),t.fit===!0&&e.fit(t.padding)},s=function(f){return!(r.stopped||f>=t.numIter||(j6(n,t),n.temperature=n.temperature*t.coolingFactor,n.temperature<t.minTemp))},o=function(){if(t.animate===!0||t.animate===!1)i(),r.one("layoutstop",t.stop),r.emit({type:"layoutstop",layout:r});else{var f=t.eles.nodes(),v=dI(n,t,f);f.layoutPositions(r,t,v)}},l=0,u=!0;if(t.animate===!0){var c=function(){for(var f=0;u&&f<t.refresh;)u=s(l),l++,f++;if(!u)NR(n,t),o();else{var v=Da();v-a>=t.animationThreshold&&i(),Kd(c)}};c()}else{for(;u;)u=s(l),l++;NR(n,t),o()}return this};oh.prototype.stop=function(){return this.stopped=!0,this.thread&&this.thread.stop(),this.emit("layoutstop"),this};oh.prototype.destroy=function(){return this.thread&&this.thread.stop(),this};var A6=function(e,r,n){for(var a=n.eles.edges(),i=n.eles.nodes(),s=Ir(n.boundingBox?n.boundingBox:{x1:0,y1:0,w:e.width(),h:e.height()}),o={isCompound:e.hasCompoundNodes(),layoutNodes:[],idToIndex:{},nodeSize:i.size(),graphSet:[],indexToGraph:[],layoutEdges:[],edgeSize:a.size(),temperature:n.initialTemp,clientWidth:s.w,clientHeight:s.h,boundingBox:s},l=n.eles.components(),u={},c=0;c<l.length;c++)for(var d=l[c],f=0;f<d.length;f++){var v=d[f];u[v.id()]=c}for(var c=0;c<o.nodeSize;c++){var p=i[c],y=p.layoutDimensions(n),m={};m.isLocked=p.locked(),m.id=p.data("id"),m.parentId=p.data("parent"),m.cmptId=u[p.id()],m.children=[],m.positionX=p.position("x"),m.positionY=p.position("y"),m.offsetX=0,m.offsetY=0,m.height=y.w,m.width=y.h,m.maxX=m.positionX+m.width/2,m.minX=m.positionX-m.width/2,m.maxY=m.positionY+m.height/2,m.minY=m.positionY-m.height/2,m.padLeft=parseFloat(p.style("padding")),m.padRight=parseFloat(p.style("padding")),m.padTop=parseFloat(p.style("padding")),m.padBottom=parseFloat(p.style("padding")),m.nodeRepulsion=Dt(n.nodeRepulsion)?n.nodeRepulsion(p):n.nodeRepulsion,o.layoutNodes.push(m),o.idToIndex[m.id]=c}for(var g=[],x=0,b=-1,w=[],c=0;c<o.nodeSize;c++){var p=o.layoutNodes[c],E=p.parentId;E!=null?o.layoutNodes[o.idToIndex[E]].children.push(p.id):(g[++b]=p.id,w.push(p.id))}for(o.graphSet.push(w);x<=b;){var C=g[x++],S=o.idToIndex[C],v=o.layoutNodes[S],T=v.children;if(T.length>0){o.graphSet.push(T);for(var c=0;c<T.length;c++)g[++b]=T[c]}}for(var c=0;c<o.graphSet.length;c++)for(var P=o.graphSet[c],f=0;f<P.length;f++){var A=o.idToIndex[P[f]];o.indexToGraph[A]=c}for(var c=0;c<o.edgeSize;c++){var j=a[c],R={};R.id=j.data("id"),R.sourceId=j.data("source"),R.targetId=j.data("target");var O=Dt(n.idealEdgeLength)?n.idealEdgeLength(j):n.idealEdgeLength,N=Dt(n.edgeElasticity)?n.edgeElasticity(j):n.edgeElasticity,D=o.idToIndex[R.sourceId],L=o.idToIndex[R.targetId],_=o.indexToGraph[D],k=o.indexToGraph[L];if(_!=k){for(var I=k6(R.sourceId,R.targetId,o),F=o.graphSet[I],B=0,m=o.layoutNodes[D];F.indexOf(m.id)===-1;)m=o.layoutNodes[o.idToIndex[m.parentId]],B++;for(m=o.layoutNodes[L];F.indexOf(m.id)===-1;)m=o.layoutNodes[o.idToIndex[m.parentId]],B++;O*=B*n.nestingFactor}R.idealLength=O,R.elasticity=N,o.layoutEdges.push(R)}return o},k6=function(e,r,n){var a=cI(e,r,0,n);return 2>a.count?0:a.graph},cI=function(e,r,n,a){var i=a.graphSet[n];if(-1<i.indexOf(e)&&-1<i.indexOf(r))return{count:2,graph:n};for(var s=0,o=0;o<i.length;o++){var l=i[o],u=a.idToIndex[l],c=a.layoutNodes[u].children;if(c.length!==0){var d=a.indexToGraph[a.idToIndex[c[0]]],f=cI(e,r,d,a);if(f.count!==0)if(f.count===1){if(s++,s===2)break}else return f}}return{count:s,graph:n}},L6,D6=function(e,r){for(var n=e.clientWidth,a=e.clientHeight,i=0;i<e.nodeSize;i++){var s=e.layoutNodes[i];s.children.length===0&&!s.isLocked&&(s.positionX=Math.random()*n,s.positionY=Math.random()*a)}},dI=function(e,r,n){var a=e.boundingBox,i={x1:1/0,x2:-1/0,y1:1/0,y2:-1/0};return r.boundingBox&&(n.forEach(function(s){var o=e.layoutNodes[e.idToIndex[s.data("id")]];i.x1=Math.min(i.x1,o.positionX),i.x2=Math.max(i.x2,o.positionX),i.y1=Math.min(i.y1,o.positionY),i.y2=Math.max(i.y2,o.positionY)}),i.w=i.x2-i.x1,i.h=i.y2-i.y1),function(s,o){var l=e.layoutNodes[e.idToIndex[s.data("id")]];if(r.boundingBox){var u=i.w===0?.5:(l.positionX-i.x1)/i.w,c=i.h===0?.5:(l.positionY-i.y1)/i.h;return{x:a.x1+u*a.w,y:a.y1+c*a.h}}else return{x:l.positionX,y:l.positionY}}},_6=function(e,r,n){var a=n.layout,i=n.eles.nodes(),s=dI(e,n,i);i.positions(s),e.ready!==!0&&(e.ready=!0,a.one("layoutready",n.ready),a.emit({type:"layoutready",layout:this}))},j6=function(e,r,n){O6(e,r),F6(e),B6(e,r),z6(e),q6(e)},O6=function(e,r){for(var n=0;n<e.graphSet.length;n++)for(var a=e.graphSet[n],i=a.length,s=0;s<i;s++)for(var o=e.layoutNodes[e.idToIndex[a[s]]],l=s+1;l<i;l++){var u=e.layoutNodes[e.idToIndex[a[l]]];M6(o,u,e,r)}},CR=function(e){return-1+2*e*Math.random()},M6=function(e,r,n,a){var i=e.cmptId,s=r.cmptId;if(!(i!==s&&!n.isCompound)){var o=r.positionX-e.positionX,l=r.positionY-e.positionY,u=1;o===0&&l===0&&(o=CR(u),l=CR(u));var c=I6(e,r,o,l);if(c>0)var d=a.nodeOverlap*c,f=Math.sqrt(o*o+l*l),v=d*o/f,p=d*l/f;else var y=nf(e,o,l),m=nf(r,-1*o,-1*l),g=m.x-y.x,x=m.y-y.y,b=g*g+x*x,f=Math.sqrt(b),d=(e.nodeRepulsion+r.nodeRepulsion)/b,v=d*g/f,p=d*x/f;e.isLocked||(e.offsetX-=v,e.offsetY-=p),r.isLocked||(r.offsetX+=v,r.offsetY+=p)}},I6=function(e,r,n,a){if(n>0)var i=e.maxX-r.minX;else var i=r.maxX-e.minX;if(a>0)var s=e.maxY-r.minY;else var s=r.maxY-e.minY;return i>=0&&s>=0?Math.sqrt(i*i+s*s):0},nf=function(e,r,n){var a=e.positionX,i=e.positionY,s=e.height||1,o=e.width||1,l=n/r,u=s/o,c={};return r===0&&0<n||r===0&&0>n?(c.x=a,c.y=i+s/2,c):0<r&&-1*u<=l&&l<=u?(c.x=a+o/2,c.y=i+o*n/2/r,c):0>r&&-1*u<=l&&l<=u?(c.x=a-o/2,c.y=i-o*n/2/r,c):0<n&&(l<=-1*u||l>=u)?(c.x=a+s*r/2/n,c.y=i+s/2,c):(0>n&&(l<=-1*u||l>=u)&&(c.x=a-s*r/2/n,c.y=i-s/2),c)},F6=function(e,r){for(var n=0;n<e.edgeSize;n++){var a=e.layoutEdges[n],i=e.idToIndex[a.sourceId],s=e.layoutNodes[i],o=e.idToIndex[a.targetId],l=e.layoutNodes[o],u=l.positionX-s.positionX,c=l.positionY-s.positionY;if(!(u===0&&c===0)){var d=nf(s,u,c),f=nf(l,-1*u,-1*c),v=f.x-d.x,p=f.y-d.y,y=Math.sqrt(v*v+p*p),m=Math.pow(a.idealLength-y,2)/a.elasticity;if(y!==0)var g=m*v/y,x=m*p/y;else var g=0,x=0;s.isLocked||(s.offsetX+=g,s.offsetY+=x),l.isLocked||(l.offsetX-=g,l.offsetY-=x)}}},B6=function(e,r){if(r.gravity!==0)for(var n=1,a=0;a<e.graphSet.length;a++){var i=e.graphSet[a],s=i.length;if(a===0)var o=e.clientHeight/2,l=e.clientWidth/2;else var u=e.layoutNodes[e.idToIndex[i[0]]],c=e.layoutNodes[e.idToIndex[u.parentId]],o=c.positionX,l=c.positionY;for(var d=0;d<s;d++){var f=e.layoutNodes[e.idToIndex[i[d]]];if(!f.isLocked){var v=o-f.positionX,p=l-f.positionY,y=Math.sqrt(v*v+p*p);if(y>n){var m=r.gravity*v/y,g=r.gravity*p/y;f.offsetX+=m,f.offsetY+=g}}}}},z6=function(e,r){var n=[],a=0,i=-1;for(n.push.apply(n,e.graphSet[0]),i+=e.graphSet[0].length;a<=i;){var s=n[a++],o=e.idToIndex[s],l=e.layoutNodes[o],u=l.children;if(0<u.length&&!l.isLocked){for(var c=l.offsetX,d=l.offsetY,f=0;f<u.length;f++){var v=e.layoutNodes[e.idToIndex[u[f]]];v.offsetX+=c,v.offsetY+=d,n[++i]=u[f]}l.offsetX=0,l.offsetY=0}}},q6=function(e,r){for(var n=0;n<e.nodeSize;n++){var a=e.layoutNodes[n];0<a.children.length&&(a.maxX=void 0,a.minX=void 0,a.maxY=void 0,a.minY=void 0)}for(var n=0;n<e.nodeSize;n++){var a=e.layoutNodes[n];if(!(0<a.children.length||a.isLocked)){var i=U6(a.offsetX,a.offsetY,e.temperature);a.positionX+=i.x,a.positionY+=i.y,a.offsetX=0,a.offsetY=0,a.minX=a.positionX-a.width,a.maxX=a.positionX+a.width,a.minY=a.positionY-a.height,a.maxY=a.positionY+a.height,fI(a,e)}}for(var n=0;n<e.nodeSize;n++){var a=e.layoutNodes[n];0<a.children.length&&!a.isLocked&&(a.positionX=(a.maxX+a.minX)/2,a.positionY=(a.maxY+a.minY)/2,a.width=a.maxX-a.minX,a.height=a.maxY-a.minY)}},U6=function(e,r,n){var a=Math.sqrt(e*e+r*r);if(a>n)var i={x:n*e/a,y:n*r/a};else var i={x:e,y:r};return i},fI=function(e,r){var n=e.parentId;if(n!=null){var a=r.layoutNodes[r.idToIndex[n]],i=!1;if((a.maxX==null||e.maxX+a.padRight>a.maxX)&&(a.maxX=e.maxX+a.padRight,i=!0),(a.minX==null||e.minX-a.padLeft<a.minX)&&(a.minX=e.minX-a.padLeft,i=!0),(a.maxY==null||e.maxY+a.padBottom>a.maxY)&&(a.maxY=e.maxY+a.padBottom,i=!0),(a.minY==null||e.minY-a.padTop<a.minY)&&(a.minY=e.minY-a.padTop,i=!0),i)return fI(a,r)}},NR=function(e,r){for(var n=e.layoutNodes,a=[],i=0;i<n.length;i++){var s=n[i],o=s.cmptId,l=a[o]=a[o]||[];l.push(s)}for(var u=0,i=0;i<a.length;i++){var c=a[i];if(c){c.x1=1/0,c.x2=-1/0,c.y1=1/0,c.y2=-1/0;for(var d=0;d<c.length;d++){var f=c[d];c.x1=Math.min(c.x1,f.positionX-f.width/2),c.x2=Math.max(c.x2,f.positionX+f.width/2),c.y1=Math.min(c.y1,f.positionY-f.height/2),c.y2=Math.max(c.y2,f.positionY+f.height/2)}c.w=c.x2-c.x1,c.h=c.y2-c.y1,u+=c.w*c.h}}a.sort(function(x,b){return b.w*b.h-x.w*x.h});for(var v=0,p=0,y=0,m=0,g=Math.sqrt(u)*e.clientWidth/e.clientHeight,i=0;i<a.length;i++){var c=a[i];if(c){for(var d=0;d<c.length;d++){var f=c[d];f.isLocked||(f.positionX+=v-c.x1,f.positionY+=p-c.y1)}v+=c.w+r.componentSpacing,y+=c.w+r.componentSpacing,m=Math.max(m,c.h),y>g&&(p+=m+r.componentSpacing,v=0,y=0,m=0)}}},$6={fit:!0,padding:30,boundingBox:void 0,avoidOverlap:!0,avoidOverlapPadding:10,nodeDimensionsIncludeLabels:!1,spacingFactor:void 0,condense:!1,rows:void 0,cols:void 0,position:function(e){},sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,r){return!0},ready:void 0,stop:void 0,transform:function(e,r){return r}};function hI(t){this.options=We({},$6,t)}hI.prototype.run=function(){var t=this.options,e=t,r=t.cy,n=e.eles,a=n.nodes().not(":parent");e.sort&&(a=a.sort(e.sort));var i=Ir(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()});if(i.h===0||i.w===0)n.nodes().layoutPositions(this,e,function(W){return{x:i.x1,y:i.y1}});else{var s=a.size(),o=Math.sqrt(s*i.h/i.w),l=Math.round(o),u=Math.round(i.w/i.h*o),c=function(z){if(z==null)return Math.min(l,u);var q=Math.min(l,u);q==l?l=z:u=z},d=function(z){if(z==null)return Math.max(l,u);var q=Math.max(l,u);q==l?l=z:u=z},f=e.rows,v=e.cols!=null?e.cols:e.columns;if(f!=null&&v!=null)l=f,u=v;else if(f!=null&&v==null)l=f,u=Math.ceil(s/l);else if(f==null&&v!=null)u=v,l=Math.ceil(s/u);else if(u*l>s){var p=c(),y=d();(p-1)*y>=s?c(p-1):(y-1)*p>=s&&d(y-1)}else for(;u*l<s;){var m=c(),g=d();(g+1)*m>=s?d(g+1):c(m+1)}var x=i.w/u,b=i.h/l;if(e.condense&&(x=0,b=0),e.avoidOverlap)for(var w=0;w<a.length;w++){var E=a[w],C=E._private.position;(C.x==null||C.y==null)&&(C.x=0,C.y=0);var S=E.layoutDimensions(e),T=e.avoidOverlapPadding,P=S.w+T,A=S.h+T;x=Math.max(x,P),b=Math.max(b,A)}for(var j={},R=function(z,q){return!!j["c-"+z+"-"+q]},O=function(z,q){j["c-"+z+"-"+q]=!0},N=0,D=0,L=function(){D++,D>=u&&(D=0,N++)},_={},k=0;k<a.length;k++){var I=a[k],F=e.position(I);if(F&&(F.row!==void 0||F.col!==void 0)){var B={row:F.row,col:F.col};if(B.col===void 0)for(B.col=0;R(B.row,B.col);)B.col++;else if(B.row===void 0)for(B.row=0;R(B.row,B.col);)B.row++;_[I.id()]=B,O(B.row,B.col)}}var $=function(z,q){var G,J;if(z.locked()||z.isParent())return!1;var ae=_[z.id()];if(ae)G=ae.col*x+x/2+i.x1,J=ae.row*b+b/2+i.y1;else{for(;R(N,D);)L();G=D*x+x/2+i.x1,J=N*b+b/2+i.y1,O(N,D),L()}return{x:G,y:J}};a.layoutPositions(this,e,$)}return this};var V6={ready:function(){},stop:function(){}};function KE(t){this.options=We({},V6,t)}KE.prototype.run=function(){var t=this.options,e=t.eles,r=this;return t.cy,r.emit("layoutstart"),e.nodes().positions(function(){return{x:0,y:0}}),r.one("layoutready",t.ready),r.emit("layoutready"),r.one("layoutstop",t.stop),r.emit("layoutstop"),this};KE.prototype.stop=function(){return this};var G6={positions:void 0,zoom:void 0,pan:void 0,fit:!0,padding:30,spacingFactor:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,r){return!0},ready:void 0,stop:void 0,transform:function(e,r){return r}};function vI(t){this.options=We({},G6,t)}vI.prototype.run=function(){var t=this.options,e=t.eles,r=e.nodes(),n=Dt(t.positions);function a(i){if(t.positions==null)return hV(i.position());if(n)return t.positions(i);var s=t.positions[i._private.data.id];return s??null}return r.layoutPositions(this,t,function(i,s){var o=a(i);return i.locked()||o==null?!1:o}),this};var H6={fit:!0,padding:30,boundingBox:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,r){return!0},ready:void 0,stop:void 0,transform:function(e,r){return r}};function pI(t){this.options=We({},H6,t)}pI.prototype.run=function(){var t=this.options,e=t.cy,r=t.eles,n=Ir(t.boundingBox?t.boundingBox:{x1:0,y1:0,w:e.width(),h:e.height()}),a=function(s,o){return{x:n.x1+Math.round(Math.random()*n.w),y:n.y1+Math.round(Math.random()*n.h)}};return r.nodes().layoutPositions(this,t,a),this};var W6=[{name:"breadthfirst",impl:oI},{name:"circle",impl:lI},{name:"concentric",impl:uI},{name:"cose",impl:oh},{name:"grid",impl:hI},{name:"null",impl:KE},{name:"preset",impl:vI},{name:"random",impl:pI}];function gI(t){this.options=t,this.notifications=0}var TR=function(){},RR=function(){throw new Error("A headless instance can not render images")};gI.prototype={recalculateRenderedStyle:TR,notify:function(){this.notifications++},init:TR,isHeadless:function(){return!0},png:RR,jpg:RR};var QE={};QE.arrowShapeWidth=.3;QE.registerArrowShapes=function(){var t=this.arrowShapes={},e=this,r=function(u,c,d,f,v,p,y){var m=v.x-d/2-y,g=v.x+d/2+y,x=v.y-d/2-y,b=v.y+d/2+y,w=m<=u&&u<=g&&x<=c&&c<=b;return w},n=function(u,c,d,f,v){var p=u*Math.cos(f)-c*Math.sin(f),y=u*Math.sin(f)+c*Math.cos(f),m=p*d,g=y*d,x=m+v.x,b=g+v.y;return{x,y:b}},a=function(u,c,d,f){for(var v=[],p=0;p<u.length;p+=2){var y=u[p],m=u[p+1];v.push(n(y,m,c,d,f))}return v},i=function(u){for(var c=[],d=0;d<u.length;d++){var f=u[d];c.push(f.x,f.y)}return c},s=function(u){return u.pstyle("width").pfValue*u.pstyle("arrow-scale").pfValue*2},o=function(u,c){Ve(c)&&(c=t[c]),t[u]=We({name:u,points:[-.15,-.3,.15,-.3,.15,.3,-.15,.3],collide:function(f,v,p,y,m,g){var x=i(a(this.points,p+2*g,y,m)),b=Wr(f,v,x);return b},roughCollide:r,draw:function(f,v,p,y){var m=a(this.points,v,p,y);e.arrowShapeImpl("polygon")(f,m)},spacing:function(f){return 0},gap:s},c)};o("none",{collide:Qd,roughCollide:Qd,draw:ME,spacing:qN,gap:qN}),o("triangle",{points:[-.15,-.3,0,0,.15,-.3]}),o("arrow","triangle"),o("triangle-backcurve",{points:t.triangle.points,controlPoint:[0,-.15],roughCollide:r,draw:function(u,c,d,f,v){var p=a(this.points,c,d,f),y=this.controlPoint,m=n(y[0],y[1],c,d,f);e.arrowShapeImpl(this.name)(u,p,m)},gap:function(u){return s(u)*.8}}),o("triangle-tee",{points:[0,0,.15,-.3,-.15,-.3,0,0],pointsTee:[-.15,-.4,-.15,-.5,.15,-.5,.15,-.4],collide:function(u,c,d,f,v,p,y){var m=i(a(this.points,d+2*y,f,v)),g=i(a(this.pointsTee,d+2*y,f,v)),x=Wr(u,c,m)||Wr(u,c,g);return x},draw:function(u,c,d,f,v){var p=a(this.points,c,d,f),y=a(this.pointsTee,c,d,f);e.arrowShapeImpl(this.name)(u,p,y)}}),o("circle-triangle",{radius:.15,pointsTr:[0,-.15,.15,-.45,-.15,-.45,0,-.15],collide:function(u,c,d,f,v,p,y){var m=v,g=Math.pow(m.x-u,2)+Math.pow(m.y-c,2)<=Math.pow((d+2*y)*this.radius,2),x=i(a(this.points,d+2*y,f,v));return Wr(u,c,x)||g},draw:function(u,c,d,f,v){var p=a(this.pointsTr,c,d,f);e.arrowShapeImpl(this.name)(u,p,f.x,f.y,this.radius*c)},spacing:function(u){return e.getArrowWidth(u.pstyle("width").pfValue,u.pstyle("arrow-scale").value)*this.radius}}),o("triangle-cross",{points:[0,0,.15,-.3,-.15,-.3,0,0],baseCrossLinePts:[-.15,-.4,-.15,-.4,.15,-.4,.15,-.4],crossLinePts:function(u,c){var d=this.baseCrossLinePts.slice(),f=c/u,v=3,p=5;return d[v]=d[v]-f,d[p]=d[p]-f,d},collide:function(u,c,d,f,v,p,y){var m=i(a(this.points,d+2*y,f,v)),g=i(a(this.crossLinePts(d,p),d+2*y,f,v)),x=Wr(u,c,m)||Wr(u,c,g);return x},draw:function(u,c,d,f,v){var p=a(this.points,c,d,f),y=a(this.crossLinePts(c,v),c,d,f);e.arrowShapeImpl(this.name)(u,p,y)}}),o("vee",{points:[-.15,-.3,0,0,.15,-.3,0,-.15],gap:function(u){return s(u)*.525}}),o("circle",{radius:.15,collide:function(u,c,d,f,v,p,y){var m=v,g=Math.pow(m.x-u,2)+Math.pow(m.y-c,2)<=Math.pow((d+2*y)*this.radius,2);return g},draw:function(u,c,d,f,v){e.arrowShapeImpl(this.name)(u,f.x,f.y,this.radius*c)},spacing:function(u){return e.getArrowWidth(u.pstyle("width").pfValue,u.pstyle("arrow-scale").value)*this.radius}}),o("tee",{points:[-.15,0,-.15,-.1,.15,-.1,.15,0],spacing:function(u){return 1},gap:function(u){return 1}}),o("square",{points:[-.15,0,.15,0,.15,-.3,-.15,-.3]}),o("diamond",{points:[-.15,-.15,0,-.3,.15,-.15,0,0],gap:function(u){return u.pstyle("width").pfValue*u.pstyle("arrow-scale").value}}),o("chevron",{points:[0,0,-.15,-.15,-.1,-.2,0,-.1,.1,-.2,.15,-.15],gap:function(u){return .95*u.pstyle("width").pfValue*u.pstyle("arrow-scale").value}})};var bs={};bs.projectIntoViewport=function(t,e){var r=this.cy,n=this.findContainerClientCoords(),a=n[0],i=n[1],s=n[4],o=r.pan(),l=r.zoom(),u=((t-a)/s-o.x)/l,c=((e-i)/s-o.y)/l;return[u,c]};bs.findContainerClientCoords=function(){if(this.containerBB)return this.containerBB;var t=this.container,e=t.getBoundingClientRect(),r=this.cy.window().getComputedStyle(t),n=function(g){return parseFloat(r.getPropertyValue(g))},a={left:n("padding-left"),right:n("padding-right"),top:n("padding-top"),bottom:n("padding-bottom")},i={left:n("border-left-width"),right:n("border-right-width"),top:n("border-top-width"),bottom:n("border-bottom-width")},s=t.clientWidth,o=t.clientHeight,l=a.left+a.right,u=a.top+a.bottom,c=i.left+i.right,d=e.width/(s+c),f=s-l,v=o-u,p=e.left+a.left+i.left,y=e.top+a.top+i.top;return this.containerBB=[p,y,f,v,d]};bs.invalidateContainerClientCoordsCache=function(){this.containerBB=null};bs.findNearestElement=function(t,e,r,n){return this.findNearestElements(t,e,r,n)[0]};bs.findNearestElements=function(t,e,r,n){var a=this,i=this,s=i.getCachedZSortedEles(),o=[],l=i.cy.zoom(),u=i.cy.hasCompoundNodes(),c=(n?24:8)/l,d=(n?8:2)/l,f=(n?8:2)/l,v=1/0,p,y;r&&(s=s.interactive);function m(S,T){if(S.isNode()){if(y)return;y=S,o.push(S)}if(S.isEdge()&&(T==null||T<v))if(p){if(p.pstyle("z-compound-depth").value===S.pstyle("z-compound-depth").value&&p.pstyle("z-compound-depth").value===S.pstyle("z-compound-depth").value){for(var P=0;P<o.length;P++)if(o[P].isEdge()){o[P]=S,p=S,v=T??v;break}}}else o.push(S),p=S,v=T??v}function g(S){var T=S.outerWidth()+2*d,P=S.outerHeight()+2*d,A=T/2,j=P/2,R=S.position(),O=S.pstyle("corner-radius").value==="auto"?"auto":S.pstyle("corner-radius").pfValue,N=S._private.rscratch;if(R.x-A<=t&&t<=R.x+A&&R.y-j<=e&&e<=R.y+j){var D=i.nodeShapes[a.getNodeShape(S)];if(D.checkPoint(t,e,0,T,P,R.x,R.y,O,N))return m(S,0),!0}}function x(S){var T=S._private,P=T.rscratch,A=S.pstyle("width").pfValue,j=S.pstyle("arrow-scale").value,R=A/2+c,O=R*R,N=R*2,k=T.source,I=T.target,D;if(P.edgeType==="segments"||P.edgeType==="straight"||P.edgeType==="haystack"){for(var L=P.allpts,_=0;_+3<L.length;_+=2)if(RV(t,e,L[_],L[_+1],L[_+2],L[_+3],N)&&O>(D=DV(t,e,L[_],L[_+1],L[_+2],L[_+3])))return m(S,D),!0}else if(P.edgeType==="bezier"||P.edgeType==="multibezier"||P.edgeType==="self"||P.edgeType==="compound"){for(var L=P.allpts,_=0;_+5<P.allpts.length;_+=4)if(PV(t,e,L[_],L[_+1],L[_+2],L[_+3],L[_+4],L[_+5],N)&&O>(D=LV(t,e,L[_],L[_+1],L[_+2],L[_+3],L[_+4],L[_+5])))return m(S,D),!0}for(var k=k||T.source,I=I||T.target,F=a.getArrowWidth(A,j),B=[{name:"source",x:P.arrowStartX,y:P.arrowStartY,angle:P.srcArrowAngle},{name:"target",x:P.arrowEndX,y:P.arrowEndY,angle:P.tgtArrowAngle},{name:"mid-source",x:P.midX,y:P.midY,angle:P.midsrcArrowAngle},{name:"mid-target",x:P.midX,y:P.midY,angle:P.midtgtArrowAngle}],_=0;_<B.length;_++){var $=B[_],W=i.arrowShapes[S.pstyle($.name+"-arrow-shape").value],z=S.pstyle("width").pfValue;if(W.roughCollide(t,e,F,$.angle,{x:$.x,y:$.y},z,c)&&W.collide(t,e,F,$.angle,{x:$.x,y:$.y},z,c))return m(S),!0}u&&o.length>0&&(g(k),g(I))}function b(S,T,P){return Hr(S,T,P)}function w(S,T){var P=S._private,A=f,j;T?j=T+"-":j="",S.boundingBox();var R=P.labelBounds[T||"main"],O=S.pstyle(j+"label").value,N=S.pstyle("text-events").strValue==="yes";if(!(!N||!O)){var D=b(P.rscratch,"labelX",T),L=b(P.rscratch,"labelY",T),_=b(P.rscratch,"labelAngle",T),k=S.pstyle(j+"text-margin-x").pfValue,I=S.pstyle(j+"text-margin-y").pfValue,F=R.x1-A-k,B=R.x2+A-k,$=R.y1-A-I,W=R.y2+A-I;if(_){var z=Math.cos(_),q=Math.sin(_),G=function(ie,oe){return ie=ie-D,oe=oe-L,{x:ie*z-oe*q+D,y:ie*q+oe*z+L}},J=G(F,$),ae=G(F,W),Y=G(B,$),H=G(B,W),X=[J.x+k,J.y+I,Y.x+k,Y.y+I,H.x+k,H.y+I,ae.x+k,ae.y+I];if(Wr(t,e,X))return m(S),!0}else if(ai(R,t,e))return m(S),!0}}for(var E=s.length-1;E>=0;E--){var C=s[E];C.isNode()?g(C)||w(C):x(C)||w(C)||w(C,"source")||w(C,"target")}return o};bs.getAllInBox=function(t,e,r,n){var a=this.getCachedZSortedEles().interactive,i=this.cy.zoom(),s=2/i,o=[],l=Math.min(t,r),u=Math.max(t,r),c=Math.min(e,n),d=Math.max(e,n);t=l,r=u,e=c,n=d;var f=Ir({x1:t,y1:e,x2:r,y2:n}),v=[{x:f.x1,y:f.y1},{x:f.x2,y:f.y1},{x:f.x2,y:f.y2},{x:f.x1,y:f.y2}],p=[[v[0],v[1]],[v[1],v[2]],[v[2],v[3]],[v[3],v[0]]];function y(ie,oe,me){return Hr(ie,oe,me)}function m(ie,oe){var me=ie._private,De=s,ge="";ie.boundingBox();var pe=me.labelBounds.main;if(!pe)return null;var we=y(me.rscratch,"labelX",oe),xe=y(me.rscratch,"labelY",oe),Ee=y(me.rscratch,"labelAngle",oe),V=ie.pstyle(ge+"text-margin-x").pfValue,K=ie.pstyle(ge+"text-margin-y").pfValue,te=pe.x1-De-V,ue=pe.x2+De-V,fe=pe.y1-De-K,ve=pe.y2+De-K;if(Ee){var be=Math.cos(Ee),Ne=Math.sin(Ee),Ce=function(Z,M){return Z=Z-we,M=M-xe,{x:Z*be-M*Ne+we,y:Z*Ne+M*be+xe}};return[Ce(te,fe),Ce(ue,fe),Ce(ue,ve),Ce(te,ve)]}else return[{x:te,y:fe},{x:ue,y:fe},{x:ue,y:ve},{x:te,y:ve}]}function g(ie,oe,me,De){function ge(pe,we,xe){return(xe.y-pe.y)*(we.x-pe.x)>(we.y-pe.y)*(xe.x-pe.x)}return ge(ie,me,De)!==ge(oe,me,De)&&ge(ie,oe,me)!==ge(ie,oe,De)}for(var x=0;x<a.length;x++){var b=a[x];if(b.isNode()){var w=b,E=w.pstyle("text-events").strValue==="yes",C=w.pstyle("box-selection").strValue,S=w.pstyle("box-select-labels").strValue==="yes";if(C==="none")continue;var T=(C==="overlap"||S)&&E,P=w.boundingBox({includeNodes:!0,includeEdges:!1,includeLabels:T});if(C==="contain"){var A=!1;if(S&&E){var j=m(w);j&&Iv(j,v)&&(o.push(w),A=!0)}!A&&SM(f,P)&&o.push(w)}else if(C==="overlap"&&zE(f,P)){var R=w.boundingBox({includeNodes:!0,includeEdges:!0,includeLabels:!1,includeMainLabels:!1,includeSourceLabels:!1,includeTargetLabels:!1}),O=[{x:R.x1,y:R.y1},{x:R.x2,y:R.y1},{x:R.x2,y:R.y2},{x:R.x1,y:R.y2}];if(Iv(O,v))o.push(w);else{var N=m(w);N&&Iv(N,v)&&o.push(w)}}}else{var D=b,L=D._private,_=L.rscratch,k=D.pstyle("box-selection").strValue;if(k==="none")continue;if(k==="contain"){if(_.startX!=null&&_.startY!=null&&!ai(f,_.startX,_.startY)||_.endX!=null&&_.endY!=null&&!ai(f,_.endX,_.endY))continue;if(_.edgeType==="bezier"||_.edgeType==="multibezier"||_.edgeType==="self"||_.edgeType==="compound"||_.edgeType==="segments"||_.edgeType==="haystack"){for(var I=L.rstyle.bezierPts||L.rstyle.linePts||L.rstyle.haystackPts,F=!0,B=0;B<I.length;B++)if(!HN(f,I[B])){F=!1;break}F&&o.push(D)}else _.edgeType==="straight"&&o.push(D)}else if(k==="overlap"){var $=!1;if(_.startX!=null&&_.startY!=null&&_.endX!=null&&_.endY!=null&&(ai(f,_.startX,_.startY)||ai(f,_.endX,_.endY)))o.push(D),$=!0;else if(!$&&_.edgeType==="haystack"){for(var W=L.rstyle.haystackPts,z=0;z<W.length;z++)if(HN(f,W[z])){o.push(D),$=!0;break}}if(!$){var q=L.rstyle.bezierPts||L.rstyle.linePts||L.rstyle.haystackPts;if((!q||q.length<2)&&_.edgeType==="straight"&&_.startX!=null&&_.startY!=null&&_.endX!=null&&_.endY!=null&&(q=[{x:_.startX,y:_.startY},{x:_.endX,y:_.endY}]),!q||q.length<2)continue;for(var G=0;G<q.length-1;G++){for(var J=q[G],ae=q[G+1],Y=0;Y<p.length;Y++){var H=Ht(p[Y],2),X=H[0],ee=H[1];if(g(J,ae,X,ee)){o.push(D),$=!0;break}}if($)break}}}}}return o};var af={};af.calculateArrowAngles=function(t){var e=t._private.rscratch,r=e.edgeType==="haystack",n=e.edgeType==="bezier",a=e.edgeType==="multibezier",i=e.edgeType==="segments",s=e.edgeType==="compound",o=e.edgeType==="self",l,u,c,d,f,v,g,x;if(r?(c=e.haystackPts[0],d=e.haystackPts[1],f=e.haystackPts[2],v=e.haystackPts[3]):(c=e.arrowStartX,d=e.arrowStartY,f=e.arrowEndX,v=e.arrowEndY),g=e.midX,x=e.midY,i)l=c-e.segpts[0],u=d-e.segpts[1];else if(a||s||o||n){var p=e.allpts,y=ar(p[0],p[2],p[4],.1),m=ar(p[1],p[3],p[5],.1);l=c-y,u=d-m}else l=c-g,u=d-x;e.srcArrowAngle=Tc(l,u);var g=e.midX,x=e.midY;if(r&&(g=(c+f)/2,x=(d+v)/2),l=f-c,u=v-d,i){var p=e.allpts;if(p.length/2%2===0){var b=p.length/2,w=b-2;l=p[b]-p[w],u=p[b+1]-p[w+1]}else if(e.isRound)l=e.midVector[1],u=-e.midVector[0];else{var b=p.length/2-1,w=b-2;l=p[b]-p[w],u=p[b+1]-p[w+1]}}else if(a||s||o){var p=e.allpts,E=e.ctrlpts,C,S,T,P;if(E.length/2%2===0){var A=p.length/2-1,j=A+2,R=j+2;C=ar(p[A],p[j],p[R],0),S=ar(p[A+1],p[j+1],p[R+1],0),T=ar(p[A],p[j],p[R],1e-4),P=ar(p[A+1],p[j+1],p[R+1],1e-4)}else{var j=p.length/2-1,A=j-2,R=j+2;C=ar(p[A],p[j],p[R],.4999),S=ar(p[A+1],p[j+1],p[R+1],.4999),T=ar(p[A],p[j],p[R],.5),P=ar(p[A+1],p[j+1],p[R+1],.5)}l=T-C,u=P-S}if(e.midtgtArrowAngle=Tc(l,u),e.midDispX=l,e.midDispY=u,l*=-1,u*=-1,i){var p=e.allpts;if(p.length/2%2!==0){if(!e.isRound){var b=p.length/2-1,O=b+2;l=-(p[O]-p[b]),u=-(p[O+1]-p[b+1])}}}if(e.midsrcArrowAngle=Tc(l,u),i)l=f-e.segpts[e.segpts.length-2],u=v-e.segpts[e.segpts.length-1];else if(a||s||o||n){var p=e.allpts,N=p.length,y=ar(p[N-6],p[N-4],p[N-2],.9),m=ar(p[N-5],p[N-3],p[N-1],.9);l=f-y,u=v-m}else l=f-g,u=v-x;e.tgtArrowAngle=Tc(l,u)};af.getArrowWidth=af.getArrowHeight=function(t,e){var r=this.arrowWidthCache=this.arrowWidthCache||{},n=r[t+", "+e];return n||(n=Math.max(Math.pow(t*13.37,.9),29)*e,r[t+", "+e]=n,n)};var X1,K1,ra={},gn={},PR,AR,Yi,vd,ga,Fi,Gi,ea,Ls,jc,mI,yI,Q1,Z1,kR,LR=function(e,r,n){n.x=r.x-e.x,n.y=r.y-e.y,n.len=Math.sqrt(n.x*n.x+n.y*n.y),n.nx=n.x/n.len,n.ny=n.y/n.len,n.ang=Math.atan2(n.ny,n.nx)},Y6=function(e,r){r.x=e.x*-1,r.y=e.y*-1,r.nx=e.nx*-1,r.ny=e.ny*-1,r.ang=e.ang>0?-(Math.PI-e.ang):Math.PI+e.ang},X6=function(e,r,n,a,i){if(e!==kR?LR(r,e,ra):Y6(gn,ra),LR(r,n,gn),PR=ra.nx*gn.ny-ra.ny*gn.nx,AR=ra.nx*gn.nx-ra.ny*-gn.ny,ga=Math.asin(Math.max(-1,Math.min(1,PR))),Math.abs(ga)<1e-6){X1=r.x,K1=r.y,Gi=Ls=0;return}Yi=1,vd=!1,AR<0?ga<0?ga=Math.PI+ga:(ga=Math.PI-ga,Yi=-1,vd=!0):ga>0&&(Yi=-1,vd=!0),r.radius!==void 0?Ls=r.radius:Ls=a,Fi=ga/2,jc=Math.min(ra.len/2,gn.len/2),i?(ea=Math.abs(Math.cos(Fi)*Ls/Math.sin(Fi)),ea>jc?(ea=jc,Gi=Math.abs(ea*Math.sin(Fi)/Math.cos(Fi))):Gi=Ls):(ea=Math.min(jc,Ls),Gi=Math.abs(ea*Math.sin(Fi)/Math.cos(Fi))),Q1=r.x+gn.nx*ea,Z1=r.y+gn.ny*ea,X1=Q1-gn.ny*Gi*Yi,K1=Z1+gn.nx*Gi*Yi,mI=r.x+ra.nx*ea,yI=r.y+ra.ny*ea,kR=r};function xI(t,e){e.radius===0?t.lineTo(e.cx,e.cy):t.arc(e.cx,e.cy,e.radius,e.startAngle,e.endAngle,e.counterClockwise)}function ZE(t,e,r,n){var a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0;return n===0||e.radius===0?{cx:e.x,cy:e.y,radius:0,startX:e.x,startY:e.y,stopX:e.x,stopY:e.y,startAngle:void 0,endAngle:void 0,counterClockwise:void 0}:(X6(t,e,r,n,a),{cx:X1,cy:K1,radius:Gi,startX:mI,startY:yI,stopX:Q1,stopY:Z1,startAngle:ra.ang+Math.PI/2*Yi,endAngle:gn.ang-Math.PI/2*Yi,counterClockwise:vd})}var yu=.01,K6=Math.sqrt(2*yu),Pr={};Pr.findMidptPtsEtc=function(t,e){var r=e.posPts,n=e.intersectionPts,a=e.vectorNormInverse,i,s=t.pstyle("source-endpoint"),o=t.pstyle("target-endpoint"),l=s.units!=null&&o.units!=null,u=function(E,C,S,T){var P=T-C,A=S-E,j=Math.sqrt(A*A+P*P);return{x:-P/j,y:A/j}},c=t.pstyle("edge-distances").value;switch(c){case"node-position":i=r;break;case"intersection":i=n;break;case"endpoints":{if(l){var d=this.manualEndptToPx(t.source()[0],s),f=Ht(d,2),v=f[0],p=f[1],y=this.manualEndptToPx(t.target()[0],o),m=Ht(y,2),g=m[0],x=m[1],b={x1:v,y1:p,x2:g,y2:x};a=u(v,p,g,x),i=b}else ht("Edge ".concat(t.id()," has edge-distances:endpoints specified without manual endpoints specified via source-endpoint and target-endpoint. Falling back on edge-distances:intersection (default).")),i=n;break}}return{midptPts:i,vectorNormInverse:a}};Pr.findHaystackPoints=function(t){for(var e=0;e<t.length;e++){var r=t[e],n=r._private,a=n.rscratch;if(!a.haystack){var i=Math.random()*2*Math.PI;a.source={x:Math.cos(i),y:Math.sin(i)},i=Math.random()*2*Math.PI,a.target={x:Math.cos(i),y:Math.sin(i)}}var s=n.source,o=n.target,l=s.position(),u=o.position(),c=s.width(),d=o.width(),f=s.height(),v=o.height(),p=r.pstyle("haystack-radius").value,y=p/2;a.haystackPts=a.allpts=[a.source.x*c*y+l.x,a.source.y*f*y+l.y,a.target.x*d*y+u.x,a.target.y*v*y+u.y],a.midX=(a.allpts[0]+a.allpts[2])/2,a.midY=(a.allpts[1]+a.allpts[3])/2,a.edgeType="haystack",a.haystack=!0,this.storeEdgeProjections(r),this.calculateArrowAngles(r),this.recalculateEdgeLabelProjections(r),this.calculateLabelAngles(r)}};Pr.findSegmentsPoints=function(t,e){var r=t._private.rscratch,n=t.pstyle("segment-weights"),a=t.pstyle("segment-distances"),i=t.pstyle("segment-radii"),s=t.pstyle("radius-type"),o=Math.min(n.pfValue.length,a.pfValue.length),l=i.pfValue[i.pfValue.length-1],u=s.pfValue[s.pfValue.length-1];r.edgeType="segments",r.segpts=[],r.radii=[],r.isArcRadius=[];for(var c=0;c<o;c++){var d=n.pfValue[c],f=a.pfValue[c],v=1-d,p=d,y=this.findMidptPtsEtc(t,e),m=y.midptPts,g=y.vectorNormInverse,x={x:m.x1*v+m.x2*p,y:m.y1*v+m.y2*p};r.segpts.push(x.x+g.x*f,x.y+g.y*f),r.radii.push(i.pfValue[c]!==void 0?i.pfValue[c]:l),r.isArcRadius.push((s.pfValue[c]!==void 0?s.pfValue[c]:u)==="arc-radius")}};Pr.findLoopPoints=function(t,e,r,n){var a=t._private.rscratch,i=e.dirCounts,s=e.srcPos,o=t.pstyle("control-point-distances"),l=o?o.pfValue[0]:void 0,u=t.pstyle("loop-direction").pfValue,c=t.pstyle("loop-sweep").pfValue,d=t.pstyle("control-point-step-size").pfValue;a.edgeType="self";var f=r,v=d;n&&(f=0,v=l);var p=u-Math.PI/2,y=p-c/2,m=p+c/2,g=u+"_"+c;f=i[g]===void 0?i[g]=0:++i[g],a.ctrlpts=[s.x+Math.cos(y)*1.4*v*(f/3+1),s.y+Math.sin(y)*1.4*v*(f/3+1),s.x+Math.cos(m)*1.4*v*(f/3+1),s.y+Math.sin(m)*1.4*v*(f/3+1)]};Pr.findCompoundLoopPoints=function(t,e,r,n){var a=t._private.rscratch;a.edgeType="compound";var i=e.srcPos,s=e.tgtPos,o=e.srcW,l=e.srcH,u=e.tgtW,c=e.tgtH,d=t.pstyle("control-point-step-size").pfValue,f=t.pstyle("control-point-distances"),v=f?f.pfValue[0]:void 0,p=r,y=d;n&&(p=0,y=v);var m=50,g={x:i.x-o/2,y:i.y-l/2},x={x:s.x-u/2,y:s.y-c/2},b={x:Math.min(g.x,x.x),y:Math.min(g.y,x.y)},w=.5,E=Math.max(w,Math.log(o*yu)),C=Math.max(w,Math.log(u*yu));a.ctrlpts=[b.x,b.y-(1+Math.pow(m,1.12)/100)*y*(p/3+1)*E,b.x-(1+Math.pow(m,1.12)/100)*y*(p/3+1)*C,b.y]};Pr.findStraightEdgePoints=function(t){t._private.rscratch.edgeType="straight"};Pr.findBezierPoints=function(t,e,r,n,a){var i=t._private.rscratch,s=t.pstyle("control-point-step-size").pfValue,o=t.pstyle("control-point-distances"),l=t.pstyle("control-point-weights"),u=o&&l?Math.min(o.value.length,l.value.length):1,c=o?o.pfValue[0]:void 0,d=l.value[0],f=n;i.edgeType=f?"multibezier":"bezier",i.ctrlpts=[];for(var v=0;v<u;v++){var p=(.5-e.eles.length/2+r)*s*(a?-1:1),y=void 0,m=BE(p);f&&(c=o?o.pfValue[v]:s,d=l.value[v]),n?y=c:y=c!==void 0?m*c:void 0;var g=y!==void 0?y:p,x=1-d,b=d,w=this.findMidptPtsEtc(t,e),E=w.midptPts,C=w.vectorNormInverse,S={x:E.x1*x+E.x2*b,y:E.y1*x+E.y2*b};i.ctrlpts.push(S.x+C.x*g,S.y+C.y*g)}};Pr.findTaxiPoints=function(t,e){var r=t._private.rscratch;r.edgeType="segments";var n="vertical",a="horizontal",i="leftward",s="rightward",o="downward",l="upward",u="auto",c=e.posPts,d=e.srcW,f=e.srcH,v=e.tgtW,p=e.tgtH,y=t.pstyle("edge-distances").value,m=y!=="node-position",g=t.pstyle("taxi-direction").value,x=g,b=t.pstyle("taxi-turn"),w=b.units==="%",E=b.pfValue,C=E<0,S=t.pstyle("taxi-turn-min-distance").pfValue,T=m?(d+v)/2:0,P=m?(f+p)/2:0,A=c.x2-c.x1,j=c.y2-c.y1,R=function(M,Q){return M>0?Math.max(M-Q,0):Math.min(M+Q,0)},O=R(A,T),N=R(j,P),D=!1;x===u?g=Math.abs(O)>Math.abs(N)?a:n:x===l||x===o?(g=n,D=!0):(x===i||x===s)&&(g=a,D=!0);var L=g===n,_=L?N:O,k=L?j:A,I=BE(k),F=!1;!(D&&(w||C))&&(x===o&&k<0||x===l&&k>0||x===i&&k>0||x===s&&k<0)&&(I*=-1,_=I*Math.abs(_),F=!0);var B;if(w){var $=E<0?1+E:E;B=$*_}else{var W=E<0?_:0;B=W+E*I}var z=function(M){return Math.abs(M)<S||Math.abs(M)>=Math.abs(_)},q=z(B),G=z(Math.abs(_)-Math.abs(B)),J=q||G;if(J&&!F)if(L){var ae=Math.abs(k)<=f/2,Y=Math.abs(A)<=v/2;if(ae){var H=(c.x1+c.x2)/2,X=c.y1,ee=c.y2;r.segpts=[H,X,H,ee]}else if(Y){var ie=(c.y1+c.y2)/2,oe=c.x1,me=c.x2;r.segpts=[oe,ie,me,ie]}else r.segpts=[c.x1,c.y2]}else{var De=Math.abs(k)<=d/2,ge=Math.abs(j)<=p/2;if(De){var pe=(c.y1+c.y2)/2,we=c.x1,xe=c.x2;r.segpts=[we,pe,xe,pe]}else if(ge){var Ee=(c.x1+c.x2)/2,V=c.y1,K=c.y2;r.segpts=[Ee,V,Ee,K]}else r.segpts=[c.x2,c.y1]}else if(L){var te=c.y1+B+(m?f/2*I:0),ue=c.x1,fe=c.x2;r.segpts=[ue,te,fe,te]}else{var ve=c.x1+B+(m?d/2*I:0),be=c.y1,Ne=c.y2;r.segpts=[ve,be,ve,Ne]}if(r.isRound){var Ce=t.pstyle("taxi-radius").value,Re=t.pstyle("radius-type").value[0]==="arc-radius";r.radii=new Array(r.segpts.length/2).fill(Ce),r.isArcRadius=new Array(r.segpts.length/2).fill(Re)}};Pr.tryToCorrectInvalidPoints=function(t,e){var r=t._private.rscratch;if(r.edgeType==="bezier"){var n=e.srcPos,a=e.tgtPos,i=e.srcW,s=e.srcH,o=e.tgtW,l=e.tgtH,u=e.srcShape,c=e.tgtShape,d=e.srcCornerRadius,f=e.tgtCornerRadius,v=e.srcRs,p=e.tgtRs,y=!_e(r.startX)||!_e(r.startY),m=!_e(r.arrowStartX)||!_e(r.arrowStartY),g=!_e(r.endX)||!_e(r.endY),x=!_e(r.arrowEndX)||!_e(r.arrowEndY),b=3,w=this.getArrowWidth(t.pstyle("width").pfValue,t.pstyle("arrow-scale").value)*this.arrowShapeWidth,E=b*w,C=ds({x:r.ctrlpts[0],y:r.ctrlpts[1]},{x:r.startX,y:r.startY}),S=C<E,T=ds({x:r.ctrlpts[0],y:r.ctrlpts[1]},{x:r.endX,y:r.endY}),P=T<E,A=!1;if(y||m||S){A=!0;var j={x:r.ctrlpts[0]-n.x,y:r.ctrlpts[1]-n.y},R=Math.sqrt(j.x*j.x+j.y*j.y),O={x:j.x/R,y:j.y/R},N=Math.max(i,s),D={x:r.ctrlpts[0]+O.x*2*N,y:r.ctrlpts[1]+O.y*2*N},L=u.intersectLine(n.x,n.y,i,s,D.x,D.y,0,d,v);S?(r.ctrlpts[0]=r.ctrlpts[0]+O.x*(E-C),r.ctrlpts[1]=r.ctrlpts[1]+O.y*(E-C)):(r.ctrlpts[0]=L[0]+O.x*E,r.ctrlpts[1]=L[1]+O.y*E)}if(g||x||P){A=!0;var _={x:r.ctrlpts[0]-a.x,y:r.ctrlpts[1]-a.y},k=Math.sqrt(_.x*_.x+_.y*_.y),I={x:_.x/k,y:_.y/k},F=Math.max(i,s),B={x:r.ctrlpts[0]+I.x*2*F,y:r.ctrlpts[1]+I.y*2*F},$=c.intersectLine(a.x,a.y,o,l,B.x,B.y,0,f,p);P?(r.ctrlpts[0]=r.ctrlpts[0]+I.x*(E-T),r.ctrlpts[1]=r.ctrlpts[1]+I.y*(E-T)):(r.ctrlpts[0]=$[0]+I.x*E,r.ctrlpts[1]=$[1]+I.y*E)}A&&this.findEndpoints(t)}};Pr.storeAllpts=function(t){var e=t._private.rscratch;if(e.edgeType==="multibezier"||e.edgeType==="bezier"||e.edgeType==="self"||e.edgeType==="compound"){e.allpts=[],e.allpts.push(e.startX,e.startY);for(var r=0;r+1<e.ctrlpts.length;r+=2)e.allpts.push(e.ctrlpts[r],e.ctrlpts[r+1]),r+3<e.ctrlpts.length&&e.allpts.push((e.ctrlpts[r]+e.ctrlpts[r+2])/2,(e.ctrlpts[r+1]+e.ctrlpts[r+3])/2);e.allpts.push(e.endX,e.endY);var n,a;e.ctrlpts.length/2%2===0?(n=e.allpts.length/2-1,e.midX=e.allpts[n],e.midY=e.allpts[n+1]):(n=e.allpts.length/2-3,a=.5,e.midX=ar(e.allpts[n],e.allpts[n+2],e.allpts[n+4],a),e.midY=ar(e.allpts[n+1],e.allpts[n+3],e.allpts[n+5],a))}else if(e.edgeType==="straight")e.allpts=[e.startX,e.startY,e.endX,e.endY],e.midX=(e.startX+e.endX+e.arrowStartX+e.arrowEndX)/4,e.midY=(e.startY+e.endY+e.arrowStartY+e.arrowEndY)/4;else if(e.edgeType==="segments"){if(e.allpts=[],e.allpts.push(e.startX,e.startY),e.allpts.push.apply(e.allpts,e.segpts),e.allpts.push(e.endX,e.endY),e.isRound){e.roundCorners=[];for(var i=2;i+3<e.allpts.length;i+=2){var s=e.radii[i/2-1],o=e.isArcRadius[i/2-1];e.roundCorners.push(ZE({x:e.allpts[i-2],y:e.allpts[i-1]},{x:e.allpts[i],y:e.allpts[i+1],radius:s},{x:e.allpts[i+2],y:e.allpts[i+3]},s,o))}}if(e.segpts.length%4===0){var l=e.segpts.length/2,u=l-2;e.midX=(e.segpts[u]+e.segpts[l])/2,e.midY=(e.segpts[u+1]+e.segpts[l+1])/2}else{var c=e.segpts.length/2-1;if(!e.isRound)e.midX=e.segpts[c],e.midY=e.segpts[c+1];else{var d={x:e.segpts[c],y:e.segpts[c+1]},f=e.roundCorners[c/2];if(f.radius===0){var v={x:e.segpts[c+2],y:e.segpts[c+3]};e.midX=d.x,e.midY=d.y,e.midVector=[d.y-v.y,v.x-d.x]}else{var p=[d.x-f.cx,d.y-f.cy],y=f.radius/Math.sqrt(Math.pow(p[0],2)+Math.pow(p[1],2));p=p.map(function(m){return m*y}),e.midX=f.cx+p[0],e.midY=f.cy+p[1],e.midVector=p}}}}};Pr.checkForInvalidEdgeWarning=function(t){var e=t[0]._private.rscratch;e.nodesOverlap||_e(e.startX)&&_e(e.startY)&&_e(e.endX)&&_e(e.endY)?e.loggedErr=!1:e.loggedErr||(e.loggedErr=!0,ht("Edge `"+t.id()+"` has invalid endpoints and so it is impossible to draw. Adjust your edge style (e.g. control points) accordingly or use an alternative edge type. This is expected behaviour when the source node and the target node overlap."))};Pr.findEdgeControlPoints=function(t){var e=this;if(!(!t||t.length===0)){for(var r=this,n=r.cy,a=n.hasCompoundNodes(),i=new Na,s=function(P,A){return[].concat(Yd(P),[A?1:0]).join("-")},o=[],l=[],u=0;u<t.length;u++){var c=t[u],d=c._private,f=c.pstyle("curve-style").value;if(!(c.removed()||!c.takesUpSpace())){if(f==="haystack"){l.push(c);continue}var v=f==="unbundled-bezier"||ni(f,"segments")||f==="straight"||f==="straight-triangle"||ni(f,"taxi"),p=f==="unbundled-bezier"||f==="bezier",y=d.source,m=d.target,g=y.poolIndex(),x=m.poolIndex(),b=[g,x].sort(),w=s(b,v),E=i.get(w);E==null&&(E={eles:[]},o.push({pairId:b,edgeIsUnbundled:v}),i.set(w,E)),E.eles.push(c),v&&(E.hasUnbundled=!0),p&&(E.hasBezier=!0)}}for(var C=function(){var P=o[S],A=P.pairId,j=P.edgeIsUnbundled,R=s(A,j),O=i.get(R),N;if(!O.hasUnbundled){var D=O.eles[0].parallelEdges().filter(function(Re){return Re.isBundledBezier()});IE(O.eles),D.forEach(function(Re){return O.eles.push(Re)}),O.eles.sort(function(Re,Z){return Re.poolIndex()-Z.poolIndex()})}var L=O.eles[0],_=L.source(),k=L.target();if(_.poolIndex()>k.poolIndex()){var I=_;_=k,k=I}var F=O.srcPos=_.position(),B=O.tgtPos=k.position(),$=O.srcW=_.outerWidth(),W=O.srcH=_.outerHeight(),z=O.tgtW=k.outerWidth(),q=O.tgtH=k.outerHeight(),G=O.srcShape=r.nodeShapes[e.getNodeShape(_)],J=O.tgtShape=r.nodeShapes[e.getNodeShape(k)],ae=O.srcCornerRadius=_.pstyle("corner-radius").value==="auto"?"auto":_.pstyle("corner-radius").pfValue,Y=O.tgtCornerRadius=k.pstyle("corner-radius").value==="auto"?"auto":k.pstyle("corner-radius").pfValue,H=O.tgtRs=k._private.rscratch,X=O.srcRs=_._private.rscratch;O.dirCounts={north:0,west:0,south:0,east:0,northwest:0,southwest:0,northeast:0,southeast:0};for(var ee=0;ee<O.eles.length;ee++){var ie=O.eles[ee],oe=ie[0]._private.rscratch,me=ie.pstyle("curve-style").value,De=me==="unbundled-bezier"||ni(me,"segments")||ni(me,"taxi"),ge=!_.same(ie.source());if(!O.calculatedIntersection&&_!==k&&(O.hasBezier||O.hasUnbundled)){O.calculatedIntersection=!0;var pe=G.intersectLine(F.x,F.y,$,W,B.x,B.y,0,ae,X),we=O.srcIntn=pe,xe=J.intersectLine(B.x,B.y,z,q,F.x,F.y,0,Y,H),Ee=O.tgtIntn=xe,V=O.intersectionPts={x1:pe[0],x2:xe[0],y1:pe[1],y2:xe[1]},K=O.posPts={x1:F.x,x2:B.x,y1:F.y,y2:B.y},te=xe[1]-pe[1],ue=xe[0]-pe[0],fe=Math.sqrt(ue*ue+te*te);_e(fe)&&fe>=K6||(fe=Math.sqrt(Math.max(ue*ue,yu)+Math.max(te*te,yu)));var ve=O.vector={x:ue,y:te},be=O.vectorNorm={x:ve.x/fe,y:ve.y/fe},Ne={x:-be.y,y:be.x};O.nodesOverlap=!_e(fe)||J.checkPoint(pe[0],pe[1],0,z,q,B.x,B.y,Y,H)||G.checkPoint(xe[0],xe[1],0,$,W,F.x,F.y,ae,X),O.vectorNormInverse=Ne,N={nodesOverlap:O.nodesOverlap,dirCounts:O.dirCounts,calculatedIntersection:!0,hasBezier:O.hasBezier,hasUnbundled:O.hasUnbundled,eles:O.eles,srcPos:B,srcRs:H,tgtPos:F,tgtRs:X,srcW:z,srcH:q,tgtW:$,tgtH:W,srcIntn:Ee,tgtIntn:we,srcShape:J,tgtShape:G,posPts:{x1:K.x2,y1:K.y2,x2:K.x1,y2:K.y1},intersectionPts:{x1:V.x2,y1:V.y2,x2:V.x1,y2:V.y1},vector:{x:-ve.x,y:-ve.y},vectorNorm:{x:-be.x,y:-be.y},vectorNormInverse:{x:-Ne.x,y:-Ne.y}}}var Ce=ge?N:O;oe.nodesOverlap=Ce.nodesOverlap,oe.srcIntn=Ce.srcIntn,oe.tgtIntn=Ce.tgtIntn,oe.isRound=me.startsWith("round"),a&&(_.isParent()||_.isChild()||k.isParent()||k.isChild())&&(_.parents().anySame(k)||k.parents().anySame(_)||_.same(k)&&_.isParent())?e.findCompoundLoopPoints(ie,Ce,ee,De):_===k?e.findLoopPoints(ie,Ce,ee,De):me.endsWith("segments")?e.findSegmentsPoints(ie,Ce):me.endsWith("taxi")?e.findTaxiPoints(ie,Ce):me==="straight"||!De&&O.eles.length%2===1&&ee===Math.floor(O.eles.length/2)?e.findStraightEdgePoints(ie):e.findBezierPoints(ie,Ce,ee,De,ge),e.findEndpoints(ie),e.tryToCorrectInvalidPoints(ie,Ce),e.checkForInvalidEdgeWarning(ie),e.storeAllpts(ie),e.storeEdgeProjections(ie),e.calculateArrowAngles(ie),e.recalculateEdgeLabelProjections(ie),e.calculateLabelAngles(ie)}},S=0;S<o.length;S++)C();this.findHaystackPoints(l)}};function bI(t){var e=[];if(t!=null){for(var r=0;r<t.length;r+=2){var n=t[r],a=t[r+1];e.push({x:n,y:a})}return e}}Pr.getSegmentPoints=function(t){var e=t[0]._private.rscratch;this.recalculateRenderedStyle(t);var r=e.edgeType;if(r==="segments")return bI(e.segpts)};Pr.getControlPoints=function(t){var e=t[0]._private.rscratch;this.recalculateRenderedStyle(t);var r=e.edgeType;if(r==="bezier"||r==="multibezier"||r==="self"||r==="compound")return bI(e.ctrlpts)};Pr.getEdgeMidpoint=function(t){var e=t[0]._private.rscratch;return this.recalculateRenderedStyle(t),{x:e.midX,y:e.midY}};var Gu={};Gu.manualEndptToPx=function(t,e){var r=this,n=t.position(),a=t.outerWidth(),i=t.outerHeight(),s=t._private.rscratch;if(e.value.length===2){var o=[e.pfValue[0],e.pfValue[1]];return e.units[0]==="%"&&(o[0]=o[0]*a),e.units[1]==="%"&&(o[1]=o[1]*i),o[0]+=n.x,o[1]+=n.y,o}else{var l=e.pfValue[0];l=-Math.PI/2+l;var u=2*Math.max(a,i),c=[n.x+Math.cos(l)*u,n.y+Math.sin(l)*u];return r.nodeShapes[this.getNodeShape(t)].intersectLine(n.x,n.y,a,i,c[0],c[1],0,t.pstyle("corner-radius").value==="auto"?"auto":t.pstyle("corner-radius").pfValue,s)}};Gu.findEndpoints=function(t){var e,r,n,a,i=this,s,o=t.source()[0],l=t.target()[0],u=o.position(),c=l.position(),d=t.pstyle("target-arrow-shape").value,f=t.pstyle("source-arrow-shape").value,v=t.pstyle("target-distance-from-node").pfValue,p=t.pstyle("source-distance-from-node").pfValue,y=o._private.rscratch,m=l._private.rscratch,g=t.pstyle("curve-style").value,x=t._private.rscratch,b=x.edgeType,w=ni(g,"taxi"),E=b==="self"||b==="compound",C=b==="bezier"||b==="multibezier"||E,S=b!=="bezier",T=b==="straight"||b==="segments",P=b==="segments",A=C||S||T,j=E||w,R=t.pstyle("source-endpoint"),O=j?"outside-to-node":R.value,N=o.pstyle("corner-radius").value==="auto"?"auto":o.pstyle("corner-radius").pfValue,D=t.pstyle("target-endpoint"),L=j?"outside-to-node":D.value,_=l.pstyle("corner-radius").value==="auto"?"auto":l.pstyle("corner-radius").pfValue;x.srcManEndpt=R,x.tgtManEndpt=D;var k,I,F,B,$=(e=(D==null||(r=D.pfValue)===null||r===void 0?void 0:r.length)===2?D.pfValue:null)!==null&&e!==void 0?e:[0,0],W=(n=(R==null||(a=R.pfValue)===null||a===void 0?void 0:a.length)===2?R.pfValue:null)!==null&&n!==void 0?n:[0,0];if(C){var z=[x.ctrlpts[0],x.ctrlpts[1]],q=S?[x.ctrlpts[x.ctrlpts.length-2],x.ctrlpts[x.ctrlpts.length-1]]:z;k=q,I=z}else if(T){var G=P?x.segpts.slice(0,2):[c.x+$[0],c.y+$[1]],J=P?x.segpts.slice(x.segpts.length-2):[u.x+W[0],u.y+W[1]];k=J,I=G}if(L==="inside-to-node")s=[c.x,c.y];else if(D.units)s=this.manualEndptToPx(l,D);else if(L==="outside-to-line")s=x.tgtIntn;else if(L==="outside-to-node"||L==="outside-to-node-or-label"?F=k:(L==="outside-to-line"||L==="outside-to-line-or-label")&&(F=[u.x,u.y]),s=i.nodeShapes[this.getNodeShape(l)].intersectLine(c.x,c.y,l.outerWidth(),l.outerHeight(),F[0],F[1],0,_,m),L==="outside-to-node-or-label"||L==="outside-to-line-or-label"){var ae=l._private.rscratch,Y=ae.labelWidth,H=ae.labelHeight,X=ae.labelX,ee=ae.labelY,ie=Y/2,oe=H/2,me=l.pstyle("text-valign").value;me==="top"?ee-=oe:me==="bottom"&&(ee+=oe);var De=l.pstyle("text-halign").value;De==="left"?X-=ie:De==="right"&&(X+=ie);var ge=hu(F[0],F[1],[X-ie,ee-oe,X+ie,ee-oe,X+ie,ee+oe,X-ie,ee+oe],c.x,c.y);if(ge.length>0){var pe=u,we=Vi(pe,Js(s)),xe=Vi(pe,Js(ge)),Ee=we;if(xe<we&&(s=ge,Ee=xe),ge.length>2){var V=Vi(pe,{x:ge[2],y:ge[3]});V<Ee&&(s=[ge[2],ge[3]])}}}var K=Rc(s,k,i.arrowShapes[d].spacing(t)+v),te=Rc(s,k,i.arrowShapes[d].gap(t)+v);if(x.endX=te[0],x.endY=te[1],x.arrowEndX=K[0],x.arrowEndY=K[1],O==="inside-to-node")s=[u.x,u.y];else if(R.units)s=this.manualEndptToPx(o,R);else if(O==="outside-to-line")s=x.srcIntn;else if(O==="outside-to-node"||O==="outside-to-node-or-label"?B=I:(O==="outside-to-line"||O==="outside-to-line-or-label")&&(B=[c.x,c.y]),s=i.nodeShapes[this.getNodeShape(o)].intersectLine(u.x,u.y,o.outerWidth(),o.outerHeight(),B[0],B[1],0,N,y),O==="outside-to-node-or-label"||O==="outside-to-line-or-label"){var ue=o._private.rscratch,fe=ue.labelWidth,ve=ue.labelHeight,be=ue.labelX,Ne=ue.labelY,Ce=fe/2,Re=ve/2,Z=o.pstyle("text-valign").value;Z==="top"?Ne-=Re:Z==="bottom"&&(Ne+=Re);var M=o.pstyle("text-halign").value;M==="left"?be-=Ce:M==="right"&&(be+=Ce);var Q=hu(B[0],B[1],[be-Ce,Ne-Re,be+Ce,Ne-Re,be+Ce,Ne+Re,be-Ce,Ne+Re],u.x,u.y);if(Q.length>0){var ne=c,re=Vi(ne,Js(s)),se=Vi(ne,Js(Q)),ye=re;if(se<re&&(s=[Q[0],Q[1]],ye=se),Q.length>2){var le=Vi(ne,{x:Q[2],y:Q[3]});le<ye&&(s=[Q[2],Q[3]])}}}var he=Rc(s,I,i.arrowShapes[f].spacing(t)+p),de=Rc(s,I,i.arrowShapes[f].gap(t)+p);x.startX=de[0],x.startY=de[1],x.arrowStartX=he[0],x.arrowStartY=he[1],A&&(!_e(x.startX)||!_e(x.startY)||!_e(x.endX)||!_e(x.endY)?x.badLine=!0:x.badLine=!1)};Gu.getSourceEndpoint=function(t){var e=t[0]._private.rscratch;switch(this.recalculateRenderedStyle(t),e.edgeType){case"haystack":return{x:e.haystackPts[0],y:e.haystackPts[1]};default:return{x:e.arrowStartX,y:e.arrowStartY}}};Gu.getTargetEndpoint=function(t){var e=t[0]._private.rscratch;switch(this.recalculateRenderedStyle(t),e.edgeType){case"haystack":return{x:e.haystackPts[2],y:e.haystackPts[3]};default:return{x:e.arrowEndX,y:e.arrowEndY}}};var JE={};function Q6(t,e,r){for(var n=function(u,c,d,f){return ar(u,c,d,f)},a=e._private,i=a.rstyle.bezierPts,s=0;s<t.bezierProjPcts.length;s++){var o=t.bezierProjPcts[s];i.push({x:n(r[0],r[2],r[4],o),y:n(r[1],r[3],r[5],o)})}}JE.storeEdgeProjections=function(t){var e=t._private,r=e.rscratch,n=r.edgeType;if(e.rstyle.bezierPts=null,e.rstyle.linePts=null,e.rstyle.haystackPts=null,n==="multibezier"||n==="bezier"||n==="self"||n==="compound"){e.rstyle.bezierPts=[];for(var a=0;a+5<r.allpts.length;a+=4)Q6(this,t,r.allpts.slice(a,a+6))}else if(n==="segments")for(var i=e.rstyle.linePts=[],a=0;a+1<r.allpts.length;a+=2)i.push({x:r.allpts[a],y:r.allpts[a+1]});else if(n==="haystack"){var s=r.haystackPts;e.rstyle.haystackPts=[{x:s[0],y:s[1]},{x:s[2],y:s[3]}]}e.rstyle.arrowWidth=this.getArrowWidth(t.pstyle("width").pfValue,t.pstyle("arrow-scale").value)*this.arrowShapeWidth};JE.recalculateEdgeProjections=function(t){this.findEdgeControlPoints(t)};var da={};da.recalculateNodeLabelProjection=function(t){var e=t.pstyle("label").strValue;if(!bi(e)){var r,n,a=t._private,i=t.width(),s=t.height(),o=t.padding(),l=t.position(),u=t.pstyle("text-halign").strValue,c=t.pstyle("text-valign").strValue,d=a.rscratch,f=a.rstyle;switch(u){case"left":r=l.x-i/2-o;break;case"right":r=l.x+i/2+o;break;default:r=l.x}switch(c){case"top":n=l.y-s/2-o;break;case"bottom":n=l.y+s/2+o;break;default:n=l.y}d.labelX=r,d.labelY=n,f.labelX=r,f.labelY=n,this.calculateLabelAngles(t),this.applyLabelDimensions(t)}};var wI=function(e,r){var n=Math.atan(r/e);return e===0&&n<0&&(n=n*-1),n},EI=function(e,r){var n=r.x-e.x,a=r.y-e.y;return wI(n,a)},Z6=function(e,r,n,a){var i=fu(0,a-.001,1),s=fu(0,a+.001,1),o=uo(e,r,n,i),l=uo(e,r,n,s);return EI(o,l)};da.recalculateEdgeLabelProjections=function(t){var e,r=t._private,n=r.rscratch,a=this,i={mid:t.pstyle("label").strValue,source:t.pstyle("source-label").strValue,target:t.pstyle("target-label").strValue};if(i.mid||i.source||i.target){e={x:n.midX,y:n.midY};var s=function(d,f,v){ba(r.rscratch,d,f,v),ba(r.rstyle,d,f,v)};s("labelX",null,e.x),s("labelY",null,e.y);var o=wI(n.midDispX,n.midDispY);s("labelAutoAngle",null,o);var l=function(){if(l.cache)return l.cache;for(var d=[],f=0;f+5<n.allpts.length;f+=4){var v={x:n.allpts[f],y:n.allpts[f+1]},p={x:n.allpts[f+2],y:n.allpts[f+3]},y={x:n.allpts[f+4],y:n.allpts[f+5]};d.push({p0:v,p1:p,p2:y,startDist:0,length:0,segments:[]})}var m=r.rstyle.bezierPts,g=a.bezierProjPcts.length;function x(S,T,P,A,j){var R=ds(T,P),O=S.segments[S.segments.length-1],N={p0:T,p1:P,t0:A,t1:j,startDist:O?O.startDist+O.length:0,length:R};S.segments.push(N),S.length+=R}for(var b=0;b<d.length;b++){var w=d[b],E=d[b-1];E&&(w.startDist=E.startDist+E.length),x(w,w.p0,m[b*g],0,a.bezierProjPcts[0]);for(var C=0;C<g-1;C++)x(w,m[b*g+C],m[b*g+C+1],a.bezierProjPcts[C],a.bezierProjPcts[C+1]);x(w,m[b*g+g-1],w.p2,a.bezierProjPcts[g-1],1)}return l.cache=d},u=function(d){var f,v=d==="source";if(i[d]){var p=t.pstyle(d+"-text-offset").pfValue;switch(n.edgeType){case"self":case"compound":case"bezier":case"multibezier":{for(var y=l(),m,g=0,x=0,b=0;b<y.length;b++){for(var w=y[v?b:y.length-1-b],E=0;E<w.segments.length;E++){var C=w.segments[v?E:w.segments.length-1-E],S=b===y.length-1&&E===w.segments.length-1;if(g=x,x+=C.length,x>=p||S){m={cp:w,segment:C};break}}if(m)break}var T=m.cp,P=m.segment,A=(p-g)/P.length,j=P.t1-P.t0,R=v?P.t0+j*A:P.t1-j*A;R=fu(0,R,1),e=uo(T.p0,T.p1,T.p2,R),f=Z6(T.p0,T.p1,T.p2,R);break}case"straight":case"segments":case"haystack":{for(var O=0,N,D,L,_,k=n.allpts.length,I=0;I+3<k&&(v?(L={x:n.allpts[I],y:n.allpts[I+1]},_={x:n.allpts[I+2],y:n.allpts[I+3]}):(L={x:n.allpts[k-2-I],y:n.allpts[k-1-I]},_={x:n.allpts[k-4-I],y:n.allpts[k-3-I]}),N=ds(L,_),D=O,O+=N,!(O>=p));I+=2);var F=p-D,B=F/N;B=fu(0,B,1),e=bV(L,_,B),f=EI(L,_);break}}s("labelX",d,e.x),s("labelY",d,e.y),s("labelAutoAngle",d,f)}};u("source"),u("target"),this.applyLabelDimensions(t)}};da.applyLabelDimensions=function(t){this.applyPrefixedLabelDimensions(t),t.isEdge()&&(this.applyPrefixedLabelDimensions(t,"source"),this.applyPrefixedLabelDimensions(t,"target"))};da.applyPrefixedLabelDimensions=function(t,e){var r=t._private,n=this.getLabelText(t,e),a=cs(n,t._private.labelDimsKey);if(Hr(r.rscratch,"prefixedLabelDimsKey",e)!==a){ba(r.rscratch,"prefixedLabelDimsKey",e,a);var i=this.calculateLabelDimensions(t,n),s=t.pstyle("line-height").pfValue,o=t.pstyle("text-wrap").strValue,l=Hr(r.rscratch,"labelWrapCachedLines",e)||[],u=o!=="wrap"?1:Math.max(l.length,1),c=i.height/u,d=c*s,f=i.width,v=i.height+(u-1)*(s-1)*c;ba(r.rstyle,"labelWidth",e,f),ba(r.rscratch,"labelWidth",e,f),ba(r.rstyle,"labelHeight",e,v),ba(r.rscratch,"labelHeight",e,v),ba(r.rscratch,"labelLineHeight",e,d)}};da.getLabelText=function(t,e){var r=t._private,n=e?e+"-":"",a=t.pstyle(n+"label").strValue,i=t.pstyle("text-transform").value,s=function(W,z){return z?(ba(r.rscratch,W,e,z),z):Hr(r.rscratch,W,e)};if(!a)return"";i=="none"||(i=="uppercase"?a=a.toUpperCase():i=="lowercase"&&(a=a.toLowerCase()));var o=t.pstyle("text-wrap").value;if(o==="wrap"){var l=s("labelKey");if(l!=null&&s("labelWrapKey")===l)return s("labelWrapCachedText");for(var u="",c=a.split(`
|
|
97
|
+
`),d=t.pstyle("text-max-width").pfValue,f=t.pstyle("text-overflow-wrap").value,v=f==="anywhere",p=[],y=/[\s\u200b]+|$/g,m=0;m<c.length;m++){var g=c[m],x=this.calculateLabelDimensions(t,g),b=x.width;if(v){var w=g.split("").join(u);g=w}if(b>d){var E=g.matchAll(y),C="",S=0,T=Xr(E),P;try{for(T.s();!(P=T.n()).done;){var A=P.value,j=A[0],R=g.substring(S,A.index);S=A.index+j.length;var O=C.length===0?R:C+R+j,N=this.calculateLabelDimensions(t,O),D=N.width;D<=d?C+=R+j:(C&&p.push(C),C=R+j)}}catch($){T.e($)}finally{T.f()}C.match(/^[\s\u200b]+$/)||p.push(C)}else p.push(g)}s("labelWrapCachedLines",p),a=s("labelWrapCachedText",p.join(`
|
|
98
|
+
`)),s("labelWrapKey",l)}else if(o==="ellipsis"){var L=t.pstyle("text-max-width").pfValue,_="",k="…",I=!1;if(this.calculateLabelDimensions(t,a).width<L)return a;for(var F=0;F<a.length;F++){var B=this.calculateLabelDimensions(t,_+a[F]+k).width;if(B>L)break;_+=a[F],F===a.length-1&&(I=!0)}return I||(_+=k),_}return a};da.getLabelJustification=function(t){var e=t.pstyle("text-justification").strValue,r=t.pstyle("text-halign").strValue;if(e==="auto")if(t.isNode())switch(r){case"left":return"right";case"right":return"left";default:return"center"}else return"center";else return e};da.calculateLabelDimensions=function(t,e){var r=this,n=r.cy.window(),a=n.document,i=0,s=t.pstyle("font-style").strValue,o=t.pstyle("font-size").pfValue,l=t.pstyle("font-family").strValue,u=t.pstyle("font-weight").strValue,c=this.labelCalcCanvas,d=this.labelCalcCanvasContext;if(!c){c=this.labelCalcCanvas=a.createElement("canvas"),d=this.labelCalcCanvasContext=c.getContext("2d");var f=c.style;f.position="absolute",f.left="-9999px",f.top="-9999px",f.zIndex="-1",f.visibility="hidden",f.pointerEvents="none"}d.font="".concat(s," ").concat(u," ").concat(o,"px ").concat(l);for(var v=0,p=0,y=e.split(`
|
|
99
|
+
`),m=0;m<y.length;m++){var g=y[m],x=d.measureText(g),b=Math.ceil(x.width),w=o;v=Math.max(b,v),p+=w}return v+=i,p+=i,{width:v,height:p}};da.calculateLabelAngle=function(t,e){var r=t._private,n=r.rscratch,a=t.isEdge(),i=e?e+"-":"",s=t.pstyle(i+"text-rotation"),o=s.strValue;return o==="none"?0:a&&o==="autorotate"?n.labelAutoAngle:o==="autorotate"?0:s.pfValue};da.calculateLabelAngles=function(t){var e=this,r=t.isEdge(),n=t._private,a=n.rscratch;a.labelAngle=e.calculateLabelAngle(t),r&&(a.sourceLabelAngle=e.calculateLabelAngle(t,"source"),a.targetLabelAngle=e.calculateLabelAngle(t,"target"))};var SI={},DR=28,_R=!1;SI.getNodeShape=function(t){var e=this,r=t.pstyle("shape").value;if(r==="cutrectangle"&&(t.width()<DR||t.height()<DR))return _R||(ht("The `cutrectangle` node shape can not be used at small sizes so `rectangle` is used instead"),_R=!0),"rectangle";if(t.isParent())return r==="rectangle"||r==="roundrectangle"||r==="round-rectangle"||r==="cutrectangle"||r==="cut-rectangle"||r==="barrel"?r:"rectangle";if(r==="polygon"){var n=t.pstyle("shape-polygon-points").value;return e.nodeShapes.makePolygon(n).name}return r};var lh={};lh.registerCalculationListeners=function(){var t=this.cy,e=t.collection(),r=this,n=function(s){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(e.merge(s),o)for(var l=0;l<s.length;l++){var u=s[l],c=u._private,d=c.rstyle;d.clean=!1,d.cleanConnected=!1}};r.binder(t).on("bounds.* dirty.*",function(s){var o=s.target;n(o)}).on("style.* background.*",function(s){var o=s.target;n(o,!1)});var a=function(s){if(s){var o=r.onUpdateEleCalcsFns;e.cleanStyle();for(var l=0;l<e.length;l++){var u=e[l],c=u._private.rstyle;u.isNode()&&!c.cleanConnected&&(n(u.connectedEdges()),c.cleanConnected=!0)}if(o)for(var d=0;d<o.length;d++){var f=o[d];f(s,e)}r.recalculateRenderedStyle(e),e=t.collection()}};r.flushRenderedStyleQueue=function(){a(!0)},r.beforeRender(a,r.beforeRenderPriorities.eleCalcs)};lh.onUpdateEleCalcs=function(t){var e=this.onUpdateEleCalcsFns=this.onUpdateEleCalcsFns||[];e.push(t)};lh.recalculateRenderedStyle=function(t,e){var r=function(w){return w._private.rstyle.cleanConnected};if(t.length!==0){var n=[],a=[];if(!this.destroyed){e===void 0&&(e=!0);for(var i=0;i<t.length;i++){var s=t[i],o=s._private,l=o.rstyle;s.isEdge()&&(!r(s.source())||!r(s.target()))&&(l.clean=!1),s.isEdge()&&s.isBundledBezier()&&s.parallelEdges().some(function(b){return!b._private.rstyle.clean&&b.isBundledBezier()})&&(l.clean=!1),!(e&&l.clean||s.removed())&&s.pstyle("display").value!=="none"&&(o.group==="nodes"?a.push(s):n.push(s),l.clean=!0)}for(var u=0;u<a.length;u++){var c=a[u],d=c._private,f=d.rstyle,v=c.position();this.recalculateNodeLabelProjection(c),f.nodeX=v.x,f.nodeY=v.y,f.nodeW=c.pstyle("width").pfValue,f.nodeH=c.pstyle("height").pfValue}this.recalculateEdgeProjections(n);for(var p=0;p<n.length;p++){var y=n[p],m=y._private,g=m.rstyle,x=m.rscratch;g.srcX=x.arrowStartX,g.srcY=x.arrowStartY,g.tgtX=x.arrowEndX,g.tgtY=x.arrowEndY,g.midX=x.midX,g.midY=x.midY,g.labelAngle=x.labelAngle,g.sourceLabelAngle=x.sourceLabelAngle,g.targetLabelAngle=x.targetLabelAngle}}}};var uh={};uh.updateCachedGrabbedEles=function(){var t=this.cachedZSortedEles;if(t){t.drag=[],t.nondrag=[];for(var e=[],r=0;r<t.length;r++){var n=t[r],a=n._private.rscratch;n.grabbed()&&!n.isParent()?e.push(n):a.inDragLayer?t.drag.push(n):t.nondrag.push(n)}for(var r=0;r<e.length;r++){var n=e[r];t.drag.push(n)}}};uh.invalidateCachedZSortedEles=function(){this.cachedZSortedEles=null};uh.getCachedZSortedEles=function(t){if(t||!this.cachedZSortedEles){var e=this.cy.mutableElements().toArray();e.sort(aI),e.interactive=e.filter(function(r){return r.interactive()}),this.cachedZSortedEles=e,this.updateCachedGrabbedEles()}else e=this.cachedZSortedEles;return e};var CI={};[bs,af,Pr,Gu,JE,da,SI,lh,uh].forEach(function(t){We(CI,t)});var NI={};NI.getCachedImage=function(t,e,r){var n=this,a=n.imageCache=n.imageCache||{},i=a[t];if(i)return i.image.complete||i.image.addEventListener("load",r),i.image;i=a[t]=a[t]||{};var s=i.image=new Image;s.addEventListener("load",r),s.addEventListener("error",function(){s.error=!0});var o="data:",l=t.substring(0,o.length).toLowerCase()===o;return l||(e=e==="null"?null:e,s.crossOrigin=e),s.src=t,s};var Io={};Io.registerBinding=function(t,e,r,n){var a=Array.prototype.slice.apply(arguments,[1]);if(Array.isArray(t)){for(var i=[],s=0;s<t.length;s++){var o=t[s];if(o!==void 0){var l=this.binder(o);i.push(l.on.apply(l,a))}}return i}var l=this.binder(t);return l.on.apply(l,a)};Io.binder=function(t){var e=this,r=e.cy.window(),n=t===r||t===r.document||t===r.document.body||c$(t);if(e.supportsPassiveEvents==null){var a=!1;try{var i=Object.defineProperty({},"passive",{get:function(){return a=!0,!0}});r.addEventListener("test",null,i)}catch{}e.supportsPassiveEvents=a}var s=function(l,u,c){var d=Array.prototype.slice.call(arguments);return n&&e.supportsPassiveEvents&&(d[2]={capture:c??!1,passive:!1,once:!1}),e.bindings.push({target:t,args:d}),(t.addEventListener||t.on).apply(t,d),this};return{on:s,addEventListener:s,addListener:s,bind:s}};Io.nodeIsDraggable=function(t){return t&&t.isNode()&&!t.locked()&&t.grabbable()};Io.nodeIsGrabbable=function(t){return this.nodeIsDraggable(t)&&t.interactive()};Io.load=function(){var t=this,e=t.cy.window(),r=function(M){return M.selected()},n=function(M){var Q=M.getRootNode();if(Q&&Q.nodeType===11&&Q.host!==void 0)return Q},a=function(M,Q,ne,re){M==null&&(M=t.cy);for(var se=0;se<Q.length;se++){var ye=Q[se];M.emit({originalEvent:ne,type:ye,position:re})}},i=function(M){return M.shiftKey||M.metaKey||M.ctrlKey},s=function(M,Q){var ne=!0;if(t.cy.hasCompoundNodes()&&M&&M.pannable())for(var re=0;Q&&re<Q.length;re++){var M=Q[re];if(M.isNode()&&M.isParent()&&!M.pannable()){ne=!1;break}}else ne=!0;return ne},o=function(M){M[0]._private.grabbed=!0},l=function(M){M[0]._private.grabbed=!1},u=function(M){M[0]._private.rscratch.inDragLayer=!0},c=function(M){M[0]._private.rscratch.inDragLayer=!1},d=function(M){M[0]._private.rscratch.isGrabTarget=!0},f=function(M){M[0]._private.rscratch.isGrabTarget=!1},v=function(M,Q){var ne=Q.addToList,re=ne.has(M);!re&&M.grabbable()&&!M.locked()&&(ne.merge(M),o(M))},p=function(M,Q){if(M.cy().hasCompoundNodes()&&!(Q.inDragLayer==null&&Q.addToList==null)){var ne=M.descendants();Q.inDragLayer&&(ne.forEach(u),ne.connectedEdges().forEach(u)),Q.addToList&&v(ne,Q)}},y=function(M,Q){Q=Q||{};var ne=M.cy().hasCompoundNodes();Q.inDragLayer&&(M.forEach(u),M.neighborhood().stdFilter(function(re){return!ne||re.isEdge()}).forEach(u)),Q.addToList&&M.forEach(function(re){v(re,Q)}),p(M,Q),x(M,{inDragLayer:Q.inDragLayer}),t.updateCachedGrabbedEles()},m=y,g=function(M){M&&(t.getCachedZSortedEles().forEach(function(Q){l(Q),c(Q),f(Q)}),t.updateCachedGrabbedEles())},x=function(M,Q){if(!(Q.inDragLayer==null&&Q.addToList==null)&&M.cy().hasCompoundNodes()){var ne=M.ancestors().orphans();if(!ne.same(M)){var re=ne.descendants().spawnSelf().merge(ne).unmerge(M).unmerge(M.descendants()),se=re.connectedEdges();Q.inDragLayer&&(se.forEach(u),re.forEach(u)),Q.addToList&&re.forEach(function(ye){v(ye,Q)})}}},b=function(){document.activeElement!=null&&document.activeElement.blur!=null&&document.activeElement.blur()},w=typeof MutationObserver<"u",E=typeof ResizeObserver<"u";w?(t.removeObserver=new MutationObserver(function(Z){for(var M=0;M<Z.length;M++){var Q=Z[M],ne=Q.removedNodes;if(ne)for(var re=0;re<ne.length;re++){var se=ne[re];if(se===t.container){t.destroy();break}}}}),t.container.parentNode&&t.removeObserver.observe(t.container.parentNode,{childList:!0})):t.registerBinding(t.container,"DOMNodeRemoved",function(Z){t.destroy()});var C=qu(function(){t.cy.resize()},100);w&&(t.styleObserver=new MutationObserver(C),t.styleObserver.observe(t.container,{attributes:!0})),t.registerBinding(e,"resize",C),E&&(t.resizeObserver=new ResizeObserver(C),t.resizeObserver.observe(t.container));var S=function(M,Q){for(;M!=null;)Q(M),M=M.parentNode},T=function(){t.invalidateContainerClientCoordsCache()};S(t.container,function(Z){t.registerBinding(Z,"transitionend",T),t.registerBinding(Z,"animationend",T),t.registerBinding(Z,"scroll",T)}),t.registerBinding(t.container,"contextmenu",function(Z){Z.preventDefault()});var P=function(){return t.selection[4]!==0},A=function(M){for(var Q=t.findContainerClientCoords(),ne=Q[0],re=Q[1],se=Q[2],ye=Q[3],le=M.touches?M.touches:[M],he=!1,de=0;de<le.length;de++){var Se=le[de];if(ne<=Se.clientX&&Se.clientX<=ne+se&&re<=Se.clientY&&Se.clientY<=re+ye){he=!0;break}}if(!he)return!1;for(var Oe=t.container,Le=M.target,ke=Le.parentNode,Ae=!1;ke;){if(ke===Oe){Ae=!0;break}ke=ke.parentNode}return!!Ae};t.registerBinding(t.container,"mousedown",function(M){if(A(M)&&!(t.hoverData.which===1&&M.which!==1)){M.preventDefault(),b(),t.hoverData.capture=!0,t.hoverData.which=M.which;var Q=t.cy,ne=[M.clientX,M.clientY],re=t.projectIntoViewport(ne[0],ne[1]),se=t.selection,ye=t.findNearestElements(re[0],re[1],!0,!1),le=ye[0],he=t.dragData.possibleDragElements;t.hoverData.mdownPos=re,t.hoverData.mdownGPos=ne;var de=function(Te){return{originalEvent:M,type:Te,position:{x:re[0],y:re[1]}}},Se=function(){t.hoverData.tapholdCancelled=!1,clearTimeout(t.hoverData.tapholdTimeout),t.hoverData.tapholdTimeout=setTimeout(function(){if(!t.hoverData.tapholdCancelled){var Te=t.hoverData.down;Te?Te.emit(de("taphold")):Q.emit(de("taphold"))}},t.tapholdDuration)};if(M.which==3){t.hoverData.cxtStarted=!0;var Oe={originalEvent:M,type:"cxttapstart",position:{x:re[0],y:re[1]}};le?(le.activate(),le.emit(Oe),t.hoverData.down=le):Q.emit(Oe),t.hoverData.downTime=new Date().getTime(),t.hoverData.cxtDragged=!1}else if(M.which==1){le&&le.activate();{if(le!=null&&t.nodeIsGrabbable(le)){var Le=function(Te){Te.emit(de("grab"))};if(d(le),!le.selected())he=t.dragData.possibleDragElements=Q.collection(),m(le,{addToList:he}),le.emit(de("grabon")).emit(de("grab"));else{he=t.dragData.possibleDragElements=Q.collection();var ke=Q.$(function(Ae){return Ae.isNode()&&Ae.selected()&&t.nodeIsGrabbable(Ae)});y(ke,{addToList:he}),le.emit(de("grabon")),ke.forEach(Le)}t.redrawHint("eles",!0),t.redrawHint("drag",!0)}t.hoverData.down=le,t.hoverData.downs=ye,t.hoverData.downTime=new Date().getTime()}a(le,["mousedown","tapstart","vmousedown"],M,{x:re[0],y:re[1]}),le==null?(se[4]=1,t.data.bgActivePosistion={x:re[0],y:re[1]},t.redrawHint("select",!0),t.redraw()):le.pannable()&&(se[4]=1),Se()}se[0]=se[2]=re[0],se[1]=se[3]=re[1]}},!1);var j=n(t.container);t.registerBinding([e,j],"mousemove",function(M){var Q=t.hoverData.capture;if(!(!Q&&!A(M))){var ne=!1,re=t.cy,se=re.zoom(),ye=[M.clientX,M.clientY],le=t.projectIntoViewport(ye[0],ye[1]),he=t.hoverData.mdownPos,de=t.hoverData.mdownGPos,Se=t.selection,Oe=null;!t.hoverData.draggingEles&&!t.hoverData.dragging&&!t.hoverData.selecting&&(Oe=t.findNearestElement(le[0],le[1],!0,!1));var Le=t.hoverData.last,ke=t.hoverData.down,Ae=[le[0]-Se[2],le[1]-Se[3]],Te=t.dragData.possibleDragElements,Ge;if(de){var Me=ye[0]-de[0],Ie=Me*Me,Ze=ye[1]-de[1],$e=Ze*Ze,He=Ie+$e;t.hoverData.isOverThresholdDrag=Ge=He>=t.desktopTapThreshold2}var ct=i(M);Ge&&(t.hoverData.tapholdCancelled=!0);var gt=function(){var Kt=t.hoverData.dragDelta=t.hoverData.dragDelta||[];Kt.length===0?(Kt.push(Ae[0]),Kt.push(Ae[1])):(Kt[0]+=Ae[0],Kt[1]+=Ae[1])};ne=!0,a(Oe,["mousemove","vmousemove","tapdrag"],M,{x:le[0],y:le[1]});var tt=function(Kt){return{originalEvent:M,type:Kt,position:{x:le[0],y:le[1]}}},lt=function(){t.data.bgActivePosistion=void 0,t.hoverData.selecting||re.emit(tt("boxstart")),Se[4]=1,t.hoverData.selecting=!0,t.redrawHint("select",!0),t.redraw()};if(t.hoverData.which===3){if(Ge){var qt=tt("cxtdrag");ke?ke.emit(qt):re.emit(qt),t.hoverData.cxtDragged=!0,(!t.hoverData.cxtOver||Oe!==t.hoverData.cxtOver)&&(t.hoverData.cxtOver&&t.hoverData.cxtOver.emit(tt("cxtdragout")),t.hoverData.cxtOver=Oe,Oe&&Oe.emit(tt("cxtdragover")))}}else if(t.hoverData.dragging){if(ne=!0,re.panningEnabled()&&re.userPanningEnabled()){var rn;if(t.hoverData.justStartedPan){var Ua=t.hoverData.mdownPos;rn={x:(le[0]-Ua[0])*se,y:(le[1]-Ua[1])*se},t.hoverData.justStartedPan=!1}else rn={x:Ae[0]*se,y:Ae[1]*se};re.panBy(rn),re.emit(tt("dragpan")),t.hoverData.dragged=!0}le=t.projectIntoViewport(M.clientX,M.clientY)}else if(Se[4]==1&&(ke==null||ke.pannable())){if(Ge){if(!t.hoverData.dragging&&re.boxSelectionEnabled()&&(ct||!re.panningEnabled()||!re.userPanningEnabled()))lt();else if(!t.hoverData.selecting&&re.panningEnabled()&&re.userPanningEnabled()){var Ar=s(ke,t.hoverData.downs);Ar&&(t.hoverData.dragging=!0,t.hoverData.justStartedPan=!0,Se[4]=0,t.data.bgActivePosistion=Js(he),t.redrawHint("select",!0),t.redraw())}ke&&ke.pannable()&&ke.active()&&ke.unactivate()}}else{if(ke&&ke.pannable()&&ke.active()&&ke.unactivate(),(!ke||!ke.grabbed())&&Oe!=Le&&(Le&&a(Le,["mouseout","tapdragout"],M,{x:le[0],y:le[1]}),Oe&&a(Oe,["mouseover","tapdragover"],M,{x:le[0],y:le[1]}),t.hoverData.last=Oe),ke)if(Ge){if(re.boxSelectionEnabled()&&ct)ke&&ke.grabbed()&&(g(Te),ke.emit(tt("freeon")),Te.emit(tt("free")),t.dragData.didDrag&&(ke.emit(tt("dragfreeon")),Te.emit(tt("dragfree")))),lt();else if(ke&&ke.grabbed()&&t.nodeIsDraggable(ke)){var It=!t.dragData.didDrag;It&&t.redrawHint("eles",!0),t.dragData.didDrag=!0,t.hoverData.draggingEles||y(Te,{inDragLayer:!0});var Pt={x:0,y:0};if(_e(Ae[0])&&_e(Ae[1])&&(Pt.x+=Ae[0],Pt.y+=Ae[1],It)){var jt=t.hoverData.dragDelta;jt&&_e(jt[0])&&_e(jt[1])&&(Pt.x+=jt[0],Pt.y+=jt[1])}t.hoverData.draggingEles=!0,Te.silentShift(Pt).emit(tt("position")).emit(tt("drag")),t.redrawHint("drag",!0),t.redraw()}}else gt();ne=!0}if(Se[2]=le[0],Se[3]=le[1],ne)return M.stopPropagation&&M.stopPropagation(),M.preventDefault&&M.preventDefault(),!1}},!1);var R,O,N;t.registerBinding(e,"mouseup",function(M){if(!(t.hoverData.which===1&&M.which!==1&&t.hoverData.capture)){var Q=t.hoverData.capture;if(Q){t.hoverData.capture=!1;var ne=t.cy,re=t.projectIntoViewport(M.clientX,M.clientY),se=t.selection,ye=t.findNearestElement(re[0],re[1],!0,!1),le=t.dragData.possibleDragElements,he=t.hoverData.down,de=i(M);t.data.bgActivePosistion&&(t.redrawHint("select",!0),t.redraw()),t.hoverData.tapholdCancelled=!0,t.data.bgActivePosistion=void 0,he&&he.unactivate();var Se=function(Me){return{originalEvent:M,type:Me,position:{x:re[0],y:re[1]}}};if(t.hoverData.which===3){var Oe=Se("cxttapend");if(he?he.emit(Oe):ne.emit(Oe),!t.hoverData.cxtDragged){var Le=Se("cxttap");he?he.emit(Le):ne.emit(Le)}t.hoverData.cxtDragged=!1,t.hoverData.which=null}else if(t.hoverData.which===1){if(a(ye,["mouseup","tapend","vmouseup"],M,{x:re[0],y:re[1]}),!t.dragData.didDrag&&!t.hoverData.dragged&&!t.hoverData.selecting&&!t.hoverData.isOverThresholdDrag&&(a(he,["click","tap","vclick"],M,{x:re[0],y:re[1]}),O=!1,M.timeStamp-N<=ne.multiClickDebounceTime()?(R&&clearTimeout(R),O=!0,N=null,a(he,["dblclick","dbltap","vdblclick"],M,{x:re[0],y:re[1]})):(R=setTimeout(function(){O||a(he,["oneclick","onetap","voneclick"],M,{x:re[0],y:re[1]})},ne.multiClickDebounceTime()),N=M.timeStamp)),he==null&&!t.dragData.didDrag&&!t.hoverData.selecting&&!t.hoverData.dragged&&!i(M)&&(ne.$(r).unselect(["tapunselect"]),le.length>0&&t.redrawHint("eles",!0),t.dragData.possibleDragElements=le=ne.collection()),ye==he&&!t.dragData.didDrag&&!t.hoverData.selecting&&ye!=null&&ye._private.selectable&&(t.hoverData.dragging||(ne.selectionType()==="additive"||de?ye.selected()?ye.unselect(["tapunselect"]):ye.select(["tapselect"]):de||(ne.$(r).unmerge(ye).unselect(["tapunselect"]),ye.select(["tapselect"]))),t.redrawHint("eles",!0)),t.hoverData.selecting){var ke=ne.collection(t.getAllInBox(se[0],se[1],se[2],se[3]));t.redrawHint("select",!0),ke.length>0&&t.redrawHint("eles",!0),ne.emit(Se("boxend"));var Ae=function(Me){return Me.selectable()&&!Me.selected()};ne.selectionType()==="additive"||de||ne.$(r).unmerge(ke).unselect(),ke.emit(Se("box")).stdFilter(Ae).select().emit(Se("boxselect")),t.redraw()}if(t.hoverData.dragging&&(t.hoverData.dragging=!1,t.redrawHint("select",!0),t.redrawHint("eles",!0),t.redraw()),!se[4]){t.redrawHint("drag",!0),t.redrawHint("eles",!0);var Te=he&&he.grabbed();g(le),Te&&(he.emit(Se("freeon")),le.emit(Se("free")),t.dragData.didDrag&&(he.emit(Se("dragfreeon")),le.emit(Se("dragfree"))))}}se[4]=0,t.hoverData.down=null,t.hoverData.cxtStarted=!1,t.hoverData.draggingEles=!1,t.hoverData.selecting=!1,t.hoverData.isOverThresholdDrag=!1,t.dragData.didDrag=!1,t.hoverData.dragged=!1,t.hoverData.dragDelta=[],t.hoverData.mdownPos=null,t.hoverData.mdownGPos=null,t.hoverData.which=null}}},!1);var D=[],L=4,_,k=1e5,I=function(M,Q){for(var ne=0;ne<M.length;ne++)if(M[ne]%Q!==0)return!1;return!0},F=function(M){for(var Q=Math.abs(M[0]),ne=1;ne<M.length;ne++)if(Math.abs(M[ne])!==Q)return!1;return!0},B=function(M){var Q=!1,ne=M.deltaY;if(ne==null&&(M.wheelDeltaY!=null?ne=M.wheelDeltaY/4:M.wheelDelta!=null&&(ne=M.wheelDelta/4)),ne!==0){if(_==null)if(D.length>=L){var re=D;if(_=I(re,5),!_){var se=Math.abs(re[0]);_=F(re)&&se>5}if(_)for(var ye=0;ye<re.length;ye++)k=Math.min(Math.abs(re[ye]),k)}else D.push(ne),Q=!0;else _&&(k=Math.min(Math.abs(ne),k));if(!t.scrollingPage){var le=t.cy,he=le.zoom(),de=le.pan(),Se=t.projectIntoViewport(M.clientX,M.clientY),Oe=[Se[0]*he+de.x,Se[1]*he+de.y];if(t.hoverData.draggingEles||t.hoverData.dragging||t.hoverData.cxtStarted||P()){M.preventDefault();return}if(le.panningEnabled()&&le.userPanningEnabled()&&le.zoomingEnabled()&&le.userZoomingEnabled()){M.preventDefault(),t.data.wheelZooming=!0,clearTimeout(t.data.wheelTimeout),t.data.wheelTimeout=setTimeout(function(){t.data.wheelZooming=!1,t.redrawHint("eles",!0),t.redraw()},150);var Le;Q&&Math.abs(ne)>5&&(ne=BE(ne)*5),Le=ne/-250,_&&(Le/=k,Le*=3),Le=Le*t.wheelSensitivity;var ke=M.deltaMode===1;ke&&(Le*=33);var Ae=le.zoom()*Math.pow(10,Le);M.type==="gesturechange"&&(Ae=t.gestureStartZoom*M.scale),le.zoom({level:Ae,renderedPosition:{x:Oe[0],y:Oe[1]}}),le.emit({type:M.type==="gesturechange"?"pinchzoom":"scrollzoom",originalEvent:M,position:{x:Se[0],y:Se[1]}})}}}};t.registerBinding(t.container,"wheel",B,!0),t.registerBinding(e,"scroll",function(M){t.scrollingPage=!0,clearTimeout(t.scrollingPageTimeout),t.scrollingPageTimeout=setTimeout(function(){t.scrollingPage=!1},250)},!0),t.registerBinding(t.container,"gesturestart",function(M){t.gestureStartZoom=t.cy.zoom(),t.hasTouchStarted||M.preventDefault()},!0),t.registerBinding(t.container,"gesturechange",function(Z){t.hasTouchStarted||B(Z)},!0),t.registerBinding(t.container,"mouseout",function(M){var Q=t.projectIntoViewport(M.clientX,M.clientY);t.cy.emit({originalEvent:M,type:"mouseout",position:{x:Q[0],y:Q[1]}})},!1),t.registerBinding(t.container,"mouseover",function(M){var Q=t.projectIntoViewport(M.clientX,M.clientY);t.cy.emit({originalEvent:M,type:"mouseover",position:{x:Q[0],y:Q[1]}})},!1);var $,W,z,q,G,J,ae,Y,H,X,ee,ie,oe,me=function(M,Q,ne,re){return Math.sqrt((ne-M)*(ne-M)+(re-Q)*(re-Q))},De=function(M,Q,ne,re){return(ne-M)*(ne-M)+(re-Q)*(re-Q)},ge;t.registerBinding(t.container,"touchstart",ge=function(M){if(t.hasTouchStarted=!0,!!A(M)){b(),t.touchData.capture=!0,t.data.bgActivePosistion=void 0;var Q=t.cy,ne=t.touchData.now,re=t.touchData.earlier;if(M.touches[0]){var se=t.projectIntoViewport(M.touches[0].clientX,M.touches[0].clientY);ne[0]=se[0],ne[1]=se[1]}if(M.touches[1]){var se=t.projectIntoViewport(M.touches[1].clientX,M.touches[1].clientY);ne[2]=se[0],ne[3]=se[1]}if(M.touches[2]){var se=t.projectIntoViewport(M.touches[2].clientX,M.touches[2].clientY);ne[4]=se[0],ne[5]=se[1]}var ye=function(ct){return{originalEvent:M,type:ct,position:{x:ne[0],y:ne[1]}}};if(M.touches[1]){t.touchData.singleTouchMoved=!0,g(t.dragData.touchDragEles);var le=t.findContainerClientCoords();H=le[0],X=le[1],ee=le[2],ie=le[3],$=M.touches[0].clientX-H,W=M.touches[0].clientY-X,z=M.touches[1].clientX-H,q=M.touches[1].clientY-X,oe=0<=$&&$<=ee&&0<=z&&z<=ee&&0<=W&&W<=ie&&0<=q&&q<=ie;var he=Q.pan(),de=Q.zoom();G=me($,W,z,q),J=De($,W,z,q),ae=[($+z)/2,(W+q)/2],Y=[(ae[0]-he.x)/de,(ae[1]-he.y)/de];var Se=200,Oe=Se*Se;if(J<Oe&&!M.touches[2]){var Le=t.findNearestElement(ne[0],ne[1],!0,!0),ke=t.findNearestElement(ne[2],ne[3],!0,!0);Le&&Le.isNode()?(Le.activate().emit(ye("cxttapstart")),t.touchData.start=Le):ke&&ke.isNode()?(ke.activate().emit(ye("cxttapstart")),t.touchData.start=ke):Q.emit(ye("cxttapstart")),t.touchData.start&&(t.touchData.start._private.grabbed=!1),t.touchData.cxt=!0,t.touchData.cxtDragged=!1,t.data.bgActivePosistion=void 0,t.redraw();return}}if(M.touches[2])Q.boxSelectionEnabled()&&M.preventDefault();else if(!M.touches[1]){if(M.touches[0]){var Ae=t.findNearestElements(ne[0],ne[1],!0,!0),Te=Ae[0];if(Te!=null&&(Te.activate(),t.touchData.start=Te,t.touchData.starts=Ae,t.nodeIsGrabbable(Te))){var Ge=t.dragData.touchDragEles=Q.collection(),Me=null;t.redrawHint("eles",!0),t.redrawHint("drag",!0),Te.selected()?(Me=Q.$(function(He){return He.selected()&&t.nodeIsGrabbable(He)}),y(Me,{addToList:Ge})):m(Te,{addToList:Ge}),d(Te),Te.emit(ye("grabon")),Me?Me.forEach(function(He){He.emit(ye("grab"))}):Te.emit(ye("grab"))}a(Te,["touchstart","tapstart","vmousedown"],M,{x:ne[0],y:ne[1]}),Te==null&&(t.data.bgActivePosistion={x:se[0],y:se[1]},t.redrawHint("select",!0),t.redraw()),t.touchData.singleTouchMoved=!1,t.touchData.singleTouchStartTime=+new Date,clearTimeout(t.touchData.tapholdTimeout),t.touchData.tapholdTimeout=setTimeout(function(){t.touchData.singleTouchMoved===!1&&!t.pinching&&!t.touchData.selecting&&a(t.touchData.start,["taphold"],M,{x:ne[0],y:ne[1]})},t.tapholdDuration)}}if(M.touches.length>=1){for(var Ie=t.touchData.startPosition=[null,null,null,null,null,null],Ze=0;Ze<ne.length;Ze++)Ie[Ze]=re[Ze]=ne[Ze];var $e=M.touches[0];t.touchData.startGPosition=[$e.clientX,$e.clientY]}}},!1);var pe;t.registerBinding(e,"touchmove",pe=function(M){var Q=t.touchData.capture;if(!(!Q&&!A(M))){var ne=t.selection,re=t.cy,se=t.touchData.now,ye=t.touchData.earlier,le=re.zoom();if(M.touches[0]){var he=t.projectIntoViewport(M.touches[0].clientX,M.touches[0].clientY);se[0]=he[0],se[1]=he[1]}if(M.touches[1]){var he=t.projectIntoViewport(M.touches[1].clientX,M.touches[1].clientY);se[2]=he[0],se[3]=he[1]}if(M.touches[2]){var he=t.projectIntoViewport(M.touches[2].clientX,M.touches[2].clientY);se[4]=he[0],se[5]=he[1]}var de=function(qB){return{originalEvent:M,type:qB,position:{x:se[0],y:se[1]}}},Se=t.touchData.startGPosition,Oe;if(Q&&M.touches[0]&&Se){for(var Le=[],ke=0;ke<se.length;ke++)Le[ke]=se[ke]-ye[ke];var Ae=M.touches[0].clientX-Se[0],Te=Ae*Ae,Ge=M.touches[0].clientY-Se[1],Me=Ge*Ge,Ie=Te+Me;Oe=Ie>=t.touchTapThreshold2}if(Q&&t.touchData.cxt){M.preventDefault();var Ze=M.touches[0].clientX-H,$e=M.touches[0].clientY-X,He=M.touches[1].clientX-H,ct=M.touches[1].clientY-X,gt=De(Ze,$e,He,ct),tt=gt/J,lt=150,qt=lt*lt,rn=1.5,Ua=rn*rn;if(tt>=Ua||gt>=qt){t.touchData.cxt=!1,t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);var Ar=de("cxttapend");t.touchData.start?(t.touchData.start.unactivate().emit(Ar),t.touchData.start=null):re.emit(Ar)}}if(Q&&t.touchData.cxt){var Ar=de("cxtdrag");t.data.bgActivePosistion=void 0,t.redrawHint("select",!0),t.touchData.start?t.touchData.start.emit(Ar):re.emit(Ar),t.touchData.start&&(t.touchData.start._private.grabbed=!1),t.touchData.cxtDragged=!0;var It=t.findNearestElement(se[0],se[1],!0,!0);(!t.touchData.cxtOver||It!==t.touchData.cxtOver)&&(t.touchData.cxtOver&&t.touchData.cxtOver.emit(de("cxtdragout")),t.touchData.cxtOver=It,It&&It.emit(de("cxtdragover")))}else if(Q&&M.touches[2]&&re.boxSelectionEnabled())M.preventDefault(),t.data.bgActivePosistion=void 0,this.lastThreeTouch=+new Date,t.touchData.selecting||re.emit(de("boxstart")),t.touchData.selecting=!0,t.touchData.didSelect=!0,ne[4]=1,!ne||ne.length===0||ne[0]===void 0?(ne[0]=(se[0]+se[2]+se[4])/3,ne[1]=(se[1]+se[3]+se[5])/3,ne[2]=(se[0]+se[2]+se[4])/3+1,ne[3]=(se[1]+se[3]+se[5])/3+1):(ne[2]=(se[0]+se[2]+se[4])/3,ne[3]=(se[1]+se[3]+se[5])/3),t.redrawHint("select",!0),t.redraw();else if(Q&&M.touches[1]&&!t.touchData.didSelect&&re.zoomingEnabled()&&re.panningEnabled()&&re.userZoomingEnabled()&&re.userPanningEnabled()){M.preventDefault(),t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);var Pt=t.dragData.touchDragEles;if(Pt){t.redrawHint("drag",!0);for(var jt=0;jt<Pt.length;jt++){var Zn=Pt[jt]._private;Zn.grabbed=!1,Zn.rscratch.inDragLayer=!1}}var Kt=t.touchData.start,Ze=M.touches[0].clientX-H,$e=M.touches[0].clientY-X,He=M.touches[1].clientX-H,ct=M.touches[1].clientY-X,pa=me(Ze,$e,He,ct),nc=pa/G;if(oe){var Vo=Ze-$,ac=$e-W,Go=He-z,Fh=ct-q,Ho=(Vo+Go)/2,ic=(ac+Fh)/2,$a=re.zoom(),Mi=$a*nc,Ii=re.pan(),Ut=Y[0]*$a+Ii.x,Xe=Y[1]*$a+Ii.y,ut={x:-Mi/$a*(Ut-Ii.x-Ho)+Ut,y:-Mi/$a*(Xe-Ii.y-ic)+Xe};if(Kt&&Kt.active()){var Pt=t.dragData.touchDragEles;g(Pt),t.redrawHint("drag",!0),t.redrawHint("eles",!0),Kt.unactivate().emit(de("freeon")),Pt.emit(de("free")),t.dragData.didDrag&&(Kt.emit(de("dragfreeon")),Pt.emit(de("dragfree")))}re.viewport({zoom:Mi,pan:ut,cancelOnFailedZoom:!0}),re.emit(de("pinchzoom")),G=pa,$=Ze,W=$e,z=He,q=ct,t.pinching=!0}if(M.touches[0]){var he=t.projectIntoViewport(M.touches[0].clientX,M.touches[0].clientY);se[0]=he[0],se[1]=he[1]}if(M.touches[1]){var he=t.projectIntoViewport(M.touches[1].clientX,M.touches[1].clientY);se[2]=he[0],se[3]=he[1]}if(M.touches[2]){var he=t.projectIntoViewport(M.touches[2].clientX,M.touches[2].clientY);se[4]=he[0],se[5]=he[1]}}else if(M.touches[0]&&!t.touchData.didSelect){var $t=t.touchData.start,xr=t.touchData.last,It;if(!t.hoverData.draggingEles&&!t.swipePanning&&(It=t.findNearestElement(se[0],se[1],!0,!0)),Q&&$t!=null&&M.preventDefault(),Q&&$t!=null&&t.nodeIsDraggable($t))if(Oe){var Pt=t.dragData.touchDragEles,OS=!t.dragData.didDrag;OS&&y(Pt,{inDragLayer:!0}),t.dragData.didDrag=!0;var Wo={x:0,y:0};if(_e(Le[0])&&_e(Le[1])&&(Wo.x+=Le[0],Wo.y+=Le[1],OS)){t.redrawHint("eles",!0);var An=t.touchData.dragDelta;An&&_e(An[0])&&_e(An[1])&&(Wo.x+=An[0],Wo.y+=An[1])}t.hoverData.draggingEles=!0,Pt.silentShift(Wo).emit(de("position")).emit(de("drag")),t.redrawHint("drag",!0),t.touchData.startPosition[0]==ye[0]&&t.touchData.startPosition[1]==ye[1]&&t.redrawHint("eles",!0),t.redraw()}else{var An=t.touchData.dragDelta=t.touchData.dragDelta||[];An.length===0?(An.push(Le[0]),An.push(Le[1])):(An[0]+=Le[0],An[1]+=Le[1])}if(a($t||It,["touchmove","tapdrag","vmousemove"],M,{x:se[0],y:se[1]}),(!$t||!$t.grabbed())&&It!=xr&&(xr&&xr.emit(de("tapdragout")),It&&It.emit(de("tapdragover"))),t.touchData.last=It,Q)for(var jt=0;jt<se.length;jt++)se[jt]&&t.touchData.startPosition[jt]&&Oe&&(t.touchData.singleTouchMoved=!0);if(Q&&($t==null||$t.pannable())&&re.panningEnabled()&&re.userPanningEnabled()){var zB=s($t,t.touchData.starts);zB&&(M.preventDefault(),t.data.bgActivePosistion||(t.data.bgActivePosistion=Js(t.touchData.startPosition)),t.swipePanning?(re.panBy({x:Le[0]*le,y:Le[1]*le}),re.emit(de("dragpan"))):Oe&&(t.swipePanning=!0,re.panBy({x:Ae*le,y:Ge*le}),re.emit(de("dragpan")),$t&&($t.unactivate(),t.redrawHint("select",!0),t.touchData.start=null)));var he=t.projectIntoViewport(M.touches[0].clientX,M.touches[0].clientY);se[0]=he[0],se[1]=he[1]}}for(var ke=0;ke<se.length;ke++)ye[ke]=se[ke];Q&&M.touches.length>0&&!t.hoverData.draggingEles&&!t.swipePanning&&t.data.bgActivePosistion!=null&&(t.data.bgActivePosistion=void 0,t.redrawHint("select",!0),t.redraw())}},!1);var we;t.registerBinding(e,"touchcancel",we=function(M){var Q=t.touchData.start;t.touchData.capture=!1,Q&&Q.unactivate()});var xe,Ee,V,K;if(t.registerBinding(e,"touchend",xe=function(M){var Q=t.touchData.start,ne=t.touchData.capture;if(ne)M.touches.length===0&&(t.touchData.capture=!1),M.preventDefault();else return;var re=t.selection;t.swipePanning=!1,t.hoverData.draggingEles=!1;var se=t.cy,ye=se.zoom(),le=t.touchData.now,he=t.touchData.earlier;if(M.touches[0]){var de=t.projectIntoViewport(M.touches[0].clientX,M.touches[0].clientY);le[0]=de[0],le[1]=de[1]}if(M.touches[1]){var de=t.projectIntoViewport(M.touches[1].clientX,M.touches[1].clientY);le[2]=de[0],le[3]=de[1]}if(M.touches[2]){var de=t.projectIntoViewport(M.touches[2].clientX,M.touches[2].clientY);le[4]=de[0],le[5]=de[1]}var Se=function(qt){return{originalEvent:M,type:qt,position:{x:le[0],y:le[1]}}};Q&&Q.unactivate();var Oe;if(t.touchData.cxt){if(Oe=Se("cxttapend"),Q?Q.emit(Oe):se.emit(Oe),!t.touchData.cxtDragged){var Le=Se("cxttap");Q?Q.emit(Le):se.emit(Le)}t.touchData.start&&(t.touchData.start._private.grabbed=!1),t.touchData.cxt=!1,t.touchData.start=null,t.redraw();return}if(!M.touches[2]&&se.boxSelectionEnabled()&&t.touchData.selecting){t.touchData.selecting=!1;var ke=se.collection(t.getAllInBox(re[0],re[1],re[2],re[3]));re[0]=void 0,re[1]=void 0,re[2]=void 0,re[3]=void 0,re[4]=0,t.redrawHint("select",!0),se.emit(Se("boxend"));var Ae=function(qt){return qt.selectable()&&!qt.selected()};ke.emit(Se("box")).stdFilter(Ae).select().emit(Se("boxselect")),ke.nonempty()&&t.redrawHint("eles",!0),t.redraw()}if(Q!=null&&Q.unactivate(),M.touches[2])t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);else if(!M.touches[1]){if(!M.touches[0]){if(!M.touches[0]){t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);var Te=t.dragData.touchDragEles;if(Q!=null){var Ge=Q._private.grabbed;g(Te),t.redrawHint("drag",!0),t.redrawHint("eles",!0),Ge&&(Q.emit(Se("freeon")),Te.emit(Se("free")),t.dragData.didDrag&&(Q.emit(Se("dragfreeon")),Te.emit(Se("dragfree")))),a(Q,["touchend","tapend","vmouseup","tapdragout"],M,{x:le[0],y:le[1]}),Q.unactivate(),t.touchData.start=null}else{var Me=t.findNearestElement(le[0],le[1],!0,!0);a(Me,["touchend","tapend","vmouseup","tapdragout"],M,{x:le[0],y:le[1]})}var Ie=t.touchData.startPosition[0]-le[0],Ze=Ie*Ie,$e=t.touchData.startPosition[1]-le[1],He=$e*$e,ct=Ze+He,gt=ct*ye*ye;t.touchData.singleTouchMoved||(Q||se.$(":selected").unselect(["tapunselect"]),a(Q,["tap","vclick"],M,{x:le[0],y:le[1]}),Ee=!1,M.timeStamp-K<=se.multiClickDebounceTime()?(V&&clearTimeout(V),Ee=!0,K=null,a(Q,["dbltap","vdblclick"],M,{x:le[0],y:le[1]})):(V=setTimeout(function(){Ee||a(Q,["onetap","voneclick"],M,{x:le[0],y:le[1]})},se.multiClickDebounceTime()),K=M.timeStamp)),Q!=null&&!t.dragData.didDrag&&Q._private.selectable&><t.touchTapThreshold2&&!t.pinching&&(se.selectionType()==="single"?(se.$(r).unmerge(Q).unselect(["tapunselect"]),Q.select(["tapselect"])):Q.selected()?Q.unselect(["tapunselect"]):Q.select(["tapselect"]),t.redrawHint("eles",!0)),t.touchData.singleTouchMoved=!0}}}for(var tt=0;tt<le.length;tt++)he[tt]=le[tt];t.dragData.didDrag=!1,M.touches.length===0&&(t.touchData.dragDelta=[],t.touchData.startPosition=[null,null,null,null,null,null],t.touchData.startGPosition=null,t.touchData.didSelect=!1),M.touches.length<2&&(M.touches.length===1&&(t.touchData.startGPosition=[M.touches[0].clientX,M.touches[0].clientY]),t.pinching=!1,t.redrawHint("eles",!0),t.redraw())},!1),typeof TouchEvent>"u"){var te=[],ue=function(M){return{clientX:M.clientX,clientY:M.clientY,force:1,identifier:M.pointerId,pageX:M.pageX,pageY:M.pageY,radiusX:M.width/2,radiusY:M.height/2,screenX:M.screenX,screenY:M.screenY,target:M.target}},fe=function(M){return{event:M,touch:ue(M)}},ve=function(M){te.push(fe(M))},be=function(M){for(var Q=0;Q<te.length;Q++){var ne=te[Q];if(ne.event.pointerId===M.pointerId){te.splice(Q,1);return}}},Ne=function(M){var Q=te.filter(function(ne){return ne.event.pointerId===M.pointerId})[0];Q.event=M,Q.touch=ue(M)},Ce=function(M){M.touches=te.map(function(Q){return Q.touch})},Re=function(M){return M.pointerType==="mouse"||M.pointerType===4};t.registerBinding(t.container,"pointerdown",function(Z){Re(Z)||(Z.preventDefault(),ve(Z),Ce(Z),ge(Z))}),t.registerBinding(t.container,"pointerup",function(Z){Re(Z)||(be(Z),Ce(Z),xe(Z))}),t.registerBinding(t.container,"pointercancel",function(Z){Re(Z)||(be(Z),Ce(Z),we(Z))}),t.registerBinding(t.container,"pointermove",function(Z){Re(Z)||(Z.preventDefault(),Ne(Z),Ce(Z),pe(Z))})}};var Fa={};Fa.generatePolygon=function(t,e){return this.nodeShapes[t]={renderer:this,name:t,points:e,draw:function(n,a,i,s,o,l){this.renderer.nodeShapeImpl("polygon",n,a,i,s,o,this.points)},intersectLine:function(n,a,i,s,o,l,u,c){return hu(o,l,this.points,n,a,i/2,s/2,u)},checkPoint:function(n,a,i,s,o,l,u,c){return _a(n,a,this.points,l,u,s,o,[0,-1],i)},hasMiterBounds:t!=="rectangle",miterBounds:function(n,a,i,s,o,l){return TV(this.points,n,a,i,s,o)}}};Fa.generateEllipse=function(){return this.nodeShapes.ellipse={renderer:this,name:"ellipse",draw:function(e,r,n,a,i,s){this.renderer.nodeShapeImpl(this.name,e,r,n,a,i)},intersectLine:function(e,r,n,a,i,s,o,l){return jV(i,s,e,r,n/2+o,a/2+o)},checkPoint:function(e,r,n,a,i,s,o,l){return Ji(e,r,a,i,s,o,n)}}};Fa.generateRoundPolygon=function(t,e){return this.nodeShapes[t]={renderer:this,name:t,points:e,getOrCreateCorners:function(n,a,i,s,o,l,u){if(l[u]!==void 0&&l[u+"-cx"]===n&&l[u+"-cy"]===a)return l[u];l[u]=new Array(e.length/2),l[u+"-cx"]=n,l[u+"-cy"]=a;var c=i/2,d=s/2;o=o==="auto"?TM(i,s):o;for(var f=new Array(e.length/2),v=0;v<e.length/2;v++)f[v]={x:n+c*e[v*2],y:a+d*e[v*2+1]};var p,y,m,g,x=f.length;for(y=f[x-1],p=0;p<x;p++)m=f[p%x],g=f[(p+1)%x],l[u][p]=ZE(y,m,g,o),y=m,m=g;return l[u]},draw:function(n,a,i,s,o,l,u){this.renderer.nodeShapeImpl("round-polygon",n,a,i,s,o,this.points,this.getOrCreateCorners(a,i,s,o,l,u,"drawCorners"))},intersectLine:function(n,a,i,s,o,l,u,c,d){return MV(o,l,this.points,n,a,i,s,u,this.getOrCreateCorners(n,a,i,s,c,d,"corners"))},checkPoint:function(n,a,i,s,o,l,u,c,d){return _V(n,a,this.points,l,u,s,o,this.getOrCreateCorners(l,u,s,o,c,d,"corners"))}}};Fa.generateRoundRectangle=function(){return this.nodeShapes["round-rectangle"]=this.nodeShapes.roundrectangle={renderer:this,name:"round-rectangle",points:Lr(4,0),draw:function(e,r,n,a,i,s){this.renderer.nodeShapeImpl(this.name,e,r,n,a,i,this.points,s)},intersectLine:function(e,r,n,a,i,s,o,l){return CM(i,s,e,r,n,a,o,l)},checkPoint:function(e,r,n,a,i,s,o,l){var u=a/2,c=i/2;l=l==="auto"?Ei(a,i):l,l=Math.min(u,c,l);var d=l*2;return!!(_a(e,r,this.points,s,o,a,i-d,[0,-1],n)||_a(e,r,this.points,s,o,a-d,i,[0,-1],n)||Ji(e,r,d,d,s-u+l,o-c+l,n)||Ji(e,r,d,d,s+u-l,o-c+l,n)||Ji(e,r,d,d,s+u-l,o+c-l,n)||Ji(e,r,d,d,s-u+l,o+c-l,n))}}};Fa.generateCutRectangle=function(){return this.nodeShapes["cut-rectangle"]=this.nodeShapes.cutrectangle={renderer:this,name:"cut-rectangle",cornerLength:qE(),points:Lr(4,0),draw:function(e,r,n,a,i,s){this.renderer.nodeShapeImpl(this.name,e,r,n,a,i,null,s)},generateCutTrianglePts:function(e,r,n,a,i){var s=i==="auto"?this.cornerLength:i,o=r/2,l=e/2,u=n-l,c=n+l,d=a-o,f=a+o;return{topLeft:[u,d+s,u+s,d,u+s,d+s],topRight:[c-s,d,c,d+s,c-s,d+s],bottomRight:[c,f-s,c-s,f,c-s,f-s],bottomLeft:[u+s,f,u,f-s,u+s,f-s]}},intersectLine:function(e,r,n,a,i,s,o,l){var u=this.generateCutTrianglePts(n+2*o,a+2*o,e,r,l),c=[].concat.apply([],[u.topLeft.splice(0,4),u.topRight.splice(0,4),u.bottomRight.splice(0,4),u.bottomLeft.splice(0,4)]);return hu(i,s,c,e,r)},checkPoint:function(e,r,n,a,i,s,o,l){var u=l==="auto"?this.cornerLength:l;if(_a(e,r,this.points,s,o,a,i-2*u,[0,-1],n)||_a(e,r,this.points,s,o,a-2*u,i,[0,-1],n))return!0;var c=this.generateCutTrianglePts(a,i,s,o);return Wr(e,r,c.topLeft)||Wr(e,r,c.topRight)||Wr(e,r,c.bottomRight)||Wr(e,r,c.bottomLeft)}}};Fa.generateBarrel=function(){return this.nodeShapes.barrel={renderer:this,name:"barrel",points:Lr(4,0),draw:function(e,r,n,a,i,s){this.renderer.nodeShapeImpl(this.name,e,r,n,a,i)},intersectLine:function(e,r,n,a,i,s,o,l){var u=.15,c=.5,d=.85,f=this.generateBarrelBezierPts(n+2*o,a+2*o,e,r),v=function(m){var g=uo({x:m[0],y:m[1]},{x:m[2],y:m[3]},{x:m[4],y:m[5]},u),x=uo({x:m[0],y:m[1]},{x:m[2],y:m[3]},{x:m[4],y:m[5]},c),b=uo({x:m[0],y:m[1]},{x:m[2],y:m[3]},{x:m[4],y:m[5]},d);return[m[0],m[1],g.x,g.y,x.x,x.y,b.x,b.y,m[4],m[5]]},p=[].concat(v(f.topLeft),v(f.topRight),v(f.bottomRight),v(f.bottomLeft));return hu(i,s,p,e,r)},generateBarrelBezierPts:function(e,r,n,a){var i=r/2,s=e/2,o=n-s,l=n+s,u=a-i,c=a+i,d=z1(e,r),f=d.heightOffset,v=d.widthOffset,p=d.ctrlPtOffsetPct*e,y={topLeft:[o,u+f,o+p,u,o+v,u],topRight:[l-v,u,l-p,u,l,u+f],bottomRight:[l,c-f,l-p,c,l-v,c],bottomLeft:[o+v,c,o+p,c,o,c-f]};return y.topLeft.isTop=!0,y.topRight.isTop=!0,y.bottomLeft.isBottom=!0,y.bottomRight.isBottom=!0,y},checkPoint:function(e,r,n,a,i,s,o,l){var u=z1(a,i),c=u.heightOffset,d=u.widthOffset;if(_a(e,r,this.points,s,o,a,i-2*c,[0,-1],n)||_a(e,r,this.points,s,o,a-2*d,i,[0,-1],n))return!0;for(var f=this.generateBarrelBezierPts(a,i,s,o),v=function(T,P,A){var j=A[4],R=A[2],O=A[0],N=A[5],D=A[1],L=Math.min(j,O),_=Math.max(j,O),k=Math.min(N,D),I=Math.max(N,D);if(L<=T&&T<=_&&k<=P&&P<=I){var F=IV(j,R,O),B=AV(F[0],F[1],F[2],T),$=B.filter(function(W){return 0<=W&&W<=1});if($.length>0)return $[0]}return null},p=Object.keys(f),y=0;y<p.length;y++){var m=p[y],g=f[m],x=v(e,r,g);if(x!=null){var b=g[5],w=g[3],E=g[1],C=ar(b,w,E,x);if(g.isTop&&C<=r||g.isBottom&&r<=C)return!0}}return!1}}};Fa.generateBottomRoundrectangle=function(){return this.nodeShapes["bottom-round-rectangle"]=this.nodeShapes.bottomroundrectangle={renderer:this,name:"bottom-round-rectangle",points:Lr(4,0),draw:function(e,r,n,a,i,s){this.renderer.nodeShapeImpl(this.name,e,r,n,a,i,this.points,s)},intersectLine:function(e,r,n,a,i,s,o,l){var u=e-(n/2+o),c=r-(a/2+o),d=c,f=e+(n/2+o),v=ii(i,s,e,r,u,c,f,d,!1);return v.length>0?v:CM(i,s,e,r,n,a,o,l)},checkPoint:function(e,r,n,a,i,s,o,l){l=l==="auto"?Ei(a,i):l;var u=2*l;if(_a(e,r,this.points,s,o,a,i-u,[0,-1],n)||_a(e,r,this.points,s,o,a-u,i,[0,-1],n))return!0;var c=a/2+2*n,d=i/2+2*n,f=[s-c,o-d,s-c,o,s+c,o,s+c,o-d];return!!(Wr(e,r,f)||Ji(e,r,u,u,s+a/2-l,o+i/2-l,n)||Ji(e,r,u,u,s-a/2+l,o+i/2-l,n))}}};Fa.registerNodeShapes=function(){var t=this.nodeShapes={},e=this;this.generateEllipse(),this.generatePolygon("triangle",Lr(3,0)),this.generateRoundPolygon("round-triangle",Lr(3,0)),this.generatePolygon("rectangle",Lr(4,0)),t.square=t.rectangle,this.generateRoundRectangle(),this.generateCutRectangle(),this.generateBarrel(),this.generateBottomRoundrectangle();{var r=[0,1,1,0,0,-1,-1,0];this.generatePolygon("diamond",r),this.generateRoundPolygon("round-diamond",r)}this.generatePolygon("pentagon",Lr(5,0)),this.generateRoundPolygon("round-pentagon",Lr(5,0)),this.generatePolygon("hexagon",Lr(6,0)),this.generateRoundPolygon("round-hexagon",Lr(6,0)),this.generatePolygon("heptagon",Lr(7,0)),this.generateRoundPolygon("round-heptagon",Lr(7,0)),this.generatePolygon("octagon",Lr(8,0)),this.generateRoundPolygon("round-octagon",Lr(8,0));var n=new Array(20);{var a=B1(5,0),i=B1(5,Math.PI/5),s=.5*(3-Math.sqrt(5));s*=1.57;for(var o=0;o<i.length/2;o++)i[o*2]*=s,i[o*2+1]*=s;for(var o=0;o<20/4;o++)n[o*4]=a[o*2],n[o*4+1]=a[o*2+1],n[o*4+2]=i[o*2],n[o*4+3]=i[o*2+1]}n=NM(n),this.generatePolygon("star",n),this.generatePolygon("vee",[-1,-1,0,-.333,1,-1,0,1]),this.generatePolygon("rhomboid",[-1,-1,.333,-1,1,1,-.333,1]),this.generatePolygon("right-rhomboid",[-.333,-1,1,-1,.333,1,-1,1]),this.nodeShapes.concavehexagon=this.generatePolygon("concave-hexagon",[-1,-.95,-.75,0,-1,.95,1,.95,.75,0,1,-.95]);{var l=[-1,-1,.25,-1,1,0,.25,1,-1,1];this.generatePolygon("tag",l),this.generateRoundPolygon("round-tag",l)}t.makePolygon=function(u){var c=u.join("$"),d="polygon-"+c,f;return(f=this[d])?f:e.generatePolygon(d,u)}};var Hu={};Hu.timeToRender=function(){return this.redrawTotalTime/this.redrawCount};Hu.redraw=function(t){t=t||bM();var e=this;e.averageRedrawTime===void 0&&(e.averageRedrawTime=0),e.lastRedrawTime===void 0&&(e.lastRedrawTime=0),e.lastDrawTime===void 0&&(e.lastDrawTime=0),e.requestedFrame=!0,e.renderOptions=t};Hu.beforeRender=function(t,e){if(!this.destroyed){e==null&&Tt("Priority is not optional for beforeRender");var r=this.beforeRenderCallbacks;r.push({fn:t,priority:e}),r.sort(function(n,a){return a.priority-n.priority})}};var jR=function(e,r,n){for(var a=e.beforeRenderCallbacks,i=0;i<a.length;i++)a[i].fn(r,n)};Hu.startRenderLoop=function(){var t=this,e=t.cy;if(!t.renderLoopStarted){t.renderLoopStarted=!0;var r=function(a){if(!t.destroyed){if(!e.batching())if(t.requestedFrame&&!t.skipFrame){jR(t,!0,a);var i=Da();t.render(t.renderOptions);var s=t.lastDrawTime=Da();t.averageRedrawTime===void 0&&(t.averageRedrawTime=s-i),t.redrawCount===void 0&&(t.redrawCount=0),t.redrawCount++,t.redrawTotalTime===void 0&&(t.redrawTotalTime=0);var o=s-i;t.redrawTotalTime+=o,t.lastRedrawTime=o,t.averageRedrawTime=t.averageRedrawTime/2+o/2,t.requestedFrame=!1}else jR(t,!1,a);t.skipFrame=!1,Kd(r)}};Kd(r)}};var J6=function(e){this.init(e)},TI=J6,Fo=TI.prototype;Fo.clientFunctions=["redrawHint","render","renderTo","matchCanvasSize","nodeShapeImpl","arrowShapeImpl"];Fo.init=function(t){var e=this;e.options=t,e.cy=t.cy;var r=e.container=t.cy.container(),n=e.cy.window();if(n){var a=n.document,i=a.head,s="__________cytoscape_stylesheet",o="__________cytoscape_container",l=a.getElementById(s)!=null;if(r.className.indexOf(o)<0&&(r.className=(r.className||"")+" "+o),!l){var u=a.createElement("style");u.id=s,u.textContent="."+o+" { position: relative; }",i.insertBefore(u,i.children[0])}var c=n.getComputedStyle(r),d=c.getPropertyValue("position");d==="static"&&ht("A Cytoscape container has style position:static and so can not use UI extensions properly")}e.selection=[void 0,void 0,void 0,void 0,0],e.bezierProjPcts=[.05,.225,.4,.5,.6,.775,.95],e.hoverData={down:null,last:null,downTime:null,triggerMode:null,dragging:!1,initialPan:[null,null],capture:!1},e.dragData={possibleDragElements:[]},e.touchData={start:null,capture:!1,startPosition:[null,null,null,null,null,null],singleTouchStartTime:null,singleTouchMoved:!0,now:[null,null,null,null,null,null],earlier:[null,null,null,null,null,null]},e.redraws=0,e.showFps=t.showFps,e.debug=t.debug,e.webgl=t.webgl,e.hideEdgesOnViewport=t.hideEdgesOnViewport,e.textureOnViewport=t.textureOnViewport,e.wheelSensitivity=t.wheelSensitivity,e.motionBlurEnabled=t.motionBlur,e.forcedPixelRatio=_e(t.pixelRatio)?t.pixelRatio:null,e.motionBlur=t.motionBlur,e.motionBlurOpacity=t.motionBlurOpacity,e.motionBlurTransparency=1-e.motionBlurOpacity,e.motionBlurPxRatio=1,e.mbPxRBlurry=1,e.minMbLowQualFrames=4,e.fullQualityMb=!1,e.clearedForMotionBlur=[],e.desktopTapThreshold=t.desktopTapThreshold,e.desktopTapThreshold2=t.desktopTapThreshold*t.desktopTapThreshold,e.touchTapThreshold=t.touchTapThreshold,e.touchTapThreshold2=t.touchTapThreshold*t.touchTapThreshold,e.tapholdDuration=500,e.bindings=[],e.beforeRenderCallbacks=[],e.beforeRenderPriorities={animations:400,eleCalcs:300,eleTxrDeq:200,lyrTxrDeq:150,lyrTxrSkip:100},e.registerNodeShapes(),e.registerArrowShapes(),e.registerCalculationListeners()};Fo.notify=function(t,e){var r=this,n=r.cy;if(!this.destroyed){if(t==="init"){r.load();return}if(t==="destroy"){r.destroy();return}(t==="add"||t==="remove"||t==="move"&&n.hasCompoundNodes()||t==="load"||t==="zorder"||t==="mount")&&r.invalidateCachedZSortedEles(),t==="viewport"&&r.redrawHint("select",!0),t==="gc"&&r.redrawHint("gc",!0),(t==="load"||t==="resize"||t==="mount")&&(r.invalidateContainerClientCoordsCache(),r.matchCanvasSize(r.container)),r.redrawHint("eles",!0),r.redrawHint("drag",!0),this.startRenderLoop(),this.redraw()}};Fo.destroy=function(){var t=this;t.destroyed=!0,t.cy.stopAnimationLoop();for(var e=0;e<t.bindings.length;e++){var r=t.bindings[e],n=r,a=n.target;(a.off||a.removeEventListener).apply(a,n.args)}if(t.bindings=[],t.beforeRenderCallbacks=[],t.onUpdateEleCalcsFns=[],t.removeObserver&&t.removeObserver.disconnect(),t.styleObserver&&t.styleObserver.disconnect(),t.resizeObserver&&t.resizeObserver.disconnect(),t.labelCalcDiv)try{document.body.removeChild(t.labelCalcDiv)}catch{}};Fo.isHeadless=function(){return!1};[QE,CI,NI,Io,Fa,Hu].forEach(function(t){We(Fo,t)});var zp=1e3/60,RI={setupDequeueing:function(e){return function(){var n=this,a=this.renderer;if(!n.dequeueingSetup){n.dequeueingSetup=!0;var i=qu(function(){a.redrawHint("eles",!0),a.redrawHint("drag",!0),a.redraw()},e.deqRedrawThreshold),s=function(u,c){var d=Da(),f=a.averageRedrawTime,v=a.lastRedrawTime,p=[],y=a.cy.extent(),m=a.getPixelRatio();for(u||a.flushRenderedStyleQueue();;){var g=Da(),x=g-d,b=g-c;if(v<zp){var w=zp-(u?f:0);if(b>=e.deqFastCost*w)break}else if(u){if(x>=e.deqCost*v||x>=e.deqAvgCost*f)break}else if(b>=e.deqNoDrawCost*zp)break;var E=e.deq(n,m,y);if(E.length>0)for(var C=0;C<E.length;C++)p.push(E[C]);else break}p.length>0&&(e.onDeqd(n,p),!u&&e.shouldRedraw(n,p,m,y)&&i())},o=e.priority||ME;a.beforeRender(s,o(n))}}}},eW=function(){function t(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Qd;ki(this,t),this.idsByKey=new Na,this.keyForId=new Na,this.cachesByLvl=new Na,this.lvls=[],this.getKey=e,this.doesEleInvalidateKey=r}return Li(t,[{key:"getIdsFor",value:function(r){r==null&&Tt("Can not get id list for null key");var n=this.idsByKey,a=this.idsByKey.get(r);return a||(a=new _o,n.set(r,a)),a}},{key:"addIdForKey",value:function(r,n){r!=null&&this.getIdsFor(r).add(n)}},{key:"deleteIdForKey",value:function(r,n){r!=null&&this.getIdsFor(r).delete(n)}},{key:"getNumberOfIdsForKey",value:function(r){return r==null?0:this.getIdsFor(r).size}},{key:"updateKeyMappingFor",value:function(r){var n=r.id(),a=this.keyForId.get(n),i=this.getKey(r);this.deleteIdForKey(a,n),this.addIdForKey(i,n),this.keyForId.set(n,i)}},{key:"deleteKeyMappingFor",value:function(r){var n=r.id(),a=this.keyForId.get(n);this.deleteIdForKey(a,n),this.keyForId.delete(n)}},{key:"keyHasChangedFor",value:function(r){var n=r.id(),a=this.keyForId.get(n),i=this.getKey(r);return a!==i}},{key:"isInvalid",value:function(r){return this.keyHasChangedFor(r)||this.doesEleInvalidateKey(r)}},{key:"getCachesAt",value:function(r){var n=this.cachesByLvl,a=this.lvls,i=n.get(r);return i||(i=new Na,n.set(r,i),a.push(r)),i}},{key:"getCache",value:function(r,n){return this.getCachesAt(n).get(r)}},{key:"get",value:function(r,n){var a=this.getKey(r),i=this.getCache(a,n);return i!=null&&this.updateKeyMappingFor(r),i}},{key:"getForCachedKey",value:function(r,n){var a=this.keyForId.get(r.id()),i=this.getCache(a,n);return i}},{key:"hasCache",value:function(r,n){return this.getCachesAt(n).has(r)}},{key:"has",value:function(r,n){var a=this.getKey(r);return this.hasCache(a,n)}},{key:"setCache",value:function(r,n,a){a.key=r,this.getCachesAt(n).set(r,a)}},{key:"set",value:function(r,n,a){var i=this.getKey(r);this.setCache(i,n,a),this.updateKeyMappingFor(r)}},{key:"deleteCache",value:function(r,n){this.getCachesAt(n).delete(r)}},{key:"delete",value:function(r,n){var a=this.getKey(r);this.deleteCache(a,n)}},{key:"invalidateKey",value:function(r){var n=this;this.lvls.forEach(function(a){return n.deleteCache(r,a)})}},{key:"invalidate",value:function(r){var n=r.id(),a=this.keyForId.get(n);this.deleteKeyMappingFor(r);var i=this.doesEleInvalidateKey(r);return i&&this.invalidateKey(a),i||this.getNumberOfIdsForKey(a)===0}}])}(),OR=25,Oc=50,pd=-4,J1=3,PI=7.99,tW=8,rW=1024,nW=1024,aW=1024,iW=.2,sW=.8,oW=10,lW=.15,uW=.1,cW=.9,dW=.9,fW=100,hW=1,to={dequeue:"dequeue",downscale:"downscale",highQuality:"highQuality"},vW=mr({getKey:null,doesEleInvalidateKey:Qd,drawElement:null,getBoundingBox:null,getRotationPoint:null,getRotationOffset:null,isVisible:mM,allowEdgeTxrCaching:!0,allowParentTxrCaching:!0}),El=function(e,r){var n=this;n.renderer=e,n.onDequeues=[];var a=vW(r);We(n,a),n.lookup=new eW(a.getKey,a.doesEleInvalidateKey),n.setupDequeueing()},nr=El.prototype;nr.reasons=to;nr.getTextureQueue=function(t){var e=this;return e.eleImgCaches=e.eleImgCaches||{},e.eleImgCaches[t]=e.eleImgCaches[t]||[]};nr.getRetiredTextureQueue=function(t){var e=this,r=e.eleImgCaches.retired=e.eleImgCaches.retired||{},n=r[t]=r[t]||[];return n};nr.getElementQueue=function(){var t=this,e=t.eleCacheQueue=t.eleCacheQueue||new Uu(function(r,n){return n.reqs-r.reqs});return e};nr.getElementKeyToQueue=function(){var t=this,e=t.eleKeyToCacheQueue=t.eleKeyToCacheQueue||{};return e};nr.getElement=function(t,e,r,n,a){var i=this,s=this.renderer,o=s.cy.zoom(),l=this.lookup;if(!e||e.w===0||e.h===0||isNaN(e.w)||isNaN(e.h)||!t.visible()||t.removed()||!i.allowEdgeTxrCaching&&t.isEdge()||!i.allowParentTxrCaching&&t.isParent())return null;if(n==null&&(n=Math.ceil(FE(o*r))),n<pd)n=pd;else if(o>=PI||n>J1)return null;var u=Math.pow(2,n),c=e.h*u,d=e.w*u,f=s.eleTextBiggerThanMin(t,u);if(!this.isVisible(t,f))return null;var v=l.get(t,n);if(v&&v.invalidated&&(v.invalidated=!1,v.texture.invalidatedWidth-=v.width),v)return v;var p;if(c<=OR?p=OR:c<=Oc?p=Oc:p=Math.ceil(c/Oc)*Oc,c>aW||d>nW)return null;var y=i.getTextureQueue(p),m=y[y.length-2],g=function(){return i.recycleTexture(p,d)||i.addTexture(p,d)};m||(m=y[y.length-1]),m||(m=g()),m.width-m.usedWidth<d&&(m=g());for(var x=function(L){return L&&L.scaledLabelShown===f},b=a&&a===to.dequeue,w=a&&a===to.highQuality,E=a&&a===to.downscale,C,S=n+1;S<=J1;S++){var T=l.get(t,S);if(T){C=T;break}}var P=C&&C.level===n+1?C:null,A=function(){m.context.drawImage(P.texture.canvas,P.x,0,P.width,P.height,m.usedWidth,0,d,c)};if(m.context.setTransform(1,0,0,1,0,0),m.context.clearRect(m.usedWidth,0,d,p),x(P))A();else if(x(C))if(w){for(var j=C.level;j>n;j--)P=i.getElement(t,e,r,j,to.downscale);A()}else return i.queueElement(t,C.level-1),C;else{var R;if(!b&&!w&&!E)for(var O=n-1;O>=pd;O--){var N=l.get(t,O);if(N){R=N;break}}if(x(R))return i.queueElement(t,n),R;m.context.translate(m.usedWidth,0),m.context.scale(u,u),this.drawElement(m.context,t,e,f,!1),m.context.scale(1/u,1/u),m.context.translate(-m.usedWidth,0)}return v={x:m.usedWidth,texture:m,level:n,scale:u,width:d,height:c,scaledLabelShown:f},m.usedWidth+=Math.ceil(d+tW),m.eleCaches.push(v),l.set(t,n,v),i.checkTextureFullness(m),v};nr.invalidateElements=function(t){for(var e=0;e<t.length;e++)this.invalidateElement(t[e])};nr.invalidateElement=function(t){var e=this,r=e.lookup,n=[],a=r.isInvalid(t);if(a){for(var i=pd;i<=J1;i++){var s=r.getForCachedKey(t,i);s&&n.push(s)}var o=r.invalidate(t);if(o)for(var l=0;l<n.length;l++){var u=n[l],c=u.texture;c.invalidatedWidth+=u.width,u.invalidated=!0,e.checkTextureUtility(c)}e.removeFromQueue(t)}};nr.checkTextureUtility=function(t){t.invalidatedWidth>=iW*t.width&&this.retireTexture(t)};nr.checkTextureFullness=function(t){var e=this,r=e.getTextureQueue(t.height);t.usedWidth/t.width>sW&&t.fullnessChecks>=oW?wi(r,t):t.fullnessChecks++};nr.retireTexture=function(t){var e=this,r=t.height,n=e.getTextureQueue(r),a=this.lookup;wi(n,t),t.retired=!0;for(var i=t.eleCaches,s=0;s<i.length;s++){var o=i[s];a.deleteCache(o.key,o.level)}IE(i);var l=e.getRetiredTextureQueue(r);l.push(t)};nr.addTexture=function(t,e){var r=this,n=r.getTextureQueue(t),a={};return n.push(a),a.eleCaches=[],a.height=t,a.width=Math.max(rW,e),a.usedWidth=0,a.invalidatedWidth=0,a.fullnessChecks=0,a.canvas=r.renderer.makeOffscreenCanvas(a.width,a.height),a.context=a.canvas.getContext("2d"),a};nr.recycleTexture=function(t,e){for(var r=this,n=r.getTextureQueue(t),a=r.getRetiredTextureQueue(t),i=0;i<a.length;i++){var s=a[i];if(s.width>=e)return s.retired=!1,s.usedWidth=0,s.invalidatedWidth=0,s.fullnessChecks=0,IE(s.eleCaches),s.context.setTransform(1,0,0,1,0,0),s.context.clearRect(0,0,s.width,s.height),wi(a,s),n.push(s),s}};nr.queueElement=function(t,e){var r=this,n=r.getElementQueue(),a=r.getElementKeyToQueue(),i=this.getKey(t),s=a[i];if(s)s.level=Math.max(s.level,e),s.eles.merge(t),s.reqs++,n.updateItem(s);else{var o={eles:t.spawn().merge(t),level:e,reqs:1,key:i};n.push(o),a[i]=o}};nr.dequeue=function(t){for(var e=this,r=e.getElementQueue(),n=e.getElementKeyToQueue(),a=[],i=e.lookup,s=0;s<hW&&r.size()>0;s++){var o=r.pop(),l=o.key,u=o.eles[0],c=i.hasCache(u,o.level);if(n[l]=null,c)continue;a.push(o);var d=e.getBoundingBox(u);e.getElement(u,d,t,o.level,to.dequeue)}return a};nr.removeFromQueue=function(t){var e=this,r=e.getElementQueue(),n=e.getElementKeyToQueue(),a=this.getKey(t),i=n[a];i!=null&&(i.eles.length===1?(i.reqs=OE,r.updateItem(i),r.pop(),n[a]=null):i.eles.unmerge(t))};nr.onDequeue=function(t){this.onDequeues.push(t)};nr.offDequeue=function(t){wi(this.onDequeues,t)};nr.setupDequeueing=RI.setupDequeueing({deqRedrawThreshold:fW,deqCost:lW,deqAvgCost:uW,deqNoDrawCost:cW,deqFastCost:dW,deq:function(e,r,n){return e.dequeue(r,n)},onDeqd:function(e,r){for(var n=0;n<e.onDequeues.length;n++){var a=e.onDequeues[n];a(r)}},shouldRedraw:function(e,r,n,a){for(var i=0;i<r.length;i++)for(var s=r[i].eles,o=0;o<s.length;o++){var l=s[o].boundingBox();if(zE(l,a))return!0}return!1},priority:function(e){return e.renderer.beforeRenderPriorities.eleTxrDeq}});var pW=1,Il=-4,sf=2,gW=3.99,mW=50,yW=50,xW=.15,bW=.1,wW=.9,EW=.9,SW=1,MR=250,CW=4e3*4e3,IR=32767,NW=!0,AI=function(e){var r=this,n=r.renderer=e,a=n.cy;r.layersByLevel={},r.firstGet=!0,r.lastInvalidationTime=Da()-2*MR,r.skipping=!1,r.eleTxrDeqs=a.collection(),r.scheduleElementRefinement=qu(function(){r.refineElementTextures(r.eleTxrDeqs),r.eleTxrDeqs.unmerge(r.eleTxrDeqs)},yW),n.beforeRender(function(s,o){o-r.lastInvalidationTime<=MR?r.skipping=!0:r.skipping=!1},n.beforeRenderPriorities.lyrTxrSkip);var i=function(o,l){return l.reqs-o.reqs};r.layersQueue=new Uu(i),r.setupDequeueing()},yr=AI.prototype,FR=0,TW=Math.pow(2,53)-1;yr.makeLayer=function(t,e){var r=Math.pow(2,e),n=Math.ceil(t.w*r),a=Math.ceil(t.h*r),i=this.renderer.makeOffscreenCanvas(n,a),s={id:FR=++FR%TW,bb:t,level:e,width:n,height:a,canvas:i,context:i.getContext("2d"),eles:[],elesQueue:[],reqs:0},o=s.context,l=-s.bb.x1,u=-s.bb.y1;return o.scale(r,r),o.translate(l,u),s};yr.getLayers=function(t,e,r){var n=this,a=n.renderer,i=a.cy,s=i.zoom(),o=n.firstGet;if(n.firstGet=!1,r==null){if(r=Math.ceil(FE(s*e)),r<Il)r=Il;else if(s>=gW||r>sf)return null}n.validateLayersElesOrdering(r,t);var l=n.layersByLevel,u=Math.pow(2,r),c=l[r]=l[r]||[],d,f=n.levelIsComplete(r,t),v,p=function(){var A=function(D){if(n.validateLayersElesOrdering(D,t),n.levelIsComplete(D,t))return v=l[D],!0},j=function(D){if(!v)for(var L=r+D;Il<=L&&L<=sf&&!A(L);L+=D);};j(1),j(-1);for(var R=c.length-1;R>=0;R--){var O=c[R];O.invalid&&wi(c,O)}};if(!f)p();else return c;var y=function(){if(!d){d=Ir();for(var A=0;A<t.length;A++)SV(d,t[A].boundingBox())}return d},m=function(A){A=A||{};var j=A.after;y();var R=Math.ceil(d.w*u),O=Math.ceil(d.h*u);if(R>IR||O>IR)return null;var N=R*O;if(N>CW)return null;var D=n.makeLayer(d,r);if(j!=null){var L=c.indexOf(j)+1;c.splice(L,0,D)}else(A.insert===void 0||A.insert)&&c.unshift(D);return D};if(n.skipping&&!o)return null;for(var g=null,x=t.length/pW,b=!o,w=0;w<t.length;w++){var E=t[w],C=E._private.rscratch,S=C.imgLayerCaches=C.imgLayerCaches||{},T=S[r];if(T){g=T;continue}if((!g||g.eles.length>=x||!SM(g.bb,E.boundingBox()))&&(g=m({insert:!0,after:g}),!g))return null;v||b?n.queueLayer(g,E):n.drawEleInLayer(g,E,r,e),g.eles.push(E),S[r]=g}return v||(b?null:c)};yr.getEleLevelForLayerLevel=function(t,e){return t};yr.drawEleInLayer=function(t,e,r,n){var a=this,i=this.renderer,s=t.context,o=e.boundingBox();o.w===0||o.h===0||!e.visible()||(r=a.getEleLevelForLayerLevel(r,n),i.setImgSmoothing(s,!1),i.drawCachedElement(s,e,null,null,r,NW),i.setImgSmoothing(s,!0))};yr.levelIsComplete=function(t,e){var r=this,n=r.layersByLevel[t];if(!n||n.length===0)return!1;for(var a=0,i=0;i<n.length;i++){var s=n[i];if(s.reqs>0||s.invalid)return!1;a+=s.eles.length}return a===e.length};yr.validateLayersElesOrdering=function(t,e){var r=this.layersByLevel[t];if(r)for(var n=0;n<r.length;n++){for(var a=r[n],i=-1,s=0;s<e.length;s++)if(a.eles[0]===e[s]){i=s;break}if(i<0){this.invalidateLayer(a);continue}for(var o=i,s=0;s<a.eles.length;s++)if(a.eles[s]!==e[o+s]){this.invalidateLayer(a);break}}};yr.updateElementsInLayers=function(t,e){for(var r=this,n=Iu(t[0]),a=0;a<t.length;a++)for(var i=n?null:t[a],s=n?t[a]:t[a].ele,o=s._private.rscratch,l=o.imgLayerCaches=o.imgLayerCaches||{},u=Il;u<=sf;u++){var c=l[u];c&&(i&&r.getEleLevelForLayerLevel(c.level)!==i.level||e(c,s,i))}};yr.haveLayers=function(){for(var t=this,e=!1,r=Il;r<=sf;r++){var n=t.layersByLevel[r];if(n&&n.length>0){e=!0;break}}return e};yr.invalidateElements=function(t){var e=this;t.length!==0&&(e.lastInvalidationTime=Da(),!(t.length===0||!e.haveLayers())&&e.updateElementsInLayers(t,function(n,a,i){e.invalidateLayer(n)}))};yr.invalidateLayer=function(t){if(this.lastInvalidationTime=Da(),!t.invalid){var e=t.level,r=t.eles,n=this.layersByLevel[e];wi(n,t),t.elesQueue=[],t.invalid=!0,t.replacement&&(t.replacement.invalid=!0);for(var a=0;a<r.length;a++){var i=r[a]._private.rscratch.imgLayerCaches;i&&(i[e]=null)}}};yr.refineElementTextures=function(t){var e=this;e.updateElementsInLayers(t,function(n,a,i){var s=n.replacement;if(s||(s=n.replacement=e.makeLayer(n.bb,n.level),s.replaces=n,s.eles=n.eles),!s.reqs)for(var o=0;o<s.eles.length;o++)e.queueLayer(s,s.eles[o])})};yr.enqueueElementRefinement=function(t){this.eleTxrDeqs.merge(t),this.scheduleElementRefinement()};yr.queueLayer=function(t,e){var r=this,n=r.layersQueue,a=t.elesQueue,i=a.hasId=a.hasId||{};if(!t.replacement){if(e){if(i[e.id()])return;a.push(e),i[e.id()]=!0}t.reqs?(t.reqs++,n.updateItem(t)):(t.reqs=1,n.push(t))}};yr.dequeue=function(t){for(var e=this,r=e.layersQueue,n=[],a=0;a<SW&&r.size()!==0;){var i=r.peek();if(i.replacement){r.pop();continue}if(i.replaces&&i!==i.replaces.replacement){r.pop();continue}if(i.invalid){r.pop();continue}var s=i.elesQueue.shift();s&&(e.drawEleInLayer(i,s,i.level,t),a++),n.length===0&&n.push(!0),i.elesQueue.length===0&&(r.pop(),i.reqs=0,i.replaces&&e.applyLayerReplacement(i),e.requestRedraw())}return n};yr.applyLayerReplacement=function(t){var e=this,r=e.layersByLevel[t.level],n=t.replaces,a=r.indexOf(n);if(!(a<0||n.invalid)){r[a]=t;for(var i=0;i<t.eles.length;i++){var s=t.eles[i]._private,o=s.imgLayerCaches=s.imgLayerCaches||{};o&&(o[t.level]=t)}e.requestRedraw()}};yr.requestRedraw=qu(function(){var t=this.renderer;t.redrawHint("eles",!0),t.redrawHint("drag",!0),t.redraw()},100);yr.setupDequeueing=RI.setupDequeueing({deqRedrawThreshold:mW,deqCost:xW,deqAvgCost:bW,deqNoDrawCost:wW,deqFastCost:EW,deq:function(e,r){return e.dequeue(r)},onDeqd:ME,shouldRedraw:mM,priority:function(e){return e.renderer.beforeRenderPriorities.lyrTxrDeq}});var kI={},BR;function RW(t,e){for(var r=0;r<e.length;r++){var n=e[r];t.lineTo(n.x,n.y)}}function PW(t,e,r){for(var n,a=0;a<e.length;a++){var i=e[a];a===0&&(n=i),t.lineTo(i.x,i.y)}t.quadraticCurveTo(r.x,r.y,n.x,n.y)}function zR(t,e,r){t.beginPath&&t.beginPath();for(var n=e,a=0;a<n.length;a++){var i=n[a];t.lineTo(i.x,i.y)}var s=r,o=r[0];t.moveTo(o.x,o.y);for(var a=1;a<s.length;a++){var i=s[a];t.lineTo(i.x,i.y)}t.closePath&&t.closePath()}function AW(t,e,r,n,a){t.beginPath&&t.beginPath(),t.arc(r,n,a,0,Math.PI*2,!1);var i=e,s=i[0];t.moveTo(s.x,s.y);for(var o=0;o<i.length;o++){var l=i[o];t.lineTo(l.x,l.y)}t.closePath&&t.closePath()}function kW(t,e,r,n){t.arc(e,r,n,0,Math.PI*2,!1)}kI.arrowShapeImpl=function(t){return(BR||(BR={polygon:RW,"triangle-backcurve":PW,"triangle-tee":zR,"circle-triangle":AW,"triangle-cross":zR,circle:kW}))[t]};var fa={};fa.drawElement=function(t,e,r,n,a,i){var s=this;e.isNode()?s.drawNode(t,e,r,n,a,i):s.drawEdge(t,e,r,n,a,i)};fa.drawElementOverlay=function(t,e){var r=this;e.isNode()?r.drawNodeOverlay(t,e):r.drawEdgeOverlay(t,e)};fa.drawElementUnderlay=function(t,e){var r=this;e.isNode()?r.drawNodeUnderlay(t,e):r.drawEdgeUnderlay(t,e)};fa.drawCachedElementPortion=function(t,e,r,n,a,i,s,o){var l=this,u=r.getBoundingBox(e);if(!(u.w===0||u.h===0)){var c=r.getElement(e,u,n,a,i);if(c!=null){var d=o(l,e);if(d===0)return;var f=s(l,e),v=u.x1,p=u.y1,y=u.w,m=u.h,g,x,b,w,E;if(f!==0){var C=r.getRotationPoint(e);b=C.x,w=C.y,t.translate(b,w),t.rotate(f),E=l.getImgSmoothing(t),E||l.setImgSmoothing(t,!0);var S=r.getRotationOffset(e);g=S.x,x=S.y}else g=v,x=p;var T;d!==1&&(T=t.globalAlpha,t.globalAlpha=T*d),t.drawImage(c.texture.canvas,c.x,0,c.width,c.height,g,x,y,m),d!==1&&(t.globalAlpha=T),f!==0&&(t.rotate(-f),t.translate(-b,-w),E||l.setImgSmoothing(t,!1))}else r.drawElement(t,e)}};var LW=function(){return 0},DW=function(e,r){return e.getTextAngle(r,null)},_W=function(e,r){return e.getTextAngle(r,"source")},jW=function(e,r){return e.getTextAngle(r,"target")},OW=function(e,r){return r.effectiveOpacity()},qp=function(e,r){return r.pstyle("text-opacity").pfValue*r.effectiveOpacity()};fa.drawCachedElement=function(t,e,r,n,a,i){var s=this,o=s.data,l=o.eleTxrCache,u=o.lblTxrCache,c=o.slbTxrCache,d=o.tlbTxrCache,f=e.boundingBox(),v=i===!0?l.reasons.highQuality:null;if(!(f.w===0||f.h===0||!e.visible())&&(!n||zE(f,n))){var p=e.isEdge(),y=e.element()._private.rscratch.badLine;s.drawElementUnderlay(t,e),s.drawCachedElementPortion(t,e,l,r,a,v,LW,OW),(!p||!y)&&s.drawCachedElementPortion(t,e,u,r,a,v,DW,qp),p&&!y&&(s.drawCachedElementPortion(t,e,c,r,a,v,_W,qp),s.drawCachedElementPortion(t,e,d,r,a,v,jW,qp)),s.drawElementOverlay(t,e)}};fa.drawElements=function(t,e){for(var r=this,n=0;n<e.length;n++){var a=e[n];r.drawElement(t,a)}};fa.drawCachedElements=function(t,e,r,n){for(var a=this,i=0;i<e.length;i++){var s=e[i];a.drawCachedElement(t,s,r,n)}};fa.drawCachedNodes=function(t,e,r,n){for(var a=this,i=0;i<e.length;i++){var s=e[i];s.isNode()&&a.drawCachedElement(t,s,r,n)}};fa.drawLayeredElements=function(t,e,r,n){var a=this,i=a.data.lyrTxrCache.getLayers(e,r);if(i)for(var s=0;s<i.length;s++){var o=i[s],l=o.bb;l.w===0||l.h===0||t.drawImage(o.canvas,l.x1,l.y1,l.w,l.h)}else a.drawCachedElements(t,e,r,n)};var Ba={};Ba.drawEdge=function(t,e,r){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,s=this,o=e._private.rscratch;if(!(i&&!e.visible())&&!(o.badLine||o.allpts==null||isNaN(o.allpts[0]))){var l;r&&(l=r,t.translate(-l.x1,-l.y1));var u=i?e.pstyle("opacity").value:1,c=i?e.pstyle("line-opacity").value:1,d=e.pstyle("curve-style").value,f=e.pstyle("line-style").value,v=e.pstyle("width").pfValue,p=e.pstyle("line-cap").value,y=e.pstyle("line-outline-width").value,m=e.pstyle("line-outline-color").value,g=u*c,x=u*c,b=function(){var D=arguments.length>0&&arguments[0]!==void 0?arguments[0]:g;d==="straight-triangle"?(s.eleStrokeStyle(t,e,D),s.drawEdgeTrianglePath(e,t,o.allpts)):(t.lineWidth=v,t.lineCap=p,s.eleStrokeStyle(t,e,D),s.drawEdgePath(e,t,o.allpts,f),t.lineCap="butt")},w=function(){var D=arguments.length>0&&arguments[0]!==void 0?arguments[0]:g;if(t.lineWidth=v+y,t.lineCap=p,y>0)s.colorStrokeStyle(t,m[0],m[1],m[2],D);else{t.lineCap="butt";return}d==="straight-triangle"?s.drawEdgeTrianglePath(e,t,o.allpts):(s.drawEdgePath(e,t,o.allpts,f),t.lineCap="butt")},E=function(){a&&s.drawEdgeOverlay(t,e)},C=function(){a&&s.drawEdgeUnderlay(t,e)},S=function(){var D=arguments.length>0&&arguments[0]!==void 0?arguments[0]:x;s.drawArrowheads(t,e,D)},T=function(){s.drawElementText(t,e,null,n)};t.lineJoin="round";var P=e.pstyle("ghost").value==="yes";if(P){var A=e.pstyle("ghost-offset-x").pfValue,j=e.pstyle("ghost-offset-y").pfValue,R=e.pstyle("ghost-opacity").value,O=g*R;t.translate(A,j),b(O),S(O),t.translate(-A,-j)}else w();C(),b(),S(),E(),T(),r&&t.translate(l.x1,l.y1)}};var LI=function(e){if(!["overlay","underlay"].includes(e))throw new Error("Invalid state");return function(r,n){if(n.visible()){var a=n.pstyle("".concat(e,"-opacity")).value;if(a!==0){var i=this,s=i.usePaths(),o=n._private.rscratch,l=n.pstyle("".concat(e,"-padding")).pfValue,u=2*l,c=n.pstyle("".concat(e,"-color")).value;r.lineWidth=u,o.edgeType==="self"&&!s?r.lineCap="butt":r.lineCap="round",i.colorStrokeStyle(r,c[0],c[1],c[2],a),i.drawEdgePath(n,r,o.allpts,"solid")}}}};Ba.drawEdgeOverlay=LI("overlay");Ba.drawEdgeUnderlay=LI("underlay");Ba.drawEdgePath=function(t,e,r,n){var a=t._private.rscratch,i=e,s,o=!1,l=this.usePaths(),u=t.pstyle("line-dash-pattern").pfValue,c=t.pstyle("line-dash-offset").pfValue;if(l){var d=r.join("$"),f=a.pathCacheKey&&a.pathCacheKey===d;f?(s=e=a.pathCache,o=!0):(s=e=new Path2D,a.pathCacheKey=d,a.pathCache=s)}if(i.setLineDash)switch(n){case"dotted":i.setLineDash([1,1]);break;case"dashed":i.setLineDash(u),i.lineDashOffset=c;break;case"solid":i.setLineDash([]);break}if(!o&&!a.badLine)switch(e.beginPath&&e.beginPath(),e.moveTo(r[0],r[1]),a.edgeType){case"bezier":case"self":case"compound":case"multibezier":for(var v=2;v+3<r.length;v+=4)e.quadraticCurveTo(r[v],r[v+1],r[v+2],r[v+3]);break;case"straight":case"haystack":for(var p=2;p+1<r.length;p+=2)e.lineTo(r[p],r[p+1]);break;case"segments":if(a.isRound){var y=Xr(a.roundCorners),m;try{for(y.s();!(m=y.n()).done;){var g=m.value;xI(e,g)}}catch(b){y.e(b)}finally{y.f()}e.lineTo(r[r.length-2],r[r.length-1])}else for(var x=2;x+1<r.length;x+=2)e.lineTo(r[x],r[x+1]);break}e=i,l?e.stroke(s):e.stroke(),e.setLineDash&&e.setLineDash([])};Ba.drawEdgeTrianglePath=function(t,e,r){e.fillStyle=e.strokeStyle;for(var n=t.pstyle("width").pfValue,a=0;a+1<r.length;a+=2){var i=[r[a+2]-r[a],r[a+3]-r[a+1]],s=Math.sqrt(i[0]*i[0]+i[1]*i[1]),o=[i[1]/s,-i[0]/s],l=[o[0]*n/2,o[1]*n/2];e.beginPath(),e.moveTo(r[a]-l[0],r[a+1]-l[1]),e.lineTo(r[a]+l[0],r[a+1]+l[1]),e.lineTo(r[a+2],r[a+3]),e.closePath(),e.fill()}};Ba.drawArrowheads=function(t,e,r){var n=e._private.rscratch,a=n.edgeType==="haystack";a||this.drawArrowhead(t,e,"source",n.arrowStartX,n.arrowStartY,n.srcArrowAngle,r),this.drawArrowhead(t,e,"mid-target",n.midX,n.midY,n.midtgtArrowAngle,r),this.drawArrowhead(t,e,"mid-source",n.midX,n.midY,n.midsrcArrowAngle,r),a||this.drawArrowhead(t,e,"target",n.arrowEndX,n.arrowEndY,n.tgtArrowAngle,r)};Ba.drawArrowhead=function(t,e,r,n,a,i,s){if(!(isNaN(n)||n==null||isNaN(a)||a==null||isNaN(i)||i==null)){var o=this,l=e.pstyle(r+"-arrow-shape").value;if(l!=="none"){var u=e.pstyle(r+"-arrow-fill").value==="hollow"?"both":"filled",c=e.pstyle(r+"-arrow-fill").value,d=e.pstyle("width").pfValue,f=e.pstyle(r+"-arrow-width"),v=f.value==="match-line"?d:f.pfValue;f.units==="%"&&(v*=d);var p=e.pstyle("opacity").value;s===void 0&&(s=p);var y=t.globalCompositeOperation;(s!==1||c==="hollow")&&(t.globalCompositeOperation="destination-out",o.colorFillStyle(t,255,255,255,1),o.colorStrokeStyle(t,255,255,255,1),o.drawArrowShape(e,t,u,d,l,v,n,a,i),t.globalCompositeOperation=y);var m=e.pstyle(r+"-arrow-color").value;o.colorFillStyle(t,m[0],m[1],m[2],s),o.colorStrokeStyle(t,m[0],m[1],m[2],s),o.drawArrowShape(e,t,c,d,l,v,n,a,i)}}};Ba.drawArrowShape=function(t,e,r,n,a,i,s,o,l){var u=this,c=this.usePaths()&&a!=="triangle-cross",d=!1,f,v=e,p={x:s,y:o},y=t.pstyle("arrow-scale").value,m=this.getArrowWidth(n,y),g=u.arrowShapes[a];if(c){var x=u.arrowPathCache=u.arrowPathCache||[],b=cs(a),w=x[b];w!=null?(f=e=w,d=!0):(f=e=new Path2D,x[b]=f)}d||(e.beginPath&&e.beginPath(),c?g.draw(e,1,0,{x:0,y:0},1):g.draw(e,m,l,p,n),e.closePath&&e.closePath()),e=v,c&&(e.translate(s,o),e.rotate(l),e.scale(m,m)),(r==="filled"||r==="both")&&(c?e.fill(f):e.fill()),(r==="hollow"||r==="both")&&(e.lineWidth=i/(c?m:1),e.lineJoin="miter",c?e.stroke(f):e.stroke()),c&&(e.scale(1/m,1/m),e.rotate(-l),e.translate(-s,-o))};var eS={};eS.safeDrawImage=function(t,e,r,n,a,i,s,o,l,u){if(!(a<=0||i<=0||l<=0||u<=0))try{t.drawImage(e,r,n,a,i,s,o,l,u)}catch(c){ht(c)}};eS.drawInscribedImage=function(t,e,r,n,a){var i=this,s=r.position(),o=s.x,l=s.y,u=r.cy().style(),c=u.getIndexedStyle.bind(u),d=c(r,"background-fit","value",n),f=c(r,"background-repeat","value",n),v=r.width(),p=r.height(),y=r.padding()*2,m=v+(c(r,"background-width-relative-to","value",n)==="inner"?0:y),g=p+(c(r,"background-height-relative-to","value",n)==="inner"?0:y),x=r._private.rscratch,b=c(r,"background-clip","value",n),w=b==="node",E=c(r,"background-image-opacity","value",n)*a,C=c(r,"background-image-smoothing","value",n),S=r.pstyle("corner-radius").value;S!=="auto"&&(S=r.pstyle("corner-radius").pfValue);var T=e.width||e.cachedW,P=e.height||e.cachedH;(T==null||P==null)&&(document.body.appendChild(e),T=e.cachedW=e.width||e.offsetWidth,P=e.cachedH=e.height||e.offsetHeight,document.body.removeChild(e));var A=T,j=P;if(c(r,"background-width","value",n)!=="auto"&&(c(r,"background-width","units",n)==="%"?A=c(r,"background-width","pfValue",n)*m:A=c(r,"background-width","pfValue",n)),c(r,"background-height","value",n)!=="auto"&&(c(r,"background-height","units",n)==="%"?j=c(r,"background-height","pfValue",n)*g:j=c(r,"background-height","pfValue",n)),!(A===0||j===0)){if(d==="contain"){var R=Math.min(m/A,g/j);A*=R,j*=R}else if(d==="cover"){var R=Math.max(m/A,g/j);A*=R,j*=R}var O=o-m/2,N=c(r,"background-position-x","units",n),D=c(r,"background-position-x","pfValue",n);N==="%"?O+=(m-A)*D:O+=D;var L=c(r,"background-offset-x","units",n),_=c(r,"background-offset-x","pfValue",n);L==="%"?O+=(m-A)*_:O+=_;var k=l-g/2,I=c(r,"background-position-y","units",n),F=c(r,"background-position-y","pfValue",n);I==="%"?k+=(g-j)*F:k+=F;var B=c(r,"background-offset-y","units",n),$=c(r,"background-offset-y","pfValue",n);B==="%"?k+=(g-j)*$:k+=$,x.pathCache&&(O-=o,k-=l,o=0,l=0);var W=t.globalAlpha;t.globalAlpha=E;var z=i.getImgSmoothing(t),q=!1;if(C==="no"&&z?(i.setImgSmoothing(t,!1),q=!0):C==="yes"&&!z&&(i.setImgSmoothing(t,!0),q=!0),f==="no-repeat")w&&(t.save(),x.pathCache?t.clip(x.pathCache):(i.nodeShapes[i.getNodeShape(r)].draw(t,o,l,m,g,S,x),t.clip())),i.safeDrawImage(t,e,0,0,T,P,O,k,A,j),w&&t.restore();else{var G=t.createPattern(e,f);t.fillStyle=G,i.nodeShapes[i.getNodeShape(r)].draw(t,o,l,m,g,S,x),t.translate(O,k),t.fill(),t.translate(-O,-k)}t.globalAlpha=W,q&&i.setImgSmoothing(t,z)}};var ws={};ws.eleTextBiggerThanMin=function(t,e){if(!e){var r=t.cy().zoom(),n=this.getPixelRatio(),a=Math.ceil(FE(r*n));e=Math.pow(2,a)}var i=t.pstyle("font-size").pfValue*e,s=t.pstyle("min-zoomed-font-size").pfValue;return!(i<s)};ws.drawElementText=function(t,e,r,n,a){var i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,s=this;if(n==null){if(i&&!s.eleTextBiggerThanMin(e))return}else if(n===!1)return;if(e.isNode()){var o=e.pstyle("label");if(!o||!o.value)return;var l=s.getLabelJustification(e);t.textAlign=l,t.textBaseline="bottom"}else{var u=e.element()._private.rscratch.badLine,c=e.pstyle("label"),d=e.pstyle("source-label"),f=e.pstyle("target-label");if(u||(!c||!c.value)&&(!d||!d.value)&&(!f||!f.value))return;t.textAlign="center",t.textBaseline="bottom"}var v=!r,p;r&&(p=r,t.translate(-p.x1,-p.y1)),a==null?(s.drawText(t,e,null,v,i),e.isEdge()&&(s.drawText(t,e,"source",v,i),s.drawText(t,e,"target",v,i))):s.drawText(t,e,a,v,i),r&&t.translate(p.x1,p.y1)};ws.getFontCache=function(t){var e;this.fontCaches=this.fontCaches||[];for(var r=0;r<this.fontCaches.length;r++)if(e=this.fontCaches[r],e.context===t)return e;return e={context:t},this.fontCaches.push(e),e};ws.setupTextStyle=function(t,e){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,n=e.pstyle("font-style").strValue,a=e.pstyle("font-size").pfValue+"px",i=e.pstyle("font-family").strValue,s=e.pstyle("font-weight").strValue,o=r?e.effectiveOpacity()*e.pstyle("text-opacity").value:1,l=e.pstyle("text-outline-opacity").value*o,u=e.pstyle("color").value,c=e.pstyle("text-outline-color").value;t.font=n+" "+s+" "+a+" "+i,t.lineJoin="round",this.colorFillStyle(t,u[0],u[1],u[2],o),this.colorStrokeStyle(t,c[0],c[1],c[2],l)};function MW(t,e,r,n,a){var i=Math.min(n,a),s=i/2,o=e+n/2,l=r+a/2;t.beginPath(),t.arc(o,l,s,0,Math.PI*2),t.closePath()}function qR(t,e,r,n,a){var i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:5,s=Math.min(i,n/2,a/2);t.beginPath(),t.moveTo(e+s,r),t.lineTo(e+n-s,r),t.quadraticCurveTo(e+n,r,e+n,r+s),t.lineTo(e+n,r+a-s),t.quadraticCurveTo(e+n,r+a,e+n-s,r+a),t.lineTo(e+s,r+a),t.quadraticCurveTo(e,r+a,e,r+a-s),t.lineTo(e,r+s),t.quadraticCurveTo(e,r,e+s,r),t.closePath()}ws.getTextAngle=function(t,e){var r,n=t._private,a=n.rscratch,i=e?e+"-":"",s=t.pstyle(i+"text-rotation");if(s.strValue==="autorotate"){var o=Hr(a,"labelAngle",e);r=t.isEdge()?o:0}else s.strValue==="none"?r=0:r=s.pfValue;return r};ws.drawText=function(t,e,r){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,i=e._private,s=i.rscratch,o=a?e.effectiveOpacity():1;if(!(a&&(o===0||e.pstyle("text-opacity").value===0))){r==="main"&&(r=null);var l=Hr(s,"labelX",r),u=Hr(s,"labelY",r),c,d,f=this.getLabelText(e,r);if(f!=null&&f!==""&&!isNaN(l)&&!isNaN(u)){this.setupTextStyle(t,e,a);var v=r?r+"-":"",p=Hr(s,"labelWidth",r),y=Hr(s,"labelHeight",r),m=e.pstyle(v+"text-margin-x").pfValue,g=e.pstyle(v+"text-margin-y").pfValue,x=e.isEdge(),b=e.pstyle("text-halign").value,w=e.pstyle("text-valign").value;x&&(b="center",w="center"),l+=m,u+=g;var E;switch(n?E=this.getTextAngle(e,r):E=0,E!==0&&(c=l,d=u,t.translate(c,d),t.rotate(E),l=0,u=0),w){case"top":break;case"center":u+=y/2;break;case"bottom":u+=y;break}var C=e.pstyle("text-background-opacity").value,S=e.pstyle("text-border-opacity").value,T=e.pstyle("text-border-width").pfValue,P=e.pstyle("text-background-padding").pfValue,A=e.pstyle("text-background-shape").strValue,j=A==="round-rectangle"||A==="roundrectangle",R=A==="circle",O=2;if(C>0||T>0&&S>0){var N=t.fillStyle,D=t.strokeStyle,L=t.lineWidth,_=e.pstyle("text-background-color").value,k=e.pstyle("text-border-color").value,I=e.pstyle("text-border-style").value,F=C>0,B=T>0&&S>0,$=l-P;switch(b){case"left":$-=p;break;case"center":$-=p/2;break}var W=u-y-P,z=p+2*P,q=y+2*P;if(F&&(t.fillStyle="rgba(".concat(_[0],",").concat(_[1],",").concat(_[2],",").concat(C*o,")")),B&&(t.strokeStyle="rgba(".concat(k[0],",").concat(k[1],",").concat(k[2],",").concat(S*o,")"),t.lineWidth=T,t.setLineDash))switch(I){case"dotted":t.setLineDash([1,1]);break;case"dashed":t.setLineDash([4,2]);break;case"double":t.lineWidth=T/4,t.setLineDash([]);break;case"solid":default:t.setLineDash([]);break}if(j?(t.beginPath(),qR(t,$,W,z,q,O)):R?(t.beginPath(),MW(t,$,W,z,q)):(t.beginPath(),t.rect($,W,z,q)),F&&t.fill(),B&&t.stroke(),B&&I==="double"){var G=T/2;t.beginPath(),j?qR(t,$+G,W+G,z-2*G,q-2*G,O):t.rect($+G,W+G,z-2*G,q-2*G),t.stroke()}t.fillStyle=N,t.strokeStyle=D,t.lineWidth=L,t.setLineDash&&t.setLineDash([])}var J=2*e.pstyle("text-outline-width").pfValue;if(J>0&&(t.lineWidth=J),e.pstyle("text-wrap").value==="wrap"){var ae=Hr(s,"labelWrapCachedLines",r),Y=Hr(s,"labelLineHeight",r),H=p/2,X=this.getLabelJustification(e);switch(X==="auto"||(b==="left"?X==="left"?l+=-p:X==="center"&&(l+=-H):b==="center"?X==="left"?l+=-H:X==="right"&&(l+=H):b==="right"&&(X==="center"?l+=H:X==="right"&&(l+=p))),w){case"top":u-=(ae.length-1)*Y;break;case"center":case"bottom":u-=(ae.length-1)*Y;break}for(var ee=0;ee<ae.length;ee++)J>0&&t.strokeText(ae[ee],l,u),t.fillText(ae[ee],l,u),u+=Y}else J>0&&t.strokeText(f,l,u),t.fillText(f,l,u);E!==0&&(t.rotate(-E),t.translate(-c,-d))}}};var _i={};_i.drawNode=function(t,e,r){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,s=this,o,l,u=e._private,c=u.rscratch,d=e.position();if(!(!_e(d.x)||!_e(d.y))&&!(i&&!e.visible())){var f=i?e.effectiveOpacity():1,v=s.usePaths(),p,y=!1,m=e.padding();o=e.width()+2*m,l=e.height()+2*m;var g;r&&(g=r,t.translate(-g.x1,-g.y1));for(var x=e.pstyle("background-image"),b=x.value,w=new Array(b.length),E=new Array(b.length),C=0,S=0;S<b.length;S++){var T=b[S],P=w[S]=T!=null&&T!=="none";if(P){var A=e.cy().style().getIndexedStyle(e,"background-image-crossorigin","value",S);C++,E[S]=s.getCachedImage(T,A,function(){u.backgroundTimestamp=Date.now(),e.emitAndNotify("background")})}}var j=e.pstyle("background-blacken").value,R=e.pstyle("border-width").pfValue,O=e.pstyle("background-opacity").value*f,N=e.pstyle("border-color").value,D=e.pstyle("border-style").value,L=e.pstyle("border-join").value,_=e.pstyle("border-cap").value,k=e.pstyle("border-position").value,I=e.pstyle("border-dash-pattern").pfValue,F=e.pstyle("border-dash-offset").pfValue,B=e.pstyle("border-opacity").value*f,$=e.pstyle("outline-width").pfValue,W=e.pstyle("outline-color").value,z=e.pstyle("outline-style").value,q=e.pstyle("outline-opacity").value*f,G=e.pstyle("outline-offset").value,J=e.pstyle("corner-radius").value;J!=="auto"&&(J=e.pstyle("corner-radius").pfValue);var ae=function(){var Re=arguments.length>0&&arguments[0]!==void 0?arguments[0]:O;s.eleFillStyle(t,e,Re)},Y=function(){var Re=arguments.length>0&&arguments[0]!==void 0?arguments[0]:B;s.colorStrokeStyle(t,N[0],N[1],N[2],Re)},H=function(){var Re=arguments.length>0&&arguments[0]!==void 0?arguments[0]:q;s.colorStrokeStyle(t,W[0],W[1],W[2],Re)},X=function(Re,Z,M,Q){var ne=s.nodePathCache=s.nodePathCache||[],re=gM(M==="polygon"?M+","+Q.join(","):M,""+Z,""+Re,""+J),se=ne[re],ye,le=!1;return se!=null?(ye=se,le=!0,c.pathCache=ye):(ye=new Path2D,ne[re]=c.pathCache=ye),{path:ye,cacheHit:le}},ee=e.pstyle("shape").strValue,ie=e.pstyle("shape-polygon-points").pfValue;if(v){t.translate(d.x,d.y);var oe=X(o,l,ee,ie);p=oe.path,y=oe.cacheHit}var me=function(){if(!y){var Re=d;v&&(Re={x:0,y:0}),s.nodeShapes[s.getNodeShape(e)].draw(p||t,Re.x,Re.y,o,l,J,c)}v?t.fill(p):t.fill()},De=function(){for(var Re=arguments.length>0&&arguments[0]!==void 0?arguments[0]:f,Z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,M=u.backgrounding,Q=0,ne=0;ne<E.length;ne++){var re=e.cy().style().getIndexedStyle(e,"background-image-containment","value",ne);if(Z&&re==="over"||!Z&&re==="inside"){Q++;continue}w[ne]&&E[ne].complete&&!E[ne].error&&(Q++,s.drawInscribedImage(t,E[ne],e,ne,Re))}u.backgrounding=Q!==C,M!==u.backgrounding&&e.updateStyle(!1)},ge=function(){var Re=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,Z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:f;s.hasPie(e)&&(s.drawPie(t,e,Z),Re&&(v||s.nodeShapes[s.getNodeShape(e)].draw(t,d.x,d.y,o,l,J,c)))},pe=function(){var Re=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,Z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:f;s.hasStripe(e)&&(t.save(),v?t.clip(c.pathCache):(s.nodeShapes[s.getNodeShape(e)].draw(t,d.x,d.y,o,l,J,c),t.clip()),s.drawStripe(t,e,Z),t.restore(),Re&&(v||s.nodeShapes[s.getNodeShape(e)].draw(t,d.x,d.y,o,l,J,c)))},we=function(){var Re=arguments.length>0&&arguments[0]!==void 0?arguments[0]:f,Z=(j>0?j:-j)*Re,M=j>0?0:255;j!==0&&(s.colorFillStyle(t,M,M,M,Z),v?t.fill(p):t.fill())},xe=function(){if(R>0){if(t.lineWidth=R,t.lineCap=_,t.lineJoin=L,t.setLineDash)switch(D){case"dotted":t.setLineDash([1,1]);break;case"dashed":t.setLineDash(I),t.lineDashOffset=F;break;case"solid":case"double":t.setLineDash([]);break}if(k!=="center"){if(t.save(),t.lineWidth*=2,k==="inside")v?t.clip(p):t.clip();else{var Re=new Path2D;Re.rect(-o/2-R,-l/2-R,o+2*R,l+2*R),Re.addPath(p),t.clip(Re,"evenodd")}v?t.stroke(p):t.stroke(),t.restore()}else v?t.stroke(p):t.stroke();if(D==="double"){t.lineWidth=R/3;var Z=t.globalCompositeOperation;t.globalCompositeOperation="destination-out",v?t.stroke(p):t.stroke(),t.globalCompositeOperation=Z}t.setLineDash&&t.setLineDash([])}},Ee=function(){if($>0){if(t.lineWidth=$,t.lineCap="butt",t.setLineDash)switch(z){case"dotted":t.setLineDash([1,1]);break;case"dashed":t.setLineDash([4,2]);break;case"solid":case"double":t.setLineDash([]);break}var Re=d;v&&(Re={x:0,y:0});var Z=s.getNodeShape(e),M=R;k==="inside"&&(M=0),k==="outside"&&(M*=2);var Q=(o+M+($+G))/o,ne=(l+M+($+G))/l,re=o*Q,se=l*ne,ye=s.nodeShapes[Z].points,le;if(v){var he=X(re,se,Z,ye);le=he.path}if(Z==="ellipse")s.drawEllipsePath(le||t,Re.x,Re.y,re,se);else if(["round-diamond","round-heptagon","round-hexagon","round-octagon","round-pentagon","round-polygon","round-triangle","round-tag"].includes(Z)){var de=0,Se=0,Oe=0;Z==="round-diamond"?de=(M+G+$)*1.4:Z==="round-heptagon"?(de=(M+G+$)*1.075,Oe=-(M/2+G+$)/35):Z==="round-hexagon"?de=(M+G+$)*1.12:Z==="round-pentagon"?(de=(M+G+$)*1.13,Oe=-(M/2+G+$)/15):Z==="round-tag"?(de=(M+G+$)*1.12,Se=(M/2+$+G)*.07):Z==="round-triangle"&&(de=(M+G+$)*(Math.PI/2),Oe=-(M+G/2+$)/Math.PI),de!==0&&(Q=(o+de)/o,re=o*Q,["round-hexagon","round-tag"].includes(Z)||(ne=(l+de)/l,se=l*ne)),J=J==="auto"?TM(re,se):J;for(var Le=re/2,ke=se/2,Ae=J+(M+$+G)/2,Te=new Array(ye.length/2),Ge=new Array(ye.length/2),Me=0;Me<ye.length/2;Me++)Te[Me]={x:Re.x+Se+Le*ye[Me*2],y:Re.y+Oe+ke*ye[Me*2+1]};var Ie,Ze,$e,He,ct=Te.length;for(Ze=Te[ct-1],Ie=0;Ie<ct;Ie++)$e=Te[Ie%ct],He=Te[(Ie+1)%ct],Ge[Ie]=ZE(Ze,$e,He,Ae),Ze=$e,$e=He;s.drawRoundPolygonPath(le||t,Re.x+Se,Re.y+Oe,o*Q,l*ne,ye,Ge)}else if(["roundrectangle","round-rectangle"].includes(Z))J=J==="auto"?Ei(re,se):J,s.drawRoundRectanglePath(le||t,Re.x,Re.y,re,se,J+(M+$+G)/2);else if(["cutrectangle","cut-rectangle"].includes(Z))J=J==="auto"?qE():J,s.drawCutRectanglePath(le||t,Re.x,Re.y,re,se,null,J+(M+$+G)/4);else if(["bottomroundrectangle","bottom-round-rectangle"].includes(Z))J=J==="auto"?Ei(re,se):J,s.drawBottomRoundRectanglePath(le||t,Re.x,Re.y,re,se,J+(M+$+G)/2);else if(Z==="barrel")s.drawBarrelPath(le||t,Re.x,Re.y,re,se);else if(Z.startsWith("polygon")||["rhomboid","right-rhomboid","round-tag","tag","vee"].includes(Z)){var gt=(M+$+G)/o;ye=Zd(Jd(ye,gt)),s.drawPolygonPath(le||t,Re.x,Re.y,o,l,ye)}else{var tt=(M+$+G)/o;ye=Zd(Jd(ye,-tt)),s.drawPolygonPath(le||t,Re.x,Re.y,o,l,ye)}if(v?t.stroke(le):t.stroke(),z==="double"){t.lineWidth=M/3;var lt=t.globalCompositeOperation;t.globalCompositeOperation="destination-out",v?t.stroke(le):t.stroke(),t.globalCompositeOperation=lt}t.setLineDash&&t.setLineDash([])}},V=function(){a&&s.drawNodeOverlay(t,e,d,o,l)},K=function(){a&&s.drawNodeUnderlay(t,e,d,o,l)},te=function(){s.drawElementText(t,e,null,n)},ue=e.pstyle("ghost").value==="yes";if(ue){var fe=e.pstyle("ghost-offset-x").pfValue,ve=e.pstyle("ghost-offset-y").pfValue,be=e.pstyle("ghost-opacity").value,Ne=be*f;t.translate(fe,ve),H(),Ee(),ae(be*O),me(),De(Ne,!0),Y(be*B),xe(),ge(j!==0||R!==0),pe(j!==0||R!==0),De(Ne,!1),we(Ne),t.translate(-fe,-ve)}v&&t.translate(-d.x,-d.y),K(),v&&t.translate(d.x,d.y),H(),Ee(),ae(),me(),De(f,!0),Y(),xe(),ge(j!==0||R!==0),pe(j!==0||R!==0),De(f,!1),we(),v&&t.translate(-d.x,-d.y),te(),V(),r&&t.translate(g.x1,g.y1)}};var DI=function(e){if(!["overlay","underlay"].includes(e))throw new Error("Invalid state");return function(r,n,a,i,s){var o=this;if(n.visible()){var l=n.pstyle("".concat(e,"-padding")).pfValue,u=n.pstyle("".concat(e,"-opacity")).value,c=n.pstyle("".concat(e,"-color")).value,d=n.pstyle("".concat(e,"-shape")).value,f=n.pstyle("".concat(e,"-corner-radius")).value;if(u>0){if(a=a||n.position(),i==null||s==null){var v=n.padding();i=n.width()+2*v,s=n.height()+2*v}o.colorFillStyle(r,c[0],c[1],c[2],u),o.nodeShapes[d].draw(r,a.x,a.y,i+l*2,s+l*2,f),r.fill()}}}};_i.drawNodeOverlay=DI("overlay");_i.drawNodeUnderlay=DI("underlay");_i.hasPie=function(t){return t=t[0],t._private.hasPie};_i.hasStripe=function(t){return t=t[0],t._private.hasStripe};_i.drawPie=function(t,e,r,n){e=e[0],n=n||e.position();var a=e.cy().style(),i=e.pstyle("pie-size"),s=e.pstyle("pie-hole"),o=e.pstyle("pie-start-angle").pfValue,l=n.x,u=n.y,c=e.width(),d=e.height(),f=Math.min(c,d)/2,v,p=0,y=this.usePaths();if(y&&(l=0,u=0),i.units==="%"?f=f*i.pfValue:i.pfValue!==void 0&&(f=i.pfValue/2),s.units==="%"?v=f*s.pfValue:s.pfValue!==void 0&&(v=s.pfValue/2),!(v>=f))for(var m=1;m<=a.pieBackgroundN;m++){var g=e.pstyle("pie-"+m+"-background-size").value,x=e.pstyle("pie-"+m+"-background-color").value,b=e.pstyle("pie-"+m+"-background-opacity").value*r,w=g/100;w+p>1&&(w=1-p);var E=1.5*Math.PI+2*Math.PI*p;E+=o;var C=2*Math.PI*w,S=E+C;g===0||p>=1||p+w>1||(v===0?(t.beginPath(),t.moveTo(l,u),t.arc(l,u,f,E,S),t.closePath()):(t.beginPath(),t.arc(l,u,f,E,S),t.arc(l,u,v,S,E,!0),t.closePath()),this.colorFillStyle(t,x[0],x[1],x[2],b),t.fill(),p+=w)}};_i.drawStripe=function(t,e,r,n){e=e[0],n=n||e.position();var a=e.cy().style(),i=n.x,s=n.y,o=e.width(),l=e.height(),u=0,c=this.usePaths();t.save();var d=e.pstyle("stripe-direction").value,f=e.pstyle("stripe-size");switch(d){case"vertical":break;case"righward":t.rotate(-Math.PI/2);break}var v=o,p=l;f.units==="%"?(v=v*f.pfValue,p=p*f.pfValue):f.pfValue!==void 0&&(v=f.pfValue,p=f.pfValue),c&&(i=0,s=0),s-=v/2,i-=p/2;for(var y=1;y<=a.stripeBackgroundN;y++){var m=e.pstyle("stripe-"+y+"-background-size").value,g=e.pstyle("stripe-"+y+"-background-color").value,x=e.pstyle("stripe-"+y+"-background-opacity").value*r,b=m/100;b+u>1&&(b=1-u),!(m===0||u>=1||u+b>1)&&(t.beginPath(),t.rect(i,s+p*u,v,p*b),t.closePath(),this.colorFillStyle(t,g[0],g[1],g[2],x),t.fill(),u+=b)}t.restore()};var Ur={},IW=100;Ur.getPixelRatio=function(){var t=this.data.contexts[0];if(this.forcedPixelRatio!=null)return this.forcedPixelRatio;var e=this.cy.window(),r=t.backingStorePixelRatio||t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1;return(e.devicePixelRatio||1)/r};Ur.paintCache=function(t){for(var e=this.paintCaches=this.paintCaches||[],r=!0,n,a=0;a<e.length;a++)if(n=e[a],n.context===t){r=!1;break}return r&&(n={context:t},e.push(n)),n};Ur.createGradientStyleFor=function(t,e,r,n,a){var i,s=this.usePaths(),o=r.pstyle(e+"-gradient-stop-colors").value,l=r.pstyle(e+"-gradient-stop-positions").pfValue;if(n==="radial-gradient")if(r.isEdge()){var u=r.sourceEndpoint(),c=r.targetEndpoint(),d=r.midpoint(),f=ds(u,d),v=ds(c,d);i=t.createRadialGradient(d.x,d.y,0,d.x,d.y,Math.max(f,v))}else{var p=s?{x:0,y:0}:r.position(),y=r.paddedWidth(),m=r.paddedHeight();i=t.createRadialGradient(p.x,p.y,0,p.x,p.y,Math.max(y,m))}else if(r.isEdge()){var g=r.sourceEndpoint(),x=r.targetEndpoint();i=t.createLinearGradient(g.x,g.y,x.x,x.y)}else{var b=s?{x:0,y:0}:r.position(),w=r.paddedWidth(),E=r.paddedHeight(),C=w/2,S=E/2,T=r.pstyle("background-gradient-direction").value;switch(T){case"to-bottom":i=t.createLinearGradient(b.x,b.y-S,b.x,b.y+S);break;case"to-top":i=t.createLinearGradient(b.x,b.y+S,b.x,b.y-S);break;case"to-left":i=t.createLinearGradient(b.x+C,b.y,b.x-C,b.y);break;case"to-right":i=t.createLinearGradient(b.x-C,b.y,b.x+C,b.y);break;case"to-bottom-right":case"to-right-bottom":i=t.createLinearGradient(b.x-C,b.y-S,b.x+C,b.y+S);break;case"to-top-right":case"to-right-top":i=t.createLinearGradient(b.x-C,b.y+S,b.x+C,b.y-S);break;case"to-bottom-left":case"to-left-bottom":i=t.createLinearGradient(b.x+C,b.y-S,b.x-C,b.y+S);break;case"to-top-left":case"to-left-top":i=t.createLinearGradient(b.x+C,b.y+S,b.x-C,b.y-S);break}}if(!i)return null;for(var P=l.length===o.length,A=o.length,j=0;j<A;j++)i.addColorStop(P?l[j]:j/(A-1),"rgba("+o[j][0]+","+o[j][1]+","+o[j][2]+","+a+")");return i};Ur.gradientFillStyle=function(t,e,r,n){var a=this.createGradientStyleFor(t,"background",e,r,n);if(!a)return null;t.fillStyle=a};Ur.colorFillStyle=function(t,e,r,n,a){t.fillStyle="rgba("+e+","+r+","+n+","+a+")"};Ur.eleFillStyle=function(t,e,r){var n=e.pstyle("background-fill").value;if(n==="linear-gradient"||n==="radial-gradient")this.gradientFillStyle(t,e,n,r);else{var a=e.pstyle("background-color").value;this.colorFillStyle(t,a[0],a[1],a[2],r)}};Ur.gradientStrokeStyle=function(t,e,r,n){var a=this.createGradientStyleFor(t,"line",e,r,n);if(!a)return null;t.strokeStyle=a};Ur.colorStrokeStyle=function(t,e,r,n,a){t.strokeStyle="rgba("+e+","+r+","+n+","+a+")"};Ur.eleStrokeStyle=function(t,e,r){var n=e.pstyle("line-fill").value;if(n==="linear-gradient"||n==="radial-gradient")this.gradientStrokeStyle(t,e,n,r);else{var a=e.pstyle("line-color").value;this.colorStrokeStyle(t,a[0],a[1],a[2],r)}};Ur.matchCanvasSize=function(t){var e=this,r=e.data,n=e.findContainerClientCoords(),a=n[2],i=n[3],s=e.getPixelRatio(),o=e.motionBlurPxRatio;(t===e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_NODE]||t===e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_DRAG])&&(s=o);var l=a*s,u=i*s,c;if(!(l===e.canvasWidth&&u===e.canvasHeight)){e.fontCaches=null;var d=r.canvasContainer;d.style.width=a+"px",d.style.height=i+"px";for(var f=0;f<e.CANVAS_LAYERS;f++)c=r.canvases[f],c.width=l,c.height=u,c.style.width=a+"px",c.style.height=i+"px";for(var f=0;f<e.BUFFER_COUNT;f++)c=r.bufferCanvases[f],c.width=l,c.height=u,c.style.width=a+"px",c.style.height=i+"px";e.textureMult=1,s<=1&&(c=r.bufferCanvases[e.TEXTURE_BUFFER],e.textureMult=2,c.width=l*e.textureMult,c.height=u*e.textureMult),e.canvasWidth=l,e.canvasHeight=u,e.pixelRatio=s}};Ur.renderTo=function(t,e,r,n){this.render({forcedContext:t,forcedZoom:e,forcedPan:r,drawAllLayers:!0,forcedPxRatio:n})};Ur.clearCanvas=function(){var t=this,e=t.data;function r(n){n.clearRect(0,0,t.canvasWidth,t.canvasHeight)}r(e.contexts[t.NODE]),r(e.contexts[t.DRAG])};Ur.render=function(t){var e=this;t=t||bM();var r=e.cy,n=t.forcedContext,a=t.drawAllLayers,i=t.drawOnlyNodeLayer,s=t.forcedZoom,o=t.forcedPan,l=t.forcedPxRatio===void 0?this.getPixelRatio():t.forcedPxRatio,u=e.data,c=u.canvasNeedsRedraw,d=e.textureOnViewport&&!n&&(e.pinching||e.hoverData.dragging||e.swipePanning||e.data.wheelZooming),f=t.motionBlur!==void 0?t.motionBlur:e.motionBlur,v=e.motionBlurPxRatio,p=r.hasCompoundNodes(),y=e.hoverData.draggingEles,m=!!(e.hoverData.selecting||e.touchData.selecting);f=f&&!n&&e.motionBlurEnabled&&!m;var g=f;n||(e.prevPxRatio!==l&&(e.invalidateContainerClientCoordsCache(),e.matchCanvasSize(e.container),e.redrawHint("eles",!0),e.redrawHint("drag",!0)),e.prevPxRatio=l),!n&&e.motionBlurTimeout&&clearTimeout(e.motionBlurTimeout),f&&(e.mbFrames==null&&(e.mbFrames=0),e.mbFrames++,e.mbFrames<3&&(g=!1),e.mbFrames>e.minMbLowQualFrames&&(e.motionBlurPxRatio=e.mbPxRBlurry)),e.clearingMotionBlur&&(e.motionBlurPxRatio=1),e.textureDrawLastFrame&&!d&&(c[e.NODE]=!0,c[e.SELECT_BOX]=!0);var x=r.style(),b=r.zoom(),w=s!==void 0?s:b,E=r.pan(),C={x:E.x,y:E.y},S={zoom:b,pan:{x:E.x,y:E.y}},T=e.prevViewport,P=T===void 0||S.zoom!==T.zoom||S.pan.x!==T.pan.x||S.pan.y!==T.pan.y;!P&&!(y&&!p)&&(e.motionBlurPxRatio=1),o&&(C=o),w*=l,C.x*=l,C.y*=l;var A=e.getCachedZSortedEles();function j(Y,H,X,ee,ie){var oe=Y.globalCompositeOperation;Y.globalCompositeOperation="destination-out",e.colorFillStyle(Y,255,255,255,e.motionBlurTransparency),Y.fillRect(H,X,ee,ie),Y.globalCompositeOperation=oe}function R(Y,H){var X,ee,ie,oe;!e.clearingMotionBlur&&(Y===u.bufferContexts[e.MOTIONBLUR_BUFFER_NODE]||Y===u.bufferContexts[e.MOTIONBLUR_BUFFER_DRAG])?(X={x:E.x*v,y:E.y*v},ee=b*v,ie=e.canvasWidth*v,oe=e.canvasHeight*v):(X=C,ee=w,ie=e.canvasWidth,oe=e.canvasHeight),Y.setTransform(1,0,0,1,0,0),H==="motionBlur"?j(Y,0,0,ie,oe):!n&&(H===void 0||H)&&Y.clearRect(0,0,ie,oe),a||(Y.translate(X.x,X.y),Y.scale(ee,ee)),o&&Y.translate(o.x,o.y),s&&Y.scale(s,s)}if(d||(e.textureDrawLastFrame=!1),d){if(e.textureDrawLastFrame=!0,!e.textureCache){e.textureCache={},e.textureCache.bb=r.mutableElements().boundingBox(),e.textureCache.texture=e.data.bufferCanvases[e.TEXTURE_BUFFER];var O=e.data.bufferContexts[e.TEXTURE_BUFFER];O.setTransform(1,0,0,1,0,0),O.clearRect(0,0,e.canvasWidth*e.textureMult,e.canvasHeight*e.textureMult),e.render({forcedContext:O,drawOnlyNodeLayer:!0,forcedPxRatio:l*e.textureMult});var S=e.textureCache.viewport={zoom:r.zoom(),pan:r.pan(),width:e.canvasWidth,height:e.canvasHeight};S.mpan={x:(0-S.pan.x)/S.zoom,y:(0-S.pan.y)/S.zoom}}c[e.DRAG]=!1,c[e.NODE]=!1;var N=u.contexts[e.NODE],D=e.textureCache.texture,S=e.textureCache.viewport;N.setTransform(1,0,0,1,0,0),f?j(N,0,0,S.width,S.height):N.clearRect(0,0,S.width,S.height);var L=x.core("outside-texture-bg-color").value,_=x.core("outside-texture-bg-opacity").value;e.colorFillStyle(N,L[0],L[1],L[2],_),N.fillRect(0,0,S.width,S.height);var b=r.zoom();R(N,!1),N.clearRect(S.mpan.x,S.mpan.y,S.width/S.zoom/l,S.height/S.zoom/l),N.drawImage(D,S.mpan.x,S.mpan.y,S.width/S.zoom/l,S.height/S.zoom/l)}else e.textureOnViewport&&!n&&(e.textureCache=null);var k=r.extent(),I=e.pinching||e.hoverData.dragging||e.swipePanning||e.data.wheelZooming||e.hoverData.draggingEles||e.cy.animated(),F=e.hideEdgesOnViewport&&I,B=[];if(B[e.NODE]=!c[e.NODE]&&f&&!e.clearedForMotionBlur[e.NODE]||e.clearingMotionBlur,B[e.NODE]&&(e.clearedForMotionBlur[e.NODE]=!0),B[e.DRAG]=!c[e.DRAG]&&f&&!e.clearedForMotionBlur[e.DRAG]||e.clearingMotionBlur,B[e.DRAG]&&(e.clearedForMotionBlur[e.DRAG]=!0),c[e.NODE]||a||i||B[e.NODE]){var $=f&&!B[e.NODE]&&v!==1,N=n||($?e.data.bufferContexts[e.MOTIONBLUR_BUFFER_NODE]:u.contexts[e.NODE]),W=f&&!$?"motionBlur":void 0;R(N,W),F?e.drawCachedNodes(N,A.nondrag,l,k):e.drawLayeredElements(N,A.nondrag,l,k),e.debug&&e.drawDebugPoints(N,A.nondrag),!a&&!f&&(c[e.NODE]=!1)}if(!i&&(c[e.DRAG]||a||B[e.DRAG])){var $=f&&!B[e.DRAG]&&v!==1,N=n||($?e.data.bufferContexts[e.MOTIONBLUR_BUFFER_DRAG]:u.contexts[e.DRAG]);R(N,f&&!$?"motionBlur":void 0),F?e.drawCachedNodes(N,A.drag,l,k):e.drawCachedElements(N,A.drag,l,k),e.debug&&e.drawDebugPoints(N,A.drag),!a&&!f&&(c[e.DRAG]=!1)}if(this.drawSelectionRectangle(t,R),f&&v!==1){var z=u.contexts[e.NODE],q=e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_NODE],G=u.contexts[e.DRAG],J=e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_DRAG],ae=function(H,X,ee){H.setTransform(1,0,0,1,0,0),ee||!g?H.clearRect(0,0,e.canvasWidth,e.canvasHeight):j(H,0,0,e.canvasWidth,e.canvasHeight);var ie=v;H.drawImage(X,0,0,e.canvasWidth*ie,e.canvasHeight*ie,0,0,e.canvasWidth,e.canvasHeight)};(c[e.NODE]||B[e.NODE])&&(ae(z,q,B[e.NODE]),c[e.NODE]=!1),(c[e.DRAG]||B[e.DRAG])&&(ae(G,J,B[e.DRAG]),c[e.DRAG]=!1)}e.prevViewport=S,e.clearingMotionBlur&&(e.clearingMotionBlur=!1,e.motionBlurCleared=!0,e.motionBlur=!0),f&&(e.motionBlurTimeout=setTimeout(function(){e.motionBlurTimeout=null,e.clearedForMotionBlur[e.NODE]=!1,e.clearedForMotionBlur[e.DRAG]=!1,e.motionBlur=!1,e.clearingMotionBlur=!d,e.mbFrames=0,c[e.NODE]=!0,c[e.DRAG]=!0,e.redraw()},IW)),n||r.emit("render")};var ll;Ur.drawSelectionRectangle=function(t,e){var r=this,n=r.cy,a=r.data,i=n.style(),s=t.drawOnlyNodeLayer,o=t.drawAllLayers,l=a.canvasNeedsRedraw,u=t.forcedContext;if(r.showFps||!s&&l[r.SELECT_BOX]&&!o){var c=u||a.contexts[r.SELECT_BOX];if(e(c),r.selection[4]==1&&(r.hoverData.selecting||r.touchData.selecting)){var d=r.cy.zoom(),f=i.core("selection-box-border-width").value/d;c.lineWidth=f,c.fillStyle="rgba("+i.core("selection-box-color").value[0]+","+i.core("selection-box-color").value[1]+","+i.core("selection-box-color").value[2]+","+i.core("selection-box-opacity").value+")",c.fillRect(r.selection[0],r.selection[1],r.selection[2]-r.selection[0],r.selection[3]-r.selection[1]),f>0&&(c.strokeStyle="rgba("+i.core("selection-box-border-color").value[0]+","+i.core("selection-box-border-color").value[1]+","+i.core("selection-box-border-color").value[2]+","+i.core("selection-box-opacity").value+")",c.strokeRect(r.selection[0],r.selection[1],r.selection[2]-r.selection[0],r.selection[3]-r.selection[1]))}if(a.bgActivePosistion&&!r.hoverData.selecting){var d=r.cy.zoom(),v=a.bgActivePosistion;c.fillStyle="rgba("+i.core("active-bg-color").value[0]+","+i.core("active-bg-color").value[1]+","+i.core("active-bg-color").value[2]+","+i.core("active-bg-opacity").value+")",c.beginPath(),c.arc(v.x,v.y,i.core("active-bg-size").pfValue/d,0,2*Math.PI),c.fill()}var p=r.lastRedrawTime;if(r.showFps&&p){p=Math.round(p);var y=Math.round(1e3/p),m="1 frame = "+p+" ms = "+y+" fps";if(c.setTransform(1,0,0,1,0,0),c.fillStyle="rgba(255, 0, 0, 0.75)",c.strokeStyle="rgba(255, 0, 0, 0.75)",c.font="30px Arial",!ll){var g=c.measureText(m);ll=g.actualBoundingBoxAscent}c.fillText(m,0,ll);var x=60;c.strokeRect(0,ll+10,250,20),c.fillRect(0,ll+10,250*Math.min(y/x,1),20)}o||(l[r.SELECT_BOX]=!1)}};function UR(t,e,r){var n=t.createShader(e);if(t.shaderSource(n,r),t.compileShader(n),!t.getShaderParameter(n,t.COMPILE_STATUS))throw new Error(t.getShaderInfoLog(n));return n}function FW(t,e,r){var n=UR(t,t.VERTEX_SHADER,e),a=UR(t,t.FRAGMENT_SHADER,r),i=t.createProgram();if(t.attachShader(i,n),t.attachShader(i,a),t.linkProgram(i),!t.getProgramParameter(i,t.LINK_STATUS))throw new Error("Could not initialize shaders");return i}function BW(t,e,r){r===void 0&&(r=e);var n=t.makeOffscreenCanvas(e,r),a=n.context=n.getContext("2d");return n.clear=function(){return a.clearRect(0,0,n.width,n.height)},n.clear(),n}function tS(t){var e=t.pixelRatio,r=t.cy.zoom(),n=t.cy.pan();return{zoom:r*e,pan:{x:n.x*e,y:n.y*e}}}function zW(t){var e=t.pixelRatio,r=t.cy.zoom();return r*e}function qW(t,e,r,n,a){var i=n*r+e.x,s=a*r+e.y;return s=Math.round(t.canvasHeight-s),[i,s]}function UW(t){return t.pstyle("background-fill").value!=="solid"||t.pstyle("background-image").strValue!=="none"?!1:t.pstyle("border-width").value===0||t.pstyle("border-opacity").value===0?!0:t.pstyle("border-style").value==="solid"}function $W(t,e){if(t.length!==e.length)return!1;for(var r=0;r<t.length;r++)if(t[r]!==e[r])return!1;return!0}function Bi(t,e,r){var n=t[0]/255,a=t[1]/255,i=t[2]/255,s=e,o=r||new Array(4);return o[0]=n*s,o[1]=a*s,o[2]=i*s,o[3]=s,o}function Ds(t,e){var r=e||new Array(4);return r[0]=(t>>0&255)/255,r[1]=(t>>8&255)/255,r[2]=(t>>16&255)/255,r[3]=(t>>24&255)/255,r}function VW(t){return t[0]+(t[1]<<8)+(t[2]<<16)+(t[3]<<24)}function GW(t,e){var r=t.createTexture();return r.buffer=function(n){t.bindTexture(t.TEXTURE_2D,r),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR_MIPMAP_NEAREST),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,n),t.generateMipmap(t.TEXTURE_2D),t.bindTexture(t.TEXTURE_2D,null)},r.deleteTexture=function(){t.deleteTexture(r)},r}function _I(t,e){switch(e){case"float":return[1,t.FLOAT,4];case"vec2":return[2,t.FLOAT,4];case"vec3":return[3,t.FLOAT,4];case"vec4":return[4,t.FLOAT,4];case"int":return[1,t.INT,4];case"ivec2":return[2,t.INT,4]}}function jI(t,e,r){switch(e){case t.FLOAT:return new Float32Array(r);case t.INT:return new Int32Array(r)}}function HW(t,e,r,n,a,i){switch(e){case t.FLOAT:return new Float32Array(r.buffer,i*n,a);case t.INT:return new Int32Array(r.buffer,i*n,a)}}function WW(t,e,r,n){var a=_I(t,e),i=Ht(a,2),s=i[0],o=i[1],l=jI(t,o,n),u=t.createBuffer();return t.bindBuffer(t.ARRAY_BUFFER,u),t.bufferData(t.ARRAY_BUFFER,l,t.STATIC_DRAW),o===t.FLOAT?t.vertexAttribPointer(r,s,o,!1,0,0):o===t.INT&&t.vertexAttribIPointer(r,s,o,0,0),t.enableVertexAttribArray(r),t.bindBuffer(t.ARRAY_BUFFER,null),u}function ta(t,e,r,n){var a=_I(t,r),i=Ht(a,3),s=i[0],o=i[1],l=i[2],u=jI(t,o,e*s),c=s*l,d=t.createBuffer();t.bindBuffer(t.ARRAY_BUFFER,d),t.bufferData(t.ARRAY_BUFFER,e*c,t.DYNAMIC_DRAW),t.enableVertexAttribArray(n),o===t.FLOAT?t.vertexAttribPointer(n,s,o,!1,c,0):o===t.INT&&t.vertexAttribIPointer(n,s,o,c,0),t.vertexAttribDivisor(n,1),t.bindBuffer(t.ARRAY_BUFFER,null);for(var f=new Array(e),v=0;v<e;v++)f[v]=HW(t,o,u,c,s,v);return d.dataArray=u,d.stride=c,d.size=s,d.getView=function(p){return f[p]},d.setPoint=function(p,y,m){var g=f[p];g[0]=y,g[1]=m},d.bufferSubData=function(p){t.bindBuffer(t.ARRAY_BUFFER,d),p?t.bufferSubData(t.ARRAY_BUFFER,0,u,0,p*s):t.bufferSubData(t.ARRAY_BUFFER,0,u)},d}function YW(t,e,r){for(var n=9,a=new Float32Array(e*n),i=new Array(e),s=0;s<e;s++){var o=s*n*4;i[s]=new Float32Array(a.buffer,o,n)}var l=t.createBuffer();t.bindBuffer(t.ARRAY_BUFFER,l),t.bufferData(t.ARRAY_BUFFER,a.byteLength,t.DYNAMIC_DRAW);for(var u=0;u<3;u++){var c=r+u;t.enableVertexAttribArray(c),t.vertexAttribPointer(c,3,t.FLOAT,!1,3*12,u*12),t.vertexAttribDivisor(c,1)}return t.bindBuffer(t.ARRAY_BUFFER,null),l.getMatrixView=function(d){return i[d]},l.setData=function(d,f){i[f].set(d,0)},l.bufferSubData=function(){t.bindBuffer(t.ARRAY_BUFFER,l),t.bufferSubData(t.ARRAY_BUFFER,0,a)},l}function XW(t){var e=t.createFramebuffer();t.bindFramebuffer(t.FRAMEBUFFER,e);var r=t.createTexture();return t.bindTexture(t.TEXTURE_2D,r),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,r,0),t.bindFramebuffer(t.FRAMEBUFFER,null),e.setFramebufferAttachmentSizes=function(n,a){t.bindTexture(t.TEXTURE_2D,r),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,n,a,0,t.RGBA,t.UNSIGNED_BYTE,null)},e}var $R=typeof Float32Array<"u"?Float32Array:Array;Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)});function Up(){var t=new $R(9);return $R!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t}function VR(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function KW(t,e,r){var n=e[0],a=e[1],i=e[2],s=e[3],o=e[4],l=e[5],u=e[6],c=e[7],d=e[8],f=r[0],v=r[1],p=r[2],y=r[3],m=r[4],g=r[5],x=r[6],b=r[7],w=r[8];return t[0]=f*n+v*s+p*u,t[1]=f*a+v*o+p*c,t[2]=f*i+v*l+p*d,t[3]=y*n+m*s+g*u,t[4]=y*a+m*o+g*c,t[5]=y*i+m*l+g*d,t[6]=x*n+b*s+w*u,t[7]=x*a+b*o+w*c,t[8]=x*i+b*l+w*d,t}function gd(t,e,r){var n=e[0],a=e[1],i=e[2],s=e[3],o=e[4],l=e[5],u=e[6],c=e[7],d=e[8],f=r[0],v=r[1];return t[0]=n,t[1]=a,t[2]=i,t[3]=s,t[4]=o,t[5]=l,t[6]=f*n+v*s+u,t[7]=f*a+v*o+c,t[8]=f*i+v*l+d,t}function GR(t,e,r){var n=e[0],a=e[1],i=e[2],s=e[3],o=e[4],l=e[5],u=e[6],c=e[7],d=e[8],f=Math.sin(r),v=Math.cos(r);return t[0]=v*n+f*s,t[1]=v*a+f*o,t[2]=v*i+f*l,t[3]=v*s-f*n,t[4]=v*o-f*a,t[5]=v*l-f*i,t[6]=u,t[7]=c,t[8]=d,t}function ew(t,e,r){var n=r[0],a=r[1];return t[0]=n*e[0],t[1]=n*e[1],t[2]=n*e[2],t[3]=a*e[3],t[4]=a*e[4],t[5]=a*e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t}function QW(t,e,r){return t[0]=2/e,t[1]=0,t[2]=0,t[3]=0,t[4]=-2/r,t[5]=0,t[6]=-1,t[7]=1,t[8]=1,t}var ZW=function(){function t(e,r,n,a){ki(this,t),this.debugID=Math.floor(Math.random()*1e4),this.r=e,this.texSize=r,this.texRows=n,this.texHeight=Math.floor(r/n),this.enableWrapping=!0,this.locked=!1,this.texture=null,this.needsBuffer=!0,this.freePointer={x:0,row:0},this.keyToLocation=new Map,this.canvas=a(e,r,r),this.scratch=a(e,r,this.texHeight,"scratch")}return Li(t,[{key:"lock",value:function(){this.locked=!0}},{key:"getKeys",value:function(){return new Set(this.keyToLocation.keys())}},{key:"getScale",value:function(r){var n=r.w,a=r.h,i=this.texHeight,s=this.texSize,o=i/a,l=n*o,u=a*o;return l>s&&(o=s/n,l=n*o,u=a*o),{scale:o,texW:l,texH:u}}},{key:"draw",value:function(r,n,a){var i=this;if(this.locked)throw new Error("can't draw, atlas is locked");var s=this.texSize,o=this.texRows,l=this.texHeight,u=this.getScale(n),c=u.scale,d=u.texW,f=u.texH,v=function(b,w){if(a&&w){var E=w.context,C=b.x,S=b.row,T=C,P=l*S;E.save(),E.translate(T,P),E.scale(c,c),a(E,n),E.restore()}},p=[null,null],y=function(){v(i.freePointer,i.canvas),p[0]={x:i.freePointer.x,y:i.freePointer.row*l,w:d,h:f},p[1]={x:i.freePointer.x+d,y:i.freePointer.row*l,w:0,h:f},i.freePointer.x+=d,i.freePointer.x==s&&(i.freePointer.x=0,i.freePointer.row++)},m=function(){var b=i.scratch,w=i.canvas;b.clear(),v({x:0,row:0},b);var E=s-i.freePointer.x,C=d-E,S=l;{var T=i.freePointer.x,P=i.freePointer.row*l,A=E;w.context.drawImage(b,0,0,A,S,T,P,A,S),p[0]={x:T,y:P,w:A,h:f}}{var j=E,R=(i.freePointer.row+1)*l,O=C;w&&w.context.drawImage(b,j,0,O,S,0,R,O,S),p[1]={x:0,y:R,w:O,h:f}}i.freePointer.x=C,i.freePointer.row++},g=function(){i.freePointer.x=0,i.freePointer.row++};if(this.freePointer.x+d<=s)y();else{if(this.freePointer.row>=o-1)return!1;this.freePointer.x===s?(g(),y()):this.enableWrapping?m():(g(),y())}return this.keyToLocation.set(r,p),this.needsBuffer=!0,p}},{key:"getOffsets",value:function(r){return this.keyToLocation.get(r)}},{key:"isEmpty",value:function(){return this.freePointer.x===0&&this.freePointer.row===0}},{key:"canFit",value:function(r){if(this.locked)return!1;var n=this.texSize,a=this.texRows,i=this.getScale(r),s=i.texW;return this.freePointer.x+s>n?this.freePointer.row<a-1:!0}},{key:"bufferIfNeeded",value:function(r){this.texture||(this.texture=GW(r,this.debugID)),this.needsBuffer&&(this.texture.buffer(this.canvas),this.needsBuffer=!1,this.locked&&(this.canvas=null,this.scratch=null))}},{key:"dispose",value:function(){this.texture&&(this.texture.deleteTexture(),this.texture=null),this.canvas=null,this.scratch=null,this.locked=!0}}])}(),JW=function(){function t(e,r,n,a){ki(this,t),this.r=e,this.texSize=r,this.texRows=n,this.createTextureCanvas=a,this.atlases=[],this.styleKeyToAtlas=new Map,this.markedKeys=new Set}return Li(t,[{key:"getKeys",value:function(){return new Set(this.styleKeyToAtlas.keys())}},{key:"_createAtlas",value:function(){var r=this.r,n=this.texSize,a=this.texRows,i=this.createTextureCanvas;return new ZW(r,n,a,i)}},{key:"_getScratchCanvas",value:function(){if(!this.scratch){var r=this.r,n=this.texSize,a=this.texRows,i=this.createTextureCanvas,s=Math.floor(n/a);this.scratch=i(r,n,s,"scratch")}return this.scratch}},{key:"draw",value:function(r,n,a){var i=this.styleKeyToAtlas.get(r);return i||(i=this.atlases[this.atlases.length-1],(!i||!i.canFit(n))&&(i&&i.lock(),i=this._createAtlas(),this.atlases.push(i)),i.draw(r,n,a),this.styleKeyToAtlas.set(r,i)),i}},{key:"getAtlas",value:function(r){return this.styleKeyToAtlas.get(r)}},{key:"hasAtlas",value:function(r){return this.styleKeyToAtlas.has(r)}},{key:"markKeyForGC",value:function(r){this.markedKeys.add(r)}},{key:"gc",value:function(){var r=this,n=this.markedKeys;if(n.size===0){console.log("nothing to garbage collect");return}var a=[],i=new Map,s=null,o=Xr(this.atlases),l;try{var u=function(){var d=l.value,f=d.getKeys(),v=e8(n,f);if(v.size===0)return a.push(d),f.forEach(function(E){return i.set(E,d)}),1;s||(s=r._createAtlas(),a.push(s));var p=Xr(f),y;try{for(p.s();!(y=p.n()).done;){var m=y.value;if(!v.has(m)){var g=d.getOffsets(m),x=Ht(g,2),b=x[0],w=x[1];s.canFit({w:b.w+w.w,h:b.h})||(s.lock(),s=r._createAtlas(),a.push(s)),d.canvas&&(r._copyTextureToNewAtlas(m,d,s),i.set(m,s))}}}catch(E){p.e(E)}finally{p.f()}d.dispose()};for(o.s();!(l=o.n()).done;)u()}catch(c){o.e(c)}finally{o.f()}this.atlases=a,this.styleKeyToAtlas=i,this.markedKeys=new Set}},{key:"_copyTextureToNewAtlas",value:function(r,n,a){var i=n.getOffsets(r),s=Ht(i,2),o=s[0],l=s[1];if(l.w===0)a.draw(r,o,function(f){f.drawImage(n.canvas,o.x,o.y,o.w,o.h,0,0,o.w,o.h)});else{var u=this._getScratchCanvas();u.clear(),u.context.drawImage(n.canvas,o.x,o.y,o.w,o.h,0,0,o.w,o.h),u.context.drawImage(n.canvas,l.x,l.y,l.w,l.h,o.w,0,l.w,l.h);var c=o.w+l.w,d=o.h;a.draw(r,{w:c,h:d},function(f){f.drawImage(u,0,0,c,d,0,0,c,d)})}}},{key:"getCounts",value:function(){return{keyCount:this.styleKeyToAtlas.size,atlasCount:new Set(this.styleKeyToAtlas.values()).size}}}])}();function e8(t,e){return t.intersection?t.intersection(e):new Set(Yd(t).filter(function(r){return e.has(r)}))}var t8=function(){function t(e,r){ki(this,t),this.r=e,this.globalOptions=r,this.atlasSize=r.webglTexSize,this.maxAtlasesPerBatch=r.webglTexPerBatch,this.renderTypes=new Map,this.collections=new Map,this.typeAndIdToKey=new Map}return Li(t,[{key:"getAtlasSize",value:function(){return this.atlasSize}},{key:"addAtlasCollection",value:function(r,n){var a=this.globalOptions,i=a.webglTexSize,s=a.createTextureCanvas,o=n.texRows,l=this._cacheScratchCanvas(s),u=new JW(this.r,i,o,l);this.collections.set(r,u)}},{key:"addRenderType",value:function(r,n){var a=n.collection;if(!this.collections.has(a))throw new Error("invalid atlas collection name '".concat(a,"'"));var i=this.collections.get(a),s=We({type:r,atlasCollection:i},n);this.renderTypes.set(r,s)}},{key:"getRenderTypeOpts",value:function(r){return this.renderTypes.get(r)}},{key:"getAtlasCollection",value:function(r){return this.collections.get(r)}},{key:"_cacheScratchCanvas",value:function(r){var n=-1,a=-1,i=null;return function(s,o,l,u){return u?((!i||o!=n||l!=a)&&(n=o,a=l,i=r(s,o,l)),i):r(s,o,l)}}},{key:"_key",value:function(r,n){return"".concat(r,"-").concat(n)}},{key:"invalidate",value:function(r){var n=this,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=a.forceRedraw,s=i===void 0?!1:i,o=a.filterEle,l=o===void 0?function(){return!0}:o,u=a.filterType,c=u===void 0?function(){return!0}:u,d=!1,f=!1,v=Xr(r),p;try{for(v.s();!(p=v.n()).done;){var y=p.value;if(l(y)){var m=Xr(this.renderTypes.values()),g;try{var x=function(){var w=g.value,E=w.type;if(c(E)){var C=n.collections.get(w.collection),S=w.getKey(y),T=Array.isArray(S)?S:[S];if(s)T.forEach(function(R){return C.markKeyForGC(R)}),f=!0;else{var P=w.getID?w.getID(y):y.id(),A=n._key(E,P),j=n.typeAndIdToKey.get(A);j!==void 0&&!$W(T,j)&&(d=!0,n.typeAndIdToKey.delete(A),j.forEach(function(R){return C.markKeyForGC(R)}))}}};for(m.s();!(g=m.n()).done;)x()}catch(b){m.e(b)}finally{m.f()}}}}catch(b){v.e(b)}finally{v.f()}return f&&(this.gc(),d=!1),d}},{key:"gc",value:function(){var r=Xr(this.collections.values()),n;try{for(r.s();!(n=r.n()).done;){var a=n.value;a.gc()}}catch(i){r.e(i)}finally{r.f()}}},{key:"getOrCreateAtlas",value:function(r,n,a,i){var s=this.renderTypes.get(n),o=this.collections.get(s.collection),l=!1,u=o.draw(i,a,function(f){s.drawClipped?(f.save(),f.beginPath(),f.rect(0,0,a.w,a.h),f.clip(),s.drawElement(f,r,a,!0,!0),f.restore()):s.drawElement(f,r,a,!0,!0),l=!0});if(l){var c=s.getID?s.getID(r):r.id(),d=this._key(n,c);this.typeAndIdToKey.has(d)?this.typeAndIdToKey.get(d).push(i):this.typeAndIdToKey.set(d,[i])}return u}},{key:"getAtlasInfo",value:function(r,n){var a=this,i=this.renderTypes.get(n),s=i.getKey(r),o=Array.isArray(s)?s:[s];return o.map(function(l){var u=i.getBoundingBox(r,l),c=a.getOrCreateAtlas(r,n,u,l),d=c.getOffsets(l),f=Ht(d,2),v=f[0],p=f[1];return{atlas:c,tex:v,tex1:v,tex2:p,bb:u}})}},{key:"getDebugInfo",value:function(){var r=[],n=Xr(this.collections),a;try{for(n.s();!(a=n.n()).done;){var i=Ht(a.value,2),s=i[0],o=i[1],l=o.getCounts(),u=l.keyCount,c=l.atlasCount;r.push({type:s,keyCount:u,atlasCount:c})}}catch(d){n.e(d)}finally{n.f()}return r}}])}(),r8=function(){function t(e){ki(this,t),this.globalOptions=e,this.atlasSize=e.webglTexSize,this.maxAtlasesPerBatch=e.webglTexPerBatch,this.batchAtlases=[]}return Li(t,[{key:"getMaxAtlasesPerBatch",value:function(){return this.maxAtlasesPerBatch}},{key:"getAtlasSize",value:function(){return this.atlasSize}},{key:"getIndexArray",value:function(){return Array.from({length:this.maxAtlasesPerBatch},function(r,n){return n})}},{key:"startBatch",value:function(){this.batchAtlases=[]}},{key:"getAtlasCount",value:function(){return this.batchAtlases.length}},{key:"getAtlases",value:function(){return this.batchAtlases}},{key:"canAddToCurrentBatch",value:function(r){return this.batchAtlases.length===this.maxAtlasesPerBatch?this.batchAtlases.includes(r):!0}},{key:"getAtlasIndexForBatch",value:function(r){var n=this.batchAtlases.indexOf(r);if(n<0){if(this.batchAtlases.length===this.maxAtlasesPerBatch)throw new Error("cannot add more atlases to batch");this.batchAtlases.push(r),n=this.batchAtlases.length-1}return n}}])}(),n8=`
|
|
100
|
+
float circleSD(vec2 p, float r) {
|
|
101
|
+
return distance(vec2(0), p) - r; // signed distance
|
|
102
|
+
}
|
|
103
|
+
`,a8=`
|
|
104
|
+
float rectangleSD(vec2 p, vec2 b) {
|
|
105
|
+
vec2 d = abs(p)-b;
|
|
106
|
+
return distance(vec2(0),max(d,0.0)) + min(max(d.x,d.y),0.0);
|
|
107
|
+
}
|
|
108
|
+
`,i8=`
|
|
109
|
+
float roundRectangleSD(vec2 p, vec2 b, vec4 cr) {
|
|
110
|
+
cr.xy = (p.x > 0.0) ? cr.xy : cr.zw;
|
|
111
|
+
cr.x = (p.y > 0.0) ? cr.x : cr.y;
|
|
112
|
+
vec2 q = abs(p) - b + cr.x;
|
|
113
|
+
return min(max(q.x, q.y), 0.0) + distance(vec2(0), max(q, 0.0)) - cr.x;
|
|
114
|
+
}
|
|
115
|
+
`,s8=`
|
|
116
|
+
float ellipseSD(vec2 p, vec2 ab) {
|
|
117
|
+
p = abs( p ); // symmetry
|
|
118
|
+
|
|
119
|
+
// find root with Newton solver
|
|
120
|
+
vec2 q = ab*(p-ab);
|
|
121
|
+
float w = (q.x<q.y)? 1.570796327 : 0.0;
|
|
122
|
+
for( int i=0; i<5; i++ ) {
|
|
123
|
+
vec2 cs = vec2(cos(w),sin(w));
|
|
124
|
+
vec2 u = ab*vec2( cs.x,cs.y);
|
|
125
|
+
vec2 v = ab*vec2(-cs.y,cs.x);
|
|
126
|
+
w = w + dot(p-u,v)/(dot(p-u,u)+dot(v,v));
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
// compute final point and distance
|
|
130
|
+
float d = length(p-ab*vec2(cos(w),sin(w)));
|
|
131
|
+
|
|
132
|
+
// return signed distance
|
|
133
|
+
return (dot(p/ab,p/ab)>1.0) ? d : -d;
|
|
134
|
+
}
|
|
135
|
+
`,Fl={SCREEN:{name:"screen",screen:!0},PICKING:{name:"picking",picking:!0}},of={IGNORE:1,USE_BB:2},$p=0,HR=1,WR=2,Vp=3,_s=4,Mc=5,ul=6,cl=7,o8=function(){function t(e,r,n){ki(this,t),this.r=e,this.gl=r,this.maxInstances=n.webglBatchSize,this.atlasSize=n.webglTexSize,this.bgColor=n.bgColor,this.debug=n.webglDebug,this.batchDebugInfo=[],n.enableWrapping=!0,n.createTextureCanvas=BW,this.atlasManager=new t8(e,n),this.batchManager=new r8(n),this.simpleShapeOptions=new Map,this.program=this._createShaderProgram(Fl.SCREEN),this.pickingProgram=this._createShaderProgram(Fl.PICKING),this.vao=this._createVAO()}return Li(t,[{key:"addAtlasCollection",value:function(r,n){this.atlasManager.addAtlasCollection(r,n)}},{key:"addTextureAtlasRenderType",value:function(r,n){this.atlasManager.addRenderType(r,n)}},{key:"addSimpleShapeRenderType",value:function(r,n){this.simpleShapeOptions.set(r,n)}},{key:"invalidate",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=n.type,i=this.atlasManager;return a?i.invalidate(r,{filterType:function(o){return o===a},forceRedraw:!0}):i.invalidate(r)}},{key:"gc",value:function(){this.atlasManager.gc()}},{key:"_createShaderProgram",value:function(r){var n=this.gl,a=`#version 300 es
|
|
136
|
+
precision highp float;
|
|
137
|
+
|
|
138
|
+
uniform mat3 uPanZoomMatrix;
|
|
139
|
+
uniform int uAtlasSize;
|
|
140
|
+
|
|
141
|
+
// instanced
|
|
142
|
+
in vec2 aPosition; // a vertex from the unit square
|
|
143
|
+
|
|
144
|
+
in mat3 aTransform; // used to transform verticies, eg into a bounding box
|
|
145
|
+
in int aVertType; // the type of thing we are rendering
|
|
146
|
+
|
|
147
|
+
// the z-index that is output when using picking mode
|
|
148
|
+
in vec4 aIndex;
|
|
149
|
+
|
|
150
|
+
// For textures
|
|
151
|
+
in int aAtlasId; // which shader unit/atlas to use
|
|
152
|
+
in vec4 aTex; // x/y/w/h of texture in atlas
|
|
153
|
+
|
|
154
|
+
// for edges
|
|
155
|
+
in vec4 aPointAPointB;
|
|
156
|
+
in vec4 aPointCPointD;
|
|
157
|
+
in vec2 aLineWidth; // also used for node border width
|
|
158
|
+
|
|
159
|
+
// simple shapes
|
|
160
|
+
in vec4 aCornerRadius; // for round-rectangle [top-right, bottom-right, top-left, bottom-left]
|
|
161
|
+
in vec4 aColor; // also used for edges
|
|
162
|
+
in vec4 aBorderColor; // aLineWidth is used for border width
|
|
163
|
+
|
|
164
|
+
// output values passed to the fragment shader
|
|
165
|
+
out vec2 vTexCoord;
|
|
166
|
+
out vec4 vColor;
|
|
167
|
+
out vec2 vPosition;
|
|
168
|
+
// flat values are not interpolated
|
|
169
|
+
flat out int vAtlasId;
|
|
170
|
+
flat out int vVertType;
|
|
171
|
+
flat out vec2 vTopRight;
|
|
172
|
+
flat out vec2 vBotLeft;
|
|
173
|
+
flat out vec4 vCornerRadius;
|
|
174
|
+
flat out vec4 vBorderColor;
|
|
175
|
+
flat out vec2 vBorderWidth;
|
|
176
|
+
flat out vec4 vIndex;
|
|
177
|
+
|
|
178
|
+
void main(void) {
|
|
179
|
+
int vid = gl_VertexID;
|
|
180
|
+
vec2 position = aPosition; // TODO make this a vec3, simplifies some code below
|
|
181
|
+
|
|
182
|
+
if(aVertType == `.concat($p,`) {
|
|
183
|
+
float texX = aTex.x; // texture coordinates
|
|
184
|
+
float texY = aTex.y;
|
|
185
|
+
float texW = aTex.z;
|
|
186
|
+
float texH = aTex.w;
|
|
187
|
+
|
|
188
|
+
if(vid == 1 || vid == 2 || vid == 4) {
|
|
189
|
+
texX += texW;
|
|
190
|
+
}
|
|
191
|
+
if(vid == 2 || vid == 4 || vid == 5) {
|
|
192
|
+
texY += texH;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
float d = float(uAtlasSize);
|
|
196
|
+
vTexCoord = vec2(texX / d, texY / d); // tex coords must be between 0 and 1
|
|
197
|
+
|
|
198
|
+
gl_Position = vec4(uPanZoomMatrix * aTransform * vec3(position, 1.0), 1.0);
|
|
199
|
+
}
|
|
200
|
+
else if(aVertType == `).concat(_s," || aVertType == ").concat(cl,`
|
|
201
|
+
|| aVertType == `).concat(Mc," || aVertType == ").concat(ul,`) { // simple shapes
|
|
202
|
+
|
|
203
|
+
// the bounding box is needed by the fragment shader
|
|
204
|
+
vBotLeft = (aTransform * vec3(0, 0, 1)).xy; // flat
|
|
205
|
+
vTopRight = (aTransform * vec3(1, 1, 1)).xy; // flat
|
|
206
|
+
vPosition = (aTransform * vec3(position, 1)).xy; // will be interpolated
|
|
207
|
+
|
|
208
|
+
// calculations are done in the fragment shader, just pass these along
|
|
209
|
+
vColor = aColor;
|
|
210
|
+
vCornerRadius = aCornerRadius;
|
|
211
|
+
vBorderColor = aBorderColor;
|
|
212
|
+
vBorderWidth = aLineWidth;
|
|
213
|
+
|
|
214
|
+
gl_Position = vec4(uPanZoomMatrix * aTransform * vec3(position, 1.0), 1.0);
|
|
215
|
+
}
|
|
216
|
+
else if(aVertType == `).concat(HR,`) {
|
|
217
|
+
vec2 source = aPointAPointB.xy;
|
|
218
|
+
vec2 target = aPointAPointB.zw;
|
|
219
|
+
|
|
220
|
+
// adjust the geometry so that the line is centered on the edge
|
|
221
|
+
position.y = position.y - 0.5;
|
|
222
|
+
|
|
223
|
+
// stretch the unit square into a long skinny rectangle
|
|
224
|
+
vec2 xBasis = target - source;
|
|
225
|
+
vec2 yBasis = normalize(vec2(-xBasis.y, xBasis.x));
|
|
226
|
+
vec2 point = source + xBasis * position.x + yBasis * aLineWidth[0] * position.y;
|
|
227
|
+
|
|
228
|
+
gl_Position = vec4(uPanZoomMatrix * vec3(point, 1.0), 1.0);
|
|
229
|
+
vColor = aColor;
|
|
230
|
+
}
|
|
231
|
+
else if(aVertType == `).concat(WR,`) {
|
|
232
|
+
vec2 pointA = aPointAPointB.xy;
|
|
233
|
+
vec2 pointB = aPointAPointB.zw;
|
|
234
|
+
vec2 pointC = aPointCPointD.xy;
|
|
235
|
+
vec2 pointD = aPointCPointD.zw;
|
|
236
|
+
|
|
237
|
+
// adjust the geometry so that the line is centered on the edge
|
|
238
|
+
position.y = position.y - 0.5;
|
|
239
|
+
|
|
240
|
+
vec2 p0, p1, p2, pos;
|
|
241
|
+
if(position.x == 0.0) { // The left side of the unit square
|
|
242
|
+
p0 = pointA;
|
|
243
|
+
p1 = pointB;
|
|
244
|
+
p2 = pointC;
|
|
245
|
+
pos = position;
|
|
246
|
+
} else { // The right side of the unit square, use same approach but flip the geometry upside down
|
|
247
|
+
p0 = pointD;
|
|
248
|
+
p1 = pointC;
|
|
249
|
+
p2 = pointB;
|
|
250
|
+
pos = vec2(0.0, -position.y);
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
vec2 p01 = p1 - p0;
|
|
254
|
+
vec2 p12 = p2 - p1;
|
|
255
|
+
vec2 p21 = p1 - p2;
|
|
256
|
+
|
|
257
|
+
// Find the normal vector.
|
|
258
|
+
vec2 tangent = normalize(normalize(p12) + normalize(p01));
|
|
259
|
+
vec2 normal = vec2(-tangent.y, tangent.x);
|
|
260
|
+
|
|
261
|
+
// Find the vector perpendicular to p0 -> p1.
|
|
262
|
+
vec2 p01Norm = normalize(vec2(-p01.y, p01.x));
|
|
263
|
+
|
|
264
|
+
// Determine the bend direction.
|
|
265
|
+
float sigma = sign(dot(p01 + p21, normal));
|
|
266
|
+
float width = aLineWidth[0];
|
|
267
|
+
|
|
268
|
+
if(sign(pos.y) == -sigma) {
|
|
269
|
+
// This is an intersecting vertex. Adjust the position so that there's no overlap.
|
|
270
|
+
vec2 point = 0.5 * width * normal * -sigma / dot(normal, p01Norm);
|
|
271
|
+
gl_Position = vec4(uPanZoomMatrix * vec3(p1 + point, 1.0), 1.0);
|
|
272
|
+
} else {
|
|
273
|
+
// This is a non-intersecting vertex. Treat it like a mitre join.
|
|
274
|
+
vec2 point = 0.5 * width * normal * sigma * dot(normal, p01Norm);
|
|
275
|
+
gl_Position = vec4(uPanZoomMatrix * vec3(p1 + point, 1.0), 1.0);
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
vColor = aColor;
|
|
279
|
+
}
|
|
280
|
+
else if(aVertType == `).concat(Vp,` && vid < 3) {
|
|
281
|
+
// massage the first triangle into an edge arrow
|
|
282
|
+
if(vid == 0)
|
|
283
|
+
position = vec2(-0.15, -0.3);
|
|
284
|
+
if(vid == 1)
|
|
285
|
+
position = vec2( 0.0, 0.0);
|
|
286
|
+
if(vid == 2)
|
|
287
|
+
position = vec2( 0.15, -0.3);
|
|
288
|
+
|
|
289
|
+
gl_Position = vec4(uPanZoomMatrix * aTransform * vec3(position, 1.0), 1.0);
|
|
290
|
+
vColor = aColor;
|
|
291
|
+
}
|
|
292
|
+
else {
|
|
293
|
+
gl_Position = vec4(2.0, 0.0, 0.0, 1.0); // discard vertex by putting it outside webgl clip space
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
vAtlasId = aAtlasId;
|
|
297
|
+
vVertType = aVertType;
|
|
298
|
+
vIndex = aIndex;
|
|
299
|
+
}
|
|
300
|
+
`),i=this.batchManager.getIndexArray(),s=`#version 300 es
|
|
301
|
+
precision highp float;
|
|
302
|
+
|
|
303
|
+
// declare texture unit for each texture atlas in the batch
|
|
304
|
+
`.concat(i.map(function(u){return"uniform sampler2D uTexture".concat(u,";")}).join(`
|
|
305
|
+
`),`
|
|
306
|
+
|
|
307
|
+
uniform vec4 uBGColor;
|
|
308
|
+
uniform float uZoom;
|
|
309
|
+
|
|
310
|
+
in vec2 vTexCoord;
|
|
311
|
+
in vec4 vColor;
|
|
312
|
+
in vec2 vPosition; // model coordinates
|
|
313
|
+
|
|
314
|
+
flat in int vAtlasId;
|
|
315
|
+
flat in vec4 vIndex;
|
|
316
|
+
flat in int vVertType;
|
|
317
|
+
flat in vec2 vTopRight;
|
|
318
|
+
flat in vec2 vBotLeft;
|
|
319
|
+
flat in vec4 vCornerRadius;
|
|
320
|
+
flat in vec4 vBorderColor;
|
|
321
|
+
flat in vec2 vBorderWidth;
|
|
322
|
+
|
|
323
|
+
out vec4 outColor;
|
|
324
|
+
|
|
325
|
+
`).concat(n8,`
|
|
326
|
+
`).concat(a8,`
|
|
327
|
+
`).concat(i8,`
|
|
328
|
+
`).concat(s8,`
|
|
329
|
+
|
|
330
|
+
vec4 blend(vec4 top, vec4 bot) { // blend colors with premultiplied alpha
|
|
331
|
+
return vec4(
|
|
332
|
+
top.rgb + (bot.rgb * (1.0 - top.a)),
|
|
333
|
+
top.a + (bot.a * (1.0 - top.a))
|
|
334
|
+
);
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
vec4 distInterp(vec4 cA, vec4 cB, float d) { // interpolate color using Signed Distance
|
|
338
|
+
// scale to the zoom level so that borders don't look blurry when zoomed in
|
|
339
|
+
// note 1.5 is an aribitrary value chosen because it looks good
|
|
340
|
+
return mix(cA, cB, 1.0 - smoothstep(0.0, 1.5 / uZoom, abs(d)));
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
void main(void) {
|
|
344
|
+
if(vVertType == `).concat($p,`) {
|
|
345
|
+
// look up the texel from the texture unit
|
|
346
|
+
`).concat(i.map(function(u){return"if(vAtlasId == ".concat(u,") outColor = texture(uTexture").concat(u,", vTexCoord);")}).join(`
|
|
347
|
+
else `),`
|
|
348
|
+
}
|
|
349
|
+
else if(vVertType == `).concat(Vp,`) {
|
|
350
|
+
// mimics how canvas renderer uses context.globalCompositeOperation = 'destination-out';
|
|
351
|
+
outColor = blend(vColor, uBGColor);
|
|
352
|
+
outColor.a = 1.0; // make opaque, masks out line under arrow
|
|
353
|
+
}
|
|
354
|
+
else if(vVertType == `).concat(_s,` && vBorderWidth == vec2(0.0)) { // simple rectangle with no border
|
|
355
|
+
outColor = vColor; // unit square is already transformed to the rectangle, nothing else needs to be done
|
|
356
|
+
}
|
|
357
|
+
else if(vVertType == `).concat(_s," || vVertType == ").concat(cl,`
|
|
358
|
+
|| vVertType == `).concat(Mc," || vVertType == ").concat(ul,`) { // use SDF
|
|
359
|
+
|
|
360
|
+
float outerBorder = vBorderWidth[0];
|
|
361
|
+
float innerBorder = vBorderWidth[1];
|
|
362
|
+
float borderPadding = outerBorder * 2.0;
|
|
363
|
+
float w = vTopRight.x - vBotLeft.x - borderPadding;
|
|
364
|
+
float h = vTopRight.y - vBotLeft.y - borderPadding;
|
|
365
|
+
vec2 b = vec2(w/2.0, h/2.0); // half width, half height
|
|
366
|
+
vec2 p = vPosition - vec2(vTopRight.x - b[0] - outerBorder, vTopRight.y - b[1] - outerBorder); // translate to center
|
|
367
|
+
|
|
368
|
+
float d; // signed distance
|
|
369
|
+
if(vVertType == `).concat(_s,`) {
|
|
370
|
+
d = rectangleSD(p, b);
|
|
371
|
+
} else if(vVertType == `).concat(cl,` && w == h) {
|
|
372
|
+
d = circleSD(p, b.x); // faster than ellipse
|
|
373
|
+
} else if(vVertType == `).concat(cl,`) {
|
|
374
|
+
d = ellipseSD(p, b);
|
|
375
|
+
} else {
|
|
376
|
+
d = roundRectangleSD(p, b, vCornerRadius.wzyx);
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
// use the distance to interpolate a color to smooth the edges of the shape, doesn't need multisampling
|
|
380
|
+
// we must smooth colors inwards, because we can't change pixels outside the shape's bounding box
|
|
381
|
+
if(d > 0.0) {
|
|
382
|
+
if(d > outerBorder) {
|
|
383
|
+
discard;
|
|
384
|
+
} else {
|
|
385
|
+
outColor = distInterp(vBorderColor, vec4(0), d - outerBorder);
|
|
386
|
+
}
|
|
387
|
+
} else {
|
|
388
|
+
if(d > innerBorder) {
|
|
389
|
+
vec4 outerColor = outerBorder == 0.0 ? vec4(0) : vBorderColor;
|
|
390
|
+
vec4 innerBorderColor = blend(vBorderColor, vColor);
|
|
391
|
+
outColor = distInterp(innerBorderColor, outerColor, d);
|
|
392
|
+
}
|
|
393
|
+
else {
|
|
394
|
+
vec4 outerColor;
|
|
395
|
+
if(innerBorder == 0.0 && outerBorder == 0.0) {
|
|
396
|
+
outerColor = vec4(0);
|
|
397
|
+
} else if(innerBorder == 0.0) {
|
|
398
|
+
outerColor = vBorderColor;
|
|
399
|
+
} else {
|
|
400
|
+
outerColor = blend(vBorderColor, vColor);
|
|
401
|
+
}
|
|
402
|
+
outColor = distInterp(vColor, outerColor, d - innerBorder);
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
else {
|
|
407
|
+
outColor = vColor;
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
`).concat(r.picking?`if(outColor.a == 0.0) discard;
|
|
411
|
+
else outColor = vIndex;`:"",`
|
|
412
|
+
}
|
|
413
|
+
`),o=FW(n,a,s);o.aPosition=n.getAttribLocation(o,"aPosition"),o.aIndex=n.getAttribLocation(o,"aIndex"),o.aVertType=n.getAttribLocation(o,"aVertType"),o.aTransform=n.getAttribLocation(o,"aTransform"),o.aAtlasId=n.getAttribLocation(o,"aAtlasId"),o.aTex=n.getAttribLocation(o,"aTex"),o.aPointAPointB=n.getAttribLocation(o,"aPointAPointB"),o.aPointCPointD=n.getAttribLocation(o,"aPointCPointD"),o.aLineWidth=n.getAttribLocation(o,"aLineWidth"),o.aColor=n.getAttribLocation(o,"aColor"),o.aCornerRadius=n.getAttribLocation(o,"aCornerRadius"),o.aBorderColor=n.getAttribLocation(o,"aBorderColor"),o.uPanZoomMatrix=n.getUniformLocation(o,"uPanZoomMatrix"),o.uAtlasSize=n.getUniformLocation(o,"uAtlasSize"),o.uBGColor=n.getUniformLocation(o,"uBGColor"),o.uZoom=n.getUniformLocation(o,"uZoom"),o.uTextures=[];for(var l=0;l<this.batchManager.getMaxAtlasesPerBatch();l++)o.uTextures.push(n.getUniformLocation(o,"uTexture".concat(l)));return o}},{key:"_createVAO",value:function(){var r=[0,0,1,0,1,1,0,0,1,1,0,1];this.vertexCount=r.length/2;var n=this.maxInstances,a=this.gl,i=this.program,s=a.createVertexArray();return a.bindVertexArray(s),WW(a,"vec2",i.aPosition,r),this.transformBuffer=YW(a,n,i.aTransform),this.indexBuffer=ta(a,n,"vec4",i.aIndex),this.vertTypeBuffer=ta(a,n,"int",i.aVertType),this.atlasIdBuffer=ta(a,n,"int",i.aAtlasId),this.texBuffer=ta(a,n,"vec4",i.aTex),this.pointAPointBBuffer=ta(a,n,"vec4",i.aPointAPointB),this.pointCPointDBuffer=ta(a,n,"vec4",i.aPointCPointD),this.lineWidthBuffer=ta(a,n,"vec2",i.aLineWidth),this.colorBuffer=ta(a,n,"vec4",i.aColor),this.cornerRadiusBuffer=ta(a,n,"vec4",i.aCornerRadius),this.borderColorBuffer=ta(a,n,"vec4",i.aBorderColor),a.bindVertexArray(null),s}},{key:"buffers",get:function(){var r=this;return this._buffers||(this._buffers=Object.keys(this).filter(function(n){return ni(n,"Buffer")}).map(function(n){return r[n]})),this._buffers}},{key:"startFrame",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Fl.SCREEN;this.panZoomMatrix=r,this.renderTarget=n,this.batchDebugInfo=[],this.wrappedCount=0,this.simpleCount=0,this.startBatch()}},{key:"startBatch",value:function(){this.instanceCount=0,this.batchManager.startBatch()}},{key:"endFrame",value:function(){this.endBatch()}},{key:"_isVisible",value:function(r,n){return r.visible()?n&&n.isVisible?n.isVisible(r):!0:!1}},{key:"drawTexture",value:function(r,n,a){var i=this.atlasManager,s=this.batchManager,o=i.getRenderTypeOpts(a);if(this._isVisible(r,o)&&!(r.isEdge()&&!this._isValidEdge(r))){if(this.renderTarget.picking&&o.getTexPickingMode){var l=o.getTexPickingMode(r);if(l===of.IGNORE)return;if(l==of.USE_BB){this.drawPickingRectangle(r,n,a);return}}var u=i.getAtlasInfo(r,a),c=Xr(u),d;try{for(c.s();!(d=c.n()).done;){var f=d.value,v=f.atlas,p=f.tex1,y=f.tex2;s.canAddToCurrentBatch(v)||this.endBatch();for(var m=s.getAtlasIndexForBatch(v),g=0,x=[[p,!0],[y,!1]];g<x.length;g++){var b=Ht(x[g],2),w=b[0],E=b[1];if(w.w!=0){var C=this.instanceCount;this.vertTypeBuffer.getView(C)[0]=$p;var S=this.indexBuffer.getView(C);Ds(n,S);var T=this.atlasIdBuffer.getView(C);T[0]=m;var P=this.texBuffer.getView(C);P[0]=w.x,P[1]=w.y,P[2]=w.w,P[3]=w.h;var A=this.transformBuffer.getMatrixView(C);this.setTransformMatrix(r,A,o,f,E),this.instanceCount++,E||this.wrappedCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}}}catch(j){c.e(j)}finally{c.f()}}}},{key:"setTransformMatrix",value:function(r,n,a,i){var s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,o=0;if(a.shapeProps&&a.shapeProps.padding&&(o=r.pstyle(a.shapeProps.padding).pfValue),i){var l=i.bb,u=i.tex1,c=i.tex2,d=u.w/(u.w+c.w);s||(d=1-d);var f=this._getAdjustedBB(l,o,s,d);this._applyTransformMatrix(n,f,a,r)}else{var v=a.getBoundingBox(r),p=this._getAdjustedBB(v,o,!0,1);this._applyTransformMatrix(n,p,a,r)}}},{key:"_applyTransformMatrix",value:function(r,n,a,i){var s,o;VR(r);var l=a.getRotation?a.getRotation(i):0;if(l!==0){var u=a.getRotationPoint(i),c=u.x,d=u.y;gd(r,r,[c,d]),GR(r,r,l);var f=a.getRotationOffset(i);s=f.x+(n.xOffset||0),o=f.y+(n.yOffset||0)}else s=n.x1,o=n.y1;gd(r,r,[s,o]),ew(r,r,[n.w,n.h])}},{key:"_getAdjustedBB",value:function(r,n,a,i){var s=r.x1,o=r.y1,l=r.w,u=r.h,c=r.yOffset;n&&(s-=n,o-=n,l+=2*n,u+=2*n);var d=0,f=l*i;return a&&i<1?l=f:!a&&i<1&&(d=l-f,s+=d,l=f),{x1:s,y1:o,w:l,h:u,xOffset:d,yOffset:c}}},{key:"drawPickingRectangle",value:function(r,n,a){var i=this.atlasManager.getRenderTypeOpts(a),s=this.instanceCount;this.vertTypeBuffer.getView(s)[0]=_s;var o=this.indexBuffer.getView(s);Ds(n,o);var l=this.colorBuffer.getView(s);Bi([0,0,0],1,l);var u=this.transformBuffer.getMatrixView(s);this.setTransformMatrix(r,u,i),this.simpleCount++,this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}},{key:"drawNode",value:function(r,n,a){var i=this.simpleShapeOptions.get(a);if(this._isVisible(r,i)){var s=i.shapeProps,o=this._getVertTypeForShape(r,s.shape);if(o===void 0||i.isSimple&&!i.isSimple(r)){this.drawTexture(r,n,a);return}var l=this.instanceCount;if(this.vertTypeBuffer.getView(l)[0]=o,o===Mc||o===ul){var u=i.getBoundingBox(r),c=this._getCornerRadius(r,s.radius,u),d=this.cornerRadiusBuffer.getView(l);d[0]=c,d[1]=c,d[2]=c,d[3]=c,o===ul&&(d[0]=0,d[2]=0)}var f=this.indexBuffer.getView(l);Ds(n,f);var v=r.pstyle(s.color).value,p=r.pstyle(s.opacity).value,y=this.colorBuffer.getView(l);Bi(v,p,y);var m=this.lineWidthBuffer.getView(l);if(m[0]=0,m[1]=0,s.border){var g=r.pstyle("border-width").value;if(g>0){var x=r.pstyle("border-color").value,b=r.pstyle("border-opacity").value,w=this.borderColorBuffer.getView(l);Bi(x,b,w);var E=r.pstyle("border-position").value;if(E==="inside")m[0]=0,m[1]=-g;else if(E==="outside")m[0]=g,m[1]=0;else{var C=g/2;m[0]=C,m[1]=-C}}}var S=this.transformBuffer.getMatrixView(l);this.setTransformMatrix(r,S,i),this.simpleCount++,this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}},{key:"_getVertTypeForShape",value:function(r,n){var a=r.pstyle(n).value;switch(a){case"rectangle":return _s;case"ellipse":return cl;case"roundrectangle":case"round-rectangle":return Mc;case"bottom-round-rectangle":return ul;default:return}}},{key:"_getCornerRadius",value:function(r,n,a){var i=a.w,s=a.h;if(r.pstyle(n).value==="auto")return Ei(i,s);var o=r.pstyle(n).pfValue,l=i/2,u=s/2;return Math.min(o,u,l)}},{key:"drawEdgeArrow",value:function(r,n,a){if(r.visible()){var i=r._private.rscratch,s,o,l;if(a==="source"?(s=i.arrowStartX,o=i.arrowStartY,l=i.srcArrowAngle):(s=i.arrowEndX,o=i.arrowEndY,l=i.tgtArrowAngle),!(isNaN(s)||s==null||isNaN(o)||o==null||isNaN(l)||l==null)){var u=r.pstyle(a+"-arrow-shape").value;if(u!=="none"){var c=r.pstyle(a+"-arrow-color").value,d=r.pstyle("opacity").value,f=r.pstyle("line-opacity").value,v=d*f,p=r.pstyle("width").pfValue,y=r.pstyle("arrow-scale").value,m=this.r.getArrowWidth(p,y),g=this.instanceCount,x=this.transformBuffer.getMatrixView(g);VR(x),gd(x,x,[s,o]),ew(x,x,[m,m]),GR(x,x,l),this.vertTypeBuffer.getView(g)[0]=Vp;var b=this.indexBuffer.getView(g);Ds(n,b);var w=this.colorBuffer.getView(g);Bi(c,v,w),this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}}}},{key:"drawEdgeLine",value:function(r,n){if(r.visible()){var a=this._getEdgePoints(r);if(a){var i=r.pstyle("opacity").value,s=r.pstyle("line-opacity").value,o=r.pstyle("width").pfValue,l=r.pstyle("line-color").value,u=i*s;if(a.length/2+this.instanceCount>this.maxInstances&&this.endBatch(),a.length==4){var c=this.instanceCount;this.vertTypeBuffer.getView(c)[0]=HR;var d=this.indexBuffer.getView(c);Ds(n,d);var f=this.colorBuffer.getView(c);Bi(l,u,f);var v=this.lineWidthBuffer.getView(c);v[0]=o;var p=this.pointAPointBBuffer.getView(c);p[0]=a[0],p[1]=a[1],p[2]=a[2],p[3]=a[3],this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}else for(var y=0;y<a.length-2;y+=2){var m=this.instanceCount;this.vertTypeBuffer.getView(m)[0]=WR;var g=this.indexBuffer.getView(m);Ds(n,g);var x=this.colorBuffer.getView(m);Bi(l,u,x);var b=this.lineWidthBuffer.getView(m);b[0]=o;var w=a[y-2],E=a[y-1],C=a[y],S=a[y+1],T=a[y+2],P=a[y+3],A=a[y+4],j=a[y+5];y==0&&(w=2*C-T+.001,E=2*S-P+.001),y==a.length-4&&(A=2*T-C+.001,j=2*P-S+.001);var R=this.pointAPointBBuffer.getView(m);R[0]=w,R[1]=E,R[2]=C,R[3]=S;var O=this.pointCPointDBuffer.getView(m);O[0]=T,O[1]=P,O[2]=A,O[3]=j,this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}}}},{key:"_isValidEdge",value:function(r){var n=r._private.rscratch;return!(n.badLine||n.allpts==null||isNaN(n.allpts[0]))}},{key:"_getEdgePoints",value:function(r){var n=r._private.rscratch;if(this._isValidEdge(r)){var a=n.allpts;if(a.length==4)return a;var i=this._getNumSegments(r);return this._getCurveSegmentPoints(a,i)}}},{key:"_getNumSegments",value:function(r){var n=15;return Math.min(Math.max(n,5),this.maxInstances)}},{key:"_getCurveSegmentPoints",value:function(r,n){if(r.length==4)return r;for(var a=Array((n+1)*2),i=0;i<=n;i++)if(i==0)a[0]=r[0],a[1]=r[1];else if(i==n)a[i*2]=r[r.length-2],a[i*2+1]=r[r.length-1];else{var s=i/n;this._setCurvePoint(r,s,a,i*2)}return a}},{key:"_setCurvePoint",value:function(r,n,a,i){if(r.length<=2)a[i]=r[0],a[i+1]=r[1];else{for(var s=Array(r.length-2),o=0;o<s.length;o+=2){var l=(1-n)*r[o]+n*r[o+2],u=(1-n)*r[o+1]+n*r[o+3];s[o]=l,s[o+1]=u}return this._setCurvePoint(s,n,a,i)}}},{key:"endBatch",value:function(){var r=this.gl,n=this.vao,a=this.vertexCount,i=this.instanceCount;if(i!==0){var s=this.renderTarget.picking?this.pickingProgram:this.program;r.useProgram(s),r.bindVertexArray(n);var o=Xr(this.buffers),l;try{for(o.s();!(l=o.n()).done;){var u=l.value;u.bufferSubData(i)}}catch(p){o.e(p)}finally{o.f()}for(var c=this.batchManager.getAtlases(),d=0;d<c.length;d++)c[d].bufferIfNeeded(r);for(var f=0;f<c.length;f++)r.activeTexture(r.TEXTURE0+f),r.bindTexture(r.TEXTURE_2D,c[f].texture),r.uniform1i(s.uTextures[f],f);r.uniform1f(s.uZoom,zW(this.r)),r.uniformMatrix3fv(s.uPanZoomMatrix,!1,this.panZoomMatrix),r.uniform1i(s.uAtlasSize,this.batchManager.getAtlasSize());var v=Bi(this.bgColor,1);r.uniform4fv(s.uBGColor,v),r.drawArraysInstanced(r.TRIANGLES,0,a,i),r.bindVertexArray(null),r.bindTexture(r.TEXTURE_2D,null),this.debug&&this.batchDebugInfo.push({count:i,atlasCount:c.length}),this.startBatch()}}},{key:"getDebugInfo",value:function(){var r=this.atlasManager.getDebugInfo(),n=r.reduce(function(s,o){return s+o.atlasCount},0),a=this.batchDebugInfo,i=a.reduce(function(s,o){return s+o.count},0);return{atlasInfo:r,totalAtlases:n,wrappedCount:this.wrappedCount,simpleCount:this.simpleCount,batchCount:a.length,batchInfo:a,totalInstances:i}}}])}(),OI={};OI.initWebgl=function(t,e){var r=this,n=r.data.contexts[r.WEBGL];t.bgColor=l8(r),t.webglTexSize=Math.min(t.webglTexSize,n.getParameter(n.MAX_TEXTURE_SIZE)),t.webglTexRows=Math.min(t.webglTexRows,54),t.webglTexRowsNodes=Math.min(t.webglTexRowsNodes,54),t.webglBatchSize=Math.min(t.webglBatchSize,16384),t.webglTexPerBatch=Math.min(t.webglTexPerBatch,n.getParameter(n.MAX_TEXTURE_IMAGE_UNITS)),r.webglDebug=t.webglDebug,r.webglDebugShowAtlases=t.webglDebugShowAtlases,r.pickingFrameBuffer=XW(n),r.pickingFrameBuffer.needsDraw=!0,r.drawing=new o8(r,n,t);var a=function(d){return function(f){return r.getTextAngle(f,d)}},i=function(d){return function(f){var v=f.pstyle(d);return v&&v.value}},s=function(d){return function(f){return f.pstyle("".concat(d,"-opacity")).value>0}},o=function(d){var f=d.pstyle("text-events").strValue==="yes";return f?of.USE_BB:of.IGNORE},l=function(d){var f=d.position(),v=f.x,p=f.y,y=d.outerWidth(),m=d.outerHeight();return{w:y,h:m,x1:v-y/2,y1:p-m/2}};r.drawing.addAtlasCollection("node",{texRows:t.webglTexRowsNodes}),r.drawing.addAtlasCollection("label",{texRows:t.webglTexRows}),r.drawing.addTextureAtlasRenderType("node-body",{collection:"node",getKey:e.getStyleKey,getBoundingBox:e.getElementBox,drawElement:e.drawElement}),r.drawing.addSimpleShapeRenderType("node-body",{getBoundingBox:l,isSimple:UW,shapeProps:{shape:"shape",color:"background-color",opacity:"background-opacity",radius:"corner-radius",border:!0}}),r.drawing.addSimpleShapeRenderType("node-overlay",{getBoundingBox:l,isVisible:s("overlay"),shapeProps:{shape:"overlay-shape",color:"overlay-color",opacity:"overlay-opacity",padding:"overlay-padding",radius:"overlay-corner-radius"}}),r.drawing.addSimpleShapeRenderType("node-underlay",{getBoundingBox:l,isVisible:s("underlay"),shapeProps:{shape:"underlay-shape",color:"underlay-color",opacity:"underlay-opacity",padding:"underlay-padding",radius:"underlay-corner-radius"}}),r.drawing.addTextureAtlasRenderType("label",{collection:"label",getTexPickingMode:o,getKey:Gp(e.getLabelKey,null),getBoundingBox:Hp(e.getLabelBox,null),drawClipped:!0,drawElement:e.drawLabel,getRotation:a(null),getRotationPoint:e.getLabelRotationPoint,getRotationOffset:e.getLabelRotationOffset,isVisible:i("label")}),r.drawing.addTextureAtlasRenderType("edge-source-label",{collection:"label",getTexPickingMode:o,getKey:Gp(e.getSourceLabelKey,"source"),getBoundingBox:Hp(e.getSourceLabelBox,"source"),drawClipped:!0,drawElement:e.drawSourceLabel,getRotation:a("source"),getRotationPoint:e.getSourceLabelRotationPoint,getRotationOffset:e.getSourceLabelRotationOffset,isVisible:i("source-label")}),r.drawing.addTextureAtlasRenderType("edge-target-label",{collection:"label",getTexPickingMode:o,getKey:Gp(e.getTargetLabelKey,"target"),getBoundingBox:Hp(e.getTargetLabelBox,"target"),drawClipped:!0,drawElement:e.drawTargetLabel,getRotation:a("target"),getRotationPoint:e.getTargetLabelRotationPoint,getRotationOffset:e.getTargetLabelRotationOffset,isVisible:i("target-label")});var u=qu(function(){console.log("garbage collect flag set"),r.data.gc=!0},1e4);r.onUpdateEleCalcs(function(c,d){var f=!1;d&&d.length>0&&(f|=r.drawing.invalidate(d)),f&&u()}),u8(r)};function l8(t){var e=t.cy.container(),r=e&&e.style&&e.style.backgroundColor||"white";return uM(r)}function MI(t,e){var r=t._private.rscratch;return Hr(r,"labelWrapCachedLines",e)||[]}var Gp=function(e,r){return function(n){var a=e(n),i=MI(n,r);return i.length>1?i.map(function(s,o){return"".concat(a,"_").concat(o)}):a}},Hp=function(e,r){return function(n,a){var i=e(n);if(typeof a=="string"){var s=a.indexOf("_");if(s>0){var o=Number(a.substring(s+1)),l=MI(n,r),u=i.h/l.length,c=u*o,d=i.y1+c;return{x1:i.x1,w:i.w,y1:d,h:u,yOffset:c}}}return i}};function u8(t){{var e=t.render;t.render=function(i){i=i||{};var s=t.cy;t.webgl&&(s.zoom()>PI?(c8(t),e.call(t,i)):(d8(t),FI(t,i,Fl.SCREEN)))}}{var r=t.matchCanvasSize;t.matchCanvasSize=function(i){r.call(t,i),t.pickingFrameBuffer.setFramebufferAttachmentSizes(t.canvasWidth,t.canvasHeight),t.pickingFrameBuffer.needsDraw=!0}}t.findNearestElements=function(i,s,o,l){return m8(t,i,s)};{var n=t.invalidateCachedZSortedEles;t.invalidateCachedZSortedEles=function(){n.call(t),t.pickingFrameBuffer.needsDraw=!0}}{var a=t.notify;t.notify=function(i,s){a.call(t,i,s),i==="viewport"||i==="bounds"?t.pickingFrameBuffer.needsDraw=!0:i==="background"&&t.drawing.invalidate(s,{type:"node-body"})}}}function c8(t){var e=t.data.contexts[t.WEBGL];e.clear(e.COLOR_BUFFER_BIT|e.DEPTH_BUFFER_BIT)}function d8(t){var e=function(n){n.save(),n.setTransform(1,0,0,1,0,0),n.clearRect(0,0,t.canvasWidth,t.canvasHeight),n.restore()};e(t.data.contexts[t.NODE]),e(t.data.contexts[t.DRAG])}function f8(t){var e=t.canvasWidth,r=t.canvasHeight,n=tS(t),a=n.pan,i=n.zoom,s=Up();gd(s,s,[a.x,a.y]),ew(s,s,[i,i]);var o=Up();QW(o,e,r);var l=Up();return KW(l,o,s),l}function II(t,e){var r=t.canvasWidth,n=t.canvasHeight,a=tS(t),i=a.pan,s=a.zoom;e.setTransform(1,0,0,1,0,0),e.clearRect(0,0,r,n),e.translate(i.x,i.y),e.scale(s,s)}function h8(t,e){t.drawSelectionRectangle(e,function(r){return II(t,r)})}function v8(t){var e=t.data.contexts[t.NODE];e.save(),II(t,e),e.strokeStyle="rgba(0, 0, 0, 0.3)",e.beginPath(),e.moveTo(-1e3,0),e.lineTo(1e3,0),e.stroke(),e.beginPath(),e.moveTo(0,-1e3),e.lineTo(0,1e3),e.stroke(),e.restore()}function p8(t){var e=function(a,i,s){for(var o=a.atlasManager.getAtlasCollection(i),l=t.data.contexts[t.NODE],u=o.atlases,c=0;c<u.length;c++){var d=u[c],f=d.canvas;if(f){var v=f.width,p=f.height,y=v*c,m=f.height*s,g=.4;l.save(),l.scale(g,g),l.drawImage(f,y,m),l.strokeStyle="black",l.rect(y,m,v,p),l.stroke(),l.restore()}}},r=0;e(t.drawing,"node",r++),e(t.drawing,"label",r++)}function g8(t,e,r,n,a){var i,s,o,l,u=tS(t),c=u.pan,d=u.zoom;{var f=qW(t,c,d,e,r),v=Ht(f,2),p=v[0],y=v[1],m=6;i=p-m/2,s=y-m/2,o=m,l=m}if(o===0||l===0)return[];var g=t.data.contexts[t.WEBGL];g.bindFramebuffer(g.FRAMEBUFFER,t.pickingFrameBuffer),t.pickingFrameBuffer.needsDraw&&(g.viewport(0,0,g.canvas.width,g.canvas.height),FI(t,null,Fl.PICKING),t.pickingFrameBuffer.needsDraw=!1);var x=o*l,b=new Uint8Array(x*4);g.readPixels(i,s,o,l,g.RGBA,g.UNSIGNED_BYTE,b),g.bindFramebuffer(g.FRAMEBUFFER,null);for(var w=new Set,E=0;E<x;E++){var C=b.slice(E*4,E*4+4),S=VW(C)-1;S>=0&&w.add(S)}return w}function m8(t,e,r){var n=g8(t,e,r),a=t.getCachedZSortedEles(),i,s,o=Xr(n),l;try{for(o.s();!(l=o.n()).done;){var u=l.value,c=a[u];if(!i&&c.isNode()&&(i=c),!s&&c.isEdge()&&(s=c),i&&s)break}}catch(d){o.e(d)}finally{o.f()}return[i,s].filter(Boolean)}function Wp(t,e,r){var n=t.drawing;e+=1,r.isNode()?(n.drawNode(r,e,"node-underlay"),n.drawNode(r,e,"node-body"),n.drawTexture(r,e,"label"),n.drawNode(r,e,"node-overlay")):(n.drawEdgeLine(r,e),n.drawEdgeArrow(r,e,"source"),n.drawEdgeArrow(r,e,"target"),n.drawTexture(r,e,"label"),n.drawTexture(r,e,"edge-source-label"),n.drawTexture(r,e,"edge-target-label"))}function FI(t,e,r){var n;t.webglDebug&&(n=performance.now());var a=t.drawing,i=0;if(r.screen&&t.data.canvasNeedsRedraw[t.SELECT_BOX]&&h8(t,e),t.data.canvasNeedsRedraw[t.NODE]||r.picking){var s=t.data.contexts[t.WEBGL];r.screen?(s.clearColor(0,0,0,0),s.enable(s.BLEND),s.blendFunc(s.ONE,s.ONE_MINUS_SRC_ALPHA)):s.disable(s.BLEND),s.clear(s.COLOR_BUFFER_BIT|s.DEPTH_BUFFER_BIT),s.viewport(0,0,s.canvas.width,s.canvas.height);var o=f8(t),l=t.getCachedZSortedEles();if(i=l.length,a.startFrame(o,r),r.screen){for(var u=0;u<l.nondrag.length;u++)Wp(t,u,l.nondrag[u]);for(var c=0;c<l.drag.length;c++)Wp(t,c,l.drag[c])}else if(r.picking)for(var d=0;d<l.length;d++)Wp(t,d,l[d]);a.endFrame(),r.screen&&t.webglDebugShowAtlases&&(v8(t),p8(t)),t.data.canvasNeedsRedraw[t.NODE]=!1,t.data.canvasNeedsRedraw[t.DRAG]=!1}if(t.webglDebug){var f=performance.now(),v=!1,p=Math.ceil(f-n),y=a.getDebugInfo(),m=["".concat(i," elements"),"".concat(y.totalInstances," instances"),"".concat(y.batchCount," batches"),"".concat(y.totalAtlases," atlases"),"".concat(y.wrappedCount," wrapped textures"),"".concat(y.simpleCount," simple shapes")].join(", ");if(v)console.log("WebGL (".concat(r.name,") - time ").concat(p,"ms, ").concat(m));else{console.log("WebGL (".concat(r.name,") - frame time ").concat(p,"ms")),console.log("Totals:"),console.log(" ".concat(m)),console.log("Texture Atlases Used:");var g=y.atlasInfo,x=Xr(g),b;try{for(x.s();!(b=x.n()).done;){var w=b.value;console.log(" ".concat(w.type,": ").concat(w.keyCount," keys, ").concat(w.atlasCount," atlases"))}}catch(E){x.e(E)}finally{x.f()}console.log("")}}t.data.gc&&(console.log("Garbage Collect!"),t.data.gc=!1,a.gc())}var ji={};ji.drawPolygonPath=function(t,e,r,n,a,i){var s=n/2,o=a/2;t.beginPath&&t.beginPath(),t.moveTo(e+s*i[0],r+o*i[1]);for(var l=1;l<i.length/2;l++)t.lineTo(e+s*i[l*2],r+o*i[l*2+1]);t.closePath()};ji.drawRoundPolygonPath=function(t,e,r,n,a,i,s){s.forEach(function(o){return xI(t,o)}),t.closePath()};ji.drawRoundRectanglePath=function(t,e,r,n,a,i){var s=n/2,o=a/2,l=i==="auto"?Ei(n,a):Math.min(i,o,s);t.beginPath&&t.beginPath(),t.moveTo(e,r-o),t.arcTo(e+s,r-o,e+s,r,l),t.arcTo(e+s,r+o,e,r+o,l),t.arcTo(e-s,r+o,e-s,r,l),t.arcTo(e-s,r-o,e,r-o,l),t.lineTo(e,r-o),t.closePath()};ji.drawBottomRoundRectanglePath=function(t,e,r,n,a,i){var s=n/2,o=a/2,l=i==="auto"?Ei(n,a):i;t.beginPath&&t.beginPath(),t.moveTo(e,r-o),t.lineTo(e+s,r-o),t.lineTo(e+s,r),t.arcTo(e+s,r+o,e,r+o,l),t.arcTo(e-s,r+o,e-s,r,l),t.lineTo(e-s,r-o),t.lineTo(e,r-o),t.closePath()};ji.drawCutRectanglePath=function(t,e,r,n,a,i,s){var o=n/2,l=a/2,u=s==="auto"?qE():s;t.beginPath&&t.beginPath(),t.moveTo(e-o+u,r-l),t.lineTo(e+o-u,r-l),t.lineTo(e+o,r-l+u),t.lineTo(e+o,r+l-u),t.lineTo(e+o-u,r+l),t.lineTo(e-o+u,r+l),t.lineTo(e-o,r+l-u),t.lineTo(e-o,r-l+u),t.closePath()};ji.drawBarrelPath=function(t,e,r,n,a){var i=n/2,s=a/2,o=e-i,l=e+i,u=r-s,c=r+s,d=z1(n,a),f=d.widthOffset,v=d.heightOffset,p=d.ctrlPtOffsetPct*f;t.beginPath&&t.beginPath(),t.moveTo(o,u+v),t.lineTo(o,c-v),t.quadraticCurveTo(o+p,c,o+f,c),t.lineTo(l-f,c),t.quadraticCurveTo(l-p,c,l,c-v),t.lineTo(l,u+v),t.quadraticCurveTo(l-p,u,l-f,u),t.lineTo(o+f,u),t.quadraticCurveTo(o+p,u,o,u+v),t.closePath()};var YR=Math.sin(0),XR=Math.cos(0),tw={},rw={},BI=Math.PI/40;for(var js=0*Math.PI;js<2*Math.PI;js+=BI)tw[js]=Math.sin(js),rw[js]=Math.cos(js);ji.drawEllipsePath=function(t,e,r,n,a){if(t.beginPath&&t.beginPath(),t.ellipse)t.ellipse(e,r,n/2,a/2,0,0,2*Math.PI);else for(var i,s,o=n/2,l=a/2,u=0*Math.PI;u<2*Math.PI;u+=BI)i=e-o*tw[u]*YR+o*rw[u]*XR,s=r+l*rw[u]*YR+l*tw[u]*XR,u===0?t.moveTo(i,s):t.lineTo(i,s);t.closePath()};var Wu={};Wu.createBuffer=function(t,e){var r=document.createElement("canvas");return r.width=t,r.height=e,[r,r.getContext("2d")]};Wu.bufferCanvasImage=function(t){var e=this.cy,r=e.mutableElements(),n=r.boundingBox(),a=this.findContainerClientCoords(),i=t.full?Math.ceil(n.w):a[2],s=t.full?Math.ceil(n.h):a[3],o=_e(t.maxWidth)||_e(t.maxHeight),l=this.getPixelRatio(),u=1;if(t.scale!==void 0)i*=t.scale,s*=t.scale,u=t.scale;else if(o){var c=1/0,d=1/0;_e(t.maxWidth)&&(c=u*t.maxWidth/i),_e(t.maxHeight)&&(d=u*t.maxHeight/s),u=Math.min(c,d),i*=u,s*=u}o||(i*=l,s*=l,u*=l);var f=document.createElement("canvas");f.width=i,f.height=s,f.style.width=i+"px",f.style.height=s+"px";var v=f.getContext("2d");if(i>0&&s>0){v.clearRect(0,0,i,s),v.globalCompositeOperation="source-over";var p=this.getCachedZSortedEles();if(t.full)v.translate(-n.x1*u,-n.y1*u),v.scale(u,u),this.drawElements(v,p),v.scale(1/u,1/u),v.translate(n.x1*u,n.y1*u);else{var y=e.pan(),m={x:y.x*u,y:y.y*u};u*=e.zoom(),v.translate(m.x,m.y),v.scale(u,u),this.drawElements(v,p),v.scale(1/u,1/u),v.translate(-m.x,-m.y)}t.bg&&(v.globalCompositeOperation="destination-over",v.fillStyle=t.bg,v.rect(0,0,i,s),v.fill())}return f};function y8(t,e){for(var r=atob(t),n=new ArrayBuffer(r.length),a=new Uint8Array(n),i=0;i<r.length;i++)a[i]=r.charCodeAt(i);return new Blob([n],{type:e})}function KR(t){var e=t.indexOf(",");return t.substr(e+1)}function zI(t,e,r){var n=function(){return e.toDataURL(r,t.quality)};switch(t.output){case"blob-promise":return new jo(function(a,i){try{e.toBlob(function(s){s!=null?a(s):i(new Error("`canvas.toBlob()` sent a null value in its callback"))},r,t.quality)}catch(s){i(s)}});case"blob":return y8(KR(n()),r);case"base64":return KR(n());case"base64uri":default:return n()}}Wu.png=function(t){return zI(t,this.bufferCanvasImage(t),"image/png")};Wu.jpg=function(t){return zI(t,this.bufferCanvasImage(t),"image/jpeg")};var qI={};qI.nodeShapeImpl=function(t,e,r,n,a,i,s,o){switch(t){case"ellipse":return this.drawEllipsePath(e,r,n,a,i);case"polygon":return this.drawPolygonPath(e,r,n,a,i,s);case"round-polygon":return this.drawRoundPolygonPath(e,r,n,a,i,s,o);case"roundrectangle":case"round-rectangle":return this.drawRoundRectanglePath(e,r,n,a,i,o);case"cutrectangle":case"cut-rectangle":return this.drawCutRectanglePath(e,r,n,a,i,s,o);case"bottomroundrectangle":case"bottom-round-rectangle":return this.drawBottomRoundRectanglePath(e,r,n,a,i,o);case"barrel":return this.drawBarrelPath(e,r,n,a,i)}};var x8=UI,Ke=UI.prototype;Ke.CANVAS_LAYERS=3;Ke.SELECT_BOX=0;Ke.DRAG=1;Ke.NODE=2;Ke.WEBGL=3;Ke.CANVAS_TYPES=["2d","2d","2d","webgl2"];Ke.BUFFER_COUNT=3;Ke.TEXTURE_BUFFER=0;Ke.MOTIONBLUR_BUFFER_NODE=1;Ke.MOTIONBLUR_BUFFER_DRAG=2;function UI(t){var e=this,r=e.cy.window(),n=r.document;t.webgl&&(Ke.CANVAS_LAYERS=e.CANVAS_LAYERS=4,console.log("webgl rendering enabled")),e.data={canvases:new Array(Ke.CANVAS_LAYERS),contexts:new Array(Ke.CANVAS_LAYERS),canvasNeedsRedraw:new Array(Ke.CANVAS_LAYERS),bufferCanvases:new Array(Ke.BUFFER_COUNT),bufferContexts:new Array(Ke.CANVAS_LAYERS)};var a="-webkit-tap-highlight-color",i="rgba(0,0,0,0)";e.data.canvasContainer=n.createElement("div");var s=e.data.canvasContainer.style;e.data.canvasContainer.style[a]=i,s.position="relative",s.zIndex="0",s.overflow="hidden";var o=t.cy.container();o.appendChild(e.data.canvasContainer),o.style[a]=i;var l={"-webkit-user-select":"none","-moz-user-select":"-moz-none","user-select":"none","-webkit-tap-highlight-color":"rgba(0,0,0,0)","outline-style":"none"};h$()&&(l["-ms-touch-action"]="none",l["touch-action"]="none");for(var u=0;u<Ke.CANVAS_LAYERS;u++){var c=e.data.canvases[u]=n.createElement("canvas"),d=Ke.CANVAS_TYPES[u];e.data.contexts[u]=c.getContext(d),e.data.contexts[u]||Tt("Could not create canvas of type "+d),Object.keys(l).forEach(function(Y){c.style[Y]=l[Y]}),c.style.position="absolute",c.setAttribute("data-id","layer"+u),c.style.zIndex=String(Ke.CANVAS_LAYERS-u),e.data.canvasContainer.appendChild(c),e.data.canvasNeedsRedraw[u]=!1}e.data.topCanvas=e.data.canvases[0],e.data.canvases[Ke.NODE].setAttribute("data-id","layer"+Ke.NODE+"-node"),e.data.canvases[Ke.SELECT_BOX].setAttribute("data-id","layer"+Ke.SELECT_BOX+"-selectbox"),e.data.canvases[Ke.DRAG].setAttribute("data-id","layer"+Ke.DRAG+"-drag"),e.data.canvases[Ke.WEBGL]&&e.data.canvases[Ke.WEBGL].setAttribute("data-id","layer"+Ke.WEBGL+"-webgl");for(var u=0;u<Ke.BUFFER_COUNT;u++)e.data.bufferCanvases[u]=n.createElement("canvas"),e.data.bufferContexts[u]=e.data.bufferCanvases[u].getContext("2d"),e.data.bufferCanvases[u].style.position="absolute",e.data.bufferCanvases[u].setAttribute("data-id","buffer"+u),e.data.bufferCanvases[u].style.zIndex=String(-u-1),e.data.bufferCanvases[u].style.visibility="hidden";e.pathsEnabled=!0;var f=Ir(),v=function(H){return{x:(H.x1+H.x2)/2,y:(H.y1+H.y2)/2}},p=function(H){return{x:-H.w/2,y:-H.h/2}},y=function(H){var X=H[0]._private,ee=X.oldBackgroundTimestamp===X.backgroundTimestamp;return!ee},m=function(H){return H[0]._private.nodeKey},g=function(H){return H[0]._private.labelStyleKey},x=function(H){return H[0]._private.sourceLabelStyleKey},b=function(H){return H[0]._private.targetLabelStyleKey},w=function(H,X,ee,ie,oe){return e.drawElement(H,X,ee,!1,!1,oe)},E=function(H,X,ee,ie,oe){return e.drawElementText(H,X,ee,ie,"main",oe)},C=function(H,X,ee,ie,oe){return e.drawElementText(H,X,ee,ie,"source",oe)},S=function(H,X,ee,ie,oe){return e.drawElementText(H,X,ee,ie,"target",oe)},T=function(H){return H.boundingBox(),H[0]._private.bodyBounds},P=function(H){return H.boundingBox(),H[0]._private.labelBounds.main||f},A=function(H){return H.boundingBox(),H[0]._private.labelBounds.source||f},j=function(H){return H.boundingBox(),H[0]._private.labelBounds.target||f},R=function(H,X){return X},O=function(H){return v(T(H))},N=function(H,X,ee){var ie=H?H+"-":"";return{x:X.x+ee.pstyle(ie+"text-margin-x").pfValue,y:X.y+ee.pstyle(ie+"text-margin-y").pfValue}},D=function(H,X,ee){var ie=H[0]._private.rscratch;return{x:ie[X],y:ie[ee]}},L=function(H){return N("",D(H,"labelX","labelY"),H)},_=function(H){return N("source",D(H,"sourceLabelX","sourceLabelY"),H)},k=function(H){return N("target",D(H,"targetLabelX","targetLabelY"),H)},I=function(H){return p(T(H))},F=function(H){return p(A(H))},B=function(H){return p(j(H))},$=function(H){var X=P(H),ee=p(P(H));if(H.isNode()){switch(H.pstyle("text-halign").value){case"left":ee.x=-X.w-(X.leftPad||0);break;case"right":ee.x=-(X.rightPad||0);break}switch(H.pstyle("text-valign").value){case"top":ee.y=-X.h-(X.topPad||0);break;case"bottom":ee.y=-(X.botPad||0);break}}return ee},W=e.data.eleTxrCache=new El(e,{getKey:m,doesEleInvalidateKey:y,drawElement:w,getBoundingBox:T,getRotationPoint:O,getRotationOffset:I,allowEdgeTxrCaching:!1,allowParentTxrCaching:!1}),z=e.data.lblTxrCache=new El(e,{getKey:g,drawElement:E,getBoundingBox:P,getRotationPoint:L,getRotationOffset:$,isVisible:R}),q=e.data.slbTxrCache=new El(e,{getKey:x,drawElement:C,getBoundingBox:A,getRotationPoint:_,getRotationOffset:F,isVisible:R}),G=e.data.tlbTxrCache=new El(e,{getKey:b,drawElement:S,getBoundingBox:j,getRotationPoint:k,getRotationOffset:B,isVisible:R}),J=e.data.lyrTxrCache=new AI(e);e.onUpdateEleCalcs(function(H,X){W.invalidateElements(X),z.invalidateElements(X),q.invalidateElements(X),G.invalidateElements(X),J.invalidateElements(X);for(var ee=0;ee<X.length;ee++){var ie=X[ee]._private;ie.oldBackgroundTimestamp=ie.backgroundTimestamp}});var ae=function(H){for(var X=0;X<H.length;X++)J.enqueueElementRefinement(H[X].ele)};W.onDequeue(ae),z.onDequeue(ae),q.onDequeue(ae),G.onDequeue(ae),t.webgl&&e.initWebgl(t,{getStyleKey:m,getLabelKey:g,getSourceLabelKey:x,getTargetLabelKey:b,drawElement:w,drawLabel:E,drawSourceLabel:C,drawTargetLabel:S,getElementBox:T,getLabelBox:P,getSourceLabelBox:A,getTargetLabelBox:j,getElementRotationPoint:O,getElementRotationOffset:I,getLabelRotationPoint:L,getSourceLabelRotationPoint:_,getTargetLabelRotationPoint:k,getLabelRotationOffset:$,getSourceLabelRotationOffset:F,getTargetLabelRotationOffset:B})}Ke.redrawHint=function(t,e){var r=this;switch(t){case"eles":r.data.canvasNeedsRedraw[Ke.NODE]=e;break;case"drag":r.data.canvasNeedsRedraw[Ke.DRAG]=e;break;case"select":r.data.canvasNeedsRedraw[Ke.SELECT_BOX]=e;break;case"gc":r.data.gc=!0;break}};var b8=typeof Path2D<"u";Ke.path2dEnabled=function(t){if(t===void 0)return this.pathsEnabled;this.pathsEnabled=!!t};Ke.usePaths=function(){return b8&&this.pathsEnabled};Ke.setImgSmoothing=function(t,e){t.imageSmoothingEnabled!=null?t.imageSmoothingEnabled=e:(t.webkitImageSmoothingEnabled=e,t.mozImageSmoothingEnabled=e,t.msImageSmoothingEnabled=e)};Ke.getImgSmoothing=function(t){return t.imageSmoothingEnabled!=null?t.imageSmoothingEnabled:t.webkitImageSmoothingEnabled||t.mozImageSmoothingEnabled||t.msImageSmoothingEnabled};Ke.makeOffscreenCanvas=function(t,e){var r;if((typeof OffscreenCanvas>"u"?"undefined":rr(OffscreenCanvas))!=="undefined")r=new OffscreenCanvas(t,e);else{var n=this.cy.window(),a=n.document;r=a.createElement("canvas"),r.width=t,r.height=e}return r};[kI,fa,Ba,eS,ws,_i,Ur,OI,ji,Wu,qI].forEach(function(t){We(Ke,t)});var w8=[{name:"null",impl:gI},{name:"base",impl:TI},{name:"canvas",impl:x8}],E8=[{type:"layout",extensions:W6},{type:"renderer",extensions:w8}],$I={},VI={};function GI(t,e,r){var n=r,a=function(T){ht("Can not register `"+e+"` for `"+t+"` since `"+T+"` already exists in the prototype and can not be overridden")};if(t==="core"){if(mu.prototype[e])return a(e);mu.prototype[e]=r}else if(t==="collection"){if(pr.prototype[e])return a(e);pr.prototype[e]=r}else if(t==="layout"){for(var i=function(T){this.options=T,r.call(this,T),st(this._private)||(this._private={}),this._private.cy=T.cy,this._private.listeners=[],this.createEmitter()},s=i.prototype=Object.create(r.prototype),o=[],l=0;l<o.length;l++){var u=o[l];s[u]=s[u]||function(){return this}}s.start&&!s.run?s.run=function(){return this.start(),this}:!s.start&&s.run&&(s.start=function(){return this.run(),this});var c=r.prototype.stop;s.stop=function(){var S=this.options;if(S&&S.animate){var T=this.animations;if(T)for(var P=0;P<T.length;P++)T[P].stop()}return c?c.call(this):this.emit("layoutstop"),this},s.destroy||(s.destroy=function(){return this}),s.cy=function(){return this._private.cy};var d=function(T){return T._private.cy},f={addEventFields:function(T,P){P.layout=T,P.cy=d(T),P.target=T},bubble:function(){return!0},parent:function(T){return d(T)}};We(s,{createEmitter:function(){return this._private.emitter=new rh(f,this),this},emitter:function(){return this._private.emitter},on:function(T,P){return this.emitter().on(T,P),this},one:function(T,P){return this.emitter().one(T,P),this},once:function(T,P){return this.emitter().one(T,P),this},removeListener:function(T,P){return this.emitter().removeListener(T,P),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},emit:function(T,P){return this.emitter().emit(T,P),this}}),ft.eventAliasesOn(s),n=i}else if(t==="renderer"&&e!=="null"&&e!=="base"){var v=HI("renderer","base"),p=v.prototype,y=r,m=r.prototype,g=function(){v.apply(this,arguments),y.apply(this,arguments)},x=g.prototype;for(var b in p){var w=p[b],E=m[b]!=null;if(E)return a(b);x[b]=w}for(var C in m)x[C]=m[C];p.clientFunctions.forEach(function(S){x[S]=x[S]||function(){Tt("Renderer does not implement `renderer."+S+"()` on its prototype")}}),n=g}else if(t==="__proto__"||t==="constructor"||t==="prototype")return Tt(t+" is an illegal type to be registered, possibly lead to prototype pollutions");return cM({map:$I,keys:[t,e],value:n})}function HI(t,e){return dM({map:$I,keys:[t,e]})}function S8(t,e,r,n,a){return cM({map:VI,keys:[t,e,r,n],value:a})}function C8(t,e,r,n){return dM({map:VI,keys:[t,e,r,n]})}var nw=function(){if(arguments.length===2)return HI.apply(null,arguments);if(arguments.length===3)return GI.apply(null,arguments);if(arguments.length===4)return C8.apply(null,arguments);if(arguments.length===5)return S8.apply(null,arguments);Tt("Invalid extension access syntax")};mu.prototype.extension=nw;E8.forEach(function(t){t.extensions.forEach(function(e){GI(t.type,e.name,e.impl)})});var lf=function(){if(!(this instanceof lf))return new lf;this.length=0},vs=lf.prototype;vs.instanceString=function(){return"stylesheet"};vs.selector=function(t){var e=this.length++;return this[e]={selector:t,properties:[]},this};vs.css=function(t,e){var r=this.length-1;if(Ve(t))this[r].properties.push({name:t,value:e});else if(st(t))for(var n=t,a=Object.keys(n),i=0;i<a.length;i++){var s=a[i],o=n[s];if(o!=null){var l=lr.properties[s]||lr.properties[Hf(s)];if(l!=null){var u=l.name,c=o;this[r].properties.push({name:u,value:c})}}}return this};vs.style=vs.css;vs.generateStyle=function(t){var e=new lr(t);return this.appendToStyle(e)};vs.appendToStyle=function(t){for(var e=0;e<this.length;e++){var r=this[e],n=r.selector,a=r.properties;t.selector(n);for(var i=0;i<a.length;i++){var s=a[i];t.css(s.name,s.value)}}return t};var N8="3.33.1",ja=function(e){if(e===void 0&&(e={}),st(e))return new mu(e);if(Ve(e))return nw.apply(nw,arguments)};ja.use=function(t){var e=Array.prototype.slice.call(arguments,1);return e.unshift(ja),t.apply(null,e),this};ja.warnings=function(t){return yM(t)};ja.version=N8;ja.stylesheet=ja.Stylesheet=lf;var WI={exports:{}};function rS(t){throw new Error('Could not dynamically require "'+t+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Yp,QR;function T8(){if(QR)return Yp;QR=1;function t(){this.__data__=[],this.size=0}return Yp=t,Yp}var Xp,ZR;function Bo(){if(ZR)return Xp;ZR=1;function t(e,r){return e===r||e!==e&&r!==r}return Xp=t,Xp}var Kp,JR;function ch(){if(JR)return Kp;JR=1;var t=Bo();function e(r,n){for(var a=r.length;a--;)if(t(r[a][0],n))return a;return-1}return Kp=e,Kp}var Qp,e2;function R8(){if(e2)return Qp;e2=1;var t=ch(),e=Array.prototype,r=e.splice;function n(a){var i=this.__data__,s=t(i,a);if(s<0)return!1;var o=i.length-1;return s==o?i.pop():r.call(i,s,1),--this.size,!0}return Qp=n,Qp}var Zp,t2;function P8(){if(t2)return Zp;t2=1;var t=ch();function e(r){var n=this.__data__,a=t(n,r);return a<0?void 0:n[a][1]}return Zp=e,Zp}var Jp,r2;function A8(){if(r2)return Jp;r2=1;var t=ch();function e(r){return t(this.__data__,r)>-1}return Jp=e,Jp}var eg,n2;function k8(){if(n2)return eg;n2=1;var t=ch();function e(r,n){var a=this.__data__,i=t(a,r);return i<0?(++this.size,a.push([r,n])):a[i][1]=n,this}return eg=e,eg}var tg,a2;function dh(){if(a2)return tg;a2=1;var t=T8(),e=R8(),r=P8(),n=A8(),a=k8();function i(s){var o=-1,l=s==null?0:s.length;for(this.clear();++o<l;){var u=s[o];this.set(u[0],u[1])}}return i.prototype.clear=t,i.prototype.delete=e,i.prototype.get=r,i.prototype.has=n,i.prototype.set=a,tg=i,tg}var rg,i2;function L8(){if(i2)return rg;i2=1;var t=dh();function e(){this.__data__=new t,this.size=0}return rg=e,rg}var ng,s2;function D8(){if(s2)return ng;s2=1;function t(e){var r=this.__data__,n=r.delete(e);return this.size=r.size,n}return ng=t,ng}var ag,o2;function _8(){if(o2)return ag;o2=1;function t(e){return this.__data__.get(e)}return ag=t,ag}var ig,l2;function j8(){if(l2)return ig;l2=1;function t(e){return this.__data__.has(e)}return ig=t,ig}var sg,u2;function YI(){if(u2)return sg;u2=1;var t=typeof Ja=="object"&&Ja&&Ja.Object===Object&&Ja;return sg=t,sg}var og,c2;function Qn(){if(c2)return og;c2=1;var t=YI(),e=typeof self=="object"&&self&&self.Object===Object&&self,r=t||e||Function("return this")();return og=r,og}var lg,d2;function zo(){if(d2)return lg;d2=1;var t=Qn(),e=t.Symbol;return lg=e,lg}var ug,f2;function O8(){if(f2)return ug;f2=1;var t=zo(),e=Object.prototype,r=e.hasOwnProperty,n=e.toString,a=t?t.toStringTag:void 0;function i(s){var o=r.call(s,a),l=s[a];try{s[a]=void 0;var u=!0}catch{}var c=n.call(s);return u&&(o?s[a]=l:delete s[a]),c}return ug=i,ug}var cg,h2;function M8(){if(h2)return cg;h2=1;var t=Object.prototype,e=t.toString;function r(n){return e.call(n)}return cg=r,cg}var dg,v2;function Es(){if(v2)return dg;v2=1;var t=zo(),e=O8(),r=M8(),n="[object Null]",a="[object Undefined]",i=t?t.toStringTag:void 0;function s(o){return o==null?o===void 0?a:n:i&&i in Object(o)?e(o):r(o)}return dg=s,dg}var fg,p2;function Rn(){if(p2)return fg;p2=1;function t(e){var r=typeof e;return e!=null&&(r=="object"||r=="function")}return fg=t,fg}var hg,g2;function Yu(){if(g2)return hg;g2=1;var t=Es(),e=Rn(),r="[object AsyncFunction]",n="[object Function]",a="[object GeneratorFunction]",i="[object Proxy]";function s(o){if(!e(o))return!1;var l=t(o);return l==n||l==a||l==r||l==i}return hg=s,hg}var vg,m2;function I8(){if(m2)return vg;m2=1;var t=Qn(),e=t["__core-js_shared__"];return vg=e,vg}var pg,y2;function F8(){if(y2)return pg;y2=1;var t=I8(),e=function(){var n=/[^.]+$/.exec(t&&t.keys&&t.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""}();function r(n){return!!e&&e in n}return pg=r,pg}var gg,x2;function XI(){if(x2)return gg;x2=1;var t=Function.prototype,e=t.toString;function r(n){if(n!=null){try{return e.call(n)}catch{}try{return n+""}catch{}}return""}return gg=r,gg}var mg,b2;function B8(){if(b2)return mg;b2=1;var t=Yu(),e=F8(),r=Rn(),n=XI(),a=/[\\^$.*+?()[\]{}|]/g,i=/^\[object .+?Constructor\]$/,s=Function.prototype,o=Object.prototype,l=s.toString,u=o.hasOwnProperty,c=RegExp("^"+l.call(u).replace(a,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function d(f){if(!r(f)||e(f))return!1;var v=t(f)?c:i;return v.test(n(f))}return mg=d,mg}var yg,w2;function z8(){if(w2)return yg;w2=1;function t(e,r){return e==null?void 0:e[r]}return yg=t,yg}var xg,E2;function Ss(){if(E2)return xg;E2=1;var t=B8(),e=z8();function r(n,a){var i=e(n,a);return t(i)?i:void 0}return xg=r,xg}var bg,S2;function nS(){if(S2)return bg;S2=1;var t=Ss(),e=Qn(),r=t(e,"Map");return bg=r,bg}var wg,C2;function fh(){if(C2)return wg;C2=1;var t=Ss(),e=t(Object,"create");return wg=e,wg}var Eg,N2;function q8(){if(N2)return Eg;N2=1;var t=fh();function e(){this.__data__=t?t(null):{},this.size=0}return Eg=e,Eg}var Sg,T2;function U8(){if(T2)return Sg;T2=1;function t(e){var r=this.has(e)&&delete this.__data__[e];return this.size-=r?1:0,r}return Sg=t,Sg}var Cg,R2;function $8(){if(R2)return Cg;R2=1;var t=fh(),e="__lodash_hash_undefined__",r=Object.prototype,n=r.hasOwnProperty;function a(i){var s=this.__data__;if(t){var o=s[i];return o===e?void 0:o}return n.call(s,i)?s[i]:void 0}return Cg=a,Cg}var Ng,P2;function V8(){if(P2)return Ng;P2=1;var t=fh(),e=Object.prototype,r=e.hasOwnProperty;function n(a){var i=this.__data__;return t?i[a]!==void 0:r.call(i,a)}return Ng=n,Ng}var Tg,A2;function G8(){if(A2)return Tg;A2=1;var t=fh(),e="__lodash_hash_undefined__";function r(n,a){var i=this.__data__;return this.size+=this.has(n)?0:1,i[n]=t&&a===void 0?e:a,this}return Tg=r,Tg}var Rg,k2;function H8(){if(k2)return Rg;k2=1;var t=q8(),e=U8(),r=$8(),n=V8(),a=G8();function i(s){var o=-1,l=s==null?0:s.length;for(this.clear();++o<l;){var u=s[o];this.set(u[0],u[1])}}return i.prototype.clear=t,i.prototype.delete=e,i.prototype.get=r,i.prototype.has=n,i.prototype.set=a,Rg=i,Rg}var Pg,L2;function W8(){if(L2)return Pg;L2=1;var t=H8(),e=dh(),r=nS();function n(){this.size=0,this.__data__={hash:new t,map:new(r||e),string:new t}}return Pg=n,Pg}var Ag,D2;function Y8(){if(D2)return Ag;D2=1;function t(e){var r=typeof e;return r=="string"||r=="number"||r=="symbol"||r=="boolean"?e!=="__proto__":e===null}return Ag=t,Ag}var kg,_2;function hh(){if(_2)return kg;_2=1;var t=Y8();function e(r,n){var a=r.__data__;return t(n)?a[typeof n=="string"?"string":"hash"]:a.map}return kg=e,kg}var Lg,j2;function X8(){if(j2)return Lg;j2=1;var t=hh();function e(r){var n=t(this,r).delete(r);return this.size-=n?1:0,n}return Lg=e,Lg}var Dg,O2;function K8(){if(O2)return Dg;O2=1;var t=hh();function e(r){return t(this,r).get(r)}return Dg=e,Dg}var _g,M2;function Q8(){if(M2)return _g;M2=1;var t=hh();function e(r){return t(this,r).has(r)}return _g=e,_g}var jg,I2;function Z8(){if(I2)return jg;I2=1;var t=hh();function e(r,n){var a=t(this,r),i=a.size;return a.set(r,n),this.size+=a.size==i?0:1,this}return jg=e,jg}var Og,F2;function aS(){if(F2)return Og;F2=1;var t=W8(),e=X8(),r=K8(),n=Q8(),a=Z8();function i(s){var o=-1,l=s==null?0:s.length;for(this.clear();++o<l;){var u=s[o];this.set(u[0],u[1])}}return i.prototype.clear=t,i.prototype.delete=e,i.prototype.get=r,i.prototype.has=n,i.prototype.set=a,Og=i,Og}var Mg,B2;function J8(){if(B2)return Mg;B2=1;var t=dh(),e=nS(),r=aS(),n=200;function a(i,s){var o=this.__data__;if(o instanceof t){var l=o.__data__;if(!e||l.length<n-1)return l.push([i,s]),this.size=++o.size,this;o=this.__data__=new r(l)}return o.set(i,s),this.size=o.size,this}return Mg=a,Mg}var Ig,z2;function vh(){if(z2)return Ig;z2=1;var t=dh(),e=L8(),r=D8(),n=_8(),a=j8(),i=J8();function s(o){var l=this.__data__=new t(o);this.size=l.size}return s.prototype.clear=e,s.prototype.delete=r,s.prototype.get=n,s.prototype.has=a,s.prototype.set=i,Ig=s,Ig}var Fg,q2;function iS(){if(q2)return Fg;q2=1;function t(e,r){for(var n=-1,a=e==null?0:e.length;++n<a&&r(e[n],n,e)!==!1;);return e}return Fg=t,Fg}var Bg,U2;function KI(){if(U2)return Bg;U2=1;var t=Ss(),e=function(){try{var r=t(Object,"defineProperty");return r({},"",{}),r}catch{}}();return Bg=e,Bg}var zg,$2;function ph(){if($2)return zg;$2=1;var t=KI();function e(r,n,a){n=="__proto__"&&t?t(r,n,{configurable:!0,enumerable:!0,value:a,writable:!0}):r[n]=a}return zg=e,zg}var qg,V2;function gh(){if(V2)return qg;V2=1;var t=ph(),e=Bo(),r=Object.prototype,n=r.hasOwnProperty;function a(i,s,o){var l=i[s];(!(n.call(i,s)&&e(l,o))||o===void 0&&!(s in i))&&t(i,s,o)}return qg=a,qg}var Ug,G2;function Xu(){if(G2)return Ug;G2=1;var t=gh(),e=ph();function r(n,a,i,s){var o=!i;i||(i={});for(var l=-1,u=a.length;++l<u;){var c=a[l],d=s?s(i[c],n[c],c,i,n):void 0;d===void 0&&(d=n[c]),o?e(i,c,d):t(i,c,d)}return i}return Ug=r,Ug}var $g,H2;function e9(){if(H2)return $g;H2=1;function t(e,r){for(var n=-1,a=Array(e);++n<e;)a[n]=r(n);return a}return $g=t,$g}var Vg,W2;function ha(){if(W2)return Vg;W2=1;function t(e){return e!=null&&typeof e=="object"}return Vg=t,Vg}var Gg,Y2;function t9(){if(Y2)return Gg;Y2=1;var t=Es(),e=ha(),r="[object Arguments]";function n(a){return e(a)&&t(a)==r}return Gg=n,Gg}var Hg,X2;function Ku(){if(X2)return Hg;X2=1;var t=t9(),e=ha(),r=Object.prototype,n=r.hasOwnProperty,a=r.propertyIsEnumerable,i=t(function(){return arguments}())?t:function(s){return e(s)&&n.call(s,"callee")&&!a.call(s,"callee")};return Hg=i,Hg}var Wg,K2;function Xt(){if(K2)return Wg;K2=1;var t=Array.isArray;return Wg=t,Wg}var Sl={exports:{}},Yg,Q2;function r9(){if(Q2)return Yg;Q2=1;function t(){return!1}return Yg=t,Yg}Sl.exports;var Z2;function qo(){return Z2||(Z2=1,function(t,e){var r=Qn(),n=r9(),a=e&&!e.nodeType&&e,i=a&&!0&&t&&!t.nodeType&&t,s=i&&i.exports===a,o=s?r.Buffer:void 0,l=o?o.isBuffer:void 0,u=l||n;t.exports=u}(Sl,Sl.exports)),Sl.exports}var Xg,J2;function mh(){if(J2)return Xg;J2=1;var t=9007199254740991,e=/^(?:0|[1-9]\d*)$/;function r(n,a){var i=typeof n;return a=a??t,!!a&&(i=="number"||i!="symbol"&&e.test(n))&&n>-1&&n%1==0&&n<a}return Xg=r,Xg}var Kg,eP;function sS(){if(eP)return Kg;eP=1;var t=9007199254740991;function e(r){return typeof r=="number"&&r>-1&&r%1==0&&r<=t}return Kg=e,Kg}var Qg,tP;function n9(){if(tP)return Qg;tP=1;var t=Es(),e=sS(),r=ha(),n="[object Arguments]",a="[object Array]",i="[object Boolean]",s="[object Date]",o="[object Error]",l="[object Function]",u="[object Map]",c="[object Number]",d="[object Object]",f="[object RegExp]",v="[object Set]",p="[object String]",y="[object WeakMap]",m="[object ArrayBuffer]",g="[object DataView]",x="[object Float32Array]",b="[object Float64Array]",w="[object Int8Array]",E="[object Int16Array]",C="[object Int32Array]",S="[object Uint8Array]",T="[object Uint8ClampedArray]",P="[object Uint16Array]",A="[object Uint32Array]",j={};j[x]=j[b]=j[w]=j[E]=j[C]=j[S]=j[T]=j[P]=j[A]=!0,j[n]=j[a]=j[m]=j[i]=j[g]=j[s]=j[o]=j[l]=j[u]=j[c]=j[d]=j[f]=j[v]=j[p]=j[y]=!1;function R(O){return r(O)&&e(O.length)&&!!j[t(O)]}return Qg=R,Qg}var Zg,rP;function yh(){if(rP)return Zg;rP=1;function t(e){return function(r){return e(r)}}return Zg=t,Zg}var Cl={exports:{}};Cl.exports;var nP;function oS(){return nP||(nP=1,function(t,e){var r=YI(),n=e&&!e.nodeType&&e,a=n&&!0&&t&&!t.nodeType&&t,i=a&&a.exports===n,s=i&&r.process,o=function(){try{var l=a&&a.require&&a.require("util").types;return l||s&&s.binding&&s.binding("util")}catch{}}();t.exports=o}(Cl,Cl.exports)),Cl.exports}var Jg,aP;function Qu(){if(aP)return Jg;aP=1;var t=n9(),e=yh(),r=oS(),n=r&&r.isTypedArray,a=n?e(n):t;return Jg=a,Jg}var em,iP;function QI(){if(iP)return em;iP=1;var t=e9(),e=Ku(),r=Xt(),n=qo(),a=mh(),i=Qu(),s=Object.prototype,o=s.hasOwnProperty;function l(u,c){var d=r(u),f=!d&&e(u),v=!d&&!f&&n(u),p=!d&&!f&&!v&&i(u),y=d||f||v||p,m=y?t(u.length,String):[],g=m.length;for(var x in u)(c||o.call(u,x))&&!(y&&(x=="length"||v&&(x=="offset"||x=="parent")||p&&(x=="buffer"||x=="byteLength"||x=="byteOffset")||a(x,g)))&&m.push(x);return m}return em=l,em}var tm,sP;function xh(){if(sP)return tm;sP=1;var t=Object.prototype;function e(r){var n=r&&r.constructor,a=typeof n=="function"&&n.prototype||t;return r===a}return tm=e,tm}var rm,oP;function ZI(){if(oP)return rm;oP=1;function t(e,r){return function(n){return e(r(n))}}return rm=t,rm}var nm,lP;function a9(){if(lP)return nm;lP=1;var t=ZI(),e=t(Object.keys,Object);return nm=e,nm}var am,uP;function lS(){if(uP)return am;uP=1;var t=xh(),e=a9(),r=Object.prototype,n=r.hasOwnProperty;function a(i){if(!t(i))return e(i);var s=[];for(var o in Object(i))n.call(i,o)&&o!="constructor"&&s.push(o);return s}return am=a,am}var im,cP;function za(){if(cP)return im;cP=1;var t=Yu(),e=sS();function r(n){return n!=null&&e(n.length)&&!t(n)}return im=r,im}var sm,dP;function Oi(){if(dP)return sm;dP=1;var t=QI(),e=lS(),r=za();function n(a){return r(a)?t(a):e(a)}return sm=n,sm}var om,fP;function i9(){if(fP)return om;fP=1;var t=Xu(),e=Oi();function r(n,a){return n&&t(a,e(a),n)}return om=r,om}var lm,hP;function s9(){if(hP)return lm;hP=1;function t(e){var r=[];if(e!=null)for(var n in Object(e))r.push(n);return r}return lm=t,lm}var um,vP;function o9(){if(vP)return um;vP=1;var t=Rn(),e=xh(),r=s9(),n=Object.prototype,a=n.hasOwnProperty;function i(s){if(!t(s))return r(s);var o=e(s),l=[];for(var u in s)u=="constructor"&&(o||!a.call(s,u))||l.push(u);return l}return um=i,um}var cm,pP;function Cs(){if(pP)return cm;pP=1;var t=QI(),e=o9(),r=za();function n(a){return r(a)?t(a,!0):e(a)}return cm=n,cm}var dm,gP;function l9(){if(gP)return dm;gP=1;var t=Xu(),e=Cs();function r(n,a){return n&&t(a,e(a),n)}return dm=r,dm}var Nl={exports:{}};Nl.exports;var mP;function JI(){return mP||(mP=1,function(t,e){var r=Qn(),n=e&&!e.nodeType&&e,a=n&&!0&&t&&!t.nodeType&&t,i=a&&a.exports===n,s=i?r.Buffer:void 0,o=s?s.allocUnsafe:void 0;function l(u,c){if(c)return u.slice();var d=u.length,f=o?o(d):new u.constructor(d);return u.copy(f),f}t.exports=l}(Nl,Nl.exports)),Nl.exports}var fm,yP;function eF(){if(yP)return fm;yP=1;function t(e,r){var n=-1,a=e.length;for(r||(r=Array(a));++n<a;)r[n]=e[n];return r}return fm=t,fm}var hm,xP;function tF(){if(xP)return hm;xP=1;function t(e,r){for(var n=-1,a=e==null?0:e.length,i=0,s=[];++n<a;){var o=e[n];r(o,n,e)&&(s[i++]=o)}return s}return hm=t,hm}var vm,bP;function rF(){if(bP)return vm;bP=1;function t(){return[]}return vm=t,vm}var pm,wP;function uS(){if(wP)return pm;wP=1;var t=tF(),e=rF(),r=Object.prototype,n=r.propertyIsEnumerable,a=Object.getOwnPropertySymbols,i=a?function(s){return s==null?[]:(s=Object(s),t(a(s),function(o){return n.call(s,o)}))}:e;return pm=i,pm}var gm,EP;function u9(){if(EP)return gm;EP=1;var t=Xu(),e=uS();function r(n,a){return t(n,e(n),a)}return gm=r,gm}var mm,SP;function cS(){if(SP)return mm;SP=1;function t(e,r){for(var n=-1,a=r.length,i=e.length;++n<a;)e[i+n]=r[n];return e}return mm=t,mm}var ym,CP;function bh(){if(CP)return ym;CP=1;var t=ZI(),e=t(Object.getPrototypeOf,Object);return ym=e,ym}var xm,NP;function nF(){if(NP)return xm;NP=1;var t=cS(),e=bh(),r=uS(),n=rF(),a=Object.getOwnPropertySymbols,i=a?function(s){for(var o=[];s;)t(o,r(s)),s=e(s);return o}:n;return xm=i,xm}var bm,TP;function c9(){if(TP)return bm;TP=1;var t=Xu(),e=nF();function r(n,a){return t(n,e(n),a)}return bm=r,bm}var wm,RP;function aF(){if(RP)return wm;RP=1;var t=cS(),e=Xt();function r(n,a,i){var s=a(n);return e(n)?s:t(s,i(n))}return wm=r,wm}var Em,PP;function iF(){if(PP)return Em;PP=1;var t=aF(),e=uS(),r=Oi();function n(a){return t(a,r,e)}return Em=n,Em}var Sm,AP;function d9(){if(AP)return Sm;AP=1;var t=aF(),e=nF(),r=Cs();function n(a){return t(a,r,e)}return Sm=n,Sm}var Cm,kP;function f9(){if(kP)return Cm;kP=1;var t=Ss(),e=Qn(),r=t(e,"DataView");return Cm=r,Cm}var Nm,LP;function h9(){if(LP)return Nm;LP=1;var t=Ss(),e=Qn(),r=t(e,"Promise");return Nm=r,Nm}var Tm,DP;function sF(){if(DP)return Tm;DP=1;var t=Ss(),e=Qn(),r=t(e,"Set");return Tm=r,Tm}var Rm,_P;function v9(){if(_P)return Rm;_P=1;var t=Ss(),e=Qn(),r=t(e,"WeakMap");return Rm=r,Rm}var Pm,jP;function Uo(){if(jP)return Pm;jP=1;var t=f9(),e=nS(),r=h9(),n=sF(),a=v9(),i=Es(),s=XI(),o="[object Map]",l="[object Object]",u="[object Promise]",c="[object Set]",d="[object WeakMap]",f="[object DataView]",v=s(t),p=s(e),y=s(r),m=s(n),g=s(a),x=i;return(t&&x(new t(new ArrayBuffer(1)))!=f||e&&x(new e)!=o||r&&x(r.resolve())!=u||n&&x(new n)!=c||a&&x(new a)!=d)&&(x=function(b){var w=i(b),E=w==l?b.constructor:void 0,C=E?s(E):"";if(C)switch(C){case v:return f;case p:return o;case y:return u;case m:return c;case g:return d}return w}),Pm=x,Pm}var Am,OP;function p9(){if(OP)return Am;OP=1;var t=Object.prototype,e=t.hasOwnProperty;function r(n){var a=n.length,i=new n.constructor(a);return a&&typeof n[0]=="string"&&e.call(n,"index")&&(i.index=n.index,i.input=n.input),i}return Am=r,Am}var km,MP;function oF(){if(MP)return km;MP=1;var t=Qn(),e=t.Uint8Array;return km=e,km}var Lm,IP;function dS(){if(IP)return Lm;IP=1;var t=oF();function e(r){var n=new r.constructor(r.byteLength);return new t(n).set(new t(r)),n}return Lm=e,Lm}var Dm,FP;function g9(){if(FP)return Dm;FP=1;var t=dS();function e(r,n){var a=n?t(r.buffer):r.buffer;return new r.constructor(a,r.byteOffset,r.byteLength)}return Dm=e,Dm}var _m,BP;function m9(){if(BP)return _m;BP=1;var t=/\w*$/;function e(r){var n=new r.constructor(r.source,t.exec(r));return n.lastIndex=r.lastIndex,n}return _m=e,_m}var jm,zP;function y9(){if(zP)return jm;zP=1;var t=zo(),e=t?t.prototype:void 0,r=e?e.valueOf:void 0;function n(a){return r?Object(r.call(a)):{}}return jm=n,jm}var Om,qP;function lF(){if(qP)return Om;qP=1;var t=dS();function e(r,n){var a=n?t(r.buffer):r.buffer;return new r.constructor(a,r.byteOffset,r.length)}return Om=e,Om}var Mm,UP;function x9(){if(UP)return Mm;UP=1;var t=dS(),e=g9(),r=m9(),n=y9(),a=lF(),i="[object Boolean]",s="[object Date]",o="[object Map]",l="[object Number]",u="[object RegExp]",c="[object Set]",d="[object String]",f="[object Symbol]",v="[object ArrayBuffer]",p="[object DataView]",y="[object Float32Array]",m="[object Float64Array]",g="[object Int8Array]",x="[object Int16Array]",b="[object Int32Array]",w="[object Uint8Array]",E="[object Uint8ClampedArray]",C="[object Uint16Array]",S="[object Uint32Array]";function T(P,A,j){var R=P.constructor;switch(A){case v:return t(P);case i:case s:return new R(+P);case p:return e(P,j);case y:case m:case g:case x:case b:case w:case E:case C:case S:return a(P,j);case o:return new R;case l:case d:return new R(P);case u:return r(P);case c:return new R;case f:return n(P)}}return Mm=T,Mm}var Im,$P;function uF(){if($P)return Im;$P=1;var t=Rn(),e=Object.create,r=function(){function n(){}return function(a){if(!t(a))return{};if(e)return e(a);n.prototype=a;var i=new n;return n.prototype=void 0,i}}();return Im=r,Im}var Fm,VP;function cF(){if(VP)return Fm;VP=1;var t=uF(),e=bh(),r=xh();function n(a){return typeof a.constructor=="function"&&!r(a)?t(e(a)):{}}return Fm=n,Fm}var Bm,GP;function b9(){if(GP)return Bm;GP=1;var t=Uo(),e=ha(),r="[object Map]";function n(a){return e(a)&&t(a)==r}return Bm=n,Bm}var zm,HP;function w9(){if(HP)return zm;HP=1;var t=b9(),e=yh(),r=oS(),n=r&&r.isMap,a=n?e(n):t;return zm=a,zm}var qm,WP;function E9(){if(WP)return qm;WP=1;var t=Uo(),e=ha(),r="[object Set]";function n(a){return e(a)&&t(a)==r}return qm=n,qm}var Um,YP;function S9(){if(YP)return Um;YP=1;var t=E9(),e=yh(),r=oS(),n=r&&r.isSet,a=n?e(n):t;return Um=a,Um}var $m,XP;function dF(){if(XP)return $m;XP=1;var t=vh(),e=iS(),r=gh(),n=i9(),a=l9(),i=JI(),s=eF(),o=u9(),l=c9(),u=iF(),c=d9(),d=Uo(),f=p9(),v=x9(),p=cF(),y=Xt(),m=qo(),g=w9(),x=Rn(),b=S9(),w=Oi(),E=Cs(),C=1,S=2,T=4,P="[object Arguments]",A="[object Array]",j="[object Boolean]",R="[object Date]",O="[object Error]",N="[object Function]",D="[object GeneratorFunction]",L="[object Map]",_="[object Number]",k="[object Object]",I="[object RegExp]",F="[object Set]",B="[object String]",$="[object Symbol]",W="[object WeakMap]",z="[object ArrayBuffer]",q="[object DataView]",G="[object Float32Array]",J="[object Float64Array]",ae="[object Int8Array]",Y="[object Int16Array]",H="[object Int32Array]",X="[object Uint8Array]",ee="[object Uint8ClampedArray]",ie="[object Uint16Array]",oe="[object Uint32Array]",me={};me[P]=me[A]=me[z]=me[q]=me[j]=me[R]=me[G]=me[J]=me[ae]=me[Y]=me[H]=me[L]=me[_]=me[k]=me[I]=me[F]=me[B]=me[$]=me[X]=me[ee]=me[ie]=me[oe]=!0,me[O]=me[N]=me[W]=!1;function De(ge,pe,we,xe,Ee,V){var K,te=pe&C,ue=pe&S,fe=pe&T;if(we&&(K=Ee?we(ge,xe,Ee,V):we(ge)),K!==void 0)return K;if(!x(ge))return ge;var ve=y(ge);if(ve){if(K=f(ge),!te)return s(ge,K)}else{var be=d(ge),Ne=be==N||be==D;if(m(ge))return i(ge,te);if(be==k||be==P||Ne&&!Ee){if(K=ue||Ne?{}:p(ge),!te)return ue?l(ge,a(K,ge)):o(ge,n(K,ge))}else{if(!me[be])return Ee?ge:{};K=v(ge,be,te)}}V||(V=new t);var Ce=V.get(ge);if(Ce)return Ce;V.set(ge,K),b(ge)?ge.forEach(function(M){K.add(De(M,pe,we,M,ge,V))}):g(ge)&&ge.forEach(function(M,Q){K.set(Q,De(M,pe,we,Q,ge,V))});var Re=fe?ue?c:u:ue?E:w,Z=ve?void 0:Re(ge);return e(Z||ge,function(M,Q){Z&&(Q=M,M=ge[Q]),r(K,Q,De(M,pe,we,Q,ge,V))}),K}return $m=De,$m}var Vm,KP;function C9(){if(KP)return Vm;KP=1;var t=dF(),e=4;function r(n){return t(n,e)}return Vm=r,Vm}var Gm,QP;function fS(){if(QP)return Gm;QP=1;function t(e){return function(){return e}}return Gm=t,Gm}var Hm,ZP;function N9(){if(ZP)return Hm;ZP=1;function t(e){return function(r,n,a){for(var i=-1,s=Object(r),o=a(r),l=o.length;l--;){var u=o[e?l:++i];if(n(s[u],u,s)===!1)break}return r}}return Hm=t,Hm}var Wm,JP;function hS(){if(JP)return Wm;JP=1;var t=N9(),e=t();return Wm=e,Wm}var Ym,eA;function vS(){if(eA)return Ym;eA=1;var t=hS(),e=Oi();function r(n,a){return n&&t(n,a,e)}return Ym=r,Ym}var Xm,tA;function T9(){if(tA)return Xm;tA=1;var t=za();function e(r,n){return function(a,i){if(a==null)return a;if(!t(a))return r(a,i);for(var s=a.length,o=n?s:-1,l=Object(a);(n?o--:++o<s)&&i(l[o],o,l)!==!1;);return a}}return Xm=e,Xm}var Km,rA;function wh(){if(rA)return Km;rA=1;var t=vS(),e=T9(),r=e(t);return Km=r,Km}var Qm,nA;function Ns(){if(nA)return Qm;nA=1;function t(e){return e}return Qm=t,Qm}var Zm,aA;function fF(){if(aA)return Zm;aA=1;var t=Ns();function e(r){return typeof r=="function"?r:t}return Zm=e,Zm}var Jm,iA;function hF(){if(iA)return Jm;iA=1;var t=iS(),e=wh(),r=fF(),n=Xt();function a(i,s){var o=n(i)?t:e;return o(i,r(s))}return Jm=a,Jm}var ey,sA;function vF(){return sA||(sA=1,ey=hF()),ey}var ty,oA;function R9(){if(oA)return ty;oA=1;var t=wh();function e(r,n){var a=[];return t(r,function(i,s,o){n(i,s,o)&&a.push(i)}),a}return ty=e,ty}var ry,lA;function P9(){if(lA)return ry;lA=1;var t="__lodash_hash_undefined__";function e(r){return this.__data__.set(r,t),this}return ry=e,ry}var ny,uA;function A9(){if(uA)return ny;uA=1;function t(e){return this.__data__.has(e)}return ny=t,ny}var ay,cA;function pF(){if(cA)return ay;cA=1;var t=aS(),e=P9(),r=A9();function n(a){var i=-1,s=a==null?0:a.length;for(this.__data__=new t;++i<s;)this.add(a[i])}return n.prototype.add=n.prototype.push=e,n.prototype.has=r,ay=n,ay}var iy,dA;function k9(){if(dA)return iy;dA=1;function t(e,r){for(var n=-1,a=e==null?0:e.length;++n<a;)if(r(e[n],n,e))return!0;return!1}return iy=t,iy}var sy,fA;function gF(){if(fA)return sy;fA=1;function t(e,r){return e.has(r)}return sy=t,sy}var oy,hA;function mF(){if(hA)return oy;hA=1;var t=pF(),e=k9(),r=gF(),n=1,a=2;function i(s,o,l,u,c,d){var f=l&n,v=s.length,p=o.length;if(v!=p&&!(f&&p>v))return!1;var y=d.get(s),m=d.get(o);if(y&&m)return y==o&&m==s;var g=-1,x=!0,b=l&a?new t:void 0;for(d.set(s,o),d.set(o,s);++g<v;){var w=s[g],E=o[g];if(u)var C=f?u(E,w,g,o,s,d):u(w,E,g,s,o,d);if(C!==void 0){if(C)continue;x=!1;break}if(b){if(!e(o,function(S,T){if(!r(b,T)&&(w===S||c(w,S,l,u,d)))return b.push(T)})){x=!1;break}}else if(!(w===E||c(w,E,l,u,d))){x=!1;break}}return d.delete(s),d.delete(o),x}return oy=i,oy}var ly,vA;function L9(){if(vA)return ly;vA=1;function t(e){var r=-1,n=Array(e.size);return e.forEach(function(a,i){n[++r]=[i,a]}),n}return ly=t,ly}var uy,pA;function pS(){if(pA)return uy;pA=1;function t(e){var r=-1,n=Array(e.size);return e.forEach(function(a){n[++r]=a}),n}return uy=t,uy}var cy,gA;function D9(){if(gA)return cy;gA=1;var t=zo(),e=oF(),r=Bo(),n=mF(),a=L9(),i=pS(),s=1,o=2,l="[object Boolean]",u="[object Date]",c="[object Error]",d="[object Map]",f="[object Number]",v="[object RegExp]",p="[object Set]",y="[object String]",m="[object Symbol]",g="[object ArrayBuffer]",x="[object DataView]",b=t?t.prototype:void 0,w=b?b.valueOf:void 0;function E(C,S,T,P,A,j,R){switch(T){case x:if(C.byteLength!=S.byteLength||C.byteOffset!=S.byteOffset)return!1;C=C.buffer,S=S.buffer;case g:return!(C.byteLength!=S.byteLength||!j(new e(C),new e(S)));case l:case u:case f:return r(+C,+S);case c:return C.name==S.name&&C.message==S.message;case v:case y:return C==S+"";case d:var O=a;case p:var N=P&s;if(O||(O=i),C.size!=S.size&&!N)return!1;var D=R.get(C);if(D)return D==S;P|=o,R.set(C,S);var L=n(O(C),O(S),P,A,j,R);return R.delete(C),L;case m:if(w)return w.call(C)==w.call(S)}return!1}return cy=E,cy}var dy,mA;function _9(){if(mA)return dy;mA=1;var t=iF(),e=1,r=Object.prototype,n=r.hasOwnProperty;function a(i,s,o,l,u,c){var d=o&e,f=t(i),v=f.length,p=t(s),y=p.length;if(v!=y&&!d)return!1;for(var m=v;m--;){var g=f[m];if(!(d?g in s:n.call(s,g)))return!1}var x=c.get(i),b=c.get(s);if(x&&b)return x==s&&b==i;var w=!0;c.set(i,s),c.set(s,i);for(var E=d;++m<v;){g=f[m];var C=i[g],S=s[g];if(l)var T=d?l(S,C,g,s,i,c):l(C,S,g,i,s,c);if(!(T===void 0?C===S||u(C,S,o,l,c):T)){w=!1;break}E||(E=g=="constructor")}if(w&&!E){var P=i.constructor,A=s.constructor;P!=A&&"constructor"in i&&"constructor"in s&&!(typeof P=="function"&&P instanceof P&&typeof A=="function"&&A instanceof A)&&(w=!1)}return c.delete(i),c.delete(s),w}return dy=a,dy}var fy,yA;function j9(){if(yA)return fy;yA=1;var t=vh(),e=mF(),r=D9(),n=_9(),a=Uo(),i=Xt(),s=qo(),o=Qu(),l=1,u="[object Arguments]",c="[object Array]",d="[object Object]",f=Object.prototype,v=f.hasOwnProperty;function p(y,m,g,x,b,w){var E=i(y),C=i(m),S=E?c:a(y),T=C?c:a(m);S=S==u?d:S,T=T==u?d:T;var P=S==d,A=T==d,j=S==T;if(j&&s(y)){if(!s(m))return!1;E=!0,P=!1}if(j&&!P)return w||(w=new t),E||o(y)?e(y,m,g,x,b,w):r(y,m,S,g,x,b,w);if(!(g&l)){var R=P&&v.call(y,"__wrapped__"),O=A&&v.call(m,"__wrapped__");if(R||O){var N=R?y.value():y,D=O?m.value():m;return w||(w=new t),b(N,D,g,x,w)}}return j?(w||(w=new t),n(y,m,g,x,b,w)):!1}return fy=p,fy}var hy,xA;function yF(){if(xA)return hy;xA=1;var t=j9(),e=ha();function r(n,a,i,s,o){return n===a?!0:n==null||a==null||!e(n)&&!e(a)?n!==n&&a!==a:t(n,a,i,s,r,o)}return hy=r,hy}var vy,bA;function O9(){if(bA)return vy;bA=1;var t=vh(),e=yF(),r=1,n=2;function a(i,s,o,l){var u=o.length,c=u,d=!l;if(i==null)return!c;for(i=Object(i);u--;){var f=o[u];if(d&&f[2]?f[1]!==i[f[0]]:!(f[0]in i))return!1}for(;++u<c;){f=o[u];var v=f[0],p=i[v],y=f[1];if(d&&f[2]){if(p===void 0&&!(v in i))return!1}else{var m=new t;if(l)var g=l(p,y,v,i,s,m);if(!(g===void 0?e(y,p,r|n,l,m):g))return!1}}return!0}return vy=a,vy}var py,wA;function xF(){if(wA)return py;wA=1;var t=Rn();function e(r){return r===r&&!t(r)}return py=e,py}var gy,EA;function M9(){if(EA)return gy;EA=1;var t=xF(),e=Oi();function r(n){for(var a=e(n),i=a.length;i--;){var s=a[i],o=n[s];a[i]=[s,o,t(o)]}return a}return gy=r,gy}var my,SA;function bF(){if(SA)return my;SA=1;function t(e,r){return function(n){return n==null?!1:n[e]===r&&(r!==void 0||e in Object(n))}}return my=t,my}var yy,CA;function I9(){if(CA)return yy;CA=1;var t=O9(),e=M9(),r=bF();function n(a){var i=e(a);return i.length==1&&i[0][2]?r(i[0][0],i[0][1]):function(s){return s===a||t(s,a,i)}}return yy=n,yy}var xy,NA;function $o(){if(NA)return xy;NA=1;var t=Es(),e=ha(),r="[object Symbol]";function n(a){return typeof a=="symbol"||e(a)&&t(a)==r}return xy=n,xy}var by,TA;function gS(){if(TA)return by;TA=1;var t=Xt(),e=$o(),r=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,n=/^\w*$/;function a(i,s){if(t(i))return!1;var o=typeof i;return o=="number"||o=="symbol"||o=="boolean"||i==null||e(i)?!0:n.test(i)||!r.test(i)||s!=null&&i in Object(s)}return by=a,by}var wy,RA;function F9(){if(RA)return wy;RA=1;var t=aS(),e="Expected a function";function r(n,a){if(typeof n!="function"||a!=null&&typeof a!="function")throw new TypeError(e);var i=function(){var s=arguments,o=a?a.apply(this,s):s[0],l=i.cache;if(l.has(o))return l.get(o);var u=n.apply(this,s);return i.cache=l.set(o,u)||l,u};return i.cache=new(r.Cache||t),i}return r.Cache=t,wy=r,wy}var Ey,PA;function B9(){if(PA)return Ey;PA=1;var t=F9(),e=500;function r(n){var a=t(n,function(s){return i.size===e&&i.clear(),s}),i=a.cache;return a}return Ey=r,Ey}var Sy,AA;function z9(){if(AA)return Sy;AA=1;var t=B9(),e=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,r=/\\(\\)?/g,n=t(function(a){var i=[];return a.charCodeAt(0)===46&&i.push(""),a.replace(e,function(s,o,l,u){i.push(l?u.replace(r,"$1"):o||s)}),i});return Sy=n,Sy}var Cy,kA;function Eh(){if(kA)return Cy;kA=1;function t(e,r){for(var n=-1,a=e==null?0:e.length,i=Array(a);++n<a;)i[n]=r(e[n],n,e);return i}return Cy=t,Cy}var Ny,LA;function q9(){if(LA)return Ny;LA=1;var t=zo(),e=Eh(),r=Xt(),n=$o(),a=1/0,i=t?t.prototype:void 0,s=i?i.toString:void 0;function o(l){if(typeof l=="string")return l;if(r(l))return e(l,o)+"";if(n(l))return s?s.call(l):"";var u=l+"";return u=="0"&&1/l==-a?"-0":u}return Ny=o,Ny}var Ty,DA;function wF(){if(DA)return Ty;DA=1;var t=q9();function e(r){return r==null?"":t(r)}return Ty=e,Ty}var Ry,_A;function Sh(){if(_A)return Ry;_A=1;var t=Xt(),e=gS(),r=z9(),n=wF();function a(i,s){return t(i)?i:e(i,s)?[i]:r(n(i))}return Ry=a,Ry}var Py,jA;function Zu(){if(jA)return Py;jA=1;var t=$o(),e=1/0;function r(n){if(typeof n=="string"||t(n))return n;var a=n+"";return a=="0"&&1/n==-e?"-0":a}return Py=r,Py}var Ay,OA;function Ch(){if(OA)return Ay;OA=1;var t=Sh(),e=Zu();function r(n,a){a=t(a,n);for(var i=0,s=a.length;n!=null&&i<s;)n=n[e(a[i++])];return i&&i==s?n:void 0}return Ay=r,Ay}var ky,MA;function U9(){if(MA)return ky;MA=1;var t=Ch();function e(r,n,a){var i=r==null?void 0:t(r,n);return i===void 0?a:i}return ky=e,ky}var Ly,IA;function $9(){if(IA)return Ly;IA=1;function t(e,r){return e!=null&&r in Object(e)}return Ly=t,Ly}var Dy,FA;function EF(){if(FA)return Dy;FA=1;var t=Sh(),e=Ku(),r=Xt(),n=mh(),a=sS(),i=Zu();function s(o,l,u){l=t(l,o);for(var c=-1,d=l.length,f=!1;++c<d;){var v=i(l[c]);if(!(f=o!=null&&u(o,v)))break;o=o[v]}return f||++c!=d?f:(d=o==null?0:o.length,!!d&&a(d)&&n(v,d)&&(r(o)||e(o)))}return Dy=s,Dy}var _y,BA;function SF(){if(BA)return _y;BA=1;var t=$9(),e=EF();function r(n,a){return n!=null&&e(n,a,t)}return _y=r,_y}var jy,zA;function V9(){if(zA)return jy;zA=1;var t=yF(),e=U9(),r=SF(),n=gS(),a=xF(),i=bF(),s=Zu(),o=1,l=2;function u(c,d){return n(c)&&a(d)?i(s(c),d):function(f){var v=e(f,c);return v===void 0&&v===d?r(f,c):t(d,v,o|l)}}return jy=u,jy}var Oy,qA;function CF(){if(qA)return Oy;qA=1;function t(e){return function(r){return r==null?void 0:r[e]}}return Oy=t,Oy}var My,UA;function G9(){if(UA)return My;UA=1;var t=Ch();function e(r){return function(n){return t(n,r)}}return My=e,My}var Iy,$A;function H9(){if($A)return Iy;$A=1;var t=CF(),e=G9(),r=gS(),n=Zu();function a(i){return r(i)?t(n(i)):e(i)}return Iy=a,Iy}var Fy,VA;function qa(){if(VA)return Fy;VA=1;var t=I9(),e=V9(),r=Ns(),n=Xt(),a=H9();function i(s){return typeof s=="function"?s:s==null?r:typeof s=="object"?n(s)?e(s[0],s[1]):t(s):a(s)}return Fy=i,Fy}var By,GA;function NF(){if(GA)return By;GA=1;var t=tF(),e=R9(),r=qa(),n=Xt();function a(i,s){var o=n(i)?t:e;return o(i,r(s,3))}return By=a,By}var zy,HA;function W9(){if(HA)return zy;HA=1;var t=Object.prototype,e=t.hasOwnProperty;function r(n,a){return n!=null&&e.call(n,a)}return zy=r,zy}var qy,WA;function TF(){if(WA)return qy;WA=1;var t=W9(),e=EF();function r(n,a){return n!=null&&e(n,a,t)}return qy=r,qy}var Uy,YA;function Y9(){if(YA)return Uy;YA=1;var t=lS(),e=Uo(),r=Ku(),n=Xt(),a=za(),i=qo(),s=xh(),o=Qu(),l="[object Map]",u="[object Set]",c=Object.prototype,d=c.hasOwnProperty;function f(v){if(v==null)return!0;if(a(v)&&(n(v)||typeof v=="string"||typeof v.splice=="function"||i(v)||o(v)||r(v)))return!v.length;var p=e(v);if(p==l||p==u)return!v.size;if(s(v))return!t(v).length;for(var y in v)if(d.call(v,y))return!1;return!0}return Uy=f,Uy}var $y,XA;function RF(){if(XA)return $y;XA=1;function t(e){return e===void 0}return $y=t,$y}var Vy,KA;function PF(){if(KA)return Vy;KA=1;var t=wh(),e=za();function r(n,a){var i=-1,s=e(n)?Array(n.length):[];return t(n,function(o,l,u){s[++i]=a(o,l,u)}),s}return Vy=r,Vy}var Gy,QA;function AF(){if(QA)return Gy;QA=1;var t=Eh(),e=qa(),r=PF(),n=Xt();function a(i,s){var o=n(i)?t:r;return o(i,e(s,3))}return Gy=a,Gy}var Hy,ZA;function X9(){if(ZA)return Hy;ZA=1;function t(e,r,n,a){var i=-1,s=e==null?0:e.length;for(a&&s&&(n=e[++i]);++i<s;)n=r(n,e[i],i,e);return n}return Hy=t,Hy}var Wy,JA;function K9(){if(JA)return Wy;JA=1;function t(e,r,n,a,i){return i(e,function(s,o,l){n=a?(a=!1,s):r(n,s,o,l)}),n}return Wy=t,Wy}var Yy,ek;function kF(){if(ek)return Yy;ek=1;var t=X9(),e=wh(),r=qa(),n=K9(),a=Xt();function i(s,o,l){var u=a(s)?t:n,c=arguments.length<3;return u(s,r(o,4),l,c,e)}return Yy=i,Yy}var Xy,tk;function Q9(){if(tk)return Xy;tk=1;var t=Es(),e=Xt(),r=ha(),n="[object String]";function a(i){return typeof i=="string"||!e(i)&&r(i)&&t(i)==n}return Xy=a,Xy}var Ky,rk;function Z9(){if(rk)return Ky;rk=1;var t=CF(),e=t("length");return Ky=e,Ky}var Qy,nk;function J9(){if(nk)return Qy;nk=1;var t="\\ud800-\\udfff",e="\\u0300-\\u036f",r="\\ufe20-\\ufe2f",n="\\u20d0-\\u20ff",a=e+r+n,i="\\ufe0e\\ufe0f",s="\\u200d",o=RegExp("["+s+t+a+i+"]");function l(u){return o.test(u)}return Qy=l,Qy}var Zy,ak;function eY(){if(ak)return Zy;ak=1;var t="\\ud800-\\udfff",e="\\u0300-\\u036f",r="\\ufe20-\\ufe2f",n="\\u20d0-\\u20ff",a=e+r+n,i="\\ufe0e\\ufe0f",s="["+t+"]",o="["+a+"]",l="\\ud83c[\\udffb-\\udfff]",u="(?:"+o+"|"+l+")",c="[^"+t+"]",d="(?:\\ud83c[\\udde6-\\uddff]){2}",f="[\\ud800-\\udbff][\\udc00-\\udfff]",v="\\u200d",p=u+"?",y="["+i+"]?",m="(?:"+v+"(?:"+[c,d,f].join("|")+")"+y+p+")*",g=y+p+m,x="(?:"+[c+o+"?",o,d,f,s].join("|")+")",b=RegExp(l+"(?="+l+")|"+x+g,"g");function w(E){for(var C=b.lastIndex=0;b.test(E);)++C;return C}return Zy=w,Zy}var Jy,ik;function tY(){if(ik)return Jy;ik=1;var t=Z9(),e=J9(),r=eY();function n(a){return e(a)?r(a):t(a)}return Jy=n,Jy}var e0,sk;function rY(){if(sk)return e0;sk=1;var t=lS(),e=Uo(),r=za(),n=Q9(),a=tY(),i="[object Map]",s="[object Set]";function o(l){if(l==null)return 0;if(r(l))return n(l)?a(l):l.length;var u=e(l);return u==i||u==s?l.size:t(l).length}return e0=o,e0}var t0,ok;function nY(){if(ok)return t0;ok=1;var t=iS(),e=uF(),r=vS(),n=qa(),a=bh(),i=Xt(),s=qo(),o=Yu(),l=Rn(),u=Qu();function c(d,f,v){var p=i(d),y=p||s(d)||u(d);if(f=n(f,4),v==null){var m=d&&d.constructor;y?v=p?new m:[]:l(d)?v=o(m)?e(a(d)):{}:v={}}return(y?t:r)(d,function(g,x,b){return f(v,g,x,b)}),v}return t0=c,t0}var r0,lk;function aY(){if(lk)return r0;lk=1;var t=zo(),e=Ku(),r=Xt(),n=t?t.isConcatSpreadable:void 0;function a(i){return r(i)||e(i)||!!(n&&i&&i[n])}return r0=a,r0}var n0,uk;function mS(){if(uk)return n0;uk=1;var t=cS(),e=aY();function r(n,a,i,s,o){var l=-1,u=n.length;for(i||(i=e),o||(o=[]);++l<u;){var c=n[l];a>0&&i(c)?a>1?r(c,a-1,i,s,o):t(o,c):s||(o[o.length]=c)}return o}return n0=r,n0}var a0,ck;function iY(){if(ck)return a0;ck=1;function t(e,r,n){switch(n.length){case 0:return e.call(r);case 1:return e.call(r,n[0]);case 2:return e.call(r,n[0],n[1]);case 3:return e.call(r,n[0],n[1],n[2])}return e.apply(r,n)}return a0=t,a0}var i0,dk;function LF(){if(dk)return i0;dk=1;var t=iY(),e=Math.max;function r(n,a,i){return a=e(a===void 0?n.length-1:a,0),function(){for(var s=arguments,o=-1,l=e(s.length-a,0),u=Array(l);++o<l;)u[o]=s[a+o];o=-1;for(var c=Array(a+1);++o<a;)c[o]=s[o];return c[a]=i(u),t(n,this,c)}}return i0=r,i0}var s0,fk;function sY(){if(fk)return s0;fk=1;var t=fS(),e=KI(),r=Ns(),n=e?function(a,i){return e(a,"toString",{configurable:!0,enumerable:!1,value:t(i),writable:!0})}:r;return s0=n,s0}var o0,hk;function oY(){if(hk)return o0;hk=1;var t=800,e=16,r=Date.now;function n(a){var i=0,s=0;return function(){var o=r(),l=e-(o-s);if(s=o,l>0){if(++i>=t)return arguments[0]}else i=0;return a.apply(void 0,arguments)}}return o0=n,o0}var l0,vk;function DF(){if(vk)return l0;vk=1;var t=sY(),e=oY(),r=e(t);return l0=r,l0}var u0,pk;function Nh(){if(pk)return u0;pk=1;var t=Ns(),e=LF(),r=DF();function n(a,i){return r(e(a,i,t),a+"")}return u0=n,u0}var c0,gk;function _F(){if(gk)return c0;gk=1;function t(e,r,n,a){for(var i=e.length,s=n+(a?1:-1);a?s--:++s<i;)if(r(e[s],s,e))return s;return-1}return c0=t,c0}var d0,mk;function lY(){if(mk)return d0;mk=1;function t(e){return e!==e}return d0=t,d0}var f0,yk;function uY(){if(yk)return f0;yk=1;function t(e,r,n){for(var a=n-1,i=e.length;++a<i;)if(e[a]===r)return a;return-1}return f0=t,f0}var h0,xk;function cY(){if(xk)return h0;xk=1;var t=_F(),e=lY(),r=uY();function n(a,i,s){return i===i?r(a,i,s):t(a,e,s)}return h0=n,h0}var v0,bk;function dY(){if(bk)return v0;bk=1;var t=cY();function e(r,n){var a=r==null?0:r.length;return!!a&&t(r,n,0)>-1}return v0=e,v0}var p0,wk;function fY(){if(wk)return p0;wk=1;function t(e,r,n){for(var a=-1,i=e==null?0:e.length;++a<i;)if(n(r,e[a]))return!0;return!1}return p0=t,p0}var g0,Ek;function hY(){if(Ek)return g0;Ek=1;function t(){}return g0=t,g0}var m0,Sk;function vY(){if(Sk)return m0;Sk=1;var t=sF(),e=hY(),r=pS(),n=1/0,a=t&&1/r(new t([,-0]))[1]==n?function(i){return new t(i)}:e;return m0=a,m0}var y0,Ck;function pY(){if(Ck)return y0;Ck=1;var t=pF(),e=dY(),r=fY(),n=gF(),a=vY(),i=pS(),s=200;function o(l,u,c){var d=-1,f=e,v=l.length,p=!0,y=[],m=y;if(c)p=!1,f=r;else if(v>=s){var g=u?null:a(l);if(g)return i(g);p=!1,f=n,m=new t}else m=u?[]:y;e:for(;++d<v;){var x=l[d],b=u?u(x):x;if(x=c||x!==0?x:0,p&&b===b){for(var w=m.length;w--;)if(m[w]===b)continue e;u&&m.push(b),y.push(x)}else f(m,b,c)||(m!==y&&m.push(b),y.push(x))}return y}return y0=o,y0}var x0,Nk;function jF(){if(Nk)return x0;Nk=1;var t=za(),e=ha();function r(n){return e(n)&&t(n)}return x0=r,x0}var b0,Tk;function gY(){if(Tk)return b0;Tk=1;var t=mS(),e=Nh(),r=pY(),n=jF(),a=e(function(i){return r(t(i,1,n,!0))});return b0=a,b0}var w0,Rk;function mY(){if(Rk)return w0;Rk=1;var t=Eh();function e(r,n){return t(n,function(a){return r[a]})}return w0=e,w0}var E0,Pk;function OF(){if(Pk)return E0;Pk=1;var t=mY(),e=Oi();function r(n){return n==null?[]:t(n,e(n))}return E0=r,E0}var S0,Ak;function Pn(){if(Ak)return S0;Ak=1;var t;if(typeof rS=="function")try{t={clone:C9(),constant:fS(),each:vF(),filter:NF(),has:TF(),isArray:Xt(),isEmpty:Y9(),isFunction:Yu(),isUndefined:RF(),keys:Oi(),map:AF(),reduce:kF(),size:rY(),transform:nY(),union:gY(),values:OF()}}catch{}return t||(t=window._),S0=t,S0}var C0,kk;function yS(){if(kk)return C0;kk=1;var t=Pn();C0=a;var e="\0",r="\0",n="";function a(c){this._isDirected=t.has(c,"directed")?c.directed:!0,this._isMultigraph=t.has(c,"multigraph")?c.multigraph:!1,this._isCompound=t.has(c,"compound")?c.compound:!1,this._label=void 0,this._defaultNodeLabelFn=t.constant(void 0),this._defaultEdgeLabelFn=t.constant(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children[r]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}a.prototype._nodeCount=0,a.prototype._edgeCount=0,a.prototype.isDirected=function(){return this._isDirected},a.prototype.isMultigraph=function(){return this._isMultigraph},a.prototype.isCompound=function(){return this._isCompound},a.prototype.setGraph=function(c){return this._label=c,this},a.prototype.graph=function(){return this._label},a.prototype.setDefaultNodeLabel=function(c){return t.isFunction(c)||(c=t.constant(c)),this._defaultNodeLabelFn=c,this},a.prototype.nodeCount=function(){return this._nodeCount},a.prototype.nodes=function(){return t.keys(this._nodes)},a.prototype.sources=function(){var c=this;return t.filter(this.nodes(),function(d){return t.isEmpty(c._in[d])})},a.prototype.sinks=function(){var c=this;return t.filter(this.nodes(),function(d){return t.isEmpty(c._out[d])})},a.prototype.setNodes=function(c,d){var f=arguments,v=this;return t.each(c,function(p){f.length>1?v.setNode(p,d):v.setNode(p)}),this},a.prototype.setNode=function(c,d){return t.has(this._nodes,c)?(arguments.length>1&&(this._nodes[c]=d),this):(this._nodes[c]=arguments.length>1?d:this._defaultNodeLabelFn(c),this._isCompound&&(this._parent[c]=r,this._children[c]={},this._children[r][c]=!0),this._in[c]={},this._preds[c]={},this._out[c]={},this._sucs[c]={},++this._nodeCount,this)},a.prototype.node=function(c){return this._nodes[c]},a.prototype.hasNode=function(c){return t.has(this._nodes,c)},a.prototype.removeNode=function(c){var d=this;if(t.has(this._nodes,c)){var f=function(v){d.removeEdge(d._edgeObjs[v])};delete this._nodes[c],this._isCompound&&(this._removeFromParentsChildList(c),delete this._parent[c],t.each(this.children(c),function(v){d.setParent(v)}),delete this._children[c]),t.each(t.keys(this._in[c]),f),delete this._in[c],delete this._preds[c],t.each(t.keys(this._out[c]),f),delete this._out[c],delete this._sucs[c],--this._nodeCount}return this},a.prototype.setParent=function(c,d){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(t.isUndefined(d))d=r;else{d+="";for(var f=d;!t.isUndefined(f);f=this.parent(f))if(f===c)throw new Error("Setting "+d+" as parent of "+c+" would create a cycle");this.setNode(d)}return this.setNode(c),this._removeFromParentsChildList(c),this._parent[c]=d,this._children[d][c]=!0,this},a.prototype._removeFromParentsChildList=function(c){delete this._children[this._parent[c]][c]},a.prototype.parent=function(c){if(this._isCompound){var d=this._parent[c];if(d!==r)return d}},a.prototype.children=function(c){if(t.isUndefined(c)&&(c=r),this._isCompound){var d=this._children[c];if(d)return t.keys(d)}else{if(c===r)return this.nodes();if(this.hasNode(c))return[]}},a.prototype.predecessors=function(c){var d=this._preds[c];if(d)return t.keys(d)},a.prototype.successors=function(c){var d=this._sucs[c];if(d)return t.keys(d)},a.prototype.neighbors=function(c){var d=this.predecessors(c);if(d)return t.union(d,this.successors(c))},a.prototype.isLeaf=function(c){var d;return this.isDirected()?d=this.successors(c):d=this.neighbors(c),d.length===0},a.prototype.filterNodes=function(c){var d=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});d.setGraph(this.graph());var f=this;t.each(this._nodes,function(y,m){c(m)&&d.setNode(m,y)}),t.each(this._edgeObjs,function(y){d.hasNode(y.v)&&d.hasNode(y.w)&&d.setEdge(y,f.edge(y))});var v={};function p(y){var m=f.parent(y);return m===void 0||d.hasNode(m)?(v[y]=m,m):m in v?v[m]:p(m)}return this._isCompound&&t.each(d.nodes(),function(y){d.setParent(y,p(y))}),d},a.prototype.setDefaultEdgeLabel=function(c){return t.isFunction(c)||(c=t.constant(c)),this._defaultEdgeLabelFn=c,this},a.prototype.edgeCount=function(){return this._edgeCount},a.prototype.edges=function(){return t.values(this._edgeObjs)},a.prototype.setPath=function(c,d){var f=this,v=arguments;return t.reduce(c,function(p,y){return v.length>1?f.setEdge(p,y,d):f.setEdge(p,y),y}),this},a.prototype.setEdge=function(){var c,d,f,v,p=!1,y=arguments[0];typeof y=="object"&&y!==null&&"v"in y?(c=y.v,d=y.w,f=y.name,arguments.length===2&&(v=arguments[1],p=!0)):(c=y,d=arguments[1],f=arguments[3],arguments.length>2&&(v=arguments[2],p=!0)),c=""+c,d=""+d,t.isUndefined(f)||(f=""+f);var m=o(this._isDirected,c,d,f);if(t.has(this._edgeLabels,m))return p&&(this._edgeLabels[m]=v),this;if(!t.isUndefined(f)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(c),this.setNode(d),this._edgeLabels[m]=p?v:this._defaultEdgeLabelFn(c,d,f);var g=l(this._isDirected,c,d,f);return c=g.v,d=g.w,Object.freeze(g),this._edgeObjs[m]=g,i(this._preds[d],c),i(this._sucs[c],d),this._in[d][m]=g,this._out[c][m]=g,this._edgeCount++,this},a.prototype.edge=function(c,d,f){var v=arguments.length===1?u(this._isDirected,arguments[0]):o(this._isDirected,c,d,f);return this._edgeLabels[v]},a.prototype.hasEdge=function(c,d,f){var v=arguments.length===1?u(this._isDirected,arguments[0]):o(this._isDirected,c,d,f);return t.has(this._edgeLabels,v)},a.prototype.removeEdge=function(c,d,f){var v=arguments.length===1?u(this._isDirected,arguments[0]):o(this._isDirected,c,d,f),p=this._edgeObjs[v];return p&&(c=p.v,d=p.w,delete this._edgeLabels[v],delete this._edgeObjs[v],s(this._preds[d],c),s(this._sucs[c],d),delete this._in[d][v],delete this._out[c][v],this._edgeCount--),this},a.prototype.inEdges=function(c,d){var f=this._in[c];if(f){var v=t.values(f);return d?t.filter(v,function(p){return p.v===d}):v}},a.prototype.outEdges=function(c,d){var f=this._out[c];if(f){var v=t.values(f);return d?t.filter(v,function(p){return p.w===d}):v}},a.prototype.nodeEdges=function(c,d){var f=this.inEdges(c,d);if(f)return f.concat(this.outEdges(c,d))};function i(c,d){c[d]?c[d]++:c[d]=1}function s(c,d){--c[d]||delete c[d]}function o(c,d,f,v){var p=""+d,y=""+f;if(!c&&p>y){var m=p;p=y,y=m}return p+n+y+n+(t.isUndefined(v)?e:v)}function l(c,d,f,v){var p=""+d,y=""+f;if(!c&&p>y){var m=p;p=y,y=m}var g={v:p,w:y};return v&&(g.name=v),g}function u(c,d){return o(c,d.v,d.w,d.name)}return C0}var N0,Lk;function yY(){return Lk||(Lk=1,N0="2.1.8"),N0}var T0,Dk;function xY(){return Dk||(Dk=1,T0={Graph:yS(),version:yY()}),T0}var R0,_k;function bY(){if(_k)return R0;_k=1;var t=Pn(),e=yS();R0={write:r,read:i};function r(s){var o={options:{directed:s.isDirected(),multigraph:s.isMultigraph(),compound:s.isCompound()},nodes:n(s),edges:a(s)};return t.isUndefined(s.graph())||(o.value=t.clone(s.graph())),o}function n(s){return t.map(s.nodes(),function(o){var l=s.node(o),u=s.parent(o),c={v:o};return t.isUndefined(l)||(c.value=l),t.isUndefined(u)||(c.parent=u),c})}function a(s){return t.map(s.edges(),function(o){var l=s.edge(o),u={v:o.v,w:o.w};return t.isUndefined(o.name)||(u.name=o.name),t.isUndefined(l)||(u.value=l),u})}function i(s){var o=new e(s.options).setGraph(s.value);return t.each(s.nodes,function(l){o.setNode(l.v,l.value),l.parent&&o.setParent(l.v,l.parent)}),t.each(s.edges,function(l){o.setEdge({v:l.v,w:l.w,name:l.name},l.value)}),o}return R0}var P0,jk;function wY(){if(jk)return P0;jk=1;var t=Pn();P0=e;function e(r){var n={},a=[],i;function s(o){t.has(n,o)||(n[o]=!0,i.push(o),t.each(r.successors(o),s),t.each(r.predecessors(o),s))}return t.each(r.nodes(),function(o){i=[],s(o),i.length&&a.push(i)}),a}return P0}var A0,Ok;function MF(){if(Ok)return A0;Ok=1;var t=Pn();A0=e;function e(){this._arr=[],this._keyIndices={}}return e.prototype.size=function(){return this._arr.length},e.prototype.keys=function(){return this._arr.map(function(r){return r.key})},e.prototype.has=function(r){return t.has(this._keyIndices,r)},e.prototype.priority=function(r){var n=this._keyIndices[r];if(n!==void 0)return this._arr[n].priority},e.prototype.min=function(){if(this.size()===0)throw new Error("Queue underflow");return this._arr[0].key},e.prototype.add=function(r,n){var a=this._keyIndices;if(r=String(r),!t.has(a,r)){var i=this._arr,s=i.length;return a[r]=s,i.push({key:r,priority:n}),this._decrease(s),!0}return!1},e.prototype.removeMin=function(){this._swap(0,this._arr.length-1);var r=this._arr.pop();return delete this._keyIndices[r.key],this._heapify(0),r.key},e.prototype.decrease=function(r,n){var a=this._keyIndices[r];if(n>this._arr[a].priority)throw new Error("New priority is greater than current priority. Key: "+r+" Old: "+this._arr[a].priority+" New: "+n);this._arr[a].priority=n,this._decrease(a)},e.prototype._heapify=function(r){var n=this._arr,a=2*r,i=a+1,s=r;a<n.length&&(s=n[a].priority<n[s].priority?a:s,i<n.length&&(s=n[i].priority<n[s].priority?i:s),s!==r&&(this._swap(r,s),this._heapify(s)))},e.prototype._decrease=function(r){for(var n=this._arr,a=n[r].priority,i;r!==0&&(i=r>>1,!(n[i].priority<a));)this._swap(r,i),r=i},e.prototype._swap=function(r,n){var a=this._arr,i=this._keyIndices,s=a[r],o=a[n];a[r]=o,a[n]=s,i[o.key]=r,i[s.key]=n},A0}var k0,Mk;function IF(){if(Mk)return k0;Mk=1;var t=Pn(),e=MF();k0=n;var r=t.constant(1);function n(i,s,o,l){return a(i,String(s),o||r,l||function(u){return i.outEdges(u)})}function a(i,s,o,l){var u={},c=new e,d,f,v=function(p){var y=p.v!==d?p.v:p.w,m=u[y],g=o(p),x=f.distance+g;if(g<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+p+" Weight: "+g);x<m.distance&&(m.distance=x,m.predecessor=d,c.decrease(y,x))};for(i.nodes().forEach(function(p){var y=p===s?0:Number.POSITIVE_INFINITY;u[p]={distance:y},c.add(p,y)});c.size()>0&&(d=c.removeMin(),f=u[d],f.distance!==Number.POSITIVE_INFINITY);)l(d).forEach(v);return u}return k0}var L0,Ik;function EY(){if(Ik)return L0;Ik=1;var t=IF(),e=Pn();L0=r;function r(n,a,i){return e.transform(n.nodes(),function(s,o){s[o]=t(n,o,a,i)},{})}return L0}var D0,Fk;function FF(){if(Fk)return D0;Fk=1;var t=Pn();D0=e;function e(r){var n=0,a=[],i={},s=[];function o(l){var u=i[l]={onStack:!0,lowlink:n,index:n++};if(a.push(l),r.successors(l).forEach(function(f){t.has(i,f)?i[f].onStack&&(u.lowlink=Math.min(u.lowlink,i[f].index)):(o(f),u.lowlink=Math.min(u.lowlink,i[f].lowlink))}),u.lowlink===u.index){var c=[],d;do d=a.pop(),i[d].onStack=!1,c.push(d);while(l!==d);s.push(c)}}return r.nodes().forEach(function(l){t.has(i,l)||o(l)}),s}return D0}var _0,Bk;function SY(){if(Bk)return _0;Bk=1;var t=Pn(),e=FF();_0=r;function r(n){return t.filter(e(n),function(a){return a.length>1||a.length===1&&n.hasEdge(a[0],a[0])})}return _0}var j0,zk;function CY(){if(zk)return j0;zk=1;var t=Pn();j0=r;var e=t.constant(1);function r(a,i,s){return n(a,i||e,s||function(o){return a.outEdges(o)})}function n(a,i,s){var o={},l=a.nodes();return l.forEach(function(u){o[u]={},o[u][u]={distance:0},l.forEach(function(c){u!==c&&(o[u][c]={distance:Number.POSITIVE_INFINITY})}),s(u).forEach(function(c){var d=c.v===u?c.w:c.v,f=i(c);o[u][d]={distance:f,predecessor:u}})}),l.forEach(function(u){var c=o[u];l.forEach(function(d){var f=o[d];l.forEach(function(v){var p=f[u],y=c[v],m=f[v],g=p.distance+y.distance;g<m.distance&&(m.distance=g,m.predecessor=y.predecessor)})})}),o}return j0}var O0,qk;function BF(){if(qk)return O0;qk=1;var t=Pn();O0=e,e.CycleException=r;function e(n){var a={},i={},s=[];function o(l){if(t.has(i,l))throw new r;t.has(a,l)||(i[l]=!0,a[l]=!0,t.each(n.predecessors(l),o),delete i[l],s.push(l))}if(t.each(n.sinks(),o),t.size(a)!==n.nodeCount())throw new r;return s}function r(){}return r.prototype=new Error,O0}var M0,Uk;function NY(){if(Uk)return M0;Uk=1;var t=BF();M0=e;function e(r){try{t(r)}catch(n){if(n instanceof t.CycleException)return!1;throw n}return!0}return M0}var I0,$k;function zF(){if($k)return I0;$k=1;var t=Pn();I0=e;function e(n,a,i){t.isArray(a)||(a=[a]);var s=(n.isDirected()?n.successors:n.neighbors).bind(n),o=[],l={};return t.each(a,function(u){if(!n.hasNode(u))throw new Error("Graph does not have node: "+u);r(n,u,i==="post",l,s,o)}),o}function r(n,a,i,s,o,l){t.has(s,a)||(s[a]=!0,i||l.push(a),t.each(o(a),function(u){r(n,u,i,s,o,l)}),i&&l.push(a))}return I0}var F0,Vk;function TY(){if(Vk)return F0;Vk=1;var t=zF();F0=e;function e(r,n){return t(r,n,"post")}return F0}var B0,Gk;function RY(){if(Gk)return B0;Gk=1;var t=zF();B0=e;function e(r,n){return t(r,n,"pre")}return B0}var z0,Hk;function PY(){if(Hk)return z0;Hk=1;var t=Pn(),e=yS(),r=MF();z0=n;function n(a,i){var s=new e,o={},l=new r,u;function c(f){var v=f.v===u?f.w:f.v,p=l.priority(v);if(p!==void 0){var y=i(f);y<p&&(o[v]=u,l.decrease(v,y))}}if(a.nodeCount()===0)return s;t.each(a.nodes(),function(f){l.add(f,Number.POSITIVE_INFINITY),s.setNode(f)}),l.decrease(a.nodes()[0],0);for(var d=!1;l.size()>0;){if(u=l.removeMin(),t.has(o,u))s.setEdge(u,o[u]);else{if(d)throw new Error("Input graph is not connected: "+a);d=!0}a.nodeEdges(u).forEach(c)}return s}return z0}var q0,Wk;function AY(){return Wk||(Wk=1,q0={components:wY(),dijkstra:IF(),dijkstraAll:EY(),findCycles:SY(),floydWarshall:CY(),isAcyclic:NY(),postorder:TY(),preorder:RY(),prim:PY(),tarjan:FF(),topsort:BF()}),q0}var U0,Yk;function kY(){if(Yk)return U0;Yk=1;var t=xY();return U0={Graph:t.Graph,json:bY(),alg:AY(),version:t.version},U0}var $0,Xk;function Wn(){if(Xk)return $0;Xk=1;var t;if(typeof rS=="function")try{t=kY()}catch{}return t||(t=window.graphlib),$0=t,$0}var V0,Kk;function LY(){if(Kk)return V0;Kk=1;var t=dF(),e=1,r=4;function n(a){return t(a,e|r)}return V0=n,V0}var G0,Qk;function Th(){if(Qk)return G0;Qk=1;var t=Bo(),e=za(),r=mh(),n=Rn();function a(i,s,o){if(!n(o))return!1;var l=typeof s;return(l=="number"?e(o)&&r(s,o.length):l=="string"&&s in o)?t(o[s],i):!1}return G0=a,G0}var H0,Zk;function DY(){if(Zk)return H0;Zk=1;var t=Nh(),e=Bo(),r=Th(),n=Cs(),a=Object.prototype,i=a.hasOwnProperty,s=t(function(o,l){o=Object(o);var u=-1,c=l.length,d=c>2?l[2]:void 0;for(d&&r(l[0],l[1],d)&&(c=1);++u<c;)for(var f=l[u],v=n(f),p=-1,y=v.length;++p<y;){var m=v[p],g=o[m];(g===void 0||e(g,a[m])&&!i.call(o,m))&&(o[m]=f[m])}return o});return H0=s,H0}var W0,Jk;function _Y(){if(Jk)return W0;Jk=1;var t=qa(),e=za(),r=Oi();function n(a){return function(i,s,o){var l=Object(i);if(!e(i)){var u=t(s,3);i=r(i),s=function(d){return u(l[d],d,l)}}var c=a(i,s,o);return c>-1?l[u?i[c]:c]:void 0}}return W0=n,W0}var Y0,eL;function jY(){if(eL)return Y0;eL=1;var t=/\s/;function e(r){for(var n=r.length;n--&&t.test(r.charAt(n)););return n}return Y0=e,Y0}var X0,tL;function OY(){if(tL)return X0;tL=1;var t=jY(),e=/^\s+/;function r(n){return n&&n.slice(0,t(n)+1).replace(e,"")}return X0=r,X0}var K0,rL;function MY(){if(rL)return K0;rL=1;var t=OY(),e=Rn(),r=$o(),n=0/0,a=/^[-+]0x[0-9a-f]+$/i,i=/^0b[01]+$/i,s=/^0o[0-7]+$/i,o=parseInt;function l(u){if(typeof u=="number")return u;if(r(u))return n;if(e(u)){var c=typeof u.valueOf=="function"?u.valueOf():u;u=e(c)?c+"":c}if(typeof u!="string")return u===0?u:+u;u=t(u);var d=i.test(u);return d||s.test(u)?o(u.slice(2),d?2:8):a.test(u)?n:+u}return K0=l,K0}var Q0,nL;function qF(){if(nL)return Q0;nL=1;var t=MY(),e=1/0,r=17976931348623157e292;function n(a){if(!a)return a===0?a:0;if(a=t(a),a===e||a===-e){var i=a<0?-1:1;return i*r}return a===a?a:0}return Q0=n,Q0}var Z0,aL;function IY(){if(aL)return Z0;aL=1;var t=qF();function e(r){var n=t(r),a=n%1;return n===n?a?n-a:n:0}return Z0=e,Z0}var J0,iL;function FY(){if(iL)return J0;iL=1;var t=_F(),e=qa(),r=IY(),n=Math.max;function a(i,s,o){var l=i==null?0:i.length;if(!l)return-1;var u=o==null?0:r(o);return u<0&&(u=n(l+u,0)),t(i,e(s,3),u)}return J0=a,J0}var ex,sL;function BY(){if(sL)return ex;sL=1;var t=_Y(),e=FY(),r=t(e);return ex=r,ex}var tx,oL;function UF(){if(oL)return tx;oL=1;var t=mS();function e(r){var n=r==null?0:r.length;return n?t(r,1):[]}return tx=e,tx}var rx,lL;function zY(){if(lL)return rx;lL=1;var t=hS(),e=fF(),r=Cs();function n(a,i){return a==null?a:t(a,e(i),r)}return rx=n,rx}var nx,uL;function qY(){if(uL)return nx;uL=1;function t(e){var r=e==null?0:e.length;return r?e[r-1]:void 0}return nx=t,nx}var ax,cL;function UY(){if(cL)return ax;cL=1;var t=ph(),e=vS(),r=qa();function n(a,i){var s={};return i=r(i,3),e(a,function(o,l,u){t(s,l,i(o,l,u))}),s}return ax=n,ax}var ix,dL;function xS(){if(dL)return ix;dL=1;var t=$o();function e(r,n,a){for(var i=-1,s=r.length;++i<s;){var o=r[i],l=n(o);if(l!=null&&(u===void 0?l===l&&!t(l):a(l,u)))var u=l,c=o}return c}return ix=e,ix}var sx,fL;function $Y(){if(fL)return sx;fL=1;function t(e,r){return e>r}return sx=t,sx}var ox,hL;function VY(){if(hL)return ox;hL=1;var t=xS(),e=$Y(),r=Ns();function n(a){return a&&a.length?t(a,r,e):void 0}return ox=n,ox}var lx,vL;function $F(){if(vL)return lx;vL=1;var t=ph(),e=Bo();function r(n,a,i){(i!==void 0&&!e(n[a],i)||i===void 0&&!(a in n))&&t(n,a,i)}return lx=r,lx}var ux,pL;function GY(){if(pL)return ux;pL=1;var t=Es(),e=bh(),r=ha(),n="[object Object]",a=Function.prototype,i=Object.prototype,s=a.toString,o=i.hasOwnProperty,l=s.call(Object);function u(c){if(!r(c)||t(c)!=n)return!1;var d=e(c);if(d===null)return!0;var f=o.call(d,"constructor")&&d.constructor;return typeof f=="function"&&f instanceof f&&s.call(f)==l}return ux=u,ux}var cx,gL;function VF(){if(gL)return cx;gL=1;function t(e,r){if(!(r==="constructor"&&typeof e[r]=="function")&&r!="__proto__")return e[r]}return cx=t,cx}var dx,mL;function HY(){if(mL)return dx;mL=1;var t=Xu(),e=Cs();function r(n){return t(n,e(n))}return dx=r,dx}var fx,yL;function WY(){if(yL)return fx;yL=1;var t=$F(),e=JI(),r=lF(),n=eF(),a=cF(),i=Ku(),s=Xt(),o=jF(),l=qo(),u=Yu(),c=Rn(),d=GY(),f=Qu(),v=VF(),p=HY();function y(m,g,x,b,w,E,C){var S=v(m,x),T=v(g,x),P=C.get(T);if(P){t(m,x,P);return}var A=E?E(S,T,x+"",m,g,C):void 0,j=A===void 0;if(j){var R=s(T),O=!R&&l(T),N=!R&&!O&&f(T);A=T,R||O||N?s(S)?A=S:o(S)?A=n(S):O?(j=!1,A=e(T,!0)):N?(j=!1,A=r(T,!0)):A=[]:d(T)||i(T)?(A=S,i(S)?A=p(S):(!c(S)||u(S))&&(A=a(T))):j=!1}j&&(C.set(T,A),w(A,T,b,E,C),C.delete(T)),t(m,x,A)}return fx=y,fx}var hx,xL;function YY(){if(xL)return hx;xL=1;var t=vh(),e=$F(),r=hS(),n=WY(),a=Rn(),i=Cs(),s=VF();function o(l,u,c,d,f){l!==u&&r(u,function(v,p){if(f||(f=new t),a(v))n(l,u,p,c,o,d,f);else{var y=d?d(s(l,p),v,p+"",l,u,f):void 0;y===void 0&&(y=v),e(l,p,y)}},i)}return hx=o,hx}var vx,bL;function XY(){if(bL)return vx;bL=1;var t=Nh(),e=Th();function r(n){return t(function(a,i){var s=-1,o=i.length,l=o>1?i[o-1]:void 0,u=o>2?i[2]:void 0;for(l=n.length>3&&typeof l=="function"?(o--,l):void 0,u&&e(i[0],i[1],u)&&(l=o<3?void 0:l,o=1),a=Object(a);++s<o;){var c=i[s];c&&n(a,c,s,l)}return a})}return vx=r,vx}var px,wL;function KY(){if(wL)return px;wL=1;var t=YY(),e=XY(),r=e(function(n,a,i){t(n,a,i)});return px=r,px}var gx,EL;function GF(){if(EL)return gx;EL=1;function t(e,r){return e<r}return gx=t,gx}var mx,SL;function QY(){if(SL)return mx;SL=1;var t=xS(),e=GF(),r=Ns();function n(a){return a&&a.length?t(a,r,e):void 0}return mx=n,mx}var yx,CL;function ZY(){if(CL)return yx;CL=1;var t=xS(),e=qa(),r=GF();function n(a,i){return a&&a.length?t(a,e(i,2),r):void 0}return yx=n,yx}var xx,NL;function JY(){if(NL)return xx;NL=1;var t=Qn(),e=function(){return t.Date.now()};return xx=e,xx}var bx,TL;function e7(){if(TL)return bx;TL=1;var t=gh(),e=Sh(),r=mh(),n=Rn(),a=Zu();function i(s,o,l,u){if(!n(s))return s;o=e(o,s);for(var c=-1,d=o.length,f=d-1,v=s;v!=null&&++c<d;){var p=a(o[c]),y=l;if(p==="__proto__"||p==="constructor"||p==="prototype")return s;if(c!=f){var m=v[p];y=u?u(m,p,v):void 0,y===void 0&&(y=n(m)?m:r(o[c+1])?[]:{})}t(v,p,y),v=v[p]}return s}return bx=i,bx}var wx,RL;function t7(){if(RL)return wx;RL=1;var t=Ch(),e=e7(),r=Sh();function n(a,i,s){for(var o=-1,l=i.length,u={};++o<l;){var c=i[o],d=t(a,c);s(d,c)&&e(u,r(c,a),d)}return u}return wx=n,wx}var Ex,PL;function r7(){if(PL)return Ex;PL=1;var t=t7(),e=SF();function r(n,a){return t(n,a,function(i,s){return e(n,s)})}return Ex=r,Ex}var Sx,AL;function n7(){if(AL)return Sx;AL=1;var t=UF(),e=LF(),r=DF();function n(a){return r(e(a,void 0,t),a+"")}return Sx=n,Sx}var Cx,kL;function a7(){if(kL)return Cx;kL=1;var t=r7(),e=n7(),r=e(function(n,a){return n==null?{}:t(n,a)});return Cx=r,Cx}var Nx,LL;function i7(){if(LL)return Nx;LL=1;var t=Math.ceil,e=Math.max;function r(n,a,i,s){for(var o=-1,l=e(t((a-n)/(i||1)),0),u=Array(l);l--;)u[s?l:++o]=n,n+=i;return u}return Nx=r,Nx}var Tx,DL;function s7(){if(DL)return Tx;DL=1;var t=i7(),e=Th(),r=qF();function n(a){return function(i,s,o){return o&&typeof o!="number"&&e(i,s,o)&&(s=o=void 0),i=r(i),s===void 0?(s=i,i=0):s=r(s),o=o===void 0?i<s?1:-1:r(o),t(i,s,o,a)}}return Tx=n,Tx}var Rx,_L;function o7(){if(_L)return Rx;_L=1;var t=s7(),e=t();return Rx=e,Rx}var Px,jL;function l7(){if(jL)return Px;jL=1;function t(e,r){var n=e.length;for(e.sort(r);n--;)e[n]=e[n].value;return e}return Px=t,Px}var Ax,OL;function u7(){if(OL)return Ax;OL=1;var t=$o();function e(r,n){if(r!==n){var a=r!==void 0,i=r===null,s=r===r,o=t(r),l=n!==void 0,u=n===null,c=n===n,d=t(n);if(!u&&!d&&!o&&r>n||o&&l&&c&&!u&&!d||i&&l&&c||!a&&c||!s)return 1;if(!i&&!o&&!d&&r<n||d&&a&&s&&!i&&!o||u&&a&&s||!l&&s||!c)return-1}return 0}return Ax=e,Ax}var kx,ML;function c7(){if(ML)return kx;ML=1;var t=u7();function e(r,n,a){for(var i=-1,s=r.criteria,o=n.criteria,l=s.length,u=a.length;++i<l;){var c=t(s[i],o[i]);if(c){if(i>=u)return c;var d=a[i];return c*(d=="desc"?-1:1)}}return r.index-n.index}return kx=e,kx}var Lx,IL;function d7(){if(IL)return Lx;IL=1;var t=Eh(),e=Ch(),r=qa(),n=PF(),a=l7(),i=yh(),s=c7(),o=Ns(),l=Xt();function u(c,d,f){d.length?d=t(d,function(y){return l(y)?function(m){return e(m,y.length===1?y[0]:y)}:y}):d=[o];var v=-1;d=t(d,i(r));var p=n(c,function(y,m,g){var x=t(d,function(b){return b(y)});return{criteria:x,index:++v,value:y}});return a(p,function(y,m){return s(y,m,f)})}return Lx=u,Lx}var Dx,FL;function f7(){if(FL)return Dx;FL=1;var t=mS(),e=d7(),r=Nh(),n=Th(),a=r(function(i,s){if(i==null)return[];var o=s.length;return o>1&&n(i,s[0],s[1])?s=[]:o>2&&n(s[0],s[1],s[2])&&(s=[s[0]]),e(i,t(s,1),[])});return Dx=a,Dx}var _x,BL;function h7(){if(BL)return _x;BL=1;var t=wF(),e=0;function r(n){var a=++e;return t(n)+a}return _x=r,_x}var jx,zL;function v7(){if(zL)return jx;zL=1;function t(e,r,n){for(var a=-1,i=e.length,s=r.length,o={};++a<i;){var l=a<s?r[a]:void 0;n(o,e[a],l)}return o}return jx=t,jx}var Ox,qL;function p7(){if(qL)return Ox;qL=1;var t=gh(),e=v7();function r(n,a){return e(n||[],a||[],t)}return Ox=r,Ox}var Mx,UL;function Rt(){if(UL)return Mx;UL=1;var t;if(typeof rS=="function")try{t={cloneDeep:LY(),constant:fS(),defaults:DY(),each:vF(),filter:NF(),find:BY(),flatten:UF(),forEach:hF(),forIn:zY(),has:TF(),isUndefined:RF(),last:qY(),map:AF(),mapValues:UY(),max:VY(),merge:KY(),min:QY(),minBy:ZY(),now:JY(),pick:a7(),range:o7(),reduce:kF(),sortBy:f7(),uniqueId:h7(),values:OF(),zipObject:p7()}}catch{}return t||(t=window._),Mx=t,Mx}var Ix,$L;function g7(){if($L)return Ix;$L=1,Ix=t;function t(){var n={};n._next=n._prev=n,this._sentinel=n}t.prototype.dequeue=function(){var n=this._sentinel,a=n._prev;if(a!==n)return e(a),a},t.prototype.enqueue=function(n){var a=this._sentinel;n._prev&&n._next&&e(n),n._next=a._next,a._next._prev=n,a._next=n,n._prev=a},t.prototype.toString=function(){for(var n=[],a=this._sentinel,i=a._prev;i!==a;)n.push(JSON.stringify(i,r)),i=i._prev;return"["+n.join(", ")+"]"};function e(n){n._prev._next=n._next,n._next._prev=n._prev,delete n._next,delete n._prev}function r(n,a){if(n!=="_next"&&n!=="_prev")return a}return Ix}var Fx,VL;function m7(){if(VL)return Fx;VL=1;var t=Rt(),e=Wn().Graph,r=g7();Fx=a;var n=t.constant(1);function a(u,c){if(u.nodeCount()<=1)return[];var d=o(u,c||n),f=i(d.graph,d.buckets,d.zeroIdx);return t.flatten(t.map(f,function(v){return u.outEdges(v.v,v.w)}),!0)}function i(u,c,d){for(var f=[],v=c[c.length-1],p=c[0],y;u.nodeCount();){for(;y=p.dequeue();)s(u,c,d,y);for(;y=v.dequeue();)s(u,c,d,y);if(u.nodeCount()){for(var m=c.length-2;m>0;--m)if(y=c[m].dequeue(),y){f=f.concat(s(u,c,d,y,!0));break}}}return f}function s(u,c,d,f,v){var p=v?[]:void 0;return t.forEach(u.inEdges(f.v),function(y){var m=u.edge(y),g=u.node(y.v);v&&p.push({v:y.v,w:y.w}),g.out-=m,l(c,d,g)}),t.forEach(u.outEdges(f.v),function(y){var m=u.edge(y),g=y.w,x=u.node(g);x.in-=m,l(c,d,x)}),u.removeNode(f.v),p}function o(u,c){var d=new e,f=0,v=0;t.forEach(u.nodes(),function(m){d.setNode(m,{v:m,in:0,out:0})}),t.forEach(u.edges(),function(m){var g=d.edge(m.v,m.w)||0,x=c(m),b=g+x;d.setEdge(m.v,m.w,b),v=Math.max(v,d.node(m.v).out+=x),f=Math.max(f,d.node(m.w).in+=x)});var p=t.range(v+f+3).map(function(){return new r}),y=f+1;return t.forEach(d.nodes(),function(m){l(p,y,d.node(m))}),{graph:d,buckets:p,zeroIdx:y}}function l(u,c,d){d.out?d.in?u[d.out-d.in+c].enqueue(d):u[u.length-1].enqueue(d):u[0].enqueue(d)}return Fx}var Bx,GL;function y7(){if(GL)return Bx;GL=1;var t=Rt(),e=m7();Bx={run:r,undo:a};function r(i){var s=i.graph().acyclicer==="greedy"?e(i,o(i)):n(i);t.forEach(s,function(l){var u=i.edge(l);i.removeEdge(l),u.forwardName=l.name,u.reversed=!0,i.setEdge(l.w,l.v,u,t.uniqueId("rev"))});function o(l){return function(u){return l.edge(u).weight}}}function n(i){var s=[],o={},l={};function u(c){t.has(l,c)||(l[c]=!0,o[c]=!0,t.forEach(i.outEdges(c),function(d){t.has(o,d.w)?s.push(d):u(d.w)}),delete o[c])}return t.forEach(i.nodes(),u),s}function a(i){t.forEach(i.edges(),function(s){var o=i.edge(s);if(o.reversed){i.removeEdge(s);var l=o.forwardName;delete o.reversed,delete o.forwardName,i.setEdge(s.w,s.v,o,l)}})}return Bx}var zx,HL;function en(){if(HL)return zx;HL=1;var t=Rt(),e=Wn().Graph;zx={addDummyNode:r,simplify:n,asNonCompoundGraph:a,successorWeights:i,predecessorWeights:s,intersectRect:o,buildLayerMatrix:l,normalizeRanks:u,removeEmptyRanks:c,addBorderNode:d,maxRank:f,partition:v,time:p,notime:y};function r(m,g,x,b){var w;do w=t.uniqueId(b);while(m.hasNode(w));return x.dummy=g,m.setNode(w,x),w}function n(m){var g=new e().setGraph(m.graph());return t.forEach(m.nodes(),function(x){g.setNode(x,m.node(x))}),t.forEach(m.edges(),function(x){var b=g.edge(x.v,x.w)||{weight:0,minlen:1},w=m.edge(x);g.setEdge(x.v,x.w,{weight:b.weight+w.weight,minlen:Math.max(b.minlen,w.minlen)})}),g}function a(m){var g=new e({multigraph:m.isMultigraph()}).setGraph(m.graph());return t.forEach(m.nodes(),function(x){m.children(x).length||g.setNode(x,m.node(x))}),t.forEach(m.edges(),function(x){g.setEdge(x,m.edge(x))}),g}function i(m){var g=t.map(m.nodes(),function(x){var b={};return t.forEach(m.outEdges(x),function(w){b[w.w]=(b[w.w]||0)+m.edge(w).weight}),b});return t.zipObject(m.nodes(),g)}function s(m){var g=t.map(m.nodes(),function(x){var b={};return t.forEach(m.inEdges(x),function(w){b[w.v]=(b[w.v]||0)+m.edge(w).weight}),b});return t.zipObject(m.nodes(),g)}function o(m,g){var x=m.x,b=m.y,w=g.x-x,E=g.y-b,C=m.width/2,S=m.height/2;if(!w&&!E)throw new Error("Not possible to find intersection inside of the rectangle");var T,P;return Math.abs(E)*C>Math.abs(w)*S?(E<0&&(S=-S),T=S*w/E,P=S):(w<0&&(C=-C),T=C,P=C*E/w),{x:x+T,y:b+P}}function l(m){var g=t.map(t.range(f(m)+1),function(){return[]});return t.forEach(m.nodes(),function(x){var b=m.node(x),w=b.rank;t.isUndefined(w)||(g[w][b.order]=x)}),g}function u(m){var g=t.min(t.map(m.nodes(),function(x){return m.node(x).rank}));t.forEach(m.nodes(),function(x){var b=m.node(x);t.has(b,"rank")&&(b.rank-=g)})}function c(m){var g=t.min(t.map(m.nodes(),function(E){return m.node(E).rank})),x=[];t.forEach(m.nodes(),function(E){var C=m.node(E).rank-g;x[C]||(x[C]=[]),x[C].push(E)});var b=0,w=m.graph().nodeRankFactor;t.forEach(x,function(E,C){t.isUndefined(E)&&C%w!==0?--b:b&&t.forEach(E,function(S){m.node(S).rank+=b})})}function d(m,g,x,b){var w={width:0,height:0};return arguments.length>=4&&(w.rank=x,w.order=b),r(m,"border",w,g)}function f(m){return t.max(t.map(m.nodes(),function(g){var x=m.node(g).rank;if(!t.isUndefined(x))return x}))}function v(m,g){var x={lhs:[],rhs:[]};return t.forEach(m,function(b){g(b)?x.lhs.push(b):x.rhs.push(b)}),x}function p(m,g){var x=t.now();try{return g()}finally{console.log(m+" time: "+(t.now()-x)+"ms")}}function y(m,g){return g()}return zx}var qx,WL;function x7(){if(WL)return qx;WL=1;var t=Rt(),e=en();qx={run:r,undo:a};function r(i){i.graph().dummyChains=[],t.forEach(i.edges(),function(s){n(i,s)})}function n(i,s){var o=s.v,l=i.node(o).rank,u=s.w,c=i.node(u).rank,d=s.name,f=i.edge(s),v=f.labelRank;if(c!==l+1){i.removeEdge(s);var p,y,m;for(m=0,++l;l<c;++m,++l)f.points=[],y={width:0,height:0,edgeLabel:f,edgeObj:s,rank:l},p=e.addDummyNode(i,"edge",y,"_d"),l===v&&(y.width=f.width,y.height=f.height,y.dummy="edge-label",y.labelpos=f.labelpos),i.setEdge(o,p,{weight:f.weight},d),m===0&&i.graph().dummyChains.push(p),o=p;i.setEdge(o,u,{weight:f.weight},d)}}function a(i){t.forEach(i.graph().dummyChains,function(s){var o=i.node(s),l=o.edgeLabel,u;for(i.setEdge(o.edgeObj,l);o.dummy;)u=i.successors(s)[0],i.removeNode(s),l.points.push({x:o.x,y:o.y}),o.dummy==="edge-label"&&(l.x=o.x,l.y=o.y,l.width=o.width,l.height=o.height),s=u,o=i.node(s)})}return qx}var Ux,YL;function uf(){if(YL)return Ux;YL=1;var t=Rt();Ux={longestPath:e,slack:r};function e(n){var a={};function i(s){var o=n.node(s);if(t.has(a,s))return o.rank;a[s]=!0;var l=t.min(t.map(n.outEdges(s),function(u){return i(u.w)-n.edge(u).minlen}));return(l===Number.POSITIVE_INFINITY||l===void 0||l===null)&&(l=0),o.rank=l}t.forEach(n.sources(),i)}function r(n,a){return n.node(a.w).rank-n.node(a.v).rank-n.edge(a).minlen}return Ux}var $x,XL;function HF(){if(XL)return $x;XL=1;var t=Rt(),e=Wn().Graph,r=uf().slack;$x=n;function n(o){var l=new e({directed:!1}),u=o.nodes()[0],c=o.nodeCount();l.setNode(u,{});for(var d,f;a(l,o)<c;)d=i(l,o),f=l.hasNode(d.v)?r(o,d):-r(o,d),s(l,o,f);return l}function a(o,l){function u(c){t.forEach(l.nodeEdges(c),function(d){var f=d.v,v=c===f?d.w:f;!o.hasNode(v)&&!r(l,d)&&(o.setNode(v,{}),o.setEdge(c,v,{}),u(v))})}return t.forEach(o.nodes(),u),o.nodeCount()}function i(o,l){return t.minBy(l.edges(),function(u){if(o.hasNode(u.v)!==o.hasNode(u.w))return r(l,u)})}function s(o,l,u){t.forEach(o.nodes(),function(c){l.node(c).rank+=u})}return $x}var Vx,KL;function b7(){if(KL)return Vx;KL=1;var t=Rt(),e=HF(),r=uf().slack,n=uf().longestPath,a=Wn().alg.preorder,i=Wn().alg.postorder,s=en().simplify;Vx=o,o.initLowLimValues=d,o.initCutValues=l,o.calcCutValue=c,o.leaveEdge=v,o.enterEdge=p,o.exchangeEdges=y;function o(b){b=s(b),n(b);var w=e(b);d(w),l(w,b);for(var E,C;E=v(w);)C=p(w,b,E),y(w,b,E,C)}function l(b,w){var E=i(b,b.nodes());E=E.slice(0,E.length-1),t.forEach(E,function(C){u(b,w,C)})}function u(b,w,E){var C=b.node(E),S=C.parent;b.edge(E,S).cutvalue=c(b,w,E)}function c(b,w,E){var C=b.node(E),S=C.parent,T=!0,P=w.edge(E,S),A=0;return P||(T=!1,P=w.edge(S,E)),A=P.weight,t.forEach(w.nodeEdges(E),function(j){var R=j.v===E,O=R?j.w:j.v;if(O!==S){var N=R===T,D=w.edge(j).weight;if(A+=N?D:-D,g(b,E,O)){var L=b.edge(E,O).cutvalue;A+=N?-L:L}}}),A}function d(b,w){arguments.length<2&&(w=b.nodes()[0]),f(b,{},1,w)}function f(b,w,E,C,S){var T=E,P=b.node(C);return w[C]=!0,t.forEach(b.neighbors(C),function(A){t.has(w,A)||(E=f(b,w,E,A,C))}),P.low=T,P.lim=E++,S?P.parent=S:delete P.parent,E}function v(b){return t.find(b.edges(),function(w){return b.edge(w).cutvalue<0})}function p(b,w,E){var C=E.v,S=E.w;w.hasEdge(C,S)||(C=E.w,S=E.v);var T=b.node(C),P=b.node(S),A=T,j=!1;T.lim>P.lim&&(A=P,j=!0);var R=t.filter(w.edges(),function(O){return j===x(b,b.node(O.v),A)&&j!==x(b,b.node(O.w),A)});return t.minBy(R,function(O){return r(w,O)})}function y(b,w,E,C){var S=E.v,T=E.w;b.removeEdge(S,T),b.setEdge(C.v,C.w,{}),d(b),l(b,w),m(b,w)}function m(b,w){var E=t.find(b.nodes(),function(S){return!w.node(S).parent}),C=a(b,E);C=C.slice(1),t.forEach(C,function(S){var T=b.node(S).parent,P=w.edge(S,T),A=!1;P||(P=w.edge(T,S),A=!0),w.node(S).rank=w.node(T).rank+(A?P.minlen:-P.minlen)})}function g(b,w,E){return b.hasEdge(w,E)}function x(b,w,E){return E.low<=w.lim&&w.lim<=E.lim}return Vx}var Gx,QL;function w7(){if(QL)return Gx;QL=1;var t=uf(),e=t.longestPath,r=HF(),n=b7();Gx=a;function a(l){switch(l.graph().ranker){case"network-simplex":o(l);break;case"tight-tree":s(l);break;case"longest-path":i(l);break;default:o(l)}}var i=e;function s(l){e(l),r(l)}function o(l){n(l)}return Gx}var Hx,ZL;function E7(){if(ZL)return Hx;ZL=1;var t=Rt();Hx=e;function e(a){var i=n(a);t.forEach(a.graph().dummyChains,function(s){for(var o=a.node(s),l=o.edgeObj,u=r(a,i,l.v,l.w),c=u.path,d=u.lca,f=0,v=c[f],p=!0;s!==l.w;){if(o=a.node(s),p){for(;(v=c[f])!==d&&a.node(v).maxRank<o.rank;)f++;v===d&&(p=!1)}if(!p){for(;f<c.length-1&&a.node(v=c[f+1]).minRank<=o.rank;)f++;v=c[f]}a.setParent(s,v),s=a.successors(s)[0]}})}function r(a,i,s,o){var l=[],u=[],c=Math.min(i[s].low,i[o].low),d=Math.max(i[s].lim,i[o].lim),f,v;f=s;do f=a.parent(f),l.push(f);while(f&&(i[f].low>c||d>i[f].lim));for(v=f,f=o;(f=a.parent(f))!==v;)u.push(f);return{path:l.concat(u.reverse()),lca:v}}function n(a){var i={},s=0;function o(l){var u=s;t.forEach(a.children(l),o),i[l]={low:u,lim:s++}}return t.forEach(a.children(),o),i}return Hx}var Wx,JL;function S7(){if(JL)return Wx;JL=1;var t=Rt(),e=en();Wx={run:r,cleanup:s};function r(o){var l=e.addDummyNode(o,"root",{},"_root"),u=a(o),c=t.max(t.values(u))-1,d=2*c+1;o.graph().nestingRoot=l,t.forEach(o.edges(),function(v){o.edge(v).minlen*=d});var f=i(o)+1;t.forEach(o.children(),function(v){n(o,l,d,f,c,u,v)}),o.graph().nodeRankFactor=d}function n(o,l,u,c,d,f,v){var p=o.children(v);if(!p.length){v!==l&&o.setEdge(l,v,{weight:0,minlen:u});return}var y=e.addBorderNode(o,"_bt"),m=e.addBorderNode(o,"_bb"),g=o.node(v);o.setParent(y,v),g.borderTop=y,o.setParent(m,v),g.borderBottom=m,t.forEach(p,function(x){n(o,l,u,c,d,f,x);var b=o.node(x),w=b.borderTop?b.borderTop:x,E=b.borderBottom?b.borderBottom:x,C=b.borderTop?c:2*c,S=w!==E?1:d-f[v]+1;o.setEdge(y,w,{weight:C,minlen:S,nestingEdge:!0}),o.setEdge(E,m,{weight:C,minlen:S,nestingEdge:!0})}),o.parent(v)||o.setEdge(l,y,{weight:0,minlen:d+f[v]})}function a(o){var l={};function u(c,d){var f=o.children(c);f&&f.length&&t.forEach(f,function(v){u(v,d+1)}),l[c]=d}return t.forEach(o.children(),function(c){u(c,1)}),l}function i(o){return t.reduce(o.edges(),function(l,u){return l+o.edge(u).weight},0)}function s(o){var l=o.graph();o.removeNode(l.nestingRoot),delete l.nestingRoot,t.forEach(o.edges(),function(u){var c=o.edge(u);c.nestingEdge&&o.removeEdge(u)})}return Wx}var Yx,eD;function C7(){if(eD)return Yx;eD=1;var t=Rt(),e=en();Yx=r;function r(a){function i(s){var o=a.children(s),l=a.node(s);if(o.length&&t.forEach(o,i),t.has(l,"minRank")){l.borderLeft=[],l.borderRight=[];for(var u=l.minRank,c=l.maxRank+1;u<c;++u)n(a,"borderLeft","_bl",s,l,u),n(a,"borderRight","_br",s,l,u)}}t.forEach(a.children(),i)}function n(a,i,s,o,l,u){var c={width:0,height:0,rank:u,borderType:i},d=l[i][u-1],f=e.addDummyNode(a,"border",c,s);l[i][u]=f,a.setParent(f,o),d&&a.setEdge(d,f,{weight:1})}return Yx}var Xx,tD;function N7(){if(tD)return Xx;tD=1;var t=Rt();Xx={adjust:e,undo:r};function e(u){var c=u.graph().rankdir.toLowerCase();(c==="lr"||c==="rl")&&n(u)}function r(u){var c=u.graph().rankdir.toLowerCase();(c==="bt"||c==="rl")&&i(u),(c==="lr"||c==="rl")&&(o(u),n(u))}function n(u){t.forEach(u.nodes(),function(c){a(u.node(c))}),t.forEach(u.edges(),function(c){a(u.edge(c))})}function a(u){var c=u.width;u.width=u.height,u.height=c}function i(u){t.forEach(u.nodes(),function(c){s(u.node(c))}),t.forEach(u.edges(),function(c){var d=u.edge(c);t.forEach(d.points,s),t.has(d,"y")&&s(d)})}function s(u){u.y=-u.y}function o(u){t.forEach(u.nodes(),function(c){l(u.node(c))}),t.forEach(u.edges(),function(c){var d=u.edge(c);t.forEach(d.points,l),t.has(d,"x")&&l(d)})}function l(u){var c=u.x;u.x=u.y,u.y=c}return Xx}var Kx,rD;function T7(){if(rD)return Kx;rD=1;var t=Rt();Kx=e;function e(r){var n={},a=t.filter(r.nodes(),function(u){return!r.children(u).length}),i=t.max(t.map(a,function(u){return r.node(u).rank})),s=t.map(t.range(i+1),function(){return[]});function o(u){if(!t.has(n,u)){n[u]=!0;var c=r.node(u);s[c.rank].push(u),t.forEach(r.successors(u),o)}}var l=t.sortBy(a,function(u){return r.node(u).rank});return t.forEach(l,o),s}return Kx}var Qx,nD;function R7(){if(nD)return Qx;nD=1;var t=Rt();Qx=e;function e(n,a){for(var i=0,s=1;s<a.length;++s)i+=r(n,a[s-1],a[s]);return i}function r(n,a,i){for(var s=t.zipObject(i,t.map(i,function(f,v){return v})),o=t.flatten(t.map(a,function(f){return t.sortBy(t.map(n.outEdges(f),function(v){return{pos:s[v.w],weight:n.edge(v).weight}}),"pos")}),!0),l=1;l<i.length;)l<<=1;var u=2*l-1;l-=1;var c=t.map(new Array(u),function(){return 0}),d=0;return t.forEach(o.forEach(function(f){var v=f.pos+l;c[v]+=f.weight;for(var p=0;v>0;)v%2&&(p+=c[v+1]),v=v-1>>1,c[v]+=f.weight;d+=f.weight*p})),d}return Qx}var Zx,aD;function P7(){if(aD)return Zx;aD=1;var t=Rt();Zx=e;function e(r,n){return t.map(n,function(a){var i=r.inEdges(a);if(i.length){var s=t.reduce(i,function(o,l){var u=r.edge(l),c=r.node(l.v);return{sum:o.sum+u.weight*c.order,weight:o.weight+u.weight}},{sum:0,weight:0});return{v:a,barycenter:s.sum/s.weight,weight:s.weight}}else return{v:a}})}return Zx}var Jx,iD;function A7(){if(iD)return Jx;iD=1;var t=Rt();Jx=e;function e(a,i){var s={};t.forEach(a,function(l,u){var c=s[l.v]={indegree:0,in:[],out:[],vs:[l.v],i:u};t.isUndefined(l.barycenter)||(c.barycenter=l.barycenter,c.weight=l.weight)}),t.forEach(i.edges(),function(l){var u=s[l.v],c=s[l.w];!t.isUndefined(u)&&!t.isUndefined(c)&&(c.indegree++,u.out.push(s[l.w]))});var o=t.filter(s,function(l){return!l.indegree});return r(o)}function r(a){var i=[];function s(u){return function(c){c.merged||(t.isUndefined(c.barycenter)||t.isUndefined(u.barycenter)||c.barycenter>=u.barycenter)&&n(u,c)}}function o(u){return function(c){c.in.push(u),--c.indegree===0&&a.push(c)}}for(;a.length;){var l=a.pop();i.push(l),t.forEach(l.in.reverse(),s(l)),t.forEach(l.out,o(l))}return t.map(t.filter(i,function(u){return!u.merged}),function(u){return t.pick(u,["vs","i","barycenter","weight"])})}function n(a,i){var s=0,o=0;a.weight&&(s+=a.barycenter*a.weight,o+=a.weight),i.weight&&(s+=i.barycenter*i.weight,o+=i.weight),a.vs=i.vs.concat(a.vs),a.barycenter=s/o,a.weight=o,a.i=Math.min(i.i,a.i),i.merged=!0}return Jx}var eb,sD;function k7(){if(sD)return eb;sD=1;var t=Rt(),e=en();eb=r;function r(i,s){var o=e.partition(i,function(y){return t.has(y,"barycenter")}),l=o.lhs,u=t.sortBy(o.rhs,function(y){return-y.i}),c=[],d=0,f=0,v=0;l.sort(a(!!s)),v=n(c,u,v),t.forEach(l,function(y){v+=y.vs.length,c.push(y.vs),d+=y.barycenter*y.weight,f+=y.weight,v=n(c,u,v)});var p={vs:t.flatten(c,!0)};return f&&(p.barycenter=d/f,p.weight=f),p}function n(i,s,o){for(var l;s.length&&(l=t.last(s)).i<=o;)s.pop(),i.push(l.vs),o++;return o}function a(i){return function(s,o){return s.barycenter<o.barycenter?-1:s.barycenter>o.barycenter?1:i?o.i-s.i:s.i-o.i}}return eb}var tb,oD;function L7(){if(oD)return tb;oD=1;var t=Rt(),e=P7(),r=A7(),n=k7();tb=a;function a(o,l,u,c){var d=o.children(l),f=o.node(l),v=f?f.borderLeft:void 0,p=f?f.borderRight:void 0,y={};v&&(d=t.filter(d,function(E){return E!==v&&E!==p}));var m=e(o,d);t.forEach(m,function(E){if(o.children(E.v).length){var C=a(o,E.v,u,c);y[E.v]=C,t.has(C,"barycenter")&&s(E,C)}});var g=r(m,u);i(g,y);var x=n(g,c);if(v&&(x.vs=t.flatten([v,x.vs,p],!0),o.predecessors(v).length)){var b=o.node(o.predecessors(v)[0]),w=o.node(o.predecessors(p)[0]);t.has(x,"barycenter")||(x.barycenter=0,x.weight=0),x.barycenter=(x.barycenter*x.weight+b.order+w.order)/(x.weight+2),x.weight+=2}return x}function i(o,l){t.forEach(o,function(u){u.vs=t.flatten(u.vs.map(function(c){return l[c]?l[c].vs:c}),!0)})}function s(o,l){t.isUndefined(o.barycenter)?(o.barycenter=l.barycenter,o.weight=l.weight):(o.barycenter=(o.barycenter*o.weight+l.barycenter*l.weight)/(o.weight+l.weight),o.weight+=l.weight)}return tb}var rb,lD;function D7(){if(lD)return rb;lD=1;var t=Rt(),e=Wn().Graph;rb=r;function r(a,i,s){var o=n(a),l=new e({compound:!0}).setGraph({root:o}).setDefaultNodeLabel(function(u){return a.node(u)});return t.forEach(a.nodes(),function(u){var c=a.node(u),d=a.parent(u);(c.rank===i||c.minRank<=i&&i<=c.maxRank)&&(l.setNode(u),l.setParent(u,d||o),t.forEach(a[s](u),function(f){var v=f.v===u?f.w:f.v,p=l.edge(v,u),y=t.isUndefined(p)?0:p.weight;l.setEdge(v,u,{weight:a.edge(f).weight+y})}),t.has(c,"minRank")&&l.setNode(u,{borderLeft:c.borderLeft[i],borderRight:c.borderRight[i]}))}),l}function n(a){for(var i;a.hasNode(i=t.uniqueId("_root")););return i}return rb}var nb,uD;function _7(){if(uD)return nb;uD=1;var t=Rt();nb=e;function e(r,n,a){var i={},s;t.forEach(a,function(o){for(var l=r.parent(o),u,c;l;){if(u=r.parent(l),u?(c=i[u],i[u]=l):(c=s,s=l),c&&c!==l){n.setEdge(c,l);return}l=u}})}return nb}var ab,cD;function j7(){if(cD)return ab;cD=1;var t=Rt(),e=T7(),r=R7(),n=L7(),a=D7(),i=_7(),s=Wn().Graph,o=en();ab=l;function l(f){var v=o.maxRank(f),p=u(f,t.range(1,v+1),"inEdges"),y=u(f,t.range(v-1,-1,-1),"outEdges"),m=e(f);d(f,m);for(var g=Number.POSITIVE_INFINITY,x,b=0,w=0;w<4;++b,++w){c(b%2?p:y,b%4>=2),m=o.buildLayerMatrix(f);var E=r(f,m);E<g&&(w=0,x=t.cloneDeep(m),g=E)}d(f,x)}function u(f,v,p){return t.map(v,function(y){return a(f,y,p)})}function c(f,v){var p=new s;t.forEach(f,function(y){var m=y.graph().root,g=n(y,m,p,v);t.forEach(g.vs,function(x,b){y.node(x).order=b}),i(y,p,g.vs)})}function d(f,v){t.forEach(v,function(p){t.forEach(p,function(y,m){f.node(y).order=m})})}return ab}var ib,dD;function O7(){if(dD)return ib;dD=1;var t=Rt(),e=Wn().Graph,r=en();ib={positionX:p,findType1Conflicts:n,findType2Conflicts:a,addConflict:s,hasConflict:o,verticalAlignment:l,horizontalCompaction:u,alignCoordinates:f,findSmallestWidthAlignment:d,balance:v};function n(g,x){var b={};function w(E,C){var S=0,T=0,P=E.length,A=t.last(C);return t.forEach(C,function(j,R){var O=i(g,j),N=O?g.node(O).order:P;(O||j===A)&&(t.forEach(C.slice(T,R+1),function(D){t.forEach(g.predecessors(D),function(L){var _=g.node(L),k=_.order;(k<S||N<k)&&!(_.dummy&&g.node(D).dummy)&&s(b,L,D)})}),T=R+1,S=N)}),C}return t.reduce(x,w),b}function a(g,x){var b={};function w(C,S,T,P,A){var j;t.forEach(t.range(S,T),function(R){j=C[R],g.node(j).dummy&&t.forEach(g.predecessors(j),function(O){var N=g.node(O);N.dummy&&(N.order<P||N.order>A)&&s(b,O,j)})})}function E(C,S){var T=-1,P,A=0;return t.forEach(S,function(j,R){if(g.node(j).dummy==="border"){var O=g.predecessors(j);O.length&&(P=g.node(O[0]).order,w(S,A,R,T,P),A=R,T=P)}w(S,A,S.length,P,C.length)}),S}return t.reduce(x,E),b}function i(g,x){if(g.node(x).dummy)return t.find(g.predecessors(x),function(b){return g.node(b).dummy})}function s(g,x,b){if(x>b){var w=x;x=b,b=w}var E=g[x];E||(g[x]=E={}),E[b]=!0}function o(g,x,b){if(x>b){var w=x;x=b,b=w}return t.has(g[x],b)}function l(g,x,b,w){var E={},C={},S={};return t.forEach(x,function(T){t.forEach(T,function(P,A){E[P]=P,C[P]=P,S[P]=A})}),t.forEach(x,function(T){var P=-1;t.forEach(T,function(A){var j=w(A);if(j.length){j=t.sortBy(j,function(L){return S[L]});for(var R=(j.length-1)/2,O=Math.floor(R),N=Math.ceil(R);O<=N;++O){var D=j[O];C[A]===A&&P<S[D]&&!o(b,A,D)&&(C[D]=A,C[A]=E[A]=E[D],P=S[D])}}})}),{root:E,align:C}}function u(g,x,b,w,E){var C={},S=c(g,x,b,E),T=E?"borderLeft":"borderRight";function P(R,O){for(var N=S.nodes(),D=N.pop(),L={};D;)L[D]?R(D):(L[D]=!0,N.push(D),N=N.concat(O(D))),D=N.pop()}function A(R){C[R]=S.inEdges(R).reduce(function(O,N){return Math.max(O,C[N.v]+S.edge(N))},0)}function j(R){var O=S.outEdges(R).reduce(function(D,L){return Math.min(D,C[L.w]-S.edge(L))},Number.POSITIVE_INFINITY),N=g.node(R);O!==Number.POSITIVE_INFINITY&&N.borderType!==T&&(C[R]=Math.max(C[R],O))}return P(A,S.predecessors.bind(S)),P(j,S.successors.bind(S)),t.forEach(w,function(R){C[R]=C[b[R]]}),C}function c(g,x,b,w){var E=new e,C=g.graph(),S=y(C.nodesep,C.edgesep,w);return t.forEach(x,function(T){var P;t.forEach(T,function(A){var j=b[A];if(E.setNode(j),P){var R=b[P],O=E.edge(R,j);E.setEdge(R,j,Math.max(S(g,A,P),O||0))}P=A})}),E}function d(g,x){return t.minBy(t.values(x),function(b){var w=Number.NEGATIVE_INFINITY,E=Number.POSITIVE_INFINITY;return t.forIn(b,function(C,S){var T=m(g,S)/2;w=Math.max(C+T,w),E=Math.min(C-T,E)}),w-E})}function f(g,x){var b=t.values(x),w=t.min(b),E=t.max(b);t.forEach(["u","d"],function(C){t.forEach(["l","r"],function(S){var T=C+S,P=g[T],A;if(P!==x){var j=t.values(P);A=S==="l"?w-t.min(j):E-t.max(j),A&&(g[T]=t.mapValues(P,function(R){return R+A}))}})})}function v(g,x){return t.mapValues(g.ul,function(b,w){if(x)return g[x.toLowerCase()][w];var E=t.sortBy(t.map(g,w));return(E[1]+E[2])/2})}function p(g){var x=r.buildLayerMatrix(g),b=t.merge(n(g,x),a(g,x)),w={},E;t.forEach(["u","d"],function(S){E=S==="u"?x:t.values(x).reverse(),t.forEach(["l","r"],function(T){T==="r"&&(E=t.map(E,function(R){return t.values(R).reverse()}));var P=(S==="u"?g.predecessors:g.successors).bind(g),A=l(g,E,b,P),j=u(g,E,A.root,A.align,T==="r");T==="r"&&(j=t.mapValues(j,function(R){return-R})),w[S+T]=j})});var C=d(g,w);return f(w,C),v(w,g.graph().align)}function y(g,x,b){return function(w,E,C){var S=w.node(E),T=w.node(C),P=0,A;if(P+=S.width/2,t.has(S,"labelpos"))switch(S.labelpos.toLowerCase()){case"l":A=-S.width/2;break;case"r":A=S.width/2;break}if(A&&(P+=b?A:-A),A=0,P+=(S.dummy?x:g)/2,P+=(T.dummy?x:g)/2,P+=T.width/2,t.has(T,"labelpos"))switch(T.labelpos.toLowerCase()){case"l":A=T.width/2;break;case"r":A=-T.width/2;break}return A&&(P+=b?A:-A),A=0,P}}function m(g,x){return g.node(x).width}return ib}var sb,fD;function M7(){if(fD)return sb;fD=1;var t=Rt(),e=en(),r=O7().positionX;sb=n;function n(i){i=e.asNonCompoundGraph(i),a(i),t.forEach(r(i),function(s,o){i.node(o).x=s})}function a(i){var s=e.buildLayerMatrix(i),o=i.graph().ranksep,l=0;t.forEach(s,function(u){var c=t.max(t.map(u,function(d){return i.node(d).height}));t.forEach(u,function(d){i.node(d).y=l+c/2}),l+=c+o})}return sb}var ob,hD;function I7(){if(hD)return ob;hD=1;var t=Rt(),e=y7(),r=x7(),n=w7(),a=en().normalizeRanks,i=E7(),s=en().removeEmptyRanks,o=S7(),l=C7(),u=N7(),c=j7(),d=M7(),f=en(),v=Wn().Graph;ob=p;function p(z,q){var G=q&&q.debugTiming?f.time:f.notime;G("layout",function(){var J=G(" buildLayoutGraph",function(){return P(z)});G(" runLayout",function(){y(J,G)}),G(" updateInputGraph",function(){m(z,J)})})}function y(z,q){q(" makeSpaceForEdgeLabels",function(){A(z)}),q(" removeSelfEdges",function(){I(z)}),q(" acyclic",function(){e.run(z)}),q(" nestingGraph.run",function(){o.run(z)}),q(" rank",function(){n(f.asNonCompoundGraph(z))}),q(" injectEdgeLabelProxies",function(){j(z)}),q(" removeEmptyRanks",function(){s(z)}),q(" nestingGraph.cleanup",function(){o.cleanup(z)}),q(" normalizeRanks",function(){a(z)}),q(" assignRankMinMax",function(){R(z)}),q(" removeEdgeLabelProxies",function(){O(z)}),q(" normalize.run",function(){r.run(z)}),q(" parentDummyChains",function(){i(z)}),q(" addBorderSegments",function(){l(z)}),q(" order",function(){c(z)}),q(" insertSelfEdges",function(){F(z)}),q(" adjustCoordinateSystem",function(){u.adjust(z)}),q(" position",function(){d(z)}),q(" positionSelfEdges",function(){B(z)}),q(" removeBorderNodes",function(){k(z)}),q(" normalize.undo",function(){r.undo(z)}),q(" fixupEdgeLabelCoords",function(){L(z)}),q(" undoCoordinateSystem",function(){u.undo(z)}),q(" translateGraph",function(){N(z)}),q(" assignNodeIntersects",function(){D(z)}),q(" reversePoints",function(){_(z)}),q(" acyclic.undo",function(){e.undo(z)})}function m(z,q){t.forEach(z.nodes(),function(G){var J=z.node(G),ae=q.node(G);J&&(J.x=ae.x,J.y=ae.y,q.children(G).length&&(J.width=ae.width,J.height=ae.height))}),t.forEach(z.edges(),function(G){var J=z.edge(G),ae=q.edge(G);J.points=ae.points,t.has(ae,"x")&&(J.x=ae.x,J.y=ae.y)}),z.graph().width=q.graph().width,z.graph().height=q.graph().height}var g=["nodesep","edgesep","ranksep","marginx","marginy"],x={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},b=["acyclicer","ranker","rankdir","align"],w=["width","height"],E={width:0,height:0},C=["minlen","weight","width","height","labeloffset"],S={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},T=["labelpos"];function P(z){var q=new v({multigraph:!0,compound:!0}),G=W(z.graph());return q.setGraph(t.merge({},x,$(G,g),t.pick(G,b))),t.forEach(z.nodes(),function(J){var ae=W(z.node(J));q.setNode(J,t.defaults($(ae,w),E)),q.setParent(J,z.parent(J))}),t.forEach(z.edges(),function(J){var ae=W(z.edge(J));q.setEdge(J,t.merge({},S,$(ae,C),t.pick(ae,T)))}),q}function A(z){var q=z.graph();q.ranksep/=2,t.forEach(z.edges(),function(G){var J=z.edge(G);J.minlen*=2,J.labelpos.toLowerCase()!=="c"&&(q.rankdir==="TB"||q.rankdir==="BT"?J.width+=J.labeloffset:J.height+=J.labeloffset)})}function j(z){t.forEach(z.edges(),function(q){var G=z.edge(q);if(G.width&&G.height){var J=z.node(q.v),ae=z.node(q.w),Y={rank:(ae.rank-J.rank)/2+J.rank,e:q};f.addDummyNode(z,"edge-proxy",Y,"_ep")}})}function R(z){var q=0;t.forEach(z.nodes(),function(G){var J=z.node(G);J.borderTop&&(J.minRank=z.node(J.borderTop).rank,J.maxRank=z.node(J.borderBottom).rank,q=t.max(q,J.maxRank))}),z.graph().maxRank=q}function O(z){t.forEach(z.nodes(),function(q){var G=z.node(q);G.dummy==="edge-proxy"&&(z.edge(G.e).labelRank=G.rank,z.removeNode(q))})}function N(z){var q=Number.POSITIVE_INFINITY,G=0,J=Number.POSITIVE_INFINITY,ae=0,Y=z.graph(),H=Y.marginx||0,X=Y.marginy||0;function ee(ie){var oe=ie.x,me=ie.y,De=ie.width,ge=ie.height;q=Math.min(q,oe-De/2),G=Math.max(G,oe+De/2),J=Math.min(J,me-ge/2),ae=Math.max(ae,me+ge/2)}t.forEach(z.nodes(),function(ie){ee(z.node(ie))}),t.forEach(z.edges(),function(ie){var oe=z.edge(ie);t.has(oe,"x")&&ee(oe)}),q-=H,J-=X,t.forEach(z.nodes(),function(ie){var oe=z.node(ie);oe.x-=q,oe.y-=J}),t.forEach(z.edges(),function(ie){var oe=z.edge(ie);t.forEach(oe.points,function(me){me.x-=q,me.y-=J}),t.has(oe,"x")&&(oe.x-=q),t.has(oe,"y")&&(oe.y-=J)}),Y.width=G-q+H,Y.height=ae-J+X}function D(z){t.forEach(z.edges(),function(q){var G=z.edge(q),J=z.node(q.v),ae=z.node(q.w),Y,H;G.points?(Y=G.points[0],H=G.points[G.points.length-1]):(G.points=[],Y=ae,H=J),G.points.unshift(f.intersectRect(J,Y)),G.points.push(f.intersectRect(ae,H))})}function L(z){t.forEach(z.edges(),function(q){var G=z.edge(q);if(t.has(G,"x"))switch((G.labelpos==="l"||G.labelpos==="r")&&(G.width-=G.labeloffset),G.labelpos){case"l":G.x-=G.width/2+G.labeloffset;break;case"r":G.x+=G.width/2+G.labeloffset;break}})}function _(z){t.forEach(z.edges(),function(q){var G=z.edge(q);G.reversed&&G.points.reverse()})}function k(z){t.forEach(z.nodes(),function(q){if(z.children(q).length){var G=z.node(q),J=z.node(G.borderTop),ae=z.node(G.borderBottom),Y=z.node(t.last(G.borderLeft)),H=z.node(t.last(G.borderRight));G.width=Math.abs(H.x-Y.x),G.height=Math.abs(ae.y-J.y),G.x=Y.x+G.width/2,G.y=J.y+G.height/2}}),t.forEach(z.nodes(),function(q){z.node(q).dummy==="border"&&z.removeNode(q)})}function I(z){t.forEach(z.edges(),function(q){if(q.v===q.w){var G=z.node(q.v);G.selfEdges||(G.selfEdges=[]),G.selfEdges.push({e:q,label:z.edge(q)}),z.removeEdge(q)}})}function F(z){var q=f.buildLayerMatrix(z);t.forEach(q,function(G){var J=0;t.forEach(G,function(ae,Y){var H=z.node(ae);H.order=Y+J,t.forEach(H.selfEdges,function(X){f.addDummyNode(z,"selfedge",{width:X.label.width,height:X.label.height,rank:H.rank,order:Y+ ++J,e:X.e,label:X.label},"_se")}),delete H.selfEdges})})}function B(z){t.forEach(z.nodes(),function(q){var G=z.node(q);if(G.dummy==="selfedge"){var J=z.node(G.e.v),ae=J.x+J.width/2,Y=J.y,H=G.x-ae,X=J.height/2;z.setEdge(G.e,G.label),z.removeNode(q),G.label.points=[{x:ae+2*H/3,y:Y-X},{x:ae+5*H/6,y:Y-X},{x:ae+H,y:Y},{x:ae+5*H/6,y:Y+X},{x:ae+2*H/3,y:Y+X}],G.label.x=G.x,G.label.y=G.y}})}function $(z,q){return t.mapValues(t.pick(z,q),Number)}function W(z){var q={};return t.forEach(z,function(G,J){q[J.toLowerCase()]=G}),q}return ob}var lb,vD;function F7(){if(vD)return lb;vD=1;var t=Rt(),e=en(),r=Wn().Graph;lb={debugOrdering:n};function n(a){var i=e.buildLayerMatrix(a),s=new r({compound:!0,multigraph:!0}).setGraph({});return t.forEach(a.nodes(),function(o){s.setNode(o,{label:o}),s.setParent(o,"layer"+a.node(o).rank)}),t.forEach(a.edges(),function(o){s.setEdge(o.v,o.w,{},o.name)}),t.forEach(i,function(o,l){var u="layer"+l;s.setNode(u,{rank:"same"}),t.reduce(o,function(c,d){return s.setEdge(c,d,{style:"invis"}),d})}),s}return lb}var ub,pD;function B7(){return pD||(pD=1,ub="0.8.5"),ub}var cb,gD;function z7(){return gD||(gD=1,cb={graphlib:Wn(),layout:I7(),debug:F7(),util:{time:en().time,notime:en().notime},version:B7()}),cb}(function(t,e){(function(n,a){t.exports=a(z7())})(Ja,function(r){return function(n){var a={};function i(s){if(a[s])return a[s].exports;var o=a[s]={i:s,l:!1,exports:{}};return n[s].call(o.exports,o,o.exports,i),o.l=!0,o.exports}return i.m=n,i.c=a,i.d=function(s,o,l){i.o(s,o)||Object.defineProperty(s,o,{enumerable:!0,get:l})},i.r=function(s){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(s,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(s,"__esModule",{value:!0})},i.t=function(s,o){if(o&1&&(s=i(s)),o&8||o&4&&typeof s=="object"&&s&&s.__esModule)return s;var l=Object.create(null);if(i.r(l),Object.defineProperty(l,"default",{enumerable:!0,value:s}),o&2&&typeof s!="string")for(var u in s)i.d(l,u,(function(c){return s[c]}).bind(null,u));return l},i.n=function(s){var o=s&&s.__esModule?function(){return s.default}:function(){return s};return i.d(o,"a",o),o},i.o=function(s,o){return Object.prototype.hasOwnProperty.call(s,o)},i.p="",i(i.s=0)}([function(n,a,i){var s=i(1),o=function(u){u&&u("layout","dagre",s)};typeof cytoscape<"u"&&o(cytoscape),n.exports=o},function(n,a,i){function s(f){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?s=function(p){return typeof p}:s=function(p){return p&&typeof Symbol=="function"&&p.constructor===Symbol&&p!==Symbol.prototype?"symbol":typeof p},s(f)}var o=function(v){return typeof v=="function"},l=i(2),u=i(3),c=i(4);function d(f){this.options=u({},l,f)}d.prototype.run=function(){var f=this.options,v=this,p=f.cy,y=f.eles,m=function(B,$){return o($)?$.apply(B,[B]):$},g=f.boundingBox||{x1:0,y1:0,w:p.width(),h:p.height()};g.x2===void 0&&(g.x2=g.x1+g.w),g.w===void 0&&(g.w=g.x2-g.x1),g.y2===void 0&&(g.y2=g.y1+g.h),g.h===void 0&&(g.h=g.y2-g.y1);var x=new c.graphlib.Graph({multigraph:!0,compound:!0}),b={},w=function(B,$){$!=null&&(b[B]=$)};w("nodesep",f.nodeSep),w("edgesep",f.edgeSep),w("ranksep",f.rankSep),w("rankdir",f.rankDir),w("align",f.align),w("ranker",f.ranker),w("acyclicer",f.acyclicer),x.setGraph(b),x.setDefaultEdgeLabel(function(){return{}}),x.setDefaultNodeLabel(function(){return{}});var E=y.nodes();o(f.sort)&&(E=E.sort(f.sort));for(var C=0;C<E.length;C++){var S=E[C],T=S.layoutDimensions(f);x.setNode(S.id(),{width:T.w,height:T.h,name:S.id()})}for(var P=0;P<E.length;P++){var A=E[P];A.isChild()&&x.setParent(A.id(),A.parent().id())}var j=y.edges().stdFilter(function(F){return!F.source().isParent()&&!F.target().isParent()});o(f.sort)&&(j=j.sort(f.sort));for(var R=0;R<j.length;R++){var O=j[R];x.setEdge(O.source().id(),O.target().id(),{minlen:m(O,f.minLen),weight:m(O,f.edgeWeight),name:O.id()},O.id())}c.layout(x);for(var N=x.nodes(),D=0;D<N.length;D++){var L=N[D],_=x.node(L);p.getElementById(L).scratch().dagre=_}var k;f.boundingBox?(k={x1:1/0,x2:-1/0,y1:1/0,y2:-1/0},E.forEach(function(F){var B=F.scratch().dagre;k.x1=Math.min(k.x1,B.x),k.x2=Math.max(k.x2,B.x),k.y1=Math.min(k.y1,B.y),k.y2=Math.max(k.y2,B.y)}),k.w=k.x2-k.x1,k.h=k.y2-k.y1):k=g;var I=function(B){if(f.boundingBox){var $=k.w===0?0:(B.x-k.x1)/k.w,W=k.h===0?0:(B.y-k.y1)/k.h;return{x:g.x1+$*g.w,y:g.y1+W*g.h}}else return B};return E.layoutPositions(v,f,function(F){F=s(F)==="object"?F:this;var B=F.scratch().dagre;return I({x:B.x,y:B.y})}),this},n.exports=d},function(n,a){var i={nodeSep:void 0,edgeSep:void 0,rankSep:void 0,rankDir:void 0,align:void 0,acyclicer:void 0,ranker:void 0,minLen:function(o){return 1},edgeWeight:function(o){return 1},fit:!0,padding:30,spacingFactor:void 0,nodeDimensionsIncludeLabels:!1,animate:!1,animateFilter:function(o,l){return!0},animationDuration:500,animationEasing:void 0,boundingBox:void 0,transform:function(o,l){return l},ready:function(){},sort:void 0,stop:function(){}};n.exports=i},function(n,a){n.exports=Object.assign!=null?Object.assign.bind(Object):function(i){for(var s=arguments.length,o=new Array(s>1?s-1:0),l=1;l<s;l++)o[l-1]=arguments[l];return o.forEach(function(u){Object.keys(u).forEach(function(c){return i[c]=u[c]})}),i}},function(n,a){n.exports=r}])})})(WI);var q7=WI.exports;const U7=Sw(q7);var WF={exports:{}},db={exports:{}},fb={exports:{}},mD;function $7(){return mD||(mD=1,function(t,e){(function(n,a){t.exports=a()})(Ja,function(){return function(r){var n={};function a(i){if(n[i])return n[i].exports;var s=n[i]={i,l:!1,exports:{}};return r[i].call(s.exports,s,s.exports,a),s.l=!0,s.exports}return a.m=r,a.c=n,a.i=function(i){return i},a.d=function(i,s,o){a.o(i,s)||Object.defineProperty(i,s,{configurable:!1,enumerable:!0,get:o})},a.n=function(i){var s=i&&i.__esModule?function(){return i.default}:function(){return i};return a.d(s,"a",s),s},a.o=function(i,s){return Object.prototype.hasOwnProperty.call(i,s)},a.p="",a(a.s=28)}([function(r,n,a){function i(){}i.QUALITY=1,i.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,i.DEFAULT_INCREMENTAL=!1,i.DEFAULT_ANIMATION_ON_LAYOUT=!0,i.DEFAULT_ANIMATION_DURING_LAYOUT=!1,i.DEFAULT_ANIMATION_PERIOD=50,i.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,i.DEFAULT_GRAPH_MARGIN=15,i.NODE_DIMENSIONS_INCLUDE_LABELS=!1,i.SIMPLE_NODE_SIZE=40,i.SIMPLE_NODE_HALF_SIZE=i.SIMPLE_NODE_SIZE/2,i.EMPTY_COMPOUND_NODE_SIZE=40,i.MIN_EDGE_LENGTH=1,i.WORLD_BOUNDARY=1e6,i.INITIAL_WORLD_BOUNDARY=i.WORLD_BOUNDARY/1e3,i.WORLD_CENTER_X=1200,i.WORLD_CENTER_Y=900,r.exports=i},function(r,n,a){var i=a(2),s=a(8),o=a(9);function l(c,d,f){i.call(this,f),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=f,this.bendpoints=[],this.source=c,this.target=d}l.prototype=Object.create(i.prototype);for(var u in i)l[u]=i[u];l.prototype.getSource=function(){return this.source},l.prototype.getTarget=function(){return this.target},l.prototype.isInterGraph=function(){return this.isInterGraph},l.prototype.getLength=function(){return this.length},l.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},l.prototype.getBendpoints=function(){return this.bendpoints},l.prototype.getLca=function(){return this.lca},l.prototype.getSourceInLca=function(){return this.sourceInLca},l.prototype.getTargetInLca=function(){return this.targetInLca},l.prototype.getOtherEnd=function(c){if(this.source===c)return this.target;if(this.target===c)return this.source;throw"Node is not incident with this edge"},l.prototype.getOtherEndInGraph=function(c,d){for(var f=this.getOtherEnd(c),v=d.getGraphManager().getRoot();;){if(f.getOwner()==d)return f;if(f.getOwner()==v)break;f=f.getOwner().getParent()}return null},l.prototype.updateLength=function(){var c=new Array(4);this.isOverlapingSourceAndTarget=s.getIntersection(this.target.getRect(),this.source.getRect(),c),this.isOverlapingSourceAndTarget||(this.lengthX=c[0]-c[2],this.lengthY=c[1]-c[3],Math.abs(this.lengthX)<1&&(this.lengthX=o.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=o.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY))},l.prototype.updateLengthSimple=function(){this.lengthX=this.target.getCenterX()-this.source.getCenterX(),this.lengthY=this.target.getCenterY()-this.source.getCenterY(),Math.abs(this.lengthX)<1&&(this.lengthX=o.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=o.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},r.exports=l},function(r,n,a){function i(s){this.vGraphObject=s}r.exports=i},function(r,n,a){var i=a(2),s=a(10),o=a(13),l=a(0),u=a(16),c=a(5);function d(v,p,y,m){y==null&&m==null&&(m=p),i.call(this,m),v.graphManager!=null&&(v=v.graphManager),this.estimatedSize=s.MIN_VALUE,this.inclusionTreeDepth=s.MAX_VALUE,this.vGraphObject=m,this.edges=[],this.graphManager=v,y!=null&&p!=null?this.rect=new o(p.x,p.y,y.width,y.height):this.rect=new o}d.prototype=Object.create(i.prototype);for(var f in i)d[f]=i[f];d.prototype.getEdges=function(){return this.edges},d.prototype.getChild=function(){return this.child},d.prototype.getOwner=function(){return this.owner},d.prototype.getWidth=function(){return this.rect.width},d.prototype.setWidth=function(v){this.rect.width=v},d.prototype.getHeight=function(){return this.rect.height},d.prototype.setHeight=function(v){this.rect.height=v},d.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},d.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},d.prototype.getCenter=function(){return new c(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},d.prototype.getLocation=function(){return new c(this.rect.x,this.rect.y)},d.prototype.getRect=function(){return this.rect},d.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},d.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},d.prototype.setRect=function(v,p){this.rect.x=v.x,this.rect.y=v.y,this.rect.width=p.width,this.rect.height=p.height},d.prototype.setCenter=function(v,p){this.rect.x=v-this.rect.width/2,this.rect.y=p-this.rect.height/2},d.prototype.setLocation=function(v,p){this.rect.x=v,this.rect.y=p},d.prototype.moveBy=function(v,p){this.rect.x+=v,this.rect.y+=p},d.prototype.getEdgeListToNode=function(v){var p=[],y=this;return y.edges.forEach(function(m){if(m.target==v){if(m.source!=y)throw"Incorrect edge source!";p.push(m)}}),p},d.prototype.getEdgesBetween=function(v){var p=[],y=this;return y.edges.forEach(function(m){if(!(m.source==y||m.target==y))throw"Incorrect edge source and/or target";(m.target==v||m.source==v)&&p.push(m)}),p},d.prototype.getNeighborsList=function(){var v=new Set,p=this;return p.edges.forEach(function(y){if(y.source==p)v.add(y.target);else{if(y.target!=p)throw"Incorrect incidency!";v.add(y.source)}}),v},d.prototype.withChildren=function(){var v=new Set,p,y;if(v.add(this),this.child!=null)for(var m=this.child.getNodes(),g=0;g<m.length;g++)p=m[g],y=p.withChildren(),y.forEach(function(x){v.add(x)});return v},d.prototype.getNoOfChildren=function(){var v=0,p;if(this.child==null)v=1;else for(var y=this.child.getNodes(),m=0;m<y.length;m++)p=y[m],v+=p.getNoOfChildren();return v==0&&(v=1),v},d.prototype.getEstimatedSize=function(){if(this.estimatedSize==s.MIN_VALUE)throw"assert failed";return this.estimatedSize},d.prototype.calcEstimatedSize=function(){return this.child==null?this.estimatedSize=(this.rect.width+this.rect.height)/2:(this.estimatedSize=this.child.calcEstimatedSize(),this.rect.width=this.estimatedSize,this.rect.height=this.estimatedSize,this.estimatedSize)},d.prototype.scatter=function(){var v,p,y=-l.INITIAL_WORLD_BOUNDARY,m=l.INITIAL_WORLD_BOUNDARY;v=l.WORLD_CENTER_X+u.nextDouble()*(m-y)+y;var g=-l.INITIAL_WORLD_BOUNDARY,x=l.INITIAL_WORLD_BOUNDARY;p=l.WORLD_CENTER_Y+u.nextDouble()*(x-g)+g,this.rect.x=v,this.rect.y=p},d.prototype.updateBounds=function(){if(this.getChild()==null)throw"assert failed";if(this.getChild().getNodes().length!=0){var v=this.getChild();if(v.updateBounds(!0),this.rect.x=v.getLeft(),this.rect.y=v.getTop(),this.setWidth(v.getRight()-v.getLeft()),this.setHeight(v.getBottom()-v.getTop()),l.NODE_DIMENSIONS_INCLUDE_LABELS){var p=v.getRight()-v.getLeft(),y=v.getBottom()-v.getTop();this.labelWidth&&(this.labelPosHorizontal=="left"?(this.rect.x-=this.labelWidth,this.setWidth(p+this.labelWidth)):this.labelPosHorizontal=="center"&&this.labelWidth>p?(this.rect.x-=(this.labelWidth-p)/2,this.setWidth(this.labelWidth)):this.labelPosHorizontal=="right"&&this.setWidth(p+this.labelWidth)),this.labelHeight&&(this.labelPosVertical=="top"?(this.rect.y-=this.labelHeight,this.setHeight(y+this.labelHeight)):this.labelPosVertical=="center"&&this.labelHeight>y?(this.rect.y-=(this.labelHeight-y)/2,this.setHeight(this.labelHeight)):this.labelPosVertical=="bottom"&&this.setHeight(y+this.labelHeight))}}},d.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==s.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},d.prototype.transform=function(v){var p=this.rect.x;p>l.WORLD_BOUNDARY?p=l.WORLD_BOUNDARY:p<-l.WORLD_BOUNDARY&&(p=-l.WORLD_BOUNDARY);var y=this.rect.y;y>l.WORLD_BOUNDARY?y=l.WORLD_BOUNDARY:y<-l.WORLD_BOUNDARY&&(y=-l.WORLD_BOUNDARY);var m=new c(p,y),g=v.inverseTransformPoint(m);this.setLocation(g.x,g.y)},d.prototype.getLeft=function(){return this.rect.x},d.prototype.getRight=function(){return this.rect.x+this.rect.width},d.prototype.getTop=function(){return this.rect.y},d.prototype.getBottom=function(){return this.rect.y+this.rect.height},d.prototype.getParent=function(){return this.owner==null?null:this.owner.getParent()},r.exports=d},function(r,n,a){var i=a(0);function s(){}for(var o in i)s[o]=i[o];s.MAX_ITERATIONS=2500,s.DEFAULT_EDGE_LENGTH=50,s.DEFAULT_SPRING_STRENGTH=.45,s.DEFAULT_REPULSION_STRENGTH=4500,s.DEFAULT_GRAVITY_STRENGTH=.4,s.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,s.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,s.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,s.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=!0,s.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=!0,s.DEFAULT_COOLING_FACTOR_INCREMENTAL=.3,s.COOLING_ADAPTATION_FACTOR=.33,s.ADAPTATION_LOWER_NODE_LIMIT=1e3,s.ADAPTATION_UPPER_NODE_LIMIT=5e3,s.MAX_NODE_DISPLACEMENT_INCREMENTAL=100,s.MAX_NODE_DISPLACEMENT=s.MAX_NODE_DISPLACEMENT_INCREMENTAL*3,s.MIN_REPULSION_DIST=s.DEFAULT_EDGE_LENGTH/10,s.CONVERGENCE_CHECK_PERIOD=100,s.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=.1,s.MIN_EDGE_LENGTH=1,s.GRID_CALCULATION_CHECK_PERIOD=10,r.exports=s},function(r,n,a){function i(s,o){s==null&&o==null?(this.x=0,this.y=0):(this.x=s,this.y=o)}i.prototype.getX=function(){return this.x},i.prototype.getY=function(){return this.y},i.prototype.setX=function(s){this.x=s},i.prototype.setY=function(s){this.y=s},i.prototype.getDifference=function(s){return new DimensionD(this.x-s.x,this.y-s.y)},i.prototype.getCopy=function(){return new i(this.x,this.y)},i.prototype.translate=function(s){return this.x+=s.width,this.y+=s.height,this},r.exports=i},function(r,n,a){var i=a(2),s=a(10),o=a(0),l=a(7),u=a(3),c=a(1),d=a(13),f=a(12),v=a(11);function p(m,g,x){i.call(this,x),this.estimatedSize=s.MIN_VALUE,this.margin=o.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=m,g!=null&&g instanceof l?this.graphManager=g:g!=null&&g instanceof Layout&&(this.graphManager=g.graphManager)}p.prototype=Object.create(i.prototype);for(var y in i)p[y]=i[y];p.prototype.getNodes=function(){return this.nodes},p.prototype.getEdges=function(){return this.edges},p.prototype.getGraphManager=function(){return this.graphManager},p.prototype.getParent=function(){return this.parent},p.prototype.getLeft=function(){return this.left},p.prototype.getRight=function(){return this.right},p.prototype.getTop=function(){return this.top},p.prototype.getBottom=function(){return this.bottom},p.prototype.isConnected=function(){return this.isConnected},p.prototype.add=function(m,g,x){if(g==null&&x==null){var b=m;if(this.graphManager==null)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(b)>-1)throw"Node already in graph!";return b.owner=this,this.getNodes().push(b),b}else{var w=m;if(!(this.getNodes().indexOf(g)>-1&&this.getNodes().indexOf(x)>-1))throw"Source or target not in graph!";if(!(g.owner==x.owner&&g.owner==this))throw"Both owners must be this graph!";return g.owner!=x.owner?null:(w.source=g,w.target=x,w.isInterGraph=!1,this.getEdges().push(w),g.edges.push(w),x!=g&&x.edges.push(w),w)}},p.prototype.remove=function(m){var g=m;if(m instanceof u){if(g==null)throw"Node is null!";if(!(g.owner!=null&&g.owner==this))throw"Owner graph is invalid!";if(this.graphManager==null)throw"Owner graph manager is invalid!";for(var x=g.edges.slice(),b,w=x.length,E=0;E<w;E++)b=x[E],b.isInterGraph?this.graphManager.remove(b):b.source.owner.remove(b);var C=this.nodes.indexOf(g);if(C==-1)throw"Node not in owner node list!";this.nodes.splice(C,1)}else if(m instanceof c){var b=m;if(b==null)throw"Edge is null!";if(!(b.source!=null&&b.target!=null))throw"Source and/or target is null!";if(!(b.source.owner!=null&&b.target.owner!=null&&b.source.owner==this&&b.target.owner==this))throw"Source and/or target owner is invalid!";var S=b.source.edges.indexOf(b),T=b.target.edges.indexOf(b);if(!(S>-1&&T>-1))throw"Source and/or target doesn't know this edge!";b.source.edges.splice(S,1),b.target!=b.source&&b.target.edges.splice(T,1);var C=b.source.owner.getEdges().indexOf(b);if(C==-1)throw"Not in owner's edge list!";b.source.owner.getEdges().splice(C,1)}},p.prototype.updateLeftTop=function(){for(var m=s.MAX_VALUE,g=s.MAX_VALUE,x,b,w,E=this.getNodes(),C=E.length,S=0;S<C;S++){var T=E[S];x=T.getTop(),b=T.getLeft(),m>x&&(m=x),g>b&&(g=b)}return m==s.MAX_VALUE?null:(E[0].getParent().paddingLeft!=null?w=E[0].getParent().paddingLeft:w=this.margin,this.left=g-w,this.top=m-w,new f(this.left,this.top))},p.prototype.updateBounds=function(m){for(var g=s.MAX_VALUE,x=-s.MAX_VALUE,b=s.MAX_VALUE,w=-s.MAX_VALUE,E,C,S,T,P,A=this.nodes,j=A.length,R=0;R<j;R++){var O=A[R];m&&O.child!=null&&O.updateBounds(),E=O.getLeft(),C=O.getRight(),S=O.getTop(),T=O.getBottom(),g>E&&(g=E),x<C&&(x=C),b>S&&(b=S),w<T&&(w=T)}var N=new d(g,b,x-g,w-b);g==s.MAX_VALUE&&(this.left=this.parent.getLeft(),this.right=this.parent.getRight(),this.top=this.parent.getTop(),this.bottom=this.parent.getBottom()),A[0].getParent().paddingLeft!=null?P=A[0].getParent().paddingLeft:P=this.margin,this.left=N.x-P,this.right=N.x+N.width+P,this.top=N.y-P,this.bottom=N.y+N.height+P},p.calculateBounds=function(m){for(var g=s.MAX_VALUE,x=-s.MAX_VALUE,b=s.MAX_VALUE,w=-s.MAX_VALUE,E,C,S,T,P=m.length,A=0;A<P;A++){var j=m[A];E=j.getLeft(),C=j.getRight(),S=j.getTop(),T=j.getBottom(),g>E&&(g=E),x<C&&(x=C),b>S&&(b=S),w<T&&(w=T)}var R=new d(g,b,x-g,w-b);return R},p.prototype.getInclusionTreeDepth=function(){return this==this.graphManager.getRoot()?1:this.parent.getInclusionTreeDepth()},p.prototype.getEstimatedSize=function(){if(this.estimatedSize==s.MIN_VALUE)throw"assert failed";return this.estimatedSize},p.prototype.calcEstimatedSize=function(){for(var m=0,g=this.nodes,x=g.length,b=0;b<x;b++){var w=g[b];m+=w.calcEstimatedSize()}return m==0?this.estimatedSize=o.EMPTY_COMPOUND_NODE_SIZE:this.estimatedSize=m/Math.sqrt(this.nodes.length),this.estimatedSize},p.prototype.updateConnected=function(){var m=this;if(this.nodes.length==0){this.isConnected=!0;return}var g=new v,x=new Set,b=this.nodes[0],w,E,C=b.withChildren();for(C.forEach(function(R){g.push(R),x.add(R)});g.length!==0;){b=g.shift(),w=b.getEdges();for(var S=w.length,T=0;T<S;T++){var P=w[T];if(E=P.getOtherEndInGraph(b,this),E!=null&&!x.has(E)){var A=E.withChildren();A.forEach(function(R){g.push(R),x.add(R)})}}}if(this.isConnected=!1,x.size>=this.nodes.length){var j=0;x.forEach(function(R){R.owner==m&&j++}),j==this.nodes.length&&(this.isConnected=!0)}},r.exports=p},function(r,n,a){var i,s=a(1);function o(l){i=a(6),this.layout=l,this.graphs=[],this.edges=[]}o.prototype.addRoot=function(){var l=this.layout.newGraph(),u=this.layout.newNode(null),c=this.add(l,u);return this.setRootGraph(c),this.rootGraph},o.prototype.add=function(l,u,c,d,f){if(c==null&&d==null&&f==null){if(l==null)throw"Graph is null!";if(u==null)throw"Parent node is null!";if(this.graphs.indexOf(l)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(l),l.parent!=null)throw"Already has a parent!";if(u.child!=null)throw"Already has a child!";return l.parent=u,u.child=l,l}else{f=c,d=u,c=l;var v=d.getOwner(),p=f.getOwner();if(!(v!=null&&v.getGraphManager()==this))throw"Source not in this graph mgr!";if(!(p!=null&&p.getGraphManager()==this))throw"Target not in this graph mgr!";if(v==p)return c.isInterGraph=!1,v.add(c,d,f);if(c.isInterGraph=!0,c.source=d,c.target=f,this.edges.indexOf(c)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(c),!(c.source!=null&&c.target!=null))throw"Edge source and/or target is null!";if(!(c.source.edges.indexOf(c)==-1&&c.target.edges.indexOf(c)==-1))throw"Edge already in source and/or target incidency list!";return c.source.edges.push(c),c.target.edges.push(c),c}},o.prototype.remove=function(l){if(l instanceof i){var u=l;if(u.getGraphManager()!=this)throw"Graph not in this graph mgr";if(!(u==this.rootGraph||u.parent!=null&&u.parent.graphManager==this))throw"Invalid parent node!";var c=[];c=c.concat(u.getEdges());for(var d,f=c.length,v=0;v<f;v++)d=c[v],u.remove(d);var p=[];p=p.concat(u.getNodes());var y;f=p.length;for(var v=0;v<f;v++)y=p[v],u.remove(y);u==this.rootGraph&&this.setRootGraph(null);var m=this.graphs.indexOf(u);this.graphs.splice(m,1),u.parent=null}else if(l instanceof s){if(d=l,d==null)throw"Edge is null!";if(!d.isInterGraph)throw"Not an inter-graph edge!";if(!(d.source!=null&&d.target!=null))throw"Source and/or target is null!";if(!(d.source.edges.indexOf(d)!=-1&&d.target.edges.indexOf(d)!=-1))throw"Source and/or target doesn't know this edge!";var m=d.source.edges.indexOf(d);if(d.source.edges.splice(m,1),m=d.target.edges.indexOf(d),d.target.edges.splice(m,1),!(d.source.owner!=null&&d.source.owner.getGraphManager()!=null))throw"Edge owner graph or owner graph manager is null!";if(d.source.owner.getGraphManager().edges.indexOf(d)==-1)throw"Not in owner graph manager's edge list!";var m=d.source.owner.getGraphManager().edges.indexOf(d);d.source.owner.getGraphManager().edges.splice(m,1)}},o.prototype.updateBounds=function(){this.rootGraph.updateBounds(!0)},o.prototype.getGraphs=function(){return this.graphs},o.prototype.getAllNodes=function(){if(this.allNodes==null){for(var l=[],u=this.getGraphs(),c=u.length,d=0;d<c;d++)l=l.concat(u[d].getNodes());this.allNodes=l}return this.allNodes},o.prototype.resetAllNodes=function(){this.allNodes=null},o.prototype.resetAllEdges=function(){this.allEdges=null},o.prototype.resetAllNodesToApplyGravitation=function(){this.allNodesToApplyGravitation=null},o.prototype.getAllEdges=function(){if(this.allEdges==null){var l=[],u=this.getGraphs();u.length;for(var c=0;c<u.length;c++)l=l.concat(u[c].getEdges());l=l.concat(this.edges),this.allEdges=l}return this.allEdges},o.prototype.getAllNodesToApplyGravitation=function(){return this.allNodesToApplyGravitation},o.prototype.setAllNodesToApplyGravitation=function(l){if(this.allNodesToApplyGravitation!=null)throw"assert failed";this.allNodesToApplyGravitation=l},o.prototype.getRoot=function(){return this.rootGraph},o.prototype.setRootGraph=function(l){if(l.getGraphManager()!=this)throw"Root not in this graph mgr!";this.rootGraph=l,l.parent==null&&(l.parent=this.layout.newNode("Root node"))},o.prototype.getLayout=function(){return this.layout},o.prototype.isOneAncestorOfOther=function(l,u){if(!(l!=null&&u!=null))throw"assert failed";if(l==u)return!0;var c=l.getOwner(),d;do{if(d=c.getParent(),d==null)break;if(d==u)return!0;if(c=d.getOwner(),c==null)break}while(!0);c=u.getOwner();do{if(d=c.getParent(),d==null)break;if(d==l)return!0;if(c=d.getOwner(),c==null)break}while(!0);return!1},o.prototype.calcLowestCommonAncestors=function(){for(var l,u,c,d,f,v=this.getAllEdges(),p=v.length,y=0;y<p;y++){if(l=v[y],u=l.source,c=l.target,l.lca=null,l.sourceInLca=u,l.targetInLca=c,u==c){l.lca=u.getOwner();continue}for(d=u.getOwner();l.lca==null;){for(l.targetInLca=c,f=c.getOwner();l.lca==null;){if(f==d){l.lca=f;break}if(f==this.rootGraph)break;if(l.lca!=null)throw"assert failed";l.targetInLca=f.getParent(),f=l.targetInLca.getOwner()}if(d==this.rootGraph)break;l.lca==null&&(l.sourceInLca=d.getParent(),d=l.sourceInLca.getOwner())}if(l.lca==null)throw"assert failed"}},o.prototype.calcLowestCommonAncestor=function(l,u){if(l==u)return l.getOwner();var c=l.getOwner();do{if(c==null)break;var d=u.getOwner();do{if(d==null)break;if(d==c)return d;d=d.getParent().getOwner()}while(!0);c=c.getParent().getOwner()}while(!0);return c},o.prototype.calcInclusionTreeDepths=function(l,u){l==null&&u==null&&(l=this.rootGraph,u=1);for(var c,d=l.getNodes(),f=d.length,v=0;v<f;v++)c=d[v],c.inclusionTreeDepth=u,c.child!=null&&this.calcInclusionTreeDepths(c.child,u+1)},o.prototype.includesInvalidEdge=function(){for(var l,u=[],c=this.edges.length,d=0;d<c;d++)l=this.edges[d],this.isOneAncestorOfOther(l.source,l.target)&&u.push(l);for(var d=0;d<u.length;d++)this.remove(u[d]);return!1},r.exports=o},function(r,n,a){var i=a(12);function s(){}s.calcSeparationAmount=function(o,l,u,c){if(!o.intersects(l))throw"assert failed";var d=new Array(2);this.decideDirectionsForOverlappingNodes(o,l,d),u[0]=Math.min(o.getRight(),l.getRight())-Math.max(o.x,l.x),u[1]=Math.min(o.getBottom(),l.getBottom())-Math.max(o.y,l.y),o.getX()<=l.getX()&&o.getRight()>=l.getRight()?u[0]+=Math.min(l.getX()-o.getX(),o.getRight()-l.getRight()):l.getX()<=o.getX()&&l.getRight()>=o.getRight()&&(u[0]+=Math.min(o.getX()-l.getX(),l.getRight()-o.getRight())),o.getY()<=l.getY()&&o.getBottom()>=l.getBottom()?u[1]+=Math.min(l.getY()-o.getY(),o.getBottom()-l.getBottom()):l.getY()<=o.getY()&&l.getBottom()>=o.getBottom()&&(u[1]+=Math.min(o.getY()-l.getY(),l.getBottom()-o.getBottom()));var f=Math.abs((l.getCenterY()-o.getCenterY())/(l.getCenterX()-o.getCenterX()));l.getCenterY()===o.getCenterY()&&l.getCenterX()===o.getCenterX()&&(f=1);var v=f*u[0],p=u[1]/f;u[0]<p?p=u[0]:v=u[1],u[0]=-1*d[0]*(p/2+c),u[1]=-1*d[1]*(v/2+c)},s.decideDirectionsForOverlappingNodes=function(o,l,u){o.getCenterX()<l.getCenterX()?u[0]=-1:u[0]=1,o.getCenterY()<l.getCenterY()?u[1]=-1:u[1]=1},s.getIntersection2=function(o,l,u){var c=o.getCenterX(),d=o.getCenterY(),f=l.getCenterX(),v=l.getCenterY();if(o.intersects(l))return u[0]=c,u[1]=d,u[2]=f,u[3]=v,!0;var p=o.getX(),y=o.getY(),m=o.getRight(),g=o.getX(),x=o.getBottom(),b=o.getRight(),w=o.getWidthHalf(),E=o.getHeightHalf(),C=l.getX(),S=l.getY(),T=l.getRight(),P=l.getX(),A=l.getBottom(),j=l.getRight(),R=l.getWidthHalf(),O=l.getHeightHalf(),N=!1,D=!1;if(c===f){if(d>v)return u[0]=c,u[1]=y,u[2]=f,u[3]=A,!1;if(d<v)return u[0]=c,u[1]=x,u[2]=f,u[3]=S,!1}else if(d===v){if(c>f)return u[0]=p,u[1]=d,u[2]=T,u[3]=v,!1;if(c<f)return u[0]=m,u[1]=d,u[2]=C,u[3]=v,!1}else{var L=o.height/o.width,_=l.height/l.width,k=(v-d)/(f-c),I=void 0,F=void 0,B=void 0,$=void 0,W=void 0,z=void 0;if(-L===k?c>f?(u[0]=g,u[1]=x,N=!0):(u[0]=m,u[1]=y,N=!0):L===k&&(c>f?(u[0]=p,u[1]=y,N=!0):(u[0]=b,u[1]=x,N=!0)),-_===k?f>c?(u[2]=P,u[3]=A,D=!0):(u[2]=T,u[3]=S,D=!0):_===k&&(f>c?(u[2]=C,u[3]=S,D=!0):(u[2]=j,u[3]=A,D=!0)),N&&D)return!1;if(c>f?d>v?(I=this.getCardinalDirection(L,k,4),F=this.getCardinalDirection(_,k,2)):(I=this.getCardinalDirection(-L,k,3),F=this.getCardinalDirection(-_,k,1)):d>v?(I=this.getCardinalDirection(-L,k,1),F=this.getCardinalDirection(-_,k,3)):(I=this.getCardinalDirection(L,k,2),F=this.getCardinalDirection(_,k,4)),!N)switch(I){case 1:$=y,B=c+-E/k,u[0]=B,u[1]=$;break;case 2:B=b,$=d+w*k,u[0]=B,u[1]=$;break;case 3:$=x,B=c+E/k,u[0]=B,u[1]=$;break;case 4:B=g,$=d+-w*k,u[0]=B,u[1]=$;break}if(!D)switch(F){case 1:z=S,W=f+-O/k,u[2]=W,u[3]=z;break;case 2:W=j,z=v+R*k,u[2]=W,u[3]=z;break;case 3:z=A,W=f+O/k,u[2]=W,u[3]=z;break;case 4:W=P,z=v+-R*k,u[2]=W,u[3]=z;break}}return!1},s.getCardinalDirection=function(o,l,u){return o>l?u:1+u%4},s.getIntersection=function(o,l,u,c){if(c==null)return this.getIntersection2(o,l,u);var d=o.x,f=o.y,v=l.x,p=l.y,y=u.x,m=u.y,g=c.x,x=c.y,b=void 0,w=void 0,E=void 0,C=void 0,S=void 0,T=void 0,P=void 0,A=void 0,j=void 0;return E=p-f,S=d-v,P=v*f-d*p,C=x-m,T=y-g,A=g*m-y*x,j=E*T-C*S,j===0?null:(b=(S*A-T*P)/j,w=(C*P-E*A)/j,new i(b,w))},s.angleOfVector=function(o,l,u,c){var d=void 0;return o!==u?(d=Math.atan((c-l)/(u-o)),u<o?d+=Math.PI:c<l&&(d+=this.TWO_PI)):c<l?d=this.ONE_AND_HALF_PI:d=this.HALF_PI,d},s.doIntersect=function(o,l,u,c){var d=o.x,f=o.y,v=l.x,p=l.y,y=u.x,m=u.y,g=c.x,x=c.y,b=(v-d)*(x-m)-(g-y)*(p-f);if(b===0)return!1;var w=((x-m)*(g-d)+(y-g)*(x-f))/b,E=((f-p)*(g-d)+(v-d)*(x-f))/b;return 0<w&&w<1&&0<E&&E<1},s.findCircleLineIntersections=function(o,l,u,c,d,f,v){var p=(u-o)*(u-o)+(c-l)*(c-l),y=2*((o-d)*(u-o)+(l-f)*(c-l)),m=(o-d)*(o-d)+(l-f)*(l-f)-v*v,g=y*y-4*p*m;if(g>=0){var x=(-y+Math.sqrt(y*y-4*p*m))/(2*p),b=(-y-Math.sqrt(y*y-4*p*m))/(2*p),w=null;return x>=0&&x<=1?[x]:b>=0&&b<=1?[b]:w}else return null},s.HALF_PI=.5*Math.PI,s.ONE_AND_HALF_PI=1.5*Math.PI,s.TWO_PI=2*Math.PI,s.THREE_PI=3*Math.PI,r.exports=s},function(r,n,a){function i(){}i.sign=function(s){return s>0?1:s<0?-1:0},i.floor=function(s){return s<0?Math.ceil(s):Math.floor(s)},i.ceil=function(s){return s<0?Math.floor(s):Math.ceil(s)},r.exports=i},function(r,n,a){function i(){}i.MAX_VALUE=2147483647,i.MIN_VALUE=-2147483648,r.exports=i},function(r,n,a){var i=function(){function d(f,v){for(var p=0;p<v.length;p++){var y=v[p];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(f,y.key,y)}}return function(f,v,p){return v&&d(f.prototype,v),p&&d(f,p),f}}();function s(d,f){if(!(d instanceof f))throw new TypeError("Cannot call a class as a function")}var o=function(f){return{value:f,next:null,prev:null}},l=function(f,v,p,y){return f!==null?f.next=v:y.head=v,p!==null?p.prev=v:y.tail=v,v.prev=f,v.next=p,y.length++,v},u=function(f,v){var p=f.prev,y=f.next;return p!==null?p.next=y:v.head=y,y!==null?y.prev=p:v.tail=p,f.prev=f.next=null,v.length--,f},c=function(){function d(f){var v=this;s(this,d),this.length=0,this.head=null,this.tail=null,f!=null&&f.forEach(function(p){return v.push(p)})}return i(d,[{key:"size",value:function(){return this.length}},{key:"insertBefore",value:function(v,p){return l(p.prev,o(v),p,this)}},{key:"insertAfter",value:function(v,p){return l(p,o(v),p.next,this)}},{key:"insertNodeBefore",value:function(v,p){return l(p.prev,v,p,this)}},{key:"insertNodeAfter",value:function(v,p){return l(p,v,p.next,this)}},{key:"push",value:function(v){return l(this.tail,o(v),null,this)}},{key:"unshift",value:function(v){return l(null,o(v),this.head,this)}},{key:"remove",value:function(v){return u(v,this)}},{key:"pop",value:function(){return u(this.tail,this).value}},{key:"popNode",value:function(){return u(this.tail,this)}},{key:"shift",value:function(){return u(this.head,this).value}},{key:"shiftNode",value:function(){return u(this.head,this)}},{key:"get_object_at",value:function(v){if(v<=this.length()){for(var p=1,y=this.head;p<v;)y=y.next,p++;return y.value}}},{key:"set_object_at",value:function(v,p){if(v<=this.length()){for(var y=1,m=this.head;y<v;)m=m.next,y++;m.value=p}}}]),d}();r.exports=c},function(r,n,a){function i(s,o,l){this.x=null,this.y=null,s==null&&o==null&&l==null?(this.x=0,this.y=0):typeof s=="number"&&typeof o=="number"&&l==null?(this.x=s,this.y=o):s.constructor.name=="Point"&&o==null&&l==null&&(l=s,this.x=l.x,this.y=l.y)}i.prototype.getX=function(){return this.x},i.prototype.getY=function(){return this.y},i.prototype.getLocation=function(){return new i(this.x,this.y)},i.prototype.setLocation=function(s,o,l){s.constructor.name=="Point"&&o==null&&l==null?(l=s,this.setLocation(l.x,l.y)):typeof s=="number"&&typeof o=="number"&&l==null&&(parseInt(s)==s&&parseInt(o)==o?this.move(s,o):(this.x=Math.floor(s+.5),this.y=Math.floor(o+.5)))},i.prototype.move=function(s,o){this.x=s,this.y=o},i.prototype.translate=function(s,o){this.x+=s,this.y+=o},i.prototype.equals=function(s){if(s.constructor.name=="Point"){var o=s;return this.x==o.x&&this.y==o.y}return this==s},i.prototype.toString=function(){return new i().constructor.name+"[x="+this.x+",y="+this.y+"]"},r.exports=i},function(r,n,a){function i(s,o,l,u){this.x=0,this.y=0,this.width=0,this.height=0,s!=null&&o!=null&&l!=null&&u!=null&&(this.x=s,this.y=o,this.width=l,this.height=u)}i.prototype.getX=function(){return this.x},i.prototype.setX=function(s){this.x=s},i.prototype.getY=function(){return this.y},i.prototype.setY=function(s){this.y=s},i.prototype.getWidth=function(){return this.width},i.prototype.setWidth=function(s){this.width=s},i.prototype.getHeight=function(){return this.height},i.prototype.setHeight=function(s){this.height=s},i.prototype.getRight=function(){return this.x+this.width},i.prototype.getBottom=function(){return this.y+this.height},i.prototype.intersects=function(s){return!(this.getRight()<s.x||this.getBottom()<s.y||s.getRight()<this.x||s.getBottom()<this.y)},i.prototype.getCenterX=function(){return this.x+this.width/2},i.prototype.getMinX=function(){return this.getX()},i.prototype.getMaxX=function(){return this.getX()+this.width},i.prototype.getCenterY=function(){return this.y+this.height/2},i.prototype.getMinY=function(){return this.getY()},i.prototype.getMaxY=function(){return this.getY()+this.height},i.prototype.getWidthHalf=function(){return this.width/2},i.prototype.getHeightHalf=function(){return this.height/2},r.exports=i},function(r,n,a){var i=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(o){return typeof o}:function(o){return o&&typeof Symbol=="function"&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o};function s(){}s.lastID=0,s.createID=function(o){return s.isPrimitive(o)?o:(o.uniqueID!=null||(o.uniqueID=s.getString(),s.lastID++),o.uniqueID)},s.getString=function(o){return o==null&&(o=s.lastID),"Object#"+o},s.isPrimitive=function(o){var l=typeof o>"u"?"undefined":i(o);return o==null||l!="object"&&l!="function"},r.exports=s},function(r,n,a){function i(y){if(Array.isArray(y)){for(var m=0,g=Array(y.length);m<y.length;m++)g[m]=y[m];return g}else return Array.from(y)}var s=a(0),o=a(7),l=a(3),u=a(1),c=a(6),d=a(5),f=a(17),v=a(29);function p(y){v.call(this),this.layoutQuality=s.QUALITY,this.createBendsAsNeeded=s.DEFAULT_CREATE_BENDS_AS_NEEDED,this.incremental=s.DEFAULT_INCREMENTAL,this.animationOnLayout=s.DEFAULT_ANIMATION_ON_LAYOUT,this.animationDuringLayout=s.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=s.DEFAULT_ANIMATION_PERIOD,this.uniformLeafNodeSizes=s.DEFAULT_UNIFORM_LEAF_NODE_SIZES,this.edgeToDummyNodes=new Map,this.graphManager=new o(this),this.isLayoutFinished=!1,this.isSubLayout=!1,this.isRemoteUse=!1,y!=null&&(this.isRemoteUse=y)}p.RANDOM_SEED=1,p.prototype=Object.create(v.prototype),p.prototype.getGraphManager=function(){return this.graphManager},p.prototype.getAllNodes=function(){return this.graphManager.getAllNodes()},p.prototype.getAllEdges=function(){return this.graphManager.getAllEdges()},p.prototype.getAllNodesToApplyGravitation=function(){return this.graphManager.getAllNodesToApplyGravitation()},p.prototype.newGraphManager=function(){var y=new o(this);return this.graphManager=y,y},p.prototype.newGraph=function(y){return new c(null,this.graphManager,y)},p.prototype.newNode=function(y){return new l(this.graphManager,y)},p.prototype.newEdge=function(y){return new u(null,null,y)},p.prototype.checkLayoutSuccess=function(){return this.graphManager.getRoot()==null||this.graphManager.getRoot().getNodes().length==0||this.graphManager.includesInvalidEdge()},p.prototype.runLayout=function(){this.isLayoutFinished=!1,this.tilingPreLayout&&this.tilingPreLayout(),this.initParameters();var y;return this.checkLayoutSuccess()?y=!1:y=this.layout(),s.ANIMATE==="during"?!1:(y&&(this.isSubLayout||this.doPostLayout()),this.tilingPostLayout&&this.tilingPostLayout(),this.isLayoutFinished=!0,y)},p.prototype.doPostLayout=function(){this.incremental||this.transform(),this.update()},p.prototype.update2=function(){if(this.createBendsAsNeeded&&(this.createBendpointsFromDummyNodes(),this.graphManager.resetAllEdges()),!this.isRemoteUse){for(var y=this.graphManager.getAllEdges(),m=0;m<y.length;m++)y[m];for(var g=this.graphManager.getRoot().getNodes(),m=0;m<g.length;m++)g[m];this.update(this.graphManager.getRoot())}},p.prototype.update=function(y){if(y==null)this.update2();else if(y instanceof l){var m=y;if(m.getChild()!=null)for(var g=m.getChild().getNodes(),x=0;x<g.length;x++)update(g[x]);if(m.vGraphObject!=null){var b=m.vGraphObject;b.update(m)}}else if(y instanceof u){var w=y;if(w.vGraphObject!=null){var E=w.vGraphObject;E.update(w)}}else if(y instanceof c){var C=y;if(C.vGraphObject!=null){var S=C.vGraphObject;S.update(C)}}},p.prototype.initParameters=function(){this.isSubLayout||(this.layoutQuality=s.QUALITY,this.animationDuringLayout=s.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=s.DEFAULT_ANIMATION_PERIOD,this.animationOnLayout=s.DEFAULT_ANIMATION_ON_LAYOUT,this.incremental=s.DEFAULT_INCREMENTAL,this.createBendsAsNeeded=s.DEFAULT_CREATE_BENDS_AS_NEEDED,this.uniformLeafNodeSizes=s.DEFAULT_UNIFORM_LEAF_NODE_SIZES),this.animationDuringLayout&&(this.animationOnLayout=!1)},p.prototype.transform=function(y){if(y==null)this.transform(new d(0,0));else{var m=new f,g=this.graphManager.getRoot().updateLeftTop();if(g!=null){m.setWorldOrgX(y.x),m.setWorldOrgY(y.y),m.setDeviceOrgX(g.x),m.setDeviceOrgY(g.y);for(var x=this.getAllNodes(),b,w=0;w<x.length;w++)b=x[w],b.transform(m)}}},p.prototype.positionNodesRandomly=function(y){if(y==null)this.positionNodesRandomly(this.getGraphManager().getRoot()),this.getGraphManager().getRoot().updateBounds(!0);else for(var m,g,x=y.getNodes(),b=0;b<x.length;b++)m=x[b],g=m.getChild(),g==null||g.getNodes().length==0?m.scatter():(this.positionNodesRandomly(g),m.updateBounds())},p.prototype.getFlatForest=function(){for(var y=[],m=!0,g=this.graphManager.getRoot().getNodes(),x=!0,b=0;b<g.length;b++)g[b].getChild()!=null&&(x=!1);if(!x)return y;var w=new Set,E=[],C=new Map,S=[];for(S=S.concat(g);S.length>0&&m;){for(E.push(S[0]);E.length>0&&m;){var T=E[0];E.splice(0,1),w.add(T);for(var P=T.getEdges(),b=0;b<P.length;b++){var A=P[b].getOtherEnd(T);if(C.get(T)!=A)if(!w.has(A))E.push(A),C.set(A,T);else{m=!1;break}}}if(!m)y=[];else{var j=[].concat(i(w));y.push(j);for(var b=0;b<j.length;b++){var R=j[b],O=S.indexOf(R);O>-1&&S.splice(O,1)}w=new Set,C=new Map}}return y},p.prototype.createDummyNodesForBendpoints=function(y){for(var m=[],g=y.source,x=this.graphManager.calcLowestCommonAncestor(y.source,y.target),b=0;b<y.bendpoints.length;b++){var w=this.newNode(null);w.setRect(new Point(0,0),new Dimension(1,1)),x.add(w);var E=this.newEdge(null);this.graphManager.add(E,g,w),m.add(w),g=w}var E=this.newEdge(null);return this.graphManager.add(E,g,y.target),this.edgeToDummyNodes.set(y,m),y.isInterGraph()?this.graphManager.remove(y):x.remove(y),m},p.prototype.createBendpointsFromDummyNodes=function(){var y=[];y=y.concat(this.graphManager.getAllEdges()),y=[].concat(i(this.edgeToDummyNodes.keys())).concat(y);for(var m=0;m<y.length;m++){var g=y[m];if(g.bendpoints.length>0){for(var x=this.edgeToDummyNodes.get(g),b=0;b<x.length;b++){var w=x[b],E=new d(w.getCenterX(),w.getCenterY()),C=g.bendpoints.get(b);C.x=E.x,C.y=E.y,w.getOwner().remove(w)}this.graphManager.add(g,g.source,g.target)}}},p.transform=function(y,m,g,x){if(g!=null&&x!=null){var b=m;if(y<=50){var w=m/g;b-=(m-w)/50*(50-y)}else{var E=m*x;b+=(E-m)/50*(y-50)}return b}else{var C,S;return y<=50?(C=9*m/500,S=m/10):(C=9*m/50,S=-8*m),C*y+S}},p.findCenterOfTree=function(y){var m=[];m=m.concat(y);var g=[],x=new Map,b=!1,w=null;(m.length==1||m.length==2)&&(b=!0,w=m[0]);for(var E=0;E<m.length;E++){var C=m[E],S=C.getNeighborsList().size;x.set(C,C.getNeighborsList().size),S==1&&g.push(C)}var T=[];for(T=T.concat(g);!b;){var P=[];P=P.concat(T),T=[];for(var E=0;E<m.length;E++){var C=m[E],A=m.indexOf(C);A>=0&&m.splice(A,1);var j=C.getNeighborsList();j.forEach(function(N){if(g.indexOf(N)<0){var D=x.get(N),L=D-1;L==1&&T.push(N),x.set(N,L)}})}g=g.concat(T),(m.length==1||m.length==2)&&(b=!0,w=m[0])}return w},p.prototype.setGraphManager=function(y){this.graphManager=y},r.exports=p},function(r,n,a){function i(){}i.seed=1,i.x=0,i.nextDouble=function(){return i.x=Math.sin(i.seed++)*1e4,i.x-Math.floor(i.x)},r.exports=i},function(r,n,a){var i=a(5);function s(o,l){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}s.prototype.getWorldOrgX=function(){return this.lworldOrgX},s.prototype.setWorldOrgX=function(o){this.lworldOrgX=o},s.prototype.getWorldOrgY=function(){return this.lworldOrgY},s.prototype.setWorldOrgY=function(o){this.lworldOrgY=o},s.prototype.getWorldExtX=function(){return this.lworldExtX},s.prototype.setWorldExtX=function(o){this.lworldExtX=o},s.prototype.getWorldExtY=function(){return this.lworldExtY},s.prototype.setWorldExtY=function(o){this.lworldExtY=o},s.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},s.prototype.setDeviceOrgX=function(o){this.ldeviceOrgX=o},s.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},s.prototype.setDeviceOrgY=function(o){this.ldeviceOrgY=o},s.prototype.getDeviceExtX=function(){return this.ldeviceExtX},s.prototype.setDeviceExtX=function(o){this.ldeviceExtX=o},s.prototype.getDeviceExtY=function(){return this.ldeviceExtY},s.prototype.setDeviceExtY=function(o){this.ldeviceExtY=o},s.prototype.transformX=function(o){var l=0,u=this.lworldExtX;return u!=0&&(l=this.ldeviceOrgX+(o-this.lworldOrgX)*this.ldeviceExtX/u),l},s.prototype.transformY=function(o){var l=0,u=this.lworldExtY;return u!=0&&(l=this.ldeviceOrgY+(o-this.lworldOrgY)*this.ldeviceExtY/u),l},s.prototype.inverseTransformX=function(o){var l=0,u=this.ldeviceExtX;return u!=0&&(l=this.lworldOrgX+(o-this.ldeviceOrgX)*this.lworldExtX/u),l},s.prototype.inverseTransformY=function(o){var l=0,u=this.ldeviceExtY;return u!=0&&(l=this.lworldOrgY+(o-this.ldeviceOrgY)*this.lworldExtY/u),l},s.prototype.inverseTransformPoint=function(o){var l=new i(this.inverseTransformX(o.x),this.inverseTransformY(o.y));return l},r.exports=s},function(r,n,a){function i(v){if(Array.isArray(v)){for(var p=0,y=Array(v.length);p<v.length;p++)y[p]=v[p];return y}else return Array.from(v)}var s=a(15),o=a(4),l=a(0),u=a(8),c=a(9);function d(){s.call(this),this.useSmartIdealEdgeLengthCalculation=o.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=o.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=o.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=o.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=o.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.displacementThresholdPerNode=3*o.DEFAULT_EDGE_LENGTH/100,this.coolingFactor=o.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.initialCoolingFactor=o.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.totalDisplacement=0,this.oldTotalDisplacement=0,this.maxIterations=o.MAX_ITERATIONS}d.prototype=Object.create(s.prototype);for(var f in s)d[f]=s[f];d.prototype.initParameters=function(){s.prototype.initParameters.call(this,arguments),this.totalIterations=0,this.notAnimatedIterations=0,this.useFRGridVariant=o.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION,this.grid=[]},d.prototype.calcIdealEdgeLengths=function(){for(var v,p,y,m,g,x,b,w=this.getGraphManager().getAllEdges(),E=0;E<w.length;E++)v=w[E],p=v.idealLength,v.isInterGraph&&(m=v.getSource(),g=v.getTarget(),x=v.getSourceInLca().getEstimatedSize(),b=v.getTargetInLca().getEstimatedSize(),this.useSmartIdealEdgeLengthCalculation&&(v.idealLength+=x+b-2*l.SIMPLE_NODE_SIZE),y=v.getLca().getInclusionTreeDepth(),v.idealLength+=p*o.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR*(m.getInclusionTreeDepth()+g.getInclusionTreeDepth()-2*y))},d.prototype.initSpringEmbedder=function(){var v=this.getAllNodes().length;this.incremental?(v>o.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*o.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(v-o.ADAPTATION_LOWER_NODE_LIMIT)/(o.ADAPTATION_UPPER_NODE_LIMIT-o.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-o.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=o.MAX_NODE_DISPLACEMENT_INCREMENTAL):(v>o.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(o.COOLING_ADAPTATION_FACTOR,1-(v-o.ADAPTATION_LOWER_NODE_LIMIT)/(o.ADAPTATION_UPPER_NODE_LIMIT-o.ADAPTATION_LOWER_NODE_LIMIT)*(1-o.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=o.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.displacementThresholdPerNode=3*o.DEFAULT_EDGE_LENGTH/100,this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},d.prototype.calcSpringForces=function(){for(var v=this.getAllEdges(),p,y=0;y<v.length;y++)p=v[y],this.calcSpringForce(p,p.idealLength)},d.prototype.calcRepulsionForces=function(){var v=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,y,m,g,x,b=this.getAllNodes(),w;if(this.useFRGridVariant)for(this.totalIterations%o.GRID_CALCULATION_CHECK_PERIOD==1&&v&&this.updateGrid(),w=new Set,y=0;y<b.length;y++)g=b[y],this.calculateRepulsionForceOfANode(g,w,v,p),w.add(g);else for(y=0;y<b.length;y++)for(g=b[y],m=y+1;m<b.length;m++)x=b[m],g.getOwner()==x.getOwner()&&this.calcRepulsionForce(g,x)},d.prototype.calcGravitationalForces=function(){for(var v,p=this.getAllNodesToApplyGravitation(),y=0;y<p.length;y++)v=p[y],this.calcGravitationalForce(v)},d.prototype.moveNodes=function(){for(var v=this.getAllNodes(),p,y=0;y<v.length;y++)p=v[y],p.move()},d.prototype.calcSpringForce=function(v,p){var y=v.getSource(),m=v.getTarget(),g,x,b,w;if(this.uniformLeafNodeSizes&&y.getChild()==null&&m.getChild()==null)v.updateLengthSimple();else if(v.updateLength(),v.isOverlapingSourceAndTarget)return;g=v.getLength(),g!=0&&(x=v.edgeElasticity*(g-p),b=x*(v.lengthX/g),w=x*(v.lengthY/g),y.springForceX+=b,y.springForceY+=w,m.springForceX-=b,m.springForceY-=w)},d.prototype.calcRepulsionForce=function(v,p){var y=v.getRect(),m=p.getRect(),g=new Array(2),x=new Array(4),b,w,E,C,S,T,P;if(y.intersects(m)){u.calcSeparationAmount(y,m,g,o.DEFAULT_EDGE_LENGTH/2),T=2*g[0],P=2*g[1];var A=v.noOfChildren*p.noOfChildren/(v.noOfChildren+p.noOfChildren);v.repulsionForceX-=A*T,v.repulsionForceY-=A*P,p.repulsionForceX+=A*T,p.repulsionForceY+=A*P}else this.uniformLeafNodeSizes&&v.getChild()==null&&p.getChild()==null?(b=m.getCenterX()-y.getCenterX(),w=m.getCenterY()-y.getCenterY()):(u.getIntersection(y,m,x),b=x[2]-x[0],w=x[3]-x[1]),Math.abs(b)<o.MIN_REPULSION_DIST&&(b=c.sign(b)*o.MIN_REPULSION_DIST),Math.abs(w)<o.MIN_REPULSION_DIST&&(w=c.sign(w)*o.MIN_REPULSION_DIST),E=b*b+w*w,C=Math.sqrt(E),S=(v.nodeRepulsion/2+p.nodeRepulsion/2)*v.noOfChildren*p.noOfChildren/E,T=S*b/C,P=S*w/C,v.repulsionForceX-=T,v.repulsionForceY-=P,p.repulsionForceX+=T,p.repulsionForceY+=P},d.prototype.calcGravitationalForce=function(v){var p,y,m,g,x,b,w,E;p=v.getOwner(),y=(p.getRight()+p.getLeft())/2,m=(p.getTop()+p.getBottom())/2,g=v.getCenterX()-y,x=v.getCenterY()-m,b=Math.abs(g)+v.getWidth()/2,w=Math.abs(x)+v.getHeight()/2,v.getOwner()==this.graphManager.getRoot()?(E=p.getEstimatedSize()*this.gravityRangeFactor,(b>E||w>E)&&(v.gravitationForceX=-this.gravityConstant*g,v.gravitationForceY=-this.gravityConstant*x)):(E=p.getEstimatedSize()*this.compoundGravityRangeFactor,(b>E||w>E)&&(v.gravitationForceX=-this.gravityConstant*g*this.compoundGravityConstant,v.gravitationForceY=-this.gravityConstant*x*this.compoundGravityConstant))},d.prototype.isConverged=function(){var v,p=!1;return this.totalIterations>this.maxIterations/3&&(p=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),v=this.totalDisplacement<this.totalDisplacementThreshold,this.oldTotalDisplacement=this.totalDisplacement,v||p},d.prototype.animate=function(){this.animationDuringLayout&&!this.isSubLayout&&(this.notAnimatedIterations==this.animationPeriod?(this.update(),this.notAnimatedIterations=0):this.notAnimatedIterations++)},d.prototype.calcNoOfChildrenForAllNodes=function(){for(var v,p=this.graphManager.getAllNodes(),y=0;y<p.length;y++)v=p[y],v.noOfChildren=v.getNoOfChildren()},d.prototype.calcGrid=function(v){var p=0,y=0;p=parseInt(Math.ceil((v.getRight()-v.getLeft())/this.repulsionRange)),y=parseInt(Math.ceil((v.getBottom()-v.getTop())/this.repulsionRange));for(var m=new Array(p),g=0;g<p;g++)m[g]=new Array(y);for(var g=0;g<p;g++)for(var x=0;x<y;x++)m[g][x]=new Array;return m},d.prototype.addNodeToGrid=function(v,p,y){var m=0,g=0,x=0,b=0;m=parseInt(Math.floor((v.getRect().x-p)/this.repulsionRange)),g=parseInt(Math.floor((v.getRect().width+v.getRect().x-p)/this.repulsionRange)),x=parseInt(Math.floor((v.getRect().y-y)/this.repulsionRange)),b=parseInt(Math.floor((v.getRect().height+v.getRect().y-y)/this.repulsionRange));for(var w=m;w<=g;w++)for(var E=x;E<=b;E++)this.grid[w][E].push(v),v.setGridCoordinates(m,g,x,b)},d.prototype.updateGrid=function(){var v,p,y=this.getAllNodes();for(this.grid=this.calcGrid(this.graphManager.getRoot()),v=0;v<y.length;v++)p=y[v],this.addNodeToGrid(p,this.graphManager.getRoot().getLeft(),this.graphManager.getRoot().getTop())},d.prototype.calculateRepulsionForceOfANode=function(v,p,y,m){if(this.totalIterations%o.GRID_CALCULATION_CHECK_PERIOD==1&&y||m){var g=new Set;v.surrounding=new Array;for(var x,b=this.grid,w=v.startX-1;w<v.finishX+2;w++)for(var E=v.startY-1;E<v.finishY+2;E++)if(!(w<0||E<0||w>=b.length||E>=b[0].length)){for(var C=0;C<b[w][E].length;C++)if(x=b[w][E][C],!(v.getOwner()!=x.getOwner()||v==x)&&!p.has(x)&&!g.has(x)){var S=Math.abs(v.getCenterX()-x.getCenterX())-(v.getWidth()/2+x.getWidth()/2),T=Math.abs(v.getCenterY()-x.getCenterY())-(v.getHeight()/2+x.getHeight()/2);S<=this.repulsionRange&&T<=this.repulsionRange&&g.add(x)}}v.surrounding=[].concat(i(g))}for(w=0;w<v.surrounding.length;w++)this.calcRepulsionForce(v,v.surrounding[w])},d.prototype.calcRepulsionRange=function(){return 0},r.exports=d},function(r,n,a){var i=a(1),s=a(4);function o(u,c,d){i.call(this,u,c,d),this.idealLength=s.DEFAULT_EDGE_LENGTH,this.edgeElasticity=s.DEFAULT_SPRING_STRENGTH}o.prototype=Object.create(i.prototype);for(var l in i)o[l]=i[l];r.exports=o},function(r,n,a){var i=a(3),s=a(4);function o(u,c,d,f){i.call(this,u,c,d,f),this.nodeRepulsion=s.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=[]}o.prototype=Object.create(i.prototype);for(var l in i)o[l]=i[l];o.prototype.setGridCoordinates=function(u,c,d,f){this.startX=u,this.finishX=c,this.startY=d,this.finishY=f},r.exports=o},function(r,n,a){function i(s,o){this.width=0,this.height=0,s!==null&&o!==null&&(this.height=o,this.width=s)}i.prototype.getWidth=function(){return this.width},i.prototype.setWidth=function(s){this.width=s},i.prototype.getHeight=function(){return this.height},i.prototype.setHeight=function(s){this.height=s},r.exports=i},function(r,n,a){var i=a(14);function s(){this.map={},this.keys=[]}s.prototype.put=function(o,l){var u=i.createID(o);this.contains(u)||(this.map[u]=l,this.keys.push(o))},s.prototype.contains=function(o){return i.createID(o),this.map[o]!=null},s.prototype.get=function(o){var l=i.createID(o);return this.map[l]},s.prototype.keySet=function(){return this.keys},r.exports=s},function(r,n,a){var i=a(14);function s(){this.set={}}s.prototype.add=function(o){var l=i.createID(o);this.contains(l)||(this.set[l]=o)},s.prototype.remove=function(o){delete this.set[i.createID(o)]},s.prototype.clear=function(){this.set={}},s.prototype.contains=function(o){return this.set[i.createID(o)]==o},s.prototype.isEmpty=function(){return this.size()===0},s.prototype.size=function(){return Object.keys(this.set).length},s.prototype.addAllTo=function(o){for(var l=Object.keys(this.set),u=l.length,c=0;c<u;c++)o.push(this.set[l[c]])},s.prototype.size=function(){return Object.keys(this.set).length},s.prototype.addAll=function(o){for(var l=o.length,u=0;u<l;u++){var c=o[u];this.add(c)}},r.exports=s},function(r,n,a){function i(){}i.multMat=function(s,o){for(var l=[],u=0;u<s.length;u++){l[u]=[];for(var c=0;c<o[0].length;c++){l[u][c]=0;for(var d=0;d<s[0].length;d++)l[u][c]+=s[u][d]*o[d][c]}}return l},i.transpose=function(s){for(var o=[],l=0;l<s[0].length;l++){o[l]=[];for(var u=0;u<s.length;u++)o[l][u]=s[u][l]}return o},i.multCons=function(s,o){for(var l=[],u=0;u<s.length;u++)l[u]=s[u]*o;return l},i.minusOp=function(s,o){for(var l=[],u=0;u<s.length;u++)l[u]=s[u]-o[u];return l},i.dotProduct=function(s,o){for(var l=0,u=0;u<s.length;u++)l+=s[u]*o[u];return l},i.mag=function(s){return Math.sqrt(this.dotProduct(s,s))},i.normalize=function(s){for(var o=[],l=this.mag(s),u=0;u<s.length;u++)o[u]=s[u]/l;return o},i.multGamma=function(s){for(var o=[],l=0,u=0;u<s.length;u++)l+=s[u];l*=-1/s.length;for(var c=0;c<s.length;c++)o[c]=l+s[c];return o},i.multL=function(s,o,l){for(var u=[],c=[],d=[],f=0;f<o[0].length;f++){for(var v=0,p=0;p<o.length;p++)v+=-.5*o[p][f]*s[p];c[f]=v}for(var y=0;y<l.length;y++){for(var m=0,g=0;g<l.length;g++)m+=l[y][g]*c[g];d[y]=m}for(var x=0;x<o.length;x++){for(var b=0,w=0;w<o[0].length;w++)b+=o[x][w]*d[w];u[x]=b}return u},r.exports=i},function(r,n,a){var i=function(){function u(c,d){for(var f=0;f<d.length;f++){var v=d[f];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(c,v.key,v)}}return function(c,d,f){return d&&u(c.prototype,d),f&&u(c,f),c}}();function s(u,c){if(!(u instanceof c))throw new TypeError("Cannot call a class as a function")}var o=a(11),l=function(){function u(c,d){s(this,u),(d!==null||d!==void 0)&&(this.compareFunction=this._defaultCompareFunction);var f=void 0;c instanceof o?f=c.size():f=c.length,this._quicksort(c,0,f-1)}return i(u,[{key:"_quicksort",value:function(d,f,v){if(f<v){var p=this._partition(d,f,v);this._quicksort(d,f,p),this._quicksort(d,p+1,v)}}},{key:"_partition",value:function(d,f,v){for(var p=this._get(d,f),y=f,m=v;;){for(;this.compareFunction(p,this._get(d,m));)m--;for(;this.compareFunction(this._get(d,y),p);)y++;if(y<m)this._swap(d,y,m),y++,m--;else return m}}},{key:"_get",value:function(d,f){return d instanceof o?d.get_object_at(f):d[f]}},{key:"_set",value:function(d,f,v){d instanceof o?d.set_object_at(f,v):d[f]=v}},{key:"_swap",value:function(d,f,v){var p=this._get(d,f);this._set(d,f,this._get(d,v)),this._set(d,v,p)}},{key:"_defaultCompareFunction",value:function(d,f){return f>d}}]),u}();r.exports=l},function(r,n,a){function i(){}i.svd=function(s){this.U=null,this.V=null,this.s=null,this.m=0,this.n=0,this.m=s.length,this.n=s[0].length;var o=Math.min(this.m,this.n);this.s=function($e){for(var He=[];$e-- >0;)He.push(0);return He}(Math.min(this.m+1,this.n)),this.U=function($e){var He=function ct(gt){if(gt.length==0)return 0;for(var tt=[],lt=0;lt<gt[0];lt++)tt.push(ct(gt.slice(1)));return tt};return He($e)}([this.m,o]),this.V=function($e){var He=function ct(gt){if(gt.length==0)return 0;for(var tt=[],lt=0;lt<gt[0];lt++)tt.push(ct(gt.slice(1)));return tt};return He($e)}([this.n,this.n]);for(var l=function($e){for(var He=[];$e-- >0;)He.push(0);return He}(this.n),u=function($e){for(var He=[];$e-- >0;)He.push(0);return He}(this.m),c=!0,d=Math.min(this.m-1,this.n),f=Math.max(0,Math.min(this.n-2,this.m)),v=0;v<Math.max(d,f);v++){if(v<d){this.s[v]=0;for(var p=v;p<this.m;p++)this.s[v]=i.hypot(this.s[v],s[p][v]);if(this.s[v]!==0){s[v][v]<0&&(this.s[v]=-this.s[v]);for(var y=v;y<this.m;y++)s[y][v]/=this.s[v];s[v][v]+=1}this.s[v]=-this.s[v]}for(var m=v+1;m<this.n;m++){if(function($e,He){return $e&&He}(v<d,this.s[v]!==0)){for(var g=0,x=v;x<this.m;x++)g+=s[x][v]*s[x][m];g=-g/s[v][v];for(var b=v;b<this.m;b++)s[b][m]+=g*s[b][v]}l[m]=s[v][m]}if(function($e,He){return $e&&He}(c,v<d))for(var w=v;w<this.m;w++)this.U[w][v]=s[w][v];if(v<f){l[v]=0;for(var E=v+1;E<this.n;E++)l[v]=i.hypot(l[v],l[E]);if(l[v]!==0){l[v+1]<0&&(l[v]=-l[v]);for(var C=v+1;C<this.n;C++)l[C]/=l[v];l[v+1]+=1}if(l[v]=-l[v],function($e,He){return $e&&He}(v+1<this.m,l[v]!==0)){for(var S=v+1;S<this.m;S++)u[S]=0;for(var T=v+1;T<this.n;T++)for(var P=v+1;P<this.m;P++)u[P]+=l[T]*s[P][T];for(var A=v+1;A<this.n;A++)for(var j=-l[A]/l[v+1],R=v+1;R<this.m;R++)s[R][A]+=j*u[R]}for(var O=v+1;O<this.n;O++)this.V[O][v]=l[O]}}var N=Math.min(this.n,this.m+1);d<this.n&&(this.s[d]=s[d][d]),this.m<N&&(this.s[N-1]=0),f+1<N&&(l[f]=s[f][N-1]),l[N-1]=0;{for(var D=d;D<o;D++){for(var L=0;L<this.m;L++)this.U[L][D]=0;this.U[D][D]=1}for(var _=d-1;_>=0;_--)if(this.s[_]!==0){for(var k=_+1;k<o;k++){for(var I=0,F=_;F<this.m;F++)I+=this.U[F][_]*this.U[F][k];I=-I/this.U[_][_];for(var B=_;B<this.m;B++)this.U[B][k]+=I*this.U[B][_]}for(var $=_;$<this.m;$++)this.U[$][_]=-this.U[$][_];this.U[_][_]=1+this.U[_][_];for(var W=0;W<_-1;W++)this.U[W][_]=0}else{for(var z=0;z<this.m;z++)this.U[z][_]=0;this.U[_][_]=1}}for(var q=this.n-1;q>=0;q--){if(function($e,He){return $e&&He}(q<f,l[q]!==0))for(var G=q+1;G<o;G++){for(var J=0,ae=q+1;ae<this.n;ae++)J+=this.V[ae][q]*this.V[ae][G];J=-J/this.V[q+1][q];for(var Y=q+1;Y<this.n;Y++)this.V[Y][G]+=J*this.V[Y][q]}for(var H=0;H<this.n;H++)this.V[H][q]=0;this.V[q][q]=1}for(var X=N-1,ee=Math.pow(2,-52),ie=Math.pow(2,-966);N>0;){var oe=void 0,me=void 0;for(oe=N-2;oe>=-1&&oe!==-1;oe--)if(Math.abs(l[oe])<=ie+ee*(Math.abs(this.s[oe])+Math.abs(this.s[oe+1]))){l[oe]=0;break}if(oe===N-2)me=4;else{var De=void 0;for(De=N-1;De>=oe&&De!==oe;De--){var ge=(De!==N?Math.abs(l[De]):0)+(De!==oe+1?Math.abs(l[De-1]):0);if(Math.abs(this.s[De])<=ie+ee*ge){this.s[De]=0;break}}De===oe?me=3:De===N-1?me=1:(me=2,oe=De)}switch(oe++,me){case 1:{var pe=l[N-2];l[N-2]=0;for(var we=N-2;we>=oe;we--){var xe=i.hypot(this.s[we],pe),Ee=this.s[we]/xe,V=pe/xe;this.s[we]=xe,we!==oe&&(pe=-V*l[we-1],l[we-1]=Ee*l[we-1]);for(var K=0;K<this.n;K++)xe=Ee*this.V[K][we]+V*this.V[K][N-1],this.V[K][N-1]=-V*this.V[K][we]+Ee*this.V[K][N-1],this.V[K][we]=xe}}break;case 2:{var te=l[oe-1];l[oe-1]=0;for(var ue=oe;ue<N;ue++){var fe=i.hypot(this.s[ue],te),ve=this.s[ue]/fe,be=te/fe;this.s[ue]=fe,te=-be*l[ue],l[ue]=ve*l[ue];for(var Ne=0;Ne<this.m;Ne++)fe=ve*this.U[Ne][ue]+be*this.U[Ne][oe-1],this.U[Ne][oe-1]=-be*this.U[Ne][ue]+ve*this.U[Ne][oe-1],this.U[Ne][ue]=fe}}break;case 3:{var Ce=Math.max(Math.max(Math.max(Math.max(Math.abs(this.s[N-1]),Math.abs(this.s[N-2])),Math.abs(l[N-2])),Math.abs(this.s[oe])),Math.abs(l[oe])),Re=this.s[N-1]/Ce,Z=this.s[N-2]/Ce,M=l[N-2]/Ce,Q=this.s[oe]/Ce,ne=l[oe]/Ce,re=((Z+Re)*(Z-Re)+M*M)/2,se=Re*M*(Re*M),ye=0;(function($e,He){return $e||He})(re!==0,se!==0)&&(ye=Math.sqrt(re*re+se),re<0&&(ye=-ye),ye=se/(re+ye));for(var le=(Q+Re)*(Q-Re)+ye,he=Q*ne,de=oe;de<N-1;de++){var Se=i.hypot(le,he),Oe=le/Se,Le=he/Se;de!==oe&&(l[de-1]=Se),le=Oe*this.s[de]+Le*l[de],l[de]=Oe*l[de]-Le*this.s[de],he=Le*this.s[de+1],this.s[de+1]=Oe*this.s[de+1];for(var ke=0;ke<this.n;ke++)Se=Oe*this.V[ke][de]+Le*this.V[ke][de+1],this.V[ke][de+1]=-Le*this.V[ke][de]+Oe*this.V[ke][de+1],this.V[ke][de]=Se;if(Se=i.hypot(le,he),Oe=le/Se,Le=he/Se,this.s[de]=Se,le=Oe*l[de]+Le*this.s[de+1],this.s[de+1]=-Le*l[de]+Oe*this.s[de+1],he=Le*l[de+1],l[de+1]=Oe*l[de+1],de<this.m-1)for(var Ae=0;Ae<this.m;Ae++)Se=Oe*this.U[Ae][de]+Le*this.U[Ae][de+1],this.U[Ae][de+1]=-Le*this.U[Ae][de]+Oe*this.U[Ae][de+1],this.U[Ae][de]=Se}l[N-2]=le}break;case 4:{if(this.s[oe]<=0){this.s[oe]=this.s[oe]<0?-this.s[oe]:0;for(var Te=0;Te<=X;Te++)this.V[Te][oe]=-this.V[Te][oe]}for(;oe<X&&!(this.s[oe]>=this.s[oe+1]);){var Ge=this.s[oe];if(this.s[oe]=this.s[oe+1],this.s[oe+1]=Ge,oe<this.n-1)for(var Me=0;Me<this.n;Me++)Ge=this.V[Me][oe+1],this.V[Me][oe+1]=this.V[Me][oe],this.V[Me][oe]=Ge;if(oe<this.m-1)for(var Ie=0;Ie<this.m;Ie++)Ge=this.U[Ie][oe+1],this.U[Ie][oe+1]=this.U[Ie][oe],this.U[Ie][oe]=Ge;oe++}N--}break}}var Ze={U:this.U,V:this.V,S:this.s};return Ze},i.hypot=function(s,o){var l=void 0;return Math.abs(s)>Math.abs(o)?(l=o/s,l=Math.abs(s)*Math.sqrt(1+l*l)):o!=0?(l=s/o,l=Math.abs(o)*Math.sqrt(1+l*l)):l=0,l},r.exports=i},function(r,n,a){var i=function(){function l(u,c){for(var d=0;d<c.length;d++){var f=c[d];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(u,f.key,f)}}return function(u,c,d){return c&&l(u.prototype,c),d&&l(u,d),u}}();function s(l,u){if(!(l instanceof u))throw new TypeError("Cannot call a class as a function")}var o=function(){function l(u,c){var d=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,f=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,v=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;s(this,l),this.sequence1=u,this.sequence2=c,this.match_score=d,this.mismatch_penalty=f,this.gap_penalty=v,this.iMax=u.length+1,this.jMax=c.length+1,this.grid=new Array(this.iMax);for(var p=0;p<this.iMax;p++){this.grid[p]=new Array(this.jMax);for(var y=0;y<this.jMax;y++)this.grid[p][y]=0}this.tracebackGrid=new Array(this.iMax);for(var m=0;m<this.iMax;m++){this.tracebackGrid[m]=new Array(this.jMax);for(var g=0;g<this.jMax;g++)this.tracebackGrid[m][g]=[null,null,null]}this.alignments=[],this.score=-1,this.computeGrids()}return i(l,[{key:"getScore",value:function(){return this.score}},{key:"getAlignments",value:function(){return this.alignments}},{key:"computeGrids",value:function(){for(var c=1;c<this.jMax;c++)this.grid[0][c]=this.grid[0][c-1]+this.gap_penalty,this.tracebackGrid[0][c]=[!1,!1,!0];for(var d=1;d<this.iMax;d++)this.grid[d][0]=this.grid[d-1][0]+this.gap_penalty,this.tracebackGrid[d][0]=[!1,!0,!1];for(var f=1;f<this.iMax;f++)for(var v=1;v<this.jMax;v++){var p=void 0;this.sequence1[f-1]===this.sequence2[v-1]?p=this.grid[f-1][v-1]+this.match_score:p=this.grid[f-1][v-1]+this.mismatch_penalty;var y=this.grid[f-1][v]+this.gap_penalty,m=this.grid[f][v-1]+this.gap_penalty,g=[p,y,m],x=this.arrayAllMaxIndexes(g);this.grid[f][v]=g[x[0]],this.tracebackGrid[f][v]=[x.includes(0),x.includes(1),x.includes(2)]}this.score=this.grid[this.iMax-1][this.jMax-1]}},{key:"alignmentTraceback",value:function(){var c=[];for(c.push({pos:[this.sequence1.length,this.sequence2.length],seq1:"",seq2:""});c[0];){var d=c[0],f=this.tracebackGrid[d.pos[0]][d.pos[1]];f[0]&&c.push({pos:[d.pos[0]-1,d.pos[1]-1],seq1:this.sequence1[d.pos[0]-1]+d.seq1,seq2:this.sequence2[d.pos[1]-1]+d.seq2}),f[1]&&c.push({pos:[d.pos[0]-1,d.pos[1]],seq1:this.sequence1[d.pos[0]-1]+d.seq1,seq2:"-"+d.seq2}),f[2]&&c.push({pos:[d.pos[0],d.pos[1]-1],seq1:"-"+d.seq1,seq2:this.sequence2[d.pos[1]-1]+d.seq2}),d.pos[0]===0&&d.pos[1]===0&&this.alignments.push({sequence1:d.seq1,sequence2:d.seq2}),c.shift()}return this.alignments}},{key:"getAllIndexes",value:function(c,d){for(var f=[],v=-1;(v=c.indexOf(d,v+1))!==-1;)f.push(v);return f}},{key:"arrayAllMaxIndexes",value:function(c){return this.getAllIndexes(c,Math.max.apply(null,c))}}]),l}();r.exports=o},function(r,n,a){var i=function(){};i.FDLayout=a(18),i.FDLayoutConstants=a(4),i.FDLayoutEdge=a(19),i.FDLayoutNode=a(20),i.DimensionD=a(21),i.HashMap=a(22),i.HashSet=a(23),i.IGeometry=a(8),i.IMath=a(9),i.Integer=a(10),i.Point=a(12),i.PointD=a(5),i.RandomSeed=a(16),i.RectangleD=a(13),i.Transform=a(17),i.UniqueIDGeneretor=a(14),i.Quicksort=a(25),i.LinkedList=a(11),i.LGraphObject=a(2),i.LGraph=a(6),i.LEdge=a(1),i.LGraphManager=a(7),i.LNode=a(3),i.Layout=a(15),i.LayoutConstants=a(0),i.NeedlemanWunsch=a(27),i.Matrix=a(24),i.SVD=a(26),r.exports=i},function(r,n,a){function i(){this.listeners=[]}var s=i.prototype;s.addListener=function(o,l){this.listeners.push({event:o,callback:l})},s.removeListener=function(o,l){for(var u=this.listeners.length;u>=0;u--){var c=this.listeners[u];c.event===o&&c.callback===l&&this.listeners.splice(u,1)}},s.emit=function(o,l){for(var u=0;u<this.listeners.length;u++){var c=this.listeners[u];o===c.event&&c.callback(l)}},r.exports=i}])})}(fb)),fb.exports}var yD;function V7(){return yD||(yD=1,function(t,e){(function(n,a){t.exports=a($7())})(Ja,function(r){return(()=>{var n={45:(o,l,u)=>{var c={};c.layoutBase=u(551),c.CoSEConstants=u(806),c.CoSEEdge=u(767),c.CoSEGraph=u(880),c.CoSEGraphManager=u(578),c.CoSELayout=u(765),c.CoSENode=u(991),c.ConstraintHandler=u(902),o.exports=c},806:(o,l,u)=>{var c=u(551).FDLayoutConstants;function d(){}for(var f in c)d[f]=c[f];d.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,d.DEFAULT_RADIAL_SEPARATION=c.DEFAULT_EDGE_LENGTH,d.DEFAULT_COMPONENT_SEPERATION=60,d.TILE=!0,d.TILING_PADDING_VERTICAL=10,d.TILING_PADDING_HORIZONTAL=10,d.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,d.ENFORCE_CONSTRAINTS=!0,d.APPLY_LAYOUT=!0,d.RELAX_MOVEMENT_ON_CONSTRAINTS=!0,d.TREE_REDUCTION_ON_INCREMENTAL=!0,d.PURE_INCREMENTAL=d.DEFAULT_INCREMENTAL,o.exports=d},767:(o,l,u)=>{var c=u(551).FDLayoutEdge;function d(v,p,y){c.call(this,v,p,y)}d.prototype=Object.create(c.prototype);for(var f in c)d[f]=c[f];o.exports=d},880:(o,l,u)=>{var c=u(551).LGraph;function d(v,p,y){c.call(this,v,p,y)}d.prototype=Object.create(c.prototype);for(var f in c)d[f]=c[f];o.exports=d},578:(o,l,u)=>{var c=u(551).LGraphManager;function d(v){c.call(this,v)}d.prototype=Object.create(c.prototype);for(var f in c)d[f]=c[f];o.exports=d},765:(o,l,u)=>{var c=u(551).FDLayout,d=u(578),f=u(880),v=u(991),p=u(767),y=u(806),m=u(902),g=u(551).FDLayoutConstants,x=u(551).LayoutConstants,b=u(551).Point,w=u(551).PointD,E=u(551).DimensionD,C=u(551).Layout,S=u(551).Integer,T=u(551).IGeometry,P=u(551).LGraph,A=u(551).Transform,j=u(551).LinkedList;function R(){c.call(this),this.toBeTiled={},this.constraints={}}R.prototype=Object.create(c.prototype);for(var O in c)R[O]=c[O];R.prototype.newGraphManager=function(){var N=new d(this);return this.graphManager=N,N},R.prototype.newGraph=function(N){return new f(null,this.graphManager,N)},R.prototype.newNode=function(N){return new v(this.graphManager,N)},R.prototype.newEdge=function(N){return new p(null,null,N)},R.prototype.initParameters=function(){c.prototype.initParameters.call(this,arguments),this.isSubLayout||(y.DEFAULT_EDGE_LENGTH<10?this.idealEdgeLength=10:this.idealEdgeLength=y.DEFAULT_EDGE_LENGTH,this.useSmartIdealEdgeLengthCalculation=y.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=g.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=g.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=g.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=g.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.prunedNodesAll=[],this.growTreeIterations=0,this.afterGrowthIterations=0,this.isTreeGrowing=!1,this.isGrowthFinished=!1)},R.prototype.initSpringEmbedder=function(){c.prototype.initSpringEmbedder.call(this),this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/g.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=.04,this.coolingAdjuster=1},R.prototype.layout=function(){var N=x.DEFAULT_CREATE_BENDS_AS_NEEDED;return N&&(this.createBendpoints(),this.graphManager.resetAllEdges()),this.level=0,this.classicLayout()},R.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){if(y.TREE_REDUCTION_ON_INCREMENTAL){this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var D=new Set(this.getAllNodes()),L=this.nodesWithGravity.filter(function(I){return D.has(I)});this.graphManager.setAllNodesToApplyGravitation(L)}}else{var N=this.getFlatForest();if(N.length>0)this.positionNodesRadially(N);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var D=new Set(this.getAllNodes()),L=this.nodesWithGravity.filter(function(_){return D.has(_)});this.graphManager.setAllNodesToApplyGravitation(L),this.positionNodesRandomly()}}return Object.keys(this.constraints).length>0&&(m.handleConstraints(this),this.initConstraintVariables()),this.initSpringEmbedder(),y.APPLY_LAYOUT&&this.runSpringEmbedder(),!0},R.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%g.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged())if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;this.coolingCycle++,this.layoutQuality==0?this.coolingAdjuster=this.coolingCycle: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 N=new Set(this.getAllNodes()),D=this.nodesWithGravity.filter(function(k){return N.has(k)});this.graphManager.setAllNodesToApplyGravitation(D),this.graphManager.updateBounds(),this.updateGrid(),y.PURE_INCREMENTAL?this.coolingFactor=g.DEFAULT_COOLING_FACTOR_INCREMENTAL/2:this.coolingFactor=g.DEFAULT_COOLING_FACTOR_INCREMENTAL}else this.isTreeGrowing=!1,this.isGrowthFinished=!0;this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged())return!0;this.afterGrowthIterations%10==0&&(this.graphManager.updateBounds(),this.updateGrid()),y.PURE_INCREMENTAL?this.coolingFactor=g.DEFAULT_COOLING_FACTOR_INCREMENTAL/2*((100-this.afterGrowthIterations)/100):this.coolingFactor=g.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var L=!this.isTreeGrowing&&!this.isGrowthFinished,_=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(L,_),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},R.prototype.getPositionsData=function(){for(var N=this.graphManager.getAllNodes(),D={},L=0;L<N.length;L++){var _=N[L].rect,k=N[L].id;D[k]={id:k,x:_.getCenterX(),y:_.getCenterY(),w:_.width,h:_.height}}return D},R.prototype.runSpringEmbedder=function(){this.initialAnimationPeriod=25,this.animationPeriod=this.initialAnimationPeriod;var N=!1;if(g.ANIMATE==="during")this.emit("layoutstarted");else{for(;!N;)N=this.tick();this.graphManager.updateBounds()}},R.prototype.moveNodes=function(){for(var N=this.getAllNodes(),D,L=0;L<N.length;L++)D=N[L],D.calculateDisplacement();Object.keys(this.constraints).length>0&&this.updateDisplacements();for(var L=0;L<N.length;L++)D=N[L],D.move()},R.prototype.initConstraintVariables=function(){var N=this;this.idToNodeMap=new Map,this.fixedNodeSet=new Set;for(var D=this.graphManager.getAllNodes(),L=0;L<D.length;L++){var _=D[L];this.idToNodeMap.set(_.id,_)}var k=function Y(H){for(var X=H.getChild().getNodes(),ee,ie=0,oe=0;oe<X.length;oe++)ee=X[oe],ee.getChild()==null?N.fixedNodeSet.has(ee.id)&&(ie+=100):ie+=Y(ee);return ie};if(this.constraints.fixedNodeConstraint){this.constraints.fixedNodeConstraint.forEach(function(X){N.fixedNodeSet.add(X.nodeId)});for(var D=this.graphManager.getAllNodes(),_,L=0;L<D.length;L++)if(_=D[L],_.getChild()!=null){var I=k(_);I>0&&(_.fixedNodeWeight=I)}}if(this.constraints.relativePlacementConstraint){var F=new Map,B=new Map;if(this.dummyToNodeForVerticalAlignment=new Map,this.dummyToNodeForHorizontalAlignment=new Map,this.fixedNodesOnHorizontal=new Set,this.fixedNodesOnVertical=new Set,this.fixedNodeSet.forEach(function(Y){N.fixedNodesOnHorizontal.add(Y),N.fixedNodesOnVertical.add(Y)}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var $=this.constraints.alignmentConstraint.vertical,L=0;L<$.length;L++)this.dummyToNodeForVerticalAlignment.set("dummy"+L,[]),$[L].forEach(function(H){F.set(H,"dummy"+L),N.dummyToNodeForVerticalAlignment.get("dummy"+L).push(H),N.fixedNodeSet.has(H)&&N.fixedNodesOnHorizontal.add("dummy"+L)});if(this.constraints.alignmentConstraint.horizontal)for(var W=this.constraints.alignmentConstraint.horizontal,L=0;L<W.length;L++)this.dummyToNodeForHorizontalAlignment.set("dummy"+L,[]),W[L].forEach(function(H){B.set(H,"dummy"+L),N.dummyToNodeForHorizontalAlignment.get("dummy"+L).push(H),N.fixedNodeSet.has(H)&&N.fixedNodesOnVertical.add("dummy"+L)})}if(y.RELAX_MOVEMENT_ON_CONSTRAINTS)this.shuffle=function(Y){var H,X,ee;for(ee=Y.length-1;ee>=2*Y.length/3;ee--)H=Math.floor(Math.random()*(ee+1)),X=Y[ee],Y[ee]=Y[H],Y[H]=X;return Y},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(Y){if(Y.left){var H=F.has(Y.left)?F.get(Y.left):Y.left,X=F.has(Y.right)?F.get(Y.right):Y.right;N.nodesInRelativeHorizontal.includes(H)||(N.nodesInRelativeHorizontal.push(H),N.nodeToRelativeConstraintMapHorizontal.set(H,[]),N.dummyToNodeForVerticalAlignment.has(H)?N.nodeToTempPositionMapHorizontal.set(H,N.idToNodeMap.get(N.dummyToNodeForVerticalAlignment.get(H)[0]).getCenterX()):N.nodeToTempPositionMapHorizontal.set(H,N.idToNodeMap.get(H).getCenterX())),N.nodesInRelativeHorizontal.includes(X)||(N.nodesInRelativeHorizontal.push(X),N.nodeToRelativeConstraintMapHorizontal.set(X,[]),N.dummyToNodeForVerticalAlignment.has(X)?N.nodeToTempPositionMapHorizontal.set(X,N.idToNodeMap.get(N.dummyToNodeForVerticalAlignment.get(X)[0]).getCenterX()):N.nodeToTempPositionMapHorizontal.set(X,N.idToNodeMap.get(X).getCenterX())),N.nodeToRelativeConstraintMapHorizontal.get(H).push({right:X,gap:Y.gap}),N.nodeToRelativeConstraintMapHorizontal.get(X).push({left:H,gap:Y.gap})}else{var ee=B.has(Y.top)?B.get(Y.top):Y.top,ie=B.has(Y.bottom)?B.get(Y.bottom):Y.bottom;N.nodesInRelativeVertical.includes(ee)||(N.nodesInRelativeVertical.push(ee),N.nodeToRelativeConstraintMapVertical.set(ee,[]),N.dummyToNodeForHorizontalAlignment.has(ee)?N.nodeToTempPositionMapVertical.set(ee,N.idToNodeMap.get(N.dummyToNodeForHorizontalAlignment.get(ee)[0]).getCenterY()):N.nodeToTempPositionMapVertical.set(ee,N.idToNodeMap.get(ee).getCenterY())),N.nodesInRelativeVertical.includes(ie)||(N.nodesInRelativeVertical.push(ie),N.nodeToRelativeConstraintMapVertical.set(ie,[]),N.dummyToNodeForHorizontalAlignment.has(ie)?N.nodeToTempPositionMapVertical.set(ie,N.idToNodeMap.get(N.dummyToNodeForHorizontalAlignment.get(ie)[0]).getCenterY()):N.nodeToTempPositionMapVertical.set(ie,N.idToNodeMap.get(ie).getCenterY())),N.nodeToRelativeConstraintMapVertical.get(ee).push({bottom:ie,gap:Y.gap}),N.nodeToRelativeConstraintMapVertical.get(ie).push({top:ee,gap:Y.gap})}});else{var z=new Map,q=new Map;this.constraints.relativePlacementConstraint.forEach(function(Y){if(Y.left){var H=F.has(Y.left)?F.get(Y.left):Y.left,X=F.has(Y.right)?F.get(Y.right):Y.right;z.has(H)?z.get(H).push(X):z.set(H,[X]),z.has(X)?z.get(X).push(H):z.set(X,[H])}else{var ee=B.has(Y.top)?B.get(Y.top):Y.top,ie=B.has(Y.bottom)?B.get(Y.bottom):Y.bottom;q.has(ee)?q.get(ee).push(ie):q.set(ee,[ie]),q.has(ie)?q.get(ie).push(ee):q.set(ie,[ee])}});var G=function(H,X){var ee=[],ie=[],oe=new j,me=new Set,De=0;return H.forEach(function(ge,pe){if(!me.has(pe)){ee[De]=[],ie[De]=!1;var we=pe;for(oe.push(we),me.add(we),ee[De].push(we);oe.length!=0;){we=oe.shift(),X.has(we)&&(ie[De]=!0);var xe=H.get(we);xe.forEach(function(Ee){me.has(Ee)||(oe.push(Ee),me.add(Ee),ee[De].push(Ee))})}De++}}),{components:ee,isFixed:ie}},J=G(z,N.fixedNodesOnHorizontal);this.componentsOnHorizontal=J.components,this.fixedComponentsOnHorizontal=J.isFixed;var ae=G(q,N.fixedNodesOnVertical);this.componentsOnVertical=ae.components,this.fixedComponentsOnVertical=ae.isFixed}}},R.prototype.updateDisplacements=function(){var N=this;if(this.constraints.fixedNodeConstraint&&this.constraints.fixedNodeConstraint.forEach(function(ae){var Y=N.idToNodeMap.get(ae.nodeId);Y.displacementX=0,Y.displacementY=0}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var D=this.constraints.alignmentConstraint.vertical,L=0;L<D.length;L++){for(var _=0,k=0;k<D[L].length;k++){if(this.fixedNodeSet.has(D[L][k])){_=0;break}_+=this.idToNodeMap.get(D[L][k]).displacementX}for(var I=_/D[L].length,k=0;k<D[L].length;k++)this.idToNodeMap.get(D[L][k]).displacementX=I}if(this.constraints.alignmentConstraint.horizontal)for(var F=this.constraints.alignmentConstraint.horizontal,L=0;L<F.length;L++){for(var B=0,k=0;k<F[L].length;k++){if(this.fixedNodeSet.has(F[L][k])){B=0;break}B+=this.idToNodeMap.get(F[L][k]).displacementY}for(var $=B/F[L].length,k=0;k<F[L].length;k++)this.idToNodeMap.get(F[L][k]).displacementY=$}}if(this.constraints.relativePlacementConstraint)if(y.RELAX_MOVEMENT_ON_CONSTRAINTS)this.totalIterations%10==0&&(this.shuffle(this.nodesInRelativeHorizontal),this.shuffle(this.nodesInRelativeVertical)),this.nodesInRelativeHorizontal.forEach(function(ae){if(!N.fixedNodesOnHorizontal.has(ae)){var Y=0;N.dummyToNodeForVerticalAlignment.has(ae)?Y=N.idToNodeMap.get(N.dummyToNodeForVerticalAlignment.get(ae)[0]).displacementX:Y=N.idToNodeMap.get(ae).displacementX,N.nodeToRelativeConstraintMapHorizontal.get(ae).forEach(function(H){if(H.right){var X=N.nodeToTempPositionMapHorizontal.get(H.right)-N.nodeToTempPositionMapHorizontal.get(ae)-Y;X<H.gap&&(Y-=H.gap-X)}else{var X=N.nodeToTempPositionMapHorizontal.get(ae)-N.nodeToTempPositionMapHorizontal.get(H.left)+Y;X<H.gap&&(Y+=H.gap-X)}}),N.nodeToTempPositionMapHorizontal.set(ae,N.nodeToTempPositionMapHorizontal.get(ae)+Y),N.dummyToNodeForVerticalAlignment.has(ae)?N.dummyToNodeForVerticalAlignment.get(ae).forEach(function(H){N.idToNodeMap.get(H).displacementX=Y}):N.idToNodeMap.get(ae).displacementX=Y}}),this.nodesInRelativeVertical.forEach(function(ae){if(!N.fixedNodesOnHorizontal.has(ae)){var Y=0;N.dummyToNodeForHorizontalAlignment.has(ae)?Y=N.idToNodeMap.get(N.dummyToNodeForHorizontalAlignment.get(ae)[0]).displacementY:Y=N.idToNodeMap.get(ae).displacementY,N.nodeToRelativeConstraintMapVertical.get(ae).forEach(function(H){if(H.bottom){var X=N.nodeToTempPositionMapVertical.get(H.bottom)-N.nodeToTempPositionMapVertical.get(ae)-Y;X<H.gap&&(Y-=H.gap-X)}else{var X=N.nodeToTempPositionMapVertical.get(ae)-N.nodeToTempPositionMapVertical.get(H.top)+Y;X<H.gap&&(Y+=H.gap-X)}}),N.nodeToTempPositionMapVertical.set(ae,N.nodeToTempPositionMapVertical.get(ae)+Y),N.dummyToNodeForHorizontalAlignment.has(ae)?N.dummyToNodeForHorizontalAlignment.get(ae).forEach(function(H){N.idToNodeMap.get(H).displacementY=Y}):N.idToNodeMap.get(ae).displacementY=Y}});else{for(var L=0;L<this.componentsOnHorizontal.length;L++){var W=this.componentsOnHorizontal[L];if(this.fixedComponentsOnHorizontal[L])for(var k=0;k<W.length;k++)this.dummyToNodeForVerticalAlignment.has(W[k])?this.dummyToNodeForVerticalAlignment.get(W[k]).forEach(function(H){N.idToNodeMap.get(H).displacementX=0}):this.idToNodeMap.get(W[k]).displacementX=0;else{for(var z=0,q=0,k=0;k<W.length;k++)if(this.dummyToNodeForVerticalAlignment.has(W[k])){var G=this.dummyToNodeForVerticalAlignment.get(W[k]);z+=G.length*this.idToNodeMap.get(G[0]).displacementX,q+=G.length}else z+=this.idToNodeMap.get(W[k]).displacementX,q++;for(var J=z/q,k=0;k<W.length;k++)this.dummyToNodeForVerticalAlignment.has(W[k])?this.dummyToNodeForVerticalAlignment.get(W[k]).forEach(function(H){N.idToNodeMap.get(H).displacementX=J}):this.idToNodeMap.get(W[k]).displacementX=J}}for(var L=0;L<this.componentsOnVertical.length;L++){var W=this.componentsOnVertical[L];if(this.fixedComponentsOnVertical[L])for(var k=0;k<W.length;k++)this.dummyToNodeForHorizontalAlignment.has(W[k])?this.dummyToNodeForHorizontalAlignment.get(W[k]).forEach(function(X){N.idToNodeMap.get(X).displacementY=0}):this.idToNodeMap.get(W[k]).displacementY=0;else{for(var z=0,q=0,k=0;k<W.length;k++)if(this.dummyToNodeForHorizontalAlignment.has(W[k])){var G=this.dummyToNodeForHorizontalAlignment.get(W[k]);z+=G.length*this.idToNodeMap.get(G[0]).displacementY,q+=G.length}else z+=this.idToNodeMap.get(W[k]).displacementY,q++;for(var J=z/q,k=0;k<W.length;k++)this.dummyToNodeForHorizontalAlignment.has(W[k])?this.dummyToNodeForHorizontalAlignment.get(W[k]).forEach(function(oe){N.idToNodeMap.get(oe).displacementY=J}):this.idToNodeMap.get(W[k]).displacementY=J}}}},R.prototype.calculateNodesToApplyGravitationTo=function(){var N=[],D,L=this.graphManager.getGraphs(),_=L.length,k;for(k=0;k<_;k++)D=L[k],D.updateConnected(),D.isConnected||(N=N.concat(D.getNodes()));return N},R.prototype.createBendpoints=function(){var N=[];N=N.concat(this.graphManager.getAllEdges());var D=new Set,L;for(L=0;L<N.length;L++){var _=N[L];if(!D.has(_)){var k=_.getSource(),I=_.getTarget();if(k==I)_.getBendpoints().push(new w),_.getBendpoints().push(new w),this.createDummyNodesForBendpoints(_),D.add(_);else{var F=[];if(F=F.concat(k.getEdgeListToNode(I)),F=F.concat(I.getEdgeListToNode(k)),!D.has(F[0])){if(F.length>1){var B;for(B=0;B<F.length;B++){var $=F[B];$.getBendpoints().push(new w),this.createDummyNodesForBendpoints($)}}F.forEach(function(W){D.add(W)})}}}if(D.size==N.length)break}},R.prototype.positionNodesRadially=function(N){for(var D=new b(0,0),L=Math.ceil(Math.sqrt(N.length)),_=0,k=0,I=0,F=new w(0,0),B=0;B<N.length;B++){B%L==0&&(I=0,k=_,B!=0&&(k+=y.DEFAULT_COMPONENT_SEPERATION),_=0);var $=N[B],W=C.findCenterOfTree($);D.x=I,D.y=k,F=R.radialLayout($,W,D),F.y>_&&(_=Math.floor(F.y)),I=Math.floor(F.x+y.DEFAULT_COMPONENT_SEPERATION)}this.transform(new w(x.WORLD_CENTER_X-F.x/2,x.WORLD_CENTER_Y-F.y/2))},R.radialLayout=function(N,D,L){var _=Math.max(this.maxDiagonalInTree(N),y.DEFAULT_RADIAL_SEPARATION);R.branchRadialLayout(D,null,0,359,0,_);var k=P.calculateBounds(N),I=new A;I.setDeviceOrgX(k.getMinX()),I.setDeviceOrgY(k.getMinY()),I.setWorldOrgX(L.x),I.setWorldOrgY(L.y);for(var F=0;F<N.length;F++){var B=N[F];B.transform(I)}var $=new w(k.getMaxX(),k.getMaxY());return I.inverseTransformPoint($)},R.branchRadialLayout=function(N,D,L,_,k,I){var F=(_-L+1)/2;F<0&&(F+=180);var B=(F+L)%360,$=B*T.TWO_PI/360,W=k*Math.cos($),z=k*Math.sin($);N.setCenter(W,z);var q=[];q=q.concat(N.getEdges());var G=q.length;D!=null&&G--;for(var J=0,ae=q.length,Y,H=N.getEdgesBetween(D);H.length>1;){var X=H[0];H.splice(0,1);var ee=q.indexOf(X);ee>=0&&q.splice(ee,1),ae--,G--}D!=null?Y=(q.indexOf(H[0])+1)%ae:Y=0;for(var ie=Math.abs(_-L)/G,oe=Y;J!=G;oe=++oe%ae){var me=q[oe].getOtherEnd(N);if(me!=D){var De=(L+J*ie)%360,ge=(De+ie)%360;R.branchRadialLayout(me,N,De,ge,k+I,I),J++}}},R.maxDiagonalInTree=function(N){for(var D=S.MIN_VALUE,L=0;L<N.length;L++){var _=N[L],k=_.getDiagonal();k>D&&(D=k)}return D},R.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},R.prototype.groupZeroDegreeMembers=function(){var N=this,D={};this.memberGroups={},this.idToDummyNode={};for(var L=[],_=this.graphManager.getAllNodes(),k=0;k<_.length;k++){var I=_[k],F=I.getParent();this.getNodeDegreeWithChildren(I)===0&&(F.id==null||!this.getToBeTiled(F))&&L.push(I)}for(var k=0;k<L.length;k++){var I=L[k],B=I.getParent().id;typeof D[B]>"u"&&(D[B]=[]),D[B]=D[B].concat(I)}Object.keys(D).forEach(function($){if(D[$].length>1){var W="DummyCompound_"+$;N.memberGroups[W]=D[$];var z=D[$][0].getParent(),q=new v(N.graphManager);q.id=W,q.paddingLeft=z.paddingLeft||0,q.paddingRight=z.paddingRight||0,q.paddingBottom=z.paddingBottom||0,q.paddingTop=z.paddingTop||0,N.idToDummyNode[W]=q;var G=N.getGraphManager().add(N.newGraph(),q),J=z.getChild();J.add(q);for(var ae=0;ae<D[$].length;ae++){var Y=D[$][ae];J.remove(Y),G.add(Y)}}})},R.prototype.clearCompounds=function(){var N={},D={};this.performDFSOnCompounds();for(var L=0;L<this.compoundOrder.length;L++)D[this.compoundOrder[L].id]=this.compoundOrder[L],N[this.compoundOrder[L].id]=[].concat(this.compoundOrder[L].getChild().getNodes()),this.graphManager.remove(this.compoundOrder[L].getChild()),this.compoundOrder[L].child=null;this.graphManager.resetAllNodes(),this.tileCompoundMembers(N,D)},R.prototype.clearZeroDegreeMembers=function(){var N=this,D=this.tiledZeroDegreePack=[];Object.keys(this.memberGroups).forEach(function(L){var _=N.idToDummyNode[L];if(D[L]=N.tileNodes(N.memberGroups[L],_.paddingLeft+_.paddingRight),_.rect.width=D[L].width,_.rect.height=D[L].height,_.setCenter(D[L].centerX,D[L].centerY),_.labelMarginLeft=0,_.labelMarginTop=0,y.NODE_DIMENSIONS_INCLUDE_LABELS){var k=_.rect.width,I=_.rect.height;_.labelWidth&&(_.labelPosHorizontal=="left"?(_.rect.x-=_.labelWidth,_.setWidth(k+_.labelWidth),_.labelMarginLeft=_.labelWidth):_.labelPosHorizontal=="center"&&_.labelWidth>k?(_.rect.x-=(_.labelWidth-k)/2,_.setWidth(_.labelWidth),_.labelMarginLeft=(_.labelWidth-k)/2):_.labelPosHorizontal=="right"&&_.setWidth(k+_.labelWidth)),_.labelHeight&&(_.labelPosVertical=="top"?(_.rect.y-=_.labelHeight,_.setHeight(I+_.labelHeight),_.labelMarginTop=_.labelHeight):_.labelPosVertical=="center"&&_.labelHeight>I?(_.rect.y-=(_.labelHeight-I)/2,_.setHeight(_.labelHeight),_.labelMarginTop=(_.labelHeight-I)/2):_.labelPosVertical=="bottom"&&_.setHeight(I+_.labelHeight))}})},R.prototype.repopulateCompounds=function(){for(var N=this.compoundOrder.length-1;N>=0;N--){var D=this.compoundOrder[N],L=D.id,_=D.paddingLeft,k=D.paddingTop,I=D.labelMarginLeft,F=D.labelMarginTop;this.adjustLocations(this.tiledMemberPack[L],D.rect.x,D.rect.y,_,k,I,F)}},R.prototype.repopulateZeroDegreeMembers=function(){var N=this,D=this.tiledZeroDegreePack;Object.keys(D).forEach(function(L){var _=N.idToDummyNode[L],k=_.paddingLeft,I=_.paddingTop,F=_.labelMarginLeft,B=_.labelMarginTop;N.adjustLocations(D[L],_.rect.x,_.rect.y,k,I,F,B)})},R.prototype.getToBeTiled=function(N){var D=N.id;if(this.toBeTiled[D]!=null)return this.toBeTiled[D];var L=N.getChild();if(L==null)return this.toBeTiled[D]=!1,!1;for(var _=L.getNodes(),k=0;k<_.length;k++){var I=_[k];if(this.getNodeDegree(I)>0)return this.toBeTiled[D]=!1,!1;if(I.getChild()==null){this.toBeTiled[I.id]=!1;continue}if(!this.getToBeTiled(I))return this.toBeTiled[D]=!1,!1}return this.toBeTiled[D]=!0,!0},R.prototype.getNodeDegree=function(N){N.id;for(var D=N.getEdges(),L=0,_=0;_<D.length;_++){var k=D[_];k.getSource().id!==k.getTarget().id&&(L=L+1)}return L},R.prototype.getNodeDegreeWithChildren=function(N){var D=this.getNodeDegree(N);if(N.getChild()==null)return D;for(var L=N.getChild().getNodes(),_=0;_<L.length;_++){var k=L[_];D+=this.getNodeDegreeWithChildren(k)}return D},R.prototype.performDFSOnCompounds=function(){this.compoundOrder=[],this.fillCompexOrderByDFS(this.graphManager.getRoot().getNodes())},R.prototype.fillCompexOrderByDFS=function(N){for(var D=0;D<N.length;D++){var L=N[D];L.getChild()!=null&&this.fillCompexOrderByDFS(L.getChild().getNodes()),this.getToBeTiled(L)&&this.compoundOrder.push(L)}},R.prototype.adjustLocations=function(N,D,L,_,k,I,F){D+=_+I,L+=k+F;for(var B=D,$=0;$<N.rows.length;$++){var W=N.rows[$];D=B;for(var z=0,q=0;q<W.length;q++){var G=W[q];G.rect.x=D,G.rect.y=L,D+=G.rect.width+N.horizontalPadding,G.rect.height>z&&(z=G.rect.height)}L+=z+N.verticalPadding}},R.prototype.tileCompoundMembers=function(N,D){var L=this;this.tiledMemberPack=[],Object.keys(N).forEach(function(_){var k=D[_];if(L.tiledMemberPack[_]=L.tileNodes(N[_],k.paddingLeft+k.paddingRight),k.rect.width=L.tiledMemberPack[_].width,k.rect.height=L.tiledMemberPack[_].height,k.setCenter(L.tiledMemberPack[_].centerX,L.tiledMemberPack[_].centerY),k.labelMarginLeft=0,k.labelMarginTop=0,y.NODE_DIMENSIONS_INCLUDE_LABELS){var I=k.rect.width,F=k.rect.height;k.labelWidth&&(k.labelPosHorizontal=="left"?(k.rect.x-=k.labelWidth,k.setWidth(I+k.labelWidth),k.labelMarginLeft=k.labelWidth):k.labelPosHorizontal=="center"&&k.labelWidth>I?(k.rect.x-=(k.labelWidth-I)/2,k.setWidth(k.labelWidth),k.labelMarginLeft=(k.labelWidth-I)/2):k.labelPosHorizontal=="right"&&k.setWidth(I+k.labelWidth)),k.labelHeight&&(k.labelPosVertical=="top"?(k.rect.y-=k.labelHeight,k.setHeight(F+k.labelHeight),k.labelMarginTop=k.labelHeight):k.labelPosVertical=="center"&&k.labelHeight>F?(k.rect.y-=(k.labelHeight-F)/2,k.setHeight(k.labelHeight),k.labelMarginTop=(k.labelHeight-F)/2):k.labelPosVertical=="bottom"&&k.setHeight(F+k.labelHeight))}})},R.prototype.tileNodes=function(N,D){var L=this.tileNodesByFavoringDim(N,D,!0),_=this.tileNodesByFavoringDim(N,D,!1),k=this.getOrgRatio(L),I=this.getOrgRatio(_),F;return I<k?F=_:F=L,F},R.prototype.getOrgRatio=function(N){var D=N.width,L=N.height,_=D/L;return _<1&&(_=1/_),_},R.prototype.calcIdealRowWidth=function(N,D){var L=y.TILING_PADDING_VERTICAL,_=y.TILING_PADDING_HORIZONTAL,k=N.length,I=0,F=0,B=0;N.forEach(function(ae){I+=ae.getWidth(),F+=ae.getHeight(),ae.getWidth()>B&&(B=ae.getWidth())});var $=I/k,W=F/k,z=Math.pow(L-_,2)+4*($+_)*(W+L)*k,q=(_-L+Math.sqrt(z))/(2*($+_)),G;D?(G=Math.ceil(q),G==q&&G++):G=Math.floor(q);var J=G*($+_)-_;return B>J&&(J=B),J+=_*2,J},R.prototype.tileNodesByFavoringDim=function(N,D,L){var _=y.TILING_PADDING_VERTICAL,k=y.TILING_PADDING_HORIZONTAL,I=y.TILING_COMPARE_BY,F={rows:[],rowWidth:[],rowHeight:[],width:0,height:D,verticalPadding:_,horizontalPadding:k,centerX:0,centerY:0};I&&(F.idealRowWidth=this.calcIdealRowWidth(N,L));var B=function(Y){return Y.rect.width*Y.rect.height},$=function(Y,H){return B(H)-B(Y)};N.sort(function(ae,Y){var H=$;return F.idealRowWidth?(H=I,H(ae.id,Y.id)):H(ae,Y)});for(var W=0,z=0,q=0;q<N.length;q++){var G=N[q];W+=G.getCenterX(),z+=G.getCenterY()}F.centerX=W/N.length,F.centerY=z/N.length;for(var q=0;q<N.length;q++){var G=N[q];if(F.rows.length==0)this.insertNodeToRow(F,G,0,D);else if(this.canAddHorizontal(F,G.rect.width,G.rect.height)){var J=F.rows.length-1;F.idealRowWidth||(J=this.getShortestRowIndex(F)),this.insertNodeToRow(F,G,J,D)}else this.insertNodeToRow(F,G,F.rows.length,D);this.shiftToLastRow(F)}return F},R.prototype.insertNodeToRow=function(N,D,L,_){var k=_;if(L==N.rows.length){var I=[];N.rows.push(I),N.rowWidth.push(k),N.rowHeight.push(0)}var F=N.rowWidth[L]+D.rect.width;N.rows[L].length>0&&(F+=N.horizontalPadding),N.rowWidth[L]=F,N.width<F&&(N.width=F);var B=D.rect.height;L>0&&(B+=N.verticalPadding);var $=0;B>N.rowHeight[L]&&($=N.rowHeight[L],N.rowHeight[L]=B,$=N.rowHeight[L]-$),N.height+=$,N.rows[L].push(D)},R.prototype.getShortestRowIndex=function(N){for(var D=-1,L=Number.MAX_VALUE,_=0;_<N.rows.length;_++)N.rowWidth[_]<L&&(D=_,L=N.rowWidth[_]);return D},R.prototype.getLongestRowIndex=function(N){for(var D=-1,L=Number.MIN_VALUE,_=0;_<N.rows.length;_++)N.rowWidth[_]>L&&(D=_,L=N.rowWidth[_]);return D},R.prototype.canAddHorizontal=function(N,D,L){if(N.idealRowWidth){var _=N.rows.length-1,k=N.rowWidth[_];return k+D+N.horizontalPadding<=N.idealRowWidth}var I=this.getShortestRowIndex(N);if(I<0)return!0;var F=N.rowWidth[I];if(F+N.horizontalPadding+D<=N.width)return!0;var B=0;N.rowHeight[I]<L&&I>0&&(B=L+N.verticalPadding-N.rowHeight[I]);var $;N.width-F>=D+N.horizontalPadding?$=(N.height+B)/(F+D+N.horizontalPadding):$=(N.height+B)/N.width,B=L+N.verticalPadding;var W;return N.width<D?W=(N.height+B)/D:W=(N.height+B)/N.width,W<1&&(W=1/W),$<1&&($=1/$),$<W},R.prototype.shiftToLastRow=function(N){var D=this.getLongestRowIndex(N),L=N.rowWidth.length-1,_=N.rows[D],k=_[_.length-1],I=k.width+N.horizontalPadding;if(N.width-N.rowWidth[L]>I&&D!=L){_.splice(-1,1),N.rows[L].push(k),N.rowWidth[D]=N.rowWidth[D]-I,N.rowWidth[L]=N.rowWidth[L]+I,N.width=N.rowWidth[instance.getLongestRowIndex(N)];for(var F=Number.MIN_VALUE,B=0;B<_.length;B++)_[B].height>F&&(F=_[B].height);D>0&&(F+=N.verticalPadding);var $=N.rowHeight[D]+N.rowHeight[L];N.rowHeight[D]=F,N.rowHeight[L]<k.height+N.verticalPadding&&(N.rowHeight[L]=k.height+N.verticalPadding);var W=N.rowHeight[D]+N.rowHeight[L];N.height+=W-$,this.shiftToLastRow(N)}},R.prototype.tilingPreLayout=function(){y.TILE&&(this.groupZeroDegreeMembers(),this.clearCompounds(),this.clearZeroDegreeMembers())},R.prototype.tilingPostLayout=function(){y.TILE&&(this.repopulateZeroDegreeMembers(),this.repopulateCompounds())},R.prototype.reduceTrees=function(){for(var N=[],D=!0,L;D;){var _=this.graphManager.getAllNodes(),k=[];D=!1;for(var I=0;I<_.length;I++)if(L=_[I],L.getEdges().length==1&&!L.getEdges()[0].isInterGraph&&L.getChild()==null){if(y.PURE_INCREMENTAL){var F=L.getEdges()[0].getOtherEnd(L),B=new E(L.getCenterX()-F.getCenterX(),L.getCenterY()-F.getCenterY());k.push([L,L.getEdges()[0],L.getOwner(),B])}else k.push([L,L.getEdges()[0],L.getOwner()]);D=!0}if(D==!0){for(var $=[],W=0;W<k.length;W++)k[W][0].getEdges().length==1&&($.push(k[W]),k[W][0].getOwner().remove(k[W][0]));N.push($),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()}}this.prunedNodesAll=N},R.prototype.growTree=function(N){for(var D=N.length,L=N[D-1],_,k=0;k<L.length;k++)_=L[k],this.findPlaceforPrunedNode(_),_[2].add(_[0]),_[2].add(_[1],_[1].source,_[1].target);N.splice(N.length-1,1),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()},R.prototype.findPlaceforPrunedNode=function(N){var D,L,_=N[0];if(_==N[1].source?L=N[1].target:L=N[1].source,y.PURE_INCREMENTAL)_.setCenter(L.getCenterX()+N[3].getWidth(),L.getCenterY()+N[3].getHeight());else{var k=L.startX,I=L.finishX,F=L.startY,B=L.finishY,$=0,W=0,z=0,q=0,G=[$,z,W,q];if(F>0)for(var J=k;J<=I;J++)G[0]+=this.grid[J][F-1].length+this.grid[J][F].length-1;if(I<this.grid.length-1)for(var J=F;J<=B;J++)G[1]+=this.grid[I+1][J].length+this.grid[I][J].length-1;if(B<this.grid[0].length-1)for(var J=k;J<=I;J++)G[2]+=this.grid[J][B+1].length+this.grid[J][B].length-1;if(k>0)for(var J=F;J<=B;J++)G[3]+=this.grid[k-1][J].length+this.grid[k][J].length-1;for(var ae=S.MAX_VALUE,Y,H,X=0;X<G.length;X++)G[X]<ae?(ae=G[X],Y=1,H=X):G[X]==ae&&Y++;if(Y==3&&ae==0)G[0]==0&&G[1]==0&&G[2]==0?D=1:G[0]==0&&G[1]==0&&G[3]==0?D=0:G[0]==0&&G[2]==0&&G[3]==0?D=3:G[1]==0&&G[2]==0&&G[3]==0&&(D=2);else if(Y==2&&ae==0){var ee=Math.floor(Math.random()*2);G[0]==0&&G[1]==0?ee==0?D=0:D=1:G[0]==0&&G[2]==0?ee==0?D=0:D=2:G[0]==0&&G[3]==0?ee==0?D=0:D=3:G[1]==0&&G[2]==0?ee==0?D=1:D=2:G[1]==0&&G[3]==0?ee==0?D=1:D=3:ee==0?D=2:D=3}else if(Y==4&&ae==0){var ee=Math.floor(Math.random()*4);D=ee}else D=H;D==0?_.setCenter(L.getCenterX(),L.getCenterY()-L.getHeight()/2-g.DEFAULT_EDGE_LENGTH-_.getHeight()/2):D==1?_.setCenter(L.getCenterX()+L.getWidth()/2+g.DEFAULT_EDGE_LENGTH+_.getWidth()/2,L.getCenterY()):D==2?_.setCenter(L.getCenterX(),L.getCenterY()+L.getHeight()/2+g.DEFAULT_EDGE_LENGTH+_.getHeight()/2):_.setCenter(L.getCenterX()-L.getWidth()/2-g.DEFAULT_EDGE_LENGTH-_.getWidth()/2,L.getCenterY())}},o.exports=R},991:(o,l,u)=>{var c=u(551).FDLayoutNode,d=u(551).IMath;function f(p,y,m,g){c.call(this,p,y,m,g)}f.prototype=Object.create(c.prototype);for(var v in c)f[v]=c[v];f.prototype.calculateDisplacement=function(){var p=this.graphManager.getLayout();this.getChild()!=null&&this.fixedNodeWeight?(this.displacementX+=p.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.fixedNodeWeight,this.displacementY+=p.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.fixedNodeWeight):(this.displacementX+=p.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY+=p.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren),Math.abs(this.displacementX)>p.coolingFactor*p.maxNodeDisplacement&&(this.displacementX=p.coolingFactor*p.maxNodeDisplacement*d.sign(this.displacementX)),Math.abs(this.displacementY)>p.coolingFactor*p.maxNodeDisplacement&&(this.displacementY=p.coolingFactor*p.maxNodeDisplacement*d.sign(this.displacementY)),this.child&&this.child.getNodes().length>0&&this.propogateDisplacementToChildren(this.displacementX,this.displacementY)},f.prototype.propogateDisplacementToChildren=function(p,y){for(var m=this.getChild().getNodes(),g,x=0;x<m.length;x++)g=m[x],g.getChild()==null?(g.displacementX+=p,g.displacementY+=y):g.propogateDisplacementToChildren(p,y)},f.prototype.move=function(){var p=this.graphManager.getLayout();(this.child==null||this.child.getNodes().length==0)&&(this.moveBy(this.displacementX,this.displacementY),p.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},f.prototype.setPred1=function(p){this.pred1=p},f.prototype.getPred1=function(){return pred1},f.prototype.getPred2=function(){return pred2},f.prototype.setNext=function(p){this.next=p},f.prototype.getNext=function(){return next},f.prototype.setProcessed=function(p){this.processed=p},f.prototype.isProcessed=function(){return processed},o.exports=f},902:(o,l,u)=>{function c(m){if(Array.isArray(m)){for(var g=0,x=Array(m.length);g<m.length;g++)x[g]=m[g];return x}else return Array.from(m)}var d=u(806),f=u(551).LinkedList,v=u(551).Matrix,p=u(551).SVD;function y(){}y.handleConstraints=function(m){var g={};g.fixedNodeConstraint=m.constraints.fixedNodeConstraint,g.alignmentConstraint=m.constraints.alignmentConstraint,g.relativePlacementConstraint=m.constraints.relativePlacementConstraint;for(var x=new Map,b=new Map,w=[],E=[],C=m.getAllNodes(),S=0,T=0;T<C.length;T++){var P=C[T];P.getChild()==null&&(b.set(P.id,S++),w.push(P.getCenterX()),E.push(P.getCenterY()),x.set(P.id,P))}g.relativePlacementConstraint&&g.relativePlacementConstraint.forEach(function(Z){!Z.gap&&Z.gap!=0&&(Z.left?Z.gap=d.DEFAULT_EDGE_LENGTH+x.get(Z.left).getWidth()/2+x.get(Z.right).getWidth()/2:Z.gap=d.DEFAULT_EDGE_LENGTH+x.get(Z.top).getHeight()/2+x.get(Z.bottom).getHeight()/2)});var A=function(M,Q){return{x:M.x-Q.x,y:M.y-Q.y}},j=function(M){var Q=0,ne=0;return M.forEach(function(re){Q+=w[b.get(re)],ne+=E[b.get(re)]}),{x:Q/M.size,y:ne/M.size}},R=function(M,Q,ne,re,se){function ye(Ae,Te){var Ge=new Set(Ae),Me=!0,Ie=!1,Ze=void 0;try{for(var $e=Te[Symbol.iterator](),He;!(Me=(He=$e.next()).done);Me=!0){var ct=He.value;Ge.add(ct)}}catch(gt){Ie=!0,Ze=gt}finally{try{!Me&&$e.return&&$e.return()}finally{if(Ie)throw Ze}}return Ge}var le=new Map;M.forEach(function(Ae,Te){le.set(Te,0)}),M.forEach(function(Ae,Te){Ae.forEach(function(Ge){le.set(Ge.id,le.get(Ge.id)+1)})});var he=new Map,de=new Map,Se=new f;le.forEach(function(Ae,Te){Ae==0?(Se.push(Te),ne||(Q=="horizontal"?he.set(Te,b.has(Te)?w[b.get(Te)]:re.get(Te)):he.set(Te,b.has(Te)?E[b.get(Te)]:re.get(Te)))):he.set(Te,Number.NEGATIVE_INFINITY),ne&&de.set(Te,new Set([Te]))}),ne&&se.forEach(function(Ae){var Te=[];if(Ae.forEach(function(Ie){ne.has(Ie)&&Te.push(Ie)}),Te.length>0){var Ge=0;Te.forEach(function(Ie){Q=="horizontal"?(he.set(Ie,b.has(Ie)?w[b.get(Ie)]:re.get(Ie)),Ge+=he.get(Ie)):(he.set(Ie,b.has(Ie)?E[b.get(Ie)]:re.get(Ie)),Ge+=he.get(Ie))}),Ge=Ge/Te.length,Ae.forEach(function(Ie){ne.has(Ie)||he.set(Ie,Ge)})}else{var Me=0;Ae.forEach(function(Ie){Q=="horizontal"?Me+=b.has(Ie)?w[b.get(Ie)]:re.get(Ie):Me+=b.has(Ie)?E[b.get(Ie)]:re.get(Ie)}),Me=Me/Ae.length,Ae.forEach(function(Ie){he.set(Ie,Me)})}});for(var Oe=function(){var Te=Se.shift(),Ge=M.get(Te);Ge.forEach(function(Me){if(he.get(Me.id)<he.get(Te)+Me.gap)if(ne&&ne.has(Me.id)){var Ie=void 0;if(Q=="horizontal"?Ie=b.has(Me.id)?w[b.get(Me.id)]:re.get(Me.id):Ie=b.has(Me.id)?E[b.get(Me.id)]:re.get(Me.id),he.set(Me.id,Ie),Ie<he.get(Te)+Me.gap){var Ze=he.get(Te)+Me.gap-Ie;de.get(Te).forEach(function($e){he.set($e,he.get($e)-Ze)})}}else he.set(Me.id,he.get(Te)+Me.gap);le.set(Me.id,le.get(Me.id)-1),le.get(Me.id)==0&&Se.push(Me.id),ne&&de.set(Me.id,ye(de.get(Te),de.get(Me.id)))})};Se.length!=0;)Oe();if(ne){var Le=new Set;M.forEach(function(Ae,Te){Ae.length==0&&Le.add(Te)});var ke=[];de.forEach(function(Ae,Te){if(Le.has(Te)){var Ge=!1,Me=!0,Ie=!1,Ze=void 0;try{for(var $e=Ae[Symbol.iterator](),He;!(Me=(He=$e.next()).done);Me=!0){var ct=He.value;ne.has(ct)&&(Ge=!0)}}catch(lt){Ie=!0,Ze=lt}finally{try{!Me&&$e.return&&$e.return()}finally{if(Ie)throw Ze}}if(!Ge){var gt=!1,tt=void 0;ke.forEach(function(lt,qt){lt.has([].concat(c(Ae))[0])&&(gt=!0,tt=qt)}),gt?Ae.forEach(function(lt){ke[tt].add(lt)}):ke.push(new Set(Ae))}}}),ke.forEach(function(Ae,Te){var Ge=Number.POSITIVE_INFINITY,Me=Number.POSITIVE_INFINITY,Ie=Number.NEGATIVE_INFINITY,Ze=Number.NEGATIVE_INFINITY,$e=!0,He=!1,ct=void 0;try{for(var gt=Ae[Symbol.iterator](),tt;!($e=(tt=gt.next()).done);$e=!0){var lt=tt.value,qt=void 0;Q=="horizontal"?qt=b.has(lt)?w[b.get(lt)]:re.get(lt):qt=b.has(lt)?E[b.get(lt)]:re.get(lt);var rn=he.get(lt);qt<Ge&&(Ge=qt),qt>Ie&&(Ie=qt),rn<Me&&(Me=rn),rn>Ze&&(Ze=rn)}}catch(pa){He=!0,ct=pa}finally{try{!$e&>.return&>.return()}finally{if(He)throw ct}}var Ua=(Ge+Ie)/2-(Me+Ze)/2,Ar=!0,It=!1,Pt=void 0;try{for(var jt=Ae[Symbol.iterator](),Zn;!(Ar=(Zn=jt.next()).done);Ar=!0){var Kt=Zn.value;he.set(Kt,he.get(Kt)+Ua)}}catch(pa){It=!0,Pt=pa}finally{try{!Ar&&jt.return&&jt.return()}finally{if(It)throw Pt}}})}return he},O=function(M){var Q=0,ne=0,re=0,se=0;if(M.forEach(function(de){de.left?w[b.get(de.left)]-w[b.get(de.right)]>=0?Q++:ne++:E[b.get(de.top)]-E[b.get(de.bottom)]>=0?re++:se++}),Q>ne&&re>se)for(var ye=0;ye<b.size;ye++)w[ye]=-1*w[ye],E[ye]=-1*E[ye];else if(Q>ne)for(var le=0;le<b.size;le++)w[le]=-1*w[le];else if(re>se)for(var he=0;he<b.size;he++)E[he]=-1*E[he]},N=function(M){var Q=[],ne=new f,re=new Set,se=0;return M.forEach(function(ye,le){if(!re.has(le)){Q[se]=[];var he=le;for(ne.push(he),re.add(he),Q[se].push(he);ne.length!=0;){he=ne.shift();var de=M.get(he);de.forEach(function(Se){re.has(Se.id)||(ne.push(Se.id),re.add(Se.id),Q[se].push(Se.id))})}se++}}),Q},D=function(M){var Q=new Map;return M.forEach(function(ne,re){Q.set(re,[])}),M.forEach(function(ne,re){ne.forEach(function(se){Q.get(re).push(se),Q.get(se.id).push({id:re,gap:se.gap,direction:se.direction})})}),Q},L=function(M){var Q=new Map;return M.forEach(function(ne,re){Q.set(re,[])}),M.forEach(function(ne,re){ne.forEach(function(se){Q.get(se.id).push({id:re,gap:se.gap,direction:se.direction})})}),Q},_=[],k=[],I=!1,F=!1,B=new Set,$=new Map,W=new Map,z=[];if(g.fixedNodeConstraint&&g.fixedNodeConstraint.forEach(function(Z){B.add(Z.nodeId)}),g.relativePlacementConstraint&&(g.relativePlacementConstraint.forEach(function(Z){Z.left?($.has(Z.left)?$.get(Z.left).push({id:Z.right,gap:Z.gap,direction:"horizontal"}):$.set(Z.left,[{id:Z.right,gap:Z.gap,direction:"horizontal"}]),$.has(Z.right)||$.set(Z.right,[])):($.has(Z.top)?$.get(Z.top).push({id:Z.bottom,gap:Z.gap,direction:"vertical"}):$.set(Z.top,[{id:Z.bottom,gap:Z.gap,direction:"vertical"}]),$.has(Z.bottom)||$.set(Z.bottom,[]))}),W=D($),z=N(W)),d.TRANSFORM_ON_CONSTRAINT_HANDLING){if(g.fixedNodeConstraint&&g.fixedNodeConstraint.length>1)g.fixedNodeConstraint.forEach(function(Z,M){_[M]=[Z.position.x,Z.position.y],k[M]=[w[b.get(Z.nodeId)],E[b.get(Z.nodeId)]]}),I=!0;else if(g.alignmentConstraint)(function(){var Z=0;if(g.alignmentConstraint.vertical){for(var M=g.alignmentConstraint.vertical,Q=function(he){var de=new Set;M[he].forEach(function(Le){de.add(Le)});var Se=new Set([].concat(c(de)).filter(function(Le){return B.has(Le)})),Oe=void 0;Se.size>0?Oe=w[b.get(Se.values().next().value)]:Oe=j(de).x,M[he].forEach(function(Le){_[Z]=[Oe,E[b.get(Le)]],k[Z]=[w[b.get(Le)],E[b.get(Le)]],Z++})},ne=0;ne<M.length;ne++)Q(ne);I=!0}if(g.alignmentConstraint.horizontal){for(var re=g.alignmentConstraint.horizontal,se=function(he){var de=new Set;re[he].forEach(function(Le){de.add(Le)});var Se=new Set([].concat(c(de)).filter(function(Le){return B.has(Le)})),Oe=void 0;Se.size>0?Oe=w[b.get(Se.values().next().value)]:Oe=j(de).y,re[he].forEach(function(Le){_[Z]=[w[b.get(Le)],Oe],k[Z]=[w[b.get(Le)],E[b.get(Le)]],Z++})},ye=0;ye<re.length;ye++)se(ye);I=!0}g.relativePlacementConstraint&&(F=!0)})();else if(g.relativePlacementConstraint){for(var q=0,G=0,J=0;J<z.length;J++)z[J].length>q&&(q=z[J].length,G=J);if(q<W.size/2)O(g.relativePlacementConstraint),I=!1,F=!1;else{var ae=new Map,Y=new Map,H=[];z[G].forEach(function(Z){$.get(Z).forEach(function(M){M.direction=="horizontal"?(ae.has(Z)?ae.get(Z).push(M):ae.set(Z,[M]),ae.has(M.id)||ae.set(M.id,[]),H.push({left:Z,right:M.id})):(Y.has(Z)?Y.get(Z).push(M):Y.set(Z,[M]),Y.has(M.id)||Y.set(M.id,[]),H.push({top:Z,bottom:M.id}))})}),O(H),F=!1;var X=R(ae,"horizontal"),ee=R(Y,"vertical");z[G].forEach(function(Z,M){k[M]=[w[b.get(Z)],E[b.get(Z)]],_[M]=[],X.has(Z)?_[M][0]=X.get(Z):_[M][0]=w[b.get(Z)],ee.has(Z)?_[M][1]=ee.get(Z):_[M][1]=E[b.get(Z)]}),I=!0}}if(I){for(var ie=void 0,oe=v.transpose(_),me=v.transpose(k),De=0;De<oe.length;De++)oe[De]=v.multGamma(oe[De]),me[De]=v.multGamma(me[De]);var ge=v.multMat(oe,v.transpose(me)),pe=p.svd(ge);ie=v.multMat(pe.V,v.transpose(pe.U));for(var we=0;we<b.size;we++){var xe=[w[we],E[we]],Ee=[ie[0][0],ie[1][0]],V=[ie[0][1],ie[1][1]];w[we]=v.dotProduct(xe,Ee),E[we]=v.dotProduct(xe,V)}F&&O(g.relativePlacementConstraint)}}if(d.ENFORCE_CONSTRAINTS){if(g.fixedNodeConstraint&&g.fixedNodeConstraint.length>0){var K={x:0,y:0};g.fixedNodeConstraint.forEach(function(Z,M){var Q={x:w[b.get(Z.nodeId)],y:E[b.get(Z.nodeId)]},ne=Z.position,re=A(ne,Q);K.x+=re.x,K.y+=re.y}),K.x/=g.fixedNodeConstraint.length,K.y/=g.fixedNodeConstraint.length,w.forEach(function(Z,M){w[M]+=K.x}),E.forEach(function(Z,M){E[M]+=K.y}),g.fixedNodeConstraint.forEach(function(Z){w[b.get(Z.nodeId)]=Z.position.x,E[b.get(Z.nodeId)]=Z.position.y})}if(g.alignmentConstraint){if(g.alignmentConstraint.vertical)for(var te=g.alignmentConstraint.vertical,ue=function(M){var Q=new Set;te[M].forEach(function(se){Q.add(se)});var ne=new Set([].concat(c(Q)).filter(function(se){return B.has(se)})),re=void 0;ne.size>0?re=w[b.get(ne.values().next().value)]:re=j(Q).x,Q.forEach(function(se){B.has(se)||(w[b.get(se)]=re)})},fe=0;fe<te.length;fe++)ue(fe);if(g.alignmentConstraint.horizontal)for(var ve=g.alignmentConstraint.horizontal,be=function(M){var Q=new Set;ve[M].forEach(function(se){Q.add(se)});var ne=new Set([].concat(c(Q)).filter(function(se){return B.has(se)})),re=void 0;ne.size>0?re=E[b.get(ne.values().next().value)]:re=j(Q).y,Q.forEach(function(se){B.has(se)||(E[b.get(se)]=re)})},Ne=0;Ne<ve.length;Ne++)be(Ne)}g.relativePlacementConstraint&&function(){var Z=new Map,M=new Map,Q=new Map,ne=new Map,re=new Map,se=new Map,ye=new Set,le=new Set;if(B.forEach(function(Ut){ye.add(Ut),le.add(Ut)}),g.alignmentConstraint){if(g.alignmentConstraint.vertical)for(var he=g.alignmentConstraint.vertical,de=function(Xe){Q.set("dummy"+Xe,[]),he[Xe].forEach(function(ut){Z.set(ut,"dummy"+Xe),Q.get("dummy"+Xe).push(ut),B.has(ut)&&ye.add("dummy"+Xe)}),re.set("dummy"+Xe,w[b.get(he[Xe][0])])},Se=0;Se<he.length;Se++)de(Se);if(g.alignmentConstraint.horizontal)for(var Oe=g.alignmentConstraint.horizontal,Le=function(Xe){ne.set("dummy"+Xe,[]),Oe[Xe].forEach(function(ut){M.set(ut,"dummy"+Xe),ne.get("dummy"+Xe).push(ut),B.has(ut)&&le.add("dummy"+Xe)}),se.set("dummy"+Xe,E[b.get(Oe[Xe][0])])},ke=0;ke<Oe.length;ke++)Le(ke)}var Ae=new Map,Te=new Map,Ge=function(Xe){$.get(Xe).forEach(function(ut){var $t=void 0,xr=void 0;ut.direction=="horizontal"?($t=Z.get(Xe)?Z.get(Xe):Xe,Z.get(ut.id)?xr={id:Z.get(ut.id),gap:ut.gap,direction:ut.direction}:xr=ut,Ae.has($t)?Ae.get($t).push(xr):Ae.set($t,[xr]),Ae.has(xr.id)||Ae.set(xr.id,[])):($t=M.get(Xe)?M.get(Xe):Xe,M.get(ut.id)?xr={id:M.get(ut.id),gap:ut.gap,direction:ut.direction}:xr=ut,Te.has($t)?Te.get($t).push(xr):Te.set($t,[xr]),Te.has(xr.id)||Te.set(xr.id,[]))})},Me=!0,Ie=!1,Ze=void 0;try{for(var $e=$.keys()[Symbol.iterator](),He;!(Me=(He=$e.next()).done);Me=!0){var ct=He.value;Ge(ct)}}catch(Ut){Ie=!0,Ze=Ut}finally{try{!Me&&$e.return&&$e.return()}finally{if(Ie)throw Ze}}var gt=D(Ae),tt=D(Te),lt=N(gt),qt=N(tt),rn=L(Ae),Ua=L(Te),Ar=[],It=[];lt.forEach(function(Ut,Xe){Ar[Xe]=[],Ut.forEach(function(ut){rn.get(ut).length==0&&Ar[Xe].push(ut)})}),qt.forEach(function(Ut,Xe){It[Xe]=[],Ut.forEach(function(ut){Ua.get(ut).length==0&&It[Xe].push(ut)})});var Pt=R(Ae,"horizontal",ye,re,Ar),jt=R(Te,"vertical",le,se,It),Zn=function(Xe){Q.get(Xe)?Q.get(Xe).forEach(function(ut){w[b.get(ut)]=Pt.get(Xe)}):w[b.get(Xe)]=Pt.get(Xe)},Kt=!0,pa=!1,nc=void 0;try{for(var Vo=Pt.keys()[Symbol.iterator](),ac;!(Kt=(ac=Vo.next()).done);Kt=!0){var Go=ac.value;Zn(Go)}}catch(Ut){pa=!0,nc=Ut}finally{try{!Kt&&Vo.return&&Vo.return()}finally{if(pa)throw nc}}var Fh=function(Xe){ne.get(Xe)?ne.get(Xe).forEach(function(ut){E[b.get(ut)]=jt.get(Xe)}):E[b.get(Xe)]=jt.get(Xe)},Ho=!0,ic=!1,$a=void 0;try{for(var Mi=jt.keys()[Symbol.iterator](),Ii;!(Ho=(Ii=Mi.next()).done);Ho=!0){var Go=Ii.value;Fh(Go)}}catch(Ut){ic=!0,$a=Ut}finally{try{!Ho&&Mi.return&&Mi.return()}finally{if(ic)throw $a}}}()}for(var Ce=0;Ce<C.length;Ce++){var Re=C[Ce];Re.getChild()==null&&Re.setCenter(w[b.get(Re.id)],E[b.get(Re.id)])}},o.exports=y},551:o=>{o.exports=r}},a={};function i(o){var l=a[o];if(l!==void 0)return l.exports;var u=a[o]={exports:{}};return n[o](u,u.exports,i),u.exports}var s=i(45);return s})()})}(db)),db.exports}(function(t,e){(function(n,a){t.exports=a(V7())})(Ja,function(r){return(()=>{var n={658:o=>{o.exports=Object.assign!=null?Object.assign.bind(Object):function(l){for(var u=arguments.length,c=Array(u>1?u-1:0),d=1;d<u;d++)c[d-1]=arguments[d];return c.forEach(function(f){Object.keys(f).forEach(function(v){return l[v]=f[v]})}),l}},548:(o,l,u)=>{var c=function(){function v(p,y){var m=[],g=!0,x=!1,b=void 0;try{for(var w=p[Symbol.iterator](),E;!(g=(E=w.next()).done)&&(m.push(E.value),!(y&&m.length===y));g=!0);}catch(C){x=!0,b=C}finally{try{!g&&w.return&&w.return()}finally{if(x)throw b}}return m}return function(p,y){if(Array.isArray(p))return p;if(Symbol.iterator in Object(p))return v(p,y);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),d=u(140).layoutBase.LinkedList,f={};f.getTopMostNodes=function(v){for(var p={},y=0;y<v.length;y++)p[v[y].id()]=!0;var m=v.filter(function(g,x){typeof g=="number"&&(g=x);for(var b=g.parent()[0];b!=null;){if(p[b.id()])return!1;b=b.parent()[0]}return!0});return m},f.connectComponents=function(v,p,y,m){var g=new d,x=new Set,b=[],w=void 0,E=void 0,C=void 0,S=!1,T=1,P=[],A=[],j=function(){var O=v.collection();A.push(O);var N=y[0],D=v.collection();D.merge(N).merge(N.descendants().intersection(p)),b.push(N),D.forEach(function(k){g.push(k),x.add(k),O.merge(k)});for(var L=function(){N=g.shift();var I=v.collection();N.neighborhood().nodes().forEach(function(W){p.intersection(N.edgesWith(W)).length>0&&I.merge(W)});for(var F=0;F<I.length;F++){var B=I[F];if(w=y.intersection(B.union(B.ancestors())),w!=null&&!x.has(w[0])){var $=w.union(w.descendants());$.forEach(function(W){g.push(W),x.add(W),O.merge(W),y.has(W)&&b.push(W)})}}};g.length!=0;)L();if(O.forEach(function(k){p.intersection(k.connectedEdges()).forEach(function(I){O.has(I.source())&&O.has(I.target())&&O.merge(I)})}),b.length==y.length&&(S=!0),!S||S&&T>1){E=b[0],C=E.connectedEdges().length,b.forEach(function(k){k.connectedEdges().length<C&&(C=k.connectedEdges().length,E=k)}),P.push(E.id());var _=v.collection();_.merge(b[0]),b.forEach(function(k){_.merge(k)}),b=[],y=y.difference(_),T++}};do j();while(!S);return m&&P.length>0&&m.set("dummy"+(m.size+1),P),A},f.relocateComponent=function(v,p,y){if(!y.fixedNodeConstraint){var m=Number.POSITIVE_INFINITY,g=Number.NEGATIVE_INFINITY,x=Number.POSITIVE_INFINITY,b=Number.NEGATIVE_INFINITY;if(y.quality=="draft"){var w=!0,E=!1,C=void 0;try{for(var S=p.nodeIndexes[Symbol.iterator](),T;!(w=(T=S.next()).done);w=!0){var P=T.value,A=c(P,2),j=A[0],R=A[1],O=y.cy.getElementById(j);if(O){var N=O.boundingBox(),D=p.xCoords[R]-N.w/2,L=p.xCoords[R]+N.w/2,_=p.yCoords[R]-N.h/2,k=p.yCoords[R]+N.h/2;D<m&&(m=D),L>g&&(g=L),_<x&&(x=_),k>b&&(b=k)}}}catch(W){E=!0,C=W}finally{try{!w&&S.return&&S.return()}finally{if(E)throw C}}var I=v.x-(g+m)/2,F=v.y-(b+x)/2;p.xCoords=p.xCoords.map(function(W){return W+I}),p.yCoords=p.yCoords.map(function(W){return W+F})}else{Object.keys(p).forEach(function(W){var z=p[W],q=z.getRect().x,G=z.getRect().x+z.getRect().width,J=z.getRect().y,ae=z.getRect().y+z.getRect().height;q<m&&(m=q),G>g&&(g=G),J<x&&(x=J),ae>b&&(b=ae)});var B=v.x-(g+m)/2,$=v.y-(b+x)/2;Object.keys(p).forEach(function(W){var z=p[W];z.setCenter(z.getCenterX()+B,z.getCenterY()+$)})}}},f.calcBoundingBox=function(v,p,y,m){for(var g=Number.MAX_SAFE_INTEGER,x=Number.MIN_SAFE_INTEGER,b=Number.MAX_SAFE_INTEGER,w=Number.MIN_SAFE_INTEGER,E=void 0,C=void 0,S=void 0,T=void 0,P=v.descendants().not(":parent"),A=P.length,j=0;j<A;j++){var R=P[j];E=p[m.get(R.id())]-R.width()/2,C=p[m.get(R.id())]+R.width()/2,S=y[m.get(R.id())]-R.height()/2,T=y[m.get(R.id())]+R.height()/2,g>E&&(g=E),x<C&&(x=C),b>S&&(b=S),w<T&&(w=T)}var O={};return O.topLeftX=g,O.topLeftY=b,O.width=x-g,O.height=w-b,O},f.calcParentsWithoutChildren=function(v,p){var y=v.collection();return p.nodes(":parent").forEach(function(m){var g=!1;m.children().forEach(function(x){x.css("display")!="none"&&(g=!0)}),g||y.merge(m)}),y},o.exports=f},816:(o,l,u)=>{var c=u(548),d=u(140).CoSELayout,f=u(140).CoSENode,v=u(140).layoutBase.PointD,p=u(140).layoutBase.DimensionD,y=u(140).layoutBase.LayoutConstants,m=u(140).layoutBase.FDLayoutConstants,g=u(140).CoSEConstants,x=function(w,E){var C=w.cy,S=w.eles,T=S.nodes(),P=S.edges(),A=void 0,j=void 0,R=void 0,O={};w.randomize&&(A=E.nodeIndexes,j=E.xCoords,R=E.yCoords);var N=function(W){return typeof W=="function"},D=function(W,z){return N(W)?W(z):W},L=c.calcParentsWithoutChildren(C,S),_=function $(W,z,q,G){for(var J=z.length,ae=0;ae<J;ae++){var Y=z[ae],H=null;Y.intersection(L).length==0&&(H=Y.children());var X=void 0,ee=Y.layoutDimensions({nodeDimensionsIncludeLabels:G.nodeDimensionsIncludeLabels});if(Y.outerWidth()!=null&&Y.outerHeight()!=null)if(G.randomize)if(!Y.isParent())X=W.add(new f(q.graphManager,new v(j[A.get(Y.id())]-ee.w/2,R[A.get(Y.id())]-ee.h/2),new p(parseFloat(ee.w),parseFloat(ee.h))));else{var ie=c.calcBoundingBox(Y,j,R,A);Y.intersection(L).length==0?X=W.add(new f(q.graphManager,new v(ie.topLeftX,ie.topLeftY),new p(ie.width,ie.height))):X=W.add(new f(q.graphManager,new v(ie.topLeftX,ie.topLeftY),new p(parseFloat(ee.w),parseFloat(ee.h))))}else X=W.add(new f(q.graphManager,new v(Y.position("x")-ee.w/2,Y.position("y")-ee.h/2),new p(parseFloat(ee.w),parseFloat(ee.h))));else X=W.add(new f(this.graphManager));if(X.id=Y.data("id"),X.nodeRepulsion=D(G.nodeRepulsion,Y),X.paddingLeft=parseInt(Y.css("padding")),X.paddingTop=parseInt(Y.css("padding")),X.paddingRight=parseInt(Y.css("padding")),X.paddingBottom=parseInt(Y.css("padding")),G.nodeDimensionsIncludeLabels&&(X.labelWidth=Y.boundingBox({includeLabels:!0,includeNodes:!1,includeOverlays:!1}).w,X.labelHeight=Y.boundingBox({includeLabels:!0,includeNodes:!1,includeOverlays:!1}).h,X.labelPosVertical=Y.css("text-valign"),X.labelPosHorizontal=Y.css("text-halign")),O[Y.data("id")]=X,isNaN(X.rect.x)&&(X.rect.x=0),isNaN(X.rect.y)&&(X.rect.y=0),H!=null&&H.length>0){var oe=void 0;oe=q.getGraphManager().add(q.newGraph(),X),$(oe,H,q,G)}}},k=function(W,z,q){for(var G=0,J=0,ae=0;ae<q.length;ae++){var Y=q[ae],H=O[Y.data("source")],X=O[Y.data("target")];if(H&&X&&H!==X&&H.getEdgesBetween(X).length==0){var ee=z.add(W.newEdge(),H,X);ee.id=Y.id(),ee.idealLength=D(w.idealEdgeLength,Y),ee.edgeElasticity=D(w.edgeElasticity,Y),G+=ee.idealLength,J++}}w.idealEdgeLength!=null&&(J>0?g.DEFAULT_EDGE_LENGTH=m.DEFAULT_EDGE_LENGTH=G/J:N(w.idealEdgeLength)?g.DEFAULT_EDGE_LENGTH=m.DEFAULT_EDGE_LENGTH=50:g.DEFAULT_EDGE_LENGTH=m.DEFAULT_EDGE_LENGTH=w.idealEdgeLength,g.MIN_REPULSION_DIST=m.MIN_REPULSION_DIST=m.DEFAULT_EDGE_LENGTH/10,g.DEFAULT_RADIAL_SEPARATION=m.DEFAULT_EDGE_LENGTH)},I=function(W,z){z.fixedNodeConstraint&&(W.constraints.fixedNodeConstraint=z.fixedNodeConstraint),z.alignmentConstraint&&(W.constraints.alignmentConstraint=z.alignmentConstraint),z.relativePlacementConstraint&&(W.constraints.relativePlacementConstraint=z.relativePlacementConstraint)};w.nestingFactor!=null&&(g.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=m.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=w.nestingFactor),w.gravity!=null&&(g.DEFAULT_GRAVITY_STRENGTH=m.DEFAULT_GRAVITY_STRENGTH=w.gravity),w.numIter!=null&&(g.MAX_ITERATIONS=m.MAX_ITERATIONS=w.numIter),w.gravityRange!=null&&(g.DEFAULT_GRAVITY_RANGE_FACTOR=m.DEFAULT_GRAVITY_RANGE_FACTOR=w.gravityRange),w.gravityCompound!=null&&(g.DEFAULT_COMPOUND_GRAVITY_STRENGTH=m.DEFAULT_COMPOUND_GRAVITY_STRENGTH=w.gravityCompound),w.gravityRangeCompound!=null&&(g.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=m.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=w.gravityRangeCompound),w.initialEnergyOnIncremental!=null&&(g.DEFAULT_COOLING_FACTOR_INCREMENTAL=m.DEFAULT_COOLING_FACTOR_INCREMENTAL=w.initialEnergyOnIncremental),w.tilingCompareBy!=null&&(g.TILING_COMPARE_BY=w.tilingCompareBy),w.quality=="proof"?y.QUALITY=2:y.QUALITY=0,g.NODE_DIMENSIONS_INCLUDE_LABELS=m.NODE_DIMENSIONS_INCLUDE_LABELS=y.NODE_DIMENSIONS_INCLUDE_LABELS=w.nodeDimensionsIncludeLabels,g.DEFAULT_INCREMENTAL=m.DEFAULT_INCREMENTAL=y.DEFAULT_INCREMENTAL=!w.randomize,g.ANIMATE=m.ANIMATE=y.ANIMATE=w.animate,g.TILE=w.tile,g.TILING_PADDING_VERTICAL=typeof w.tilingPaddingVertical=="function"?w.tilingPaddingVertical.call():w.tilingPaddingVertical,g.TILING_PADDING_HORIZONTAL=typeof w.tilingPaddingHorizontal=="function"?w.tilingPaddingHorizontal.call():w.tilingPaddingHorizontal,g.DEFAULT_INCREMENTAL=m.DEFAULT_INCREMENTAL=y.DEFAULT_INCREMENTAL=!0,g.PURE_INCREMENTAL=!w.randomize,y.DEFAULT_UNIFORM_LEAF_NODE_SIZES=w.uniformNodeDimensions,w.step=="transformed"&&(g.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,g.ENFORCE_CONSTRAINTS=!1,g.APPLY_LAYOUT=!1),w.step=="enforced"&&(g.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,g.ENFORCE_CONSTRAINTS=!0,g.APPLY_LAYOUT=!1),w.step=="cose"&&(g.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,g.ENFORCE_CONSTRAINTS=!1,g.APPLY_LAYOUT=!0),w.step=="all"&&(w.randomize?g.TRANSFORM_ON_CONSTRAINT_HANDLING=!0:g.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,g.ENFORCE_CONSTRAINTS=!0,g.APPLY_LAYOUT=!0),w.fixedNodeConstraint||w.alignmentConstraint||w.relativePlacementConstraint?g.TREE_REDUCTION_ON_INCREMENTAL=!1:g.TREE_REDUCTION_ON_INCREMENTAL=!0;var F=new d,B=F.newGraphManager();return _(B.addRoot(),c.getTopMostNodes(T),F,w),k(F,B,P),I(F,w),F.runLayout(),O};o.exports={coseLayout:x}},212:(o,l,u)=>{var c=function(){function w(E,C){for(var S=0;S<C.length;S++){var T=C[S];T.enumerable=T.enumerable||!1,T.configurable=!0,"value"in T&&(T.writable=!0),Object.defineProperty(E,T.key,T)}}return function(E,C,S){return C&&w(E.prototype,C),S&&w(E,S),E}}();function d(w,E){if(!(w instanceof E))throw new TypeError("Cannot call a class as a function")}var f=u(658),v=u(548),p=u(657),y=p.spectralLayout,m=u(816),g=m.coseLayout,x=Object.freeze({quality:"default",randomize:!0,animate:!0,animationDuration:1e3,animationEasing:void 0,fit:!0,padding:30,nodeDimensionsIncludeLabels:!1,uniformNodeDimensions:!1,packComponents:!0,step:"all",samplingType:!0,sampleSize:25,nodeSeparation:75,piTol:1e-7,nodeRepulsion:function(E){return 4500},idealEdgeLength:function(E){return 50},edgeElasticity:function(E){return .45},nestingFactor:.1,gravity:.25,numIter:2500,tile:!0,tilingCompareBy:void 0,tilingPaddingVertical:10,tilingPaddingHorizontal:10,gravityRangeCompound:1.5,gravityCompound:1,gravityRange:3.8,initialEnergyOnIncremental:.3,fixedNodeConstraint:void 0,alignmentConstraint:void 0,relativePlacementConstraint:void 0,ready:function(){},stop:function(){}}),b=function(){function w(E){d(this,w),this.options=f({},x,E)}return c(w,[{key:"run",value:function(){var C=this,S=this.options,T=S.cy,P=S.eles,A=[],j=[],R=void 0,O=[];S.fixedNodeConstraint&&(!Array.isArray(S.fixedNodeConstraint)||S.fixedNodeConstraint.length==0)&&(S.fixedNodeConstraint=void 0),S.alignmentConstraint&&(S.alignmentConstraint.vertical&&(!Array.isArray(S.alignmentConstraint.vertical)||S.alignmentConstraint.vertical.length==0)&&(S.alignmentConstraint.vertical=void 0),S.alignmentConstraint.horizontal&&(!Array.isArray(S.alignmentConstraint.horizontal)||S.alignmentConstraint.horizontal.length==0)&&(S.alignmentConstraint.horizontal=void 0)),S.relativePlacementConstraint&&(!Array.isArray(S.relativePlacementConstraint)||S.relativePlacementConstraint.length==0)&&(S.relativePlacementConstraint=void 0);var N=S.fixedNodeConstraint||S.alignmentConstraint||S.relativePlacementConstraint;N&&(S.tile=!1,S.packComponents=!1);var D=void 0,L=!1;if(T.layoutUtilities&&S.packComponents&&(D=T.layoutUtilities("get"),D||(D=T.layoutUtilities()),L=!0),P.nodes().length>0)if(L){var I=v.getTopMostNodes(S.eles.nodes());if(R=v.connectComponents(T,S.eles,I),R.forEach(function(ge){var pe=ge.boundingBox();O.push({x:pe.x1+pe.w/2,y:pe.y1+pe.h/2})}),S.randomize&&R.forEach(function(ge){S.eles=ge,A.push(y(S))}),S.quality=="default"||S.quality=="proof"){var F=T.collection();if(S.tile){var B=new Map,$=[],W=[],z=0,q={nodeIndexes:B,xCoords:$,yCoords:W},G=[];if(R.forEach(function(ge,pe){ge.edges().length==0&&(ge.nodes().forEach(function(we,xe){F.merge(ge.nodes()[xe]),we.isParent()||(q.nodeIndexes.set(ge.nodes()[xe].id(),z++),q.xCoords.push(ge.nodes()[0].position().x),q.yCoords.push(ge.nodes()[0].position().y))}),G.push(pe))}),F.length>1){var J=F.boundingBox();O.push({x:J.x1+J.w/2,y:J.y1+J.h/2}),R.push(F),A.push(q);for(var ae=G.length-1;ae>=0;ae--)R.splice(G[ae],1),A.splice(G[ae],1),O.splice(G[ae],1)}}R.forEach(function(ge,pe){S.eles=ge,j.push(g(S,A[pe])),v.relocateComponent(O[pe],j[pe],S)})}else R.forEach(function(ge,pe){v.relocateComponent(O[pe],A[pe],S)});var Y=new Set;if(R.length>1){var H=[],X=P.filter(function(ge){return ge.css("display")=="none"});R.forEach(function(ge,pe){var we=void 0;if(S.quality=="draft"&&(we=A[pe].nodeIndexes),ge.nodes().not(X).length>0){var xe={};xe.edges=[],xe.nodes=[];var Ee=void 0;ge.nodes().not(X).forEach(function(V){if(S.quality=="draft")if(!V.isParent())Ee=we.get(V.id()),xe.nodes.push({x:A[pe].xCoords[Ee]-V.boundingbox().w/2,y:A[pe].yCoords[Ee]-V.boundingbox().h/2,width:V.boundingbox().w,height:V.boundingbox().h});else{var K=v.calcBoundingBox(V,A[pe].xCoords,A[pe].yCoords,we);xe.nodes.push({x:K.topLeftX,y:K.topLeftY,width:K.width,height:K.height})}else j[pe][V.id()]&&xe.nodes.push({x:j[pe][V.id()].getLeft(),y:j[pe][V.id()].getTop(),width:j[pe][V.id()].getWidth(),height:j[pe][V.id()].getHeight()})}),ge.edges().forEach(function(V){var K=V.source(),te=V.target();if(K.css("display")!="none"&&te.css("display")!="none")if(S.quality=="draft"){var ue=we.get(K.id()),fe=we.get(te.id()),ve=[],be=[];if(K.isParent()){var Ne=v.calcBoundingBox(K,A[pe].xCoords,A[pe].yCoords,we);ve.push(Ne.topLeftX+Ne.width/2),ve.push(Ne.topLeftY+Ne.height/2)}else ve.push(A[pe].xCoords[ue]),ve.push(A[pe].yCoords[ue]);if(te.isParent()){var Ce=v.calcBoundingBox(te,A[pe].xCoords,A[pe].yCoords,we);be.push(Ce.topLeftX+Ce.width/2),be.push(Ce.topLeftY+Ce.height/2)}else be.push(A[pe].xCoords[fe]),be.push(A[pe].yCoords[fe]);xe.edges.push({startX:ve[0],startY:ve[1],endX:be[0],endY:be[1]})}else j[pe][K.id()]&&j[pe][te.id()]&&xe.edges.push({startX:j[pe][K.id()].getCenterX(),startY:j[pe][K.id()].getCenterY(),endX:j[pe][te.id()].getCenterX(),endY:j[pe][te.id()].getCenterY()})}),xe.nodes.length>0&&(H.push(xe),Y.add(pe))}});var ee=D.packComponents(H,S.randomize).shifts;if(S.quality=="draft")A.forEach(function(ge,pe){var we=ge.xCoords.map(function(Ee){return Ee+ee[pe].dx}),xe=ge.yCoords.map(function(Ee){return Ee+ee[pe].dy});ge.xCoords=we,ge.yCoords=xe});else{var ie=0;Y.forEach(function(ge){Object.keys(j[ge]).forEach(function(pe){var we=j[ge][pe];we.setCenter(we.getCenterX()+ee[ie].dx,we.getCenterY()+ee[ie].dy)}),ie++})}}}else{var _=S.eles.boundingBox();if(O.push({x:_.x1+_.w/2,y:_.y1+_.h/2}),S.randomize){var k=y(S);A.push(k)}S.quality=="default"||S.quality=="proof"?(j.push(g(S,A[0])),v.relocateComponent(O[0],j[0],S)):v.relocateComponent(O[0],A[0],S)}var oe=function(pe,we){if(S.quality=="default"||S.quality=="proof"){typeof pe=="number"&&(pe=we);var xe=void 0,Ee=void 0,V=pe.data("id");return j.forEach(function(te){V in te&&(xe={x:te[V].getRect().getCenterX(),y:te[V].getRect().getCenterY()},Ee=te[V])}),S.nodeDimensionsIncludeLabels&&(Ee.labelWidth&&(Ee.labelPosHorizontal=="left"?xe.x+=Ee.labelWidth/2:Ee.labelPosHorizontal=="right"&&(xe.x-=Ee.labelWidth/2)),Ee.labelHeight&&(Ee.labelPosVertical=="top"?xe.y+=Ee.labelHeight/2:Ee.labelPosVertical=="bottom"&&(xe.y-=Ee.labelHeight/2))),xe==null&&(xe={x:pe.position("x"),y:pe.position("y")}),{x:xe.x,y:xe.y}}else{var K=void 0;return A.forEach(function(te){var ue=te.nodeIndexes.get(pe.id());ue!=null&&(K={x:te.xCoords[ue],y:te.yCoords[ue]})}),K==null&&(K={x:pe.position("x"),y:pe.position("y")}),{x:K.x,y:K.y}}};if(S.quality=="default"||S.quality=="proof"||S.randomize){var me=v.calcParentsWithoutChildren(T,P),De=P.filter(function(ge){return ge.css("display")=="none"});S.eles=P.not(De),P.nodes().not(":parent").not(De).layoutPositions(C,S,oe),me.length>0&&me.forEach(function(ge){ge.position(oe(ge))})}else console.log("If randomize option is set to false, then quality option must be 'default' or 'proof'.")}}]),w}();o.exports=b},657:(o,l,u)=>{var c=u(548),d=u(140).layoutBase.Matrix,f=u(140).layoutBase.SVD,v=function(y){var m=y.cy,g=y.eles,x=g.nodes(),b=g.nodes(":parent"),w=new Map,E=new Map,C=new Map,S=[],T=[],P=[],A=[],j=[],R=[],O=[],N=[],D=void 0,L=1e8,_=1e-9,k=y.piTol,I=y.samplingType,F=y.nodeSeparation,B=void 0,$=function(){for(var M=0,Q=0,ne=!1;Q<B;){M=Math.floor(Math.random()*D),ne=!1;for(var re=0;re<Q;re++)if(A[re]==M){ne=!0;break}if(!ne)A[Q]=M,Q++;else continue}},W=function(M,Q,ne){for(var re=[],se=0,ye=0,le=0,he=void 0,de=[],Se=0,Oe=1,Le=0;Le<D;Le++)de[Le]=L;for(re[ye]=M,de[M]=0;ye>=se;){le=re[se++];for(var ke=S[le],Ae=0;Ae<ke.length;Ae++)he=E.get(ke[Ae]),de[he]==L&&(de[he]=de[le]+1,re[++ye]=he);R[le][Q]=de[le]*F}if(ne){for(var Te=0;Te<D;Te++)R[Te][Q]<j[Te]&&(j[Te]=R[Te][Q]);for(var Ge=0;Ge<D;Ge++)j[Ge]>Se&&(Se=j[Ge],Oe=Ge)}return Oe},z=function(M){var Q=void 0;if(M){Q=Math.floor(Math.random()*D);for(var re=0;re<D;re++)j[re]=L;for(var se=0;se<B;se++)A[se]=Q,Q=W(Q,se,M)}else{$();for(var ne=0;ne<B;ne++)W(A[ne],ne,M)}for(var ye=0;ye<D;ye++)for(var le=0;le<B;le++)R[ye][le]*=R[ye][le];for(var he=0;he<B;he++)O[he]=[];for(var de=0;de<B;de++)for(var Se=0;Se<B;Se++)O[de][Se]=R[A[Se]][de]},q=function(){for(var M=f.svd(O),Q=M.S,ne=M.U,re=M.V,se=Q[0]*Q[0]*Q[0],ye=[],le=0;le<B;le++){ye[le]=[];for(var he=0;he<B;he++)ye[le][he]=0,le==he&&(ye[le][he]=Q[le]/(Q[le]*Q[le]+se/(Q[le]*Q[le])))}N=d.multMat(d.multMat(re,ye),d.transpose(ne))},G=function(){for(var M=void 0,Q=void 0,ne=[],re=[],se=[],ye=[],le=0;le<D;le++)ne[le]=Math.random(),re[le]=Math.random();ne=d.normalize(ne),re=d.normalize(re);for(var he=_,de=_,Se=void 0;;){for(var Oe=0;Oe<D;Oe++)se[Oe]=ne[Oe];if(ne=d.multGamma(d.multL(d.multGamma(se),R,N)),M=d.dotProduct(se,ne),ne=d.normalize(ne),he=d.dotProduct(se,ne),Se=Math.abs(he/de),Se<=1+k&&Se>=1)break;de=he}for(var Le=0;Le<D;Le++)se[Le]=ne[Le];for(de=_;;){for(var ke=0;ke<D;ke++)ye[ke]=re[ke];if(ye=d.minusOp(ye,d.multCons(se,d.dotProduct(se,ye))),re=d.multGamma(d.multL(d.multGamma(ye),R,N)),Q=d.dotProduct(ye,re),re=d.normalize(re),he=d.dotProduct(ye,re),Se=Math.abs(he/de),Se<=1+k&&Se>=1)break;de=he}for(var Ae=0;Ae<D;Ae++)ye[Ae]=re[Ae];T=d.multCons(se,Math.sqrt(Math.abs(M))),P=d.multCons(ye,Math.sqrt(Math.abs(Q)))};c.connectComponents(m,g,c.getTopMostNodes(x),w),b.forEach(function(Z){c.connectComponents(m,g,c.getTopMostNodes(Z.descendants().intersection(g)),w)});for(var J=0,ae=0;ae<x.length;ae++)x[ae].isParent()||E.set(x[ae].id(),J++);var Y=!0,H=!1,X=void 0;try{for(var ee=w.keys()[Symbol.iterator](),ie;!(Y=(ie=ee.next()).done);Y=!0){var oe=ie.value;E.set(oe,J++)}}catch(Z){H=!0,X=Z}finally{try{!Y&&ee.return&&ee.return()}finally{if(H)throw X}}for(var me=0;me<E.size;me++)S[me]=[];b.forEach(function(Z){for(var M=Z.children().intersection(g);M.nodes(":childless").length==0;)M=M.nodes()[0].children().intersection(g);var Q=0,ne=M.nodes(":childless")[0].connectedEdges().length;M.nodes(":childless").forEach(function(re,se){re.connectedEdges().length<ne&&(ne=re.connectedEdges().length,Q=se)}),C.set(Z.id(),M.nodes(":childless")[Q].id())}),x.forEach(function(Z){var M=void 0;Z.isParent()?M=E.get(C.get(Z.id())):M=E.get(Z.id()),Z.neighborhood().nodes().forEach(function(Q){g.intersection(Z.edgesWith(Q)).length>0&&(Q.isParent()?S[M].push(C.get(Q.id())):S[M].push(Q.id()))})});var De=function(M){var Q=E.get(M),ne=void 0;w.get(M).forEach(function(re){m.getElementById(re).isParent()?ne=C.get(re):ne=re,S[Q].push(ne),S[E.get(ne)].push(M)})},ge=!0,pe=!1,we=void 0;try{for(var xe=w.keys()[Symbol.iterator](),Ee;!(ge=(Ee=xe.next()).done);ge=!0){var V=Ee.value;De(V)}}catch(Z){pe=!0,we=Z}finally{try{!ge&&xe.return&&xe.return()}finally{if(pe)throw we}}D=E.size;var K=void 0;if(D>2){B=D<y.sampleSize?D:y.sampleSize;for(var te=0;te<D;te++)R[te]=[];for(var ue=0;ue<B;ue++)N[ue]=[];return y.quality=="draft"||y.step=="all"?(z(I),q(),G(),K={nodeIndexes:E,xCoords:T,yCoords:P}):(E.forEach(function(Z,M){T.push(m.getElementById(M).position("x")),P.push(m.getElementById(M).position("y"))}),K={nodeIndexes:E,xCoords:T,yCoords:P}),K}else{var fe=E.keys(),ve=m.getElementById(fe.next().value),be=ve.position(),Ne=ve.outerWidth();if(T.push(be.x),P.push(be.y),D==2){var Ce=m.getElementById(fe.next().value),Re=Ce.outerWidth();T.push(be.x+Ne/2+Re/2+y.idealEdgeLength),P.push(be.y)}return K={nodeIndexes:E,xCoords:T,yCoords:P},K}};o.exports={spectralLayout:v}},579:(o,l,u)=>{var c=u(212),d=function(v){v&&v("layout","fcose",c)};typeof cytoscape<"u"&&d(cytoscape),o.exports=d},140:o=>{o.exports=r}},a={};function i(o){var l=a[o];if(l!==void 0)return l.exports;var u=a[o]={exports:{}};return n[o](u,u.exports,i),u.exports}var s=i(579);return s})()})})(WF);var G7=WF.exports;const H7=Sw(G7);let xD=!1;function W7(){xD||(ja.use(U7),ja.use(H7),xD=!0)}function Y7(t,e,r){const n=U.useRef(null);return U.useEffect(()=>{W7()},[]),U.useEffect(()=>{if(!t.current||(n.current&&(n.current.destroy(),n.current=null),e.length===0))return;const a=ja({container:t.current,elements:e,style:r,layout:{name:"preset"},minZoom:.1,maxZoom:4,wheelSensitivity:.3,boxSelectionEnabled:!1});return n.current=a,()=>{a.destroy(),n.current=null}},[t,e,r]),n}function X7(t){return{runLayout:U.useCallback((r="dagre",n="TB")=>{const a=t.current;if(!a||a.nodes().length===0)return;let i;r==="dagre"?i={name:"dagre",rankDir:n,nodeSep:60,rankSep:80,edgeSep:30,padding:40,animate:!0,animationDuration:300}:i={name:"fcose",animate:!0,animationDuration:300,nodeDimensionsIncludeLabels:!0,idealEdgeLength:150,nodeRepulsion:8e3,padding:40},a.layout(i).run()},[t])}}const bD=["#3498db","#2ecc71","#e74c3c","#9b59b6","#f1c40f","#1abc9c","#e67e22","#34495e","#16a085","#d35400"];function K7(t){const e={};return t.forEach((r,n)=>{e[r]=bD[n%bD.length]}),e}function hb(t){try{const e=document.createElement("canvas").getContext("2d");return e?(e.fillStyle="#123456",e.fillStyle=t,e.fillStyle!=="#123456"?e.fillStyle:null):null}catch{return null}}function dl(t,e){const r=getComputedStyle(document.documentElement).getPropertyValue(t).trim();if(!r)return e;if(r.startsWith("#")||r.startsWith("rgb")||r.startsWith("hsl(")||r.startsWith("oklch("))return hb(r)||e;const n=hb(`hsl(${r})`);if(n)return n;const a=hb(`oklch(${r})`);return a||e}function wD(t){const e=dl("--b1","#ffffff"),r=dl("--bc","#1f2937"),n=dl("--p","#570df8"),a=dl("--pc","#ffffff"),i=dl("--n","#2a323c"),s=[{selector:'node[type = "entity"]',style:{label:"data(label)","text-valign":"center","text-halign":"center","background-color":e,"border-width":2,"border-color":i,color:r,"font-size":14,"font-weight":"bold","font-family":"ui-sans-serif, system-ui, sans-serif",width:160,height:45,shape:"roundrectangle","text-wrap":"ellipsis","text-max-width":"140px"}},{selector:"node[pkCount > 0]",style:{"border-color":n,"border-width":3}},{selector:":parent",style:{"background-color":e,"background-opacity":.15,"border-style":"dashed","border-width":2,"border-color":i,"text-valign":"top","text-halign":"center","font-weight":"bold","font-size":15,padding:"24px",label:"data(label)",color:r}},{selector:"edge",style:{width:2,"line-color":i,"target-arrow-color":i,"target-arrow-shape":"triangle","curve-style":"bezier","source-label":"data(sourceCardinality)","target-label":"data(targetCardinality)","source-text-offset":20,"target-text-offset":20,"font-size":11,color:r,"text-background-color":e,"text-background-opacity":.8,"text-background-padding":"2px"}},{selector:":selected",style:{"background-color":n,color:a,"border-color":n,"line-color":n,"target-arrow-color":n}},{selector:".dimmed",style:{opacity:.15}},{selector:".highlighted",style:{"border-color":n,"border-width":4,"z-index":10}},{selector:"node[expanded]",style:{"text-valign":"top","font-size":11}},{selector:".perspective-root",style:{"border-width":5,"border-color":"#e74c3c","border-style":"double","z-index":10}},{selector:".perspective-member",style:{"border-width":3,"border-color":"#2ecc71"}},{selector:".perspective-frontier",style:{"border-width":3,"border-color":"#f39c12","border-style":"dashed"}}];for(const[o,l]of Object.entries(t))s.push({selector:`node[service = "${o}"]`,style:{"border-color":l,"border-width":2}});return s}function ED(t,e){const r=U.useMemo(()=>K7(e),[e]),n=U.useMemo(()=>wD(r),[r]),a=U.useRef(null);return U.useEffect(()=>{const i=new MutationObserver(()=>{const s=document.documentElement.getAttribute("data-theme");if(s!==a.current){a.current=s;const o=t.current;if(o){const l=wD(r);o.style().fromJson(l).update()}}});return i.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]}),a.current=document.documentElement.getAttribute("data-theme"),()=>i.disconnect()},[t,r]),{stylesheet:n,serviceColorMap:r}}function Q7(t,e){const[r,n]=U.useState(null),[a,i]=U.useState(null);U.useEffect(()=>{const l=t.current;if(!l)return;const u=y=>{const m=y.target;if(m.isParent())return;const g=m.renderedPosition();n({label:m.data("label"),description:m.data("description")||"",attrCount:m.data("attrCount")||0,pkCount:m.data("pkCount")||0,service:m.data("service")||"",position:{x:g.x,y:g.y-40}})},c=()=>{n(null)},d=y=>{const m=y.target;if(m.isParent())return;const g=m.data("service"),x=m.data("label"),b=m.data("attributes");e?e(g,x):i({type:"node",label:x,service:g,description:m.data("description"),attributes:b})},f=y=>{const m=y.target,g=l.getElementById(m.data("source")),x=l.getElementById(m.data("target"));i({type:"edge",label:m.data("label")||"Relationship",sourceLabel:g.data("label"),targetLabel:x.data("label"),sourceCardinality:m.data("sourceCardinality"),targetCardinality:m.data("targetCardinality")})},v=y=>{const m=y.target;if(m.isParent())return;const g=m.id();SD(l,g)},p=()=>{i(null)};return l.on("mouseover",'node[type = "entity"]',u),l.on("mouseout","node",c),l.on("tap","node",d),l.on("tap","edge",f),l.on("dbltap",'node[type = "entity"]',v),l.on("tap",p),()=>{l.off("mouseover",'node[type = "entity"]',u),l.off("mouseout","node",c),l.off("tap","node",d),l.off("tap","edge",f),l.off("dbltap",'node[type = "entity"]',v),l.off("tap",p)}},[t,e]);const s=U.useCallback(l=>{const u=t.current;if(!u)return;if(!l.trim()){u.elements().removeClass("dimmed highlighted");return}const c=l.toLowerCase();u.batch(()=>{u.elements().addClass("dimmed").removeClass("highlighted");const d=u.nodes().filter(f=>{var v,p;return((v=f.data("label"))==null?void 0:v.toLowerCase().includes(c))||((p=f.data("description"))==null?void 0:p.toLowerCase().includes(c))});d.removeClass("dimmed").addClass("highlighted"),d.connectedEdges().removeClass("dimmed"),d.neighborhood("node").removeClass("dimmed")})},[t]),o=U.useCallback(l=>{const u=t.current;u&&SD(u,l)},[t]);return{tooltip:r,infoPanel:a,setInfoPanel:i,applySearchFilter:s,toggleNodeExpansion:o}}function SD(t,e){const r=t.getElementById(e);if(!r.length)return;const n=!r.data("expanded");if(r.data("expanded",n),n){const a=r.data("attributes")||[],i=a.slice(0,15).map(o=>`${o.primaryKey?"PK ":""}${o.name}: ${o.type}`).join(`
|
|
414
|
+
`),s=a.length>15?`
|
|
415
|
+
... +${a.length-15} more`:"";r.style({label:`${r.data("label")}
|
|
416
|
+
${"─".repeat(20)}
|
|
417
|
+
${i}${s}`,height:Math.max(50,40+a.length*16),width:220,"text-valign":"top","font-size":10})}else r.style({label:r.data("label"),height:50,width:180,"text-valign":"center","font-size":13})}function Z7(t){const[e,r]=U.useState([]),[n,a]=U.useState(!1),i=U.useCallback(async c=>{try{a(!0);const d=await Ca.listDiagramLayouts(c),f=d.data??d;r(Array.isArray(f)?f:[])}catch(d){console.warn("Could not load diagram layouts:",d)}finally{a(!1)}},[]),s=U.useCallback(c=>{const d=t.current;d&&(d.batch(()=>{Object.entries(c.entities).forEach(([f,v])=>{const p=d.getElementById(f);p.length&&(p.position({x:v.x,y:v.y}),p.data("expanded",v.showProperties))})}),d.zoom(c.zoom),d.pan(c.pan))},[t]),o=U.useCallback(async(c,d)=>{const f=t.current,v={};f&&f.nodes().not(":parent").forEach(y=>{v[y.id()]={x:y.position("x"),y:y.position("y"),showProperties:y.data("expanded")??!1,name:y.data("label")}});const p={id:`${d||"all"}-${Date.now()}`,name:c,service:d,entities:v,zoom:(f==null?void 0:f.zoom())??1,pan:(f==null?void 0:f.pan())??{x:0,y:0}};try{const y=await Ca.saveDiagramLayout(p);r(m=>[...m,y.data??y])}catch(y){console.error("Failed to save layout:",y)}},[t]),l=U.useCallback(async c=>{try{const d=await Ca.loadDiagramLayout(c),f=d.data??d;s(f)}catch(d){console.error("Failed to load layout:",d)}},[s]),u=U.useCallback(async c=>{try{await Ca.deleteDiagramLayout(c),r(d=>d.filter(f=>f.id!==c))}catch(d){console.error("Failed to delete layout:",d)}},[]);return{layouts:e,loading:n,loadLayouts:i,saveLayout:o,loadLayout:l,deleteLayout:u,applyLayout:s}}function J7(t,e){var a;const[r,n]=U.useState(null);return U.useEffect(()=>{if(!e){n(null);const i=t.current;i&&i.elements().removeClass("perspective-root perspective-member perspective-frontier dimmed");return}un.resolve(e).then(n).catch(()=>n(null))},[e]),U.useEffect(()=>{const i=t.current;if(!i||!r)return;const s=new Set(r.resolvedNodes.map(u=>u.entityUuid)),o=new Set(r.resolvedNodes.filter(u=>u.isRoot).map(u=>u.entityUuid)),l=new Set(r.resolvedNodes.filter(u=>u.isFrontier).map(u=>u.entityUuid));i.batch(()=>{i.elements().removeClass("perspective-root perspective-member perspective-frontier dimmed"),i.nodes().addClass("dimmed"),i.edges().addClass("dimmed"),i.nodes().forEach(u=>{const c=u.id();s.has(c)&&(u.removeClass("dimmed"),o.has(c)?u.addClass("perspective-root"):l.has(c)?u.addClass("perspective-frontier"):u.addClass("perspective-member"))}),i.edges().forEach(u=>{s.has(u.source().id())&&s.has(u.target().id())&&u.removeClass("dimmed")})})},[r,(a=t.current)==null?void 0:a.elements().length]),{resolved:r}}function eX({cyRef:t,layoutName:e,layoutDirection:r,onLayoutChange:n,onDirectionChange:a,onRunLayout:i,onSearch:s,layouts:o,onSaveLayout:l,onLoadLayout:u,onDeleteLayout:c}){const[d,f]=U.useState(""),[v,p]=U.useState(!1),[y,m]=U.useState(""),g=S=>{f(S),s(S)},x=()=>{y.trim()&&(l(y.trim()),m(""),p(!1))},b=()=>{const S=t.current;S&&S.zoom({level:S.zoom()*1.2,renderedPosition:{x:S.width()/2,y:S.height()/2}})},w=()=>{const S=t.current;S&&S.zoom({level:S.zoom()/1.2,renderedPosition:{x:S.width()/2,y:S.height()/2}})},E=()=>{const S=t.current;S&&S.fit(void 0,40)},C=()=>{const S=t.current;if(!S)return;const T=S.png({full:!0,scale:2,bg:"white"}),P=document.createElement("a");P.href=T,P.download="graph.png",P.click()};return h.jsxs("div",{className:"flex flex-wrap items-center gap-2 p-2 bg-base-200 rounded-t-lg border-b border-base-300",children:[h.jsxs("div",{className:"join",children:[h.jsx("button",{className:`join-item btn btn-xs ${e==="dagre"?"btn-primary":"btn-ghost"}`,onClick:()=>n("dagre"),title:"Hierarchical layout",children:"Dagre"}),h.jsx("button",{className:`join-item btn btn-xs ${e==="fcose"?"btn-primary":"btn-ghost"}`,onClick:()=>n("fcose"),title:"Force-directed layout",children:"Force"})]}),e==="dagre"&&h.jsx("div",{className:"join",children:["TB","LR","BT","RL"].map(S=>h.jsx("button",{className:`join-item btn btn-xs ${r===S?"btn-primary":"btn-ghost"}`,onClick:()=>a(S),children:S},S))}),h.jsx("button",{className:"btn btn-xs btn-ghost",onClick:i,title:"Re-run layout",children:"Re-layout"}),h.jsx("div",{className:"divider divider-horizontal mx-0 h-6"}),h.jsxs("div",{className:"join",children:[h.jsx("button",{className:"join-item btn btn-xs btn-ghost",onClick:b,title:"Zoom in",children:"+"}),h.jsx("button",{className:"join-item btn btn-xs btn-ghost",onClick:w,title:"Zoom out",children:"-"}),h.jsx("button",{className:"join-item btn btn-xs btn-ghost",onClick:E,title:"Fit to screen",children:"Fit"})]}),h.jsx("div",{className:"divider divider-horizontal mx-0 h-6"}),h.jsx("input",{type:"text",className:"input input-xs input-bordered w-40",placeholder:"Search nodes...",value:d,onChange:S=>g(S.target.value)}),h.jsx("div",{className:"divider divider-horizontal mx-0 h-6"}),h.jsxs("div",{className:"dropdown dropdown-end",children:[h.jsxs("label",{tabIndex:0,className:"btn btn-xs btn-ghost",children:["Layouts (",o.length,")"]}),h.jsxs("div",{tabIndex:0,className:"dropdown-content z-50 menu p-2 shadow bg-base-100 rounded-box w-52",children:[o.map(S=>h.jsxs("div",{className:"flex items-center gap-1",children:[h.jsx("button",{className:"btn btn-xs btn-ghost flex-1 justify-start",onClick:()=>u(S.id),children:S.name}),h.jsx("button",{className:"btn btn-xs btn-ghost text-error",onClick:()=>c(S.id),children:"×"})]},S.id)),o.length===0&&h.jsx("div",{className:"text-xs opacity-50 px-2 py-1",children:"No saved layouts"})]})]}),v?h.jsxs("div",{className:"flex items-center gap-1",children:[h.jsx("input",{type:"text",className:"input input-xs input-bordered w-28",placeholder:"Layout name",value:y,onChange:S=>m(S.target.value),onKeyDown:S=>S.key==="Enter"&&x(),autoFocus:!0}),h.jsx("button",{className:"btn btn-xs btn-primary",onClick:x,children:"Save"}),h.jsx("button",{className:"btn btn-xs btn-ghost",onClick:()=>p(!1),children:"Cancel"})]}):h.jsx("button",{className:"btn btn-xs btn-ghost",onClick:()=>p(!0),children:"Save Layout"}),h.jsx("button",{className:"btn btn-xs btn-ghost ml-auto",onClick:C,title:"Export as PNG",children:"Export PNG"})]})}function tX({data:t}){return h.jsxs("div",{className:"absolute z-50 pointer-events-none bg-base-200 border border-base-300 rounded-lg shadow-lg px-3 py-2 text-sm max-w-xs",style:{left:t.position.x,top:t.position.y,transform:"translate(-50%, -100%)"},children:[h.jsx("div",{className:"font-bold text-base-content",children:t.label}),t.service&&h.jsx("div",{className:"text-xs opacity-60",children:t.service}),t.description&&h.jsx("div",{className:"mt-1 text-xs text-base-content/80 line-clamp-2",children:t.description}),h.jsxs("div",{className:"mt-1 flex gap-2 text-xs opacity-70",children:[h.jsxs("span",{children:[t.attrCount," attributes"]}),t.pkCount>0&&h.jsxs("span",{children:[t.pkCount," PK"]})]})]})}function rX({data:t,onClose:e,onNavigate:r}){return h.jsx("div",{className:"absolute right-0 top-0 h-full w-80 bg-base-100 border-l border-base-300 shadow-lg overflow-y-auto z-40",children:h.jsxs("div",{className:"p-4",children:[h.jsxs("div",{className:"flex items-center justify-between mb-3",children:[h.jsx("h3",{className:"font-bold text-lg text-base-content",children:t.label}),h.jsx("button",{onClick:e,className:"btn btn-ghost btn-sm btn-circle",children:"×"})]}),t.type==="node"&&h.jsxs(h.Fragment,{children:[t.service&&h.jsx("div",{className:"badge badge-outline badge-sm mb-2",children:t.service}),t.description&&h.jsx("p",{className:"text-sm text-base-content/80 mb-3",children:t.description}),t.service&&r&&h.jsx("button",{className:"btn btn-primary btn-sm mb-3 w-full",onClick:()=>r(t.service,t.label),children:"View Entity Details"}),t.attributes&&t.attributes.length>0&&h.jsxs("div",{children:[h.jsxs("h4",{className:"font-semibold text-sm mb-2",children:["Attributes (",t.attributes.length,")"]}),h.jsx("div",{className:"space-y-1",children:t.attributes.map(n=>h.jsxs("div",{className:"flex items-center gap-2 text-xs px-2 py-1 rounded bg-base-200",children:[n.primaryKey&&h.jsx("span",{className:"badge badge-primary badge-xs",children:"PK"}),h.jsx("span",{className:"font-mono",children:n.name}),h.jsx("span",{className:"opacity-50 ml-auto",children:n.type}),n.required&&h.jsx("span",{className:"text-error",children:"*"})]},n.uuid))})]})]}),t.type==="edge"&&h.jsxs("div",{className:"space-y-3",children:[h.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[h.jsx("span",{className:"font-mono",children:t.sourceLabel}),h.jsx("span",{className:"badge badge-sm",children:t.sourceCardinality}),h.jsx("span",{children:"→"}),h.jsx("span",{className:"badge badge-sm",children:t.targetCardinality}),h.jsx("span",{className:"font-mono",children:t.targetLabel})]}),h.jsxs("div",{className:"text-xs opacity-60",children:["Cardinality: ",t.sourceCardinality==="many"?"N":"1",":",t.targetCardinality==="many"?"N":"1"]})]})]})})}function YF({service:t,mode:e="service",packages:r,initialLayoutId:n,perspectiveId:a}){const i=ku(),s=vn(),o=U.useRef(null),l=t||i.service,u=i.entity,[c,d]=U.useState("dagre"),[f,v]=U.useState("TB"),[p,y]=U.useState(!1),{nodes:m,edges:g,loading:x,error:b,services:w}=W5(l,u),E=U.useMemo(()=>{if(m.length===0)return[];let I,F=[];if(e==="organization"&&r&&r.length>0){const $=X5(r);I=$.parentMapping,F=$.compoundNodes}const B=Y5(m,g,I);return[...F,...B]},[m,g,e,r]),{stylesheet:C}=ED({current:null},w),S=Y7(o,E,C);ED(S,w);const{runLayout:T}=X7(S),P=Z7(S);U.useEffect(()=>{P.loadLayouts(l)},[l]);const A=U.useCallback((I,F)=>{s(`/services/${I}/entities/${F}`)},[s]),{tooltip:j,infoPanel:R,setInfoPanel:O,applySearchFilter:N}=Q7(S);J7(S,a),U.useEffect(()=>{if(E.length>0&&S.current&&!p){if(n)P.loadLayout(n);else{const I=setTimeout(()=>{T(c,f)},100);return()=>clearTimeout(I)}y(!0)}},[E,S.current]);const D=U.useCallback(I=>{d(I),T(I,f)},[T,f]),L=U.useCallback(I=>{v(I),T(c,I)},[T,c]),_=U.useCallback(()=>{T(c,f)},[T,c,f]),k=U.useCallback(I=>{P.saveLayout(I,l)},[P,l]);return b?h.jsx("div",{className:"flex items-center justify-center h-96",children:h.jsx("div",{className:"alert alert-error max-w-md",children:h.jsxs("span",{children:["Failed to load graph: ",b]})})}):h.jsxs("div",{className:"flex flex-col h-full",children:[h.jsx(eX,{cyRef:S,layoutName:c,layoutDirection:f,onLayoutChange:D,onDirectionChange:L,onRunLayout:_,onSearch:N,layouts:P.layouts,onSaveLayout:k,onLoadLayout:P.loadLayout,onDeleteLayout:P.deleteLayout}),h.jsxs("div",{className:"relative flex-1 min-h-0",children:[x&&h.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-base-100/50 z-30",children:h.jsx("span",{className:"loading loading-spinner loading-lg"})}),!x&&E.length===0&&h.jsx("div",{className:"flex items-center justify-center h-full text-base-content/50",children:"No entities to display"}),h.jsx("div",{ref:o,className:"w-full h-full"}),j&&h.jsx(tX,{data:j}),R&&h.jsx(rX,{data:R,onClose:()=>O(null),onNavigate:A})]})]})}const aw=()=>{const[t,e]=U.useState([]),[r,n]=U.useState([]),[a,i]=U.useState({name:"",package:""}),[s,o]=U.useState(!1),[l,u]=U.useState(null),[c,d]=U.useState(!1),[f,v]=U.useState(!1),[p,y]=U.useState(!1),[m,g]=U.useState(null),[x,b]=U.useState({name:"",description:"",packageName:""});U.useEffect(()=>{(async()=>{try{const O=await xi.getAllPackages();n(O)}catch{}})()},[]);const w=async()=>{o(!0),u(null);try{const R=await xi.getAllPackages();n(R);const O=[];for(const N of R)if(!(a.package&&N.name!==a.package)&&N.entities)for(const D of N.entities)a.name&&!D.name.toLowerCase().includes(a.name.toLowerCase())||O.push({entity:D,packageName:N.name});e(O)}catch{u("Failed to load entities. Please try again.")}finally{o(!1)}};U.useEffect(()=>{w()},[]);const E=R=>{i({...a,[R.target.name]:R.target.value})},C=R=>{R.preventDefault(),w()},S=async()=>{if(!x.name||!x.packageName){u("Name and package are required");return}o(!0),u(null);try{const O={uuid:crypto.randomUUID(),name:x.name,description:x.description||void 0,attributes:[]};await at.createEntity(x.packageName,O),d(!1),b({name:"",description:"",packageName:""}),w()}catch(R){console.error("Error creating entity:",R),u("Failed to create entity. Please try again.")}finally{o(!1)}},T=async()=>{if(m){o(!0),u(null);try{await at.updateEntity(m.packageName,m.entity.name,m.entity),v(!1),g(null),w()}catch(R){console.error("Error updating entity:",R),u("Failed to update entity. Please try again.")}finally{o(!1)}}},P=async()=>{if(m){o(!0),u(null);try{await at.deleteEntity(m.packageName,m.entity.name),y(!1),g(null),w()}catch(R){console.error("Error deleting entity:",R),u("Failed to delete entity. Please try again.")}finally{o(!1)}}},A=R=>{const{name:O,value:N}=R.target;b({...x,[O]:N})},j=R=>{if(!m)return;const{name:O,value:N}=R.target;g({...m,entity:{...m.entity,[O]:N}})};return h.jsxs("div",{className:"container mx-auto px-4 sm:px-6 lg:px-8 flex-1 flex flex-col min-h-0",children:[h.jsxs("div",{className:"flex justify-between items-center mb-2",children:[h.jsx("h1",{className:"text-lg font-semibold",children:"Entities & Attributes (Flat View)"}),h.jsx("button",{className:"btn btn-primary",onClick:()=>d(!0),children:"Add Entity"})]}),h.jsxs("form",{className:"flex flex-wrap gap-3 mb-2",onSubmit:C,children:[h.jsx("input",{type:"text",name:"name",placeholder:"Name",className:"input input-bordered",value:a.name,onChange:E}),h.jsxs("select",{name:"package",className:"select select-bordered",value:a.package,onChange:E,children:[h.jsx("option",{value:"",children:"All Packages"}),r.map(R=>h.jsx("option",{value:R.name,children:R.name},R.id))]}),h.jsx("button",{type:"submit",className:"btn btn-outline",children:"Filter"})]}),s?h.jsx("div",{className:"flex justify-center items-center h-32",children:h.jsx("span",{className:"loading loading-spinner loading-lg"})}):l?h.jsx("div",{className:"alert alert-error",children:l}):h.jsx("div",{className:"overflow-x-auto bg-base-100 rounded-lg shadow p-1 flex-1 min-h-0",children:h.jsxs("table",{className:"table table-zebra w-full",children:[h.jsx("thead",{children:h.jsxs("tr",{children:[h.jsx("th",{children:"Name"}),h.jsx("th",{children:"Package"}),h.jsx("th",{children:"Description"}),h.jsx("th",{children:"Actions"})]})}),h.jsx("tbody",{children:t.length===0?h.jsx("tr",{children:h.jsx("td",{colSpan:4,className:"text-center text-gray-500",children:"No entities found."})}):t.map(({entity:R,packageName:O})=>h.jsxs("tr",{children:[h.jsx("td",{children:R.name}),h.jsx("td",{children:O}),h.jsx("td",{className:"max-w-xs truncate",children:R.description}),h.jsx("td",{children:h.jsxs("div",{className:"flex gap-2",children:[h.jsx("button",{onClick:()=>{g({entity:R,packageName:O}),v(!0)},className:"btn btn-sm btn-ghost btn-square",title:"Edit","aria-label":`Edit ${R.name}`,children:h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor",children:h.jsx("path",{d:"M13.586 3.586a2 2 0 112.828 2.828l-.793.793-2.828-2.828.793-.793zM11.379 5.793L3 14.172V17h2.828l8.38-8.379-2.83-2.828z"})})}),h.jsx("button",{onClick:()=>{g({entity:R,packageName:O}),y(!0)},className:"btn btn-sm btn-ghost btn-square text-error",title:"Delete","aria-label":`Delete ${R.name}`,children:h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor",children:h.jsx("path",{fillRule:"evenodd",d:"M9 2a1 1 0 00-.894.553L7.382 4H4a1 1 0 000 2v10a2 2 0 002 2h8a2 2 0 002-2V6a1 1 0 100-2h-3.382l-.724-1.447A1 1 0 0011 2H9zM7 8a1 1 0 012 0v6a1 1 0 11-2 0V8zm5-1a1 1 0 00-1 1v6a1 1 0 102 0V8a1 1 0 00-1-1z",clipRule:"evenodd"})})})]})})]},R.uuid))})]})}),c&&h.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50",children:h.jsxs("div",{className:"bg-base-100 p-6 rounded-lg shadow-lg w-full max-w-md",children:[h.jsx("h2",{className:"text-xl font-bold mb-4",children:"Create New Entity"}),l&&h.jsx("div",{className:"alert alert-error mb-4",children:l}),h.jsxs("div",{className:"form-control mb-4",children:[h.jsx("label",{className:"label",children:h.jsx("span",{className:"label-text",children:"Name"})}),h.jsx("input",{type:"text",name:"name",className:"input input-bordered",value:x.name,onChange:A,required:!0})]}),h.jsxs("div",{className:"form-control mb-4",children:[h.jsx("label",{className:"label",children:h.jsx("span",{className:"label-text",children:"Description"})}),h.jsx("textarea",{name:"description",className:"textarea textarea-bordered",value:x.description,onChange:A})]}),h.jsxs("div",{className:"form-control mb-4",children:[h.jsx("label",{className:"label",children:h.jsx("span",{className:"label-text",children:"Package"})}),h.jsxs("select",{name:"packageName",className:"select select-bordered",value:x.packageName,onChange:A,required:!0,children:[h.jsx("option",{value:"",children:"Select a package"}),r.map(R=>h.jsx("option",{value:R.name,children:R.name},R.id))]})]}),h.jsxs("div",{className:"flex justify-end gap-2 mt-6",children:[h.jsx("button",{type:"button",className:"btn btn-outline",onClick:()=>{d(!1),u(null)},children:"Cancel"}),h.jsx("button",{type:"button",className:"btn btn-primary",onClick:S,disabled:s,children:s?h.jsxs(h.Fragment,{children:[h.jsx("span",{className:"loading loading-spinner loading-xs mr-2"}),"Creating..."]}):"Create"})]})]})}),f&&m&&h.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50",children:h.jsxs("div",{className:"bg-base-100 p-6 rounded-lg shadow-lg w-full max-w-md",children:[h.jsx("h2",{className:"text-xl font-bold mb-4",children:"Edit Entity"}),l&&h.jsx("div",{className:"alert alert-error mb-4",children:l}),h.jsxs("div",{className:"form-control mb-4",children:[h.jsx("label",{className:"label",children:h.jsx("span",{className:"label-text",children:"Name"})}),h.jsx("input",{type:"text",name:"name",className:"input input-bordered",value:m.entity.name,onChange:j,required:!0})]}),h.jsxs("div",{className:"form-control mb-4",children:[h.jsx("label",{className:"label",children:h.jsx("span",{className:"label-text",children:"Description"})}),h.jsx("textarea",{name:"description",className:"textarea textarea-bordered",value:m.entity.description||"",onChange:j})]}),h.jsxs("div",{className:"form-control mb-4",children:[h.jsx("label",{className:"label",children:h.jsx("span",{className:"label-text",children:"Package"})}),h.jsx("input",{type:"text",className:"input input-bordered",value:m.packageName,disabled:!0})]}),h.jsxs("div",{className:"flex justify-end gap-2 mt-6",children:[h.jsx("button",{type:"button",className:"btn btn-outline",onClick:()=>{v(!1),g(null),u(null)},children:"Cancel"}),h.jsx("button",{type:"button",className:"btn btn-primary",onClick:T,disabled:s,children:s?h.jsxs(h.Fragment,{children:[h.jsx("span",{className:"loading loading-spinner loading-xs mr-2"}),"Updating..."]}):"Update"})]})]})}),p&&m&&h.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50",children:h.jsxs("div",{className:"bg-base-100 p-6 rounded-lg shadow-lg w-full max-w-md",children:[h.jsx("h2",{className:"text-xl font-bold mb-4",children:"Delete Entity"}),h.jsxs("p",{className:"mb-4",children:["Are you sure you want to delete the entity ",h.jsx("strong",{children:m.entity.name}),"? This action cannot be undone."]}),l&&h.jsx("div",{className:"alert alert-error mb-4",children:l}),h.jsxs("div",{className:"flex justify-end gap-2 mt-6",children:[h.jsx("button",{type:"button",className:"btn btn-outline",onClick:()=>{y(!1),g(null),u(null)},children:"Cancel"}),h.jsx("button",{type:"button",className:"btn btn-error",onClick:P,disabled:s,children:s?h.jsxs(h.Fragment,{children:[h.jsx("span",{className:"loading loading-spinner loading-xs mr-2"}),"Deleting..."]}):"Delete"})]})]})})]})},CD=()=>{const[t,e]=U.useState([]),[r,n]=U.useState(!0),[a,i]=U.useState(null),[s,o]=U.useState("tree"),[l,u]=U.useState("tree");U.useEffect(()=>{(async()=>{try{n(!0);const f=await T5();e(f),i(null)}catch(f){console.error("Error fetching package tree:",f),i("Failed to load package hierarchy. Please try again later.")}finally{n(!1)}})()},[]);const c=(d,f=0)=>h.jsx("ul",{className:`pl-${f*4}`,children:d.map(v=>h.jsxs("li",{className:"mb-2",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("span",{className:"font-semibold",children:v.name}),v.description&&h.jsxs("span",{className:"text-xs text-gray-500",children:["(",v.description,")"]}),h.jsx(ze,{to:`/packages/${v.id}`,className:"btn btn-xs btn-outline ml-2",children:"Details"})]}),v.entities&&v.entities.length>0&&h.jsx("ul",{className:"ml-6 mt-1",children:v.entities.map(p=>h.jsxs("li",{className:"flex items-center gap-2",children:[h.jsx(ze,{to:`/services/${v.name}/entities/${p.name}`,className:"link",children:p.name}),h.jsx("span",{className:"text-xs text-gray-400",children:p.description})]},p.uuid))}),v.subPackages&&v.subPackages.length>0&&c(v.subPackages,f+1)]},v.id))});return r?h.jsx("div",{className:"flex justify-center items-center h-64",children:h.jsx("span",{className:"loading loading-spinner loading-lg"})}):a?h.jsxs("div",{className:"alert alert-error",children:[h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"stroke-current shrink-0 h-6 w-6",fill:"none",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m7-2a9 9 0 11-18 0 9 9 0 0118 0z"})}),h.jsx("span",{children:a})]}):h.jsxs("div",{children:[h.jsxs("div",{className:"flex justify-between items-center mb-2",children:[h.jsx("h1",{className:"text-lg font-semibold",children:"Package Hierarchy"}),h.jsxs("div",{className:"flex gap-2",children:[h.jsx("button",{className:`btn btn-sm ${s!=="diagram"?"btn-outline":"btn-ghost"}`,onClick:()=>{const d=s==="table"?"tree":"table";o(d),u(d)},children:s==="table"?"Table View":"Tree View"}),h.jsx("button",{className:`btn btn-sm ${s==="diagram"?"btn-outline":"btn-ghost"}`,onClick:()=>o("diagram"),children:"Diagram View"})]})]}),s==="table"?h.jsx("div",{className:"overflow-x-auto",children:h.jsx(aw,{})}):s==="tree"?h.jsx("div",{className:"overflow-x-auto",children:t.length===0?h.jsx("div",{className:"alert alert-info",children:h.jsx("span",{children:"No packages found. Create a new package to get started."})}):c(t)}):h.jsx("div",{className:"h-[700px]",children:h.jsx(YF,{mode:"organization",packages:t})})]})},nX=()=>{const[t,e]=U.useState([]),[r,n]=U.useState(!1),[a,i]=U.useState(null);return U.useEffect(()=>{(async()=>{n(!0),i(null);try{const o=await xi.getAllPackages();e(o)}catch{i("Failed to load packages. Please try again.")}finally{n(!1)}})()},[]),h.jsxs("div",{className:"container mx-auto px-4 sm:px-6 lg:px-8 flex-1 flex flex-col min-h-0",children:[h.jsx("h1",{className:"text-lg font-semibold mb-2",children:"Packages (Flat View)"}),r?h.jsx("div",{className:"flex justify-center items-center h-32",children:h.jsx("span",{className:"loading loading-spinner loading-lg"})}):a?h.jsx("div",{className:"alert alert-error",children:a}):h.jsx("div",{className:"overflow-x-auto bg-base-100 rounded-lg shadow p-1 flex-1 min-h-0",children:h.jsxs("table",{className:"table table-zebra w-full",children:[h.jsx("thead",{children:h.jsxs("tr",{children:[h.jsx("th",{children:"Package Name"}),h.jsx("th",{children:"Description"}),h.jsx("th",{children:"Microservice"}),h.jsx("th",{children:"Entity Count"}),h.jsx("th",{children:"Created At"}),h.jsx("th",{children:"Updated At"})]})}),h.jsx("tbody",{children:t.length===0?h.jsx("tr",{children:h.jsx("td",{colSpan:6,className:"text-center text-gray-500",children:"No packages found."})}):t.map(s=>{var o;return h.jsxs("tr",{children:[h.jsx("td",{children:s.name}),h.jsx("td",{className:"max-w-xs truncate",children:s.description}),h.jsx("td",{children:s.type||"-"}),h.jsx("td",{children:((o=s.entities)==null?void 0:o.length)??0}),h.jsx("td",{children:s.createdAt?new Date(s.createdAt).toLocaleString():"-"}),h.jsx("td",{children:s.updatedAt?new Date(s.updatedAt).toLocaleString():"-"})]},s.id)})})]})})]})},aX=()=>{const[t,e]=U.useState([]),[r,n]=U.useState(!1),[a,i]=U.useState(null);return U.useEffect(()=>{(async()=>{n(!0),i(null);try{const o=await xi.getAllPackages(),l=[];for(const u of o)if(u.entities){for(const c of u.entities)if(c.attributes)for(const d of c.attributes)l.push({attribute:d,entityName:c.name,packageName:u.name})}e(l)}catch{i("Failed to load attributes. Please try again.")}finally{n(!1)}})()},[]),h.jsxs("div",{className:"container mx-auto px-4 sm:px-6 lg:px-8 flex-1 flex flex-col min-h-0",children:[h.jsx("h1",{className:"text-lg font-semibold mb-2",children:"Attributes (Flat View)"}),r?h.jsx("div",{className:"flex justify-center items-center h-32",children:h.jsx("span",{className:"loading loading-spinner loading-lg"})}):a?h.jsx("div",{className:"alert alert-error",children:a}):h.jsx("div",{className:"overflow-x-auto bg-base-100 rounded-lg shadow p-1 flex-1 min-h-0",children:h.jsxs("table",{className:"table table-zebra w-full",children:[h.jsx("thead",{children:h.jsxs("tr",{children:[h.jsx("th",{children:"Attribute Name"}),h.jsx("th",{children:"Type"}),h.jsx("th",{children:"Description"}),h.jsx("th",{children:"Required"}),h.jsx("th",{children:"Entity Name"}),h.jsx("th",{children:"Package Name"})]})}),h.jsx("tbody",{children:t.length===0?h.jsx("tr",{children:h.jsx("td",{colSpan:6,className:"text-center text-gray-500",children:"No attributes found."})}):t.map(({attribute:s,entityName:o,packageName:l})=>h.jsxs("tr",{children:[h.jsx("td",{children:s.name}),h.jsx("td",{children:s.type}),h.jsx("td",{className:"max-w-xs truncate",children:s.description}),h.jsx("td",{children:s.required?"Yes":"No"}),h.jsx("td",{children:o}),h.jsx("td",{children:l})]},s.uuid+o+l))})]})})]})},iX={entity:"badge-primary",attribute:"badge-secondary",metadata:"badge-accent",relationship:"badge-info",package:"badge-warning"},sX=()=>{const[t,e]=jO(),r=t.get("q")||"",[n,a]=U.useState(r),[i,s]=U.useState([]),[o,l]=U.useState(!1),[u,c]=U.useState(null),[d,f]=U.useState({type:t.get("type")||"all",service:t.get("service")||"all",stereotype:t.get("stereotype")||"all",hasMetadata:t.get("hasMetadata")||""}),[v,p]=U.useState([]),[y,m]=U.useState([]);U.useEffect(()=>{at.getAllServices().then(C=>p(C.data)).catch(()=>{}),zn.getAll("entity").then(m).catch(()=>{})},[]),U.useEffect(()=>{r&&g(r)},[r]);const g=async C=>{if(!C.trim()){s([]);return}try{l(!0),c(null);const S={};d.type!=="all"&&(S.type=d.type),d.service!=="all"&&(S.service=d.service),d.stereotype!=="all"&&(S.stereotype=d.stereotype),d.hasMetadata&&(S.hasMetadata=d.hasMetadata);const T=await at.searchEntities(C,Object.keys(S).length>0?S:void 0);s(T.data)}catch{c("Failed to perform search.")}finally{l(!1)}},x=C=>{C.preventDefault();const S={q:n};d.type!=="all"&&(S.type=d.type),d.service!=="all"&&(S.service=d.service),d.stereotype!=="all"&&(S.stereotype=d.stereotype),d.hasMetadata&&(S.hasMetadata=d.hasMetadata),e(S),g(n)},b=(C,S)=>{f(T=>({...T,[C]:S}))},w=(C,S)=>{if(!S.trim())return C;const T=new RegExp(`(${S.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")})`,"gi");return C.split(T).map((A,j)=>T.test(A)?h.jsx("mark",{className:"bg-primary/30",children:A},j):A)},E=C=>C.type==="package"?`/packages/${C.service}`:C.type==="relationship"?`/packages/${C.service}`:`/packages/${C.service}/entities/${C.entityName}`;return h.jsx("div",{className:"card bg-base-100 shadow-xl",children:h.jsxs("div",{className:"card-body",children:[h.jsx("h2",{className:"card-title text-2xl mb-6",children:"Search Data Dictionary"}),h.jsx("form",{onSubmit:x,className:"mb-6",children:h.jsx("div",{className:"flex gap-4",children:h.jsx("div",{className:"form-control flex-1",children:h.jsxs("div",{className:"join w-full",children:[h.jsx("input",{type:"text",placeholder:"Search entities, attributes, metadata, relationships...",className:"input input-bordered join-item w-full",value:n,onChange:C=>a(C.target.value)}),h.jsx("button",{type:"submit",className:"btn btn-primary join-item",children:"Search"})]})})})}),h.jsxs("div",{className:"flex flex-wrap gap-3 mb-6",children:[h.jsx("div",{className:"form-control",children:h.jsxs("select",{className:"select select-bordered select-sm",value:d.type,onChange:C=>b("type",C.target.value),children:[h.jsx("option",{value:"all",children:"All Types"}),h.jsx("option",{value:"entity",children:"Entities"}),h.jsx("option",{value:"attribute",children:"Attributes"}),h.jsx("option",{value:"metadata",children:"Metadata"}),h.jsx("option",{value:"relationship",children:"Relationships"}),h.jsx("option",{value:"package",children:"Packages"})]})}),h.jsx("div",{className:"form-control",children:h.jsxs("select",{className:"select select-bordered select-sm",value:d.service,onChange:C=>b("service",C.target.value),children:[h.jsx("option",{value:"all",children:"All Services"}),v.map(C=>h.jsx("option",{value:C,children:C},C))]})}),h.jsx("div",{className:"form-control",children:h.jsxs("select",{className:"select select-bordered select-sm",value:d.stereotype,onChange:C=>b("stereotype",C.target.value),children:[h.jsx("option",{value:"all",children:"All Stereotypes"}),y.map(C=>h.jsx("option",{value:C.id,children:C.name},C.id))]})}),h.jsx("div",{className:"form-control",children:h.jsx("input",{type:"text",className:"input input-bordered input-sm w-40",placeholder:"Has metadata...",value:d.hasMetadata,onChange:C=>b("hasMetadata",C.target.value)})})]}),o?h.jsx("div",{className:"flex justify-center items-center h-64",children:h.jsx("span",{className:"loading loading-spinner loading-lg"})}):u?h.jsx("div",{className:"alert alert-error",children:h.jsx("span",{children:u})}):i.length===0&&r?h.jsx("div",{className:"alert alert-info",children:h.jsxs("span",{children:['No results found for "',r,'". Try a different search term or adjust filters.']})}):i.length>0?h.jsx("div",{className:"overflow-x-auto",children:h.jsxs("table",{className:"table table-sm w-full",children:[h.jsx("thead",{children:h.jsxs("tr",{children:[h.jsx("th",{children:"Type"}),h.jsx("th",{children:"Name"}),h.jsx("th",{children:"Service"}),h.jsx("th",{children:"Description"}),h.jsx("th",{children:"Context"}),h.jsx("th",{})]})}),h.jsx("tbody",{children:i.map((C,S)=>h.jsxs("tr",{className:"hover",children:[h.jsx("td",{children:h.jsx("span",{className:`badge badge-sm ${iX[C.type]||"badge-ghost"}`,children:C.type})}),h.jsx("td",{className:"font-mono font-medium",children:w(C.name,n)}),h.jsx("td",{children:h.jsx("span",{className:"badge badge-ghost badge-sm",children:C.service})}),h.jsx("td",{className:"max-w-xs truncate text-sm",children:w(C.description,n)}),h.jsx("td",{className:"text-xs text-base-content/60",children:C.matchContext||""}),h.jsx("td",{children:h.jsx(ze,{to:E(C),className:"btn btn-xs btn-ghost",children:"View"})})]},S))})]})}):null,i.length>0&&h.jsxs("div",{className:"mt-4 text-sm text-base-content/70",children:[i.length," ",i.length===1?"result":"results"]})]})})},oX=()=>{const[t,e]=U.useState(""),[r,n]=U.useState(!1),[a,i]=U.useState(null),[s,o]=U.useState(null),l=vn(),u=async c=>{if(c.preventDefault(),!t.trim()){i("Commit message is required");return}try{n(!0),i(null),o(null);const d=await us.commitChanges(t);o(`Changes committed successfully. Commit hash: ${d.data.commitHash}`),e(""),setTimeout(()=>{l("/version/history")},2e3)}catch(d){console.error("Error committing changes:",d),i("Failed to commit changes. Please try again.")}finally{n(!1)}};return h.jsx("div",{className:"card bg-base-100 shadow-xl",children:h.jsxs("div",{className:"card-body",children:[h.jsx("h2",{className:"card-title text-2xl mb-6",children:"Commit Changes"}),a&&h.jsxs("div",{className:"alert alert-error mb-6",children:[h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"stroke-current shrink-0 h-6 w-6",fill:"none",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m7-2a9 9 0 11-18 0 9 9 0 0118 0z"})}),h.jsx("span",{children:a})]}),s&&h.jsxs("div",{className:"alert alert-success mb-6",children:[h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"stroke-current shrink-0 h-6 w-6",fill:"none",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"})}),h.jsx("span",{children:s})]}),h.jsxs("form",{onSubmit:u,children:[h.jsxs("div",{className:"form-control",children:[h.jsx("label",{className:"label",children:h.jsx("span",{className:"label-text",children:"Commit Message"})}),h.jsx("textarea",{className:"textarea textarea-bordered h-24",placeholder:"Describe the changes you've made...",value:t,onChange:c=>e(c.target.value),required:!0}),h.jsx("label",{className:"label",children:h.jsx("span",{className:"label-text-alt",children:"Write a clear and descriptive message explaining the changes you've made."})})]}),h.jsxs("div",{className:"alert alert-info mt-6 mb-6",children:[h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",className:"stroke-current shrink-0 w-6 h-6",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),h.jsxs("div",{children:[h.jsx("p",{className:"font-medium",children:"Committing will save all changes to the data dictionary."}),h.jsx("p",{className:"text-sm mt-1",children:"This creates a new version that can be reverted to later if needed."})]})]}),h.jsxs("div",{className:"card-actions justify-end mt-6",children:[h.jsx("button",{type:"button",className:"btn btn-ghost",onClick:()=>l("/version/history"),disabled:r,children:"Cancel"}),h.jsx("button",{type:"submit",className:"btn btn-primary",disabled:r,children:r?h.jsxs(h.Fragment,{children:[h.jsx("span",{className:"loading loading-spinner loading-sm"}),"Committing..."]}):h.jsxs(h.Fragment,{children:[h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5 mr-2",viewBox:"0 0 20 20",fill:"currentColor",children:h.jsx("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z",clipRule:"evenodd"})}),"Commit Changes"]})})]})]})]})})},lX=()=>{const[t,e]=U.useState([]),[r,n]=U.useState(!0),[a,i]=U.useState(null),[s,o]=U.useState(null),[l,u]=U.useState(null),[c,d]=U.useState(null),[f,v]=U.useState(20);U.useEffect(()=>{p()},[f]);const p=async()=>{try{n(!0),i(null);const g=await us.getCommitHistory(f);e(g.data)}catch(g){console.error("Error fetching commit history:",g),i("Failed to load commit history. Please try again later.")}finally{n(!1)}},y=async g=>{try{o(g),u(null),d(null);const x=await us.revertToCommit(g);d(`Successfully reverted to commit ${g.substring(0,7)}. New revert commit: ${x.data.newCommitHash.substring(0,7)}`),p()}catch(x){console.error(`Error reverting to commit ${g}:`,x),u(`Failed to revert to commit ${g.substring(0,7)}. Please try again.`)}finally{o(null)}},m=g=>{const x=new Date(g);return new Intl.DateTimeFormat("en-US",{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}).format(x)};return h.jsx("div",{className:"card bg-base-100 shadow-xl",children:h.jsxs("div",{className:"card-body",children:[h.jsxs("div",{className:"flex justify-between items-center mb-6",children:[h.jsx("h2",{className:"card-title text-2xl",children:"Commit History"}),h.jsx("div",{className:"form-control",children:h.jsxs("select",{className:"select select-bordered select-sm",value:f,onChange:g=>v(Number(g.target.value)),children:[h.jsx("option",{value:10,children:"Last 10 commits"}),h.jsx("option",{value:20,children:"Last 20 commits"}),h.jsx("option",{value:50,children:"Last 50 commits"}),h.jsx("option",{value:100,children:"Last 100 commits"})]})})]}),c&&h.jsxs("div",{className:"alert alert-success mb-6",children:[h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"stroke-current shrink-0 h-6 w-6",fill:"none",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"})}),h.jsx("span",{children:c})]}),l&&h.jsxs("div",{className:"alert alert-error mb-6",children:[h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"stroke-current shrink-0 h-6 w-6",fill:"none",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m7-2a9 9 0 11-18 0 9 9 0 0118 0z"})}),h.jsx("span",{children:l})]}),r?h.jsx("div",{className:"flex justify-center items-center h-64",children:h.jsx("span",{className:"loading loading-spinner loading-lg"})}):a?h.jsxs("div",{className:"alert alert-error",children:[h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"stroke-current shrink-0 h-6 w-6",fill:"none",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m7-2a9 9 0 11-18 0 9 9 0 0118 0z"})}),h.jsx("span",{children:a})]}):t.length===0?h.jsxs("div",{className:"alert alert-info",children:[h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",className:"stroke-current shrink-0 w-6 h-6",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),h.jsx("span",{children:"No commit history found. Make your first commit to start tracking changes."})]}):h.jsx("div",{className:"overflow-x-auto",children:h.jsxs("table",{className:"table table-zebra w-full",children:[h.jsx("thead",{children:h.jsxs("tr",{children:[h.jsx("th",{children:"Commit"}),h.jsx("th",{children:"Message"}),h.jsx("th",{children:"Author"}),h.jsx("th",{children:"Date"}),h.jsx("th",{children:"Changes"}),h.jsx("th",{children:"Actions"})]})}),h.jsx("tbody",{children:t.map(g=>h.jsxs("tr",{className:"hover",children:[h.jsx("td",{className:"font-mono",children:g.hash.substring(0,7)}),h.jsx("td",{className:"max-w-xs truncate",children:g.message}),h.jsx("td",{children:g.author}),h.jsx("td",{children:m(g.date)}),h.jsx("td",{children:g.changes&&h.jsxs("div",{className:"flex flex-col gap-1",children:[g.changes.added.length>0&&h.jsxs("span",{className:"text-success text-sm",children:["+",g.changes.added.length," added"]}),g.changes.modified.length>0&&h.jsxs("span",{className:"text-warning text-sm",children:["~",g.changes.modified.length," modified"]}),g.changes.deleted.length>0&&h.jsxs("span",{className:"text-error text-sm",children:["-",g.changes.deleted.length," deleted"]})]})}),h.jsx("td",{children:h.jsxs("div",{className:"flex gap-2",children:[h.jsxs("button",{className:"btn btn-sm btn-outline",onClick:()=>y(g.hash),disabled:!!s,children:[s===g.hash?h.jsx("span",{className:"loading loading-spinner loading-xs"}):h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4",viewBox:"0 0 20 20",fill:"currentColor",children:h.jsx("path",{fillRule:"evenodd",d:"M4 2a1 1 0 011 1v2.101a7.002 7.002 0 0111.601 2.566 1 1 0 11-1.885.666A5.002 5.002 0 005.999 7H9a1 1 0 010 2H4a1 1 0 01-1-1V3a1 1 0 011-1zm.008 9.057a1 1 0 011.276.61A5.002 5.002 0 0014.001 13H11a1 1 0 110-2h5a1 1 0 011 1v5a1 1 0 11-2 0v-2.101a7.002 7.002 0 01-11.601-2.566 1 1 0 01.61-1.276z",clipRule:"evenodd"})}),"Revert"]}),h.jsxs("button",{className:"btn btn-sm btn-ghost",onClick:()=>{console.log("View commit details:",g.hash)},children:[h.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4",viewBox:"0 0 20 20",fill:"currentColor",children:[h.jsx("path",{d:"M10 12a2 2 0 100-4 2 2 0 000 4z"}),h.jsx("path",{fillRule:"evenodd",d:"M.458 10C1.732 5.943 5.522 3 10 3s8.268 2.943 9.542 7c-1.274 4.057-5.064 7-9.542 7S1.732 14.057.458 10zM14 10a4 4 0 11-8 0 4 4 0 018 0z",clipRule:"evenodd"})]}),"Details"]})]})})]},g.hash))})]})})]})})};var Ju=t=>t.type==="checkbox",es=t=>t instanceof Date,Vr=t=>t==null;const XF=t=>typeof t=="object";var Bt=t=>!Vr(t)&&!Array.isArray(t)&&XF(t)&&!es(t),uX=t=>Bt(t)&&t.target?Ju(t.target)?t.target.checked:t.target.value:t,KF=t=>t.substring(0,t.search(/\.\d+(\.|$)/))||t,cX=(t,e)=>t.has(KF(e)),dX=t=>{const e=t.constructor&&t.constructor.prototype;return Bt(e)&&e.hasOwnProperty("isPrototypeOf")},bS=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function Qt(t){if(t instanceof Date)return new Date(t);const e=typeof FileList<"u"&&t instanceof FileList;if(bS&&(t instanceof Blob||e))return t;const r=Array.isArray(t);if(!r&&!(Bt(t)&&dX(t)))return t;const n=r?[]:Object.create(Object.getPrototypeOf(t));for(const a in t)Object.prototype.hasOwnProperty.call(t,a)&&(n[a]=Qt(t[a]));return n}var Rh=t=>/^\w*$/.test(t),At=t=>t===void 0,wS=t=>Array.isArray(t)?t.filter(Boolean):[],ES=t=>wS(t.replace(/["|']|\]/g,"").split(/\.|\[/)),Ue=(t,e,r)=>{if(!e||!Bt(t))return r;const n=(Rh(e)?[e]:ES(e)).reduce((a,i)=>Vr(a)?a:a[i],t);return At(n)||n===t?At(t[e])?r:t[e]:n},aa=t=>typeof t=="boolean",In=t=>typeof t=="function",Et=(t,e,r)=>{let n=-1;const a=Rh(e)?[e]:ES(e),i=a.length,s=i-1;for(;++n<i;){const o=a[n];let l=r;if(n!==s){const u=t[o];l=Bt(u)||Array.isArray(u)?u:isNaN(+a[n+1])?{}:[]}if(o==="__proto__"||o==="constructor"||o==="prototype")return;t[o]=l,t=t[o]}};const Os={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change",SUBMIT:"submit",TRIGGER:"trigger",VALID:"valid"},Fn={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},Ln={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},vb="form",QF="root",fX=ir.createContext(null);fX.displayName="HookFormControlContext";var hX=(t,e,r,n=!0)=>{const a={defaultValues:e._defaultValues};for(const i in t)Object.defineProperty(a,i,{get:()=>{const s=i;return e._proxyFormState[s]!==Fn.all&&(e._proxyFormState[s]=!n||Fn.all),r&&(r[s]=!0),t[s]}});return a};const vX=typeof window<"u"?ir.useLayoutEffect:ir.useEffect;var jr=t=>typeof t=="string",pX=(t,e,r,n,a)=>jr(t)?(n&&e.watch.add(t),Ue(r,t,a)):Array.isArray(t)?t.map(i=>(n&&e.watch.add(i),Ue(r,i))):(n&&(e.watchAll=!0),r),iw=t=>Vr(t)||!XF(t);function Za(t,e,r=new WeakSet){if(iw(t)||iw(e))return Object.is(t,e);if(es(t)&&es(e))return Object.is(t.getTime(),e.getTime());const n=Object.keys(t),a=Object.keys(e);if(n.length!==a.length)return!1;if(r.has(t)||r.has(e))return!0;r.add(t),r.add(e);for(const i of n){const s=t[i];if(!a.includes(i))return!1;if(i!=="ref"){const o=e[i];if(es(s)&&es(o)||Bt(s)&&Bt(o)||Array.isArray(s)&&Array.isArray(o)?!Za(s,o,r):!Object.is(s,o))return!1}}return!0}const gX=ir.createContext(null);gX.displayName="HookFormContext";var mX=(t,e,r,n,a)=>e?{...r[t],types:{...r[t]&&r[t].types?r[t].types:{},[n]:a||!0}}:{},Bl=t=>Array.isArray(t)?t:[t],ND=()=>{let t=[];return{get observers(){return t},next:a=>{for(const i of t)i.next&&i.next(a)},subscribe:a=>(t.push(a),{unsubscribe:()=>{t=t.filter(i=>i!==a)}}),unsubscribe:()=>{t=[]}}};function ZF(t,e){const r={};for(const n in t)if(t.hasOwnProperty(n)){const a=t[n],i=e[n];if(a&&Bt(a)&&i){const s=ZF(a,i);Bt(s)&&(r[n]=s)}else t[n]&&(r[n]=i)}return r}var Dr=t=>Bt(t)&&!Object.keys(t).length,SS=t=>t.type==="file",cf=t=>{if(!bS)return!1;const e=t?t.ownerDocument:0;return t instanceof(e&&e.defaultView?e.defaultView.HTMLElement:HTMLElement)},JF=t=>t.type==="select-multiple",CS=t=>t.type==="radio",yX=t=>CS(t)||Ju(t),pb=t=>cf(t)&&t.isConnected;function xX(t,e){const r=e.slice(0,-1).length;let n=0;for(;n<r;)t=At(t)?n++:t[e[n++]];return t}function bX(t){for(const e in t)if(t.hasOwnProperty(e)&&!At(t[e]))return!1;return!0}function Vt(t,e){const r=Array.isArray(e)?e:Rh(e)?[e]:ES(e),n=r.length===1?t:xX(t,r),a=r.length-1,i=r[a];return n&&delete n[i],a!==0&&(Bt(n)&&Dr(n)||Array.isArray(n)&&bX(n))&&Vt(t,r.slice(0,-1)),t}var wX=t=>{for(const e in t)if(In(t[e]))return!0;return!1};function eB(t){return Array.isArray(t)||Bt(t)&&!wX(t)}function sw(t,e={}){for(const r in t){const n=t[r];eB(n)?(e[r]=Array.isArray(n)?[]:{},sw(n,e[r])):At(n)||(e[r]=!0)}return e}function Bs(t,e,r){r||(r=sw(e));for(const n in t){const a=t[n];if(eB(a))At(e)||iw(r[n])?r[n]=sw(a,Array.isArray(a)?[]:{}):Bs(a,Vr(e)?{}:e[n],r[n]);else{const i=e[n];r[n]=!Za(a,i)}}return r}const TD={value:!1,isValid:!1},RD={value:!0,isValid:!0};var tB=t=>{if(Array.isArray(t)){if(t.length>1){const e=t.filter(r=>r&&r.checked&&!r.disabled).map(r=>r.value);return{value:e,isValid:!!e.length}}return t[0].checked&&!t[0].disabled?t[0].attributes&&!At(t[0].attributes.value)?At(t[0].value)||t[0].value===""?RD:{value:t[0].value,isValid:!0}:RD:TD}return TD},rB=(t,{valueAsNumber:e,valueAsDate:r,setValueAs:n})=>At(t)?t:e?t===""?NaN:t&&+t:r&&jr(t)?new Date(t):n?n(t):t;const PD={isValid:!1,value:null};var nB=t=>Array.isArray(t)?t.reduce((e,r)=>r&&r.checked&&!r.disabled?{isValid:!0,value:r.value}:e,PD):PD;function AD(t){const e=t.ref;return SS(e)?e.files:CS(e)?nB(t.refs).value:JF(e)?[...e.selectedOptions].map(({value:r})=>r):Ju(e)?tB(t.refs).value:rB(At(e.value)?t.ref.value:e.value,t)}var EX=(t,e,r,n)=>{const a={};for(const i of t){const s=Ue(e,i);s&&Et(a,i,s._f)}return{criteriaMode:r,names:[...t],fields:a,shouldUseNativeValidation:n}},df=t=>t instanceof RegExp,fl=t=>At(t)?t:df(t)?t.source:Bt(t)?df(t.value)?t.value.source:t.value:t,kD=t=>({isOnSubmit:!t||t===Fn.onSubmit,isOnBlur:t===Fn.onBlur,isOnChange:t===Fn.onChange,isOnAll:t===Fn.all,isOnTouch:t===Fn.onTouched});const LD="AsyncFunction";var SX=t=>!!t&&!!t.validate&&!!(In(t.validate)&&t.validate.constructor.name===LD||Bt(t.validate)&&Object.values(t.validate).find(e=>e.constructor.name===LD)),CX=t=>t.mount&&(t.required||t.min||t.max||t.maxLength||t.minLength||t.pattern||t.validate),DD=(t,e,r)=>!r&&(e.watchAll||e.watch.has(t)||[...e.watch].some(n=>t.startsWith(n)&&/^\.\w+/.test(t.slice(n.length))));const zl=(t,e,r,n)=>{for(const a of r||Object.keys(t)){const i=Ue(t,a);if(i){const{_f:s,...o}=i;if(s){if(s.refs&&s.refs[0]&&e(s.refs[0],a)&&!n)return!0;if(s.ref&&e(s.ref,s.name)&&!n)return!0;if(zl(o,e))break}else if(Bt(o)&&zl(o,e))break}}};function _D(t,e,r){const n=Ue(t,r);if(n||Rh(r))return{error:n,name:r};const a=r.split(".");for(;a.length;){const i=a.join("."),s=Ue(e,i),o=Ue(t,i);if(s&&!Array.isArray(s)&&r!==i)return{name:r};if(o&&o.type)return{name:i,error:o};if(o&&o.root&&o.root.type)return{name:`${i}.root`,error:o.root};a.pop()}return{name:r}}var NX=(t,e,r,n)=>{r(t);const{name:a,...i}=t;return Dr(i)||Object.keys(i).length>=Object.keys(e).length||Object.keys(i).find(s=>e[s]===(!n||Fn.all))},TX=(t,e,r)=>!t||!e||t===e||Bl(t).some(n=>n&&(r?n===e:n.startsWith(e)||e.startsWith(n))),RX=(t,e,r,n,a)=>a.isOnAll?!1:!r&&a.isOnTouch?!(e||t):(r?n.isOnBlur:a.isOnBlur)?!t:(r?n.isOnChange:a.isOnChange)?t:!0,PX=(t,e)=>!wS(Ue(t,e)).length&&Vt(t,e),AX=(t,e,r)=>{const n=Bl(Ue(t,r));return Et(n,QF,e[r]),Et(t,r,n),t};function jD(t,e,r="validate"){if(jr(t)||Array.isArray(t)&&t.every(jr)||aa(t)&&!t)return{type:r,message:jr(t)?t:"",ref:e}}var Ms=t=>Bt(t)&&!df(t)?t:{value:t,message:""},OD=async(t,e,r,n,a,i)=>{const{ref:s,refs:o,required:l,maxLength:u,minLength:c,min:d,max:f,pattern:v,validate:p,name:y,valueAsNumber:m,mount:g}=t._f,x=Ue(r,y);if(!g||e.has(y))return{};const b=o?o[0]:s,w=R=>{a&&b.reportValidity&&(b.setCustomValidity(aa(R)?"":R||""),b.reportValidity())},E={},C=CS(s),S=Ju(s),T=C||S,P=(m||SS(s))&&At(s.value)&&At(x)||cf(s)&&s.value===""||x===""||Array.isArray(x)&&!x.length,A=mX.bind(null,y,n,E),j=(R,O,N,D=Ln.maxLength,L=Ln.minLength)=>{const _=R?O:N;E[y]={type:R?D:L,message:_,ref:s,...A(R?D:L,_)}};if(i?!Array.isArray(x)||!x.length:l&&(!T&&(P||Vr(x))||aa(x)&&!x||S&&!tB(o).isValid||C&&!nB(o).isValid)){const{value:R,message:O}=jr(l)?{value:!!l,message:l}:Ms(l);if(R&&(E[y]={type:Ln.required,message:O,ref:b,...A(Ln.required,O)},!n))return w(O),E}if(!P&&(!Vr(d)||!Vr(f))){let R,O;const N=Ms(f),D=Ms(d);if(!Vr(x)&&!isNaN(x)){const L=s.valueAsNumber||x&&+x;Vr(N.value)||(R=L>N.value),Vr(D.value)||(O=L<D.value)}else{const L=s.valueAsDate||new Date(x),_=F=>new Date(new Date().toDateString()+" "+F),k=s.type=="time",I=s.type=="week";jr(N.value)&&x&&(R=k?_(x)>_(N.value):I?x>N.value:L>new Date(N.value)),jr(D.value)&&x&&(O=k?_(x)<_(D.value):I?x<D.value:L<new Date(D.value))}if((R||O)&&(j(!!R,N.message,D.message,Ln.max,Ln.min),!n))return w(E[y].message),E}if((u||c)&&!P&&(jr(x)||i&&Array.isArray(x))){const R=Ms(u),O=Ms(c),N=!Vr(R.value)&&x.length>+R.value,D=!Vr(O.value)&&x.length<+O.value;if((N||D)&&(j(N,R.message,O.message),!n))return w(E[y].message),E}if(v&&!P&&jr(x)){const{value:R,message:O}=Ms(v);if(df(R)&&!x.match(R)&&(E[y]={type:Ln.pattern,message:O,ref:s,...A(Ln.pattern,O)},!n))return w(O),E}if(p){if(In(p)){const R=await p(x,r),O=jD(R,b);if(O&&(E[y]={...O,...A(Ln.validate,O.message)},!n))return w(O.message),E}else if(Bt(p)){let R={};for(const O in p){if(!Dr(R)&&!n)break;const N=jD(await p[O](x,r),b,O);N&&(R={...N,...A(O,N.message)},w(N.message),n&&(E[y]=R))}if(!Dr(R)&&(E[y]={ref:b,...R},!n))return E}}return w(!0),E};const kX={mode:Fn.onSubmit,reValidateMode:Fn.onChange,shouldFocusError:!0};function LX(t={}){let e={...kX,...t},r={submitCount:0,isDirty:!1,isReady:!1,isLoading:In(e.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1},n={},a=Bt(e.defaultValues)||Bt(e.values)?Qt(e.defaultValues||e.values)||{}:{},i=e.shouldUnregister?{}:Qt(a),s={action:!1,mount:!1,watch:!1,keepIsValid:!1},o={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},l,u=0;const c={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},d={...c};let f={...d};const v={array:ND(),state:ND()},p=e.criteriaMode===Fn.all,y=V=>K=>{clearTimeout(u),u=setTimeout(V,K)},m=async V=>{if(!s.keepIsValid&&!e.disabled&&(d.isValid||f.isValid||V)){let K;e.resolver?(K=Dr((await T()).errors),g()):K=await j({fields:n,onlyCheckValid:!0,eventType:Os.VALID}),K!==r.isValid&&v.state.next({isValid:K})}},g=(V,K)=>{!e.disabled&&(d.isValidating||d.validatingFields||f.isValidating||f.validatingFields)&&((V||Array.from(o.mount)).forEach(te=>{te&&(K?Et(r.validatingFields,te,K):Vt(r.validatingFields,te))}),v.state.next({validatingFields:r.validatingFields,isValidating:!Dr(r.validatingFields)}))},x=(V,K=[],te,ue,fe=!0,ve=!0)=>{if(ue&&te&&!e.disabled){if(s.action=!0,ve&&Array.isArray(Ue(n,V))){const be=te(Ue(n,V),ue.argA,ue.argB);fe&&Et(n,V,be)}if(ve&&Array.isArray(Ue(r.errors,V))){const be=te(Ue(r.errors,V),ue.argA,ue.argB);fe&&Et(r.errors,V,be),PX(r.errors,V)}if((d.touchedFields||f.touchedFields)&&ve&&Array.isArray(Ue(r.touchedFields,V))){const be=te(Ue(r.touchedFields,V),ue.argA,ue.argB);fe&&Et(r.touchedFields,V,be)}if(d.dirtyFields||f.dirtyFields){const be=Bs(a,i),Ne=KF(V);Et(r.dirtyFields,Ne,Ue(be,Ne))}v.state.next({name:V,isDirty:O(V,K),dirtyFields:r.dirtyFields,errors:r.errors,isValid:r.isValid})}else Et(i,V,K)},b=(V,K)=>{Et(r.errors,V,K),v.state.next({errors:r.errors})},w=V=>{r.errors=V,v.state.next({errors:r.errors,isValid:!1})},E=(V,K,te,ue)=>{const fe=Ue(n,V);if(fe){const ve=Ue(i,V,At(te)?Ue(a,V):te);At(ve)||ue&&ue.defaultChecked||K?Et(i,V,K?ve:AD(fe._f)):L(V,ve),s.mount&&!s.action&&m()}},C=(V,K,te,ue,fe)=>{let ve=!1,be=!1;const Ne={name:V};if(!e.disabled){if(!te||ue){(d.isDirty||f.isDirty)&&(be=r.isDirty,r.isDirty=Ne.isDirty=O(),ve=be!==Ne.isDirty);const Ce=Za(Ue(a,V),K);be=!!Ue(r.dirtyFields,V),Ce?Vt(r.dirtyFields,V):Et(r.dirtyFields,V,!0),Ne.dirtyFields=r.dirtyFields,ve=ve||(d.dirtyFields||f.dirtyFields)&&be!==!Ce}if(te){const Ce=Ue(r.touchedFields,V);Ce||(Et(r.touchedFields,V,te),Ne.touchedFields=r.touchedFields,ve=ve||(d.touchedFields||f.touchedFields)&&Ce!==te)}ve&&fe&&v.state.next(Ne)}return ve?Ne:{}},S=(V,K,te,ue)=>{const fe=Ue(r.errors,V),ve=(d.isValid||f.isValid)&&aa(K)&&r.isValid!==K;if(e.delayError&&te?(l=y(()=>b(V,te)),l(e.delayError)):(clearTimeout(u),l=null,te?Et(r.errors,V,te):Vt(r.errors,V)),(te?!Za(fe,te):fe)||!Dr(ue)||ve){const be={...ue,...ve&&aa(K)?{isValid:K}:{},errors:r.errors,name:V};r={...r,...be},v.state.next(be)}},T=async V=>(g(V,!0),await e.resolver(i,e.context,EX(V||o.mount,n,e.criteriaMode,e.shouldUseNativeValidation))),P=async V=>{const{errors:K}=await T(V);if(g(V),V)for(const te of V){const ue=Ue(K,te);ue?Et(r.errors,te,ue):Vt(r.errors,te)}else r.errors=K;return K},A=async({name:V,eventType:K})=>{if(t.validate){const te=await t.validate({formValues:i,formState:r,name:V,eventType:K});if(Bt(te))for(const ue in te)te[ue]&&q(`${vb}.${ue}`,{message:jr(te.message)?te.message:"",type:Ln.validate});else jr(te)||!te?q(vb,{message:te||"",type:Ln.validate}):z(vb);return te}return!0},j=async({fields:V,onlyCheckValid:K,name:te,eventType:ue,context:fe={valid:!0,runRootValidation:!1}})=>{if(t.validate&&(fe.runRootValidation=!0,!await A({name:te,eventType:ue})&&(fe.valid=!1,K)))return fe.valid;for(const ve in V){const be=V[ve];if(be){const{_f:Ne,...Ce}=be;if(Ne){const Re=o.array.has(Ne.name),Z=be._f&&SX(be._f);Z&&d.validatingFields&&g([Ne.name],!0);const M=await OD(be,o.disabled,i,p,e.shouldUseNativeValidation&&!K,Re);if(Z&&d.validatingFields&&g([Ne.name]),M[Ne.name]&&(fe.valid=!1,K)||(!K&&(Ue(M,Ne.name)?Re?AX(r.errors,M,Ne.name):Et(r.errors,Ne.name,M[Ne.name]):Vt(r.errors,Ne.name)),t.shouldUseNativeValidation&&M[Ne.name]))break}!Dr(Ce)&&await j({context:fe,onlyCheckValid:K,fields:Ce,name:ve,eventType:ue})}}return fe.valid},R=()=>{for(const V of o.unMount){const K=Ue(n,V);K&&(K._f.refs?K._f.refs.every(te=>!pb(te)):!pb(K._f.ref))&&Y(V)}o.unMount=new Set},O=(V,K)=>!e.disabled&&(V&&K&&Et(i,V,K),!Za($(),a)),N=(V,K,te)=>pX(V,o,{...s.mount?i:At(K)?a:jr(V)?{[V]:K}:K},te,K),D=V=>wS(Ue(s.mount?i:a,V,e.shouldUnregister?Ue(a,V,[]):[])),L=(V,K,te={})=>{const ue=Ue(n,V);let fe=K;if(ue){const ve=ue._f;ve&&(!ve.disabled&&Et(i,V,rB(K,ve)),fe=cf(ve.ref)&&Vr(K)?"":K,JF(ve.ref)?[...ve.ref.options].forEach(be=>be.selected=fe.includes(be.value)):ve.refs?Ju(ve.ref)?ve.refs.forEach(be=>{(!be.defaultChecked||!be.disabled)&&(Array.isArray(fe)?be.checked=!!fe.find(Ne=>Ne===be.value):be.checked=fe===be.value||!!fe)}):ve.refs.forEach(be=>be.checked=be.value===fe):SS(ve.ref)?ve.ref.value="":(ve.ref.value=fe,ve.ref.type||v.state.next({name:V,values:Qt(i)})))}(te.shouldDirty||te.shouldTouch)&&C(V,fe,te.shouldTouch,te.shouldDirty,!0),te.shouldValidate&&B(V)},_=(V,K,te)=>{for(const ue in K){if(!K.hasOwnProperty(ue))return;const fe=K[ue],ve=V+"."+ue,be=Ue(n,ve);(o.array.has(V)||Bt(fe)||be&&!be._f)&&!es(fe)?_(ve,fe,te):L(ve,fe,te)}},k=(V,K,te={})=>{const ue=Ue(n,V),fe=o.array.has(V),ve=Qt(K);Et(i,V,ve),fe?(v.array.next({name:V,values:Qt(i)}),(d.isDirty||d.dirtyFields||f.isDirty||f.dirtyFields)&&te.shouldDirty&&v.state.next({name:V,dirtyFields:Bs(a,i),isDirty:O(V,ve)})):ue&&!ue._f&&!Vr(ve)?_(V,ve,te):L(V,ve,te),DD(V,o)?v.state.next({...r,name:V,values:Qt(i)}):v.state.next({name:s.mount?V:void 0,values:Qt(i)})},I=async V=>{s.mount=!0;const K=V.target;let te=K.name,ue=!0;const fe=Ue(n,te),ve=Ce=>{ue=Number.isNaN(Ce)||es(Ce)&&isNaN(Ce.getTime())||Za(Ce,Ue(i,te,Ce))},be=kD(e.mode),Ne=kD(e.reValidateMode);if(fe){let Ce,Re;const Z=K.type?AD(fe._f):uX(V),M=V.type===Os.BLUR||V.type===Os.FOCUS_OUT,Q=!CX(fe._f)&&!t.validate&&!e.resolver&&!Ue(r.errors,te)&&!fe._f.deps||RX(M,Ue(r.touchedFields,te),r.isSubmitted,Ne,be),ne=DD(te,o,M);Et(i,te,Z),M?(!K||!K.readOnly)&&(fe._f.onBlur&&fe._f.onBlur(V),l&&l(0)):fe._f.onChange&&fe._f.onChange(V);const re=C(te,Z,M),se=!Dr(re)||ne;if(!M&&v.state.next({name:te,type:V.type,values:Qt(i)}),Q)return(d.isValid||f.isValid)&&(e.mode==="onBlur"?M&&m():M||m()),se&&v.state.next({name:te,...ne?{}:re});if(!e.resolver&&t.validate&&await A({name:te,eventType:V.type}),!M&&ne&&v.state.next({...r}),e.resolver){const{errors:ye}=await T([te]);if(g([te]),ve(Z),ue){const le=_D(r.errors,n,te),he=_D(ye,n,le.name||te);Ce=he.error,te=he.name,Re=Dr(ye)}}else g([te],!0),Ce=(await OD(fe,o.disabled,i,p,e.shouldUseNativeValidation))[te],g([te]),ve(Z),ue&&(Ce?Re=!1:(d.isValid||f.isValid)&&(Re=await j({fields:n,onlyCheckValid:!0,name:te,eventType:V.type})));ue&&(fe._f.deps&&(!Array.isArray(fe._f.deps)||fe._f.deps.length>0)&&B(fe._f.deps),S(te,Re,Ce,re))}},F=(V,K)=>{if(Ue(r.errors,K)&&V.focus)return V.focus(),1},B=async(V,K={})=>{let te,ue;const fe=Bl(V);if(e.resolver){const ve=await P(At(V)?V:fe);te=Dr(ve),ue=V?!fe.some(be=>Ue(ve,be)):te}else V?(ue=(await Promise.all(fe.map(async ve=>{const be=Ue(n,ve);return await j({fields:be&&be._f?{[ve]:be}:be,eventType:Os.TRIGGER})}))).every(Boolean),!(!ue&&!r.isValid)&&m()):ue=te=await j({fields:n,name:V,eventType:Os.TRIGGER});return v.state.next({...!jr(V)||(d.isValid||f.isValid)&&te!==r.isValid?{}:{name:V},...e.resolver||!V?{isValid:te}:{},errors:r.errors}),K.shouldFocus&&!ue&&zl(n,F,V?fe:o.mount),ue},$=(V,K)=>{let te={...s.mount?i:a};return K&&(te=ZF(K.dirtyFields?r.dirtyFields:r.touchedFields,te)),At(V)?te:jr(V)?Ue(te,V):V.map(ue=>Ue(te,ue))},W=(V,K)=>({invalid:!!Ue((K||r).errors,V),isDirty:!!Ue((K||r).dirtyFields,V),error:Ue((K||r).errors,V),isValidating:!!Ue(r.validatingFields,V),isTouched:!!Ue((K||r).touchedFields,V)}),z=V=>{const K=V?Bl(V):void 0;K==null||K.forEach(te=>Vt(r.errors,te)),K?K.forEach(te=>{v.state.next({name:te,errors:r.errors})}):v.state.next({errors:{}})},q=(V,K,te)=>{const ue=(Ue(n,V,{_f:{}})._f||{}).ref,fe=Ue(r.errors,V)||{},{ref:ve,message:be,type:Ne,...Ce}=fe;Et(r.errors,V,{...Ce,...K,ref:ue}),v.state.next({name:V,errors:r.errors,isValid:!1}),te&&te.shouldFocus&&ue&&ue.focus&&ue.focus()},G=(V,K)=>In(V)?v.state.subscribe({next:te=>"values"in te&&V(N(void 0,K),te)}):N(V,K,!0),J=V=>v.state.subscribe({next:K=>{TX(V.name,K.name,V.exact)&&NX(K,V.formState||d,we,V.reRenderRoot)&&V.callback({values:{...i},...r,...K,defaultValues:a})}}).unsubscribe,ae=V=>(s.mount=!0,f={...f,...V.formState},J({...V,formState:{...c,...V.formState}})),Y=(V,K={})=>{for(const te of V?Bl(V):o.mount)o.mount.delete(te),o.array.delete(te),K.keepValue||(Vt(n,te),Vt(i,te)),!K.keepError&&Vt(r.errors,te),!K.keepDirty&&Vt(r.dirtyFields,te),!K.keepTouched&&Vt(r.touchedFields,te),!K.keepIsValidating&&Vt(r.validatingFields,te),!e.shouldUnregister&&!K.keepDefaultValue&&Vt(a,te);v.state.next({values:Qt(i)}),v.state.next({...r,...K.keepDirty?{isDirty:O()}:{}}),!K.keepIsValid&&m()},H=({disabled:V,name:K})=>{if(aa(V)&&s.mount||V||o.disabled.has(K)){const fe=o.disabled.has(K)!==!!V;V?o.disabled.add(K):o.disabled.delete(K),fe&&s.mount&&!s.action&&m()}},X=(V,K={})=>{let te=Ue(n,V);const ue=aa(K.disabled)||aa(e.disabled);return Et(n,V,{...te||{},_f:{...te&&te._f?te._f:{ref:{name:V}},name:V,mount:!0,...K}}),o.mount.add(V),te?H({disabled:aa(K.disabled)?K.disabled:e.disabled,name:V}):E(V,!0,K.value),{...ue?{disabled:K.disabled||e.disabled}:{},...e.progressive?{required:!!K.required,min:fl(K.min),max:fl(K.max),minLength:fl(K.minLength),maxLength:fl(K.maxLength),pattern:fl(K.pattern)}:{},name:V,onChange:I,onBlur:I,ref:fe=>{if(fe){X(V,K),te=Ue(n,V);const ve=At(fe.value)&&fe.querySelectorAll&&fe.querySelectorAll("input,select,textarea")[0]||fe,be=yX(ve),Ne=te._f.refs||[];if(be?Ne.find(Ce=>Ce===ve):ve===te._f.ref)return;Et(n,V,{_f:{...te._f,...be?{refs:[...Ne.filter(pb),ve,...Array.isArray(Ue(a,V))?[{}]:[]],ref:{type:ve.type,name:V}}:{ref:ve}}}),E(V,!1,void 0,ve)}else te=Ue(n,V,{}),te._f&&(te._f.mount=!1),(e.shouldUnregister||K.shouldUnregister)&&!(cX(o.array,V)&&s.action)&&o.unMount.add(V)}}},ee=()=>e.shouldFocusError&&zl(n,F,o.mount),ie=V=>{aa(V)&&(v.state.next({disabled:V}),zl(n,(K,te)=>{const ue=Ue(n,te);ue&&(K.disabled=ue._f.disabled||V,Array.isArray(ue._f.refs)&&ue._f.refs.forEach(fe=>{fe.disabled=ue._f.disabled||V}))},0,!1))},oe=(V,K)=>async te=>{let ue;te&&(te.preventDefault&&te.preventDefault(),te.persist&&te.persist());let fe=Qt(i);if(v.state.next({isSubmitting:!0}),e.resolver){const{errors:ve,values:be}=await T();g(),r.errors=ve,fe=Qt(be)}else await j({fields:n,eventType:Os.SUBMIT});if(o.disabled.size)for(const ve of o.disabled)Vt(fe,ve);if(Vt(r.errors,QF),Dr(r.errors)){v.state.next({errors:{}});try{await V(fe,te)}catch(ve){ue=ve}}else K&&await K({...r.errors},te),ee(),setTimeout(ee);if(v.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Dr(r.errors)&&!ue,submitCount:r.submitCount+1,errors:r.errors}),ue)throw ue},me=(V,K={})=>{Ue(n,V)&&(At(K.defaultValue)?k(V,Qt(Ue(a,V))):(k(V,K.defaultValue),Et(a,V,Qt(K.defaultValue))),K.keepTouched||Vt(r.touchedFields,V),K.keepDirty||(Vt(r.dirtyFields,V),r.isDirty=K.defaultValue?O(V,Qt(Ue(a,V))):O()),K.keepError||(Vt(r.errors,V),d.isValid&&m()),v.state.next({...r}))},De=(V,K={})=>{const te=V?Qt(V):a,ue=Qt(te),fe=Dr(V),ve=fe?a:ue;if(K.keepDefaultValues||(a=te),!K.keepValues){if(K.keepDirtyValues){const be=new Set([...o.mount,...Object.keys(Bs(a,i))]);for(const Ne of Array.from(be)){const Ce=Ue(r.dirtyFields,Ne),Re=Ue(i,Ne),Z=Ue(ve,Ne);Ce&&!At(Re)?Et(ve,Ne,Re):!Ce&&!At(Z)&&k(Ne,Z)}}else{if(bS&&At(V))for(const be of o.mount){const Ne=Ue(n,be);if(Ne&&Ne._f){const Ce=Array.isArray(Ne._f.refs)?Ne._f.refs[0]:Ne._f.ref;if(cf(Ce)){const Re=Ce.closest("form");if(Re){Re.reset();break}}}}if(K.keepFieldsRef)for(const be of o.mount)k(be,Ue(ve,be));else n={}}i=e.shouldUnregister?K.keepDefaultValues?Qt(a):{}:Qt(ve),v.array.next({values:{...ve}}),v.state.next({values:{...ve}})}o={mount:K.keepDirtyValues?o.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},s.mount=!d.isValid||!!K.keepIsValid||!!K.keepDirtyValues||!e.shouldUnregister&&!Dr(ve),s.watch=!!e.shouldUnregister,s.keepIsValid=!!K.keepIsValid,s.action=!1,K.keepErrors||(r.errors={}),v.state.next({submitCount:K.keepSubmitCount?r.submitCount:0,isDirty:fe?!1:K.keepDirty?r.isDirty:!!(K.keepDefaultValues&&!Za(V,a)),isSubmitted:K.keepIsSubmitted?r.isSubmitted:!1,dirtyFields:fe?{}:K.keepDirtyValues?K.keepDefaultValues&&i?Bs(a,i):r.dirtyFields:K.keepDefaultValues&&V?Bs(a,V):K.keepDirty?r.dirtyFields:{},touchedFields:K.keepTouched?r.touchedFields:{},errors:K.keepErrors?r.errors:{},isSubmitSuccessful:K.keepIsSubmitSuccessful?r.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:a})},ge=(V,K)=>De(In(V)?V(i):V,{...e.resetOptions,...K}),pe=(V,K={})=>{const te=Ue(n,V),ue=te&&te._f;if(ue){const fe=ue.refs?ue.refs[0]:ue.ref;fe.focus&&setTimeout(()=>{fe.focus(),K.shouldSelect&&In(fe.select)&&fe.select()})}},we=V=>{r={...r,...V}},Ee={control:{register:X,unregister:Y,getFieldState:W,handleSubmit:oe,setError:q,_subscribe:J,_runSchema:T,_updateIsValidating:g,_focusError:ee,_getWatch:N,_getDirty:O,_setValid:m,_setFieldArray:x,_setDisabledField:H,_setErrors:w,_getFieldArray:D,_reset:De,_resetDefaultValues:()=>In(e.defaultValues)&&e.defaultValues().then(V=>{ge(V,e.resetOptions),v.state.next({isLoading:!1})}),_removeUnmounted:R,_disableForm:ie,_subjects:v,_proxyFormState:d,get _fields(){return n},get _formValues(){return i},get _state(){return s},set _state(V){s=V},get _defaultValues(){return a},get _names(){return o},set _names(V){o=V},get _formState(){return r},get _options(){return e},set _options(V){e={...e,...V}}},subscribe:ae,trigger:B,register:X,handleSubmit:oe,watch:G,setValue:k,getValues:$,reset:ge,resetField:me,clearErrors:z,unregister:Y,setError:q,setFocus:pe,getFieldState:W};return{...Ee,formControl:Ee}}function ec(t={}){const e=ir.useRef(void 0),r=ir.useRef(void 0),[n,a]=ir.useState({isDirty:!1,isValidating:!1,isLoading:In(t.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1,isReady:!1,defaultValues:In(t.defaultValues)?void 0:t.defaultValues});if(!e.current)if(t.formControl)e.current={...t.formControl,formState:n},t.defaultValues&&!In(t.defaultValues)&&t.formControl.reset(t.defaultValues,t.resetOptions);else{const{formControl:s,...o}=LX(t);e.current={...o,formState:n}}const i=e.current.control;return i._options=t,vX(()=>{const s=i._subscribe({formState:i._proxyFormState,callback:()=>a({...i._formState}),reRenderRoot:!0});return a(o=>({...o,isReady:!0})),i._formState.isReady=!0,s},[i]),ir.useEffect(()=>i._disableForm(t.disabled),[i,t.disabled]),ir.useEffect(()=>{t.mode&&(i._options.mode=t.mode),t.reValidateMode&&(i._options.reValidateMode=t.reValidateMode)},[i,t.mode,t.reValidateMode]),ir.useEffect(()=>{t.errors&&(i._setErrors(t.errors),i._focusError())},[i,t.errors]),ir.useEffect(()=>{t.shouldUnregister&&i._subjects.state.next({values:i._getWatch()})},[i,t.shouldUnregister]),ir.useEffect(()=>{if(i._proxyFormState.isDirty){const s=i._getDirty();s!==n.isDirty&&i._subjects.state.next({isDirty:s})}},[i,n.isDirty]),ir.useEffect(()=>{var s;t.values&&!Za(t.values,r.current)?(i._reset(t.values,{keepFieldsRef:!0,...i._options.resetOptions}),!((s=i._options.resetOptions)===null||s===void 0)&&s.keepIsValid||i._setValid(),r.current=t.values,a(o=>({...o}))):i._resetDefaultValues()},[i,t.values]),ir.useEffect(()=>{i._state.mount||(i._setValid(),i._state.mount=!0),i._state.watch&&(i._state.watch=!1,i._subjects.state.next({...i._formState})),i._removeUnmounted()}),e.current.formState=ir.useMemo(()=>hX(n,i),[i,n]),e.current}const DX=()=>{const[t,e]=U.useState(!1),[r,n]=U.useState(null),a=vn(),{register:i,handleSubmit:s,formState:{errors:o}}=ec({defaultValues:{username:"",password:"",rememberMe:!1}}),l=async u=>{var c,d;try{e(!0),n(null),await Or.login(u.username,u.password),a("/")}catch(f){console.error("Login error:",f),n(((d=(c=f.response)==null?void 0:c.data)==null?void 0:d.message)||"Invalid username or password")}finally{e(!1)}};return h.jsx("div",{className:"flex justify-center items-center min-h-[70vh]",children:h.jsx("div",{className:"card w-full max-w-md bg-base-100 shadow-xl",children:h.jsxs("div",{className:"card-body",children:[h.jsx("h2",{className:"card-title text-2xl mb-6 justify-center",children:"Login"}),r&&h.jsxs("div",{className:"alert alert-error mb-6",children:[h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"stroke-current shrink-0 h-6 w-6",fill:"none",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m7-2a9 9 0 11-18 0 9 9 0 0118 0z"})}),h.jsx("span",{children:r})]}),h.jsxs("form",{onSubmit:s(l),children:[h.jsxs("div",{className:"form-control",children:[h.jsx("label",{className:"label",children:h.jsx("span",{className:"label-text",children:"Username"})}),h.jsx("input",{type:"text",className:`input input-bordered ${o.username?"input-error":""}`,...i("username",{required:"Username is required"})}),o.username&&h.jsx("label",{className:"label",children:h.jsx("span",{className:"label-text-alt text-error",children:o.username.message})})]}),h.jsxs("div",{className:"form-control mt-4",children:[h.jsx("label",{className:"label",children:h.jsx("span",{className:"label-text",children:"Password"})}),h.jsx("input",{type:"password",className:`input input-bordered ${o.password?"input-error":""}`,...i("password",{required:"Password is required"})}),o.password&&h.jsx("label",{className:"label",children:h.jsx("span",{className:"label-text-alt text-error",children:o.password.message})}),h.jsx("label",{className:"label",children:h.jsx(ze,{to:"/forgot-password",className:"label-text-alt link link-hover",children:"Forgot password?"})})]}),h.jsx("div",{className:"form-control mt-2",children:h.jsxs("label",{className:"label cursor-pointer justify-start gap-2",children:[h.jsx("input",{type:"checkbox",className:"checkbox checkbox-sm",...i("rememberMe")}),h.jsx("span",{className:"label-text",children:"Remember me"})]})}),h.jsx("div",{className:"form-control mt-6",children:h.jsx("button",{type:"submit",className:"btn btn-primary",disabled:t,children:t?h.jsxs(h.Fragment,{children:[h.jsx("span",{className:"loading loading-spinner loading-sm"}),"Logging in..."]}):"Login"})})]}),h.jsx("div",{className:"divider",children:"OR"}),h.jsx("div",{className:"text-center",children:h.jsxs("p",{className:"text-sm",children:["Don't have an account?"," ",h.jsx(ze,{to:"/register",className:"link link-primary",children:"Register"})]})})]})})})},_X=()=>{const[t,e]=U.useState(!1),[r,n]=U.useState(null),[a,i]=U.useState(null),s=vn(),{register:o,handleSubmit:l,formState:{errors:u},watch:c}=ec({defaultValues:{username:"",email:"",password:"",confirmPassword:""}}),d=c("password"),f=async v=>{var p,y;try{e(!0),n(null),await new Promise(m=>setTimeout(m,1e3)),i("Registration successful! You can now log in."),setTimeout(()=>{s("/login")},2e3)}catch(m){console.error("Registration error:",m),n(((y=(p=m.response)==null?void 0:p.data)==null?void 0:y.message)||"Registration failed. Please try again.")}finally{e(!1)}};return h.jsx("div",{className:"flex justify-center items-center min-h-[70vh]",children:h.jsx("div",{className:"card w-full max-w-md bg-base-100 shadow-xl",children:h.jsxs("div",{className:"card-body",children:[h.jsx("h2",{className:"card-title text-2xl mb-6 justify-center",children:"Register"}),r&&h.jsxs("div",{className:"alert alert-error mb-6",children:[h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"stroke-current shrink-0 h-6 w-6",fill:"none",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m7-2a9 9 0 11-18 0 9 9 0 0118 0z"})}),h.jsx("span",{children:r})]}),a&&h.jsxs("div",{className:"alert alert-success mb-6",children:[h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"stroke-current shrink-0 h-6 w-6",fill:"none",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"})}),h.jsx("span",{children:a})]}),h.jsxs("form",{onSubmit:l(f),children:[h.jsxs("div",{className:"form-control",children:[h.jsx("label",{className:"label",children:h.jsx("span",{className:"label-text",children:"Username"})}),h.jsx("input",{type:"text",className:`input input-bordered ${u.username?"input-error":""}`,...o("username",{required:"Username is required",minLength:{value:3,message:"Username must be at least 3 characters"}})}),u.username&&h.jsx("label",{className:"label",children:h.jsx("span",{className:"label-text-alt text-error",children:u.username.message})})]}),h.jsxs("div",{className:"form-control mt-4",children:[h.jsx("label",{className:"label",children:h.jsx("span",{className:"label-text",children:"Email"})}),h.jsx("input",{type:"email",className:`input input-bordered ${u.email?"input-error":""}`,...o("email",{required:"Email is required",pattern:{value:/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}$/i,message:"Invalid email address"}})}),u.email&&h.jsx("label",{className:"label",children:h.jsx("span",{className:"label-text-alt text-error",children:u.email.message})})]}),h.jsxs("div",{className:"form-control mt-4",children:[h.jsx("label",{className:"label",children:h.jsx("span",{className:"label-text",children:"Password"})}),h.jsx("input",{type:"password",className:`input input-bordered ${u.password?"input-error":""}`,...o("password",{required:"Password is required",minLength:{value:8,message:"Password must be at least 8 characters"}})}),u.password&&h.jsx("label",{className:"label",children:h.jsx("span",{className:"label-text-alt text-error",children:u.password.message})})]}),h.jsxs("div",{className:"form-control mt-4",children:[h.jsx("label",{className:"label",children:h.jsx("span",{className:"label-text",children:"Confirm Password"})}),h.jsx("input",{type:"password",className:`input input-bordered ${u.confirmPassword?"input-error":""}`,...o("confirmPassword",{required:"Please confirm your password",validate:v=>v===d||"Passwords do not match"})}),u.confirmPassword&&h.jsx("label",{className:"label",children:h.jsx("span",{className:"label-text-alt text-error",children:u.confirmPassword.message})})]}),h.jsx("div",{className:"form-control mt-6",children:h.jsx("button",{type:"submit",className:"btn btn-primary",disabled:t,children:t?h.jsxs(h.Fragment,{children:[h.jsx("span",{className:"loading loading-spinner loading-sm"}),"Registering..."]}):"Register"})})]}),h.jsx("div",{className:"divider",children:"OR"}),h.jsx("div",{className:"text-center",children:h.jsxs("p",{className:"text-sm",children:["Already have an account?"," ",h.jsx(ze,{to:"/login",className:"link link-primary",children:"Login"})]})})]})})})},jX=()=>{const[t,e]=U.useState(!1),[r,n]=U.useState(null),[a,i]=U.useState(null),{register:s,handleSubmit:o,formState:{errors:l}}=ec({defaultValues:{email:""}}),u=async c=>{var d,f;try{e(!0),n(null),i(null),await new Promise(v=>setTimeout(v,1e3)),i(`Password reset instructions have been sent to ${c.email}`)}catch(v){console.error("Password reset error:",v),n(((f=(d=v.response)==null?void 0:d.data)==null?void 0:f.message)||"Failed to send password reset email. Please try again.")}finally{e(!1)}};return h.jsx("div",{className:"flex justify-center items-center min-h-[70vh]",children:h.jsx("div",{className:"card w-full max-w-md bg-base-100 shadow-xl",children:h.jsxs("div",{className:"card-body",children:[h.jsx("h2",{className:"card-title text-2xl mb-6 justify-center",children:"Forgot Password"}),r&&h.jsxs("div",{className:"alert alert-error mb-6",children:[h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"stroke-current shrink-0 h-6 w-6",fill:"none",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m7-2a9 9 0 11-18 0 9 9 0 0118 0z"})}),h.jsx("span",{children:r})]}),a?h.jsxs("div",{className:"text-center",children:[h.jsxs("div",{className:"alert alert-success mb-6",children:[h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"stroke-current shrink-0 h-6 w-6",fill:"none",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"})}),h.jsx("span",{children:a})]}),h.jsx("p",{className:"mb-6",children:"Please check your email for instructions on how to reset your password."}),h.jsx("div",{className:"flex justify-center",children:h.jsx(ze,{to:"/login",className:"btn btn-primary",children:"Return to Login"})})]}):h.jsxs(h.Fragment,{children:[h.jsx("p",{className:"mb-6",children:"Enter your email address and we'll send you instructions to reset your password."}),h.jsxs("form",{onSubmit:o(u),children:[h.jsxs("div",{className:"form-control",children:[h.jsx("label",{className:"label",children:h.jsx("span",{className:"label-text",children:"Email"})}),h.jsx("input",{type:"email",className:`input input-bordered ${l.email?"input-error":""}`,...s("email",{required:"Email is required",pattern:{value:/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}$/i,message:"Invalid email address"}})}),l.email&&h.jsx("label",{className:"label",children:h.jsx("span",{className:"label-text-alt text-error",children:l.email.message})})]}),h.jsx("div",{className:"form-control mt-6",children:h.jsx("button",{type:"submit",className:"btn btn-primary",disabled:t,children:t?h.jsxs(h.Fragment,{children:[h.jsx("span",{className:"loading loading-spinner loading-sm"}),"Sending..."]}):"Send Reset Instructions"})})]}),h.jsx("div",{className:"text-center mt-6",children:h.jsxs("p",{className:"text-sm",children:["Remember your password?"," ",h.jsx(ze,{to:"/login",className:"link link-primary",children:"Login"})]})})]})]})})})},OX=()=>{const[t,e]=U.useState(null),[r,n]=U.useState(!0),[a,i]=U.useState(!1),[s,o]=U.useState(null),[l,u]=U.useState(null),[c,d]=U.useState(!1),{register:f,handleSubmit:v,formState:{errors:p},reset:y,watch:m}=ec(),g=m("newPassword");U.useEffect(()=>{(async()=>{try{n(!0);const w=await Or.getCurrentUser();e(w.data),y({username:w.data.username,email:w.data.email,currentPassword:"",newPassword:"",confirmPassword:""})}catch(w){console.error("Error fetching user profile:",w),o("Failed to load user profile")}finally{n(!1)}})()},[y]);const x=async b=>{var w,E;try{i(!0),o(null),u(null),await new Promise(C=>setTimeout(C,1e3)),e(C=>C?{...C,username:b.username,email:b.email}:null),u("Profile updated successfully")}catch(C){console.error("Profile update error:",C),o(((E=(w=C.response)==null?void 0:w.data)==null?void 0:E.message)||"Failed to update profile")}finally{i(!1)}};return r?h.jsx("div",{className:"flex justify-center items-center h-64",children:h.jsx("span",{className:"loading loading-spinner loading-lg"})}):t?h.jsxs("div",{className:"container mx-auto px-4 py-8",children:[h.jsx("h1",{className:"text-3xl font-bold mb-8",children:"User Profile"}),s&&h.jsxs("div",{className:"alert alert-error mb-6",children:[h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"stroke-current shrink-0 h-6 w-6",fill:"none",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m7-2a9 9 0 11-18 0 9 9 0 0118 0z"})}),h.jsx("span",{children:s})]}),l&&h.jsxs("div",{className:"alert alert-success mb-6",children:[h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"stroke-current shrink-0 h-6 w-6",fill:"none",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"})}),h.jsx("span",{children:l})]}),h.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-8",children:[h.jsx("div",{className:"md:col-span-1",children:h.jsx("div",{className:"card bg-base-100 shadow-xl",children:h.jsxs("div",{className:"card-body items-center text-center",children:[h.jsx("div",{className:"avatar placeholder",children:h.jsx("div",{className:"bg-primary text-primary-content rounded-full w-24",children:h.jsx("span",{className:"text-3xl",children:t.username.charAt(0).toUpperCase()})})}),h.jsx("h2",{className:"card-title mt-4",children:t.username}),h.jsx("p",{className:"text-sm opacity-70",children:t.email}),h.jsx("div",{className:"badge badge-primary mt-2",children:t.role})]})})}),h.jsx("div",{className:"md:col-span-2",children:h.jsx("div",{className:"card bg-base-100 shadow-xl",children:h.jsxs("div",{className:"card-body",children:[h.jsx("h2",{className:"card-title text-xl mb-4",children:"Edit Profile"}),h.jsxs("form",{onSubmit:v(x),children:[h.jsxs("div",{className:"form-control",children:[h.jsx("label",{className:"label",children:h.jsx("span",{className:"label-text",children:"Username"})}),h.jsx("input",{type:"text",className:`input input-bordered ${p.username?"input-error":""}`,...f("username",{required:"Username is required"})}),p.username&&h.jsx("label",{className:"label",children:h.jsx("span",{className:"label-text-alt text-error",children:p.username.message})})]}),h.jsxs("div",{className:"form-control mt-4",children:[h.jsx("label",{className:"label",children:h.jsx("span",{className:"label-text",children:"Email"})}),h.jsx("input",{type:"email",className:`input input-bordered ${p.email?"input-error":""}`,...f("email",{required:"Email is required",pattern:{value:/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}$/i,message:"Invalid email address"}})}),p.email&&h.jsx("label",{className:"label",children:h.jsx("span",{className:"label-text-alt text-error",children:p.email.message})})]}),h.jsx("div",{className:"divider"}),h.jsx("div",{className:"form-control",children:h.jsxs("label",{className:"label cursor-pointer justify-start gap-2",children:[h.jsx("input",{type:"checkbox",className:"checkbox",checked:c,onChange:()=>d(!c)}),h.jsx("span",{className:"label-text",children:"Change Password"})]})}),c&&h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:"form-control mt-4",children:[h.jsx("label",{className:"label",children:h.jsx("span",{className:"label-text",children:"Current Password"})}),h.jsx("input",{type:"password",className:`input input-bordered ${p.currentPassword?"input-error":""}`,...f("currentPassword",{required:"Current password is required"})}),p.currentPassword&&h.jsx("label",{className:"label",children:h.jsx("span",{className:"label-text-alt text-error",children:p.currentPassword.message})})]}),h.jsxs("div",{className:"form-control mt-4",children:[h.jsx("label",{className:"label",children:h.jsx("span",{className:"label-text",children:"New Password"})}),h.jsx("input",{type:"password",className:`input input-bordered ${p.newPassword?"input-error":""}`,...f("newPassword",{required:"New password is required",minLength:{value:8,message:"Password must be at least 8 characters"}})}),p.newPassword&&h.jsx("label",{className:"label",children:h.jsx("span",{className:"label-text-alt text-error",children:p.newPassword.message})})]}),h.jsxs("div",{className:"form-control mt-4",children:[h.jsx("label",{className:"label",children:h.jsx("span",{className:"label-text",children:"Confirm New Password"})}),h.jsx("input",{type:"password",className:`input input-bordered ${p.confirmPassword?"input-error":""}`,...f("confirmPassword",{required:"Please confirm your new password",validate:b=>b===g||"Passwords do not match"})}),p.confirmPassword&&h.jsx("label",{className:"label",children:h.jsx("span",{className:"label-text-alt text-error",children:p.confirmPassword.message})})]})]}),h.jsx("div",{className:"card-actions justify-end mt-6",children:h.jsx("button",{type:"submit",className:"btn btn-primary",disabled:a,children:a?h.jsxs(h.Fragment,{children:[h.jsx("span",{className:"loading loading-spinner loading-sm"}),"Saving..."]}):"Save Changes"})})]})]})})})]})]}):h.jsxs("div",{className:"alert alert-error",children:[h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"stroke-current shrink-0 h-6 w-6",fill:"none",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m7-2a9 9 0 11-18 0 9 9 0 0118 0z"})}),h.jsx("span",{children:"Failed to load user profile"})]})},MX=()=>{const[t,e]=U.useState(null),[r,n]=U.useState(!0),[a,i]=U.useState(!1),[s,o]=U.useState(null),[l,u]=U.useState(null),{register:c,handleSubmit:d,formState:{errors:f},reset:v}=ec({defaultValues:{theme:"system",notifications:!0,emailNotifications:!0,autoCommit:!1,defaultView:"list"}});U.useEffect(()=>{(async()=>{try{n(!0);const m=await Or.getCurrentUser();e(m.data),v({theme:"system",notifications:!0,emailNotifications:!0,autoCommit:!1,defaultView:"list"})}catch(m){console.error("Error fetching user settings:",m),o("Failed to load user settings")}finally{n(!1)}})()},[v]);const p=async y=>{var m,g;try{i(!0),o(null),u(null),await new Promise(x=>setTimeout(x,1e3)),u("Settings updated successfully"),y.theme==="light"?document.documentElement.setAttribute("data-theme","light"):y.theme==="dark"?document.documentElement.setAttribute("data-theme","dark"):document.documentElement.removeAttribute("data-theme")}catch(x){console.error("Settings update error:",x),o(((g=(m=x.response)==null?void 0:m.data)==null?void 0:g.message)||"Failed to update settings")}finally{i(!1)}};return r?h.jsx("div",{className:"flex justify-center items-center h-64",children:h.jsx("span",{className:"loading loading-spinner loading-lg"})}):h.jsxs("div",{className:"container mx-auto px-4 py-8",children:[h.jsx("h1",{className:"text-3xl font-bold mb-8",children:"Settings"}),s&&h.jsxs("div",{className:"alert alert-error mb-6",children:[h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"stroke-current shrink-0 h-6 w-6",fill:"none",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m7-2a9 9 0 11-18 0 9 9 0 0118 0z"})}),h.jsx("span",{children:s})]}),l&&h.jsxs("div",{className:"alert alert-success mb-6",children:[h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"stroke-current shrink-0 h-6 w-6",fill:"none",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"})}),h.jsx("span",{children:l})]}),h.jsx("div",{className:"card bg-base-100 shadow-xl",children:h.jsx("div",{className:"card-body",children:h.jsxs("form",{onSubmit:d(p),children:[h.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[h.jsx("div",{className:"md:col-span-2",children:h.jsx("h2",{className:"text-xl font-bold mb-4",children:"Appearance"})}),h.jsxs("div",{className:"form-control",children:[h.jsx("label",{className:"label",children:h.jsx("span",{className:"label-text",children:"Theme"})}),h.jsxs("select",{className:"select select-bordered w-full",...c("theme"),children:[h.jsx("option",{value:"system",children:"System Default"}),h.jsx("option",{value:"light",children:"Light"}),h.jsx("option",{value:"dark",children:"Dark"})]})]}),h.jsxs("div",{className:"form-control",children:[h.jsx("label",{className:"label",children:h.jsx("span",{className:"label-text",children:"Default View"})}),h.jsxs("select",{className:"select select-bordered w-full",...c("defaultView"),children:[h.jsx("option",{value:"list",children:"List View"}),h.jsx("option",{value:"grid",children:"Grid View"}),h.jsx("option",{value:"table",children:"Table View"})]})]}),h.jsx("div",{className:"md:col-span-2",children:h.jsx("h2",{className:"text-xl font-bold mb-4 mt-4",children:"Notifications"})}),h.jsx("div",{className:"form-control",children:h.jsxs("label",{className:"label cursor-pointer justify-start gap-4",children:[h.jsx("input",{type:"checkbox",className:"toggle toggle-primary",...c("notifications")}),h.jsxs("div",{children:[h.jsx("span",{className:"label-text font-medium",children:"In-app Notifications"}),h.jsx("p",{className:"text-xs opacity-70 mt-1",children:"Receive notifications within the application"})]})]})}),h.jsx("div",{className:"form-control",children:h.jsxs("label",{className:"label cursor-pointer justify-start gap-4",children:[h.jsx("input",{type:"checkbox",className:"toggle toggle-primary",...c("emailNotifications")}),h.jsxs("div",{children:[h.jsx("span",{className:"label-text font-medium",children:"Email Notifications"}),h.jsx("p",{className:"text-xs opacity-70 mt-1",children:"Receive notifications via email"})]})]})}),h.jsx("div",{className:"md:col-span-2",children:h.jsx("h2",{className:"text-xl font-bold mb-4 mt-4",children:"Data Dictionary"})}),h.jsx("div",{className:"form-control",children:h.jsxs("label",{className:"label cursor-pointer justify-start gap-4",children:[h.jsx("input",{type:"checkbox",className:"toggle toggle-primary",...c("autoCommit")}),h.jsxs("div",{children:[h.jsx("span",{className:"label-text font-medium",children:"Auto-commit Changes"}),h.jsx("p",{className:"text-xs opacity-70 mt-1",children:"Automatically commit changes when editing entities"})]})]})}),h.jsxs("div",{className:"md:col-span-2",children:[h.jsx("h2",{className:"text-xl font-bold mb-4 mt-4",children:"Account"}),h.jsxs("div",{className:"flex flex-col gap-2",children:[h.jsx("button",{type:"button",className:"btn btn-outline btn-error w-full md:w-auto",onClick:()=>{window.confirm("Are you sure you want to delete your account? This action cannot be undone.")&&console.log("Delete account")},children:"Delete Account"}),h.jsx("p",{className:"text-xs opacity-70",children:"This will permanently delete your account and all associated data."})]})]})]}),h.jsx("div",{className:"card-actions justify-end mt-8",children:h.jsx("button",{type:"submit",className:"btn btn-primary",disabled:a,children:a?h.jsxs(h.Fragment,{children:[h.jsx("span",{className:"loading loading-spinner loading-sm"}),"Saving..."]}):"Save Settings"})})]})})})]})};function IX({service:t,entityName:e}){const[r,n]=U.useState([]),[a,i]=U.useState(!0),[s,o]=U.useState(""),[l,u]=U.useState(""),c=async()=>{try{const p=await at.getComments(t,e);n(p)}catch{}finally{i(!1)}};U.useEffect(()=>{c()},[t,e]);const d=async()=>{if(s.trim())try{await at.addComment(t,e,{author:"current-user",message:s,targetField:l||void 0}),o(""),u(""),c()}catch{}},f=async p=>{try{await at.resolveComment(t,e,p),c()}catch{}};if(a)return h.jsx("span",{className:"loading loading-spinner loading-sm"});const v=r.filter(p=>!p.resolved).length;return h.jsxs("div",{className:"space-y-4",children:[v>0&&h.jsxs("div",{className:"text-sm text-warning",children:[v," unresolved comment",v>1?"s":""]}),h.jsxs("div",{className:"space-y-2",children:[r.length===0&&h.jsx("p",{className:"text-sm text-base-content/50",children:"No comments yet."}),r.map(p=>h.jsxs("div",{className:`card bg-base-200 p-3 ${p.resolved?"opacity-50":""}`,children:[h.jsxs("div",{className:"flex items-start justify-between",children:[h.jsxs("div",{children:[h.jsx("span",{className:"font-semibold text-sm",children:p.author}),h.jsx("span",{className:"text-xs text-base-content/60 ml-2",children:new Date(p.timestamp).toLocaleString()}),p.targetField&&h.jsx("span",{className:"badge badge-ghost badge-xs ml-2 font-mono",children:p.targetField})]}),!p.resolved&&h.jsx("button",{className:"btn btn-ghost btn-xs",onClick:()=>f(p.id),children:"Resolve"}),p.resolved&&h.jsx("span",{className:"badge badge-success badge-xs",children:"resolved"})]}),h.jsx("p",{className:"text-sm mt-1",children:p.message})]},p.id))]}),h.jsxs("div",{className:"border-t border-base-300 pt-3 space-y-2",children:[h.jsx("textarea",{className:"textarea textarea-bordered textarea-sm w-full",placeholder:"Add a comment...",value:s,onChange:p=>o(p.target.value),rows:2}),h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("input",{type:"text",className:"input input-bordered input-sm w-48",placeholder:"Target field (optional)",value:l,onChange:p=>u(p.target.value)}),h.jsx("button",{className:"btn btn-sm btn-primary",onClick:d,disabled:!s.trim(),children:"Add Comment"})]})]})]})}function MD({node:t}){return h.jsxs("div",{className:"flex items-center gap-2 p-2 bg-base-200 rounded",style:{marginLeft:`${(t.depth-1)*24}px`},children:[h.jsx("span",{className:`badge badge-xs ${t.direction==="upstream"?"badge-info":"badge-warning"}`,children:t.direction==="upstream"?"↑":"↓"}),h.jsx(ze,{to:`/packages/${t.service}/entities/${t.entityName}`,className:"link link-primary font-mono text-sm",children:t.entityName}),h.jsx("span",{className:"badge badge-ghost badge-xs",children:t.service}),t.relationship.description&&h.jsx("span",{className:"text-xs text-base-content/60 italic",children:t.relationship.description})]})}function FX({entityUuid:t,service:e}){const[r,n]=U.useState(null),[a,i]=U.useState(!0);if(U.useEffect(()=>{t&&(i(!0),at.getLineage(t).then(n).catch(()=>n(null)).finally(()=>i(!1)))},[t]),a)return h.jsx("span",{className:"loading loading-spinner loading-sm"});if(!r)return h.jsx("p",{className:"text-sm text-base-content/50",children:"Failed to load lineage data."});const s=r.upstream.length>0||r.downstream.length>0;return h.jsxs("div",{className:"space-y-6",children:[!s&&h.jsxs("div",{className:"text-center py-8 text-base-content/50",children:[h.jsx("p",{children:"No lineage relationships defined for this entity."}),h.jsx("p",{className:"text-xs mt-1",children:'Create relationships with type "lineage" to track data flow.'})]}),r.upstream.length>0&&h.jsxs("div",{children:[h.jsxs("h4",{className:"font-semibold mb-2 flex items-center gap-2",children:[h.jsx("span",{className:"badge badge-info badge-sm",children:"Upstream"}),"Data flows FROM (",r.upstream.length,")"]}),h.jsx("div",{className:"space-y-1",children:r.upstream.map((o,l)=>h.jsx(MD,{node:o},`${o.entityUuid}-${l}`))})]}),s&&h.jsx("div",{className:"flex items-center justify-center py-2",children:h.jsxs("div",{className:"p-3 bg-primary/10 border-2 border-primary rounded-lg font-bold",children:[r.entity.name,h.jsx("span",{className:"badge badge-ghost badge-xs ml-2",children:r.entity.service})]})}),r.downstream.length>0&&h.jsxs("div",{children:[h.jsxs("h4",{className:"font-semibold mb-2 flex items-center gap-2",children:[h.jsx("span",{className:"badge badge-warning badge-sm",children:"Downstream"}),"Data flows TO (",r.downstream.length,")"]}),h.jsx("div",{className:"space-y-1",children:r.downstream.map((o,l)=>h.jsx(MD,{node:o},`${o.entityUuid}-${l}`))})]})]})}const BX=({attributes:t,entityName:e,serviceName:r})=>{const[n,a]=U.useState(""),[i,s]=U.useState("all"),o=t.filter(u=>{const c=n===""||u.name.toLowerCase().includes(n.toLowerCase())||u.description.toLowerCase().includes(n.toLowerCase()),d=i==="all"||u.type===i;return c&&d}),l=u=>{switch(u){case kr.STRING:return"badge-primary";case kr.NUMBER:case kr.INTEGER:return"badge-secondary";case kr.BOOLEAN:return"badge-accent";case kr.DATETIME:case kr.DATE:case kr.TIME:case kr.DATE_TIME:case kr.TIMESTAMP:case kr.DURATION:return"badge-info";case kr.ENUM:return"badge-warning";case kr.OBJECT:case kr.ARRAY:return"badge-success";default:return"badge-ghost"}};return h.jsxs("div",{children:[h.jsxs("div",{className:"flex flex-col md:flex-row gap-4 mb-4",children:[h.jsx("div",{className:"form-control flex-1",children:h.jsxs("div",{className:"input-group",children:[h.jsx("input",{type:"text",placeholder:"Search attributes...",className:"input input-bordered w-full",value:n,onChange:u=>a(u.target.value)}),n&&h.jsx("button",{className:"btn btn-square",onClick:()=>a(""),children:h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M6 18L18 6M6 6l12 12"})})})]})}),h.jsxs("select",{className:"select select-bordered",value:i,onChange:u=>s(u.target.value),children:[h.jsx("option",{value:"all",children:"All Types"}),Object.values(kr).map(u=>h.jsx("option",{value:u,children:u},u))]})]}),o.length===0?h.jsxs("div",{className:"alert alert-info",children:[h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",className:"stroke-current shrink-0 w-6 h-6",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),h.jsx("span",{children:"No attributes found matching your criteria."})]}):h.jsx("div",{className:"overflow-x-auto",children:h.jsxs("table",{className:"table table-zebra w-full",children:[h.jsx("thead",{children:h.jsxs("tr",{children:[h.jsx("th",{children:"Name"}),h.jsx("th",{children:"Type"}),h.jsx("th",{children:"Description"}),h.jsx("th",{children:"Required"}),h.jsx("th",{children:"Constraints"}),h.jsx("th",{children:"Actions"})]})}),h.jsx("tbody",{children:o.map(u=>{var c,d,f,v,p,y,m;return h.jsxs("tr",{className:"hover",children:[h.jsxs("td",{className:"font-medium",children:[u.name,u.primaryKey&&h.jsx("span",{className:"badge badge-xs badge-warning ml-1",title:"Primary Key",children:"PK"})]}),h.jsx("td",{children:h.jsx("span",{className:`badge ${l(u.type)}`,children:u.type})}),h.jsx("td",{className:"max-w-xs truncate",children:u.description}),h.jsx("td",{children:u.required?h.jsx("span",{className:"badge badge-success",children:"Required"}):h.jsx("span",{className:"badge badge-ghost",children:"Optional"})}),h.jsxs("td",{children:[((c=u.constraints)==null?void 0:c.format)&&h.jsxs("div",{children:[h.jsx("span",{className:"font-medium",children:"Format:"})," ",u.constraints.format]}),((d=u.constraints)==null?void 0:d.minLength)!==void 0&&h.jsxs("div",{children:[h.jsx("span",{className:"font-medium",children:"Min Length:"})," ",u.constraints.minLength]}),((f=u.constraints)==null?void 0:f.maxLength)!==void 0&&h.jsxs("div",{children:[h.jsx("span",{className:"font-medium",children:"Max Length:"})," ",u.constraints.maxLength]}),((v=u.constraints)==null?void 0:v.minimum)!==void 0&&h.jsxs("div",{children:[h.jsx("span",{className:"font-medium",children:"Min:"})," ",u.constraints.minimum]}),((p=u.constraints)==null?void 0:p.maximum)!==void 0&&h.jsxs("div",{children:[h.jsx("span",{className:"font-medium",children:"Max:"})," ",u.constraints.maximum]}),((y=u.constraints)==null?void 0:y.pattern)&&h.jsxs("div",{children:[h.jsx("span",{className:"font-medium",children:"Pattern:"})," ",u.constraints.pattern]}),((m=u.constraints)==null?void 0:m.enumValues)&&u.constraints.enumValues.length>0&&h.jsxs("div",{children:[h.jsx("span",{className:"font-medium",children:"Values:"})," ",u.constraints.enumValues.join(", ")]}),!u.constraints&&"-"]}),h.jsx("td",{children:h.jsx(ze,{to:`/services/${r}/entities/${e}/attributes/${u.name}/edit`,className:"btn btn-sm btn-ghost btn-square",title:"Edit",children:h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor",children:h.jsx("path",{d:"M13.586 3.586a2 2 0 112.828 2.828l-.793.793-2.828-2.828.793-.793zM11.379 5.793L3 14.172V17h2.828l8.38-8.379-2.83-2.828z"})})})})]},u.name)})})]})}),h.jsx("div",{className:"mt-6",children:h.jsxs(ze,{to:`/services/${r}/entities/${e}/attributes/create`,className:"btn btn-primary",children:[h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5 mr-2",viewBox:"0 0 20 20",fill:"currentColor",children:h.jsx("path",{fillRule:"evenodd",d:"M10 3a1 1 0 011 1v5h5a1 1 0 110 2h-5v5a1 1 0 11-2 0v-5H4a1 1 0 110-2h5V4a1 1 0 011-1z",clipRule:"evenodd"})}),"Add Attribute"]})})]})},zX=({relationships:t,entityName:e,serviceName:r})=>{const[n,a]=U.useState(""),[i,s]=U.useState("all"),o=(c,d)=>c===cr.ONE&&d===cr.ONE?"One-to-One":c===cr.ONE&&d===cr.MANY?"One-to-Many":c===cr.MANY&&d===cr.ONE?"Many-to-One":c===cr.MANY&&d===cr.MANY?"Many-to-Many":`${c}:${d}`,l=(c,d)=>c===cr.ONE&&d===cr.ONE?"badge-primary":c===cr.ONE&&d===cr.MANY?"badge-secondary":c===cr.MANY&&d===cr.ONE?"badge-accent":c===cr.MANY&&d===cr.MANY?"badge-info":"badge-ghost",u=t.filter(c=>{const d=n===""||(c.description||"").toLowerCase().includes(n.toLowerCase())||(c.source.name||"").toLowerCase().includes(n.toLowerCase())||(c.target.name||"").toLowerCase().includes(n.toLowerCase());if(i==="all")return d;const f=o(c.source.cardinality,c.target.cardinality);return d&&f===i});return h.jsxs("div",{children:[h.jsxs("div",{className:"flex flex-col md:flex-row gap-4 mb-4",children:[h.jsx("div",{className:"form-control flex-1",children:h.jsxs("div",{className:"input-group",children:[h.jsx("input",{type:"text",placeholder:"Search relationships...",className:"input input-bordered w-full",value:n,onChange:c=>a(c.target.value)}),n&&h.jsx("button",{className:"btn btn-square",onClick:()=>a(""),children:h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M6 18L18 6M6 6l12 12"})})})]})}),h.jsxs("select",{className:"select select-bordered",value:i,onChange:c=>s(c.target.value),children:[h.jsx("option",{value:"all",children:"All Cardinalities"}),h.jsx("option",{value:"One-to-One",children:"One-to-One"}),h.jsx("option",{value:"One-to-Many",children:"One-to-Many"}),h.jsx("option",{value:"Many-to-One",children:"Many-to-One"}),h.jsx("option",{value:"Many-to-Many",children:"Many-to-Many"})]})]}),t.length===0?h.jsxs("div",{className:"alert alert-info",children:[h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",className:"stroke-current shrink-0 w-6 h-6",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),h.jsx("span",{children:"No relationships defined for this entity."})]}):u.length===0?h.jsxs("div",{className:"alert alert-info",children:[h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",className:"stroke-current shrink-0 w-6 h-6",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),h.jsx("span",{children:"No relationships found matching your criteria."})]}):h.jsx("div",{className:"overflow-x-auto",children:h.jsxs("table",{className:"table table-zebra w-full",children:[h.jsx("thead",{children:h.jsxs("tr",{children:[h.jsx("th",{children:"Source"}),h.jsx("th",{children:"Cardinality"}),h.jsx("th",{children:"Target"}),h.jsx("th",{children:"Description"}),h.jsx("th",{children:"Actions"})]})}),h.jsx("tbody",{children:u.map(c=>h.jsxs("tr",{className:"hover",children:[h.jsxs("td",{children:[h.jsxs("div",{children:[h.jsx("span",{className:"font-medium",children:c.source.name||c.source.entity}),h.jsxs("span",{className:"text-xs text-base-content/50 ml-1",children:["(",c.source.cardinality,")"]})]}),c.source.referenceAttributes&&c.source.referenceAttributes.length>0&&h.jsxs("div",{className:"text-xs text-base-content/50",children:["via: ",c.source.referenceAttributes.join(", ")]})]}),h.jsx("td",{children:h.jsx("span",{className:`badge ${l(c.source.cardinality,c.target.cardinality)}`,children:o(c.source.cardinality,c.target.cardinality)})}),h.jsxs("td",{children:[h.jsxs("div",{children:[h.jsx("span",{className:"font-medium",children:c.target.name||c.target.entity}),h.jsxs("span",{className:"text-xs text-base-content/50 ml-1",children:["(",c.target.cardinality,")"]})]}),c.target.referenceAttributes&&c.target.referenceAttributes.length>0&&h.jsxs("div",{className:"text-xs text-base-content/50",children:["via: ",c.target.referenceAttributes.join(", ")]})]}),h.jsx("td",{className:"max-w-xs truncate",children:c.description||"-"}),h.jsx("td",{children:h.jsx(ze,{to:`/services/${r}/entities/${e}/relationships/${c.uuid}/edit`,className:"btn btn-sm btn-ghost btn-square",title:"Edit",children:h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor",children:h.jsx("path",{d:"M13.586 3.586a2 2 0 112.828 2.828l-.793.793-2.828-2.828.793-.793zM11.379 5.793L3 14.172V17h2.828l8.38-8.379-2.83-2.828z"})})})})]},c.uuid))})]})}),h.jsx("div",{className:"mt-6",children:h.jsxs(ze,{to:`/services/${r}/entities/${e}/relationships/create`,className:"btn btn-primary",children:[h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5 mr-2",viewBox:"0 0 20 20",fill:"currentColor",children:h.jsx("path",{fillRule:"evenodd",d:"M10 3a1 1 0 011 1v5h5a1 1 0 110 2h-5v5a1 1 0 11-2 0v-5H4a1 1 0 110-2h5V4a1 1 0 011-1z",clipRule:"evenodd"})}),"Add Relationship"]})})]})},qX=t=>{var L,_,k;const e=ku(),r=t.serviceProp||e.service,n=t.entityProp||e.entity,[a,i]=U.useState(null),[s,o]=U.useState([]),[l,u]=U.useState(!0),[c,d]=U.useState(null),[f,v]=U.useState("attributes"),[p,y]=U.useState(null),[m,g]=U.useState(!1),[x,b]=U.useState(!1),[w,E]=U.useState(!1),[C,S]=U.useState(""),[T,P]=U.useState(""),[A,j]=U.useState([]),[R,O]=U.useState(null),N=vn();U.useEffect(()=>{zn.getAll("entity").then(j).catch(()=>{})},[]),U.useEffect(()=>{const I=window.location.pathname.endsWith("/create");if(n==="create"||I&&!n){E(!0),u(!1);return}(async()=>{var B,$;if(!(!r||!n))try{u(!0);const W=await at.getEntitySchema(r,n);if(i(W.data),(B=W.data)!=null&&B.stereotype)try{const z=await zn.getById(W.data.stereotype);O(z)}catch{}try{const z=await id.getPackageRelationships(r),q=($=W.data)==null?void 0:$.uuid;q&&o(z.filter(G=>G.source.entity===q||G.target.entity===q))}catch{o([])}d(null)}catch(W){console.error(`Error fetching entity ${n} for service ${r}:`,W),d("Failed to load entity details. Please try again later.")}finally{u(!1)}})()},[r,n]);const D=async I=>{var F;if(I.preventDefault(),!r||!C){d("Service and entity name are required");return}try{u(!0);const B=new Date().toISOString(),$={uuid:crypto.randomUUID(),name:C,description:T||`${C} entity`,attributes:[],metadata:[],createdAt:B,updatedAt:B};try{const W=await at.createEntity(r,$);N(`/services/${r}/entities/${C}`)}catch(W){W.response?d(`API error: ${((F=W.response.data)==null?void 0:F.message)||W.message||"Unknown error"}`):d(`Error: ${W.message||"Unknown error"}`),u(!1)}}catch{d("Failed to create entity. Please try again."),u(!1)}};return!r&&!w?h.jsxs("div",{className:"alert alert-error",children:[h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"stroke-current shrink-0 h-6 w-6",fill:"none",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m7-2a9 9 0 11-18 0 9 9 0 0118 0z"})}),h.jsx("span",{children:"Service name is required"})]}):l?h.jsx("div",{className:"flex justify-center items-center h-64",children:h.jsx("span",{className:"loading loading-spinner loading-lg"})}):c?h.jsxs("div",{className:"alert alert-error",children:[h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"stroke-current shrink-0 h-6 w-6",fill:"none",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m7-2a9 9 0 11-18 0 9 9 0 0118 0z"})}),h.jsx("span",{children:c})]}):!a&&!w?h.jsxs("div",{className:"alert alert-warning",children:[h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"stroke-current shrink-0 h-6 w-6",fill:"none",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})}),h.jsx("span",{children:"Entity not found"})]}):w?h.jsxs("div",{className:"container mx-auto px-4",children:[h.jsx("h1",{className:"text-2xl font-bold mb-6",children:"Create New Entity"}),c&&h.jsxs("div",{className:"alert alert-error mb-4",children:[h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"stroke-current shrink-0 h-6 w-6",fill:"none",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m7-2a9 9 0 11-18 0 9 9 0 0118 0z"})}),h.jsx("span",{children:c})]}),h.jsx("div",{className:"card bg-base-100 shadow-xl",children:h.jsx("div",{className:"card-body",children:h.jsxs("form",{onSubmit:D,children:[h.jsxs("div",{className:"form-control mb-4",children:[h.jsx("label",{className:"label",children:h.jsx("span",{className:"label-text",children:"Entity Name"})}),h.jsx("input",{type:"text",className:"input input-bordered w-full",value:C,onChange:I=>S(I.target.value),placeholder:"Enter entity name",required:!0})]}),h.jsxs("div",{className:"form-control mb-6",children:[h.jsx("label",{className:"label",children:h.jsx("span",{className:"label-text",children:"Description"})}),h.jsx("textarea",{className:"textarea textarea-bordered w-full",value:T,onChange:I=>P(I.target.value),placeholder:"Enter entity description",rows:3})]}),h.jsx("div",{className:"form-control",children:h.jsx("button",{type:"submit",className:"btn btn-primary",disabled:l,children:l?h.jsxs(h.Fragment,{children:[h.jsx("span",{className:"loading loading-spinner loading-sm"}),"Creating..."]}):"Create Entity"})})]})})})]}):h.jsxs("div",{className:"flex-1 flex flex-col min-h-0",children:[h.jsxs("div",{className:"flex flex-wrap items-center gap-2 mb-2",children:[h.jsx("h1",{className:"text-lg font-semibold",children:a==null?void 0:a.name}),h.jsx("span",{className:"badge badge-sm badge-outline",children:r}),h.jsxs("span",{className:"text-xs text-base-content/50",children:[((L=a==null?void 0:a.attributes)==null?void 0:L.length)||0," attrs / ",s.length," rels"]}),h.jsx("button",{className:"btn btn-ghost btn-xs",onClick:()=>b(!x),title:x?"Hide details":"Show details",children:h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:`h-3.5 w-3.5 transition-transform ${x?"rotate-180":""}`,viewBox:"0 0 20 20",fill:"currentColor",children:h.jsx("path",{fillRule:"evenodd",d:"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z",clipRule:"evenodd"})})}),h.jsxs("div",{className:"ml-auto flex gap-1",children:[h.jsxs(ze,{to:`/services/${r}/entities/${n}/edit`,className:"btn btn-primary btn-sm",children:[h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 mr-1",viewBox:"0 0 20 20",fill:"currentColor",children:h.jsx("path",{d:"M13.586 3.586a2 2 0 112.828 2.828l-.793.793-2.828-2.828.793-.793zM11.379 5.793L3 14.172V17h2.828l8.38-8.379-2.83-2.828z"})}),"Edit"]}),h.jsxs(ze,{to:`/visualization/${r}/${n}`,className:"btn btn-outline btn-sm",children:[h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 mr-1",viewBox:"0 0 20 20",fill:"currentColor",children:h.jsx("path",{d:"M2 11a1 1 0 011-1h2a1 1 0 011 1v5a1 1 0 01-1 1H3a1 1 0 01-1-1v-5zM8 7a1 1 0 011-1h2a1 1 0 011 1v9a1 1 0 01-1 1H9a1 1 0 01-1-1V7zM14 4a1 1 0 011-1h2a1 1 0 011 1v12a1 1 0 01-1 1h-2a1 1 0 01-1-1V4z"})}),"Visualize"]}),a&&!w&&h.jsxs(h.Fragment,{children:[h.jsx("span",{className:`badge ml-2 ${a.status==="approved"?"badge-success":a.status==="submitted"?"badge-warning":a.status==="returned"?"badge-error":"badge-ghost"}`,children:a.status||"draft"}),(a.status==="draft"||a.status==="returned")&&h.jsx("button",{className:"btn btn-sm btn-warning",onClick:async()=>{if(!(!r||!n))try{await at.submitEntity(r,n);const I=await at.getEntitySchema(r,n);i(I.data)}catch{}},children:"Submit"}),a.status==="submitted"&&h.jsxs(h.Fragment,{children:[h.jsx("button",{className:"btn btn-sm btn-success",onClick:async()=>{if(!(!r||!n))try{await at.approveEntity(r,n);const I=await at.getEntitySchema(r,n);i(I.data)}catch{}},children:"Approve"}),h.jsx("button",{className:"btn btn-sm btn-error",onClick:async()=>{const I=prompt("Return comment (optional):");if(!(!r||!n))try{await at.returnEntity(r,n,I||void 0);const F=await at.getEntitySchema(r,n);i(F.data)}catch{}},children:"Return"})]})]})]})]}),x&&h.jsxs("div",{className:"bg-base-100 rounded-lg border border-base-300 p-3 mb-2",children:[(a==null?void 0:a.description)&&h.jsx("p",{className:"text-sm text-base-content/70 mb-2",children:a.description}),h.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-3 gap-3 text-sm",children:[h.jsxs("div",{children:[h.jsx("span",{className:"text-base-content/50",children:"Package"}),h.jsx("p",{className:"font-medium",children:r})]}),h.jsxs("div",{children:[h.jsx("span",{className:"text-base-content/50",children:"Attributes"}),h.jsx("p",{className:"font-medium",children:((_=a==null?void 0:a.attributes)==null?void 0:_.length)||0})]}),h.jsxs("div",{children:[h.jsx("span",{className:"text-base-content/50",children:"Relationships"}),h.jsx("p",{className:"font-medium",children:s.length})]})]})]}),h.jsx("div",{className:"card bg-base-100 shadow-sm flex-1 min-h-0 flex flex-col",children:h.jsxs("div",{className:"card-body p-3 flex flex-col min-h-0",children:[h.jsxs("div",{className:"tabs tabs-bordered tabs-sm",children:[h.jsxs("button",{className:`tab ${f==="attributes"?"tab-active":""}`,onClick:()=>v("attributes"),children:["Attributes (",((k=a==null?void 0:a.attributes)==null?void 0:k.length)||0,")"]}),h.jsxs("button",{className:`tab ${f==="relationships"?"tab-active":""}`,onClick:()=>v("relationships"),children:["Relationships (",s.length,")"]}),h.jsx("button",{className:`tab ${f==="metadata"?"tab-active":""}`,onClick:()=>v("metadata"),children:"Metadata"}),h.jsx("button",{className:`tab ${f==="lineage"?"tab-active":""}`,onClick:()=>v("lineage"),children:"Lineage"}),h.jsx("button",{className:`tab ${f==="impact"?"tab-active":""}`,onClick:()=>{v("impact"),!p&&(a!=null&&a.uuid)&&(g(!0),at.getImpactAnalysis(a.uuid).then(y).catch(()=>{}).finally(()=>g(!1)))},children:"Impact"}),h.jsx("button",{className:`tab ${f==="comments"?"tab-active":""}`,onClick:()=>v("comments"),children:"Comments"})]}),h.jsxs("div",{className:"mt-2 flex-1 overflow-auto min-h-0",children:[f==="attributes"&&a&&h.jsx(BX,{attributes:a.attributes,entityName:a.name,serviceName:r||""}),f==="relationships"&&a&&h.jsx(zX,{relationships:s,entityName:a.name,serviceName:r||""}),f==="metadata"&&a&&h.jsxs("div",{className:"space-y-4",children:[h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsx("label",{className:"text-sm font-semibold",children:"Stereotype:"}),h.jsxs("select",{className:"select select-bordered select-sm w-60",value:a.stereotype||"",onChange:I=>{const F=A.find(B=>B.id===I.target.value)||null;O(F),i({...a,stereotype:I.target.value||void 0})},children:[h.jsx("option",{value:"",children:"None"}),A.map(I=>h.jsx("option",{value:I.id,children:I.name},I.id))]}),R&&h.jsx("span",{className:"text-xs text-base-content/60",children:R.description})]}),h.jsx(tM,{entries:a.metadata||[],stereotype:R,onChange:I=>i({...a,metadata:I})})]}),f==="lineage"&&a&&r&&h.jsx(FX,{entityUuid:a.uuid,service:r}),f==="impact"&&h.jsx("div",{children:m?h.jsx("div",{className:"flex justify-center py-8",children:h.jsx("span",{className:"loading loading-spinner"})}):p?h.jsxs("div",{className:"space-y-4",children:[h.jsxs("div",{children:[h.jsxs("h4",{className:"font-semibold mb-2",children:["Relationships (",p.relationships.length,")"]}),p.relationships.length===0?h.jsx("p",{className:"text-sm text-base-content/50",children:"No relationships reference this entity."}):h.jsx("ul",{className:"space-y-1",children:p.relationships.map(I=>h.jsxs("li",{className:"text-sm flex gap-2",children:[h.jsx("span",{className:"badge badge-info badge-xs mt-1",children:"rel"}),h.jsxs("span",{children:[I.sourceEntity," → ",I.targetEntity]}),I.description&&h.jsxs("span",{className:"text-base-content/60",children:["(",I.description,")"]})]},I.uuid))})]}),h.jsxs("div",{children:[h.jsxs("h4",{className:"font-semibold mb-2",children:["Perspectives (",p.perspectives.length,")"]}),p.perspectives.length===0?h.jsx("p",{className:"text-sm text-base-content/50",children:"Not included in any perspective."}):h.jsx("ul",{className:"space-y-1",children:p.perspectives.map(I=>h.jsxs("li",{className:"text-sm",children:[h.jsx(ze,{to:`/perspectives/${I.uuid}`,className:"link link-primary",children:I.name}),h.jsx("span",{className:"text-base-content/60 ml-2 font-mono text-xs",children:I.path})]},I.uuid))})]}),h.jsxs("div",{children:[h.jsxs("h4",{className:"font-semibold mb-2",children:["Diagrams (",p.diagrams.length,")"]}),p.diagrams.length===0?h.jsx("p",{className:"text-sm text-base-content/50",children:"Not used in any diagram."}):h.jsx("ul",{className:"space-y-1",children:p.diagrams.map(I=>h.jsx("li",{className:"text-sm",children:h.jsx(ze,{to:`/diagram?layout=${I.id}`,className:"link link-primary",children:I.name})},I.id))})]})]}):h.jsx("p",{className:"text-sm text-base-content/50",children:"Click the Impact tab to load dependency analysis."})}),f==="comments"&&r&&n&&h.jsx(IX,{service:r,entityName:n})]})]})})]})},UX=/^[a-z0-9]+(?:-[a-z0-9]+)*$/;function ID({initialValues:t,onSubmit:e,onCancel:r,isEdit:n,loading:a}){const[i,s]=U.useState((t==null?void 0:t.name)||""),[o,l]=U.useState((t==null?void 0:t.description)||""),[u,c]=U.useState((t==null?void 0:t.type)||"microservice"),[d,f]=U.useState(null),v=y=>{s(y),y&&!UX.test(y)?f("Must be kebab-case (lowercase, numbers, hyphens)"):f(null)},p=y=>{y.preventDefault(),!(!i||d)&&e({name:i,description:o,type:u})};return h.jsxs("form",{onSubmit:p,className:"space-y-4",children:[h.jsxs("div",{className:"form-control",children:[h.jsx("label",{className:"label",children:h.jsx("span",{className:"label-text",children:"Package Name"})}),h.jsx("input",{type:"text",className:`input input-bordered ${d?"input-error":""}`,value:i,onChange:y=>v(y.target.value),placeholder:"my-package",disabled:n,required:!0}),d&&h.jsx("label",{className:"label",children:h.jsx("span",{className:"label-text-alt text-error",children:d})})]}),h.jsxs("div",{className:"form-control",children:[h.jsx("label",{className:"label",children:h.jsx("span",{className:"label-text",children:"Description"})}),h.jsx("textarea",{className:"textarea textarea-bordered",value:o,onChange:y=>l(y.target.value),placeholder:"Package description...",rows:3})]}),h.jsxs("div",{className:"form-control",children:[h.jsx("label",{className:"label",children:h.jsx("span",{className:"label-text",children:"Type"})}),h.jsxs("select",{className:"select select-bordered",value:u,onChange:y=>c(y.target.value),children:[h.jsx("option",{value:"project",children:"Project"}),h.jsx("option",{value:"microservice",children:"Microservice"}),h.jsx("option",{value:"module",children:"Module"})]})]}),h.jsxs("div",{className:"flex gap-2 justify-end",children:[h.jsx("button",{type:"button",className:"btn btn-ghost",onClick:r,children:"Cancel"}),h.jsxs("button",{type:"submit",className:"btn btn-primary",disabled:!i||!!d||a,children:[a&&h.jsx("span",{className:"loading loading-spinner loading-sm"}),n?"Update":"Create"]})]})]})}function $X({packagePath:t}){var A,j,R;const e=vn(),[r,n]=jO(),a=r.get("view")||"page",[i,s]=U.useState(null),[o,l]=U.useState(!0),[u,c]=U.useState(null),[d,f]=U.useState(!1),[v,p]=U.useState(!1),[y,m]=U.useState(!1),g=t[0],x=t.slice(1),b=`/packages/${t.join("/")}`;U.useEffect(()=>{if(t.length===0)return;(async()=>{var N,D;try{l(!0),c(null);const L=await Mn.getPackageByPath(g,x);s(L)}catch(L){c(((D=(N=L.response)==null?void 0:N.data)==null?void 0:D.message)||"Failed to load package")}finally{l(!1)}})()},[g,x.join("/")]);const w=async O=>{var N,D;try{await Mn.createSubPackage(g,[...x,O.name],{name:O.name,description:O.description,type:O.type}),f(!1);const L=await Mn.getPackageByPath(g,x);s(L)}catch(L){c(((D=(N=L.response)==null?void 0:N.data)==null?void 0:D.message)||"Failed to create sub-package")}},E=async O=>{var N,D;try{await Mn.updatePackage(g,x,{description:O.description,type:O.type}),p(!1);const L=await Mn.getPackageByPath(g,x);s(L)}catch(L){c(((D=(N=L.response)==null?void 0:N.data)==null?void 0:D.message)||"Failed to update package")}},C=async()=>{var O,N;try{await Mn.deletePackage(g,x),x.length>0?e(`/packages/${[g,...x.slice(0,-1)].join("/")}`):e("/packages")}catch(D){c(((N=(O=D.response)==null?void 0:O.data)==null?void 0:N.message)||"Failed to delete package"),m(!1)}};if(t.length===0)return h.jsxs("div",{className:"p-6",children:[h.jsx("h1",{className:"text-2xl font-bold",children:"Packages"}),h.jsx("p",{className:"text-base-content/60 mt-2",children:"Select a package from the sidebar to view details."})]});if(o)return h.jsx("div",{className:"flex items-center justify-center h-64",children:h.jsx("span",{className:"loading loading-spinner loading-lg"})});if(u)return h.jsx("div",{className:"p-6",children:h.jsx("div",{className:"alert alert-error",children:h.jsx("span",{children:u})})});if(!i)return null;const S=((A=i.entities)==null?void 0:A.length)??0,T=((j=i.subPackages)==null?void 0:j.length)??0,P=((R=i.relationships)==null?void 0:R.length)??0;return h.jsxs("div",{className:"p-6 space-y-6",children:[h.jsxs("div",{className:"flex items-start justify-between",children:[h.jsxs("div",{children:[h.jsx("h1",{className:"text-2xl font-bold",children:i.name}),i.description&&h.jsx("p",{className:"text-base-content/70 mt-1",children:i.description}),i.type&&h.jsx("span",{className:"badge badge-outline badge-sm mt-2",children:i.type})]}),h.jsxs("div",{className:"flex gap-2",children:[h.jsx("button",{className:"btn btn-sm btn-ghost",onClick:()=>p(!0),children:"Edit"}),h.jsx("button",{className:"btn btn-sm btn-error btn-ghost",onClick:()=>m(!0),children:"Delete"})]})]}),h.jsxs("div",{className:"tabs tabs-boxed w-fit",children:[h.jsx("button",{className:`tab ${a==="page"?"tab-active":""}`,onClick:()=>n({view:"page"}),children:"Page View"}),h.jsx("button",{className:`tab ${a==="graph"?"tab-active":""}`,onClick:()=>n({view:"graph"}),children:"Diagram View"})]}),a==="graph"?h.jsx("div",{className:"h-[600px] border border-base-300 rounded-lg overflow-hidden",children:h.jsx(YF,{service:g})}):h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:"stats stats-horizontal shadow w-full",children:[h.jsxs("div",{className:"stat",children:[h.jsx("div",{className:"stat-title",children:"Entities"}),h.jsx("div",{className:"stat-value text-lg",children:S})]}),h.jsxs("div",{className:"stat",children:[h.jsx("div",{className:"stat-title",children:"Sub-packages"}),h.jsx("div",{className:"stat-value text-lg",children:T})]}),h.jsxs("div",{className:"stat",children:[h.jsx("div",{className:"stat-title",children:"Relationships"}),h.jsx("div",{className:"stat-value text-lg",children:P})]})]}),h.jsx("div",{className:"card bg-base-200",children:h.jsxs("div",{className:"card-body",children:[h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsx("h2",{className:"card-title text-lg",children:"Entities"}),h.jsx(ze,{to:`${b}/entities/create`,className:"btn btn-sm btn-primary",children:"Add Entity"})]}),S===0?h.jsx("p",{className:"text-base-content/50",children:"No entities in this package."}):h.jsx("div",{className:"overflow-x-auto",children:h.jsxs("table",{className:"table table-sm",children:[h.jsx("thead",{children:h.jsxs("tr",{children:[h.jsx("th",{children:"Name"}),h.jsx("th",{children:"Description"}),h.jsx("th",{children:"Attributes"})]})}),h.jsx("tbody",{children:i.entities.map(O=>{var N;return h.jsxs("tr",{className:"hover",children:[h.jsx("td",{children:h.jsx(ze,{to:`${b}/entities/${O.name}`,className:"link link-primary font-mono",children:O.name})}),h.jsx("td",{className:"text-sm text-base-content/70 max-w-xs truncate",children:O.description||"-"}),h.jsx("td",{children:((N=O.attributes)==null?void 0:N.length)??0})]},O.uuid)})})]})})]})}),h.jsx("div",{className:"card bg-base-200",children:h.jsxs("div",{className:"card-body",children:[h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsx("h2",{className:"card-title text-lg",children:"Sub-packages"}),h.jsx("button",{className:"btn btn-sm btn-primary",onClick:()=>f(!0),children:"Add Sub-package"})]}),T===0?h.jsx("p",{className:"text-base-content/50",children:"No sub-packages."}):h.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-3",children:i.subPackages.map(O=>{var N,D;return h.jsx(ze,{to:`${b}/${O.name}`,className:"card bg-base-100 shadow-sm hover:shadow-md transition-shadow",children:h.jsxs("div",{className:"card-body p-4",children:[h.jsx("h3",{className:"font-bold",children:O.name}),O.description&&h.jsx("p",{className:"text-sm text-base-content/70 line-clamp-2",children:O.description}),h.jsxs("div",{className:"flex gap-2 text-xs opacity-60 mt-1",children:[h.jsxs("span",{children:[((N=O.entities)==null?void 0:N.length)??0," entities"]}),h.jsxs("span",{children:[((D=O.subPackages)==null?void 0:D.length)??0," sub-packages"]})]})]})},O.id)})})]})}),i.metadata&&i.metadata.length>0&&h.jsx("div",{className:"card bg-base-200",children:h.jsxs("div",{className:"card-body",children:[h.jsx("h2",{className:"card-title text-lg",children:"Metadata"}),h.jsx("div",{className:"overflow-x-auto",children:h.jsxs("table",{className:"table table-sm",children:[h.jsx("thead",{children:h.jsxs("tr",{children:[h.jsx("th",{children:"Key"}),h.jsx("th",{children:"Value"})]})}),h.jsx("tbody",{children:i.metadata.map((O,N)=>h.jsxs("tr",{children:[h.jsx("td",{className:"font-mono",children:O.name}),h.jsx("td",{children:String(O.value)})]},N))})]})})]})})]}),d&&h.jsxs("dialog",{className:"modal modal-open",children:[h.jsxs("div",{className:"modal-box",children:[h.jsx("h3",{className:"font-bold text-lg",children:"Create Sub-package"}),h.jsx("div",{className:"mt-4",children:h.jsx(ID,{onSubmit:w,onCancel:()=>f(!1)})})]}),h.jsx("form",{method:"dialog",className:"modal-backdrop",children:h.jsx("button",{onClick:()=>f(!1),children:"close"})})]}),v&&h.jsxs("dialog",{className:"modal modal-open",children:[h.jsxs("div",{className:"modal-box",children:[h.jsx("h3",{className:"font-bold text-lg",children:"Edit Package"}),h.jsx("div",{className:"mt-4",children:h.jsx(ID,{initialValues:{name:i.name,description:i.description,type:i.type},onSubmit:E,onCancel:()=>p(!1),isEdit:!0})})]}),h.jsx("form",{method:"dialog",className:"modal-backdrop",children:h.jsx("button",{onClick:()=>p(!1),children:"close"})})]}),y&&h.jsxs("dialog",{className:"modal modal-open",children:[h.jsxs("div",{className:"modal-box",children:[h.jsx("h3",{className:"font-bold text-lg",children:"Delete Package"}),h.jsxs("p",{className:"py-4",children:["Are you sure you want to delete ",h.jsx("strong",{children:i.name}),"? This cannot be undone."]}),h.jsxs("div",{className:"modal-action",children:[h.jsx("button",{className:"btn btn-ghost",onClick:()=>m(!1),children:"Cancel"}),h.jsx("button",{className:"btn btn-error",onClick:C,children:"Delete"})]})]}),h.jsx("form",{method:"dialog",className:"modal-backdrop",children:h.jsx("button",{onClick:()=>m(!1),children:"close"})})]})]})}function VX(){const r=(ku()["*"]||"").split("/").filter(Boolean),n=r.indexOf("entities");if(n>=0&&n<r.length-1){const a=r.slice(0,n),i=r[n+1],s=a[0],o=r[n+2]==="edit";return h.jsx(qX,{serviceProp:s,entityProp:i,packagePath:a,editMode:o},`${s}-${i}`)}return h.jsx($X,{packagePath:r})}const zi=({children:t,roles:e})=>{const[r,n]=U.useState(null),[a,i]=U.useState(null),[s,o]=U.useState(!0),l=Ia();return U.useEffect(()=>{(async()=>{try{if(!Or.isAuthenticated()){n(!1),o(!1);return}const c=await Or.getCurrentUser();i(c.data),n(!0)}catch(c){console.error("Authentication check failed:",c),n(!1),Or.logout()}finally{o(!1)}})()},[]),s?h.jsx("div",{className:"flex justify-center items-center h-64",children:h.jsx("span",{className:"loading loading-spinner loading-lg"})}):r?e&&a&&!e.includes(a.role)?h.jsxs("div",{className:"flex flex-col items-center justify-center h-64",children:[h.jsxs("div",{className:"alert alert-error max-w-md",children:[h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"stroke-current shrink-0 h-6 w-6",fill:"none",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m7-2a9 9 0 11-18 0 9 9 0 0118 0z"})}),h.jsxs("div",{children:[h.jsx("h3",{className:"font-bold",children:"Access Denied"}),h.jsx("div",{className:"text-sm",children:"You don't have permission to access this page."})]})]}),h.jsx("button",{className:"btn btn-primary mt-4",onClick:()=>window.history.back(),children:"Go Back"})]}):h.jsx(h.Fragment,{children:t}):h.jsx(uU,{to:"/login",state:{from:l},replace:!0})};function FD(){return h.jsxs(fU,{children:[h.jsx(rt,{path:"/login",element:h.jsx(DX,{})}),h.jsx(rt,{path:"/register",element:h.jsx(_X,{})}),h.jsx(rt,{path:"/forgot-password",element:h.jsx(jX,{})}),h.jsxs(rt,{path:"/",element:h.jsx(D5,{}),children:[h.jsx(rt,{index:!0,element:h.jsx(_5,{})}),h.jsx(rt,{path:"create",element:h.jsx(O5,{})}),h.jsx(rt,{path:"dictionaries",element:h.jsx(CD,{})}),h.jsxs(rt,{path:"packages",children:[h.jsx(rt,{index:!0,element:h.jsx(CD,{})}),h.jsx(rt,{path:"*",element:h.jsx(VX,{})})]}),h.jsxs(rt,{path:"perspectives",children:[h.jsx(rt,{index:!0,element:h.jsx(V5,{})}),h.jsx(rt,{path:"create",element:h.jsx(zi,{roles:["admin","editor"],children:h.jsx(EN,{})})}),h.jsx(rt,{path:":id",element:h.jsx(G5,{})}),h.jsx(rt,{path:":id/edit",element:h.jsx(zi,{roles:["admin","editor"],children:h.jsx(EN,{})})})]}),h.jsx(rt,{path:"import-export",element:h.jsx(q5,{})}),h.jsx(rt,{path:"quality",element:h.jsx($5,{})}),h.jsx(rt,{path:"stereotypes",element:h.jsx(I5,{})}),h.jsx(rt,{path:"search",element:h.jsx(sX,{})}),h.jsx(rt,{path:"entities/flat",element:h.jsx(aw,{})}),h.jsx(rt,{path:"flat/packages",element:h.jsx(nX,{})}),h.jsx(rt,{path:"flat/entities",element:h.jsx(aw,{})}),h.jsx(rt,{path:"flat/attributes",element:h.jsx(aX,{})}),h.jsxs(rt,{path:"version",children:[h.jsx(rt,{path:"save",element:h.jsx(zi,{roles:["admin","editor"],children:h.jsx(F5,{})})}),h.jsx(rt,{path:"history",element:h.jsx(lX,{})}),h.jsx(rt,{path:"workspaces",element:h.jsx(B5,{})}),h.jsx(rt,{path:"merge",element:h.jsx(zi,{roles:["admin","editor"],children:h.jsx(z5,{})})}),h.jsx(rt,{path:"commit",element:h.jsx(zi,{roles:["admin","editor"],children:h.jsx(oX,{})})})]}),h.jsx(rt,{path:"profile",element:h.jsx(zi,{children:h.jsx(OX,{})})}),h.jsx(rt,{path:"settings",element:h.jsx(zi,{children:h.jsx(MX,{})})}),h.jsx(rt,{path:"*",element:h.jsx(j5,{})})]})]})}const GX=Symbol("di:inject");class NS{constructor(e,r={}){this.providers=new Map,this.instances=new Map,this.parent=e,this.config=r}createChild(){return new NS(this,this.config)}provide(e){if(this.config.debug){const r=this.getTokenName(e.provide),n=this.config.pluginContext?`[${this.config.pluginContext}] `:"";console.log(`🔧 ${n}Providing token: ${r}`)}return this.providers.set(e.provide,e),this}resolve(e){var r;if(this.instances.has(e)){if(this.config.debug){const n=this.getTokenName(e),a=this.config.pluginContext?`[${this.config.pluginContext}] `:"";console.log(`✓ ${a}Resolving token (cached): ${n}`)}return this.instances.get(e)}if(this.providers.has(e)){if(this.config.debug){const i=this.getTokenName(e),s=this.config.pluginContext?`[${this.config.pluginContext}] `:"";console.log(`🔍 ${s}Resolving token: ${i}`)}const n=this.providers.get(e);let a;if("useValue"in n)a=n.useValue;else if("useClass"in n){const i=n.useClass,o=(i[GX]||[]).map(l=>this.resolve(l));a=new i(...o)}else{const s=(n.deps||[]).map(o=>this.resolve(o));a=n.useFactory(...s)}return this.instances.set(e,a),a}if(this.parent)return this.parent.resolve(e);throw new Error(`No provider for token: ${((r=e.toString)==null?void 0:r.call(e))??String(e)}`)}setPluginContext(e){this.config.pluginContext=e}clearPluginContext(){this.config.pluginContext=void 0}getTokenName(e){return typeof e=="symbol"?e.toString():typeof e=="function"?e.name||"AnonymousClass":String(e)}}function HX(){const t=new Map;return{on(e,r){t.has(e)||t.set(e,new Set),t.get(e).add(r)},off(e,r){var n;(n=t.get(e))==null||n.delete(r)},emit(e,...r){for(const n of t.get(e)??[])n(...r)}}}function WX(){const t=new Map;return{register(e,r){t.set(e,r)},run(e,...r){const n=t.get(e);if(!n)throw new Error(`Command not found: ${e}`);return n(...r)},has(e){return t.has(e)}}}function YX(){const t=new Map;return{register(e,r){const n=t.get(e)??[];n.push(r),t.set(e,n)},list(e){return[...t.get(e)??[]]}}}const XX="modulepreload",KX=function(t){return"/"+t},BD={},QX=function(e,r,n){if(!r||r.length===0)return e();const a=document.getElementsByTagName("link");return Promise.all(r.map(i=>{if(i=KX(i),i in BD)return;BD[i]=!0;const s=i.endsWith(".css"),o=s?'[rel="stylesheet"]':"";if(!!n)for(let c=a.length-1;c>=0;c--){const d=a[c];if(d.href===i&&(!s||d.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${i}"]${o}`))return;const u=document.createElement("link");if(u.rel=s?"stylesheet":XX,s||(u.as="script",u.crossOrigin=""),u.href=i,document.head.appendChild(u),s)return new Promise((c,d)=>{u.addEventListener("load",c),u.addEventListener("error",()=>d(new Error(`Unable to preload CSS for ${i}`)))})})).then(()=>e()).catch(i=>{const s=new Event("vite:preloadError",{cancelable:!0});if(s.payload=i,window.dispatchEvent(s),!s.defaultPrevented)throw i})};function gb(t){const e=new Map(t.map(i=>[i.name,i])),r=new Set,n=[],a=(i,s=new Set)=>{if(!r.has(i.name)){if(s.has(i.name))throw new Error(`Circular dependency detected: ${[...s,i.name].join(" -> ")}`);s.add(i.name),(i.dependsOn??[]).forEach(o=>{const l=e.get(o);if(!l){console.warn(`Dependency not found: ${o} (required by ${i.name})`);return}a(l,new Set(s))}),r.add(i.name),n.push(i)}};return t.forEach(i=>a(i)),n}class zD{constructor(e,r){this.manifest=e,this.module=r}}class ZX{constructor(){this.byName=new Map}get(e){return this.byName.get(e)}list(){return[...this.byName.values()].map(e=>e.manifest)}register(e,r,n){this.byName.set(e,new zD(r,n))}async loadAllAtRoot(e){const r=[];for(const a of e)typeof a=="string"?r.push(await fetch(a).then(i=>i.json())):r.push(a);const n=gb(r);for(const a of n){const i=new URL(a.entry,(a.baseUrl??location.origin)+"/").toString(),s=await QX(()=>import(i),[]);this.byName.set(a.name,new zD(a,s))}}getModulesInOrder(e="all"){const r=e==="all"?[...this.byName.keys()]:e;return gb(r.map(a=>this.byName.get(a).manifest)).map(a=>this.byName.get(a.name).module).filter(Boolean)}getModulesWithNamesInOrder(e="all"){const r=e==="all"?[...this.byName.keys()]:e;return gb(r.map(a=>this.byName.get(a).manifest)).map(a=>({name:a.name,module:this.byName.get(a.name).module})).filter(a=>a.module)}}function aB(){return{commands:WX(),views:YX(),hooks:HX()}}function iB(t,e,r){return{provide:n=>t.provide(n),resolve:n=>t.resolve(n),commands:{register:(n,a)=>e.commands.register(n,a)},views:{register:(n,a)=>e.views.register(n,a)},hooks:{on:(n,a)=>e.hooks.on(n,a),emit:(n,...a)=>e.hooks.emit(n,...a)},env:r}}function sB(t,e,r){return{resolve:n=>t.resolve(n),commands:e.commands,views:e.views,hooks:e.hooks,env:r}}class JX{constructor(e=[],r,n={}){const a={debug:n.debug};this.root=new NS(void 0,a),e.forEach(i=>this.root.provide(i)),this._registry=new ZX,this.env=r,this.config=n,this.config.debug&&console.log("🚀 Microkernel Host created with debug logging enabled")}async loadPlugins(e){await this._registry.loadAllAtRoot(e)}registerPlugin(e,r,n){this._registry.register(e,r,n)}getPlugin(e){var r;return(r=this._registry.get(e))==null?void 0:r.manifest}listPlugins(){return this._registry.list()}async bootstrapAllAtRoot(){var i,s;const e=aB(),r=iB(this.root,e,this.env),n=this._registry.getModulesWithNamesInOrder("all");this.config.debug&&(console.log(`
|
|
418
|
+
📋 Plugin initialization order:`,n.map(o=>o.name).join(" → ")),console.log(`
|
|
419
|
+
--- INITIALIZATION PHASE ---
|
|
420
|
+
`));for(const{name:o,module:l}of n)try{this.config.debug&&(console.log(`⚙️ Initializing plugin: ${o}`),this.root.setPluginContext(o)),await((i=l.initialize)==null?void 0:i.call(l,r)),this.config.debug&&(console.log(`✅ Plugin initialized: ${o}
|
|
421
|
+
`),this.root.clearPluginContext())}catch(u){const c=u instanceof Error?u:new Error(String(u)),d=new Error(`Plugin initialization failed: ${c.message}`);throw d.cause=u,this.config.debug&&console.error(`❌ Plugin initialization failed: ${o}`,c),d}this.config.debug&&console.log(`--- ACTIVATION PHASE ---
|
|
422
|
+
`);const a=sB(this.root,e,this.env);this.rootActivationCtx=a;for(const{name:o,module:l}of n)try{this.config.debug&&(console.log(`🔌 Activating plugin: ${o}`),this.root.setPluginContext(o)),await((s=l.activate)==null?void 0:s.call(l,a)),this.config.debug&&(console.log(`✅ Plugin activated: ${o}
|
|
423
|
+
`),this.root.clearPluginContext())}catch(u){const c=u instanceof Error?u:new Error(String(u));console.error("Plugin activation failed:",c),this.config.debug&&console.error(`❌ Plugin activation failed: ${o}`,c)}this.config.debug&&console.log(`🎉 All plugins bootstrapped successfully!
|
|
424
|
+
`),a.hooks.emit("host:activated")}createChildHost(e=[],r){const n=this.root.createChild();e.forEach(i=>n.provide(i));const a={...this.env||{},...r||{}};return new eK(n,this._registry,a,this.config)}}class eK{constructor(e,r,n,a={}){this.container=e,this.registry=r,this.env=n,this.config=a}async bootstrap(e="all"){var s,o;const r=aB(),n=iB(this.container,r,this.env),a=this.registry.getModulesWithNamesInOrder(e);this.config.debug&&(console.log(`
|
|
425
|
+
📋 Child host plugin initialization order:`,a.map(l=>l.name).join(" → ")),console.log(`
|
|
426
|
+
--- CHILD INITIALIZATION PHASE ---
|
|
427
|
+
`));for(const{name:l,module:u}of a)try{this.config.debug&&(console.log(`⚙️ Initializing plugin: ${l}`),this.container.setPluginContext(l)),await((s=u.initialize)==null?void 0:s.call(u,n)),this.config.debug&&(console.log(`✅ Plugin initialized: ${l}
|
|
428
|
+
`),this.container.clearPluginContext())}catch(c){const d=c instanceof Error?c:new Error(String(c)),f=new Error(`Plugin initialization failed: ${d.message}`);throw f.cause=c,this.config.debug&&console.error(`❌ Plugin initialization failed: ${l}`,d),f}this.config.debug&&console.log(`--- CHILD ACTIVATION PHASE ---
|
|
429
|
+
`);const i=sB(this.container,r,this.env);for(const{name:l,module:u}of a)try{this.config.debug&&(console.log(`🔌 Activating plugin: ${l}`),this.container.setPluginContext(l)),await((o=u.activate)==null?void 0:o.call(u,i)),this.config.debug&&(console.log(`✅ Plugin activated: ${l}
|
|
430
|
+
`),this.container.clearPluginContext())}catch(c){const d=c instanceof Error?c:new Error(String(c));console.error("Plugin activation failed:",d),this.config.debug&&console.error(`❌ Plugin activation failed: ${l}`,d)}this.config.debug&&console.log(`🎉 Child host plugins bootstrapped successfully!
|
|
431
|
+
`),i.hooks.emit("child:activated")}}const TS=Symbol("StoreManager"),tK=Symbol("MiddlewareRegistry"),oB=Symbol("ReducerRegistry"),lB=Symbol("StoreExtensions");class Ye{constructor(e){e==null||e==="."||Array.isArray(e)&&e.length===0?(this.segments=[],this.isAbsolutePath=!1):(this.isAbsolutePath=Array.isArray(e)?e[0].startsWith("/"):e.startsWith("/"),this.segments=this.normalizePath(e))}static of(e){return e!=null&&typeof e=="object"&&!Array.isArray(e)?e:new Ye(e)}normalizePath(e){return e==null?[]:(Array.isArray(e)?e:e.split("/")).reduce((n,a)=>a==="."||a===""?n:n.concat(a.split("/")),[]).filter(n=>n.length>0)}getSegments(){return this.segments}isCurrentDir(){return this.getSegments().length===0}toString(){return this.isAbsolute()?"/"+this.segments.join("/"):this.segments.join("/")}isAbsolute(){return this.isAbsolutePath}isRelative(){return!this.isAbsolutePath}resolve(e){const r=e instanceof Ye?e.getSegments():this.normalizePath(e),n=[...this.segments];if(e instanceof Ye?e.isAbsolute():Array.isArray(e)?e[0].startsWith("/"):e.startsWith("/"))return new Ye(r);for(const a of r)a===".."?n.length>0&&n[n.length-1]!==".."?n.pop():n.push(a):a!=="."&&n.push(a);return new Ye(this.isAbsolute()?["/",...n]:n)}getParent(){if(this.segments.length===0)return new Ye(null);const e=this.segments.slice(0,-1);return new Ye(this.isAbsolute()?["/",...e]:e)}getCurrentDirectory(){return this.segments.length===0?"":this.segments[this.segments.length-1]}static ofRoot(){return new Ye("/")}relativize(e){const r=e instanceof Ye?e.getSegments():this.normalizePath(e);if(this.isAbsolute()!==(e instanceof Ye?e.isAbsolute():Array.isArray(e)?e[0].startsWith("/"):e.startsWith("/")))throw new Error("Cannot relativize between absolute and relative paths");let n=0;const a=Math.min(this.segments.length,r.length);for(let o=0;o<a&&this.segments[o]===r[o];o++)n++;const i=this.segments.slice(n).map(()=>".."),s=r.slice(n);return new Ye(i.concat(s))}isDescendant(e){const r=e instanceof Ye?e.getSegments():this.normalizePath(e);if(r.length<this.segments.length)return!1;for(let n=0;n<this.segments.length;n++)if(this.segments[n]!==r[n])return!1;return!0}static isRelativePath(e){return(typeof e=="object"&&!Array.isArray(e)?e:Ye.of(e)).isRelative()}static asString(e){return typeof e=="string"?e:(typeof e=="object"&&!Array.isArray(e)?e:Ye.of(e)).toString()}static getName(e){let r;switch(typeof e){case"string":r=e;break;case"object":{const n=Array.isArray(e)?e:e.getSegments();r=n[n.length-1]}break}return r}}function ql(t){return Array.isArray(t)?t:t.split("/").filter(e=>e.trim().length>0)}function qD(t,e){var r,n,a;if(t==null||e==null)return!1;if(t.type!==e.type)return!1;switch(t.type){case"property":return e.type==="property"&&t.propertyName===e.propertyName;case"position":return e.type==="position"&&t.position===e.position;case"lookup":return e.type==="lookup"&&((r=t.keys)==null?void 0:r.length)===((n=e.keys)==null?void 0:n.length)&&((a=t.keys)==null?void 0:a.every(i=>e.keys.some(s=>rK(i,s))))}}function rK(t,e){return t.propertyName===e.propertyName&&t.propertyValue===e.propertyValue}function RS(t,e,r){if(t===void 0)return;if(e===void 0)return t;const{parent:n,value:a}=e,i=RS(t,n,r==null?void 0:r.parent);return nK(i,a,r==null?void 0:r.value)}function nK(t,e,r){if(t!==void 0){if(e===void 0)return t;if(Array.isArray(t)){if(e.type==="lookup"){const n=e,a=t.find(i=>i!==void 0&&n.keys.every(({propertyName:s,propertyValue:o})=>i[s]===o));return a===void 0&&r!==void 0?(t.push(r),r):a}else if(e.type==="position"){const n=t[e.position];return n===void 0&&r!==void 0?(t[e.position]=r,r):n}}else if(typeof t=="object"&&e.type==="property"){const n=t===null?void 0:t[e.propertyName];return n===void 0&&r!==void 0&&t!==null&&t!==void 0?(t[e.propertyName]=r,r):n}}}function mb(t,e,r){return RS(t,e,r)}function ro(t=!0){return{contentLoaded:t,contentLoading:!1,contentLoadError:void 0,contentHistory:[],extensionStates:{}}}function dr(t){return`Minified Redux error #${t}; visit https://redux.js.org/Errors?code=${t} for the full message or use the non-minified dev environment for full errors. `}var aK=(()=>typeof Symbol=="function"&&Symbol.observable||"@@observable")(),UD=aK,yb=()=>Math.random().toString(36).substring(7).split("").join("."),iK={INIT:`@@redux/INIT${yb()}`,REPLACE:`@@redux/REPLACE${yb()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${yb()}`},ff=iK;function PS(t){if(typeof t!="object"||t===null)return!1;let e=t;for(;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e||Object.getPrototypeOf(t)===null}function uB(t,e,r){if(typeof t!="function")throw new Error(dr(2));if(typeof e=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(dr(0));if(typeof e=="function"&&typeof r>"u"&&(r=e,e=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(dr(1));return r(uB)(t,e)}let n=t,a=e,i=new Map,s=i,o=0,l=!1;function u(){s===i&&(s=new Map,i.forEach((m,g)=>{s.set(g,m)}))}function c(){if(l)throw new Error(dr(3));return a}function d(m){if(typeof m!="function")throw new Error(dr(4));if(l)throw new Error(dr(5));let g=!0;u();const x=o++;return s.set(x,m),function(){if(g){if(l)throw new Error(dr(6));g=!1,u(),s.delete(x),i=null}}}function f(m){if(!PS(m))throw new Error(dr(7));if(typeof m.type>"u")throw new Error(dr(8));if(typeof m.type!="string")throw new Error(dr(17));if(l)throw new Error(dr(9));try{l=!0,a=n(a,m)}finally{l=!1}return(i=s).forEach(x=>{x()}),m}function v(m){if(typeof m!="function")throw new Error(dr(10));n=m,f({type:ff.REPLACE})}function p(){const m=d;return{subscribe(g){if(typeof g!="object"||g===null)throw new Error(dr(11));function x(){const w=g;w.next&&w.next(c())}return x(),{unsubscribe:m(x)}},[UD](){return this}}}return f({type:ff.INIT}),{dispatch:f,subscribe:d,getState:c,replaceReducer:v,[UD]:p}}function sK(t){Object.keys(t).forEach(e=>{const r=t[e];if(typeof r(void 0,{type:ff.INIT})>"u")throw new Error(dr(12));if(typeof r(void 0,{type:ff.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(dr(13))})}function cB(t){const e=Object.keys(t),r={};for(let i=0;i<e.length;i++){const s=e[i];typeof t[s]=="function"&&(r[s]=t[s])}const n=Object.keys(r);let a;try{sK(r)}catch(i){a=i}return function(s={},o){if(a)throw a;let l=!1;const u={};for(let c=0;c<n.length;c++){const d=n[c],f=r[d],v=s[d],p=f(v,o);if(typeof p>"u")throw o&&o.type,new Error(dr(14));u[d]=p,l=l||p!==v}return l=l||n.length!==Object.keys(s).length,l?u:s}}function hf(...t){return t.length===0?e=>e:t.length===1?t[0]:t.reduce((e,r)=>(...n)=>e(r(...n)))}function oK(...t){return e=>(r,n)=>{const a=e(r,n);let i=()=>{throw new Error(dr(15))};const s={getState:a.getState,dispatch:(l,...u)=>i(l,...u)},o=t.map(l=>l(s));return i=hf(...o)(a.dispatch),{...a,dispatch:i}}}function lK(t){return PS(t)&&"type"in t&&typeof t.type=="string"}var dB=Symbol.for("immer-nothing"),$D=Symbol.for("immer-draftable"),Fr=Symbol.for("immer-state");function Bn(t,...e){throw new Error(`[Immer] minified error nr: ${t}. Full error at: https://bit.ly/3cXEKWf`)}var on=Object,No=on.getPrototypeOf,vf="constructor",Ph="prototype",ow="configurable",pf="enumerable",md="writable",xu="value",Oa=t=>!!t&&!!t[Fr];function Yn(t){var e;return t?fB(t)||kh(t)||!!t[$D]||!!((e=t[vf])!=null&&e[$D])||Lh(t)||Dh(t):!1}var uK=on[Ph][vf].toString(),VD=new WeakMap;function fB(t){if(!t||!AS(t))return!1;const e=No(t);if(e===null||e===on[Ph])return!0;const r=on.hasOwnProperty.call(e,vf)&&e[vf];if(r===Object)return!0;if(!zs(r))return!1;let n=VD.get(r);return n===void 0&&(n=Function.toString.call(r),VD.set(r,n)),n===uK}function Ah(t,e,r=!0){tc(t)===0?(r?Reflect.ownKeys(t):on.keys(t)).forEach(a=>{e(a,t[a],t)}):t.forEach((n,a)=>e(a,n,t))}function tc(t){const e=t[Fr];return e?e.type_:kh(t)?1:Lh(t)?2:Dh(t)?3:0}var GD=(t,e,r=tc(t))=>r===2?t.has(e):on[Ph].hasOwnProperty.call(t,e),lw=(t,e,r=tc(t))=>r===2?t.get(e):t[e],gf=(t,e,r,n=tc(t))=>{n===2?t.set(e,r):n===3?t.add(r):t[e]=r};function cK(t,e){return t===e?t!==0||1/t===1/e:t!==t&&e!==e}var kh=Array.isArray,Lh=t=>t instanceof Map,Dh=t=>t instanceof Set,AS=t=>typeof t=="object",zs=t=>typeof t=="function",xb=t=>typeof t=="boolean";function dK(t){const e=+t;return Number.isInteger(e)&&String(e)===t}var wa=t=>t.copy_||t.base_,kS=t=>t.modified_?t.copy_:t.base_;function uw(t,e){if(Lh(t))return new Map(t);if(Dh(t))return new Set(t);if(kh(t))return Array[Ph].slice.call(t);const r=fB(t);if(e===!0||e==="class_only"&&!r){const n=on.getOwnPropertyDescriptors(t);delete n[Fr];let a=Reflect.ownKeys(n);for(let i=0;i<a.length;i++){const s=a[i],o=n[s];o[md]===!1&&(o[md]=!0,o[ow]=!0),(o.get||o.set)&&(n[s]={[ow]:!0,[md]:!0,[pf]:o[pf],[xu]:t[s]})}return on.create(No(t),n)}else{const n=No(t);if(n!==null&&r)return{...t};const a=on.create(n);return on.assign(a,t)}}function LS(t,e=!1){return _h(t)||Oa(t)||!Yn(t)||(tc(t)>1&&on.defineProperties(t,{set:Ic,add:Ic,clear:Ic,delete:Ic}),on.freeze(t),e&&Ah(t,(r,n)=>{LS(n,!0)},!1)),t}function fK(){Bn(2)}var Ic={[xu]:fK};function _h(t){return t===null||!AS(t)?!0:on.isFrozen(t)}var mf="MapSet",cw="Patches",HD="ArrayMethods",hB={};function ps(t){const e=hB[t];return e||Bn(0,t),e}var WD=t=>!!hB[t],bu,vB=()=>bu,hK=(t,e)=>({drafts_:[],parent_:t,immer_:e,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:WD(mf)?ps(mf):void 0,arrayMethodsPlugin_:WD(HD)?ps(HD):void 0});function YD(t,e){e&&(t.patchPlugin_=ps(cw),t.patches_=[],t.inversePatches_=[],t.patchListener_=e)}function dw(t){fw(t),t.drafts_.forEach(vK),t.drafts_=null}function fw(t){t===bu&&(bu=t.parent_)}var XD=t=>bu=hK(bu,t);function vK(t){const e=t[Fr];e.type_===0||e.type_===1?e.revoke_():e.revoked_=!0}function KD(t,e){e.unfinalizedDrafts_=e.drafts_.length;const r=e.drafts_[0];if(t!==void 0&&t!==r){r[Fr].modified_&&(dw(e),Bn(4)),Yn(t)&&(t=QD(e,t));const{patchPlugin_:a}=e;a&&a.generateReplacementPatches_(r[Fr].base_,t,e)}else t=QD(e,r);return pK(e,t,!0),dw(e),e.patches_&&e.patchListener_(e.patches_,e.inversePatches_),t!==dB?t:void 0}function QD(t,e){if(_h(e))return e;const r=e[Fr];if(!r)return yf(e,t.handledSet_,t);if(!jh(r,t))return e;if(!r.modified_)return r.base_;if(!r.finalized_){const{callbacks_:n}=r;if(n)for(;n.length>0;)n.pop()(t);mB(r,t)}return r.copy_}function pK(t,e,r=!1){!t.parent_&&t.immer_.autoFreeze_&&t.canAutoFreeze_&&LS(e,r)}function pB(t){t.finalized_=!0,t.scope_.unfinalizedDrafts_--}var jh=(t,e)=>t.scope_===e,gK=[];function gB(t,e,r,n){const a=wa(t),i=t.type_;if(n!==void 0&&lw(a,n,i)===e){gf(a,n,r,i);return}if(!t.draftLocations_){const o=t.draftLocations_=new Map;Ah(a,(l,u)=>{if(Oa(u)){const c=o.get(u)||[];c.push(l),o.set(u,c)}})}const s=t.draftLocations_.get(e)??gK;for(const o of s)gf(a,o,r,i)}function mK(t,e,r){t.callbacks_.push(function(a){var o;const i=e;if(!i||!jh(i,a))return;(o=a.mapSetPlugin_)==null||o.fixSetContents(i);const s=kS(i);gB(t,i.draft_??i,s,r),mB(i,a)})}function mB(t,e){var n;if(t.modified_&&!t.finalized_&&(t.type_===3||t.type_===1&&t.allIndicesReassigned_||(((n=t.assigned_)==null?void 0:n.size)??0)>0)){const{patchPlugin_:a}=e;if(a){const i=a.getPath(t);i&&a.generatePatches_(t,i,e)}pB(t)}}function yK(t,e,r){const{scope_:n}=t;if(Oa(r)){const a=r[Fr];jh(a,n)&&a.callbacks_.push(function(){yd(t);const s=kS(a);gB(t,r,s,e)})}else Yn(r)&&t.callbacks_.push(function(){const i=wa(t);t.type_===3?i.has(r)&&yf(r,n.handledSet_,n):lw(i,e,t.type_)===r&&n.drafts_.length>1&&(t.assigned_.get(e)??!1)===!0&&t.copy_&&yf(lw(t.copy_,e,t.type_),n.handledSet_,n)})}function yf(t,e,r){return!r.immer_.autoFreeze_&&r.unfinalizedDrafts_<1||Oa(t)||e.has(t)||!Yn(t)||_h(t)||(e.add(t),Ah(t,(n,a)=>{if(Oa(a)){const i=a[Fr];if(jh(i,r)){const s=kS(i);gf(t,n,s,t.type_),pB(i)}}else Yn(a)&&yf(a,e,r)})),t}function xK(t,e){const r=kh(t),n={type_:r?1:0,scope_:e?e.scope_:vB(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:e,base_:t,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0};let a=n,i=xf;r&&(a=[n],i=wu);const{revoke:s,proxy:o}=Proxy.revocable(a,i);return n.draft_=o,n.revoke_=s,[o,n]}var xf={get(t,e){if(e===Fr)return t;let r=t.scope_.arrayMethodsPlugin_;const n=t.type_===1&&typeof e=="string";if(n&&r!=null&&r.isArrayOperationMethod(e))return r.createMethodInterceptor(t,e);const a=wa(t);if(!GD(a,e,t.type_))return bK(t,a,e);const i=a[e];if(t.finalized_||!Yn(i)||n&&t.operationMethod&&(r!=null&&r.isMutatingArrayMethod(t.operationMethod))&&dK(e))return i;if(i===bb(t.base_,e)){yd(t);const s=t.type_===1?+e:e,o=vw(t.scope_,i,t,s);return t.copy_[s]=o}return i},has(t,e){return e in wa(t)},ownKeys(t){return Reflect.ownKeys(wa(t))},set(t,e,r){const n=yB(wa(t),e);if(n!=null&&n.set)return n.set.call(t.draft_,r),!0;if(!t.modified_){const a=bb(wa(t),e),i=a==null?void 0:a[Fr];if(i&&i.base_===r)return t.copy_[e]=r,t.assigned_.set(e,!1),!0;if(cK(r,a)&&(r!==void 0||GD(t.base_,e,t.type_)))return!0;yd(t),hw(t)}return t.copy_[e]===r&&(r!==void 0||e in t.copy_)||Number.isNaN(r)&&Number.isNaN(t.copy_[e])||(t.copy_[e]=r,t.assigned_.set(e,!0),yK(t,e,r)),!0},deleteProperty(t,e){return yd(t),bb(t.base_,e)!==void 0||e in t.base_?(t.assigned_.set(e,!1),hw(t)):t.assigned_.delete(e),t.copy_&&delete t.copy_[e],!0},getOwnPropertyDescriptor(t,e){const r=wa(t),n=Reflect.getOwnPropertyDescriptor(r,e);return n&&{[md]:!0,[ow]:t.type_!==1||e!=="length",[pf]:n[pf],[xu]:r[e]}},defineProperty(){Bn(11)},getPrototypeOf(t){return No(t.base_)},setPrototypeOf(){Bn(12)}},wu={};for(let t in xf){let e=xf[t];wu[t]=function(){const r=arguments;return r[0]=r[0][0],e.apply(this,r)}}wu.deleteProperty=function(t,e){return wu.set.call(this,t,e,void 0)};wu.set=function(t,e,r){return xf.set.call(this,t[0],e,r,t[0])};function bb(t,e){const r=t[Fr];return(r?wa(r):t)[e]}function bK(t,e,r){var a;const n=yB(e,r);return n?xu in n?n[xu]:(a=n.get)==null?void 0:a.call(t.draft_):void 0}function yB(t,e){if(!(e in t))return;let r=No(t);for(;r;){const n=Object.getOwnPropertyDescriptor(r,e);if(n)return n;r=No(r)}}function hw(t){t.modified_||(t.modified_=!0,t.parent_&&hw(t.parent_))}function yd(t){t.copy_||(t.assigned_=new Map,t.copy_=uw(t.base_,t.scope_.immer_.useStrictShallowCopy_))}var wK=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(r,n,a)=>{if(zs(r)&&!zs(n)){const s=n;n=r;const o=this;return function(u=s,...c){return o.produce(u,d=>n.call(this,d,...c))}}zs(n)||Bn(6),a!==void 0&&!zs(a)&&Bn(7);let i;if(Yn(r)){const s=XD(this),o=vw(s,r,void 0);let l=!0;try{i=n(o),l=!1}finally{l?dw(s):fw(s)}return YD(s,a),KD(i,s)}else if(!r||!AS(r)){if(i=n(r),i===void 0&&(i=r),i===dB&&(i=void 0),this.autoFreeze_&&LS(i,!0),a){const s=[],o=[];ps(cw).generateReplacementPatches_(r,i,{patches_:s,inversePatches_:o}),a(s,o)}return i}else Bn(1,r)},this.produceWithPatches=(r,n)=>{if(zs(r))return(o,...l)=>this.produceWithPatches(o,u=>r(u,...l));let a,i;return[this.produce(r,n,(o,l)=>{a=o,i=l}),a,i]},xb(e==null?void 0:e.autoFreeze)&&this.setAutoFreeze(e.autoFreeze),xb(e==null?void 0:e.useStrictShallowCopy)&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),xb(e==null?void 0:e.useStrictIteration)&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){Yn(e)||Bn(8),Oa(e)&&(e=EK(e));const r=XD(this),n=vw(r,e,void 0);return n[Fr].isManual_=!0,fw(r),n}finishDraft(e,r){const n=e&&e[Fr];(!n||!n.isManual_)&&Bn(9);const{scope_:a}=n;return YD(a,r),KD(void 0,a)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,r){let n;for(n=r.length-1;n>=0;n--){const i=r[n];if(i.path.length===0&&i.op==="replace"){e=i.value;break}}n>-1&&(r=r.slice(n+1));const a=ps(cw).applyPatches_;return Oa(e)?a(e,r):this.produce(e,i=>a(i,r))}};function vw(t,e,r,n){const[a,i]=Lh(e)?ps(mf).proxyMap_(e,r):Dh(e)?ps(mf).proxySet_(e,r):xK(e,r);return((r==null?void 0:r.scope_)??vB()).drafts_.push(a),i.callbacks_=(r==null?void 0:r.callbacks_)??[],i.key_=n,r&&n!==void 0?mK(r,i,n):i.callbacks_.push(function(l){var c;(c=l.mapSetPlugin_)==null||c.fixSetContents(i);const{patchPlugin_:u}=l;i.modified_&&u&&u.generatePatches_(i,[],l)}),a}function EK(t){return Oa(t)||Bn(10,t),xB(t)}function xB(t){if(!Yn(t)||_h(t))return t;const e=t[Fr];let r,n=!0;if(e){if(!e.modified_)return e.base_;e.finalized_=!0,r=uw(t,e.scope_.immer_.useStrictShallowCopy_),n=e.scope_.immer_.shouldUseStrictIteration()}else r=uw(t,!0);return Ah(r,(a,i)=>{gf(r,a,xB(i))},n),e&&(e.finalized_=!1),r}var SK=new wK,bB=SK.produce;function CK(t,e=`expected a function, instead received ${typeof t}`){if(typeof t!="function")throw new TypeError(e)}function NK(t,e=`expected an object, instead received ${typeof t}`){if(typeof t!="object")throw new TypeError(e)}function TK(t,e="expected all items to be functions, instead received the following types: "){if(!t.every(r=>typeof r=="function")){const r=t.map(n=>typeof n=="function"?`function ${n.name||"unnamed"}()`:typeof n).join(", ");throw new TypeError(`${e}[${r}]`)}}var ZD=t=>Array.isArray(t)?t:[t];function RK(t){const e=Array.isArray(t[0])?t[0]:t;return TK(e,"createSelector expects all input-selectors to be functions, but received the following types: "),e}function PK(t,e){const r=[],{length:n}=t;for(let a=0;a<n;a++)r.push(t[a].apply(null,e));return r}var AK=class{constructor(t){this.value=t}deref(){return this.value}},kK=typeof WeakRef<"u"?WeakRef:AK,LK=0,JD=1;function Fc(){return{s:LK,v:void 0,o:null,p:null}}function wB(t,e={}){let r=Fc();const{resultEqualityCheck:n}=e;let a,i=0;function s(){var d;let o=r;const{length:l}=arguments;for(let f=0,v=l;f<v;f++){const p=arguments[f];if(typeof p=="function"||typeof p=="object"&&p!==null){let y=o.o;y===null&&(o.o=y=new WeakMap);const m=y.get(p);m===void 0?(o=Fc(),y.set(p,o)):o=m}else{let y=o.p;y===null&&(o.p=y=new Map);const m=y.get(p);m===void 0?(o=Fc(),y.set(p,o)):o=m}}const u=o;let c;if(o.s===JD)c=o.v;else if(c=t.apply(null,arguments),i++,n){const f=((d=a==null?void 0:a.deref)==null?void 0:d.call(a))??a;f!=null&&n(f,c)&&(c=f,i!==0&&i--),a=typeof c=="object"&&c!==null||typeof c=="function"?new kK(c):c}return u.s=JD,u.v=c,c}return s.clearCache=()=>{r=Fc(),s.resetResultsCount()},s.resultsCount=()=>i,s.resetResultsCount=()=>{i=0},s}function DK(t,...e){const r=typeof t=="function"?{memoize:t,memoizeOptions:e}:t,n=(...a)=>{let i=0,s=0,o,l={},u=a.pop();typeof u=="object"&&(l=u,u=a.pop()),CK(u,`createSelector expects an output function after the inputs, but received: [${typeof u}]`);const c={...r,...l},{memoize:d,memoizeOptions:f=[],argsMemoize:v=wB,argsMemoizeOptions:p=[],devModeChecks:y={}}=c,m=ZD(f),g=ZD(p),x=RK(a),b=d(function(){return i++,u.apply(null,arguments)},...m),w=v(function(){s++;const C=PK(x,arguments);return o=b.apply(null,C),o},...g);return Object.assign(w,{resultFunc:u,memoizedResultFunc:b,dependencies:x,dependencyRecomputations:()=>s,resetDependencyRecomputations:()=>{s=0},lastResult:()=>o,recomputations:()=>i,resetRecomputations:()=>{i=0},memoize:d,argsMemoize:v})};return Object.assign(n,{withTypes:()=>n}),n}var pw=DK(wB),_K=Object.assign((t,e=pw)=>{NK(t,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof t}`);const r=Object.keys(t),n=r.map(i=>t[i]);return e(n,(...i)=>i.reduce((s,o,l)=>(s[r[l]]=o,s),{}))},{withTypes:()=>_K});function EB(t){return({dispatch:r,getState:n})=>a=>i=>typeof i=="function"?i(r,n,t):a(i)}var jK=EB(),OK=EB,MK=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?hf:hf.apply(null,arguments)},IK=t=>t&&typeof t.match=="function";function Ul(t,e){function r(...n){if(e){let a=e(...n);if(!a)throw new Error(Ra(0));return{type:t,payload:a.payload,..."meta"in a&&{meta:a.meta},..."error"in a&&{error:a.error}}}return{type:t,payload:n[0]}}return r.toString=()=>`${t}`,r.type=t,r.match=n=>lK(n)&&n.type===t,r}var SB=class Tl extends Array{constructor(...e){super(...e),Object.setPrototypeOf(this,Tl.prototype)}static get[Symbol.species](){return Tl}concat(...e){return super.concat.apply(this,e)}prepend(...e){return e.length===1&&Array.isArray(e[0])?new Tl(...e[0].concat(this)):new Tl(...e.concat(this))}};function e_(t){return Yn(t)?bB(t,()=>{}):t}function Bc(t,e,r){return t.has(e)?t.get(e):t.set(e,r(e)).get(e)}function FK(t){return typeof t=="boolean"}var BK=()=>function(e){const{thunk:r=!0,immutableCheck:n=!0,serializableCheck:a=!0,actionCreatorCheck:i=!0}=e??{};let s=new SB;return r&&(FK(r)?s.push(jK):s.push(OK(r.extraArgument))),s},zK="RTK_autoBatch",t_=t=>e=>{setTimeout(e,t)},qK=(t={type:"raf"})=>e=>(...r)=>{const n=e(...r);let a=!0,i=!1,s=!1;const o=new Set,l=t.type==="tick"?queueMicrotask:t.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:t_(10):t.type==="callback"?t.queueNotification:t_(t.timeout),u=()=>{s=!1,i&&(i=!1,o.forEach(c=>c()))};return Object.assign({},n,{subscribe(c){const d=()=>a&&c(),f=n.subscribe(d);return o.add(c),()=>{f(),o.delete(c)}},dispatch(c){var d;try{return a=!((d=c==null?void 0:c.meta)!=null&&d[zK]),i=!a,i&&(s||(s=!0,l(u))),n.dispatch(c)}finally{a=!0}}})},UK=t=>function(r){const{autoBatch:n=!0}=r??{};let a=new SB(t);return n&&a.push(qK(typeof n=="object"?n:void 0)),a};function $K(t){const e=BK(),{reducer:r=void 0,middleware:n,devTools:a=!0,duplicateMiddlewareCheck:i=!0,preloadedState:s=void 0,enhancers:o=void 0}=t||{};let l;if(typeof r=="function")l=r;else if(PS(r))l=cB(r);else throw new Error(Ra(1));let u;typeof n=="function"?u=n(e):u=e();let c=hf;a&&(c=MK({trace:!1,...typeof a=="object"&&a}));const d=oK(...u),f=UK(d);let v=typeof o=="function"?o(f):f();const p=c(...v);return uB(l,s,p)}function CB(t){const e={},r=[];let n;const a={addCase(i,s){const o=typeof i=="string"?i:i.type;if(!o)throw new Error(Ra(28));if(o in e)throw new Error(Ra(29));return e[o]=s,a},addAsyncThunk(i,s){return s.pending&&(e[i.pending.type]=s.pending),s.rejected&&(e[i.rejected.type]=s.rejected),s.fulfilled&&(e[i.fulfilled.type]=s.fulfilled),s.settled&&r.push({matcher:i.settled,reducer:s.settled}),a},addMatcher(i,s){return r.push({matcher:i,reducer:s}),a},addDefaultCase(i){return n=i,a}};return t(a),[e,r,n]}function VK(t){return typeof t=="function"}function GK(t,e){let[r,n,a]=CB(e),i;if(VK(t))i=()=>e_(t());else{const o=e_(t);i=()=>o}function s(o=i(),l){let u=[r[l.type],...n.filter(({matcher:c})=>c(l)).map(({reducer:c})=>c)];return u.filter(c=>!!c).length===0&&(u=[a]),u.reduce((c,d)=>{if(d)if(Oa(c)){const v=d(c,l);return v===void 0?c:v}else{if(Yn(c))return bB(c,f=>d(f,l));{const f=d(c,l);if(f===void 0){if(c===null)return c;throw Error("A case reducer on a non-draftable value must not return undefined")}return f}}return c},o)}return s.getInitialState=i,s}var HK=(t,e)=>IK(t)?t.match(e):t(e);function WK(...t){return e=>t.some(r=>HK(r,e))}var YK="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",XK=(t=21)=>{let e="",r=t;for(;r--;)e+=YK[Math.random()*64|0];return e},KK=["name","message","stack","code"],wb=class{constructor(t,e){Yo(this,"_type");this.payload=t,this.meta=e}},r_=class{constructor(t,e){Yo(this,"_type");this.payload=t,this.meta=e}},QK=t=>{if(typeof t=="object"&&t!==null){const e={};for(const r of KK)typeof t[r]=="string"&&(e[r]=t[r]);return e}return{message:String(t)}},n_="External signal was aborted",Qe=(()=>{function t(e,r,n){const a=Ul(e+"/fulfilled",(l,u,c,d)=>({payload:l,meta:{...d||{},arg:c,requestId:u,requestStatus:"fulfilled"}})),i=Ul(e+"/pending",(l,u,c)=>({payload:void 0,meta:{...c||{},arg:u,requestId:l,requestStatus:"pending"}})),s=Ul(e+"/rejected",(l,u,c,d,f)=>({payload:d,error:(n&&n.serializeError||QK)(l||"Rejected"),meta:{...f||{},arg:c,requestId:u,rejectedWithValue:!!d,requestStatus:"rejected",aborted:(l==null?void 0:l.name)==="AbortError",condition:(l==null?void 0:l.name)==="ConditionError"}}));function o(l,{signal:u}={}){return(c,d,f)=>{const v=n!=null&&n.idGenerator?n.idGenerator(l):XK(),p=new AbortController;let y,m;function g(b){m=b,p.abort()}u&&(u.aborted?g(n_):u.addEventListener("abort",()=>g(n_),{once:!0}));const x=async function(){var E,C;let b;try{let S=(E=n==null?void 0:n.condition)==null?void 0:E.call(n,l,{getState:d,extra:f});if(JK(S)&&(S=await S),S===!1||p.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};const T=new Promise((P,A)=>{y=()=>{A({name:"AbortError",message:m||"Aborted"})},p.signal.addEventListener("abort",y,{once:!0})});c(i(v,l,(C=n==null?void 0:n.getPendingMeta)==null?void 0:C.call(n,{requestId:v,arg:l},{getState:d,extra:f}))),b=await Promise.race([T,Promise.resolve(r(l,{dispatch:c,getState:d,extra:f,requestId:v,signal:p.signal,abort:g,rejectWithValue:(P,A)=>new wb(P,A),fulfillWithValue:(P,A)=>new r_(P,A)})).then(P=>{if(P instanceof wb)throw P;return P instanceof r_?a(P.payload,v,l,P.meta):a(P,v,l)})])}catch(S){b=S instanceof wb?s(null,v,l,S.payload,S.meta):s(S,v,l)}finally{y&&p.signal.removeEventListener("abort",y)}return n&&!n.dispatchConditionRejection&&s.match(b)&&b.meta.condition||c(b),b}();return Object.assign(x,{abort:g,requestId:v,arg:l,unwrap(){return x.then(ZK)}})}}return Object.assign(o,{pending:i,rejected:s,fulfilled:a,settled:WK(s,a),typePrefix:e})}return t.withTypes=()=>t,t})();function ZK(t){if(t.meta&&t.meta.rejectedWithValue)throw t.payload;if(t.error)throw t.error;return t.payload}function JK(t){return t!==null&&typeof t=="object"&&typeof t.then=="function"}var eQ=Symbol.for("rtk-slice-createasyncthunk");function tQ(t,e){return`${t}/${e}`}function rQ({creators:t}={}){var r;const e=(r=t==null?void 0:t.asyncThunk)==null?void 0:r[eQ];return function(a){const{name:i,reducerPath:s=i}=a;if(!i)throw new Error(Ra(11));typeof process<"u";const o=(typeof a.reducers=="function"?a.reducers(aQ()):a.reducers)||{},l=Object.keys(o),u={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},c={addCase(w,E){const C=typeof w=="string"?w:w.type;if(!C)throw new Error(Ra(12));if(C in u.sliceCaseReducersByType)throw new Error(Ra(13));return u.sliceCaseReducersByType[C]=E,c},addMatcher(w,E){return u.sliceMatchers.push({matcher:w,reducer:E}),c},exposeAction(w,E){return u.actionCreators[w]=E,c},exposeCaseReducer(w,E){return u.sliceCaseReducersByName[w]=E,c}};l.forEach(w=>{const E=o[w],C={reducerName:w,type:tQ(i,w),createNotation:typeof a.reducers=="function"};sQ(E)?lQ(C,E,c,e):iQ(C,E,c)});function d(){const[w={},E=[],C=void 0]=typeof a.extraReducers=="function"?CB(a.extraReducers):[a.extraReducers],S={...w,...u.sliceCaseReducersByType};return GK(a.initialState,T=>{for(let P in S)T.addCase(P,S[P]);for(let P of u.sliceMatchers)T.addMatcher(P.matcher,P.reducer);for(let P of E)T.addMatcher(P.matcher,P.reducer);C&&T.addDefaultCase(C)})}const f=w=>w,v=new Map,p=new WeakMap;let y;function m(w,E){return y||(y=d()),y(w,E)}function g(){return y||(y=d()),y.getInitialState()}function x(w,E=!1){function C(T){let P=T[w];return typeof P>"u"&&E&&(P=Bc(p,C,g)),P}function S(T=f){const P=Bc(v,E,()=>new WeakMap);return Bc(P,T,()=>{const A={};for(const[j,R]of Object.entries(a.selectors??{}))A[j]=nQ(R,T,()=>Bc(p,T,g),E);return A})}return{reducerPath:w,getSelectors:S,get selectors(){return S(C)},selectSlice:C}}const b={name:i,reducer:m,actions:u.actionCreators,caseReducers:u.sliceCaseReducersByName,getInitialState:g,...x(s),injectInto(w,{reducerPath:E,...C}={}){const S=E??s;return w.inject({reducerPath:S,reducer:m},C),{...b,...x(S,!0)}}};return b}}function nQ(t,e,r,n){function a(i,...s){let o=e(i);return typeof o>"u"&&n&&(o=r()),t(o,...s)}return a.unwrapped=t,a}var va=rQ();function aQ(){function t(e,r){return{_reducerDefinitionType:"asyncThunk",payloadCreator:e,...r}}return t.withTypes=()=>t,{reducer(e){return Object.assign({[e.name](...r){return e(...r)}}[e.name],{_reducerDefinitionType:"reducer"})},preparedReducer(e,r){return{_reducerDefinitionType:"reducerWithPrepare",prepare:e,reducer:r}},asyncThunk:t}}function iQ({type:t,reducerName:e,createNotation:r},n,a){let i,s;if("reducer"in n){if(r&&!oQ(n))throw new Error(Ra(17));i=n.reducer,s=n.prepare}else i=n;a.addCase(t,i).exposeCaseReducer(e,i).exposeAction(e,s?Ul(t,s):Ul(t))}function sQ(t){return t._reducerDefinitionType==="asyncThunk"}function oQ(t){return t._reducerDefinitionType==="reducerWithPrepare"}function lQ({type:t,reducerName:e},r,n,a){if(!a)throw new Error(Ra(18));const{payloadCreator:i,fulfilled:s,pending:o,rejected:l,settled:u,options:c}=r,d=a(t,i,c);n.exposeAction(e,d),s&&n.addCase(d.fulfilled,s),o&&n.addCase(d.pending,o),l&&n.addCase(d.rejected,l),u&&n.addMatcher(d.settled,u),n.exposeCaseReducer(e,{fulfilled:s||zc,pending:o||zc,rejected:l||zc,settled:u||zc})}function zc(){}function Ra(t){return`Minified Redux Toolkit error #${t}; visit https://redux-toolkit.js.org/Errors?code=${t} for the full message or use the non-minified dev environment for full errors. `}class uQ{constructor(){Object.defineProperty(this,"registrations",{enumerable:!0,configurable:!0,writable:!0,value:new Map}),Object.defineProperty(this,"locked",{enumerable:!0,configurable:!0,writable:!0,value:!1})}register(e){if(this.locked)throw new Error(`Cannot register middleware "${e.id}" - store already created. Register middleware during plugin initialization phase.`);this.registrations.has(e.id)&&console.warn(`[MiddlewareRegistry] Middleware "${e.id}" already registered, overwriting.`),this.registrations.set(e.id,{priority:0,...e})}unregister(e){if(this.locked)throw new Error("Cannot unregister middleware after store creation");this.registrations.delete(e)}getAll(){return Array.from(this.registrations.values()).sort((r,n)=>(n.priority||0)-(r.priority||0)).map(r=>r.middleware)}has(e){return this.registrations.has(e)}getInfo(e){return this.registrations.get(e)}getAllRegistrations(){return Array.from(this.registrations.values()).sort((e,r)=>(r.priority||0)-(e.priority||0))}lock(){this.locked=!0}}class cQ{constructor(e){Object.defineProperty(this,"reducers",{enumerable:!0,configurable:!0,writable:!0,value:new Map}),Object.defineProperty(this,"onReducerChange",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.onReducerChange=e}register(e,r,n=!1){if(!n&&this.reducers.has(e)){console.warn(`[ReducerRegistry] Reducer "${e}" already registered. Use replace=true to override.`);return}this.reducers.set(e,{key:e,reducer:r,registeredAt:new Date}),this.onReducerChange&&this.onReducerChange(this.getCombinedReducer())}unregister(e){this.reducers.delete(e),this.onReducerChange&&this.onReducerChange(this.getCombinedReducer())}getAll(){const e={};return this.reducers.forEach((r,n)=>{e[n]=r.reducer}),e}getCombinedReducer(){const e=this.getAll();return Object.keys(e).length===0?(r={})=>r:cB(e)}has(e){return this.reducers.has(e)}getInfo(e){return this.reducers.get(e)}getAllRegistrations(){return Array.from(this.reducers.values())}}class dQ{constructor(){Object.defineProperty(this,"store",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"middlewareRegistry",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"reducerRegistry",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"initialized",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"fileSystemAdapter",{enumerable:!0,configurable:!0,writable:!0,value:null}),this.middlewareRegistry=new uQ,this.reducerRegistry=new cQ(e=>{this.store&&this.store.replaceReducer(e)})}getMiddlewareRegistry(){return this.middlewareRegistry}getReducerRegistry(){return this.reducerRegistry}setFileSystemAdapter(e){this.fileSystemAdapter=e}getFileSystemAdapter(){return this.fileSystemAdapter}isInitialized(){return this.initialized}initialize(e={}){if(this.initialized)throw new Error("[StoreManager] Store already initialized");const r=this.middlewareRegistry.getAll();this.middlewareRegistry.lock();const n=this.reducerRegistry.getCombinedReducer(),a=e.enhancers||[];return this.store=$K({reducer:n,preloadedState:e.preloadedState,middleware:i=>i({thunk:!1,serializableCheck:!1,immutableCheck:!1,actionCreatorCheck:!1}).concat(...r),enhancers:i=>i().concat(a),devTools:e.devTools!==!1?{trace:!0,traceLimit:25}:!1}),this.initialized=!0,console.log("[StoreManager] Store initialized with:",{reducers:this.reducerRegistry.getAllRegistrations().map(i=>i.key),middleware:this.middlewareRegistry.getAllRegistrations().map(i=>({id:i.id,priority:i.priority,plugin:i.plugin})),devTools:e.devTools!==!1}),this.store}getStore(){if(!this.store)throw new Error("[StoreManager] Store not initialized. Call initialize() first.");return this.store}dispatch(e){return this.getStore().dispatch(e)}getState(){return this.getStore().getState()}subscribe(e){return this.getStore().subscribe(e)}replaceReducer(e){this.getStore().replaceReducer(e)}destroy(){this.store=null,this.initialized=!1,console.log("[StoreManager] Store destroyed")}}function fQ(t){return e=>r=>n=>{t==null||t.emit("redux:action:before",{action:n,state:e.getState()});const a=r(n);return t==null||t.emit("redux:action:after",{action:n,state:e.getState()}),n!=null&&n.type&&(t==null||t.emit(`redux:action:${n.type}`,n)),a}}class hQ{constructor(){Object.defineProperty(this,"entries",{enumerable:!0,configurable:!0,writable:!0,value:[]})}register(e,r){var i;const n=!!((i=r.middleware)!=null&&i.length),a=!!(r.reducers&&Object.keys(r.reducers).length);!n&&!a||this.entries.push({source:e,extensions:{middleware:r.middleware,reducers:r.reducers}})}drain(){const e=this.entries;return this.entries=[],e}}function vQ(t,e){if(t)return{plugin:t.plugin??e,...t}}function pQ(t,e,r){t.drain().forEach(({source:a,extensions:i})=>{var s;(s=i.middleware)==null||s.forEach(o=>{const l=vQ(o,a);l&&e.register(l)}),i.reducers&&Object.entries(i.reducers).forEach(([o,l])=>{r.register(o,l)})})}function gQ(){return new hQ}var NB=Symbol.for("immer-nothing"),a_=Symbol.for("immer-draftable"),tn=Symbol.for("immer-state");function bn(t,...e){throw new Error(`[Immer] minified error nr: ${t}. Full error at: https://bit.ly/3cXEKWf`)}var Eu=Object.getPrototypeOf;function Xn(t){return!!t&&!!t[tn]}function gs(t){var e;return t?TB(t)||Array.isArray(t)||!!t[a_]||!!((e=t.constructor)!=null&&e[a_])||rc(t)||Mh(t):!1}var mQ=Object.prototype.constructor.toString(),i_=new WeakMap;function TB(t){if(!t||typeof t!="object")return!1;const e=Object.getPrototypeOf(t);if(e===null||e===Object.prototype)return!0;const r=Object.hasOwnProperty.call(e,"constructor")&&e.constructor;if(r===Object)return!0;if(typeof r!="function")return!1;let n=i_.get(r);return n===void 0&&(n=Function.toString.call(r),i_.set(r,n)),n===mQ}function DS(t){return Xn(t)||bn(15,t),t[tn].base_}function bf(t,e,r=!0){Oh(t)===0?(r?Reflect.ownKeys(t):Object.keys(t)).forEach(a=>{e(a,t[a],t)}):t.forEach((n,a)=>e(a,n,t))}function Oh(t){const e=t[tn];return e?e.type_:Array.isArray(t)?1:rc(t)?2:Mh(t)?3:0}function gw(t,e){return Oh(t)===2?t.has(e):Object.prototype.hasOwnProperty.call(t,e)}function RB(t,e,r){const n=Oh(t);n===2?t.set(e,r):n===3?t.add(r):t[e]=r}function yQ(t,e){return t===e?t!==0||1/t===1/e:t!==t&&e!==e}function rc(t){return t instanceof Map}function Mh(t){return t instanceof Set}function Hi(t){return t.copy_||t.base_}function mw(t,e){if(rc(t))return new Map(t);if(Mh(t))return new Set(t);if(Array.isArray(t))return Array.prototype.slice.call(t);const r=TB(t);if(e===!0||e==="class_only"&&!r){const n=Object.getOwnPropertyDescriptors(t);delete n[tn];let a=Reflect.ownKeys(n);for(let i=0;i<a.length;i++){const s=a[i],o=n[s];o.writable===!1&&(o.writable=!0,o.configurable=!0),(o.get||o.set)&&(n[s]={configurable:!0,writable:!0,enumerable:o.enumerable,value:t[s]})}return Object.create(Eu(t),n)}else{const n=Eu(t);if(n!==null&&r)return{...t};const a=Object.create(n);return Object.assign(a,t)}}function _S(t,e=!1){return Ih(t)||Xn(t)||!gs(t)||(Oh(t)>1&&Object.defineProperties(t,{set:qc,add:qc,clear:qc,delete:qc}),Object.freeze(t),e&&Object.values(t).forEach(r=>_S(r,!0))),t}function xQ(){bn(2)}var qc={value:xQ};function Ih(t){return t===null||typeof t!="object"?!0:Object.isFrozen(t)}var bQ={};function ms(t){const e=bQ[t];return e||bn(0,t),e}var Su;function PB(){return Su}function wQ(t,e){return{drafts_:[],parent_:t,immer_:e,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function s_(t,e){e&&(ms("Patches"),t.patches_=[],t.inversePatches_=[],t.patchListener_=e)}function yw(t){xw(t),t.drafts_.forEach(EQ),t.drafts_=null}function xw(t){t===Su&&(Su=t.parent_)}function o_(t){return Su=wQ(Su,t)}function EQ(t){const e=t[tn];e.type_===0||e.type_===1?e.revoke_():e.revoked_=!0}function l_(t,e){e.unfinalizedDrafts_=e.drafts_.length;const r=e.drafts_[0];return t!==void 0&&t!==r?(r[tn].modified_&&(yw(e),bn(4)),gs(t)&&(t=wf(e,t),e.parent_||Ef(e,t)),e.patches_&&ms("Patches").generateReplacementPatches_(r[tn].base_,t,e.patches_,e.inversePatches_)):t=wf(e,r,[]),yw(e),e.patches_&&e.patchListener_(e.patches_,e.inversePatches_),t!==NB?t:void 0}function wf(t,e,r){if(Ih(e))return e;const n=t.immer_.shouldUseStrictIteration(),a=e[tn];if(!a)return bf(e,(i,s)=>u_(t,a,e,i,s,r),n),e;if(a.scope_!==t)return e;if(!a.modified_)return Ef(t,a.base_,!0),a.base_;if(!a.finalized_){a.finalized_=!0,a.scope_.unfinalizedDrafts_--;const i=a.copy_;let s=i,o=!1;a.type_===3&&(s=new Set(i),i.clear(),o=!0),bf(s,(l,u)=>u_(t,a,i,l,u,r,o),n),Ef(t,i,!1),r&&t.patches_&&ms("Patches").generatePatches_(a,r,t.patches_,t.inversePatches_)}return a.copy_}function u_(t,e,r,n,a,i,s){if(a==null||typeof a!="object"&&!s)return;const o=Ih(a);if(!(o&&!s)){if(Xn(a)){const l=i&&e&&e.type_!==3&&!gw(e.assigned_,n)?i.concat(n):void 0,u=wf(t,a,l);if(RB(r,n,u),Xn(u))t.canAutoFreeze_=!1;else return}else s&&r.add(a);if(gs(a)&&!o){if(!t.immer_.autoFreeze_&&t.unfinalizedDrafts_<1||e&&e.base_&&e.base_[n]===a&&o)return;wf(t,a),(!e||!e.scope_.parent_)&&typeof n!="symbol"&&(rc(r)?r.has(n):Object.prototype.propertyIsEnumerable.call(r,n))&&Ef(t,a)}}}function Ef(t,e,r=!1){!t.parent_&&t.immer_.autoFreeze_&&t.canAutoFreeze_&&_S(e,r)}function SQ(t,e){const r=Array.isArray(t),n={type_:r?1:0,scope_:e?e.scope_:PB(),modified_:!1,finalized_:!1,assigned_:{},parent_:e,base_:t,draft_:null,copy_:null,revoke_:null,isManual_:!1};let a=n,i=jS;r&&(a=[n],i=Cu);const{revoke:s,proxy:o}=Proxy.revocable(a,i);return n.draft_=o,n.revoke_=s,o}var jS={get(t,e){if(e===tn)return t;const r=Hi(t);if(!gw(r,e))return CQ(t,r,e);const n=r[e];return t.finalized_||!gs(n)?n:n===Eb(t.base_,e)?(Sb(t),t.copy_[e]=ww(n,t)):n},has(t,e){return e in Hi(t)},ownKeys(t){return Reflect.ownKeys(Hi(t))},set(t,e,r){const n=AB(Hi(t),e);if(n!=null&&n.set)return n.set.call(t.draft_,r),!0;if(!t.modified_){const a=Eb(Hi(t),e),i=a==null?void 0:a[tn];if(i&&i.base_===r)return t.copy_[e]=r,t.assigned_[e]=!1,!0;if(yQ(r,a)&&(r!==void 0||gw(t.base_,e)))return!0;Sb(t),bw(t)}return t.copy_[e]===r&&(r!==void 0||e in t.copy_)||Number.isNaN(r)&&Number.isNaN(t.copy_[e])||(t.copy_[e]=r,t.assigned_[e]=!0),!0},deleteProperty(t,e){return Eb(t.base_,e)!==void 0||e in t.base_?(t.assigned_[e]=!1,Sb(t),bw(t)):delete t.assigned_[e],t.copy_&&delete t.copy_[e],!0},getOwnPropertyDescriptor(t,e){const r=Hi(t),n=Reflect.getOwnPropertyDescriptor(r,e);return n&&{writable:!0,configurable:t.type_!==1||e!=="length",enumerable:n.enumerable,value:r[e]}},defineProperty(){bn(11)},getPrototypeOf(t){return Eu(t.base_)},setPrototypeOf(){bn(12)}},Cu={};bf(jS,(t,e)=>{Cu[t]=function(){return arguments[0]=arguments[0][0],e.apply(this,arguments)}});Cu.deleteProperty=function(t,e){return Cu.set.call(this,t,e,void 0)};Cu.set=function(t,e,r){return jS.set.call(this,t[0],e,r,t[0])};function Eb(t,e){const r=t[tn];return(r?Hi(r):t)[e]}function CQ(t,e,r){var a;const n=AB(e,r);return n?"value"in n?n.value:(a=n.get)==null?void 0:a.call(t.draft_):void 0}function AB(t,e){if(!(e in t))return;let r=Eu(t);for(;r;){const n=Object.getOwnPropertyDescriptor(r,e);if(n)return n;r=Eu(r)}}function bw(t){t.modified_||(t.modified_=!0,t.parent_&&bw(t.parent_))}function Sb(t){t.copy_||(t.copy_=mw(t.base_,t.scope_.immer_.useStrictShallowCopy_))}var NQ=class{constructor(t){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!0,this.produce=(e,r,n)=>{if(typeof e=="function"&&typeof r!="function"){const i=r;r=e;const s=this;return function(l=i,...u){return s.produce(l,c=>r.call(this,c,...u))}}typeof r!="function"&&bn(6),n!==void 0&&typeof n!="function"&&bn(7);let a;if(gs(e)){const i=o_(this),s=ww(e,void 0);let o=!0;try{a=r(s),o=!1}finally{o?yw(i):xw(i)}return s_(i,n),l_(a,i)}else if(!e||typeof e!="object"){if(a=r(e),a===void 0&&(a=e),a===NB&&(a=void 0),this.autoFreeze_&&_S(a,!0),n){const i=[],s=[];ms("Patches").generateReplacementPatches_(e,a,i,s),n(i,s)}return a}else bn(1,e)},this.produceWithPatches=(e,r)=>{if(typeof e=="function")return(s,...o)=>this.produceWithPatches(s,l=>e(l,...o));let n,a;return[this.produce(e,r,(s,o)=>{n=s,a=o}),n,a]},typeof(t==null?void 0:t.autoFreeze)=="boolean"&&this.setAutoFreeze(t.autoFreeze),typeof(t==null?void 0:t.useStrictShallowCopy)=="boolean"&&this.setUseStrictShallowCopy(t.useStrictShallowCopy),typeof(t==null?void 0:t.useStrictIteration)=="boolean"&&this.setUseStrictIteration(t.useStrictIteration)}createDraft(t){gs(t)||bn(8),Xn(t)&&(t=kB(t));const e=o_(this),r=ww(t,void 0);return r[tn].isManual_=!0,xw(e),r}finishDraft(t,e){const r=t&&t[tn];(!r||!r.isManual_)&&bn(9);const{scope_:n}=r;return s_(n,e),l_(void 0,n)}setAutoFreeze(t){this.autoFreeze_=t}setUseStrictShallowCopy(t){this.useStrictShallowCopy_=t}setUseStrictIteration(t){this.useStrictIteration_=t}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(t,e){let r;for(r=e.length-1;r>=0;r--){const a=e[r];if(a.path.length===0&&a.op==="replace"){t=a.value;break}}r>-1&&(e=e.slice(r+1));const n=ms("Patches").applyPatches_;return Xn(t)?n(t,e):this.produce(t,a=>n(a,e))}};function ww(t,e){const r=rc(t)?ms("MapSet").proxyMap_(t,e):Mh(t)?ms("MapSet").proxySet_(t,e):SQ(t,e);return(e?e.scope_:PB()).drafts_.push(r),r}function kB(t){return Xn(t)||bn(10,t),LB(t)}function LB(t){if(!gs(t)||Ih(t))return t;const e=t[tn];let r,n=!0;if(e){if(!e.modified_)return e.base_;e.finalized_=!0,r=mw(t,e.scope_.immer_.useStrictShallowCopy_),n=e.scope_.immer_.shouldUseStrictIteration()}else r=mw(t,!0);return bf(r,(a,i)=>{RB(r,a,LB(i))},n),e&&(e.finalized_=!1),r}var TQ=new NQ,Is=TQ.produce;function c_(t){return t==null?!1:Xn(t)&&typeof DS(t)=="object"||typeof t=="object"}function Uc(t){return t==null?!1:Xn(t)&&Array.isArray(DS(t))||Array.isArray(t)}class RQ{executeDelete(e,r){if(r===void 0)return;const{parent:n,value:a}=r,i=RS(e,n);i!==void 0&&(Uc(i)?a.type==="position"&&i.splice(a.position,1):c_(i)&&a.type==="property"&&i!==null&&delete i[a.propertyName])}executeSet(e,r,n,a){if(r===void 0)return;const{parent:i,value:s}=r,o=mb(e,i,a);o!==void 0&&(Uc(o)?s.type==="position"&&(o[s.position]=n):c_(o)&&s.type==="property"&&o!==null&&(o[s.propertyName]=n))}executeAdd(e,r,n,a){const i=mb(e,r,a);i!==void 0&&Uc(i)&&i.push(n)}executeInsert(e,r,n,a){const{value:i,parent:s}=r;if(i.type==="position"){const o=mb(e,s,a);o!==void 0&&Uc(o)&&o.splice(i.position,0,n)}}rebasePendingCommandOn(e,r){function n(c){const d=[];let f=c;for(;f;)d.push(f.value),f=f.parent;return d.reverse()}function a(c){let d={parent:void 0,value:c[0]};for(let f=1;f<c.length;f++)d={parent:d,value:c[f]};return d}function i(c,d,f){if(f.type!=="position"||c.type!=="position")return f;let{position:v}=f;const{position:p}=c;return d.name==="insert-at"&&v>=p?v+=1:d.name==="delete-at"&&v>p&&(v-=1),v!==f.position?{...f,position:v}:f}const s=n(e.itinerary),o=n(r.itinerary);let l=0;for(;l<s.length&&l<o.length&&qD(s[l],o[l]);)l++;const u=o.slice();for(let c=0;c<s.length;c++)s[c].type==="position"&&o.length>c&&o[c].type==="position"&&s.slice(0,c).every((f,v)=>qD(f,o[v]))&&(u[c]=i(s[c],e,o[c]));return u.length===0?r:{...r,itinerary:a(u)}}executeBatch(e,r){const{commands:n}=r,a=[];for(let i=0;i<n.length;i++){let s=n[i];for(let o=0;o<a.length&&s!=null;o++)s=this.rebasePendingCommandOn(a[o],s);if(s!=null){switch(s.name){case"add-at":this.executeAdd(e,s.itinerary,s.value,s.prototypes);break;case"insert-at":this.executeInsert(e,s.itinerary,s.value,s.prototypes);break;case"set-at":this.executeSet(e,s.itinerary,s.value,s.prototypes);break;case"delete-at":this.executeDelete(e,s.itinerary);break}a.push(s)}}}}function Ew(t,e){if(t===e)return!0;if(t===null||e===null||typeof t!="object"||typeof e!="object"||Array.isArray(t)!==Array.isArray(e))return!1;const r=Object.keys(t),n=Object.keys(e);if(r.length!==n.length)return!1;for(const a of r)if(!n.includes(a)||!Ew(t[a],e[a]))return!1;return!0}function hl(t,e){const r=ql(e);let n=t;for(let a=0;a<r.length;a++){const i=r[a];if(n===void 0)return;if(n.type==="directory")n=n.children[i];else return}return n}function d_(t,e){const r=ro();return e&&(r.extensionStates={...r.extensionStates,...e}),{type:"directory",state:r,name:t,children:{}}}function PQ(t,e,r,n,a){return a&&(n.extensionStates={...n.extensionStates,...a}),{type:"file",name:t,content:e,schema:r,state:n}}class AQ{constructor(){Object.defineProperty(this,"contentCommandHandler",{enumerable:!0,configurable:!0,writable:!0,value:new kQ})}execute(e,r){switch(r.name){case"mkdir":return this.executeMkdir(e,r);case"set-file":return this.executeSetFile(e,r);case"update-file-content":return this.executeContentCommand(e,r);case"set-file-content":return this.executeSetContentCommand(e,r);case"remove":return this.executeRemove(e,r);case"set-extension-state":return this.executeSetExtensionState(e,r)}}executeMkdir(e,r){const{path:n,parents:a,extensionStates:i}=r,s=ql(n);return Is(e,o=>{const{root:l}=o;let u=l;for(let c=0;c<s.length;c++){const d=s[c];if(c+1===s.length)u.children[d]===void 0&&(u.children[d]=d_(d,i));else{let f=u.children[d];if(f===void 0)if(a===!0)f=d_(d),u.children[d]=f;else return;else if(f.type==="directory")u=f;else return;u=f}}})}executeRemove(e,r){const{path:n,recursive:a}=r,i=ql(n);return Is(e,s=>{const{root:o}=s,l=hl(o,i.slice(0,i.length-1));if(l!==void 0&&l.type==="directory"){const u=i[i.length-1],c=l.children[u];if((c==null?void 0:c.type)==="directory"&&Object.keys(c.children).length>0&&a!==!0)return;delete l.children[u]}})}executeSetFile(e,r){const{path:n,content:a,schema:i,override:s,contentIsPresent:o,extensionStates:l}=r,u=ql(n);return Is(e,c=>{const{root:d}=c,f=u.slice(0,u.length-1),v=hl(d,f);if(v!==void 0)if(v.type==="directory"){const p=u[u.length-1];v.children[p]===void 0||s===!0?v.children[p]=PQ(p,a,i,ro(o),l):console.warn("File already exists at location",n)}else console.warn("Parent file is not directory",f)})}executeContentCommand(e,r){const{path:n,contentCommand:a}=r;return Is(e,i=>{const{root:s}=i,o=hl(s,n);o!==void 0?o.type==="file"?(this.contentCommandHandler.execute(o,a),this.contentMayChange(o)):console.warn("Not a file at location",n):console.warn("No file found at location",n)})}contentMayChange(e){if(!Ew(this.original(e.content),this.current(e.content))&&(e.state===void 0&&(e.state=ro()),e.state.contentHistory.push(this.original(e.content)),e.state.memo!==void 0)){const n=e.state.memo;n.modified=!Ew(this.current(n.originalContent),this.current(e.content))}}executeSetContentCommand(e,r){const{path:n,content:a,fromRemote:i}=r;return Is(e,s=>{const{root:o}=s,l=hl(o,n);if(l!==void 0)if(l.type==="file")if(l.content=a,l.state===void 0&&(l.state=ro(!0)),i)if(l.state.contentLoaded=!0,l.state.memo===void 0)l.state.memo={originalContent:{value:a},modified:!1};else{const u=l.state.memo;u.originalContent={value:a},u.modified=!1}else this.contentMayChange(l);else console.warn("Not a file at location",n);else console.warn("No file found at location",n)})}executeSetExtensionState(e,r){const{path:n,key:a,state:i}=r;return Is(e,s=>{const{root:o}=s,l=hl(o,n);if(l!==void 0){l.state===void 0&&(l.state=ro()),l.state.extensionStates===void 0&&(l.state.extensionStates={});const u=l.state.extensionStates[a];l.state.extensionStates[a]={...u,...i}}else console.warn("No node found at location",n)})}current(e){return e==null?e:Xn(e)?kB(e):e}original(e){return e==null?e:Xn(e)?DS(e):e}}class kQ{constructor(){Object.defineProperty(this,"updater",{enumerable:!0,configurable:!0,writable:!0,value:new RQ})}execute(e,r){switch(r.name){case"add-at":this.executeAdd(e,r);break;case"insert-at":this.executeInsert(e,r);break;case"set-at":this.executeSet(e,r);break;case"delete-at":this.executeDelete(e,r);break;case"batch-update":this.executeBatch(e,r);break}}executeDelete(e,r){const{itinerary:n}=r;n===void 0&&(e.content=void 0);const{content:a}=e;this.updater.executeDelete(a,n)}executeSet(e,r){const{itinerary:n,value:a}=r;n===void 0&&(e.content=a);const{content:i}=e;this.updater.executeSet(i,n,a)}executeAdd(e,r){const{itinerary:n,value:a}=r,{content:i}=e;this.updater.executeAdd(i,n,a)}executeInsert(e,r){const{itinerary:n,value:a}=r;if(n===void 0)return;const{content:i}=e;this.updater.executeInsert(i,n,a)}executeBatch(e,r){const{content:n}=e;this.updater.executeBatch(n,r)}}function LQ(t){return new DQ(t)}class DQ{constructor(e){Object.defineProperty(this,"sliceName",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"actions",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"commandHandler",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"reducer",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.actions=new _Q(e),this.commandHandler=new AQ,this.reducer=(r=this.getInitialState(),n)=>this.actions.isFileSystemNodeAction(n)?this.commandHandler.execute(r,n.command):r}getInitialState(){return{root:{type:"directory",name:"",children:{},state:ro()}}}getActions(){return this.actions}getReducer(e){return e===void 0?this.reducer:(r,n)=>this.reducer(e(r,n),n)}createSelector(e,r){const n=pw(e,i=>i==null?void 0:i.root),a=ql(r);return a===void 0||a.length===0?n:a.reduce((i,s)=>pw(i,o=>o===void 0||o.type==="file"?o:o.children[s]),n)}}class _Q{constructor(e){Object.defineProperty(this,"sliceName",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"_mkdirType",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_setFileType",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_removeType",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_updateFileContentType",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_setFileContentType",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_setExtensionStateType",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"actionTypeSet",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._mkdirType=`${this.sliceName}/createDirectoryNode`,this._setFileType=`${this.sliceName}/createFileNode`,this._removeType=`${this.sliceName}/removeNode`,this._updateFileContentType=`${this.sliceName}/updateFileContent`,this._setFileContentType=`${this.sliceName}/setFileContent`,this._setExtensionStateType=`${this.sliceName}/setExtensionState`,this.actionTypeSet=new Set([this._mkdirType,this._setFileType,this._removeType,this._updateFileContentType,this._setFileContentType,this._setExtensionStateType])}get mkdirType(){return this._mkdirType}get setFileType(){return this._setFileType}get removeType(){return this._removeType}get updateFileContentType(){return this._updateFileContentType}get setFileContentType(){return this._setFileContentType}get setExtensionStateType(){return this._setExtensionStateType}isFileSystemNodeAction(e){return this.actionTypeSet.has(e.type)}mkdir(e,r,n){return{type:this.mkdirType,command:{name:"mkdir",path:e,parents:r,extensionStates:n}}}setFile(e,r,n,a={override:!0,contentIsPresent:!0}){const{override:i,contentIsPresent:s,extensionStates:o}=a;return{type:this.setFileType,command:{name:"set-file",path:e,content:r,schema:n,override:i,contentIsPresent:s,extensionStates:o}}}updateFileContent(e,r){return{type:this.updateFileContentType,command:{name:"update-file-content",path:e,contentCommand:r}}}setFileContent(e,r,n=!1){return{type:this.setFileContentType,command:{name:"set-file-content",path:e,content:r,fromRemote:n}}}removeNode(e,r){return{type:this.removeType,command:{name:"remove",path:e,recursive:r}}}setExtensionState(e,r,n){return{type:this.setExtensionStateType,command:{name:"set-extension-state",path:e,key:r,state:n}}}}const jQ="FILESYSTEM_ADAPTER";function OQ(t={}){const e=new dQ,r=e.getMiddlewareRegistry(),n=e.getReducerRegistry(),a=gQ(),i=LQ("fs"),s=l=>{a.register("ui-store:event-bridge",{middleware:[{id:"event-bridge",middleware:fQ(l),priority:1e3,plugin:"ui-store",description:"Bridges Redux actions to microkernel events"}]}),t.logger},o=()=>{var l;if((l=t.middleware)!=null&&l.length){const u=t.middleware.map(c=>({...c,plugin:c.plugin??"ui-store-config"}));a.register("ui-store-config:middleware",{middleware:u})}if(t.middlewareFactory){const u=t.middlewareFactory(i);u!=null&&u.length&&a.register("ui-store-config:middleware-factory",{middleware:u.map(c=>({...c,plugin:c.plugin??"ui-store-config"}))})}t.reducers&&Object.keys(t.reducers).length&&a.register("ui-store-config:reducers",{reducers:t.reducers})};return{async initialize(l){e.setFileSystemAdapter(i),n.register("fs",i.getReducer()),l.provide({provide:TS,useValue:e}),l.provide({provide:tK,useValue:r}),l.provide({provide:oB,useValue:n}),l.provide({provide:lB,useValue:a}),l.provide({provide:jQ,useValue:i}),s(l.hooks),o(),console.log("[ui-store] Plugin initialized with filesystem support")},async activate(l){pQ(a,r,n);const u=e.initialize({devTools:t.devTools});u.subscribe(()=>{l.hooks.emit("redux:state-changed",u.getState())}),l.hooks.emit("ui-store:ready",{store:u}),console.log("[ui-store] Plugin activated")},async deactivate(){e.destroy(),console.log("[ui-store] Plugin deactivated")}}}function MQ(){return OQ({devTools:!1,logger:!1})}const IQ=Symbol("Shell"),FQ=Symbol("ThemeManager"),BQ=Symbol("FeatureManager"),zQ=Symbol("LayoutManager"),qi={SET_THEME:"shell.setTheme",TOGGLE_THEME:"shell.toggleTheme",ENABLE_FEATURE:"shell.enableFeature",DISABLE_FEATURE:"shell.disableFeature",TOGGLE_FEATURE:"shell.toggleFeature",NAVIGATE:"shell.navigate",NAVIGATE_BACK:"shell.navigateBack"},vl={READY:"shell:ready",THEME_CHANGED:"shell:theme-changed",FEATURE_TOGGLED:"shell:feature-toggled",ROUTE_CHANGED:"shell:route-changed",VIEWPORT_RESIZED:"shell:viewport-resized"},f_="ui-shell-theme";class qQ{constructor(e={mode:"system"},r,n){Object.defineProperty(this,"currentTheme",{enumerable:!0,configurable:!0,writable:!0,value:"system"}),Object.defineProperty(this,"config",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"listeners",{enumerable:!0,configurable:!0,writable:!0,value:new Set}),Object.defineProperty(this,"storageProvider",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"themeProvider",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.config=e,this.storageProvider=r,this.themeProvider=n,this.currentTheme=e.mode||this.loadPersistedTheme(),this.setupSystemThemeListener(),this.applyTheme()}getTheme(){return this.currentTheme}getResolvedTheme(){return this.currentTheme==="system"?this.themeProvider.getSystemPreference():this.currentTheme}setTheme(e){this.currentTheme!==e&&(this.currentTheme=e,this.persistTheme(e),this.applyTheme(),this.notifyListeners())}toggleTheme(){const e=this.getResolvedTheme();this.setTheme(e==="light"?"dark":"light")}subscribe(e){return this.listeners.add(e),()=>this.listeners.delete(e)}setCSSVariables(e){this.config.cssVariables={...this.config.cssVariables,...e},this.applyTheme()}destroy(){this.themeProvider.destroy(),this.listeners.clear()}setupSystemThemeListener(){this.themeProvider.onSystemThemeChange(()=>{this.currentTheme==="system"&&(this.applyTheme(),this.notifyListeners())})}applyTheme(){this.themeProvider.applyTheme(this.currentTheme,this.config)}loadPersistedTheme(){const e=this.storageProvider.getItem(f_);return e==="light"||e==="dark"||e==="system"?e:"system"}persistTheme(e){this.storageProvider.setItem(f_,e)}notifyListeners(){this.listeners.forEach(e=>e(this.currentTheme))}}class UQ{constructor(e={}){Object.defineProperty(this,"features",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"listeners",{enumerable:!0,configurable:!0,writable:!0,value:new Map}),this.features={...e}}isEnabled(e){const r=this.features[e];return typeof r=="boolean"?r:!!r}get(e,r){const n=this.features[e];return n!==void 0?n:r}set(e,r){this.features[e]!==r&&(this.features[e]=r,this.notifyListeners(e,r))}enable(e){this.set(e,!0)}disable(e){this.set(e,!1)}toggle(e){this.set(e,!this.isEnabled(e))}update(e){Object.entries(e).forEach(([r,n])=>{this.set(r,n)})}getAll(){return{...this.features}}has(e){return e in this.features}subscribe(e,r){return this.listeners.has(e)||this.listeners.set(e,new Set),this.listeners.get(e).add(r),()=>{const n=this.listeners.get(e);n&&(n.delete(r),n.size===0&&this.listeners.delete(e))}}subscribeAll(e){const r=[];return Object.keys(this.features).forEach(a=>{const i=this.subscribe(a,s=>e(a,s));r.push(i)}),()=>{r.forEach(a=>a())}}destroy(){this.listeners.clear()}notifyListeners(e,r){const n=this.listeners.get(e);n&&n.forEach(a=>a(r))}}class $Q{getItem(e){if(!this.isAvailable())return null;try{return localStorage.getItem(e)}catch(r){return console.warn("Failed to get item from localStorage:",r),null}}setItem(e,r){if(this.isAvailable())try{localStorage.setItem(e,r)}catch(n){console.warn("Failed to set item in localStorage:",n)}}removeItem(e){if(this.isAvailable())try{localStorage.removeItem(e)}catch(r){console.warn("Failed to remove item from localStorage:",r)}}clear(){if(this.isAvailable())try{localStorage.clear()}catch(e){console.warn("Failed to clear localStorage:",e)}}isAvailable(){return typeof localStorage<"u"}}class VQ{constructor(){Object.defineProperty(this,"mediaQuery",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"listeners",{enumerable:!0,configurable:!0,writable:!0,value:new Set}),Object.defineProperty(this,"handleMediaQueryChange",{enumerable:!0,configurable:!0,writable:!0,value:()=>{const e=this.getSystemPreference();this.listeners.forEach(r=>r(e))}})}applyTheme(e,r){if(typeof document>"u")return;const n=e==="system"?this.getSystemPreference():e;document.documentElement.setAttribute("data-theme",n),document.documentElement.style.colorScheme=n,r.cssVariables&&Object.entries(r.cssVariables).forEach(([a,i])=>{document.documentElement.style.setProperty(a,i)})}getSystemPreference(){return typeof window>"u"?"light":window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}onSystemThemeChange(e){return typeof window>"u"?()=>{}:(this.listeners.add(e),this.mediaQuery||(this.mediaQuery=window.matchMedia("(prefers-color-scheme: dark)"),this.mediaQuery.addEventListener("change",this.handleMediaQueryChange)),()=>{this.listeners.delete(e)})}destroy(){var e;(e=this.mediaQuery)==null||e.removeEventListener("change",this.handleMediaQueryChange),this.listeners.clear()}}class GQ{constructor(e={}){Object.defineProperty(this,"themeManager",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"featureManager",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"router",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"eventListeners",{enumerable:!0,configurable:!0,writable:!0,value:new Map}),Object.defineProperty(this,"viewportState",{enumerable:!0,configurable:!0,writable:!0,value:{width:typeof window<"u"?window.innerWidth:0,height:typeof window<"u"?window.innerHeight:0}}),Object.defineProperty(this,"config",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"isReady",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"handleResize",{enumerable:!0,configurable:!0,writable:!0,value:()=>{typeof window>"u"||(this.viewportState.width=window.innerWidth,this.viewportState.height=window.innerHeight,this.emit("viewport:resized",{width:this.viewportState.width,height:this.viewportState.height}))}}),this.config=e;const r=new $Q,n=new VQ;this.themeManager=new qQ(e.theme,r,n),this.featureManager=new UQ(e.features),this.setupViewportListener()}async initialize(){if(this.isReady){console.warn("Shell is already initialized");return}this.themeManager.setTheme(this.themeManager.getTheme()),this.themeManager.subscribe(e=>{this.emit("theme:changed",{theme:e})}),this.featureManager.subscribeAll((e,r)=>{this.emit("feature:toggled",{key:e,value:r})}),this.isReady=!0,this.emit("shell:ready",{})}getContext(){return{theme:this.themeManager.getTheme(),setTheme:e=>this.themeManager.setTheme(e),features:this.featureManager.getAll(),isFeatureEnabled:e=>this.featureManager.isEnabled(e),getFeature:(e,r)=>this.featureManager.get(e,r),viewport:{width:this.viewportState.width,height:this.viewportState.height,isMobile:this.viewportState.width<768,isTablet:this.viewportState.width>=768&&this.viewportState.width<1024,isDesktop:this.viewportState.width>=1024}}}getThemeManager(){return this.themeManager}getFeatureManager(){return this.featureManager}getRouter(){return this.router}setRouter(e){this.router=e,this.router.subscribe(r=>{this.emit("route:changed",{route:r})})}emit(e,r){const n={type:e,payload:r,timestamp:Date.now()},a=this.eventListeners.get(e);a&&a.forEach(s=>s(n));const i=this.eventListeners.get("*");i&&i.forEach(s=>s(n))}on(e,r){return this.eventListeners.has(e)||this.eventListeners.set(e,new Set),this.eventListeners.get(e).add(r),()=>{const n=this.eventListeners.get(e);n&&(n.delete(r),n.size===0&&this.eventListeners.delete(e))}}off(e,r){const n=this.eventListeners.get(e);n&&n.delete(r)}ready(){return this.isReady}getConfig(){return{...this.config}}destroy(){this.themeManager.destroy(),this.featureManager.destroy(),this.router&&this.router.destroy(),typeof window<"u"&&window.removeEventListener("resize",this.handleResize),this.eventListeners.clear(),this.isReady=!1}setupViewportListener(){typeof window>"u"||window.addEventListener("resize",this.handleResize)}}class HQ{constructor(){Object.defineProperty(this,"slots",{enumerable:!0,configurable:!0,writable:!0,value:new Map}),Object.defineProperty(this,"listeners",{enumerable:!0,configurable:!0,writable:!0,value:new Set})}registerSlot(e){const r=e.area;return this.slots.has(r)||this.slots.set(r,new Set),this.slots.get(r).add(e),this.notifyListeners(),()=>this.unregisterSlot(e)}unregisterSlot(e){const r=e.area,n=this.slots.get(r);n&&(n.delete(e),n.size===0&&this.slots.delete(r),this.notifyListeners())}getSlots(e){const r=this.slots.get(e);return r?Array.from(r).sort((n,a)=>{const i=n.priority||0;return(a.priority||0)-i}):[]}getAreas(){return Array.from(this.slots.keys())}hasSlots(e){const r=this.slots.get(e);return!!(r&&r.size>0)}subscribe(e){return this.listeners.add(e),()=>this.listeners.delete(e)}clear(){this.slots.clear(),this.notifyListeners()}destroy(){this.slots.clear(),this.listeners.clear()}notifyListeners(){this.listeners.forEach(e=>e())}}function WQ(t){let e,r;return{initialize(n){e=new GQ(t),r=new HQ,n.provide({provide:IQ,useValue:e}),n.provide({provide:FQ,useValue:e.getThemeManager()}),n.provide({provide:BQ,useValue:e.getFeatureManager()}),n.provide({provide:zQ,useValue:r}),n.commands.register(qi.SET_THEME,a=>{e.getThemeManager().setTheme(a)}),n.commands.register(qi.TOGGLE_THEME,()=>{e.getThemeManager().toggleTheme()}),n.commands.register(qi.ENABLE_FEATURE,a=>{e.getFeatureManager().enable(a)}),n.commands.register(qi.DISABLE_FEATURE,a=>{e.getFeatureManager().disable(a)}),n.commands.register(qi.TOGGLE_FEATURE,a=>{e.getFeatureManager().toggle(a)}),n.commands.register(qi.NAVIGATE,a=>{const i=e.getRouter();if(!i){console.warn("Router not initialized");return}return i.push(a)}),n.commands.register(qi.NAVIGATE_BACK,()=>{const a=e.getRouter();if(!a){console.warn("Router not initialized");return}a.back()}),e.on("shell:ready",()=>n.hooks.emit(vl.READY,{})),e.on("theme:changed",a=>n.hooks.emit(vl.THEME_CHANGED,a.payload)),e.on("feature:toggled",a=>n.hooks.emit(vl.FEATURE_TOGGLED,a.payload)),e.on("route:changed",a=>n.hooks.emit(vl.ROUTE_CHANGED,a.payload)),e.on("viewport:resized",a=>n.hooks.emit(vl.VIEWPORT_RESIZED,a.payload))},async activate(n){await e.initialize();const a=e.getContext();n.hooks.emit("shell:activated",{context:a})},deactivate(){e.destroy(),r.destroy()}}}function YQ(){const t=WQ({theme:{mode:"system"},features:{visualization:!0,diagrams:!0,versionControl:!0,search:!0,flatViews:!0}});return{async initialize(e){await t.initialize(e)},async activate(e){await t.activate(e),e.hooks.on("shell:theme-changed",r=>{const n=r==="system"?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":r;document.documentElement.setAttribute("data-theme",n)})},async deactivate(){t.deactivate&&await t.deactivate()}}}class XQ{async login(e,r){return await Or.login(e,r)}logout(){Or.logout()}async getCurrentUser(){return await Or.getCurrentUser()}isAuthenticated(){return Or.isAuthenticated()}}const KQ=Symbol("AuthService");function QQ(){const t=new XQ;return{async initialize(e){e.provide({provide:KQ,useValue:t})},async activate(e){if(t.isAuthenticated())try{e.hooks.emit("auth:session-restored")}catch(r){console.warn("[auth] Failed to restore session:",r)}},async deactivate(){}}}function ZQ(){return{async initialize(t){t.views.register("routes.data-dictionary",()=>({routes:["/packages/**","/services/**","/dictionaries/**","/create"]})),t.commands.register("data-dictionary.refresh",async()=>{t.hooks.emit("data-dictionary:refresh-requested")})},async activate(t){console.log("[data-dictionary] Plugin activated")}}}function JQ(){return{async initialize(t){t.views.register("routes.visualization",()=>({routes:["/visualization/**","/diagram/**","/organization-diagram"]}))},async activate(t){console.log("[visualization] Plugin activated")}}}function eZ(){return{async initialize(t){t.views.register("routes.search",()=>({routes:["/search","/entities/flat","/flat/**","/tree/**"]}))},async activate(t){console.log("[search] Plugin activated")}}}function tZ(){return{async initialize(t){t.views.register("routes.version-control",()=>({routes:["/version/**"]})),t.commands.register("version.commit",async e=>{t.hooks.emit("version:commit-requested",{message:e})})},async activate(t){console.log("[version-control] Plugin activated")}}}var Sr;(function(t){t.LS_REQUEST="[Remote FS] List/Request",t.LS_COMPLETED="[Remote FS] List/Completed",t.LS_FAILED="[Remote FS] List/Failed",t.MKDIR_REQUEST="[Remote FS] Make Directory/Request",t.MKDIR_COMPLETED="[Remote FS] Make Directory/Completed",t.MKDIR_FAILED="[Remote FS] Make Directory/Failed",t.GET_REQUEST="[Remote FS] Get/Request",t.GET_COMPLETED="[Remote FS] Get/Completed",t.GET_FAILED="[Remote FS] Get/Failed",t.POST_REQUEST="[Remote FS] Post/Request",t.POST_COMPLETED="[Remote FS] Post/Completed",t.POST_FAILED="[Remote FS] Post/Failed",t.PUT_REQUEST="[Remote FS] Put/Request",t.PUT_COMPLETED="[Remote FS] Put/Completed",t.PUT_FAILED="[Remote FS] Put/Failed",t.DELETE_REQUEST="[Remote FS] Delete/Request",t.DELETE_COMPLETED="[Remote FS] Delete/Completed",t.DELETE_FAILED="[Remote FS] Delete/Failed"})(Sr||(Sr={}));const rZ=Symbol.for("@hamak/ui-remote-fs:workspace-client"),nZ=Symbol.for("@hamak/ui-remote-fs:path-translator");class aZ{constructor(e){Object.defineProperty(this,"mountPoint",{enumerable:!0,configurable:!0,writable:!0,value:e})}toRemotePath(e){let r=Array.isArray(e)?Ye.of(e):e;if(this.mountPoint.isAbsolute()&&!r.isAbsolute()&&(r=Ye.ofRoot().resolve(r)),!!this.isUnderMountPoint(r))return this.mountPoint.relativize(r)}toLocalPath(e){const r=Array.isArray(e)?Ye.of(e):e;return this.mountPoint.resolve(r)}isUnderMountPoint(e){let r=Array.isArray(e)?Ye.of(e):e;this.mountPoint.isAbsolute()&&!r.isAbsolute()&&(r=Ye.ofRoot().resolve(r));const n=r.getSegments(),a=this.mountPoint.getSegments();return n.length===a.length&&n.every((s,o)=>s===a[o])?!0:this.mountPoint.isDescendant(r)}getMountPoint(){return this.mountPoint}formatPath(e,r="/"){return(Array.isArray(e)?e:e.getSegments()).join(r)}}class iZ{constructor(){Object.defineProperty(this,"types",{enumerable:!0,configurable:!0,writable:!0,value:Sr})}ofLsRequest(e,r){return{type:this.types.LS_REQUEST,payload:{path:e,options:r}}}ofLsCompleted(e,r){return{type:this.types.LS_COMPLETED,payload:{data:e,request:r}}}ofLsFailed(e,r){return{type:this.types.LS_FAILED,payload:{error:e,request:r}}}ofMkdirRequest(e,r){return{type:this.types.MKDIR_REQUEST,payload:{path:e,options:r}}}ofMkdirCompleted(e,r){return{type:this.types.MKDIR_COMPLETED,payload:{data:e,request:r}}}ofMkdirFailed(e,r){return{type:this.types.MKDIR_FAILED,payload:{error:e,request:r}}}ofGetRequest(e,r){return{type:this.types.GET_REQUEST,payload:{path:e,options:r}}}ofGetCompleted(e,r){return{type:this.types.GET_COMPLETED,payload:{data:e,request:r}}}ofGetFailed(e,r){return{type:this.types.GET_FAILED,payload:{error:e,request:r}}}ofPostRequest(e,r,n){return{type:this.types.POST_REQUEST,payload:{path:e,content:r,options:n}}}ofPostCompleted(e,r){return{type:this.types.POST_COMPLETED,payload:{data:e,request:r}}}ofPostFailed(e,r){return{type:this.types.POST_FAILED,payload:{error:e,request:r}}}ofPutRequest(e,r,n){return{type:this.types.PUT_REQUEST,payload:{path:e,content:r,options:n}}}ofPutCompleted(e,r){return{type:this.types.PUT_COMPLETED,payload:{data:e,request:r}}}ofPutFailed(e,r){return{type:this.types.PUT_FAILED,payload:{error:e,request:r}}}ofDeleteRequest(e,r){return{type:this.types.DELETE_REQUEST,payload:{path:e,options:r}}}ofDeleteCompleted(e,r){return{type:this.types.DELETE_COMPLETED,payload:{data:e,request:r}}}ofDeleteFailed(e,r){return{type:this.types.DELETE_FAILED,payload:{error:e,request:r}}}isRemoteFsAction(e){return e&&typeof e=="object"&&"type"in e&&Object.values(Sr).includes(e.type)}}const $r=new iZ;function sZ(t){const{client:e,pathTranslator:r,onError:n,onSuccess:a}=t,i=l=>{const u=Array.isArray(l)?Ye.of(l):Ye.of([l]);return r.toRemotePath(u)},s=l=>l&&typeof l=="object"&&"code"in l&&"message"in l?l:{code:(l==null?void 0:l.code)||"UNKNOWN",message:(l==null?void 0:l.message)||"Unknown error"};return l=>u=>c=>{const d=u(c),f=l.dispatch,v=c;switch(v.type){case Sr.LS_REQUEST:{const p=v,y=i(p.payload.path);if(y===void 0)break;(async()=>{try{const m=await e.listFiles(y.getSegments(),p.payload.options),g=$r.ofLsCompleted(m,p);f(g),a==null||a(m,g)}catch(m){const g=s(m),x=$r.ofLsFailed(g,p);f(x),n==null||n(g,x)}})();break}case Sr.MKDIR_REQUEST:{const p=v,y=i(p.payload.path);if(y===void 0)break;(async()=>{try{const m=await e.createDirectory(y.getSegments(),p.payload.options),g=$r.ofMkdirCompleted(m,p);f(g),a==null||a(m,g)}catch(m){const g=s(m),x=$r.ofMkdirFailed(g,p);f(x),n==null||n(g,x)}})();break}case Sr.GET_REQUEST:{const p=v,y=i(p.payload.path);if(y===void 0)break;(async()=>{try{const m=await e.readFile(y.getSegments(),p.payload.options),g=$r.ofGetCompleted(m,p);f(g),a==null||a(m,g)}catch(m){const g=s(m),x=$r.ofGetFailed(g,p);f(x),n==null||n(g,x)}})();break}case Sr.POST_REQUEST:{const p=v,y=i(p.payload.path);if(y===void 0)break;(async()=>{try{const m=await e.putFile(y.getSegments(),p.payload.content,p.payload.options),g=$r.ofPostCompleted(m,p);f(g),a==null||a(m,g)}catch(m){const g=s(m),x=$r.ofPostFailed(g,p);f(x),n==null||n(g,x)}})();break}case Sr.PUT_REQUEST:{const p=v,y=i(p.payload.path);if(y===void 0)break;(async()=>{try{const m=await e.putFile(y.getSegments(),p.payload.content,p.payload.options),g=$r.ofPutCompleted(m,p);f(g),a==null||a(m,g)}catch(m){const g=s(m),x=$r.ofPutFailed(g,p);f(x),n==null||n(g,x)}})();break}case Sr.DELETE_REQUEST:{const p=v,y=i(p.payload.path);if(y===void 0)break;(async()=>{try{const m=await e.deleteFile(y.getSegments(),p.payload.options),g=$r.ofDeleteCompleted(m,p);f(g),a==null||a(m,g)}catch(m){const g=s(m),x=$r.ofDeleteFailed(g,p);f(x),n==null||n(g,x)}})();break}}return d}}function oZ(t){const{fileSystemAdapter:e,autoReload:r=!0,transformContent:n}=t,a=e.getActions();return s=>o=>l=>{const u=o(l),c=l;if(!$r.isRemoteFsAction(c))return u;const d=s.dispatch;switch(c.type){case Sr.LS_COMPLETED:{const f=c,{request:v,data:p}=f.payload;p==null||p.forEach(y=>{const m=Ye.of(v.payload.path).resolve(y.name).getSegments();y.isDirectory?d(a.mkdir(m,!0,y.extensions)):d(a.setFile(m,void 0,"xs:any",{override:!0,contentIsPresent:!1,extensionStates:y.extensions}))});break}case Sr.MKDIR_COMPLETED:{const f=c,{request:v}=f.payload,p=Ye.of(v.payload.path).getSegments();d(a.mkdir(p,!0));break}case Sr.GET_COMPLETED:{const f=c,{request:v,data:p}=f.payload,y=Ye.of(v.payload.path).getSegments();let m=p.content===void 0||p.content===null||p.content===""?void 0:JSON.parse(p.content);m!==void 0&&n&&(m=n(m));const g=e.createSelector(x=>x.fileSystem,y)(s.getState());g===void 0?d(a.setFile(y,m,"xs:any",{override:!0,contentIsPresent:!0})):(g==null?void 0:g.type)==="file"&&d(a.setFileContent(y,m,!0));break}case Sr.POST_COMPLETED:case Sr.PUT_COMPLETED:{const f=c,{request:v}=f.payload,p=Ye.of(v.payload.path).getSegments();r&&d($r.ofGetRequest(p));break}case Sr.DELETE_COMPLETED:{const f=c,{request:v}=f.payload,p=Ye.of(v.payload.path).getSegments();d(a.removeNode(p));break}}return u}}class lZ{constructor(e){Object.defineProperty(this,"workspaceId",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"baseUrl",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"axios",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.workspaceId=e.workspaceId,this.baseUrl=e.baseUrl||(typeof globalThis<"u"&&"location"in globalThis?`${globalThis.location.protocol}//${globalThis.location.host}/api`:"/api"),this.axios=e.axiosInstance||lu.create({baseURL:this.baseUrl,timeout:e.timeout||3e4,headers:{"Content-Type":"application/json"}})}formatPath(e){return e.join("/")}buildUrl(e,r){if(!(r!=null&&r.queryParams))return e;const n=new URLSearchParams;for(const[i,s]of Object.entries(r.queryParams))s!==void 0&&(Array.isArray(s)?s.forEach(o=>n.append(i,String(o))):n.append(i,String(s)));const a=n.toString();return a?`${e}?${a}`:e}handleError(e){var n,a,i,s;if(lu.isAxiosError(e)){const o=e;throw(a=(n=o.response)==null?void 0:n.data)!=null&&a.error?o.response.data.error:{code:o.code||"UNKNOWN",message:o.message||"Unknown error occurred",params:{status:(i=o.response)==null?void 0:i.status,statusText:(s=o.response)==null?void 0:s.statusText}}}throw{code:"UNKNOWN",message:e instanceof Error?e.message:"Unknown error occurred"}}serializeContent(e){return typeof e=="string"?e:JSON.stringify(e)}async listFiles(e,r){try{const n=this.formatPath(e),a=this.buildUrl(`/${this.workspaceId}/files/${n}`,r);return(await this.axios.get(a)).data}catch(n){this.handleError(n)}}async createDirectory(e,r){try{const n=this.formatPath(e),a=this.buildUrl(`/${this.workspaceId}/mkdir/${n}`,r);return(await this.axios.post(a)).data}catch(n){this.handleError(n)}}async readFile(e,r){try{const n=this.formatPath(e),a=this.buildUrl(`/${this.workspaceId}/read/${n}`,r);return(await this.axios.get(a)).data}catch(n){this.handleError(n)}}async putFile(e,r,n){try{const a=this.formatPath(e),i=this.serializeContent(r),s=this.buildUrl(`/${this.workspaceId}/put/${a}`,n);return(await this.axios.put(s,{content:i})).data}catch(a){this.handleError(a)}}async deleteFile(e,r){try{const n=this.formatPath(e),a=this.buildUrl(`/${this.workspaceId}/delete/${n}`,r);return(await this.axios.delete(a)).data}catch(n){this.handleError(n)}}getWorkspaceId(){return this.workspaceId}getBaseUrl(){return this.baseUrl}}const uZ=Symbol("StoreManager"),cZ=Symbol("StoreExtensions");function dZ(t){let e,r,n;const a=(i,...s)=>{t.debug&&console.log(`[ui-remote-fs] ${i}`,...s)};return{async initialize(i){if(a("Initializing plugin..."),t.customClient)e=t.customClient,a("Using custom workspace client");else{const s={workspaceId:t.workspaceId,baseUrl:t.baseUrl,timeout:t.timeout};e=new lZ(s),a("Created HTTP workspace client",{baseUrl:t.baseUrl,workspaceId:t.workspaceId})}t.customPathTranslator?(r=t.customPathTranslator,a("Using custom path translator")):(r=new aZ(t.mountPoint),a("Created path translator",{mountPoint:t.mountPoint.getSegments()})),i.provide({provide:rZ,useValue:e}),i.provide({provide:nZ,useValue:r}),a("Plugin initialized")},async activate(i){a("Activating plugin...");try{n=i.resolve(uZ)}catch{throw new Error("[ui-remote-fs] Store manager not found. Ensure @hamak/ui-store plugin is loaded before ui-remote-fs.")}const s=n.getFileSystemAdapter();if(!s)throw new Error("[ui-remote-fs] File system adapter not found in store manager.");const o=i.resolve(cZ),l=sZ({client:e,pathTranslator:r,onError:(d,f)=>{a("Remote FS error:",d,f),i.hooks.emit("ui-remote-fs:error",{error:d,action:f})},onSuccess:(d,f)=>{a("Remote FS success:",f.type),i.hooks.emit("ui-remote-fs:success",{result:d,action:f})}}),u=oZ({fileSystemAdapter:s,pathTranslator:r,autoReload:t.autoReload,transformContent:t.transformContent}),c=[{id:"remote-fs",middleware:l,priority:100,plugin:"ui-remote-fs",description:"Handles remote filesystem operations via HTTP"},{id:"store-sync",middleware:u,priority:50,plugin:"ui-remote-fs",description:"Synchronizes remote FS to Redux Store FS"}];o.register("ui-remote-fs:middleware",{middleware:c}),a("Middleware registered"),i.hooks.emit("ui-remote-fs:ready",{workspaceClient:e,pathTranslator:r,mountPoint:t.mountPoint}),a("Plugin activated")},async deactivate(){a("Plugin deactivated")}}}function fZ(){return dZ({workspaceId:"dictionaries",mountPoint:Ye.ofRoot().resolve("dictionaries"),baseUrl:"/fs",autoReload:!0,debug:!1})}const hZ=Symbol("GIT_CLIENT_TOKEN"),vZ=Symbol("GIT_PATH_TRANSLATOR_TOKEN");var qe;(function(t){t.STATUS_REQUEST="[Git] Status/Request",t.STATUS_COMPLETED="[Git] Status/Completed",t.STATUS_FAILED="[Git] Status/Failed",t.LIST_BRANCHES_REQUEST="[Git] List Branches/Request",t.LIST_BRANCHES_COMPLETED="[Git] List Branches/Completed",t.LIST_BRANCHES_FAILED="[Git] List Branches/Failed",t.CHECKOUT_REQUEST="[Git] Checkout/Request",t.CHECKOUT_COMPLETED="[Git] Checkout/Completed",t.CHECKOUT_FAILED="[Git] Checkout/Failed",t.CREATE_BRANCH_REQUEST="[Git] Create Branch/Request",t.CREATE_BRANCH_COMPLETED="[Git] Create Branch/Completed",t.CREATE_BRANCH_FAILED="[Git] Create Branch/Failed",t.STAGE_REQUEST="[Git] Stage/Request",t.STAGE_COMPLETED="[Git] Stage/Completed",t.STAGE_FAILED="[Git] Stage/Failed",t.UNSTAGE_REQUEST="[Git] Unstage/Request",t.UNSTAGE_COMPLETED="[Git] Unstage/Completed",t.UNSTAGE_FAILED="[Git] Unstage/Failed",t.COMMIT_REQUEST="[Git] Commit/Request",t.COMMIT_COMPLETED="[Git] Commit/Completed",t.COMMIT_FAILED="[Git] Commit/Failed",t.PULL_REQUEST="[Git] Pull/Request",t.PULL_COMPLETED="[Git] Pull/Completed",t.PULL_FAILED="[Git] Pull/Failed",t.PUSH_REQUEST="[Git] Push/Request",t.PUSH_COMPLETED="[Git] Push/Completed",t.PUSH_FAILED="[Git] Push/Failed",t.FETCH_REQUEST="[Git] Fetch/Request",t.FETCH_COMPLETED="[Git] Fetch/Completed",t.FETCH_FAILED="[Git] Fetch/Failed",t.DIFF_REQUEST="[Git] Diff/Request",t.DIFF_COMPLETED="[Git] Diff/Completed",t.DIFF_FAILED="[Git] Diff/Failed",t.LOG_REQUEST="[Git] Log/Request",t.LOG_COMPLETED="[Git] Log/Completed",t.LOG_FAILED="[Git] Log/Failed",t.SET_EXTENSION_STATE="[Git] Set Extension State",t.CLEAR_EXTENSION_STATE="[Git] Clear Extension State"})(qe||(qe={}));class pZ{constructor(){Object.defineProperty(this,"types",{enumerable:!0,configurable:!0,writable:!0,value:qe})}ofStatusRequest(e){return{type:qe.STATUS_REQUEST,payload:{path:e}}}ofStatusCompleted(e,r){return{type:qe.STATUS_COMPLETED,payload:{data:e,request:r}}}ofStatusFailed(e,r){return{type:qe.STATUS_FAILED,payload:{error:e,request:r}}}ofListBranchesRequest(e){return{type:qe.LIST_BRANCHES_REQUEST,payload:{path:e}}}ofListBranchesCompleted(e,r){return{type:qe.LIST_BRANCHES_COMPLETED,payload:{data:e,request:r}}}ofListBranchesFailed(e,r){return{type:qe.LIST_BRANCHES_FAILED,payload:{error:e,request:r}}}ofCheckoutRequest(e,r,n){return{type:qe.CHECKOUT_REQUEST,payload:{path:e,branch:r,create:n}}}ofCheckoutCompleted(e,r){return{type:qe.CHECKOUT_COMPLETED,payload:{branch:e,request:r}}}ofCheckoutFailed(e,r){return{type:qe.CHECKOUT_FAILED,payload:{error:e,request:r}}}ofCreateBranchRequest(e,r,n){return{type:qe.CREATE_BRANCH_REQUEST,payload:{path:e,branch:r,startPoint:n}}}ofCreateBranchCompleted(e,r){return{type:qe.CREATE_BRANCH_COMPLETED,payload:{branch:e,request:r}}}ofCreateBranchFailed(e,r){return{type:qe.CREATE_BRANCH_FAILED,payload:{error:e,request:r}}}ofStageRequest(e,r){return{type:qe.STAGE_REQUEST,payload:{path:e,files:r}}}ofStageCompleted(e){return{type:qe.STAGE_COMPLETED,payload:{request:e}}}ofStageFailed(e,r){return{type:qe.STAGE_FAILED,payload:{error:e,request:r}}}ofUnstageRequest(e,r){return{type:qe.UNSTAGE_REQUEST,payload:{path:e,files:r}}}ofUnstageCompleted(e){return{type:qe.UNSTAGE_COMPLETED,payload:{request:e}}}ofUnstageFailed(e,r){return{type:qe.UNSTAGE_FAILED,payload:{error:e,request:r}}}ofCommitRequest(e,r){return{type:qe.COMMIT_REQUEST,payload:{path:e,message:r}}}ofCommitCompleted(e,r){return{type:qe.COMMIT_COMPLETED,payload:{data:e,request:r}}}ofCommitFailed(e,r){return{type:qe.COMMIT_FAILED,payload:{error:e,request:r}}}ofPullRequest(e,r,n){return{type:qe.PULL_REQUEST,payload:{path:e,remote:r,branch:n}}}ofPullCompleted(e,r){return{type:qe.PULL_COMPLETED,payload:{data:e,request:r}}}ofPullFailed(e,r){return{type:qe.PULL_FAILED,payload:{error:e,request:r}}}ofPushRequest(e,r,n){return{type:qe.PUSH_REQUEST,payload:{path:e,remote:r,branch:n}}}ofPushCompleted(e){return{type:qe.PUSH_COMPLETED,payload:{request:e}}}ofPushFailed(e,r){return{type:qe.PUSH_FAILED,payload:{error:e,request:r}}}ofFetchRequest(e,r){return{type:qe.FETCH_REQUEST,payload:{path:e,remote:r}}}ofFetchCompleted(e){return{type:qe.FETCH_COMPLETED,payload:{request:e}}}ofFetchFailed(e,r){return{type:qe.FETCH_FAILED,payload:{error:e,request:r}}}ofDiffRequest(e,r,n){return{type:qe.DIFF_REQUEST,payload:{path:e,file:r,staged:n}}}ofDiffCompleted(e,r){return{type:qe.DIFF_COMPLETED,payload:{data:e,request:r}}}ofDiffFailed(e,r){return{type:qe.DIFF_FAILED,payload:{error:e,request:r}}}ofLogRequest(e,r,n){return{type:qe.LOG_REQUEST,payload:{path:e,maxCount:r,file:n}}}ofLogCompleted(e,r){return{type:qe.LOG_COMPLETED,payload:{data:e,request:r}}}ofLogFailed(e,r){return{type:qe.LOG_FAILED,payload:{error:e,request:r}}}ofSetExtensionState(e,r){return{type:qe.SET_EXTENSION_STATE,payload:{path:e,state:r}}}ofClearExtensionState(e){return{type:qe.CLEAR_EXTENSION_STATE,payload:{path:e}}}isGitAction(e){return e!==null&&typeof e=="object"&&"type"in e&&Object.values(qe).includes(e.type)}}const dt=new pZ;class gZ{constructor(e){Object.defineProperty(this,"workspaceId",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"baseUrl",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"axios",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.workspaceId=e.workspaceId,this.baseUrl=e.baseUrl||(typeof window<"u"&&window.location?`${window.location.protocol}//${window.location.host}/api/git`:"/api/git"),this.axios=e.axiosInstance||lu.create({baseURL:this.baseUrl,timeout:e.timeout||3e4,headers:{"Content-Type":"application/json"}})}formatPath(e){return e.join("/")}handleError(e){var n,a,i,s;if(lu.isAxiosError(e)){const o=e;throw(a=(n=o.response)==null?void 0:n.data)!=null&&a.error?o.response.data.error:{code:o.code||"UNKNOWN",message:o.message||"Unknown error occurred",params:{status:(i=o.response)==null?void 0:i.status,statusText:(s=o.response)==null?void 0:s.statusText}}}throw{code:"UNKNOWN",message:e instanceof Error?e.message:"Unknown error occurred"}}async getStatus(e){try{const r=this.formatPath(e);return(await this.axios.get(`/${this.workspaceId}/status/${r}`)).data}catch(r){this.handleError(r)}}async listBranches(e){try{const r=this.formatPath(e);return(await this.axios.get(`/${this.workspaceId}/branches/${r}`)).data}catch(r){this.handleError(r)}}async checkout(e,r,n){try{const a=this.formatPath(e);await this.axios.post(`/${this.workspaceId}/checkout/${a}`,{branch:r,create:n})}catch(a){this.handleError(a)}}async createBranch(e,r,n){try{const a=this.formatPath(e);await this.axios.post(`/${this.workspaceId}/branch/${a}`,{branch:r,startPoint:n})}catch(a){this.handleError(a)}}async stage(e,r){try{const n=this.formatPath(e);await this.axios.post(`/${this.workspaceId}/stage/${n}`,{files:r})}catch(n){this.handleError(n)}}async unstage(e,r){try{const n=this.formatPath(e);await this.axios.post(`/${this.workspaceId}/unstage/${n}`,{files:r})}catch(n){this.handleError(n)}}async commit(e,r){try{const n=this.formatPath(e);return(await this.axios.post(`/${this.workspaceId}/commit/${n}`,{message:r})).data}catch(n){this.handleError(n)}}async pull(e,r,n){try{const a=this.formatPath(e);return(await this.axios.post(`/${this.workspaceId}/pull/${a}`,{remote:r,branch:n})).data}catch(a){this.handleError(a)}}async push(e,r,n){try{const a=this.formatPath(e);await this.axios.post(`/${this.workspaceId}/push/${a}`,{remote:r,branch:n})}catch(a){this.handleError(a)}}async fetch(e,r){try{const n=this.formatPath(e);await this.axios.post(`/${this.workspaceId}/fetch/${n}`,{remote:r})}catch(n){this.handleError(n)}}async diff(e,r,n){try{const a=this.formatPath(e),i=new URLSearchParams;r&&i.set("file",r),n!==void 0&&i.set("staged",String(n));const s=i.toString(),o=`/${this.workspaceId}/diff/${a}${s?`?${s}`:""}`;return(await this.axios.get(o)).data}catch(a){this.handleError(a)}}async log(e,r,n){try{const a=this.formatPath(e),i=new URLSearchParams;r!==void 0&&i.set("maxCount",String(r)),n&&i.set("file",n);const s=i.toString(),o=`/${this.workspaceId}/log/${a}${s?`?${s}`:""}`;return(await this.axios.get(o)).data}catch(a){this.handleError(a)}}getWorkspaceId(){return this.workspaceId}getBaseUrl(){return this.baseUrl}}class mZ{constructor(e){Object.defineProperty(this,"mountPoint",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"enabled",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"repoRootPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.mountPoint=e.mountPoint,this.enabled=e.enabled??!0,this.repoRootPath=e.repoRootPath}toRemotePath(e){const r=Array.isArray(e)?Ye.of(e):e;if(!this.isUnderMountPoint(r))return;const n=this.mountPoint.getSegments(),i=r.getSegments().slice(n.length);return Ye.of(i)}toLocalPath(e){const r=Array.isArray(e)?Ye.of(e):e,n=this.mountPoint.getSegments(),a=r.getSegments();return Ye.of([...n,...a])}isUnderMountPoint(e){const r=Array.isArray(e)?Ye.of(e):e,n=this.mountPoint.getSegments(),a=r.getSegments();if(a.length<n.length)return!1;for(let i=0;i<n.length;i++)if(a[i]!==n[i])return!1;return!0}isGitEnabled(e){return this.enabled&&this.isUnderMountPoint(e)}getMountPoint(){return this.mountPoint}getRepoRootPath(){return this.repoRootPath}formatPath(e,r="/"){return(Array.isArray(e)?Ye.of(e):e).getSegments().join(r)}}function yZ(t){const{client:e,pathTranslator:r,onError:n,onSuccess:a}=t,i=l=>{const u=Array.isArray(l)?Ye.of(l):Ye.of([l]);return r.toRemotePath(u)},s=l=>l&&typeof l=="object"&&"code"in l&&"message"in l?l:{code:(l==null?void 0:l.code)||"UNKNOWN",message:(l==null?void 0:l.message)||"Unknown error"};return l=>u=>c=>{const d=u(c),f=l.dispatch,v=c;switch(v.type){case qe.STATUS_REQUEST:{const p=v,y=i(p.payload.path);if(y===void 0)break;(async()=>{try{const m=await e.getStatus(y.getSegments()),g=dt.ofStatusCompleted(m,p);f(g),a==null||a(m,g)}catch(m){const g=s(m),x=dt.ofStatusFailed(g,p);f(x),n==null||n(g,x)}})();break}case qe.LIST_BRANCHES_REQUEST:{const p=v,y=i(p.payload.path);if(y===void 0)break;(async()=>{try{const m=await e.listBranches(y.getSegments()),g=dt.ofListBranchesCompleted(m,p);f(g),a==null||a(m,g)}catch(m){const g=s(m),x=dt.ofListBranchesFailed(g,p);f(x),n==null||n(g,x)}})();break}case qe.CHECKOUT_REQUEST:{const p=v,y=i(p.payload.path);if(y===void 0)break;(async()=>{try{await e.checkout(y.getSegments(),p.payload.branch,p.payload.create);const m=dt.ofCheckoutCompleted(p.payload.branch,p);f(m),a==null||a(p.payload.branch,m)}catch(m){const g=s(m),x=dt.ofCheckoutFailed(g,p);f(x),n==null||n(g,x)}})();break}case qe.CREATE_BRANCH_REQUEST:{const p=v,y=i(p.payload.path);if(y===void 0)break;(async()=>{try{await e.createBranch(y.getSegments(),p.payload.branch,p.payload.startPoint);const m=dt.ofCreateBranchCompleted(p.payload.branch,p);f(m),a==null||a(p.payload.branch,m)}catch(m){const g=s(m),x=dt.ofCreateBranchFailed(g,p);f(x),n==null||n(g,x)}})();break}case qe.STAGE_REQUEST:{const p=v,y=i(p.payload.path);if(y===void 0)break;(async()=>{try{await e.stage(y.getSegments(),p.payload.files);const m=dt.ofStageCompleted(p);f(m),a==null||a(null,m)}catch(m){const g=s(m),x=dt.ofStageFailed(g,p);f(x),n==null||n(g,x)}})();break}case qe.UNSTAGE_REQUEST:{const p=v,y=i(p.payload.path);if(y===void 0)break;(async()=>{try{await e.unstage(y.getSegments(),p.payload.files);const m=dt.ofUnstageCompleted(p);f(m),a==null||a(null,m)}catch(m){const g=s(m),x=dt.ofUnstageFailed(g,p);f(x),n==null||n(g,x)}})();break}case qe.COMMIT_REQUEST:{const p=v,y=i(p.payload.path);if(y===void 0)break;(async()=>{try{const m=await e.commit(y.getSegments(),p.payload.message),g=dt.ofCommitCompleted(m,p);f(g),a==null||a(m,g)}catch(m){const g=s(m),x=dt.ofCommitFailed(g,p);f(x),n==null||n(g,x)}})();break}case qe.PULL_REQUEST:{const p=v,y=i(p.payload.path);if(y===void 0)break;(async()=>{try{const m=await e.pull(y.getSegments(),p.payload.remote,p.payload.branch),g=dt.ofPullCompleted(m,p);f(g),a==null||a(m,g)}catch(m){const g=s(m),x=dt.ofPullFailed(g,p);f(x),n==null||n(g,x)}})();break}case qe.PUSH_REQUEST:{const p=v,y=i(p.payload.path);if(y===void 0)break;(async()=>{try{await e.push(y.getSegments(),p.payload.remote,p.payload.branch);const m=dt.ofPushCompleted(p);f(m),a==null||a(null,m)}catch(m){const g=s(m),x=dt.ofPushFailed(g,p);f(x),n==null||n(g,x)}})();break}case qe.FETCH_REQUEST:{const p=v,y=i(p.payload.path);if(y===void 0)break;(async()=>{try{await e.fetch(y.getSegments(),p.payload.remote);const m=dt.ofFetchCompleted(p);f(m),a==null||a(null,m)}catch(m){const g=s(m),x=dt.ofFetchFailed(g,p);f(x),n==null||n(g,x)}})();break}case qe.DIFF_REQUEST:{const p=v,y=i(p.payload.path);if(y===void 0)break;(async()=>{try{const m=await e.diff(y.getSegments(),p.payload.file,p.payload.staged),g=dt.ofDiffCompleted(m,p);f(g),a==null||a(m,g)}catch(m){const g=s(m),x=dt.ofDiffFailed(g,p);f(x),n==null||n(g,x)}})();break}case qe.LOG_REQUEST:{const p=v,y=i(p.payload.path);if(y===void 0)break;(async()=>{try{const m=await e.log(y.getSegments(),p.payload.maxCount,p.payload.file),g=dt.ofLogCompleted(m,p);f(g),a==null||a(m,g)}catch(m){const g=s(m),x=dt.ofLogFailed(g,p);f(x),n==null||n(g,x)}})();break}}return d}}function xZ(t){const e=(n,a,i)=>{n(dt.ofSetExtensionState(a,i))};return n=>a=>i=>{var u;const s=a(i),o=i,l=n.dispatch;if(!dt.isGitAction(o))return s;switch(o.type){case qe.STATUS_COMPLETED:{const c=o,{request:d,data:f}=c.payload,v=Ye.of(d.payload.path).getSegments(),p={gitEnabled:!0,loading:!1,error:void 0,lastFetched:Date.now(),repoInfo:{isRepo:!0,repoRoot:".",branch:f.branch,remotes:[],hasUncommittedChanges:f.hasUncommittedChanges}};e(l,v,p),(u=f.files)==null||u.forEach(y=>{const m=Ye.of(d.payload.path).resolve(y.path).getSegments(),g={gitEnabled:!0,loading:!1,fileStatus:{status:y.status,staged:y.staged,conflicted:y.status==="conflicted"}};e(l,m,g)});break}case qe.STATUS_FAILED:{const c=o,{request:d,error:f}=c.payload,v=Ye.of(d.payload.path).getSegments(),p={gitEnabled:!0,loading:!1,error:{code:f.code,message:f.message},lastFetched:Date.now()};e(l,v,p);break}case qe.LIST_BRANCHES_COMPLETED:{const c=o,{request:d,data:f}=c.payload,v=Ye.of(d.payload.path).getSegments(),p={repoInfo:{isRepo:!0,repoRoot:".",branch:{current:f.current,ahead:0,behind:0},remotes:f.remote.map(y=>y.replace(/^remotes\//,"").split("/")[0]).filter((y,m,g)=>g.indexOf(y)===m),hasUncommittedChanges:!1}};e(l,v,p);break}case qe.CHECKOUT_COMPLETED:{const c=o,{request:d}=c.payload,f=Ye.of(d.payload.path).getSegments();l(dt.ofStatusRequest(f));break}case qe.COMMIT_COMPLETED:{const c=o,{request:d}=c.payload,f=Ye.of(d.payload.path).getSegments();l(dt.ofStatusRequest(f));break}case qe.PULL_COMPLETED:{const c=o,{request:d}=c.payload,f=Ye.of(d.payload.path).getSegments();l(dt.ofStatusRequest(f));break}case qe.STAGE_COMPLETED:case qe.UNSTAGE_COMPLETED:{const{request:c}=o.payload,d=Ye.of(c.payload.path).getSegments();l(dt.ofStatusRequest(d));break}case qe.SET_EXTENSION_STATE:break;case qe.CLEAR_EXTENSION_STATE:break}return s}}function bZ(t){let e,r,n;const a=(i,...s)=>{t.debug&&console.log(`[ui-remote-git-fs] ${i}`,...s)};return{async initialize(i){a("Initializing plugin..."),t.customClient?(e=t.customClient,a("Using custom Git client")):(e=new gZ({workspaceId:t.workspaceId,baseUrl:t.gitApiBaseUrl,timeout:t.timeout}),a("Created HTTP Git client",{baseUrl:t.gitApiBaseUrl,workspaceId:t.workspaceId})),t.customPathTranslator?(r=t.customPathTranslator,a("Using custom path translator")):(r=new mZ(t),a("Created path translator",{mountPoint:t.mountPoint.getSegments()})),i.provide({provide:hZ,useValue:e}),i.provide({provide:vZ,useValue:r}),a("Plugin initialized")},async activate(i){a("Activating plugin...");try{n=i.resolve(TS)}catch{throw new Error("[ui-remote-git-fs] Store manager not found. Ensure @hamak/ui-store plugin is loaded before ui-remote-git-fs.")}if(!n.getFileSystemAdapter())throw new Error("[ui-remote-git-fs] File system adapter not found in store manager.");const o=i.resolve(lB),l=yZ({client:e,pathTranslator:r,onError:(d,f)=>{a("Git error:",d,f),i.hooks.emit("ui-remote-git-fs:error",{error:d,action:f})},onSuccess:(d,f)=>{a("Git success:",f.type),i.hooks.emit("ui-remote-git-fs:success",{result:d,action:f})}}),u=xZ(),c=[{id:"git-ops",middleware:l,priority:40,plugin:"ui-remote-git-fs",description:"Handles Git operations via HTTP"},{id:"git-sync",middleware:u,priority:30,plugin:"ui-remote-git-fs",description:"Synchronizes Git state to FileSystemNode extension states"}];o.register("ui-remote-git-fs:middleware",{middleware:c}),a("Middleware registered"),i.hooks.emit("ui-remote-git-fs:ready",{gitClient:e,pathTranslator:r,mountPoint:t.mountPoint,enabled:t.enabled??!0}),a("Plugin activated")},async deactivate(){a("Plugin deactivated")}}}function wZ(){return bZ({workspaceId:"dictionaries",mountPoint:Ye.ofRoot().resolve("dictionaries"),gitApiBaseUrl:"/api/git",debug:!1})}const EZ=Symbol("NotificationService");class SZ{constructor(){Yo(this,"listeners",[]);Yo(this,"counter",0)}notify(e,r,n=5e3){const a={id:`notif-${++this.counter}`,type:e,message:r,duration:n};this.listeners.forEach(i=>i(a))}subscribe(e){return this.listeners.push(e),()=>{this.listeners=this.listeners.filter(r=>r!==e)}}success(e){this.notify("success",e)}error(e){this.notify("error",e)}warning(e){this.notify("warning",e)}info(e){this.notify("info",e)}}function CZ(){const t=new SZ;return{async initialize(e){e.provide({provide:EZ,useValue:t}),e.commands.register("notification.success",r=>t.success(r)),e.commands.register("notification.error",r=>t.error(r)),e.commands.register("notification.warning",r=>t.warning(r)),e.commands.register("notification.info",r=>t.info(r))},async activate(){console.log("[notification] Plugin activated")}}}function NZ(){return{async initialize(t){t.views.register("routes.perspective",()=>({routes:["/perspectives/**"]})),t.commands.register("perspective.refresh",async()=>{t.hooks.emit("perspective:refresh-requested")})},async activate(t){console.log("[perspective] Plugin activated")}}}const TZ={user:null,token:localStorage.getItem("auth_token"),isAuthenticated:!!localStorage.getItem("auth_token"),loading:!1,error:null},Cb=Qe("auth/login",async({username:t,password:e})=>await Or.login(t,e)),Nb=Qe("auth/fetchCurrentUser",async()=>await Or.getCurrentUser()),DB=va({name:"auth",initialState:TZ,reducers:{logout(t){Or.logout(),t.user=null,t.token=null,t.isAuthenticated=!1,t.error=null},clearError(t){t.error=null}},extraReducers:t=>{t.addCase(Cb.pending,e=>{e.loading=!0,e.error=null}).addCase(Cb.fulfilled,(e,r)=>{e.loading=!1,e.token=r.payload.token,e.user=r.payload.user,e.isAuthenticated=!0}).addCase(Cb.rejected,(e,r)=>{e.loading=!1,e.error=r.error.message||"Login failed"}).addCase(Nb.pending,e=>{e.loading=!0}).addCase(Nb.fulfilled,(e,r)=>{e.loading=!1,e.user=r.payload}).addCase(Nb.rejected,(e,r)=>{e.loading=!1,e.error=r.error.message||"Failed to fetch user"})}});DB.actions;const RZ=DB.reducer,PZ={services:[],packages:[],serviceEntities:{},loading:!1,error:null},Tb=Qe("services/fetchAll",async()=>await at.getAllServices()),AZ=Qe("services/fetchEntities",async t=>{const e=await at.getServiceEntities(t);return{service:t,entities:e}}),kZ=Qe("services/fetchAllPackages",async()=>await xi.getAllPackages()),LZ=va({name:"services",initialState:PZ,reducers:{},extraReducers:t=>{t.addCase(Tb.pending,e=>{e.loading=!0,e.error=null}).addCase(Tb.fulfilled,(e,r)=>{e.loading=!1,e.services=r.payload}).addCase(Tb.rejected,(e,r)=>{e.loading=!1,e.error=r.error.message||"Failed to fetch services"}).addCase(AZ.fulfilled,(e,r)=>{e.serviceEntities[r.payload.service]=r.payload.entities}).addCase(kZ.fulfilled,(e,r)=>{e.packages=r.payload})}}),DZ=LZ.reducer,_Z={current:null,flatEntities:[],loading:!1,error:null},Rb=Qe("entity/fetch",async({service:t,entity:e})=>await at.getEntitySchema(t,e)),jZ=Qe("entity/create",async({service:t,entityData:e})=>await at.createEntity(t,e)),OZ=Qe("entity/update",async({service:t,entity:e,entityData:r})=>await at.updateEntity(t,e,r));Qe("entity/delete",async({service:t,entity:e})=>(await at.deleteEntity(t,e),{service:t,entity:e}));const Pb=Qe("entity/fetchFlat",async t=>await xi.getFlatEntities(t)),_B=va({name:"entity",initialState:_Z,reducers:{clearCurrentEntity(t){t.current=null}},extraReducers:t=>{t.addCase(Rb.pending,e=>{e.loading=!0,e.error=null}).addCase(Rb.fulfilled,(e,r)=>{e.loading=!1,e.current=r.payload}).addCase(Rb.rejected,(e,r)=>{e.loading=!1,e.error=r.error.message||"Failed to fetch entity"}).addCase(jZ.fulfilled,(e,r)=>{e.current=r.payload}).addCase(OZ.fulfilled,(e,r)=>{e.current=r.payload}).addCase(Pb.pending,e=>{e.loading=!0}).addCase(Pb.fulfilled,(e,r)=>{e.loading=!1,e.flatEntities=r.payload}).addCase(Pb.rejected,(e,r)=>{e.loading=!1,e.error=r.error.message||"Failed to fetch flat entities"})}});_B.actions;const MZ=_B.reducer,IZ={dictionaries:[],current:null,loading:!1,error:null},Ab=Qe("dictionary/fetchAll",async()=>await Do.getAllDictionaries()),FZ=Qe("dictionary/fetch",async t=>await Do.getDictionaryById(t)),BZ=Qe("dictionary/create",async t=>await Do.createDictionary(t));Qe("dictionary/update",async({id:t,data:e})=>await Do.updateDictionary(t,e));const zZ=Qe("dictionary/delete",async t=>(await Do.deleteDictionary(t),t)),jB=va({name:"dictionary",initialState:IZ,reducers:{clearCurrentDictionary(t){t.current=null}},extraReducers:t=>{t.addCase(Ab.pending,e=>{e.loading=!0,e.error=null}).addCase(Ab.fulfilled,(e,r)=>{e.loading=!1,e.dictionaries=r.payload}).addCase(Ab.rejected,(e,r)=>{e.loading=!1,e.error=r.error.message||"Failed to fetch dictionaries"}).addCase(FZ.fulfilled,(e,r)=>{e.current=r.payload}).addCase(BZ.fulfilled,(e,r)=>{e.dictionaries.push(r.payload)}).addCase(zZ.fulfilled,(e,r)=>{e.dictionaries=e.dictionaries.filter(n=>n.id!==r.payload)})}});jB.actions;const qZ=jB.reducer,UZ={layouts:[],current:null,loading:!1,error:null},kb=Qe("diagram/fetchLayouts",async t=>await Ca.listDiagramLayouts(t)),$Z=Qe("diagram/fetchLayout",async t=>await Ca.loadDiagramLayout(t)),VZ=Qe("diagram/save",async t=>await Ca.saveDiagramLayout(t));Qe("diagram/update",async({id:t,layout:e})=>await Ca.updateDiagramLayout(t,e));const GZ=Qe("diagram/delete",async t=>(await Ca.deleteDiagramLayout(t),t)),OB=va({name:"diagram",initialState:UZ,reducers:{clearCurrentDiagram(t){t.current=null}},extraReducers:t=>{t.addCase(kb.pending,e=>{e.loading=!0,e.error=null}).addCase(kb.fulfilled,(e,r)=>{e.loading=!1,e.layouts=r.payload}).addCase(kb.rejected,(e,r)=>{e.loading=!1,e.error=r.error.message||"Failed to fetch diagram layouts"}).addCase($Z.fulfilled,(e,r)=>{e.current=r.payload}).addCase(VZ.fulfilled,(e,r)=>{e.layouts.push(r.payload)}).addCase(GZ.fulfilled,(e,r)=>{e.layouts=e.layouts.filter(n=>n.id!==r.payload)})}});OB.actions;const HZ=OB.reducer,WZ={currentPackage:null,loading:!1,error:null},Lb=Qe("packages/fetchByPath",async({rootPackage:t,path:e})=>await Mn.getPackageByPath(t,e));Qe("packages/create",async t=>await Mn.createPackage(t));Qe("packages/createSub",async({rootPackage:t,path:e,data:r})=>await Mn.createSubPackage(t,e,r));Qe("packages/update",async({rootPackage:t,path:e,data:r})=>await Mn.updatePackage(t,e,r));Qe("packages/delete",async({rootPackage:t,path:e,force:r})=>await Mn.deletePackage(t,e,r));const MB=va({name:"packages",initialState:WZ,reducers:{clearCurrentPackage(t){t.currentPackage=null}},extraReducers:t=>{t.addCase(Lb.pending,e=>{e.loading=!0,e.error=null}).addCase(Lb.fulfilled,(e,r)=>{e.loading=!1,e.currentPackage=r.payload}).addCase(Lb.rejected,(e,r)=>{e.loading=!1,e.error=r.error.message||"Failed to fetch package"})}});MB.actions;const YZ=MB.reducer,XZ={stereotypes:[],loading:!1,error:null},Db=Qe("stereotypes/fetchAll",async t=>await zn.getAll(t)),KZ=Qe("stereotypes/create",async t=>(await zn.create(t)).data),QZ=Qe("stereotypes/update",async({id:t,data:e})=>(await zn.update(t,e)).data),ZZ=Qe("stereotypes/delete",async t=>(await zn.delete(t),t)),JZ=va({name:"stereotypes",initialState:XZ,reducers:{},extraReducers:t=>{t.addCase(Db.pending,e=>{e.loading=!0,e.error=null}).addCase(Db.fulfilled,(e,r)=>{e.loading=!1,e.stereotypes=r.payload}).addCase(Db.rejected,(e,r)=>{e.loading=!1,e.error=r.error.message||"Failed to fetch stereotypes"}).addCase(KZ.fulfilled,(e,r)=>{e.stereotypes.push(r.payload)}).addCase(QZ.fulfilled,(e,r)=>{const n=e.stereotypes.findIndex(a=>a.id===r.payload.id);n>=0&&(e.stereotypes[n]=r.payload)}).addCase(ZZ.fulfilled,(e,r)=>{e.stereotypes=e.stereotypes.filter(n=>n.id!==r.payload)})}}),eJ=JZ.reducer,tJ={perspectives:[],current:null,loading:!1,error:null},_b=Qe("perspectives/fetchAll",async()=>await un.getAll()),jb=Qe("perspectives/resolve",async t=>await un.resolve(t)),rJ=Qe("perspectives/create",async t=>(await un.create(t)).data);Qe("perspectives/update",async({id:t,data:e})=>(await un.update(t,e)).data);const nJ=Qe("perspectives/delete",async t=>(await un.delete(t),t)),IB=va({name:"perspectives",initialState:tJ,reducers:{clearCurrent(t){t.current=null}},extraReducers:t=>{t.addCase(_b.pending,e=>{e.loading=!0,e.error=null}).addCase(_b.fulfilled,(e,r)=>{e.loading=!1,e.perspectives=r.payload}).addCase(_b.rejected,(e,r)=>{e.loading=!1,e.error=r.error.message||"Failed to fetch perspectives"}).addCase(jb.pending,e=>{e.loading=!0}).addCase(jb.fulfilled,(e,r)=>{e.loading=!1,e.current=r.payload}).addCase(jb.rejected,(e,r)=>{e.loading=!1,e.error=r.error.message||"Failed to resolve perspective"}).addCase(rJ.fulfilled,(e,r)=>{e.perspectives.push(r.payload)}).addCase(nJ.fulfilled,(e,r)=>{e.perspectives=e.perspectives.filter(n=>n.uuid!==r.payload)})}});IB.actions;const aJ=IB.reducer,iJ={commits:[],loading:!1,error:null,lastCommitResult:null},Ob=Qe("version/fetchHistory",async(t=10)=>await us.getCommitHistory(t)),Mb=Qe("version/commit",async t=>await us.commitChanges(t)),sJ=Qe("version/revert",async t=>await us.revertToCommit(t)),FB=va({name:"version",initialState:iJ,reducers:{clearLastCommitResult(t){t.lastCommitResult=null}},extraReducers:t=>{t.addCase(Ob.pending,e=>{e.loading=!0,e.error=null}).addCase(Ob.fulfilled,(e,r)=>{e.loading=!1,e.commits=r.payload}).addCase(Ob.rejected,(e,r)=>{e.loading=!1,e.error=r.error.message||"Failed to fetch commit history"}).addCase(Mb.pending,e=>{e.loading=!0}).addCase(Mb.fulfilled,e=>{e.loading=!1,e.lastCommitResult={success:!0,message:"Changes committed"}}).addCase(Mb.rejected,(e,r)=>{e.loading=!1,e.lastCommitResult={success:!1,message:r.error.message}}).addCase(sJ.fulfilled,e=>{e.lastCommitResult={success:!0,message:"Reverted successfully"}})}});FB.actions;const oJ=FB.reducer,lJ={query:"",results:[],loading:!1,error:null},Ib=Qe("search/searchEntities",async t=>await at.searchEntities(t)),BB=va({name:"search",initialState:lJ,reducers:{setSearchQuery(t,e){t.query=e.payload},clearSearch(t){t.query="",t.results=[],t.error=null}},extraReducers:t=>{t.addCase(Ib.pending,e=>{e.loading=!0,e.error=null}).addCase(Ib.fulfilled,(e,r)=>{e.loading=!1,e.results=r.payload}).addCase(Ib.rejected,(e,r)=>{e.loading=!1,e.error=r.error.message||"Search failed"})}});BB.actions;const uJ=BB.reducer,nn=new JX([],void 0,{debug:!1});let h_=!1;function cJ(){const t=MQ(),e={async initialize(r){await t.initialize(r);const n=r.resolve(oB);n&&(n.register("auth",RZ),n.register("services",DZ),n.register("entity",MZ),n.register("dictionary",qZ),n.register("diagram",HZ),n.register("packages",YZ),n.register("stereotypes",eJ),n.register("perspectives",aJ),n.register("version",oJ),n.register("search",uJ))},async activate(r){await t.activate(r)},async deactivate(){t.deactivate&&await t.deactivate()}};nn.registerPlugin("store",{name:"store",version:"1.0.0",entry:""},e),nn.registerPlugin("shell",{name:"shell",version:"1.0.0",entry:"",dependsOn:["store"]},YQ()),nn.registerPlugin("auth",{name:"auth",version:"1.0.0",entry:"",dependsOn:["store"]},QQ()),nn.registerPlugin("data-dictionary",{name:"data-dictionary",version:"1.0.0",entry:"",dependsOn:["store","auth"]},ZQ()),nn.registerPlugin("visualization",{name:"visualization",version:"1.0.0",entry:"",dependsOn:["store"]},JQ()),nn.registerPlugin("search",{name:"search",version:"1.0.0",entry:"",dependsOn:["store"]},eZ()),nn.registerPlugin("version-control",{name:"version-control",version:"1.0.0",entry:"",dependsOn:["store","auth"]},tZ()),nn.registerPlugin("remote-fs",{name:"remote-fs",version:"1.0.0",entry:"",dependsOn:["store"]},fZ()),nn.registerPlugin("remote-git",{name:"remote-git",version:"1.0.0",entry:"",dependsOn:["store","remote-fs"]},wZ()),nn.registerPlugin("notification",{name:"notification",version:"1.0.0",entry:"",dependsOn:["store"]},CZ()),nn.registerPlugin("perspective",{name:"perspective",version:"1.0.0",entry:"",dependsOn:["store","auth"]},NZ())}async function dJ(){if(h_)return console.log("[Bootstrap] Already bootstrapped, skipping..."),!0;try{return console.log("[Bootstrap] Registering plugins..."),cJ(),console.log("[Bootstrap] Bootstrapping microkernel..."),await nn.bootstrapAllAtRoot(),h_=!0,console.log("[Bootstrap] Application ready"),!0}catch(t){throw console.error("[Bootstrap] Failed to bootstrap application:",t),t}}function fJ(){const t=nn.rootActivationCtx;if(!t)throw new Error("Application not bootstrapped");const e=t.resolve(TS);if(!e)throw new Error("Store manager not available");return e.getStore()}dJ().then(()=>{const t=fJ();xd.createRoot(document.getElementById("root")).render(h.jsx(ir.StrictMode,{children:h.jsx($U,{store:t,children:h.jsx(JC,{children:h.jsx(FD,{})})})}))}).catch(t=>{console.error("Failed to bootstrap application:",t),xd.createRoot(document.getElementById("root")).render(h.jsx(ir.StrictMode,{children:h.jsx(JC,{children:h.jsx(FD,{})})}))});
|