var p0 = Object.defineProperty; var g0 = (t, e, r) => e in t ? p0(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r; var Ir = (t, e, r) => g0(t, typeof e != "symbol" ? e + "" : e, r); import { getCurrentScope as m0, onScopeDispose as y0, unref as P, getCurrentInstance as gt, onMounted as Et, nextTick as ot, watch as Pe, ref as ce, defineComponent as de, openBlock as N, createElementBlock as Z, createElementVNode as X, warn as b0, computed as V, inject as Ue, isRef as Xa, shallowRef as jr, onBeforeUnmount as qr, onBeforeMount as w0, provide as Ct, mergeProps as Rr, renderSlot as Le, toRef as $r, onUnmounted as x0, useAttrs as C0, useSlots as vo, createCommentVNode as he, Fragment as Qe, normalizeClass as ie, createBlock as ye, withCtx as U, resolveDynamicComponent as er, withModifiers as ht, createVNode as J, toDisplayString as Ie, normalizeStyle as lt, Transition as ui, withDirectives as Ze, vShow as mt, reactive as Jr, onActivated as E0, onUpdated as mv, cloneVNode as k0, Text as yv, Comment as S0, Teleport as T0, readonly as _0, onDeactivated as D0, createTextVNode as ze, toRaw as ys, vModelCheckbox as bs, toRefs as ho, toHandlers as P0, watchEffect as bv, renderList as Jt, withKeys as aa, resolveComponent as Qt, resolveDirective as O0, toHandlerKey as L0, vModelText as I0, h as ia, createApp as F0, pushScopeId as po, popScopeId as go, createStaticVNode as A0 } from "vue"; const cn = (t, e, { checkForDefaultPrevented: r = !0 } = {}) => (a) => { const i = t == null ? void 0 : t(a); if (r === !1 || !i) return e == null ? void 0 : e(a); }; var Ac; const _t = typeof window < "u", M0 = (t) => typeof t == "string", wv = () => { }, Gl = _t && ((Ac = window == null ? void 0 : window.navigator) == null ? void 0 : Ac.userAgent) && /iP(ad|hone|od)/.test(window.navigator.userAgent); function xv(t) { return typeof t == "function" ? t() : P(t); } function B0(t) { return t; } function Rs(t) { return m0() ? (y0(t), !0) : !1; } function N0(t, e = !0) { gt() ? Et(t) : e ? t() : ot(t); } function vn(t) { var e; const r = xv(t); return (e = r == null ? void 0 : r.$el) != null ? e : r; } const zs = _t ? window : void 0; function kr(...t) { let e, r, n, a; if (M0(t[0]) || Array.isArray(t[0]) ? ([r, n, a] = t, e = zs) : [e, r, n, a] = t, !e) return wv; Array.isArray(r) || (r = [r]), Array.isArray(n) || (n = [n]); const i = [], o = () => { i.forEach((c) => c()), i.length = 0; }, s = (c, d, v, h) => (c.addEventListener(d, v, h), () => c.removeEventListener(d, v, h)), u = Pe(() => [vn(e), xv(a)], ([c, d]) => { o(), c && i.push(...r.flatMap((v) => n.map((h) => s(c, v, h, d)))); }, { immediate: !0, flush: "post" }), l = () => { u(), o(); }; return Rs(l), l; } let Mc = !1; function $0(t, e, r = {}) { const { window: n = zs, ignore: a = [], capture: i = !0, detectIframe: o = !1 } = r; if (!n) return; Gl && !Mc && (Mc = !0, Array.from(n.document.body.children).forEach((v) => v.addEventListener("click", wv))); let s = !0; const u = (v) => a.some((h) => { if (typeof h == "string") return Array.from(n.document.querySelectorAll(h)).some((f) => f === v.target || v.composedPath().includes(f)); { const f = vn(h); return f && (v.target === f || v.composedPath().includes(f)); } }), c = [ kr(n, "click", (v) => { const h = vn(t); if (!(!h || h === v.target || v.composedPath().includes(h))) { if (v.detail === 0 && (s = !u(v)), !s) { s = !0; return; } e(v); } }, { passive: !0, capture: i }), kr(n, "pointerdown", (v) => { const h = vn(t); h && (s = !v.composedPath().includes(h) && !u(v)); }, { passive: !0 }), o && kr(n, "blur", (v) => { var h; const f = vn(t); ((h = n.document.activeElement) == null ? void 0 : h.tagName) === "IFRAME" && !(f != null && f.contains(n.document.activeElement)) && e(v); }) ].filter(Boolean); return () => c.forEach((v) => v()); } function Cv(t, e = !1) { const r = ce(), n = () => r.value = !!t(); return n(), N0(n, e), r; } const Bc = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, Nc = "__vueuse_ssr_handlers__"; Bc[Nc] = Bc[Nc] || {}; var $c = Object.getOwnPropertySymbols, R0 = Object.prototype.hasOwnProperty, z0 = Object.prototype.propertyIsEnumerable, V0 = (t, e) => { var r = {}; for (var n in t) R0.call(t, n) && e.indexOf(n) < 0 && (r[n] = t[n]); if (t != null && $c) for (var n of $c(t)) e.indexOf(n) < 0 && z0.call(t, n) && (r[n] = t[n]); return r; }; function dn(t, e, r = {}) { const n = r, { window: a = zs } = n, i = V0(n, ["window"]); let o; const s = Cv(() => a && "ResizeObserver" in a), u = () => { o && (o.disconnect(), o = void 0); }, l = Pe(() => vn(t), (d) => { u(), s.value && a && d && (o = new ResizeObserver(e), o.observe(d, i)); }, { immediate: !0, flush: "post" }), c = () => { u(), l(); }; return Rs(c), { isSupported: s, stop: c }; } var Rc = Object.getOwnPropertySymbols, H0 = Object.prototype.hasOwnProperty, q0 = Object.prototype.propertyIsEnumerable, K0 = (t, e) => { var r = {}; for (var n in t) H0.call(t, n) && e.indexOf(n) < 0 && (r[n] = t[n]); if (t != null && Rc) for (var n of Rc(t)) e.indexOf(n) < 0 && q0.call(t, n) && (r[n] = t[n]); return r; }; function U0(t, e, r = {}) { const n = r, { window: a = zs } = n, i = K0(n, ["window"]); let o; const s = Cv(() => a && "MutationObserver" in a), u = () => { o && (o.disconnect(), o = void 0); }, l = Pe(() => vn(t), (d) => { u(), s.value && a && d && (o = new MutationObserver(e), o.observe(d, i)); }, { immediate: !0 }), c = () => { u(), l(); }; return Rs(c), { isSupported: s, stop: c }; } var zc; (function(t) { t.UP = "UP", t.RIGHT = "RIGHT", t.DOWN = "DOWN", t.LEFT = "LEFT", t.NONE = "NONE"; })(zc || (zc = {})); var G0 = Object.defineProperty, Vc = Object.getOwnPropertySymbols, W0 = Object.prototype.hasOwnProperty, Y0 = Object.prototype.propertyIsEnumerable, Hc = (t, e, r) => e in t ? G0(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r, Z0 = (t, e) => { for (var r in e || (e = {})) W0.call(e, r) && Hc(t, r, e[r]); if (Vc) for (var r of Vc(e)) Y0.call(e, r) && Hc(t, r, e[r]); return t; }; const X0 = { easeInSine: [0.12, 0, 0.39, 0], easeOutSine: [0.61, 1, 0.88, 1], easeInOutSine: [0.37, 0, 0.63, 1], easeInQuad: [0.11, 0, 0.5, 0], easeOutQuad: [0.5, 1, 0.89, 1], easeInOutQuad: [0.45, 0, 0.55, 1], easeInCubic: [0.32, 0, 0.67, 0], easeOutCubic: [0.33, 1, 0.68, 1], easeInOutCubic: [0.65, 0, 0.35, 1], easeInQuart: [0.5, 0, 0.75, 0], easeOutQuart: [0.25, 1, 0.5, 1], easeInOutQuart: [0.76, 0, 0.24, 1], easeInQuint: [0.64, 0, 0.78, 0], easeOutQuint: [0.22, 1, 0.36, 1], easeInOutQuint: [0.83, 0, 0.17, 1], easeInExpo: [0.7, 0, 0.84, 0], easeOutExpo: [0.16, 1, 0.3, 1], easeInOutExpo: [0.87, 0, 0.13, 1], easeInCirc: [0.55, 0, 1, 0.45], easeOutCirc: [0, 0.55, 0.45, 1], easeInOutCirc: [0.85, 0, 0.15, 1], easeInBack: [0.36, 0, 0.66, -0.56], easeOutBack: [0.34, 1.56, 0.64, 1], easeInOutBack: [0.68, -0.6, 0.32, 1.6] }; Z0({ linear: B0 }, X0); const j0 = () => _t && /firefox/i.test(window.navigator.userAgent), Tu = (t) => { let e, r; return t.type === "touchend" ? (r = t.changedTouches[0].clientY, e = t.changedTouches[0].clientX) : t.type.startsWith("touch") ? (r = t.touches[0].clientY, e = t.touches[0].clientX) : (r = t.clientY, e = t.clientX), { clientX: e, clientY: r }; }; /** * @vue/shared v3.4.27 * (c) 2018-present Yuxi (Evan) You and Vue contributors * @license MIT **/ process.env.NODE_ENV !== "production" && Object.freeze({}); process.env.NODE_ENV !== "production" && Object.freeze([]); const Wi = () => { }, Q0 = Object.prototype.hasOwnProperty, va = (t, e) => Q0.call(t, e), fr = Array.isArray, lr = (t) => typeof t == "function", tr = (t) => typeof t == "string", Ht = (t) => t !== null && typeof t == "object", J0 = Object.prototype.toString, em = (t) => J0.call(t), bl = (t) => em(t).slice(8, -1), Ev = (t) => { const e = /* @__PURE__ */ Object.create(null); return (r) => e[r] || (e[r] = t(r)); }, tm = /-(\w)/g, rm = Ev((t) => t.replace(tm, (e, r) => r ? r.toUpperCase() : "")), nm = /\B([A-Z])/g, am = Ev( (t) => t.replace(nm, "-$1").toLowerCase() ); var kv = typeof global == "object" && global && global.Object === Object && global, im = typeof self == "object" && self && self.Object === Object && self, nn = kv || im || Function("return this")(), en = nn.Symbol, Sv = Object.prototype, om = Sv.hasOwnProperty, sm = Sv.toString, Si = en ? en.toStringTag : void 0; function lm(t) { var e = om.call(t, Si), r = t[Si]; try { t[Si] = void 0; var n = !0; } catch { } var a = sm.call(t); return n && (e ? t[Si] = r : delete t[Si]), a; } var um = Object.prototype, cm = um.toString; function dm(t) { return cm.call(t); } var fm = "[object Null]", vm = "[object Undefined]", qc = en ? en.toStringTag : void 0; function ci(t) { return t == null ? t === void 0 ? vm : fm : qc && qc in Object(t) ? lm(t) : dm(t); } function ja(t) { return t != null && typeof t == "object"; } var hm = "[object Symbol]"; function Vs(t) { return typeof t == "symbol" || ja(t) && ci(t) == hm; } function pm(t, e) { for (var r = -1, n = t == null ? 0 : t.length, a = Array(n); ++r < n; ) a[r] = e(t[r], r, t); return a; } var Vr = Array.isArray, gm = 1 / 0, Kc = en ? en.prototype : void 0, Uc = Kc ? Kc.toString : void 0; function Tv(t) { if (typeof t == "string") return t; if (Vr(t)) return pm(t, Tv) + ""; if (Vs(t)) return Uc ? Uc.call(t) : ""; var e = t + ""; return e == "0" && 1 / t == -gm ? "-0" : e; } var mm = /\s/; function ym(t) { for (var e = t.length; e-- && mm.test(t.charAt(e)); ) ; return e; } var bm = /^\s+/; function wm(t) { return t && t.slice(0, ym(t) + 1).replace(bm, ""); } function Vn(t) { var e = typeof t; return t != null && (e == "object" || e == "function"); } var Gc = NaN, xm = /^[-+]0x[0-9a-f]+$/i, Cm = /^0b[01]+$/i, Em = /^0o[0-7]+$/i, km = parseInt; function Wc(t) { if (typeof t == "number") return t; if (Vs(t)) return Gc; if (Vn(t)) { var e = typeof t.valueOf == "function" ? t.valueOf() : t; t = Vn(e) ? e + "" : e; } if (typeof t != "string") return t === 0 ? t : +t; t = wm(t); var r = Cm.test(t); return r || Em.test(t) ? km(t.slice(2), r ? 2 : 8) : xm.test(t) ? Gc : +t; } function _v(t) { return t; } var Sm = "[object AsyncFunction]", Tm = "[object Function]", _m = "[object GeneratorFunction]", Dm = "[object Proxy]"; function Dv(t) { if (!Vn(t)) return !1; var e = ci(t); return e == Tm || e == _m || e == Sm || e == Dm; } var wl = nn["__core-js_shared__"], Yc = function() { var t = /[^.]+$/.exec(wl && wl.keys && wl.keys.IE_PROTO || ""); return t ? "Symbol(src)_1." + t : ""; }(); function Pm(t) { return !!Yc && Yc in t; } var Om = Function.prototype, Lm = Om.toString; function ka(t) { if (t != null) { try { return Lm.call(t); } catch { } try { return t + ""; } catch { } } return ""; } var Im = /[\\^$.*+?()[\]{}|]/g, Fm = /^\[object .+?Constructor\]$/, Am = Function.prototype, Mm = Object.prototype, Bm = Am.toString, Nm = Mm.hasOwnProperty, $m = RegExp( "^" + Bm.call(Nm).replace(Im, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$" ); function Rm(t) { if (!Vn(t) || Pm(t)) return !1; var e = Dv(t) ? $m : Fm; return e.test(ka(t)); } function zm(t, e) { return t == null ? void 0 : t[e]; } function Sa(t, e) { var r = zm(t, e); return Rm(r) ? r : void 0; } var Wl = Sa(nn, "WeakMap"); function Vm(t, e, r) { switch (r.length) { case 0: return t.call(e); case 1: return t.call(e, r[0]); case 2: return t.call(e, r[0], r[1]); case 3: return t.call(e, r[0], r[1], r[2]); } return t.apply(e, r); } var Hm = 800, qm = 16, Km = Date.now; function Um(t) { var e = 0, r = 0; return function() { var n = Km(), a = qm - (n - r); if (r = n, a > 0) { if (++e >= Hm) return arguments[0]; } else e = 0; return t.apply(void 0, arguments); }; } function Gm(t) { return function() { return t; }; } var ws = function() { try { var t = Sa(Object, "defineProperty"); return t({}, "", {}), t; } catch { } }(), Wm = ws ? function(t, e) { return ws(t, "toString", { configurable: !0, enumerable: !1, value: Gm(e), writable: !0 }); } : _v, Ym = Um(Wm); function Zm(t, e, r, n) { t.length; for (var a = r + 1; a--; ) if (e(t[a], a, t)) return a; return -1; } var Xm = 9007199254740991, jm = /^(?:0|[1-9]\d*)$/; function _u(t, e) { var r = typeof t; return e = e ?? Xm, !!e && (r == "number" || r != "symbol" && jm.test(t)) && t > -1 && t % 1 == 0 && t < e; } function Qm(t, e, r) { e == "__proto__" && ws ? ws(t, e, { configurable: !0, enumerable: !0, value: r, writable: !0 }) : t[e] = r; } function Du(t, e) { return t === e || t !== t && e !== e; } var Jm = Object.prototype, ey = Jm.hasOwnProperty; function ty(t, e, r) { var n = t[e]; (!(ey.call(t, e) && Du(n, r)) || r === void 0 && !(e in t)) && Qm(t, e, r); } var Zc = Math.max; function ry(t, e, r) { return e = Zc(e === void 0 ? t.length - 1 : e, 0), function() { for (var n = arguments, a = -1, i = Zc(n.length - e, 0), o = Array(i); ++a < i; ) o[a] = n[e + a]; a = -1; for (var s = Array(e + 1); ++a < e; ) s[a] = n[a]; return s[e] = r(o), Vm(t, this, s); }; } var ny = 9007199254740991; function Pu(t) { return typeof t == "number" && t > -1 && t % 1 == 0 && t <= ny; } function ay(t) { return t != null && Pu(t.length) && !Dv(t); } var iy = Object.prototype; function oy(t) { var e = t && t.constructor, r = typeof e == "function" && e.prototype || iy; return t === r; } function sy(t, e) { for (var r = -1, n = Array(t); ++r < t; ) n[r] = e(r); return n; } var ly = "[object Arguments]"; function Xc(t) { return ja(t) && ci(t) == ly; } var Pv = Object.prototype, uy = Pv.hasOwnProperty, cy = Pv.propertyIsEnumerable, Ou = Xc(/* @__PURE__ */ function() { return arguments; }()) ? Xc : function(t) { return ja(t) && uy.call(t, "callee") && !cy.call(t, "callee"); }; function dy() { return !1; } var Ov = typeof exports == "object" && exports && !exports.nodeType && exports, jc = Ov && typeof module == "object" && module && !module.nodeType && module, fy = jc && jc.exports === Ov, Qc = fy ? nn.Buffer : void 0, vy = Qc ? Qc.isBuffer : void 0, Yl = vy || dy, hy = "[object Arguments]", py = "[object Array]", gy = "[object Boolean]", my = "[object Date]", yy = "[object Error]", by = "[object Function]", wy = "[object Map]", xy = "[object Number]", Cy = "[object Object]", Ey = "[object RegExp]", ky = "[object Set]", Sy = "[object String]", Ty = "[object WeakMap]", _y = "[object ArrayBuffer]", Dy = "[object DataView]", Py = "[object Float32Array]", Oy = "[object Float64Array]", Ly = "[object Int8Array]", Iy = "[object Int16Array]", Fy = "[object Int32Array]", Ay = "[object Uint8Array]", My = "[object Uint8ClampedArray]", By = "[object Uint16Array]", Ny = "[object Uint32Array]", ft = {}; ft[Py] = ft[Oy] = ft[Ly] = ft[Iy] = ft[Fy] = ft[Ay] = ft[My] = ft[By] = ft[Ny] = !0; ft[hy] = ft[py] = ft[_y] = ft[gy] = ft[Dy] = ft[my] = ft[yy] = ft[by] = ft[wy] = ft[xy] = ft[Cy] = ft[Ey] = ft[ky] = ft[Sy] = ft[Ty] = !1; function $y(t) { return ja(t) && Pu(t.length) && !!ft[ci(t)]; } function Ry(t) { return function(e) { return t(e); }; } var Lv = typeof exports == "object" && exports && !exports.nodeType && exports, zi = Lv && typeof module == "object" && module && !module.nodeType && module, zy = zi && zi.exports === Lv, xl = zy && kv.process, Jc = function() { try { var t = zi && zi.require && zi.require("util").types; return t || xl && xl.binding && xl.binding("util"); } catch { } }(), ed = Jc && Jc.isTypedArray, Iv = ed ? Ry(ed) : $y, Vy = Object.prototype, Hy = Vy.hasOwnProperty; function qy(t, e) { var r = Vr(t), n = !r && Ou(t), a = !r && !n && Yl(t), i = !r && !n && !a && Iv(t), o = r || n || a || i, s = o ? sy(t.length, String) : [], u = s.length; for (var l in t) Hy.call(t, l) && !(o && // Safari 9 has enumerable `arguments.length` in strict mode. (l == "length" || // Node.js 0.10 has enumerable non-index properties on buffers. a && (l == "offset" || l == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays. i && (l == "buffer" || l == "byteLength" || l == "byteOffset") || // Skip index properties. _u(l, u))) && s.push(l); return s; } function Ky(t, e) { return function(r) { return t(e(r)); }; } var Uy = Ky(Object.keys, Object), Gy = Object.prototype, Wy = Gy.hasOwnProperty; function Yy(t) { if (!oy(t)) return Uy(t); var e = []; for (var r in Object(t)) Wy.call(t, r) && r != "constructor" && e.push(r); return e; } function Fv(t) { return ay(t) ? qy(t) : Yy(t); } var Zy = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, Xy = /^\w*$/; function Lu(t, e) { if (Vr(t)) return !1; var r = typeof t; return r == "number" || r == "symbol" || r == "boolean" || t == null || Vs(t) ? !0 : Xy.test(t) || !Zy.test(t) || e != null && t in Object(e); } var Yi = Sa(Object, "create"); function jy() { this.__data__ = Yi ? Yi(null) : {}, this.size = 0; } function Qy(t) { var e = this.has(t) && delete this.__data__[t]; return this.size -= e ? 1 : 0, e; } var Jy = "__lodash_hash_undefined__", e1 = Object.prototype, t1 = e1.hasOwnProperty; function r1(t) { var e = this.__data__; if (Yi) { var r = e[t]; return r === Jy ? void 0 : r; } return t1.call(e, t) ? e[t] : void 0; } var n1 = Object.prototype, a1 = n1.hasOwnProperty; function i1(t) { var e = this.__data__; return Yi ? e[t] !== void 0 : a1.call(e, t); } var o1 = "__lodash_hash_undefined__"; function s1(t, e) { var r = this.__data__; return this.size += this.has(t) ? 0 : 1, r[t] = Yi && e === void 0 ? o1 : e, this; } function ha(t) { var e = -1, r = t == null ? 0 : t.length; for (this.clear(); ++e < r; ) { var n = t[e]; this.set(n[0], n[1]); } } ha.prototype.clear = jy; ha.prototype.delete = Qy; ha.prototype.get = r1; ha.prototype.has = i1; ha.prototype.set = s1; function l1() { this.__data__ = [], this.size = 0; } function Hs(t, e) { for (var r = t.length; r--; ) if (Du(t[r][0], e)) return r; return -1; } var u1 = Array.prototype, c1 = u1.splice; function d1(t) { var e = this.__data__, r = Hs(e, t); if (r < 0) return !1; var n = e.length - 1; return r == n ? e.pop() : c1.call(e, r, 1), --this.size, !0; } function f1(t) { var e = this.__data__, r = Hs(e, t); return r < 0 ? void 0 : e[r][1]; } function v1(t) { return Hs(this.__data__, t) > -1; } function h1(t, e) { var r = this.__data__, n = Hs(r, t); return n < 0 ? (++this.size, r.push([t, e])) : r[n][1] = e, this; } function bn(t) { var e = -1, r = t == null ? 0 : t.length; for (this.clear(); ++e < r; ) { var n = t[e]; this.set(n[0], n[1]); } } bn.prototype.clear = l1; bn.prototype.delete = d1; bn.prototype.get = f1; bn.prototype.has = v1; bn.prototype.set = h1; var Zi = Sa(nn, "Map"); function p1() { this.size = 0, this.__data__ = { hash: new ha(), map: new (Zi || bn)(), string: new ha() }; } function g1(t) { var e = typeof t; return e == "string" || e == "number" || e == "symbol" || e == "boolean" ? t !== "__proto__" : t === null; } function qs(t, e) { var r = t.__data__; return g1(e) ? r[typeof e == "string" ? "string" : "hash"] : r.map; } function m1(t) { var e = qs(this, t).delete(t); return this.size -= e ? 1 : 0, e; } function y1(t) { return qs(this, t).get(t); } function b1(t) { return qs(this, t).has(t); } function w1(t, e) { var r = qs(this, t), n = r.size; return r.set(t, e), this.size += r.size == n ? 0 : 1, this; } function wn(t) { var e = -1, r = t == null ? 0 : t.length; for (this.clear(); ++e < r; ) { var n = t[e]; this.set(n[0], n[1]); } } wn.prototype.clear = p1; wn.prototype.delete = m1; wn.prototype.get = y1; wn.prototype.has = b1; wn.prototype.set = w1; var x1 = "Expected a function"; function Iu(t, e) { if (typeof t != "function" || e != null && typeof e != "function") throw new TypeError(x1); var r = function() { var n = arguments, a = e ? e.apply(this, n) : n[0], i = r.cache; if (i.has(a)) return i.get(a); var o = t.apply(this, n); return r.cache = i.set(a, o) || i, o; }; return r.cache = new (Iu.Cache || wn)(), r; } Iu.Cache = wn; var C1 = 500; function E1(t) { var e = Iu(t, function(n) { return r.size === C1 && r.clear(), n; }), r = e.cache; return e; } var k1 = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g, S1 = /\\(\\)?/g, T1 = E1(function(t) { var e = []; return t.charCodeAt(0) === 46 && e.push(""), t.replace(k1, function(r, n, a, i) { e.push(a ? i.replace(S1, "$1") : n || r); }), e; }); function _1(t) { return t == null ? "" : Tv(t); } function Ks(t, e) { return Vr(t) ? t : Lu(t, e) ? [t] : T1(_1(t)); } var D1 = 1 / 0; function mo(t) { if (typeof t == "string" || Vs(t)) return t; var e = t + ""; return e == "0" && 1 / t == -D1 ? "-0" : e; } function Fu(t, e) { e = Ks(e, t); for (var r = 0, n = e.length; t != null && r < n; ) t = t[mo(e[r++])]; return r && r == n ? t : void 0; } function fn(t, e, r) { var n = t == null ? void 0 : Fu(t, e); return n === void 0 ? r : n; } function Av(t, e) { for (var r = -1, n = e.length, a = t.length; ++r < n; ) t[a + r] = e[r]; return t; } var td = en ? en.isConcatSpreadable : void 0; function P1(t) { return Vr(t) || Ou(t) || !!(td && t && t[td]); } function O1(t, e, r, n, a) { var i = -1, o = t.length; for (r || (r = P1), a || (a = []); ++i < o; ) { var s = t[i]; r(s) ? Av(a, s) : a[a.length] = s; } return a; } function L1(t) { var e = t == null ? 0 : t.length; return e ? O1(t) : []; } function I1(t) { return Ym(ry(t, void 0, L1), t + ""); } function Fn() { if (!arguments.length) return []; var t = arguments[0]; return Vr(t) ? t : [t]; } function F1() { this.__data__ = new bn(), this.size = 0; } function A1(t) { var e = this.__data__, r = e.delete(t); return this.size = e.size, r; } function M1(t) { return this.__data__.get(t); } function B1(t) { return this.__data__.has(t); } var N1 = 200; function $1(t, e) { var r = this.__data__; if (r instanceof bn) { var n = r.__data__; if (!Zi || n.length < N1 - 1) return n.push([t, e]), this.size = ++r.size, this; r = this.__data__ = new wn(n); } return r.set(t, e), this.size = r.size, this; } function hn(t) { var e = this.__data__ = new bn(t); this.size = e.size; } hn.prototype.clear = F1; hn.prototype.delete = A1; hn.prototype.get = M1; hn.prototype.has = B1; hn.prototype.set = $1; function R1(t, e) { for (var r = -1, n = t == null ? 0 : t.length, a = 0, i = []; ++r < n; ) { var o = t[r]; e(o, r, t) && (i[a++] = o); } return i; } function z1() { return []; } var V1 = Object.prototype, H1 = V1.propertyIsEnumerable, rd = Object.getOwnPropertySymbols, q1 = rd ? function(t) { return t == null ? [] : (t = Object(t), R1(rd(t), function(e) { return H1.call(t, e); })); } : z1; function K1(t, e, r) { var n = e(t); return Vr(t) ? n : Av(n, r(t)); } function nd(t) { return K1(t, Fv, q1); } var Zl = Sa(nn, "DataView"), Xl = Sa(nn, "Promise"), jl = Sa(nn, "Set"), ad = "[object Map]", U1 = "[object Object]", id = "[object Promise]", od = "[object Set]", sd = "[object WeakMap]", ld = "[object DataView]", G1 = ka(Zl), W1 = ka(Zi), Y1 = ka(Xl), Z1 = ka(jl), X1 = ka(Wl), In = ci; (Zl && In(new Zl(new ArrayBuffer(1))) != ld || Zi && In(new Zi()) != ad || Xl && In(Xl.resolve()) != id || jl && In(new jl()) != od || Wl && In(new Wl()) != sd) && (In = function(t) { var e = ci(t), r = e == U1 ? t.constructor : void 0, n = r ? ka(r) : ""; if (n) switch (n) { case G1: return ld; case W1: return ad; case Y1: return id; case Z1: return od; case X1: return sd; } return e; }); var ud = nn.Uint8Array, j1 = "__lodash_hash_undefined__"; function Q1(t) { return this.__data__.set(t, j1), this; } function J1(t) { return this.__data__.has(t); } function xs(t) { var e = -1, r = t == null ? 0 : t.length; for (this.__data__ = new wn(); ++e < r; ) this.add(t[e]); } xs.prototype.add = xs.prototype.push = Q1; xs.prototype.has = J1; function eb(t, e) { for (var r = -1, n = t == null ? 0 : t.length; ++r < n; ) if (e(t[r], r, t)) return !0; return !1; } function tb(t, e) { return t.has(e); } var rb = 1, nb = 2; function Mv(t, e, r, n, a, i) { var o = r & rb, s = t.length, u = e.length; if (s != u && !(o && u > s)) return !1; var l = i.get(t), c = i.get(e); if (l && c) return l == e && c == t; var d = -1, v = !0, h = r & nb ? new xs() : void 0; for (i.set(t, e), i.set(e, t); ++d < s; ) { var f = t[d], p = e[d]; if (n) var m = o ? n(p, f, d, e, t, i) : n(f, p, d, t, e, i); if (m !== void 0) { if (m) continue; v = !1; break; } if (h) { if (!eb(e, function(g, y) { if (!tb(h, y) && (f === g || a(f, g, r, n, i))) return h.push(y); })) { v = !1; break; } } else if (!(f === p || a(f, p, r, n, i))) { v = !1; break; } } return i.delete(t), i.delete(e), v; } function ab(t) { var e = -1, r = Array(t.size); return t.forEach(function(n, a) { r[++e] = [a, n]; }), r; } function ib(t) { var e = -1, r = Array(t.size); return t.forEach(function(n) { r[++e] = n; }), r; } var ob = 1, sb = 2, lb = "[object Boolean]", ub = "[object Date]", cb = "[object Error]", db = "[object Map]", fb = "[object Number]", vb = "[object RegExp]", hb = "[object Set]", pb = "[object String]", gb = "[object Symbol]", mb = "[object ArrayBuffer]", yb = "[object DataView]", cd = en ? en.prototype : void 0, Cl = cd ? cd.valueOf : void 0; function bb(t, e, r, n, a, i, o) { switch (r) { case yb: if (t.byteLength != e.byteLength || t.byteOffset != e.byteOffset) return !1; t = t.buffer, e = e.buffer; case mb: return !(t.byteLength != e.byteLength || !i(new ud(t), new ud(e))); case lb: case ub: case fb: return Du(+t, +e); case cb: return t.name == e.name && t.message == e.message; case vb: case pb: return t == e + ""; case db: var s = ab; case hb: var u = n & ob; if (s || (s = ib), t.size != e.size && !u) return !1; var l = o.get(t); if (l) return l == e; n |= sb, o.set(t, e); var c = Mv(s(t), s(e), n, a, i, o); return o.delete(t), c; case gb: if (Cl) return Cl.call(t) == Cl.call(e); } return !1; } var wb = 1, xb = Object.prototype, Cb = xb.hasOwnProperty; function Eb(t, e, r, n, a, i) { var o = r & wb, s = nd(t), u = s.length, l = nd(e), c = l.length; if (u != c && !o) return !1; for (var d = u; d--; ) { var v = s[d]; if (!(o ? v in e : Cb.call(e, v))) return !1; } var h = i.get(t), f = i.get(e); if (h && f) return h == e && f == t; var p = !0; i.set(t, e), i.set(e, t); for (var m = o; ++d < u; ) { v = s[d]; var g = t[v], y = e[v]; if (n) var b = o ? n(y, g, v, e, t, i) : n(g, y, v, t, e, i); if (!(b === void 0 ? g === y || a(g, y, r, n, i) : b)) { p = !1; break; } m || (m = v == "constructor"); } if (p && !m) { var w = t.constructor, C = e.constructor; w != C && "constructor" in t && "constructor" in e && !(typeof w == "function" && w instanceof w && typeof C == "function" && C instanceof C) && (p = !1); } return i.delete(t), i.delete(e), p; } var kb = 1, dd = "[object Arguments]", fd = "[object Array]", No = "[object Object]", Sb = Object.prototype, vd = Sb.hasOwnProperty; function Tb(t, e, r, n, a, i) { var o = Vr(t), s = Vr(e), u = o ? fd : In(t), l = s ? fd : In(e); u = u == dd ? No : u, l = l == dd ? No : l; var c = u == No, d = l == No, v = u == l; if (v && Yl(t)) { if (!Yl(e)) return !1; o = !0, c = !1; } if (v && !c) return i || (i = new hn()), o || Iv(t) ? Mv(t, e, r, n, a, i) : bb(t, e, u, r, n, a, i); if (!(r & kb)) { var h = c && vd.call(t, "__wrapped__"), f = d && vd.call(e, "__wrapped__"); if (h || f) { var p = h ? t.value() : t, m = f ? e.value() : e; return i || (i = new hn()), a(p, m, r, n, i); } } return v ? (i || (i = new hn()), Eb(t, e, r, n, a, i)) : !1; } function Us(t, e, r, n, a) { return t === e ? !0 : t == null || e == null || !ja(t) && !ja(e) ? t !== t && e !== e : Tb(t, e, r, n, Us, a); } var _b = 1, Db = 2; function Pb(t, e, r, n) { var a = r.length, i = a; if (t == null) return !i; for (t = Object(t); a--; ) { var o = r[a]; if (o[2] ? o[1] !== t[o[0]] : !(o[0] in t)) return !1; } for (; ++a < i; ) { o = r[a]; var s = o[0], u = t[s], l = o[1]; if (o[2]) { if (u === void 0 && !(s in t)) return !1; } else { var c = new hn(), d; if (!(d === void 0 ? Us(l, u, _b | Db, n, c) : d)) return !1; } } return !0; } function Bv(t) { return t === t && !Vn(t); } function Ob(t) { for (var e = Fv(t), r = e.length; r--; ) { var n = e[r], a = t[n]; e[r] = [n, a, Bv(a)]; } return e; } function Nv(t, e) { return function(r) { return r == null ? !1 : r[t] === e && (e !== void 0 || t in Object(r)); }; } function Lb(t) { var e = Ob(t); return e.length == 1 && e[0][2] ? Nv(e[0][0], e[0][1]) : function(r) { return r === t || Pb(r, t, e); }; } function Ib(t, e) { return t != null && e in Object(t); } function Fb(t, e, r) { e = Ks(e, t); for (var n = -1, a = e.length, i = !1; ++n < a; ) { var o = mo(e[n]); if (!(i = t != null && r(t, o))) break; t = t[o]; } return i || ++n != a ? i : (a = t == null ? 0 : t.length, !!a && Pu(a) && _u(o, a) && (Vr(t) || Ou(t))); } function $v(t, e) { return t != null && Fb(t, e, Ib); } var Ab = 1, Mb = 2; function Bb(t, e) { return Lu(t) && Bv(e) ? Nv(mo(t), e) : function(r) { var n = fn(r, t); return n === void 0 && n === e ? $v(r, t) : Us(e, n, Ab | Mb); }; } function Nb(t) { return function(e) { return e == null ? void 0 : e[t]; }; } function $b(t) { return function(e) { return Fu(e, t); }; } function Rb(t) { return Lu(t) ? Nb(mo(t)) : $b(t); } function zb(t) { return typeof t == "function" ? t : t == null ? _v : typeof t == "object" ? Vr(t) ? Bb(t[0], t[1]) : Lb(t) : Rb(t); } var El = function() { return nn.Date.now(); }, Vb = "Expected a function", Hb = Math.max, qb = Math.min; function Rv(t, e, r) { var n, a, i, o, s, u, l = 0, c = !1, d = !1, v = !0; if (typeof t != "function") throw new TypeError(Vb); e = Wc(e) || 0, Vn(r) && (c = !!r.leading, d = "maxWait" in r, i = d ? Hb(Wc(r.maxWait) || 0, e) : i, v = "trailing" in r ? !!r.trailing : v); function h(E) { var x = n, T = a; return n = a = void 0, l = E, o = t.apply(T, x), o; } function f(E) { return l = E, s = setTimeout(g, e), c ? h(E) : o; } function p(E) { var x = E - u, T = E - l, k = e - x; return d ? qb(k, i - T) : k; } function m(E) { var x = E - u, T = E - l; return u === void 0 || x >= e || x < 0 || d && T >= i; } function g() { var E = El(); if (m(E)) return y(E); s = setTimeout(g, p(E)); } function y(E) { return s = void 0, v && n ? h(E) : (n = a = void 0, o); } function b() { s !== void 0 && clearTimeout(s), l = 0, n = u = a = s = void 0; } function w() { return s === void 0 ? o : y(El()); } function C() { var E = El(), x = m(E); if (n = arguments, a = this, u = E, x) { if (s === void 0) return f(u); if (d) return clearTimeout(s), s = setTimeout(g, e), h(u); } return s === void 0 && (s = setTimeout(g, e)), o; } return C.cancel = b, C.flush = w, C; } function Kb(t, e, r) { var n = t == null ? 0 : t.length; if (!n) return -1; var a = n - 1; return Zm(t, zb(e), a); } function Cs(t) { for (var e = -1, r = t == null ? 0 : t.length, n = {}; ++e < r; ) { var a = t[e]; n[a[0]] = a[1]; } return n; } function Es(t, e) { return Us(t, e); } function $n(t) { return t == null; } function Ub(t) { return t === void 0; } function Gb(t, e, r, n) { if (!Vn(t)) return t; e = Ks(e, t); for (var a = -1, i = e.length, o = i - 1, s = t; s != null && ++a < i; ) { var u = mo(e[a]), l = r; if (u === "__proto__" || u === "constructor" || u === "prototype") return t; if (a != o) { var c = s[u]; l = void 0, l === void 0 && (l = Vn(c) ? c : _u(e[a + 1]) ? [] : {}); } ty(s, u, l), s = s[u]; } return t; } function Wb(t, e, r) { for (var n = -1, a = e.length, i = {}; ++n < a; ) { var o = e[n], s = Fu(t, o); r(s, o) && Gb(i, Ks(o, t), s); } return i; } function Yb(t, e) { return Wb(t, e, function(r, n) { return $v(t, n); }); } var zv = I1(function(t, e) { return t == null ? {} : Yb(t, e); }); const Mn = (t) => t === void 0, Qa = (t) => typeof t == "boolean", qt = (t) => typeof t == "number", ua = (t) => typeof Element > "u" ? !1 : t instanceof Element, ks = (t) => $n(t), Zb = (t) => tr(t) ? !Number.isNaN(Number(t)) : !1, Xb = (t = "") => t.replace(/[|\\{}()[\]^$+*?.]/g, "\\$&").replace(/-/g, "\\x2d"), hd = (t) => Object.keys(t); class Vv extends Error { constructor(e) { super(e), this.name = "ElementPlusError"; } } function jb(t, e) { throw new Vv(`[${t}] ${e}`); } function Dt(t, e) { if (process.env.NODE_ENV !== "production") { const r = tr(t) ? new Vv(`[${t}] ${e}`) : t; console.warn(r); } } const Qb = "utils/dom/style", Hv = (t = "") => t.split(" ").filter((e) => !!e.trim()), Ql = (t, e) => { !t || !e.trim() || t.classList.add(...Hv(e)); }, ca = (t, e) => { !t || !e.trim() || t.classList.remove(...Hv(e)); }, Ti = (t, e) => { var r; if (!_t || !t || !e) return ""; let n = rm(e); n === "float" && (n = "cssFloat"); try { const a = t.style[n]; if (a) return a; const i = (r = document.defaultView) == null ? void 0 : r.getComputedStyle(t, ""); return i ? i[n] : ""; } catch { return t.style[n]; } }; function Ja(t, e = "px") { if (!t) return ""; if (qt(t) || Zb(t)) return `${t}${e}`; if (tr(t)) return t; Dt(Qb, "binding value must be a string or number"); } function Jb(t, e) { if (!_t) return; if (!e) { t.scrollTop = 0; return; } const r = []; let n = e.offsetParent; for (; n !== null && t !== n && t.contains(n); ) r.push(n), n = n.offsetParent; const a = e.offsetTop + r.reduce((u, l) => u + l.offsetTop, 0), i = a + e.offsetHeight, o = t.scrollTop, s = o + t.clientHeight; a < o ? t.scrollTop = a : i > s && (t.scrollTop = i - t.clientHeight); } /*! Element Plus Icons Vue v2.3.1 */ var e2 = /* @__PURE__ */ de({ name: "Aim", __name: "aim", setup(t) { return (e, r) => (N(), Z("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ X("path", { fill: "currentColor", d: "M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768m0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896" }), X("path", { fill: "currentColor", d: "M512 96a32 32 0 0 1 32 32v192a32 32 0 0 1-64 0V128a32 32 0 0 1 32-32m0 576a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V704a32 32 0 0 1 32-32M96 512a32 32 0 0 1 32-32h192a32 32 0 0 1 0 64H128a32 32 0 0 1-32-32m576 0a32 32 0 0 1 32-32h192a32 32 0 1 1 0 64H704a32 32 0 0 1-32-32" }) ])); } }), t2 = e2, r2 = /* @__PURE__ */ de({ name: "ArrowDown", __name: "arrow-down", setup(t) { return (e, r) => (N(), Z("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ X("path", { fill: "currentColor", d: "M831.872 340.864 512 652.672 192.128 340.864a30.592 30.592 0 0 0-42.752 0 29.12 29.12 0 0 0 0 41.6L489.664 714.24a32 32 0 0 0 44.672 0l340.288-331.712a29.12 29.12 0 0 0 0-41.728 30.592 30.592 0 0 0-42.752 0z" }) ])); } }), Gs = r2, n2 = /* @__PURE__ */ de({ name: "ArrowUp", __name: "arrow-up", setup(t) { return (e, r) => (N(), Z("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ X("path", { fill: "currentColor", d: "m488.832 344.32-339.84 356.672a32 32 0 0 0 0 44.16l.384.384a29.44 29.44 0 0 0 42.688 0l320-335.872 319.872 335.872a29.44 29.44 0 0 0 42.688 0l.384-.384a32 32 0 0 0 0-44.16L535.168 344.32a32 32 0 0 0-46.336 0" }) ])); } }), qv = n2, a2 = /* @__PURE__ */ de({ name: "CaretRight", __name: "caret-right", setup(t) { return (e, r) => (N(), Z("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ X("path", { fill: "currentColor", d: "M384 192v640l384-320.064z" }) ])); } }), i2 = a2, o2 = /* @__PURE__ */ de({ name: "CircleCheck", __name: "circle-check", setup(t) { return (e, r) => (N(), Z("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ X("path", { fill: "currentColor", d: "M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768m0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896" }), X("path", { fill: "currentColor", d: "M745.344 361.344a32 32 0 0 1 45.312 45.312l-288 288a32 32 0 0 1-45.312 0l-160-160a32 32 0 1 1 45.312-45.312L480 626.752l265.344-265.408z" }) ])); } }), s2 = o2, l2 = /* @__PURE__ */ de({ name: "CircleClose", __name: "circle-close", setup(t) { return (e, r) => (N(), Z("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ X("path", { fill: "currentColor", d: "m466.752 512-90.496-90.496a32 32 0 0 1 45.248-45.248L512 466.752l90.496-90.496a32 32 0 1 1 45.248 45.248L557.248 512l90.496 90.496a32 32 0 1 1-45.248 45.248L512 557.248l-90.496 90.496a32 32 0 0 1-45.248-45.248z" }), X("path", { fill: "currentColor", d: "M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768m0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896" }) ])); } }), Au = l2, u2 = /* @__PURE__ */ de({ name: "Close", __name: "close", setup(t) { return (e, r) => (N(), Z("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ X("path", { fill: "currentColor", d: "M764.288 214.592 512 466.88 259.712 214.592a31.936 31.936 0 0 0-45.12 45.12L466.752 512 214.528 764.224a31.936 31.936 0 1 0 45.12 45.184L512 557.184l252.288 252.288a31.936 31.936 0 0 0 45.12-45.12L557.12 512.064l252.288-252.352a31.936 31.936 0 1 0-45.12-45.184z" }) ])); } }), Ss = u2, c2 = /* @__PURE__ */ de({ name: "CopyDocument", __name: "copy-document", setup(t) { return (e, r) => (N(), Z("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ X("path", { fill: "currentColor", d: "M768 832a128 128 0 0 1-128 128H192A128 128 0 0 1 64 832V384a128 128 0 0 1 128-128v64a64 64 0 0 0-64 64v448a64 64 0 0 0 64 64h448a64 64 0 0 0 64-64z" }), X("path", { fill: "currentColor", d: "M384 128a64 64 0 0 0-64 64v448a64 64 0 0 0 64 64h448a64 64 0 0 0 64-64V192a64 64 0 0 0-64-64zm0-64h448a128 128 0 0 1 128 128v448a128 128 0 0 1-128 128H384a128 128 0 0 1-128-128V192A128 128 0 0 1 384 64" }) ])); } }), d2 = c2, f2 = /* @__PURE__ */ de({ name: "Delete", __name: "delete", setup(t) { return (e, r) => (N(), Z("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ X("path", { fill: "currentColor", d: "M160 256H96a32 32 0 0 1 0-64h256V95.936a32 32 0 0 1 32-32h256a32 32 0 0 1 32 32V192h256a32 32 0 1 1 0 64h-64v672a32 32 0 0 1-32 32H192a32 32 0 0 1-32-32zm448-64v-64H416v64zM224 896h576V256H224zm192-128a32 32 0 0 1-32-32V416a32 32 0 0 1 64 0v320a32 32 0 0 1-32 32m192 0a32 32 0 0 1-32-32V416a32 32 0 0 1 64 0v320a32 32 0 0 1-32 32" }) ])); } }), v2 = f2, h2 = /* @__PURE__ */ de({ name: "Edit", __name: "edit", setup(t) { return (e, r) => (N(), Z("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ X("path", { fill: "currentColor", d: "M832 512a32 32 0 1 1 64 0v352a32 32 0 0 1-32 32H160a32 32 0 0 1-32-32V160a32 32 0 0 1 32-32h352a32 32 0 0 1 0 64H192v640h640z" }), X("path", { fill: "currentColor", d: "m469.952 554.24 52.8-7.552L847.104 222.4a32 32 0 1 0-45.248-45.248L477.44 501.44l-7.552 52.8zm422.4-422.4a96 96 0 0 1 0 135.808l-331.84 331.84a32 32 0 0 1-18.112 9.088L436.8 623.68a32 32 0 0 1-36.224-36.224l15.104-105.6a32 32 0 0 1 9.024-18.112l331.904-331.84a96 96 0 0 1 135.744 0z" }) ])); } }), p2 = h2, g2 = /* @__PURE__ */ de({ name: "Finished", __name: "finished", setup(t) { return (e, r) => (N(), Z("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ X("path", { fill: "currentColor", d: "M280.768 753.728 691.456 167.04a32 32 0 1 1 52.416 36.672L314.24 817.472a32 32 0 0 1-45.44 7.296l-230.4-172.8a32 32 0 0 1 38.4-51.2l203.968 152.96zM736 448a32 32 0 1 1 0-64h192a32 32 0 1 1 0 64zM608 640a32 32 0 0 1 0-64h319.936a32 32 0 1 1 0 64zM480 832a32 32 0 1 1 0-64h447.936a32 32 0 1 1 0 64z" }) ])); } }), m2 = g2, y2 = /* @__PURE__ */ de({ name: "Hide", __name: "hide", setup(t) { return (e, r) => (N(), Z("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ X("path", { fill: "currentColor", d: "M876.8 156.8c0-9.6-3.2-16-9.6-22.4-6.4-6.4-12.8-9.6-22.4-9.6-9.6 0-16 3.2-22.4 9.6L736 220.8c-64-32-137.6-51.2-224-60.8-160 16-288 73.6-377.6 176C44.8 438.4 0 496 0 512s48 73.6 134.4 176c22.4 25.6 44.8 48 73.6 67.2l-86.4 89.6c-6.4 6.4-9.6 12.8-9.6 22.4 0 9.6 3.2 16 9.6 22.4 6.4 6.4 12.8 9.6 22.4 9.6 9.6 0 16-3.2 22.4-9.6l704-710.4c3.2-6.4 6.4-12.8 6.4-22.4Zm-646.4 528c-76.8-70.4-128-128-153.6-172.8 28.8-48 80-105.6 153.6-172.8C304 272 400 230.4 512 224c64 3.2 124.8 19.2 176 44.8l-54.4 54.4C598.4 300.8 560 288 512 288c-64 0-115.2 22.4-160 64s-64 96-64 160c0 48 12.8 89.6 35.2 124.8L256 707.2c-9.6-6.4-19.2-16-25.6-22.4Zm140.8-96c-12.8-22.4-19.2-48-19.2-76.8 0-44.8 16-83.2 48-112 32-28.8 67.2-48 112-48 28.8 0 54.4 6.4 73.6 19.2zM889.599 336c-12.8-16-28.8-28.8-41.6-41.6l-48 48c73.6 67.2 124.8 124.8 150.4 169.6-28.8 48-80 105.6-153.6 172.8-73.6 67.2-172.8 108.8-284.8 115.2-51.2-3.2-99.2-12.8-140.8-28.8l-48 48c57.6 22.4 118.4 38.4 188.8 44.8 160-16 288-73.6 377.6-176C979.199 585.6 1024 528 1024 512s-48.001-73.6-134.401-176Z" }), X("path", { fill: "currentColor", d: "M511.998 672c-12.8 0-25.6-3.2-38.4-6.4l-51.2 51.2c28.8 12.8 57.6 19.2 89.6 19.2 64 0 115.2-22.4 160-64 41.6-41.6 64-96 64-160 0-32-6.4-64-19.2-89.6l-51.2 51.2c3.2 12.8 6.4 25.6 6.4 38.4 0 44.8-16 83.2-48 112-32 28.8-67.2 48-112 48Z" }) ])); } }), b2 = y2, w2 = /* @__PURE__ */ de({ name: "Loading", __name: "loading", setup(t) { return (e, r) => (N(), Z("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ X("path", { fill: "currentColor", d: "M512 64a32 32 0 0 1 32 32v192a32 32 0 0 1-64 0V96a32 32 0 0 1 32-32m0 640a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V736a32 32 0 0 1 32-32m448-192a32 32 0 0 1-32 32H736a32 32 0 1 1 0-64h192a32 32 0 0 1 32 32m-640 0a32 32 0 0 1-32 32H96a32 32 0 0 1 0-64h192a32 32 0 0 1 32 32M195.2 195.2a32 32 0 0 1 45.248 0L376.32 331.008a32 32 0 0 1-45.248 45.248L195.2 240.448a32 32 0 0 1 0-45.248zm452.544 452.544a32 32 0 0 1 45.248 0L828.8 783.552a32 32 0 0 1-45.248 45.248L647.744 692.992a32 32 0 0 1 0-45.248zM828.8 195.264a32 32 0 0 1 0 45.184L692.992 376.32a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0m-452.544 452.48a32 32 0 0 1 0 45.248L240.448 828.8a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0z" }) ])); } }), Mu = w2, x2 = /* @__PURE__ */ de({ name: "Lock", __name: "lock", setup(t) { return (e, r) => (N(), Z("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ X("path", { fill: "currentColor", d: "M224 448a32 32 0 0 0-32 32v384a32 32 0 0 0 32 32h576a32 32 0 0 0 32-32V480a32 32 0 0 0-32-32zm0-64h576a96 96 0 0 1 96 96v384a96 96 0 0 1-96 96H224a96 96 0 0 1-96-96V480a96 96 0 0 1 96-96" }), X("path", { fill: "currentColor", d: "M512 544a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V576a32 32 0 0 1 32-32m192-160v-64a192 192 0 1 0-384 0v64zM512 64a256 256 0 0 1 256 256v128H256V320A256 256 0 0 1 512 64" }) ])); } }), C2 = x2, E2 = /* @__PURE__ */ de({ name: "Notebook", __name: "notebook", setup(t) { return (e, r) => (N(), Z("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ X("path", { fill: "currentColor", d: "M192 128v768h640V128zm-32-64h704a32 32 0 0 1 32 32v832a32 32 0 0 1-32 32H160a32 32 0 0 1-32-32V96a32 32 0 0 1 32-32" }), X("path", { fill: "currentColor", d: "M672 128h64v768h-64zM96 192h128q32 0 32 32t-32 32H96q-32 0-32-32t32-32m0 192h128q32 0 32 32t-32 32H96q-32 0-32-32t32-32m0 192h128q32 0 32 32t-32 32H96q-32 0-32-32t32-32m0 192h128q32 0 32 32t-32 32H96q-32 0-32-32t32-32" }) ])); } }), k2 = E2, S2 = /* @__PURE__ */ de({ name: "Unlock", __name: "unlock", setup(t) { return (e, r) => (N(), Z("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ X("path", { fill: "currentColor", d: "M224 448a32 32 0 0 0-32 32v384a32 32 0 0 0 32 32h576a32 32 0 0 0 32-32V480a32 32 0 0 0-32-32zm0-64h576a96 96 0 0 1 96 96v384a96 96 0 0 1-96 96H224a96 96 0 0 1-96-96V480a96 96 0 0 1 96-96" }), X("path", { fill: "currentColor", d: "M512 544a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V576a32 32 0 0 1 32-32m178.304-295.296A192.064 192.064 0 0 0 320 320v64h352l96 38.4V448H256V320a256 256 0 0 1 493.76-95.104z" }) ])); } }), T2 = S2, _2 = /* @__PURE__ */ de({ name: "View", __name: "view", setup(t) { return (e, r) => (N(), Z("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ X("path", { fill: "currentColor", d: "M512 160c320 0 512 352 512 352S832 864 512 864 0 512 0 512s192-352 512-352m0 64c-225.28 0-384.128 208.064-436.8 288 52.608 79.872 211.456 288 436.8 288 225.28 0 384.128-208.064 436.8-288-52.608-79.872-211.456-288-436.8-288zm0 64a224 224 0 1 1 0 448 224 224 0 0 1 0-448m0 64a160.192 160.192 0 0 0-160 160c0 88.192 71.744 160 160 160s160-71.808 160-160-71.744-160-160-160" }) ])); } }), D2 = _2, P2 = /* @__PURE__ */ de({ name: "Warning", __name: "warning", setup(t) { return (e, r) => (N(), Z("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ X("path", { fill: "currentColor", d: "M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m0 832a384 384 0 0 0 0-768 384 384 0 0 0 0 768m48-176a48 48 0 1 1-96 0 48 48 0 0 1 96 0m-48-464a32 32 0 0 1 32 32v288a32 32 0 0 1-64 0V288a32 32 0 0 1 32-32" }) ])); } }), O2 = P2, L2 = /* @__PURE__ */ de({ name: "ZoomIn", __name: "zoom-in", setup(t) { return (e, r) => (N(), Z("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ X("path", { fill: "currentColor", d: "m795.904 750.72 124.992 124.928a32 32 0 0 1-45.248 45.248L750.656 795.904a416 416 0 1 1 45.248-45.248zM480 832a352 352 0 1 0 0-704 352 352 0 0 0 0 704m-32-384v-96a32 32 0 0 1 64 0v96h96a32 32 0 0 1 0 64h-96v96a32 32 0 0 1-64 0v-96h-96a32 32 0 0 1 0-64z" }) ])); } }), I2 = L2, F2 = /* @__PURE__ */ de({ name: "ZoomOut", __name: "zoom-out", setup(t) { return (e, r) => (N(), Z("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ X("path", { fill: "currentColor", d: "m795.904 750.72 124.992 124.928a32 32 0 0 1-45.248 45.248L750.656 795.904a416 416 0 1 1 45.248-45.248zM480 832a352 352 0 1 0 0-704 352 352 0 0 0 0 704M352 448h256a32 32 0 0 1 0 64H352a32 32 0 0 1 0-64" }) ])); } }), A2 = F2; const Kv = "__epPropKey", $e = (t) => t, M2 = (t) => Ht(t) && !!t[Kv], Ws = (t, e) => { if (!Ht(t) || M2(t)) return t; const { values: r, required: n, default: a, type: i, validator: o } = t, u = { type: i, required: !!n, validator: r || o ? (l) => { let c = !1, d = []; if (r && (d = Array.from(r), va(t, "default") && d.push(a), c || (c = d.includes(l))), o && (c || (c = o(l))), !c && d.length > 0) { const v = [...new Set(d)].map((h) => JSON.stringify(h)).join(", "); b0(`Invalid prop: validation failed${e ? ` for prop "${e}"` : ""}. Expected one of [${v}], got value ${JSON.stringify(l)}.`); } return c; } : void 0, [Kv]: !0 }; return va(t, "default") && (u.default = a), u; }, rt = (t) => Cs(Object.entries(t).map(([e, r]) => [ e, Ws(r, e) ])), Hn = $e([ String, Object, Function ]), Uv = { validating: Mu, success: s2, error: Au }, $t = (t, e) => { if (t.install = (r) => { for (const n of [t, ...Object.values(e ?? {})]) r.component(n.name, n); }, e) for (const [r, n] of Object.entries(e)) t[r] = n; return t; }, B2 = (t, e) => (t.install = (r) => { r.directive(e, t); }, t), xn = (t) => (t.install = Wi, t), Lt = { tab: "Tab", enter: "Enter", space: "Space", left: "ArrowLeft", up: "ArrowUp", right: "ArrowRight", down: "ArrowDown", esc: "Escape", delete: "Delete", backspace: "Backspace", numpadEnter: "NumpadEnter", pageUp: "PageUp", pageDown: "PageDown", home: "Home", end: "End" }, zt = "update:modelValue", Bu = "change", Gv = ["", "default", "small", "large"], N2 = (t) => /([\uAC00-\uD7AF\u3130-\u318F])+/gi.test(t), Ra = (t) => t, $2 = ["class", "style"], R2 = /^on[A-Z]/, z2 = (t = {}) => { const { excludeListeners: e = !1, excludeKeys: r } = t, n = V(() => ((r == null ? void 0 : r.value) || []).concat($2)), a = gt(); return a ? V(() => { var i; return Cs(Object.entries((i = a.proxy) == null ? void 0 : i.$attrs).filter(([o]) => !n.value.includes(o) && !(e && R2.test(o)))); }) : (Dt("use-attrs", "getCurrentInstance() returned null. useAttrs() must be called at the top of a setup function"), V(() => ({}))); }, as = ({ from: t, replacement: e, scope: r, version: n, ref: a, type: i = "API" }, o) => { Pe(() => P(o), (s) => { s && Dt(r, `[${i}] ${t} is about to be deprecated in version ${n}, please use ${e} instead. For more detail, please visit: ${a} `); }, { immediate: !0 }); }; var V2 = { name: "en", el: { breadcrumb: { label: "Breadcrumb" }, colorpicker: { confirm: "OK", clear: "Clear", defaultLabel: "color picker", description: "current color is {color}. press enter to select a new color.", alphaLabel: "pick alpha value" }, datepicker: { now: "Now", today: "Today", cancel: "Cancel", clear: "Clear", confirm: "OK", dateTablePrompt: "Use the arrow keys and enter to select the day of the month", monthTablePrompt: "Use the arrow keys and enter to select the month", yearTablePrompt: "Use the arrow keys and enter to select the year", selectedDate: "Selected date", selectDate: "Select date", selectTime: "Select time", startDate: "Start Date", startTime: "Start Time", endDate: "End Date", endTime: "End Time", prevYear: "Previous Year", nextYear: "Next Year", prevMonth: "Previous Month", nextMonth: "Next Month", year: "", month1: "January", month2: "February", month3: "March", month4: "April", month5: "May", month6: "June", month7: "July", month8: "August", month9: "September", month10: "October", month11: "November", month12: "December", week: "week", weeks: { sun: "Sun", mon: "Mon", tue: "Tue", wed: "Wed", thu: "Thu", fri: "Fri", sat: "Sat" }, weeksFull: { sun: "Sunday", mon: "Monday", tue: "Tuesday", wed: "Wednesday", thu: "Thursday", fri: "Friday", sat: "Saturday" }, months: { jan: "Jan", feb: "Feb", mar: "Mar", apr: "Apr", may: "May", jun: "Jun", jul: "Jul", aug: "Aug", sep: "Sep", oct: "Oct", nov: "Nov", dec: "Dec" } }, inputNumber: { decrease: "decrease number", increase: "increase number" }, select: { loading: "Loading", noMatch: "No matching data", noData: "No data", placeholder: "Select" }, mention: { loading: "Loading" }, dropdown: { toggleDropdown: "Toggle Dropdown" }, cascader: { noMatch: "No matching data", loading: "Loading", placeholder: "Select", noData: "No data" }, pagination: { goto: "Go to", pagesize: "/page", total: "Total {total}", pageClassifier: "", page: "Page", prev: "Go to previous page", next: "Go to next page", currentPage: "page {pager}", prevPages: "Previous {pager} pages", nextPages: "Next {pager} pages", deprecationWarning: "Deprecated usages detected, please refer to the el-pagination documentation for more details" }, dialog: { close: "Close this dialog" }, drawer: { close: "Close this dialog" }, messagebox: { title: "Message", confirm: "OK", cancel: "Cancel", error: "Illegal input", close: "Close this dialog" }, upload: { deleteTip: "press delete to remove", delete: "Delete", preview: "Preview", continue: "Continue" }, slider: { defaultLabel: "slider between {min} and {max}", defaultRangeStartLabel: "pick start value", defaultRangeEndLabel: "pick end value" }, table: { emptyText: "No Data", confirmFilter: "Confirm", resetFilter: "Reset", clearFilter: "All", sumText: "Sum" }, tour: { next: "Next", previous: "Previous", finish: "Finish" }, tree: { emptyText: "No Data" }, transfer: { noMatch: "No matching data", noData: "No data", titles: ["List 1", "List 2"], filterPlaceholder: "Enter keyword", noCheckedFormat: "{total} items", hasCheckedFormat: "{checked}/{total} checked" }, image: { error: "FAILED" }, pageHeader: { title: "Back" }, popconfirm: { confirmButtonText: "Yes", cancelButtonText: "No" }, carousel: { leftArrow: "Carousel arrow left", rightArrow: "Carousel arrow right", indicator: "Carousel switch to index {index}" } } }; const H2 = (t) => (e, r) => q2(e, r, P(t)), q2 = (t, e, r) => fn(r, t, t).replace(/\{(\w+)\}/g, (n, a) => { var i; return `${(i = e == null ? void 0 : e[a]) != null ? i : `{${a}}`}`; }), K2 = (t) => { const e = V(() => P(t).name), r = Xa(t) ? t : ce(t); return { lang: e, locale: r, t: H2(t) }; }, Wv = Symbol("localeContextKey"), yo = (t) => { const e = t || Ue(Wv, ce()); return K2(V(() => e.value || V2)); }, is = "el", U2 = "is-", Qn = (t, e, r, n, a) => { let i = `${t}-${e}`; return r && (i += `-${r}`), n && (i += `__${n}`), a && (i += `--${a}`), i; }, Yv = Symbol("namespaceContextKey"), Nu = (t) => { const e = t || (gt() ? Ue(Yv, ce(is)) : ce(is)); return V(() => P(e) || is); }, He = (t, e) => { const r = Nu(e); return { namespace: r, b: (p = "") => Qn(r.value, t, p, "", ""), e: (p) => p ? Qn(r.value, t, "", p, "") : "", m: (p) => p ? Qn(r.value, t, "", "", p) : "", be: (p, m) => p && m ? Qn(r.value, t, p, m, "") : "", em: (p, m) => p && m ? Qn(r.value, t, "", p, m) : "", bm: (p, m) => p && m ? Qn(r.value, t, p, "", m) : "", bem: (p, m, g) => p && m && g ? Qn(r.value, t, p, m, g) : "", is: (p, ...m) => { const g = m.length >= 1 ? m[0] : !0; return p && g ? `${U2}${p}` : ""; }, cssVar: (p) => { const m = {}; for (const g in p) p[g] && (m[`--${r.value}-${g}`] = p[g]); return m; }, cssVarName: (p) => `--${r.value}-${p}`, cssVarBlock: (p) => { const m = {}; for (const g in p) p[g] && (m[`--${r.value}-${t}-${g}`] = p[g]); return m; }, cssVarBlockName: (p) => `--${r.value}-${t}-${p}` }; }, G2 = Ws({ type: $e(Boolean), default: null }), W2 = Ws({ type: $e(Function) }), Y2 = (t) => { const e = `update:${t}`, r = `onUpdate:${t}`, n = [e], a = { [t]: G2, [r]: W2 }; return { useModelToggle: ({ indicator: o, toggleReason: s, shouldHideWhenRouteChanges: u, shouldProceed: l, onShow: c, onHide: d }) => { const v = gt(), { emit: h } = v, f = v.props, p = V(() => lr(f[r])), m = V(() => f[t] === null), g = (x) => { o.value !== !0 && (o.value = !0, s && (s.value = x), lr(c) && c(x)); }, y = (x) => { o.value !== !1 && (o.value = !1, s && (s.value = x), lr(d) && d(x)); }, b = (x) => { if (f.disabled === !0 || lr(l) && !l()) return; const T = p.value && _t; T && h(e, !0), (m.value || !T) && g(x); }, w = (x) => { if (f.disabled === !0 || !_t) return; const T = p.value && _t; T && h(e, !1), (m.value || !T) && y(x); }, C = (x) => { Qa(x) && (f.disabled && x ? p.value && h(e, !1) : o.value !== x && (x ? g() : y())); }, E = () => { o.value ? w() : b(); }; return Pe(() => f[t], C), u && v.appContext.config.globalProperties.$route !== void 0 && Pe(() => ({ ...v.proxy.$route }), () => { u.value && o.value && w(); }), Et(() => { C(f[t]); }), { hide: w, show: b, toggle: E, hasUpdateHandler: p }; }, useModelToggleProps: a, useModelToggleEmits: n }; }, Zv = (t) => { const e = gt(); return V(() => { var r, n; return (n = (r = e == null ? void 0 : e.proxy) == null ? void 0 : r.$props) == null ? void 0 : n[t]; }); }; var vr = "top", _r = "bottom", Dr = "right", hr = "left", $u = "auto", bo = [vr, _r, Dr, hr], ei = "start", Xi = "end", Z2 = "clippingParents", Xv = "viewport", _i = "popper", X2 = "reference", pd = bo.reduce(function(t, e) { return t.concat([e + "-" + ei, e + "-" + Xi]); }, []), Ys = [].concat(bo, [$u]).reduce(function(t, e) { return t.concat([e, e + "-" + ei, e + "-" + Xi]); }, []), j2 = "beforeRead", Q2 = "read", J2 = "afterRead", ew = "beforeMain", tw = "main", rw = "afterMain", nw = "beforeWrite", aw = "write", iw = "afterWrite", ow = [j2, Q2, J2, ew, tw, rw, nw, aw, iw]; function tn(t) { return t ? (t.nodeName || "").toLowerCase() : null; } function Kr(t) { if (t == null) return window; if (t.toString() !== "[object Window]") { var e = t.ownerDocument; return e && e.defaultView || window; } return t; } function ti(t) { var e = Kr(t).Element; return t instanceof e || t instanceof Element; } function Tr(t) { var e = Kr(t).HTMLElement; return t instanceof e || t instanceof HTMLElement; } function Ru(t) { if (typeof ShadowRoot > "u") return !1; var e = Kr(t).ShadowRoot; return t instanceof e || t instanceof ShadowRoot; } function sw(t) { var e = t.state; Object.keys(e.elements).forEach(function(r) { var n = e.styles[r] || {}, a = e.attributes[r] || {}, i = e.elements[r]; !Tr(i) || !tn(i) || (Object.assign(i.style, n), Object.keys(a).forEach(function(o) { var s = a[o]; s === !1 ? i.removeAttribute(o) : i.setAttribute(o, s === !0 ? "" : s); })); }); } function lw(t) { var e = t.state, r = { popper: { position: e.options.strategy, left: "0", top: "0", margin: "0" }, arrow: { position: "absolute" }, reference: {} }; return Object.assign(e.elements.popper.style, r.popper), e.styles = r, e.elements.arrow && Object.assign(e.elements.arrow.style, r.arrow), function() { Object.keys(e.elements).forEach(function(n) { var a = e.elements[n], i = e.attributes[n] || {}, o = Object.keys(e.styles.hasOwnProperty(n) ? e.styles[n] : r[n]), s = o.reduce(function(u, l) { return u[l] = "", u; }, {}); !Tr(a) || !tn(a) || (Object.assign(a.style, s), Object.keys(i).forEach(function(u) { a.removeAttribute(u); })); }); }; } var jv = { name: "applyStyles", enabled: !0, phase: "write", fn: sw, effect: lw, requires: ["computeStyles"] }; function Qr(t) { return t.split("-")[0]; } var da = Math.max, Ts = Math.min, ri = Math.round; function ni(t, e) { e === void 0 && (e = !1); var r = t.getBoundingClientRect(), n = 1, a = 1; if (Tr(t) && e) { var i = t.offsetHeight, o = t.offsetWidth; o > 0 && (n = ri(r.width) / o || 1), i > 0 && (a = ri(r.height) / i || 1); } return { width: r.width / n, height: r.height / a, top: r.top / a, right: r.right / n, bottom: r.bottom / a, left: r.left / n, x: r.left / n, y: r.top / a }; } function zu(t) { var e = ni(t), r = t.offsetWidth, n = t.offsetHeight; return Math.abs(e.width - r) <= 1 && (r = e.width), Math.abs(e.height - n) <= 1 && (n = e.height), { x: t.offsetLeft, y: t.offsetTop, width: r, height: n }; } function Qv(t, e) { var r = e.getRootNode && e.getRootNode(); if (t.contains(e)) return !0; if (r && Ru(r)) { var n = e; do { if (n && t.isSameNode(n)) return !0; n = n.parentNode || n.host; } while (n); } return !1; } function pn(t) { return Kr(t).getComputedStyle(t); } function uw(t) { return ["table", "td", "th"].indexOf(tn(t)) >= 0; } function Yn(t) { return ((ti(t) ? t.ownerDocument : t.document) || window.document).documentElement; } function Zs(t) { return tn(t) === "html" ? t : t.assignedSlot || t.parentNode || (Ru(t) ? t.host : null) || Yn(t); } function gd(t) { return !Tr(t) || pn(t).position === "fixed" ? null : t.offsetParent; } function cw(t) { var e = navigator.userAgent.toLowerCase().indexOf("firefox") !== -1, r = navigator.userAgent.indexOf("Trident") !== -1; if (r && Tr(t)) { var n = pn(t); if (n.position === "fixed") return null; } var a = Zs(t); for (Ru(a) && (a = a.host); Tr(a) && ["html", "body"].indexOf(tn(a)) < 0; ) { var i = pn(a); if (i.transform !== "none" || i.perspective !== "none" || i.contain === "paint" || ["transform", "perspective"].indexOf(i.willChange) !== -1 || e && i.willChange === "filter" || e && i.filter && i.filter !== "none") return a; a = a.parentNode; } return null; } function wo(t) { for (var e = Kr(t), r = gd(t); r && uw(r) && pn(r).position === "static"; ) r = gd(r); return r && (tn(r) === "html" || tn(r) === "body" && pn(r).position === "static") ? e : r || cw(t) || e; } function Vu(t) { return ["top", "bottom"].indexOf(t) >= 0 ? "x" : "y"; } function Vi(t, e, r) { return da(t, Ts(e, r)); } function dw(t, e, r) { var n = Vi(t, e, r); return n > r ? r : n; } function Jv() { return { top: 0, right: 0, bottom: 0, left: 0 }; } function eh(t) { return Object.assign({}, Jv(), t); } function th(t, e) { return e.reduce(function(r, n) { return r[n] = t, r; }, {}); } var fw = function(t, e) { return t = typeof t == "function" ? t(Object.assign({}, e.rects, { placement: e.placement })) : t, eh(typeof t != "number" ? t : th(t, bo)); }; function vw(t) { var e, r = t.state, n = t.name, a = t.options, i = r.elements.arrow, o = r.modifiersData.popperOffsets, s = Qr(r.placement), u = Vu(s), l = [hr, Dr].indexOf(s) >= 0, c = l ? "height" : "width"; if (!(!i || !o)) { var d = fw(a.padding, r), v = zu(i), h = u === "y" ? vr : hr, f = u === "y" ? _r : Dr, p = r.rects.reference[c] + r.rects.reference[u] - o[u] - r.rects.popper[c], m = o[u] - r.rects.reference[u], g = wo(i), y = g ? u === "y" ? g.clientHeight || 0 : g.clientWidth || 0 : 0, b = p / 2 - m / 2, w = d[h], C = y - v[c] - d[f], E = y / 2 - v[c] / 2 + b, x = Vi(w, E, C), T = u; r.modifiersData[n] = (e = {}, e[T] = x, e.centerOffset = x - E, e); } } function hw(t) { var e = t.state, r = t.options, n = r.element, a = n === void 0 ? "[data-popper-arrow]" : n; a != null && (typeof a == "string" && (a = e.elements.popper.querySelector(a), !a) || !Qv(e.elements.popper, a) || (e.elements.arrow = a)); } var pw = { name: "arrow", enabled: !0, phase: "main", fn: vw, effect: hw, requires: ["popperOffsets"], requiresIfExists: ["preventOverflow"] }; function ai(t) { return t.split("-")[1]; } var gw = { top: "auto", right: "auto", bottom: "auto", left: "auto" }; function mw(t) { var e = t.x, r = t.y, n = window, a = n.devicePixelRatio || 1; return { x: ri(e * a) / a || 0, y: ri(r * a) / a || 0 }; } function md(t) { var e, r = t.popper, n = t.popperRect, a = t.placement, i = t.variation, o = t.offsets, s = t.position, u = t.gpuAcceleration, l = t.adaptive, c = t.roundOffsets, d = t.isFixed, v = o.x, h = v === void 0 ? 0 : v, f = o.y, p = f === void 0 ? 0 : f, m = typeof c == "function" ? c({ x: h, y: p }) : { x: h, y: p }; h = m.x, p = m.y; var g = o.hasOwnProperty("x"), y = o.hasOwnProperty("y"), b = hr, w = vr, C = window; if (l) { var E = wo(r), x = "clientHeight", T = "clientWidth"; if (E === Kr(r) && (E = Yn(r), pn(E).position !== "static" && s === "absolute" && (x = "scrollHeight", T = "scrollWidth")), E = E, a === vr || (a === hr || a === Dr) && i === Xi) { w = _r; var k = d && E === C && C.visualViewport ? C.visualViewport.height : E[x]; p -= k - n.height, p *= u ? 1 : -1; } if (a === hr || (a === vr || a === _r) && i === Xi) { b = Dr; var _ = d && E === C && C.visualViewport ? C.visualViewport.width : E[T]; h -= _ - n.width, h *= u ? 1 : -1; } } var D = Object.assign({ position: s }, l && gw), O = c === !0 ? mw({ x: h, y: p }) : { x: h, y: p }; if (h = O.x, p = O.y, u) { var F; return Object.assign({}, D, (F = {}, F[w] = y ? "0" : "", F[b] = g ? "0" : "", F.transform = (C.devicePixelRatio || 1) <= 1 ? "translate(" + h + "px, " + p + "px)" : "translate3d(" + h + "px, " + p + "px, 0)", F)); } return Object.assign({}, D, (e = {}, e[w] = y ? p + "px" : "", e[b] = g ? h + "px" : "", e.transform = "", e)); } function yw(t) { var e = t.state, r = t.options, n = r.gpuAcceleration, a = n === void 0 ? !0 : n, i = r.adaptive, o = i === void 0 ? !0 : i, s = r.roundOffsets, u = s === void 0 ? !0 : s, l = { placement: Qr(e.placement), variation: ai(e.placement), popper: e.elements.popper, popperRect: e.rects.popper, gpuAcceleration: a, isFixed: e.options.strategy === "fixed" }; e.modifiersData.popperOffsets != null && (e.styles.popper = Object.assign({}, e.styles.popper, md(Object.assign({}, l, { offsets: e.modifiersData.popperOffsets, position: e.options.strategy, adaptive: o, roundOffsets: u })))), e.modifiersData.arrow != null && (e.styles.arrow = Object.assign({}, e.styles.arrow, md(Object.assign({}, l, { offsets: e.modifiersData.arrow, position: "absolute", adaptive: !1, roundOffsets: u })))), e.attributes.popper = Object.assign({}, e.attributes.popper, { "data-popper-placement": e.placement }); } var rh = { name: "computeStyles", enabled: !0, phase: "beforeWrite", fn: yw, data: {} }, $o = { passive: !0 }; function bw(t) { var e = t.state, r = t.instance, n = t.options, a = n.scroll, i = a === void 0 ? !0 : a, o = n.resize, s = o === void 0 ? !0 : o, u = Kr(e.elements.popper), l = [].concat(e.scrollParents.reference, e.scrollParents.popper); return i && l.forEach(function(c) { c.addEventListener("scroll", r.update, $o); }), s && u.addEventListener("resize", r.update, $o), function() { i && l.forEach(function(c) { c.removeEventListener("scroll", r.update, $o); }), s && u.removeEventListener("resize", r.update, $o); }; } var nh = { name: "eventListeners", enabled: !0, phase: "write", fn: function() { }, effect: bw, data: {} }, ww = { left: "right", right: "left", bottom: "top", top: "bottom" }; function os(t) { return t.replace(/left|right|bottom|top/g, function(e) { return ww[e]; }); } var xw = { start: "end", end: "start" }; function yd(t) { return t.replace(/start|end/g, function(e) { return xw[e]; }); } function Hu(t) { var e = Kr(t), r = e.pageXOffset, n = e.pageYOffset; return { scrollLeft: r, scrollTop: n }; } function qu(t) { return ni(Yn(t)).left + Hu(t).scrollLeft; } function Cw(t) { var e = Kr(t), r = Yn(t), n = e.visualViewport, a = r.clientWidth, i = r.clientHeight, o = 0, s = 0; return n && (a = n.width, i = n.height, /^((?!chrome|android).)*safari/i.test(navigator.userAgent) || (o = n.offsetLeft, s = n.offsetTop)), { width: a, height: i, x: o + qu(t), y: s }; } function Ew(t) { var e, r = Yn(t), n = Hu(t), a = (e = t.ownerDocument) == null ? void 0 : e.body, i = da(r.scrollWidth, r.clientWidth, a ? a.scrollWidth : 0, a ? a.clientWidth : 0), o = da(r.scrollHeight, r.clientHeight, a ? a.scrollHeight : 0, a ? a.clientHeight : 0), s = -n.scrollLeft + qu(t), u = -n.scrollTop; return pn(a || r).direction === "rtl" && (s += da(r.clientWidth, a ? a.clientWidth : 0) - i), { width: i, height: o, x: s, y: u }; } function Ku(t) { var e = pn(t), r = e.overflow, n = e.overflowX, a = e.overflowY; return /auto|scroll|overlay|hidden/.test(r + a + n); } function ah(t) { return ["html", "body", "#document"].indexOf(tn(t)) >= 0 ? t.ownerDocument.body : Tr(t) && Ku(t) ? t : ah(Zs(t)); } function Hi(t, e) { var r; e === void 0 && (e = []); var n = ah(t), a = n === ((r = t.ownerDocument) == null ? void 0 : r.body), i = Kr(n), o = a ? [i].concat(i.visualViewport || [], Ku(n) ? n : []) : n, s = e.concat(o); return a ? s : s.concat(Hi(Zs(o))); } function Jl(t) { return Object.assign({}, t, { left: t.x, top: t.y, right: t.x + t.width, bottom: t.y + t.height }); } function kw(t) { var e = ni(t); return e.top = e.top + t.clientTop, e.left = e.left + t.clientLeft, e.bottom = e.top + t.clientHeight, e.right = e.left + t.clientWidth, e.width = t.clientWidth, e.height = t.clientHeight, e.x = e.left, e.y = e.top, e; } function bd(t, e) { return e === Xv ? Jl(Cw(t)) : ti(e) ? kw(e) : Jl(Ew(Yn(t))); } function Sw(t) { var e = Hi(Zs(t)), r = ["absolute", "fixed"].indexOf(pn(t).position) >= 0, n = r && Tr(t) ? wo(t) : t; return ti(n) ? e.filter(function(a) { return ti(a) && Qv(a, n) && tn(a) !== "body"; }) : []; } function Tw(t, e, r) { var n = e === "clippingParents" ? Sw(t) : [].concat(e), a = [].concat(n, [r]), i = a[0], o = a.reduce(function(s, u) { var l = bd(t, u); return s.top = da(l.top, s.top), s.right = Ts(l.right, s.right), s.bottom = Ts(l.bottom, s.bottom), s.left = da(l.left, s.left), s; }, bd(t, i)); return o.width = o.right - o.left, o.height = o.bottom - o.top, o.x = o.left, o.y = o.top, o; } function ih(t) { var e = t.reference, r = t.element, n = t.placement, a = n ? Qr(n) : null, i = n ? ai(n) : null, o = e.x + e.width / 2 - r.width / 2, s = e.y + e.height / 2 - r.height / 2, u; switch (a) { case vr: u = { x: o, y: e.y - r.height }; break; case _r: u = { x: o, y: e.y + e.height }; break; case Dr: u = { x: e.x + e.width, y: s }; break; case hr: u = { x: e.x - r.width, y: s }; break; default: u = { x: e.x, y: e.y }; } var l = a ? Vu(a) : null; if (l != null) { var c = l === "y" ? "height" : "width"; switch (i) { case ei: u[l] = u[l] - (e[c] / 2 - r[c] / 2); break; case Xi: u[l] = u[l] + (e[c] / 2 - r[c] / 2); break; } } return u; } function ji(t, e) { e === void 0 && (e = {}); var r = e, n = r.placement, a = n === void 0 ? t.placement : n, i = r.boundary, o = i === void 0 ? Z2 : i, s = r.rootBoundary, u = s === void 0 ? Xv : s, l = r.elementContext, c = l === void 0 ? _i : l, d = r.altBoundary, v = d === void 0 ? !1 : d, h = r.padding, f = h === void 0 ? 0 : h, p = eh(typeof f != "number" ? f : th(f, bo)), m = c === _i ? X2 : _i, g = t.rects.popper, y = t.elements[v ? m : c], b = Tw(ti(y) ? y : y.contextElement || Yn(t.elements.popper), o, u), w = ni(t.elements.reference), C = ih({ reference: w, element: g, strategy: "absolute", placement: a }), E = Jl(Object.assign({}, g, C)), x = c === _i ? E : w, T = { top: b.top - x.top + p.top, bottom: x.bottom - b.bottom + p.bottom, left: b.left - x.left + p.left, right: x.right - b.right + p.right }, k = t.modifiersData.offset; if (c === _i && k) { var _ = k[a]; Object.keys(T).forEach(function(D) { var O = [Dr, _r].indexOf(D) >= 0 ? 1 : -1, F = [vr, _r].indexOf(D) >= 0 ? "y" : "x"; T[D] += _[F] * O; }); } return T; } function _w(t, e) { e === void 0 && (e = {}); var r = e, n = r.placement, a = r.boundary, i = r.rootBoundary, o = r.padding, s = r.flipVariations, u = r.allowedAutoPlacements, l = u === void 0 ? Ys : u, c = ai(n), d = c ? s ? pd : pd.filter(function(f) { return ai(f) === c; }) : bo, v = d.filter(function(f) { return l.indexOf(f) >= 0; }); v.length === 0 && (v = d); var h = v.reduce(function(f, p) { return f[p] = ji(t, { placement: p, boundary: a, rootBoundary: i, padding: o })[Qr(p)], f; }, {}); return Object.keys(h).sort(function(f, p) { return h[f] - h[p]; }); } function Dw(t) { if (Qr(t) === $u) return []; var e = os(t); return [yd(t), e, yd(e)]; } function Pw(t) { var e = t.state, r = t.options, n = t.name; if (!e.modifiersData[n]._skip) { for (var a = r.mainAxis, i = a === void 0 ? !0 : a, o = r.altAxis, s = o === void 0 ? !0 : o, u = r.fallbackPlacements, l = r.padding, c = r.boundary, d = r.rootBoundary, v = r.altBoundary, h = r.flipVariations, f = h === void 0 ? !0 : h, p = r.allowedAutoPlacements, m = e.options.placement, g = Qr(m), y = g === m, b = u || (y || !f ? [os(m)] : Dw(m)), w = [m].concat(b).reduce(function(se, oe) { return se.concat(Qr(oe) === $u ? _w(e, { placement: oe, boundary: c, rootBoundary: d, padding: l, flipVariations: f, allowedAutoPlacements: p }) : oe); }, []), C = e.rects.reference, E = e.rects.popper, x = /* @__PURE__ */ new Map(), T = !0, k = w[0], _ = 0; _ < w.length; _++) { var D = w[_], O = Qr(D), F = ai(D) === ei, L = [vr, _r].indexOf(O) >= 0, B = L ? "width" : "height", I = ji(e, { placement: D, boundary: c, rootBoundary: d, altBoundary: v, padding: l }), M = L ? F ? Dr : hr : F ? _r : vr; C[B] > E[B] && (M = os(M)); var A = os(M), R = []; if (i && R.push(I[O] <= 0), s && R.push(I[M] <= 0, I[A] <= 0), R.every(function(se) { return se; })) { k = D, T = !1; break; } x.set(D, R); } if (T) for (var K = f ? 3 : 1, H = function(se) { var oe = w.find(function(ne) { var ue = x.get(ne); if (ue) return ue.slice(0, se).every(function(te) { return te; }); }); if (oe) return k = oe, "break"; }, q = K; q > 0; q--) { var ee = H(q); if (ee === "break") break; } e.placement !== k && (e.modifiersData[n]._skip = !0, e.placement = k, e.reset = !0); } } var Ow = { name: "flip", enabled: !0, phase: "main", fn: Pw, requiresIfExists: ["offset"], data: { _skip: !1 } }; function wd(t, e, r) { return r === void 0 && (r = { x: 0, y: 0 }), { top: t.top - e.height - r.y, right: t.right - e.width + r.x, bottom: t.bottom - e.height + r.y, left: t.left - e.width - r.x }; } function xd(t) { return [vr, Dr, _r, hr].some(function(e) { return t[e] >= 0; }); } function Lw(t) { var e = t.state, r = t.name, n = e.rects.reference, a = e.rects.popper, i = e.modifiersData.preventOverflow, o = ji(e, { elementContext: "reference" }), s = ji(e, { altBoundary: !0 }), u = wd(o, n), l = wd(s, a, i), c = xd(u), d = xd(l); e.modifiersData[r] = { referenceClippingOffsets: u, popperEscapeOffsets: l, isReferenceHidden: c, hasPopperEscaped: d }, e.attributes.popper = Object.assign({}, e.attributes.popper, { "data-popper-reference-hidden": c, "data-popper-escaped": d }); } var Iw = { name: "hide", enabled: !0, phase: "main", requiresIfExists: ["preventOverflow"], fn: Lw }; function Fw(t, e, r) { var n = Qr(t), a = [hr, vr].indexOf(n) >= 0 ? -1 : 1, i = typeof r == "function" ? r(Object.assign({}, e, { placement: t })) : r, o = i[0], s = i[1]; return o = o || 0, s = (s || 0) * a, [hr, Dr].indexOf(n) >= 0 ? { x: s, y: o } : { x: o, y: s }; } function Aw(t) { var e = t.state, r = t.options, n = t.name, a = r.offset, i = a === void 0 ? [0, 0] : a, o = Ys.reduce(function(c, d) { return c[d] = Fw(d, e.rects, i), c; }, {}), s = o[e.placement], u = s.x, l = s.y; e.modifiersData.popperOffsets != null && (e.modifiersData.popperOffsets.x += u, e.modifiersData.popperOffsets.y += l), e.modifiersData[n] = o; } var Mw = { name: "offset", enabled: !0, phase: "main", requires: ["popperOffsets"], fn: Aw }; function Bw(t) { var e = t.state, r = t.name; e.modifiersData[r] = ih({ reference: e.rects.reference, element: e.rects.popper, strategy: "absolute", placement: e.placement }); } var oh = { name: "popperOffsets", enabled: !0, phase: "read", fn: Bw, data: {} }; function Nw(t) { return t === "x" ? "y" : "x"; } function $w(t) { var e = t.state, r = t.options, n = t.name, a = r.mainAxis, i = a === void 0 ? !0 : a, o = r.altAxis, s = o === void 0 ? !1 : o, u = r.boundary, l = r.rootBoundary, c = r.altBoundary, d = r.padding, v = r.tether, h = v === void 0 ? !0 : v, f = r.tetherOffset, p = f === void 0 ? 0 : f, m = ji(e, { boundary: u, rootBoundary: l, padding: d, altBoundary: c }), g = Qr(e.placement), y = ai(e.placement), b = !y, w = Vu(g), C = Nw(w), E = e.modifiersData.popperOffsets, x = e.rects.reference, T = e.rects.popper, k = typeof p == "function" ? p(Object.assign({}, e.rects, { placement: e.placement })) : p, _ = typeof k == "number" ? { mainAxis: k, altAxis: k } : Object.assign({ mainAxis: 0, altAxis: 0 }, k), D = e.modifiersData.offset ? e.modifiersData.offset[e.placement] : null, O = { x: 0, y: 0 }; if (E) { if (i) { var F, L = w === "y" ? vr : hr, B = w === "y" ? _r : Dr, I = w === "y" ? "height" : "width", M = E[w], A = M + m[L], R = M - m[B], K = h ? -T[I] / 2 : 0, H = y === ei ? x[I] : T[I], q = y === ei ? -T[I] : -x[I], ee = e.elements.arrow, se = h && ee ? zu(ee) : { width: 0, height: 0 }, oe = e.modifiersData["arrow#persistent"] ? e.modifiersData["arrow#persistent"].padding : Jv(), ne = oe[L], ue = oe[B], te = Vi(0, x[I], se[I]), $ = b ? x[I] / 2 - K - te - ne - _.mainAxis : H - te - ne - _.mainAxis, G = b ? -x[I] / 2 + K + te + ue + _.mainAxis : q + te + ue + _.mainAxis, Q = e.elements.arrow && wo(e.elements.arrow), ge = Q ? w === "y" ? Q.clientTop || 0 : Q.clientLeft || 0 : 0, Ee = (F = D == null ? void 0 : D[w]) != null ? F : 0, fe = M + $ - Ee - ge, me = M + G - Ee, xe = Vi(h ? Ts(A, fe) : A, M, h ? da(R, me) : R); E[w] = xe, O[w] = xe - M; } if (s) { var ke, Ce = w === "x" ? vr : hr, De = w === "x" ? _r : Dr, qe = E[C], Ke = C === "y" ? "height" : "width", Be = qe + m[Ce], Ge = qe - m[De], le = [vr, hr].indexOf(g) !== -1, S = (ke = D == null ? void 0 : D[C]) != null ? ke : 0, z = le ? Be : qe - x[Ke] - T[Ke] - S + _.altAxis, ae = le ? qe + x[Ke] + T[Ke] - S - _.altAxis : Ge, j = h && le ? dw(z, qe, ae) : Vi(h ? z : Be, qe, h ? ae : Ge); E[C] = j, O[C] = j - qe; } e.modifiersData[n] = O; } } var Rw = { name: "preventOverflow", enabled: !0, phase: "main", fn: $w, requiresIfExists: ["offset"] }; function zw(t) { return { scrollLeft: t.scrollLeft, scrollTop: t.scrollTop }; } function Vw(t) { return t === Kr(t) || !Tr(t) ? Hu(t) : zw(t); } function Hw(t) { var e = t.getBoundingClientRect(), r = ri(e.width) / t.offsetWidth || 1, n = ri(e.height) / t.offsetHeight || 1; return r !== 1 || n !== 1; } function qw(t, e, r) { r === void 0 && (r = !1); var n = Tr(e), a = Tr(e) && Hw(e), i = Yn(e), o = ni(t, a), s = { scrollLeft: 0, scrollTop: 0 }, u = { x: 0, y: 0 }; return (n || !n && !r) && ((tn(e) !== "body" || Ku(i)) && (s = Vw(e)), Tr(e) ? (u = ni(e, !0), u.x += e.clientLeft, u.y += e.clientTop) : i && (u.x = qu(i))), { x: o.left + s.scrollLeft - u.x, y: o.top + s.scrollTop - u.y, width: o.width, height: o.height }; } function Kw(t) { var e = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Set(), n = []; t.forEach(function(i) { e.set(i.name, i); }); function a(i) { r.add(i.name); var o = [].concat(i.requires || [], i.requiresIfExists || []); o.forEach(function(s) { if (!r.has(s)) { var u = e.get(s); u && a(u); } }), n.push(i); } return t.forEach(function(i) { r.has(i.name) || a(i); }), n; } function Uw(t) { var e = Kw(t); return ow.reduce(function(r, n) { return r.concat(e.filter(function(a) { return a.phase === n; })); }, []); } function Gw(t) { var e; return function() { return e || (e = new Promise(function(r) { Promise.resolve().then(function() { e = void 0, r(t()); }); })), e; }; } function Ww(t) { var e = t.reduce(function(r, n) { var a = r[n.name]; return r[n.name] = a ? Object.assign({}, a, n, { options: Object.assign({}, a.options, n.options), data: Object.assign({}, a.data, n.data) }) : n, r; }, {}); return Object.keys(e).map(function(r) { return e[r]; }); } var Cd = { placement: "bottom", modifiers: [], strategy: "absolute" }; function Ed() { for (var t = arguments.length, e = new Array(t), r = 0; r < t; r++) e[r] = arguments[r]; return !e.some(function(n) { return !(n && typeof n.getBoundingClientRect == "function"); }); } function Uu(t) { t === void 0 && (t = {}); var e = t, r = e.defaultModifiers, n = r === void 0 ? [] : r, a = e.defaultOptions, i = a === void 0 ? Cd : a; return function(o, s, u) { u === void 0 && (u = i); var l = { placement: "bottom", orderedModifiers: [], options: Object.assign({}, Cd, i), modifiersData: {}, elements: { reference: o, popper: s }, attributes: {}, styles: {} }, c = [], d = !1, v = { state: l, setOptions: function(p) { var m = typeof p == "function" ? p(l.options) : p; f(), l.options = Object.assign({}, i, l.options, m), l.scrollParents = { reference: ti(o) ? Hi(o) : o.contextElement ? Hi(o.contextElement) : [], popper: Hi(s) }; var g = Uw(Ww([].concat(n, l.options.modifiers))); return l.orderedModifiers = g.filter(function(y) { return y.enabled; }), h(), v.update(); }, forceUpdate: function() { if (!d) { var p = l.elements, m = p.reference, g = p.popper; if (Ed(m, g)) { l.rects = { reference: qw(m, wo(g), l.options.strategy === "fixed"), popper: zu(g) }, l.reset = !1, l.placement = l.options.placement, l.orderedModifiers.forEach(function(T) { return l.modifiersData[T.name] = Object.assign({}, T.data); }); for (var y = 0; y < l.orderedModifiers.length; y++) { if (l.reset === !0) { l.reset = !1, y = -1; continue; } var b = l.orderedModifiers[y], w = b.fn, C = b.options, E = C === void 0 ? {} : C, x = b.name; typeof w == "function" && (l = w({ state: l, options: E, name: x, instance: v }) || l); } } } }, update: Gw(function() { return new Promise(function(p) { v.forceUpdate(), p(l); }); }), destroy: function() { f(), d = !0; } }; if (!Ed(o, s)) return v; v.setOptions(u).then(function(p) { !d && u.onFirstUpdate && u.onFirstUpdate(p); }); function h() { l.orderedModifiers.forEach(function(p) { var m = p.name, g = p.options, y = g === void 0 ? {} : g, b = p.effect; if (typeof b == "function") { var w = b({ state: l, name: m, instance: v, options: y }), C = function() { }; c.push(w || C); } }); } function f() { c.forEach(function(p) { return p(); }), c = []; } return v; }; } Uu(); var Yw = [nh, oh, rh, jv]; Uu({ defaultModifiers: Yw }); var Zw = [nh, oh, rh, jv, Mw, Ow, Rw, pw, Iw], Xw = Uu({ defaultModifiers: Zw }); const jw = (t, e, r = {}) => { const n = { name: "updateState", enabled: !0, phase: "write", fn: ({ state: u }) => { const l = Qw(u); Object.assign(o.value, l); }, requires: ["computeStyles"] }, a = V(() => { const { onFirstUpdate: u, placement: l, strategy: c, modifiers: d } = P(r); return { onFirstUpdate: u, placement: l || "bottom", strategy: c || "absolute", modifiers: [ ...d || [], n, { name: "applyStyles", enabled: !1 } ] }; }), i = jr(), o = ce({ styles: { popper: { position: P(a).strategy, left: "0", top: "0" }, arrow: { position: "absolute" } }, attributes: {} }), s = () => { i.value && (i.value.destroy(), i.value = void 0); }; return Pe(a, (u) => { const l = P(i); l && l.setOptions(u); }, { deep: !0 }), Pe([t, e], ([u, l]) => { s(), !(!u || !l) && (i.value = Xw(u, l, P(a))); }), qr(() => { s(); }), { state: V(() => { var u; return { ...((u = P(i)) == null ? void 0 : u.state) || {} }; }), styles: V(() => P(o).styles), attributes: V(() => P(o).attributes), update: () => { var u; return (u = P(i)) == null ? void 0 : u.update(); }, forceUpdate: () => { var u; return (u = P(i)) == null ? void 0 : u.forceUpdate(); }, instanceRef: V(() => P(i)) }; }; function Qw(t) { const e = Object.keys(t.elements), r = Cs(e.map((a) => [a, t.styles[a] || {}])), n = Cs(e.map((a) => [a, t.attributes[a]])); return { styles: r, attributes: n }; } function kd() { let t; const e = (n, a) => { r(), t = window.setTimeout(n, a); }, r = () => window.clearTimeout(t); return Rs(() => r()), { registerTimeout: e, cancelTimeout: r }; } const eu = { prefix: Math.floor(Math.random() * 1e4), current: 0 }, Jw = Symbol("elIdInjection"), sh = () => gt() ? Ue(Jw, eu) : eu, Xs = (t) => { const e = sh(); !_t && e === eu && Dt("IdInjection", `Looks like you are using server rendering, you must provide a id provider to ensure the hydration process to be succeed usage: app.provide(ID_INJECTION_KEY, { prefix: number, current: number, })`); const r = Nu(); return V(() => P(t) || `${r.value}-id-${e.prefix}-${e.current++}`); }; let za = []; const Sd = (t) => { const e = t; e.key === Lt.esc && za.forEach((r) => r(e)); }, ex = (t) => { Et(() => { za.length === 0 && document.addEventListener("keydown", Sd), _t && za.push(t); }), qr(() => { za = za.filter((e) => e !== t), za.length === 0 && _t && document.removeEventListener("keydown", Sd); }); }; let Td; const lh = () => { const t = Nu(), e = sh(), r = V(() => `${t.value}-popper-container-${e.prefix}`), n = V(() => `#${r.value}`); return { id: r, selector: n }; }, tx = (t) => { const e = document.createElement("div"); return e.id = t, document.body.appendChild(e), e; }, rx = () => { const { id: t, selector: e } = lh(); return w0(() => { _t && (process.env.NODE_ENV === "test" || !Td || !document.body.querySelector(e.value)) && (Td = tx(t.value)); }), { id: t, selector: e }; }, nx = rt({ showAfter: { type: Number, default: 0 }, hideAfter: { type: Number, default: 200 }, autoClose: { type: Number, default: 0 } }), ax = ({ showAfter: t, hideAfter: e, autoClose: r, open: n, close: a }) => { const { registerTimeout: i } = kd(), { registerTimeout: o, cancelTimeout: s } = kd(); return { onOpen: (c) => { i(() => { n(c); const d = P(r); qt(d) && d > 0 && o(() => { a(c); }, d); }, P(t)); }, onClose: (c) => { s(), i(() => { a(c); }, P(e)); } }; }, uh = Symbol("elForwardRef"), ix = (t) => { Ct(uh, { setForwardRef: (r) => { t.value = r; } }); }, ox = (t) => ({ mounted(e) { t(e); }, updated(e) { t(e); }, unmounted() { t(null); } }), _d = { current: 0 }, Dd = ce(0), ch = 2e3, Pd = Symbol("elZIndexContextKey"), dh = Symbol("zIndexContextKey"), fh = (t) => { const e = gt() ? Ue(Pd, _d) : _d, r = t || (gt() ? Ue(dh, void 0) : void 0), n = V(() => { const o = P(r); return qt(o) ? o : ch; }), a = V(() => n.value + Dd.value), i = () => (e.current++, Dd.value = e.current, a.value); return !_t && !Ue(Pd) && Dt("ZIndexInjection", `Looks like you are using server rendering, you must provide a z-index provider to ensure the hydration process to be succeed usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`), { initialZIndex: n, currentZIndex: a, nextZIndex: i }; }; function sx(t) { let e; function r() { if (t.value == null) return; const { selectionStart: a, selectionEnd: i, value: o } = t.value; if (a == null || i == null) return; const s = o.slice(0, Math.max(0, a)), u = o.slice(Math.max(0, i)); e = { selectionStart: a, selectionEnd: i, value: o, beforeTxt: s, afterTxt: u }; } function n() { if (t.value == null || e == null) return; const { value: a } = t.value, { beforeTxt: i, afterTxt: o, selectionStart: s } = e; if (i == null || o == null || s == null) return; let u = a.length; if (a.endsWith(o)) u = a.length - o.length; else if (a.startsWith(i)) u = i.length; else { const l = i[s - 1], c = a.indexOf(l, s - 1); c !== -1 && (u = c + 1); } t.value.setSelectionRange(u, u); } return [r, n]; } const di = Ws({ type: String, values: Gv, required: !1 }), vh = Symbol("size"), lx = () => { const t = Ue(vh, {}); return V(() => P(t.size) || ""); }; function Gu(t, { beforeFocus: e, afterFocus: r, beforeBlur: n, afterBlur: a } = {}) { const i = gt(), { emit: o } = i, s = jr(), u = ce(!1), l = (v) => { lr(e) && e(v) || u.value || (u.value = !0, o("focus", v), r == null || r()); }, c = (v) => { var h; lr(n) && n(v) || v.relatedTarget && ((h = s.value) != null && h.contains(v.relatedTarget)) || (u.value = !1, o("blur", v), a == null || a()); }, d = () => { var v, h; (v = s.value) != null && v.contains(document.activeElement) && s.value !== document.activeElement || (h = t.value) == null || h.focus(); }; return Pe(s, (v) => { v && v.setAttribute("tabindex", "-1"); }), kr(s, "focus", l, !0), kr(s, "blur", c, !0), kr(s, "click", d, !0), process.env.NODE_ENV === "test" && Et(() => { const v = ua(t.value) ? t.value : document.querySelector("input,textarea"); v && (kr(v, "focus", l, !0), kr(v, "blur", c, !0)); }), { isFocused: u, wrapperRef: s, handleFocus: l, handleBlur: c }; } function hh({ afterComposition: t, emit: e }) { const r = ce(!1), n = (s) => { e == null || e("compositionstart", s), r.value = !0; }, a = (s) => { var u; e == null || e("compositionupdate", s); const l = (u = s.target) == null ? void 0 : u.value, c = l[l.length - 1] || ""; r.value = !N2(c); }, i = (s) => { e == null || e("compositionend", s), r.value && (r.value = !1, ot(() => t(s))); }; return { isComposing: r, handleComposition: (s) => { s.type === "compositionend" ? i(s) : a(s); }, handleCompositionStart: n, handleCompositionUpdate: a, handleCompositionEnd: i }; } const ph = Symbol("emptyValuesContextKey"), ux = "use-empty-values", cx = ["", void 0, null], dx = void 0, fx = rt({ emptyValues: Array, valueOnClear: { type: [String, Number, Boolean, Function], default: void 0, validator: (t) => lr(t) ? !t() : !t } }), vx = (t, e) => { const r = gt() ? Ue(ph, ce({})) : ce({}), n = V(() => t.emptyValues || r.value.emptyValues || cx), a = V(() => lr(t.valueOnClear) ? t.valueOnClear() : t.valueOnClear !== void 0 ? t.valueOnClear : lr(r.value.valueOnClear) ? r.value.valueOnClear() : r.value.valueOnClear !== void 0 ? r.value.valueOnClear : dx), i = (o) => n.value.includes(o); return n.value.includes(a.value) || Dt(ux, "value-on-clear should be a value of empty-values"), { emptyValues: n, valueOnClear: a, isEmptyValue: i }; }, hx = rt({ ariaLabel: String, ariaOrientation: { type: String, values: ["horizontal", "vertical", "undefined"] }, ariaControls: String }), Zn = (t) => zv(hx, t), gh = Symbol(), _s = ce(); function Wu(t, e = void 0) { const r = gt() ? Ue(gh, _s) : _s; return t ? V(() => { var n, a; return (a = (n = r.value) == null ? void 0 : n[t]) != null ? a : e; }) : r; } function px(t, e) { const r = Wu(), n = He(t, V(() => { var s; return ((s = r.value) == null ? void 0 : s.namespace) || is; })), a = yo(V(() => { var s; return (s = r.value) == null ? void 0 : s.locale; })), i = fh(V(() => { var s; return ((s = r.value) == null ? void 0 : s.zIndex) || ch; })), o = V(() => { var s; return P(e) || ((s = r.value) == null ? void 0 : s.size) || ""; }); return gx(V(() => P(r) || {})), { ns: n, locale: a, zIndex: i, size: o }; } const gx = (t, e, r = !1) => { var n; const a = !!gt(), i = a ? Wu() : void 0, o = (n = void 0) != null ? n : a ? Ct : void 0; if (!o) { Dt("provideGlobalConfig", "provideGlobalConfig() can only be used inside setup()."); return; } const s = V(() => { const u = P(t); return i != null && i.value ? mx(i.value, u) : u; }); return o(gh, s), o(Wv, V(() => s.value.locale)), o(Yv, V(() => s.value.namespace)), o(dh, V(() => s.value.zIndex)), o(vh, { size: V(() => s.value.size || "") }), o(ph, V(() => ({ emptyValues: s.value.emptyValues, valueOnClear: s.value.valueOnClear }))), (r || !_s.value) && (_s.value = s.value), s; }, mx = (t, e) => { const r = [.../* @__PURE__ */ new Set([...hd(t), ...hd(e)])], n = {}; for (const a of r) n[a] = e[a] !== void 0 ? e[a] : t[a]; return n; }; var Ve = (t, e) => { const r = t.__vccOpts || t; for (const [n, a] of e) r[n] = a; return r; }; const yx = rt({ size: { type: $e([Number, String]) }, color: { type: String } }), bx = de({ name: "ElIcon", inheritAttrs: !1 }), wx = /* @__PURE__ */ de({ ...bx, props: yx, setup(t) { const e = t, r = He("icon"), n = V(() => { const { size: a, color: i } = e; return !a && !i ? {} : { fontSize: Mn(a) ? void 0 : Ja(a), "--color": i }; }); return (a, i) => (N(), Z("i", Rr({ class: P(r).b(), style: P(n) }, a.$attrs), [ Le(a.$slots, "default") ], 16)); } }); var xx = /* @__PURE__ */ Ve(wx, [["__file", "icon.vue"]]); const Vt = $t(xx), Yu = Symbol("formContextKey"), Qi = Symbol("formItemContextKey"), pa = (t, e = {}) => { const r = ce(void 0), n = e.prop ? r : Zv("size"), a = e.global ? r : lx(), i = e.form ? { size: void 0 } : Ue(Yu, void 0), o = e.formItem ? { size: void 0 } : Ue(Qi, void 0); return V(() => n.value || P(t) || (o == null ? void 0 : o.size) || (i == null ? void 0 : i.size) || a.value || ""); }, xo = (t) => { const e = Zv("disabled"), r = Ue(Yu, void 0); return V(() => e.value || P(t) || (r == null ? void 0 : r.disabled) || !1); }, Ta = () => { const t = Ue(Yu, void 0), e = Ue(Qi, void 0); return { form: t, formItem: e }; }, Co = (t, { formItemContext: e, disableIdGeneration: r, disableIdManagement: n }) => { r || (r = ce(!1)), n || (n = ce(!1)); const a = ce(); let i; const o = V(() => { var s; return !!(!(t.label || t.ariaLabel) && e && e.inputIds && ((s = e.inputIds) == null ? void 0 : s.length) <= 1); }); return Et(() => { i = Pe([$r(t, "id"), r], ([s, u]) => { const l = s ?? (u ? void 0 : Xs().value); l !== a.value && (e != null && e.removeInputId && (a.value && e.removeInputId(a.value), !(n != null && n.value) && !u && l && e.addInputId(l)), a.value = l); }, { immediate: !0 }); }), x0(() => { i && i(), e != null && e.removeInputId && a.value && e.removeInputId(a.value); }), { isLabeledByFormItem: o, inputId: a }; }; let Fr; const Cx = ` height:0 !important; visibility:hidden !important; ${j0() ? "" : "overflow:hidden !important;"} position:absolute !important; z-index:-1000 !important; top:0 !important; right:0 !important; `, Ex = [ "letter-spacing", "line-height", "padding-top", "padding-bottom", "font-family", "font-weight", "font-size", "text-rendering", "text-transform", "width", "text-indent", "padding-left", "padding-right", "border-width", "box-sizing" ]; function kx(t) { const e = window.getComputedStyle(t), r = e.getPropertyValue("box-sizing"), n = Number.parseFloat(e.getPropertyValue("padding-bottom")) + Number.parseFloat(e.getPropertyValue("padding-top")), a = Number.parseFloat(e.getPropertyValue("border-bottom-width")) + Number.parseFloat(e.getPropertyValue("border-top-width")); return { contextStyle: Ex.map((o) => `${o}:${e.getPropertyValue(o)}`).join(";"), paddingSize: n, borderSize: a, boxSizing: r }; } function Od(t, e = 1, r) { var n; Fr || (Fr = document.createElement("textarea"), document.body.appendChild(Fr)); const { paddingSize: a, borderSize: i, boxSizing: o, contextStyle: s } = kx(t); Fr.setAttribute("style", `${s};${Cx}`), Fr.value = t.value || t.placeholder || ""; let u = Fr.scrollHeight; const l = {}; o === "border-box" ? u = u + i : o === "content-box" && (u = u - a), Fr.value = ""; const c = Fr.scrollHeight - a; if (qt(e)) { let d = c * e; o === "border-box" && (d = d + a + i), u = Math.max(d, u), l.minHeight = `${d}px`; } if (qt(r)) { let d = c * r; o === "border-box" && (d = d + a + i), u = Math.min(d, u); } return l.height = `${u}px`, (n = Fr.parentNode) == null || n.removeChild(Fr), Fr = void 0, l; } const Sx = rt({ id: { type: String, default: void 0 }, size: di, disabled: Boolean, modelValue: { type: $e([ String, Number, Object ]), default: "" }, maxlength: { type: [String, Number] }, minlength: { type: [String, Number] }, type: { type: String, default: "text" }, resize: { type: String, values: ["none", "both", "horizontal", "vertical"] }, autosize: { type: $e([Boolean, Object]), default: !1 }, autocomplete: { type: String, default: "off" }, formatter: { type: Function }, parser: { type: Function }, placeholder: { type: String }, form: { type: String }, readonly: Boolean, clearable: Boolean, showPassword: Boolean, showWordLimit: Boolean, suffixIcon: { type: Hn }, prefixIcon: { type: Hn }, containerRole: { type: String, default: void 0 }, tabindex: { type: [String, Number], default: 0 }, validateEvent: { type: Boolean, default: !0 }, inputStyle: { type: $e([Object, Array, String]), default: () => Ra({}) }, autofocus: Boolean, rows: { type: Number, default: 2 }, ...Zn(["ariaLabel"]) }), Tx = { [zt]: (t) => tr(t), input: (t) => tr(t), change: (t) => tr(t), focus: (t) => t instanceof FocusEvent, blur: (t) => t instanceof FocusEvent, clear: () => !0, mouseleave: (t) => t instanceof MouseEvent, mouseenter: (t) => t instanceof MouseEvent, keydown: (t) => t instanceof Event, compositionstart: (t) => t instanceof CompositionEvent, compositionupdate: (t) => t instanceof CompositionEvent, compositionend: (t) => t instanceof CompositionEvent }, _x = de({ name: "ElInput", inheritAttrs: !1 }), Dx = /* @__PURE__ */ de({ ..._x, props: Sx, emits: Tx, setup(t, { expose: e, emit: r }) { const n = t, a = C0(), i = vo(), o = V(() => { const S = {}; return n.containerRole === "combobox" && (S["aria-haspopup"] = a["aria-haspopup"], S["aria-owns"] = a["aria-owns"], S["aria-expanded"] = a["aria-expanded"]), S; }), s = V(() => [ n.type === "textarea" ? m.b() : p.b(), p.m(h.value), p.is("disabled", f.value), p.is("exceed", ee.value), { [p.b("group")]: i.prepend || i.append, [p.m("prefix")]: i.prefix || n.prefixIcon, [p.m("suffix")]: i.suffix || n.suffixIcon || n.clearable || n.showPassword, [p.bm("suffix", "password-clear")]: R.value && K.value, [p.b("hidden")]: n.type === "hidden" }, a.class ]), u = V(() => [ p.e("wrapper"), p.is("focus", k.value) ]), l = z2({ excludeKeys: V(() => Object.keys(o.value)) }), { form: c, formItem: d } = Ta(), { inputId: v } = Co(n, { formItemContext: d }), h = pa(), f = xo(), p = He("input"), m = He("textarea"), g = jr(), y = jr(), b = ce(!1), w = ce(!1), C = ce(), E = jr(n.inputStyle), x = V(() => g.value || y.value), { wrapperRef: T, isFocused: k, handleFocus: _, handleBlur: D } = Gu(x, { beforeFocus() { return f.value; }, afterBlur() { var S; n.validateEvent && ((S = d == null ? void 0 : d.validate) == null || S.call(d, "blur").catch((z) => Dt(z))); } }), O = V(() => { var S; return (S = c == null ? void 0 : c.statusIcon) != null ? S : !1; }), F = V(() => (d == null ? void 0 : d.validateState) || ""), L = V(() => F.value && Uv[F.value]), B = V(() => w.value ? D2 : b2), I = V(() => [ a.style ]), M = V(() => [ n.inputStyle, E.value, { resize: n.resize } ]), A = V(() => $n(n.modelValue) ? "" : String(n.modelValue)), R = V(() => n.clearable && !f.value && !n.readonly && !!A.value && (k.value || b.value)), K = V(() => n.showPassword && !f.value && !n.readonly && !!A.value && (!!A.value || k.value)), H = V(() => n.showWordLimit && !!n.maxlength && (n.type === "text" || n.type === "textarea") && !f.value && !n.readonly && !n.showPassword), q = V(() => A.value.length), ee = V(() => !!H.value && q.value > Number(n.maxlength)), se = V(() => !!i.suffix || !!n.suffixIcon || R.value || n.showPassword || H.value || !!F.value && O.value), [oe, ne] = sx(g); dn(y, (S) => { if ($(), !H.value || n.resize !== "both") return; const z = S[0], { width: ae } = z.contentRect; C.value = { right: `calc(100% - ${ae + 15 + 6}px)` }; }); const ue = () => { const { type: S, autosize: z } = n; if (!(!_t || S !== "textarea" || !y.value)) if (z) { const ae = Ht(z) ? z.minRows : void 0, j = Ht(z) ? z.maxRows : void 0, Y = Od(y.value, ae, j); E.value = { overflowY: "hidden", ...Y }, ot(() => { y.value.offsetHeight, E.value = Y; }); } else E.value = { minHeight: Od(y.value).minHeight }; }, $ = ((S) => { let z = !1; return () => { var ae; if (z || !n.autosize) return; ((ae = y.value) == null ? void 0 : ae.offsetParent) === null || (S(), z = !0); }; })(ue), G = () => { const S = x.value, z = n.formatter ? n.formatter(A.value) : A.value; !S || S.value === z || (S.value = z); }, Q = async (S) => { oe(); let { value: z } = S.target; if (n.formatter && (z = n.parser ? n.parser(z) : z), !Ee.value) { if (z === A.value) { G(); return; } r(zt, z), r("input", z), await ot(), G(), ne(); } }, ge = (S) => { r("change", S.target.value); }, { isComposing: Ee, handleCompositionStart: fe, handleCompositionUpdate: me, handleCompositionEnd: xe } = hh({ emit: r, afterComposition: Q }), ke = () => { w.value = !w.value, Ce(); }, Ce = async () => { var S; await ot(), (S = x.value) == null || S.focus(); }, De = () => { var S; return (S = x.value) == null ? void 0 : S.blur(); }, qe = (S) => { b.value = !1, r("mouseleave", S); }, Ke = (S) => { b.value = !0, r("mouseenter", S); }, Be = (S) => { r("keydown", S); }, Ge = () => { var S; (S = x.value) == null || S.select(); }, le = () => { r(zt, ""), r("change", ""), r("clear"), r("input", ""); }; return Pe(() => n.modelValue, () => { var S; ot(() => ue()), n.validateEvent && ((S = d == null ? void 0 : d.validate) == null || S.call(d, "change").catch((z) => Dt(z))); }), Pe(A, () => G()), Pe(() => n.type, async () => { await ot(), G(), ue(); }), Et(() => { !n.formatter && n.parser && Dt("ElInput", "If you set the parser, you also need to set the formatter."), G(), ot(ue); }), e({ input: g, textarea: y, ref: x, textareaStyle: M, autosize: $r(n, "autosize"), isComposing: Ee, focus: Ce, blur: De, select: Ge, clear: le, resizeTextarea: ue }), (S, z) => (N(), Z("div", Rr(P(o), { class: [ P(s), { [P(p).bm("group", "append")]: S.$slots.append, [P(p).bm("group", "prepend")]: S.$slots.prepend } ], style: P(I), role: S.containerRole, onMouseenter: Ke, onMouseleave: qe }), [ he(" input "), S.type !== "textarea" ? (N(), Z(Qe, { key: 0 }, [ he(" prepend slot "), S.$slots.prepend ? (N(), Z("div", { key: 0, class: ie(P(p).be("group", "prepend")) }, [ Le(S.$slots, "prepend") ], 2)) : he("v-if", !0), X("div", { ref_key: "wrapperRef", ref: T, class: ie(P(u)) }, [ he(" prefix slot "), S.$slots.prefix || S.prefixIcon ? (N(), Z("span", { key: 0, class: ie(P(p).e("prefix")) }, [ X("span", { class: ie(P(p).e("prefix-inner")) }, [ Le(S.$slots, "prefix"), S.prefixIcon ? (N(), ye(P(Vt), { key: 0, class: ie(P(p).e("icon")) }, { default: U(() => [ (N(), ye(er(S.prefixIcon))) ]), _: 1 }, 8, ["class"])) : he("v-if", !0) ], 2) ], 2)) : he("v-if", !0), X("input", Rr({ id: P(v), ref_key: "input", ref: g, class: P(p).e("inner") }, P(l), { minlength: S.minlength, maxlength: S.maxlength, type: S.showPassword ? w.value ? "text" : "password" : S.type, disabled: P(f), readonly: S.readonly, autocomplete: S.autocomplete, tabindex: S.tabindex, "aria-label": S.ariaLabel, placeholder: S.placeholder, style: S.inputStyle, form: S.form, autofocus: S.autofocus, onCompositionstart: P(fe), onCompositionupdate: P(me), onCompositionend: P(xe), onInput: Q, onChange: ge, onKeydown: Be }), null, 16, ["id", "minlength", "maxlength", "type", "disabled", "readonly", "autocomplete", "tabindex", "aria-label", "placeholder", "form", "autofocus", "onCompositionstart", "onCompositionupdate", "onCompositionend"]), he(" suffix slot "), P(se) ? (N(), Z("span", { key: 1, class: ie(P(p).e("suffix")) }, [ X("span", { class: ie(P(p).e("suffix-inner")) }, [ !P(R) || !P(K) || !P(H) ? (N(), Z(Qe, { key: 0 }, [ Le(S.$slots, "suffix"), S.suffixIcon ? (N(), ye(P(Vt), { key: 0, class: ie(P(p).e("icon")) }, { default: U(() => [ (N(), ye(er(S.suffixIcon))) ]), _: 1 }, 8, ["class"])) : he("v-if", !0) ], 64)) : he("v-if", !0), P(R) ? (N(), ye(P(Vt), { key: 1, class: ie([P(p).e("icon"), P(p).e("clear")]), onMousedown: ht(P(Wi), ["prevent"]), onClick: le }, { default: U(() => [ J(P(Au)) ]), _: 1 }, 8, ["class", "onMousedown"])) : he("v-if", !0), P(K) ? (N(), ye(P(Vt), { key: 2, class: ie([P(p).e("icon"), P(p).e("password")]), onClick: ke }, { default: U(() => [ (N(), ye(er(P(B)))) ]), _: 1 }, 8, ["class"])) : he("v-if", !0), P(H) ? (N(), Z("span", { key: 3, class: ie(P(p).e("count")) }, [ X("span", { class: ie(P(p).e("count-inner")) }, Ie(P(q)) + " / " + Ie(S.maxlength), 3) ], 2)) : he("v-if", !0), P(F) && P(L) && P(O) ? (N(), ye(P(Vt), { key: 4, class: ie([ P(p).e("icon"), P(p).e("validateIcon"), P(p).is("loading", P(F) === "validating") ]) }, { default: U(() => [ (N(), ye(er(P(L)))) ]), _: 1 }, 8, ["class"])) : he("v-if", !0) ], 2) ], 2)) : he("v-if", !0) ], 2), he(" append slot "), S.$slots.append ? (N(), Z("div", { key: 1, class: ie(P(p).be("group", "append")) }, [ Le(S.$slots, "append") ], 2)) : he("v-if", !0) ], 64)) : (N(), Z(Qe, { key: 1 }, [ he(" textarea "), X("textarea", Rr({ id: P(v), ref_key: "textarea", ref: y, class: [P(m).e("inner"), P(p).is("focus", P(k))] }, P(l), { minlength: S.minlength, maxlength: S.maxlength, tabindex: S.tabindex, disabled: P(f), readonly: S.readonly, autocomplete: S.autocomplete, style: P(M), "aria-label": S.ariaLabel, placeholder: S.placeholder, form: S.form, autofocus: S.autofocus, rows: S.rows, onCompositionstart: P(fe), onCompositionupdate: P(me), onCompositionend: P(xe), onInput: Q, onFocus: P(_), onBlur: P(D), onChange: ge, onKeydown: Be }), null, 16, ["id", "minlength", "maxlength", "tabindex", "disabled", "readonly", "autocomplete", "aria-label", "placeholder", "form", "autofocus", "rows", "onCompositionstart", "onCompositionupdate", "onCompositionend", "onFocus", "onBlur"]), P(H) ? (N(), Z("span", { key: 0, style: lt(C.value), class: ie(P(p).e("count")) }, Ie(P(q)) + " / " + Ie(S.maxlength), 7)) : he("v-if", !0) ], 64)) ], 16, ["role"])); } }); var Px = /* @__PURE__ */ Ve(Dx, [["__file", "input.vue"]]); const Eo = $t(Px), La = 4, Ox = { vertical: { offset: "offsetHeight", scroll: "scrollTop", scrollSize: "scrollHeight", size: "height", key: "vertical", axis: "Y", client: "clientY", direction: "top" }, horizontal: { offset: "offsetWidth", scroll: "scrollLeft", scrollSize: "scrollWidth", size: "width", key: "horizontal", axis: "X", client: "clientX", direction: "left" } }, Lx = ({ move: t, size: e, bar: r }) => ({ [r.size]: e, transform: `translate${r.axis}(${t}%)` }), Zu = Symbol("scrollbarContextKey"), Ix = rt({ vertical: Boolean, size: String, move: Number, ratio: { type: Number, required: !0 }, always: Boolean }), Fx = "Thumb", Ax = /* @__PURE__ */ de({ __name: "thumb", props: Ix, setup(t) { const e = t, r = Ue(Zu), n = He("scrollbar"); r || jb(Fx, "can not inject scrollbar context"); const a = ce(), i = ce(), o = ce({}), s = ce(!1); let u = !1, l = !1, c = _t ? document.onselectstart : null; const d = V(() => Ox[e.vertical ? "vertical" : "horizontal"]), v = V(() => Lx({ size: e.size, move: e.move, bar: d.value })), h = V(() => a.value[d.value.offset] ** 2 / r.wrapElement[d.value.scrollSize] / e.ratio / i.value[d.value.offset]), f = (E) => { var x; if (E.stopPropagation(), E.ctrlKey || [1, 2].includes(E.button)) return; (x = window.getSelection()) == null || x.removeAllRanges(), m(E); const T = E.currentTarget; T && (o.value[d.value.axis] = T[d.value.offset] - (E[d.value.client] - T.getBoundingClientRect()[d.value.direction])); }, p = (E) => { if (!i.value || !a.value || !r.wrapElement) return; const x = Math.abs(E.target.getBoundingClientRect()[d.value.direction] - E[d.value.client]), T = i.value[d.value.offset] / 2, k = (x - T) * 100 * h.value / a.value[d.value.offset]; r.wrapElement[d.value.scroll] = k * r.wrapElement[d.value.scrollSize] / 100; }, m = (E) => { E.stopImmediatePropagation(), u = !0, document.addEventListener("mousemove", g), document.addEventListener("mouseup", y), c = document.onselectstart, document.onselectstart = () => !1; }, g = (E) => { if (!a.value || !i.value || u === !1) return; const x = o.value[d.value.axis]; if (!x) return; const T = (a.value.getBoundingClientRect()[d.value.direction] - E[d.value.client]) * -1, k = i.value[d.value.offset] - x, _ = (T - k) * 100 * h.value / a.value[d.value.offset]; r.wrapElement[d.value.scroll] = _ * r.wrapElement[d.value.scrollSize] / 100; }, y = () => { u = !1, o.value[d.value.axis] = 0, document.removeEventListener("mousemove", g), document.removeEventListener("mouseup", y), C(), l && (s.value = !1); }, b = () => { l = !1, s.value = !!e.size; }, w = () => { l = !0, s.value = u; }; qr(() => { C(), document.removeEventListener("mouseup", y); }); const C = () => { document.onselectstart !== c && (document.onselectstart = c); }; return kr($r(r, "scrollbarElement"), "mousemove", b), kr($r(r, "scrollbarElement"), "mouseleave", w), (E, x) => (N(), ye(ui, { name: P(n).b("fade"), persisted: "" }, { default: U(() => [ Ze(X("div", { ref_key: "instance", ref: a, class: ie([P(n).e("bar"), P(n).is(P(d).key)]), onMousedown: p }, [ X("div", { ref_key: "thumb", ref: i, class: ie(P(n).e("thumb")), style: lt(P(v)), onMousedown: f }, null, 38) ], 34), [ [mt, E.always || s.value] ]) ]), _: 1 }, 8, ["name"])); } }); var Ld = /* @__PURE__ */ Ve(Ax, [["__file", "thumb.vue"]]); const Mx = rt({ always: { type: Boolean, default: !0 }, minSize: { type: Number, required: !0 } }), Bx = /* @__PURE__ */ de({ __name: "bar", props: Mx, setup(t, { expose: e }) { const r = t, n = Ue(Zu), a = ce(0), i = ce(0), o = ce(""), s = ce(""), u = ce(1), l = ce(1); return e({ handleScroll: (v) => { if (v) { const h = v.offsetHeight - La, f = v.offsetWidth - La; i.value = v.scrollTop * 100 / h * u.value, a.value = v.scrollLeft * 100 / f * l.value; } }, update: () => { const v = n == null ? void 0 : n.wrapElement; if (!v) return; const h = v.offsetHeight - La, f = v.offsetWidth - La, p = h ** 2 / v.scrollHeight, m = f ** 2 / v.scrollWidth, g = Math.max(p, r.minSize), y = Math.max(m, r.minSize); u.value = p / (h - p) / (g / (h - g)), l.value = m / (f - m) / (y / (f - y)), s.value = g + La < h ? `${g}px` : "", o.value = y + La < f ? `${y}px` : ""; } }), (v, h) => (N(), Z(Qe, null, [ J(Ld, { move: a.value, ratio: l.value, size: o.value, always: v.always }, null, 8, ["move", "ratio", "size", "always"]), J(Ld, { move: i.value, ratio: u.value, size: s.value, vertical: "", always: v.always }, null, 8, ["move", "ratio", "size", "always"]) ], 64)); } }); var Nx = /* @__PURE__ */ Ve(Bx, [["__file", "bar.vue"]]); const $x = rt({ height: { type: [String, Number], default: "" }, maxHeight: { type: [String, Number], default: "" }, native: { type: Boolean, default: !1 }, wrapStyle: { type: $e([String, Object, Array]), default: "" }, wrapClass: { type: [String, Array], default: "" }, viewClass: { type: [String, Array], default: "" }, viewStyle: { type: [String, Array, Object], default: "" }, noresize: Boolean, tag: { type: String, default: "div" }, always: Boolean, minSize: { type: Number, default: 20 }, tabindex: { type: [String, Number], default: void 0 }, id: String, role: String, ...Zn(["ariaLabel", "ariaOrientation"]) }), Rx = { scroll: ({ scrollTop: t, scrollLeft: e }) => [t, e].every(qt) }, tu = "ElScrollbar", zx = de({ name: tu }), Vx = /* @__PURE__ */ de({ ...zx, props: $x, emits: Rx, setup(t, { expose: e, emit: r }) { const n = t, a = He("scrollbar"); let i, o, s = 0, u = 0; const l = ce(), c = ce(), d = ce(), v = ce(), h = V(() => { const C = {}; return n.height && (C.height = Ja(n.height)), n.maxHeight && (C.maxHeight = Ja(n.maxHeight)), [n.wrapStyle, C]; }), f = V(() => [ n.wrapClass, a.e("wrap"), { [a.em("wrap", "hidden-default")]: !n.native } ]), p = V(() => [a.e("view"), n.viewClass]), m = () => { var C; c.value && ((C = v.value) == null || C.handleScroll(c.value), s = c.value.scrollTop, u = c.value.scrollLeft, r("scroll", { scrollTop: c.value.scrollTop, scrollLeft: c.value.scrollLeft })); }; function g(C, E) { Ht(C) ? c.value.scrollTo(C) : qt(C) && qt(E) && c.value.scrollTo(C, E); } const y = (C) => { if (!qt(C)) { Dt(tu, "value must be a number"); return; } c.value.scrollTop = C; }, b = (C) => { if (!qt(C)) { Dt(tu, "value must be a number"); return; } c.value.scrollLeft = C; }, w = () => { var C; (C = v.value) == null || C.update(); }; return Pe(() => n.noresize, (C) => { C ? (i == null || i(), o == null || o()) : ({ stop: i } = dn(d, w), o = kr("resize", w)); }, { immediate: !0 }), Pe(() => [n.maxHeight, n.height], () => { n.native || ot(() => { var C; w(), c.value && ((C = v.value) == null || C.handleScroll(c.value)); }); }), Ct(Zu, Jr({ scrollbarElement: l, wrapElement: c })), E0(() => { c.value && (c.value.scrollTop = s, c.value.scrollLeft = u); }), Et(() => { n.native || ot(() => { w(); }); }), mv(() => w()), e({ wrapRef: c, update: w, scrollTo: g, setScrollTop: y, setScrollLeft: b, handleScroll: m }), (C, E) => (N(), Z("div", { ref_key: "scrollbarRef", ref: l, class: ie(P(a).b()) }, [ X("div", { ref_key: "wrapRef", ref: c, class: ie(P(f)), style: lt(P(h)), tabindex: C.tabindex, onScroll: m }, [ (N(), ye(er(C.tag), { id: C.id, ref_key: "resizeRef", ref: d, class: ie(P(p)), style: lt(C.viewStyle), role: C.role, "aria-label": C.ariaLabel, "aria-orientation": C.ariaOrientation }, { default: U(() => [ Le(C.$slots, "default") ]), _: 3 }, 8, ["id", "class", "style", "role", "aria-label", "aria-orientation"])) ], 46, ["tabindex"]), C.native ? he("v-if", !0) : (N(), ye(Nx, { key: 0, ref_key: "barRef", ref: v, always: C.always, "min-size": C.minSize }, null, 8, ["always", "min-size"])) ], 2)); } }); var Hx = /* @__PURE__ */ Ve(Vx, [["__file", "scrollbar.vue"]]); const qx = $t(Hx), Xu = Symbol("popper"), mh = Symbol("popperContent"), Kx = [ "dialog", "grid", "group", "listbox", "menu", "navigation", "tooltip", "tree" ], yh = rt({ role: { type: String, values: Kx, default: "tooltip" } }), Ux = de({ name: "ElPopper", inheritAttrs: !1 }), Gx = /* @__PURE__ */ de({ ...Ux, props: yh, setup(t, { expose: e }) { const r = t, n = ce(), a = ce(), i = ce(), o = ce(), s = V(() => r.role), u = { triggerRef: n, popperInstanceRef: a, contentRef: i, referenceRef: o, role: s }; return e(u), Ct(Xu, u), (l, c) => Le(l.$slots, "default"); } }); var Wx = /* @__PURE__ */ Ve(Gx, [["__file", "popper.vue"]]); const bh = rt({ arrowOffset: { type: Number, default: 5 } }), Yx = de({ name: "ElPopperArrow", inheritAttrs: !1 }), Zx = /* @__PURE__ */ de({ ...Yx, props: bh, setup(t, { expose: e }) { const r = t, n = He("popper"), { arrowOffset: a, arrowRef: i, arrowStyle: o } = Ue(mh, void 0); return Pe(() => r.arrowOffset, (s) => { a.value = s; }), qr(() => { i.value = void 0; }), e({ arrowRef: i }), (s, u) => (N(), Z("span", { ref_key: "arrowRef", ref: i, class: ie(P(n).e("arrow")), style: lt(P(o)), "data-popper-arrow": "" }, null, 6)); } }); var Xx = /* @__PURE__ */ Ve(Zx, [["__file", "arrow.vue"]]); const kl = "ElOnlyChild", jx = de({ name: kl, setup(t, { slots: e, attrs: r }) { var n; const a = Ue(uh), i = ox((n = a == null ? void 0 : a.setForwardRef) != null ? n : Wi); return () => { var o; const s = (o = e.default) == null ? void 0 : o.call(e, r); if (!s) return null; if (s.length > 1) return Dt(kl, "requires exact only one valid child."), null; const u = wh(s); return u ? Ze(k0(u, r), [[i]]) : (Dt(kl, "no valid child node found"), null); }; } }); function wh(t) { if (!t) return null; const e = t; for (const r of e) { if (Ht(r)) switch (r.type) { case S0: continue; case yv: case "svg": return Id(r); case Qe: return wh(r.children); default: return r; } return Id(r); } return null; } function Id(t) { const e = He("only-child"); return J("span", { class: e.e("content") }, [t]); } const xh = rt({ virtualRef: { type: $e(Object) }, virtualTriggering: Boolean, onMouseenter: { type: $e(Function) }, onMouseleave: { type: $e(Function) }, onClick: { type: $e(Function) }, onKeydown: { type: $e(Function) }, onFocus: { type: $e(Function) }, onBlur: { type: $e(Function) }, onContextmenu: { type: $e(Function) }, id: String, open: Boolean }), Qx = de({ name: "ElPopperTrigger", inheritAttrs: !1 }), Jx = /* @__PURE__ */ de({ ...Qx, props: xh, setup(t, { expose: e }) { const r = t, { role: n, triggerRef: a } = Ue(Xu, void 0); ix(a); const i = V(() => s.value ? r.id : void 0), o = V(() => { if (n && n.value === "tooltip") return r.open && r.id ? r.id : void 0; }), s = V(() => { if (n && n.value !== "tooltip") return n.value; }), u = V(() => s.value ? `${r.open}` : void 0); let l; const c = [ "onMouseenter", "onMouseleave", "onClick", "onKeydown", "onFocus", "onBlur", "onContextmenu" ]; return Et(() => { Pe(() => r.virtualRef, (d) => { d && (a.value = vn(d)); }, { immediate: !0 }), Pe(a, (d, v) => { l == null || l(), l = void 0, ua(d) && (c.forEach((h) => { var f; const p = r[h]; p && (d.addEventListener(h.slice(2).toLowerCase(), p), (f = v == null ? void 0 : v.removeEventListener) == null || f.call(v, h.slice(2).toLowerCase(), p)); }), l = Pe([i, o, s, u], (h) => { [ "aria-controls", "aria-describedby", "aria-haspopup", "aria-expanded" ].forEach((f, p) => { $n(h[p]) ? d.removeAttribute(f) : d.setAttribute(f, h[p]); }); }, { immediate: !0 })), ua(v) && [ "aria-controls", "aria-describedby", "aria-haspopup", "aria-expanded" ].forEach((h) => v.removeAttribute(h)); }, { immediate: !0 }); }), qr(() => { if (l == null || l(), l = void 0, a.value && ua(a.value)) { const d = a.value; c.forEach((v) => { const h = r[v]; h && d.removeEventListener(v.slice(2).toLowerCase(), h); }), a.value = void 0; } }), e({ triggerRef: a }), (d, v) => d.virtualTriggering ? he("v-if", !0) : (N(), ye(P(jx), Rr({ key: 0 }, d.$attrs, { "aria-controls": P(i), "aria-describedby": P(o), "aria-expanded": P(u), "aria-haspopup": P(s) }), { default: U(() => [ Le(d.$slots, "default") ]), _: 3 }, 16, ["aria-controls", "aria-describedby", "aria-expanded", "aria-haspopup"])); } }); var eC = /* @__PURE__ */ Ve(Jx, [["__file", "trigger.vue"]]); const Sl = "focus-trap.focus-after-trapped", Tl = "focus-trap.focus-after-released", tC = "focus-trap.focusout-prevented", Fd = { cancelable: !0, bubbles: !1 }, rC = { cancelable: !0, bubbles: !1 }, Ad = "focusAfterTrapped", Md = "focusAfterReleased", nC = Symbol("elFocusTrap"), ju = ce(), js = ce(0), Qu = ce(0); let Ro = 0; const Ch = (t) => { const e = [], r = document.createTreeWalker(t, NodeFilter.SHOW_ELEMENT, { acceptNode: (n) => { const a = n.tagName === "INPUT" && n.type === "hidden"; return n.disabled || n.hidden || a ? NodeFilter.FILTER_SKIP : n.tabIndex >= 0 || n === document.activeElement ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP; } }); for (; r.nextNode(); ) e.push(r.currentNode); return e; }, Bd = (t, e) => { for (const r of t) if (!aC(r, e)) return r; }, aC = (t, e) => { if (process.env.NODE_ENV === "test") return !1; if (getComputedStyle(t).visibility === "hidden") return !0; for (; t; ) { if (e && t === e) return !1; if (getComputedStyle(t).display === "none") return !0; t = t.parentElement; } return !1; }, iC = (t) => { const e = Ch(t), r = Bd(e, t), n = Bd(e.reverse(), t); return [r, n]; }, oC = (t) => t instanceof HTMLInputElement && "select" in t, On = (t, e) => { if (t && t.focus) { const r = document.activeElement; t.focus({ preventScroll: !0 }), Qu.value = window.performance.now(), t !== r && oC(t) && e && t.select(); } }; function Nd(t, e) { const r = [...t], n = t.indexOf(e); return n !== -1 && r.splice(n, 1), r; } const sC = () => { let t = []; return { push: (n) => { const a = t[0]; a && n !== a && a.pause(), t = Nd(t, n), t.unshift(n); }, remove: (n) => { var a, i; t = Nd(t, n), (i = (a = t[0]) == null ? void 0 : a.resume) == null || i.call(a); } }; }, lC = (t, e = !1) => { const r = document.activeElement; for (const n of t) if (On(n, e), document.activeElement !== r) return; }, $d = sC(), uC = () => js.value > Qu.value, zo = () => { ju.value = "pointer", js.value = window.performance.now(); }, Rd = () => { ju.value = "keyboard", js.value = window.performance.now(); }, cC = () => (Et(() => { Ro === 0 && (document.addEventListener("mousedown", zo), document.addEventListener("touchstart", zo), document.addEventListener("keydown", Rd)), Ro++; }), qr(() => { Ro--, Ro <= 0 && (document.removeEventListener("mousedown", zo), document.removeEventListener("touchstart", zo), document.removeEventListener("keydown", Rd)); }), { focusReason: ju, lastUserFocusTimestamp: js, lastAutomatedFocusTimestamp: Qu }), Vo = (t) => new CustomEvent(tC, { ...rC, detail: t }), dC = de({ name: "ElFocusTrap", inheritAttrs: !1, props: { loop: Boolean, trapped: Boolean, focusTrapEl: Object, focusStartEl: { type: [Object, String], default: "first" } }, emits: [ Ad, Md, "focusin", "focusout", "focusout-prevented", "release-requested" ], setup(t, { emit: e }) { const r = ce(); let n, a; const { focusReason: i } = cC(); ex((f) => { t.trapped && !o.paused && e("release-requested", f); }); const o = { paused: !1, pause() { this.paused = !0; }, resume() { this.paused = !1; } }, s = (f) => { if (!t.loop && !t.trapped || o.paused) return; const { key: p, altKey: m, ctrlKey: g, metaKey: y, currentTarget: b, shiftKey: w } = f, { loop: C } = t, E = p === Lt.tab && !m && !g && !y, x = document.activeElement; if (E && x) { const T = b, [k, _] = iC(T); if (k && _) { if (!w && x === _) { const O = Vo({ focusReason: i.value }); e("focusout-prevented", O), O.defaultPrevented || (f.preventDefault(), C && On(k, !0)); } else if (w && [k, T].includes(x)) { const O = Vo({ focusReason: i.value }); e("focusout-prevented", O), O.defaultPrevented || (f.preventDefault(), C && On(_, !0)); } } else if (x === T) { const O = Vo({ focusReason: i.value }); e("focusout-prevented", O), O.defaultPrevented || f.preventDefault(); } } }; Ct(nC, { focusTrapRef: r, onKeydown: s }), Pe(() => t.focusTrapEl, (f) => { f && (r.value = f); }, { immediate: !0 }), Pe([r], ([f], [p]) => { f && (f.addEventListener("keydown", s), f.addEventListener("focusin", c), f.addEventListener("focusout", d)), p && (p.removeEventListener("keydown", s), p.removeEventListener("focusin", c), p.removeEventListener("focusout", d)); }); const u = (f) => { e(Ad, f); }, l = (f) => e(Md, f), c = (f) => { const p = P(r); if (!p) return; const m = f.target, g = f.relatedTarget, y = m && p.contains(m); t.trapped || g && p.contains(g) || (n = g), y && e("focusin", f), !o.paused && t.trapped && (y ? a = m : On(a, !0)); }, d = (f) => { const p = P(r); if (!(o.paused || !p)) if (t.trapped) { const m = f.relatedTarget; !$n(m) && !p.contains(m) && setTimeout(() => { if (!o.paused && t.trapped) { const g = Vo({ focusReason: i.value }); e("focusout-prevented", g), g.defaultPrevented || On(a, !0); } }, 0); } else { const m = f.target; m && p.contains(m) || e("focusout", f); } }; async function v() { await ot(); const f = P(r); if (f) { $d.push(o); const p = f.contains(document.activeElement) ? n : document.activeElement; if (n = p, !f.contains(p)) { const g = new Event(Sl, Fd); f.addEventListener(Sl, u), f.dispatchEvent(g), g.defaultPrevented || ot(() => { let y = t.focusStartEl; tr(y) || (On(y), document.activeElement !== y && (y = "first")), y === "first" && lC(Ch(f), !0), (document.activeElement === p || y === "container") && On(f); }); } } } function h() { const f = P(r); if (f) { f.removeEventListener(Sl, u); const p = new CustomEvent(Tl, { ...Fd, detail: { focusReason: i.value } }); f.addEventListener(Tl, l), f.dispatchEvent(p), !p.defaultPrevented && (i.value == "keyboard" || !uC() || f.contains(document.activeElement)) && On(n ?? document.body), f.removeEventListener(Tl, l), $d.remove(o); } } return Et(() => { t.trapped && v(), Pe(() => t.trapped, (f) => { f ? v() : h(); }); }), qr(() => { t.trapped && h(), r.value && (r.value.removeEventListener("keydown", s), r.value.removeEventListener("focusin", c), r.value.removeEventListener("focusout", d), r.value = void 0); }), { onKeydown: s }; } }); function fC(t, e, r, n, a, i) { return Le(t.$slots, "default", { handleKeydown: t.onKeydown }); } var vC = /* @__PURE__ */ Ve(dC, [["render", fC], ["__file", "focus-trap.vue"]]); const hC = ["fixed", "absolute"], pC = rt({ boundariesPadding: { type: Number, default: 0 }, fallbackPlacements: { type: $e(Array), default: void 0 }, gpuAcceleration: { type: Boolean, default: !0 }, offset: { type: Number, default: 12 }, placement: { type: String, values: Ys, default: "bottom" }, popperOptions: { type: $e(Object), default: () => ({}) }, strategy: { type: String, values: hC, default: "absolute" } }), Eh = rt({ ...pC, id: String, style: { type: $e([String, Array, Object]) }, className: { type: $e([String, Array, Object]) }, effect: { type: $e(String), default: "dark" }, visible: Boolean, enterable: { type: Boolean, default: !0 }, pure: Boolean, focusOnShow: { type: Boolean, default: !1 }, trapping: { type: Boolean, default: !1 }, popperClass: { type: $e([String, Array, Object]) }, popperStyle: { type: $e([String, Array, Object]) }, referenceEl: { type: $e(Object) }, triggerTargetEl: { type: $e(Object) }, stopPopperMouseEvent: { type: Boolean, default: !0 }, virtualTriggering: Boolean, zIndex: Number, ...Zn(["ariaLabel"]) }), gC = { mouseenter: (t) => t instanceof MouseEvent, mouseleave: (t) => t instanceof MouseEvent, focus: () => !0, blur: () => !0, close: () => !0 }, mC = (t, e = []) => { const { placement: r, strategy: n, popperOptions: a } = t, i = { placement: r, strategy: n, ...a, modifiers: [...bC(t), ...e] }; return wC(i, a == null ? void 0 : a.modifiers), i; }, yC = (t) => { if (_t) return vn(t); }; function bC(t) { const { offset: e, gpuAcceleration: r, fallbackPlacements: n } = t; return [ { name: "offset", options: { offset: [0, e ?? 12] } }, { name: "preventOverflow", options: { padding: { top: 2, bottom: 2, left: 5, right: 5 } } }, { name: "flip", options: { padding: 5, fallbackPlacements: n } }, { name: "computeStyles", options: { gpuAcceleration: r } } ]; } function wC(t, e) { e && (t.modifiers = [...t.modifiers, ...e ?? []]); } const xC = 0, CC = (t) => { const { popperInstanceRef: e, contentRef: r, triggerRef: n, role: a } = Ue(Xu, void 0), i = ce(), o = ce(), s = V(() => ({ name: "eventListeners", enabled: !!t.visible })), u = V(() => { var g; const y = P(i), b = (g = P(o)) != null ? g : xC; return { name: "arrow", enabled: !Ub(y), options: { element: y, padding: b } }; }), l = V(() => ({ onFirstUpdate: () => { f(); }, ...mC(t, [ P(u), P(s) ]) })), c = V(() => yC(t.referenceEl) || P(n)), { attributes: d, state: v, styles: h, update: f, forceUpdate: p, instanceRef: m } = jw(c, r, l); return Pe(m, (g) => e.value = g), Et(() => { Pe(() => { var g; return (g = P(c)) == null ? void 0 : g.getBoundingClientRect(); }, () => { f(); }); }), { attributes: d, arrowRef: i, contentRef: r, instanceRef: m, state: v, styles: h, role: a, forceUpdate: p, update: f }; }, EC = (t, { attributes: e, styles: r, role: n }) => { const { nextZIndex: a } = fh(), i = He("popper"), o = V(() => P(e).popper), s = ce(qt(t.zIndex) ? t.zIndex : a()), u = V(() => [ i.b(), i.is("pure", t.pure), i.is(t.effect), t.popperClass ]), l = V(() => [ { zIndex: P(s) }, P(r).popper, t.popperStyle || {} ]), c = V(() => n.value === "dialog" ? "false" : void 0), d = V(() => P(r).arrow || {}); return { ariaModal: c, arrowStyle: d, contentAttrs: o, contentClass: u, contentStyle: l, contentZIndex: s, updateZIndex: () => { s.value = qt(t.zIndex) ? t.zIndex : a(); } }; }, kC = (t, e) => { const r = ce(!1), n = ce(); return { focusStartRef: n, trapped: r, onFocusAfterReleased: (l) => { var c; ((c = l.detail) == null ? void 0 : c.focusReason) !== "pointer" && (n.value = "first", e("blur")); }, onFocusAfterTrapped: () => { e("focus"); }, onFocusInTrap: (l) => { t.visible && !r.value && (l.target && (n.value = l.target), r.value = !0); }, onFocusoutPrevented: (l) => { t.trapping || (l.detail.focusReason === "pointer" && l.preventDefault(), r.value = !1); }, onReleaseRequested: () => { r.value = !1, e("close"); } }; }, SC = de({ name: "ElPopperContent" }), TC = /* @__PURE__ */ de({ ...SC, props: Eh, emits: gC, setup(t, { expose: e, emit: r }) { const n = t, { focusStartRef: a, trapped: i, onFocusAfterReleased: o, onFocusAfterTrapped: s, onFocusInTrap: u, onFocusoutPrevented: l, onReleaseRequested: c } = kC(n, r), { attributes: d, arrowRef: v, contentRef: h, styles: f, instanceRef: p, role: m, update: g } = CC(n), { ariaModal: y, arrowStyle: b, contentAttrs: w, contentClass: C, contentStyle: E, updateZIndex: x } = EC(n, { styles: f, attributes: d, role: m }), T = Ue(Qi, void 0), k = ce(); Ct(mh, { arrowStyle: b, arrowRef: v, arrowOffset: k }), T && Ct(Qi, { ...T, addInputId: Wi, removeInputId: Wi }); let _; const D = (F = !0) => { g(), F && x(); }, O = () => { D(!1), n.visible && n.focusOnShow ? i.value = !0 : n.visible === !1 && (i.value = !1); }; return Et(() => { Pe(() => n.triggerTargetEl, (F, L) => { _ == null || _(), _ = void 0; const B = P(F || h.value), I = P(L || h.value); ua(B) && (_ = Pe([m, () => n.ariaLabel, y, () => n.id], (M) => { ["role", "aria-label", "aria-modal", "id"].forEach((A, R) => { $n(M[R]) ? B.removeAttribute(A) : B.setAttribute(A, M[R]); }); }, { immediate: !0 })), I !== B && ua(I) && ["role", "aria-label", "aria-modal", "id"].forEach((M) => { I.removeAttribute(M); }); }, { immediate: !0 }), Pe(() => n.visible, O, { immediate: !0 }); }), qr(() => { _ == null || _(), _ = void 0; }), e({ popperContentRef: h, popperInstanceRef: p, updatePopper: D, contentStyle: E }), (F, L) => (N(), Z("div", Rr({ ref_key: "contentRef", ref: h }, P(w), { style: P(E), class: P(C), tabindex: "-1", onMouseenter: (B) => F.$emit("mouseenter", B), onMouseleave: (B) => F.$emit("mouseleave", B) }), [ J(P(vC), { trapped: P(i), "trap-on-focus-in": !0, "focus-trap-el": P(h), "focus-start-el": P(a), onFocusAfterTrapped: P(s), onFocusAfterReleased: P(o), onFocusin: P(u), onFocusoutPrevented: P(l), onReleaseRequested: P(c) }, { default: U(() => [ Le(F.$slots, "default") ]), _: 3 }, 8, ["trapped", "focus-trap-el", "focus-start-el", "onFocusAfterTrapped", "onFocusAfterReleased", "onFocusin", "onFocusoutPrevented", "onReleaseRequested"]) ], 16, ["onMouseenter", "onMouseleave"])); } }); var _C = /* @__PURE__ */ Ve(TC, [["__file", "content.vue"]]); const DC = $t(Wx), Ju = Symbol("elTooltip"), cr = rt({ ...nx, ...Eh, appendTo: { type: $e([String, Object]) }, content: { type: String, default: "" }, rawContent: Boolean, persistent: Boolean, visible: { type: $e(Boolean), default: null }, transition: String, teleported: { type: Boolean, default: !0 }, disabled: Boolean, ...Zn(["ariaLabel"]) }), Ji = rt({ ...xh, disabled: Boolean, trigger: { type: $e([String, Array]), default: "hover" }, triggerKeys: { type: $e(Array), default: () => [Lt.enter, Lt.space] } }), { useModelToggleProps: PC, useModelToggleEmits: OC, useModelToggle: LC } = Y2("visible"), IC = rt({ ...yh, ...PC, ...cr, ...Ji, ...bh, showArrow: { type: Boolean, default: !0 } }), FC = [ ...OC, "before-show", "before-hide", "show", "hide", "open", "close" ], AC = (t, e) => fr(t) ? t.includes(e) : t === e, Ia = (t, e, r) => (n) => { AC(P(t), e) && r(n); }, MC = de({ name: "ElTooltipTrigger" }), BC = /* @__PURE__ */ de({ ...MC, props: Ji, setup(t, { expose: e }) { const r = t, n = He("tooltip"), { controlled: a, id: i, open: o, onOpen: s, onClose: u, onToggle: l } = Ue(Ju, void 0), c = ce(null), d = () => { if (P(a) || r.disabled) return !0; }, v = $r(r, "trigger"), h = cn(d, Ia(v, "hover", s)), f = cn(d, Ia(v, "hover", u)), p = cn(d, Ia(v, "click", (w) => { w.button === 0 && l(w); })), m = cn(d, Ia(v, "focus", s)), g = cn(d, Ia(v, "focus", u)), y = cn(d, Ia(v, "contextmenu", (w) => { w.preventDefault(), l(w); })), b = cn(d, (w) => { const { code: C } = w; r.triggerKeys.includes(C) && (w.preventDefault(), l(w)); }); return e({ triggerRef: c }), (w, C) => (N(), ye(P(eC), { id: P(i), "virtual-ref": w.virtualRef, open: P(o), "virtual-triggering": w.virtualTriggering, class: ie(P(n).e("trigger")), onBlur: P(g), onClick: P(p), onContextmenu: P(y), onFocus: P(m), onMouseenter: P(h), onMouseleave: P(f), onKeydown: P(b) }, { default: U(() => [ Le(w.$slots, "default") ]), _: 3 }, 8, ["id", "virtual-ref", "open", "virtual-triggering", "class", "onBlur", "onClick", "onContextmenu", "onFocus", "onMouseenter", "onMouseleave", "onKeydown"])); } }); var NC = /* @__PURE__ */ Ve(BC, [["__file", "trigger.vue"]]); const $C = rt({ to: { type: $e([String, Object]), required: !0 }, disabled: Boolean }), RC = /* @__PURE__ */ de({ __name: "teleport", props: $C, setup(t) { return (e, r) => e.disabled ? Le(e.$slots, "default", { key: 0 }) : (N(), ye(T0, { key: 1, to: e.to }, [ Le(e.$slots, "default") ], 8, ["to"])); } }); var zC = /* @__PURE__ */ Ve(RC, [["__file", "teleport.vue"]]); const VC = $t(zC), HC = de({ name: "ElTooltipContent", inheritAttrs: !1 }), qC = /* @__PURE__ */ de({ ...HC, props: cr, setup(t, { expose: e }) { const r = t, { selector: n } = lh(), a = He("tooltip"), i = ce(null); let o; const { controlled: s, id: u, open: l, trigger: c, onClose: d, onOpen: v, onShow: h, onHide: f, onBeforeShow: p, onBeforeHide: m } = Ue(Ju, void 0), g = V(() => r.transition || `${a.namespace.value}-fade-in-linear`), y = V(() => process.env.NODE_ENV === "test" ? !0 : r.persistent); qr(() => { o == null || o(); }); const b = V(() => P(y) ? !0 : P(l)), w = V(() => r.disabled ? !1 : P(l)), C = V(() => r.appendTo || n.value), E = V(() => { var I; return (I = r.style) != null ? I : {}; }), x = ce(!0), T = () => { f(), x.value = !0; }, k = () => { if (P(s)) return !0; }, _ = cn(k, () => { r.enterable && P(c) === "hover" && v(); }), D = cn(k, () => { P(c) === "hover" && d(); }), O = () => { var I, M; (M = (I = i.value) == null ? void 0 : I.updatePopper) == null || M.call(I), p == null || p(); }, F = () => { m == null || m(); }, L = () => { h(), o = $0(V(() => { var I; return (I = i.value) == null ? void 0 : I.popperContentRef; }), () => { if (P(s)) return; P(c) !== "hover" && d(); }); }, B = () => { r.virtualTriggering || d(); }; return Pe(() => P(l), (I) => { I ? x.value = !1 : o == null || o(); }, { flush: "post" }), Pe(() => r.content, () => { var I, M; (M = (I = i.value) == null ? void 0 : I.updatePopper) == null || M.call(I); }), e({ contentRef: i }), (I, M) => (N(), ye(P(VC), { disabled: !I.teleported, to: P(C) }, { default: U(() => [ J(ui, { name: P(g), onAfterLeave: T, onBeforeEnter: O, onAfterEnter: L, onBeforeLeave: F }, { default: U(() => [ P(b) ? Ze((N(), ye(P(_C), Rr({ key: 0, id: P(u), ref_key: "contentRef", ref: i }, I.$attrs, { "aria-label": I.ariaLabel, "aria-hidden": x.value, "boundaries-padding": I.boundariesPadding, "fallback-placements": I.fallbackPlacements, "gpu-acceleration": I.gpuAcceleration, offset: I.offset, placement: I.placement, "popper-options": I.popperOptions, strategy: I.strategy, effect: I.effect, enterable: I.enterable, pure: I.pure, "popper-class": I.popperClass, "popper-style": [I.popperStyle, P(E)], "reference-el": I.referenceEl, "trigger-target-el": I.triggerTargetEl, visible: P(w), "z-index": I.zIndex, onMouseenter: P(_), onMouseleave: P(D), onBlur: B, onClose: P(d) }), { default: U(() => [ Le(I.$slots, "default") ]), _: 3 }, 16, ["id", "aria-label", "aria-hidden", "boundaries-padding", "fallback-placements", "gpu-acceleration", "offset", "placement", "popper-options", "strategy", "effect", "enterable", "pure", "popper-class", "popper-style", "reference-el", "trigger-target-el", "visible", "z-index", "onMouseenter", "onMouseleave", "onClose"])), [ [mt, P(w)] ]) : he("v-if", !0) ]), _: 3 }, 8, ["name"]) ]), _: 3 }, 8, ["disabled", "to"])); } }); var KC = /* @__PURE__ */ Ve(qC, [["__file", "content.vue"]]); const UC = de({ name: "ElTooltip" }), GC = /* @__PURE__ */ de({ ...UC, props: IC, emits: FC, setup(t, { expose: e, emit: r }) { const n = t; rx(); const a = Xs(), i = ce(), o = ce(), s = () => { var g; const y = P(i); y && ((g = y.popperInstanceRef) == null || g.update()); }, u = ce(!1), l = ce(), { show: c, hide: d, hasUpdateHandler: v } = LC({ indicator: u, toggleReason: l }), { onOpen: h, onClose: f } = ax({ showAfter: $r(n, "showAfter"), hideAfter: $r(n, "hideAfter"), autoClose: $r(n, "autoClose"), open: c, close: d }), p = V(() => Qa(n.visible) && !v.value); Ct(Ju, { controlled: p, id: a, open: _0(u), trigger: $r(n, "trigger"), onOpen: (g) => { h(g); }, onClose: (g) => { f(g); }, onToggle: (g) => { P(u) ? f(g) : h(g); }, onShow: () => { r("show", l.value); }, onHide: () => { r("hide", l.value); }, onBeforeShow: () => { r("before-show", l.value); }, onBeforeHide: () => { r("before-hide", l.value); }, updatePopper: s }), Pe(() => n.disabled, (g) => { g && u.value && (u.value = !1); }); const m = (g) => { var y, b; const w = (b = (y = o.value) == null ? void 0 : y.contentRef) == null ? void 0 : b.popperContentRef, C = (g == null ? void 0 : g.relatedTarget) || document.activeElement; return w && w.contains(C); }; return D0(() => u.value && d()), e({ popperRef: i, contentRef: o, isFocusInsideContent: m, updatePopper: s, onOpen: h, onClose: f, hide: d }), (g, y) => (N(), ye(P(DC), { ref_key: "popperRef", ref: i, role: g.role }, { default: U(() => [ J(NC, { disabled: g.disabled, trigger: g.trigger, "trigger-keys": g.triggerKeys, "virtual-ref": g.virtualRef, "virtual-triggering": g.virtualTriggering }, { default: U(() => [ g.$slots.default ? Le(g.$slots, "default", { key: 0 }) : he("v-if", !0) ]), _: 3 }, 8, ["disabled", "trigger", "trigger-keys", "virtual-ref", "virtual-triggering"]), J(KC, { ref_key: "contentRef", ref: o, "aria-label": g.ariaLabel, "boundaries-padding": g.boundariesPadding, content: g.content, disabled: g.disabled, effect: g.effect, enterable: g.enterable, "fallback-placements": g.fallbackPlacements, "hide-after": g.hideAfter, "gpu-acceleration": g.gpuAcceleration, offset: g.offset, persistent: g.persistent, "popper-class": g.popperClass, "popper-style": g.popperStyle, placement: g.placement, "popper-options": g.popperOptions, pure: g.pure, "raw-content": g.rawContent, "reference-el": g.referenceEl, "trigger-target-el": g.triggerTargetEl, "show-after": g.showAfter, strategy: g.strategy, teleported: g.teleported, transition: g.transition, "virtual-triggering": g.virtualTriggering, "z-index": g.zIndex, "append-to": g.appendTo }, { default: U(() => [ Le(g.$slots, "content", {}, () => [ g.rawContent ? (N(), Z("span", { key: 0, innerHTML: g.content }, null, 8, ["innerHTML"])) : (N(), Z("span", { key: 1 }, Ie(g.content), 1)) ]), g.showArrow ? (N(), ye(P(Xx), { key: 0, "arrow-offset": g.arrowOffset }, null, 8, ["arrow-offset"])) : he("v-if", !0) ]), _: 3 }, 8, ["aria-label", "boundaries-padding", "content", "disabled", "effect", "enterable", "fallback-placements", "hide-after", "gpu-acceleration", "offset", "persistent", "popper-class", "popper-style", "placement", "popper-options", "pure", "raw-content", "reference-el", "trigger-target-el", "show-after", "strategy", "teleported", "transition", "virtual-triggering", "z-index", "append-to"]) ]), _: 3 }, 8, ["role"])); } }); var WC = /* @__PURE__ */ Ve(GC, [["__file", "tooltip.vue"]]); const ko = $t(WC), kh = Symbol("buttonGroupContextKey"), YC = (t, e) => { as({ from: "type.text", replacement: "link", version: "3.0.0", scope: "props", ref: "https://element-plus.org/en-US/component/button.html#button-attributes" }, V(() => t.type === "text")); const r = Ue(kh, void 0), n = Wu("button"), { form: a } = Ta(), i = pa(V(() => r == null ? void 0 : r.size)), o = xo(), s = ce(), u = vo(), l = V(() => t.type || (r == null ? void 0 : r.type) || ""), c = V(() => { var f, p, m; return (m = (p = t.autoInsertSpace) != null ? p : (f = n.value) == null ? void 0 : f.autoInsertSpace) != null ? m : !1; }), d = V(() => t.tag === "button" ? { ariaDisabled: o.value || t.loading, disabled: o.value || t.loading, autofocus: t.autofocus, type: t.nativeType } : {}), v = V(() => { var f; const p = (f = u.default) == null ? void 0 : f.call(u); if (c.value && (p == null ? void 0 : p.length) === 1) { const m = p[0]; if ((m == null ? void 0 : m.type) === yv) { const g = m.children; return new RegExp("^\\p{Unified_Ideograph}{2}$", "u").test(g.trim()); } } return !1; }); return { _disabled: o, _size: i, _type: l, _ref: s, _props: d, shouldAddSpace: v, handleClick: (f) => { if (o.value || t.loading) { f.stopPropagation(); return; } t.nativeType === "reset" && (a == null || a.resetFields()), e("click", f); } }; }, ZC = [ "default", "primary", "success", "warning", "info", "danger", "text", "" ], XC = ["button", "submit", "reset"], ru = rt({ size: di, disabled: Boolean, type: { type: String, values: ZC, default: "" }, icon: { type: Hn }, nativeType: { type: String, values: XC, default: "button" }, loading: Boolean, loadingIcon: { type: Hn, default: () => Mu }, plain: Boolean, text: Boolean, link: Boolean, bg: Boolean, autofocus: Boolean, round: Boolean, circle: Boolean, color: String, dark: Boolean, autoInsertSpace: { type: Boolean, default: void 0 }, tag: { type: $e([String, Object]), default: "button" } }), jC = { click: (t) => t instanceof MouseEvent }; function Kt(t, e) { QC(t) && (t = "100%"); var r = JC(t); return t = e === 360 ? t : Math.min(e, Math.max(0, parseFloat(t))), r && (t = parseInt(String(t * e), 10) / 100), Math.abs(t - e) < 1e-6 ? 1 : (e === 360 ? t = (t < 0 ? t % e + e : t % e) / parseFloat(String(e)) : t = t % e / parseFloat(String(e)), t); } function Ho(t) { return Math.min(1, Math.max(0, t)); } function QC(t) { return typeof t == "string" && t.indexOf(".") !== -1 && parseFloat(t) === 1; } function JC(t) { return typeof t == "string" && t.indexOf("%") !== -1; } function Sh(t) { return t = parseFloat(t), (isNaN(t) || t < 0 || t > 1) && (t = 1), t; } function qo(t) { return t <= 1 ? "".concat(Number(t) * 100, "%") : t; } function sa(t) { return t.length === 1 ? "0" + t : String(t); } function eE(t, e, r) { return { r: Kt(t, 255) * 255, g: Kt(e, 255) * 255, b: Kt(r, 255) * 255 }; } function zd(t, e, r) { t = Kt(t, 255), e = Kt(e, 255), r = Kt(r, 255); var n = Math.max(t, e, r), a = Math.min(t, e, r), i = 0, o = 0, s = (n + a) / 2; if (n === a) o = 0, i = 0; else { var u = n - a; switch (o = s > 0.5 ? u / (2 - n - a) : u / (n + a), n) { case t: i = (e - r) / u + (e < r ? 6 : 0); break; case e: i = (r - t) / u + 2; break; case r: i = (t - e) / u + 4; break; } i /= 6; } return { h: i, s: o, l: s }; } function _l(t, e, r) { return r < 0 && (r += 1), r > 1 && (r -= 1), r < 1 / 6 ? t + (e - t) * (6 * r) : r < 1 / 2 ? e : r < 2 / 3 ? t + (e - t) * (2 / 3 - r) * 6 : t; } function tE(t, e, r) { var n, a, i; if (t = Kt(t, 360), e = Kt(e, 100), r = Kt(r, 100), e === 0) a = r, i = r, n = r; else { var o = r < 0.5 ? r * (1 + e) : r + e - r * e, s = 2 * r - o; n = _l(s, o, t + 1 / 3), a = _l(s, o, t), i = _l(s, o, t - 1 / 3); } return { r: n * 255, g: a * 255, b: i * 255 }; } function Vd(t, e, r) { t = Kt(t, 255), e = Kt(e, 255), r = Kt(r, 255); var n = Math.max(t, e, r), a = Math.min(t, e, r), i = 0, o = n, s = n - a, u = n === 0 ? 0 : s / n; if (n === a) i = 0; else { switch (n) { case t: i = (e - r) / s + (e < r ? 6 : 0); break; case e: i = (r - t) / s + 2; break; case r: i = (t - e) / s + 4; break; } i /= 6; } return { h: i, s: u, v: o }; } function rE(t, e, r) { t = Kt(t, 360) * 6, e = Kt(e, 100), r = Kt(r, 100); var n = Math.floor(t), a = t - n, i = r * (1 - e), o = r * (1 - a * e), s = r * (1 - (1 - a) * e), u = n % 6, l = [r, o, i, i, s, r][u], c = [s, r, r, o, i, i][u], d = [i, i, s, r, r, o][u]; return { r: l * 255, g: c * 255, b: d * 255 }; } function Hd(t, e, r, n) { var a = [ sa(Math.round(t).toString(16)), sa(Math.round(e).toString(16)), sa(Math.round(r).toString(16)) ]; return n && a[0].startsWith(a[0].charAt(1)) && a[1].startsWith(a[1].charAt(1)) && a[2].startsWith(a[2].charAt(1)) ? a[0].charAt(0) + a[1].charAt(0) + a[2].charAt(0) : a.join(""); } function nE(t, e, r, n, a) { var i = [ sa(Math.round(t).toString(16)), sa(Math.round(e).toString(16)), sa(Math.round(r).toString(16)), sa(aE(n)) ]; return a && i[0].startsWith(i[0].charAt(1)) && i[1].startsWith(i[1].charAt(1)) && i[2].startsWith(i[2].charAt(1)) && i[3].startsWith(i[3].charAt(1)) ? i[0].charAt(0) + i[1].charAt(0) + i[2].charAt(0) + i[3].charAt(0) : i.join(""); } function aE(t) { return Math.round(parseFloat(t) * 255).toString(16); } function qd(t) { return mr(t) / 255; } function mr(t) { return parseInt(t, 16); } function iE(t) { return { r: t >> 16, g: (t & 65280) >> 8, b: t & 255 }; } var nu = { aliceblue: "#f0f8ff", antiquewhite: "#faebd7", aqua: "#00ffff", aquamarine: "#7fffd4", azure: "#f0ffff", beige: "#f5f5dc", bisque: "#ffe4c4", black: "#000000", blanchedalmond: "#ffebcd", blue: "#0000ff", blueviolet: "#8a2be2", brown: "#a52a2a", burlywood: "#deb887", cadetblue: "#5f9ea0", chartreuse: "#7fff00", chocolate: "#d2691e", coral: "#ff7f50", cornflowerblue: "#6495ed", cornsilk: "#fff8dc", crimson: "#dc143c", cyan: "#00ffff", darkblue: "#00008b", darkcyan: "#008b8b", darkgoldenrod: "#b8860b", darkgray: "#a9a9a9", darkgreen: "#006400", darkgrey: "#a9a9a9", darkkhaki: "#bdb76b", darkmagenta: "#8b008b", darkolivegreen: "#556b2f", darkorange: "#ff8c00", darkorchid: "#9932cc", darkred: "#8b0000", darksalmon: "#e9967a", darkseagreen: "#8fbc8f", darkslateblue: "#483d8b", darkslategray: "#2f4f4f", darkslategrey: "#2f4f4f", darkturquoise: "#00ced1", darkviolet: "#9400d3", deeppink: "#ff1493", deepskyblue: "#00bfff", dimgray: "#696969", dimgrey: "#696969", dodgerblue: "#1e90ff", firebrick: "#b22222", floralwhite: "#fffaf0", forestgreen: "#228b22", fuchsia: "#ff00ff", gainsboro: "#dcdcdc", ghostwhite: "#f8f8ff", goldenrod: "#daa520", gold: "#ffd700", gray: "#808080", green: "#008000", greenyellow: "#adff2f", grey: "#808080", honeydew: "#f0fff0", hotpink: "#ff69b4", indianred: "#cd5c5c", indigo: "#4b0082", ivory: "#fffff0", khaki: "#f0e68c", lavenderblush: "#fff0f5", lavender: "#e6e6fa", lawngreen: "#7cfc00", lemonchiffon: "#fffacd", lightblue: "#add8e6", lightcoral: "#f08080", lightcyan: "#e0ffff", lightgoldenrodyellow: "#fafad2", lightgray: "#d3d3d3", lightgreen: "#90ee90", lightgrey: "#d3d3d3", lightpink: "#ffb6c1", lightsalmon: "#ffa07a", lightseagreen: "#20b2aa", lightskyblue: "#87cefa", lightslategray: "#778899", lightslategrey: "#778899", lightsteelblue: "#b0c4de", lightyellow: "#ffffe0", lime: "#00ff00", limegreen: "#32cd32", linen: "#faf0e6", magenta: "#ff00ff", maroon: "#800000", mediumaquamarine: "#66cdaa", mediumblue: "#0000cd", mediumorchid: "#ba55d3", mediumpurple: "#9370db", mediumseagreen: "#3cb371", mediumslateblue: "#7b68ee", mediumspringgreen: "#00fa9a", mediumturquoise: "#48d1cc", mediumvioletred: "#c71585", midnightblue: "#191970", mintcream: "#f5fffa", mistyrose: "#ffe4e1", moccasin: "#ffe4b5", navajowhite: "#ffdead", navy: "#000080", oldlace: "#fdf5e6", olive: "#808000", olivedrab: "#6b8e23", orange: "#ffa500", orangered: "#ff4500", orchid: "#da70d6", palegoldenrod: "#eee8aa", palegreen: "#98fb98", paleturquoise: "#afeeee", palevioletred: "#db7093", papayawhip: "#ffefd5", peachpuff: "#ffdab9", peru: "#cd853f", pink: "#ffc0cb", plum: "#dda0dd", powderblue: "#b0e0e6", purple: "#800080", rebeccapurple: "#663399", red: "#ff0000", rosybrown: "#bc8f8f", royalblue: "#4169e1", saddlebrown: "#8b4513", salmon: "#fa8072", sandybrown: "#f4a460", seagreen: "#2e8b57", seashell: "#fff5ee", sienna: "#a0522d", silver: "#c0c0c0", skyblue: "#87ceeb", slateblue: "#6a5acd", slategray: "#708090", slategrey: "#708090", snow: "#fffafa", springgreen: "#00ff7f", steelblue: "#4682b4", tan: "#d2b48c", teal: "#008080", thistle: "#d8bfd8", tomato: "#ff6347", turquoise: "#40e0d0", violet: "#ee82ee", wheat: "#f5deb3", white: "#ffffff", whitesmoke: "#f5f5f5", yellow: "#ffff00", yellowgreen: "#9acd32" }; function oE(t) { var e = { r: 0, g: 0, b: 0 }, r = 1, n = null, a = null, i = null, o = !1, s = !1; return typeof t == "string" && (t = uE(t)), typeof t == "object" && (ln(t.r) && ln(t.g) && ln(t.b) ? (e = eE(t.r, t.g, t.b), o = !0, s = String(t.r).substr(-1) === "%" ? "prgb" : "rgb") : ln(t.h) && ln(t.s) && ln(t.v) ? (n = qo(t.s), a = qo(t.v), e = rE(t.h, n, a), o = !0, s = "hsv") : ln(t.h) && ln(t.s) && ln(t.l) && (n = qo(t.s), i = qo(t.l), e = tE(t.h, n, i), o = !0, s = "hsl"), Object.prototype.hasOwnProperty.call(t, "a") && (r = t.a)), r = Sh(r), { ok: o, format: t.format || s, r: Math.min(255, Math.max(e.r, 0)), g: Math.min(255, Math.max(e.g, 0)), b: Math.min(255, Math.max(e.b, 0)), a: r }; } var sE = "[-\\+]?\\d+%?", lE = "[-\\+]?\\d*\\.\\d+%?", Bn = "(?:".concat(lE, ")|(?:").concat(sE, ")"), Dl = "[\\s|\\(]+(".concat(Bn, ")[,|\\s]+(").concat(Bn, ")[,|\\s]+(").concat(Bn, ")\\s*\\)?"), Pl = "[\\s|\\(]+(".concat(Bn, ")[,|\\s]+(").concat(Bn, ")[,|\\s]+(").concat(Bn, ")[,|\\s]+(").concat(Bn, ")\\s*\\)?"), Ar = { CSS_UNIT: new RegExp(Bn), rgb: new RegExp("rgb" + Dl), rgba: new RegExp("rgba" + Pl), hsl: new RegExp("hsl" + Dl), hsla: new RegExp("hsla" + Pl), hsv: new RegExp("hsv" + Dl), hsva: new RegExp("hsva" + Pl), hex3: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/, hex6: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/, hex4: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/, hex8: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/ }; function uE(t) { if (t = t.trim().toLowerCase(), t.length === 0) return !1; var e = !1; if (nu[t]) t = nu[t], e = !0; else if (t === "transparent") return { r: 0, g: 0, b: 0, a: 0, format: "name" }; var r = Ar.rgb.exec(t); return r ? { r: r[1], g: r[2], b: r[3] } : (r = Ar.rgba.exec(t), r ? { r: r[1], g: r[2], b: r[3], a: r[4] } : (r = Ar.hsl.exec(t), r ? { h: r[1], s: r[2], l: r[3] } : (r = Ar.hsla.exec(t), r ? { h: r[1], s: r[2], l: r[3], a: r[4] } : (r = Ar.hsv.exec(t), r ? { h: r[1], s: r[2], v: r[3] } : (r = Ar.hsva.exec(t), r ? { h: r[1], s: r[2], v: r[3], a: r[4] } : (r = Ar.hex8.exec(t), r ? { r: mr(r[1]), g: mr(r[2]), b: mr(r[3]), a: qd(r[4]), format: e ? "name" : "hex8" } : (r = Ar.hex6.exec(t), r ? { r: mr(r[1]), g: mr(r[2]), b: mr(r[3]), format: e ? "name" : "hex" } : (r = Ar.hex4.exec(t), r ? { r: mr(r[1] + r[1]), g: mr(r[2] + r[2]), b: mr(r[3] + r[3]), a: qd(r[4] + r[4]), format: e ? "name" : "hex8" } : (r = Ar.hex3.exec(t), r ? { r: mr(r[1] + r[1]), g: mr(r[2] + r[2]), b: mr(r[3] + r[3]), format: e ? "name" : "hex" } : !1))))))))); } function ln(t) { return !!Ar.CSS_UNIT.exec(String(t)); } var cE = ( /** @class */ function() { function t(e, r) { e === void 0 && (e = ""), r === void 0 && (r = {}); var n; if (e instanceof t) return e; typeof e == "number" && (e = iE(e)), this.originalInput = e; var a = oE(e); this.originalInput = e, this.r = a.r, this.g = a.g, this.b = a.b, this.a = a.a, this.roundA = Math.round(100 * this.a) / 100, this.format = (n = r.format) !== null && n !== void 0 ? n : a.format, this.gradientType = r.gradientType, this.r < 1 && (this.r = Math.round(this.r)), this.g < 1 && (this.g = Math.round(this.g)), this.b < 1 && (this.b = Math.round(this.b)), this.isValid = a.ok; } return t.prototype.isDark = function() { return this.getBrightness() < 128; }, t.prototype.isLight = function() { return !this.isDark(); }, t.prototype.getBrightness = function() { var e = this.toRgb(); return (e.r * 299 + e.g * 587 + e.b * 114) / 1e3; }, t.prototype.getLuminance = function() { var e = this.toRgb(), r, n, a, i = e.r / 255, o = e.g / 255, s = e.b / 255; return i <= 0.03928 ? r = i / 12.92 : r = Math.pow((i + 0.055) / 1.055, 2.4), o <= 0.03928 ? n = o / 12.92 : n = Math.pow((o + 0.055) / 1.055, 2.4), s <= 0.03928 ? a = s / 12.92 : a = Math.pow((s + 0.055) / 1.055, 2.4), 0.2126 * r + 0.7152 * n + 0.0722 * a; }, t.prototype.getAlpha = function() { return this.a; }, t.prototype.setAlpha = function(e) { return this.a = Sh(e), this.roundA = Math.round(100 * this.a) / 100, this; }, t.prototype.isMonochrome = function() { var e = this.toHsl().s; return e === 0; }, t.prototype.toHsv = function() { var e = Vd(this.r, this.g, this.b); return { h: e.h * 360, s: e.s, v: e.v, a: this.a }; }, t.prototype.toHsvString = function() { var e = Vd(this.r, this.g, this.b), r = Math.round(e.h * 360), n = Math.round(e.s * 100), a = Math.round(e.v * 100); return this.a === 1 ? "hsv(".concat(r, ", ").concat(n, "%, ").concat(a, "%)") : "hsva(".concat(r, ", ").concat(n, "%, ").concat(a, "%, ").concat(this.roundA, ")"); }, t.prototype.toHsl = function() { var e = zd(this.r, this.g, this.b); return { h: e.h * 360, s: e.s, l: e.l, a: this.a }; }, t.prototype.toHslString = function() { var e = zd(this.r, this.g, this.b), r = Math.round(e.h * 360), n = Math.round(e.s * 100), a = Math.round(e.l * 100); return this.a === 1 ? "hsl(".concat(r, ", ").concat(n, "%, ").concat(a, "%)") : "hsla(".concat(r, ", ").concat(n, "%, ").concat(a, "%, ").concat(this.roundA, ")"); }, t.prototype.toHex = function(e) { return e === void 0 && (e = !1), Hd(this.r, this.g, this.b, e); }, t.prototype.toHexString = function(e) { return e === void 0 && (e = !1), "#" + this.toHex(e); }, t.prototype.toHex8 = function(e) { return e === void 0 && (e = !1), nE(this.r, this.g, this.b, this.a, e); }, t.prototype.toHex8String = function(e) { return e === void 0 && (e = !1), "#" + this.toHex8(e); }, t.prototype.toHexShortString = function(e) { return e === void 0 && (e = !1), this.a === 1 ? this.toHexString(e) : this.toHex8String(e); }, t.prototype.toRgb = function() { return { r: Math.round(this.r), g: Math.round(this.g), b: Math.round(this.b), a: this.a }; }, t.prototype.toRgbString = function() { var e = Math.round(this.r), r = Math.round(this.g), n = Math.round(this.b); return this.a === 1 ? "rgb(".concat(e, ", ").concat(r, ", ").concat(n, ")") : "rgba(".concat(e, ", ").concat(r, ", ").concat(n, ", ").concat(this.roundA, ")"); }, t.prototype.toPercentageRgb = function() { var e = function(r) { return "".concat(Math.round(Kt(r, 255) * 100), "%"); }; return { r: e(this.r), g: e(this.g), b: e(this.b), a: this.a }; }, t.prototype.toPercentageRgbString = function() { var e = function(r) { return Math.round(Kt(r, 255) * 100); }; return this.a === 1 ? "rgb(".concat(e(this.r), "%, ").concat(e(this.g), "%, ").concat(e(this.b), "%)") : "rgba(".concat(e(this.r), "%, ").concat(e(this.g), "%, ").concat(e(this.b), "%, ").concat(this.roundA, ")"); }, t.prototype.toName = function() { if (this.a === 0) return "transparent"; if (this.a < 1) return !1; for (var e = "#" + Hd(this.r, this.g, this.b, !1), r = 0, n = Object.entries(nu); r < n.length; r++) { var a = n[r], i = a[0], o = a[1]; if (e === o) return i; } return !1; }, t.prototype.toString = function(e) { var r = !!e; e = e ?? this.format; var n = !1, a = this.a < 1 && this.a >= 0, i = !r && a && (e.startsWith("hex") || e === "name"); return i ? e === "name" && this.a === 0 ? this.toName() : this.toRgbString() : (e === "rgb" && (n = this.toRgbString()), e === "prgb" && (n = this.toPercentageRgbString()), (e === "hex" || e === "hex6") && (n = this.toHexString()), e === "hex3" && (n = this.toHexString(!0)), e === "hex4" && (n = this.toHex8String(!0)), e === "hex8" && (n = this.toHex8String()), e === "name" && (n = this.toName()), e === "hsl" && (n = this.toHslString()), e === "hsv" && (n = this.toHsvString()), n || this.toHexString()); }, t.prototype.toNumber = function() { return (Math.round(this.r) << 16) + (Math.round(this.g) << 8) + Math.round(this.b); }, t.prototype.clone = function() { return new t(this.toString()); }, t.prototype.lighten = function(e) { e === void 0 && (e = 10); var r = this.toHsl(); return r.l += e / 100, r.l = Ho(r.l), new t(r); }, t.prototype.brighten = function(e) { e === void 0 && (e = 10); var r = this.toRgb(); return r.r = Math.max(0, Math.min(255, r.r - Math.round(255 * -(e / 100)))), r.g = Math.max(0, Math.min(255, r.g - Math.round(255 * -(e / 100)))), r.b = Math.max(0, Math.min(255, r.b - Math.round(255 * -(e / 100)))), new t(r); }, t.prototype.darken = function(e) { e === void 0 && (e = 10); var r = this.toHsl(); return r.l -= e / 100, r.l = Ho(r.l), new t(r); }, t.prototype.tint = function(e) { return e === void 0 && (e = 10), this.mix("white", e); }, t.prototype.shade = function(e) { return e === void 0 && (e = 10), this.mix("black", e); }, t.prototype.desaturate = function(e) { e === void 0 && (e = 10); var r = this.toHsl(); return r.s -= e / 100, r.s = Ho(r.s), new t(r); }, t.prototype.saturate = function(e) { e === void 0 && (e = 10); var r = this.toHsl(); return r.s += e / 100, r.s = Ho(r.s), new t(r); }, t.prototype.greyscale = function() { return this.desaturate(100); }, t.prototype.spin = function(e) { var r = this.toHsl(), n = (r.h + e) % 360; return r.h = n < 0 ? 360 + n : n, new t(r); }, t.prototype.mix = function(e, r) { r === void 0 && (r = 50); var n = this.toRgb(), a = new t(e).toRgb(), i = r / 100, o = { r: (a.r - n.r) * i + n.r, g: (a.g - n.g) * i + n.g, b: (a.b - n.b) * i + n.b, a: (a.a - n.a) * i + n.a }; return new t(o); }, t.prototype.analogous = function(e, r) { e === void 0 && (e = 6), r === void 0 && (r = 30); var n = this.toHsl(), a = 360 / r, i = [this]; for (n.h = (n.h - (a * e >> 1) + 720) % 360; --e; ) n.h = (n.h + a) % 360, i.push(new t(n)); return i; }, t.prototype.complement = function() { var e = this.toHsl(); return e.h = (e.h + 180) % 360, new t(e); }, t.prototype.monochromatic = function(e) { e === void 0 && (e = 6); for (var r = this.toHsv(), n = r.h, a = r.s, i = r.v, o = [], s = 1 / e; e--; ) o.push(new t({ h: n, s: a, v: i })), i = (i + s) % 1; return o; }, t.prototype.splitcomplement = function() { var e = this.toHsl(), r = e.h; return [ this, new t({ h: (r + 72) % 360, s: e.s, l: e.l }), new t({ h: (r + 216) % 360, s: e.s, l: e.l }) ]; }, t.prototype.onBackground = function(e) { var r = this.toRgb(), n = new t(e).toRgb(), a = r.a + n.a * (1 - r.a); return new t({ r: (r.r * r.a + n.r * n.a * (1 - r.a)) / a, g: (r.g * r.a + n.g * n.a * (1 - r.a)) / a, b: (r.b * r.a + n.b * n.a * (1 - r.a)) / a, a }); }, t.prototype.triad = function() { return this.polyad(3); }, t.prototype.tetrad = function() { return this.polyad(4); }, t.prototype.polyad = function(e) { for (var r = this.toHsl(), n = r.h, a = [this], i = 360 / e, o = 1; o < e; o++) a.push(new t({ h: (n + o * i) % 360, s: r.s, l: r.l })); return a; }, t.prototype.equals = function(e) { return this.toRgbString() === new t(e).toRgbString(); }, t; }() ); function _n(t, e = 20) { return t.mix("#141414", e).toString(); } function dE(t) { const e = xo(), r = He("button"); return V(() => { let n = {}, a = t.color; if (a) { const i = a.match(/var\((.*?)\)/); i && (a = window.getComputedStyle(window.document.documentElement).getPropertyValue(i[1])); const o = new cE(a), s = t.dark ? o.tint(20).toString() : _n(o, 20); if (t.plain) n = r.cssVarBlock({ "bg-color": t.dark ? _n(o, 90) : o.tint(90).toString(), "text-color": a, "border-color": t.dark ? _n(o, 50) : o.tint(50).toString(), "hover-text-color": `var(${r.cssVarName("color-white")})`, "hover-bg-color": a, "hover-border-color": a, "active-bg-color": s, "active-text-color": `var(${r.cssVarName("color-white")})`, "active-border-color": s }), e.value && (n[r.cssVarBlockName("disabled-bg-color")] = t.dark ? _n(o, 90) : o.tint(90).toString(), n[r.cssVarBlockName("disabled-text-color")] = t.dark ? _n(o, 50) : o.tint(50).toString(), n[r.cssVarBlockName("disabled-border-color")] = t.dark ? _n(o, 80) : o.tint(80).toString()); else { const u = t.dark ? _n(o, 30) : o.tint(30).toString(), l = o.isDark() ? `var(${r.cssVarName("color-white")})` : `var(${r.cssVarName("color-black")})`; if (n = r.cssVarBlock({ "bg-color": a, "text-color": l, "border-color": a, "hover-bg-color": u, "hover-text-color": l, "hover-border-color": u, "active-bg-color": s, "active-border-color": s }), e.value) { const c = t.dark ? _n(o, 50) : o.tint(50).toString(); n[r.cssVarBlockName("disabled-bg-color")] = c, n[r.cssVarBlockName("disabled-text-color")] = t.dark ? "rgba(255, 255, 255, 0.5)" : `var(${r.cssVarName("color-white")})`, n[r.cssVarBlockName("disabled-border-color")] = c; } } } return n; }); } const fE = de({ name: "ElButton" }), vE = /* @__PURE__ */ de({ ...fE, props: ru, emits: jC, setup(t, { expose: e, emit: r }) { const n = t, a = dE(n), i = He("button"), { _ref: o, _size: s, _type: u, _disabled: l, _props: c, shouldAddSpace: d, handleClick: v } = YC(n, r), h = V(() => [ i.b(), i.m(u.value), i.m(s.value), i.is("disabled", l.value), i.is("loading", n.loading), i.is("plain", n.plain), i.is("round", n.round), i.is("circle", n.circle), i.is("text", n.text), i.is("link", n.link), i.is("has-bg", n.bg) ]); return e({ ref: o, size: s, type: u, disabled: l, shouldAddSpace: d }), (f, p) => (N(), ye(er(f.tag), Rr({ ref_key: "_ref", ref: o }, P(c), { class: P(h), style: P(a), onClick: P(v) }), { default: U(() => [ f.loading ? (N(), Z(Qe, { key: 0 }, [ f.$slots.loading ? Le(f.$slots, "loading", { key: 0 }) : (N(), ye(P(Vt), { key: 1, class: ie(P(i).is("loading")) }, { default: U(() => [ (N(), ye(er(f.loadingIcon))) ]), _: 1 }, 8, ["class"])) ], 64)) : f.icon || f.$slots.icon ? (N(), ye(P(Vt), { key: 1 }, { default: U(() => [ f.icon ? (N(), ye(er(f.icon), { key: 0 })) : Le(f.$slots, "icon", { key: 1 }) ]), _: 3 })) : he("v-if", !0), f.$slots.default ? (N(), Z("span", { key: 2, class: ie({ [P(i).em("text", "expand")]: P(d) }) }, [ Le(f.$slots, "default") ], 2)) : he("v-if", !0) ]), _: 3 }, 16, ["class", "style", "onClick"])); } }); var hE = /* @__PURE__ */ Ve(vE, [["__file", "button.vue"]]); const pE = { size: ru.size, type: ru.type }, gE = de({ name: "ElButtonGroup" }), mE = /* @__PURE__ */ de({ ...gE, props: pE, setup(t) { const e = t; Ct(kh, Jr({ size: $r(e, "size"), type: $r(e, "type") })); const r = He("button"); return (n, a) => (N(), Z("div", { class: ie(P(r).b("group")) }, [ Le(n.$slots, "default") ], 2)); } }); var Th = /* @__PURE__ */ Ve(mE, [["__file", "button-group.vue"]]); const Hr = $t(hE, { ButtonGroup: Th }), yE = xn(Th), Ln = /* @__PURE__ */ new Map(); if (_t) { let t; document.addEventListener("mousedown", (e) => t = e), document.addEventListener("mouseup", (e) => { if (t) { for (const r of Ln.values()) for (const { documentHandler: n } of r) n(e, t); t = void 0; } }); } function Kd(t, e) { let r = []; return Array.isArray(e.arg) ? r = e.arg : ua(e.arg) && r.push(e.arg), function(n, a) { const i = e.instance.popperRef, o = n.target, s = a == null ? void 0 : a.target, u = !e || !e.instance, l = !o || !s, c = t.contains(o) || t.contains(s), d = t === o, v = r.length && r.some((f) => f == null ? void 0 : f.contains(o)) || r.length && r.includes(s), h = i && (i.contains(o) || i.contains(s)); u || l || c || d || v || h || e.value(n, a); }; } const _h = { beforeMount(t, e) { Ln.has(t) || Ln.set(t, []), Ln.get(t).push({ documentHandler: Kd(t, e), bindingFn: e.value }); }, updated(t, e) { Ln.has(t) || Ln.set(t, []); const r = Ln.get(t), n = r.findIndex((i) => i.bindingFn === e.oldValue), a = { documentHandler: Kd(t, e), bindingFn: e.value }; n >= 0 ? r.splice(n, 1, a) : r.push(a); }, unmounted(t) { Ln.delete(t); } }, bE = rt({ header: { type: String, default: "" }, footer: { type: String, default: "" }, bodyStyle: { type: $e([String, Object, Array]), default: "" }, bodyClass: String, shadow: { type: String, values: ["always", "hover", "never"], default: "always" } }), wE = de({ name: "ElCard" }), xE = /* @__PURE__ */ de({ ...wE, props: bE, setup(t) { const e = He("card"); return (r, n) => (N(), Z("div", { class: ie([P(e).b(), P(e).is(`${r.shadow}-shadow`)]) }, [ r.$slots.header || r.header ? (N(), Z("div", { key: 0, class: ie(P(e).e("header")) }, [ Le(r.$slots, "header", {}, () => [ ze(Ie(r.header), 1) ]) ], 2)) : he("v-if", !0), X("div", { class: ie([P(e).e("body"), r.bodyClass]), style: lt(r.bodyStyle) }, [ Le(r.$slots, "default") ], 6), r.$slots.footer || r.footer ? (N(), Z("div", { key: 1, class: ie(P(e).e("footer")) }, [ Le(r.$slots, "footer", {}, () => [ ze(Ie(r.footer), 1) ]) ], 2)) : he("v-if", !0) ], 2)); } }); var CE = /* @__PURE__ */ Ve(xE, [["__file", "card.vue"]]); const EE = $t(CE), Dh = { modelValue: { type: [Number, String, Boolean], default: void 0 }, label: { type: [String, Boolean, Number, Object], default: void 0 }, value: { type: [String, Boolean, Number, Object], default: void 0 }, indeterminate: Boolean, disabled: Boolean, checked: Boolean, name: { type: String, default: void 0 }, trueValue: { type: [String, Number], default: void 0 }, falseValue: { type: [String, Number], default: void 0 }, trueLabel: { type: [String, Number], default: void 0 }, falseLabel: { type: [String, Number], default: void 0 }, id: { type: String, default: void 0 }, border: Boolean, size: di, tabindex: [String, Number], validateEvent: { type: Boolean, default: !0 }, ...Zn(["ariaControls"]) }, Ph = { [zt]: (t) => tr(t) || qt(t) || Qa(t), change: (t) => tr(t) || qt(t) || Qa(t) }, fi = Symbol("checkboxGroupContextKey"), kE = ({ model: t, isChecked: e }) => { const r = Ue(fi, void 0), n = V(() => { var i, o; const s = (i = r == null ? void 0 : r.max) == null ? void 0 : i.value, u = (o = r == null ? void 0 : r.min) == null ? void 0 : o.value; return !Mn(s) && t.value.length >= s && !e.value || !Mn(u) && t.value.length <= u && e.value; }); return { isDisabled: xo(V(() => (r == null ? void 0 : r.disabled.value) || n.value)), isLimitDisabled: n }; }, SE = (t, { model: e, isLimitExceeded: r, hasOwnLabel: n, isDisabled: a, isLabeledByFormItem: i }) => { const o = Ue(fi, void 0), { formItem: s } = Ta(), { emit: u } = gt(); function l(f) { var p, m, g, y; return [!0, t.trueValue, t.trueLabel].includes(f) ? (m = (p = t.trueValue) != null ? p : t.trueLabel) != null ? m : !0 : (y = (g = t.falseValue) != null ? g : t.falseLabel) != null ? y : !1; } function c(f, p) { u("change", l(f), p); } function d(f) { if (r.value) return; const p = f.target; u("change", l(p.checked), f); } async function v(f) { r.value || !n.value && !a.value && i.value && (f.composedPath().some((g) => g.tagName === "LABEL") || (e.value = l([!1, t.falseValue, t.falseLabel].includes(e.value)), await ot(), c(e.value, f))); } const h = V(() => (o == null ? void 0 : o.validateEvent) || t.validateEvent); return Pe(() => t.modelValue, () => { h.value && (s == null || s.validate("change").catch((f) => Dt(f))); }), { handleChange: d, onClickRoot: v }; }, TE = (t) => { const e = ce(!1), { emit: r } = gt(), n = Ue(fi, void 0), a = V(() => Mn(n) === !1), i = ce(!1), o = V({ get() { var s, u; return a.value ? (s = n == null ? void 0 : n.modelValue) == null ? void 0 : s.value : (u = t.modelValue) != null ? u : e.value; }, set(s) { var u, l; a.value && fr(s) ? (i.value = ((u = n == null ? void 0 : n.max) == null ? void 0 : u.value) !== void 0 && s.length > (n == null ? void 0 : n.max.value) && s.length > o.value.length, i.value === !1 && ((l = n == null ? void 0 : n.changeEvent) == null || l.call(n, s))) : (r(zt, s), e.value = s); } }); return { model: o, isGroup: a, isLimitExceeded: i }; }, _E = (t, e, { model: r }) => { const n = Ue(fi, void 0), a = ce(!1), i = V(() => ks(t.value) ? t.label : t.value), o = V(() => { const c = r.value; return Qa(c) ? c : fr(c) ? Ht(i.value) ? c.map(ys).some((d) => Es(d, i.value)) : c.map(ys).includes(i.value) : c != null ? c === t.trueValue || c === t.trueLabel : !!c; }), s = pa(V(() => { var c; return (c = n == null ? void 0 : n.size) == null ? void 0 : c.value; }), { prop: !0 }), u = pa(V(() => { var c; return (c = n == null ? void 0 : n.size) == null ? void 0 : c.value; })), l = V(() => !!e.default || !ks(i.value)); return { checkboxButtonSize: s, isChecked: o, isFocused: a, checkboxSize: u, hasOwnLabel: l, actualValue: i }; }, Oh = (t, e) => { const { formItem: r } = Ta(), { model: n, isGroup: a, isLimitExceeded: i } = TE(t), { isFocused: o, isChecked: s, checkboxButtonSize: u, checkboxSize: l, hasOwnLabel: c, actualValue: d } = _E(t, e, { model: n }), { isDisabled: v } = kE({ model: n, isChecked: s }), { inputId: h, isLabeledByFormItem: f } = Co(t, { formItemContext: r, disableIdGeneration: c, disableIdManagement: a }), { handleChange: p, onClickRoot: m } = SE(t, { model: n, isLimitExceeded: i, hasOwnLabel: c, isDisabled: v, isLabeledByFormItem: f }); return (() => { function y() { var b, w; fr(n.value) && !n.value.includes(d.value) ? n.value.push(d.value) : n.value = (w = (b = t.trueValue) != null ? b : t.trueLabel) != null ? w : !0; } t.checked && y(); })(), as({ from: "label act as value", replacement: "value", version: "3.0.0", scope: "el-checkbox", ref: "https://element-plus.org/en-US/component/checkbox.html" }, V(() => a.value && ks(t.value))), as({ from: "true-label", replacement: "true-value", version: "3.0.0", scope: "el-checkbox", ref: "https://element-plus.org/en-US/component/checkbox.html" }, V(() => !!t.trueLabel)), as({ from: "false-label", replacement: "false-value", version: "3.0.0", scope: "el-checkbox", ref: "https://element-plus.org/en-US/component/checkbox.html" }, V(() => !!t.falseLabel)), { inputId: h, isLabeledByFormItem: f, isChecked: s, isDisabled: v, isFocused: o, checkboxButtonSize: u, checkboxSize: l, hasOwnLabel: c, model: n, actualValue: d, handleChange: p, onClickRoot: m }; }, DE = de({ name: "ElCheckbox" }), PE = /* @__PURE__ */ de({ ...DE, props: Dh, emits: Ph, setup(t) { const e = t, r = vo(), { inputId: n, isLabeledByFormItem: a, isChecked: i, isDisabled: o, isFocused: s, checkboxSize: u, hasOwnLabel: l, model: c, actualValue: d, handleChange: v, onClickRoot: h } = Oh(e, r), f = He("checkbox"), p = V(() => [ f.b(), f.m(u.value), f.is("disabled", o.value), f.is("bordered", e.border), f.is("checked", i.value) ]), m = V(() => [ f.e("input"), f.is("disabled", o.value), f.is("checked", i.value), f.is("indeterminate", e.indeterminate), f.is("focus", s.value) ]); return (g, y) => (N(), ye(er(!P(l) && P(a) ? "span" : "label"), { class: ie(P(p)), "aria-controls": g.indeterminate ? g.ariaControls : null, onClick: P(h) }, { default: U(() => { var b, w, C, E; return [ X("span", { class: ie(P(m)) }, [ g.trueValue || g.falseValue || g.trueLabel || g.falseLabel ? Ze((N(), Z("input", { key: 0, id: P(n), "onUpdate:modelValue": (x) => Xa(c) ? c.value = x : null, class: ie(P(f).e("original")), type: "checkbox", indeterminate: g.indeterminate, name: g.name, tabindex: g.tabindex, disabled: P(o), "true-value": (w = (b = g.trueValue) != null ? b : g.trueLabel) != null ? w : !0, "false-value": (E = (C = g.falseValue) != null ? C : g.falseLabel) != null ? E : !1, onChange: P(v), onFocus: (x) => s.value = !0, onBlur: (x) => s.value = !1, onClick: ht(() => { }, ["stop"]) }, null, 42, ["id", "onUpdate:modelValue", "indeterminate", "name", "tabindex", "disabled", "true-value", "false-value", "onChange", "onFocus", "onBlur", "onClick"])), [ [bs, P(c)] ]) : Ze((N(), Z("input", { key: 1, id: P(n), "onUpdate:modelValue": (x) => Xa(c) ? c.value = x : null, class: ie(P(f).e("original")), type: "checkbox", indeterminate: g.indeterminate, disabled: P(o), value: P(d), name: g.name, tabindex: g.tabindex, onChange: P(v), onFocus: (x) => s.value = !0, onBlur: (x) => s.value = !1, onClick: ht(() => { }, ["stop"]) }, null, 42, ["id", "onUpdate:modelValue", "indeterminate", "disabled", "value", "name", "tabindex", "onChange", "onFocus", "onBlur", "onClick"])), [ [bs, P(c)] ]), X("span", { class: ie(P(f).e("inner")) }, null, 2) ], 2), P(l) ? (N(), Z("span", { key: 0, class: ie(P(f).e("label")) }, [ Le(g.$slots, "default"), g.$slots.default ? he("v-if", !0) : (N(), Z(Qe, { key: 0 }, [ ze(Ie(g.label), 1) ], 64)) ], 2)) : he("v-if", !0) ]; }), _: 3 }, 8, ["class", "aria-controls", "onClick"])); } }); var OE = /* @__PURE__ */ Ve(PE, [["__file", "checkbox.vue"]]); const LE = de({ name: "ElCheckboxButton" }), IE = /* @__PURE__ */ de({ ...LE, props: Dh, emits: Ph, setup(t) { const e = t, r = vo(), { isFocused: n, isChecked: a, isDisabled: i, checkboxButtonSize: o, model: s, actualValue: u, handleChange: l } = Oh(e, r), c = Ue(fi, void 0), d = He("checkbox"), v = V(() => { var f, p, m, g; const y = (p = (f = c == null ? void 0 : c.fill) == null ? void 0 : f.value) != null ? p : ""; return { backgroundColor: y, borderColor: y, color: (g = (m = c == null ? void 0 : c.textColor) == null ? void 0 : m.value) != null ? g : "", boxShadow: y ? `-1px 0 0 0 ${y}` : void 0 }; }), h = V(() => [ d.b("button"), d.bm("button", o.value), d.is("disabled", i.value), d.is("checked", a.value), d.is("focus", n.value) ]); return (f, p) => { var m, g, y, b; return N(), Z("label", { class: ie(P(h)) }, [ f.trueValue || f.falseValue || f.trueLabel || f.falseLabel ? Ze((N(), Z("input", { key: 0, "onUpdate:modelValue": (w) => Xa(s) ? s.value = w : null, class: ie(P(d).be("button", "original")), type: "checkbox", name: f.name, tabindex: f.tabindex, disabled: P(i), "true-value": (g = (m = f.trueValue) != null ? m : f.trueLabel) != null ? g : !0, "false-value": (b = (y = f.falseValue) != null ? y : f.falseLabel) != null ? b : !1, onChange: P(l), onFocus: (w) => n.value = !0, onBlur: (w) => n.value = !1, onClick: ht(() => { }, ["stop"]) }, null, 42, ["onUpdate:modelValue", "name", "tabindex", "disabled", "true-value", "false-value", "onChange", "onFocus", "onBlur", "onClick"])), [ [bs, P(s)] ]) : Ze((N(), Z("input", { key: 1, "onUpdate:modelValue": (w) => Xa(s) ? s.value = w : null, class: ie(P(d).be("button", "original")), type: "checkbox", name: f.name, tabindex: f.tabindex, disabled: P(i), value: P(u), onChange: P(l), onFocus: (w) => n.value = !0, onBlur: (w) => n.value = !1, onClick: ht(() => { }, ["stop"]) }, null, 42, ["onUpdate:modelValue", "name", "tabindex", "disabled", "value", "onChange", "onFocus", "onBlur", "onClick"])), [ [bs, P(s)] ]), f.$slots.default || f.label ? (N(), Z("span", { key: 2, class: ie(P(d).be("button", "inner")), style: lt(P(a) ? P(v) : void 0) }, [ Le(f.$slots, "default", {}, () => [ ze(Ie(f.label), 1) ]) ], 6)) : he("v-if", !0) ], 2); }; } }); var Lh = /* @__PURE__ */ Ve(IE, [["__file", "checkbox-button.vue"]]); const FE = rt({ modelValue: { type: $e(Array), default: () => [] }, disabled: Boolean, min: Number, max: Number, size: di, fill: String, textColor: String, tag: { type: String, default: "div" }, validateEvent: { type: Boolean, default: !0 }, ...Zn(["ariaLabel"]) }), AE = { [zt]: (t) => fr(t), change: (t) => fr(t) }, ME = de({ name: "ElCheckboxGroup" }), BE = /* @__PURE__ */ de({ ...ME, props: FE, emits: AE, setup(t, { emit: e }) { const r = t, n = He("checkbox"), { formItem: a } = Ta(), { inputId: i, isLabeledByFormItem: o } = Co(r, { formItemContext: a }), s = async (l) => { e(zt, l), await ot(), e("change", l); }, u = V({ get() { return r.modelValue; }, set(l) { s(l); } }); return Ct(fi, { ...zv(ho(r), [ "size", "min", "max", "disabled", "validateEvent", "fill", "textColor" ]), modelValue: u, changeEvent: s }), Pe(() => r.modelValue, () => { r.validateEvent && (a == null || a.validate("change").catch((l) => Dt(l))); }), (l, c) => { var d; return N(), ye(er(l.tag), { id: P(i), class: ie(P(n).b("group")), role: "group", "aria-label": P(o) ? void 0 : l.ariaLabel || "checkbox-group", "aria-labelledby": P(o) ? (d = P(a)) == null ? void 0 : d.labelId : void 0 }, { default: U(() => [ Le(l.$slots, "default") ]), _: 3 }, 8, ["id", "class", "aria-label", "aria-labelledby"]); }; } }); var Ih = /* @__PURE__ */ Ve(BE, [["__file", "checkbox-group.vue"]]); const NE = $t(OE, { CheckboxButton: Lh, CheckboxGroup: Ih }); xn(Lh); xn(Ih); const au = rt({ type: { type: String, values: ["primary", "success", "info", "warning", "danger"], default: "primary" }, closable: Boolean, disableTransitions: Boolean, hit: Boolean, color: String, size: { type: String, values: Gv }, effect: { type: String, values: ["dark", "light", "plain"], default: "light" }, round: Boolean }), $E = { close: (t) => t instanceof MouseEvent, click: (t) => t instanceof MouseEvent }, RE = de({ name: "ElTag" }), zE = /* @__PURE__ */ de({ ...RE, props: au, emits: $E, setup(t, { emit: e }) { const r = t, n = pa(), a = He("tag"), i = V(() => { const { type: l, hit: c, effect: d, closable: v, round: h } = r; return [ a.b(), a.is("closable", v), a.m(l || "primary"), a.m(n.value), a.m(d), a.is("hit", c), a.is("round", h) ]; }), o = (l) => { e("close", l); }, s = (l) => { e("click", l); }, u = (l) => { l.component.subTree.component.bum = null; }; return (l, c) => l.disableTransitions ? (N(), Z("span", { key: 0, class: ie(P(i)), style: lt({ backgroundColor: l.color }), onClick: s }, [ X("span", { class: ie(P(a).e("content")) }, [ Le(l.$slots, "default") ], 2), l.closable ? (N(), ye(P(Vt), { key: 0, class: ie(P(a).e("close")), onClick: ht(o, ["stop"]) }, { default: U(() => [ J(P(Ss)) ]), _: 1 }, 8, ["class", "onClick"])) : he("v-if", !0) ], 6)) : (N(), ye(ui, { key: 1, name: `${P(a).namespace.value}-zoom-in-center`, appear: "", onVnodeMounted: u }, { default: U(() => [ X("span", { class: ie(P(i)), style: lt({ backgroundColor: l.color }), onClick: s }, [ X("span", { class: ie(P(a).e("content")) }, [ Le(l.$slots, "default") ], 2), l.closable ? (N(), ye(P(Vt), { key: 0, class: ie(P(a).e("close")), onClick: ht(o, ["stop"]) }, { default: U(() => [ J(P(Ss)) ]), _: 1 }, 8, ["class", "onClick"])) : he("v-if", !0) ], 6) ]), _: 3 }, 8, ["name"])); } }); var VE = /* @__PURE__ */ Ve(zE, [["__file", "tag.vue"]]); const HE = $t(VE), Fh = Symbol("rowContextKey"), qE = [ "start", "center", "end", "space-around", "space-between", "space-evenly" ], KE = ["top", "middle", "bottom"], UE = rt({ tag: { type: String, default: "div" }, gutter: { type: Number, default: 0 }, justify: { type: String, values: qE, default: "start" }, align: { type: String, values: KE } }), GE = de({ name: "ElRow" }), WE = /* @__PURE__ */ de({ ...GE, props: UE, setup(t) { const e = t, r = He("row"), n = V(() => e.gutter); Ct(Fh, { gutter: n }); const a = V(() => { const o = {}; return e.gutter && (o.marginRight = o.marginLeft = `-${e.gutter / 2}px`), o; }), i = V(() => [ r.b(), r.is(`justify-${e.justify}`, e.justify !== "start"), r.is(`align-${e.align}`, !!e.align) ]); return (o, s) => (N(), ye(er(o.tag), { class: ie(P(i)), style: lt(P(a)) }, { default: U(() => [ Le(o.$slots, "default") ]), _: 3 }, 8, ["class", "style"])); } }); var YE = /* @__PURE__ */ Ve(WE, [["__file", "row.vue"]]); const Qs = $t(YE), ZE = rt({ tag: { type: String, default: "div" }, span: { type: Number, default: 24 }, offset: { type: Number, default: 0 }, pull: { type: Number, default: 0 }, push: { type: Number, default: 0 }, xs: { type: $e([Number, Object]), default: () => Ra({}) }, sm: { type: $e([Number, Object]), default: () => Ra({}) }, md: { type: $e([Number, Object]), default: () => Ra({}) }, lg: { type: $e([Number, Object]), default: () => Ra({}) }, xl: { type: $e([Number, Object]), default: () => Ra({}) } }), XE = de({ name: "ElCol" }), jE = /* @__PURE__ */ de({ ...XE, props: ZE, setup(t) { const e = t, { gutter: r } = Ue(Fh, { gutter: V(() => 0) }), n = He("col"), a = V(() => { const o = {}; return r.value && (o.paddingLeft = o.paddingRight = `${r.value / 2}px`), o; }), i = V(() => { const o = []; return ["span", "offset", "pull", "push"].forEach((l) => { const c = e[l]; qt(c) && (l === "span" ? o.push(n.b(`${e[l]}`)) : c > 0 && o.push(n.b(`${l}-${e[l]}`))); }), ["xs", "sm", "md", "lg", "xl"].forEach((l) => { qt(e[l]) ? o.push(n.b(`${l}-${e[l]}`)) : Ht(e[l]) && Object.entries(e[l]).forEach(([c, d]) => { o.push(c !== "span" ? n.b(`${l}-${c}-${d}`) : n.b(`${l}-${d}`)); }); }), r.value && o.push(n.is("guttered")), [n.b(), o]; }); return (o, s) => (N(), ye(er(o.tag), { class: ie(P(i)), style: lt(P(a)) }, { default: U(() => [ Le(o.$slots, "default") ]), _: 3 }, 8, ["class", "style"])); } }); var QE = /* @__PURE__ */ Ve(jE, [["__file", "col.vue"]]); const So = $t(QE), JE = de({ name: "ElCollapseTransition" }), ek = /* @__PURE__ */ de({ ...JE, setup(t) { const e = He("collapse-transition"), r = (a) => { a.style.maxHeight = "", a.style.overflow = a.dataset.oldOverflow, a.style.paddingTop = a.dataset.oldPaddingTop, a.style.paddingBottom = a.dataset.oldPaddingBottom; }, n = { beforeEnter(a) { a.dataset || (a.dataset = {}), a.dataset.oldPaddingTop = a.style.paddingTop, a.dataset.oldPaddingBottom = a.style.paddingBottom, a.style.height && (a.dataset.elExistsHeight = a.style.height), a.style.maxHeight = 0, a.style.paddingTop = 0, a.style.paddingBottom = 0; }, enter(a) { requestAnimationFrame(() => { a.dataset.oldOverflow = a.style.overflow, a.dataset.elExistsHeight ? a.style.maxHeight = a.dataset.elExistsHeight : a.scrollHeight !== 0 ? a.style.maxHeight = `${a.scrollHeight}px` : a.style.maxHeight = 0, a.style.paddingTop = a.dataset.oldPaddingTop, a.style.paddingBottom = a.dataset.oldPaddingBottom, a.style.overflow = "hidden"; }); }, afterEnter(a) { a.style.maxHeight = "", a.style.overflow = a.dataset.oldOverflow; }, enterCancelled(a) { r(a); }, beforeLeave(a) { a.dataset || (a.dataset = {}), a.dataset.oldPaddingTop = a.style.paddingTop, a.dataset.oldPaddingBottom = a.style.paddingBottom, a.dataset.oldOverflow = a.style.overflow, a.style.maxHeight = `${a.scrollHeight}px`, a.style.overflow = "hidden"; }, leave(a) { a.scrollHeight !== 0 && (a.style.maxHeight = 0, a.style.paddingTop = 0, a.style.paddingBottom = 0); }, afterLeave(a) { r(a); }, leaveCancelled(a) { r(a); } }; return (a, i) => (N(), ye(ui, Rr({ name: P(e).b() }, P0(n)), { default: U(() => [ Le(a.$slots, "default") ]), _: 3 }, 16, ["name"])); } }); var tk = /* @__PURE__ */ Ve(ek, [["__file", "collapse-transition.vue"]]); const rk = $t(tk), nk = rt({ color: { type: $e(Object), required: !0 }, vertical: { type: Boolean, default: !1 } }); let Ol = !1; function eo(t, e) { if (!_t) return; const r = function(i) { var o; (o = e.drag) == null || o.call(e, i); }, n = function(i) { var o; document.removeEventListener("mousemove", r), document.removeEventListener("mouseup", n), document.removeEventListener("touchmove", r), document.removeEventListener("touchend", n), document.onselectstart = null, document.ondragstart = null, Ol = !1, (o = e.end) == null || o.call(e, i); }, a = function(i) { var o; Ol || (i.preventDefault(), document.onselectstart = () => !1, document.ondragstart = () => !1, document.addEventListener("mousemove", r), document.addEventListener("mouseup", n), document.addEventListener("touchmove", r), document.addEventListener("touchend", n), Ol = !0, (o = e.start) == null || o.call(e, i)); }; t.addEventListener("mousedown", a), t.addEventListener("touchstart", a, { passive: !1 }); } const ak = (t) => { const e = gt(), { t: r } = yo(), n = jr(), a = jr(), i = V(() => t.color.get("alpha")), o = V(() => r("el.colorpicker.alphaLabel")); function s(d) { var v; d.target !== n.value && u(d), (v = n.value) == null || v.focus(); } function u(d) { if (!a.value || !n.value) return; const h = e.vnode.el.getBoundingClientRect(), { clientX: f, clientY: p } = Tu(d); if (t.vertical) { let m = p - h.top; m = Math.max(n.value.offsetHeight / 2, m), m = Math.min(m, h.height - n.value.offsetHeight / 2), t.color.set("alpha", Math.round((m - n.value.offsetHeight / 2) / (h.height - n.value.offsetHeight) * 100)); } else { let m = f - h.left; m = Math.max(n.value.offsetWidth / 2, m), m = Math.min(m, h.width - n.value.offsetWidth / 2), t.color.set("alpha", Math.round((m - n.value.offsetWidth / 2) / (h.width - n.value.offsetWidth) * 100)); } } function l(d) { const { code: v, shiftKey: h } = d, f = h ? 10 : 1; switch (v) { case Lt.left: case Lt.down: d.preventDefault(), d.stopPropagation(), c(-f); break; case Lt.right: case Lt.up: d.preventDefault(), d.stopPropagation(), c(f); break; } } function c(d) { let v = i.value + d; v = v < 0 ? 0 : v > 100 ? 100 : v, t.color.set("alpha", v); } return { thumb: n, bar: a, alpha: i, alphaLabel: o, handleDrag: u, handleClick: s, handleKeydown: l }; }, ik = (t, { bar: e, thumb: r, handleDrag: n }) => { const a = gt(), i = He("color-alpha-slider"), o = ce(0), s = ce(0), u = ce(); function l() { if (!r.value || t.vertical) return 0; const y = a.vnode.el, b = t.color.get("alpha"); return y ? Math.round(b * (y.offsetWidth - r.value.offsetWidth / 2) / 100) : 0; } function c() { if (!r.value) return 0; const y = a.vnode.el; if (!t.vertical) return 0; const b = t.color.get("alpha"); return y ? Math.round(b * (y.offsetHeight - r.value.offsetHeight / 2) / 100) : 0; } function d() { if (t.color && t.color.value) { const { r: y, g: b, b: w } = t.color.toRgb(); return `linear-gradient(to right, rgba(${y}, ${b}, ${w}, 0) 0%, rgba(${y}, ${b}, ${w}, 1) 100%)`; } return ""; } function v() { o.value = l(), s.value = c(), u.value = d(); } Et(() => { if (!e.value || !r.value) return; const y = { drag: (b) => { n(b); }, end: (b) => { n(b); } }; eo(e.value, y), eo(r.value, y), v(); }), Pe(() => t.color.get("alpha"), () => v()), Pe(() => t.color.value, () => v()); const h = V(() => [i.b(), i.is("vertical", t.vertical)]), f = V(() => i.e("bar")), p = V(() => i.e("thumb")), m = V(() => ({ background: u.value })), g = V(() => ({ left: Ja(o.value), top: Ja(s.value) })); return { rootKls: h, barKls: f, barStyle: m, thumbKls: p, thumbStyle: g, update: v }; }, ok = "ElColorAlphaSlider", sk = de({ name: ok }), lk = /* @__PURE__ */ de({ ...sk, props: nk, setup(t, { expose: e }) { const r = t, { alpha: n, alphaLabel: a, bar: i, thumb: o, handleDrag: s, handleClick: u, handleKeydown: l } = ak(r), { rootKls: c, barKls: d, barStyle: v, thumbKls: h, thumbStyle: f, update: p } = ik(r, { bar: i, thumb: o, handleDrag: s }); return e({ update: p, bar: i, thumb: o }), (m, g) => (N(), Z("div", { class: ie(P(c)) }, [ X("div", { ref_key: "bar", ref: i, class: ie(P(d)), style: lt(P(v)), onClick: P(u) }, null, 14, ["onClick"]), X("div", { ref_key: "thumb", ref: o, class: ie(P(h)), style: lt(P(f)), "aria-label": P(a), "aria-valuenow": P(n), "aria-orientation": m.vertical ? "vertical" : "horizontal", "aria-valuemin": "0", "aria-valuemax": "100", role: "slider", tabindex: "0", onKeydown: P(l) }, null, 46, ["aria-label", "aria-valuenow", "aria-orientation", "onKeydown"]) ], 2)); } }); var uk = /* @__PURE__ */ Ve(lk, [["__file", "alpha-slider.vue"]]); const ck = de({ name: "ElColorHueSlider", props: { color: { type: Object, required: !0 }, vertical: Boolean }, setup(t) { const e = He("color-hue-slider"), r = gt(), n = ce(), a = ce(), i = ce(0), o = ce(0), s = V(() => t.color.get("hue")); Pe(() => s.value, () => { v(); }); function u(h) { h.target !== n.value && l(h); } function l(h) { if (!a.value || !n.value) return; const p = r.vnode.el.getBoundingClientRect(), { clientX: m, clientY: g } = Tu(h); let y; if (t.vertical) { let b = g - p.top; b = Math.min(b, p.height - n.value.offsetHeight / 2), b = Math.max(n.value.offsetHeight / 2, b), y = Math.round((b - n.value.offsetHeight / 2) / (p.height - n.value.offsetHeight) * 360); } else { let b = m - p.left; b = Math.min(b, p.width - n.value.offsetWidth / 2), b = Math.max(n.value.offsetWidth / 2, b), y = Math.round((b - n.value.offsetWidth / 2) / (p.width - n.value.offsetWidth) * 360); } t.color.set("hue", y); } function c() { if (!n.value) return 0; const h = r.vnode.el; if (t.vertical) return 0; const f = t.color.get("hue"); return h ? Math.round(f * (h.offsetWidth - n.value.offsetWidth / 2) / 360) : 0; } function d() { if (!n.value) return 0; const h = r.vnode.el; if (!t.vertical) return 0; const f = t.color.get("hue"); return h ? Math.round(f * (h.offsetHeight - n.value.offsetHeight / 2) / 360) : 0; } function v() { i.value = c(), o.value = d(); } return Et(() => { if (!a.value || !n.value) return; const h = { drag: (f) => { l(f); }, end: (f) => { l(f); } }; eo(a.value, h), eo(n.value, h), v(); }), { bar: a, thumb: n, thumbLeft: i, thumbTop: o, hueValue: s, handleClick: u, update: v, ns: e }; } }); function dk(t, e, r, n, a, i) { return N(), Z("div", { class: ie([t.ns.b(), t.ns.is("vertical", t.vertical)]) }, [ X("div", { ref: "bar", class: ie(t.ns.e("bar")), onClick: t.handleClick }, null, 10, ["onClick"]), X("div", { ref: "thumb", class: ie(t.ns.e("thumb")), style: lt({ left: t.thumbLeft + "px", top: t.thumbTop + "px" }) }, null, 6) ], 2); } var fk = /* @__PURE__ */ Ve(ck, [["render", dk], ["__file", "hue-slider.vue"]]); const vk = rt({ modelValue: String, id: String, showAlpha: Boolean, colorFormat: String, disabled: Boolean, size: di, popperClass: { type: String, default: "" }, tabindex: { type: [String, Number], default: 0 }, teleported: cr.teleported, predefine: { type: $e(Array) }, validateEvent: { type: Boolean, default: !0 }, ...Zn(["ariaLabel"]) }), hk = { [zt]: (t) => tr(t) || $n(t), [Bu]: (t) => tr(t) || $n(t), activeChange: (t) => tr(t) || $n(t), focus: (t) => t instanceof FocusEvent, blur: (t) => t instanceof FocusEvent }, Ah = Symbol("colorPickerContextKey"), Ud = function(t, e, r) { return [ t, e * r / ((t = (2 - e) * r) < 1 ? t : 2 - t) || 0, t / 2 ]; }, pk = function(t) { return typeof t == "string" && t.includes(".") && Number.parseFloat(t) === 1; }, gk = function(t) { return typeof t == "string" && t.includes("%"); }, Ka = function(t, e) { pk(t) && (t = "100%"); const r = gk(t); return t = Math.min(e, Math.max(0, Number.parseFloat(`${t}`))), r && (t = Number.parseInt(`${t * e}`, 10) / 100), Math.abs(t - e) < 1e-6 ? 1 : t % e / Number.parseFloat(e); }, Gd = { 10: "A", 11: "B", 12: "C", 13: "D", 14: "E", 15: "F" }, ss = (t) => { t = Math.min(Math.round(t), 255); const e = Math.floor(t / 16), r = t % 16; return `${Gd[e] || e}${Gd[r] || r}`; }, Wd = function({ r: t, g: e, b: r }) { return Number.isNaN(+t) || Number.isNaN(+e) || Number.isNaN(+r) ? "" : `#${ss(t)}${ss(e)}${ss(r)}`; }, Ll = { A: 10, B: 11, C: 12, D: 13, E: 14, F: 15 }, Jn = function(t) { return t.length === 2 ? (Ll[t[0].toUpperCase()] || +t[0]) * 16 + (Ll[t[1].toUpperCase()] || +t[1]) : Ll[t[1].toUpperCase()] || +t[1]; }, mk = function(t, e, r) { e = e / 100, r = r / 100; let n = e; const a = Math.max(r, 0.01); r *= 2, e *= r <= 1 ? r : 2 - r, n *= a <= 1 ? a : 2 - a; const i = (r + e) / 2, o = r === 0 ? 2 * n / (a + n) : 2 * e / (r + e); return { h: t, s: o * 100, v: i * 100 }; }, Yd = (t, e, r) => { t = Ka(t, 255), e = Ka(e, 255), r = Ka(r, 255); const n = Math.max(t, e, r), a = Math.min(t, e, r); let i; const o = n, s = n - a, u = n === 0 ? 0 : s / n; if (n === a) i = 0; else { switch (n) { case t: { i = (e - r) / s + (e < r ? 6 : 0); break; } case e: { i = (r - t) / s + 2; break; } case r: { i = (t - e) / s + 4; break; } } i /= 6; } return { h: i * 360, s: u * 100, v: o * 100 }; }, Di = function(t, e, r) { t = Ka(t, 360) * 6, e = Ka(e, 100), r = Ka(r, 100); const n = Math.floor(t), a = t - n, i = r * (1 - e), o = r * (1 - a * e), s = r * (1 - (1 - a) * e), u = n % 6, l = [r, o, i, i, s, r][u], c = [s, r, r, o, i, i][u], d = [i, i, s, r, r, o][u]; return { r: Math.round(l * 255), g: Math.round(c * 255), b: Math.round(d * 255) }; }; class qi { constructor(e = {}) { this._hue = 0, this._saturation = 100, this._value = 100, this._alpha = 100, this.enableAlpha = !1, this.format = "hex", this.value = ""; for (const r in e) va(e, r) && (this[r] = e[r]); e.value ? this.fromString(e.value) : this.doOnChange(); } set(e, r) { if (arguments.length === 1 && typeof e == "object") { for (const n in e) va(e, n) && this.set(n, e[n]); return; } this[`_${e}`] = r, this.doOnChange(); } get(e) { return e === "alpha" ? Math.floor(this[`_${e}`]) : this[`_${e}`]; } toRgb() { return Di(this._hue, this._saturation, this._value); } fromString(e) { if (!e) { this._hue = 0, this._saturation = 100, this._value = 100, this.doOnChange(); return; } const r = (n, a, i) => { this._hue = Math.max(0, Math.min(360, n)), this._saturation = Math.max(0, Math.min(100, a)), this._value = Math.max(0, Math.min(100, i)), this.doOnChange(); }; if (e.includes("hsl")) { const n = e.replace(/hsla|hsl|\(|\)/gm, "").split(/\s|,/g).filter((a) => a !== "").map((a, i) => i > 2 ? Number.parseFloat(a) : Number.parseInt(a, 10)); if (n.length === 4 ? this._alpha = Number.parseFloat(n[3]) * 100 : n.length === 3 && (this._alpha = 100), n.length >= 3) { const { h: a, s: i, v: o } = mk(n[0], n[1], n[2]); r(a, i, o); } } else if (e.includes("hsv")) { const n = e.replace(/hsva|hsv|\(|\)/gm, "").split(/\s|,/g).filter((a) => a !== "").map((a, i) => i > 2 ? Number.parseFloat(a) : Number.parseInt(a, 10)); n.length === 4 ? this._alpha = Number.parseFloat(n[3]) * 100 : n.length === 3 && (this._alpha = 100), n.length >= 3 && r(n[0], n[1], n[2]); } else if (e.includes("rgb")) { const n = e.replace(/rgba|rgb|\(|\)/gm, "").split(/\s|,/g).filter((a) => a !== "").map((a, i) => i > 2 ? Number.parseFloat(a) : Number.parseInt(a, 10)); if (n.length === 4 ? this._alpha = Number.parseFloat(n[3]) * 100 : n.length === 3 && (this._alpha = 100), n.length >= 3) { const { h: a, s: i, v: o } = Yd(n[0], n[1], n[2]); r(a, i, o); } } else if (e.includes("#")) { const n = e.replace("#", "").trim(); if (!/^[0-9a-fA-F]{3}$|^[0-9a-fA-F]{6}$|^[0-9a-fA-F]{8}$/.test(n)) return; let a, i, o; n.length === 3 ? (a = Jn(n[0] + n[0]), i = Jn(n[1] + n[1]), o = Jn(n[2] + n[2])) : (n.length === 6 || n.length === 8) && (a = Jn(n.slice(0, 2)), i = Jn(n.slice(2, 4)), o = Jn(n.slice(4, 6))), n.length === 8 ? this._alpha = Jn(n.slice(6)) / 255 * 100 : (n.length === 3 || n.length === 6) && (this._alpha = 100); const { h: s, s: u, v: l } = Yd(a, i, o); r(s, u, l); } } compare(e) { return Math.abs(e._hue - this._hue) < 2 && Math.abs(e._saturation - this._saturation) < 1 && Math.abs(e._value - this._value) < 1 && Math.abs(e._alpha - this._alpha) < 1; } doOnChange() { const { _hue: e, _saturation: r, _value: n, _alpha: a, format: i } = this; if (this.enableAlpha) switch (i) { case "hsl": { const o = Ud(e, r / 100, n / 100); this.value = `hsla(${e}, ${Math.round(o[1] * 100)}%, ${Math.round(o[2] * 100)}%, ${this.get("alpha") / 100})`; break; } case "hsv": { this.value = `hsva(${e}, ${Math.round(r)}%, ${Math.round(n)}%, ${this.get("alpha") / 100})`; break; } case "hex": { this.value = `${Wd(Di(e, r, n))}${ss(a * 255 / 100)}`; break; } default: { const { r: o, g: s, b: u } = Di(e, r, n); this.value = `rgba(${o}, ${s}, ${u}, ${this.get("alpha") / 100})`; } } else switch (i) { case "hsl": { const o = Ud(e, r / 100, n / 100); this.value = `hsl(${e}, ${Math.round(o[1] * 100)}%, ${Math.round(o[2] * 100)}%)`; break; } case "hsv": { this.value = `hsv(${e}, ${Math.round(r)}%, ${Math.round(n)}%)`; break; } case "rgb": { const { r: o, g: s, b: u } = Di(e, r, n); this.value = `rgb(${o}, ${s}, ${u})`; break; } default: this.value = Wd(Di(e, r, n)); } } } const yk = de({ props: { colors: { type: Array, required: !0 }, color: { type: Object, required: !0 }, enableAlpha: { type: Boolean, required: !0 } }, setup(t) { const e = He("color-predefine"), { currentColor: r } = Ue(Ah), n = ce(i(t.colors, t.color)); Pe(() => r.value, (o) => { const s = new qi(); s.fromString(o), n.value.forEach((u) => { u.selected = s.compare(u); }); }), bv(() => { n.value = i(t.colors, t.color); }); function a(o) { t.color.fromString(t.colors[o]); } function i(o, s) { return o.map((u) => { const l = new qi(); return l.enableAlpha = t.enableAlpha, l.format = "rgba", l.fromString(u), l.selected = l.value === s.value, l; }); } return { rgbaColors: n, handleSelect: a, ns: e }; } }); function bk(t, e, r, n, a, i) { return N(), Z("div", { class: ie(t.ns.b()) }, [ X("div", { class: ie(t.ns.e("colors")) }, [ (N(!0), Z(Qe, null, Jt(t.rgbaColors, (o, s) => (N(), Z("div", { key: t.colors[s], class: ie([ t.ns.e("color-selector"), t.ns.is("alpha", o._alpha < 100), { selected: o.selected } ]), onClick: (u) => t.handleSelect(s) }, [ X("div", { style: lt({ backgroundColor: o.value }) }, null, 4) ], 10, ["onClick"]))), 128)) ], 2) ], 2); } var wk = /* @__PURE__ */ Ve(yk, [["render", bk], ["__file", "predefine.vue"]]); const xk = de({ name: "ElSlPanel", props: { color: { type: Object, required: !0 } }, setup(t) { const e = He("color-svpanel"), r = gt(), n = ce(0), a = ce(0), i = ce("hsl(0, 100%, 50%)"), o = V(() => { const l = t.color.get("hue"), c = t.color.get("value"); return { hue: l, value: c }; }); function s() { const l = t.color.get("saturation"), c = t.color.get("value"), d = r.vnode.el, { clientWidth: v, clientHeight: h } = d; a.value = l * v / 100, n.value = (100 - c) * h / 100, i.value = `hsl(${t.color.get("hue")}, 100%, 50%)`; } function u(l) { const d = r.vnode.el.getBoundingClientRect(), { clientX: v, clientY: h } = Tu(l); let f = v - d.left, p = h - d.top; f = Math.max(0, f), f = Math.min(f, d.width), p = Math.max(0, p), p = Math.min(p, d.height), a.value = f, n.value = p, t.color.set({ saturation: f / d.width * 100, value: 100 - p / d.height * 100 }); } return Pe(() => o.value, () => { s(); }), Et(() => { eo(r.vnode.el, { drag: (l) => { u(l); }, end: (l) => { u(l); } }), s(); }), { cursorTop: n, cursorLeft: a, background: i, colorValue: o, handleDrag: u, update: s, ns: e }; } }); function Ck(t, e, r, n, a, i) { return N(), Z("div", { class: ie(t.ns.b()), style: lt({ backgroundColor: t.background }) }, [ X("div", { class: ie(t.ns.e("white")) }, null, 2), X("div", { class: ie(t.ns.e("black")) }, null, 2), X("div", { class: ie(t.ns.e("cursor")), style: lt({ top: t.cursorTop + "px", left: t.cursorLeft + "px" }) }, [ X("div") ], 6) ], 6); } var Ek = /* @__PURE__ */ Ve(xk, [["render", Ck], ["__file", "sv-panel.vue"]]); const kk = de({ name: "ElColorPicker" }), Sk = /* @__PURE__ */ de({ ...kk, props: vk, emits: hk, setup(t, { expose: e, emit: r }) { const n = t, { t: a } = yo(), i = He("color"), { formItem: o } = Ta(), s = pa(), u = xo(), { inputId: l, isLabeledByFormItem: c } = Co(n, { formItemContext: o }), d = ce(), v = ce(), h = ce(), f = ce(), p = ce(), m = ce(), { isFocused: g, handleFocus: y, handleBlur: b } = Gu(p, { beforeFocus() { return u.value; }, beforeBlur($) { var G; return (G = f.value) == null ? void 0 : G.isFocusInsideContent($); }, afterBlur() { B(!1), R(); } }); let w = !0; const C = Jr(new qi({ enableAlpha: n.showAlpha, format: n.colorFormat || "", value: n.modelValue })), E = ce(!1), x = ce(!1), T = ce(""), k = V(() => !n.modelValue && !x.value ? "transparent" : L(C, n.showAlpha)), _ = V(() => !n.modelValue && !x.value ? "" : C.value), D = V(() => c.value ? void 0 : n.ariaLabel || a("el.colorpicker.defaultLabel")), O = V(() => c.value ? o == null ? void 0 : o.labelId : void 0), F = V(() => [ i.b("picker"), i.is("disabled", u.value), i.bm("picker", s.value), i.is("focused", g.value) ]); function L($, G) { if (!($ instanceof qi)) throw new TypeError("color should be instance of _color Class"); const { r: Q, g: ge, b: Ee } = $.toRgb(); return G ? `rgba(${Q}, ${ge}, ${Ee}, ${$.get("alpha") / 100})` : `rgb(${Q}, ${ge}, ${Ee})`; } function B($) { E.value = $; } const I = Rv(B, 100, { leading: !0 }); function M() { u.value || B(!0); } function A() { I(!1), R(); } function R() { ot(() => { n.modelValue ? C.fromString(n.modelValue) : (C.value = "", ot(() => { x.value = !1; })); }); } function K() { u.value || I(!E.value); } function H() { C.fromString(T.value); } function q() { const $ = C.value; r(zt, $), r("change", $), n.validateEvent && (o == null || o.validate("change").catch((G) => Dt(G))), I(!1), ot(() => { const G = new qi({ enableAlpha: n.showAlpha, format: n.colorFormat || "", value: n.modelValue }); C.compare(G) || R(); }); } function ee() { I(!1), r(zt, null), r("change", null), n.modelValue !== null && n.validateEvent && (o == null || o.validate("change").catch(($) => Dt($))), R(); } function se() { E.value && (A(), g.value && ue()); } function oe($) { $.preventDefault(), $.stopPropagation(), B(!1), R(); } function ne($) { switch ($.code) { case Lt.enter: case Lt.space: $.preventDefault(), $.stopPropagation(), M(), m.value.focus(); break; case Lt.esc: oe($); break; } } function ue() { p.value.focus(); } function te() { p.value.blur(); } return Et(() => { n.modelValue && (T.value = _.value); }), Pe(() => n.modelValue, ($) => { $ ? $ && $ !== C.value && (w = !1, C.fromString($)) : x.value = !1; }), Pe(() => [n.colorFormat, n.showAlpha], () => { C.enableAlpha = n.showAlpha, C.format = n.colorFormat || C.format, C.doOnChange(), r(zt, C.value); }), Pe(() => _.value, ($) => { T.value = $, w && r("activeChange", $), w = !0; }), Pe(() => C.value, () => { !n.modelValue && !x.value && (x.value = !0); }), Pe(() => E.value, () => { ot(() => { var $, G, Q; ($ = d.value) == null || $.update(), (G = v.value) == null || G.update(), (Q = h.value) == null || Q.update(); }); }), Ct(Ah, { currentColor: _ }), e({ color: C, show: M, hide: A, focus: ue, blur: te }), ($, G) => (N(), ye(P(ko), { ref_key: "popper", ref: f, visible: E.value, "show-arrow": !1, "fallback-placements": ["bottom", "top", "right", "left"], offset: 0, "gpu-acceleration": !1, "popper-class": [P(i).be("picker", "panel"), P(i).b("dropdown"), $.popperClass], "stop-popper-mouse-event": !1, effect: "light", trigger: "click", teleported: $.teleported, transition: `${P(i).namespace.value}-zoom-in-top`, persistent: "", onHide: (Q) => B(!1) }, { content: U(() => [ Ze((N(), Z("div", { onKeydown: aa(oe, ["esc"]) }, [ X("div", { class: ie(P(i).be("dropdown", "main-wrapper")) }, [ J(fk, { ref_key: "hue", ref: d, class: "hue-slider", color: P(C), vertical: "" }, null, 8, ["color"]), J(Ek, { ref_key: "sv", ref: v, color: P(C) }, null, 8, ["color"]) ], 2), $.showAlpha ? (N(), ye(uk, { key: 0, ref_key: "alpha", ref: h, color: P(C) }, null, 8, ["color"])) : he("v-if", !0), $.predefine ? (N(), ye(wk, { key: 1, ref: "predefine", "enable-alpha": $.showAlpha, color: P(C), colors: $.predefine }, null, 8, ["enable-alpha", "color", "colors"])) : he("v-if", !0), X("div", { class: ie(P(i).be("dropdown", "btns")) }, [ X("span", { class: ie(P(i).be("dropdown", "value")) }, [ J(P(Eo), { ref_key: "inputRef", ref: m, modelValue: T.value, "onUpdate:modelValue": (Q) => T.value = Q, "validate-event": !1, size: "small", onKeyup: aa(H, ["enter"]), onBlur: H }, null, 8, ["modelValue", "onUpdate:modelValue", "onKeyup"]) ], 2), J(P(Hr), { class: ie(P(i).be("dropdown", "link-btn")), text: "", size: "small", onClick: ee }, { default: U(() => [ ze(Ie(P(a)("el.colorpicker.clear")), 1) ]), _: 1 }, 8, ["class"]), J(P(Hr), { plain: "", size: "small", class: ie(P(i).be("dropdown", "btn")), onClick: q }, { default: U(() => [ ze(Ie(P(a)("el.colorpicker.confirm")), 1) ]), _: 1 }, 8, ["class"]) ], 2) ], 40, ["onKeydown"])), [ [P(_h), se] ]) ]), default: U(() => [ X("div", Rr({ id: P(l), ref_key: "triggerRef", ref: p }, $.$attrs, { class: P(F), role: "button", "aria-label": P(D), "aria-labelledby": P(O), "aria-description": P(a)("el.colorpicker.description", { color: $.modelValue || "" }), "aria-disabled": P(u), tabindex: P(u) ? -1 : $.tabindex, onKeydown: ne, onFocus: P(y), onBlur: P(b) }), [ P(u) ? (N(), Z("div", { key: 0, class: ie(P(i).be("picker", "mask")) }, null, 2)) : he("v-if", !0), X("div", { class: ie(P(i).be("picker", "trigger")), onClick: K }, [ X("span", { class: ie([P(i).be("picker", "color"), P(i).is("alpha", $.showAlpha)]) }, [ X("span", { class: ie(P(i).be("picker", "color-inner")), style: lt({ backgroundColor: P(k) }) }, [ Ze(J(P(Vt), { class: ie([P(i).be("picker", "icon"), P(i).is("icon-arrow-down")]) }, { default: U(() => [ J(P(Gs)) ]), _: 1 }, 8, ["class"]), [ [mt, $.modelValue || x.value] ]), Ze(J(P(Vt), { class: ie([P(i).be("picker", "empty"), P(i).is("icon-close")]) }, { default: U(() => [ J(P(Ss)) ]), _: 1 }, 8, ["class"]), [ [mt, !$.modelValue && !x.value] ]) ], 6) ], 2) ], 2) ], 16, ["id", "aria-label", "aria-labelledby", "aria-description", "aria-disabled", "tabindex", "onFocus", "onBlur"]) ]), _: 1 }, 8, ["visible", "popper-class", "teleported", "transition", "onHide"])); } }); var Tk = /* @__PURE__ */ Ve(Sk, [["__file", "color-picker.vue"]]); const _k = $t(Tk), Dk = de({ name: "ElContainer" }), Pk = /* @__PURE__ */ de({ ...Dk, props: { direction: { type: String } }, setup(t) { const e = t, r = vo(), n = He("container"), a = V(() => e.direction === "vertical" ? !0 : e.direction === "horizontal" ? !1 : r && r.default ? r.default().some((o) => { const s = o.type.name; return s === "ElHeader" || s === "ElFooter"; }) : !1); return (i, o) => (N(), Z("section", { class: ie([P(n).b(), P(n).is("vertical", P(a))]) }, [ Le(i.$slots, "default") ], 2)); } }); var Ok = /* @__PURE__ */ Ve(Pk, [["__file", "container.vue"]]); const Lk = de({ name: "ElAside" }), Ik = /* @__PURE__ */ de({ ...Lk, props: { width: { type: String, default: null } }, setup(t) { const e = t, r = He("aside"), n = V(() => e.width ? r.cssVarBlock({ width: e.width }) : {}); return (a, i) => (N(), Z("aside", { class: ie(P(r).b()), style: lt(P(n)) }, [ Le(a.$slots, "default") ], 6)); } }); var Mh = /* @__PURE__ */ Ve(Ik, [["__file", "aside.vue"]]); const Fk = de({ name: "ElFooter" }), Ak = /* @__PURE__ */ de({ ...Fk, props: { height: { type: String, default: null } }, setup(t) { const e = t, r = He("footer"), n = V(() => e.height ? r.cssVarBlock({ height: e.height }) : {}); return (a, i) => (N(), Z("footer", { class: ie(P(r).b()), style: lt(P(n)) }, [ Le(a.$slots, "default") ], 6)); } }); var Bh = /* @__PURE__ */ Ve(Ak, [["__file", "footer.vue"]]); const Mk = de({ name: "ElHeader" }), Bk = /* @__PURE__ */ de({ ...Mk, props: { height: { type: String, default: null } }, setup(t) { const e = t, r = He("header"), n = V(() => e.height ? r.cssVarBlock({ height: e.height }) : {}); return (a, i) => (N(), Z("header", { class: ie(P(r).b()), style: lt(P(n)) }, [ Le(a.$slots, "default") ], 6)); } }); var Nh = /* @__PURE__ */ Ve(Bk, [["__file", "header.vue"]]); const Nk = de({ name: "ElMain" }), $k = /* @__PURE__ */ de({ ...Nk, setup(t) { const e = He("main"); return (r, n) => (N(), Z("main", { class: ie(P(e).b()) }, [ Le(r.$slots, "default") ], 2)); } }); var $h = /* @__PURE__ */ Ve($k, [["__file", "main.vue"]]); const Rh = $t(Ok, { Aside: Mh, Footer: Bh, Header: Nh, Main: $h }); xn(Mh); xn(Bh); const zh = xn(Nh), ec = xn($h), Rk = /* @__PURE__ */ de({ inheritAttrs: !1 }); function zk(t, e, r, n, a, i) { return Le(t.$slots, "default"); } var Vk = /* @__PURE__ */ Ve(Rk, [["render", zk], ["__file", "collection.vue"]]); const Hk = /* @__PURE__ */ de({ name: "ElCollectionItem", inheritAttrs: !1 }); function qk(t, e, r, n, a, i) { return Le(t.$slots, "default"); } var Kk = /* @__PURE__ */ Ve(Hk, [["render", qk], ["__file", "collection-item.vue"]]); const Uk = "data-el-collection-item", Gk = (t) => { const e = `El${t}Collection`, r = `${e}Item`, n = Symbol(e), a = Symbol(r), i = { ...Vk, name: e, setup() { const s = ce(null), u = /* @__PURE__ */ new Map(); Ct(n, { itemMap: u, getItems: () => { const c = P(s); if (!c) return []; const d = Array.from(c.querySelectorAll(`[${Uk}]`)); return [...u.values()].sort((h, f) => d.indexOf(h.ref) - d.indexOf(f.ref)); }, collectionRef: s }); } }, o = { ...Kk, name: r, setup(s, { attrs: u }) { const l = ce(null), c = Ue(n, void 0); Ct(a, { collectionItemRef: l }), Et(() => { const d = P(l); d && c.itemMap.set(d, { ref: d, ...u }); }), qr(() => { const d = P(l); c.itemMap.delete(d); }); } }; return { COLLECTION_INJECTION_KEY: n, COLLECTION_ITEM_INJECTION_KEY: a, ElCollection: i, ElCollectionItem: o }; }, Il = rt({ trigger: Ji.trigger, effect: { ...cr.effect, default: "light" }, type: { type: $e(String) }, placement: { type: $e(String), default: "bottom" }, popperOptions: { type: $e(Object), default: () => ({}) }, id: String, size: { type: String, default: "" }, splitButton: Boolean, hideOnClick: { type: Boolean, default: !0 }, loop: { type: Boolean, default: !0 }, showTimeout: { type: Number, default: 150 }, hideTimeout: { type: Number, default: 150 }, tabindex: { type: $e([Number, String]), default: 0 }, maxHeight: { type: $e([Number, String]), default: "" }, popperClass: { type: String, default: "" }, disabled: Boolean, role: { type: String, default: "menu" }, buttonProps: { type: $e(Object) }, teleported: cr.teleported }); rt({ command: { type: [Object, String, Number], default: () => ({}) }, disabled: Boolean, divided: Boolean, textValue: String, icon: { type: Hn } }); rt({ onKeydown: { type: $e(Function) } }); Gk("Dropdown"); const Vh = Symbol("ElSelectGroup"), To = Symbol("ElSelect"); function Wk(t, e) { const r = Ue(To), n = Ue(Vh, { disabled: !1 }), a = V(() => c(Fn(r.props.modelValue), t.value)), i = V(() => { var h; if (r.props.multiple) { const f = Fn((h = r.props.modelValue) != null ? h : []); return !a.value && f.length >= r.props.multipleLimit && r.props.multipleLimit > 0; } else return !1; }), o = V(() => t.label || (Ht(t.value) ? "" : t.value)), s = V(() => t.value || t.label || ""), u = V(() => t.disabled || e.groupDisabled || i.value), l = gt(), c = (h = [], f) => { if (Ht(t.value)) { const p = r.props.valueKey; return h && h.some((m) => ys(fn(m, p)) === fn(f, p)); } else return h && h.includes(f); }, d = () => { !t.disabled && !n.disabled && (r.states.hoveringIndex = r.optionsArray.indexOf(l.proxy)); }, v = (h) => { const f = new RegExp(Xb(h), "i"); e.visible = f.test(o.value) || t.created; }; return Pe(() => o.value, () => { !t.created && !r.props.remote && r.setSelected(); }), Pe(() => t.value, (h, f) => { const { remote: p, valueKey: m } = r.props; if (h !== f && (r.onOptionDestroy(f, l.proxy), r.onOptionCreate(l.proxy)), !t.created && !p) { if (m && Ht(h) && Ht(f) && h[m] === f[m]) return; r.setSelected(); } }), Pe(() => n.disabled, () => { e.groupDisabled = n.disabled; }, { immediate: !0 }), { select: r, currentLabel: o, currentValue: s, itemSelected: a, isDisabled: u, hoverItem: d, updateOption: v }; } const Yk = de({ name: "ElOption", componentName: "ElOption", props: { value: { required: !0, type: [String, Number, Boolean, Object] }, label: [String, Number], created: Boolean, disabled: Boolean }, setup(t) { const e = He("select"), r = Xs(), n = V(() => [ e.be("dropdown", "item"), e.is("disabled", P(s)), e.is("selected", P(o)), e.is("hovering", P(v)) ]), a = Jr({ index: -1, groupDisabled: !1, visible: !0, hover: !1 }), { currentLabel: i, itemSelected: o, isDisabled: s, select: u, hoverItem: l, updateOption: c } = Wk(t, a), { visible: d, hover: v } = ho(a), h = gt().proxy; u.onOptionCreate(h), qr(() => { const p = h.value, { selected: m } = u.states, y = (u.props.multiple ? m : [m]).some((b) => b.value === h.value); ot(() => { u.states.cachedOptions.get(p) === h && !y && u.states.cachedOptions.delete(p); }), u.onOptionDestroy(p, h); }); function f() { s.value || u.handleOptionSelect(h); } return { ns: e, id: r, containerKls: n, currentLabel: i, itemSelected: o, isDisabled: s, select: u, hoverItem: l, updateOption: c, visible: d, hover: v, selectOptionClick: f, states: a }; } }); function Zk(t, e, r, n, a, i) { return Ze((N(), Z("li", { id: t.id, class: ie(t.containerKls), role: "option", "aria-disabled": t.isDisabled || void 0, "aria-selected": t.itemSelected, onMouseenter: t.hoverItem, onClick: ht(t.selectOptionClick, ["stop"]) }, [ Le(t.$slots, "default", {}, () => [ X("span", null, Ie(t.currentLabel), 1) ]) ], 42, ["id", "aria-disabled", "aria-selected", "onMouseenter", "onClick"])), [ [mt, t.visible] ]); } var tc = /* @__PURE__ */ Ve(Yk, [["render", Zk], ["__file", "option.vue"]]); const Xk = de({ name: "ElSelectDropdown", componentName: "ElSelectDropdown", setup() { const t = Ue(To), e = He("select"), r = V(() => t.props.popperClass), n = V(() => t.props.multiple), a = V(() => t.props.fitInputWidth), i = ce(""); function o() { var s; i.value = `${(s = t.selectRef) == null ? void 0 : s.offsetWidth}px`; } return Et(() => { o(), dn(t.selectRef, o); }), { ns: e, minWidth: i, popperClass: r, isMultiple: n, isFitInputWidth: a }; } }); function jk(t, e, r, n, a, i) { return N(), Z("div", { class: ie([t.ns.b("dropdown"), t.ns.is("multiple", t.isMultiple), t.popperClass]), style: lt({ [t.isFitInputWidth ? "width" : "minWidth"]: t.minWidth }) }, [ t.$slots.header ? (N(), Z("div", { key: 0, class: ie(t.ns.be("dropdown", "header")) }, [ Le(t.$slots, "header") ], 2)) : he("v-if", !0), Le(t.$slots, "default"), t.$slots.footer ? (N(), Z("div", { key: 1, class: ie(t.ns.be("dropdown", "footer")) }, [ Le(t.$slots, "footer") ], 2)) : he("v-if", !0) ], 6); } var Qk = /* @__PURE__ */ Ve(Xk, [["render", jk], ["__file", "select-dropdown.vue"]]); const Jk = 11, eS = (t, e) => { const { t: r } = yo(), n = Xs(), a = He("select"), i = He("input"), o = Jr({ inputValue: "", options: /* @__PURE__ */ new Map(), cachedOptions: /* @__PURE__ */ new Map(), disabledOptions: /* @__PURE__ */ new Map(), optionValues: [], selected: [], selectionWidth: 0, calculatorWidth: 0, collapseItemWidth: 0, selectedLabel: "", hoveringIndex: -1, previousQuery: null, inputHovering: !1, menuVisibleOnFocus: !1, isBeforeHide: !1 }), s = ce(null), u = ce(null), l = ce(null), c = ce(null), d = ce(null), v = ce(null), h = ce(null), f = ce(null), p = ce(null), m = ce(null), g = ce(null), y = ce(null), { isComposing: b, handleCompositionStart: w, handleCompositionUpdate: C, handleCompositionEnd: E } = hh({ afterComposition: (W) => ae(W) }), { wrapperRef: x, isFocused: T } = Gu(d, { beforeFocus() { return I.value; }, afterFocus() { t.automaticDropdown && !k.value && (k.value = !0, o.menuVisibleOnFocus = !0); }, beforeBlur(W) { var we, We; return ((we = l.value) == null ? void 0 : we.isFocusInsideContent(W)) || ((We = c.value) == null ? void 0 : We.isFocusInsideContent(W)); }, afterBlur() { k.value = !1, o.menuVisibleOnFocus = !1; } }), k = ce(!1), _ = ce(), { form: D, formItem: O } = Ta(), { inputId: F } = Co(t, { formItemContext: O }), { valueOnClear: L, isEmptyValue: B } = vx(t), I = V(() => t.disabled || (D == null ? void 0 : D.disabled)), M = V(() => fr(t.modelValue) ? t.modelValue.length > 0 : !B(t.modelValue)), A = V(() => t.clearable && !I.value && o.inputHovering && M.value), R = V(() => t.remote && t.filterable && !t.remoteShowSuffix ? "" : t.suffixIcon), K = V(() => a.is("reverse", R.value && k.value)), H = V(() => (O == null ? void 0 : O.validateState) || ""), q = V(() => Uv[H.value]), ee = V(() => t.remote ? 300 : 0), se = V(() => t.loading ? t.loadingText || r("el.select.loading") : t.remote && !o.inputValue && o.options.size === 0 ? !1 : t.filterable && o.inputValue && o.options.size > 0 && oe.value === 0 ? t.noMatchText || r("el.select.noMatch") : o.options.size === 0 ? t.noDataText || r("el.select.noData") : null), oe = V(() => ne.value.filter((W) => W.visible).length), ne = V(() => { const W = Array.from(o.options.values()), we = []; return o.optionValues.forEach((We) => { const at = W.findIndex((Gr) => Gr.value === We); at > -1 && we.push(W[at]); }), we.length >= W.length ? we : W; }), ue = V(() => Array.from(o.cachedOptions.values())), te = V(() => { const W = ne.value.filter((we) => !we.created).some((we) => we.currentLabel === o.inputValue); return t.filterable && t.allowCreate && o.inputValue !== "" && !W; }), $ = () => { t.filterable && lr(t.filterMethod) || t.filterable && t.remote && lr(t.remoteMethod) || ne.value.forEach((W) => { var we; (we = W.updateOption) == null || we.call(W, o.inputValue); }); }, G = pa(), Q = V(() => ["small"].includes(G.value) ? "small" : "default"), ge = V({ get() { return k.value && se.value !== !1; }, set(W) { k.value = W; } }), Ee = V(() => { if (t.multiple && !Mn(t.modelValue)) return Fn(t.modelValue).length === 0 && !o.inputValue; const W = fr(t.modelValue) ? t.modelValue[0] : t.modelValue; return t.filterable || Mn(W) ? !o.inputValue : !0; }), fe = V(() => { var W; const we = (W = t.placeholder) != null ? W : r("el.select.placeholder"); return t.multiple || !M.value ? we : o.selectedLabel; }), me = V(() => Gl ? null : "mouseenter"); Pe(() => t.modelValue, (W, we) => { t.multiple && t.filterable && !t.reserveKeyword && (o.inputValue = "", xe("")), Ce(), !Es(W, we) && t.validateEvent && (O == null || O.validate("change").catch((We) => Dt(We))); }, { flush: "post", deep: !0 }), Pe(() => k.value, (W) => { W ? xe(o.inputValue) : (o.inputValue = "", o.previousQuery = null, o.isBeforeHide = !0), e("visible-change", W); }), Pe(() => o.options.entries(), () => { var W; if (!_t) return; const we = ((W = s.value) == null ? void 0 : W.querySelectorAll("input")) || []; (!t.filterable && !t.defaultFirstOption && !Mn(t.modelValue) || !Array.from(we).includes(document.activeElement)) && Ce(), t.defaultFirstOption && (t.filterable || t.remote) && oe.value && ke(); }, { flush: "post" }), Pe(() => o.hoveringIndex, (W) => { qt(W) && W > -1 ? _.value = ne.value[W] || {} : _.value = {}, ne.value.forEach((we) => { we.hover = _.value === we; }); }), bv(() => { o.isBeforeHide || $(); }); const xe = (W) => { o.previousQuery === W || b.value || (o.previousQuery = W, t.filterable && lr(t.filterMethod) ? t.filterMethod(W) : t.filterable && t.remote && lr(t.remoteMethod) && t.remoteMethod(W), t.defaultFirstOption && (t.filterable || t.remote) && oe.value ? ot(ke) : ot(qe)); }, ke = () => { const W = ne.value.filter((at) => at.visible && !at.disabled && !at.states.groupDisabled), we = W.find((at) => at.created), We = W[0]; o.hoveringIndex = _e(ne.value, we || We); }, Ce = () => { if (t.multiple) o.selectedLabel = ""; else { const we = fr(t.modelValue) ? t.modelValue[0] : t.modelValue, We = De(we); o.selectedLabel = We.currentLabel, o.selected = [We]; return; } const W = []; Mn(t.modelValue) || Fn(t.modelValue).forEach((we) => { W.push(De(we)); }), o.selected = W; }, De = (W) => { let we; const We = bl(W).toLowerCase() === "object", at = bl(W).toLowerCase() === "null", Gr = bl(W).toLowerCase() === "undefined"; for (let sn = o.cachedOptions.size - 1; sn >= 0; sn--) { const xr = ue.value[sn]; if (We ? fn(xr.value, t.valueKey) === fn(W, t.valueKey) : xr.value === W) { we = { value: W, currentLabel: xr.currentLabel, get isDisabled() { return xr.isDisabled; } }; break; } } if (we) return we; const Sn = We ? W.label : !at && !Gr ? W : ""; return { value: W, currentLabel: Sn }; }, qe = () => { o.hoveringIndex = ne.value.findIndex((W) => o.selected.some((we) => Xt(we) === Xt(W))); }, Ke = () => { o.selectionWidth = u.value.getBoundingClientRect().width; }, Be = () => { o.calculatorWidth = v.value.getBoundingClientRect().width; }, Ge = () => { o.collapseItemWidth = g.value.getBoundingClientRect().width; }, le = () => { var W, we; (we = (W = l.value) == null ? void 0 : W.updatePopper) == null || we.call(W); }, S = () => { var W, we; (we = (W = c.value) == null ? void 0 : W.updatePopper) == null || we.call(W); }, z = () => { o.inputValue.length > 0 && !k.value && (k.value = !0), xe(o.inputValue); }, ae = (W) => { if (o.inputValue = W.target.value, t.remote) j(); else return z(); }, j = Rv(() => { z(); }, ee.value), Y = (W) => { Es(t.modelValue, W) || e(Bu, W); }, pe = (W) => Kb(W, (we) => !o.disabledOptions.has(we)), re = (W) => { if (t.multiple && W.code !== Lt.delete && W.target.value.length <= 0) { const we = Fn(t.modelValue).slice(), We = pe(we); if (We < 0) return; const at = we[We]; we.splice(We, 1), e(zt, we), Y(we), e("remove-tag", at); } }, ve = (W, we) => { const We = o.selected.indexOf(we); if (We > -1 && !I.value) { const at = Fn(t.modelValue).slice(); at.splice(We, 1), e(zt, at), Y(at), e("remove-tag", we.value); } W.stopPropagation(), kt(); }, Ae = (W) => { W.stopPropagation(); const we = t.multiple ? [] : L.value; if (t.multiple) for (const We of o.selected) We.isDisabled && we.push(We.value); e(zt, we), Y(we), o.hoveringIndex = -1, k.value = !1, e("clear"), kt(); }, Me = (W) => { var we; if (t.multiple) { const We = Fn((we = t.modelValue) != null ? we : []).slice(), at = _e(We, W.value); at > -1 ? We.splice(at, 1) : (t.multipleLimit <= 0 || We.length < t.multipleLimit) && We.push(W.value), e(zt, We), Y(We), W.created && xe(""), t.filterable && !t.reserveKeyword && (o.inputValue = ""); } else e(zt, W.value), Y(W.value), k.value = !1; kt(), !k.value && ot(() => { Ne(W); }); }, _e = (W = [], we) => { if (!Ht(we)) return W.indexOf(we); const We = t.valueKey; let at = -1; return W.some((Gr, Sn) => ys(fn(Gr, We)) === fn(we, We) ? (at = Sn, !0) : !1), at; }, Ne = (W) => { var we, We, at, Gr, Sn; const Oa = fr(W) ? W[0] : W; let sn = null; if (Oa != null && Oa.value) { const xr = ne.value.filter((Tn) => Tn.value === Oa.value); xr.length > 0 && (sn = xr[0].$el); } if (l.value && sn) { const xr = (Gr = (at = (We = (we = l.value) == null ? void 0 : we.popperRef) == null ? void 0 : We.contentRef) == null ? void 0 : at.querySelector) == null ? void 0 : Gr.call(at, `.${a.be("dropdown", "wrap")}`); xr && Jb(xr, sn); } (Sn = y.value) == null || Sn.handleScroll(); }, Te = (W) => { o.options.set(W.value, W), o.cachedOptions.set(W.value, W), W.disabled && o.disabledOptions.set(W.value, W); }, Oe = (W, we) => { o.options.get(W) === we && o.options.delete(W); }, ut = V(() => { var W, we; return (we = (W = l.value) == null ? void 0 : W.popperRef) == null ? void 0 : we.contentRef; }), nt = () => { o.isBeforeHide = !1, ot(() => Ne(o.selected)); }, kt = () => { var W; (W = d.value) == null || W.focus(); }, St = () => { var W; (W = d.value) == null || W.blur(); }, wt = (W) => { Ae(W); }, Zt = () => { k.value = !1, T.value && St(); }, Pt = () => { o.inputValue.length > 0 ? o.inputValue = "" : k.value = !1; }, Mt = () => { I.value || (Gl && (o.inputHovering = !0), o.menuVisibleOnFocus ? o.menuVisibleOnFocus = !1 : k.value = !k.value); }, gr = () => { k.value ? ne.value[o.hoveringIndex] && Me(ne.value[o.hoveringIndex]) : Mt(); }, Xt = (W) => Ht(W.value) ? fn(W.value, t.valueKey) : W.value, jt = V(() => ne.value.filter((W) => W.visible).every((W) => W.disabled)), wr = V(() => t.multiple ? t.collapseTags ? o.selected.slice(0, t.maxCollapseTags) : o.selected : []), Pr = V(() => t.multiple ? t.collapseTags ? o.selected.slice(t.maxCollapseTags) : [] : []), ur = (W) => { if (!k.value) { k.value = !0; return; } if (!(o.options.size === 0 || o.filteredOptionsCount === 0 || b.value) && !jt.value) { W === "next" ? (o.hoveringIndex++, o.hoveringIndex === o.options.size && (o.hoveringIndex = 0)) : W === "prev" && (o.hoveringIndex--, o.hoveringIndex < 0 && (o.hoveringIndex = o.options.size - 1)); const we = ne.value[o.hoveringIndex]; (we.disabled === !0 || we.states.groupDisabled === !0 || !we.visible) && ur(W), ot(() => Ne(_.value)); } }, xt = () => { if (!u.value) return 0; const W = window.getComputedStyle(u.value); return Number.parseFloat(W.gap || "6px"); }, Tt = V(() => { const W = xt(); return { maxWidth: `${g.value && t.maxCollapseTags === 1 ? o.selectionWidth - o.collapseItemWidth - W : o.selectionWidth}px` }; }), Bt = V(() => ({ maxWidth: `${o.selectionWidth}px` })), kn = V(() => ({ width: `${Math.max(o.calculatorWidth, Jk)}px` })); return dn(u, Ke), dn(v, Be), dn(p, le), dn(x, le), dn(m, S), dn(g, Ge), Et(() => { Ce(); }), { inputId: F, contentId: n, nsSelect: a, nsInput: i, states: o, isFocused: T, expanded: k, optionsArray: ne, hoverOption: _, selectSize: G, filteredOptionsCount: oe, resetCalculatorWidth: Be, updateTooltip: le, updateTagTooltip: S, debouncedOnInputChange: j, onInput: ae, deletePrevTag: re, deleteTag: ve, deleteSelected: Ae, handleOptionSelect: Me, scrollToOption: Ne, hasModelValue: M, shouldShowPlaceholder: Ee, currentPlaceholder: fe, mouseEnterEventName: me, showClose: A, iconComponent: R, iconReverse: K, validateState: H, validateIcon: q, showNewOption: te, updateOptions: $, collapseTagSize: Q, setSelected: Ce, selectDisabled: I, emptyText: se, handleCompositionStart: w, handleCompositionUpdate: C, handleCompositionEnd: E, onOptionCreate: Te, onOptionDestroy: Oe, handleMenuEnter: nt, focus: kt, blur: St, handleClearClick: wt, handleClickOutside: Zt, handleEsc: Pt, toggleMenu: Mt, selectOption: gr, getValueKey: Xt, navigateOptions: ur, dropdownMenuVisible: ge, showTagList: wr, collapseTagList: Pr, tagStyle: Tt, collapseTagStyle: Bt, inputStyle: kn, popperRef: ut, inputRef: d, tooltipRef: l, tagTooltipRef: c, calculatorRef: v, prefixRef: h, suffixRef: f, selectRef: s, wrapperRef: x, selectionRef: u, scrollbarRef: y, menuRef: p, tagMenuRef: m, collapseItemRef: g }; }; var tS = de({ name: "ElOptions", setup(t, { slots: e }) { const r = Ue(To); let n = []; return () => { var a, i; const o = (a = e.default) == null ? void 0 : a.call(e), s = []; function u(l) { fr(l) && l.forEach((c) => { var d, v, h, f; const p = (d = (c == null ? void 0 : c.type) || {}) == null ? void 0 : d.name; p === "ElOptionGroup" ? u(!tr(c.children) && !fr(c.children) && lr((v = c.children) == null ? void 0 : v.default) ? (h = c.children) == null ? void 0 : h.default() : c.children) : p === "ElOption" ? s.push((f = c.props) == null ? void 0 : f.value) : fr(c.children) && u(c.children); }); } return o.length && u((i = o[0]) == null ? void 0 : i.children), Es(s, n) || (n = s, r && (r.states.optionValues = s)), o; }; } }); const rS = rt({ name: String, id: String, modelValue: { type: [Array, String, Number, Boolean, Object], default: void 0 }, autocomplete: { type: String, default: "off" }, automaticDropdown: Boolean, size: di, effect: { type: $e(String), default: "light" }, disabled: Boolean, clearable: Boolean, filterable: Boolean, allowCreate: Boolean, loading: Boolean, popperClass: { type: String, default: "" }, popperOptions: { type: $e(Object), default: () => ({}) }, remote: Boolean, loadingText: String, noMatchText: String, noDataText: String, remoteMethod: Function, filterMethod: Function, multiple: Boolean, multipleLimit: { type: Number, default: 0 }, placeholder: { type: String }, defaultFirstOption: Boolean, reserveKeyword: { type: Boolean, default: !0 }, valueKey: { type: String, default: "value" }, collapseTags: Boolean, collapseTagsTooltip: Boolean, maxCollapseTags: { type: Number, default: 1 }, teleported: cr.teleported, persistent: { type: Boolean, default: !0 }, clearIcon: { type: Hn, default: Au }, fitInputWidth: Boolean, suffixIcon: { type: Hn, default: Gs }, tagType: { ...au.type, default: "info" }, tagEffect: { ...au.effect, default: "light" }, validateEvent: { type: Boolean, default: !0 }, remoteShowSuffix: Boolean, placement: { type: $e(String), values: Ys, default: "bottom-start" }, fallbackPlacements: { type: $e(Array), default: ["bottom-start", "top-start", "right", "left"] }, appendTo: String, ...fx, ...Zn(["ariaLabel"]) }), Zd = "ElSelect", nS = de({ name: Zd, componentName: Zd, components: { ElSelectMenu: Qk, ElOption: tc, ElOptions: tS, ElTag: HE, ElScrollbar: qx, ElTooltip: ko, ElIcon: Vt }, directives: { ClickOutside: _h }, props: rS, emits: [ zt, Bu, "remove-tag", "clear", "visible-change", "focus", "blur" ], setup(t, { emit: e }) { const r = V(() => { const { modelValue: i, multiple: o } = t, s = o ? [] : void 0; return fr(i) ? o ? i : s : o ? s : i; }), n = Jr({ ...ho(t), modelValue: r }), a = eS(n, e); return Ct(To, Jr({ props: n, states: a.states, optionsArray: a.optionsArray, handleOptionSelect: a.handleOptionSelect, onOptionCreate: a.onOptionCreate, onOptionDestroy: a.onOptionDestroy, selectRef: a.selectRef, setSelected: a.setSelected })), { ...a, modelValue: r }; } }); function aS(t, e, r, n, a, i) { const o = Qt("el-tag"), s = Qt("el-tooltip"), u = Qt("el-icon"), l = Qt("el-option"), c = Qt("el-options"), d = Qt("el-scrollbar"), v = Qt("el-select-menu"), h = O0("click-outside"); return Ze((N(), Z("div", { ref: "selectRef", class: ie([t.nsSelect.b(), t.nsSelect.m(t.selectSize)]), [L0(t.mouseEnterEventName)]: (f) => t.states.inputHovering = !0, onMouseleave: (f) => t.states.inputHovering = !1 }, [ J(s, { ref: "tooltipRef", visible: t.dropdownMenuVisible, placement: t.placement, teleported: t.teleported, "popper-class": [t.nsSelect.e("popper"), t.popperClass], "popper-options": t.popperOptions, "fallback-placements": t.fallbackPlacements, effect: t.effect, pure: "", trigger: "click", transition: `${t.nsSelect.namespace.value}-zoom-in-top`, "stop-popper-mouse-event": !1, "gpu-acceleration": !1, persistent: t.persistent, "append-to": t.appendTo, onBeforeShow: t.handleMenuEnter, onHide: (f) => t.states.isBeforeHide = !1 }, { default: U(() => { var f; return [ X("div", { ref: "wrapperRef", class: ie([ t.nsSelect.e("wrapper"), t.nsSelect.is("focused", t.isFocused), t.nsSelect.is("hovering", t.states.inputHovering), t.nsSelect.is("filterable", t.filterable), t.nsSelect.is("disabled", t.selectDisabled) ]), onClick: ht(t.toggleMenu, ["prevent"]) }, [ t.$slots.prefix ? (N(), Z("div", { key: 0, ref: "prefixRef", class: ie(t.nsSelect.e("prefix")) }, [ Le(t.$slots, "prefix") ], 2)) : he("v-if", !0), X("div", { ref: "selectionRef", class: ie([ t.nsSelect.e("selection"), t.nsSelect.is("near", t.multiple && !t.$slots.prefix && !!t.states.selected.length) ]) }, [ t.multiple ? Le(t.$slots, "tag", { key: 0 }, () => [ (N(!0), Z(Qe, null, Jt(t.showTagList, (p) => (N(), Z("div", { key: t.getValueKey(p), class: ie(t.nsSelect.e("selected-item")) }, [ J(o, { closable: !t.selectDisabled && !p.isDisabled, size: t.collapseTagSize, type: t.tagType, effect: t.tagEffect, "disable-transitions": "", style: lt(t.tagStyle), onClose: (m) => t.deleteTag(m, p) }, { default: U(() => [ X("span", { class: ie(t.nsSelect.e("tags-text")) }, [ Le(t.$slots, "label", { label: p.currentLabel, value: p.value }, () => [ ze(Ie(p.currentLabel), 1) ]) ], 2) ]), _: 2 }, 1032, ["closable", "size", "type", "effect", "style", "onClose"]) ], 2))), 128)), t.collapseTags && t.states.selected.length > t.maxCollapseTags ? (N(), ye(s, { key: 0, ref: "tagTooltipRef", disabled: t.dropdownMenuVisible || !t.collapseTagsTooltip, "fallback-placements": ["bottom", "top", "right", "left"], effect: t.effect, placement: "bottom", teleported: t.teleported }, { default: U(() => [ X("div", { ref: "collapseItemRef", class: ie(t.nsSelect.e("selected-item")) }, [ J(o, { closable: !1, size: t.collapseTagSize, type: t.tagType, effect: t.tagEffect, "disable-transitions": "", style: lt(t.collapseTagStyle) }, { default: U(() => [ X("span", { class: ie(t.nsSelect.e("tags-text")) }, " + " + Ie(t.states.selected.length - t.maxCollapseTags), 3) ]), _: 1 }, 8, ["size", "type", "effect", "style"]) ], 2) ]), content: U(() => [ X("div", { ref: "tagMenuRef", class: ie(t.nsSelect.e("selection")) }, [ (N(!0), Z(Qe, null, Jt(t.collapseTagList, (p) => (N(), Z("div", { key: t.getValueKey(p), class: ie(t.nsSelect.e("selected-item")) }, [ J(o, { class: "in-tooltip", closable: !t.selectDisabled && !p.isDisabled, size: t.collapseTagSize, type: t.tagType, effect: t.tagEffect, "disable-transitions": "", onClose: (m) => t.deleteTag(m, p) }, { default: U(() => [ X("span", { class: ie(t.nsSelect.e("tags-text")) }, [ Le(t.$slots, "label", { label: p.currentLabel, value: p.value }, () => [ ze(Ie(p.currentLabel), 1) ]) ], 2) ]), _: 2 }, 1032, ["closable", "size", "type", "effect", "onClose"]) ], 2))), 128)) ], 2) ]), _: 3 }, 8, ["disabled", "effect", "teleported"])) : he("v-if", !0) ]) : he("v-if", !0), t.selectDisabled ? he("v-if", !0) : (N(), Z("div", { key: 1, class: ie([ t.nsSelect.e("selected-item"), t.nsSelect.e("input-wrapper"), t.nsSelect.is("hidden", !t.filterable) ]) }, [ Ze(X("input", { id: t.inputId, ref: "inputRef", "onUpdate:modelValue": (p) => t.states.inputValue = p, type: "text", name: t.name, class: ie([t.nsSelect.e("input"), t.nsSelect.is(t.selectSize)]), disabled: t.selectDisabled, autocomplete: t.autocomplete, style: lt(t.inputStyle), role: "combobox", readonly: !t.filterable, spellcheck: "false", "aria-activedescendant": ((f = t.hoverOption) == null ? void 0 : f.id) || "", "aria-controls": t.contentId, "aria-expanded": t.dropdownMenuVisible, "aria-label": t.ariaLabel, "aria-autocomplete": "none", "aria-haspopup": "listbox", onKeydown: [ aa(ht((p) => t.navigateOptions("next"), ["stop", "prevent"]), ["down"]), aa(ht((p) => t.navigateOptions("prev"), ["stop", "prevent"]), ["up"]), aa(ht(t.handleEsc, ["stop", "prevent"]), ["esc"]), aa(ht(t.selectOption, ["stop", "prevent"]), ["enter"]), aa(ht(t.deletePrevTag, ["stop"]), ["delete"]) ], onCompositionstart: t.handleCompositionStart, onCompositionupdate: t.handleCompositionUpdate, onCompositionend: t.handleCompositionEnd, onInput: t.onInput, onClick: ht(t.toggleMenu, ["stop"]) }, null, 46, ["id", "onUpdate:modelValue", "name", "disabled", "autocomplete", "readonly", "aria-activedescendant", "aria-controls", "aria-expanded", "aria-label", "onKeydown", "onCompositionstart", "onCompositionupdate", "onCompositionend", "onInput", "onClick"]), [ [I0, t.states.inputValue] ]), t.filterable ? (N(), Z("span", { key: 0, ref: "calculatorRef", "aria-hidden": "true", class: ie(t.nsSelect.e("input-calculator")), textContent: Ie(t.states.inputValue) }, null, 10, ["textContent"])) : he("v-if", !0) ], 2)), t.shouldShowPlaceholder ? (N(), Z("div", { key: 2, class: ie([ t.nsSelect.e("selected-item"), t.nsSelect.e("placeholder"), t.nsSelect.is("transparent", !t.hasModelValue || t.expanded && !t.states.inputValue) ]) }, [ t.hasModelValue ? Le(t.$slots, "label", { key: 0, label: t.currentPlaceholder, value: t.modelValue }, () => [ X("span", null, Ie(t.currentPlaceholder), 1) ]) : (N(), Z("span", { key: 1 }, Ie(t.currentPlaceholder), 1)) ], 2)) : he("v-if", !0) ], 2), X("div", { ref: "suffixRef", class: ie(t.nsSelect.e("suffix")) }, [ t.iconComponent && !t.showClose ? (N(), ye(u, { key: 0, class: ie([t.nsSelect.e("caret"), t.nsSelect.e("icon"), t.iconReverse]) }, { default: U(() => [ (N(), ye(er(t.iconComponent))) ]), _: 1 }, 8, ["class"])) : he("v-if", !0), t.showClose && t.clearIcon ? (N(), ye(u, { key: 1, class: ie([ t.nsSelect.e("caret"), t.nsSelect.e("icon"), t.nsSelect.e("clear") ]), onClick: t.handleClearClick }, { default: U(() => [ (N(), ye(er(t.clearIcon))) ]), _: 1 }, 8, ["class", "onClick"])) : he("v-if", !0), t.validateState && t.validateIcon ? (N(), ye(u, { key: 2, class: ie([t.nsInput.e("icon"), t.nsInput.e("validateIcon")]) }, { default: U(() => [ (N(), ye(er(t.validateIcon))) ]), _: 1 }, 8, ["class"])) : he("v-if", !0) ], 2) ], 10, ["onClick"]) ]; }), content: U(() => [ J(v, { ref: "menuRef" }, { default: U(() => [ t.$slots.header ? (N(), Z("div", { key: 0, class: ie(t.nsSelect.be("dropdown", "header")), onClick: ht(() => { }, ["stop"]) }, [ Le(t.$slots, "header") ], 10, ["onClick"])) : he("v-if", !0), Ze(J(d, { id: t.contentId, ref: "scrollbarRef", tag: "ul", "wrap-class": t.nsSelect.be("dropdown", "wrap"), "view-class": t.nsSelect.be("dropdown", "list"), class: ie([t.nsSelect.is("empty", t.filteredOptionsCount === 0)]), role: "listbox", "aria-label": t.ariaLabel, "aria-orientation": "vertical" }, { default: U(() => [ t.showNewOption ? (N(), ye(l, { key: 0, value: t.states.inputValue, created: !0 }, null, 8, ["value"])) : he("v-if", !0), J(c, null, { default: U(() => [ Le(t.$slots, "default") ]), _: 3 }) ]), _: 3 }, 8, ["id", "wrap-class", "view-class", "class", "aria-label"]), [ [mt, t.states.options.size > 0 && !t.loading] ]), t.$slots.loading && t.loading ? (N(), Z("div", { key: 1, class: ie(t.nsSelect.be("dropdown", "loading")) }, [ Le(t.$slots, "loading") ], 2)) : t.loading || t.filteredOptionsCount === 0 ? (N(), Z("div", { key: 2, class: ie(t.nsSelect.be("dropdown", "empty")) }, [ Le(t.$slots, "empty", {}, () => [ X("span", null, Ie(t.emptyText), 1) ]) ], 2)) : he("v-if", !0), t.$slots.footer ? (N(), Z("div", { key: 3, class: ie(t.nsSelect.be("dropdown", "footer")), onClick: ht(() => { }, ["stop"]) }, [ Le(t.$slots, "footer") ], 10, ["onClick"])) : he("v-if", !0) ]), _: 3 }, 512) ]), _: 3 }, 8, ["visible", "placement", "teleported", "popper-class", "popper-options", "fallback-placements", "effect", "transition", "persistent", "append-to", "onBeforeShow", "onHide"]) ], 16, ["onMouseleave"])), [ [h, t.handleClickOutside, t.popperRef] ]); } var iS = /* @__PURE__ */ Ve(nS, [["render", aS], ["__file", "select.vue"]]); const oS = de({ name: "ElOptionGroup", componentName: "ElOptionGroup", props: { label: String, disabled: Boolean }, setup(t) { const e = He("select"), r = ce(null), n = gt(), a = ce([]); Ct(Vh, Jr({ ...ho(t) })); const i = V(() => a.value.some((l) => l.visible === !0)), o = (l) => { var c, d; return ((c = l.type) == null ? void 0 : c.name) === "ElOption" && !!((d = l.component) != null && d.proxy); }, s = (l) => { const c = Fn(l), d = []; return c.forEach((v) => { var h, f; o(v) ? d.push(v.component.proxy) : (h = v.children) != null && h.length ? d.push(...s(v.children)) : (f = v.component) != null && f.subTree && d.push(...s(v.component.subTree)); }), d; }, u = () => { a.value = s(n.subTree); }; return Et(() => { u(); }), U0(r, u, { attributes: !0, subtree: !0, childList: !0 }), { groupRef: r, visible: i, ns: e }; } }); function sS(t, e, r, n, a, i) { return Ze((N(), Z("ul", { ref: "groupRef", class: ie(t.ns.be("group", "wrap")) }, [ X("li", { class: ie(t.ns.be("group", "title")) }, Ie(t.label), 3), X("li", null, [ X("ul", { class: ie(t.ns.b("group")) }, [ Le(t.$slots, "default") ], 2) ]) ], 2)), [ [mt, t.visible] ]); } var Hh = /* @__PURE__ */ Ve(oS, [["render", sS], ["__file", "option-group.vue"]]); const lS = $t(iS, { Option: tc, OptionGroup: Hh }), uS = xn(tc); xn(Hh); const cS = rt({ trigger: Ji.trigger, placement: Il.placement, disabled: Ji.disabled, visible: cr.visible, transition: cr.transition, popperOptions: Il.popperOptions, tabindex: Il.tabindex, content: cr.content, popperStyle: cr.popperStyle, popperClass: cr.popperClass, enterable: { ...cr.enterable, default: !0 }, effect: { ...cr.effect, default: "light" }, teleported: cr.teleported, title: String, width: { type: [String, Number], default: 150 }, offset: { type: Number, default: void 0 }, showAfter: { type: Number, default: 0 }, hideAfter: { type: Number, default: 200 }, autoClose: { type: Number, default: 0 }, showArrow: { type: Boolean, default: !0 }, persistent: { type: Boolean, default: !0 }, "onUpdate:visible": { type: Function } }), dS = { "update:visible": (t) => Qa(t), "before-enter": () => !0, "before-leave": () => !0, "after-enter": () => !0, "after-leave": () => !0 }, fS = "onUpdate:visible", vS = de({ name: "ElPopover" }), hS = /* @__PURE__ */ de({ ...vS, props: cS, emits: dS, setup(t, { expose: e, emit: r }) { const n = t, a = V(() => n[fS]), i = He("popover"), o = ce(), s = V(() => { var m; return (m = P(o)) == null ? void 0 : m.popperRef; }), u = V(() => [ { width: Ja(n.width) }, n.popperStyle ]), l = V(() => [i.b(), n.popperClass, { [i.m("plain")]: !!n.content }]), c = V(() => n.transition === `${i.namespace.value}-fade-in-linear`), d = () => { var m; (m = o.value) == null || m.hide(); }, v = () => { r("before-enter"); }, h = () => { r("before-leave"); }, f = () => { r("after-enter"); }, p = () => { r("update:visible", !1), r("after-leave"); }; return e({ popperRef: s, hide: d }), (m, g) => (N(), ye(P(ko), Rr({ ref_key: "tooltipRef", ref: o }, m.$attrs, { trigger: m.trigger, placement: m.placement, disabled: m.disabled, visible: m.visible, transition: m.transition, "popper-options": m.popperOptions, tabindex: m.tabindex, content: m.content, offset: m.offset, "show-after": m.showAfter, "hide-after": m.hideAfter, "auto-close": m.autoClose, "show-arrow": m.showArrow, "aria-label": m.title, effect: m.effect, enterable: m.enterable, "popper-class": P(l), "popper-style": P(u), teleported: m.teleported, persistent: m.persistent, "gpu-acceleration": P(c), "onUpdate:visible": P(a), onBeforeShow: v, onBeforeHide: h, onShow: f, onHide: p }), { content: U(() => [ m.title ? (N(), Z("div", { key: 0, class: ie(P(i).e("title")), role: "title" }, Ie(m.title), 3)) : he("v-if", !0), Le(m.$slots, "default", {}, () => [ ze(Ie(m.content), 1) ]) ]), default: U(() => [ m.$slots.reference ? Le(m.$slots, "reference", { key: 0 }) : he("v-if", !0) ]), _: 3 }, 16, ["trigger", "placement", "disabled", "visible", "transition", "popper-options", "tabindex", "content", "offset", "show-after", "hide-after", "auto-close", "show-arrow", "aria-label", "effect", "enterable", "popper-class", "popper-style", "teleported", "persistent", "gpu-acceleration", "onUpdate:visible"])); } }); var pS = /* @__PURE__ */ Ve(hS, [["__file", "popover.vue"]]); const Xd = (t, e) => { const r = e.arg || e.value, n = r == null ? void 0 : r.popperRef; n && (n.triggerRef = t); }; var gS = { mounted(t, e) { Xd(t, e); }, updated(t, e) { Xd(t, e); } }; const mS = "popover", yS = B2(gS, mS), rc = $t(pS, { directive: yS }), Ua = "$treeNodeId", jd = function(t, e) { !e || e[Ua] || Object.defineProperty(e, Ua, { value: t.id, enumerable: !1, configurable: !1, writable: !1 }); }, nc = function(t, e) { return t ? e[t] : e[Ua]; }, iu = (t, e, r) => { const n = t.value.currentNode; r(); const a = t.value.currentNode; n !== a && e("current-change", a ? a.data : null, a); }, ou = (t) => { let e = !0, r = !0, n = !0; for (let a = 0, i = t.length; a < i; a++) { const o = t[a]; (o.checked !== !0 || o.indeterminate) && (e = !1, o.disabled || (n = !1)), (o.checked !== !1 || o.indeterminate) && (r = !1); } return { all: e, none: r, allWithoutDisable: n, half: !e && !r }; }, Ai = function(t) { if (t.childNodes.length === 0 || t.loading) return; const { all: e, none: r, half: n } = ou(t.childNodes); e ? (t.checked = !0, t.indeterminate = !1) : n ? (t.checked = !1, t.indeterminate = !0) : r && (t.checked = !1, t.indeterminate = !1); const a = t.parent; !a || a.level === 0 || t.store.checkStrictly || Ai(a); }, Ko = function(t, e) { const r = t.store.props, n = t.data || {}, a = r[e]; if (typeof a == "function") return a(n, t); if (typeof a == "string") return n[a]; if (typeof a > "u") { const i = n[e]; return i === void 0 ? "" : i; } }; let bS = 0; class fa { constructor(e) { this.id = bS++, this.text = null, this.checked = !1, this.indeterminate = !1, this.data = null, this.expanded = !1, this.parent = null, this.visible = !0, this.isCurrent = !1, this.canFocus = !1; for (const r in e) va(e, r) && (this[r] = e[r]); this.level = 0, this.loaded = !1, this.childNodes = [], this.loading = !1, this.parent && (this.level = this.parent.level + 1); } initialize() { const e = this.store; if (!e) throw new Error("[Node]store is required!"); e.registerNode(this); const r = e.props; if (r && typeof r.isLeaf < "u") { const i = Ko(this, "isLeaf"); typeof i == "boolean" && (this.isLeafByUser = i); } if (e.lazy !== !0 && this.data ? (this.setData(this.data), e.defaultExpandAll && (this.expanded = !0, this.canFocus = !0)) : this.level > 0 && e.lazy && e.defaultExpandAll && !this.isLeafByUser && this.expand(), Array.isArray(this.data) || jd(this, this.data), !this.data) return; const n = e.defaultExpandedKeys, a = e.key; a && n && n.includes(this.key) && this.expand(null, e.autoExpandParent), a && e.currentNodeKey !== void 0 && this.key === e.currentNodeKey && (e.currentNode = this, e.currentNode.isCurrent = !0), e.lazy && e._initDefaultCheckedNode(this), this.updateLeafState(), this.parent && (this.level === 1 || this.parent.expanded === !0) && (this.canFocus = !0); } setData(e) { Array.isArray(e) || jd(this, e), this.data = e, this.childNodes = []; let r; this.level === 0 && Array.isArray(this.data) ? r = this.data : r = Ko(this, "children") || []; for (let n = 0, a = r.length; n < a; n++) this.insertChild({ data: r[n] }); } get label() { return Ko(this, "label"); } get key() { const e = this.store.key; return this.data ? this.data[e] : null; } get disabled() { return Ko(this, "disabled"); } get nextSibling() { const e = this.parent; if (e) { const r = e.childNodes.indexOf(this); if (r > -1) return e.childNodes[r + 1]; } return null; } get previousSibling() { const e = this.parent; if (e) { const r = e.childNodes.indexOf(this); if (r > -1) return r > 0 ? e.childNodes[r - 1] : null; } return null; } contains(e, r = !0) { return (this.childNodes || []).some((n) => n === e || r && n.contains(e)); } remove() { const e = this.parent; e && e.removeChild(this); } insertChild(e, r, n) { if (!e) throw new Error("InsertChild error: child is required."); if (!(e instanceof fa)) { if (!n) { const a = this.getChildren(!0); a.includes(e.data) || (typeof r > "u" || r < 0 ? a.push(e.data) : a.splice(r, 0, e.data)); } Object.assign(e, { parent: this, store: this.store }), e = Jr(new fa(e)), e instanceof fa && e.initialize(); } e.level = this.level + 1, typeof r > "u" || r < 0 ? this.childNodes.push(e) : this.childNodes.splice(r, 0, e), this.updateLeafState(); } insertBefore(e, r) { let n; r && (n = this.childNodes.indexOf(r)), this.insertChild(e, n); } insertAfter(e, r) { let n; r && (n = this.childNodes.indexOf(r), n !== -1 && (n += 1)), this.insertChild(e, n); } removeChild(e) { const r = this.getChildren() || [], n = r.indexOf(e.data); n > -1 && r.splice(n, 1); const a = this.childNodes.indexOf(e); a > -1 && (this.store && this.store.deregisterNode(e), e.parent = null, this.childNodes.splice(a, 1)), this.updateLeafState(); } removeChildByData(e) { let r = null; for (let n = 0; n < this.childNodes.length; n++) if (this.childNodes[n].data === e) { r = this.childNodes[n]; break; } r && this.removeChild(r); } expand(e, r) { const n = () => { if (r) { let a = this.parent; for (; a.level > 0; ) a.expanded = !0, a = a.parent; } this.expanded = !0, e && e(), this.childNodes.forEach((a) => { a.canFocus = !0; }); }; this.shouldLoadData() ? this.loadData((a) => { Array.isArray(a) && (this.checked ? this.setChecked(!0, !0) : this.store.checkStrictly || Ai(this), n()); }) : n(); } doCreateChildren(e, r = {}) { e.forEach((n) => { this.insertChild(Object.assign({ data: n }, r), void 0, !0); }); } collapse() { this.expanded = !1, this.childNodes.forEach((e) => { e.canFocus = !1; }); } shouldLoadData() { return this.store.lazy === !0 && this.store.load && !this.loaded; } updateLeafState() { if (this.store.lazy === !0 && this.loaded !== !0 && typeof this.isLeafByUser < "u") { this.isLeaf = this.isLeafByUser; return; } const e = this.childNodes; if (!this.store.lazy || this.store.lazy === !0 && this.loaded === !0) { this.isLeaf = !e || e.length === 0; return; } this.isLeaf = !1; } setChecked(e, r, n, a) { if (this.indeterminate = e === "half", this.checked = e === !0, this.store.checkStrictly) return; if (!(this.shouldLoadData() && !this.store.checkDescendants)) { const { all: o, allWithoutDisable: s } = ou(this.childNodes); !this.isLeaf && !o && s && (this.checked = !1, e = !1); const u = () => { if (r) { const l = this.childNodes; for (let v = 0, h = l.length; v < h; v++) { const f = l[v]; a = a || e !== !1; const p = f.disabled ? f.checked : a; f.setChecked(p, r, !0, a); } const { half: c, all: d } = ou(l); d || (this.checked = d, this.indeterminate = c); } }; if (this.shouldLoadData()) { this.loadData(() => { u(), Ai(this); }, { checked: e !== !1 }); return; } else u(); } const i = this.parent; !i || i.level === 0 || n || Ai(i); } getChildren(e = !1) { if (this.level === 0) return this.data; const r = this.data; if (!r) return null; const n = this.store.props; let a = "children"; return n && (a = n.children || "children"), r[a] === void 0 && (r[a] = null), e && !r[a] && (r[a] = []), r[a]; } updateChildren() { const e = this.getChildren() || [], r = this.childNodes.map((i) => i.data), n = {}, a = []; e.forEach((i, o) => { const s = i[Ua]; !!s && r.findIndex((l) => l[Ua] === s) >= 0 ? n[s] = { index: o, data: i } : a.push({ index: o, data: i }); }), this.store.lazy || r.forEach((i) => { n[i[Ua]] || this.removeChildByData(i); }), a.forEach(({ index: i, data: o }) => { this.insertChild({ data: o }, i); }), this.updateLeafState(); } loadData(e, r = {}) { if (this.store.lazy === !0 && this.store.load && !this.loaded && (!this.loading || Object.keys(r).length)) { this.loading = !0; const n = (i) => { this.childNodes = [], this.doCreateChildren(i, r), this.loaded = !0, this.loading = !1, this.updateLeafState(), e && e.call(this, i); }, a = () => { this.loading = !1; }; this.store.load(this, n, a); } else e && e.call(this); } eachNode(e) { const r = [this]; for (; r.length; ) { const n = r.shift(); r.unshift(...n.childNodes), e(n); } } reInitChecked() { this.store.checkStrictly || Ai(this); } } class wS { constructor(e) { this.currentNode = null, this.currentNodeKey = null; for (const r in e) va(e, r) && (this[r] = e[r]); this.nodesMap = {}; } initialize() { if (this.root = new fa({ data: this.data, store: this }), this.root.initialize(), this.lazy && this.load) { const e = this.load; e(this.root, (r) => { this.root.doCreateChildren(r), this._initDefaultCheckedNodes(); }); } else this._initDefaultCheckedNodes(); } filter(e) { const r = this.filterNodeMethod, n = this.lazy, a = function(i) { const o = i.root ? i.root.childNodes : i.childNodes; if (o.forEach((s) => { s.visible = r.call(s, e, s.data, s), a(s); }), !i.visible && o.length) { let s = !0; s = !o.some((u) => u.visible), i.root ? i.root.visible = s === !1 : i.visible = s === !1; } e && i.visible && !i.isLeaf && (!n || i.loaded) && i.expand(); }; a(this); } setData(e) { e !== this.root.data ? (this.nodesMap = {}, this.root.setData(e), this._initDefaultCheckedNodes()) : this.root.updateChildren(); } getNode(e) { if (e instanceof fa) return e; const r = Ht(e) ? nc(this.key, e) : e; return this.nodesMap[r] || null; } insertBefore(e, r) { const n = this.getNode(r); n.parent.insertBefore({ data: e }, n); } insertAfter(e, r) { const n = this.getNode(r); n.parent.insertAfter({ data: e }, n); } remove(e) { const r = this.getNode(e); r && r.parent && (r === this.currentNode && (this.currentNode = null), r.parent.removeChild(r)); } append(e, r) { const n = ks(r) ? this.root : this.getNode(r); n && n.insertChild({ data: e }); } _initDefaultCheckedNodes() { const e = this.defaultCheckedKeys || [], r = this.nodesMap; e.forEach((n) => { const a = r[n]; a && a.setChecked(!0, !this.checkStrictly); }); } _initDefaultCheckedNode(e) { (this.defaultCheckedKeys || []).includes(e.key) && e.setChecked(!0, !this.checkStrictly); } setDefaultCheckedKey(e) { e !== this.defaultCheckedKeys && (this.defaultCheckedKeys = e, this._initDefaultCheckedNodes()); } registerNode(e) { const r = this.key; !e || !e.data || (r ? e.key !== void 0 && (this.nodesMap[e.key] = e) : this.nodesMap[e.id] = e); } deregisterNode(e) { !this.key || !e || !e.data || (e.childNodes.forEach((n) => { this.deregisterNode(n); }), delete this.nodesMap[e.key]); } getCheckedNodes(e = !1, r = !1) { const n = [], a = function(i) { (i.root ? i.root.childNodes : i.childNodes).forEach((s) => { (s.checked || r && s.indeterminate) && (!e || e && s.isLeaf) && n.push(s.data), a(s); }); }; return a(this), n; } getCheckedKeys(e = !1) { return this.getCheckedNodes(e).map((r) => (r || {})[this.key]); } getHalfCheckedNodes() { const e = [], r = function(n) { (n.root ? n.root.childNodes : n.childNodes).forEach((i) => { i.indeterminate && e.push(i.data), r(i); }); }; return r(this), e; } getHalfCheckedKeys() { return this.getHalfCheckedNodes().map((e) => (e || {})[this.key]); } _getAllNodes() { const e = [], r = this.nodesMap; for (const n in r) va(r, n) && e.push(r[n]); return e; } updateChildren(e, r) { const n = this.nodesMap[e]; if (!n) return; const a = n.childNodes; for (let i = a.length - 1; i >= 0; i--) { const o = a[i]; this.remove(o.data); } for (let i = 0, o = r.length; i < o; i++) { const s = r[i]; this.append(s, n.data); } } _setCheckedKeys(e, r = !1, n) { const a = this._getAllNodes().sort((u, l) => u.level - l.level), i = /* @__PURE__ */ Object.create(null), o = Object.keys(n); a.forEach((u) => u.setChecked(!1, !1)); const s = (u) => { u.childNodes.forEach((l) => { var c; i[l.data[e]] = !0, (c = l.childNodes) != null && c.length && s(l); }); }; for (let u = 0, l = a.length; u < l; u++) { const c = a[u], d = c.data[e].toString(); if (!o.includes(d)) { c.checked && !i[d] && c.setChecked(!1, !1); continue; } if (c.childNodes.length && s(c), c.isLeaf || this.checkStrictly) { c.setChecked(!0, !1); continue; } if (c.setChecked(!0, !0), r) { c.setChecked(!1, !1); const h = function(f) { f.childNodes.forEach((m) => { m.isLeaf || m.setChecked(!1, !1), h(m); }); }; h(c); } } } setCheckedNodes(e, r = !1) { const n = this.key, a = {}; e.forEach((i) => { a[(i || {})[n]] = !0; }), this._setCheckedKeys(n, r, a); } setCheckedKeys(e, r = !1) { this.defaultCheckedKeys = e; const n = this.key, a = {}; e.forEach((i) => { a[i] = !0; }), this._setCheckedKeys(n, r, a); } setDefaultExpandedKeys(e) { e = e || [], this.defaultExpandedKeys = e, e.forEach((r) => { const n = this.getNode(r); n && n.expand(null, this.autoExpandParent); }); } setChecked(e, r, n) { const a = this.getNode(e); a && a.setChecked(!!r, n); } getCurrentNode() { return this.currentNode; } setCurrentNode(e) { const r = this.currentNode; r && (r.isCurrent = !1), this.currentNode = e, this.currentNode.isCurrent = !0; } setUserCurrentNode(e, r = !0) { const n = e[this.key], a = this.nodesMap[n]; this.setCurrentNode(a), r && this.currentNode.level > 1 && this.currentNode.parent.expand(null, !0); } setCurrentNodeKey(e, r = !0) { if (e == null) { this.currentNode && (this.currentNode.isCurrent = !1), this.currentNode = null; return; } const n = this.getNode(e); n && (this.setCurrentNode(n), r && this.currentNode.level > 1 && this.currentNode.parent.expand(null, !0)); } } const xS = de({ name: "ElTreeNodeContent", props: { node: { type: Object, required: !0 }, renderContent: Function }, setup(t) { const e = He("tree"), r = Ue("NodeInstance"), n = Ue("RootTree"); return () => { const a = t.node, { data: i, store: o } = a; return t.renderContent ? t.renderContent(ia, { _self: r, node: a, data: i, store: o }) : Le(n.ctx.slots, "default", { node: a, data: i }, () => [ ia("span", { class: e.be("node", "label") }, [a.label]) ]); }; } }); var CS = /* @__PURE__ */ Ve(xS, [["__file", "tree-node-content.vue"]]); function qh(t) { const e = Ue("TreeNodeMap", null), r = { treeNodeExpand: (n) => { t.node !== n && t.node.collapse(); }, children: [] }; return e && e.children.push(r), Ct("TreeNodeMap", r), { broadcastExpanded: (n) => { if (t.accordion) for (const a of r.children) a.treeNodeExpand(n); } }; } const Kh = Symbol("dragEvents"); function ES({ props: t, ctx: e, el$: r, dropIndicator$: n, store: a }) { const i = He("tree"), o = ce({ showDropIndicator: !1, draggingNode: null, dropNode: null, allowDrop: !0, dropType: null }); return Ct(Kh, { treeNodeDragStart: ({ event: c, treeNode: d }) => { if (typeof t.allowDrag == "function" && !t.allowDrag(d.node)) return c.preventDefault(), !1; c.dataTransfer.effectAllowed = "move"; try { c.dataTransfer.setData("text/plain", ""); } catch { } o.value.draggingNode = d, e.emit("node-drag-start", d.node, c); }, treeNodeDragOver: ({ event: c, treeNode: d }) => { const v = d, h = o.value.dropNode; h && h.node.id !== v.node.id && ca(h.$el, i.is("drop-inner")); const f = o.value.draggingNode; if (!f || !v) return; let p = !0, m = !0, g = !0, y = !0; typeof t.allowDrop == "function" && (p = t.allowDrop(f.node, v.node, "prev"), y = m = t.allowDrop(f.node, v.node, "inner"), g = t.allowDrop(f.node, v.node, "next")), c.dataTransfer.dropEffect = m || p || g ? "move" : "none", (p || m || g) && (h == null ? void 0 : h.node.id) !== v.node.id && (h && e.emit("node-drag-leave", f.node, h.node, c), e.emit("node-drag-enter", f.node, v.node, c)), p || m || g ? o.value.dropNode = v : o.value.dropNode = null, v.node.nextSibling === f.node && (g = !1), v.node.previousSibling === f.node && (p = !1), v.node.contains(f.node, !1) && (m = !1), (f.node === v.node || f.node.contains(v.node)) && (p = !1, m = !1, g = !1); const b = v.$el.querySelector(`.${i.be("node", "content")}`).getBoundingClientRect(), w = r.value.getBoundingClientRect(); let C; const E = p ? m ? 0.25 : g ? 0.45 : 1 : -1, x = g ? m ? 0.75 : p ? 0.55 : 0 : 1; let T = -9999; const k = c.clientY - b.top; k < b.height * E ? C = "before" : k > b.height * x ? C = "after" : m ? C = "inner" : C = "none"; const _ = v.$el.querySelector(`.${i.be("node", "expand-icon")}`).getBoundingClientRect(), D = n.value; C === "before" ? T = _.top - w.top : C === "after" && (T = _.bottom - w.top), D.style.top = `${T}px`, D.style.left = `${_.right - w.left}px`, C === "inner" ? Ql(v.$el, i.is("drop-inner")) : ca(v.$el, i.is("drop-inner")), o.value.showDropIndicator = C === "before" || C === "after", o.value.allowDrop = o.value.showDropIndicator || y, o.value.dropType = C, e.emit("node-drag-over", f.node, v.node, c); }, treeNodeDragEnd: (c) => { const { draggingNode: d, dropType: v, dropNode: h } = o.value; if (c.preventDefault(), c.dataTransfer && (c.dataTransfer.dropEffect = "move"), d && h) { const f = { data: d.node.data }; v !== "none" && d.node.remove(), v === "before" ? h.node.parent.insertBefore(f, h.node) : v === "after" ? h.node.parent.insertAfter(f, h.node) : v === "inner" && h.node.insertChild(f), v !== "none" && (a.value.registerNode(f), a.value.key && d.node.eachNode((p) => { var m; (m = a.value.nodesMap[p.data[a.value.key]]) == null || m.setChecked(p.checked, !a.value.checkStrictly); })), ca(h.$el, i.is("drop-inner")), e.emit("node-drag-end", d.node, h.node, v, c), v !== "none" && e.emit("node-drop", d.node, h.node, v, c); } d && !h && e.emit("node-drag-end", d.node, null, v, c), o.value.showDropIndicator = !1, o.value.draggingNode = null, o.value.dropNode = null, o.value.allowDrop = !0; } }), { dragState: o }; } const kS = de({ name: "ElTreeNode", components: { ElCollapseTransition: rk, ElCheckbox: NE, NodeContent: CS, ElIcon: Vt, Loading: Mu }, props: { node: { type: fa, default: () => ({}) }, props: { type: Object, default: () => ({}) }, accordion: Boolean, renderContent: Function, renderAfterExpand: Boolean, showCheckbox: { type: Boolean, default: !1 } }, emits: ["node-expand"], setup(t, e) { const r = He("tree"), { broadcastExpanded: n } = qh(t), a = Ue("RootTree"), i = ce(!1), o = ce(!1), s = ce(null), u = ce(null), l = ce(null), c = Ue(Kh), d = gt(); Ct("NodeInstance", d), a || Dt("Tree", "Can not find node's tree."), t.node.expanded && (i.value = !0, o.value = !0); const v = a.props.props.children || "children"; Pe(() => { const k = t.node.data[v]; return k && [...k]; }, () => { t.node.updateChildren(); }), Pe(() => t.node.indeterminate, (k) => { p(t.node.checked, k); }), Pe(() => t.node.checked, (k) => { p(k, t.node.indeterminate); }), Pe(() => t.node.childNodes.length, () => t.node.reInitChecked()), Pe(() => t.node.expanded, (k) => { ot(() => i.value = k), k && (o.value = !0); }); const h = (k) => nc(a.props.nodeKey, k.data), f = (k) => { const _ = t.props.class; if (!_) return {}; let D; if (lr(_)) { const { data: O } = k; D = _(O, k); } else D = _; return tr(D) ? { [D]: !0 } : D; }, p = (k, _) => { (s.value !== k || u.value !== _) && a.ctx.emit("check-change", t.node.data, k, _), s.value = k, u.value = _; }, m = (k) => { iu(a.store, a.ctx.emit, () => a.store.value.setCurrentNode(t.node)), a.currentNode.value = t.node, a.props.expandOnClickNode && y(), a.props.checkOnClickNode && !t.node.disabled && b(null, { target: { checked: !t.node.checked } }), a.ctx.emit("node-click", t.node.data, t.node, d, k); }, g = (k) => { a.instance.vnode.props.onNodeContextmenu && (k.stopPropagation(), k.preventDefault()), a.ctx.emit("node-contextmenu", k, t.node.data, t.node, d); }, y = () => { t.node.isLeaf || (i.value ? (a.ctx.emit("node-collapse", t.node.data, t.node, d), t.node.collapse()) : t.node.expand(() => { e.emit("node-expand", t.node.data, t.node, d); })); }, b = (k, _) => { t.node.setChecked(_.target.checked, !a.props.checkStrictly), ot(() => { const D = a.store.value; a.ctx.emit("check", t.node.data, { checkedNodes: D.getCheckedNodes(), checkedKeys: D.getCheckedKeys(), halfCheckedNodes: D.getHalfCheckedNodes(), halfCheckedKeys: D.getHalfCheckedKeys() }); }); }; return { ns: r, node$: l, tree: a, expanded: i, childNodeRendered: o, oldChecked: s, oldIndeterminate: u, getNodeKey: h, getNodeClass: f, handleSelectChange: p, handleClick: m, handleContextMenu: g, handleExpandIconClick: y, handleCheckChange: b, handleChildNodeExpand: (k, _, D) => { n(_), a.ctx.emit("node-expand", k, _, D); }, handleDragStart: (k) => { a.props.draggable && c.treeNodeDragStart({ event: k, treeNode: t }); }, handleDragOver: (k) => { k.preventDefault(), a.props.draggable && c.treeNodeDragOver({ event: k, treeNode: { $el: l.value, node: t.node } }); }, handleDrop: (k) => { k.preventDefault(); }, handleDragEnd: (k) => { a.props.draggable && c.treeNodeDragEnd(k); }, CaretRight: i2 }; } }); function SS(t, e, r, n, a, i) { const o = Qt("el-icon"), s = Qt("el-checkbox"), u = Qt("loading"), l = Qt("node-content"), c = Qt("el-tree-node"), d = Qt("el-collapse-transition"); return Ze((N(), Z("div", { ref: "node$", class: ie([ t.ns.b("node"), t.ns.is("expanded", t.expanded), t.ns.is("current", t.node.isCurrent), t.ns.is("hidden", !t.node.visible), t.ns.is("focusable", !t.node.disabled), t.ns.is("checked", !t.node.disabled && t.node.checked), t.getNodeClass(t.node) ]), role: "treeitem", tabindex: "-1", "aria-expanded": t.expanded, "aria-disabled": t.node.disabled, "aria-checked": t.node.checked, draggable: t.tree.props.draggable, "data-key": t.getNodeKey(t.node), onClick: ht(t.handleClick, ["stop"]), onContextmenu: t.handleContextMenu, onDragstart: ht(t.handleDragStart, ["stop"]), onDragover: ht(t.handleDragOver, ["stop"]), onDragend: ht(t.handleDragEnd, ["stop"]), onDrop: ht(t.handleDrop, ["stop"]) }, [ X("div", { class: ie(t.ns.be("node", "content")), style: lt({ paddingLeft: (t.node.level - 1) * t.tree.props.indent + "px" }) }, [ t.tree.props.icon || t.CaretRight ? (N(), ye(o, { key: 0, class: ie([ t.ns.be("node", "expand-icon"), t.ns.is("leaf", t.node.isLeaf), { expanded: !t.node.isLeaf && t.expanded } ]), onClick: ht(t.handleExpandIconClick, ["stop"]) }, { default: U(() => [ (N(), ye(er(t.tree.props.icon || t.CaretRight))) ]), _: 1 }, 8, ["class", "onClick"])) : he("v-if", !0), t.showCheckbox ? (N(), ye(s, { key: 1, "model-value": t.node.checked, indeterminate: t.node.indeterminate, disabled: !!t.node.disabled, onClick: ht(() => { }, ["stop"]), onChange: t.handleCheckChange }, null, 8, ["model-value", "indeterminate", "disabled", "onClick", "onChange"])) : he("v-if", !0), t.node.loading ? (N(), ye(o, { key: 2, class: ie([t.ns.be("node", "loading-icon"), t.ns.is("loading")]) }, { default: U(() => [ J(u) ]), _: 1 }, 8, ["class"])) : he("v-if", !0), J(l, { node: t.node, "render-content": t.renderContent }, null, 8, ["node", "render-content"]) ], 6), J(d, null, { default: U(() => [ !t.renderAfterExpand || t.childNodeRendered ? Ze((N(), Z("div", { key: 0, class: ie(t.ns.be("node", "children")), role: "group", "aria-expanded": t.expanded }, [ (N(!0), Z(Qe, null, Jt(t.node.childNodes, (v) => (N(), ye(c, { key: t.getNodeKey(v), "render-content": t.renderContent, "render-after-expand": t.renderAfterExpand, "show-checkbox": t.showCheckbox, node: v, accordion: t.accordion, props: t.props, onNodeExpand: t.handleChildNodeExpand }, null, 8, ["render-content", "render-after-expand", "show-checkbox", "node", "accordion", "props", "onNodeExpand"]))), 128)) ], 10, ["aria-expanded"])), [ [mt, t.expanded] ]) : he("v-if", !0) ]), _: 1 }) ], 42, ["aria-expanded", "aria-disabled", "aria-checked", "draggable", "data-key", "onClick", "onContextmenu", "onDragstart", "onDragover", "onDragend", "onDrop"])), [ [mt, t.node.visible] ]); } var TS = /* @__PURE__ */ Ve(kS, [["render", SS], ["__file", "tree-node.vue"]]); function _S({ el$: t }, e) { const r = He("tree"), n = jr([]), a = jr([]); Et(() => { o(); }), mv(() => { n.value = Array.from(t.value.querySelectorAll("[role=treeitem]")), a.value = Array.from(t.value.querySelectorAll("input[type=checkbox]")); }), Pe(a, (s) => { s.forEach((u) => { u.setAttribute("tabindex", "-1"); }); }), kr(t, "keydown", (s) => { const u = s.target; if (!u.className.includes(r.b("node"))) return; const l = s.code; n.value = Array.from(t.value.querySelectorAll(`.${r.is("focusable")}[role=treeitem]`)); const c = n.value.indexOf(u); let d; if ([Lt.up, Lt.down].includes(l)) { if (s.preventDefault(), l === Lt.up) { d = c === -1 ? 0 : c !== 0 ? c - 1 : n.value.length - 1; const h = d; for (; !e.value.getNode(n.value[d].dataset.key).canFocus; ) { if (d--, d === h) { d = -1; break; } d < 0 && (d = n.value.length - 1); } } else { d = c === -1 ? 0 : c < n.value.length - 1 ? c + 1 : 0; const h = d; for (; !e.value.getNode(n.value[d].dataset.key).canFocus; ) { if (d++, d === h) { d = -1; break; } d >= n.value.length && (d = 0); } } d !== -1 && n.value[d].focus(); } [Lt.left, Lt.right].includes(l) && (s.preventDefault(), u.click()); const v = u.querySelector('[type="checkbox"]'); [Lt.enter, Lt.space].includes(l) && v && (s.preventDefault(), v.click()); }); const o = () => { var s; n.value = Array.from(t.value.querySelectorAll(`.${r.is("focusable")}[role=treeitem]`)), a.value = Array.from(t.value.querySelectorAll("input[type=checkbox]")); const u = t.value.querySelectorAll(`.${r.is("checked")}[role=treeitem]`); if (u.length) { u[0].setAttribute("tabindex", "0"); return; } (s = n.value[0]) == null || s.setAttribute("tabindex", "0"); }; } const DS = de({ name: "ElTree", components: { ElTreeNode: TS }, props: { data: { type: Array, default: () => [] }, emptyText: { type: String }, renderAfterExpand: { type: Boolean, default: !0 }, nodeKey: String, checkStrictly: Boolean, defaultExpandAll: Boolean, expandOnClickNode: { type: Boolean, default: !0 }, checkOnClickNode: Boolean, checkDescendants: { type: Boolean, default: !1 }, autoExpandParent: { type: Boolean, default: !0 }, defaultCheckedKeys: Array, defaultExpandedKeys: Array, currentNodeKey: [String, Number], renderContent: Function, showCheckbox: { type: Boolean, default: !1 }, draggable: { type: Boolean, default: !1 }, allowDrag: Function, allowDrop: Function, props: { type: Object, default: () => ({ children: "children", label: "label", disabled: "disabled" }) }, lazy: { type: Boolean, default: !1 }, highlightCurrent: Boolean, load: Function, filterNodeMethod: Function, accordion: Boolean, indent: { type: Number, default: 18 }, icon: { type: Hn } }, emits: [ "check-change", "current-change", "node-click", "node-contextmenu", "node-collapse", "node-expand", "check", "node-drag-start", "node-drag-end", "node-drop", "node-drag-leave", "node-drag-enter", "node-drag-over" ], setup(t, e) { const { t: r } = yo(), n = He("tree"), a = Ue(To, null), i = ce(new wS({ key: t.nodeKey, data: t.data, lazy: t.lazy, props: t.props, load: t.load, currentNodeKey: t.currentNodeKey, checkStrictly: t.checkStrictly, checkDescendants: t.checkDescendants, defaultCheckedKeys: t.defaultCheckedKeys, defaultExpandedKeys: t.defaultExpandedKeys, autoExpandParent: t.autoExpandParent, defaultExpandAll: t.defaultExpandAll, filterNodeMethod: t.filterNodeMethod })); i.value.initialize(); const o = ce(i.value.root), s = ce(null), u = ce(null), l = ce(null), { broadcastExpanded: c } = qh(t), { dragState: d } = ES({ props: t, ctx: e, el$: u, dropIndicator$: l, store: i }); _S({ el$: u }, i); const v = V(() => { const { childNodes: A } = o.value, R = a ? a.hasFilteredOptions !== 0 : !1; return (!A || A.length === 0 || A.every(({ visible: K }) => !K)) && !R; }); Pe(() => t.currentNodeKey, (A) => { i.value.setCurrentNodeKey(A); }), Pe(() => t.defaultCheckedKeys, (A) => { i.value.setDefaultCheckedKey(A); }), Pe(() => t.defaultExpandedKeys, (A) => { i.value.setDefaultExpandedKeys(A); }), Pe(() => t.data, (A) => { i.value.setData(A); }, { deep: !0 }), Pe(() => t.checkStrictly, (A) => { i.value.checkStrictly = A; }); const h = (A) => { if (!t.filterNodeMethod) throw new Error("[Tree] filterNodeMethod is required when filter"); i.value.filter(A); }, f = (A) => nc(t.nodeKey, A.data), p = (A) => { if (!t.nodeKey) throw new Error("[Tree] nodeKey is required in getNodePath"); const R = i.value.getNode(A); if (!R) return []; const K = [R.data]; let H = R.parent; for (; H && H !== o.value; ) K.push(H.data), H = H.parent; return K.reverse(); }, m = (A, R) => i.value.getCheckedNodes(A, R), g = (A) => i.value.getCheckedKeys(A), y = () => { const A = i.value.getCurrentNode(); return A ? A.data : null; }, b = () => { if (!t.nodeKey) throw new Error("[Tree] nodeKey is required in getCurrentKey"); const A = y(); return A ? A[t.nodeKey] : null; }, w = (A, R) => { if (!t.nodeKey) throw new Error("[Tree] nodeKey is required in setCheckedNodes"); i.value.setCheckedNodes(A, R); }, C = (A, R) => { if (!t.nodeKey) throw new Error("[Tree] nodeKey is required in setCheckedKeys"); i.value.setCheckedKeys(A, R); }, E = (A, R, K) => { i.value.setChecked(A, R, K); }, x = () => i.value.getHalfCheckedNodes(), T = () => i.value.getHalfCheckedKeys(), k = (A, R = !0) => { if (!t.nodeKey) throw new Error("[Tree] nodeKey is required in setCurrentNode"); iu(i, e.emit, () => { c(A), i.value.setUserCurrentNode(A, R); }); }, _ = (A, R = !0) => { if (!t.nodeKey) throw new Error("[Tree] nodeKey is required in setCurrentKey"); iu(i, e.emit, () => { c(), i.value.setCurrentNodeKey(A, R); }); }, D = (A) => i.value.getNode(A), O = (A) => { i.value.remove(A); }, F = (A, R) => { i.value.append(A, R); }, L = (A, R) => { i.value.insertBefore(A, R); }, B = (A, R) => { i.value.insertAfter(A, R); }, I = (A, R, K) => { c(R), e.emit("node-expand", A, R, K); }, M = (A, R) => { if (!t.nodeKey) throw new Error("[Tree] nodeKey is required in updateKeyChild"); i.value.updateChildren(A, R); }; return Ct("RootTree", { ctx: e, props: t, store: i, root: o, currentNode: s, instance: gt() }), Ct(Qi, void 0), { ns: n, store: i, root: o, currentNode: s, dragState: d, el$: u, dropIndicator$: l, isEmpty: v, filter: h, getNodeKey: f, getNodePath: p, getCheckedNodes: m, getCheckedKeys: g, getCurrentNode: y, getCurrentKey: b, setCheckedNodes: w, setCheckedKeys: C, setChecked: E, getHalfCheckedNodes: x, getHalfCheckedKeys: T, setCurrentNode: k, setCurrentKey: _, t: r, getNode: D, remove: O, append: F, insertBefore: L, insertAfter: B, handleNodeExpand: I, updateKeyChildren: M }; } }); function PS(t, e, r, n, a, i) { const o = Qt("el-tree-node"); return N(), Z("div", { ref: "el$", class: ie([ t.ns.b(), t.ns.is("dragging", !!t.dragState.draggingNode), t.ns.is("drop-not-allow", !t.dragState.allowDrop), t.ns.is("drop-inner", t.dragState.dropType === "inner"), { [t.ns.m("highlight-current")]: t.highlightCurrent } ]), role: "tree" }, [ (N(!0), Z(Qe, null, Jt(t.root.childNodes, (s) => (N(), ye(o, { key: t.getNodeKey(s), node: s, props: t.props, accordion: t.accordion, "render-after-expand": t.renderAfterExpand, "show-checkbox": t.showCheckbox, "render-content": t.renderContent, onNodeExpand: t.handleNodeExpand }, null, 8, ["node", "props", "accordion", "render-after-expand", "show-checkbox", "render-content", "onNodeExpand"]))), 128)), t.isEmpty ? (N(), Z("div", { key: 0, class: ie(t.ns.e("empty-block")) }, [ Le(t.$slots, "empty", {}, () => { var s; return [ X("span", { class: ie(t.ns.e("empty-text")) }, Ie((s = t.emptyText) != null ? s : t.t("el.tree.emptyText")), 3) ]; }) ], 2)) : he("v-if", !0), Ze(X("div", { ref: "dropIndicator$", class: ie(t.ns.e("drop-indicator")) }, null, 2), [ [mt, t.dragState.showDropIndicator] ]) ], 2); } var OS = /* @__PURE__ */ Ve(DS, [["render", PS], ["__file", "tree.vue"]]); const LS = $t(OS); function IS(t) { let e; const r = ce(!1), n = Jr({ ...t, originalPosition: "", originalOverflow: "", visible: !1 }); function a(v) { n.text = v; } function i() { const v = n.parent, h = d.ns; if (!v.vLoadingAddClassList) { let f = v.getAttribute("loading-number"); f = Number.parseInt(f) - 1, f ? v.setAttribute("loading-number", f.toString()) : (ca(v, h.bm("parent", "relative")), v.removeAttribute("loading-number")), ca(v, h.bm("parent", "hidden")); } o(), c.unmount(); } function o() { var v, h; (h = (v = d.$el) == null ? void 0 : v.parentNode) == null || h.removeChild(d.$el); } function s() { var v; t.beforeClose && !t.beforeClose() || (r.value = !0, clearTimeout(e), e = setTimeout(u, 400), n.visible = !1, (v = t.closed) == null || v.call(t)); } function u() { if (!r.value) return; const v = n.parent; r.value = !1, v.vLoadingAddClassList = void 0, i(); } const l = de({ name: "ElLoading", setup(v, { expose: h }) { const { ns: f, zIndex: p } = px("loading"); return h({ ns: f, zIndex: p }), () => { const m = n.spinner || n.svg, g = ia("svg", { class: "circular", viewBox: n.svgViewBox ? n.svgViewBox : "0 0 50 50", ...m ? { innerHTML: m } : {} }, [ ia("circle", { class: "path", cx: "25", cy: "25", r: "20", fill: "none" }) ]), y = n.text ? ia("p", { class: f.b("text") }, [n.text]) : void 0; return ia(ui, { name: f.b("fade"), onAfterLeave: u }, { default: U(() => [ Ze(J("div", { style: { backgroundColor: n.background || "" }, class: [ f.b("mask"), n.customClass, n.fullscreen ? "is-fullscreen" : "" ] }, [ ia("div", { class: f.b("spinner") }, [g, y]) ]), [[mt, n.visible]]) ]) }); }; } }), c = F0(l), d = c.mount(document.createElement("div")); return { ...ho(n), setText: a, removeElLoadingChild: o, close: s, handleAfterLeave: u, vm: d, get $el() { return d.$el; } }; } let Uo; const FS = function(t = {}) { if (!_t) return; const e = AS(t); if (e.fullscreen && Uo) return Uo; const r = IS({ ...e, closed: () => { var a; (a = e.closed) == null || a.call(e), e.fullscreen && (Uo = void 0); } }); MS(e, e.parent, r), Qd(e, e.parent, r), e.parent.vLoadingAddClassList = () => Qd(e, e.parent, r); let n = e.parent.getAttribute("loading-number"); return n ? n = `${Number.parseInt(n) + 1}` : n = "1", e.parent.setAttribute("loading-number", n), e.parent.appendChild(r.$el), ot(() => r.visible.value = e.visible), e.fullscreen && (Uo = r), r; }, AS = (t) => { var e, r, n, a; let i; return tr(t.target) ? i = (e = document.querySelector(t.target)) != null ? e : document.body : i = t.target || document.body, { parent: i === document.body || t.body ? document.body : i, background: t.background || "", svg: t.svg || "", svgViewBox: t.svgViewBox || "", spinner: t.spinner || !1, text: t.text || "", fullscreen: i === document.body && ((r = t.fullscreen) != null ? r : !0), lock: (n = t.lock) != null ? n : !1, customClass: t.customClass || "", visible: (a = t.visible) != null ? a : !0, beforeClose: t.beforeClose, closed: t.closed, target: i }; }, MS = async (t, e, r) => { const { nextZIndex: n } = r.vm.zIndex || r.vm._.exposed.zIndex, a = {}; if (t.fullscreen) r.originalPosition.value = Ti(document.body, "position"), r.originalOverflow.value = Ti(document.body, "overflow"), a.zIndex = n(); else if (t.parent === document.body) { r.originalPosition.value = Ti(document.body, "position"), await ot(); for (const i of ["top", "left"]) { const o = i === "top" ? "scrollTop" : "scrollLeft"; a[i] = `${t.target.getBoundingClientRect()[i] + document.body[o] + document.documentElement[o] - Number.parseInt(Ti(document.body, `margin-${i}`), 10)}px`; } for (const i of ["height", "width"]) a[i] = `${t.target.getBoundingClientRect()[i]}px`; } else r.originalPosition.value = Ti(e, "position"); for (const [i, o] of Object.entries(a)) r.$el.style[i] = o; }, Qd = (t, e, r) => { const n = r.vm.ns || r.vm._.exposed.ns; ["absolute", "fixed", "sticky"].includes(r.originalPosition.value) ? ca(e, n.bm("parent", "relative")) : Ql(e, n.bm("parent", "relative")), t.fullscreen && t.lock ? Ql(e, n.bm("parent", "hidden")) : ca(e, n.bm("parent", "hidden")); }, ls = Symbol("ElLoading"), Jd = (t, e) => { var r, n, a, i; const o = e.instance, s = (v) => Ht(e.value) ? e.value[v] : void 0, u = (v) => { const h = tr(v) && (o == null ? void 0 : o[v]) || v; return h && ce(h); }, l = (v) => u(s(v) || t.getAttribute(`element-loading-${am(v)}`)), c = (r = s("fullscreen")) != null ? r : e.modifiers.fullscreen, d = { text: l("text"), svg: l("svg"), svgViewBox: l("svgViewBox"), spinner: l("spinner"), background: l("background"), customClass: l("customClass"), fullscreen: c, target: (n = s("target")) != null ? n : c ? void 0 : t, body: (a = s("body")) != null ? a : e.modifiers.body, lock: (i = s("lock")) != null ? i : e.modifiers.lock }; t[ls] = { options: d, instance: FS(d) }; }, BS = (t, e) => { for (const r of Object.keys(e)) Xa(e[r]) && (e[r].value = t[r]); }, ac = { mounted(t, e) { e.value && Jd(t, e); }, updated(t, e) { const r = t[ls]; e.oldValue !== e.value && (e.value && !e.oldValue ? Jd(t, e) : e.value && e.oldValue ? Ht(e.value) && BS(e.value, r.options) : r == null || r.instance.close()); }, unmounted(t) { var e; (e = t[ls]) == null || e.instance.close(), t[ls] = null; } }, Ur = (t, e) => { const r = t.__vccOpts || t; for (const [n, a] of e) r[n] = a; return r; }, NS = { name: "AnnotationPopup", props: { annotationEntry: { type: Object } }, inject: ["$annotator", "userApiKey"], data: function() { return { displayPair: { "Feature ID": "featureId", Tooltip: "label", Models: "models", Name: "name", Resource: "resourceId" }, editing: !1, evidencePrefixes: ["", "DOI:", "PMID:"], evidencePrefix: "", evidence: [], authenticated: !1, newEvidence: "", comment: "", prevSubs: [], showSubmissions: !0, errorMessage: "", creator: void 0 }; }, computed: { isEditable: function() { return this.annotationEntry.resourceId && this.annotationEntry.featureId; }, isPositionUpdated: function() { return this.annotationEntry.resourceId && this.annotationEntry.type === "updated" && this.annotationEntry.positionUpdated; }, isDeleted: function() { return this.annotationEntry.resourceId && this.annotationEntry.type === "deleted"; } }, methods: { evidenceEntered: function(t) { t && (this.evidence.push(this.evidencePrefix + t), this.newEvidence = ""); }, formatTime: function(t) { const e = { year: "numeric", month: "long", day: "numeric", hour: "numeric", minute: "numeric", second: "numeric" }; return new Date(t).toLocaleDateString(void 0, e); }, updatePrevSubmissions: function() { var t; this.$annotator && this.authenticated && this.annotationEntry.resourceId && this.annotationEntry.featureId && ((t = this.$annotator) == null || t.itemAnnotations( this.userApiKey, this.annotationEntry.resourceId, this.annotationEntry.featureId ).then((e) => { this.prevSubs = e; }).catch((e) => { console.log(e); })); }, submit: function() { var t; if (this.annotationEntry.type === "updated" && this.annotationEntry.positionUpdated ? this.comment = this.comment ? `Position Updated: ${this.comment}` : "Position Updated" : this.annotationEntry.type === "deleted" && (this.comment = this.comment ? `Feature Deleted: ${this.comment}` : "Feature Deleted"), (this.evidence.length > 0 || this.comment) && this.annotationEntry.resourceId && this.annotationEntry.featureId) { const e = []; this.evidence.forEach((n) => { if (n.includes("DOI:")) { const a = n.replace("DOI:", "https://doi.org/"); e.push(new URL(a)); } else if (n.includes("PMID:")) { const a = n.replace( "PMID:", "https://pubmed.ncbi.nlm.nih.gov/" ); e.push(new URL(a)); } else e.push(n); }); const r = { resource: this.annotationEntry.resourceId, item: Object.assign( { id: this.annotationEntry.featureId }, Object.fromEntries( Object.entries(this.annotationEntry).filter( ([n]) => ["label", "models"].includes(n) ) ) ), body: { evidence: e, comment: this.comment }, feature: this.annotationEntry.feature }; Object.assign(r.body, this.annotationEntry.body), this.annotationEntry.type === "deleted" && (r.feature = void 0), this.creator && (r.creator = this.creator), (t = this.$annotator) == null || t.addAnnotation(this.userApiKey, r).then(() => { this.$emit("annotation", r), this.errorMessage = "", this.resetSubmission(), this.updatePrevSubmissions(); }).catch(() => { this.errorMessage = "There is a problem with the submission, please try again later"; }); } }, removeEvidence: function(t) { this.evidence.splice(t, 1); }, resetSubmission: function() { this.editing = !1, this.evidence = [], this.newFeature = "", this.comment = ""; } }, watch: { annotationEntry: { handler: function(t, e) { t !== e && (this.resetSubmission(), this.updatePrevSubmissions()); }, immediate: !1, deep: !1 } }, mounted: function() { var t; (t = this.$annotator) == null || t.authenticate(this.userApiKey).then((e) => { e.name && e.email && e.canUpdate ? (this.creator = e, e.orcid || (this.creator.orcid = "0000-0000-0000-0000"), this.authenticated = !0, this.updatePrevSubmissions()) : this.errorMessage = ""; }); } }, _a = (t) => (po("data-v-9930ef40"), t = t(), go(), t), $S = { class: "block" }, RS = /* @__PURE__ */ _a(() => /* @__PURE__ */ X("div", { class: "title" }, "Feature Annotations", -1)), zS = /* @__PURE__ */ _a(() => /* @__PURE__ */ X("strong", { class: "sub-title" }, "Previous submissions:", -1)), VS = /* @__PURE__ */ _a(() => /* @__PURE__ */ X("strong", null, "Evidence: ", -1)), HS = ["href"], qS = /* @__PURE__ */ _a(() => /* @__PURE__ */ X("strong", null, "Comment: ", -1)), KS = /* @__PURE__ */ _a(() => /* @__PURE__ */ X("strong", { class: "sub-title" }, "Suggest changes:", -1)), US = /* @__PURE__ */ _a(() => /* @__PURE__ */ X("strong", null, "Evidence:", -1)), GS = /* @__PURE__ */ _a(() => /* @__PURE__ */ X("strong", null, "Comment:", -1)), WS = { class: "sub-title" }; function YS(t, e, r, n, a, i) { const o = Qs, s = qv, u = Vt, l = Gs, c = p2, d = v2, v = m2, h = So, f = Ss, p = uS, m = lS, g = Eo, y = Hr, b = ec; return N(), ye(b, { class: "main" }, { default: U(() => [ X("div", $S, [ J(o, { class: "info-field" }, { default: U(() => [ RS ]), _: 1 }), r.annotationEntry ? (N(), Z(Qe, { key: 0 }, [ (N(!0), Z(Qe, null, Jt(t.displayPair, (w, C) => Ze((N(), ye(o, { class: "dialog-text", key: w }, { default: U(() => [ X("strong", null, Ie(C) + ": ", 1), ze(" " + Ie(r.annotationEntry[w]), 1) ]), _: 2 }, 1024)), [ [mt, r.annotationEntry[w]] ])), 128)), t.prevSubs.length > 0 ? (N(), Z(Qe, { key: 0 }, [ Ze(X("div", { class: "hide", onClick: e[0] || (e[0] = (w) => t.showSubmissions = !1) }, [ ze(" Hide previous submissions "), J(u, null, { default: U(() => [ J(s) ]), _: 1 }) ], 512), [ [mt, t.showSubmissions] ]), Ze(X("div", { class: "hide", onClick: e[1] || (e[1] = (w) => t.showSubmissions = !0) }, [ ze(" Show previous " + Ie(t.prevSubs.length) + " submission(s) ", 1), J(u, null, { default: U(() => [ J(l) ]), _: 1 }) ], 512), [ [mt, !t.showSubmissions] ]), t.showSubmissions ? (N(), Z(Qe, { key: 0 }, [ J(o, { class: "dialog-spacer" }), J(o, { class: "dialog-text" }, { default: U(() => [ zS ]), _: 1 }), (N(!0), Z(Qe, null, Jt(t.prevSubs, (w, C) => (N(), Z("div", { class: "entry", key: C }, [ J(o, { class: "dialog-text" }, { default: U(() => [ X("strong", null, Ie(i.formatTime(w.created)), 1), ze(" " + Ie(w.creator.name), 1) ]), _: 2 }, 1024), J(o, { class: "dialog-text" }, { default: U(() => [ VS, (N(!0), Z(Qe, null, Jt(w.body.evidence, (E) => (N(), ye(o, { key: E, class: "dialog-text" }, { default: U(() => [ X("a", { href: E, target: "_blank" }, Ie(E), 9, HS) ]), _: 2 }, 1024))), 128)) ]), _: 2 }, 1024), J(o, { class: "dialog-text" }, { default: U(() => [ qS, ze(" " + Ie(w.body.comment), 1) ]), _: 2 }, 1024) ]))), 128)) ], 64)) : he("", !0) ], 64)) : he("", !0), t.authenticated ? (N(), Z(Qe, { key: 1 }, [ i.isEditable ? (N(), Z(Qe, { key: 0 }, [ J(o, { class: "dialog-spacer" }), t.editing ? (N(), Z(Qe, { key: 1 }, [ J(o, { class: "dialog-text" }, { default: U(() => [ KS ]), _: 1 }), i.isDeleted ? he("", !0) : (N(), Z(Qe, { key: 0 }, [ J(o, { class: "dialog-text" }, { default: U(() => [ US ]), _: 1 }), (N(!0), Z(Qe, null, Jt(t.evidence, (w, C) => (N(), ye(o, { key: w }, { default: U(() => [ J(h, { span: 20 }, { default: U(() => [ ze(Ie(t.evidence[C]), 1) ]), _: 2 }, 1024), J(h, { span: 4 }, { default: U(() => [ J(u, { class: "standard-icon" }, { default: U(() => [ J(f, { onClick: (E) => i.removeEvidence(C) }, null, 8, ["onClick"]) ]), _: 2 }, 1024) ]), _: 2 }, 1024) ]), _: 2 }, 1024))), 128)), J(o, null, { default: U(() => [ J(g, { size: "small", placeholder: "Enter", modelValue: t.newEvidence, "onUpdate:modelValue": e[4] || (e[4] = (w) => t.newEvidence = w), onChange: e[5] || (e[5] = (w) => i.evidenceEntered(w)) }, { prepend: U(() => [ J(m, { teleported: !1, modelValue: t.evidencePrefix, "onUpdate:modelValue": e[3] || (e[3] = (w) => t.evidencePrefix = w), placeholder: "No Prefix", class: "select-box", "popper-class": "flatmap_dropdown" }, { default: U(() => [ (N(!0), Z(Qe, null, Jt(t.evidencePrefixes, (w) => (N(), ye(p, { key: w, label: w, value: w }, { default: U(() => [ J(o, null, { default: U(() => [ J(h, { span: 12 }, { default: U(() => [ ze(Ie(w), 1) ]), _: 2 }, 1024) ]), _: 2 }, 1024) ]), _: 2 }, 1032, ["label", "value"]))), 128)) ]), _: 1 }, 8, ["modelValue"]) ]), _: 1 }, 8, ["modelValue"]) ]), _: 1 }) ], 64)), J(o, null, { default: U(() => [ GS ]), _: 1 }), J(o, { class: "dialog-text" }, { default: U(() => [ J(g, { type: "textarea", autosize: { minRows: 2, maxRows: 4 }, placeholder: "Enter", modelValue: t.comment, "onUpdate:modelValue": e[6] || (e[6] = (w) => t.comment = w) }, null, 8, ["modelValue"]) ]), _: 1 }), J(o, { class: "dialog-text" }, { default: U(() => [ J(y, { class: "button", type: "primary", plain: "", onClick: i.submit }, { default: U(() => [ ze(" Submit ") ]), _: 1 }, 8, ["onClick"]) ]), _: 1 }) ], 64)) : (N(), ye(o, { key: 0 }, { default: U(() => [ J(u, { class: "standard-icon" }, { default: U(() => [ J(c, { onClick: e[2] || (e[2] = (w) => t.editing = !0) }) ]), _: 1 }), i.isDeleted ? (N(), ye(u, { key: 0, class: "standard-icon" }, { default: U(() => [ J(d, { onClick: i.submit }, null, 8, ["onClick"]) ]), _: 1 })) : i.isPositionUpdated ? (N(), ye(u, { key: 1, class: "standard-icon" }, { default: U(() => [ J(v, { onClick: i.submit }, null, 8, ["onClick"]) ]), _: 1 })) : he("", !0) ]), _: 1 })), t.errorMessage ? (N(), ye(o, { key: 2, class: "dialog-text" }, { default: U(() => [ X("strong", WS, Ie(t.errorMessage), 1) ]), _: 1 })) : he("", !0) ], 64)) : he("", !0) ], 64)) : he("", !0) ], 64)) : he("", !0) ]) ]), _: 1 }); } const ZS = /* @__PURE__ */ Ur(NS, [["render", YS], ["__scopeId", "data-v-9930ef40"]]), XS = { name: "CreateTooltipContent", components: { Button: Hr, Col: So, Container: Rh, Header: zh, Input: Eo, Main: ec }, props: { createData: { type: Object } }, watch: { "createData.shape": { handler: function(t, e) { this.group = t, e !== void 0 && this.$emit("cancel-create"); }, immediate: !0 } }, computed: { confirmText: function() { return this.createData.editingIndex > -1 ? "Edit" : "Confirm"; } }, data: function() { return { group: "default", region: "", showPoint: !1 }; }, methods: { confirm: function() { this.$emit( "confirm-create", { region: "__annotation/" + this.region, group: this.group, shape: this.createData.shape, editingIndex: this.createData.editingIndex } ), this.group = this.createData.shape; }, cancel: function() { this.$emit("cancel-create"); } } }, jS = (t) => (po("data-v-d61c5879"), t = t(), go(), t), QS = /* @__PURE__ */ jS(() => /* @__PURE__ */ X("span", { class: "create-text" }, " Primitives will be created in the __annotation region ", -1)); function JS(t, e, r, n, a, i) { const o = zh, s = So, u = Qs, l = Eo, c = Hr, d = ec, v = Rh; return N(), ye(v, { class: "create-container" }, { default: U(() => [ J(o, { height: "30px", class: "header" }, { default: U(() => [ X("div", null, "Create " + Ie(r.createData.shape), 1) ]), _: 1 }), J(d, { class: "slides-block" }, { default: U(() => [ QS, Ze(J(u, { class: "row" }, { default: U(() => [ J(s, { offset: 0, span: 8 }, { default: U(() => [ ze(" Position: ") ]), _: 1 }), J(s, { offset: 0, span: 16 }, { default: U(() => [ (N(!0), Z(Qe, null, Jt(r.createData.points, ({ value: h, i: f }) => (N(), ye(u, { key: f, class: "value" }, { default: U(() => [ ze(Ie(f), 1) ]), _: 2 }, 1024))), 128)) ]), _: 1 }) ]), _: 1 }, 512), [ [mt, t.showPoint] ]), J(u, { class: "row" }, { default: U(() => [ J(s, { offset: 0, span: 8 }, { default: U(() => [ ze(" Region: ") ]), _: 1 }), J(s, { offset: 0, span: 16 }, { default: U(() => [ J(l, { modelValue: t.region, "onUpdate:modelValue": e[0] || (e[0] = (h) => t.region = h), placeholder: "__annotation", size: "small" }, null, 8, ["modelValue"]) ]), _: 1 }) ]), _: 1 }), J(u, { class: "row" }, { default: U(() => [ J(s, { offset: 0, span: 8 }, { default: U(() => [ ze(" Group: ") ]), _: 1 }), J(s, { offset: 0, span: 16 }, { default: U(() => [ J(l, { modelValue: t.group, "onUpdate:modelValue": e[1] || (e[1] = (h) => t.group = h), placeholder: r.createData.shape, size: "small" }, null, 8, ["modelValue", "placeholder"]) ]), _: 1 }) ]), _: 1 }), J(u, null, { default: U(() => [ J(s, { offset: 0, span: 12 }, { default: U(() => [ J(c, { type: "primary", plain: "", onClick: i.confirm }, { default: U(() => [ ze(Ie(i.confirmText), 1) ]), _: 1 }, 8, ["onClick"]) ]), _: 1 }), J(s, { offset: 0, span: 12 }, { default: U(() => [ J(c, { type: "primary", plain: "", onClick: i.cancel }, { default: U(() => [ ze(" Cancel ") ]), _: 1 }, 8, ["onClick"]) ]), _: 1 }) ]), _: 1 }) ]), _: 1 }) ]), _: 1 }); } const RI = /* @__PURE__ */ Ur(XS, [["render", JS], ["__scopeId", "data-v-d61c5879"]]); function Ft(t) { "@babel/helpers - typeof"; return Ft = 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; }, Ft(t); } function ic(t, e) { if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function"); } function eT(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, n.key, n); } } function oc(t, e, r) { return e && eT(t.prototype, e), Object.defineProperty(t, "prototype", { writable: !1 }), t; } function Uh(t, e, r) { return e in t ? Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = r, t; } function Mr(t, e) { return tT(t) || rT(t, e) || Gh(t, e) || nT(); } function tT(t) { if (Array.isArray(t)) return t; } function rT(t, e) { var r = t == null ? null : typeof Symbol < "u" && t[Symbol.iterator] || t["@@iterator"]; if (r != null) { var n = [], a = !0, i = !1, o, s; try { for (r = r.call(t); !(a = (o = r.next()).done) && (n.push(o.value), !(e && n.length === e)); a = !0) ; } catch (u) { i = !0, s = u; } finally { try { !a && r.return != null && r.return(); } finally { if (i) throw s; } } return n; } } function Gh(t, e) { if (t) { if (typeof t == "string") return ef(t, e); var r = Object.prototype.toString.call(t).slice(8, -1); if (r === "Object" && t.constructor && (r = t.constructor.name), r === "Map" || r === "Set") return Array.from(t); if (r === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)) return ef(t, e); } } function ef(t, e) { (e == null || e > t.length) && (e = t.length); for (var r = 0, n = new Array(e); r < e; r++) n[r] = t[r]; return n; } function nT() { throw new TypeError(`Invalid attempt to destructure non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`); } function Wh(t, e) { var r = typeof Symbol < "u" && t[Symbol.iterator] || t["@@iterator"]; if (!r) { if (Array.isArray(t) || (r = Gh(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(u) { throw u; }, f: a }; } throw new TypeError(`Invalid attempt to iterate non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`); } var i = !0, o = !1, s; return { s: function() { r = r.call(t); }, n: function() { var u = r.next(); return i = u.done, u; }, e: function(u) { o = !0, s = u; }, f: function() { try { !i && r.return != null && r.return(); } finally { if (o) throw s; } } }; } var Ot = typeof window > "u" ? null : window, tf = Ot ? Ot.navigator : null; Ot && Ot.document; var aT = Ft(""), Yh = Ft({}), iT = Ft(function() { }), oT = typeof HTMLElement > "u" ? "undefined" : Ft(HTMLElement), _o = function(e) { return e && e.instanceString && pt(e.instanceString) ? e.instanceString() : null; }, Fe = function(e) { return e != null && Ft(e) == aT; }, pt = function(e) { return e != null && Ft(e) === iT; }, st = function(e) { return !yr(e) && (Array.isArray ? Array.isArray(e) : e != null && e instanceof Array); }, Xe = function(e) { return e != null && Ft(e) === Yh && !st(e) && e.constructor === Object; }, sT = function(e) { return e != null && Ft(e) === Yh; }, be = function(e) { return e != null && Ft(e) === Ft(1) && !isNaN(e); }, lT = function(e) { return be(e) && Math.floor(e) === e; }, Ds = function(e) { if (oT !== "undefined") return e != null && e instanceof HTMLElement; }, yr = function(e) { return Do(e) || Zh(e); }, Do = function(e) { return _o(e) === "collection" && e._private.single; }, Zh = function(e) { return _o(e) === "collection" && !e._private.single; }, sc = function(e) { return _o(e) === "core"; }, Xh = function(e) { return _o(e) === "stylesheet"; }, uT = function(e) { return _o(e) === "event"; }, qn = function(e) { return e == null ? !0 : !!(e === "" || e.match(/^\s+$/)); }, cT = function(e) { return typeof HTMLElement > "u" ? !1 : e instanceof HTMLElement; }, dT = function(e) { return Xe(e) && be(e.x1) && be(e.x2) && be(e.y1) && be(e.y2); }, fT = function(e) { return sT(e) && pt(e.then); }, vT = function() { return tf && tf.userAgent.match(/msie|trident|edge/i); }, to = function(e, r) { r || (r = function() { if (arguments.length === 1) return arguments[0]; if (arguments.length === 0) return "undefined"; for (var i = [], o = 0; o < arguments.length; o++) i.push(arguments[o]); return i.join("$"); }); var n = function a() { var i = this, o = arguments, s, u = r.apply(i, o), l = a.cache; return (s = l[u]) || (s = l[u] = e.apply(i, o)), s; }; return n.cache = {}, n; }, lc = to(function(t) { return t.replace(/([A-Z])/g, function(e) { return "-" + e.toLowerCase(); }); }), Js = to(function(t) { return t.replace(/(-\w)/g, function(e) { return e[1].toUpperCase(); }); }), jh = to(function(t, e) { return t + e[0].toUpperCase() + e.substring(1); }, function(t, e) { return t + "$" + e; }), rf = function(e) { return qn(e) ? e : e.charAt(0).toUpperCase() + e.substring(1); }, It = "(?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))", hT = "rgb[a]?\\((" + It + "[%]?)\\s*,\\s*(" + It + "[%]?)\\s*,\\s*(" + It + "[%]?)(?:\\s*,\\s*(" + It + "))?\\)", pT = "rgb[a]?\\((?:" + It + "[%]?)\\s*,\\s*(?:" + It + "[%]?)\\s*,\\s*(?:" + It + "[%]?)(?:\\s*,\\s*(?:" + It + "))?\\)", gT = "hsl[a]?\\((" + It + ")\\s*,\\s*(" + It + "[%])\\s*,\\s*(" + It + "[%])(?:\\s*,\\s*(" + It + "))?\\)", mT = "hsl[a]?\\((?:" + It + ")\\s*,\\s*(?:" + It + "[%])\\s*,\\s*(?:" + It + "[%])(?:\\s*,\\s*(?:" + It + "))?\\)", yT = "\\#[0-9a-fA-F]{3}", bT = "\\#[0-9a-fA-F]{6}", Qh = function(e, r) { return e < r ? -1 : e > r ? 1 : 0; }, wT = function(e, r) { return -1 * Qh(e, r); }, Re = 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 o = a[i]; t[o] = n[o]; } } return t; }, xT = function(e) { if (!(!(e.length === 4 || e.length === 7) || e[0] !== "#")) { var r = e.length === 4, n, a, i, o = 16; return r ? (n = parseInt(e[1] + e[1], o), a = parseInt(e[2] + e[2], o), i = parseInt(e[3] + e[3], o)) : (n = parseInt(e[1] + e[2], o), a = parseInt(e[3] + e[4], o), i = parseInt(e[5] + e[6], o)), [n, a, i]; } }, CT = function(e) { var r, n, a, i, o, s, u, l; function c(f, p, m) { return m < 0 && (m += 1), m > 1 && (m -= 1), m < 1 / 6 ? f + (p - f) * 6 * m : m < 1 / 2 ? p : m < 2 / 3 ? f + (p - f) * (2 / 3 - m) * 6 : f; } var d = new RegExp("^" + gT + "$").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, o = d[4], o !== void 0 && (o = parseFloat(o), o < 0 || o > 1))) return; if (a === 0) s = u = l = Math.round(i * 255); else { var v = i < 0.5 ? i * (1 + a) : i + a - i * a, h = 2 * i - v; s = Math.round(255 * c(h, v, n + 1 / 3)), u = Math.round(255 * c(h, v, n)), l = Math.round(255 * c(h, v, n - 1 / 3)); } r = [s, u, l, o]; } return r; }, ET = function(e) { var r, n = new RegExp("^" + hT + "$").exec(e); if (n) { r = []; for (var a = [], i = 1; i <= 3; i++) { var o = n[i]; if (o[o.length - 1] === "%" && (a[i] = !0), o = parseFloat(o), a[i] && (o = o / 100 * 255), o < 0 || o > 255) return; r.push(Math.floor(o)); } var s = a[1] || a[2] || a[3], u = a[1] && a[2] && a[3]; if (s && !u) return; var l = n[4]; if (l !== void 0) { if (l = parseFloat(l), l < 0 || l > 1) return; r.push(l); } } return r; }, kT = function(e) { return TT[e.toLowerCase()]; }, ST = function(e) { return (st(e) ? e : null) || kT(e) || xT(e) || ET(e) || CT(e); }, TT = { // special colour names transparent: [0, 0, 0, 0], // NB alpha === 0 // regular colours 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] }, Jh = function(e) { for (var r = e.map, n = e.keys, a = n.length, i = 0; i < a; i++) { var o = n[i]; if (Xe(o)) throw Error("Tried to set map with object key"); i < n.length - 1 ? (r[o] == null && (r[o] = {}), r = r[o]) : r[o] = e.value; } }, ep = function(e) { for (var r = e.map, n = e.keys, a = n.length, i = 0; i < a; i++) { var o = n[i]; if (Xe(o)) throw Error("Tried to get map with object key"); if (r = r[o], r == null) return r; } return r; }; function _T(t) { var e = typeof t; return t != null && (e == "object" || e == "function"); } var ga = _T, Mi = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}; function DT(t, e) { return e = { exports: {} }, t(e, e.exports), e.exports; } var PT = typeof Mi == "object" && Mi && Mi.Object === Object && Mi, OT = PT, LT = typeof self == "object" && self && self.Object === Object && self, IT = OT || LT || Function("return this")(), el = IT, FT = function() { return el.Date.now(); }, Fl = FT, AT = /\s/; function MT(t) { for (var e = t.length; e-- && AT.test(t.charAt(e)); ) ; return e; } var BT = MT, NT = /^\s+/; function $T(t) { return t && t.slice(0, BT(t) + 1).replace(NT, ""); } var RT = $T, zT = el.Symbol, ii = zT, tp = Object.prototype, VT = tp.hasOwnProperty, HT = tp.toString, Pi = ii ? ii.toStringTag : void 0; function qT(t) { var e = VT.call(t, Pi), r = t[Pi]; try { t[Pi] = void 0; var n = !0; } catch { } var a = HT.call(t); return n && (e ? t[Pi] = r : delete t[Pi]), a; } var KT = qT, UT = Object.prototype, GT = UT.toString; function WT(t) { return GT.call(t); } var YT = WT, ZT = "[object Null]", XT = "[object Undefined]", nf = ii ? ii.toStringTag : void 0; function jT(t) { return t == null ? t === void 0 ? XT : ZT : nf && nf in Object(t) ? KT(t) : YT(t); } var rp = jT; function QT(t) { return t != null && typeof t == "object"; } var JT = QT, e5 = "[object Symbol]"; function t5(t) { return typeof t == "symbol" || JT(t) && rp(t) == e5; } var Po = t5, af = NaN, r5 = /^[-+]0x[0-9a-f]+$/i, n5 = /^0b[01]+$/i, a5 = /^0o[0-7]+$/i, i5 = parseInt; function o5(t) { if (typeof t == "number") return t; if (Po(t)) return af; if (ga(t)) { var e = typeof t.valueOf == "function" ? t.valueOf() : t; t = ga(e) ? e + "" : e; } if (typeof t != "string") return t === 0 ? t : +t; t = RT(t); var r = n5.test(t); return r || a5.test(t) ? i5(t.slice(2), r ? 2 : 8) : r5.test(t) ? af : +t; } var of = o5, s5 = "Expected a function", l5 = Math.max, u5 = Math.min; function c5(t, e, r) { var n, a, i, o, s, u, l = 0, c = !1, d = !1, v = !0; if (typeof t != "function") throw new TypeError(s5); e = of(e) || 0, ga(r) && (c = !!r.leading, d = "maxWait" in r, i = d ? l5(of(r.maxWait) || 0, e) : i, v = "trailing" in r ? !!r.trailing : v); function h(E) { var x = n, T = a; return n = a = void 0, l = E, o = t.apply(T, x), o; } function f(E) { return l = E, s = setTimeout(g, e), c ? h(E) : o; } function p(E) { var x = E - u, T = E - l, k = e - x; return d ? u5(k, i - T) : k; } function m(E) { var x = E - u, T = E - l; return u === void 0 || x >= e || x < 0 || d && T >= i; } function g() { var E = Fl(); if (m(E)) return y(E); s = setTimeout(g, p(E)); } function y(E) { return s = void 0, v && n ? h(E) : (n = a = void 0, o); } function b() { s !== void 0 && clearTimeout(s), l = 0, n = u = a = s = void 0; } function w() { return s === void 0 ? o : y(Fl()); } function C() { var E = Fl(), x = m(E); if (n = arguments, a = this, u = E, x) { if (s === void 0) return f(u); if (d) return clearTimeout(s), s = setTimeout(g, e), h(u); } return s === void 0 && (s = setTimeout(g, e)), o; } return C.cancel = b, C.flush = w, C; } var tl = c5, Al = Ot ? Ot.performance : null, np = Al && Al.now ? function() { return Al.now(); } : function() { return Date.now(); }, d5 = function() { if (Ot) { if (Ot.requestAnimationFrame) return function(t) { Ot.requestAnimationFrame(t); }; if (Ot.mozRequestAnimationFrame) return function(t) { Ot.mozRequestAnimationFrame(t); }; if (Ot.webkitRequestAnimationFrame) return function(t) { Ot.webkitRequestAnimationFrame(t); }; if (Ot.msRequestAnimationFrame) return function(t) { Ot.msRequestAnimationFrame(t); }; } return function(t) { t && setTimeout(function() { t(np()); }, 1e3 / 60); }; }(), Ps = function(e) { return d5(e); }, gn = np, Va = 9261, ap = 65599, Bi = 5381, ip = function(e) { for (var r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : Va, n = r, a; a = e.next(), !a.done; ) n = n * ap + a.value | 0; return n; }, ro = function(e) { var r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : Va; return r * ap + e | 0; }, no = function(e) { var r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : Bi; return (r << 5) + r + e | 0; }, f5 = function(e, r) { return e * 2097152 + r; }, Dn = function(e) { return e[0] * 2097152 + e[1]; }, Go = function(e, r) { return [ro(e[0], r[0]), no(e[1], r[1])]; }, v5 = function(e, r) { var n = { value: 0, done: !1 }, a = 0, i = e.length, o = { next: function() { return a < i ? n.value = e[a++] : n.done = !0, n; } }; return ip(o, r); }, ma = function(e, r) { var n = { value: 0, done: !1 }, a = 0, i = e.length, o = { next: function() { return a < i ? n.value = e.charCodeAt(a++) : n.done = !0, n; } }; return ip(o, r); }, op = function() { return h5(arguments); }, h5 = function(e) { for (var r, n = 0; n < e.length; n++) { var a = e[n]; n === 0 ? r = ma(a) : r = ma(a, r); } return r; }, sf = !0, p5 = console.warn != null, g5 = console.trace != null, uc = Number.MAX_SAFE_INTEGER || 9007199254740991, sp = function() { return !0; }, Os = function() { return !1; }, lf = function() { return 0; }, cc = function() { }, yt = function(e) { throw new Error(e); }, lp = function(e) { if (e !== void 0) sf = !!e; else return sf; }, tt = function(e) { lp() && (p5 ? console.warn(e) : (console.log(e), g5 && console.trace())); }, m5 = function(e) { return Re({}, e); }, Zr = function(e) { return e == null ? e : st(e) ? e.slice() : Xe(e) ? m5(e) : e; }, y5 = function(e) { return e.slice(); }, up = function(e, r) { for ( // loop :) r = e = ""; // b - result , a - numeric letiable e++ < 36; // r += e * 51 & 52 ? ( // return a random number or 4 (e ^ 15 ? ( // generate a random number from 0 to 15 8 ^ Math.random() * (e ^ 20 ? 16 : 4) ) : 4).toString(16) ) : "-" ) ; return r; }, b5 = {}, cp = function() { return b5; }, Wt = function(e) { var r = Object.keys(e); return function(n) { for (var a = {}, i = 0; i < r.length; i++) { var o = r[i], s = n == null ? void 0 : n[o]; a[o] = s === void 0 ? e[o] : s; } return a; }; }, Kn = function(e, r, n) { for (var a = e.length - 1; a >= 0; a--) e[a] === r && e.splice(a, 1); }, dc = function(e) { e.splice(0, e.length); }, w5 = function(e, r) { for (var n = 0; n < r.length; n++) { var a = r[n]; e.push(a); } }, Nr = function(e, r, n) { return n && (r = jh(n, r)), e[r]; }, An = function(e, r, n, a) { n && (r = jh(n, r)), e[r] = a; }, x5 = /* @__PURE__ */ function() { function t() { ic(this, t), this._obj = {}; } return oc(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]; } }]), t; }(), Xr = typeof Map < "u" ? Map : x5, C5 = "undefined", E5 = /* @__PURE__ */ function() { function t(e) { if (ic(this, t), this._obj = /* @__PURE__ */ 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 oc(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 = /* @__PURE__ */ 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); } }]), t; }(), vi = (typeof Set > "u" ? "undefined" : Ft(Set)) !== C5 ? Set : E5, rl = function(e, r) { var n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : !0; if (e === void 0 || r === void 0 || !sc(e)) { yt("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") { yt("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, // indicates this is an element data: r.data || {}, // data object position: r.position || { x: 0, y: 0 }, // (x, y) position pair autoWidth: void 0, // width and height of nodes calculated by the renderer when set to special 'auto' value autoHeight: void 0, autoPadding: void 0, compoundBoundsClean: !1, // whether the compound dimensions need to be recalculated the next time dimensions are read listeners: [], // array of bound listeners group: a, // string; 'nodes' or 'edges' style: {}, // properties as set by the style rstyle: {}, // properties for style sent from the renderer to the core styleCxts: [], // applied style contexts from the styler styleKeys: {}, // per-group keys of style property values removed: !0, // whether it's inside the vis; true if removed (set true here since we call restore) selected: !!r.selected, // whether it's selected selectable: r.selectable === void 0 ? !0 : !!r.selectable, // whether it's selectable locked: !!r.locked, // whether the element is locked (cannot be moved) grabbed: !1, // whether the element is grabbed by the mouse; renderer sets this privately grabbable: r.grabbable === void 0 ? !0 : !!r.grabbable, // whether the element can be grabbed pannable: r.pannable === void 0 ? a === "edges" : !!r.pannable, // whether the element has passthrough panning enabled active: !1, // whether the element is active from user interaction classes: new vi(), // map ( className => true ) animation: { // object for currently-running animations current: [], queue: [] }, rscratch: {}, // object in which the renderer can store information scratch: r.scratch || {}, // scratch objects edges: [], // array of connected edges children: [], // array of children parent: r.parent && r.parent.isNode() ? r.parent : null, // parent ref traversalCache: {}, // cache of output of traversal functions backgrounding: !1, // whether background images are loading bbCache: null, // cache of the current bounding box bbCacheShift: { x: 0, y: 0 }, // shift applied to cached bb to be applied on next get bodyBounds: null, // bounds cache of element body, w/o overlay overlayBounds: null, // bounds cache of element body, including overlay labelBounds: { // bounds cache of labels all: null, source: null, target: null, main: null }, arrowBounds: { // bounds cache of edge arrows 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 o = r.renderedPosition, s = e.pan(), u = e.zoom(); i.position = { x: (o.x - s.x) / u, y: (o.y - s.y) / u }; } var l = []; st(r.classes) ? l = r.classes : Fe(r.classes) && (l = r.classes.split(/\s+/)); for (var c = 0, d = l.length; c < d; c++) { var v = l[c]; !v || v === "" || i.classes.add(v); } this.createEmitter(); var h = r.style || r.css; h && (tt("Setting a `style` bypass at element creation should be done only when absolutely necessary. Try to use the stylesheet instead."), this.style(h)), (n === void 0 || n) && this.restore(); }, uf = function(e) { return e = { bfs: e.bfs || !e.dfs, dfs: e.dfs || !e.bfs }, function(n, a, i) { var o; Xe(n) && !yr(n) && (o = n, n = o.roots || o.root, a = o.visit, i = o.directed), i = arguments.length === 2 && !pt(a) ? a : i, a = pt(a) ? a : function() { }; for (var s = this._private.cy, u = n = Fe(n) ? this.filter(n) : n, l = [], c = [], d = {}, v = {}, h = {}, f = 0, p, m = this.byGroup(), g = m.nodes, y = m.edges, b = 0; b < u.length; b++) { var w = u[b], C = w.id(); w.isNode() && (l.unshift(w), e.bfs && (h[C] = !0, c.push(w)), v[C] = 0); } for (var E = function() { var F = e.bfs ? l.shift() : l.pop(), L = F.id(); if (e.dfs) { if (h[L]) return "continue"; h[L] = !0, c.push(F); } var B = v[L], I = d[L], M = I != null ? I.source() : null, A = I != null ? I.target() : null, R = I == null ? void 0 : F.same(M) ? A[0] : M[0], K = void 0; if (K = a(F, I, R, f++, B), K === !0) return p = F, "break"; if (K === !1) return "break"; for (var H = F.connectedEdges().filter(function(ne) { return (!i || ne.source().same(F)) && y.has(ne); }), q = 0; q < H.length; q++) { var ee = H[q], se = ee.connectedNodes().filter(function(ne) { return !ne.same(F) && g.has(ne); }), oe = se.id(); se.length !== 0 && !h[oe] && (se = se[0], l.push(se), e.bfs && (h[oe] = !0, c.push(se)), d[oe] = ee, v[oe] = v[L] + 1); } }; l.length !== 0; ) { var x = E(); if (x !== "continue" && x === "break") break; } for (var T = s.collection(), k = 0; k < c.length; k++) { var _ = c[k], D = d[_.id()]; D != null && T.push(D), T.push(_); } return { path: s.collection(T), found: s.collection(p) }; }; }, ao = { breadthFirstSearch: uf({ bfs: !0 }), depthFirstSearch: uf({ dfs: !0 }) }; ao.bfs = ao.breadthFirstSearch; ao.dfs = ao.depthFirstSearch; var k5 = DT(function(t, e) { (function() { var r, n, a, i, o, s, u, l, c, d, v, h, f, p, m; a = Math.floor, d = Math.min, n = function(g, y) { return g < y ? -1 : g > y ? 1 : 0; }, c = function(g, y, b, w, C) { var E; if (b == null && (b = 0), C == null && (C = n), b < 0) throw new Error("lo must be non-negative"); for (w == null && (w = g.length); b < w; ) E = a((b + w) / 2), C(y, g[E]) < 0 ? w = E : b = E + 1; return [].splice.apply(g, [b, b - b].concat(y)), y; }, s = function(g, y, b) { return b == null && (b = n), g.push(y), p(g, 0, g.length - 1, b); }, o = function(g, y) { var b, w; return y == null && (y = n), b = g.pop(), g.length ? (w = g[0], g[0] = b, m(g, 0, y)) : w = b, w; }, l = function(g, y, b) { var w; return b == null && (b = n), w = g[0], g[0] = y, m(g, 0, b), w; }, u = function(g, y, b) { var w; return b == null && (b = n), g.length && b(g[0], y) < 0 && (w = [g[0], y], y = w[0], g[0] = w[1], m(g, 0, b)), y; }, i = function(g, y) { var b, w, C, E, x, T; for (y == null && (y = n), E = (function() { T = []; for (var k = 0, _ = a(g.length / 2); 0 <= _ ? k < _ : k > _; 0 <= _ ? k++ : k--) T.push(k); return T; }).apply(this).reverse(), x = [], w = 0, C = E.length; w < C; w++) b = E[w], x.push(m(g, b, y)); return x; }, f = function(g, y, b) { var w; if (b == null && (b = n), w = g.indexOf(y), w !== -1) return p(g, 0, w, b), m(g, w, b); }, v = function(g, y, b) { var w, C, E, x, T; if (b == null && (b = n), C = g.slice(0, y), !C.length) return C; for (i(C, b), T = g.slice(y), E = 0, x = T.length; E < x; E++) w = T[E], u(C, w, b); return C.sort(b).reverse(); }, h = function(g, y, b) { var w, C, E, x, T, k, _, D, O; if (b == null && (b = n), y * 10 <= g.length) { if (E = g.slice(0, y).sort(b), !E.length) return E; for (C = E[E.length - 1], _ = g.slice(y), x = 0, k = _.length; x < k; x++) w = _[x], b(w, C) < 0 && (c(E, w, 0, null, b), E.pop(), C = E[E.length - 1]); return E; } for (i(g, b), O = [], T = 0, D = d(y, g.length); 0 <= D ? T < D : T > D; 0 <= D ? ++T : --T) O.push(o(g, b)); return O; }, p = function(g, y, b, w) { var C, E, x; for (w == null && (w = n), C = g[b]; b > y; ) { if (x = b - 1 >> 1, E = g[x], w(C, E) < 0) { g[b] = E, b = x; continue; } break; } return g[b] = C; }, m = function(g, y, b) { var w, C, E, x, T; for (b == null && (b = n), C = g.length, T = y, E = g[y], w = 2 * y + 1; w < C; ) x = w + 1, x < C && !(b(g[w], g[x]) < 0) && (w = x), g[y] = g[w], y = w, w = 2 * y + 1; return g[y] = E, p(g, T, y, b); }, r = function() { g.push = s, g.pop = o, g.replace = l, g.pushpop = u, g.heapify = i, g.updateItem = f, g.nlargest = v, g.nsmallest = h; function g(y) { this.cmp = y ?? n, this.nodes = []; } return g.prototype.push = function(y) { return s(this.nodes, y, this.cmp); }, g.prototype.pop = function() { return o(this.nodes, this.cmp); }, g.prototype.peek = function() { return this.nodes[0]; }, g.prototype.contains = function(y) { return this.nodes.indexOf(y) !== -1; }, g.prototype.replace = function(y) { return l(this.nodes, y, this.cmp); }, g.prototype.pushpop = function(y) { return u(this.nodes, y, this.cmp); }, g.prototype.heapify = function() { return i(this.nodes, this.cmp); }, g.prototype.updateItem = function(y) { return f(this.nodes, y, 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 y; return y = new g(), y.nodes = this.nodes.slice(0), y; }, 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, y) { return t.exports = y(); }(this, function() { return r; }); }).call(Mi); }), Oo = k5, S5 = Wt({ root: null, weight: function(e) { return 1; }, directed: !1 }), T5 = { dijkstra: function(e) { if (!Xe(e)) { var r = arguments; e = { root: r[0], weight: r[1], directed: r[2] }; } var n = S5(e), a = n.root, i = n.weight, o = n.directed, s = this, u = i, l = Fe(a) ? this.filter(a)[0] : a[0], c = {}, d = {}, v = {}, h = this.byGroup(), f = h.nodes, p = h.edges; p.unmergeBy(function(B) { return B.isLoop(); }); for (var m = function(I) { return c[I.id()]; }, g = function(I, M) { c[I.id()] = M, y.updateItem(I); }, y = new Oo(function(B, I) { return m(B) - m(I); }), b = 0; b < f.length; b++) { var w = f[b]; c[w.id()] = w.same(l) ? 0 : 1 / 0, y.push(w); } for (var C = function(I, M) { for (var A = (o ? I.edgesTo(M) : I.edgesWith(M)).intersect(p), R = 1 / 0, K, H = 0; H < A.length; H++) { var q = A[H], ee = u(q); (ee < R || !K) && (R = ee, K = q); } return { edge: K, dist: R }; }; y.size() > 0; ) { var E = y.pop(), x = m(E), T = E.id(); if (v[T] = x, x !== 1 / 0) for (var k = E.neighborhood().intersect(f), _ = 0; _ < k.length; _++) { var D = k[_], O = D.id(), F = C(E, D), L = x + F.dist; L < m(D) && (g(D, L), d[O] = { node: E, edge: F.edge }); } } return { distanceTo: function(I) { var M = Fe(I) ? f.filter(I)[0] : I[0]; return v[M.id()]; }, pathTo: function(I) { var M = Fe(I) ? f.filter(I)[0] : I[0], A = [], R = M, K = R.id(); if (M.length > 0) for (A.unshift(M); d[K]; ) { var H = d[K]; A.unshift(H.edge), A.unshift(H.node), R = H.node, K = R.id(); } return s.spawn(A); } }; } }, _5 = { // kruskal's algorithm (finds min spanning tree, assuming undirected graph) // implemented from pseudocode from wikipedia kruskal: function(e) { e = e || function(b) { return 1; }; for (var r = this.byGroup(), n = r.nodes, a = r.edges, i = n.length, o = new Array(i), s = n, u = function(w) { for (var C = 0; C < o.length; C++) { var E = o[C]; if (E.has(w)) return C; } }, l = 0; l < i; l++) o[l] = this.spawn(n[l]); for (var c = a.sort(function(b, w) { return e(b) - e(w); }), d = 0; d < c.length; d++) { var v = c[d], h = v.source()[0], f = v.target()[0], p = u(h), m = u(f), g = o[p], y = o[m]; p !== m && (s.merge(v), g.merge(y), o.splice(m, 1)); } return s; } }, D5 = Wt({ root: null, goal: null, weight: function(e) { return 1; }, heuristic: function(e) { return 0; }, directed: !1 }), P5 = { // Implemented from pseudocode from wikipedia aStar: function(e) { var r = this.cy(), n = D5(e), a = n.root, i = n.goal, o = n.heuristic, s = n.directed, u = n.weight; a = r.collection(a)[0], i = r.collection(i)[0]; var l = a.id(), c = i.id(), d = {}, v = {}, h = {}, f = new Oo(function(K, H) { return v[K.id()] - v[H.id()]; }), p = new vi(), m = {}, g = {}, y = function(H, q) { f.push(H), p.add(q); }, b, w, C = function() { b = f.pop(), w = b.id(), p.delete(w); }, E = function(H) { return p.has(H); }; y(a, l), d[l] = 0, v[l] = o(a); for (var x = 0; f.size() > 0; ) { if (C(), x++, w === c) { for (var T = [], k = i, _ = c, D = g[_]; T.unshift(k), D != null && T.unshift(D), k = m[_], k != null; ) _ = k.id(), D = g[_]; return { found: !0, distance: d[w], path: this.spawn(T), steps: x }; } h[w] = !0; for (var O = b._private.edges, F = 0; F < O.length; F++) { var L = O[F]; if (this.hasElementWithId(L.id()) && !(s && L.data("source") !== w)) { var B = L.source(), I = L.target(), M = B.id() !== w ? B : I, A = M.id(); if (this.hasElementWithId(A) && !h[A]) { var R = d[w] + u(L); if (!E(A)) { d[A] = R, v[A] = R + o(M), y(M, A), m[A] = b, g[A] = L; continue; } R < d[A] && (d[A] = R, v[A] = R + o(M), m[A] = b, g[A] = L); } } } } return { found: !1, distance: void 0, path: void 0, steps: x }; } }, O5 = Wt({ weight: function(e) { return 1; }, directed: !1 }), L5 = { // Implemented from pseudocode from wikipedia floydWarshall: function(e) { for (var r = this.cy(), n = O5(e), a = n.weight, i = n.directed, o = a, s = this.byGroup(), u = s.nodes, l = s.edges, c = u.length, d = c * c, v = function(ee) { return u.indexOf(ee); }, h = function(ee) { return u[ee]; }, f = new Array(d), p = 0; p < d; p++) { var m = p % c, g = (p - m) / c; g === m ? f[p] = 0 : f[p] = 1 / 0; } for (var y = new Array(d), b = new Array(d), w = 0; w < l.length; w++) { var C = l[w], E = C.source()[0], x = C.target()[0]; if (E !== x) { var T = v(E), k = v(x), _ = T * c + k, D = o(C); if (f[_] > D && (f[_] = D, y[_] = k, b[_] = C), !i) { var O = k * c + T; !i && f[O] > D && (f[O] = D, y[O] = T, b[O] = C); } } } for (var F = 0; F < c; F++) for (var L = 0; L < c; L++) for (var B = L * c + F, I = 0; I < c; I++) { var M = L * c + I, A = F * c + I; f[B] + f[A] < f[M] && (f[M] = f[B] + f[A], y[M] = y[B]); } var R = function(ee) { return (Fe(ee) ? r.filter(ee) : ee)[0]; }, K = function(ee) { return v(R(ee)); }, H = { distance: function(ee, se) { var oe = K(ee), ne = K(se); return f[oe * c + ne]; }, path: function(ee, se) { var oe = K(ee), ne = K(se), ue = h(oe); if (oe === ne) return ue.collection(); if (y[oe * c + ne] == null) return r.collection(); var te = r.collection(), $ = oe, G; for (te.merge(ue); oe !== ne; ) $ = oe, oe = y[oe * c + ne], G = b[$ * c + oe], te.merge(G), te.merge(h(oe)); return te; } }; return H; } // floydWarshall }, I5 = Wt({ weight: function(e) { return 1; }, directed: !1, root: null }), F5 = { // Implemented from pseudocode from wikipedia bellmanFord: function(e) { var r = this, n = I5(e), a = n.weight, i = n.directed, o = n.root, s = a, u = this, l = this.cy(), c = this.byGroup(), d = c.edges, v = c.nodes, h = v.length, f = new Xr(), p = !1, m = []; o = l.collection(o)[0], d.unmergeBy(function(ke) { return ke.isLoop(); }); for (var g = d.length, y = function(Ce) { var De = f.get(Ce.id()); return De || (De = {}, f.set(Ce.id(), De)), De; }, b = function(Ce) { return (Fe(Ce) ? l.$(Ce) : Ce)[0]; }, w = function(Ce) { return y(b(Ce)).dist; }, C = function(Ce) { for (var De = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : o, qe = b(Ce), Ke = [], Be = qe; ; ) { if (Be == null) return r.spawn(); var Ge = y(Be), le = Ge.edge, S = Ge.pred; if (Ke.unshift(Be[0]), Be.same(De) && Ke.length > 0) break; le != null && Ke.unshift(le), Be = S; } return u.spawn(Ke); }, E = 0; E < h; E++) { var x = v[E], T = y(x); x.same(o) ? T.dist = 0 : T.dist = 1 / 0, T.pred = null, T.edge = null; } for (var k = !1, _ = function(Ce, De, qe, Ke, Be, Ge) { var le = Ke.dist + Ge; le < Be.dist && !qe.same(Ke.edge) && (Be.dist = le, Be.pred = Ce, Be.edge = qe, k = !0); }, D = 1; D < h; D++) { k = !1; for (var O = 0; O < g; O++) { var F = d[O], L = F.source(), B = F.target(), I = s(F), M = y(L), A = y(B); _(L, B, F, M, A, I), i || _(B, L, F, A, M, I); } if (!k) break; } if (k) for (var R = [], K = 0; K < g; K++) { var H = d[K], q = H.source(), ee = H.target(), se = s(H), oe = y(q).dist, ne = y(ee).dist; if (oe + se < ne || !i && ne + se < oe) if (p || (tt("Graph contains a negative weight cycle for Bellman-Ford"), p = !0), e.findNegativeWeightCycles !== !1) { var ue = []; oe + se < ne && ue.push(q), !i && ne + se < oe && ue.push(ee); for (var te = ue.length, $ = 0; $ < te; $++) { var G = ue[$], Q = [G]; Q.push(y(G).edge); for (var ge = y(G).pred; Q.indexOf(ge) === -1; ) Q.push(ge), Q.push(y(ge).edge), ge = y(ge).pred; Q = Q.slice(Q.indexOf(ge)); for (var Ee = Q[0].id(), fe = 0, me = 2; me < Q.length; me += 2) Q[me].id() < Ee && (Ee = Q[me].id(), fe = me); Q = Q.slice(fe).concat(Q.slice(0, fe)), Q.push(Q[0]); var xe = Q.map(function(ke) { return ke.id(); }).join(","); R.indexOf(xe) === -1 && (m.push(u.spawn(Q)), R.push(xe)); } } else break; } return { distanceTo: w, pathTo: C, hasNegativeWeightCycle: p, negativeWeightCycles: m }; } // bellmanFord }, A5 = Math.sqrt(2), M5 = function(e, r, n) { n.length === 0 && yt("Karger-Stein must be run on a connected (sub)graph"); for (var a = n[e], i = a[1], o = a[2], s = r[i], u = r[o], l = n, c = l.length - 1; c >= 0; c--) { var d = l[c], v = d[1], h = d[2]; (r[v] === s && r[h] === u || r[v] === u && r[h] === s) && l.splice(c, 1); } for (var f = 0; f < l.length; f++) { var p = l[f]; p[1] === u ? (l[f] = p.slice(), l[f][1] = s) : p[2] === u && (l[f] = p.slice(), l[f][2] = s); } for (var m = 0; m < r.length; m++) r[m] === u && (r[m] = s); return l; }, Ml = function(e, r, n, a) { for (; n > a; ) { var i = Math.floor(Math.random() * r.length); r = M5(i, e, r), n--; } return r; }, B5 = { // Computes the minimum cut of an undirected graph // Returns the correct answer with high probability kargerStein: function() { var e = this, r = this.byGroup(), n = r.nodes, a = r.edges; a.unmergeBy(function(A) { return A.isLoop(); }); var i = n.length, o = a.length, s = Math.ceil(Math.pow(Math.log(i) / Math.LN2, 2)), u = Math.floor(i / A5); if (i < 2) { yt("At least 2 nodes are required for Karger-Stein algorithm"); return; } for (var l = [], c = 0; c < o; c++) { var d = a[c]; l.push([c, n.indexOf(d.source()), n.indexOf(d.target())]); } for (var v = 1 / 0, h = [], f = new Array(i), p = new Array(i), m = new Array(i), g = function(R, K) { for (var H = 0; H < i; H++) K[H] = R[H]; }, y = 0; y <= s; y++) { for (var b = 0; b < i; b++) p[b] = b; var w = Ml(p, l.slice(), i, u), C = w.slice(); g(p, m); var E = Ml(p, w, u, 2), x = Ml(m, C, u, 2); E.length <= x.length && E.length < v ? (v = E.length, h = E, g(p, f)) : x.length <= E.length && x.length < v && (v = x.length, h = x, g(m, f)); } for (var T = this.spawn(h.map(function(A) { return a[A[0]]; })), k = this.spawn(), _ = this.spawn(), D = f[0], O = 0; O < f.length; O++) { var F = f[O], L = n[O]; F === D ? k.merge(L) : _.merge(L); } var B = function(R) { var K = e.spawn(); return R.forEach(function(H) { K.merge(H), H.connectedEdges().forEach(function(q) { e.contains(q) && !T.contains(q) && K.merge(q); }); }), K; }, I = [B(k), B(_)], M = { cut: T, components: I, // n.b. partitions are included to be compatible with the old api spec // (could be removed in a future major version) partition1: k, partition2: _ }; return M; } }, N5 = function(e) { return { x: e.x, y: e.y }; }, nl = function(e, r, n) { return { x: e.x * r + n.x, y: e.y * r + n.y }; }, dp = function(e, r, n) { return { x: (e.x - n.x) / r, y: (e.y - n.y) / r }; }, Ha = function(e) { return { x: e[0], y: e[1] }; }, $5 = 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 o = e[i]; isFinite(o) && (a = Math.min(o, a)); } return a; }, R5 = 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 o = e[i]; isFinite(o) && (a = Math.max(o, a)); } return a; }, z5 = 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, o = r; o < n; o++) { var s = e[o]; isFinite(s) && (a += s, i++); } return a / i; }, V5 = 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, o = 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 s = 0, u = e.length - 1; u >= 0; u--) { var l = e[u]; o ? isFinite(l) || (e[u] = -1 / 0, s++) : e.splice(u, 1); } i && e.sort(function(v, h) { return v - h; }); var c = e.length, d = Math.floor(c / 2); return c % 2 !== 0 ? e[d + 1 + s] : (e[d - 1 + s] + e[d + s]) / 2; }, H5 = function(e) { return Math.PI * e / 180; }, Wo = function(e, r) { return Math.atan2(r, e) - Math.PI / 2; }, fc = Math.log2 || function(t) { return Math.log(t) / Math.log(2); }, fp = function(e) { return e > 0 ? 1 : e < 0 ? -1 : 0; }, ya = function(e, r) { return Math.sqrt(ta(e, r)); }, ta = function(e, r) { var n = r.x - e.x, a = r.y - e.y; return n * n + a * a; }, q5 = 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; }, Nt = function(e, r, n, a) { return (1 - a) * (1 - a) * e + 2 * (1 - a) * a * r + a * a * n; }, Ga = function(e, r, n, a) { return { x: Nt(e.x, r.x, n.x, a), y: Nt(e.y, r.y, n.y, a) }; }, K5 = function(e, r, n, a) { var i = { x: r.x - e.x, y: r.y - e.y }, o = ya(e, r), s = { x: i.x / o, y: i.y / o }; return n = n ?? 0, a = a ?? n * o, { x: e.x + s.x * a, y: e.y + s.y * a }; }, io = function(e, r, n) { return Math.max(e, Math.min(n, r)); }, pr = 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 }; } }, U5 = function(e) { return { x1: e.x1, x2: e.x2, w: e.w, y1: e.y1, y2: e.y2, h: e.h }; }, G5 = function(e) { e.x1 = 1 / 0, e.y1 = 1 / 0, e.x2 = -1 / 0, e.y2 = -1 / 0, e.w = 0, e.h = 0; }, W5 = function(e, r, n) { return { x1: e.x1 + r, x2: e.x2 + r, y1: e.y1 + n, y2: e.y2 + n, w: e.w, h: e.h }; }, vp = 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; }, Y5 = 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; }, us = 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; }, cs = function(e) { var r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : [0], n, a, i, o; if (r.length === 1) n = a = i = o = r[0]; else if (r.length === 2) n = i = r[0], o = a = r[1]; else if (r.length === 4) { var s = Mr(r, 4); n = s[0], a = s[1], i = s[2], o = s[3]; } return e.x1 -= o, e.x2 += a, e.y1 -= n, e.y2 += i, e.w = e.x2 - e.x1, e.h = e.y2 - e.y1, e; }, cf = 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; }, vc = 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); }, oi = function(e, r, n) { return e.x1 <= r && r <= e.x2 && e.y1 <= n && n <= e.y2; }, Z5 = function(e, r) { return oi(e, r.x, r.y); }, hp = function(e, r) { return oi(e, r.x1, r.y1) && oi(e, r.x2, r.y2); }, pp = function(e, r, n, a, i, o, s) { var u = arguments.length > 7 && arguments[7] !== void 0 ? arguments[7] : "auto", l = u === "auto" ? ba(i, o) : u, c = i / 2, d = o / 2; l = Math.min(l, c, d); var v = l !== c, h = l !== d, f; if (v) { var p = n - c + l - s, m = a - d - s, g = n + c - l + s, y = m; if (f = Nn(e, r, n, a, p, m, g, y, !1), f.length > 0) return f; } if (h) { var b = n + c + s, w = a - d + l - s, C = b, E = a + d - l + s; if (f = Nn(e, r, n, a, b, w, C, E, !1), f.length > 0) return f; } if (v) { var x = n - c + l - s, T = a + d + s, k = n + c - l + s, _ = T; if (f = Nn(e, r, n, a, x, T, k, _, !1), f.length > 0) return f; } if (h) { var D = n - c - s, O = a - d + l - s, F = D, L = a + d - l + s; if (f = Nn(e, r, n, a, D, O, F, L, !1), f.length > 0) return f; } var B; { var I = n - c + l, M = a - d + l; if (B = Ni(e, r, n, a, I, M, l + s), B.length > 0 && B[0] <= I && B[1] <= M) return [B[0], B[1]]; } { var A = n + c - l, R = a - d + l; if (B = Ni(e, r, n, a, A, R, l + s), B.length > 0 && B[0] >= A && B[1] <= R) return [B[0], B[1]]; } { var K = n + c - l, H = a + d - l; if (B = Ni(e, r, n, a, K, H, l + s), B.length > 0 && B[0] >= K && B[1] >= H) return [B[0], B[1]]; } { var q = n - c + l, ee = a + d - l; if (B = Ni(e, r, n, a, q, ee, l + s), B.length > 0 && B[0] <= q && B[1] >= ee) return [B[0], B[1]]; } return []; }, X5 = function(e, r, n, a, i, o, s) { var u = s, l = Math.min(n, i), c = Math.max(n, i), d = Math.min(a, o), v = Math.max(a, o); return l - u <= e && e <= c + u && d - u <= r && r <= v + u; }, j5 = function(e, r, n, a, i, o, s, u, l) { var c = { x1: Math.min(n, s, i) - l, x2: Math.max(n, s, i) + l, y1: Math.min(a, u, o) - l, y2: Math.max(a, u, o) + l }; return !(e < c.x1 || e > c.x2 || r < c.y1 || r > c.y2); }, Q5 = function(e, r, n, a) { n -= a; var i = r * r - 4 * e * n; if (i < 0) return []; var o = Math.sqrt(i), s = 2 * e, u = (-r + o) / s, l = (-r - o) / s; return [u, l]; }, J5 = function(e, r, n, a, i) { var o = 1e-5; e === 0 && (e = o), r /= e, n /= e, a /= e; var s, u, l, c, d, v, h, f; if (u = (3 * n - r * r) / 9, l = -(27 * a) + r * (9 * n - 2 * (r * r)), l /= 54, s = u * u * u + l * l, i[1] = 0, h = r / 3, s > 0) { d = l + Math.sqrt(s), d = d < 0 ? -Math.pow(-d, 1 / 3) : Math.pow(d, 1 / 3), v = l - Math.sqrt(s), v = v < 0 ? -Math.pow(-v, 1 / 3) : Math.pow(v, 1 / 3), i[0] = -h + d + v, h += (d + v) / 2, i[4] = i[2] = -h, h = Math.sqrt(3) * (-v + d) / 2, i[3] = h, i[5] = -h; return; } if (i[5] = i[3] = 0, s === 0) { f = l < 0 ? -Math.pow(-l, 1 / 3) : Math.pow(l, 1 / 3), i[0] = -h + 2 * f, i[4] = i[2] = -(f + h); return; } u = -u, c = u * u * u, c = Math.acos(l / Math.sqrt(c)), f = 2 * Math.sqrt(u), i[0] = -h + f * Math.cos(c / 3), i[2] = -h + f * Math.cos((c + 2 * Math.PI) / 3), i[4] = -h + f * Math.cos((c + 4 * Math.PI) / 3); }, e4 = function(e, r, n, a, i, o, s, u) { var l = 1 * n * n - 4 * n * i + 2 * n * s + 4 * i * i - 4 * i * s + s * s + a * a - 4 * a * o + 2 * a * u + 4 * o * o - 4 * o * u + u * u, c = 1 * 9 * n * i - 3 * n * n - 3 * n * s - 6 * i * i + 3 * i * s + 9 * a * o - 3 * a * a - 3 * a * u - 6 * o * o + 3 * o * u, d = 1 * 3 * n * n - 6 * n * i + n * s - n * e + 2 * i * i + 2 * i * e - s * e + 3 * a * a - 6 * a * o + a * u - a * r + 2 * o * o + 2 * o * r - u * r, v = 1 * n * i - n * n + n * e - i * e + a * o - a * a + a * r - o * r, h = []; J5(l, c, d, v, h); for (var f = 1e-7, p = [], m = 0; m < 6; m += 2) Math.abs(h[m + 1]) < f && h[m] >= 0 && h[m] <= 1 && p.push(h[m]); p.push(1), p.push(0); for (var g = -1, y, b, w, C = 0; C < p.length; C++) y = Math.pow(1 - p[C], 2) * n + 2 * (1 - p[C]) * p[C] * i + p[C] * p[C] * s, b = Math.pow(1 - p[C], 2) * a + 2 * (1 - p[C]) * p[C] * o + p[C] * p[C] * u, w = Math.pow(y - e, 2) + Math.pow(b - r, 2), g >= 0 ? w < g && (g = w) : g = w; return g; }, t4 = function(e, r, n, a, i, o) { var s = [e - n, r - a], u = [i - n, o - a], l = u[0] * u[0] + u[1] * u[1], c = s[0] * s[0] + s[1] * s[1], d = s[0] * u[0] + s[1] * u[1], v = d * d / l; return d < 0 ? c : v > l ? (e - i) * (e - i) + (r - o) * (r - o) : c - v; }, dr = function(e, r, n) { for (var a, i, o, s, u, l = 0, c = 0; c < n.length / 2; c++) if (a = n[c * 2], i = n[c * 2 + 1], c + 1 < n.length / 2 ? (o = n[(c + 1) * 2], s = n[(c + 1) * 2 + 1]) : (o = n[(c + 1 - n.length / 2) * 2], s = n[(c + 1 - n.length / 2) * 2 + 1]), !(a == e && o == e)) if (a >= e && e >= o || a <= e && e <= o) u = (e - a) / (o - a) * (s - i) + i, u > r && l++; else continue; return l % 2 !== 0; }, mn = function(e, r, n, a, i, o, s, u, l) { var c = new Array(n.length), d; u[0] != null ? (d = Math.atan(u[1] / u[0]), u[0] < 0 ? d = d + Math.PI / 2 : d = -d - Math.PI / 2) : d = u; for (var v = Math.cos(-d), h = Math.sin(-d), f = 0; f < c.length / 2; f++) c[f * 2] = o / 2 * (n[f * 2] * v - n[f * 2 + 1] * h), c[f * 2 + 1] = s / 2 * (n[f * 2 + 1] * v + n[f * 2] * h), c[f * 2] += a, c[f * 2 + 1] += i; var p; if (l > 0) { var m = Is(c, -l); p = Ls(m); } else p = c; return dr(e, r, p); }, r4 = function(e, r, n, a, i, o, s, u) { for (var l = new Array(n.length * 2), c = 0; c < u.length; c++) { var d = u[c]; l[c * 4 + 0] = d.startX, l[c * 4 + 1] = d.startY, l[c * 4 + 2] = d.stopX, l[c * 4 + 3] = d.stopY; var v = Math.pow(d.cx - e, 2) + Math.pow(d.cy - r, 2); if (v <= Math.pow(d.radius, 2)) return !0; } return dr(e, r, l); }, Ls = function(e) { for (var r = new Array(e.length / 2), n, a, i, o, s, u, l, c, d = 0; d < e.length / 4; d++) { n = e[d * 4], a = e[d * 4 + 1], i = e[d * 4 + 2], o = e[d * 4 + 3], d < e.length / 4 - 1 ? (s = e[(d + 1) * 4], u = e[(d + 1) * 4 + 1], l = e[(d + 1) * 4 + 2], c = e[(d + 1) * 4 + 3]) : (s = e[0], u = e[1], l = e[2], c = e[3]); var v = Nn(n, a, i, o, s, u, l, c, !0); r[d * 2] = v[0], r[d * 2 + 1] = v[1]; } return r; }, Is = function(e, r) { for (var n = new Array(e.length * 2), a, i, o, s, u = 0; u < e.length / 2; u++) { a = e[u * 2], i = e[u * 2 + 1], u < e.length / 2 - 1 ? (o = e[(u + 1) * 2], s = e[(u + 1) * 2 + 1]) : (o = e[0], s = e[1]); var l = s - i, c = -(o - a), d = Math.sqrt(l * l + c * c), v = l / d, h = c / d; n[u * 4] = a + v * r, n[u * 4 + 1] = i + h * r, n[u * 4 + 2] = o + v * r, n[u * 4 + 3] = s + h * r; } return n; }, n4 = function(e, r, n, a, i, o) { var s = n - e, u = a - r; s /= i, u /= o; var l = Math.sqrt(s * s + u * u), c = l - 1; if (c < 0) return []; var d = c / l; return [(n - e) * d + e, (a - r) * d + r]; }, la = function(e, r, n, a, i, o, s) { return e -= i, r -= o, e /= n / 2 + s, r /= a / 2 + s, e * e + r * r <= 1; }, Ni = function(e, r, n, a, i, o, s) { var u = [n - e, a - r], l = [e - i, r - o], c = u[0] * u[0] + u[1] * u[1], d = 2 * (l[0] * u[0] + l[1] * u[1]), v = l[0] * l[0] + l[1] * l[1] - s * s, h = d * d - 4 * c * v; if (h < 0) return []; var f = (-d + Math.sqrt(h)) / (2 * c), p = (-d - Math.sqrt(h)) / (2 * c), m = Math.min(f, p), g = Math.max(f, p), y = []; if (m >= 0 && m <= 1 && y.push(m), g >= 0 && g <= 1 && y.push(g), y.length === 0) return []; var b = y[0] * u[0] + e, w = y[0] * u[1] + r; if (y.length > 1) { if (y[0] == y[1]) return [b, w]; var C = y[1] * u[0] + e, E = y[1] * u[1] + r; return [b, w, C, E]; } else return [b, w]; }, Bl = function(e, r, n) { return r <= e && e <= n || n <= e && e <= r ? e : e <= r && r <= n || n <= r && r <= e ? r : n; }, Nn = function(e, r, n, a, i, o, s, u, l) { var c = e - i, d = n - e, v = s - i, h = r - o, f = a - r, p = u - o, m = v * h - p * c, g = d * h - f * c, y = p * d - v * f; if (y !== 0) { var b = m / y, w = g / y, C = 1e-3, E = 0 - C, x = 1 + C; return E <= b && b <= x && E <= w && w <= x ? [e + b * d, r + b * f] : l ? [e + b * d, r + b * f] : []; } else return m === 0 || g === 0 ? Bl(e, n, s) === s ? [s, u] : Bl(e, n, i) === i ? [i, o] : Bl(i, s, n) === n ? [n, a] : [] : []; }, oo = function(e, r, n, a, i, o, s, u) { var l = [], c, d = new Array(n.length), v = !0; o == null && (v = !1); var h; if (v) { for (var f = 0; f < d.length / 2; f++) d[f * 2] = n[f * 2] * o + a, d[f * 2 + 1] = n[f * 2 + 1] * s + i; if (u > 0) { var p = Is(d, -u); h = Ls(p); } else h = d; } else h = n; for (var m, g, y, b, w = 0; w < h.length / 2; w++) m = h[w * 2], g = h[w * 2 + 1], w < h.length / 2 - 1 ? (y = h[(w + 1) * 2], b = h[(w + 1) * 2 + 1]) : (y = h[0], b = h[1]), c = Nn(e, r, a, i, m, g, y, b), c.length !== 0 && l.push(c[0], c[1]); return l; }, a4 = function(e, r, n, a, i, o, s, u, l) { var c = [], d, v = new Array(n.length * 2); l.forEach(function(y, b) { b === 0 ? (v[v.length - 2] = y.startX, v[v.length - 1] = y.startY) : (v[b * 4 - 2] = y.startX, v[b * 4 - 1] = y.startY), v[b * 4] = y.stopX, v[b * 4 + 1] = y.stopY, d = Ni(e, r, a, i, y.cx, y.cy, y.radius), d.length !== 0 && c.push(d[0], d[1]); }); for (var h = 0; h < v.length / 4; h++) d = Nn(e, r, a, i, v[h * 4], v[h * 4 + 1], v[h * 4 + 2], v[h * 4 + 3], !1), d.length !== 0 && c.push(d[0], d[1]); if (c.length > 2) { for (var f = [c[0], c[1]], p = Math.pow(f[0] - e, 2) + Math.pow(f[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 <= p && (f[0] = c[m * 2], f[1] = c[m * 2 + 1], p = g); } return f; } return c; }, Yo = 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]), o = (i - n) / i; return o < 0 && (o = 1e-5), [r[0] + o * a[0], r[1] + o * a[1]]; }, sr = function(e, r) { var n = su(e, r); return n = gp(n), n; }, gp = function(e) { for (var r, n, a = e.length / 2, i = 1 / 0, o = 1 / 0, s = -1 / 0, u = -1 / 0, l = 0; l < a; l++) r = e[2 * l], n = e[2 * l + 1], i = Math.min(i, r), s = Math.max(s, r), o = Math.min(o, n), u = Math.max(u, n); for (var c = 2 / (s - i), d = 2 / (u - o), v = 0; v < a; v++) r = e[2 * v] = e[2 * v] * c, n = e[2 * v + 1] = e[2 * v + 1] * d, i = Math.min(i, r), s = Math.max(s, r), o = Math.min(o, n), u = Math.max(u, n); if (o < -1) for (var h = 0; h < a; h++) n = e[2 * h + 1] = e[2 * h + 1] + (-1 - o); return e; }, su = 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), o, s = 0; s < e; s++) o = s * n + a, i[2 * s] = Math.cos(o), i[2 * s + 1] = Math.sin(-o); return i; }, ba = function(e, r) { return Math.min(e / 4, r / 4, 8); }, mp = function(e, r) { return Math.min(e / 10, r / 10, 8); }, hc = function() { return 8; }, i4 = function(e, r, n) { return [e - 2 * r + n, 2 * (r - e), e]; }, lu = function(e, r) { return { heightOffset: Math.min(15, 0.05 * r), widthOffset: Math.min(100, 0.25 * e), ctrlPtOffsetPct: 0.05 }; }, o4 = Wt({ dampingFactor: 0.8, precision: 1e-6, iterations: 200, weight: function(e) { return 1; } }), s4 = { pageRank: function(e) { for (var r = o4(e), n = r.dampingFactor, a = r.precision, i = r.iterations, o = r.weight, s = this._private.cy, u = this.byGroup(), l = u.nodes, c = u.edges, d = l.length, v = d * d, h = c.length, f = new Array(v), p = new Array(d), m = (1 - n) / d, g = 0; g < d; g++) { for (var y = 0; y < d; y++) { var b = g * d + y; f[b] = 0; } p[g] = 0; } for (var w = 0; w < h; w++) { var C = c[w], E = C.data("source"), x = C.data("target"); if (E !== x) { var T = l.indexOfId(E), k = l.indexOfId(x), _ = o(C), D = k * d + T; f[D] += _, p[T] += _; } } for (var O = 1 / d + m, F = 0; F < d; F++) if (p[F] === 0) for (var L = 0; L < d; L++) { var B = L * d + F; f[B] = O; } else for (var I = 0; I < d; I++) { var M = I * d + F; f[M] = f[M] / p[F] + m; } for (var A = new Array(d), R = new Array(d), K, H = 0; H < d; H++) A[H] = 1; for (var q = 0; q < i; q++) { for (var ee = 0; ee < d; ee++) R[ee] = 0; for (var se = 0; se < d; se++) for (var oe = 0; oe < d; oe++) { var ne = se * d + oe; R[se] += f[ne] * A[oe]; } q5(R), K = A, A = R, R = K; for (var ue = 0, te = 0; te < d; te++) { var $ = K[te] - A[te]; ue += $ * $; } if (ue < a) break; } var G = { rank: function(ge) { return ge = s.collection(ge)[0], A[l.indexOf(ge)]; } }; return G; } // pageRank }, df = Wt({ root: null, weight: function(e) { return 1; }, directed: !1, alpha: 0 }), Wa = { degreeCentralityNormalized: function(e) { e = df(e); var r = this.cy(), n = this.nodes(), a = n.length; if (e.directed) { for (var c = {}, d = {}, v = 0, h = 0, f = 0; f < a; f++) { var p = n[f], m = p.id(); e.root = p; var g = this.degreeCentrality(e); v < g.indegree && (v = g.indegree), h < g.outdegree && (h = g.outdegree), c[m] = g.indegree, d[m] = g.outdegree; } return { indegree: function(b) { return v == 0 ? 0 : (Fe(b) && (b = r.filter(b)), c[b.id()] / v); }, outdegree: function(b) { return h === 0 ? 0 : (Fe(b) && (b = r.filter(b)), d[b.id()] / h); } }; } else { for (var i = {}, o = 0, s = 0; s < a; s++) { var u = n[s]; e.root = u; var l = this.degreeCentrality(e); o < l.degree && (o = l.degree), i[u.id()] = l.degree; } return { degree: function(b) { return o === 0 ? 0 : (Fe(b) && (b = r.filter(b)), i[b.id()] / o); } }; } }, // degreeCentralityNormalized // Implemented from the algorithm in Opsahl's paper // "Node centrality in weighted networks: Generalizing degree and shortest paths" // check the heading 2 "Degree" degreeCentrality: function(e) { e = df(e); var r = this.cy(), n = this, a = e, i = a.root, o = a.weight, s = a.directed, u = a.alpha; if (i = r.collection(i)[0], s) { for (var h = i.connectedEdges(), f = h.filter(function(E) { return E.target().same(i) && n.has(E); }), p = h.filter(function(E) { return E.source().same(i) && n.has(E); }), m = f.length, g = p.length, y = 0, b = 0, w = 0; w < f.length; w++) y += o(f[w]); for (var C = 0; C < p.length; C++) b += o(p[C]); return { indegree: Math.pow(m, 1 - u) * Math.pow(y, u), outdegree: Math.pow(g, 1 - u) * Math.pow(b, u) }; } else { for (var l = i.connectedEdges().intersection(n), c = l.length, d = 0, v = 0; v < l.length; v++) d += o(l[v]); return { degree: Math.pow(c, 1 - u) * Math.pow(d, u) }; } } // degreeCentrality }; Wa.dc = Wa.degreeCentrality; Wa.dcn = Wa.degreeCentralityNormalised = Wa.degreeCentralityNormalized; var ff = Wt({ harmonic: !0, weight: function() { return 1; }, directed: !1, root: null }), Ya = { closenessCentralityNormalized: function(e) { for (var r = ff(e), n = r.harmonic, a = r.weight, i = r.directed, o = this.cy(), s = {}, u = 0, l = this.nodes(), c = this.floydWarshall({ weight: a, directed: i }), d = 0; d < l.length; d++) { for (var v = 0, h = l[d], f = 0; f < l.length; f++) if (d !== f) { var p = c.distance(h, l[f]); n ? v += 1 / p : v += p; } n || (v = 1 / v), u < v && (u = v), s[h.id()] = v; } return { closeness: function(g) { return u == 0 ? 0 : (Fe(g) ? g = o.filter(g)[0].id() : g = g.id(), s[g] / u); } }; }, // Implemented from pseudocode from wikipedia closenessCentrality: function(e) { var r = ff(e), n = r.root, a = r.weight, i = r.directed, o = r.harmonic; n = this.filter(n)[0]; for (var s = this.dijkstra({ root: n, weight: a, directed: i }), u = 0, l = this.nodes(), c = 0; c < l.length; c++) { var d = l[c]; if (!d.same(n)) { var v = s.distanceTo(d); o ? u += 1 / v : u += v; } } return o ? u : 1 / u; } // closenessCentrality }; Ya.cc = Ya.closenessCentrality; Ya.ccn = Ya.closenessCentralityNormalised = Ya.closenessCentralityNormalized; var l4 = Wt({ weight: null, directed: !1 }), uu = { // Implemented from the algorithm in the paper "On Variants of Shortest-Path Betweenness Centrality and their Generic Computation" by Ulrik Brandes betweennessCentrality: function(e) { for (var r = l4(e), n = r.directed, a = r.weight, i = a != null, o = this.cy(), s = this.nodes(), u = {}, l = {}, c = 0, d = { set: function(b, w) { l[b] = w, w > c && (c = w); }, get: function(b) { return l[b]; } }, v = 0; v < s.length; v++) { var h = s[v], f = h.id(); n ? u[f] = h.outgoers().nodes() : u[f] = h.openNeighborhood().nodes(), d.set(f, 0); } for (var p = function(b) { for (var w = s[b].id(), C = [], E = {}, x = {}, T = {}, k = new Oo(function(oe, ne) { return T[oe] - T[ne]; }), _ = 0; _ < s.length; _++) { var D = s[_].id(); E[D] = [], x[D] = 0, T[D] = 1 / 0; } for (x[w] = 1, T[w] = 0, k.push(w); !k.empty(); ) { var O = k.pop(); if (C.push(O), i) for (var F = 0; F < u[O].length; F++) { var L = u[O][F], B = o.getElementById(O), I = void 0; B.edgesTo(L).length > 0 ? I = B.edgesTo(L)[0] : I = L.edgesTo(B)[0]; var M = a(I); L = L.id(), T[L] > T[O] + M && (T[L] = T[O] + M, k.nodes.indexOf(L) < 0 ? k.push(L) : k.updateItem(L), x[L] = 0, E[L] = []), T[L] == T[O] + M && (x[L] = x[L] + x[O], E[L].push(O)); } else for (var A = 0; A < u[O].length; A++) { var R = u[O][A].id(); T[R] == 1 / 0 && (k.push(R), T[R] = T[O] + 1), T[R] == T[O] + 1 && (x[R] = x[R] + x[O], E[R].push(O)); } } for (var K = {}, H = 0; H < s.length; H++) K[s[H].id()] = 0; for (; C.length > 0; ) { for (var q = C.pop(), ee = 0; ee < E[q].length; ee++) { var se = E[q][ee]; K[se] = K[se] + x[se] / x[q] * (1 + K[q]); } q != s[b].id() && d.set(q, d.get(q) + K[q]); } }, m = 0; m < s.length; m++) p(m); var g = { betweenness: function(b) { var w = o.collection(b).id(); return d.get(w); }, betweennessNormalized: function(b) { if (c == 0) return 0; var w = o.collection(b).id(); return d.get(w) / c; } }; return g.betweennessNormalised = g.betweennessNormalized, g; } // betweennessCentrality }; uu.bc = uu.betweennessCentrality; var u4 = Wt({ expandFactor: 2, // affects time of computation and cluster granularity to some extent: M * M inflateFactor: 2, // affects cluster granularity (the greater the value, the more clusters): M(i,j) / E(j) multFactor: 1, // optional self loops for each node. Use a neutral value to improve cluster computations. maxIterations: 20, // maximum number of iterations of the MCL algorithm in a single run attributes: [ // attributes/features used to group nodes, ie. similarity values between nodes function(t) { return 1; } ] }), c4 = function(e) { return u4(e); }, d4 = function(e, r) { for (var n = 0, a = 0; a < r.length; a++) n += r[a](e); return n; }, f4 = function(e, r, n) { for (var a = 0; a < r; a++) e[a * r + a] = n; }, yp = 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 o = 0; o < r; o++) e[o * r + a] = e[o * r + a] / n; } }, v4 = function(e, r, n) { for (var a = new Array(n * n), i = 0; i < n; i++) { for (var o = 0; o < n; o++) a[i * n + o] = 0; for (var s = 0; s < n; s++) for (var u = 0; u < n; u++) a[i * n + u] += e[i * n + s] * r[s * n + u]; } return a; }, h4 = function(e, r, n) { for (var a = e.slice(0), i = 1; i < n; i++) e = v4(e, a, r); return e; }, p4 = 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 yp(a, r), a; }, g4 = function(e, r, n, a) { for (var i = 0; i < n; i++) { var o = Math.round(e[i] * Math.pow(10, a)) / Math.pow(10, a), s = Math.round(r[i] * Math.pow(10, a)) / Math.pow(10, a); if (o !== s) return !1; } return !0; }, m4 = function(e, r, n, a) { for (var i = [], o = 0; o < r; o++) { for (var s = [], u = 0; u < r; u++) Math.round(e[o * r + u] * 1e3) / 1e3 > 0 && s.push(n[u]); s.length !== 0 && i.push(a.collection(s)); } return i; }, y4 = function(e, r) { for (var n = 0; n < e.length; n++) if (!r[n] || e[n].id() !== r[n].id()) return !1; return !0; }, b4 = function(e) { for (var r = 0; r < e.length; r++) for (var n = 0; n < e.length; n++) r != n && y4(e[r], e[n]) && e.splice(n, 1); return e; }, vf = function(e) { for (var r = this.nodes(), n = this.edges(), a = this.cy(), i = c4(e), o = {}, s = 0; s < r.length; s++) o[r[s].id()] = s; for (var u = r.length, l = u * u, c = new Array(l), d, v = 0; v < l; v++) c[v] = 0; for (var h = 0; h < n.length; h++) { var f = n[h], p = o[f.source().id()], m = o[f.target().id()], g = d4(f, i.attributes); c[p * u + m] += g, c[m * u + p] += g; } f4(c, u, i.multFactor), yp(c, u); for (var y = !0, b = 0; y && b < i.maxIterations; ) y = !1, d = h4(c, u, i.expandFactor), c = p4(d, u, i.inflateFactor), g4(c, d, l, 4) || (y = !0), b++; var w = m4(c, u, r, a); return w = b4(w), w; }, w4 = { markovClustering: vf, mcl: vf }, x4 = function(e) { return e; }, bp = function(e, r) { return Math.abs(r - e); }, hf = function(e, r, n) { return e + bp(r, n); }, pf = function(e, r, n) { return e + Math.pow(n - r, 2); }, C4 = function(e) { return Math.sqrt(e); }, E4 = function(e, r, n) { return Math.max(e, bp(r, n)); }, Oi = function(e, r, n, a, i) { for (var o = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : x4, s = a, u, l, c = 0; c < e; c++) u = r(c), l = n(c), s = i(s, u, l); return o(s); }, si = { euclidean: function(e, r, n) { return e >= 2 ? Oi(e, r, n, 0, pf, C4) : Oi(e, r, n, 0, hf); }, squaredEuclidean: function(e, r, n) { return Oi(e, r, n, 0, pf); }, manhattan: function(e, r, n) { return Oi(e, r, n, 0, hf); }, max: function(e, r, n) { return Oi(e, r, n, -1 / 0, E4); } }; si["squared-euclidean"] = si.squaredEuclidean; si.squaredeuclidean = si.squaredEuclidean; function al(t, e, r, n, a, i) { var o; return pt(t) ? o = t : o = si[t] || si.euclidean, e === 0 && pt(t) ? o(a, i) : o(e, r, n, a, i); } var k4 = Wt({ k: 2, m: 2, sensitivityThreshold: 1e-4, distance: "euclidean", maxIterations: 10, attributes: [], testMode: !1, testCentroids: null }), pc = function(e) { return k4(e); }, Fs = function(e, r, n, a, i) { var o = i !== "kMedoids", s = o ? function(d) { return n[d]; } : function(d) { return a[d](n); }, u = function(v) { return a[v](r); }, l = n, c = r; return al(e, a.length, s, u, l, c); }, Nl = function(e, r, n) { for (var a = n.length, i = new Array(a), o = new Array(a), s = new Array(r), u = null, l = 0; l < a; l++) i[l] = e.min(n[l]).value, o[l] = e.max(n[l]).value; for (var c = 0; c < r; c++) { u = []; for (var d = 0; d < a; d++) u[d] = Math.random() * (o[d] - i[d]) + i[d]; s[c] = u; } return s; }, wp = function(e, r, n, a, i) { for (var o = 1 / 0, s = 0, u = 0; u < r.length; u++) { var l = Fs(n, e, r[u], a, i); l < o && (o = l, s = u); } return s; }, xp = function(e, r, n) { for (var a = [], i = null, o = 0; o < r.length; o++) i = r[o], n[i.id()] === e && a.push(i); return a; }, S4 = function(e, r, n) { return Math.abs(r - e) <= n; }, T4 = function(e, r, n) { for (var a = 0; a < e.length; a++) for (var i = 0; i < e[a].length; i++) { var o = Math.abs(e[a][i] - r[a][i]); if (o > n) return !1; } return !0; }, _4 = function(e, r, n) { for (var a = 0; a < n; a++) if (e === r[a]) return !0; return !1; }, gf = 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)]; _4(i, n, a); ) i = e[Math.floor(Math.random() * e.length)]; n[a] = i; } else for (var o = 0; o < r; o++) n[o] = e[Math.floor(Math.random() * e.length)]; return n; }, mf = function(e, r, n) { for (var a = 0, i = 0; i < r.length; i++) a += Fs("manhattan", r[i], e, n, "kMedoids"); return a; }, D4 = function(e) { var r = this.cy(), n = this.nodes(), a = null, i = pc(e), o = new Array(i.k), s = {}, u; i.testMode ? typeof i.testCentroids == "number" ? (i.testCentroids, u = Nl(n, i.k, i.attributes)) : Ft(i.testCentroids) === "object" ? u = i.testCentroids : u = Nl(n, i.k, i.attributes) : u = Nl(n, i.k, i.attributes); for (var l = !0, c = 0; l && c < i.maxIterations; ) { for (var d = 0; d < n.length; d++) a = n[d], s[a.id()] = wp(a, u, i.distance, i.attributes, "kMeans"); l = !1; for (var v = 0; v < i.k; v++) { var h = xp(v, n, s); if (h.length !== 0) { for (var f = i.attributes.length, p = u[v], m = new Array(f), g = new Array(f), y = 0; y < f; y++) { g[y] = 0; for (var b = 0; b < h.length; b++) a = h[b], g[y] += i.attributes[y](a); m[y] = g[y] / h.length, S4(m[y], p[y], i.sensitivityThreshold) || (l = !0); } u[v] = m, o[v] = r.collection(h); } } c++; } return o; }, P4 = function(e) { var r = this.cy(), n = this.nodes(), a = null, i = pc(e), o = new Array(i.k), s, u = {}, l, c = new Array(i.k); i.testMode ? typeof i.testCentroids == "number" || (Ft(i.testCentroids) === "object" ? s = i.testCentroids : s = gf(n, i.k)) : s = gf(n, i.k); for (var d = !0, v = 0; d && v < i.maxIterations; ) { for (var h = 0; h < n.length; h++) a = n[h], u[a.id()] = wp(a, s, i.distance, i.attributes, "kMedoids"); d = !1; for (var f = 0; f < s.length; f++) { var p = xp(f, n, u); if (p.length !== 0) { c[f] = mf(s[f], p, i.attributes); for (var m = 0; m < p.length; m++) l = mf(p[m], p, i.attributes), l < c[f] && (c[f] = l, s[f] = p[m], d = !0); o[f] = r.collection(p); } } v++; } return o; }, O4 = function(e, r, n, a, i) { for (var o, s, u = 0; u < r.length; u++) for (var l = 0; l < e.length; l++) a[u][l] = Math.pow(n[u][l], i.m); for (var c = 0; c < e.length; c++) for (var d = 0; d < i.attributes.length; d++) { o = 0, s = 0; for (var v = 0; v < r.length; v++) o += a[v][c] * i.attributes[d](r[v]), s += a[v][c]; e[c][d] = o / s; } }, L4 = function(e, r, n, a, i) { for (var o = 0; o < e.length; o++) r[o] = e[o].slice(); for (var s, u, l, c = 2 / (i.m - 1), d = 0; d < n.length; d++) for (var v = 0; v < a.length; v++) { s = 0; for (var h = 0; h < n.length; h++) u = Fs(i.distance, a[v], n[d], i.attributes, "cmeans"), l = Fs(i.distance, a[v], n[h], i.attributes, "cmeans"), s += Math.pow(u / l, c); e[v][d] = 1 / s; } }, I4 = function(e, r, n, a) { for (var i = new Array(n.k), o = 0; o < i.length; o++) i[o] = []; for (var s, u, l = 0; l < r.length; l++) { s = -1 / 0, u = -1; for (var c = 0; c < r[0].length; c++) r[l][c] > s && (s = r[l][c], u = c); i[u].push(e[l]); } for (var d = 0; d < i.length; d++) i[d] = a.collection(i[d]); return i; }, yf = function(e) { var r = this.cy(), n = this.nodes(), a = pc(e), i, o, s, u, l; u = new Array(n.length); for (var c = 0; c < n.length; c++) u[c] = new Array(a.k); s = new Array(n.length); for (var d = 0; d < n.length; d++) s[d] = new Array(a.k); for (var v = 0; v < n.length; v++) { for (var h = 0, f = 0; f < a.k; f++) s[v][f] = Math.random(), h += s[v][f]; for (var p = 0; p < a.k; p++) s[v][p] = s[v][p] / h; } o = new Array(a.k); for (var m = 0; m < a.k; m++) o[m] = new Array(a.attributes.length); l = new Array(n.length); for (var g = 0; g < n.length; g++) l[g] = new Array(a.k); for (var y = !0, b = 0; y && b < a.maxIterations; ) y = !1, O4(o, n, s, l, a), L4(s, u, o, n, a), T4(s, u, a.sensitivityThreshold) || (y = !0), b++; return i = I4(n, s, a, r), { clusters: i, degreeOfMembership: s }; }, F4 = { kMeans: D4, kMedoids: P4, fuzzyCMeans: yf, fcm: yf }, A4 = Wt({ distance: "euclidean", // distance metric to compare nodes linkage: "min", // linkage criterion : how to determine the distance between clusters of nodes mode: "threshold", // mode:'threshold' => clusters must be threshold distance apart threshold: 1 / 0, // the distance threshold // mode:'dendrogram' => the nodes are organised as leaves in a tree (siblings are close), merging makes clusters addDendrogram: !1, // whether to add the dendrogram to the graph for viz dendrogramDepth: 0, // depth at which dendrogram branches are merged into the returned clusters attributes: [] // array of attr functions }), M4 = { single: "min", complete: "max" }, B4 = function(e) { var r = A4(e), n = M4[r.linkage]; return n != null && (r.linkage = n), r; }, bf = function(e, r, n, a, i) { for (var o = 0, s = 1 / 0, u, l = i.attributes, c = function(k, _) { return al(i.distance, l.length, function(D) { return l[D](k); }, function(D) { return l[D](_); }, k, _); }, d = 0; d < e.length; d++) { var v = e[d].key, h = n[v][a[v]]; h < s && (o = v, s = h); } if (i.mode === "threshold" && s >= i.threshold || i.mode === "dendrogram" && e.length === 1) return !1; var f = r[o], p = r[a[o]], m; i.mode === "dendrogram" ? m = { left: f, right: p, key: f.key } : m = { value: f.value.concat(p.value), key: f.key }, e[f.index] = m, e.splice(p.index, 1), r[f.key] = m; for (var g = 0; g < e.length; g++) { var y = e[g]; f.key === y.key ? u = 1 / 0 : i.linkage === "min" ? (u = n[f.key][y.key], n[f.key][y.key] > n[p.key][y.key] && (u = n[p.key][y.key])) : i.linkage === "max" ? (u = n[f.key][y.key], n[f.key][y.key] < n[p.key][y.key] && (u = n[p.key][y.key])) : i.linkage === "mean" ? u = (n[f.key][y.key] * f.size + n[p.key][y.key] * p.size) / (f.size + p.size) : i.mode === "dendrogram" ? u = c(y.value, f.value) : u = c(y.value[0], f.value[0]), n[f.key][y.key] = n[y.key][f.key] = u; } for (var b = 0; b < e.length; b++) { var w = e[b].key; if (a[w] === f.key || a[w] === p.key) { for (var C = w, E = 0; E < e.length; E++) { var x = e[E].key; n[w][x] < n[w][C] && (C = x); } a[w] = C; } e[b].index = b; } return f.key = p.key = f.index = p.index = null, !0; }, Zo = function t(e, r, n) { e && (e.value ? r.push(e.value) : (e.left && t(e.left, r), e.right && t(e.right, r))); }, N4 = function t(e, r) { if (!e) return ""; if (e.left && e.right) { var n = t(e.left, r), a = t(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(); }, $4 = function t(e, r, n) { if (!e) return []; var a = [], i = [], o = []; return r === 0 ? (e.left && Zo(e.left, a), e.right && Zo(e.right, i), o = a.concat(i), [n.collection(o)]) : r === 1 ? e.value ? [n.collection(e.value)] : (e.left && Zo(e.left, a), e.right && Zo(e.right, i), [n.collection(a), n.collection(i)]) : e.value ? [n.collection(e.value)] : (e.left && (a = t(e.left, r - 1, n)), e.right && (i = t(e.right, r - 1, n)), a.concat(i)); }, wf = function(e) { for (var r = this.cy(), n = this.nodes(), a = B4(e), i = a.attributes, o = function(b, w) { return al(a.distance, i.length, function(C) { return i[C](b); }, function(C) { return i[C](w); }, b, w); }, s = [], u = [], l = [], c = [], d = 0; d < n.length; d++) { var v = { value: a.mode === "dendrogram" ? n[d] : [n[d]], key: d, index: d }; s[d] = v, c[d] = v, u[d] = [], l[d] = 0; } for (var h = 0; h < s.length; h++) for (var f = 0; f <= h; f++) { var p = void 0; a.mode === "dendrogram" ? p = h === f ? 1 / 0 : o(s[h].value, s[f].value) : p = h === f ? 1 / 0 : o(s[h].value[0], s[f].value[0]), u[h][f] = p, u[f][h] = p, p < u[h][l[h]] && (l[h] = f); } for (var m = bf(s, c, u, l, a); m; ) m = bf(s, c, u, l, a); var g; return a.mode === "dendrogram" ? (g = $4(s[0], a.dendrogramDepth, r), a.addDendrogram && N4(s[0], r)) : (g = new Array(s.length), s.forEach(function(y, b) { y.key = y.index = null, g[b] = r.collection(y.value); })), g; }, R4 = { hierarchicalClustering: wf, hca: wf }, z4 = Wt({ distance: "euclidean", // distance metric to compare attributes between two nodes preference: "median", // suitability of a data point to serve as an exemplar damping: 0.8, // damping factor between [0.5, 1) maxIterations: 1e3, // max number of iterations to run minIterations: 100, // min number of iterations to run in order for clustering to stop attributes: [ // functions to quantify the similarity between any two points // e.g. node => node.data('weight') ] }), V4 = function(e) { var r = e.damping, n = e.preference; 0.5 <= r && r < 1 || yt("Damping must range on [0.5, 1). Got: ".concat(r)); var a = ["median", "mean", "min", "max"]; return a.some(function(i) { return i === n; }) || be(n) || yt("Preference must be one of [".concat(a.map(function(i) { return "'".concat(i, "'"); }).join(", "), "] or a number. Got: ").concat(n)), z4(e); }, H4 = function(e, r, n, a) { var i = function(s, u) { return a[u](s); }; return -al(e, a.length, function(o) { return i(r, o); }, function(o) { return i(n, o); }, r, n); }, q4 = function(e, r) { var n = null; return r === "median" ? n = V5(e) : r === "mean" ? n = z5(e) : r === "min" ? n = $5(e) : r === "max" ? n = R5(e) : n = r, n; }, K4 = 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; }, xf = function(e, r, n) { for (var a = [], i = 0; i < e; i++) { for (var o = -1, s = -1 / 0, u = 0; u < n.length; u++) { var l = n[u]; r[i * e + l] > s && (o = l, s = r[i * e + l]); } o > 0 && a.push(o); } for (var c = 0; c < n.length; c++) a[n[c]] = n[c]; return a; }, U4 = function(e, r, n) { for (var a = xf(e, r, n), i = 0; i < n.length; i++) { for (var o = [], s = 0; s < a.length; s++) a[s] === n[i] && o.push(s); for (var u = -1, l = -1 / 0, c = 0; c < o.length; c++) { for (var d = 0, v = 0; v < o.length; v++) d += r[o[v] * e + o[c]]; d > l && (u = c, l = d); } n[i] = o[u]; } return a = xf(e, r, n), a; }, Cf = function(e) { for (var r = this.cy(), n = this.nodes(), a = V4(e), i = {}, o = 0; o < n.length; o++) i[n[o].id()] = o; var s, u, l, c, d, v; s = n.length, u = s * s, l = new Array(u); for (var h = 0; h < u; h++) l[h] = -1 / 0; for (var f = 0; f < s; f++) for (var p = 0; p < s; p++) f !== p && (l[f * s + p] = H4(a.distance, n[f], n[p], a.attributes)); c = q4(l, a.preference); for (var m = 0; m < s; m++) l[m * s + m] = c; d = new Array(u); for (var g = 0; g < u; g++) d[g] = 0; v = new Array(u); for (var y = 0; y < u; y++) v[y] = 0; for (var b = new Array(s), w = new Array(s), C = new Array(s), E = 0; E < s; E++) b[E] = 0, w[E] = 0, C[E] = 0; for (var x = new Array(s * a.minIterations), T = 0; T < x.length; T++) x[T] = 0; var k; for (k = 0; k < a.maxIterations; k++) { for (var _ = 0; _ < s; _++) { for (var D = -1 / 0, O = -1 / 0, F = -1, L = 0, B = 0; B < s; B++) b[B] = d[_ * s + B], L = v[_ * s + B] + l[_ * s + B], L >= D ? (O = D, D = L, F = B) : L > O && (O = L); for (var I = 0; I < s; I++) d[_ * s + I] = (1 - a.damping) * (l[_ * s + I] - D) + a.damping * b[I]; d[_ * s + F] = (1 - a.damping) * (l[_ * s + F] - O) + a.damping * b[F]; } for (var M = 0; M < s; M++) { for (var A = 0, R = 0; R < s; R++) b[R] = v[R * s + M], w[R] = Math.max(0, d[R * s + M]), A += w[R]; A -= w[M], w[M] = d[M * s + M], A += w[M]; for (var K = 0; K < s; K++) v[K * s + M] = (1 - a.damping) * Math.min(0, A - w[K]) + a.damping * b[K]; v[M * s + M] = (1 - a.damping) * (A - w[M]) + a.damping * b[M]; } for (var H = 0, q = 0; q < s; q++) { var ee = v[q * s + q] + d[q * s + q] > 0 ? 1 : 0; x[k % a.minIterations * s + q] = ee, H += ee; } if (H > 0 && (k >= a.minIterations - 1 || k == a.maxIterations - 1)) { for (var se = 0, oe = 0; oe < s; oe++) { C[oe] = 0; for (var ne = 0; ne < a.minIterations; ne++) C[oe] += x[ne * s + oe]; (C[oe] === 0 || C[oe] === a.minIterations) && se++; } if (se === s) break; } } for (var ue = K4(s, d, v), te = U4(s, l, ue), $ = {}, G = 0; G < ue.length; G++) $[ue[G]] = []; for (var Q = 0; Q < n.length; Q++) { var ge = i[n[Q].id()], Ee = te[ge]; Ee != null && $[Ee].push(n[Q]); } for (var fe = new Array(ue.length), me = 0; me < ue.length; me++) fe[me] = r.collection($[ue[me]]); return fe; }, G4 = { affinityPropagation: Cf, ap: Cf }, W4 = Wt({ root: void 0, directed: !1 }), Y4 = { hierholzer: function(e) { if (!Xe(e)) { var r = arguments; e = { root: r[0], directed: r[1] }; } var n = W4(e), a = n.root, i = n.directed, o = this, s = !1, u, l, c; a && (c = Fe(a) ? this.filter(a)[0].id() : a[0].id()); var d = {}, v = {}; i ? o.forEach(function(y) { var b = y.id(); if (y.isNode()) { var w = y.indegree(!0), C = y.outdegree(!0), E = w - C, x = C - w; E == 1 ? u ? s = !0 : u = b : x == 1 ? l ? s = !0 : l = b : (x > 1 || E > 1) && (s = !0), d[b] = [], y.outgoers().forEach(function(T) { T.isEdge() && d[b].push(T.id()); }); } else v[b] = [void 0, y.target().id()]; }) : o.forEach(function(y) { var b = y.id(); if (y.isNode()) { var w = y.degree(!0); w % 2 && (u ? l ? s = !0 : l = b : u = b), d[b] = [], y.connectedEdges().forEach(function(C) { return d[b].push(C.id()); }); } else v[b] = [y.source().id(), y.target().id()]; }); var h = { found: !1, trail: void 0 }; if (s) return h; if (l && u) if (i) { if (c && l != c) return h; c = l; } else { if (c && l != c && u != c) return h; c || (c = l); } else c || (c = o[0].id()); var f = function(b) { for (var w = b, C = [b], E, x, T; d[w].length; ) E = d[w].shift(), x = v[E][0], T = v[E][1], w != T ? (d[T] = d[T].filter(function(k) { return k != E; }), w = T) : !i && w != x && (d[x] = d[x].filter(function(k) { return k != E; }), w = x), C.unshift(E), C.unshift(w); return C; }, p = [], m = []; for (m = f(c); m.length != 1; ) d[m[0]].length == 0 ? (p.unshift(o.getElementById(m.shift())), p.unshift(o.getElementById(m.shift()))) : m = f(m.shift()).concat(m); p.unshift(o.getElementById(m.shift())); for (var g in d) if (d[g].length) return h; return h.found = !0, h.trail = this.spawn(p, !0), h; } }, Xo = function() { var e = this, r = {}, n = 0, a = 0, i = [], o = [], s = {}, u = function(v, h) { for (var f = o.length - 1, p = [], m = e.spawn(); o[f].x != v || o[f].y != h; ) p.push(o.pop().edge), f--; p.push(o.pop().edge), p.forEach(function(g) { var y = g.connectedNodes().intersection(e); m.merge(g), y.forEach(function(b) { var w = b.id(), C = b.connectedEdges().intersection(e); m.merge(b), r[w].cutVertex ? m.merge(C.filter(function(E) { return E.isLoop(); })) : m.merge(C); }); }), i.push(m); }, l = function d(v, h, f) { v === f && (a += 1), r[h] = { id: n, low: n++, cutVertex: !1 }; var p = e.getElementById(h).connectedEdges().intersection(e); if (p.size() === 0) i.push(e.spawn(e.getElementById(h))); else { var m, g, y, b; p.forEach(function(w) { m = w.source().id(), g = w.target().id(), y = m === h ? g : m, y !== f && (b = w.id(), s[b] || (s[b] = !0, o.push({ x: h, y, edge: w })), y in r ? r[h].low = Math.min(r[h].low, r[y].id) : (d(v, y, h), r[h].low = Math.min(r[h].low, r[y].low), r[h].id <= r[y].low && (r[h].cutVertex = !0, u(h, y)))); }); } }; e.forEach(function(d) { if (d.isNode()) { var v = d.id(); v in r || (a = 0, l(v, v), r[v].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 }; }, Z4 = { hopcroftTarjanBiconnected: Xo, htbc: Xo, htb: Xo, hopcroftTarjanBiconnectedComponents: Xo }, jo = function() { var e = this, r = {}, n = 0, a = [], i = [], o = e.spawn(e), s = function u(l) { i.push(l), r[l] = { index: n, low: n++, explored: !1 }; var c = e.getElementById(l).connectedEdges().intersection(e); if (c.forEach(function(p) { var m = p.target().id(); m !== l && (m in r || u(m), r[m].explored || (r[l].low = Math.min(r[l].low, r[m].low))); }), r[l].index === r[l].low) { for (var d = e.spawn(); ; ) { var v = i.pop(); if (d.merge(e.getElementById(v)), r[v].low = r[l].index, r[v].explored = !0, v === l) break; } var h = d.edgesWith(d), f = d.merge(h); a.push(f), o = o.difference(f); } }; return e.forEach(function(u) { if (u.isNode()) { var l = u.id(); l in r || s(l); } }), { cut: o, components: a }; }, X4 = { tarjanStronglyConnected: jo, tsc: jo, tscc: jo, tarjanStronglyConnectedComponents: jo }, Cp = {}; [ao, T5, _5, P5, L5, F5, B5, s4, Wa, Ya, uu, w4, F4, R4, G4, Y4, Z4, X4].forEach(function(t) { Re(Cp, t); }); /*! Embeddable Minimum Strictly-Compliant Promises/A+ 1.1.1 Thenable Copyright (c) 2013-2014 Ralf S. Engelschall (http://engelschall.com) Licensed under The MIT License (http://opensource.org/licenses/MIT) */ var Ep = 0, kp = 1, Sp = 2, yn = function t(e) { if (!(this instanceof t)) return new t(e); this.id = "Thenable/1.0.7", this.state = Ep, 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)); }; yn.prototype = { /* promise resolving methods */ fulfill: function(e) { return Ef(this, kp, "fulfillValue", e); }, reject: function(e) { return Ef(this, Sp, "rejectReason", e); }, /* "The then Method" [Promises/A+ 1.1, 1.2, 2.2] */ then: function(e, r) { var n = this, a = new yn(); return n.onFulfilled.push(Sf(e, a, "fulfill")), n.onRejected.push(Sf(r, a, "reject")), Tp(n), a.proxy; } }; var Ef = function(e, r, n, a) { return e.state === Ep && (e.state = r, e[n] = a, Tp(e)), e; }, Tp = function(e) { e.state === kp ? kf(e, "onFulfilled", e.fulfillValue) : e.state === Sp && kf(e, "onRejected", e.rejectReason); }, kf = function(e, r, n) { if (e[r].length !== 0) { var a = e[r]; e[r] = []; var i = function() { for (var s = 0; s < a.length; s++) a[s](n); }; typeof setImmediate == "function" ? setImmediate(i) : setTimeout(i, 0); } }, Sf = function(e, r, n) { return function(a) { if (typeof e != "function") r[n].call(r, a); else { var i; try { i = e(a); } catch (o) { r.reject(o); return; } j4(r, i); } }; }, j4 = function t(e, r) { if (e === r || e.proxy === r) { e.reject(new TypeError("cannot resolve promise with itself")); return; } var n; if (Ft(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, /* resolvePromise */ /* [Promises/A+ 2.3.3.3.1] */ function(i) { a || (a = !0, i === r ? e.reject(new TypeError("circular thenable chain")) : t(e, i)); }, /* rejectPromise */ /* [Promises/A+ 2.3.3.3.2] */ function(i) { a || (a = !0, e.reject(i)); } ); } catch (i) { a || e.reject(i); } return; } e.fulfill(r); }; yn.all = function(t) { return new yn(function(e, r) { for (var n = new Array(t.length), a = 0, i = function(u, l) { n[u] = l, a++, a === t.length && e(n); }, o = 0; o < t.length; o++) (function(s) { var u = t[s], l = u != null && u.then != null; if (l) u.then(function(d) { i(s, d); }, function(d) { r(d); }); else { var c = u; i(s, c); } })(o); }); }; yn.resolve = function(t) { return new yn(function(e, r) { e(t); }); }; yn.reject = function(t) { return new yn(function(e, r) { r(t); }); }; var hi = typeof Promise < "u" ? Promise : yn, cu = function(e, r, n) { var a = sc(e), i = !a, o = this._private = Re({ duration: 1e3 }, r, n); if (o.target = e, o.style = o.style || o.css, o.started = !1, o.playing = !1, o.hooked = !1, o.applying = !1, o.progress = 0, o.completes = [], o.frames = [], o.complete && pt(o.complete) && o.completes.push(o.complete), i) { var s = e.position(); o.startPosition = o.startPosition || { x: s.x, y: s.y }, o.startStyle = o.startStyle || e.cy().style().getAnimationStartStyle(e, o.style); } if (a) { var u = e.pan(); o.startPan = { x: u.x, y: u.y }, o.startZoom = e.zoom(); } this.length = 1, this[0] = this; }, wa = cu.prototype; Re(wa, { 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), yr(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(l, c) { var d = e[l]; d != null && (e[l] = 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], o = i.name, s = e.startStyle[o]; e.startStyle[o] = i, e.style[a] = s; } 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 hi(function(a, i) { n.push(function() { a(); }); }); } }); wa.complete = wa.completed; wa.run = wa.play; wa.running = wa.playing; var Q4 = { 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 o = a[0]; if (o) return o._private.animation.current.length > 0; }; }, // animated 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 o = 0; o < a.length; o++) { var s = a[o]; s._private.animation.queue = []; } return this; }; }, // clearQueue delay: function() { return function(r, n) { var a = this._private.cy || this; return a.styleEnabled() ? this.animate({ delay: r, duration: r, complete: n }) : this; }; }, // delay delayAnimation: function() { return function(r, n) { var a = this._private.cy || this; return a.styleEnabled() ? this.animation({ delay: r, duration: r, complete: n }) : this; }; }, // delay animation: function() { return function(r, n) { var a = this, i = a.length !== void 0, o = i ? a : [a], s = this._private.cy || this, u = !i, l = !u; if (!s.styleEnabled()) return this; var c = s.style(); r = Re({}, r, n); var d = Object.keys(r).length === 0; if (d) return new cu(o[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 (l && (r.style = c.getPropsList(r.style || r.css), r.css = void 0), l && r.renderedPosition != null) { var v = r.renderedPosition, h = s.pan(), f = s.zoom(); r.position = dp(v, f, h); } if (u && r.panBy != null) { var p = r.panBy, m = s.pan(); r.pan = { x: m.x + p.x, y: m.y + p.y }; } var g = r.center || r.centre; if (u && g != null) { var y = s.getCenterPan(g.eles, r.zoom); y != null && (r.pan = y); } if (u && r.fit != null) { var b = r.fit, w = s.getFitViewport(b.eles || b.boundingBox, b.padding); w != null && (r.pan = w.pan, r.zoom = w.zoom); } if (u && Xe(r.zoom)) { var C = s.getZoomedViewport(r.zoom); C != null ? (C.zoomed && (r.zoom = C.zoom), C.panned && (r.pan = C.pan)) : r.zoom = null; } return new cu(o[0], r); }; }, // animate animate: function() { return function(r, n) { var a = this, i = a.length !== void 0, o = i ? a : [a], s = this._private.cy || this; if (!s.styleEnabled()) return this; n && (r = Re({}, r, n)); for (var u = 0; u < o.length; u++) { var l = o[u], c = l.animated() && (r.queue === void 0 || r.queue), d = l.animation(r, c ? { queue: !0 } : void 0); d.play(); } return this; }; }, // animate stop: function() { return function(r, n) { var a = this, i = a.length !== void 0, o = i ? a : [a], s = this._private.cy || this; if (!s.styleEnabled()) return this; for (var u = 0; u < o.length; u++) { for (var l = o[u], c = l._private, d = c.animation.current, v = 0; v < d.length; v++) { var h = d[v], f = h._private; n && (f.duration = 0); } r && (c.animation.queue = []), n || (c.animation.current = []); } return s.notify("draw"), this; }; } // stop }, J4 = Array.isArray, il = J4, e3 = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, t3 = /^\w*$/; function r3(t, e) { if (il(t)) return !1; var r = typeof t; return r == "number" || r == "symbol" || r == "boolean" || t == null || Po(t) ? !0 : t3.test(t) || !e3.test(t) || e != null && t in Object(e); } var n3 = r3, a3 = "[object AsyncFunction]", i3 = "[object Function]", o3 = "[object GeneratorFunction]", s3 = "[object Proxy]"; function l3(t) { if (!ga(t)) return !1; var e = rp(t); return e == i3 || e == o3 || e == a3 || e == s3; } var u3 = l3, c3 = el["__core-js_shared__"], $l = c3, Tf = function() { var t = /[^.]+$/.exec($l && $l.keys && $l.keys.IE_PROTO || ""); return t ? "Symbol(src)_1." + t : ""; }(); function d3(t) { return !!Tf && Tf in t; } var f3 = d3, v3 = Function.prototype, h3 = v3.toString; function p3(t) { if (t != null) { try { return h3.call(t); } catch { } try { return t + ""; } catch { } } return ""; } var g3 = p3, m3 = /[\\^$.*+?()[\]{}|]/g, y3 = /^\[object .+?Constructor\]$/, b3 = Function.prototype, w3 = Object.prototype, x3 = b3.toString, C3 = w3.hasOwnProperty, E3 = RegExp( "^" + x3.call(C3).replace(m3, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$" ); function k3(t) { if (!ga(t) || f3(t)) return !1; var e = u3(t) ? E3 : y3; return e.test(g3(t)); } var S3 = k3; function T3(t, e) { return t == null ? void 0 : t[e]; } var _3 = T3; function D3(t, e) { var r = _3(t, e); return S3(r) ? r : void 0; } var gc = D3, P3 = gc(Object, "create"), so = P3; function O3() { this.__data__ = so ? so(null) : {}, this.size = 0; } var L3 = O3; function I3(t) { var e = this.has(t) && delete this.__data__[t]; return this.size -= e ? 1 : 0, e; } var F3 = I3, A3 = "__lodash_hash_undefined__", M3 = Object.prototype, B3 = M3.hasOwnProperty; function N3(t) { var e = this.__data__; if (so) { var r = e[t]; return r === A3 ? void 0 : r; } return B3.call(e, t) ? e[t] : void 0; } var $3 = N3, R3 = Object.prototype, z3 = R3.hasOwnProperty; function V3(t) { var e = this.__data__; return so ? e[t] !== void 0 : z3.call(e, t); } var H3 = V3, q3 = "__lodash_hash_undefined__"; function K3(t, e) { var r = this.__data__; return this.size += this.has(t) ? 0 : 1, r[t] = so && e === void 0 ? q3 : e, this; } var U3 = K3; function pi(t) { var e = -1, r = t == null ? 0 : t.length; for (this.clear(); ++e < r; ) { var n = t[e]; this.set(n[0], n[1]); } } pi.prototype.clear = L3; pi.prototype.delete = F3; pi.prototype.get = $3; pi.prototype.has = H3; pi.prototype.set = U3; var _f = pi; function G3() { this.__data__ = [], this.size = 0; } var W3 = G3; function Y3(t, e) { return t === e || t !== t && e !== e; } var _p = Y3; function Z3(t, e) { for (var r = t.length; r--; ) if (_p(t[r][0], e)) return r; return -1; } var ol = Z3, X3 = Array.prototype, j3 = X3.splice; function Q3(t) { var e = this.__data__, r = ol(e, t); if (r < 0) return !1; var n = e.length - 1; return r == n ? e.pop() : j3.call(e, r, 1), --this.size, !0; } var J3 = Q3; function e_(t) { var e = this.__data__, r = ol(e, t); return r < 0 ? void 0 : e[r][1]; } var t_ = e_; function r_(t) { return ol(this.__data__, t) > -1; } var n_ = r_; function a_(t, e) { var r = this.__data__, n = ol(r, t); return n < 0 ? (++this.size, r.push([t, e])) : r[n][1] = e, this; } var i_ = a_; function gi(t) { var e = -1, r = t == null ? 0 : t.length; for (this.clear(); ++e < r; ) { var n = t[e]; this.set(n[0], n[1]); } } gi.prototype.clear = W3; gi.prototype.delete = J3; gi.prototype.get = t_; gi.prototype.has = n_; gi.prototype.set = i_; var o_ = gi, s_ = gc(el, "Map"), l_ = s_; function u_() { this.size = 0, this.__data__ = { hash: new _f(), map: new (l_ || o_)(), string: new _f() }; } var c_ = u_; function d_(t) { var e = typeof t; return e == "string" || e == "number" || e == "symbol" || e == "boolean" ? t !== "__proto__" : t === null; } var f_ = d_; function v_(t, e) { var r = t.__data__; return f_(e) ? r[typeof e == "string" ? "string" : "hash"] : r.map; } var sl = v_; function h_(t) { var e = sl(this, t).delete(t); return this.size -= e ? 1 : 0, e; } var p_ = h_; function g_(t) { return sl(this, t).get(t); } var m_ = g_; function y_(t) { return sl(this, t).has(t); } var b_ = y_; function w_(t, e) { var r = sl(this, t), n = r.size; return r.set(t, e), this.size += r.size == n ? 0 : 1, this; } var x_ = w_; function mi(t) { var e = -1, r = t == null ? 0 : t.length; for (this.clear(); ++e < r; ) { var n = t[e]; this.set(n[0], n[1]); } } mi.prototype.clear = c_; mi.prototype.delete = p_; mi.prototype.get = m_; mi.prototype.has = b_; mi.prototype.set = x_; var Dp = mi, C_ = "Expected a function"; function mc(t, e) { if (typeof t != "function" || e != null && typeof e != "function") throw new TypeError(C_); var r = function() { var n = arguments, a = e ? e.apply(this, n) : n[0], i = r.cache; if (i.has(a)) return i.get(a); var o = t.apply(this, n); return r.cache = i.set(a, o) || i, o; }; return r.cache = new (mc.Cache || Dp)(), r; } mc.Cache = Dp; var E_ = mc, k_ = 500; function S_(t) { var e = E_(t, function(n) { return r.size === k_ && r.clear(), n; }), r = e.cache; return e; } var T_ = S_, __ = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g, D_ = /\\(\\)?/g, P_ = T_(function(t) { var e = []; return t.charCodeAt(0) === 46 && e.push(""), t.replace(__, function(r, n, a, i) { e.push(a ? i.replace(D_, "$1") : n || r); }), e; }), Pp = P_; function O_(t, e) { for (var r = -1, n = t == null ? 0 : t.length, a = Array(n); ++r < n; ) a[r] = e(t[r], r, t); return a; } var Op = O_, L_ = 1 / 0, Df = ii ? ii.prototype : void 0, Pf = Df ? Df.toString : void 0; function Lp(t) { if (typeof t == "string") return t; if (il(t)) return Op(t, Lp) + ""; if (Po(t)) return Pf ? Pf.call(t) : ""; var e = t + ""; return e == "0" && 1 / t == -L_ ? "-0" : e; } var I_ = Lp; function F_(t) { return t == null ? "" : I_(t); } var Ip = F_; function A_(t, e) { return il(t) ? t : n3(t, e) ? [t] : Pp(Ip(t)); } var Fp = A_, M_ = 1 / 0; function B_(t) { if (typeof t == "string" || Po(t)) return t; var e = t + ""; return e == "0" && 1 / t == -M_ ? "-0" : e; } var yc = B_; function N_(t, e) { e = Fp(e, t); for (var r = 0, n = e.length; t != null && r < n; ) t = t[yc(e[r++])]; return r && r == n ? t : void 0; } var $_ = N_; function R_(t, e, r) { var n = t == null ? void 0 : $_(t, e); return n === void 0 ? r : n; } var z_ = R_, V_ = function() { try { var t = gc(Object, "defineProperty"); return t({}, "", {}), t; } catch { } }(), Of = V_; function H_(t, e, r) { e == "__proto__" && Of ? Of(t, e, { configurable: !0, enumerable: !0, value: r, writable: !0 }) : t[e] = r; } var q_ = H_, K_ = Object.prototype, U_ = K_.hasOwnProperty; function G_(t, e, r) { var n = t[e]; (!(U_.call(t, e) && _p(n, r)) || r === void 0 && !(e in t)) && q_(t, e, r); } var W_ = G_, Y_ = 9007199254740991, Z_ = /^(?:0|[1-9]\d*)$/; function X_(t, e) { var r = typeof t; return e = e ?? Y_, !!e && (r == "number" || r != "symbol" && Z_.test(t)) && t > -1 && t % 1 == 0 && t < e; } var j_ = X_; function Q_(t, e, r, n) { if (!ga(t)) return t; e = Fp(e, t); for (var a = -1, i = e.length, o = i - 1, s = t; s != null && ++a < i; ) { var u = yc(e[a]), l = r; if (u === "__proto__" || u === "constructor" || u === "prototype") return t; if (a != o) { var c = s[u]; l = n ? n(c, u, s) : void 0, l === void 0 && (l = ga(c) ? c : j_(e[a + 1]) ? [] : {}); } W_(s, u, l), s = s[u]; } return t; } var J_ = Q_; function eD(t, e, r) { return t == null ? t : J_(t, e, r); } var tD = eD; function rD(t, e) { var r = -1, n = t.length; for (e || (e = Array(n)); ++r < n; ) e[r] = t[r]; return e; } var nD = rD; function aD(t) { return il(t) ? Op(t, yc) : Po(t) ? [t] : nD(Pp(Ip(t))); } var iD = aD, oD = { // access data field data: function(e) { var r = { field: "data", bindingEvent: "data", allowBinding: !1, allowSetting: !1, allowGetting: !1, settingEvent: "data", settingTriggersEvent: !1, triggerFnName: "trigger", immutableKeys: {}, // key => true if immutable updateStyle: !1, beforeGet: function(a) { }, beforeSet: function(a, i) { }, onSet: function(a) { }, canSet: function(a) { return !0; } }; return e = Re({}, r, e), function(a, i) { var o = e, s = this, u = s.length !== void 0, l = u ? s : [s], c = u ? s[0] : s; if (Fe(a)) { var d = a.indexOf(".") !== -1, v = d && iD(a); if (o.allowGetting && i === void 0) { var h; return c && (o.beforeGet(c), v && c._private[o.field][a] === void 0 ? h = z_(c._private[o.field], v) : h = c._private[o.field][a]), h; } else if (o.allowSetting && i !== void 0) { var f = !o.immutableKeys[a]; if (f) { var p = Uh({}, a, i); o.beforeSet(s, p); for (var m = 0, g = l.length; m < g; m++) { var y = l[m]; o.canSet(y) && (v && c._private[o.field][a] === void 0 ? tD(y._private[o.field], v, i) : y._private[o.field][a] = i); } o.updateStyle && s.updateStyle(), o.onSet(s), o.settingTriggersEvent && s[o.triggerFnName](o.settingEvent); } } } else if (o.allowSetting && Xe(a)) { var b = a, w, C, E = Object.keys(b); o.beforeSet(s, b); for (var x = 0; x < E.length; x++) { w = E[x], C = b[w]; var T = !o.immutableKeys[w]; if (T) for (var k = 0; k < l.length; k++) { var _ = l[k]; o.canSet(_) && (_._private[o.field][w] = C); } } o.updateStyle && s.updateStyle(), o.onSet(s), o.settingTriggersEvent && s[o.triggerFnName](o.settingEvent); } else if (o.allowBinding && pt(a)) { var D = a; s.on(o.bindingEvent, D); } else if (o.allowGetting && a === void 0) { var O; return c && (o.beforeGet(c), O = c._private[o.field]), O; } return s; }; }, // data // remove data field removeData: function(e) { var r = { field: "data", event: "data", triggerFnName: "trigger", triggerEvent: !1, immutableKeys: {} // key => true if immutable }; return e = Re({}, r, e), function(a) { var i = e, o = this, s = o.length !== void 0, u = s ? o : [o]; if (Fe(a)) { for (var l = a.split(/\s+/), c = l.length, d = 0; d < c; d++) { var v = l[d]; if (!qn(v)) { var h = !i.immutableKeys[v]; if (h) for (var f = 0, p = u.length; f < p; f++) u[f]._private[i.field][v] = void 0; } } i.triggerEvent && o[i.triggerFnName](i.event); } else if (a === void 0) { for (var m = 0, g = u.length; m < g; m++) for (var y = u[m]._private[i.field], b = Object.keys(y), w = 0; w < b.length; w++) { var C = b[w], E = !i.immutableKeys[C]; E && (y[C] = void 0); } i.triggerEvent && o[i.triggerFnName](i.event); } return o; }; } // removeData }, sD = { 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, o = Array.prototype.slice.call(arguments, 0); return new hi(function(s, u) { var l = function(h) { i.off.apply(i, d), s(h); }, c = o.concat([l]), d = c.concat([]); i.on.apply(i, c); }); }; } }, et = {}; [Q4, oD, sD].forEach(function(t) { Re(et, t); }); var lD = { animate: et.animate(), animation: et.animation(), animated: et.animated(), clearQueue: et.clearQueue(), delay: et.delay(), delayAnimation: et.delayAnimation(), stop: et.stop() }, ds = { classes: function(e) { var r = this; if (e === void 0) { var n = []; return r[0]._private.classes.forEach(function(f) { return n.push(f); }), n; } else st(e) || (e = (e || "").match(/\S+/g) || []); for (var a = [], i = new vi(e), o = 0; o < r.length; o++) { for (var s = r[o], u = s._private, l = u.classes, c = !1, d = 0; d < e.length; d++) { var v = e[d], h = l.has(v); if (!h) { c = !0; break; } } c || (c = l.size !== e.length), c && (u.classes = i, a.push(s)); } 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) { st(e) || (e = e.match(/\S+/g) || []); for (var n = this, a = r === void 0, i = [], o = 0, s = n.length; o < s; o++) for (var u = n[o], l = u._private.classes, c = !1, d = 0; d < e.length; d++) { var v = e[d], h = l.has(v), f = !1; r || a && !h ? (l.add(v), f = !0) : (!r || a && h) && (l.delete(v), f = !0), !c && f && (i.push(u), 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; } }; ds.className = ds.classNames = ds.classes; var Ye = { metaChar: "[\\!\\\"\\#\\$\\%\\&\\'\\(\\)\\*\\+\\,\\.\\/\\:\\;\\<\\=\\>\\?\\@\\[\\]\\^\\`\\{\\|\\}\\~]", // chars we need to escape in let names, etc comparatorOp: "=|\\!=|>|>=|<|<=|\\$=|\\^=|\\*=", // binary comparison op (used in data selectors) boolOp: "\\?|\\!|\\^", // boolean (unary) operators (used in data selectors) string: `"(?:\\\\"|[^"])*"|'(?:\\\\'|[^'])*'`, // string literals (used in data selectors) -- doublequotes | singlequotes number: It, // number literal (used in data selectors) --- e.g. 0.1234, 1234, 12e123 meta: "degree|indegree|outdegree", // allowed metadata fields (i.e. allowed functions to use from Collection) separator: "\\s*,\\s*", // queries are separated by commas, e.g. edge[foo = 'bar'], node.someClass descendant: "\\s+", child: "\\s+>\\s+", subject: "\\$", group: "node|edge|\\*", directedEdge: "\\s+->\\s+", undirectedEdge: "\\s+<->\\s+" }; Ye.variable = "(?:[\\w-.]|(?:\\\\" + Ye.metaChar + "))+"; Ye.className = "(?:[\\w-]|(?:\\\\" + Ye.metaChar + "))+"; Ye.value = Ye.string + "|" + Ye.number; Ye.id = Ye.variable; (function() { var t, e, r; for (t = Ye.comparatorOp.split("|"), r = 0; r < t.length; r++) e = t[r], Ye.comparatorOp += "|@" + e; for (t = Ye.comparatorOp.split("|"), r = 0; r < t.length; r++) e = t[r], !(e.indexOf("!") >= 0) && e !== "=" && (Ye.comparatorOp += "|\\!" + e); })(); var it = function() { return { checks: [] }; }, Se = { /** E.g. node */ GROUP: 0, /** A collection of elements */ COLLECTION: 1, /** A filter(ele) function */ FILTER: 2, /** E.g. [foo > 1] */ DATA_COMPARE: 3, /** E.g. [foo] */ DATA_EXIST: 4, /** E.g. [?foo] */ DATA_BOOL: 5, /** E.g. [[degree > 2]] */ META_COMPARE: 6, /** E.g. :selected */ STATE: 7, /** E.g. #foo */ ID: 8, /** E.g. .foo */ CLASS: 9, /** E.g. #foo <-> #bar */ UNDIRECTED_EDGE: 10, /** E.g. #foo -> #bar */ DIRECTED_EDGE: 11, /** E.g. $#foo -> #bar */ NODE_SOURCE: 12, /** E.g. #foo -> $#bar */ NODE_TARGET: 13, /** E.g. $#foo <-> #bar */ NODE_NEIGHBOR: 14, /** E.g. #foo > #bar */ CHILD: 15, /** E.g. #foo #bar */ DESCENDANT: 16, /** E.g. $#foo > #bar */ PARENT: 17, /** E.g. $#foo #bar */ ANCESTOR: 18, /** E.g. #foo > $bar > #baz */ COMPOUND_SPLIT: 19, /** Always matches, useful placeholder for subject in `COMPOUND_SPLIT` */ TRUE: 20 }, du = [{ 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 wT(t.selector, e.selector); }), uD = function() { for (var t = {}, e, r = 0; r < du.length; r++) e = du[r], t[e.selector] = e.matches; return t; }(), cD = function(e, r) { return uD[e](r); }, dD = "(" + du.map(function(t) { return t.selector; }).join("|") + ")", Fa = function(e) { return e.replace(new RegExp("\\\\(" + Ye.metaChar + ")", "g"), function(r, n) { return n; }); }, Pn = function(e, r, n) { e[e.length - 1] = n; }, fu = [{ name: "group", // just used for identifying when debugging query: !0, regex: "(" + Ye.group + ")", populate: function(e, r, n) { var a = Mr(n, 1), i = a[0]; r.checks.push({ type: Se.GROUP, value: i === "*" ? i : i + "s" }); } }, { name: "state", query: !0, regex: dD, populate: function(e, r, n) { var a = Mr(n, 1), i = a[0]; r.checks.push({ type: Se.STATE, value: i }); } }, { name: "id", query: !0, regex: "\\#(" + Ye.id + ")", populate: function(e, r, n) { var a = Mr(n, 1), i = a[0]; r.checks.push({ type: Se.ID, value: Fa(i) }); } }, { name: "className", query: !0, regex: "\\.(" + Ye.className + ")", populate: function(e, r, n) { var a = Mr(n, 1), i = a[0]; r.checks.push({ type: Se.CLASS, value: Fa(i) }); } }, { name: "dataExists", query: !0, regex: "\\[\\s*(" + Ye.variable + ")\\s*\\]", populate: function(e, r, n) { var a = Mr(n, 1), i = a[0]; r.checks.push({ type: Se.DATA_EXIST, field: Fa(i) }); } }, { name: "dataCompare", query: !0, regex: "\\[\\s*(" + Ye.variable + ")\\s*(" + Ye.comparatorOp + ")\\s*(" + Ye.value + ")\\s*\\]", populate: function(e, r, n) { var a = Mr(n, 3), i = a[0], o = a[1], s = a[2], u = new RegExp("^" + Ye.string + "$").exec(s) != null; u ? s = s.substring(1, s.length - 1) : s = parseFloat(s), r.checks.push({ type: Se.DATA_COMPARE, field: Fa(i), operator: o, value: s }); } }, { name: "dataBool", query: !0, regex: "\\[\\s*(" + Ye.boolOp + ")\\s*(" + Ye.variable + ")\\s*\\]", populate: function(e, r, n) { var a = Mr(n, 2), i = a[0], o = a[1]; r.checks.push({ type: Se.DATA_BOOL, field: Fa(o), operator: i }); } }, { name: "metaCompare", query: !0, regex: "\\[\\[\\s*(" + Ye.meta + ")\\s*(" + Ye.comparatorOp + ")\\s*(" + Ye.number + ")\\s*\\]\\]", populate: function(e, r, n) { var a = Mr(n, 3), i = a[0], o = a[1], s = a[2]; r.checks.push({ type: Se.META_COMPARE, field: Fa(i), operator: o, value: parseFloat(s) }); } }, { name: "nextQuery", separator: !0, regex: Ye.separator, populate: function(e, r) { var n = e.currentSubject, a = e.edgeCount, i = e.compoundCount, o = e[e.length - 1]; n != null && (o.subject = n, e.currentSubject = null), o.edgeCount = a, o.compoundCount = i, e.edgeCount = 0, e.compoundCount = 0; var s = e[e.length++] = it(); return s; } }, { name: "directedEdge", separator: !0, regex: Ye.directedEdge, populate: function(e, r) { if (e.currentSubject == null) { var n = it(), a = r, i = it(); return n.checks.push({ type: Se.DIRECTED_EDGE, source: a, target: i }), Pn(e, r, n), e.edgeCount++, i; } else { var o = it(), s = r, u = it(); return o.checks.push({ type: Se.NODE_SOURCE, source: s, target: u }), Pn(e, r, o), e.edgeCount++, u; } } }, { name: "undirectedEdge", separator: !0, regex: Ye.undirectedEdge, populate: function(e, r) { if (e.currentSubject == null) { var n = it(), a = r, i = it(); return n.checks.push({ type: Se.UNDIRECTED_EDGE, nodes: [a, i] }), Pn(e, r, n), e.edgeCount++, i; } else { var o = it(), s = r, u = it(); return o.checks.push({ type: Se.NODE_NEIGHBOR, node: s, neighbor: u }), Pn(e, r, o), u; } } }, { name: "child", separator: !0, regex: Ye.child, populate: function(e, r) { if (e.currentSubject == null) { var n = it(), a = it(), i = e[e.length - 1]; return n.checks.push({ type: Se.CHILD, parent: i, child: a }), Pn(e, r, n), e.compoundCount++, a; } else if (e.currentSubject === r) { var o = it(), s = e[e.length - 1], u = it(), l = it(), c = it(), d = it(); return o.checks.push({ type: Se.COMPOUND_SPLIT, left: s, right: u, subject: l }), l.checks = r.checks, r.checks = [{ type: Se.TRUE }], d.checks.push({ type: Se.TRUE }), u.checks.push({ type: Se.PARENT, // type is swapped on right side queries parent: d, child: c // empty for now }), Pn(e, s, o), e.currentSubject = l, e.compoundCount++, c; } else { var v = it(), h = it(), f = [{ type: Se.PARENT, parent: v, child: h }]; return v.checks = r.checks, r.checks = f, e.compoundCount++, h; } } }, { name: "descendant", separator: !0, regex: Ye.descendant, populate: function(e, r) { if (e.currentSubject == null) { var n = it(), a = it(), i = e[e.length - 1]; return n.checks.push({ type: Se.DESCENDANT, ancestor: i, descendant: a }), Pn(e, r, n), e.compoundCount++, a; } else if (e.currentSubject === r) { var o = it(), s = e[e.length - 1], u = it(), l = it(), c = it(), d = it(); return o.checks.push({ type: Se.COMPOUND_SPLIT, left: s, right: u, subject: l }), l.checks = r.checks, r.checks = [{ type: Se.TRUE }], d.checks.push({ type: Se.TRUE }), u.checks.push({ type: Se.ANCESTOR, // type is swapped on right side queries ancestor: d, descendant: c // empty for now }), Pn(e, s, o), e.currentSubject = l, e.compoundCount++, c; } else { var v = it(), h = it(), f = [{ type: Se.ANCESTOR, ancestor: v, descendant: h }]; return v.checks = r.checks, r.checks = f, e.compoundCount++, h; } } }, { name: "subject", modifier: !0, regex: Ye.subject, populate: function(e, r) { if (e.currentSubject != null && e.currentSubject !== r) return tt("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 === Se.DIRECTED_EDGE ? a.type = Se.NODE_TARGET : i === Se.UNDIRECTED_EDGE && (a.type = Se.NODE_NEIGHBOR, a.node = a.nodes[1], a.neighbor = a.nodes[0], a.nodes = null); } }]; fu.forEach(function(t) { return t.regexObj = new RegExp("^" + t.regex); }); var fD = function(e) { for (var r, n, a, i = 0; i < fu.length; i++) { var o = fu[i], s = o.name, u = e.match(o.regexObj); if (u != null) { n = u, r = o, a = s; var l = u[0]; e = e.substring(l.length); break; } } return { expr: r, match: n, name: a, remaining: e }; }, vD = function(e) { var r = e.match(/^\s+/); if (r) { var n = r[0]; e = e.substring(n.length); } return e; }, hD = function(e) { var r = this, n = r.inputText = e, a = r[0] = it(); for (r.length = 1, n = vD(n); ; ) { var i = fD(n); if (i.expr == null) return tt("The selector `" + e + "`is invalid"), !1; var o = i.match.slice(1), s = i.expr.populate(r, a, o); if (s === !1) return !1; if (s != null && (a = s), n = i.remaining, n.match(/^\s*$/)) break; } var u = r[r.length - 1]; r.currentSubject != null && (u.subject = r.currentSubject), u.edgeCount = r.edgeCount, u.compoundCount = r.compoundCount; for (var l = 0; l < r.length; l++) { var c = r[l]; if (c.compoundCount > 0 && c.edgeCount > 0) return tt("The selector `" + e + "` is invalid because it uses both a compound selector and an edge selector"), !1; if (c.edgeCount > 1) return tt("The selector `" + e + "` is invalid because it uses multiple edge selectors"), !1; c.edgeCount === 1 && tt("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; }, pD = function() { if (this.toStringCache != null) return this.toStringCache; for (var e = function(c) { return c ?? ""; }, r = function(c) { return Fe(c) ? '"' + c + '"' : e(c); }, n = function(c) { return " " + c + " "; }, a = function(c, d) { var v = c.type, h = c.value; switch (v) { case Se.GROUP: { var f = e(h); return f.substring(0, f.length - 1); } case Se.DATA_COMPARE: { var p = c.field, m = c.operator; return "[" + p + n(e(m)) + r(h) + "]"; } case Se.DATA_BOOL: { var g = c.operator, y = c.field; return "[" + e(g) + y + "]"; } case Se.DATA_EXIST: { var b = c.field; return "[" + b + "]"; } case Se.META_COMPARE: { var w = c.operator, C = c.field; return "[[" + C + n(e(w)) + r(h) + "]]"; } case Se.STATE: return h; case Se.ID: return "#" + h; case Se.CLASS: return "." + h; case Se.PARENT: case Se.CHILD: return i(c.parent, d) + n(">") + i(c.child, d); case Se.ANCESTOR: case Se.DESCENDANT: return i(c.ancestor, d) + " " + i(c.descendant, d); case Se.COMPOUND_SPLIT: { var E = i(c.left, d), x = i(c.subject, d), T = i(c.right, d); return E + (E.length > 0 ? " " : "") + x + T; } case Se.TRUE: return ""; } }, i = function(c, d) { return c.checks.reduce(function(v, h, f) { return v + (d === c && f === 0 ? "$" : "") + a(h, d); }, ""); }, o = "", s = 0; s < this.length; s++) { var u = this[s]; o += i(u, u.subject), this.length > 1 && s < this.length - 1 && (o += ", "); } return this.toStringCache = o, o; }, gD = { parse: hD, toString: pD }, Ap = function(e, r, n) { var a, i = Fe(e), o = be(e), s = Fe(n), u, l, c = !1, d = !1, v = !1; switch (r.indexOf("!") >= 0 && (r = r.replace("!", ""), d = !0), r.indexOf("@") >= 0 && (r = r.replace("@", ""), c = !0), (i || s || c) && (u = !i && !o ? "" : "" + e, l = "" + n), c && (e = u = u.toLowerCase(), n = l = l.toLowerCase()), r) { case "*=": a = u.indexOf(l) >= 0; break; case "$=": a = u.indexOf(l, u.length - l.length) >= 0; break; case "^=": a = u.indexOf(l) === 0; break; case "=": a = e === n; break; case ">": v = !0, a = e > n; break; case ">=": v = !0, a = e >= n; break; case "<": v = !0, a = e < n; break; case "<=": v = !0, a = e <= n; break; default: a = !1; break; } return d && (e != null || !v) && (a = !a), a; }, mD = function(e, r) { switch (r) { case "?": return !!e; case "!": return !e; case "^": return e === void 0; } }, yD = function(e) { return e !== void 0; }, bc = function(e, r) { return e.data(r); }, bD = function(e, r) { return e[r](); }, bt = [], vt = function(e, r) { return e.checks.every(function(n) { return bt[n.type](n, r); }); }; bt[Se.GROUP] = function(t, e) { var r = t.value; return r === "*" || r === e.group(); }; bt[Se.STATE] = function(t, e) { var r = t.value; return cD(r, e); }; bt[Se.ID] = function(t, e) { var r = t.value; return e.id() === r; }; bt[Se.CLASS] = function(t, e) { var r = t.value; return e.hasClass(r); }; bt[Se.META_COMPARE] = function(t, e) { var r = t.field, n = t.operator, a = t.value; return Ap(bD(e, r), n, a); }; bt[Se.DATA_COMPARE] = function(t, e) { var r = t.field, n = t.operator, a = t.value; return Ap(bc(e, r), n, a); }; bt[Se.DATA_BOOL] = function(t, e) { var r = t.field, n = t.operator; return mD(bc(e, r), n); }; bt[Se.DATA_EXIST] = function(t, e) { var r = t.field; return t.operator, yD(bc(e, r)); }; bt[Se.UNDIRECTED_EDGE] = function(t, e) { var r = t.nodes[0], n = t.nodes[1], a = e.source(), i = e.target(); return vt(r, a) && vt(n, i) || vt(n, a) && vt(r, i); }; bt[Se.NODE_NEIGHBOR] = function(t, e) { return vt(t.node, e) && e.neighborhood().some(function(r) { return r.isNode() && vt(t.neighbor, r); }); }; bt[Se.DIRECTED_EDGE] = function(t, e) { return vt(t.source, e.source()) && vt(t.target, e.target()); }; bt[Se.NODE_SOURCE] = function(t, e) { return vt(t.source, e) && e.outgoers().some(function(r) { return r.isNode() && vt(t.target, r); }); }; bt[Se.NODE_TARGET] = function(t, e) { return vt(t.target, e) && e.incomers().some(function(r) { return r.isNode() && vt(t.source, r); }); }; bt[Se.CHILD] = function(t, e) { return vt(t.child, e) && vt(t.parent, e.parent()); }; bt[Se.PARENT] = function(t, e) { return vt(t.parent, e) && e.children().some(function(r) { return vt(t.child, r); }); }; bt[Se.DESCENDANT] = function(t, e) { return vt(t.descendant, e) && e.ancestors().some(function(r) { return vt(t.ancestor, r); }); }; bt[Se.ANCESTOR] = function(t, e) { return vt(t.ancestor, e) && e.descendants().some(function(r) { return vt(t.descendant, r); }); }; bt[Se.COMPOUND_SPLIT] = function(t, e) { return vt(t.subject, e) && vt(t.left, e) && vt(t.right, e); }; bt[Se.TRUE] = function() { return !0; }; bt[Se.COLLECTION] = function(t, e) { var r = t.value; return r.has(e); }; bt[Se.FILTER] = function(t, e) { var r = t.value; return r(e); }; var wD = function(e) { var r = this; if (r.length === 1 && r[0].checks.length === 1 && r[0].checks[0].type === Se.ID) return e.getElementById(r[0].checks[0].value).collection(); var n = function(i) { for (var o = 0; o < r.length; o++) { var s = r[o]; if (vt(s, i)) return !0; } return !1; }; return r.text() == null && (n = function() { return !0; }), e.filter(n); }, xD = function(e) { for (var r = this, n = 0; n < r.length; n++) { var a = r[n]; if (vt(a, e)) return !0; } return !1; }, CD = { matches: xD, filter: wD }, Un = function(e) { this.inputText = e, this.currentSubject = null, this.compoundCount = 0, this.edgeCount = 0, this.length = 0, e == null || Fe(e) && e.match(/^\s*$/) || (yr(e) ? this.addQuery({ checks: [{ type: Se.COLLECTION, value: e.collection() }] }) : pt(e) ? this.addQuery({ checks: [{ type: Se.FILTER, value: e }] }) : Fe(e) ? this.parse(e) || (this.invalid = !0) : yt("A selector must be created from a string; found ")); }, Gn = Un.prototype; [gD, CD].forEach(function(t) { return Re(Gn, t); }); Gn.text = function() { return this.inputText; }; Gn.size = function() { return this.length; }; Gn.eq = function(t) { return this[t]; }; Gn.sameText = function(t) { return !this.invalid && !t.invalid && this.text() === t.text(); }; Gn.addQuery = function(t) { this[this.length++] = t; }; Gn.selector = Gn.toString; var Rn = { allAre: function(e) { var r = new Un(e); return this.every(function(n) { return r.matches(n); }); }, is: function(e) { var r = new Un(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()); }); } }; Rn.allAreNeighbours = Rn.allAreNeighbors; Rn.has = Rn.contains; Rn.equal = Rn.equals = Rn.same; var Sr = function(e, r) { return function(a, i, o, s) { var u = a, l = this, c; if (u == null ? c = "" : yr(u) && u.length === 1 && (c = u.id()), l.length === 1 && c) { var d = l[0]._private, v = d.traversalCache = d.traversalCache || {}, h = v[r] = v[r] || [], f = ma(c), p = h[f]; return p || (h[f] = e.call(l, a, i, o, s)); } else return e.call(l, a, i, o, s); }; }, li = { 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], o = i._private.parent; o && r.push(o); } 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: Sr(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 o = a[i]; r.push(o), o.children().nonempty() && n(o.children()); } } return n(this.children()), this.spawn(r, !0).filter(e); } }; function wc(t, e, r, n) { for (var a = [], i = new vi(), o = t.cy(), s = o.hasCompoundNodes(), u = 0; u < t.length; u++) { var l = t[u]; r ? a.push(l) : s && n(a, i, l); } for (; a.length > 0; ) { var c = a.shift(); e(c), i.add(c.id()), s && n(a, i, c); } return t; } function Mp(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); } } li.forEachDown = function(t) { var e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !0; return wc(this, t, e, Mp); }; function Bp(t, e, r) { if (r.isChild()) { var n = r._private.parent; e.has(n.id()) || t.push(n); } } li.forEachUp = function(t) { var e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !0; return wc(this, t, e, Bp); }; function ED(t, e, r) { Bp(t, e, r), Mp(t, e, r); } li.forEachUpAndDown = function(t) { var e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !0; return wc(this, t, e, ED); }; li.ancestors = li.parents; var lo, Np; lo = Np = { data: et.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: et.removeData({ field: "data", event: "data", triggerFnName: "trigger", triggerEvent: !0, immutableKeys: { id: !0, source: !0, target: !0, parent: !0 }, updateStyle: !0 }), scratch: et.data({ field: "scratch", bindingEvent: "scratch", allowBinding: !0, allowSetting: !0, settingEvent: "scratch", settingTriggersEvent: !0, triggerFnName: "trigger", allowGetting: !0, updateStyle: !0 }), removeScratch: et.removeData({ field: "scratch", event: "scratch", triggerFnName: "trigger", triggerEvent: !0, updateStyle: !0 }), rscratch: et.data({ field: "rscratch", allowBinding: !1, allowSetting: !0, settingTriggersEvent: !1, allowGetting: !0 }), removeRscratch: et.removeData({ field: "rscratch", triggerEvent: !1 }), id: function() { var e = this[0]; if (e) return e._private.data.id; } }; lo.attr = lo.data; lo.removeAttr = lo.removeData; var kD = Np, ll = {}; function Rl(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, o = 0; o < i.length; o++) { var s = i[o]; !e && s.isLoop() || (n += t(a, s)); } return n; } else return; }; } Re(ll, { degree: Rl(function(t, e) { return e.source().same(e.target()) ? 2 : 1; }), indegree: Rl(function(t, e) { return e.target().same(t) ? 1 : 0; }), outdegree: Rl(function(t, e) { return e.source().same(t) ? 1 : 0; }) }); function Aa(t, e) { return function(r) { for (var n, a = this.nodes(), i = 0; i < a.length; i++) { var o = a[i], s = o[t](r); s !== void 0 && (n === void 0 || e(s, n)) && (n = s); } return n; }; } Re(ll, { minDegree: Aa("degree", function(t, e) { return t < e; }), maxDegree: Aa("degree", function(t, e) { return t > e; }), minIndegree: Aa("indegree", function(t, e) { return t < e; }), maxIndegree: Aa("indegree", function(t, e) { return t > e; }), minOutdegree: Aa("outdegree", function(t, e) { return t < e; }), maxOutdegree: Aa("outdegree", function(t, e) { return t > e; }) }); Re(ll, { totalDegree: function(e) { for (var r = 0, n = this.nodes(), a = 0; a < n.length; a++) r += n[a].degree(e); return r; } }); var zr, $p, Rp = function(e, r, n) { for (var a = 0; a < e.length; a++) { var i = e[a]; if (!i.locked()) { var o = i._private.position, s = { x: r.x != null ? r.x - o.x : 0, y: r.y != null ? r.y - o.y : 0 }; i.isParent() && !(s.x === 0 && s.y === 0) && i.children().shift(s, n), i.dirtyBoundingBoxCache(); } } }, Lf = { 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) { Rp(e, r, !1); }, onSet: function(e) { e.dirtyCompoundBoundsCache(); }, canSet: function(e) { return !e.locked(); } }; zr = $p = { position: et.data(Lf), // position but no notification to renderer silentPosition: et.data(Re({}, Lf, { allowBinding: !1, allowSetting: !0, settingTriggersEvent: !1, allowGetting: !1, beforeSet: function(e, r) { Rp(e, r, !0); }, onSet: function(e) { e.dirtyCompoundBoundsCache(); } })), positions: function(e, r) { if (Xe(e)) r ? this.silentPosition(e) : this.position(e); else if (pt(e)) { var n = e, a = this.cy(); a.startBatch(); for (var i = 0; i < this.length; i++) { var o = this[i], s = void 0; (s = n(o, i)) && (r ? o.silentPosition(s) : o.position(s)); } a.endBatch(); } return this; }, silentPositions: function(e) { return this.positions(e, !0); }, shift: function(e, r, n) { var a; if (Xe(e) ? (a = { x: be(e.x) ? e.x : 0, y: be(e.y) ? e.y : 0 }, n = r) : Fe(e) && be(r) && (a = { x: 0, y: 0 }, a[e] = r), a != null) { var i = this.cy(); i.startBatch(); for (var o = 0; o < this.length; o++) { var s = this[o]; if (!(i.hasCompoundNodes() && s.isChild() && s.ancestors().anySame(this))) { var u = s.position(), l = { x: u.x + a.x, y: u.y + a.y }; n ? s.silentPosition(l) : s.position(l); } } i.endBatch(); } return this; }, silentShift: function(e, r) { return Xe(e) ? this.shift(e, !0) : Fe(e) && be(r) && this.shift(e, r, !0), this; }, // get/set the rendered (i.e. on screen) positon of the element renderedPosition: function(e, r) { var n = this[0], a = this.cy(), i = a.zoom(), o = a.pan(), s = Xe(e) ? e : void 0, u = s !== void 0 || r !== void 0 && Fe(e); if (n && n.isNode()) if (u) for (var l = 0; l < this.length; l++) { var c = this[l]; r !== void 0 ? c.position(e, (r - o[e]) / i) : s !== void 0 && c.position(dp(s, i, o)); } else { var d = n.position(); return s = nl(d, i, o), e === void 0 ? s : s[e]; } else if (!u) return; return this; }, // get/set the position relative to the parent relativePosition: function(e, r) { var n = this[0], a = this.cy(), i = Xe(e) ? e : void 0, o = i !== void 0 || r !== void 0 && Fe(e), s = a.hasCompoundNodes(); if (n && n.isNode()) if (o) for (var u = 0; u < this.length; u++) { var l = this[u], c = s ? l.parent() : null, d = c && c.length > 0, v = d; d && (c = c[0]); var h = v ? c.position() : { x: 0, y: 0 }; r !== void 0 ? l.position(e, r + h[e]) : i !== void 0 && l.position({ x: i.x + h.x, y: i.y + h.y }); } else { var f = n.position(), p = s ? n.parent() : null, m = p && p.length > 0, g = m; m && (p = p[0]); var y = g ? p.position() : { x: 0, y: 0 }; return i = { x: f.x - y.x, y: f.y - y.y }, e === void 0 ? i : i[e]; } else if (!o) return; return this; } }; zr.modelPosition = zr.point = zr.position; zr.modelPositions = zr.points = zr.positions; zr.renderedPoint = zr.renderedPosition; zr.relativePoint = zr.relativePosition; var SD = $p, Za, Xn; Za = Xn = {}; Xn.renderedBoundingBox = function(t) { var e = this.boundingBox(t), r = this.cy(), n = r.zoom(), a = r.pan(), i = e.x1 * n + a.x, o = e.x2 * n + a.x, s = e.y1 * n + a.y, u = e.y2 * n + a.y; return { x1: i, x2: o, y1: s, y2: u, w: o - i, h: u - s }; }; Xn.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); }; Xn.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(o) { if (!o.isParent()) return; var s = o._private, u = o.children(), l = o.pstyle("compound-sizing-wrt-labels").value === "include", c = { width: { val: o.pstyle("min-width").pfValue, left: o.pstyle("min-width-bias-left"), right: o.pstyle("min-width-bias-right") }, height: { val: o.pstyle("min-height").pfValue, top: o.pstyle("min-height-bias-top"), bottom: o.pstyle("min-height-bias-bottom") } }, d = u.boundingBox({ includeLabels: l, includeOverlays: !1, // updating the compound bounds happens outside of the regular // cache cycle (i.e. before fired events) useCache: !1 }), v = s.position; (d.w === 0 || d.h === 0) && (d = { w: o.pstyle("width").pfValue, h: o.pstyle("height").pfValue }, d.x1 = v.x - d.w / 2, d.x2 = v.x + d.w / 2, d.y1 = v.y - d.h / 2, d.y2 = v.y + d.h / 2); function h(k, _, D) { var O = 0, F = 0, L = _ + D; return k > 0 && L > 0 && (O = _ / L * k, F = D / L * k), { biasDiff: O, biasComplementDiff: F }; } function f(k, _, D, O) { if (D.units === "%") switch (O) { case "width": return k > 0 ? D.pfValue * k : 0; case "height": return _ > 0 ? D.pfValue * _ : 0; case "average": return k > 0 && _ > 0 ? D.pfValue * (k + _) / 2 : 0; case "min": return k > 0 && _ > 0 ? k > _ ? D.pfValue * _ : D.pfValue * k : 0; case "max": return k > 0 && _ > 0 ? k > _ ? D.pfValue * k : D.pfValue * _ : 0; default: return 0; } else return D.units === "px" ? D.pfValue : 0; } var p = c.width.left.value; c.width.left.units === "px" && c.width.val > 0 && (p = p * 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 y = c.height.bottom.value; c.height.bottom.units === "px" && c.height.val > 0 && (y = y * 100 / c.height.val); var b = h(c.width.val - d.w, p, m), w = b.biasDiff, C = b.biasComplementDiff, E = h(c.height.val - d.h, g, y), x = E.biasDiff, T = E.biasComplementDiff; s.autoPadding = f(d.w, d.h, o.pstyle("padding"), o.pstyle("padding-relative-to").value), s.autoWidth = Math.max(d.w, c.width.val), v.x = (-w + d.x1 + d.x2 + C) / 2, s.autoHeight = Math.max(d.h, c.height.val), v.y = (-x + 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 Er = function(e) { return e === 1 / 0 || e === -1 / 0 ? 0 : e; }, Br = 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); }, ra = function(e, r) { return r == null ? e : Br(e, r.x1, r.y1, r.x2, r.y2); }, Li = function(e, r, n) { return Nr(e, r, n); }, Qo = function(e, r, n) { if (!r.cy().headless()) { var a = r._private, i = a.rstyle, o = i.arrowWidth / 2, s = r.pstyle(n + "-arrow-shape").value, u, l; if (s !== "none") { n === "source" ? (u = i.srcX, l = i.srcY) : n === "target" ? (u = i.tgtX, l = i.tgtY) : (u = i.midX, l = i.midY); var c = a.arrowBounds = a.arrowBounds || {}, d = c[n] = c[n] || {}; d.x1 = u - o, d.y1 = l - o, d.x2 = u + o, d.y2 = l + o, d.w = d.x2 - d.x1, d.h = d.y2 - d.y1, us(d, 1), Br(e, d.x1, d.y1, d.x2, d.y2); } } }, zl = function(e, r, n) { if (!r.cy().headless()) { var a; n ? a = n + "-" : a = ""; var i = r._private, o = i.rstyle, s = r.pstyle(a + "label").strValue; if (s) { var u = r.pstyle("text-halign"), l = r.pstyle("text-valign"), c = Li(o, "labelWidth", n), d = Li(o, "labelHeight", n), v = Li(o, "labelX", n), h = Li(o, "labelY", n), f = r.pstyle(a + "text-margin-x").pfValue, p = r.pstyle(a + "text-margin-y").pfValue, m = r.isEdge(), g = r.pstyle(a + "text-rotation"), y = r.pstyle("text-outline-width").pfValue, b = r.pstyle("text-border-width").pfValue, w = b / 2, C = r.pstyle("text-background-padding").pfValue, E = 2, x = d, T = c, k = T / 2, _ = x / 2, D, O, F, L; if (m) D = v - k, O = v + k, F = h - _, L = h + _; else { switch (u.value) { case "left": D = v - T, O = v; break; case "center": D = v - k, O = v + k; break; case "right": D = v, O = v + T; break; } switch (l.value) { case "top": F = h - x, L = h; break; case "center": F = h - _, L = h + _; break; case "bottom": F = h, L = h + x; break; } } D += f - Math.max(y, w) - C - E, O += f + Math.max(y, w) + C + E, F += p - Math.max(y, w) - C - E, L += p + Math.max(y, w) + C + E; var B = n || "main", I = i.labelBounds, M = I[B] = I[B] || {}; M.x1 = D, M.y1 = F, M.x2 = O, M.y2 = L, M.w = O - D, M.h = L - F; var A = m && g.strValue === "autorotate", R = g.pfValue != null && g.pfValue !== 0; if (A || R) { var K = A ? Li(i.rstyle, "labelAngle", n) : g.pfValue, H = Math.cos(K), q = Math.sin(K), ee = (D + O) / 2, se = (F + L) / 2; if (!m) { switch (u.value) { case "left": ee = O; break; case "right": ee = D; break; } switch (l.value) { case "top": se = L; break; case "bottom": se = F; break; } } var oe = function(Ee, fe) { return Ee = Ee - ee, fe = fe - se, { x: Ee * H - fe * q + ee, y: Ee * q + fe * H + se }; }, ne = oe(D, F), ue = oe(D, L), te = oe(O, F), $ = oe(O, L); D = Math.min(ne.x, ue.x, te.x, $.x), O = Math.max(ne.x, ue.x, te.x, $.x), F = Math.min(ne.y, ue.y, te.y, $.y), L = Math.max(ne.y, ue.y, te.y, $.y); } var G = B + "Rot", Q = I[G] = I[G] || {}; Q.x1 = D, Q.y1 = F, Q.x2 = O, Q.y2 = L, Q.w = O - D, Q.h = L - F, Br(e, D, F, O, L), Br(i.labelBounds.all, D, F, O, L); } return e; } }, TD = function(e, r) { if (!r.cy().headless()) { var n = r.pstyle("outline-opacity").value, a = r.pstyle("outline-width").value; if (n > 0 && a > 0) { var i = r.pstyle("outline-offset").value, o = r.pstyle("shape").value, s = a + i, u = (e.w + s * 2) / e.w, l = (e.h + s * 2) / e.h, c = 0, d = 0; ["diamond", "pentagon", "round-triangle"].includes(o) ? (u = (e.w + s * 2.4) / e.w, d = -s / 3.6) : ["concave-hexagon", "rhomboid", "right-rhomboid"].includes(o) ? u = (e.w + s * 2.4) / e.w : o === "star" ? (u = (e.w + s * 2.8) / e.w, l = (e.h + s * 2.6) / e.h, d = -s / 3.8) : o === "triangle" ? (u = (e.w + s * 2.8) / e.w, l = (e.h + s * 2.4) / e.h, d = -s / 1.4) : o === "vee" && (u = (e.w + s * 4.4) / e.w, l = (e.h + s * 3.8) / e.h, d = -s * 0.5); var v = e.h * l - e.h, h = e.w * u - e.w; if (cs(e, [Math.ceil(v / 2), Math.ceil(h / 2)]), c != 0 || d !== 0) { var f = W5(e, c, d); vp(e, f); } } } }, _D = function(e, r) { var n = e._private.cy, a = n.styleEnabled(), i = n.headless(), o = pr(), s = e._private, u = e.isNode(), l = e.isEdge(), c, d, v, h, f, p, m = s.rstyle, g = u && a ? e.pstyle("bounds-expansion").pfValue : [0], y = function(xe) { return xe.pstyle("display").value !== "none"; }, b = !a || y(e) && (!l || y(e.source()) && y(e.target())); if (b) { var w = 0, C = 0; a && r.includeOverlays && (w = e.pstyle("overlay-opacity").value, w !== 0 && (C = e.pstyle("overlay-padding").value)); var E = 0, x = 0; a && r.includeUnderlays && (E = e.pstyle("underlay-opacity").value, E !== 0 && (x = e.pstyle("underlay-padding").value)); var T = Math.max(C, x), k = 0, _ = 0; if (a && (k = e.pstyle("width").pfValue, _ = k / 2), u && r.includeNodes) { var D = e.position(); f = D.x, p = D.y; var O = e.outerWidth(), F = O / 2, L = e.outerHeight(), B = L / 2; c = f - F, d = f + F, v = p - B, h = p + B, Br(o, c, v, d, h), a && r.includeOutlines && TD(o, e); } else if (l && r.includeEdges) if (a && !i) { var I = e.pstyle("curve-style").strValue; if (c = Math.min(m.srcX, m.midX, m.tgtX), d = Math.max(m.srcX, m.midX, m.tgtX), v = Math.min(m.srcY, m.midY, m.tgtY), h = Math.max(m.srcY, m.midY, m.tgtY), c -= _, d += _, v -= _, h += _, Br(o, c, v, d, h), I === "haystack") { var M = m.haystackPts; if (M && M.length === 2) { if (c = M[0].x, v = M[0].y, d = M[1].x, h = M[1].y, c > d) { var A = c; c = d, d = A; } if (v > h) { var R = v; v = h, h = R; } Br(o, c - _, v - _, d + _, h + _); } } else if (I === "bezier" || I === "unbundled-bezier" || I.endsWith("segments") || I.endsWith("taxi")) { var K; switch (I) { case "bezier": case "unbundled-bezier": K = m.bezierPts; break; case "segments": case "taxi": case "round-segments": case "round-taxi": K = m.linePts; break; } if (K != null) for (var H = 0; H < K.length; H++) { var q = K[H]; c = q.x - _, d = q.x + _, v = q.y - _, h = q.y + _, Br(o, c, v, d, h); } } } else { var ee = e.source(), se = ee.position(), oe = e.target(), ne = oe.position(); if (c = se.x, d = ne.x, v = se.y, h = ne.y, c > d) { var ue = c; c = d, d = ue; } if (v > h) { var te = v; v = h, h = te; } c -= _, d += _, v -= _, h += _, Br(o, c, v, d, h); } if (a && r.includeEdges && l && (Qo(o, e, "mid-source"), Qo(o, e, "mid-target"), Qo(o, e, "source"), Qo(o, e, "target")), a) { var $ = e.pstyle("ghost").value === "yes"; if ($) { var G = e.pstyle("ghost-offset-x").pfValue, Q = e.pstyle("ghost-offset-y").pfValue; Br(o, o.x1 + G, o.y1 + Q, o.x2 + G, o.y2 + Q); } } var ge = s.bodyBounds = s.bodyBounds || {}; cf(ge, o), cs(ge, g), us(ge, 1), a && (c = o.x1, d = o.x2, v = o.y1, h = o.y2, Br(o, c - T, v - T, d + T, h + T)); var Ee = s.overlayBounds = s.overlayBounds || {}; cf(Ee, o), cs(Ee, g), us(Ee, 1); var fe = s.labelBounds = s.labelBounds || {}; fe.all != null ? G5(fe.all) : fe.all = pr(), a && r.includeLabels && (r.includeMainLabels && zl(o, e, null), l && (r.includeSourceLabels && zl(o, e, "source"), r.includeTargetLabels && zl(o, e, "target"))); } return o.x1 = Er(o.x1), o.y1 = Er(o.y1), o.x2 = Er(o.x2), o.y2 = Er(o.y2), o.w = Er(o.x2 - o.x1), o.h = Er(o.y2 - o.y1), o.w > 0 && o.h > 0 && b && (cs(o, g), us(o, 1)), o; }, zp = function(e) { var r = 0, n = function(o) { return (o ? 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; }, Vp = function(e) { if (e.isEdge()) { var r = e.source().position(), n = e.target().position(), a = function(o) { return Math.round(o); }; return v5([a(r.x), a(r.y), a(n.x), a(n.y)]); } else return 0; }, If = function(e, r) { var n = e._private, a, i = e.isEdge(), o = r == null ? Ff : zp(r), s = o === Ff, u = Vp(e), l = n.bbCachePosKey === u, c = r.useCache && l, d = function(p) { return p._private.bbCache == null || p._private.styleDirty; }, v = !c || d(e) || i && d(e.source()) || d(e.target()); if (v ? (l || e.recalculateRenderedStyle(c), a = _D(e, uo), n.bbCache = a, n.bbCachePosKey = u) : a = n.bbCache, !s) { var h = e.isNode(); a = pr(), (r.includeNodes && h || r.includeEdges && !h) && (r.includeOverlays ? ra(a, n.overlayBounds) : ra(a, n.bodyBounds)), r.includeLabels && (r.includeMainLabels && (!i || r.includeSourceLabels && r.includeTargetLabels) ? ra(a, n.labelBounds.all) : (r.includeMainLabels && ra(a, n.labelBounds.mainRot), r.includeSourceLabels && ra(a, n.labelBounds.sourceRot), r.includeTargetLabels && ra(a, n.labelBounds.targetRot))), a.w = a.x2 - a.x1, a.h = a.y2 - a.y1; } return a; }, uo = { includeNodes: !0, includeEdges: !0, includeLabels: !0, includeMainLabels: !0, includeSourceLabels: !0, includeTargetLabels: !0, includeOverlays: !0, includeUnderlays: !0, includeOutlines: !0, useCache: !0 }, Ff = zp(uo), Af = Wt(uo); Xn.boundingBox = function(t) { var e; if (this.length === 1 && this[0]._private.bbCache != null && !this[0]._private.styleDirty && (t === void 0 || t.useCache === void 0 || t.useCache === !0)) t === void 0 ? t = uo : t = Af(t), e = If(this[0], t); else { e = pr(), t = t || uo; var r = Af(t), n = this, a = n.cy(), i = a.styleEnabled(); if (i) for (var o = 0; o < n.length; o++) { var s = n[o], u = s._private, l = Vp(s), c = u.bbCachePosKey === l, d = r.useCache && c && !u.styleDirty; s.recalculateRenderedStyle(d); } this.updateCompoundBounds(!t.useCache); for (var v = 0; v < n.length; v++) { var h = n[v]; ra(e, If(h, r)); } } return e.x1 = Er(e.x1), e.y1 = Er(e.y1), e.x2 = Er(e.x2), e.y2 = Er(e.y2), e.w = Er(e.x2 - e.x1), e.h = Er(e.y2 - e.y1), e; }; Xn.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; }; Xn.boundingBoxAt = function(t) { var e = this.nodes(), r = this.cy(), n = r.hasCompoundNodes(), a = r.collection(); if (n && (a = e.filter(function(l) { return l.isParent(); }), e = e.not(a)), Xe(t)) { var i = t; t = function() { return i; }; } var o = function(c, d) { return c._private.bbAtOldPos = t(c, d); }, s = function(c) { return c._private.bbAtOldPos; }; r.startBatch(), e.forEach(o).silentPositions(t), n && (a.dirtyCompoundBoundsCache(), a.dirtyBoundingBoxCache(), a.updateCompoundBounds(!0)); var u = U5(this.boundingBox({ useCache: !1 })); return e.silentPositions(s), n && (a.dirtyCompoundBoundsCache(), a.dirtyBoundingBoxCache(), a.updateCompoundBounds(!0)), r.endBatch(), u; }; Za.boundingbox = Za.bb = Za.boundingBox; Za.renderedBoundingbox = Za.renderedBoundingBox; var DD = Xn, $i, Lo; $i = Lo = {}; var Hp = function(e) { e.uppercaseName = rf(e.name), e.autoName = "auto" + e.uppercaseName, e.labelName = "label" + e.uppercaseName, e.outerName = "outer" + e.uppercaseName, e.uppercaseOuterName = rf(e.outerName), $i[e.name] = function() { var n = this[0], a = n._private, i = a.cy, o = i._private.styleEnabled; if (n) if (o) { if (n.isParent()) return n.updateCompoundBounds(), a[e.autoName] || 0; var s = n.pstyle(e.name); switch (s.strValue) { case "label": return n.recalculateRenderedStyle(), a.rstyle[e.labelName] || 0; default: return s.pfValue; } } else return 1; }, $i["outer" + e.uppercaseName] = function() { var n = this[0], a = n._private, i = a.cy, o = i._private.styleEnabled; if (n) if (o) { var s = n[e.name](), u = n.pstyle("border-width").pfValue, l = 2 * n.padding(); return s + u + l; } else return 1; }, $i["rendered" + e.uppercaseName] = function() { var n = this[0]; if (n) { var a = n[e.name](); return a * this.cy().zoom(); } }, $i["rendered" + e.uppercaseOuterName] = function() { var n = this[0]; if (n) { var a = n[e.outerName](); return a * this.cy().zoom(); } }; }; Hp({ name: "width" }); Hp({ name: "height" }); Lo.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; }; Lo.paddedHeight = function() { var t = this[0]; return t.height() + 2 * t.padding(); }; Lo.paddedWidth = function() { var t = this[0]; return t.width() + 2 * t.padding(); }; var PD = Lo, OD = function(e, r) { if (e.isEdge()) return r(e); }, LD = function(e, r) { if (e.isEdge()) { var n = e.cy(); return nl(r(e), n.zoom(), n.pan()); } }, ID = function(e, r) { if (e.isEdge()) { var n = e.cy(), a = n.pan(), i = n.zoom(); return r(e).map(function(o) { return nl(o, i, a); }); } }, FD = function(e) { return e.renderer().getControlPoints(e); }, AD = function(e) { return e.renderer().getSegmentPoints(e); }, MD = function(e) { return e.renderer().getSourceEndpoint(e); }, BD = function(e) { return e.renderer().getTargetEndpoint(e); }, ND = function(e) { return e.renderer().getEdgeMidpoint(e); }, Mf = { controlPoints: { get: FD, mult: !0 }, segmentPoints: { get: AD, mult: !0 }, sourceEndpoint: { get: MD }, targetEndpoint: { get: BD }, midpoint: { get: ND } }, $D = function(e) { return "rendered" + e[0].toUpperCase() + e.substr(1); }, RD = Object.keys(Mf).reduce(function(t, e) { var r = Mf[e], n = $D(e); return t[e] = function() { return OD(this, r.get); }, r.mult ? t[n] = function() { return ID(this, r.get); } : t[n] = function() { return LD(this, r.get); }, t; }, {}), zD = Re({}, SD, DD, PD, RD); /*! Event object based on jQuery events, MIT license https://jquery.org/license/ https://tldrlegal.com/license/mit-license https://github.com/jquery/jquery/blob/master/src/event.js */ var qp = function(e, r) { this.recycle(e, r); }; function Ii() { return !1; } function Jo() { return !0; } qp.prototype = { instanceString: function() { return "event"; }, recycle: function(e, r) { if (this.isImmediatePropagationStopped = this.isPropagationStopped = this.isDefaultPrevented = Ii, e != null && e.preventDefault ? (this.type = e.type, this.isDefaultPrevented = e.defaultPrevented ? Jo : Ii) : 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 = Jo; var e = this.originalEvent; e && e.preventDefault && e.preventDefault(); }, stopPropagation: function() { this.isPropagationStopped = Jo; var e = this.originalEvent; e && e.stopPropagation && e.stopPropagation(); }, stopImmediatePropagation: function() { this.isImmediatePropagationStopped = Jo, this.stopPropagation(); }, isDefaultPrevented: Ii, isPropagationStopped: Ii, isImmediatePropagationStopped: Ii }; var Kp = /^([^.]+)(\.(?:[^.]+))?$/, VD = ".*", Up = { 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 }, Bf = Object.keys(Up), HD = {}; function ul() { for (var t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : HD, e = arguments.length > 1 ? arguments[1] : void 0, r = 0; r < Bf.length; r++) { var n = Bf[r]; this[n] = t[n] || Up[n]; } this.context = e || this.context, this.listeners = [], this.emitting = 0; } var Wn = ul.prototype, Gp = function(e, r, n, a, i, o, s) { pt(a) && (i = a, a = null), s && (o == null ? o = s : o = Re({}, o, s)); for (var u = st(n) ? n : n.split(/\s+/), l = 0; l < u.length; l++) { var c = u[l]; if (!qn(c)) { var d = c.match(Kp); if (d) { var v = d[1], h = d[2] ? d[2] : null, f = r(e, c, v, h, a, i, o); if (f === !1) break; } } } }, Nf = function(e, r) { return e.addEventFields(e.context, r), new qp(r.type, r); }, qD = function(e, r, n) { if (uT(n)) { r(e, n); return; } else if (Xe(n)) { r(e, Nf(e, n)); return; } for (var a = st(n) ? n : n.split(/\s+/), i = 0; i < a.length; i++) { var o = a[i]; if (!qn(o)) { var s = o.match(Kp); if (s) { var u = s[1], l = s[2] ? s[2] : null, c = Nf(e, { type: u, namespace: l, target: e.context }); r(e, c); } } } }; Wn.on = Wn.addListener = function(t, e, r, n, a) { return Gp(this, function(i, o, s, u, l, c, d) { pt(c) && i.listeners.push({ event: o, // full event string callback: c, // callback to run type: s, // the event type (e.g. 'click') namespace: u, // the event namespace (e.g. ".foo") qualifier: l, // a restriction on whether to match this emitter conf: d // additional configuration }); }, t, e, r, n, a), this; }; Wn.one = function(t, e, r, n) { return this.on(t, e, r, n, { one: !0 }); }; Wn.removeListener = Wn.off = function(t, e, r, n) { var a = this; this.emitting !== 0 && (this.listeners = y5(this.listeners)); for (var i = this.listeners, o = function(l) { var c = i[l]; Gp(a, function(d, v, h, f, p, m) { if ((c.type === h || t === "*") && (!f && c.namespace !== ".*" || c.namespace === f) && (!p || d.qualifierCompare(c.qualifier, p)) && (!m || c.callback === m)) return i.splice(l, 1), !1; }, t, e, r, n); }, s = i.length - 1; s >= 0; s--) o(s); return this; }; Wn.removeAllListeners = function() { return this.removeListener("*"); }; Wn.emit = Wn.trigger = function(t, e, r) { var n = this.listeners, a = n.length; return this.emitting++, st(e) || (e = [e]), qD(this, function(i, o) { r != null && (n = [{ event: o.event, type: o.type, namespace: o.namespace, callback: r }], a = n.length); for (var s = function(c) { var d = n[c]; if (d.type === o.type && (!d.namespace || d.namespace === o.namespace || d.namespace === VD) && i.eventMatches(i.context, d, o)) { var v = [o]; e != null && w5(v, e), i.beforeEmit(i.context, d, o), d.conf && d.conf.one && (i.listeners = i.listeners.filter(function(p) { return p !== d; })); var h = i.callbackContext(i.context, d, o), f = d.callback.apply(h, v); i.afterEmit(i.context, d, o), f === !1 && (o.stopPropagation(), o.preventDefault()); } }, u = 0; u < a; u++) s(u); i.bubble(i.context) && !o.isPropagationStopped() && i.parent(i.context).emit(o, e); }, t), this.emitting--, this; }; var KD = { 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 && Do(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(); } }, es = function(e) { return Fe(e) ? new Un(e) : e; }, Wp = { createEmitter: function() { for (var e = 0; e < this.length; e++) { var r = this[e], n = r._private; n.emitter || (n.emitter = new ul(KD, r)); } return this; }, emitter: function() { return this._private.emitter; }, on: function(e, r, n) { for (var a = es(r), i = 0; i < this.length; i++) { var o = this[i]; o.emitter().on(e, a, n); } return this; }, removeListener: function(e, r, n) { for (var a = es(r), i = 0; i < this.length; i++) { var o = this[i]; o.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 = es(r), i = 0; i < this.length; i++) { var o = this[i]; o.emitter().one(e, a, n); } return this; }, once: function(e, r, n) { for (var a = es(r), i = 0; i < this.length; i++) { var o = this[i]; o.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; } }; et.eventAliasesOn(Wp); var Yp = { 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); }, // internal helper to get nodes and edges as separate collections with single iteration over elements 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 (Fe(e) || yr(e)) return new Un(e).filter(this); if (pt(e)) { for (var n = this.spawn(), a = this, i = 0; i < a.length; i++) { var o = a[i], s = r ? e.apply(r, [o, i, a]) : e(o, i, a); s && n.push(o); } return n; } return this.spawn(); }, not: function(e) { if (e) { Fe(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 (Fe(e)) { var r = e; return this.filter(r); } for (var n = this.spawn(), a = this, i = e, o = this.length < e.length, s = o ? a : i, u = o ? i : a, l = 0; l < s.length; l++) { var c = s[l]; u.has(c) && n.push(c); } return n; }, xor: function(e) { var r = this._private.cy; Fe(e) && (e = r.$(e)); var n = this.spawn(), a = this, i = e, o = function(u, l) { for (var c = 0; c < u.length; c++) { var d = u[c], v = d._private.data.id, h = l.hasElementWithId(v); h || n.push(d); } }; return o(a, i), o(i, a), n; }, diff: function(e) { var r = this._private.cy; Fe(e) && (e = r.$(e)); var n = this.spawn(), a = this.spawn(), i = this.spawn(), o = this, s = e, u = function(c, d, v) { for (var h = 0; h < c.length; h++) { var f = c[h], p = f._private.data.id, m = d.hasElementWithId(p); m ? i.merge(f) : v.push(f); } }; return u(o, s, n), u(s, o, a), { left: n, right: a, both: i }; }, add: function(e) { var r = this._private.cy; if (!e) return this; if (Fe(e)) { var n = e; e = r.mutableElements().filter(n); } for (var a = this.spawnSelf(), i = 0; i < e.length; i++) { var o = e[i], s = !this.has(o); s && a.push(o); } return a; }, // in place merge on calling collection merge: function(e) { var r = this._private, n = r.cy; if (!e) return this; if (e && Fe(e)) { var a = e; e = n.mutableElements().filter(a); } for (var i = r.map, o = 0; o < e.length; o++) { var s = e[o], u = s._private.data.id, l = !i.has(u); if (l) { var c = this.length++; this[c] = s, i.set(u, { ele: s, 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 o = e === this.length - 1; if (this.length > 1 && !o) { var s = this.length - 1, u = this[s], l = u._private.data.id; this[s] = void 0, this[e] = u, i.set(l, { ele: u, index: e }); } return this.length--, this; }, // remove single ele in place in calling collection 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 o = i.index; return this.unmergeAt(o), this; }, // remove eles in place on calling collection unmerge: function(e) { var r = this._private.cy; if (!e) return this; if (e && Fe(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 o = a[i], s = r ? e.apply(r, [o, i, a]) : e(o, i, a); n.push(s); } 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, o = 0; o < i.length; o++) { var s = i[o], u = r ? e.apply(r, [s, o, i]) : e(s, o, i); u > n && (n = u, a = s); } return { value: n, ele: a }; }, min: function(e, r) { for (var n = 1 / 0, a, i = this, o = 0; o < i.length; o++) { var s = i[o], u = r ? e.apply(r, [s, o, i]) : e(s, o, i); u < n && (n = u, a = s); } return { value: n, ele: a }; } }, Je = Yp; Je.u = Je["|"] = Je["+"] = Je.union = Je.or = Je.add; Je["\\"] = Je["!"] = Je["-"] = Je.difference = Je.relativeComplement = Je.subtract = Je.not; Je.n = Je["&"] = Je["."] = Je.and = Je.intersection = Je.intersect; Je["^"] = Je["(+)"] = Je["(-)"] = Je.symmetricDifference = Je.symdiff = Je.xor; Je.fnFilter = Je.filterFn = Je.stdFilter = Je.filter; Je.complement = Je.abscomp = Je.absoluteComplement; var UD = { 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; } }, Zp = 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" ? uc : 0; } var o = i(e) - i(r); if (o !== 0) return o; function s(c) { var d = c.pstyle("z-index-compare"); return d.value === "auto" && c.isNode() ? 1 : 0; } var u = s(e) - s(r); if (u !== 0) return u; var l = e.pstyle("z-index").value - r.pstyle("z-index").value; return l !== 0 ? l : e.poolIndex() - r.poolIndex(); }, As = { forEach: function(e, r) { if (pt(e)) for (var n = this.length, a = 0; a < n; a++) { var i = this[a], o = r ? e.apply(r, [i, a, this]) : e(i, a, this); if (o === !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 (!pt(e)) return this; var r = this.toArray().sort(e); return this.spawn(r); }, sortByZIndex: function() { return this.sort(Zp); }, 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 : uc - 1; } else { var i = r.source, o = r.target, s = i.zDepth(), u = o.zDepth(); return Math.max(s, u, 0); } } } }; As.each = As.forEach; var GD = function() { var e = "undefined", r = (typeof Symbol > "u" ? "undefined" : Ft(Symbol)) != e && Ft(Symbol.iterator) != e; r && (As[Symbol.iterator] = function() { var n = this, a = { value: void 0, done: !1 }, i = 0, o = this.length; return Uh({ next: function() { return i < o ? a.value = n[i++] : (a.value = void 0, a.done = !0), a; } }, Symbol.iterator, function() { return this; }); }); }; GD(); var WD = Wt({ nodeDimensionsIncludeLabels: !1 }), fs = { // Calculates and returns node dimensions { x, y } based on options given layoutDimensions: function(e) { e = WD(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; }, // using standard layout options, apply position function (w/ or w/o animation) layoutPositions: function(e, r, n) { var a = this.nodes().filter(function(C) { return !C.isParent(); }), i = this.cy(), o = r.eles, s = function(E) { return E.id(); }, u = to(n, s); e.emit({ type: "layoutstart", layout: e }), e.animations = []; var l = function(E, x, T) { var k = { x: x.x1 + x.w / 2, y: x.y1 + x.h / 2 }, _ = { // scale from center of bounding box (not necessarily 0,0) x: (T.x - k.x) * E, y: (T.y - k.y) * E }; return { x: k.x + _.x, y: k.y + _.y }; }, c = r.spacingFactor && r.spacingFactor !== 1, d = function() { if (!c) return null; for (var E = pr(), x = 0; x < a.length; x++) { var T = a[x], k = u(T, x); Y5(E, k.x, k.y); } return E; }, v = d(), h = to(function(C, E) { var x = u(C, E); if (c) { var T = Math.abs(r.spacingFactor); x = l(T, v, x); } return r.transform != null && (x = r.transform(C, x)), x; }, s); if (r.animate) { for (var f = 0; f < a.length; f++) { var p = a[f], m = h(p, f), g = r.animateFilter == null || r.animateFilter(p, f); if (g) { var y = p.animation({ position: m, duration: r.animationDuration, easing: r.animationEasing }); e.animations.push(y); } else p.position(m); } if (r.fit) { var b = i.animation({ fit: { boundingBox: o.boundingBoxAt(h), 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(C) { return C.play(); }), e.one("layoutready", r.ready), e.emit({ type: "layoutready", layout: e }), hi.all(e.animations.map(function(C) { return C.promise(); })).then(function() { e.one("layoutstop", r.stop), e.emit({ type: "layoutstop", layout: e }); }); } else a.positions(h), 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(Re({}, e, { eles: this })); } }; fs.createLayout = fs.makeLayout = fs.layout; function Xp(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 cl(t, e) { return t = ma(t), function(n) { return Xp(t, e, n); }; } function dl(t, e) { t = ma(t); var r = function(a) { return e.call(a); }; return function() { var a = this[0]; if (a) return Xp(t, r, a); }; } var Ut = { 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; }, // fully updates (recalculates) the style for the elements 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 o = i; return e ? o.emitAndNotify("style") : o.emit("style"), i.forEach(function(s) { return s._private.styleDirty = !0; }), this; }, // private: clears dirty flag and recalculates style 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)); } }, // get the internal parsed style object for the specified property 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) { this.cleanStyle(); 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; }, // get the specified css property as a rendered value (i.e. on-screen value) // or get the whole rendered style if no property specified (NB doesn't allow setting) renderedStyle: function(e) { var r = this.cy(); if (!r.styleEnabled()) return this; var n = this[0]; if (n) return r.style().getRenderedStyle(n, e); }, // read the calculated css style of the element or override the style (via a bypass) style: function(e, r) { var n = this.cy(); if (!n.styleEnabled()) return this; var a = !1, i = n.style(); if (Xe(e)) { var o = e; i.applyBypass(this, o, a), this.emitAndNotify("style"); } else if (Fe(e)) if (r === void 0) { var s = this[0]; return s ? i.getStylePropertyValue(s, e) : void 0; } else i.applyBypass(this, e, r, a), this.emitAndNotify("style"); else if (e === void 0) { var u = this[0]; return u ? i.getRawStyle(u) : 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 o = 0; o < i.length; o++) { var s = i[o]; a.removeAllBypasses(s, n); } else { e = e.split(/\s+/); for (var u = 0; u < i.length; u++) { var l = i[u]; a.removeBypasses(l, 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 o = a.data.parent ? n.parents() : null; if (o) for (var s = 0; s < o.length; s++) { var u = o[s], l = u.pstyle("opacity").value; i = l * 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 Vl(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 xc(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], o = a.hasCompoundNodes(); if (i) { var s = i._private; if (!e(i)) return !1; if (i.isNode()) return !o || Vl(i, n); var u = s.source, l = s.target; return r(u) && (!o || Vl(u, r)) && (u === l || r(l) && (!o || Vl(l, r))); } }; } var yi = cl("eleTakesUpSpace", function(t) { return t.pstyle("display").value === "element" && t.width() !== 0 && (t.isNode() ? t.height() !== 0 : !0); }); Ut.takesUpSpace = dl("takesUpSpace", xc({ ok: yi })); var YD = cl("eleInteractive", function(t) { return t.pstyle("events").value === "yes" && t.pstyle("visibility").value === "visible" && yi(t); }), ZD = cl("parentInteractive", function(t) { return t.pstyle("visibility").value === "visible" && yi(t); }); Ut.interactive = dl("interactive", xc({ ok: YD, parentOk: ZD, edgeOkViaNode: yi })); Ut.noninteractive = function() { var t = this[0]; if (t) return !t.interactive(); }; var XD = cl("eleVisible", function(t) { return t.pstyle("visibility").value === "visible" && t.pstyle("opacity").pfValue !== 0 && yi(t); }), jD = yi; Ut.visible = dl("visible", xc({ ok: XD, edgeOkViaNode: jD })); Ut.hidden = function() { var t = this[0]; if (t) return !t.visible(); }; Ut.isBundledBezier = dl("isBundledBezier", function() { return this.cy().styleEnabled() ? !this.removed() && this.pstyle("curve-style").value === "bezier" && this.takesUpSpace() : !1; }); Ut.bypass = Ut.css = Ut.style; Ut.renderedCss = Ut.renderedStyle; Ut.removeBypass = Ut.removeCss = Ut.removeStyle; Ut.pstyle = Ut.parsedStyle; var zn = {}; function $f(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 && pt(e[0])) { var i = e[0]; this.on(t.event, i); } else if (e.length === 0 || e.length === 1 && st(e[0])) { for (var o = e.length === 1 ? e[0] : null, s = 0; s < this.length; s++) { var u = this[s], l = !t.ableField || u._private[t.ableField], c = u._private[t.field] != t.value; if (t.overrideAble) { var d = t.overrideAble(u); if (d !== void 0 && (l = d, !d)) return this; } l && (u._private[t.field] = t.value, c && r.push(u)); } var v = this.spawn(r); v.updateStyle(), v.emit(t.event), o && v.emit(o); } return this; }; } function bi(t) { zn[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]; } }, zn[t.on] = $f({ event: t.on, field: t.field, ableField: t.ableField, overrideAble: t.overrideAble, value: !0 }), zn[t.off] = $f({ event: t.off, field: t.field, ableField: t.ableField, overrideAble: t.overrideAble, value: !1 }); } bi({ field: "locked", overrideField: function(e) { return e.cy().autolock() ? !0 : void 0; }, on: "lock", off: "unlock" }); bi({ field: "grabbable", overrideField: function(e) { return e.cy().autoungrabify() || e.pannable() ? !1 : void 0; }, on: "grabify", off: "ungrabify" }); bi({ field: "selected", ableField: "selectable", overrideAble: function(e) { return e.cy().autounselectify() ? !1 : void 0; }, on: "select", off: "unselect" }); bi({ field: "selectable", overrideField: function(e) { return e.cy().autounselectify() ? !1 : void 0; }, on: "selectify", off: "unselectify" }); zn.deselect = zn.unselect; zn.grabbed = function() { var t = this[0]; if (t) return t._private.grabbed; }; bi({ field: "active", on: "activate", off: "unactivate" }); bi({ field: "pannable", on: "panify", off: "unpanify" }); zn.inactive = function() { var t = this[0]; if (t) return !t._private.active; }; var nr = {}, Rf = function(e) { return function(n) { for (var a = this, i = [], o = 0; o < a.length; o++) { var s = a[o]; if (s.isNode()) { for (var u = !1, l = s.connectedEdges(), c = 0; c < l.length; c++) { var d = l[c], v = d.source(), h = d.target(); if (e.noIncomingEdges && h === s && v !== s || e.noOutgoingEdges && v === s && h !== s) { u = !0; break; } } u || i.push(s); } } return this.spawn(i, !0).filter(n); }; }, zf = function(e) { return function(r) { for (var n = this, a = [], i = 0; i < n.length; i++) { var o = n[i]; if (o.isNode()) for (var s = o.connectedEdges(), u = 0; u < s.length; u++) { var l = s[u], c = l.source(), d = l.target(); e.outgoing && c === o ? (a.push(l), a.push(d)) : e.incoming && d === o && (a.push(l), a.push(c)); } } return this.spawn(a, !0).filter(r); }; }, Vf = function(e) { return function(r) { for (var n = this, a = [], i = {}; ; ) { var o = e.outgoing ? n.outgoers() : n.incomers(); if (o.length === 0) break; for (var s = !1, u = 0; u < o.length; u++) { var l = o[u], c = l.id(); i[c] || (i[c] = !0, a.push(l), s = !0); } if (!s) break; n = o; } return this.spawn(a, !0).filter(r); }; }; nr.clearTraversalCache = function() { for (var t = 0; t < this.length; t++) this[t]._private.traversalCache = null; }; Re(nr, { // get the root nodes in the DAG roots: Rf({ noIncomingEdges: !0 }), // get the leaf nodes in the DAG leaves: Rf({ noOutgoingEdges: !0 }), // normally called children in graph theory // these nodes =edges=> outgoing nodes outgoers: Sr(zf({ outgoing: !0 }), "outgoers"), // aka DAG descendants successors: Vf({ outgoing: !0 }), // normally called parents in graph theory // these nodes <=edges= incoming nodes incomers: Sr(zf({ incoming: !0 }), "incomers"), // aka DAG ancestors predecessors: Vf({ incoming: !0 }) }); Re(nr, { neighborhood: Sr(function(t) { for (var e = [], r = this.nodes(), n = 0; n < r.length; n++) for (var a = r[n], i = a.connectedEdges(), o = 0; o < i.length; o++) { var s = i[o], u = s.source(), l = s.target(), c = a === u ? l : u; c.length > 0 && e.push(c[0]), e.push(s[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); } }); nr.neighbourhood = nr.neighborhood; nr.closedNeighbourhood = nr.closedNeighborhood; nr.openNeighbourhood = nr.openNeighborhood; Re(nr, { source: Sr(function(e) { var r = this[0], n; return r && (n = r._private.source || r.cy().collection()), n && e ? n.filter(e) : n; }, "source"), target: Sr(function(e) { var r = this[0], n; return r && (n = r._private.target || r.cy().collection()), n && e ? n.filter(e) : n; }, "target"), sources: Hf({ attr: "source" }), targets: Hf({ attr: "target" }) }); function Hf(t) { return function(r) { for (var n = [], a = 0; a < this.length; a++) { var i = this[a], o = i._private[t.attr]; o && n.push(o); } return this.spawn(n, !0).filter(r); }; } Re(nr, { edgesWith: Sr(qf(), "edgesWith"), edgesTo: Sr(qf({ thisIsSrc: !0 }), "edgesTo") }); function qf(t) { return function(r) { var n = [], a = this._private.cy, i = t || {}; Fe(r) && (r = a.$(r)); for (var o = 0; o < r.length; o++) for (var s = r[o]._private.edges, u = 0; u < s.length; u++) { var l = s[u], c = l._private.data, d = this.hasElementWithId(c.source) && r.hasElementWithId(c.target), v = r.hasElementWithId(c.source) && this.hasElementWithId(c.target), h = d || v; h && ((i.thisIsSrc || i.thisIsTgt) && (i.thisIsSrc && !d || i.thisIsTgt && !v) || n.push(l)); } return this.spawn(n, !0); }; } Re(nr, { connectedEdges: Sr(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, o = 0; o < i.length; o++) { var s = i[o]; e.push(s); } } return this.spawn(e, !0).filter(t); }, "connectedEdges"), connectedNodes: Sr(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: Sr(Kf(), "parallelEdges"), codirectedEdges: Sr(Kf({ codirected: !0 }), "codirectedEdges") }); function Kf(t) { var e = { codirected: !1 }; return t = Re({}, e, t), function(n) { for (var a = [], i = this.edges(), o = t, s = 0; s < i.length; s++) for (var u = i[s], l = u._private, c = l.source, d = c._private.data.id, v = l.data.target, h = c._private.edges, f = 0; f < h.length; f++) { var p = h[f], m = p._private.data, g = m.target, y = m.source, b = g === v && y === d, w = d === g && v === y; (o.codirected && b || !o.codirected && (b || w)) && a.push(p); } return this.spawn(a, !0).filter(n); }; } Re(nr, { components: function(e) { var r = this, n = r.cy(), a = n.collection(), i = e == null ? r.nodes() : e.nodes(), o = []; e != null && i.empty() && (i = e.sources()); var s = function(c, d) { a.merge(c), i.unmerge(c), d.merge(c); }; if (i.empty()) return r.spawn(); var u = function() { var c = n.collection(); o.push(c); var d = i[0]; s(d, c), r.bfs({ directed: !1, roots: d, visit: function(h) { return s(h, c); } }), c.forEach(function(v) { v.connectedEdges().forEach(function(h) { r.has(h) && c.has(h.source()) && c.has(h.target()) && c.merge(h); }); }); }; do u(); while (i.length > 0); return o; }, component: function() { var e = this[0]; return e.cy().mutableElements().components(e)[0]; } }); nr.componentsOf = nr.components; var Gt = 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) { yt("A collection must have a reference to the core"); return; } var i = new Xr(), o = !1; if (!r) r = []; else if (r.length > 0 && Xe(r[0]) && !Do(r[0])) { o = !0; for (var s = [], u = new vi(), l = 0, c = r.length; l < c; l++) { var d = r[l]; d.data == null && (d.data = {}); var v = d.data; if (v.id == null) v.id = up(); else if (e.hasElementWithId(v.id) || u.has(v.id)) continue; var h = new rl(e, d, !1); s.push(h), u.add(v.id); } r = s; } this.length = 0; for (var f = 0, p = r.length; f < p; f++) { var m = r[f][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(y) { this.lazyMap = y; }, rebuildMap: function() { for (var b = this.lazyMap = new Xr(), w = this.eles, C = 0; C < w.length; C++) { var E = w[C]; b.set(E.id(), { index: C, ele: E }); } } }, n && (this._private.map = i), o && !a && this.restore(); }, dt = rl.prototype = Gt.prototype = Object.create(Array.prototype); dt.instanceString = function() { return "collection"; }; dt.spawn = function(t, e) { return new Gt(this.cy(), t, e); }; dt.spawnSelf = function() { return this.spawn(this); }; dt.cy = function() { return this._private.cy; }; dt.renderer = function() { return this._private.cy.renderer(); }; dt.element = function() { return this[0]; }; dt.collection = function() { return Zh(this) ? this : new Gt(this._private.cy, [this]); }; dt.unique = function() { return new Gt(this._private.cy, this, !0); }; dt.hasElementWithId = function(t) { return t = "" + t, this._private.map.has(t); }; dt.getElementById = function(t) { t = "" + t; var e = this._private.cy, r = this._private.map.get(t); return r ? r.ele : new Gt(e); }; dt.$id = dt.getElementById; dt.poolIndex = function() { var t = this._private.cy, e = t._private.elements, r = this[0]._private.data.id; return e._private.map.get(r).index; }; dt.indexOf = function(t) { var e = t[0]._private.data.id; return this._private.map.get(e).index; }; dt.indexOfId = function(t) { return t = "" + t, this._private.map.get(t).index; }; dt.json = function(t) { var e = this.element(), r = this.cy(); if (e == null && t) return this; if (e != null) { var n = e._private; if (Xe(t)) { if (r.startBatch(), t.data) { e.data(t.data); var a = n.data; if (e.isEdge()) { var i = !1, o = {}, s = t.data.source, u = t.data.target; s != null && s != a.source && (o.source = "" + s, i = !0), u != null && u != a.target && (o.target = "" + u, i = !0), i && (e = e.move(o)); } else { var l = "parent" in t.data, c = t.data.parent; l && (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(p, m, g) { var y = t[p]; y != null && y !== n[p] && (y ? 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 v = { data: Zr(n.data), position: Zr(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 }; v.classes = ""; var h = 0; return n.classes.forEach(function(f) { return v.classes += h++ === 0 ? f : " " + f; }), v; } } }; dt.jsons = function() { for (var t = [], e = 0; e < this.length; e++) { var r = this[e], n = r.json(); t.push(n); } return t; }; dt.clone = function() { for (var t = this.cy(), e = [], r = 0; r < this.length; r++) { var n = this[r], a = n.json(), i = new rl(t, a, !1); e.push(i); } return new Gt(t, e); }; dt.copy = dt.clone; dt.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 = [], o = [], s, u = 0, l = r.length; u < l; u++) { var c = r[u]; e && !c.removed() || (c.isNode() ? i.push(c) : o.push(c)); } s = i.concat(o); var d, v = function() { s.splice(d, 1), d--; }; for (d = 0; d < s.length; d++) { var h = s[d], f = h._private, p = f.data; if (h.clearTraversalCache(), !(!e && !f.removed)) { if (p.id === void 0) p.id = up(); else if (be(p.id)) p.id = "" + p.id; else if (qn(p.id) || !Fe(p.id)) { yt("Can not create element with invalid string ID `" + p.id + "`"), v(); continue; } else if (n.hasElementWithId(p.id)) { yt("Can not create second element with ID `" + p.id + "`"), v(); continue; } } var m = p.id; if (h.isNode()) { var g = f.position; g.x == null && (g.x = 0), g.y == null && (g.y = 0); } if (h.isEdge()) { for (var y = h, b = ["source", "target"], w = b.length, C = !1, E = 0; E < w; E++) { var x = b[E], T = p[x]; be(T) && (T = p[x] = "" + p[x]), T == null || T === "" ? (yt("Can not create edge `" + m + "` with unspecified " + x), C = !0) : n.hasElementWithId(T) || (yt("Can not create edge `" + m + "` with nonexistant " + x + " `" + T + "`"), C = !0); } if (C) { v(); continue; } var k = n.getElementById(p.source), _ = n.getElementById(p.target); k.same(_) ? k._private.edges.push(y) : (k._private.edges.push(y), _._private.edges.push(y)), y._private.source = k, y._private.target = _; } f.map = new Xr(), f.map.set(m, { ele: h, index: 0 }), f.removed = !1, e && n.addToPool(h); } for (var D = 0; D < i.length; D++) { var O = i[D], F = O._private.data; be(F.parent) && (F.parent = "" + F.parent); var L = F.parent, B = L != null; if (B || O._private.parent) { var I = O._private.parent ? n.collection().merge(O._private.parent) : n.getElementById(L); if (I.empty()) F.parent = void 0; else if (I[0].removed()) tt("Node added with missing parent, reference to parent removed"), F.parent = void 0, O._private.parent = null; else { for (var M = !1, A = I; !A.empty(); ) { if (O.same(A)) { M = !0, F.parent = void 0; break; } A = A.parent(); } M || (I[0]._private.children.push(O), O._private.parent = I[0], a.hasCompoundNodes = !0); } } } if (s.length > 0) { for (var R = s.length === r.length ? r : new Gt(n, s), K = 0; K < R.length; K++) { var H = R[K]; H.isNode() || (H.parallelEdges().clearTraversalCache(), H.source().clearTraversalCache(), H.target().clearTraversalCache()); } var q; a.hasCompoundNodes ? q = n.collection().merge(R).merge(R.connectedNodes()).merge(R.parent()) : q = R, q.dirtyCompoundBoundsCache().dirtyBoundingBoxCache().updateStyle(t), t ? R.emitAndNotify("add") : e && R.emit("add"); } return r; }; dt.removed = function() { var t = this[0]; return t && t._private.removed; }; dt.inside = function() { var t = this[0]; return t && !t._private.removed; }; dt.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 o(L) { for (var B = L._private.edges, I = 0; I < B.length; I++) u(B[I]); } function s(L) { for (var B = L._private.children, I = 0; I < B.length; I++) u(B[I]); } function u(L) { var B = a[L.id()]; e && L.removed() || B || (a[L.id()] = !0, L.isNode() ? (n.push(L), o(L), s(L)) : n.unshift(L)); } for (var l = 0, c = r.length; l < c; l++) { var d = r[l]; u(d); } function v(L, B) { var I = L._private.edges; Kn(I, B), L.clearTraversalCache(); } function h(L) { L.clearTraversalCache(); } var f = []; f.ids = {}; function p(L, B) { B = B[0], L = L[0]; var I = L._private.children, M = L.id(); Kn(I, B), B._private.parent = null, f.ids[M] || (f.ids[M] = !0, f.push(L)); } r.dirtyCompoundBoundsCache(), e && i.removeFromPool(n); for (var m = 0; m < n.length; m++) { var g = n[m]; if (g.isEdge()) { var y = g.source()[0], b = g.target()[0]; v(y, g), v(b, g); for (var w = g.parallelEdges(), C = 0; C < w.length; C++) { var E = w[C]; h(E), E.isBundledBezier() && E.dirtyBoundingBoxCache(); } } else { var x = g.parent(); x.length !== 0 && p(x, g); } e && (g._private.removed = !0); } var T = i._private.elements; i._private.hasCompoundNodes = !1; for (var k = 0; k < T.length; k++) { var _ = T[k]; if (_.isParent()) { i._private.hasCompoundNodes = !0; break; } } var D = new Gt(this.cy(), n); D.size() > 0 && (t ? D.emitAndNotify("remove") : e && D.emit("remove")); for (var O = 0; O < f.length; O++) { var F = f[O]; (!e || !F.removed()) && F.updateStyle(); } return D; }; dt.move = function(t) { var e = this._private.cy, r = this, n = !1, a = !1, i = function(f) { return f == null ? f : "" + f; }; if (t.source !== void 0 || t.target !== void 0) { var o = i(t.source), s = i(t.target), u = o != null && e.hasElementWithId(o), l = s != null && e.hasElementWithId(s); (u || l) && (e.batch(function() { r.remove(n, a), r.emitAndNotify("moveout"); for (var h = 0; h < r.length; h++) { var f = r[h], p = f._private.data; f.isEdge() && (u && (p.source = o), l && (p.target = s)); } 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 v = c === null ? void 0 : c; e.batch(function() { var h = r.remove(n, a); h.emitAndNotify("moveout"); for (var f = 0; f < r.length; f++) { var p = r[f], m = p._private.data; p.isNode() && (m.parent = v); } h.restore(n, a); }), r.emitAndNotify("move"); } } return this; }; [Cp, lD, ds, Rn, li, kD, ll, zD, Wp, Yp, UD, As, fs, Ut, zn, nr].forEach(function(t) { Re(dt, t); }); var QD = { add: function(e) { var r, n = this; if (yr(e)) { var a = e; if (a._private.cy === n) r = a.restore(); else { for (var i = [], o = 0; o < a.length; o++) { var s = a[o]; i.push(s.json()); } r = new Gt(n, i); } } else if (st(e)) { var u = e; r = new Gt(n, u); } else if (Xe(e) && (st(e.nodes) || st(e.edges))) { for (var l = e, c = [], d = ["nodes", "edges"], v = 0, h = d.length; v < h; v++) { var f = d[v], p = l[f]; if (st(p)) for (var m = 0, g = p.length; m < g; m++) { var y = Re({ group: f }, p[m]); c.push(y); } } r = new Gt(n, c); } else { var b = e; r = new rl(n, b).collection(); } return r; }, remove: function(e) { if (!yr(e)) { if (Fe(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 JD(t, e, r, n) { var a = 4, i = 1e-3, o = 1e-7, s = 10, u = 11, l = 1 / (u - 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 v = c ? new Float32Array(u) : new Array(u); function h(_, D) { return 1 - 3 * D + 3 * _; } function f(_, D) { return 3 * D - 6 * _; } function p(_) { return 3 * _; } function m(_, D, O) { return ((h(D, O) * _ + f(D, O)) * _ + p(D)) * _; } function g(_, D, O) { return 3 * h(D, O) * _ * _ + 2 * f(D, O) * _ + p(D); } function y(_, D) { for (var O = 0; O < a; ++O) { var F = g(D, t, r); if (F === 0) return D; var L = m(D, t, r) - _; D -= L / F; } return D; } function b() { for (var _ = 0; _ < u; ++_) v[_] = m(_ * l, t, r); } function w(_, D, O) { var F, L, B = 0; do L = D + (O - D) / 2, F = m(L, t, r) - _, F > 0 ? O = L : D = L; while (Math.abs(F) > o && ++B < s); return L; } function C(_) { for (var D = 0, O = 1, F = u - 1; O !== F && v[O] <= _; ++O) D += l; --O; var L = (_ - v[O]) / (v[O + 1] - v[O]), B = D + L * l, I = g(B, t, r); return I >= i ? y(_, B) : I === 0 ? B : w(_, D, D + l); } var E = !1; function x() { E = !0, (t !== e || r !== n) && b(); } var T = function(D) { return E || x(), t === e && r === n ? D : D === 0 ? 0 : D === 1 ? 1 : m(C(D), e, n); }; T.getControlPoints = function() { return [{ x: t, y: e }, { x: r, y: n }]; }; var k = "generateBezier(" + [t, e, r, n] + ")"; return T.toString = function() { return k; }, T; } /*! Runge-Kutta spring physics function generator. Adapted from Framer.js, copyright Koen Bok. MIT License: http://en.wikipedia.org/wiki/MIT_License */ var eP = /* @__PURE__ */ function() { function t(n) { return -n.tension * n.x - n.friction * n.v; } function e(n, a, i) { var o = { x: n.x + i.dx * a, v: n.v + i.dv * a, tension: n.tension, friction: n.friction }; return { dx: o.v, dv: t(o) }; } function r(n, a) { var i = { dx: n.v, dv: t(n) }, o = e(n, a * 0.5, i), s = e(n, a * 0.5, o), u = e(n, a, s), l = 1 / 6 * (i.dx + 2 * (o.dx + s.dx) + u.dx), c = 1 / 6 * (i.dv + 2 * (o.dv + s.dv) + u.dv); return n.x = n.x + l * a, n.v = n.v + c * a, n; } return function n(a, i, o) { var s = { x: -1, v: 0, tension: null, friction: null }, u = [0], l = 0, c = 1 / 1e4, d = 16 / 1e3, v, h, f; for (a = parseFloat(a) || 500, i = parseFloat(i) || 20, o = o || null, s.tension = a, s.friction = i, v = o !== null, v ? (l = n(a, i), h = l / o * d) : h = d; f = r(f || s, h), u.push(1 + f.x), l += 16, Math.abs(f.x) > c && Math.abs(f.v) > c; ) ; return v ? function(p) { return u[p * (u.length - 1) | 0]; } : l; }; }(), ct = function(e, r, n, a) { var i = JD(e, r, n, a); return function(o, s, u) { return o + (s - o) * i(u); }; }, vs = { linear: function(e, r, n) { return e + (r - e) * n; }, // default easings ease: ct(0.25, 0.1, 0.25, 1), "ease-in": ct(0.42, 0, 1, 1), "ease-out": ct(0, 0, 0.58, 1), "ease-in-out": ct(0.42, 0, 0.58, 1), // sine "ease-in-sine": ct(0.47, 0, 0.745, 0.715), "ease-out-sine": ct(0.39, 0.575, 0.565, 1), "ease-in-out-sine": ct(0.445, 0.05, 0.55, 0.95), // quad "ease-in-quad": ct(0.55, 0.085, 0.68, 0.53), "ease-out-quad": ct(0.25, 0.46, 0.45, 0.94), "ease-in-out-quad": ct(0.455, 0.03, 0.515, 0.955), // cubic "ease-in-cubic": ct(0.55, 0.055, 0.675, 0.19), "ease-out-cubic": ct(0.215, 0.61, 0.355, 1), "ease-in-out-cubic": ct(0.645, 0.045, 0.355, 1), // quart "ease-in-quart": ct(0.895, 0.03, 0.685, 0.22), "ease-out-quart": ct(0.165, 0.84, 0.44, 1), "ease-in-out-quart": ct(0.77, 0, 0.175, 1), // quint "ease-in-quint": ct(0.755, 0.05, 0.855, 0.06), "ease-out-quint": ct(0.23, 1, 0.32, 1), "ease-in-out-quint": ct(0.86, 0, 0.07, 1), // expo "ease-in-expo": ct(0.95, 0.05, 0.795, 0.035), "ease-out-expo": ct(0.19, 1, 0.22, 1), "ease-in-out-expo": ct(1, 0, 0, 1), // circ "ease-in-circ": ct(0.6, 0.04, 0.98, 0.335), "ease-out-circ": ct(0.075, 0.82, 0.165, 1), "ease-in-out-circ": ct(0.785, 0.135, 0.15, 0.86), // user param easings... spring: function(e, r, n) { if (n === 0) return vs.linear; var a = eP(e, r, n); return function(i, o, s) { return i + (o - i) * a(s); }; }, "cubic-bezier": ct }; function Uf(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 Gf(t, e) { return t.pfValue != null || t.value != null ? t.pfValue != null && (e == null || e.type.units !== "%") ? t.pfValue : t.value : t; } function Ma(t, e, r, n, a) { var i = a != null ? a.type : null; r < 0 ? r = 0 : r > 1 && (r = 1); var o = Gf(t, a), s = Gf(e, a); if (be(o) && be(s)) return Uf(i, o, s, r, n); if (st(o) && st(s)) { for (var u = [], l = 0; l < s.length; l++) { var c = o[l], d = s[l]; if (c != null && d != null) { var v = Uf(i, c, d, r, n); u.push(v); } else u.push(d); } return u; } } function tP(t, e, r, n) { var a = !n, i = t._private, o = e._private, s = o.easing, u = o.startTime, l = n ? t : t.cy(), c = l.style(); if (!o.easingImpl) if (s == null) o.easingImpl = vs.linear; else { var d; if (Fe(s)) { var v = c.parse("transition-timing-function", s); d = v.value; } else d = s; var h, f; Fe(d) ? (h = d, f = []) : (h = d[1], f = d.slice(2).map(function(R) { return +R; })), f.length > 0 ? (h === "spring" && f.push(o.duration), o.easingImpl = vs[h].apply(null, f)) : o.easingImpl = vs[h]; } var p = o.easingImpl, m; if (o.duration === 0 ? m = 1 : m = (r - u) / o.duration, o.applying && (m = o.progress), m < 0 ? m = 0 : m > 1 && (m = 1), o.delay == null) { var g = o.startPosition, y = o.position; if (y && a && !t.locked()) { var b = {}; Fi(g.x, y.x) && (b.x = Ma(g.x, y.x, m, p)), Fi(g.y, y.y) && (b.y = Ma(g.y, y.y, m, p)), t.position(b); } var w = o.startPan, C = o.pan, E = i.pan, x = C != null && n; x && (Fi(w.x, C.x) && (E.x = Ma(w.x, C.x, m, p)), Fi(w.y, C.y) && (E.y = Ma(w.y, C.y, m, p)), t.emit("pan")); var T = o.startZoom, k = o.zoom, _ = k != null && n; _ && (Fi(T, k) && (i.zoom = io(i.minZoom, Ma(T, k, m, p), i.maxZoom)), t.emit("zoom")), (x || _) && t.emit("viewport"); var D = o.style; if (D && D.length > 0 && a) { for (var O = 0; O < D.length; O++) { var F = D[O], L = F.name, B = F, I = o.startStyle[L], M = c.properties[I.name], A = Ma(I, B, m, p, M); c.overrideBypass(t, L, A); } t.emit("style"); } } return o.progress = m, m; } function Fi(t, e) { return t == null || e == null ? !1 : be(t) && be(e) ? !0 : !!(t && e); } function rP(t, e, r, n) { var a = e._private; a.started = !0, a.startTime = r - a.progress * a.duration; } function Wf(t, e) { var r = e._private.aniEles, n = []; function a(c, d) { var v = c._private, h = v.animation.current, f = v.animation.queue, p = !1; if (h.length === 0) { var m = f.shift(); m && h.push(m); } for (var g = function(E) { for (var x = E.length - 1; x >= 0; x--) { var T = E[x]; T(); } E.splice(0, E.length); }, y = h.length - 1; y >= 0; y--) { var b = h[y], w = b._private; if (w.stopped) { h.splice(y, 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 || rP(c, b, t), tP(c, b, t, d), w.applying && (w.applying = !1), g(w.frames), w.step != null && w.step(t), b.completed() && (h.splice(y, 1), w.hooked = !1, w.playing = !1, w.started = !1, g(w.completes)), p = !0); } return !d && h.length === 0 && f.length === 0 && n.push(c), p; } for (var i = !1, o = 0; o < r.length; o++) { var s = r[o], u = a(s); i = i || u; } var l = a(e, !0); (i || l) && (r.length > 0 ? e.notify("draw", r) : e.notify("draw")), r.unmerge(n), e.emit("step"); } var nP = { // pull in animation functions animate: et.animate(), animation: et.animation(), animated: et.animated(), clearQueue: et.clearQueue(), delay: et.delay(), delayAnimation: et.delayAnimation(), stop: et.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 && Ps(function(i) { Wf(i, e), r(); }); } var n = e.renderer(); n && n.beforeRender ? n.beforeRender(function(i, o) { Wf(o, e); }, n.beforeRenderPriorities.animations) : r(); } }, aP = { 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 && Do(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; } }, ts = function(e) { return Fe(e) ? new Un(e) : e; }, jp = { createEmitter: function() { var e = this._private; return e.emitter || (e.emitter = new ul(aP, this)), this; }, emitter: function() { return this._private.emitter; }, on: function(e, r, n) { return this.emitter().on(e, ts(r), n), this; }, removeListener: function(e, r, n) { return this.emitter().removeListener(e, ts(r), n), this; }, removeAllListeners: function() { return this.emitter().removeAllListeners(), this; }, one: function(e, r, n) { return this.emitter().one(e, ts(r), n), this; }, once: function(e, r, n) { return this.emitter().one(e, ts(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; } }; et.eventAliasesOn(jp); var vu = { 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); } }; vu.jpeg = vu.jpg; var hs = { layout: function(e) { var r = this; if (e == null) { yt("Layout options must be specified to make a layout"); return; } if (e.name == null) { yt("A `name` must be specified to make a layout"); return; } var n = e.name, a = r.extension("layout", n); if (a == null) { yt("No such layout `" + n + "` found. Did you forget to import it and `cytoscape.use()` it?"); return; } var i; Fe(e.eles) ? i = r.$(e.eles) : i = e.eles != null ? e.eles : r.$(); var o = new a(Re({}, e, { cy: r, eles: i })); return o; } }; hs.createLayout = hs.makeLayout = hs.layout; var iP = { 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; }, // for backwards compatibility 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], o = e[i], s = r.getElementById(i); s.data(o); } }); } }, oP = Wt({ hideEdgesOnViewport: !1, textureOnViewport: !1, motionBlur: !1, motionBlurOpacity: 0.05, pixelRatio: void 0, desktopTapThreshold: 4, touchTapThreshold: 8, wheelSensitivity: 1, debug: !1, showFps: !1 }), hu = { 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) { yt("Can not initialise: No such renderer `".concat(e.name, "` found. Did you forget to import it and `cytoscape.use()` it?")); return; } e.wheelSensitivity !== void 0 && tt("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 = oP(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); } }; hu.invalidateDimensions = hu.resize; var ps = { // get a collection // - empty collection on no args // - collection of elements in the graph on selector arg // - guarantee a returned collection when elements or collection specified collection: function(e, r) { return Fe(e) ? this.$(e) : yr(e) ? e.collection() : st(e) ? (r || (r = {}), new Gt(this, e, r.unique, r.removed)) : new Gt(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; }, // search the graph like jQuery $: function(e) { var r = this._private.elements; return e ? r.filter(e) : r.spawnSelf(); }, mutableElements: function() { return this._private.elements; } }; ps.elements = ps.filter = ps.$; var ir = {}, Ki = "t", sP = "f"; ir.apply = function(t) { for (var e = this, r = e._private, n = r.cy, a = n.collection(), i = 0; i < t.length; i++) { var o = t[i], s = e.getContextMeta(o); if (!s.empty) { var u = e.getContextStyle(s), l = e.applyContextStyle(s, u, o); o._private.appliedInitStyle ? e.updateTransitions(o, l.diffProps) : o._private.appliedInitStyle = !0; var c = e.updateStyleHints(o); c && a.push(o); } } return a; }; ir.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 o = [], s = {}, u = 0; u < r.length; u++) { var l = r[u], c = t[u] === Ki, d = e[u] === Ki, v = c !== d, h = l.mappedProperties.length > 0; if (v || d && h) { var f = void 0; v && h || v ? f = l.properties : h && (f = l.mappedProperties); for (var p = 0; p < f.length; p++) { for (var m = f[p], g = m.name, y = !1, b = u + 1; b < r.length; b++) { var w = r[b], C = e[b] === Ki; if (C && (y = w.properties[m.name] != null, y)) break; } !s[g] && !y && (s[g] = !0, o.push(g)); } } } return n[a] = o, o; }; ir.getContextMeta = function(t) { for (var e = this, r = "", n, a = t._private.styleCxtKey || "", i = 0; i < e.length; i++) { var o = e[i], s = o.selector && o.selector.matches(t); s ? r += Ki : r += sP; } return n = e.getPropertiesDiff(a, r), t._private.styleCxtKey = r, { key: r, diffPropNames: n, empty: n.length === 0 }; }; ir.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 o = r[i], s = e[i] === Ki; if (s) for (var u = 0; u < o.properties.length; u++) { var l = o.properties[u]; a[l.name] = l; } } return n[e] = a, a; }; ir.applyContextStyle = function(t, e, r) { for (var n = this, a = t.diffPropNames, i = {}, o = n.types, s = 0; s < a.length; s++) { var u = a[s], l = e[u], c = r.pstyle(u); if (!l) if (c) c.bypass ? l = { name: u, deleteBypassed: !0 } : l = { name: u, delete: !0 }; else continue; if (c !== l) { if (l.mapped === o.fn && c != null && c.mapping != null && c.mapping.value === l.value) { var d = c.mapping, v = d.fnValue = l.value(r); if (v === d.prevFnValue) continue; } var h = i[u] = { prev: c }; n.applyParsedProperty(r, l), h.next = r.pstyle(u), h.next && h.next.bypass && (h.next = h.next.bypassed); } } return { diffProps: i }; }; ir.updateStyleHints = function(t) { var e = t._private, r = this, n = r.propertyGroupNames, a = r.propertyGroupKeys, i = function(Q, ge, Ee) { return r.getPropertiesHash(Q, ge, Ee); }, o = e.styleKey; if (t.removed()) return !1; var s = e.group === "nodes", u = t._private.style; n = Object.keys(u); for (var l = 0; l < a.length; l++) { var c = a[l]; e.styleKeys[c] = [Va, Bi]; } for (var d = function(Q, ge) { return e.styleKeys[ge][0] = ro(Q, e.styleKeys[ge][0]); }, v = function(Q, ge) { return e.styleKeys[ge][1] = no(Q, e.styleKeys[ge][1]); }, h = function(Q, ge) { d(Q, ge), v(Q, ge); }, f = function(Q, ge) { for (var Ee = 0; Ee < Q.length; Ee++) { var fe = Q.charCodeAt(Ee); d(fe, ge), v(fe, ge); } }, p = 2e9, m = function(Q) { return -128 < Q && Q < 128 && Math.floor(Q) !== Q ? p - (Q * 1024 | 0) : Q; }, g = 0; g < n.length; g++) { var y = n[g], b = u[y]; if (b != null) { var w = this.properties[y], C = w.type, E = w.groupKey, x = void 0; w.hashOverride != null ? x = w.hashOverride(t, b) : b.pfValue != null && (x = b.pfValue); var T = w.enums == null ? b.value : null, k = x != null, _ = T != null, D = k || _, O = b.units; if (C.number && D && !C.multiple) { var F = k ? x : T; h(m(F), E), !k && O != null && f(O, E); } else f(b.strValue, E); } } for (var L = [Va, Bi], B = 0; B < a.length; B++) { var I = a[B], M = e.styleKeys[I]; L[0] = ro(M[0], L[0]), L[1] = no(M[1], L[1]); } e.styleKey = f5(L[0], L[1]); var A = e.styleKeys; e.labelDimsKey = Dn(A.labelDimensions); var R = i(t, ["label"], A.labelDimensions); if (e.labelKey = Dn(R), e.labelStyleKey = Dn(Go(A.commonLabel, R)), !s) { var K = i(t, ["source-label"], A.labelDimensions); e.sourceLabelKey = Dn(K), e.sourceLabelStyleKey = Dn(Go(A.commonLabel, K)); var H = i(t, ["target-label"], A.labelDimensions); e.targetLabelKey = Dn(H), e.targetLabelStyleKey = Dn(Go(A.commonLabel, H)); } if (s) { var q = e.styleKeys, ee = q.nodeBody, se = q.nodeBorder, oe = q.nodeOutline, ne = q.backgroundImage, ue = q.compound, te = q.pie, $ = [ee, se, oe, ne, ue, te].filter(function(G) { return G != null; }).reduce(Go, [Va, Bi]); e.nodeKey = Dn($), e.hasPie = te != null && te[0] !== Va && te[1] !== Bi; } return o !== e.styleKey; }; ir.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; }; ir.applyParsedProperty = function(t, e) { var r = this, n = e, a = t._private.style, i, o = r.types, s = r.properties[n.name].type, u = n.bypass, l = a[n.name], c = l && l.bypass, d = t._private, v = "mapping", h = function(ee) { return ee == null ? null : ee.pfValue != null ? ee.pfValue : ee.value; }, f = function() { var ee = h(l), se = h(n); r.checkTriggers(t, n.name, ee, se); }; if (e.name === "curve-style" && t.isEdge() && // loops must be bundled beziers (e.value !== "bezier" && t.isLoop() || // edges connected to compound nodes can not be haystacks e.value === "haystack" && (t.source().isParent() || t.target().isParent())) && (n = e = this.parse(e.name, "bezier", u)), n.delete) return a[n.name] = void 0, f(), !0; if (n.deleteBypassed) return l ? l.bypass ? (l.bypassed = void 0, f(), !0) : !1 : (f(), !0); if (n.deleteBypass) return l ? l.bypass ? (a[n.name] = l.bypassed, f(), !0) : !1 : (f(), !0); var p = function() { tt("Do not assign mappings to elements without corresponding data (i.e. ele `" + t.id() + "` has no mapping for property `" + n.name + "` with data field `" + n.field + "`); try a `[" + n.field + "]` selector to limit scope to elements with `" + n.field + "` defined"); }; switch (n.mapped) { case o.mapData: { for (var m = n.field.split("."), g = d.data, y = 0; y < m.length && g; y++) { var b = m[y]; g = g[b]; } if (g == null) return p(), !1; var w; if (be(g)) { var C = n.fieldMax - n.fieldMin; C === 0 ? w = 0 : w = (g - n.fieldMin) / C; } else return tt("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), s.color) { var E = n.valueMin[0], x = n.valueMax[0], T = n.valueMin[1], k = n.valueMax[1], _ = n.valueMin[2], D = n.valueMax[2], O = n.valueMin[3] == null ? 1 : n.valueMin[3], F = n.valueMax[3] == null ? 1 : n.valueMax[3], L = [Math.round(E + (x - E) * w), Math.round(T + (k - T) * w), Math.round(_ + (D - _) * w), Math.round(O + (F - O) * w)]; i = { // colours are simple, so just create the flat property instead of expensive string parsing bypass: n.bypass, // we're a bypass if the mapping property is a bypass name: n.name, value: L, strValue: "rgb(" + L[0] + ", " + L[1] + ", " + L[2] + ")" }; } else if (s.number) { var B = n.valueMin + (n.valueMax - n.valueMin) * w; i = this.parse(n.name, B, n.bypass, v); } else return !1; if (!i) return p(), !1; i.mapping = n, n = i; break; } case o.data: { for (var I = n.field.split("."), M = d.data, A = 0; A < I.length && M; A++) { var R = I[A]; M = M[R]; } if (M != null && (i = this.parse(n.name, M, n.bypass, v)), !i) return p(), !1; i.mapping = n, n = i; break; } case o.fn: { var K = n.value, H = n.fnValue != null ? n.fnValue : K(t); if (n.prevFnValue = H, H == null) return tt("Custom function mappers may not return null (i.e. `" + n.name + "` for ele `" + t.id() + "` is null)"), !1; if (i = this.parse(n.name, H, n.bypass, v), !i) return tt("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 = Zr(n), n = i; break; } case void 0: break; default: return !1; } return u ? (c ? n.bypassed = l.bypassed : n.bypassed = l, a[n.name] = n) : c ? l.bypassed = n : a[n.name] = n, f(), !0; }; ir.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), o = 0; o < i.length; o++) { var s = i[o], u = a[s]; u != null && (u.bypass ? u.bypassed = null : a[s] = null); } } }; ir.update = function() { var t = this._private.cy, e = t.mutableElements(); e.updateStyle(); }; ir.updateTransitions = function(t, e) { var r = this, n = t._private, a = t.pstyle("transition-property").value, i = t.pstyle("transition-duration").pfValue, o = t.pstyle("transition-delay").pfValue; if (a.length > 0 && i > 0) { for (var s = {}, u = !1, l = 0; l < a.length; l++) { var c = a[l], d = t.pstyle(c), v = e[c]; if (v) { var h = v.prev, f = h, p = v.next != null ? v.next : d, m = !1, g = void 0, y = 1e-6; f && (be(f.pfValue) && be(p.pfValue) ? (m = p.pfValue - f.pfValue, g = f.pfValue + y * m) : be(f.value) && be(p.value) ? (m = p.value - f.value, g = f.value + y * m) : st(f.value) && st(p.value) && (m = f.value[0] !== p.value[0] || f.value[1] !== p.value[1] || f.value[2] !== p.value[2], g = f.strValue), m && (s[c] = p.strValue, this.applyBypass(t, c, g), u = !0)); } } if (!u) return; n.transitioning = !0, new hi(function(b) { o > 0 ? t.delayAnimation(o).play().promise().then(b) : b(); }).then(function() { return t.animation({ style: s, 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); }; ir.checkTrigger = function(t, e, r, n, a, i) { var o = this.properties[e], s = a(o); s != null && s(r, n) && i(o); }; ir.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); }); }; ir.checkBoundsTrigger = function(t, e, r, n) { this.checkTrigger(t, e, r, n, function(a) { return a.triggersBounds; }, function(a) { t.dirtyCompoundBoundsCache(), t.dirtyBoundingBoxCache(), // only for beziers -- so performance of other edges isn't affected a.triggersBoundsOfParallelBeziers && e === "curve-style" && (r === "bezier" || n === "bezier") && t.parallelEdges().forEach(function(i) { i.isBundledBezier() && i.dirtyBoundingBoxCache(); }), a.triggersBoundsOfConnectedEdges && e === "display" && (r === "none" || n === "none") && t.connectedEdges().forEach(function(i) { i.dirtyBoundingBoxCache(); }); }); }; ir.checkTriggers = function(t, e, r, n) { t.dirtyStyleCache(), this.checkZOrderTrigger(t, e, r, n), this.checkBoundsTrigger(t, e, r, n); }; var Io = {}; Io.applyBypass = function(t, e, r, n) { var a = this, i = [], o = !0; if (e === "*" || e === "**") { if (r !== void 0) for (var s = 0; s < a.properties.length; s++) { var u = a.properties[s], l = u.name, c = this.parse(l, r, !0); c && i.push(c); } } else if (Fe(e)) { var d = this.parse(e, r, !0); d && i.push(d); } else if (Xe(e)) { var v = e; n = r; for (var h = Object.keys(v), f = 0; f < h.length; f++) { var p = h[f], m = v[p]; if (m === void 0 && (m = v[Js(p)]), m !== void 0) { var g = this.parse(p, m, !0); g && i.push(g); } } } else return !1; if (i.length === 0) return !1; for (var y = !1, b = 0; b < t.length; b++) { for (var w = t[b], C = {}, E = void 0, x = 0; x < i.length; x++) { var T = i[x]; if (n) { var k = w.pstyle(T.name); E = C[T.name] = { prev: k }; } y = this.applyParsedProperty(w, Zr(T)) || y, n && (E.next = w.pstyle(T.name)); } y && this.updateStyleHints(w), n && this.updateTransitions(w, C, o); } return y; }; Io.overrideBypass = function(t, e, r) { e = lc(e); for (var n = 0; n < t.length; n++) { var a = t[n], i = a._private.style[e], o = this.properties[e].type, s = o.color, u = o.mutiple, l = 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), s ? i.strValue = "rgb(" + r.join(",") + ")" : u ? i.strValue = r.join(" ") : i.strValue = "" + r, this.updateStyleHints(a)), this.checkTriggers(a, e, l, r); } }; Io.removeAllBypasses = function(t, e) { return this.removeBypasses(t, this.propertyNames, e); }; Io.removeBypasses = function(t, e, r) { for (var n = !0, a = 0; a < t.length; a++) { for (var i = t[a], o = {}, s = 0; s < e.length; s++) { var u = e[s], l = this.properties[u], c = i.pstyle(l.name); if (!(!c || !c.bypass)) { var d = "", v = this.parse(u, d, !0), h = o[l.name] = { prev: c }; this.applyParsedProperty(i, v), h.next = i.pstyle(l.name); } } this.updateStyleHints(i), r && this.updateTransitions(i, o, n); } }; var Cc = {}; Cc.getEmSizeInPixels = function() { var t = this.containerCss("font-size"); return t != null ? parseFloat(t) : 1; }; Cc.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 rn = {}; rn.getRenderedStyle = function(t, e) { return e ? this.getStylePropertyValue(t, e, !0) : this.getRawStyle(t, !0); }; rn.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], o = r.getStylePropertyValue(t, i.name, e); o != null && (n[i.name] = o, n[Js(i.name)] = o); } return n; } }; rn.getIndexedStyle = function(t, e, r, n) { var a = t.pstyle(e)[r][n]; return a ?? t.cy().style().getDefaultProperty(e)[r][0]; }; rn.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, o = t.pstyle(a.name); if (o) { var s = o.value, u = o.units, l = o.strValue; if (r && i.number && s != null && be(s)) { var c = t.cy().zoom(), d = function(m) { return m * c; }, v = function(m, g) { return d(m) + g; }, h = st(s), f = h ? u.every(function(p) { return p != null; }) : u != null; return f ? h ? s.map(function(p, m) { return v(p, u[m]); }).join(" ") : v(s, u) : h ? s.map(function(p) { return Fe(p) ? p : "" + d(p); }).join(" ") : "" + d(s); } else if (l != null) return l; } return null; } }; rn.getAnimationStartStyle = function(t, e) { for (var r = {}, n = 0; n < e.length; n++) { var a = e[n], i = a.name, o = t.pstyle(i); o !== void 0 && (Xe(o) ? o = this.parse(i, o.strValue) : o = this.parse(i, o)), o && (r[i] = o); } return r; }; rn.getPropsList = function(t) { var e = this, r = [], n = t, a = e.properties; if (n) for (var i = Object.keys(n), o = 0; o < i.length; o++) { var s = i[o], u = n[s], l = a[s] || a[lc(s)], c = this.parse(l.name, u); c && r.push(c); } return r; }; rn.getNonDefaultPropertiesHash = function(t, e, r) { var n = r.slice(), a, i, o, s, u, l; for (u = 0; u < e.length; u++) if (a = e[u], i = t.pstyle(a, !1), i != null) if (i.pfValue != null) n[0] = ro(s, n[0]), n[1] = no(s, n[1]); else for (o = i.strValue, l = 0; l < o.length; l++) s = o.charCodeAt(l), n[0] = ro(s, n[0]), n[1] = no(s, n[1]); return n; }; rn.getPropertiesHash = rn.getNonDefaultPropertiesHash; var fl = {}; fl.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, o = Object.keys(i); e.selector(a); for (var s = 0; s < o.length; s++) { var u = o[s], l = i[u]; e.css(u, l); } } return e; }; fl.fromJson = function(t) { var e = this; return e.resetToDefault(), e.appendFromJson(t), e; }; fl.json = function() { for (var t = [], e = this.defaultLength; e < this.length; e++) { for (var r = this[e], n = r.selector, a = r.properties, i = {}, o = 0; o < a.length; o++) { var s = a[o]; i[s.name] = s.strValue; } t.push({ selector: n ? n.toString() : "core", style: i }); } return t; }; var Ec = {}; Ec.appendFromString = function(t) { var e = this, r = this, n = "" + t, a, i, o; n = n.replace(/[/][*](\s|.)+?[*][/]/g, ""); function s() { n.length > a.length ? n = n.substr(a.length) : n = ""; } function u() { i.length > o.length ? i = i.substr(o.length) : i = ""; } for (; ; ) { var l = n.match(/^\s*$/); if (l) break; var c = n.match(/^\s*((?:.|\s)+?)\s*\{((?:.|\s)+?)\}/); if (!c) { tt("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 v = new Un(d); if (v.invalid) { tt("Skipping parsing of block: Invalid selector found in string stylesheet: " + d), s(); continue; } } var h = c[2], f = !1; i = h; for (var p = []; ; ) { var m = i.match(/^\s*$/); if (m) break; var g = i.match(/^\s*(.+?)\s*:\s*(.+?)(?:\s*;|\s*$)/); if (!g) { tt("Skipping parsing of block: Invalid formatting of style property and value definitions found in:" + h), f = !0; break; } o = g[0]; var y = g[1], b = g[2], w = e.properties[y]; if (!w) { tt("Skipping property: Invalid property name in: " + o), u(); continue; } var C = r.parse(y, b); if (!C) { tt("Skipping property: Invalid property definition in: " + o), u(); continue; } p.push({ name: y, val: b }), u(); } if (f) { s(); break; } r.selector(d); for (var E = 0; E < p.length; E++) { var x = p[E]; r.css(x.name, x.val); } s(); } return r; }; Ec.fromString = function(t) { var e = this; return e.resetToDefault(), e.appendFromString(t), e; }; var Rt = {}; (function() { var t = It, e = pT, r = mT, n = yT, a = bT, i = function($) { return "^" + $ + "\\s*\\(\\s*([\\w\\.]+)\\s*\\)$"; }, o = function($) { var G = t + "|\\w+|" + e + "|" + r + "|" + n + "|" + a; return "^" + $ + "\\s*\\(([\\w\\.]+)\\s*\\,\\s*(" + t + ")\\s*\\,\\s*(" + t + ")\\s*,\\s*(" + G + ")\\s*\\,\\s*(" + G + ")\\)$"; }, s = [`^url\\s*\\(\\s*['"]?(.+?)['"]?\\s*\\)$`, "^(none)$", "^(.+)$"]; Rt.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 }, // allows negative bidirectionalSizeMaybePercent: { number: !0, allowPercent: !0 }, // allows negative bidirectionalSizes: { number: !0, multiple: !0 }, // allows negative sizeMaybePercent: { number: !0, min: 0, allowPercent: !0 }, axisDirection: { enums: ["horizontal", "leftward", "rightward", "vertical", "upward", "downward", "auto"] }, 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 }, 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"] }, 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: o("mapData") }, mapLayoutData: { mapping: !0, regex: o("mapLayoutData") }, mapScratch: { mapping: !0, regex: o("mapScratch") }, fn: { mapping: !0, fn: !0 }, url: { regexes: s, singleRegexMatchValue: !0 }, urls: { regexes: s, 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($, G) { switch ($.length) { case 2: return G[0] !== "deg" && G[0] !== "rad" && G[1] !== "deg" && G[1] !== "rad"; case 1: return Fe($[0]) || G[0] === "deg" || G[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" // different order ] }, boundsExpansion: { number: !0, multiple: !0, min: 0, validate: function($) { var G = $.length; return G === 1 || G === 2 || G === 4; } } }; var u = { zeroNonZero: function($, G) { return ($ == null || G == null) && $ !== G || $ == 0 && G != 0 ? !0 : $ != 0 && G == 0; }, any: function($, G) { return $ != G; }, emptyNonEmpty: function($, G) { var Q = qn($), ge = qn(G); return Q && !ge || !Q && ge; } }, l = Rt.types, c = [{ name: "label", type: l.text, triggersBounds: u.any, triggersZOrder: u.emptyNonEmpty }, { name: "text-rotation", type: l.textRotation, triggersBounds: u.any }, { name: "text-margin-x", type: l.bidirectionalSize, triggersBounds: u.any }, { name: "text-margin-y", type: l.bidirectionalSize, triggersBounds: u.any }], d = [{ name: "source-label", type: l.text, triggersBounds: u.any }, { name: "source-text-rotation", type: l.textRotation, triggersBounds: u.any }, { name: "source-text-margin-x", type: l.bidirectionalSize, triggersBounds: u.any }, { name: "source-text-margin-y", type: l.bidirectionalSize, triggersBounds: u.any }, { name: "source-text-offset", type: l.size, triggersBounds: u.any }], v = [{ name: "target-label", type: l.text, triggersBounds: u.any }, { name: "target-text-rotation", type: l.textRotation, triggersBounds: u.any }, { name: "target-text-margin-x", type: l.bidirectionalSize, triggersBounds: u.any }, { name: "target-text-margin-y", type: l.bidirectionalSize, triggersBounds: u.any }, { name: "target-text-offset", type: l.size, triggersBounds: u.any }], h = [{ name: "font-family", type: l.fontFamily, triggersBounds: u.any }, { name: "font-style", type: l.fontStyle, triggersBounds: u.any }, { name: "font-weight", type: l.fontWeight, triggersBounds: u.any }, { name: "font-size", type: l.size, triggersBounds: u.any }, { name: "text-transform", type: l.textTransform, triggersBounds: u.any }, { name: "text-wrap", type: l.textWrap, triggersBounds: u.any }, { name: "text-overflow-wrap", type: l.textOverflowWrap, triggersBounds: u.any }, { name: "text-max-width", type: l.size, triggersBounds: u.any }, { name: "text-outline-width", type: l.size, triggersBounds: u.any }, { name: "line-height", type: l.positiveNumber, triggersBounds: u.any }], f = [{ name: "text-valign", type: l.valign, triggersBounds: u.any }, { name: "text-halign", type: l.halign, triggersBounds: u.any }, { name: "color", type: l.color }, { name: "text-outline-color", type: l.color }, { name: "text-outline-opacity", type: l.zeroOneNumber }, { name: "text-background-color", type: l.color }, { name: "text-background-opacity", type: l.zeroOneNumber }, { name: "text-background-padding", type: l.size, triggersBounds: u.any }, { name: "text-border-opacity", type: l.zeroOneNumber }, { name: "text-border-color", type: l.color }, { name: "text-border-width", type: l.size, triggersBounds: u.any }, { name: "text-border-style", type: l.borderStyle, triggersBounds: u.any }, { name: "text-background-shape", type: l.textBackgroundShape, triggersBounds: u.any }, { name: "text-justification", type: l.justification }], p = [{ name: "events", type: l.bool, triggersZOrder: u.any }, { name: "text-events", type: l.bool, triggersZOrder: u.any }], m = [{ name: "display", type: l.display, triggersZOrder: u.any, triggersBounds: u.any, triggersBoundsOfConnectedEdges: !0 }, { name: "visibility", type: l.visibility, triggersZOrder: u.any }, { name: "opacity", type: l.zeroOneNumber, triggersZOrder: u.zeroNonZero }, { name: "text-opacity", type: l.zeroOneNumber }, { name: "min-zoomed-font-size", type: l.size }, { name: "z-compound-depth", type: l.zCompoundDepth, triggersZOrder: u.any }, { name: "z-index-compare", type: l.zIndexCompare, triggersZOrder: u.any }, { name: "z-index", type: l.number, triggersZOrder: u.any }], g = [{ name: "overlay-padding", type: l.size, triggersBounds: u.any }, { name: "overlay-color", type: l.color }, { name: "overlay-opacity", type: l.zeroOneNumber, triggersBounds: u.zeroNonZero }, { name: "overlay-shape", type: l.overlayShape, triggersBounds: u.any }, { name: "overlay-corner-radius", type: l.cornerRadius }], y = [{ name: "underlay-padding", type: l.size, triggersBounds: u.any }, { name: "underlay-color", type: l.color }, { name: "underlay-opacity", type: l.zeroOneNumber, triggersBounds: u.zeroNonZero }, { name: "underlay-shape", type: l.overlayShape, triggersBounds: u.any }, { name: "underlay-corner-radius", type: l.cornerRadius }], b = [{ name: "transition-property", type: l.propList }, { name: "transition-duration", type: l.time }, { name: "transition-delay", type: l.time }, { name: "transition-timing-function", type: l.easing }], w = function($, G) { return G.value === "label" ? -$.poolIndex() : G.pfValue; }, C = [{ name: "height", type: l.nodeSize, triggersBounds: u.any, hashOverride: w }, { name: "width", type: l.nodeSize, triggersBounds: u.any, hashOverride: w }, { name: "shape", type: l.nodeShape, triggersBounds: u.any }, { name: "shape-polygon-points", type: l.polygonPointList, triggersBounds: u.any }, { name: "corner-radius", type: l.cornerRadius }, { name: "background-color", type: l.color }, { name: "background-fill", type: l.fill }, { name: "background-opacity", type: l.zeroOneNumber }, { name: "background-blacken", type: l.nOneOneNumber }, { name: "background-gradient-stop-colors", type: l.colors }, { name: "background-gradient-stop-positions", type: l.percentages }, { name: "background-gradient-direction", type: l.gradientDirection }, { name: "padding", type: l.sizeMaybePercent, triggersBounds: u.any }, { name: "padding-relative-to", type: l.paddingRelativeTo, triggersBounds: u.any }, { name: "bounds-expansion", type: l.boundsExpansion, triggersBounds: u.any }], E = [{ name: "border-color", type: l.color }, { name: "border-opacity", type: l.zeroOneNumber }, { name: "border-width", type: l.size, triggersBounds: u.any }, { name: "border-style", type: l.borderStyle }, { name: "border-cap", type: l.lineCap }, { name: "border-join", type: l.lineJoin }, { name: "border-dash-pattern", type: l.numbers }, { name: "border-dash-offset", type: l.number }, { name: "border-position", type: l.linePosition }], x = [{ name: "outline-color", type: l.color }, { name: "outline-opacity", type: l.zeroOneNumber }, { name: "outline-width", type: l.size, triggersBounds: u.any }, { name: "outline-style", type: l.borderStyle }, { name: "outline-offset", type: l.size, triggersBounds: u.any }], T = [{ name: "background-image", type: l.urls }, { name: "background-image-crossorigin", type: l.bgCrossOrigin }, { name: "background-image-opacity", type: l.zeroOneNumbers }, { name: "background-image-containment", type: l.bgContainment }, { name: "background-image-smoothing", type: l.bools }, { name: "background-position-x", type: l.bgPos }, { name: "background-position-y", type: l.bgPos }, { name: "background-width-relative-to", type: l.bgRelativeTo }, { name: "background-height-relative-to", type: l.bgRelativeTo }, { name: "background-repeat", type: l.bgRepeat }, { name: "background-fit", type: l.bgFit }, { name: "background-clip", type: l.bgClip }, { name: "background-width", type: l.bgWH }, { name: "background-height", type: l.bgWH }, { name: "background-offset-x", type: l.bgPos }, { name: "background-offset-y", type: l.bgPos }], k = [{ name: "position", type: l.position, triggersBounds: u.any }, { name: "compound-sizing-wrt-labels", type: l.compoundIncludeLabels, triggersBounds: u.any }, { name: "min-width", type: l.size, triggersBounds: u.any }, { name: "min-width-bias-left", type: l.sizeMaybePercent, triggersBounds: u.any }, { name: "min-width-bias-right", type: l.sizeMaybePercent, triggersBounds: u.any }, { name: "min-height", type: l.size, triggersBounds: u.any }, { name: "min-height-bias-top", type: l.sizeMaybePercent, triggersBounds: u.any }, { name: "min-height-bias-bottom", type: l.sizeMaybePercent, triggersBounds: u.any }], _ = [{ name: "line-style", type: l.lineStyle }, { name: "line-color", type: l.color }, { name: "line-fill", type: l.fill }, { name: "line-cap", type: l.lineCap }, { name: "line-opacity", type: l.zeroOneNumber }, { name: "line-dash-pattern", type: l.numbers }, { name: "line-dash-offset", type: l.number }, { name: "line-outline-width", type: l.size }, { name: "line-outline-color", type: l.color }, { name: "line-gradient-stop-colors", type: l.colors }, { name: "line-gradient-stop-positions", type: l.percentages }, { name: "curve-style", type: l.curveStyle, triggersBounds: u.any, triggersBoundsOfParallelBeziers: !0 }, { name: "haystack-radius", type: l.zeroOneNumber, triggersBounds: u.any }, { name: "source-endpoint", type: l.edgeEndpoint, triggersBounds: u.any }, { name: "target-endpoint", type: l.edgeEndpoint, triggersBounds: u.any }, { name: "control-point-step-size", type: l.size, triggersBounds: u.any }, { name: "control-point-distances", type: l.bidirectionalSizes, triggersBounds: u.any }, { name: "control-point-weights", type: l.numbers, triggersBounds: u.any }, { name: "segment-distances", type: l.bidirectionalSizes, triggersBounds: u.any }, { name: "segment-weights", type: l.numbers, triggersBounds: u.any }, { name: "segment-radii", type: l.numbers, triggersBounds: u.any }, { name: "radius-type", type: l.radiusType, triggersBounds: u.any }, { name: "taxi-turn", type: l.bidirectionalSizeMaybePercent, triggersBounds: u.any }, { name: "taxi-turn-min-distance", type: l.size, triggersBounds: u.any }, { name: "taxi-direction", type: l.axisDirection, triggersBounds: u.any }, { name: "taxi-radius", type: l.number, triggersBounds: u.any }, { name: "edge-distances", type: l.edgeDistances, triggersBounds: u.any }, { name: "arrow-scale", type: l.positiveNumber, triggersBounds: u.any }, { name: "loop-direction", type: l.angle, triggersBounds: u.any }, { name: "loop-sweep", type: l.angle, triggersBounds: u.any }, { name: "source-distance-from-node", type: l.size, triggersBounds: u.any }, { name: "target-distance-from-node", type: l.size, triggersBounds: u.any }], D = [{ name: "ghost", type: l.bool, triggersBounds: u.any }, { name: "ghost-offset-x", type: l.bidirectionalSize, triggersBounds: u.any }, { name: "ghost-offset-y", type: l.bidirectionalSize, triggersBounds: u.any }, { name: "ghost-opacity", type: l.zeroOneNumber }], O = [{ name: "selection-box-color", type: l.color }, { name: "selection-box-opacity", type: l.zeroOneNumber }, { name: "selection-box-border-color", type: l.color }, { name: "selection-box-border-width", type: l.size }, { name: "active-bg-color", type: l.color }, { name: "active-bg-opacity", type: l.zeroOneNumber }, { name: "active-bg-size", type: l.size }, { name: "outside-texture-bg-color", type: l.color }, { name: "outside-texture-bg-opacity", type: l.zeroOneNumber }], F = []; Rt.pieBackgroundN = 16, F.push({ name: "pie-size", type: l.sizeMaybePercent }); for (var L = 1; L <= Rt.pieBackgroundN; L++) F.push({ name: "pie-" + L + "-background-color", type: l.color }), F.push({ name: "pie-" + L + "-background-size", type: l.percent }), F.push({ name: "pie-" + L + "-background-opacity", type: l.zeroOneNumber }); var B = [], I = Rt.arrowPrefixes = ["source", "mid-source", "target", "mid-target"]; [{ name: "arrow-shape", type: l.arrowShape, triggersBounds: u.any }, { name: "arrow-color", type: l.color }, { name: "arrow-fill", type: l.arrowFill }, { name: "arrow-width", type: l.arrowWidth }].forEach(function(te) { I.forEach(function($) { var G = $ + "-" + te.name, Q = te.type, ge = te.triggersBounds; B.push({ name: G, type: Q, triggersBounds: ge }); }); }, {}); var M = Rt.properties = [].concat(p, b, m, g, y, D, f, h, c, d, v, C, E, x, T, F, k, _, B, O), A = Rt.propertyGroups = { // common to all eles behavior: p, transition: b, visibility: m, overlay: g, underlay: y, ghost: D, // labels commonLabel: f, labelDimensions: h, mainLabel: c, sourceLabel: d, targetLabel: v, // node props nodeBody: C, nodeBorder: E, nodeOutline: x, backgroundImage: T, pie: F, compound: k, // edge props edgeLine: _, edgeArrow: B, core: O }, R = Rt.propertyGroupNames = {}, K = Rt.propertyGroupKeys = Object.keys(A); K.forEach(function(te) { R[te] = A[te].map(function($) { return $.name; }), A[te].forEach(function($) { return $.groupKey = te; }); }); var H = Rt.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" }]; Rt.propertyNames = M.map(function(te) { return te.name; }); for (var q = 0; q < M.length; q++) { var ee = M[q]; M[ee.name] = ee; } for (var se = 0; se < H.length; se++) { var oe = H[se], ne = M[oe.pointsTo], ue = { name: oe.name, alias: !0, pointsTo: ne }; M.push(ue), M[oe.name] = ue; } })(); Rt.getDefaultProperty = function(t) { return this.getDefaultProperties()[t]; }; Rt.getDefaultProperties = function() { var t = this._private; if (t.defaultProperties != null) return t.defaultProperties; for (var e = Re({ // core props "selection-box-color": "#ddd", "selection-box-opacity": 0.65, "selection-box-border-color": "#aaa", "selection-box-border-width": 1, "active-bg-color": "black", "active-bg-opacity": 0.15, "active-bg-size": 30, "outside-texture-bg-color": "#000", "outside-texture-bg-opacity": 0.125, // common node/edge props events: "yes", "text-events": "no", "text-valign": "top", "text-halign": "center", "text-justification": "auto", "line-height": 1, color: "#000", "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", // node props "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, // node gradient "background-gradient-direction": "to-bottom", "background-gradient-stop-colors": "#999", "background-gradient-stop-positions": "0%", // ghost props ghost: "no", "ghost-offset-y": 0, "ghost-offset-x": 0, "ghost-opacity": 0, // compound props 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 }, { // node pie bg "pie-size": "100%" }, [{ name: "pie-{{i}}-background-color", value: "black" }, { name: "pie-{{i}}-background-size", value: "0%" }, { name: "pie-{{i}}-background-opacity", value: 1 }].reduce(function(u, l) { for (var c = 1; c <= Rt.pieBackgroundN; c++) { var d = l.name.replace("{{i}}", c), v = l.value; u[d] = v; } return u; }, {}), { // edge props "line-style": "solid", "line-color": "#999", "line-fill": "solid", "line-cap": "butt", "line-opacity": 1, "line-outline-width": 0, "line-outline-color": "#000", "line-gradient-stop-colors": "#999", "line-gradient-stop-positions": "0%", "control-point-step-size": 40, "control-point-weights": 0.5, "segment-weights": 0.5, "segment-distances": 20, "segment-radii": 15, "radius-type": "arc-radius", "taxi-turn": "50%", "taxi-radius": 15, "taxi-turn-min-distance": 10, "taxi-direction": "auto", "edge-distances": "intersection", "curve-style": "haystack", "haystack-radius": 0, "arrow-scale": 1, "loop-direction": "-45deg", "loop-sweep": "-90deg", "source-distance-from-node": 0, "target-distance-from-node": 0, "source-endpoint": "outside-to-node", "target-endpoint": "outside-to-node", "line-dash-pattern": [6, 3], "line-dash-offset": 0 }, [{ name: "arrow-shape", value: "none" }, { name: "arrow-color", value: "#999" }, { name: "arrow-fill", value: "filled" }, { name: "arrow-width", value: 1 }].reduce(function(u, l) { return Rt.arrowPrefixes.forEach(function(c) { var d = c + "-" + l.name, v = l.value; u[d] = v; }), u; }, {})), r = {}, n = 0; n < this.properties.length; n++) { var a = this.properties[n]; if (!a.pointsTo) { var i = a.name, o = e[i], s = this.parse(i, o); r[i] = s; } } return t.defaultProperties = r, t.defaultProperties; }; Rt.addDefaultStylesheet = function() { this.selector(":parent").css({ shape: "rectangle", padding: 10, "background-color": "#eee", "border-color": "#ccc", "border-width": 1 }).selector("edge").css({ width: 3 }).selector(":loop").css({ "curve-style": "bezier" }).selector("edge:compound").css({ "curve-style": "bezier", "source-endpoint": "outside-to-line", "target-endpoint": "outside-to-line" }).selector(":selected").css({ "background-color": "#0169D9", "line-color": "#0169D9", "source-arrow-color": "#0169D9", "target-arrow-color": "#0169D9", "mid-source-arrow-color": "#0169D9", "mid-target-arrow-color": "#0169D9" }).selector(":parent:selected").css({ "background-color": "#CCE1F9", "border-color": "#aec8e5" }).selector(":active").css({ "overlay-color": "black", "overlay-padding": 10, "overlay-opacity": 0.25 }), this.defaultLength = this.length; }; var vl = {}; vl.parse = function(t, e, r, n) { var a = this; if (pt(e)) return a.parseImplWarn(t, e, r, n); var i = n === "mapping" || n === !0 || n === !1 || n == null ? "dontcare" : n, o = r ? "t" : "f", s = "" + e, u = op(t, s, o, i), l = a.propCache = a.propCache || [], c; return (c = l[u]) || (c = l[u] = a.parseImplWarn(t, e, r, n)), (r || n === "mapping") && (c = Zr(c), c && (c.value = Zr(c.value))), c; }; vl.parseImplWarn = function(t, e, r, n) { var a = this.parseImpl(t, e, r, n); return !a && e != null && tt("The style property `".concat(t, ": ").concat(e, "` is invalid")), a && (a.name === "width" || a.name === "height") && e === "label" && tt("The style value of `label` is deprecated for `" + a.name + "`"), a; }; vl.parseImpl = function(t, e, r, n) { var a = this; t = lc(t); var i = a.properties[t], o = e, s = a.types; if (!i || e === void 0) return null; i.alias && (i = i.pointsTo, t = i.name); var u = Fe(e); u && (e = e.trim()); var l = i.type; if (!l) return null; if (r && (e === "" || e === null)) return { name: t, value: e, bypass: !0, deleteBypass: !0 }; if (pt(e)) return { name: t, value: e, strValue: "fn", mapped: s.fn, bypass: r }; var c, d; if (!(!u || n || e.length < 7 || e[1] !== "a")) { if (e.length >= 7 && e[0] === "d" && (c = new RegExp(s.data.regex).exec(e))) { if (r) return !1; var v = s.data; return { name: t, value: c, strValue: "" + e, mapped: v, field: c[1], bypass: r }; } else if (e.length >= 10 && e[0] === "m" && (d = new RegExp(s.mapData.regex).exec(e))) { if (r || l.multiple) return !1; var h = s.mapData; if (!(l.color || l.number)) return !1; var f = this.parse(t, d[4]); if (!f || f.mapped) return !1; var p = this.parse(t, d[5]); if (!p || p.mapped) return !1; if (f.pfValue === p.pfValue || f.strValue === p.strValue) return tt("`" + t + ": " + e + "` is not a valid mapper because the output range is zero; converting to `" + t + ": " + f.strValue + "`"), this.parse(t, f.strValue); if (l.color) { var m = f.value, g = p.value, y = m[0] === g[0] && m[1] === g[1] && m[2] === g[2] && // optional alpha (m[3] === g[3] || (m[3] == null || m[3] === 1) && (g[3] == null || g[3] === 1)); if (y) return !1; } return { name: t, value: d, strValue: "" + e, mapped: h, field: d[1], fieldMin: parseFloat(d[2]), // min & max are numeric fieldMax: parseFloat(d[3]), valueMin: f.value, valueMax: p.value, bypass: r }; } } if (l.multiple && n !== "multiple") { var b; if (u ? b = e.split(/\s+/) : st(e) ? b = e : b = [e], l.evenMultiple && b.length % 2 !== 0) return null; for (var w = [], C = [], E = [], x = "", T = !1, k = 0; k < b.length; k++) { var _ = a.parse(t, b[k], r, "multiple"); T = T || Fe(_.value), w.push(_.value), E.push(_.pfValue != null ? _.pfValue : _.value), C.push(_.units), x += (k > 0 ? " " : "") + _.strValue; } return l.validate && !l.validate(w, C) ? null : l.singleEnum && T ? w.length === 1 && Fe(w[0]) ? { name: t, value: w[0], strValue: w[0], bypass: r } : null : { name: t, value: w, pfValue: E, strValue: x, bypass: r, units: C }; } var D = function() { for (var $ = 0; $ < l.enums.length; $++) { var G = l.enums[$]; if (G === e) return { name: t, value: e, strValue: "" + e, bypass: r }; } return null; }; if (l.number) { var O, F = "px"; if (l.units && (O = l.units), l.implicitUnits && (F = l.implicitUnits), !l.unitless) if (u) { var L = "px|em" + (l.allowPercent ? "|\\%" : ""); O && (L = O); var B = e.match("^(" + It + ")(" + L + ")?$"); B && (e = B[1], O = B[2] || F); } else (!O || l.implicitUnits) && (O = F); if (e = parseFloat(e), isNaN(e) && l.enums === void 0) return null; if (isNaN(e) && l.enums !== void 0) return e = o, D(); if (l.integer && !lT(e) || l.min !== void 0 && (e < l.min || l.strictMin && e === l.min) || l.max !== void 0 && (e > l.max || l.strictMax && e === l.max)) return null; var I = { name: t, value: e, strValue: "" + e + (O || ""), units: O, bypass: r }; return l.unitless || O !== "px" && O !== "em" ? I.pfValue = e : I.pfValue = O === "px" || !O ? e : this.getEmSizeInPixels() * e, (O === "ms" || O === "s") && (I.pfValue = O === "ms" ? e : 1e3 * e), (O === "deg" || O === "rad") && (I.pfValue = O === "rad" ? e : H5(e)), O === "%" && (I.pfValue = e / 100), I; } else if (l.propList) { var M = [], A = "" + e; if (A !== "none") { for (var R = A.split(/\s*,\s*|\s+/), K = 0; K < R.length; K++) { var H = R[K].trim(); a.properties[H] ? M.push(H) : tt("`" + H + "` is not a valid property name"); } if (M.length === 0) return null; } return { name: t, value: M, strValue: M.length === 0 ? "none" : M.join(" "), bypass: r }; } else if (l.color) { var q = ST(e); return q ? { name: t, value: q, pfValue: q, strValue: "rgb(" + q[0] + "," + q[1] + "," + q[2] + ")", // n.b. no spaces b/c of multiple support bypass: r } : null; } else if (l.regex || l.regexes) { if (l.enums) { var ee = D(); if (ee) return ee; } for (var se = l.regexes ? l.regexes : [l.regex], oe = 0; oe < se.length; oe++) { var ne = new RegExp(se[oe]), ue = ne.exec(e); if (ue) return { name: t, value: l.singleRegexMatchValue ? ue[1] : ue, strValue: "" + e, bypass: r }; } return null; } else return l.string ? { name: t, value: "" + e, strValue: "" + e, bypass: r } : l.enums ? D() : null; }; var rr = function t(e) { if (!(this instanceof t)) return new t(e); if (!sc(e)) { yt("A style must have a core reference"); return; } this._private = { cy: e, coreStyle: {} }, this.length = 0, this.resetToDefault(); }, ar = rr.prototype; ar.instanceString = function() { return "style"; }; ar.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; }; ar.resetToDefault = function() { return this.clear(), this.addDefaultStylesheet(), this; }; ar.core = function(t) { return this._private.coreStyle[t] || this.getDefaultProperty(t); }; ar.selector = function(t) { var e = t === "core" ? null : new Un(t), r = this.length++; return this[r] = { selector: e, properties: [], mappedProperties: [], index: r }, this; }; ar.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[Js(a.name)]), i !== void 0 && this.cssRule(a.name, i); } else e.length === 2 && this.cssRule(e[0], e[1]); return this; }; ar.style = ar.css; ar.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.mapped && this[n].mappedProperties.push(r); var a = !this[n].selector; a && (this._private.coreStyle[r.name] = r); } return this; }; ar.append = function(t) { return Xh(t) ? t.appendToStyle(this) : st(t) ? this.appendFromJson(t) : Fe(t) && this.appendFromString(t), this; }; rr.fromJson = function(t, e) { var r = new rr(t); return r.fromJson(e), r; }; rr.fromString = function(t, e) { return new rr(t).fromString(e); }; [ir, Io, Cc, rn, fl, Ec, Rt, vl].forEach(function(t) { Re(ar, t); }); rr.types = ar.types; rr.properties = ar.properties; rr.propertyGroups = ar.propertyGroups; rr.propertyGroupNames = ar.propertyGroupNames; rr.propertyGroupKeys = ar.propertyGroupKeys; var lP = { style: function(e) { if (e) { var r = this.setStyle(e); r.update(); } return this._private.style; }, setStyle: function(e) { var r = this._private; return Xh(e) ? r.style = e.generateStyle(this) : st(e) ? r.style = rr.fromJson(this, e) : Fe(e) ? r.style = rr.fromString(this, e) : r.style = rr(this), r.style; }, // e.g. cy.data() changed => recalc ele mappers updateStyle: function() { this.mutableElements().updateStyle(); } }, uP = "single", xa = { 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 = uP), 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, o, s; switch (e.length) { case 0: return r; case 1: if (Fe(e[0])) return n = e[0], r[n]; if (Xe(e[0])) { if (!this._private.panningEnabled) return this; i = e[0], o = i.x, s = i.y, be(o) && (r.x = o), be(s) && (r.y = s), this.emit("pan viewport"); } break; case 2: if (!this._private.panningEnabled) return this; n = e[0], a = e[1], (n === "x" || n === "y") && be(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, o, s, u, l; if (!this._private.panningEnabled) return this; switch (n.length) { case 1: Xe(e) && (s = n[0], u = s.x, l = s.y, be(u) && (a.x += u), be(l) && (a.y += l), this.emit("pan viewport")); break; case 2: i = e, o = r, (i === "x" || i === "y") && be(o) && (a[i] += o), this.emit("pan viewport"); break; } return this.notify("viewport"), this; }, 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 (be(e) && r === void 0 && (r = e, e = void 0), !(!this._private.panningEnabled || !this._private.zoomingEnabled)) { var n; if (Fe(e)) { var a = e; e = this.$(a); } else if (dT(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 yr(e) || (e = this.mutableElements()); if (!(yr(e) && e.empty())) { n = n || e.boundingBox(); var o = this.width(), s = this.height(), u; if (r = be(r) ? r : 0, !isNaN(o) && !isNaN(s) && o > 0 && s > 0 && !isNaN(n.w) && !isNaN(n.h) && n.w > 0 && n.h > 0) { u = Math.min((o - 2 * r) / n.w, (s - 2 * r) / n.h), u = u > this._private.maxZoom ? this._private.maxZoom : u, u = u < this._private.minZoom ? this._private.minZoom : u; var l = { // now pan to middle x: (o - u * (n.x1 + n.x2)) / 2, y: (s - u * (n.y1 + n.y2)) / 2 }; return { zoom: u, pan: l }; } } } }, zoomRange: function(e, r) { var n = this._private; if (r == null) { var a = e; e = a.min, r = a.max; } return be(e) && be(r) && e <= r ? (n.minZoom = e, n.maxZoom = r) : be(e) && r === void 0 && e <= n.maxZoom ? n.minZoom = e : be(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, o, s = !1; if (r.zoomingEnabled || (s = !0), be(e) ? o = e : Xe(e) && (o = e.level, e.position != null ? i = nl(e.position, a, n) : e.renderedPosition != null && (i = e.renderedPosition), i != null && !r.panningEnabled && (s = !0)), o = o > r.maxZoom ? r.maxZoom : o, o = o < r.minZoom ? r.minZoom : o, s || !be(o) || o === a || i != null && (!be(i.x) || !be(i.y))) return null; if (i != null) { var u = n, l = a, c = o, d = { x: -c / l * (i.x - u.x) + i.x, y: -c / l * (i.y - u.y) + i.y }; return { zoomed: !0, panned: !0, zoom: c, pan: d }; } else return { zoomed: !0, panned: !1, zoom: o, 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 = [], o = !1, s = !1; if (!e) return this; if (be(e.zoom) || (n = !1), Xe(e.pan) || (a = !1), !n && !a) return this; if (n) { var u = e.zoom; u < r.minZoom || u > r.maxZoom || !r.zoomingEnabled ? o = !0 : (r.zoom = u, i.push("zoom")); } if (a && (!o || !e.cancelOnFailedZoom) && r.panningEnabled) { var l = e.pan; be(l.x) && (r.pan.x = l.x, s = !1), be(l.y) && (r.pan.y = l.y, s = !1), s || 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 (Fe(e)) { var n = e; e = this.mutableElements().filter(n); } else yr(e) || (e = this.mutableElements()); if (e.length !== 0) { var a = e.boundingBox(), i = this.width(), o = this.height(); r = r === void 0 ? this._private.zoom : r; var s = { // middle x: (i - r * (a.x1 + a.x2)) / 2, y: (o - r * (a.y1 + a.y2)) / 2 }; return s; } } }, 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(s) { return parseFloat(a.getPropertyValue(s)); }; return { width: r.clientWidth - i("padding-left") - i("padding-right"), height: r.clientHeight - i("padding-top") - i("padding-bottom") }; }() : { // fallback if no container (not 0 b/c can be used for dividing etc) 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; } }; xa.centre = xa.center; xa.autolockNodes = xa.autolock; xa.autoungrabifyNodes = xa.autoungrabify; var co = { data: et.data({ field: "data", bindingEvent: "data", allowBinding: !0, allowSetting: !0, settingEvent: "data", settingTriggersEvent: !0, triggerFnName: "trigger", allowGetting: !0, updateStyle: !0 }), removeData: et.removeData({ field: "data", event: "data", triggerFnName: "trigger", triggerEvent: !0, updateStyle: !0 }), scratch: et.data({ field: "scratch", bindingEvent: "scratch", allowBinding: !0, allowSetting: !0, settingEvent: "scratch", settingTriggersEvent: !0, triggerFnName: "trigger", allowGetting: !0, updateStyle: !0 }), removeScratch: et.removeData({ field: "scratch", event: "scratch", triggerFnName: "trigger", triggerEvent: !0, updateStyle: !0 }) }; co.attr = co.data; co.removeAttr = co.removeData; var fo = function(e) { var r = this; e = Re({}, e); var n = e.container; n && !Ds(n) && Ds(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 o = Ot !== void 0 && n !== void 0 && !e.headless, s = e; s.layout = Re({ name: o ? "grid" : "null" }, s.layout), s.renderer = Re({ name: o ? "canvas" : "null" }, s.renderer); var u = function(f, p, m) { return p !== void 0 ? p : m !== void 0 ? m : f; }, l = this._private = { container: n, // html dom ele container ready: !1, // whether ready has been triggered options: s, // cached options elements: new Gt(this), // elements in the graph listeners: [], // list of listeners aniEles: new Gt(this), // elements being animated data: s.data || {}, // data for the core scratch: {}, // scratch object for core layout: null, renderer: null, destroyed: !1, // whether destroy was called notificationsEnabled: !0, // whether notifications are sent to the renderer minZoom: 1e-50, maxZoom: 1e50, zoomingEnabled: u(!0, s.zoomingEnabled), userZoomingEnabled: u(!0, s.userZoomingEnabled), panningEnabled: u(!0, s.panningEnabled), userPanningEnabled: u(!0, s.userPanningEnabled), boxSelectionEnabled: u(!0, s.boxSelectionEnabled), autolock: u(!1, s.autolock, s.autolockNodes), autoungrabify: u(!1, s.autoungrabify, s.autoungrabifyNodes), autounselectify: u(!1, s.autounselectify), styleEnabled: s.styleEnabled === void 0 ? o : s.styleEnabled, zoom: be(s.zoom) ? s.zoom : 1, pan: { x: Xe(s.pan) && be(s.pan.x) ? s.pan.x : 0, y: Xe(s.pan) && be(s.pan.y) ? s.pan.y : 0 }, animation: { // object for currently-running animations current: [], queue: [] }, hasCompoundNodes: !1, multiClickDebounceTime: u(250, s.multiClickDebounceTime) }; this.createEmitter(), this.selectionType(s.selectionType), this.zoomRange({ min: s.minZoom, max: s.maxZoom }); var c = function(f, p) { var m = f.some(fT); if (m) return hi.all(f).then(p); p(f); }; l.styleEnabled && r.setStyle([]); var d = Re({}, s, s.renderer); r.initRenderer(d); var v = function(f, p, m) { r.notifications(!1); var g = r.mutableElements(); g.length > 0 && g.remove(), f != null && (Xe(f) || st(f)) && r.add(f), r.one("layoutready", function(b) { r.notifications(!0), r.emit(b), r.one("load", p), r.emitAndNotify("load"); }).one("layoutstop", function() { r.one("done", m), r.emit("done"); }); var y = Re({}, r._private.options.layout); y.eles = r.elements(), r.layout(y).run(); }; c([s.style, s.elements], function(h) { var f = h[0], p = h[1]; l.styleEnabled && r.style().append(f), v(p, function() { r.startAnimationLoop(), l.ready = !0, pt(s.ready) && r.on("ready", s.ready); for (var m = 0; m < i.length; m++) { var g = i[m]; r.on("ready", g); } a && (a.readies = []), r.emit("ready"); }, s.done); }); }, Ms = fo.prototype; Re(Ms, { 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 Ot; var r = this._private.container.ownerDocument; return r === void 0 || r == null ? Ot : r.defaultView || Ot; }, mount: function(e) { if (e != null) { var r = this, n = r._private, a = n.options; return !Ds(e) && Ds(e[0]) && (e = e[0]), r.stopAnimationLoop(), r.destroyRenderer(), n.container = e, n.styleEnabled = !0, r.invalidateSize(), r.initRenderer(Re({}, a, a.renderer, { // allow custom renderer name to be re-used, otherwise use canvas 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 Zr(this._private.options); }, json: function(e) { var r = this, n = r._private, a = r.mutableElements(), i = function(w) { return r.getElementById(w.id()); }; if (Xe(e)) { if (r.startBatch(), e.elements) { var o = {}, s = function(w, C) { for (var E = [], x = [], T = 0; T < w.length; T++) { var k = w[T]; if (!k.data.id) { tt("cy.json() cannot handle elements without an ID attribute"); continue; } var _ = "" + k.data.id, D = r.getElementById(_); o[_] = !0, D.length !== 0 ? x.push({ ele: D, json: k }) : (C && (k.group = C), E.push(k)); } r.add(E); for (var O = 0; O < x.length; O++) { var F = x[O], L = F.ele, B = F.json; L.json(B); } }; if (st(e.elements)) s(e.elements); else for (var u = ["nodes", "edges"], l = 0; l < u.length; l++) { var c = u[l], d = e.elements[c]; st(d) && s(d, c); } var v = r.collection(); a.filter(function(b) { return !o[b.id()]; }).forEach(function(b) { b.isParent() ? v.merge(b) : b.remove(); }), v.forEach(function(b) { return b.children().move({ parent: null }); }), v.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 h = ["minZoom", "maxZoom", "zoomingEnabled", "userZoomingEnabled", "panningEnabled", "userPanningEnabled", "boxSelectionEnabled", "autolock", "autoungrabify", "autounselectify", "multiClickDebounceTime"], f = 0; f < h.length; f++) { var p = h[f]; e[p] != null && r[p](e[p]); } 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 = Zr(r.data()); var y = 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 = Zr(n.pan), g.boxSelectionEnabled = n.boxSelectionEnabled, g.renderer = Zr(y.renderer), g.hideEdgesOnViewport = y.hideEdgesOnViewport, g.textureOnViewport = y.textureOnViewport, g.wheelSensitivity = y.wheelSensitivity, g.motionBlur = y.motionBlur, g.multiClickDebounceTime = y.multiClickDebounceTime, g; } } }); Ms.$id = Ms.getElementById; [QD, nP, jp, vu, hs, iP, hu, ps, lP, xa, co].forEach(function(t) { Re(Ms, t); }); var cP = { fit: !0, // whether to fit the viewport to the graph directed: !1, // whether the tree is directed downwards (or edges can point in any direction if false) padding: 30, // padding on fit circle: !1, // put depths in concentric circles if true, put depths top down if false grid: !1, // whether to create an even grid into which the DAG is placed (circle:false only) spacingFactor: 1.75, // positive spacing factor, larger => more space between nodes (N.B. n/a if causes overlap) boundingBox: void 0, // constrain layout bounds; { x1, y1, x2, y2 } or { x1, y1, w, h } avoidOverlap: !0, // prevents node overlap, may overflow boundingBox if not enough space nodeDimensionsIncludeLabels: !1, // Excludes the label when calculating node bounding boxes for the layout algorithm roots: void 0, // the roots of the trees depthSort: void 0, // a sorting function to order nodes at equal depth. e.g. function(a, b){ return a.data('weight') - b.data('weight') } animate: !1, // whether to transition the node positions animationDuration: 500, // duration of animation in ms if enabled animationEasing: void 0, // easing of animation if enabled, animateFilter: function(e, r) { return !0; }, // a function that determines whether the node should be animated. All nodes animated by default on animate enabled. Non-animated nodes are positioned immediately when the layout starts ready: void 0, // callback on layoutready stop: void 0, // callback on layoutstop transform: function(e, r) { return r; } // transform a given node position. Useful for changing flow direction in discrete layouts }, dP = { maximal: !1, // whether to shift nodes down their natural BFS depths in order to avoid upwards edges (DAGS only); setting acyclic to true sets maximal to true also acyclic: !1 // whether the tree is acyclic and thus a node could be shifted (due to the maximal option) multiple times without causing an infinite loop; setting to true sets maximal to true also; if you are uncertain whether a tree is acyclic, set to false to avoid potential infinite loops }, Ba = function(e) { return e.scratch("breadthfirst"); }, Yf = function(e, r) { return e.scratch("breadthfirst", r); }; function Qp(t) { this.options = Re({}, cP, dP, t); } Qp.prototype.run = function() { var t = this.options, e = t, r = t.cy, n = e.eles, a = n.nodes().filter(function(fe) { return !fe.isParent(); }), i = n, o = e.directed, s = e.acyclic || e.maximal || e.maximalAdjustments > 0, u = pr(e.boundingBox ? e.boundingBox : { x1: 0, y1: 0, w: r.width(), h: r.height() }), l; if (yr(e.roots)) l = e.roots; else if (st(e.roots)) { for (var c = [], d = 0; d < e.roots.length; d++) { var v = e.roots[d], h = r.getElementById(v); c.push(h); } l = r.collection(c); } else if (Fe(e.roots)) l = r.$(e.roots); else if (o) l = a.roots(); else { var f = n.components(); l = r.collection(); for (var p = function(me) { var xe = f[me], ke = xe.maxDegree(!1), Ce = xe.filter(function(De) { return De.degree(!1) === ke; }); l = l.add(Ce); }, m = 0; m < f.length; m++) p(m); } var g = [], y = {}, b = function(me, xe) { g[xe] == null && (g[xe] = []); var ke = g[xe].length; g[xe].push(me), Yf(me, { index: ke, depth: xe }); }, w = function(me, xe) { var ke = Ba(me), Ce = ke.depth, De = ke.index; g[Ce][De] = null, b(me, xe); }; i.bfs({ roots: l, directed: e.directed, visit: function(me, xe, ke, Ce, De) { var qe = me[0], Ke = qe.id(); b(qe, De), y[Ke] = !0; } }); for (var C = [], E = 0; E < a.length; E++) { var x = a[E]; y[x.id()] || C.push(x); } var T = function(me) { for (var xe = g[me], ke = 0; ke < xe.length; ke++) { var Ce = xe[ke]; if (Ce == null) { xe.splice(ke, 1), ke--; continue; } Yf(Ce, { depth: me, index: ke }); } }, k = function() { for (var me = 0; me < g.length; me++) T(me); }, _ = function(me, xe) { for (var ke = Ba(me), Ce = me.incomers().filter(function(S) { return S.isNode() && n.has(S); }), De = -1, qe = me.id(), Ke = 0; Ke < Ce.length; Ke++) { var Be = Ce[Ke], Ge = Ba(Be); De = Math.max(De, Ge.depth); } if (ke.depth <= De) { if (!e.acyclic && xe[qe]) return null; var le = De + 1; return w(me, le), xe[qe] = le, !0; } return !1; }; if (o && s) { var D = [], O = {}, F = function(me) { return D.push(me); }, L = function() { return D.shift(); }; for (a.forEach(function(fe) { return D.push(fe); }); D.length > 0; ) { var B = L(), I = _(B, O); if (I) B.outgoers().filter(function(fe) { return fe.isNode() && n.has(fe); }).forEach(F); else if (I === null) { tt("Detected double maximal shift for node `" + B.id() + "`. Bailing maximal adjustment due to cycle. Use `options.maximal: true` only on DAGs."); break; } } } k(); var M = 0; if (e.avoidOverlap) for (var A = 0; A < a.length; A++) { var R = a[A], K = R.layoutDimensions(e), H = K.w, q = K.h; M = Math.max(M, H, q); } var ee = {}, se = function(me) { if (ee[me.id()]) return ee[me.id()]; for (var xe = Ba(me).depth, ke = me.neighborhood(), Ce = 0, De = 0, qe = 0; qe < ke.length; qe++) { var Ke = ke[qe]; if (!(Ke.isEdge() || Ke.isParent() || !a.has(Ke))) { var Be = Ba(Ke); if (Be != null) { var Ge = Be.index, le = Be.depth; if (!(Ge == null || le == null)) { var S = g[le].length; le < xe && (Ce += Ge / S, De++); } } } } return De = Math.max(1, De), Ce = Ce / De, De === 0 && (Ce = 0), ee[me.id()] = Ce, Ce; }, oe = function(me, xe) { var ke = se(me), Ce = se(xe), De = ke - Ce; return De === 0 ? Qh(me.id(), xe.id()) : De; }; e.depthSort !== void 0 && (oe = e.depthSort); for (var ne = 0; ne < g.length; ne++) g[ne].sort(oe), T(ne); for (var ue = [], te = 0; te < C.length; te++) ue.push(C[te]); g.unshift(ue), k(); for (var $ = 0, G = 0; G < g.length; G++) $ = Math.max(g[G].length, $); var Q = { x: u.x1 + u.w / 2, y: u.x1 + u.h / 2 }, ge = g.reduce(function(fe, me) { return Math.max(fe, me.length); }, 0), Ee = function(me) { var xe = Ba(me), ke = xe.depth, Ce = xe.index, De = g[ke].length, qe = Math.max(u.w / ((e.grid ? ge : De) + 1), M), Ke = Math.max(u.h / (g.length + 1), M), Be = Math.min(u.w / 2 / g.length, u.h / 2 / g.length); if (Be = Math.max(Be, M), e.circle) { var le = Be * ke + Be - (g.length > 0 && g[0].length <= 3 ? Be / 2 : 0), S = 2 * Math.PI / g[ke].length * Ce; return ke === 0 && g[0].length === 1 && (le = 1), { x: Q.x + le * Math.cos(S), y: Q.y + le * Math.sin(S) }; } else { var Ge = { x: Q.x + (Ce + 1 - (De + 1) / 2) * qe, y: (ke + 1) * Ke }; return Ge; } }; return n.nodes().layoutPositions(this, e, Ee), this; }; var fP = { fit: !0, // whether to fit the viewport to the graph padding: 30, // the padding on fit boundingBox: void 0, // constrain layout bounds; { x1, y1, x2, y2 } or { x1, y1, w, h } avoidOverlap: !0, // prevents node overlap, may overflow boundingBox and radius if not enough space nodeDimensionsIncludeLabels: !1, // Excludes the label when calculating node bounding boxes for the layout algorithm spacingFactor: void 0, // Applies a multiplicative factor (>0) to expand or compress the overall area that the nodes take up radius: void 0, // the radius of the circle startAngle: 3 / 2 * Math.PI, // where nodes start in radians sweep: void 0, // how many radians should be between the first and last node (defaults to full circle) clockwise: !0, // whether the layout should go clockwise (true) or counterclockwise/anticlockwise (false) sort: void 0, // a sorting function to order the nodes; e.g. function(a, b){ return a.data('weight') - b.data('weight') } animate: !1, // whether to transition the node positions animationDuration: 500, // duration of animation in ms if enabled animationEasing: void 0, // easing of animation if enabled animateFilter: function(e, r) { return !0; }, // a function that determines whether the node should be animated. All nodes animated by default on animate enabled. Non-animated nodes are positioned immediately when the layout starts ready: void 0, // callback on layoutready stop: void 0, // callback on layoutstop transform: function(e, r) { return r; } // transform a given node position. Useful for changing flow direction in discrete layouts }; function Jp(t) { this.options = Re({}, fP, t); } Jp.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 o = pr(e.boundingBox ? e.boundingBox : { x1: 0, y1: 0, w: r.width(), h: r.height() }), s = { x: o.x1 + o.w / 2, y: o.y1 + o.h / 2 }, u = e.sweep === void 0 ? 2 * Math.PI - 2 * Math.PI / i.length : e.sweep, l = u / Math.max(1, i.length - 1), c, d = 0, v = 0; v < i.length; v++) { var h = i[v], f = h.layoutDimensions(e), p = f.w, m = f.h; d = Math.max(d, p, m); } if (be(e.radius) ? c = e.radius : i.length <= 1 ? c = 0 : c = Math.min(o.h, o.w) / 2 - d, i.length > 1 && e.avoidOverlap) { d *= 1.75; var g = Math.cos(l) - Math.cos(0), y = Math.sin(l) - Math.sin(0), b = Math.sqrt(d * d / (g * g + y * y)); c = Math.max(b, c); } var w = function(E, x) { var T = e.startAngle + x * l * (a ? 1 : -1), k = c * Math.cos(T), _ = c * Math.sin(T), D = { x: s.x + k, y: s.y + _ }; return D; }; return n.nodes().layoutPositions(this, e, w), this; }; var vP = { fit: !0, // whether to fit the viewport to the graph padding: 30, // the padding on fit startAngle: 3 / 2 * Math.PI, // where nodes start in radians sweep: void 0, // how many radians should be between the first and last node (defaults to full circle) clockwise: !0, // whether the layout should go clockwise (true) or counterclockwise/anticlockwise (false) equidistant: !1, // whether levels have an equal radial distance betwen them, may cause bounding box overflow minNodeSpacing: 10, // min spacing between outside of nodes (used for radius adjustment) boundingBox: void 0, // constrain layout bounds; { x1, y1, x2, y2 } or { x1, y1, w, h } avoidOverlap: !0, // prevents node overlap, may overflow boundingBox if not enough space nodeDimensionsIncludeLabels: !1, // Excludes the label when calculating node bounding boxes for the layout algorithm height: void 0, // height of layout area (overrides container height) width: void 0, // width of layout area (overrides container width) spacingFactor: void 0, // Applies a multiplicative factor (>0) to expand or compress the overall area that the nodes take up concentric: function(e) { return e.degree(); }, levelWidth: function(e) { return e.maxDegree() / 4; }, animate: !1, // whether to transition the node positions animationDuration: 500, // duration of animation in ms if enabled animationEasing: void 0, // easing of animation if enabled animateFilter: function(e, r) { return !0; }, // a function that determines whether the node should be animated. All nodes animated by default on animate enabled. Non-animated nodes are positioned immediately when the layout starts ready: void 0, // callback on layoutready stop: void 0, // callback on layoutstop transform: function(e, r) { return r; } // transform a given node position. Useful for changing flow direction in discrete layouts }; function eg(t) { this.options = Re({}, vP, t); } eg.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"), o = pr(e.boundingBox ? e.boundingBox : { x1: 0, y1: 0, w: n.width(), h: n.height() }), s = { x: o.x1 + o.w / 2, y: o.y1 + o.h / 2 }, u = [], l = 0, c = 0; c < i.length; c++) { var d = i[c], v = void 0; v = e.concentric(d), u.push({ value: v, node: d }), d._private.scratch.concentric = v; } i.updateStyle(); for (var h = 0; h < i.length; h++) { var f = i[h], p = f.layoutDimensions(e); l = Math.max(l, p.w, p.h); } u.sort(function(fe, me) { return me.value - fe.value; }); for (var m = e.levelWidth(i), g = [[]], y = g[0], b = 0; b < u.length; b++) { var w = u[b]; if (y.length > 0) { var C = Math.abs(y[0].value - w.value); C >= m && (y = [], g.push(y)); } y.push(w); } var E = l + e.minNodeSpacing; if (!e.avoidOverlap) { var x = g.length > 0 && g[0].length > 1, T = Math.min(o.w, o.h) / 2 - E, k = T / (g.length + x ? 1 : 0); E = Math.min(E, k); } for (var _ = 0, D = 0; D < g.length; D++) { var O = g[D], F = e.sweep === void 0 ? 2 * Math.PI - 2 * Math.PI / O.length : e.sweep, L = O.dTheta = F / Math.max(1, O.length - 1); if (O.length > 1 && e.avoidOverlap) { var B = Math.cos(L) - Math.cos(0), I = Math.sin(L) - Math.sin(0), M = Math.sqrt(E * E / (B * B + I * I)); _ = Math.max(M, _); } O.r = _, _ += E; } if (e.equidistant) { for (var A = 0, R = 0, K = 0; K < g.length; K++) { var H = g[K], q = H.r - R; A = Math.max(A, q); } R = 0; for (var ee = 0; ee < g.length; ee++) { var se = g[ee]; ee === 0 && (R = se.r), se.r = R, R += A; } } for (var oe = {}, ne = 0; ne < g.length; ne++) for (var ue = g[ne], te = ue.dTheta, $ = ue.r, G = 0; G < ue.length; G++) { var Q = ue[G], ge = e.startAngle + (r ? 1 : -1) * te * G, Ee = { x: s.x + $ * Math.cos(ge), y: s.y + $ * Math.sin(ge) }; oe[Q.node.id()] = Ee; } return a.nodes().layoutPositions(this, e, function(fe) { var me = fe.id(); return oe[me]; }), this; }; var Hl, hP = { // Called on `layoutready` ready: function() { }, // Called on `layoutstop` stop: function() { }, // Whether to animate while running the layout // true : Animate continuously as the layout is running // false : Just show the end result // 'end' : Animate with the end result, from the initial positions to the end positions animate: !0, // Easing of the animation for animate:'end' animationEasing: void 0, // The duration of the animation for animate:'end' animationDuration: void 0, // A function that determines whether the node should be animated // All nodes animated by default on animate enabled // Non-animated nodes are positioned immediately when the layout starts animateFilter: function(e, r) { return !0; }, // The layout animates only after this many milliseconds for animate:true // (prevents flashing on fast runs) animationThreshold: 250, // Number of iterations between consecutive screen positions update refresh: 20, // Whether to fit the network view after when done fit: !0, // Padding on fit padding: 30, // Constrain layout bounds; { x1, y1, x2, y2 } or { x1, y1, w, h } boundingBox: void 0, // Excludes the label when calculating node bounding boxes for the layout algorithm nodeDimensionsIncludeLabels: !1, // Randomize the initial positions of the nodes (true) or use existing positions (false) randomize: !1, // Extra spacing between components in non-compound graphs componentSpacing: 40, // Node repulsion (non overlapping) multiplier nodeRepulsion: function(e) { return 2048; }, // Node repulsion (overlapping) multiplier nodeOverlap: 4, // Ideal edge (non nested) length idealEdgeLength: function(e) { return 32; }, // Divisor to compute edge forces edgeElasticity: function(e) { return 32; }, // Nesting factor (multiplier) to compute ideal edge length for nested edges nestingFactor: 1.2, // Gravity force (constant) gravity: 1, // Maximum number of iterations to perform numIter: 1e3, // Initial temperature (maximum node displacement) initialTemp: 1e3, // Cooling factor (how the temperature is reduced between consecutive iterations coolingFactor: 0.99, // Lower temperature threshold (below this point the layout will end) minTemp: 1 }; function hl(t) { this.options = Re({}, hP, 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"), o = a.target().data("id"), s = e.some(function(l) { return l.data("id") === i; }), u = e.some(function(l) { return l.data("id") === o; }); return !s || !u; }); this.options.eles = this.options.eles.not(n); } hl.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 ? Hl = !0 : Hl = !1; var n = pP(e, r, t); Hl && yP(n), t.randomize && bP(n); var a = gn(), i = function() { wP(n, e, t), t.fit === !0 && e.fit(t.padding); }, o = function(v) { return !(r.stopped || v >= t.numIter || (xP(n, t), n.temperature = n.temperature * t.coolingFactor, n.temperature < t.minTemp)); }, s = function() { if (t.animate === !0 || t.animate === !1) i(), r.one("layoutstop", t.stop), r.emit({ type: "layoutstop", layout: r }); else { var v = t.eles.nodes(), h = tg(n, t, v); v.layoutPositions(r, t, h); } }, u = 0, l = !0; if (t.animate === !0) { var c = function d() { for (var v = 0; l && v < t.refresh; ) l = o(u), u++, v++; if (!l) Xf(n, t), s(); else { var h = gn(); h - a >= t.animationThreshold && i(), Ps(d); } }; c(); } else { for (; l; ) l = o(u), u++; Xf(n, t), s(); } return this; }; hl.prototype.stop = function() { return this.stopped = !0, this.thread && this.thread.stop(), this.emit("layoutstop"), this; }; hl.prototype.destroy = function() { return this.thread && this.thread.stop(), this; }; var pP = function(e, r, n) { for (var a = n.eles.edges(), i = n.eles.nodes(), o = pr(n.boundingBox ? n.boundingBox : { x1: 0, y1: 0, w: e.width(), h: e.height() }), s = { isCompound: e.hasCompoundNodes(), layoutNodes: [], idToIndex: {}, nodeSize: i.size(), graphSet: [], indexToGraph: [], layoutEdges: [], edgeSize: a.size(), temperature: n.initialTemp, clientWidth: o.w, clientHeight: o.h, boundingBox: o }, u = n.eles.components(), l = {}, c = 0; c < u.length; c++) for (var d = u[c], v = 0; v < d.length; v++) { var h = d[v]; l[h.id()] = c; } for (var c = 0; c < s.nodeSize; c++) { var f = i[c], p = f.layoutDimensions(n), m = {}; m.isLocked = f.locked(), m.id = f.data("id"), m.parentId = f.data("parent"), m.cmptId = l[f.id()], m.children = [], m.positionX = f.position("x"), m.positionY = f.position("y"), m.offsetX = 0, m.offsetY = 0, m.height = p.w, m.width = p.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(f.style("padding")), m.padRight = parseFloat(f.style("padding")), m.padTop = parseFloat(f.style("padding")), m.padBottom = parseFloat(f.style("padding")), m.nodeRepulsion = pt(n.nodeRepulsion) ? n.nodeRepulsion(f) : n.nodeRepulsion, s.layoutNodes.push(m), s.idToIndex[m.id] = c; } for (var g = [], y = 0, b = -1, w = [], c = 0; c < s.nodeSize; c++) { var f = s.layoutNodes[c], C = f.parentId; C != null ? s.layoutNodes[s.idToIndex[C]].children.push(f.id) : (g[++b] = f.id, w.push(f.id)); } for (s.graphSet.push(w); y <= b; ) { var E = g[y++], x = s.idToIndex[E], h = s.layoutNodes[x], T = h.children; if (T.length > 0) { s.graphSet.push(T); for (var c = 0; c < T.length; c++) g[++b] = T[c]; } } for (var c = 0; c < s.graphSet.length; c++) for (var k = s.graphSet[c], v = 0; v < k.length; v++) { var _ = s.idToIndex[k[v]]; s.indexToGraph[_] = c; } for (var c = 0; c < s.edgeSize; c++) { var D = a[c], O = {}; O.id = D.data("id"), O.sourceId = D.data("source"), O.targetId = D.data("target"); var F = pt(n.idealEdgeLength) ? n.idealEdgeLength(D) : n.idealEdgeLength, L = pt(n.edgeElasticity) ? n.edgeElasticity(D) : n.edgeElasticity, B = s.idToIndex[O.sourceId], I = s.idToIndex[O.targetId], M = s.indexToGraph[B], A = s.indexToGraph[I]; if (M != A) { for (var R = gP(O.sourceId, O.targetId, s), K = s.graphSet[R], H = 0, m = s.layoutNodes[B]; K.indexOf(m.id) === -1; ) m = s.layoutNodes[s.idToIndex[m.parentId]], H++; for (m = s.layoutNodes[I]; K.indexOf(m.id) === -1; ) m = s.layoutNodes[s.idToIndex[m.parentId]], H++; F *= H * n.nestingFactor; } O.idealLength = F, O.elasticity = L, s.layoutEdges.push(O); } return s; }, gP = function(e, r, n) { var a = mP(e, r, 0, n); return 2 > a.count ? 0 : a.graph; }, mP = function t(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 o = 0, s = 0; s < i.length; s++) { var u = i[s], l = a.idToIndex[u], c = a.layoutNodes[l].children; if (c.length !== 0) { var d = a.indexToGraph[a.idToIndex[c[0]]], v = t(e, r, d, a); if (v.count !== 0) if (v.count === 1) { if (o++, o === 2) break; } else return v; } } return { count: o, graph: n }; }, yP, bP = function(e, r) { for (var n = e.clientWidth, a = e.clientHeight, i = 0; i < e.nodeSize; i++) { var o = e.layoutNodes[i]; o.children.length === 0 && !o.isLocked && (o.positionX = Math.random() * n, o.positionY = Math.random() * a); } }, tg = 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(o) { var s = e.layoutNodes[e.idToIndex[o.data("id")]]; i.x1 = Math.min(i.x1, s.positionX), i.x2 = Math.max(i.x2, s.positionX), i.y1 = Math.min(i.y1, s.positionY), i.y2 = Math.max(i.y2, s.positionY); }), i.w = i.x2 - i.x1, i.h = i.y2 - i.y1), function(o, s) { var u = e.layoutNodes[e.idToIndex[o.data("id")]]; if (r.boundingBox) { var l = (u.positionX - i.x1) / i.w, c = (u.positionY - i.y1) / i.h; return { x: a.x1 + l * a.w, y: a.y1 + c * a.h }; } else return { x: u.positionX, y: u.positionY }; }; }, wP = function(e, r, n) { var a = n.layout, i = n.eles.nodes(), o = tg(e, n, i); i.positions(o), e.ready !== !0 && (e.ready = !0, a.one("layoutready", n.ready), a.emit({ type: "layoutready", layout: this })); }, xP = function(e, r, n) { CP(e, r), SP(e), TP(e, r), _P(e), DP(e); }, CP = function(e, r) { for (var n = 0; n < e.graphSet.length; n++) for (var a = e.graphSet[n], i = a.length, o = 0; o < i; o++) for (var s = e.layoutNodes[e.idToIndex[a[o]]], u = o + 1; u < i; u++) { var l = e.layoutNodes[e.idToIndex[a[u]]]; EP(s, l, e, r); } }, Zf = function(e) { return -e + 2 * e * Math.random(); }, EP = function(e, r, n, a) { var i = e.cmptId, o = r.cmptId; if (!(i !== o && !n.isCompound)) { var s = r.positionX - e.positionX, u = r.positionY - e.positionY, l = 1; s === 0 && u === 0 && (s = Zf(l), u = Zf(l)); var c = kP(e, r, s, u); if (c > 0) var d = a.nodeOverlap * c, v = Math.sqrt(s * s + u * u), h = d * s / v, f = d * u / v; else var p = Bs(e, s, u), m = Bs(r, -1 * s, -1 * u), g = m.x - p.x, y = m.y - p.y, b = g * g + y * y, v = Math.sqrt(b), d = (e.nodeRepulsion + r.nodeRepulsion) / b, h = d * g / v, f = d * y / v; e.isLocked || (e.offsetX -= h, e.offsetY -= f), r.isLocked || (r.offsetX += h, r.offsetY += f); } }, kP = 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 o = e.maxY - r.minY; else var o = r.maxY - e.minY; return i >= 0 && o >= 0 ? Math.sqrt(i * i + o * o) : 0; }, Bs = function(e, r, n) { var a = e.positionX, i = e.positionY, o = e.height || 1, s = e.width || 1, u = n / r, l = o / s, c = {}; return r === 0 && 0 < n || r === 0 && 0 > n ? (c.x = a, c.y = i + o / 2, c) : 0 < r && -1 * l <= u && u <= l ? (c.x = a + s / 2, c.y = i + s * n / 2 / r, c) : 0 > r && -1 * l <= u && u <= l ? (c.x = a - s / 2, c.y = i - s * n / 2 / r, c) : 0 < n && (u <= -1 * l || u >= l) ? (c.x = a + o * r / 2 / n, c.y = i + o / 2, c) : (0 > n && (u <= -1 * l || u >= l) && (c.x = a - o * r / 2 / n, c.y = i - o / 2), c); }, SP = function(e, r) { for (var n = 0; n < e.edgeSize; n++) { var a = e.layoutEdges[n], i = e.idToIndex[a.sourceId], o = e.layoutNodes[i], s = e.idToIndex[a.targetId], u = e.layoutNodes[s], l = u.positionX - o.positionX, c = u.positionY - o.positionY; if (!(l === 0 && c === 0)) { var d = Bs(o, l, c), v = Bs(u, -1 * l, -1 * c), h = v.x - d.x, f = v.y - d.y, p = Math.sqrt(h * h + f * f), m = Math.pow(a.idealLength - p, 2) / a.elasticity; if (p !== 0) var g = m * h / p, y = m * f / p; else var g = 0, y = 0; o.isLocked || (o.offsetX += g, o.offsetY += y), u.isLocked || (u.offsetX -= g, u.offsetY -= y); } } }, TP = function(e, r) { if (r.gravity !== 0) for (var n = 1, a = 0; a < e.graphSet.length; a++) { var i = e.graphSet[a], o = i.length; if (a === 0) var s = e.clientHeight / 2, u = e.clientWidth / 2; else var l = e.layoutNodes[e.idToIndex[i[0]]], c = e.layoutNodes[e.idToIndex[l.parentId]], s = c.positionX, u = c.positionY; for (var d = 0; d < o; d++) { var v = e.layoutNodes[e.idToIndex[i[d]]]; if (!v.isLocked) { var h = s - v.positionX, f = u - v.positionY, p = Math.sqrt(h * h + f * f); if (p > n) { var m = r.gravity * h / p, g = r.gravity * f / p; v.offsetX += m, v.offsetY += g; } } } } }, _P = 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 o = n[a++], s = e.idToIndex[o], u = e.layoutNodes[s], l = u.children; if (0 < l.length && !u.isLocked) { for (var c = u.offsetX, d = u.offsetY, v = 0; v < l.length; v++) { var h = e.layoutNodes[e.idToIndex[l[v]]]; h.offsetX += c, h.offsetY += d, n[++i] = l[v]; } u.offsetX = 0, u.offsetY = 0; } } }, DP = 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 = PP(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, OP(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); } }, PP = 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; }, OP = function t(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 t(a, r); } }, Xf = function(e, r) { for (var n = e.layoutNodes, a = [], i = 0; i < n.length; i++) { var o = n[i], s = o.cmptId, u = a[s] = a[s] || []; u.push(o); } for (var l = 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 v = c[d]; c.x1 = Math.min(c.x1, v.positionX - v.width / 2), c.x2 = Math.max(c.x2, v.positionX + v.width / 2), c.y1 = Math.min(c.y1, v.positionY - v.height / 2), c.y2 = Math.max(c.y2, v.positionY + v.height / 2); } c.w = c.x2 - c.x1, c.h = c.y2 - c.y1, l += c.w * c.h; } } a.sort(function(y, b) { return b.w * b.h - y.w * y.h; }); for (var h = 0, f = 0, p = 0, m = 0, g = Math.sqrt(l) * 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 v = c[d]; v.isLocked || (v.positionX += h - c.x1, v.positionY += f - c.y1); } h += c.w + r.componentSpacing, p += c.w + r.componentSpacing, m = Math.max(m, c.h), p > g && (f += m + r.componentSpacing, h = 0, p = 0, m = 0); } } }, LP = { fit: !0, // whether to fit the viewport to the graph padding: 30, // padding used on fit boundingBox: void 0, // constrain layout bounds; { x1, y1, x2, y2 } or { x1, y1, w, h } avoidOverlap: !0, // prevents node overlap, may overflow boundingBox if not enough space avoidOverlapPadding: 10, // extra spacing around nodes when avoidOverlap: true nodeDimensionsIncludeLabels: !1, // Excludes the label when calculating node bounding boxes for the layout algorithm spacingFactor: void 0, // Applies a multiplicative factor (>0) to expand or compress the overall area that the nodes take up condense: !1, // uses all available space on false, uses minimal space on true rows: void 0, // force num of rows in the grid cols: void 0, // force num of columns in the grid position: function(e) { }, // returns { row, col } for element sort: void 0, // a sorting function to order the nodes; e.g. function(a, b){ return a.data('weight') - b.data('weight') } animate: !1, // whether to transition the node positions animationDuration: 500, // duration of animation in ms if enabled animationEasing: void 0, // easing of animation if enabled animateFilter: function(e, r) { return !0; }, // a function that determines whether the node should be animated. All nodes animated by default on animate enabled. Non-animated nodes are positioned immediately when the layout starts ready: void 0, // callback on layoutready stop: void 0, // callback on layoutstop transform: function(e, r) { return r; } // transform a given node position. Useful for changing flow direction in discrete layouts }; function rg(t) { this.options = Re({}, LP, t); } rg.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 = pr(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(ee) { return { x: i.x1, y: i.y1 }; }); else { var o = a.size(), s = Math.sqrt(o * i.h / i.w), u = Math.round(s), l = Math.round(i.w / i.h * s), c = function(se) { if (se == null) return Math.min(u, l); var oe = Math.min(u, l); oe == u ? u = se : l = se; }, d = function(se) { if (se == null) return Math.max(u, l); var oe = Math.max(u, l); oe == u ? u = se : l = se; }, v = e.rows, h = e.cols != null ? e.cols : e.columns; if (v != null && h != null) u = v, l = h; else if (v != null && h == null) u = v, l = Math.ceil(o / u); else if (v == null && h != null) l = h, u = Math.ceil(o / l); else if (l * u > o) { var f = c(), p = d(); (f - 1) * p >= o ? c(f - 1) : (p - 1) * f >= o && d(p - 1); } else for (; l * u < o; ) { var m = c(), g = d(); (g + 1) * m >= o ? d(g + 1) : c(m + 1); } var y = i.w / l, b = i.h / u; if (e.condense && (y = 0, b = 0), e.avoidOverlap) for (var w = 0; w < a.length; w++) { var C = a[w], E = C._private.position; (E.x == null || E.y == null) && (E.x = 0, E.y = 0); var x = C.layoutDimensions(e), T = e.avoidOverlapPadding, k = x.w + T, _ = x.h + T; y = Math.max(y, k), b = Math.max(b, _); } for (var D = {}, O = function(se, oe) { return !!D["c-" + se + "-" + oe]; }, F = function(se, oe) { D["c-" + se + "-" + oe] = !0; }, L = 0, B = 0, I = function() { B++, B >= l && (B = 0, L++); }, M = {}, A = 0; A < a.length; A++) { var R = a[A], K = e.position(R); if (K && (K.row !== void 0 || K.col !== void 0)) { var H = { row: K.row, col: K.col }; if (H.col === void 0) for (H.col = 0; O(H.row, H.col); ) H.col++; else if (H.row === void 0) for (H.row = 0; O(H.row, H.col); ) H.row++; M[R.id()] = H, F(H.row, H.col); } } var q = function(se, oe) { var ne, ue; if (se.locked() || se.isParent()) return !1; var te = M[se.id()]; if (te) ne = te.col * y + y / 2 + i.x1, ue = te.row * b + b / 2 + i.y1; else { for (; O(L, B); ) I(); ne = B * y + y / 2 + i.x1, ue = L * b + b / 2 + i.y1, F(L, B), I(); } return { x: ne, y: ue }; }; a.layoutPositions(this, e, q); } return this; }; var IP = { ready: function() { }, // on layoutready stop: function() { } // on layoutstop }; function kc(t) { this.options = Re({}, IP, t); } kc.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; }; kc.prototype.stop = function() { return this; }; var FP = { positions: void 0, // map of (node id) => (position obj); or function(node){ return somPos; } zoom: void 0, // the zoom level to set (prob want fit = false if set) pan: void 0, // the pan level to set (prob want fit = false if set) fit: !0, // whether to fit to viewport padding: 30, // padding on fit spacingFactor: void 0, // Applies a multiplicative factor (>0) to expand or compress the overall area that the nodes take up animate: !1, // whether to transition the node positions animationDuration: 500, // duration of animation in ms if enabled animationEasing: void 0, // easing of animation if enabled animateFilter: function(e, r) { return !0; }, // a function that determines whether the node should be animated. All nodes animated by default on animate enabled. Non-animated nodes are positioned immediately when the layout starts ready: void 0, // callback on layoutready stop: void 0, // callback on layoutstop transform: function(e, r) { return r; } // transform a given node position. Useful for changing flow direction in discrete layouts }; function ng(t) { this.options = Re({}, FP, t); } ng.prototype.run = function() { var t = this.options, e = t.eles, r = e.nodes(), n = pt(t.positions); function a(i) { if (t.positions == null) return N5(i.position()); if (n) return t.positions(i); var o = t.positions[i._private.data.id]; return o ?? null; } return r.layoutPositions(this, t, function(i, o) { var s = a(i); return i.locked() || s == null ? !1 : s; }), this; }; var AP = { fit: !0, // whether to fit to viewport padding: 30, // fit padding boundingBox: void 0, // constrain layout bounds; { x1, y1, x2, y2 } or { x1, y1, w, h } animate: !1, // whether to transition the node positions animationDuration: 500, // duration of animation in ms if enabled animationEasing: void 0, // easing of animation if enabled animateFilter: function(e, r) { return !0; }, // a function that determines whether the node should be animated. All nodes animated by default on animate enabled. Non-animated nodes are positioned immediately when the layout starts ready: void 0, // callback on layoutready stop: void 0, // callback on layoutstop transform: function(e, r) { return r; } // transform a given node position. Useful for changing flow direction in discrete layouts }; function ag(t) { this.options = Re({}, AP, t); } ag.prototype.run = function() { var t = this.options, e = t.cy, r = t.eles, n = pr(t.boundingBox ? t.boundingBox : { x1: 0, y1: 0, w: e.width(), h: e.height() }), a = function(o, s) { 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 MP = [{ name: "breadthfirst", impl: Qp }, { name: "circle", impl: Jp }, { name: "concentric", impl: eg }, { name: "cose", impl: hl }, { name: "grid", impl: rg }, { name: "null", impl: kc }, { name: "preset", impl: ng }, { name: "random", impl: ag }]; function ig(t) { this.options = t, this.notifications = 0; } var jf = function() { }, Qf = function() { throw new Error("A headless instance can not render images"); }; ig.prototype = { recalculateRenderedStyle: jf, notify: function() { this.notifications++; }, init: jf, isHeadless: function() { return !0; }, png: Qf, jpg: Qf }; var Sc = {}; Sc.arrowShapeWidth = 0.3; Sc.registerArrowShapes = function() { var t = this.arrowShapes = {}, e = this, r = function(l, c, d, v, h, f, p) { var m = h.x - d / 2 - p, g = h.x + d / 2 + p, y = h.y - d / 2 - p, b = h.y + d / 2 + p, w = m <= l && l <= g && y <= c && c <= b; return w; }, n = function(l, c, d, v, h) { var f = l * Math.cos(v) - c * Math.sin(v), p = l * Math.sin(v) + c * Math.cos(v), m = f * d, g = p * d, y = m + h.x, b = g + h.y; return { x: y, y: b }; }, a = function(l, c, d, v) { for (var h = [], f = 0; f < l.length; f += 2) { var p = l[f], m = l[f + 1]; h.push(n(p, m, c, d, v)); } return h; }, i = function(l) { for (var c = [], d = 0; d < l.length; d++) { var v = l[d]; c.push(v.x, v.y); } return c; }, o = function(l) { return l.pstyle("width").pfValue * l.pstyle("arrow-scale").pfValue * 2; }, s = function(l, c) { Fe(c) && (c = t[c]), t[l] = Re({ name: l, points: [-0.15, -0.3, 0.15, -0.3, 0.15, 0.3, -0.15, 0.3], collide: function(v, h, f, p, m, g) { var y = i(a(this.points, f + 2 * g, p, m)), b = dr(v, h, y); return b; }, roughCollide: r, draw: function(v, h, f, p) { var m = a(this.points, h, f, p); e.arrowShapeImpl("polygon")(v, m); }, spacing: function(v) { return 0; }, gap: o }, c); }; s("none", { collide: Os, roughCollide: Os, draw: cc, spacing: lf, gap: lf }), s("triangle", { points: [-0.15, -0.3, 0, 0, 0.15, -0.3] }), s("arrow", "triangle"), s("triangle-backcurve", { points: t.triangle.points, controlPoint: [0, -0.15], roughCollide: r, draw: function(l, c, d, v, h) { var f = a(this.points, c, d, v), p = this.controlPoint, m = n(p[0], p[1], c, d, v); e.arrowShapeImpl(this.name)(l, f, m); }, gap: function(l) { return o(l) * 0.8; } }), s("triangle-tee", { points: [0, 0, 0.15, -0.3, -0.15, -0.3, 0, 0], pointsTee: [-0.15, -0.4, -0.15, -0.5, 0.15, -0.5, 0.15, -0.4], collide: function(l, c, d, v, h, f, p) { var m = i(a(this.points, d + 2 * p, v, h)), g = i(a(this.pointsTee, d + 2 * p, v, h)), y = dr(l, c, m) || dr(l, c, g); return y; }, draw: function(l, c, d, v, h) { var f = a(this.points, c, d, v), p = a(this.pointsTee, c, d, v); e.arrowShapeImpl(this.name)(l, f, p); } }), s("circle-triangle", { radius: 0.15, pointsTr: [0, -0.15, 0.15, -0.45, -0.15, -0.45, 0, -0.15], collide: function(l, c, d, v, h, f, p) { var m = h, g = Math.pow(m.x - l, 2) + Math.pow(m.y - c, 2) <= Math.pow((d + 2 * p) * this.radius, 2), y = i(a(this.points, d + 2 * p, v, h)); return dr(l, c, y) || g; }, draw: function(l, c, d, v, h) { var f = a(this.pointsTr, c, d, v); e.arrowShapeImpl(this.name)(l, f, v.x, v.y, this.radius * c); }, spacing: function(l) { return e.getArrowWidth(l.pstyle("width").pfValue, l.pstyle("arrow-scale").value) * this.radius; } }), s("triangle-cross", { points: [0, 0, 0.15, -0.3, -0.15, -0.3, 0, 0], baseCrossLinePts: [ -0.15, -0.4, // first half of the rectangle -0.15, -0.4, 0.15, -0.4, // second half of the rectangle 0.15, -0.4 ], crossLinePts: function(l, c) { var d = this.baseCrossLinePts.slice(), v = c / l, h = 3, f = 5; return d[h] = d[h] - v, d[f] = d[f] - v, d; }, collide: function(l, c, d, v, h, f, p) { var m = i(a(this.points, d + 2 * p, v, h)), g = i(a(this.crossLinePts(d, f), d + 2 * p, v, h)), y = dr(l, c, m) || dr(l, c, g); return y; }, draw: function(l, c, d, v, h) { var f = a(this.points, c, d, v), p = a(this.crossLinePts(c, h), c, d, v); e.arrowShapeImpl(this.name)(l, f, p); } }), s("vee", { points: [-0.15, -0.3, 0, 0, 0.15, -0.3, 0, -0.15], gap: function(l) { return o(l) * 0.525; } }), s("circle", { radius: 0.15, collide: function(l, c, d, v, h, f, p) { var m = h, g = Math.pow(m.x - l, 2) + Math.pow(m.y - c, 2) <= Math.pow((d + 2 * p) * this.radius, 2); return g; }, draw: function(l, c, d, v, h) { e.arrowShapeImpl(this.name)(l, v.x, v.y, this.radius * c); }, spacing: function(l) { return e.getArrowWidth(l.pstyle("width").pfValue, l.pstyle("arrow-scale").value) * this.radius; } }), s("tee", { points: [-0.15, 0, -0.15, -0.1, 0.15, -0.1, 0.15, 0], spacing: function(l) { return 1; }, gap: function(l) { return 1; } }), s("square", { points: [-0.15, 0, 0.15, 0, 0.15, -0.3, -0.15, -0.3] }), s("diamond", { points: [-0.15, -0.15, 0, -0.3, 0.15, -0.15, 0, 0], gap: function(l) { return l.pstyle("width").pfValue * l.pstyle("arrow-scale").value; } }), s("chevron", { points: [0, 0, -0.15, -0.15, -0.1, -0.2, 0, -0.1, 0.1, -0.2, 0.15, -0.15], gap: function(l) { return 0.95 * l.pstyle("width").pfValue * l.pstyle("arrow-scale").value; } }); }; var Da = {}; Da.projectIntoViewport = function(t, e) { var r = this.cy, n = this.findContainerClientCoords(), a = n[0], i = n[1], o = n[4], s = r.pan(), u = r.zoom(), l = ((t - a) / o - s.x) / u, c = ((e - i) / o - s.y) / u; return [l, c]; }; Da.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") }, o = t.clientWidth, s = t.clientHeight, u = a.left + a.right, l = a.top + a.bottom, c = i.left + i.right, d = e.width / (o + c), v = o - u, h = s - l, f = e.left + a.left + i.left, p = e.top + a.top + i.top; return this.containerBB = [f, p, v, h, d]; }; Da.invalidateContainerClientCoordsCache = function() { this.containerBB = null; }; Da.findNearestElement = function(t, e, r, n) { return this.findNearestElements(t, e, r, n)[0]; }; Da.findNearestElements = function(t, e, r, n) { var a = this, i = this, o = i.getCachedZSortedEles(), s = [], u = i.cy.zoom(), l = i.cy.hasCompoundNodes(), c = (n ? 24 : 8) / u, d = (n ? 8 : 2) / u, v = (n ? 8 : 2) / u, h = 1 / 0, f, p; r && (o = o.interactive); function m(x, T) { if (x.isNode()) { if (p) return; p = x, s.push(x); } if (x.isEdge() && (T == null || T < h)) if (f) { if (f.pstyle("z-compound-depth").value === x.pstyle("z-compound-depth").value && f.pstyle("z-compound-depth").value === x.pstyle("z-compound-depth").value) { for (var k = 0; k < s.length; k++) if (s[k].isEdge()) { s[k] = x, f = x, h = T ?? h; break; } } } else s.push(x), f = x, h = T ?? h; } function g(x) { var T = x.outerWidth() + 2 * d, k = x.outerHeight() + 2 * d, _ = T / 2, D = k / 2, O = x.position(), F = x.pstyle("corner-radius").value === "auto" ? "auto" : x.pstyle("corner-radius").pfValue, L = x._private.rscratch; if (O.x - _ <= t && t <= O.x + _ && O.y - D <= e && e <= O.y + D) { var B = i.nodeShapes[a.getNodeShape(x)]; if (B.checkPoint(t, e, 0, T, k, O.x, O.y, F, L)) return m(x, 0), !0; } } function y(x) { var T = x._private, k = T.rscratch, _ = x.pstyle("width").pfValue, D = x.pstyle("arrow-scale").value, O = _ / 2 + c, F = O * O, L = O * 2, A = T.source, R = T.target, B; if (k.edgeType === "segments" || k.edgeType === "straight" || k.edgeType === "haystack") { for (var I = k.allpts, M = 0; M + 3 < I.length; M += 2) if (X5(t, e, I[M], I[M + 1], I[M + 2], I[M + 3], L) && F > (B = t4(t, e, I[M], I[M + 1], I[M + 2], I[M + 3]))) return m(x, B), !0; } else if (k.edgeType === "bezier" || k.edgeType === "multibezier" || k.edgeType === "self" || k.edgeType === "compound") { for (var I = k.allpts, M = 0; M + 5 < k.allpts.length; M += 4) if (j5(t, e, I[M], I[M + 1], I[M + 2], I[M + 3], I[M + 4], I[M + 5], L) && F > (B = e4(t, e, I[M], I[M + 1], I[M + 2], I[M + 3], I[M + 4], I[M + 5]))) return m(x, B), !0; } for (var A = A || T.source, R = R || T.target, K = a.getArrowWidth(_, D), H = [{ name: "source", x: k.arrowStartX, y: k.arrowStartY, angle: k.srcArrowAngle }, { name: "target", x: k.arrowEndX, y: k.arrowEndY, angle: k.tgtArrowAngle }, { name: "mid-source", x: k.midX, y: k.midY, angle: k.midsrcArrowAngle }, { name: "mid-target", x: k.midX, y: k.midY, angle: k.midtgtArrowAngle }], M = 0; M < H.length; M++) { var q = H[M], ee = i.arrowShapes[x.pstyle(q.name + "-arrow-shape").value], se = x.pstyle("width").pfValue; if (ee.roughCollide(t, e, K, q.angle, { x: q.x, y: q.y }, se, c) && ee.collide(t, e, K, q.angle, { x: q.x, y: q.y }, se, c)) return m(x), !0; } l && s.length > 0 && (g(A), g(R)); } function b(x, T, k) { return Nr(x, T, k); } function w(x, T) { var k = x._private, _ = v, D; T ? D = T + "-" : D = "", x.boundingBox(); var O = k.labelBounds[T || "main"], F = x.pstyle(D + "label").value, L = x.pstyle("text-events").strValue === "yes"; if (!(!L || !F)) { var B = b(k.rscratch, "labelX", T), I = b(k.rscratch, "labelY", T), M = b(k.rscratch, "labelAngle", T), A = x.pstyle(D + "text-margin-x").pfValue, R = x.pstyle(D + "text-margin-y").pfValue, K = O.x1 - _ - A, H = O.x2 + _ - A, q = O.y1 - _ - R, ee = O.y2 + _ - R; if (M) { var se = Math.cos(M), oe = Math.sin(M), ne = function(Ee, fe) { return Ee = Ee - B, fe = fe - I, { x: Ee * se - fe * oe + B, y: Ee * oe + fe * se + I }; }, ue = ne(K, q), te = ne(K, ee), $ = ne(H, q), G = ne(H, ee), Q = [ // with the margin added after the rotation is applied ue.x + A, ue.y + R, $.x + A, $.y + R, G.x + A, G.y + R, te.x + A, te.y + R ]; if (dr(t, e, Q)) return m(x), !0; } else if (oi(O, t, e)) return m(x), !0; } } for (var C = o.length - 1; C >= 0; C--) { var E = o[C]; E.isNode() ? g(E) || w(E) : y(E) || w(E) || w(E, "source") || w(E, "target"); } return s; }; Da.getAllInBox = function(t, e, r, n) { var a = this.getCachedZSortedEles().interactive, i = [], o = Math.min(t, r), s = Math.max(t, r), u = Math.min(e, n), l = Math.max(e, n); t = o, r = s, e = u, n = l; for (var c = pr({ x1: t, y1: e, x2: r, y2: n }), d = 0; d < a.length; d++) { var v = a[d]; if (v.isNode()) { var h = v, f = h.boundingBox({ includeNodes: !0, includeEdges: !1, includeLabels: !1 }); vc(c, f) && !hp(f, c) && i.push(h); } else { var p = v, m = p._private, g = m.rscratch; if (g.startX != null && g.startY != null && !oi(c, g.startX, g.startY) || g.endX != null && g.endY != null && !oi(c, g.endX, g.endY)) continue; if (g.edgeType === "bezier" || g.edgeType === "multibezier" || g.edgeType === "self" || g.edgeType === "compound" || g.edgeType === "segments" || g.edgeType === "haystack") { for (var y = m.rstyle.bezierPts || m.rstyle.linePts || m.rstyle.haystackPts, b = !0, w = 0; w < y.length; w++) if (!Z5(c, y[w])) { b = !1; break; } b && i.push(p); } else (g.edgeType === "haystack" || g.edgeType === "straight") && i.push(p); } } return i; }; var Ns = {}; Ns.calculateArrowAngles = function(t) { var e = t._private.rscratch, r = e.edgeType === "haystack", n = e.edgeType === "bezier", a = e.edgeType === "multibezier", i = e.edgeType === "segments", o = e.edgeType === "compound", s = e.edgeType === "self", u, l, c, d, v, h, g, y; if (r ? (c = e.haystackPts[0], d = e.haystackPts[1], v = e.haystackPts[2], h = e.haystackPts[3]) : (c = e.arrowStartX, d = e.arrowStartY, v = e.arrowEndX, h = e.arrowEndY), g = e.midX, y = e.midY, i) u = c - e.segpts[0], l = d - e.segpts[1]; else if (a || o || s || n) { var f = e.allpts, p = Nt(f[0], f[2], f[4], 0.1), m = Nt(f[1], f[3], f[5], 0.1); u = c - p, l = d - m; } else u = c - g, l = d - y; e.srcArrowAngle = Wo(u, l); var g = e.midX, y = e.midY; if (r && (g = (c + v) / 2, y = (d + h) / 2), u = v - c, l = h - d, i) { var f = e.allpts; if (f.length / 2 % 2 === 0) { var b = f.length / 2, w = b - 2; u = f[b] - f[w], l = f[b + 1] - f[w + 1]; } else if (e.isRound) u = e.midVector[1], l = -e.midVector[0]; else { var b = f.length / 2 - 1, w = b - 2; u = f[b] - f[w], l = f[b + 1] - f[w + 1]; } } else if (a || o || s) { var f = e.allpts, C = e.ctrlpts, E, x, T, k; if (C.length / 2 % 2 === 0) { var _ = f.length / 2 - 1, D = _ + 2, O = D + 2; E = Nt(f[_], f[D], f[O], 0), x = Nt(f[_ + 1], f[D + 1], f[O + 1], 0), T = Nt(f[_], f[D], f[O], 1e-4), k = Nt(f[_ + 1], f[D + 1], f[O + 1], 1e-4); } else { var D = f.length / 2 - 1, _ = D - 2, O = D + 2; E = Nt(f[_], f[D], f[O], 0.4999), x = Nt(f[_ + 1], f[D + 1], f[O + 1], 0.4999), T = Nt(f[_], f[D], f[O], 0.5), k = Nt(f[_ + 1], f[D + 1], f[O + 1], 0.5); } u = T - E, l = k - x; } if (e.midtgtArrowAngle = Wo(u, l), e.midDispX = u, e.midDispY = l, u *= -1, l *= -1, i) { var f = e.allpts; if (f.length / 2 % 2 !== 0) { if (!e.isRound) { var b = f.length / 2 - 1, F = b + 2; u = -(f[F] - f[b]), l = -(f[F + 1] - f[b + 1]); } } } if (e.midsrcArrowAngle = Wo(u, l), i) u = v - e.segpts[e.segpts.length - 2], l = h - e.segpts[e.segpts.length - 1]; else if (a || o || s || n) { var f = e.allpts, L = f.length, p = Nt(f[L - 6], f[L - 4], f[L - 2], 0.9), m = Nt(f[L - 5], f[L - 3], f[L - 1], 0.9); u = v - p, l = h - m; } else u = v - g, l = h - y; e.tgtArrowAngle = Wo(u, l); }; Ns.getArrowWidth = Ns.getArrowHeight = function(t, e) { var r = this.arrowWidthCache = this.arrowWidthCache || {}, n = r[t + ", " + e]; return n || (n = Math.max(Math.pow(t * 13.37, 0.9), 29) * e, r[t + ", " + e] = n, n); }; var pu, gu, Yr = {}, Cr = {}, Jf, ev, oa, gs, un, ea, na, Wr, Na, rs, og, sg, mu, yu, tv, rv = 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); }, BP = 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; }, NP = function(e, r, n, a, i) { if (e !== tv ? rv(r, e, Yr) : BP(Cr, Yr), rv(r, n, Cr), Jf = Yr.nx * Cr.ny - Yr.ny * Cr.nx, ev = Yr.nx * Cr.nx - Yr.ny * -Cr.ny, un = Math.asin(Math.max(-1, Math.min(1, Jf))), Math.abs(un) < 1e-6) { pu = r.x, gu = r.y, na = Na = 0; return; } oa = 1, gs = !1, ev < 0 ? un < 0 ? un = Math.PI + un : (un = Math.PI - un, oa = -1, gs = !0) : un > 0 && (oa = -1, gs = !0), r.radius !== void 0 ? Na = r.radius : Na = a, ea = un / 2, rs = Math.min(Yr.len / 2, Cr.len / 2), i ? (Wr = Math.abs(Math.cos(ea) * Na / Math.sin(ea)), Wr > rs ? (Wr = rs, na = Math.abs(Wr * Math.sin(ea) / Math.cos(ea))) : na = Na) : (Wr = Math.min(rs, Na), na = Math.abs(Wr * Math.sin(ea) / Math.cos(ea))), mu = r.x + Cr.nx * Wr, yu = r.y + Cr.ny * Wr, pu = mu - Cr.ny * na * oa, gu = yu + Cr.nx * na * oa, og = r.x + Yr.nx * Wr, sg = r.y + Yr.ny * Wr, tv = r; }; function lg(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 Tc(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 } : (NP(t, e, r, n, a), { cx: pu, cy: gu, radius: na, startX: og, startY: sg, stopX: mu, stopY: yu, startAngle: Yr.ang + Math.PI / 2 * oa, endAngle: Cr.ang - Math.PI / 2 * oa, counterClockwise: gs }); } var or = {}; or.findMidptPtsEtc = function(t, e) { var r = e.posPts, n = e.intersectionPts, a = e.vectorNormInverse, i, o = t.pstyle("source-endpoint"), s = t.pstyle("target-endpoint"), u = o.units != null && s.units != null, l = function(C, E, x, T) { var k = T - E, _ = x - C, D = Math.sqrt(_ * _ + k * k); return { x: -k / D, y: _ / D }; }, c = t.pstyle("edge-distances").value; switch (c) { case "node-position": i = r; break; case "intersection": i = n; break; case "endpoints": { if (u) { var d = this.manualEndptToPx(t.source()[0], o), v = Mr(d, 2), h = v[0], f = v[1], p = this.manualEndptToPx(t.target()[0], s), m = Mr(p, 2), g = m[0], y = m[1], b = { x1: h, y1: f, x2: g, y2: y }; a = l(h, f, g, y), i = b; } else tt("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 }; }; or.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 o = n.source, s = n.target, u = o.position(), l = s.position(), c = o.width(), d = s.width(), v = o.height(), h = s.height(), f = r.pstyle("haystack-radius").value, p = f / 2; a.haystackPts = a.allpts = [a.source.x * c * p + u.x, a.source.y * v * p + u.y, a.target.x * d * p + l.x, a.target.y * h * p + l.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); } }; or.findSegmentsPoints = function(t, e) { var r = t._private.rscratch, n = t.pstyle("segment-weights"), a = t.pstyle("segment-distances"), i = t.pstyle("segment-radii"), o = t.pstyle("radius-type"), s = Math.min(n.pfValue.length, a.pfValue.length), u = i.pfValue[i.pfValue.length - 1], l = o.pfValue[o.pfValue.length - 1]; r.edgeType = "segments", r.segpts = [], r.radii = [], r.isArcRadius = []; for (var c = 0; c < s; c++) { var d = n.pfValue[c], v = a.pfValue[c], h = 1 - d, f = d, p = this.findMidptPtsEtc(t, e), m = p.midptPts, g = p.vectorNormInverse, y = { x: m.x1 * h + m.x2 * f, y: m.y1 * h + m.y2 * f }; r.segpts.push(y.x + g.x * v, y.y + g.y * v), r.radii.push(i.pfValue[c] !== void 0 ? i.pfValue[c] : u), r.isArcRadius.push((o.pfValue[c] !== void 0 ? o.pfValue[c] : l) === "arc-radius"); } }; or.findLoopPoints = function(t, e, r, n) { var a = t._private.rscratch, i = e.dirCounts, o = e.srcPos, s = t.pstyle("control-point-distances"), u = s ? s.pfValue[0] : void 0, l = t.pstyle("loop-direction").pfValue, c = t.pstyle("loop-sweep").pfValue, d = t.pstyle("control-point-step-size").pfValue; a.edgeType = "self"; var v = r, h = d; n && (v = 0, h = u); var f = l - Math.PI / 2, p = f - c / 2, m = f + c / 2, g = l + "_" + c; v = i[g] === void 0 ? i[g] = 0 : ++i[g], a.ctrlpts = [o.x + Math.cos(p) * 1.4 * h * (v / 3 + 1), o.y + Math.sin(p) * 1.4 * h * (v / 3 + 1), o.x + Math.cos(m) * 1.4 * h * (v / 3 + 1), o.y + Math.sin(m) * 1.4 * h * (v / 3 + 1)]; }; or.findCompoundLoopPoints = function(t, e, r, n) { var a = t._private.rscratch; a.edgeType = "compound"; var i = e.srcPos, o = e.tgtPos, s = e.srcW, u = e.srcH, l = e.tgtW, c = e.tgtH, d = t.pstyle("control-point-step-size").pfValue, v = t.pstyle("control-point-distances"), h = v ? v.pfValue[0] : void 0, f = r, p = d; n && (f = 0, p = h); var m = 50, g = { x: i.x - s / 2, y: i.y - u / 2 }, y = { x: o.x - l / 2, y: o.y - c / 2 }, b = { x: Math.min(g.x, y.x), y: Math.min(g.y, y.y) }, w = 0.5, C = Math.max(w, Math.log(s * 0.01)), E = Math.max(w, Math.log(l * 0.01)); a.ctrlpts = [b.x, b.y - (1 + Math.pow(m, 1.12) / 100) * p * (f / 3 + 1) * C, b.x - (1 + Math.pow(m, 1.12) / 100) * p * (f / 3 + 1) * E, b.y]; }; or.findStraightEdgePoints = function(t) { t._private.rscratch.edgeType = "straight"; }; or.findBezierPoints = function(t, e, r, n, a) { var i = t._private.rscratch, o = t.pstyle("control-point-step-size").pfValue, s = t.pstyle("control-point-distances"), u = t.pstyle("control-point-weights"), l = s && u ? Math.min(s.value.length, u.value.length) : 1, c = s ? s.pfValue[0] : void 0, d = u.value[0], v = n; i.edgeType = v ? "multibezier" : "bezier", i.ctrlpts = []; for (var h = 0; h < l; h++) { var f = (0.5 - e.eles.length / 2 + r) * o * (a ? -1 : 1), p = void 0, m = fp(f); v && (c = s ? s.pfValue[h] : o, d = u.value[h]), n ? p = c : p = c !== void 0 ? m * c : void 0; var g = p !== void 0 ? p : f, y = 1 - d, b = d, w = this.findMidptPtsEtc(t, e), C = w.midptPts, E = w.vectorNormInverse, x = { x: C.x1 * y + C.x2 * b, y: C.y1 * y + C.y2 * b }; i.ctrlpts.push(x.x + E.x * g, x.y + E.y * g); } }; or.findTaxiPoints = function(t, e) { var r = t._private.rscratch; r.edgeType = "segments"; var n = "vertical", a = "horizontal", i = "leftward", o = "rightward", s = "downward", u = "upward", l = "auto", c = e.posPts, d = e.srcW, v = e.srcH, h = e.tgtW, f = e.tgtH, p = t.pstyle("edge-distances").value, m = p !== "node-position", g = t.pstyle("taxi-direction").value, y = g, b = t.pstyle("taxi-turn"), w = b.units === "%", C = b.pfValue, E = C < 0, x = t.pstyle("taxi-turn-min-distance").pfValue, T = m ? (d + h) / 2 : 0, k = m ? (v + f) / 2 : 0, _ = c.x2 - c.x1, D = c.y2 - c.y1, O = function(Ae, Me) { return Ae > 0 ? Math.max(Ae - Me, 0) : Math.min(Ae + Me, 0); }, F = O(_, T), L = O(D, k), B = !1; y === l ? g = Math.abs(F) > Math.abs(L) ? a : n : y === u || y === s ? (g = n, B = !0) : (y === i || y === o) && (g = a, B = !0); var I = g === n, M = I ? L : F, A = I ? D : _, R = fp(A), K = !1; !(B && (w || E)) && (y === s && A < 0 || y === u && A > 0 || y === i && A > 0 || y === o && A < 0) && (R *= -1, M = R * Math.abs(M), K = !0); var H; if (w) { var q = C < 0 ? 1 + C : C; H = q * M; } else { var ee = C < 0 ? M : 0; H = ee + C * R; } var se = function(Ae) { return Math.abs(Ae) < x || Math.abs(Ae) >= Math.abs(M); }, oe = se(H), ne = se(Math.abs(M) - Math.abs(H)), ue = oe || ne; if (ue && !K) if (I) { var te = Math.abs(A) <= v / 2, $ = Math.abs(_) <= h / 2; if (te) { var G = (c.x1 + c.x2) / 2, Q = c.y1, ge = c.y2; r.segpts = [G, Q, G, ge]; } else if ($) { var Ee = (c.y1 + c.y2) / 2, fe = c.x1, me = c.x2; r.segpts = [fe, Ee, me, Ee]; } else r.segpts = [c.x1, c.y2]; } else { var xe = Math.abs(A) <= d / 2, ke = Math.abs(D) <= f / 2; if (xe) { var Ce = (c.y1 + c.y2) / 2, De = c.x1, qe = c.x2; r.segpts = [De, Ce, qe, Ce]; } else if (ke) { var Ke = (c.x1 + c.x2) / 2, Be = c.y1, Ge = c.y2; r.segpts = [Ke, Be, Ke, Ge]; } else r.segpts = [c.x2, c.y1]; } else if (I) { var le = c.y1 + H + (m ? v / 2 * R : 0), S = c.x1, z = c.x2; r.segpts = [S, le, z, le]; } else { var ae = c.x1 + H + (m ? d / 2 * R : 0), j = c.y1, Y = c.y2; r.segpts = [ae, j, ae, Y]; } if (r.isRound) { var pe = t.pstyle("taxi-radius").value, re = t.pstyle("radius-type").value[0] === "arc-radius"; r.radii = new Array(r.segpts.length / 2).fill(pe), r.isArcRadius = new Array(r.segpts.length / 2).fill(re); } }; or.tryToCorrectInvalidPoints = function(t, e) { var r = t._private.rscratch; if (r.edgeType === "bezier") { var n = e.srcPos, a = e.tgtPos, i = e.srcW, o = e.srcH, s = e.tgtW, u = e.tgtH, l = e.srcShape, c = e.tgtShape, d = e.srcCornerRadius, v = e.tgtCornerRadius, h = e.srcRs, f = e.tgtRs, p = !be(r.startX) || !be(r.startY), m = !be(r.arrowStartX) || !be(r.arrowStartY), g = !be(r.endX) || !be(r.endY), y = !be(r.arrowEndX) || !be(r.arrowEndY), b = 3, w = this.getArrowWidth(t.pstyle("width").pfValue, t.pstyle("arrow-scale").value) * this.arrowShapeWidth, C = b * w, E = ya({ x: r.ctrlpts[0], y: r.ctrlpts[1] }, { x: r.startX, y: r.startY }), x = E < C, T = ya({ x: r.ctrlpts[0], y: r.ctrlpts[1] }, { x: r.endX, y: r.endY }), k = T < C, _ = !1; if (p || m || x) { _ = !0; var D = { // delta x: r.ctrlpts[0] - n.x, y: r.ctrlpts[1] - n.y }, O = Math.sqrt(D.x * D.x + D.y * D.y), F = { // normalised delta x: D.x / O, y: D.y / O }, L = Math.max(i, o), B = { // *2 radius guarantees outside shape x: r.ctrlpts[0] + F.x * 2 * L, y: r.ctrlpts[1] + F.y * 2 * L }, I = l.intersectLine(n.x, n.y, i, o, B.x, B.y, 0, d, h); x ? (r.ctrlpts[0] = r.ctrlpts[0] + F.x * (C - E), r.ctrlpts[1] = r.ctrlpts[1] + F.y * (C - E)) : (r.ctrlpts[0] = I[0] + F.x * C, r.ctrlpts[1] = I[1] + F.y * C); } if (g || y || k) { _ = !0; var M = { // delta x: r.ctrlpts[0] - a.x, y: r.ctrlpts[1] - a.y }, A = Math.sqrt(M.x * M.x + M.y * M.y), R = { // normalised delta x: M.x / A, y: M.y / A }, K = Math.max(i, o), H = { // *2 radius guarantees outside shape x: r.ctrlpts[0] + R.x * 2 * K, y: r.ctrlpts[1] + R.y * 2 * K }, q = c.intersectLine(a.x, a.y, s, u, H.x, H.y, 0, v, f); k ? (r.ctrlpts[0] = r.ctrlpts[0] + R.x * (C - T), r.ctrlpts[1] = r.ctrlpts[1] + R.y * (C - T)) : (r.ctrlpts[0] = q[0] + R.x * C, r.ctrlpts[1] = q[1] + R.y * C); } _ && this.findEndpoints(t); } }; or.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 = 0.5, e.midX = Nt(e.allpts[n], e.allpts[n + 2], e.allpts[n + 4], a), e.midY = Nt(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 o = e.radii[i / 2 - 1], s = e.isArcRadius[i / 2 - 1]; e.roundCorners.push(Tc({ x: e.allpts[i - 2], y: e.allpts[i - 1] }, { x: e.allpts[i], y: e.allpts[i + 1], radius: o }, { x: e.allpts[i + 2], y: e.allpts[i + 3] }, o, s)); } } if (e.segpts.length % 4 === 0) { var u = e.segpts.length / 2, l = u - 2; e.midX = (e.segpts[l] + e.segpts[u]) / 2, e.midY = (e.segpts[l + 1] + e.segpts[u + 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] }, v = e.roundCorners[c / 2], h = [d.x - v.cx, d.y - v.cy], f = v.radius / Math.sqrt(Math.pow(h[0], 2) + Math.pow(h[1], 2)); h = h.map(function(p) { return p * f; }), e.midX = v.cx + h[0], e.midY = v.cy + h[1], e.midVector = h; } } } }; or.checkForInvalidEdgeWarning = function(t) { var e = t[0]._private.rscratch; e.nodesOverlap || be(e.startX) && be(e.startY) && be(e.endX) && be(e.endY) ? e.loggedErr = !1 : e.loggedErr || (e.loggedErr = !0, tt("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.")); }; or.findEdgeControlPoints = function(t) { var e = this; if (!(!t || t.length === 0)) { for (var r = this, n = r.cy, a = n.hasCompoundNodes(), i = { map: new Xr(), get: function(x) { var T = this.map.get(x[0]); return T != null ? T.get(x[1]) : null; }, set: function(x, T) { var k = this.map.get(x[0]); k == null && (k = new Xr(), this.map.set(x[0], k)), k.set(x[1], T); } }, o = [], s = [], u = 0; u < t.length; u++) { var l = t[u], c = l._private, d = l.pstyle("curve-style").value; if (!(l.removed() || !l.takesUpSpace())) { if (d === "haystack") { s.push(l); continue; } var v = d === "unbundled-bezier" || d.endsWith("segments") || d === "straight" || d === "straight-triangle" || d.endsWith("taxi"), h = d === "unbundled-bezier" || d === "bezier", f = c.source, p = c.target, m = f.poolIndex(), g = p.poolIndex(), y = [m, g].sort(), b = i.get(y); b == null && (b = { eles: [] }, i.set(y, b), o.push(y)), b.eles.push(l), v && (b.hasUnbundled = !0), h && (b.hasBezier = !0); } } for (var w = function(x) { var T = o[x], k = i.get(T), _ = void 0; if (!k.hasUnbundled) { var D = k.eles[0].parallelEdges().filter(function(ae) { return ae.isBundledBezier(); }); dc(k.eles), D.forEach(function(ae) { return k.eles.push(ae); }), k.eles.sort(function(ae, j) { return ae.poolIndex() - j.poolIndex(); }); } var O = k.eles[0], F = O.source(), L = O.target(); if (F.poolIndex() > L.poolIndex()) { var B = F; F = L, L = B; } var I = k.srcPos = F.position(), M = k.tgtPos = L.position(), A = k.srcW = F.outerWidth(), R = k.srcH = F.outerHeight(), K = k.tgtW = L.outerWidth(), H = k.tgtH = L.outerHeight(), q = k.srcShape = r.nodeShapes[e.getNodeShape(F)], ee = k.tgtShape = r.nodeShapes[e.getNodeShape(L)], se = k.srcCornerRadius = F.pstyle("corner-radius").value === "auto" ? "auto" : F.pstyle("corner-radius").pfValue, oe = k.tgtCornerRadius = L.pstyle("corner-radius").value === "auto" ? "auto" : L.pstyle("corner-radius").pfValue, ne = k.tgtRs = L._private.rscratch, ue = k.srcRs = F._private.rscratch; k.dirCounts = { north: 0, west: 0, south: 0, east: 0, northwest: 0, southwest: 0, northeast: 0, southeast: 0 }; for (var te = 0; te < k.eles.length; te++) { var $ = k.eles[te], G = $[0]._private.rscratch, Q = $.pstyle("curve-style").value, ge = Q === "unbundled-bezier" || Q.endsWith("segments") || Q.endsWith("taxi"), Ee = !F.same($.source()); if (!k.calculatedIntersection && F !== L && (k.hasBezier || k.hasUnbundled)) { k.calculatedIntersection = !0; var fe = q.intersectLine(I.x, I.y, A, R, M.x, M.y, 0, se, ue), me = k.srcIntn = fe, xe = ee.intersectLine(M.x, M.y, K, H, I.x, I.y, 0, oe, ne), ke = k.tgtIntn = xe, Ce = k.intersectionPts = { x1: fe[0], x2: xe[0], y1: fe[1], y2: xe[1] }, De = k.posPts = { x1: I.x, x2: M.x, y1: I.y, y2: M.y }, qe = xe[1] - fe[1], Ke = xe[0] - fe[0], Be = Math.sqrt(Ke * Ke + qe * qe), Ge = k.vector = { x: Ke, y: qe }, le = k.vectorNorm = { x: Ge.x / Be, y: Ge.y / Be }, S = { x: -le.y, y: le.x }; k.nodesOverlap = !be(Be) || ee.checkPoint(fe[0], fe[1], 0, K, H, M.x, M.y, oe, ne) || q.checkPoint(xe[0], xe[1], 0, A, R, I.x, I.y, se, ue), k.vectorNormInverse = S, _ = { nodesOverlap: k.nodesOverlap, dirCounts: k.dirCounts, calculatedIntersection: !0, hasBezier: k.hasBezier, hasUnbundled: k.hasUnbundled, eles: k.eles, srcPos: M, tgtPos: I, srcW: K, srcH: H, tgtW: A, tgtH: R, srcIntn: ke, tgtIntn: me, srcShape: ee, tgtShape: q, posPts: { x1: De.x2, y1: De.y2, x2: De.x1, y2: De.y1 }, intersectionPts: { x1: Ce.x2, y1: Ce.y2, x2: Ce.x1, y2: Ce.y1 }, vector: { x: -Ge.x, y: -Ge.y }, vectorNorm: { x: -le.x, y: -le.y }, vectorNormInverse: { x: -S.x, y: -S.y } }; } var z = Ee ? _ : k; G.nodesOverlap = z.nodesOverlap, G.srcIntn = z.srcIntn, G.tgtIntn = z.tgtIntn, G.isRound = Q.startsWith("round"), a && (F.isParent() || F.isChild() || L.isParent() || L.isChild()) && (F.parents().anySame(L) || L.parents().anySame(F) || F.same(L) && F.isParent()) ? e.findCompoundLoopPoints($, z, te, ge) : F === L ? e.findLoopPoints($, z, te, ge) : Q.endsWith("segments") ? e.findSegmentsPoints($, z) : Q.endsWith("taxi") ? e.findTaxiPoints($, z) : Q === "straight" || !ge && k.eles.length % 2 === 1 && te === Math.floor(k.eles.length / 2) ? e.findStraightEdgePoints($) : e.findBezierPoints($, z, te, ge, Ee), e.findEndpoints($), e.tryToCorrectInvalidPoints($, z), e.checkForInvalidEdgeWarning($), e.storeAllpts($), e.storeEdgeProjections($), e.calculateArrowAngles($), e.recalculateEdgeLabelProjections($), e.calculateLabelAngles($); } }, C = 0; C < o.length; C++) w(C); this.findHaystackPoints(s); } }; function ug(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; } } or.getSegmentPoints = function(t) { var e = t[0]._private.rscratch, r = e.edgeType; if (r === "segments") return this.recalculateRenderedStyle(t), ug(e.segpts); }; or.getControlPoints = function(t) { var e = t[0]._private.rscratch, r = e.edgeType; if (r === "bezier" || r === "multibezier" || r === "self" || r === "compound") return this.recalculateRenderedStyle(t), ug(e.ctrlpts); }; or.getEdgeMidpoint = function(t) { var e = t[0]._private.rscratch; return this.recalculateRenderedStyle(t), { x: e.midX, y: e.midY }; }; var Fo = {}; Fo.manualEndptToPx = function(t, e) { var r = this, n = t.position(), a = t.outerWidth(), i = t.outerHeight(), o = t._private.rscratch; if (e.value.length === 2) { var s = [e.pfValue[0], e.pfValue[1]]; return e.units[0] === "%" && (s[0] = s[0] * a), e.units[1] === "%" && (s[1] = s[1] * i), s[0] += n.x, s[1] += n.y, s; } else { var u = e.pfValue[0]; u = -Math.PI / 2 + u; var l = 2 * Math.max(a, i), c = [n.x + Math.cos(u) * l, n.y + Math.sin(u) * l]; 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, o); } }; Fo.findEndpoints = function(t) { var e = this, r, n = t.source()[0], a = t.target()[0], i = n.position(), o = a.position(), s = t.pstyle("target-arrow-shape").value, u = t.pstyle("source-arrow-shape").value, l = t.pstyle("target-distance-from-node").pfValue, c = t.pstyle("source-distance-from-node").pfValue, d = n._private.rscratch, v = a._private.rscratch, h = t.pstyle("curve-style").value, f = t._private.rscratch, p = f.edgeType, m = h === "taxi", g = p === "self" || p === "compound", y = p === "bezier" || p === "multibezier" || g, b = p !== "bezier", w = p === "straight" || p === "segments", C = p === "segments", E = y || b || w, x = g || m, T = t.pstyle("source-endpoint"), k = x ? "outside-to-node" : T.value, _ = n.pstyle("corner-radius").value === "auto" ? "auto" : n.pstyle("corner-radius").pfValue, D = t.pstyle("target-endpoint"), O = x ? "outside-to-node" : D.value, F = a.pstyle("corner-radius").value === "auto" ? "auto" : a.pstyle("corner-radius").pfValue; f.srcManEndpt = T, f.tgtManEndpt = D; var L, B, I, M; if (y) { var A = [f.ctrlpts[0], f.ctrlpts[1]], R = b ? [f.ctrlpts[f.ctrlpts.length - 2], f.ctrlpts[f.ctrlpts.length - 1]] : A; L = R, B = A; } else if (w) { var K = C ? f.segpts.slice(0, 2) : [o.x, o.y], H = C ? f.segpts.slice(f.segpts.length - 2) : [i.x, i.y]; L = H, B = K; } if (O === "inside-to-node") r = [o.x, o.y]; else if (D.units) r = this.manualEndptToPx(a, D); else if (O === "outside-to-line") r = f.tgtIntn; else if (O === "outside-to-node" || O === "outside-to-node-or-label" ? I = L : (O === "outside-to-line" || O === "outside-to-line-or-label") && (I = [i.x, i.y]), r = e.nodeShapes[this.getNodeShape(a)].intersectLine(o.x, o.y, a.outerWidth(), a.outerHeight(), I[0], I[1], 0, F, v), O === "outside-to-node-or-label" || O === "outside-to-line-or-label") { var q = a._private.rscratch, ee = q.labelWidth, se = q.labelHeight, oe = q.labelX, ne = q.labelY, ue = ee / 2, te = se / 2, $ = a.pstyle("text-valign").value; $ === "top" ? ne -= te : $ === "bottom" && (ne += te); var G = a.pstyle("text-halign").value; G === "left" ? oe -= ue : G === "right" && (oe += ue); var Q = oo(I[0], I[1], [oe - ue, ne - te, oe + ue, ne - te, oe + ue, ne + te, oe - ue, ne + te], o.x, o.y); if (Q.length > 0) { var ge = i, Ee = ta(ge, Ha(r)), fe = ta(ge, Ha(Q)), me = Ee; if (fe < Ee && (r = Q, me = fe), Q.length > 2) { var xe = ta(ge, { x: Q[2], y: Q[3] }); xe < me && (r = [Q[2], Q[3]]); } } } var ke = Yo(r, L, e.arrowShapes[s].spacing(t) + l), Ce = Yo(r, L, e.arrowShapes[s].gap(t) + l); if (f.endX = Ce[0], f.endY = Ce[1], f.arrowEndX = ke[0], f.arrowEndY = ke[1], k === "inside-to-node") r = [i.x, i.y]; else if (T.units) r = this.manualEndptToPx(n, T); else if (k === "outside-to-line") r = f.srcIntn; else if (k === "outside-to-node" || k === "outside-to-node-or-label" ? M = B : (k === "outside-to-line" || k === "outside-to-line-or-label") && (M = [o.x, o.y]), r = e.nodeShapes[this.getNodeShape(n)].intersectLine(i.x, i.y, n.outerWidth(), n.outerHeight(), M[0], M[1], 0, _, d), k === "outside-to-node-or-label" || k === "outside-to-line-or-label") { var De = n._private.rscratch, qe = De.labelWidth, Ke = De.labelHeight, Be = De.labelX, Ge = De.labelY, le = qe / 2, S = Ke / 2, z = n.pstyle("text-valign").value; z === "top" ? Ge -= S : z === "bottom" && (Ge += S); var ae = n.pstyle("text-halign").value; ae === "left" ? Be -= le : ae === "right" && (Be += le); var j = oo(M[0], M[1], [Be - le, Ge - S, Be + le, Ge - S, Be + le, Ge + S, Be - le, Ge + S], i.x, i.y); if (j.length > 0) { var Y = o, pe = ta(Y, Ha(r)), re = ta(Y, Ha(j)), ve = pe; if (re < pe && (r = [j[0], j[1]], ve = re), j.length > 2) { var Ae = ta(Y, { x: j[2], y: j[3] }); Ae < ve && (r = [j[2], j[3]]); } } } var Me = Yo(r, B, e.arrowShapes[u].spacing(t) + c), _e = Yo(r, B, e.arrowShapes[u].gap(t) + c); f.startX = _e[0], f.startY = _e[1], f.arrowStartX = Me[0], f.arrowStartY = Me[1], E && (!be(f.startX) || !be(f.startY) || !be(f.endX) || !be(f.endY) ? f.badLine = !0 : f.badLine = !1); }; Fo.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 }; } }; Fo.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 _c = {}; function $P(t, e, r) { for (var n = function(l, c, d, v) { return Nt(l, c, d, v); }, a = e._private, i = a.rstyle.bezierPts, o = 0; o < t.bezierProjPcts.length; o++) { var s = t.bezierProjPcts[o]; i.push({ x: n(r[0], r[2], r[4], s), y: n(r[1], r[3], r[5], s) }); } } _c.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) $P(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 o = r.haystackPts; e.rstyle.haystackPts = [{ x: o[0], y: o[1] }, { x: o[2], y: o[3] }]; } e.rstyle.arrowWidth = this.getArrowWidth(t.pstyle("width").pfValue, t.pstyle("arrow-scale").value) * this.arrowShapeWidth; }; _c.recalculateEdgeProjections = function(t) { this.findEdgeControlPoints(t); }; var an = {}; an.recalculateNodeLabelProjection = function(t) { var e = t.pstyle("label").strValue; if (!qn(e)) { var r, n, a = t._private, i = t.width(), o = t.height(), s = t.padding(), u = t.position(), l = t.pstyle("text-halign").strValue, c = t.pstyle("text-valign").strValue, d = a.rscratch, v = a.rstyle; switch (l) { case "left": r = u.x - i / 2 - s; break; case "right": r = u.x + i / 2 + s; break; default: r = u.x; } switch (c) { case "top": n = u.y - o / 2 - s; break; case "bottom": n = u.y + o / 2 + s; break; default: n = u.y; } d.labelX = r, d.labelY = n, v.labelX = r, v.labelY = n, this.calculateLabelAngles(t), this.applyLabelDimensions(t); } }; var cg = function(e, r) { var n = Math.atan(r / e); return e === 0 && n < 0 && (n = n * -1), n; }, dg = function(e, r) { var n = r.x - e.x, a = r.y - e.y; return cg(n, a); }, RP = function(e, r, n, a) { var i = io(0, a - 1e-3, 1), o = io(0, a + 1e-3, 1), s = Ga(e, r, n, i), u = Ga(e, r, n, o); return dg(s, u); }; an.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 o = function(d, v, h) { An(r.rscratch, d, v, h), An(r.rstyle, d, v, h); }; o("labelX", null, e.x), o("labelY", null, e.y); var s = cg(n.midDispX, n.midDispY); o("labelAutoAngle", null, s); var u = function c() { if (c.cache) return c.cache; for (var d = [], v = 0; v + 5 < n.allpts.length; v += 4) { var h = { x: n.allpts[v], y: n.allpts[v + 1] }, f = { x: n.allpts[v + 2], y: n.allpts[v + 3] }, p = { x: n.allpts[v + 4], y: n.allpts[v + 5] }; d.push({ p0: h, p1: f, p2: p, startDist: 0, length: 0, segments: [] }); } var m = r.rstyle.bezierPts, g = a.bezierProjPcts.length; function y(x, T, k, _, D) { var O = ya(T, k), F = x.segments[x.segments.length - 1], L = { p0: T, p1: k, t0: _, t1: D, startDist: F ? F.startDist + F.length : 0, length: O }; x.segments.push(L), x.length += O; } for (var b = 0; b < d.length; b++) { var w = d[b], C = d[b - 1]; C && (w.startDist = C.startDist + C.length), y(w, w.p0, m[b * g], 0, a.bezierProjPcts[0]); for (var E = 0; E < g - 1; E++) y(w, m[b * g + E], m[b * g + E + 1], a.bezierProjPcts[E], a.bezierProjPcts[E + 1]); y(w, m[b * g + g - 1], w.p2, a.bezierProjPcts[g - 1], 1); } return c.cache = d; }, l = function(d) { var v, h = d === "source"; if (i[d]) { var f = t.pstyle(d + "-text-offset").pfValue; switch (n.edgeType) { case "self": case "compound": case "bezier": case "multibezier": { for (var p = u(), m, g = 0, y = 0, b = 0; b < p.length; b++) { for (var w = p[h ? b : p.length - 1 - b], C = 0; C < w.segments.length; C++) { var E = w.segments[h ? C : w.segments.length - 1 - C], x = b === p.length - 1 && C === w.segments.length - 1; if (g = y, y += E.length, y >= f || x) { m = { cp: w, segment: E }; break; } } if (m) break; } var T = m.cp, k = m.segment, _ = (f - g) / k.length, D = k.t1 - k.t0, O = h ? k.t0 + D * _ : k.t1 - D * _; O = io(0, O, 1), e = Ga(T.p0, T.p1, T.p2, O), v = RP(T.p0, T.p1, T.p2, O); break; } case "straight": case "segments": case "haystack": { for (var F = 0, L, B, I, M, A = n.allpts.length, R = 0; R + 3 < A && (h ? (I = { x: n.allpts[R], y: n.allpts[R + 1] }, M = { x: n.allpts[R + 2], y: n.allpts[R + 3] }) : (I = { x: n.allpts[A - 2 - R], y: n.allpts[A - 1 - R] }, M = { x: n.allpts[A - 4 - R], y: n.allpts[A - 3 - R] }), L = ya(I, M), B = F, F += L, !(F >= f)); R += 2) ; var K = f - B, H = K / L; H = io(0, H, 1), e = K5(I, M, H), v = dg(I, M); break; } } o("labelX", d, e.x), o("labelY", d, e.y), o("labelAutoAngle", d, v); } }; l("source"), l("target"), this.applyLabelDimensions(t); } }; an.applyLabelDimensions = function(t) { this.applyPrefixedLabelDimensions(t), t.isEdge() && (this.applyPrefixedLabelDimensions(t, "source"), this.applyPrefixedLabelDimensions(t, "target")); }; an.applyPrefixedLabelDimensions = function(t, e) { var r = t._private, n = this.getLabelText(t, e), a = this.calculateLabelDimensions(t, n), i = t.pstyle("line-height").pfValue, o = t.pstyle("text-wrap").strValue, s = Nr(r.rscratch, "labelWrapCachedLines", e) || [], u = o !== "wrap" ? 1 : Math.max(s.length, 1), l = a.height / u, c = l * i, d = a.width, v = a.height + (u - 1) * (i - 1) * l; An(r.rstyle, "labelWidth", e, d), An(r.rscratch, "labelWidth", e, d), An(r.rstyle, "labelHeight", e, v), An(r.rscratch, "labelHeight", e, v), An(r.rscratch, "labelLineHeight", e, c); }; an.getLabelText = function(t, e) { var r = t._private, n = e ? e + "-" : "", a = t.pstyle(n + "label").strValue, i = t.pstyle("text-transform").value, o = function(ee, se) { return se ? (An(r.rscratch, ee, e, se), se) : Nr(r.rscratch, ee, e); }; if (!a) return ""; i == "none" || (i == "uppercase" ? a = a.toUpperCase() : i == "lowercase" && (a = a.toLowerCase())); var s = t.pstyle("text-wrap").value; if (s === "wrap") { var u = o("labelKey"); if (u != null && o("labelWrapKey") === u) return o("labelWrapCachedText"); for (var l = "​", c = a.split(` `), d = t.pstyle("text-max-width").pfValue, v = t.pstyle("text-overflow-wrap").value, h = v === "anywhere", f = [], p = /[\s\u200b]+|$/g, m = 0; m < c.length; m++) { var g = c[m], y = this.calculateLabelDimensions(t, g), b = y.width; if (h) { var w = g.split("").join(l); g = w; } if (b > d) { var C = g.matchAll(p), E = "", x = 0, T = Wh(C), k; try { for (T.s(); !(k = T.n()).done; ) { var _ = k.value, D = _[0], O = g.substring(x, _.index); x = _.index + D.length; var F = E.length === 0 ? O : E + O + D, L = this.calculateLabelDimensions(t, F), B = L.width; B <= d ? E += O + D : (E && f.push(E), E = O + D); } } catch (q) { T.e(q); } finally { T.f(); } E.match(/^[\s\u200b]+$/) || f.push(E); } else f.push(g); } o("labelWrapCachedLines", f), a = o("labelWrapCachedText", f.join(` `)), o("labelWrapKey", u); } else if (s === "ellipsis") { var I = t.pstyle("text-max-width").pfValue, M = "", A = "…", R = !1; if (this.calculateLabelDimensions(t, a).width < I) return a; for (var K = 0; K < a.length; K++) { var H = this.calculateLabelDimensions(t, M + a[K] + A).width; if (H > I) break; M += a[K], K === a.length - 1 && (R = !0); } return R || (M += A), M; } return a; }; an.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; }; an.calculateLabelDimensions = function(t, e) { var r = this, n = r.cy.window(), a = n.document, i = ma(e, t._private.labelDimsKey), o = r.labelDimCache || (r.labelDimCache = []), s = o[i]; if (s != null) return s; var u = 0, l = t.pstyle("font-style").strValue, c = t.pstyle("font-size").pfValue, d = t.pstyle("font-family").strValue, v = t.pstyle("font-weight").strValue, h = this.labelCalcCanvas, f = this.labelCalcCanvasContext; if (!h) { h = this.labelCalcCanvas = a.createElement("canvas"), f = this.labelCalcCanvasContext = h.getContext("2d"); var p = h.style; p.position = "absolute", p.left = "-9999px", p.top = "-9999px", p.zIndex = "-1", p.visibility = "hidden", p.pointerEvents = "none"; } f.font = "".concat(l, " ").concat(v, " ").concat(c, "px ").concat(d); for (var m = 0, g = 0, y = e.split(` `), b = 0; b < y.length; b++) { var w = y[b], C = f.measureText(w), E = Math.ceil(C.width), x = c; m = Math.max(E, m), g += x; } return m += u, g += u, o[i] = { width: m, height: g }; }; an.calculateLabelAngle = function(t, e) { var r = t._private, n = r.rscratch, a = t.isEdge(), i = e ? e + "-" : "", o = t.pstyle(i + "text-rotation"), s = o.strValue; return s === "none" ? 0 : a && s === "autorotate" ? n.labelAutoAngle : s === "autorotate" ? 0 : o.pfValue; }; an.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 fg = {}, nv = 28, av = !1; fg.getNodeShape = function(t) { var e = this, r = t.pstyle("shape").value; if (r === "cutrectangle" && (t.width() < nv || t.height() < nv)) return av || (tt("The `cutrectangle` node shape can not be used at small sizes so `rectangle` is used instead"), av = !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 pl = {}; pl.registerCalculationListeners = function() { var t = this.cy, e = t.collection(), r = this, n = function(o) { var s = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !0; if (e.merge(o), s) for (var u = 0; u < o.length; u++) { var l = o[u], c = l._private, d = c.rstyle; d.clean = !1, d.cleanConnected = !1; } }; r.binder(t).on("bounds.* dirty.*", function(o) { var s = o.target; n(s); }).on("style.* background.*", function(o) { var s = o.target; n(s, !1); }); var a = function(o) { if (o) { var s = r.onUpdateEleCalcsFns; e.cleanStyle(); for (var u = 0; u < e.length; u++) { var l = e[u], c = l._private.rstyle; l.isNode() && !c.cleanConnected && (n(l.connectedEdges()), c.cleanConnected = !0); } if (s) for (var d = 0; d < s.length; d++) { var v = s[d]; v(o, e); } r.recalculateRenderedStyle(e), e = t.collection(); } }; r.flushRenderedStyleQueue = function() { a(!0); }, r.beforeRender(a, r.beforeRenderPriorities.eleCalcs); }; pl.onUpdateEleCalcs = function(t) { var e = this.onUpdateEleCalcsFns = this.onUpdateEleCalcsFns || []; e.push(t); }; pl.recalculateRenderedStyle = function(t, e) { var r = function(w) { return w._private.rstyle.cleanConnected; }, n = [], a = []; if (!this.destroyed) { e === void 0 && (e = !0); for (var i = 0; i < t.length; i++) { var o = t[i], s = o._private, u = s.rstyle; o.isEdge() && (!r(o.source()) || !r(o.target())) && (u.clean = !1), !(e && u.clean || o.removed()) && o.pstyle("display").value !== "none" && (s.group === "nodes" ? a.push(o) : n.push(o), u.clean = !0); } for (var l = 0; l < a.length; l++) { var c = a[l], d = c._private, v = d.rstyle, h = c.position(); this.recalculateNodeLabelProjection(c), v.nodeX = h.x, v.nodeY = h.y, v.nodeW = c.pstyle("width").pfValue, v.nodeH = c.pstyle("height").pfValue; } this.recalculateEdgeProjections(n); for (var f = 0; f < n.length; f++) { var p = n[f], m = p._private, g = m.rstyle, y = m.rscratch; g.srcX = y.arrowStartX, g.srcY = y.arrowStartY, g.tgtX = y.arrowEndX, g.tgtY = y.arrowEndY, g.midX = y.midX, g.midY = y.midY, g.labelAngle = y.labelAngle, g.sourceLabelAngle = y.sourceLabelAngle, g.targetLabelAngle = y.targetLabelAngle; } } }; var gl = {}; gl.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); } } }; gl.invalidateCachedZSortedEles = function() { this.cachedZSortedEles = null; }; gl.getCachedZSortedEles = function(t) { if (t || !this.cachedZSortedEles) { var e = this.cy.mutableElements().toArray(); e.sort(Zp), e.interactive = e.filter(function(r) { return r.interactive(); }), this.cachedZSortedEles = e, this.updateCachedGrabbedEles(); } else e = this.cachedZSortedEles; return e; }; var vg = {}; [Da, Ns, or, Fo, _c, an, fg, pl, gl].forEach(function(t) { Re(vg, t); }); var hg = {}; hg.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 o = i.image = new Image(); o.addEventListener("load", r), o.addEventListener("error", function() { o.error = !0; }); var s = "data:", u = t.substring(0, s.length).toLowerCase() === s; return u || (e = e === "null" ? null : e, o.crossOrigin = e), o.src = t, o; }; var wi = {}; wi.registerBinding = function(t, e, r, n) { var a = Array.prototype.slice.apply(arguments, [1]), i = this.binder(t); return i.on.apply(i, a); }; wi.binder = function(t) { var e = this, r = e.cy.window(), n = t === r || t === r.document || t === r.document.body || cT(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 o = function(u, l, 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: o, addEventListener: o, addListener: o, bind: o }; }; wi.nodeIsDraggable = function(t) { return t && t.isNode() && !t.locked() && t.grabbable(); }; wi.nodeIsGrabbable = function(t) { return this.nodeIsDraggable(t) && t.interactive(); }; wi.load = function() { var t = this, e = t.cy.window(), r = function(S) { return S.selected(); }, n = function(S, z, ae, j) { S == null && (S = t.cy); for (var Y = 0; Y < z.length; Y++) { var pe = z[Y]; S.emit({ originalEvent: ae, type: pe, position: j }); } }, a = function(S) { return S.shiftKey || S.metaKey || S.ctrlKey; }, i = function(S, z) { var ae = !0; if (t.cy.hasCompoundNodes() && S && S.pannable()) for (var j = 0; z && j < z.length; j++) { var S = z[j]; if (S.isNode() && S.isParent() && !S.pannable()) { ae = !1; break; } } else ae = !0; return ae; }, o = function(S) { S[0]._private.grabbed = !0; }, s = function(S) { S[0]._private.grabbed = !1; }, u = function(S) { S[0]._private.rscratch.inDragLayer = !0; }, l = function(S) { S[0]._private.rscratch.inDragLayer = !1; }, c = function(S) { S[0]._private.rscratch.isGrabTarget = !0; }, d = function(S) { S[0]._private.rscratch.isGrabTarget = !1; }, v = function(S, z) { var ae = z.addToList, j = ae.has(S); !j && S.grabbable() && !S.locked() && (ae.merge(S), o(S)); }, h = function(S, z) { if (S.cy().hasCompoundNodes() && !(z.inDragLayer == null && z.addToList == null)) { var ae = S.descendants(); z.inDragLayer && (ae.forEach(u), ae.connectedEdges().forEach(u)), z.addToList && v(ae, z); } }, f = function(S, z) { z = z || {}; var ae = S.cy().hasCompoundNodes(); z.inDragLayer && (S.forEach(u), S.neighborhood().stdFilter(function(j) { return !ae || j.isEdge(); }).forEach(u)), z.addToList && S.forEach(function(j) { v(j, z); }), h(S, z), g(S, { inDragLayer: z.inDragLayer }), t.updateCachedGrabbedEles(); }, p = f, m = function(S) { S && (t.getCachedZSortedEles().forEach(function(z) { s(z), l(z), d(z); }), t.updateCachedGrabbedEles()); }, g = function(S, z) { if (!(z.inDragLayer == null && z.addToList == null) && S.cy().hasCompoundNodes()) { var ae = S.ancestors().orphans(); if (!ae.same(S)) { var j = ae.descendants().spawnSelf().merge(ae).unmerge(S).unmerge(S.descendants()), Y = j.connectedEdges(); z.inDragLayer && (Y.forEach(u), j.forEach(u)), z.addToList && j.forEach(function(pe) { v(pe, z); }); } } }, y = function() { document.activeElement != null && document.activeElement.blur != null && document.activeElement.blur(); }, b = typeof MutationObserver < "u", w = typeof ResizeObserver < "u"; b ? (t.removeObserver = new MutationObserver(function(le) { for (var S = 0; S < le.length; S++) { var z = le[S], ae = z.removedNodes; if (ae) for (var j = 0; j < ae.length; j++) { var Y = ae[j]; if (Y === t.container) { t.destroy(); break; } } } }), t.container.parentNode && t.removeObserver.observe(t.container.parentNode, { childList: !0 })) : t.registerBinding(t.container, "DOMNodeRemoved", function(le) { t.destroy(); }); var C = tl(function() { t.cy.resize(); }, 100); b && (t.styleObserver = new MutationObserver(C), t.styleObserver.observe(t.container, { attributes: !0 })), t.registerBinding(e, "resize", C), w && (t.resizeObserver = new ResizeObserver(C), t.resizeObserver.observe(t.container)); var E = function(S, z) { for (; S != null; ) z(S), S = S.parentNode; }, x = function() { t.invalidateContainerClientCoordsCache(); }; E(t.container, function(le) { t.registerBinding(le, "transitionend", x), t.registerBinding(le, "animationend", x), t.registerBinding(le, "scroll", x); }), t.registerBinding(t.container, "contextmenu", function(le) { le.preventDefault(); }); var T = function() { return t.selection[4] !== 0; }, k = function(S) { for (var z = t.findContainerClientCoords(), ae = z[0], j = z[1], Y = z[2], pe = z[3], re = S.touches ? S.touches : [S], ve = !1, Ae = 0; Ae < re.length; Ae++) { var Me = re[Ae]; if (ae <= Me.clientX && Me.clientX <= ae + Y && j <= Me.clientY && Me.clientY <= j + pe) { ve = !0; break; } } if (!ve) return !1; for (var _e = t.container, Ne = S.target, Te = Ne.parentNode, Oe = !1; Te; ) { if (Te === _e) { Oe = !0; break; } Te = Te.parentNode; } return !!Oe; }; t.registerBinding(t.container, "mousedown", function(S) { if (k(S) && !(t.hoverData.which === 1 && S.which !== 1)) { S.preventDefault(), y(), t.hoverData.capture = !0, t.hoverData.which = S.which; var z = t.cy, ae = [S.clientX, S.clientY], j = t.projectIntoViewport(ae[0], ae[1]), Y = t.selection, pe = t.findNearestElements(j[0], j[1], !0, !1), re = pe[0], ve = t.dragData.possibleDragElements; t.hoverData.mdownPos = j, t.hoverData.mdownGPos = ae; var Ae = function() { t.hoverData.tapholdCancelled = !1, clearTimeout(t.hoverData.tapholdTimeout), t.hoverData.tapholdTimeout = setTimeout(function() { if (!t.hoverData.tapholdCancelled) { var ut = t.hoverData.down; ut ? ut.emit({ originalEvent: S, type: "taphold", position: { x: j[0], y: j[1] } }) : z.emit({ originalEvent: S, type: "taphold", position: { x: j[0], y: j[1] } }); } }, t.tapholdDuration); }; if (S.which == 3) { t.hoverData.cxtStarted = !0; var Me = { originalEvent: S, type: "cxttapstart", position: { x: j[0], y: j[1] } }; re ? (re.activate(), re.emit(Me), t.hoverData.down = re) : z.emit(Me), t.hoverData.downTime = (/* @__PURE__ */ new Date()).getTime(), t.hoverData.cxtDragged = !1; } else if (S.which == 1) { re && re.activate(); { if (re != null && t.nodeIsGrabbable(re)) { var _e = function(ut) { return { originalEvent: S, type: ut, position: { x: j[0], y: j[1] } }; }, Ne = function(ut) { ut.emit(_e("grab")); }; if (c(re), !re.selected()) ve = t.dragData.possibleDragElements = z.collection(), p(re, { addToList: ve }), re.emit(_e("grabon")).emit(_e("grab")); else { ve = t.dragData.possibleDragElements = z.collection(); var Te = z.$(function(Oe) { return Oe.isNode() && Oe.selected() && t.nodeIsGrabbable(Oe); }); f(Te, { addToList: ve }), re.emit(_e("grabon")), Te.forEach(Ne); } t.redrawHint("eles", !0), t.redrawHint("drag", !0); } t.hoverData.down = re, t.hoverData.downs = pe, t.hoverData.downTime = (/* @__PURE__ */ new Date()).getTime(); } n(re, ["mousedown", "tapstart", "vmousedown"], S, { x: j[0], y: j[1] }), re == null ? (Y[4] = 1, t.data.bgActivePosistion = { x: j[0], y: j[1] }, t.redrawHint("select", !0), t.redraw()) : re.pannable() && (Y[4] = 1), Ae(); } Y[0] = Y[2] = j[0], Y[1] = Y[3] = j[1]; } }, !1), t.registerBinding(e, "mousemove", function(S) { var z = t.hoverData.capture; if (!(!z && !k(S))) { var ae = !1, j = t.cy, Y = j.zoom(), pe = [S.clientX, S.clientY], re = t.projectIntoViewport(pe[0], pe[1]), ve = t.hoverData.mdownPos, Ae = t.hoverData.mdownGPos, Me = t.selection, _e = null; !t.hoverData.draggingEles && !t.hoverData.dragging && !t.hoverData.selecting && (_e = t.findNearestElement(re[0], re[1], !0, !1)); var Ne = t.hoverData.last, Te = t.hoverData.down, Oe = [re[0] - Me[2], re[1] - Me[3]], ut = t.dragData.possibleDragElements, nt; if (Ae) { var kt = pe[0] - Ae[0], St = kt * kt, wt = pe[1] - Ae[1], Zt = wt * wt, Pt = St + Zt; t.hoverData.isOverThresholdDrag = nt = Pt >= t.desktopTapThreshold2; } var Mt = a(S); nt && (t.hoverData.tapholdCancelled = !0); var gr = function() { var W = t.hoverData.dragDelta = t.hoverData.dragDelta || []; W.length === 0 ? (W.push(Oe[0]), W.push(Oe[1])) : (W[0] += Oe[0], W[1] += Oe[1]); }; ae = !0, n(_e, ["mousemove", "vmousemove", "tapdrag"], S, { x: re[0], y: re[1] }); var Xt = function() { t.data.bgActivePosistion = void 0, t.hoverData.selecting || j.emit({ originalEvent: S, type: "boxstart", position: { x: re[0], y: re[1] } }), Me[4] = 1, t.hoverData.selecting = !0, t.redrawHint("select", !0), t.redraw(); }; if (t.hoverData.which === 3) { if (nt) { var jt = { originalEvent: S, type: "cxtdrag", position: { x: re[0], y: re[1] } }; Te ? Te.emit(jt) : j.emit(jt), t.hoverData.cxtDragged = !0, (!t.hoverData.cxtOver || _e !== t.hoverData.cxtOver) && (t.hoverData.cxtOver && t.hoverData.cxtOver.emit({ originalEvent: S, type: "cxtdragout", position: { x: re[0], y: re[1] } }), t.hoverData.cxtOver = _e, _e && _e.emit({ originalEvent: S, type: "cxtdragover", position: { x: re[0], y: re[1] } })); } } else if (t.hoverData.dragging) { if (ae = !0, j.panningEnabled() && j.userPanningEnabled()) { var wr; if (t.hoverData.justStartedPan) { var Pr = t.hoverData.mdownPos; wr = { x: (re[0] - Pr[0]) * Y, y: (re[1] - Pr[1]) * Y }, t.hoverData.justStartedPan = !1; } else wr = { x: Oe[0] * Y, y: Oe[1] * Y }; j.panBy(wr), j.emit("dragpan"), t.hoverData.dragged = !0; } re = t.projectIntoViewport(S.clientX, S.clientY); } else if (Me[4] == 1 && (Te == null || Te.pannable())) { if (nt) { if (!t.hoverData.dragging && j.boxSelectionEnabled() && (Mt || !j.panningEnabled() || !j.userPanningEnabled())) Xt(); else if (!t.hoverData.selecting && j.panningEnabled() && j.userPanningEnabled()) { var ur = i(Te, t.hoverData.downs); ur && (t.hoverData.dragging = !0, t.hoverData.justStartedPan = !0, Me[4] = 0, t.data.bgActivePosistion = Ha(ve), t.redrawHint("select", !0), t.redraw()); } Te && Te.pannable() && Te.active() && Te.unactivate(); } } else { if (Te && Te.pannable() && Te.active() && Te.unactivate(), (!Te || !Te.grabbed()) && _e != Ne && (Ne && n(Ne, ["mouseout", "tapdragout"], S, { x: re[0], y: re[1] }), _e && n(_e, ["mouseover", "tapdragover"], S, { x: re[0], y: re[1] }), t.hoverData.last = _e), Te) if (nt) { if (j.boxSelectionEnabled() && Mt) Te && Te.grabbed() && (m(ut), Te.emit("freeon"), ut.emit("free"), t.dragData.didDrag && (Te.emit("dragfreeon"), ut.emit("dragfree"))), Xt(); else if (Te && Te.grabbed() && t.nodeIsDraggable(Te)) { var xt = !t.dragData.didDrag; xt && t.redrawHint("eles", !0), t.dragData.didDrag = !0, t.hoverData.draggingEles || f(ut, { inDragLayer: !0 }); var Tt = { x: 0, y: 0 }; if (be(Oe[0]) && be(Oe[1]) && (Tt.x += Oe[0], Tt.y += Oe[1], xt)) { var Bt = t.hoverData.dragDelta; Bt && be(Bt[0]) && be(Bt[1]) && (Tt.x += Bt[0], Tt.y += Bt[1]); } t.hoverData.draggingEles = !0, ut.silentShift(Tt).emit("position drag"), t.redrawHint("drag", !0), t.redraw(); } } else gr(); ae = !0; } if (Me[2] = re[0], Me[3] = re[1], ae) return S.stopPropagation && S.stopPropagation(), S.preventDefault && S.preventDefault(), !1; } }, !1); var _, D, O; t.registerBinding(e, "mouseup", function(S) { if (!(t.hoverData.which === 1 && S.which !== 1 && t.hoverData.capture)) { var z = t.hoverData.capture; if (z) { t.hoverData.capture = !1; var ae = t.cy, j = t.projectIntoViewport(S.clientX, S.clientY), Y = t.selection, pe = t.findNearestElement(j[0], j[1], !0, !1), re = t.dragData.possibleDragElements, ve = t.hoverData.down, Ae = a(S); if (t.data.bgActivePosistion && (t.redrawHint("select", !0), t.redraw()), t.hoverData.tapholdCancelled = !0, t.data.bgActivePosistion = void 0, ve && ve.unactivate(), t.hoverData.which === 3) { var Me = { originalEvent: S, type: "cxttapend", position: { x: j[0], y: j[1] } }; if (ve ? ve.emit(Me) : ae.emit(Me), !t.hoverData.cxtDragged) { var _e = { originalEvent: S, type: "cxttap", position: { x: j[0], y: j[1] } }; ve ? ve.emit(_e) : ae.emit(_e); } t.hoverData.cxtDragged = !1, t.hoverData.which = null; } else if (t.hoverData.which === 1) { if (n(pe, ["mouseup", "tapend", "vmouseup"], S, { x: j[0], y: j[1] }), !t.dragData.didDrag && // didn't move a node around !t.hoverData.dragged && // didn't pan !t.hoverData.selecting && // not box selection !t.hoverData.isOverThresholdDrag && (n(ve, ["click", "tap", "vclick"], S, { x: j[0], y: j[1] }), D = !1, S.timeStamp - O <= ae.multiClickDebounceTime() ? (_ && clearTimeout(_), D = !0, O = null, n(ve, ["dblclick", "dbltap", "vdblclick"], S, { x: j[0], y: j[1] })) : (_ = setTimeout(function() { D || n(ve, ["oneclick", "onetap", "voneclick"], S, { x: j[0], y: j[1] }); }, ae.multiClickDebounceTime()), O = S.timeStamp)), ve == null && !t.dragData.didDrag && !t.hoverData.selecting && !t.hoverData.dragged && !a(S) && (ae.$(r).unselect(["tapunselect"]), re.length > 0 && t.redrawHint("eles", !0), t.dragData.possibleDragElements = re = ae.collection()), pe == ve && !t.dragData.didDrag && !t.hoverData.selecting && pe != null && pe._private.selectable && (t.hoverData.dragging || (ae.selectionType() === "additive" || Ae ? pe.selected() ? pe.unselect(["tapunselect"]) : pe.select(["tapselect"]) : Ae || (ae.$(r).unmerge(pe).unselect(["tapunselect"]), pe.select(["tapselect"]))), t.redrawHint("eles", !0)), t.hoverData.selecting) { var Ne = ae.collection(t.getAllInBox(Y[0], Y[1], Y[2], Y[3])); t.redrawHint("select", !0), Ne.length > 0 && t.redrawHint("eles", !0), ae.emit({ type: "boxend", originalEvent: S, position: { x: j[0], y: j[1] } }); var Te = function(nt) { return nt.selectable() && !nt.selected(); }; ae.selectionType() === "additive" || Ae || ae.$(r).unmerge(Ne).unselect(), Ne.emit("box").stdFilter(Te).select().emit("boxselect"), t.redraw(); } if (t.hoverData.dragging && (t.hoverData.dragging = !1, t.redrawHint("select", !0), t.redrawHint("eles", !0), t.redraw()), !Y[4]) { t.redrawHint("drag", !0), t.redrawHint("eles", !0); var Oe = ve && ve.grabbed(); m(re), Oe && (ve.emit("freeon"), re.emit("free"), t.dragData.didDrag && (ve.emit("dragfreeon"), re.emit("dragfree"))); } } Y[4] = 0, t.hoverData.down = null, t.hoverData.cxtStarted = !1, t.hoverData.draggingEles = !1, t.hoverData.selecting = !1, t.hoverData.isOverThresholdDrag = !1, t.dragData.didDrag = !1, t.hoverData.dragged = !1, t.hoverData.dragDelta = [], t.hoverData.mdownPos = null, t.hoverData.mdownGPos = null, t.hoverData.which = null; } } }, !1); var F = function(S) { if (!t.scrollingPage) { var z = t.cy, ae = z.zoom(), j = z.pan(), Y = t.projectIntoViewport(S.clientX, S.clientY), pe = [Y[0] * ae + j.x, Y[1] * ae + j.y]; if (t.hoverData.draggingEles || t.hoverData.dragging || t.hoverData.cxtStarted || T()) { S.preventDefault(); return; } if (z.panningEnabled() && z.userPanningEnabled() && z.zoomingEnabled() && z.userZoomingEnabled()) { S.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 re; S.deltaY != null ? re = S.deltaY / -250 : S.wheelDeltaY != null ? re = S.wheelDeltaY / 1e3 : re = S.wheelDelta / 1e3, re = re * t.wheelSensitivity; var ve = S.deltaMode === 1; ve && (re *= 33); var Ae = z.zoom() * Math.pow(10, re); S.type === "gesturechange" && (Ae = t.gestureStartZoom * S.scale), z.zoom({ level: Ae, renderedPosition: { x: pe[0], y: pe[1] } }), z.emit(S.type === "gesturechange" ? "pinchzoom" : "scrollzoom"); } } }; t.registerBinding(t.container, "wheel", F, !0), t.registerBinding(e, "scroll", function(S) { t.scrollingPage = !0, clearTimeout(t.scrollingPageTimeout), t.scrollingPageTimeout = setTimeout(function() { t.scrollingPage = !1; }, 250); }, !0), t.registerBinding(t.container, "gesturestart", function(S) { t.gestureStartZoom = t.cy.zoom(), t.hasTouchStarted || S.preventDefault(); }, !0), t.registerBinding(t.container, "gesturechange", function(le) { t.hasTouchStarted || F(le); }, !0), t.registerBinding(t.container, "mouseout", function(S) { var z = t.projectIntoViewport(S.clientX, S.clientY); t.cy.emit({ originalEvent: S, type: "mouseout", position: { x: z[0], y: z[1] } }); }, !1), t.registerBinding(t.container, "mouseover", function(S) { var z = t.projectIntoViewport(S.clientX, S.clientY); t.cy.emit({ originalEvent: S, type: "mouseover", position: { x: z[0], y: z[1] } }); }, !1); var L, B, I, M, A, R, K, H, q, ee, se, oe, ne, ue = function(S, z, ae, j) { return Math.sqrt((ae - S) * (ae - S) + (j - z) * (j - z)); }, te = function(S, z, ae, j) { return (ae - S) * (ae - S) + (j - z) * (j - z); }, $; t.registerBinding(t.container, "touchstart", $ = function(S) { if (t.hasTouchStarted = !0, !!k(S)) { y(), t.touchData.capture = !0, t.data.bgActivePosistion = void 0; var z = t.cy, ae = t.touchData.now, j = t.touchData.earlier; if (S.touches[0]) { var Y = t.projectIntoViewport(S.touches[0].clientX, S.touches[0].clientY); ae[0] = Y[0], ae[1] = Y[1]; } if (S.touches[1]) { var Y = t.projectIntoViewport(S.touches[1].clientX, S.touches[1].clientY); ae[2] = Y[0], ae[3] = Y[1]; } if (S.touches[2]) { var Y = t.projectIntoViewport(S.touches[2].clientX, S.touches[2].clientY); ae[4] = Y[0], ae[5] = Y[1]; } if (S.touches[1]) { t.touchData.singleTouchMoved = !0, m(t.dragData.touchDragEles); var pe = t.findContainerClientCoords(); q = pe[0], ee = pe[1], se = pe[2], oe = pe[3], L = S.touches[0].clientX - q, B = S.touches[0].clientY - ee, I = S.touches[1].clientX - q, M = S.touches[1].clientY - ee, ne = 0 <= L && L <= se && 0 <= I && I <= se && 0 <= B && B <= oe && 0 <= M && M <= oe; var re = z.pan(), ve = z.zoom(); A = ue(L, B, I, M), R = te(L, B, I, M), K = [(L + I) / 2, (B + M) / 2], H = [(K[0] - re.x) / ve, (K[1] - re.y) / ve]; var Ae = 200, Me = Ae * Ae; if (R < Me && !S.touches[2]) { var _e = t.findNearestElement(ae[0], ae[1], !0, !0), Ne = t.findNearestElement(ae[2], ae[3], !0, !0); _e && _e.isNode() ? (_e.activate().emit({ originalEvent: S, type: "cxttapstart", position: { x: ae[0], y: ae[1] } }), t.touchData.start = _e) : Ne && Ne.isNode() ? (Ne.activate().emit({ originalEvent: S, type: "cxttapstart", position: { x: ae[0], y: ae[1] } }), t.touchData.start = Ne) : z.emit({ originalEvent: S, type: "cxttapstart", position: { x: ae[0], y: ae[1] } }), 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 (S.touches[2]) z.boxSelectionEnabled() && S.preventDefault(); else if (!S.touches[1]) { if (S.touches[0]) { var Te = t.findNearestElements(ae[0], ae[1], !0, !0), Oe = Te[0]; if (Oe != null && (Oe.activate(), t.touchData.start = Oe, t.touchData.starts = Te, t.nodeIsGrabbable(Oe))) { var ut = t.dragData.touchDragEles = z.collection(), nt = null; t.redrawHint("eles", !0), t.redrawHint("drag", !0), Oe.selected() ? (nt = z.$(function(Pt) { return Pt.selected() && t.nodeIsGrabbable(Pt); }), f(nt, { addToList: ut })) : p(Oe, { addToList: ut }), c(Oe); var kt = function(Mt) { return { originalEvent: S, type: Mt, position: { x: ae[0], y: ae[1] } }; }; Oe.emit(kt("grabon")), nt ? nt.forEach(function(Pt) { Pt.emit(kt("grab")); }) : Oe.emit(kt("grab")); } n(Oe, ["touchstart", "tapstart", "vmousedown"], S, { x: ae[0], y: ae[1] }), Oe == null && (t.data.bgActivePosistion = { x: Y[0], y: Y[1] }, t.redrawHint("select", !0), t.redraw()), t.touchData.singleTouchMoved = !1, t.touchData.singleTouchStartTime = +/* @__PURE__ */ new Date(), clearTimeout(t.touchData.tapholdTimeout), t.touchData.tapholdTimeout = setTimeout(function() { t.touchData.singleTouchMoved === !1 && !t.pinching && !t.touchData.selecting && n(t.touchData.start, ["taphold"], S, { x: ae[0], y: ae[1] }); }, t.tapholdDuration); } } if (S.touches.length >= 1) { for (var St = t.touchData.startPosition = [null, null, null, null, null, null], wt = 0; wt < ae.length; wt++) St[wt] = j[wt] = ae[wt]; var Zt = S.touches[0]; t.touchData.startGPosition = [Zt.clientX, Zt.clientY]; } } }, !1); var G; t.registerBinding(e, "touchmove", G = function(S) { var z = t.touchData.capture; if (!(!z && !k(S))) { var ae = t.selection, j = t.cy, Y = t.touchData.now, pe = t.touchData.earlier, re = j.zoom(); if (S.touches[0]) { var ve = t.projectIntoViewport(S.touches[0].clientX, S.touches[0].clientY); Y[0] = ve[0], Y[1] = ve[1]; } if (S.touches[1]) { var ve = t.projectIntoViewport(S.touches[1].clientX, S.touches[1].clientY); Y[2] = ve[0], Y[3] = ve[1]; } if (S.touches[2]) { var ve = t.projectIntoViewport(S.touches[2].clientX, S.touches[2].clientY); Y[4] = ve[0], Y[5] = ve[1]; } var Ae = t.touchData.startGPosition, Me; if (z && S.touches[0] && Ae) { for (var _e = [], Ne = 0; Ne < Y.length; Ne++) _e[Ne] = Y[Ne] - pe[Ne]; var Te = S.touches[0].clientX - Ae[0], Oe = Te * Te, ut = S.touches[0].clientY - Ae[1], nt = ut * ut, kt = Oe + nt; Me = kt >= t.touchTapThreshold2; } if (z && t.touchData.cxt) { S.preventDefault(); var St = S.touches[0].clientX - q, wt = S.touches[0].clientY - ee, Zt = S.touches[1].clientX - q, Pt = S.touches[1].clientY - ee, Mt = te(St, wt, Zt, Pt), gr = Mt / R, Xt = 150, jt = Xt * Xt, wr = 1.5, Pr = wr * wr; if (gr >= Pr || Mt >= jt) { t.touchData.cxt = !1, t.data.bgActivePosistion = void 0, t.redrawHint("select", !0); var ur = { originalEvent: S, type: "cxttapend", position: { x: Y[0], y: Y[1] } }; t.touchData.start ? (t.touchData.start.unactivate().emit(ur), t.touchData.start = null) : j.emit(ur); } } if (z && t.touchData.cxt) { var ur = { originalEvent: S, type: "cxtdrag", position: { x: Y[0], y: Y[1] } }; t.data.bgActivePosistion = void 0, t.redrawHint("select", !0), t.touchData.start ? t.touchData.start.emit(ur) : j.emit(ur), t.touchData.start && (t.touchData.start._private.grabbed = !1), t.touchData.cxtDragged = !0; var xt = t.findNearestElement(Y[0], Y[1], !0, !0); (!t.touchData.cxtOver || xt !== t.touchData.cxtOver) && (t.touchData.cxtOver && t.touchData.cxtOver.emit({ originalEvent: S, type: "cxtdragout", position: { x: Y[0], y: Y[1] } }), t.touchData.cxtOver = xt, xt && xt.emit({ originalEvent: S, type: "cxtdragover", position: { x: Y[0], y: Y[1] } })); } else if (z && S.touches[2] && j.boxSelectionEnabled()) S.preventDefault(), t.data.bgActivePosistion = void 0, this.lastThreeTouch = +/* @__PURE__ */ new Date(), t.touchData.selecting || j.emit({ originalEvent: S, type: "boxstart", position: { x: Y[0], y: Y[1] } }), t.touchData.selecting = !0, t.touchData.didSelect = !0, ae[4] = 1, !ae || ae.length === 0 || ae[0] === void 0 ? (ae[0] = (Y[0] + Y[2] + Y[4]) / 3, ae[1] = (Y[1] + Y[3] + Y[5]) / 3, ae[2] = (Y[0] + Y[2] + Y[4]) / 3 + 1, ae[3] = (Y[1] + Y[3] + Y[5]) / 3 + 1) : (ae[2] = (Y[0] + Y[2] + Y[4]) / 3, ae[3] = (Y[1] + Y[3] + Y[5]) / 3), t.redrawHint("select", !0), t.redraw(); else if (z && S.touches[1] && !t.touchData.didSelect && j.zoomingEnabled() && j.panningEnabled() && j.userZoomingEnabled() && j.userPanningEnabled()) { S.preventDefault(), t.data.bgActivePosistion = void 0, t.redrawHint("select", !0); var Tt = t.dragData.touchDragEles; if (Tt) { t.redrawHint("drag", !0); for (var Bt = 0; Bt < Tt.length; Bt++) { var kn = Tt[Bt]._private; kn.grabbed = !1, kn.rscratch.inDragLayer = !1; } } var W = t.touchData.start, St = S.touches[0].clientX - q, wt = S.touches[0].clientY - ee, Zt = S.touches[1].clientX - q, Pt = S.touches[1].clientY - ee, we = ue(St, wt, Zt, Pt), We = we / A; if (ne) { var at = St - L, Gr = wt - B, Sn = Zt - I, Oa = Pt - M, sn = (at + Sn) / 2, xr = (Gr + Oa) / 2, Tn = j.zoom(), ml = Tn * We, Bo = j.pan(), Lc = H[0] * Tn + Bo.x, Ic = H[1] * Tn + Bo.y, v0 = { x: -ml / Tn * (Lc - Bo.x - sn) + Lc, y: -ml / Tn * (Ic - Bo.y - xr) + Ic }; if (W && W.active()) { var Tt = t.dragData.touchDragEles; m(Tt), t.redrawHint("drag", !0), t.redrawHint("eles", !0), W.unactivate().emit("freeon"), Tt.emit("free"), t.dragData.didDrag && (W.emit("dragfreeon"), Tt.emit("dragfree")); } j.viewport({ zoom: ml, pan: v0, cancelOnFailedZoom: !0 }), j.emit("pinchzoom"), A = we, L = St, B = wt, I = Zt, M = Pt, t.pinching = !0; } if (S.touches[0]) { var ve = t.projectIntoViewport(S.touches[0].clientX, S.touches[0].clientY); Y[0] = ve[0], Y[1] = ve[1]; } if (S.touches[1]) { var ve = t.projectIntoViewport(S.touches[1].clientX, S.touches[1].clientY); Y[2] = ve[0], Y[3] = ve[1]; } if (S.touches[2]) { var ve = t.projectIntoViewport(S.touches[2].clientX, S.touches[2].clientY); Y[4] = ve[0], Y[5] = ve[1]; } } else if (S.touches[0] && !t.touchData.didSelect) { var Or = t.touchData.start, yl = t.touchData.last, xt; if (!t.hoverData.draggingEles && !t.swipePanning && (xt = t.findNearestElement(Y[0], Y[1], !0, !0)), z && Or != null && S.preventDefault(), z && Or != null && t.nodeIsDraggable(Or)) if (Me) { var Tt = t.dragData.touchDragEles, Fc = !t.dragData.didDrag; Fc && f(Tt, { inDragLayer: !0 }), t.dragData.didDrag = !0; var ki = { x: 0, y: 0 }; if (be(_e[0]) && be(_e[1]) && (ki.x += _e[0], ki.y += _e[1], Fc)) { t.redrawHint("eles", !0); var Lr = t.touchData.dragDelta; Lr && be(Lr[0]) && be(Lr[1]) && (ki.x += Lr[0], ki.y += Lr[1]); } t.hoverData.draggingEles = !0, Tt.silentShift(ki).emit("position drag"), t.redrawHint("drag", !0), t.touchData.startPosition[0] == pe[0] && t.touchData.startPosition[1] == pe[1] && t.redrawHint("eles", !0), t.redraw(); } else { var Lr = t.touchData.dragDelta = t.touchData.dragDelta || []; Lr.length === 0 ? (Lr.push(_e[0]), Lr.push(_e[1])) : (Lr[0] += _e[0], Lr[1] += _e[1]); } if (n(Or || xt, ["touchmove", "tapdrag", "vmousemove"], S, { x: Y[0], y: Y[1] }), (!Or || !Or.grabbed()) && xt != yl && (yl && yl.emit({ originalEvent: S, type: "tapdragout", position: { x: Y[0], y: Y[1] } }), xt && xt.emit({ originalEvent: S, type: "tapdragover", position: { x: Y[0], y: Y[1] } })), t.touchData.last = xt, z) for (var Bt = 0; Bt < Y.length; Bt++) Y[Bt] && t.touchData.startPosition[Bt] && Me && (t.touchData.singleTouchMoved = !0); if (z && (Or == null || Or.pannable()) && j.panningEnabled() && j.userPanningEnabled()) { var h0 = i(Or, t.touchData.starts); h0 && (S.preventDefault(), t.data.bgActivePosistion || (t.data.bgActivePosistion = Ha(t.touchData.startPosition)), t.swipePanning ? (j.panBy({ x: _e[0] * re, y: _e[1] * re }), j.emit("dragpan")) : Me && (t.swipePanning = !0, j.panBy({ x: Te * re, y: ut * re }), j.emit("dragpan"), Or && (Or.unactivate(), t.redrawHint("select", !0), t.touchData.start = null))); var ve = t.projectIntoViewport(S.touches[0].clientX, S.touches[0].clientY); Y[0] = ve[0], Y[1] = ve[1]; } } for (var Ne = 0; Ne < Y.length; Ne++) pe[Ne] = Y[Ne]; z && S.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 Q; t.registerBinding(e, "touchcancel", Q = function(S) { var z = t.touchData.start; t.touchData.capture = !1, z && z.unactivate(); }); var ge, Ee, fe, me; if (t.registerBinding(e, "touchend", ge = function(S) { var z = t.touchData.start, ae = t.touchData.capture; if (ae) S.touches.length === 0 && (t.touchData.capture = !1), S.preventDefault(); else return; var j = t.selection; t.swipePanning = !1, t.hoverData.draggingEles = !1; var Y = t.cy, pe = Y.zoom(), re = t.touchData.now, ve = t.touchData.earlier; if (S.touches[0]) { var Ae = t.projectIntoViewport(S.touches[0].clientX, S.touches[0].clientY); re[0] = Ae[0], re[1] = Ae[1]; } if (S.touches[1]) { var Ae = t.projectIntoViewport(S.touches[1].clientX, S.touches[1].clientY); re[2] = Ae[0], re[3] = Ae[1]; } if (S.touches[2]) { var Ae = t.projectIntoViewport(S.touches[2].clientX, S.touches[2].clientY); re[4] = Ae[0], re[5] = Ae[1]; } z && z.unactivate(); var Me; if (t.touchData.cxt) { if (Me = { originalEvent: S, type: "cxttapend", position: { x: re[0], y: re[1] } }, z ? z.emit(Me) : Y.emit(Me), !t.touchData.cxtDragged) { var _e = { originalEvent: S, type: "cxttap", position: { x: re[0], y: re[1] } }; z ? z.emit(_e) : Y.emit(_e); } t.touchData.start && (t.touchData.start._private.grabbed = !1), t.touchData.cxt = !1, t.touchData.start = null, t.redraw(); return; } if (!S.touches[2] && Y.boxSelectionEnabled() && t.touchData.selecting) { t.touchData.selecting = !1; var Ne = Y.collection(t.getAllInBox(j[0], j[1], j[2], j[3])); j[0] = void 0, j[1] = void 0, j[2] = void 0, j[3] = void 0, j[4] = 0, t.redrawHint("select", !0), Y.emit({ type: "boxend", originalEvent: S, position: { x: re[0], y: re[1] } }); var Te = function(jt) { return jt.selectable() && !jt.selected(); }; Ne.emit("box").stdFilter(Te).select().emit("boxselect"), Ne.nonempty() && t.redrawHint("eles", !0), t.redraw(); } if (z != null && z.unactivate(), S.touches[2]) t.data.bgActivePosistion = void 0, t.redrawHint("select", !0); else if (!S.touches[1]) { if (!S.touches[0]) { if (!S.touches[0]) { t.data.bgActivePosistion = void 0, t.redrawHint("select", !0); var Oe = t.dragData.touchDragEles; if (z != null) { var ut = z._private.grabbed; m(Oe), t.redrawHint("drag", !0), t.redrawHint("eles", !0), ut && (z.emit("freeon"), Oe.emit("free"), t.dragData.didDrag && (z.emit("dragfreeon"), Oe.emit("dragfree"))), n(z, ["touchend", "tapend", "vmouseup", "tapdragout"], S, { x: re[0], y: re[1] }), z.unactivate(), t.touchData.start = null; } else { var nt = t.findNearestElement(re[0], re[1], !0, !0); n(nt, ["touchend", "tapend", "vmouseup", "tapdragout"], S, { x: re[0], y: re[1] }); } var kt = t.touchData.startPosition[0] - re[0], St = kt * kt, wt = t.touchData.startPosition[1] - re[1], Zt = wt * wt, Pt = St + Zt, Mt = Pt * pe * pe; t.touchData.singleTouchMoved || (z || Y.$(":selected").unselect(["tapunselect"]), n(z, ["tap", "vclick"], S, { x: re[0], y: re[1] }), Ee = !1, S.timeStamp - me <= Y.multiClickDebounceTime() ? (fe && clearTimeout(fe), Ee = !0, me = null, n(z, ["dbltap", "vdblclick"], S, { x: re[0], y: re[1] })) : (fe = setTimeout(function() { Ee || n(z, ["onetap", "voneclick"], S, { x: re[0], y: re[1] }); }, Y.multiClickDebounceTime()), me = S.timeStamp)), z != null && !t.dragData.didDrag && z._private.selectable && Mt < t.touchTapThreshold2 && !t.pinching && (Y.selectionType() === "single" ? (Y.$(r).unmerge(z).unselect(["tapunselect"]), z.select(["tapselect"])) : z.selected() ? z.unselect(["tapunselect"]) : z.select(["tapselect"]), t.redrawHint("eles", !0)), t.touchData.singleTouchMoved = !0; } } } for (var gr = 0; gr < re.length; gr++) ve[gr] = re[gr]; t.dragData.didDrag = !1, S.touches.length === 0 && (t.touchData.dragDelta = [], t.touchData.startPosition = [null, null, null, null, null, null], t.touchData.startGPosition = null, t.touchData.didSelect = !1), S.touches.length < 2 && (S.touches.length === 1 && (t.touchData.startGPosition = [S.touches[0].clientX, S.touches[0].clientY]), t.pinching = !1, t.redrawHint("eles", !0), t.redraw()); }, !1), typeof TouchEvent > "u") { var xe = [], ke = function(S) { return { clientX: S.clientX, clientY: S.clientY, force: 1, identifier: S.pointerId, pageX: S.pageX, pageY: S.pageY, radiusX: S.width / 2, radiusY: S.height / 2, screenX: S.screenX, screenY: S.screenY, target: S.target }; }, Ce = function(S) { return { event: S, touch: ke(S) }; }, De = function(S) { xe.push(Ce(S)); }, qe = function(S) { for (var z = 0; z < xe.length; z++) { var ae = xe[z]; if (ae.event.pointerId === S.pointerId) { xe.splice(z, 1); return; } } }, Ke = function(S) { var z = xe.filter(function(ae) { return ae.event.pointerId === S.pointerId; })[0]; z.event = S, z.touch = ke(S); }, Be = function(S) { S.touches = xe.map(function(z) { return z.touch; }); }, Ge = function(S) { return S.pointerType === "mouse" || S.pointerType === 4; }; t.registerBinding(t.container, "pointerdown", function(le) { Ge(le) || (le.preventDefault(), De(le), Be(le), $(le)); }), t.registerBinding(t.container, "pointerup", function(le) { Ge(le) || (qe(le), Be(le), ge(le)); }), t.registerBinding(t.container, "pointercancel", function(le) { Ge(le) || (qe(le), Be(le), Q(le)); }), t.registerBinding(t.container, "pointermove", function(le) { Ge(le) || (le.preventDefault(), Ke(le), Be(le), G(le)); }); } }; var Cn = {}; Cn.generatePolygon = function(t, e) { return this.nodeShapes[t] = { renderer: this, name: t, points: e, draw: function(n, a, i, o, s, u) { this.renderer.nodeShapeImpl("polygon", n, a, i, o, s, this.points); }, intersectLine: function(n, a, i, o, s, u, l, c) { return oo(s, u, this.points, n, a, i / 2, o / 2, l); }, checkPoint: function(n, a, i, o, s, u, l, c) { return mn(n, a, this.points, u, l, o, s, [0, -1], i); } }; }; Cn.generateEllipse = function() { return this.nodeShapes.ellipse = { renderer: this, name: "ellipse", draw: function(e, r, n, a, i, o) { this.renderer.nodeShapeImpl(this.name, e, r, n, a, i); }, intersectLine: function(e, r, n, a, i, o, s, u) { return n4(i, o, e, r, n / 2 + s, a / 2 + s); }, checkPoint: function(e, r, n, a, i, o, s, u) { return la(e, r, a, i, o, s, n); } }; }; Cn.generateRoundPolygon = function(t, e) { return this.nodeShapes[t] = { renderer: this, name: t, points: e, getOrCreateCorners: function(n, a, i, o, s, u, l) { if (u[l] !== void 0 && u[l + "-cx"] === n && u[l + "-cy"] === a) return u[l]; u[l] = new Array(e.length / 2), u[l + "-cx"] = n, u[l + "-cy"] = a; var c = i / 2, d = o / 2; s = s === "auto" ? mp(i, o) : s; for (var v = new Array(e.length / 2), h = 0; h < e.length / 2; h++) v[h] = { x: n + c * e[h * 2], y: a + d * e[h * 2 + 1] }; var f, p, m, g, y = v.length; for (p = v[y - 1], f = 0; f < y; f++) m = v[f % y], g = v[(f + 1) % y], u[l][f] = Tc(p, m, g, s), p = m, m = g; return u[l]; }, draw: function(n, a, i, o, s, u, l) { this.renderer.nodeShapeImpl("round-polygon", n, a, i, o, s, this.points, this.getOrCreateCorners(a, i, o, s, u, l, "drawCorners")); }, intersectLine: function(n, a, i, o, s, u, l, c, d) { return a4(s, u, this.points, n, a, i, o, l, this.getOrCreateCorners(n, a, i, o, c, d, "corners")); }, checkPoint: function(n, a, i, o, s, u, l, c, d) { return r4(n, a, this.points, u, l, o, s, this.getOrCreateCorners(u, l, o, s, c, d, "corners")); } }; }; Cn.generateRoundRectangle = function() { return this.nodeShapes["round-rectangle"] = this.nodeShapes.roundrectangle = { renderer: this, name: "round-rectangle", points: sr(4, 0), draw: function(e, r, n, a, i, o) { this.renderer.nodeShapeImpl(this.name, e, r, n, a, i, this.points, o); }, intersectLine: function(e, r, n, a, i, o, s, u) { return pp(i, o, e, r, n, a, s, u); }, checkPoint: function(e, r, n, a, i, o, s, u) { var l = a / 2, c = i / 2; u = u === "auto" ? ba(a, i) : u, u = Math.min(l, c, u); var d = u * 2; return !!(mn(e, r, this.points, o, s, a, i - d, [0, -1], n) || mn(e, r, this.points, o, s, a - d, i, [0, -1], n) || la(e, r, d, d, o - l + u, s - c + u, n) || la(e, r, d, d, o + l - u, s - c + u, n) || la(e, r, d, d, o + l - u, s + c - u, n) || la(e, r, d, d, o - l + u, s + c - u, n)); } }; }; Cn.generateCutRectangle = function() { return this.nodeShapes["cut-rectangle"] = this.nodeShapes.cutrectangle = { renderer: this, name: "cut-rectangle", cornerLength: hc(), points: sr(4, 0), draw: function(e, r, n, a, i, o) { this.renderer.nodeShapeImpl(this.name, e, r, n, a, i, null, o); }, generateCutTrianglePts: function(e, r, n, a, i) { var o = i === "auto" ? this.cornerLength : i, s = r / 2, u = e / 2, l = n - u, c = n + u, d = a - s, v = a + s; return { topLeft: [l, d + o, l + o, d, l + o, d + o], topRight: [c - o, d, c, d + o, c - o, d + o], bottomRight: [c, v - o, c - o, v, c - o, v - o], bottomLeft: [l + o, v, l, v - o, l + o, v - o] }; }, intersectLine: function(e, r, n, a, i, o, s, u) { var l = this.generateCutTrianglePts(n + 2 * s, a + 2 * s, e, r, u), c = [].concat.apply([], [l.topLeft.splice(0, 4), l.topRight.splice(0, 4), l.bottomRight.splice(0, 4), l.bottomLeft.splice(0, 4)]); return oo(i, o, c, e, r); }, checkPoint: function(e, r, n, a, i, o, s, u) { var l = u === "auto" ? this.cornerLength : u; if (mn(e, r, this.points, o, s, a, i - 2 * l, [0, -1], n) || mn(e, r, this.points, o, s, a - 2 * l, i, [0, -1], n)) return !0; var c = this.generateCutTrianglePts(a, i, o, s); return dr(e, r, c.topLeft) || dr(e, r, c.topRight) || dr(e, r, c.bottomRight) || dr(e, r, c.bottomLeft); } }; }; Cn.generateBarrel = function() { return this.nodeShapes.barrel = { renderer: this, name: "barrel", points: sr(4, 0), draw: function(e, r, n, a, i, o) { this.renderer.nodeShapeImpl(this.name, e, r, n, a, i); }, intersectLine: function(e, r, n, a, i, o, s, u) { var l = 0.15, c = 0.5, d = 0.85, v = this.generateBarrelBezierPts(n + 2 * s, a + 2 * s, e, r), h = function(m) { var g = Ga({ x: m[0], y: m[1] }, { x: m[2], y: m[3] }, { x: m[4], y: m[5] }, l), y = Ga({ x: m[0], y: m[1] }, { x: m[2], y: m[3] }, { x: m[4], y: m[5] }, c), b = Ga({ 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, y.x, y.y, b.x, b.y, m[4], m[5]]; }, f = [].concat(h(v.topLeft), h(v.topRight), h(v.bottomRight), h(v.bottomLeft)); return oo(i, o, f, e, r); }, generateBarrelBezierPts: function(e, r, n, a) { var i = r / 2, o = e / 2, s = n - o, u = n + o, l = a - i, c = a + i, d = lu(e, r), v = d.heightOffset, h = d.widthOffset, f = d.ctrlPtOffsetPct * e, p = { topLeft: [s, l + v, s + f, l, s + h, l], topRight: [u - h, l, u - f, l, u, l + v], bottomRight: [u, c - v, u - f, c, u - h, c], bottomLeft: [s + h, c, s + f, c, s, c - v] }; return p.topLeft.isTop = !0, p.topRight.isTop = !0, p.bottomLeft.isBottom = !0, p.bottomRight.isBottom = !0, p; }, checkPoint: function(e, r, n, a, i, o, s, u) { var l = lu(a, i), c = l.heightOffset, d = l.widthOffset; if (mn(e, r, this.points, o, s, a, i - 2 * c, [0, -1], n) || mn(e, r, this.points, o, s, a - 2 * d, i, [0, -1], n)) return !0; for (var v = this.generateBarrelBezierPts(a, i, o, s), h = function(T, k, _) { var D = _[4], O = _[2], F = _[0], L = _[5], B = _[1], I = Math.min(D, F), M = Math.max(D, F), A = Math.min(L, B), R = Math.max(L, B); if (I <= T && T <= M && A <= k && k <= R) { var K = i4(D, O, F), H = Q5(K[0], K[1], K[2], T), q = H.filter(function(ee) { return 0 <= ee && ee <= 1; }); if (q.length > 0) return q[0]; } return null; }, f = Object.keys(v), p = 0; p < f.length; p++) { var m = f[p], g = v[m], y = h(e, r, g); if (y != null) { var b = g[5], w = g[3], C = g[1], E = Nt(b, w, C, y); if (g.isTop && E <= r || g.isBottom && r <= E) return !0; } } return !1; } }; }; Cn.generateBottomRoundrectangle = function() { return this.nodeShapes["bottom-round-rectangle"] = this.nodeShapes.bottomroundrectangle = { renderer: this, name: "bottom-round-rectangle", points: sr(4, 0), draw: function(e, r, n, a, i, o) { this.renderer.nodeShapeImpl(this.name, e, r, n, a, i, this.points, o); }, intersectLine: function(e, r, n, a, i, o, s, u) { var l = e - (n / 2 + s), c = r - (a / 2 + s), d = c, v = e + (n / 2 + s), h = Nn(i, o, e, r, l, c, v, d, !1); return h.length > 0 ? h : pp(i, o, e, r, n, a, s, u); }, checkPoint: function(e, r, n, a, i, o, s, u) { u = u === "auto" ? ba(a, i) : u; var l = 2 * u; if (mn(e, r, this.points, o, s, a, i - l, [0, -1], n) || mn(e, r, this.points, o, s, a - l, i, [0, -1], n)) return !0; var c = a / 2 + 2 * n, d = i / 2 + 2 * n, v = [o - c, s - d, o - c, s, o + c, s, o + c, s - d]; return !!(dr(e, r, v) || la(e, r, l, l, o + a / 2 - u, s + i / 2 - u, n) || la(e, r, l, l, o - a / 2 + u, s + i / 2 - u, n)); } }; }; Cn.registerNodeShapes = function() { var t = this.nodeShapes = {}, e = this; this.generateEllipse(), this.generatePolygon("triangle", sr(3, 0)), this.generateRoundPolygon("round-triangle", sr(3, 0)), this.generatePolygon("rectangle", sr(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", sr(5, 0)), this.generateRoundPolygon("round-pentagon", sr(5, 0)), this.generatePolygon("hexagon", sr(6, 0)), this.generateRoundPolygon("round-hexagon", sr(6, 0)), this.generatePolygon("heptagon", sr(7, 0)), this.generateRoundPolygon("round-heptagon", sr(7, 0)), this.generatePolygon("octagon", sr(8, 0)), this.generateRoundPolygon("round-octagon", sr(8, 0)); var n = new Array(20); { var a = su(5, 0), i = su(5, Math.PI / 5), o = 0.5 * (3 - Math.sqrt(5)); o *= 1.57; for (var s = 0; s < i.length / 2; s++) i[s * 2] *= o, i[s * 2 + 1] *= o; for (var s = 0; s < 20 / 4; s++) n[s * 4] = a[s * 2], n[s * 4 + 1] = a[s * 2 + 1], n[s * 4 + 2] = i[s * 2], n[s * 4 + 3] = i[s * 2 + 1]; } n = gp(n), this.generatePolygon("star", n), this.generatePolygon("vee", [-1, -1, 0, -0.333, 1, -1, 0, 1]), this.generatePolygon("rhomboid", [-1, -1, 0.333, -1, 1, 1, -0.333, 1]), this.generatePolygon("right-rhomboid", [-0.333, -1, 1, -1, 0.333, 1, -1, 1]), this.nodeShapes.concavehexagon = this.generatePolygon("concave-hexagon", [-1, -0.95, -0.75, 0, -1, 0.95, 1, 0.95, 0.75, 0, 1, -0.95]); { var u = [-1, -1, 0.25, -1, 1, 0, 0.25, 1, -1, 1]; this.generatePolygon("tag", u), this.generateRoundPolygon("round-tag", u); } t.makePolygon = function(l) { var c = l.join("$"), d = "polygon-" + c, v; return (v = this[d]) ? v : e.generatePolygon(d, l); }; }; var Ao = {}; Ao.timeToRender = function() { return this.redrawTotalTime / this.redrawCount; }; Ao.redraw = function(t) { t = t || cp(); 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; }; Ao.beforeRender = function(t, e) { if (!this.destroyed) { e == null && yt("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 iv = function(e, r, n) { for (var a = e.beforeRenderCallbacks, i = 0; i < a.length; i++) a[i].fn(r, n); }; Ao.startRenderLoop = function() { var t = this, e = t.cy; if (!t.renderLoopStarted) { t.renderLoopStarted = !0; var r = function n(a) { if (!t.destroyed) { if (!e.batching()) if (t.requestedFrame && !t.skipFrame) { iv(t, !0, a); var i = gn(); t.render(t.renderOptions); var o = t.lastDrawTime = gn(); t.averageRedrawTime === void 0 && (t.averageRedrawTime = o - i), t.redrawCount === void 0 && (t.redrawCount = 0), t.redrawCount++, t.redrawTotalTime === void 0 && (t.redrawTotalTime = 0); var s = o - i; t.redrawTotalTime += s, t.lastRedrawTime = s, t.averageRedrawTime = t.averageRedrawTime / 2 + s / 2, t.requestedFrame = !1; } else iv(t, !1, a); t.skipFrame = !1, Ps(n); } }; Ps(r); } }; var zP = function(e) { this.init(e); }, pg = zP, xi = pg.prototype; xi.clientFunctions = ["redrawHint", "render", "renderTo", "matchCanvasSize", "nodeShapeImpl", "arrowShapeImpl"]; xi.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, o = "__________cytoscape_stylesheet", s = "__________cytoscape_container", u = a.getElementById(o) != null; if (r.className.indexOf(s) < 0 && (r.className = (r.className || "") + " " + s), !u) { var l = a.createElement("style"); l.id = o, l.textContent = "." + s + " { position: relative; }", i.insertBefore(l, i.children[0]); } var c = n.getComputedStyle(r), d = c.getPropertyValue("position"); d === "static" && tt("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 = [0.05, 0.225, 0.4, 0.5, 0.6, 0.775, 0.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, // These 3 fields related to tap, taphold events 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.hideEdgesOnViewport = t.hideEdgesOnViewport, e.textureOnViewport = t.textureOnViewport, e.wheelSensitivity = t.wheelSensitivity, e.motionBlurEnabled = t.motionBlur, e.forcedPixelRatio = be(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 = { // higher priority execs before lower one animations: 400, eleCalcs: 300, eleTxrDeq: 200, lyrTxrDeq: 150, lyrTxrSkip: 100 }, e.registerNodeShapes(), e.registerArrowShapes(), e.registerCalculationListeners(); }; xi.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 === "load" || t === "resize" || t === "mount") && (r.invalidateContainerClientCoordsCache(), r.matchCanvasSize(r.container)), r.redrawHint("eles", !0), r.redrawHint("drag", !0), this.startRenderLoop(), this.redraw(); } }; xi.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 { } }; xi.isHeadless = function() { return !1; }; [Sc, vg, hg, wi, Cn, Ao].forEach(function(t) { Re(xi, t); }); var ql = 1e3 / 60, gg = { setupDequeueing: function(e) { return function() { var n = this, a = this.renderer; if (!n.dequeueingSetup) { n.dequeueingSetup = !0; var i = tl(function() { a.redrawHint("eles", !0), a.redrawHint("drag", !0), a.redraw(); }, e.deqRedrawThreshold), o = function(l, c) { var d = gn(), v = a.averageRedrawTime, h = a.lastRedrawTime, f = [], p = a.cy.extent(), m = a.getPixelRatio(); for (l || a.flushRenderedStyleQueue(); ; ) { var g = gn(), y = g - d, b = g - c; if (h < ql) { var w = ql - (l ? v : 0); if (b >= e.deqFastCost * w) break; } else if (l) { if (y >= e.deqCost * h || y >= e.deqAvgCost * v) break; } else if (b >= e.deqNoDrawCost * ql) break; var C = e.deq(n, m, p); if (C.length > 0) for (var E = 0; E < C.length; E++) f.push(C[E]); else break; } f.length > 0 && (e.onDeqd(n, f), !l && e.shouldRedraw(n, f, m, p) && i()); }, s = e.priority || cc; a.beforeRender(o, s(n)); } }; } }, VP = /* @__PURE__ */ function() { function t(e) { var r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : Os; ic(this, t), this.idsByKey = new Xr(), this.keyForId = new Xr(), this.cachesByLvl = new Xr(), this.lvls = [], this.getKey = e, this.doesEleInvalidateKey = r; } return oc(t, [{ key: "getIdsFor", value: function(r) { r == null && yt("Can not get id list for null key"); var n = this.idsByKey, a = this.idsByKey.get(r); return a || (a = new vi(), 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 Xr(), 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); }); } // returns true if no other eles reference the invalidated cache (n.b. other eles may need the cache with the same key) }, { 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; } }]), t; }(), ov = 25, ns = 50, ms = -4, bu = 3, HP = 7.99, qP = 8, KP = 1024, UP = 1024, GP = 1024, WP = 0.2, YP = 0.8, ZP = 10, XP = 0.15, jP = 0.1, QP = 0.9, JP = 0.9, eO = 100, tO = 1, qa = { dequeue: "dequeue", downscale: "downscale", highQuality: "highQuality" }, rO = Wt({ getKey: null, doesEleInvalidateKey: Os, drawElement: null, getBoundingBox: null, getRotationPoint: null, getRotationOffset: null, isVisible: sp, allowEdgeTxrCaching: !0, allowParentTxrCaching: !0 }), Ri = function(e, r) { var n = this; n.renderer = e, n.onDequeues = []; var a = rO(r); Re(n, a), n.lookup = new VP(a.getKey, a.doesEleInvalidateKey), n.setupDequeueing(); }, At = Ri.prototype; At.reasons = qa; At.getTextureQueue = function(t) { var e = this; return e.eleImgCaches = e.eleImgCaches || {}, e.eleImgCaches[t] = e.eleImgCaches[t] || []; }; At.getRetiredTextureQueue = function(t) { var e = this, r = e.eleImgCaches.retired = e.eleImgCaches.retired || {}, n = r[t] = r[t] || []; return n; }; At.getElementQueue = function() { var t = this, e = t.eleCacheQueue = t.eleCacheQueue || new Oo(function(r, n) { return n.reqs - r.reqs; }); return e; }; At.getElementKeyToQueue = function() { var t = this, e = t.eleKeyToCacheQueue = t.eleKeyToCacheQueue || {}; return e; }; At.getElement = function(t, e, r, n, a) { var i = this, o = this.renderer, s = o.cy.zoom(), u = 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(fc(s * r))), n < ms) n = ms; else if (s >= HP || n > bu) return null; var l = Math.pow(2, n), c = e.h * l, d = e.w * l, v = o.eleTextBiggerThanMin(t, l); if (!this.isVisible(t, v)) return null; var h = u.get(t, n); if (h && h.invalidated && (h.invalidated = !1, h.texture.invalidatedWidth -= h.width), h) return h; var f; if (c <= ov ? f = ov : c <= ns ? f = ns : f = Math.ceil(c / ns) * ns, c > GP || d > UP) return null; var p = i.getTextureQueue(f), m = p[p.length - 2], g = function() { return i.recycleTexture(f, d) || i.addTexture(f, d); }; m || (m = p[p.length - 1]), m || (m = g()), m.width - m.usedWidth < d && (m = g()); for (var y = function(I) { return I && I.scaledLabelShown === v; }, b = a && a === qa.dequeue, w = a && a === qa.highQuality, C = a && a === qa.downscale, E, x = n + 1; x <= bu; x++) { var T = u.get(t, x); if (T) { E = T; break; } } var k = E && E.level === n + 1 ? E : null, _ = function() { m.context.drawImage(k.texture.canvas, k.x, 0, k.width, k.height, m.usedWidth, 0, d, c); }; if (m.context.setTransform(1, 0, 0, 1, 0, 0), m.context.clearRect(m.usedWidth, 0, d, f), y(k)) _(); else if (y(E)) if (w) { for (var D = E.level; D > n; D--) k = i.getElement(t, e, r, D, qa.downscale); _(); } else return i.queueElement(t, E.level - 1), E; else { var O; if (!b && !w && !C) for (var F = n - 1; F >= ms; F--) { var L = u.get(t, F); if (L) { O = L; break; } } if (y(O)) return i.queueElement(t, n), O; m.context.translate(m.usedWidth, 0), m.context.scale(l, l), this.drawElement(m.context, t, e, v, !1), m.context.scale(1 / l, 1 / l), m.context.translate(-m.usedWidth, 0); } return h = { x: m.usedWidth, texture: m, level: n, scale: l, width: d, height: c, scaledLabelShown: v }, m.usedWidth += Math.ceil(d + qP), m.eleCaches.push(h), u.set(t, n, h), i.checkTextureFullness(m), h; }; At.invalidateElements = function(t) { for (var e = 0; e < t.length; e++) this.invalidateElement(t[e]); }; At.invalidateElement = function(t) { var e = this, r = e.lookup, n = [], a = r.isInvalid(t); if (a) { for (var i = ms; i <= bu; i++) { var o = r.getForCachedKey(t, i); o && n.push(o); } var s = r.invalidate(t); if (s) for (var u = 0; u < n.length; u++) { var l = n[u], c = l.texture; c.invalidatedWidth += l.width, l.invalidated = !0, e.checkTextureUtility(c); } e.removeFromQueue(t); } }; At.checkTextureUtility = function(t) { t.invalidatedWidth >= WP * t.width && this.retireTexture(t); }; At.checkTextureFullness = function(t) { var e = this, r = e.getTextureQueue(t.height); t.usedWidth / t.width > YP && t.fullnessChecks >= ZP ? Kn(r, t) : t.fullnessChecks++; }; At.retireTexture = function(t) { var e = this, r = t.height, n = e.getTextureQueue(r), a = this.lookup; Kn(n, t), t.retired = !0; for (var i = t.eleCaches, o = 0; o < i.length; o++) { var s = i[o]; a.deleteCache(s.key, s.level); } dc(i); var u = e.getRetiredTextureQueue(r); u.push(t); }; At.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(KP, 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; }; At.recycleTexture = function(t, e) { for (var r = this, n = r.getTextureQueue(t), a = r.getRetiredTextureQueue(t), i = 0; i < a.length; i++) { var o = a[i]; if (o.width >= e) return o.retired = !1, o.usedWidth = 0, o.invalidatedWidth = 0, o.fullnessChecks = 0, dc(o.eleCaches), o.context.setTransform(1, 0, 0, 1, 0, 0), o.context.clearRect(0, 0, o.width, o.height), Kn(a, o), n.push(o), o; } }; At.queueElement = function(t, e) { var r = this, n = r.getElementQueue(), a = r.getElementKeyToQueue(), i = this.getKey(t), o = a[i]; if (o) o.level = Math.max(o.level, e), o.eles.merge(t), o.reqs++, n.updateItem(o); else { var s = { eles: t.spawn().merge(t), level: e, reqs: 1, key: i }; n.push(s), a[i] = s; } }; At.dequeue = function(t) { for (var e = this, r = e.getElementQueue(), n = e.getElementKeyToQueue(), a = [], i = e.lookup, o = 0; o < tO && r.size() > 0; o++) { var s = r.pop(), u = s.key, l = s.eles[0], c = i.hasCache(l, s.level); if (n[u] = null, c) continue; a.push(s); var d = e.getBoundingBox(l); e.getElement(l, d, t, s.level, qa.dequeue); } return a; }; At.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 = uc, r.updateItem(i), r.pop(), n[a] = null) : i.eles.unmerge(t)); }; At.onDequeue = function(t) { this.onDequeues.push(t); }; At.offDequeue = function(t) { Kn(this.onDequeues, t); }; At.setupDequeueing = gg.setupDequeueing({ deqRedrawThreshold: eO, deqCost: XP, deqAvgCost: jP, deqNoDrawCost: QP, deqFastCost: JP, 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 o = r[i].eles, s = 0; s < o.length; s++) { var u = o[s].boundingBox(); if (vc(u, a)) return !0; } return !1; }, priority: function(e) { return e.renderer.beforeRenderPriorities.eleTxrDeq; } }); var nO = 1, Ui = -4, $s = 2, aO = 3.99, iO = 50, oO = 50, sO = 0.15, lO = 0.1, uO = 0.9, cO = 0.9, dO = 1, sv = 250, fO = 4e3 * 4e3, vO = !0, mg = function(e) { var r = this, n = r.renderer = e, a = n.cy; r.layersByLevel = {}, r.firstGet = !0, r.lastInvalidationTime = gn() - 2 * sv, r.skipping = !1, r.eleTxrDeqs = a.collection(), r.scheduleElementRefinement = tl(function() { r.refineElementTextures(r.eleTxrDeqs), r.eleTxrDeqs.unmerge(r.eleTxrDeqs); }, oO), n.beforeRender(function(o, s) { s - r.lastInvalidationTime <= sv ? r.skipping = !0 : r.skipping = !1; }, n.beforeRenderPriorities.lyrTxrSkip); var i = function(s, u) { return u.reqs - s.reqs; }; r.layersQueue = new Oo(i), r.setupDequeueing(); }, Yt = mg.prototype, lv = 0, hO = Math.pow(2, 53) - 1; Yt.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), o = { id: lv = ++lv % hO, bb: t, level: e, width: n, height: a, canvas: i, context: i.getContext("2d"), eles: [], elesQueue: [], reqs: 0 }, s = o.context, u = -o.bb.x1, l = -o.bb.y1; return s.scale(r, r), s.translate(u, l), o; }; Yt.getLayers = function(t, e, r) { var n = this, a = n.renderer, i = a.cy, o = i.zoom(), s = n.firstGet; if (n.firstGet = !1, r == null) { if (r = Math.ceil(fc(o * e)), r < Ui) r = Ui; else if (o >= aO || r > $s) return null; } n.validateLayersElesOrdering(r, t); var u = n.layersByLevel, l = Math.pow(2, r), c = u[r] = u[r] || [], d, v = n.levelIsComplete(r, t), h, f = function() { var _ = function(B) { if (n.validateLayersElesOrdering(B, t), n.levelIsComplete(B, t)) return h = u[B], !0; }, D = function(B) { if (!h) for (var I = r + B; Ui <= I && I <= $s && !_(I); I += B) ; }; D(1), D(-1); for (var O = c.length - 1; O >= 0; O--) { var F = c[O]; F.invalid && Kn(c, F); } }; if (!v) f(); else return c; var p = function() { if (!d) { d = pr(); for (var _ = 0; _ < t.length; _++) vp(d, t[_].boundingBox()); } return d; }, m = function(_) { _ = _ || {}; var D = _.after; p(); var O = d.w * l * (d.h * l); if (O > fO) return null; var F = n.makeLayer(d, r); if (D != null) { var L = c.indexOf(D) + 1; c.splice(L, 0, F); } else (_.insert === void 0 || _.insert) && c.unshift(F); return F; }; if (n.skipping && !s) return null; for (var g = null, y = t.length / nO, b = !s, w = 0; w < t.length; w++) { var C = t[w], E = C._private.rscratch, x = E.imgLayerCaches = E.imgLayerCaches || {}, T = x[r]; if (T) { g = T; continue; } if ((!g || g.eles.length >= y || !hp(g.bb, C.boundingBox())) && (g = m({ insert: !0, after: g }), !g)) return null; h || b ? n.queueLayer(g, C) : n.drawEleInLayer(g, C, r, e), g.eles.push(C), x[r] = g; } return h || (b ? null : c); }; Yt.getEleLevelForLayerLevel = function(t, e) { return t; }; Yt.drawEleInLayer = function(t, e, r, n) { var a = this, i = this.renderer, o = t.context, s = e.boundingBox(); s.w === 0 || s.h === 0 || !e.visible() || (r = a.getEleLevelForLayerLevel(r, n), i.setImgSmoothing(o, !1), i.drawCachedElement(o, e, null, null, r, vO), i.setImgSmoothing(o, !0)); }; Yt.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 o = n[i]; if (o.reqs > 0 || o.invalid) return !1; a += o.eles.length; } return a === e.length; }; Yt.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, o = 0; o < e.length; o++) if (a.eles[0] === e[o]) { i = o; break; } if (i < 0) { this.invalidateLayer(a); continue; } for (var s = i, o = 0; o < a.eles.length; o++) if (a.eles[o] !== e[s + o]) { this.invalidateLayer(a); break; } } }; Yt.updateElementsInLayers = function(t, e) { for (var r = this, n = Do(t[0]), a = 0; a < t.length; a++) for (var i = n ? null : t[a], o = n ? t[a] : t[a].ele, s = o._private.rscratch, u = s.imgLayerCaches = s.imgLayerCaches || {}, l = Ui; l <= $s; l++) { var c = u[l]; c && (i && r.getEleLevelForLayerLevel(c.level) !== i.level || e(c, o, i)); } }; Yt.haveLayers = function() { for (var t = this, e = !1, r = Ui; r <= $s; r++) { var n = t.layersByLevel[r]; if (n && n.length > 0) { e = !0; break; } } return e; }; Yt.invalidateElements = function(t) { var e = this; t.length !== 0 && (e.lastInvalidationTime = gn(), !(t.length === 0 || !e.haveLayers()) && e.updateElementsInLayers(t, function(n, a, i) { e.invalidateLayer(n); })); }; Yt.invalidateLayer = function(t) { if (this.lastInvalidationTime = gn(), !t.invalid) { var e = t.level, r = t.eles, n = this.layersByLevel[e]; Kn(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); } } }; Yt.refineElementTextures = function(t) { var e = this; e.updateElementsInLayers(t, function(n, a, i) { var o = n.replacement; if (o || (o = n.replacement = e.makeLayer(n.bb, n.level), o.replaces = n, o.eles = n.eles), !o.reqs) for (var s = 0; s < o.eles.length; s++) e.queueLayer(o, o.eles[s]); }); }; Yt.enqueueElementRefinement = function(t) { this.eleTxrDeqs.merge(t), this.scheduleElementRefinement(); }; Yt.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)); } }; Yt.dequeue = function(t) { for (var e = this, r = e.layersQueue, n = [], a = 0; a < dO && 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 o = i.elesQueue.shift(); o && (e.drawEleInLayer(i, o, 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; }; Yt.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 o = t.eles[i]._private, s = o.imgLayerCaches = o.imgLayerCaches || {}; s && (s[t.level] = t); } e.requestRedraw(); } }; Yt.requestRedraw = tl(function() { var t = this.renderer; t.redrawHint("eles", !0), t.redrawHint("drag", !0), t.redraw(); }, 100); Yt.setupDequeueing = gg.setupDequeueing({ deqRedrawThreshold: iO, deqCost: sO, deqAvgCost: lO, deqNoDrawCost: uO, deqFastCost: cO, deq: function(e, r) { return e.dequeue(r); }, onDeqd: cc, shouldRedraw: sp, priority: function(e) { return e.renderer.beforeRenderPriorities.lyrTxrDeq; } }); var yg = {}, uv; function pO(t, e) { for (var r = 0; r < e.length; r++) { var n = e[r]; t.lineTo(n.x, n.y); } } function gO(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 cv(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 o = r, s = r[0]; t.moveTo(s.x, s.y); for (var a = 1; a < o.length; a++) { var i = o[a]; t.lineTo(i.x, i.y); } t.closePath && t.closePath(); } function mO(t, e, r, n, a) { t.beginPath && t.beginPath(), t.arc(r, n, a, 0, Math.PI * 2, !1); var i = e, o = i[0]; t.moveTo(o.x, o.y); for (var s = 0; s < i.length; s++) { var u = i[s]; t.lineTo(u.x, u.y); } t.closePath && t.closePath(); } function yO(t, e, r, n) { t.arc(e, r, n, 0, Math.PI * 2, !1); } yg.arrowShapeImpl = function(t) { return (uv || (uv = { polygon: pO, "triangle-backcurve": gO, "triangle-tee": cv, "circle-triangle": mO, "triangle-cross": cv, circle: yO }))[t]; }; var on = {}; on.drawElement = function(t, e, r, n, a, i) { var o = this; e.isNode() ? o.drawNode(t, e, r, n, a, i) : o.drawEdge(t, e, r, n, a, i); }; on.drawElementOverlay = function(t, e) { var r = this; e.isNode() ? r.drawNodeOverlay(t, e) : r.drawEdgeOverlay(t, e); }; on.drawElementUnderlay = function(t, e) { var r = this; e.isNode() ? r.drawNodeUnderlay(t, e) : r.drawEdgeUnderlay(t, e); }; on.drawCachedElementPortion = function(t, e, r, n, a, i, o, s) { var u = this, l = r.getBoundingBox(e); if (!(l.w === 0 || l.h === 0)) { var c = r.getElement(e, l, n, a, i); if (c != null) { var d = s(u, e); if (d === 0) return; var v = o(u, e), h = l.x1, f = l.y1, p = l.w, m = l.h, g, y, b, w, C; if (v !== 0) { var E = r.getRotationPoint(e); b = E.x, w = E.y, t.translate(b, w), t.rotate(v), C = u.getImgSmoothing(t), C || u.setImgSmoothing(t, !0); var x = r.getRotationOffset(e); g = x.x, y = x.y; } else g = h, y = f; var T; d !== 1 && (T = t.globalAlpha, t.globalAlpha = T * d), t.drawImage(c.texture.canvas, c.x, 0, c.width, c.height, g, y, p, m), d !== 1 && (t.globalAlpha = T), v !== 0 && (t.rotate(-v), t.translate(-b, -w), C || u.setImgSmoothing(t, !1)); } else r.drawElement(t, e); } }; var bO = function() { return 0; }, wO = function(e, r) { return e.getTextAngle(r, null); }, xO = function(e, r) { return e.getTextAngle(r, "source"); }, CO = function(e, r) { return e.getTextAngle(r, "target"); }, EO = function(e, r) { return r.effectiveOpacity(); }, Kl = function(e, r) { return r.pstyle("text-opacity").pfValue * r.effectiveOpacity(); }; on.drawCachedElement = function(t, e, r, n, a, i) { var o = this, s = o.data, u = s.eleTxrCache, l = s.lblTxrCache, c = s.slbTxrCache, d = s.tlbTxrCache, v = e.boundingBox(), h = i === !0 ? u.reasons.highQuality : null; if (!(v.w === 0 || v.h === 0 || !e.visible()) && (!n || vc(v, n))) { var f = e.isEdge(), p = e.element()._private.rscratch.badLine; o.drawElementUnderlay(t, e), o.drawCachedElementPortion(t, e, u, r, a, h, bO, EO), (!f || !p) && o.drawCachedElementPortion(t, e, l, r, a, h, wO, Kl), f && !p && (o.drawCachedElementPortion(t, e, c, r, a, h, xO, Kl), o.drawCachedElementPortion(t, e, d, r, a, h, CO, Kl)), o.drawElementOverlay(t, e); } }; on.drawElements = function(t, e) { for (var r = this, n = 0; n < e.length; n++) { var a = e[n]; r.drawElement(t, a); } }; on.drawCachedElements = function(t, e, r, n) { for (var a = this, i = 0; i < e.length; i++) { var o = e[i]; a.drawCachedElement(t, o, r, n); } }; on.drawCachedNodes = function(t, e, r, n) { for (var a = this, i = 0; i < e.length; i++) { var o = e[i]; o.isNode() && a.drawCachedElement(t, o, r, n); } }; on.drawLayeredElements = function(t, e, r, n) { var a = this, i = a.data.lyrTxrCache.getLayers(e, r); if (i) for (var o = 0; o < i.length; o++) { var s = i[o], u = s.bb; u.w === 0 || u.h === 0 || t.drawImage(s.canvas, u.x1, u.y1, u.w, u.h); } else a.drawCachedElements(t, e, r, n); }; var En = {}; En.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, o = this, s = e._private.rscratch; if (!(i && !e.visible()) && !(s.badLine || s.allpts == null || isNaN(s.allpts[0]))) { var u; r && (u = r, t.translate(-u.x1, -u.y1)); var l = i ? e.pstyle("opacity").value : 1, c = i ? e.pstyle("line-opacity").value : 1, d = e.pstyle("curve-style").value, v = e.pstyle("line-style").value, h = e.pstyle("width").pfValue, f = e.pstyle("line-cap").value, p = e.pstyle("line-outline-width").value, m = e.pstyle("line-outline-color").value, g = l * c, y = l * c, b = function() { var B = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : g; d === "straight-triangle" ? (o.eleStrokeStyle(t, e, B), o.drawEdgeTrianglePath(e, t, s.allpts)) : (t.lineWidth = h, t.lineCap = f, o.eleStrokeStyle(t, e, B), o.drawEdgePath(e, t, s.allpts, v), t.lineCap = "butt"); }, w = function() { var B = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : g; if (t.lineWidth = h + p, t.lineCap = f, p > 0) o.colorStrokeStyle(t, m[0], m[1], m[2], B); else { t.lineCap = "butt"; return; } d === "straight-triangle" ? o.drawEdgeTrianglePath(e, t, s.allpts) : (o.drawEdgePath(e, t, s.allpts, v), t.lineCap = "butt"); }, C = function() { a && o.drawEdgeOverlay(t, e); }, E = function() { a && o.drawEdgeUnderlay(t, e); }, x = function() { var B = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : y; o.drawArrowheads(t, e, B); }, T = function() { o.drawElementText(t, e, null, n); }; t.lineJoin = "round"; var k = e.pstyle("ghost").value === "yes"; if (k) { var _ = e.pstyle("ghost-offset-x").pfValue, D = e.pstyle("ghost-offset-y").pfValue, O = e.pstyle("ghost-opacity").value, F = g * O; t.translate(_, D), b(F), x(F), t.translate(-_, -D); } else w(); E(), b(), x(), C(), T(), r && t.translate(u.x1, u.y1); } }; var bg = 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, o = i.usePaths(), s = n._private.rscratch, u = n.pstyle("".concat(e, "-padding")).pfValue, l = 2 * u, c = n.pstyle("".concat(e, "-color")).value; r.lineWidth = l, s.edgeType === "self" && !o ? r.lineCap = "butt" : r.lineCap = "round", i.colorStrokeStyle(r, c[0], c[1], c[2], a), i.drawEdgePath(n, r, s.allpts, "solid"); } } }; }; En.drawEdgeOverlay = bg("overlay"); En.drawEdgeUnderlay = bg("underlay"); En.drawEdgePath = function(t, e, r, n) { var a = t._private.rscratch, i = e, o, s = !1, u = this.usePaths(), l = t.pstyle("line-dash-pattern").pfValue, c = t.pstyle("line-dash-offset").pfValue; if (u) { var d = r.join("$"), v = a.pathCacheKey && a.pathCacheKey === d; v ? (o = e = a.pathCache, s = !0) : (o = e = new Path2D(), a.pathCacheKey = d, a.pathCache = o); } if (i.setLineDash) switch (n) { case "dotted": i.setLineDash([1, 1]); break; case "dashed": i.setLineDash(l), i.lineDashOffset = c; break; case "solid": i.setLineDash([]); break; } if (!s && !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 h = 2; h + 3 < r.length; h += 4) e.quadraticCurveTo(r[h], r[h + 1], r[h + 2], r[h + 3]); break; case "straight": case "haystack": for (var f = 2; f + 1 < r.length; f += 2) e.lineTo(r[f], r[f + 1]); break; case "segments": if (a.isRound) { var p = Wh(a.roundCorners), m; try { for (p.s(); !(m = p.n()).done; ) { var g = m.value; lg(e, g); } } catch (b) { p.e(b); } finally { p.f(); } e.lineTo(r[r.length - 2], r[r.length - 1]); } else for (var y = 2; y + 1 < r.length; y += 2) e.lineTo(r[y], r[y + 1]); break; } e = i, u ? e.stroke(o) : e.stroke(), e.setLineDash && e.setLineDash([]); }; En.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]], o = Math.sqrt(i[0] * i[0] + i[1] * i[1]), s = [i[1] / o, -i[0] / o], u = [s[0] * n / 2, s[1] * n / 2]; e.beginPath(), e.moveTo(r[a] - u[0], r[a + 1] - u[1]), e.lineTo(r[a] + u[0], r[a + 1] + u[1]), e.lineTo(r[a + 2], r[a + 3]), e.closePath(), e.fill(); } }; En.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); }; En.drawArrowhead = function(t, e, r, n, a, i, o) { if (!(isNaN(n) || n == null || isNaN(a) || a == null || isNaN(i) || i == null)) { var s = this, u = e.pstyle(r + "-arrow-shape").value; if (u !== "none") { var l = e.pstyle(r + "-arrow-fill").value === "hollow" ? "both" : "filled", c = e.pstyle(r + "-arrow-fill").value, d = e.pstyle("width").pfValue, v = e.pstyle(r + "-arrow-width"), h = v.value === "match-line" ? d : v.pfValue; v.units === "%" && (h *= d); var f = e.pstyle("opacity").value; o === void 0 && (o = f); var p = t.globalCompositeOperation; (o !== 1 || c === "hollow") && (t.globalCompositeOperation = "destination-out", s.colorFillStyle(t, 255, 255, 255, 1), s.colorStrokeStyle(t, 255, 255, 255, 1), s.drawArrowShape(e, t, l, d, u, h, n, a, i), t.globalCompositeOperation = p); var m = e.pstyle(r + "-arrow-color").value; s.colorFillStyle(t, m[0], m[1], m[2], o), s.colorStrokeStyle(t, m[0], m[1], m[2], o), s.drawArrowShape(e, t, c, d, u, h, n, a, i); } } }; En.drawArrowShape = function(t, e, r, n, a, i, o, s, u) { var l = this, c = this.usePaths() && a !== "triangle-cross", d = !1, v, h = e, f = { x: o, y: s }, p = t.pstyle("arrow-scale").value, m = this.getArrowWidth(n, p), g = l.arrowShapes[a]; if (c) { var y = l.arrowPathCache = l.arrowPathCache || [], b = ma(a), w = y[b]; w != null ? (v = e = w, d = !0) : (v = e = new Path2D(), y[b] = v); } d || (e.beginPath && e.beginPath(), c ? g.draw(e, 1, 0, { x: 0, y: 0 }, 1) : g.draw(e, m, u, f, n), e.closePath && e.closePath()), e = h, c && (e.translate(o, s), e.rotate(u), e.scale(m, m)), (r === "filled" || r === "both") && (c ? e.fill(v) : e.fill()), (r === "hollow" || r === "both") && (e.lineWidth = i / (c ? m : 1), e.lineJoin = "miter", c ? e.stroke(v) : e.stroke()), c && (e.scale(1 / m, 1 / m), e.rotate(-u), e.translate(-o, -s)); }; var Dc = {}; Dc.safeDrawImage = function(t, e, r, n, a, i, o, s, u, l) { if (!(a <= 0 || i <= 0 || u <= 0 || l <= 0)) try { t.drawImage(e, r, n, a, i, o, s, u, l); } catch (c) { tt(c); } }; Dc.drawInscribedImage = function(t, e, r, n, a) { var i = this, o = r.position(), s = o.x, u = o.y, l = r.cy().style(), c = l.getIndexedStyle.bind(l), d = c(r, "background-fit", "value", n), v = c(r, "background-repeat", "value", n), h = r.width(), f = r.height(), p = r.padding() * 2, m = h + (c(r, "background-width-relative-to", "value", n) === "inner" ? 0 : p), g = f + (c(r, "background-height-relative-to", "value", n) === "inner" ? 0 : p), y = r._private.rscratch, b = c(r, "background-clip", "value", n), w = b === "node", C = c(r, "background-image-opacity", "value", n) * a, E = c(r, "background-image-smoothing", "value", n), x = r.pstyle("corner-radius").value; x !== "auto" && (x = r.pstyle("corner-radius").pfValue); var T = e.width || e.cachedW, k = e.height || e.cachedH; (T == null || k == null) && (document.body.appendChild(e), T = e.cachedW = e.width || e.offsetWidth, k = e.cachedH = e.height || e.offsetHeight, document.body.removeChild(e)); var _ = T, D = k; if (c(r, "background-width", "value", n) !== "auto" && (c(r, "background-width", "units", n) === "%" ? _ = c(r, "background-width", "pfValue", n) * m : _ = c(r, "background-width", "pfValue", n)), c(r, "background-height", "value", n) !== "auto" && (c(r, "background-height", "units", n) === "%" ? D = c(r, "background-height", "pfValue", n) * g : D = c(r, "background-height", "pfValue", n)), !(_ === 0 || D === 0)) { if (d === "contain") { var O = Math.min(m / _, g / D); _ *= O, D *= O; } else if (d === "cover") { var O = Math.max(m / _, g / D); _ *= O, D *= O; } var F = s - m / 2, L = c(r, "background-position-x", "units", n), B = c(r, "background-position-x", "pfValue", n); L === "%" ? F += (m - _) * B : F += B; var I = c(r, "background-offset-x", "units", n), M = c(r, "background-offset-x", "pfValue", n); I === "%" ? F += (m - _) * M : F += M; var A = u - g / 2, R = c(r, "background-position-y", "units", n), K = c(r, "background-position-y", "pfValue", n); R === "%" ? A += (g - D) * K : A += K; var H = c(r, "background-offset-y", "units", n), q = c(r, "background-offset-y", "pfValue", n); H === "%" ? A += (g - D) * q : A += q, y.pathCache && (F -= s, A -= u, s = 0, u = 0); var ee = t.globalAlpha; t.globalAlpha = C; var se = i.getImgSmoothing(t), oe = !1; if (E === "no" && se ? (i.setImgSmoothing(t, !1), oe = !0) : E === "yes" && !se && (i.setImgSmoothing(t, !0), oe = !0), v === "no-repeat") w && (t.save(), y.pathCache ? t.clip(y.pathCache) : (i.nodeShapes[i.getNodeShape(r)].draw(t, s, u, m, g, x, y), t.clip())), i.safeDrawImage(t, e, 0, 0, T, k, F, A, _, D), w && t.restore(); else { var ne = t.createPattern(e, v); t.fillStyle = ne, i.nodeShapes[i.getNodeShape(r)].draw(t, s, u, m, g, x, y), t.translate(F, A), t.fill(), t.translate(-F, -A); } t.globalAlpha = ee, oe && i.setImgSmoothing(t, se); } }; var Pa = {}; Pa.eleTextBiggerThanMin = function(t, e) { if (!e) { var r = t.cy().zoom(), n = this.getPixelRatio(), a = Math.ceil(fc(r * n)); e = Math.pow(2, a); } var i = t.pstyle("font-size").pfValue * e, o = t.pstyle("min-zoomed-font-size").pfValue; return !(i < o); }; Pa.drawElementText = function(t, e, r, n, a) { var i = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : !0, o = this; if (n == null) { if (i && !o.eleTextBiggerThanMin(e)) return; } else if (n === !1) return; if (e.isNode()) { var s = e.pstyle("label"); if (!s || !s.value) return; var u = o.getLabelJustification(e); t.textAlign = u, t.textBaseline = "bottom"; } else { var l = e.element()._private.rscratch.badLine, c = e.pstyle("label"), d = e.pstyle("source-label"), v = e.pstyle("target-label"); if (l || (!c || !c.value) && (!d || !d.value) && (!v || !v.value)) return; t.textAlign = "center", t.textBaseline = "bottom"; } var h = !r, f; r && (f = r, t.translate(-f.x1, -f.y1)), a == null ? (o.drawText(t, e, null, h, i), e.isEdge() && (o.drawText(t, e, "source", h, i), o.drawText(t, e, "target", h, i))) : o.drawText(t, e, a, h, i), r && t.translate(f.x1, f.y1); }; Pa.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; }; Pa.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, o = e.pstyle("font-weight").strValue, s = r ? e.effectiveOpacity() * e.pstyle("text-opacity").value : 1, u = e.pstyle("text-outline-opacity").value * s, l = e.pstyle("color").value, c = e.pstyle("text-outline-color").value; t.font = n + " " + o + " " + a + " " + i, t.lineJoin = "round", this.colorFillStyle(t, l[0], l[1], l[2], s), this.colorStrokeStyle(t, c[0], c[1], c[2], u); }; function Ul(t, e, r, n, a) { var i = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : 5, o = arguments.length > 6 ? arguments[6] : void 0; t.beginPath(), t.moveTo(e + i, r), t.lineTo(e + n - i, r), t.quadraticCurveTo(e + n, r, e + n, r + i), t.lineTo(e + n, r + a - i), t.quadraticCurveTo(e + n, r + a, e + n - i, r + a), t.lineTo(e + i, r + a), t.quadraticCurveTo(e, r + a, e, r + a - i), t.lineTo(e, r + i), t.quadraticCurveTo(e, r, e + i, r), t.closePath(), o ? t.stroke() : t.fill(); } Pa.getTextAngle = function(t, e) { var r, n = t._private, a = n.rscratch, i = e ? e + "-" : "", o = t.pstyle(i + "text-rotation"), s = Nr(a, "labelAngle", e); return o.strValue === "autorotate" ? r = t.isEdge() ? s : 0 : o.strValue === "none" ? r = 0 : r = o.pfValue, r; }; Pa.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, o = i.rscratch, s = a ? e.effectiveOpacity() : 1; if (!(a && (s === 0 || e.pstyle("text-opacity").value === 0))) { r === "main" && (r = null); var u = Nr(o, "labelX", r), l = Nr(o, "labelY", r), c, d, v = this.getLabelText(e, r); if (v != null && v !== "" && !isNaN(u) && !isNaN(l)) { this.setupTextStyle(t, e, a); var h = r ? r + "-" : "", f = Nr(o, "labelWidth", r), p = Nr(o, "labelHeight", r), m = e.pstyle(h + "text-margin-x").pfValue, g = e.pstyle(h + "text-margin-y").pfValue, y = e.isEdge(), b = e.pstyle("text-halign").value, w = e.pstyle("text-valign").value; y && (b = "center", w = "center"), u += m, l += g; var C; switch (n ? C = this.getTextAngle(e, r) : C = 0, C !== 0 && (c = u, d = l, t.translate(c, d), t.rotate(C), u = 0, l = 0), w) { case "top": break; case "center": l += p / 2; break; case "bottom": l += p; break; } var E = e.pstyle("text-background-opacity").value, x = e.pstyle("text-border-opacity").value, T = e.pstyle("text-border-width").pfValue, k = e.pstyle("text-background-padding").pfValue, _ = e.pstyle("text-background-shape").strValue, D = _.indexOf("round") === 0, O = 2; if (E > 0 || T > 0 && x > 0) { var F = u - k; switch (b) { case "left": F -= f; break; case "center": F -= f / 2; break; } var L = l - p - k, B = f + 2 * k, I = p + 2 * k; if (E > 0) { var M = t.fillStyle, A = e.pstyle("text-background-color").value; t.fillStyle = "rgba(" + A[0] + "," + A[1] + "," + A[2] + "," + E * s + ")", D ? Ul(t, F, L, B, I, O) : t.fillRect(F, L, B, I), t.fillStyle = M; } if (T > 0 && x > 0) { var R = t.strokeStyle, K = t.lineWidth, H = e.pstyle("text-border-color").value, q = e.pstyle("text-border-style").value; if (t.strokeStyle = "rgba(" + H[0] + "," + H[1] + "," + H[2] + "," + x * s + ")", t.lineWidth = T, t.setLineDash) switch (q) { 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": t.setLineDash([]); break; } if (D ? Ul(t, F, L, B, I, O, "stroke") : t.strokeRect(F, L, B, I), q === "double") { var ee = T / 2; D ? Ul(t, F + ee, L + ee, B - ee * 2, I - ee * 2, O, "stroke") : t.strokeRect(F + ee, L + ee, B - ee * 2, I - ee * 2); } t.setLineDash && t.setLineDash([]), t.lineWidth = K, t.strokeStyle = R; } } var se = 2 * e.pstyle("text-outline-width").pfValue; if (se > 0 && (t.lineWidth = se), e.pstyle("text-wrap").value === "wrap") { var oe = Nr(o, "labelWrapCachedLines", r), ne = Nr(o, "labelLineHeight", r), ue = f / 2, te = this.getLabelJustification(e); switch (te === "auto" || (b === "left" ? te === "left" ? u += -f : te === "center" && (u += -ue) : b === "center" ? te === "left" ? u += -ue : te === "right" && (u += ue) : b === "right" && (te === "center" ? u += ue : te === "right" && (u += f))), w) { case "top": l -= (oe.length - 1) * ne; break; case "center": case "bottom": l -= (oe.length - 1) * ne; break; } for (var $ = 0; $ < oe.length; $++) se > 0 && t.strokeText(oe[$], u, l), t.fillText(oe[$], u, l), l += ne; } else se > 0 && t.strokeText(v, u, l), t.fillText(v, u, l); C !== 0 && (t.rotate(-C), t.translate(-c, -d)); } } }; var Ci = {}; Ci.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, o = this, s, u, l = e._private, c = l.rscratch, d = e.position(); if (!(!be(d.x) || !be(d.y)) && !(i && !e.visible())) { var v = i ? e.effectiveOpacity() : 1, h = o.usePaths(), f, p = !1, m = e.padding(); s = e.width() + 2 * m, u = e.height() + 2 * m; var g; r && (g = r, t.translate(-g.x1, -g.y1)); for (var y = e.pstyle("background-image"), b = y.value, w = new Array(b.length), C = new Array(b.length), E = 0, x = 0; x < b.length; x++) { var T = b[x], k = w[x] = T != null && T !== "none"; if (k) { var _ = e.cy().style().getIndexedStyle(e, "background-image-crossorigin", "value", x); E++, C[x] = o.getCachedImage(T, _, function() { l.backgroundTimestamp = Date.now(), e.emitAndNotify("background"); }); } } var D = e.pstyle("background-blacken").value, O = e.pstyle("border-width").pfValue, F = e.pstyle("background-opacity").value * v, L = e.pstyle("border-color").value, B = e.pstyle("border-style").value, I = e.pstyle("border-join").value, M = e.pstyle("border-cap").value, A = e.pstyle("border-position").value, R = e.pstyle("border-dash-pattern").pfValue, K = e.pstyle("border-dash-offset").pfValue, H = e.pstyle("border-opacity").value * v, q = e.pstyle("outline-width").pfValue, ee = e.pstyle("outline-color").value, se = e.pstyle("outline-style").value, oe = e.pstyle("outline-opacity").value * v, ne = e.pstyle("outline-offset").value, ue = e.pstyle("corner-radius").value; ue !== "auto" && (ue = e.pstyle("corner-radius").pfValue); var te = function() { var pe = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : F; o.eleFillStyle(t, e, pe); }, $ = function() { var pe = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : H; o.colorStrokeStyle(t, L[0], L[1], L[2], pe); }, G = function() { var pe = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : oe; o.colorStrokeStyle(t, ee[0], ee[1], ee[2], pe); }, Q = function(pe, re, ve, Ae) { var Me = o.nodePathCache = o.nodePathCache || [], _e = op(ve === "polygon" ? ve + "," + Ae.join(",") : ve, "" + re, "" + pe, "" + ue), Ne = Me[_e], Te, Oe = !1; return Ne != null ? (Te = Ne, Oe = !0, c.pathCache = Te) : (Te = new Path2D(), Me[_e] = c.pathCache = Te), { path: Te, cacheHit: Oe }; }, ge = e.pstyle("shape").strValue, Ee = e.pstyle("shape-polygon-points").pfValue; if (h) { t.translate(d.x, d.y); var fe = Q(s, u, ge, Ee); f = fe.path, p = fe.cacheHit; } var me = function() { if (!p) { var pe = d; h && (pe = { x: 0, y: 0 }), o.nodeShapes[o.getNodeShape(e)].draw(f || t, pe.x, pe.y, s, u, ue, c); } h ? t.fill(f) : t.fill(); }, xe = function() { for (var pe = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : v, re = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !0, ve = l.backgrounding, Ae = 0, Me = 0; Me < C.length; Me++) { var _e = e.cy().style().getIndexedStyle(e, "background-image-containment", "value", Me); if (re && _e === "over" || !re && _e === "inside") { Ae++; continue; } w[Me] && C[Me].complete && !C[Me].error && (Ae++, o.drawInscribedImage(t, C[Me], e, Me, pe)); } l.backgrounding = Ae !== E, ve !== l.backgrounding && e.updateStyle(!1); }, ke = function() { var pe = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : !1, re = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : v; o.hasPie(e) && (o.drawPie(t, e, re), pe && (h || o.nodeShapes[o.getNodeShape(e)].draw(t, d.x, d.y, s, u, ue, c))); }, Ce = function() { var pe = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : v, re = (D > 0 ? D : -D) * pe, ve = D > 0 ? 0 : 255; D !== 0 && (o.colorFillStyle(t, ve, ve, ve, re), h ? t.fill(f) : t.fill()); }, De = function() { if (O > 0) { if (t.lineWidth = O, t.lineCap = M, t.lineJoin = I, t.setLineDash) switch (B) { case "dotted": t.setLineDash([1, 1]); break; case "dashed": t.setLineDash(R), t.lineDashOffset = K; break; case "solid": case "double": t.setLineDash([]); break; } if (A !== "center") { if (t.save(), t.lineWidth *= 2, A === "inside") h ? t.clip(f) : t.clip(); else { var pe = new Path2D(); pe.rect(-s / 2 - O, -u / 2 - O, s + 2 * O, u + 2 * O), pe.addPath(f), t.clip(pe, "evenodd"); } h ? t.stroke(f) : t.stroke(), t.restore(); } else h ? t.stroke(f) : t.stroke(); if (B === "double") { t.lineWidth = O / 3; var re = t.globalCompositeOperation; t.globalCompositeOperation = "destination-out", h ? t.stroke(f) : t.stroke(), t.globalCompositeOperation = re; } t.setLineDash && t.setLineDash([]); } }, qe = function() { if (q > 0) { if (t.lineWidth = q, t.lineCap = "butt", t.setLineDash) switch (se) { case "dotted": t.setLineDash([1, 1]); break; case "dashed": t.setLineDash([4, 2]); break; case "solid": case "double": t.setLineDash([]); break; } var pe = d; h && (pe = { x: 0, y: 0 }); var re = o.getNodeShape(e), ve = O; A === "inside" && (ve = 0), A === "outside" && (ve *= 2); var Ae = (s + ve + (q + ne)) / s, Me = (u + ve + (q + ne)) / u, _e = s * Ae, Ne = u * Me, Te = o.nodeShapes[re].points, Oe; if (h) { var ut = Q(_e, Ne, re, Te); Oe = ut.path; } if (re === "ellipse") o.drawEllipsePath(Oe || t, pe.x, pe.y, _e, Ne); else if (["round-diamond", "round-heptagon", "round-hexagon", "round-octagon", "round-pentagon", "round-polygon", "round-triangle", "round-tag"].includes(re)) { var nt = 0, kt = 0, St = 0; re === "round-diamond" ? nt = (ve + ne + q) * 1.4 : re === "round-heptagon" ? (nt = (ve + ne + q) * 1.075, St = -(ve / 2 + ne + q) / 35) : re === "round-hexagon" ? nt = (ve + ne + q) * 1.12 : re === "round-pentagon" ? (nt = (ve + ne + q) * 1.13, St = -(ve / 2 + ne + q) / 15) : re === "round-tag" ? (nt = (ve + ne + q) * 1.12, kt = (ve / 2 + q + ne) * 0.07) : re === "round-triangle" && (nt = (ve + ne + q) * (Math.PI / 2), St = -(ve + ne / 2 + q) / Math.PI), nt !== 0 && (Ae = (s + nt) / s, _e = s * Ae, ["round-hexagon", "round-tag"].includes(re) || (Me = (u + nt) / u, Ne = u * Me)), ue = ue === "auto" ? mp(_e, Ne) : ue; for (var wt = _e / 2, Zt = Ne / 2, Pt = ue + (ve + q + ne) / 2, Mt = new Array(Te.length / 2), gr = new Array(Te.length / 2), Xt = 0; Xt < Te.length / 2; Xt++) Mt[Xt] = { x: pe.x + kt + wt * Te[Xt * 2], y: pe.y + St + Zt * Te[Xt * 2 + 1] }; var jt, wr, Pr, ur, xt = Mt.length; for (wr = Mt[xt - 1], jt = 0; jt < xt; jt++) Pr = Mt[jt % xt], ur = Mt[(jt + 1) % xt], gr[jt] = Tc(wr, Pr, ur, Pt), wr = Pr, Pr = ur; o.drawRoundPolygonPath(Oe || t, pe.x + kt, pe.y + St, s * Ae, u * Me, Te, gr); } else if (["roundrectangle", "round-rectangle"].includes(re)) ue = ue === "auto" ? ba(_e, Ne) : ue, o.drawRoundRectanglePath(Oe || t, pe.x, pe.y, _e, Ne, ue + (ve + q + ne) / 2); else if (["cutrectangle", "cut-rectangle"].includes(re)) ue = ue === "auto" ? hc() : ue, o.drawCutRectanglePath(Oe || t, pe.x, pe.y, _e, Ne, null, ue + (ve + q + ne) / 4); else if (["bottomroundrectangle", "bottom-round-rectangle"].includes(re)) ue = ue === "auto" ? ba(_e, Ne) : ue, o.drawBottomRoundRectanglePath(Oe || t, pe.x, pe.y, _e, Ne, ue + (ve + q + ne) / 2); else if (re === "barrel") o.drawBarrelPath(Oe || t, pe.x, pe.y, _e, Ne); else if (re.startsWith("polygon") || ["rhomboid", "right-rhomboid", "round-tag", "tag", "vee"].includes(re)) { var Tt = (ve + q + ne) / s; Te = Ls(Is(Te, Tt)), o.drawPolygonPath(Oe || t, pe.x, pe.y, s, u, Te); } else { var Bt = (ve + q + ne) / s; Te = Ls(Is(Te, -Bt)), o.drawPolygonPath(Oe || t, pe.x, pe.y, s, u, Te); } if (h ? t.stroke(Oe) : t.stroke(), se === "double") { t.lineWidth = ve / 3; var kn = t.globalCompositeOperation; t.globalCompositeOperation = "destination-out", h ? t.stroke(Oe) : t.stroke(), t.globalCompositeOperation = kn; } t.setLineDash && t.setLineDash([]); } }, Ke = function() { a && o.drawNodeOverlay(t, e, d, s, u); }, Be = function() { a && o.drawNodeUnderlay(t, e, d, s, u); }, Ge = function() { o.drawElementText(t, e, null, n); }, le = e.pstyle("ghost").value === "yes"; if (le) { var S = e.pstyle("ghost-offset-x").pfValue, z = e.pstyle("ghost-offset-y").pfValue, ae = e.pstyle("ghost-opacity").value, j = ae * v; t.translate(S, z), G(), qe(), te(ae * F), me(), xe(j, !0), $(ae * H), De(), ke(D !== 0 || O !== 0), xe(j, !1), Ce(j), t.translate(-S, -z); } h && t.translate(-d.x, -d.y), Be(), h && t.translate(d.x, d.y), G(), qe(), te(), me(), xe(v, !0), $(), De(), ke(D !== 0 || O !== 0), xe(v, !1), Ce(), h && t.translate(-d.x, -d.y), Ge(), Ke(), r && t.translate(g.x1, g.y1); } }; var wg = function(e) { if (!["overlay", "underlay"].includes(e)) throw new Error("Invalid state"); return function(r, n, a, i, o) { var s = this; if (n.visible()) { var u = n.pstyle("".concat(e, "-padding")).pfValue, l = n.pstyle("".concat(e, "-opacity")).value, c = n.pstyle("".concat(e, "-color")).value, d = n.pstyle("".concat(e, "-shape")).value, v = n.pstyle("".concat(e, "-corner-radius")).value; if (l > 0) { if (a = a || n.position(), i == null || o == null) { var h = n.padding(); i = n.width() + 2 * h, o = n.height() + 2 * h; } s.colorFillStyle(r, c[0], c[1], c[2], l), s.nodeShapes[d].draw(r, a.x, a.y, i + u * 2, o + u * 2, v), r.fill(); } } }; }; Ci.drawNodeOverlay = wg("overlay"); Ci.drawNodeUnderlay = wg("underlay"); Ci.hasPie = function(t) { return t = t[0], t._private.hasPie; }; Ci.drawPie = function(t, e, r, n) { e = e[0], n = n || e.position(); var a = e.cy().style(), i = e.pstyle("pie-size"), o = n.x, s = n.y, u = e.width(), l = e.height(), c = Math.min(u, l) / 2, d = 0, v = this.usePaths(); v && (o = 0, s = 0), i.units === "%" ? c = c * i.pfValue : i.pfValue !== void 0 && (c = i.pfValue / 2); for (var h = 1; h <= a.pieBackgroundN; h++) { var f = e.pstyle("pie-" + h + "-background-size").value, p = e.pstyle("pie-" + h + "-background-color").value, m = e.pstyle("pie-" + h + "-background-opacity").value * r, g = f / 100; g + d > 1 && (g = 1 - d); var y = 1.5 * Math.PI + 2 * Math.PI * d, b = 2 * Math.PI * g, w = y + b; f === 0 || d >= 1 || d + g > 1 || (t.beginPath(), t.moveTo(o, s), t.arc(o, s, c, y, w), t.closePath(), this.colorFillStyle(t, p[0], p[1], p[2], m), t.fill(), d += g); } }; var br = {}, kO = 100; br.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; }; br.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; }; br.createGradientStyleFor = function(t, e, r, n, a) { var i, o = this.usePaths(), s = r.pstyle(e + "-gradient-stop-colors").value, u = r.pstyle(e + "-gradient-stop-positions").pfValue; if (n === "radial-gradient") if (r.isEdge()) { var l = r.sourceEndpoint(), c = r.targetEndpoint(), d = r.midpoint(), v = ya(l, d), h = ya(c, d); i = t.createRadialGradient(d.x, d.y, 0, d.x, d.y, Math.max(v, h)); } else { var f = o ? { x: 0, y: 0 } : r.position(), p = r.paddedWidth(), m = r.paddedHeight(); i = t.createRadialGradient(f.x, f.y, 0, f.x, f.y, Math.max(p, m)); } else if (r.isEdge()) { var g = r.sourceEndpoint(), y = r.targetEndpoint(); i = t.createLinearGradient(g.x, g.y, y.x, y.y); } else { var b = o ? { x: 0, y: 0 } : r.position(), w = r.paddedWidth(), C = r.paddedHeight(), E = w / 2, x = C / 2, T = r.pstyle("background-gradient-direction").value; switch (T) { case "to-bottom": i = t.createLinearGradient(b.x, b.y - x, b.x, b.y + x); break; case "to-top": i = t.createLinearGradient(b.x, b.y + x, b.x, b.y - x); break; case "to-left": i = t.createLinearGradient(b.x + E, b.y, b.x - E, b.y); break; case "to-right": i = t.createLinearGradient(b.x - E, b.y, b.x + E, b.y); break; case "to-bottom-right": case "to-right-bottom": i = t.createLinearGradient(b.x - E, b.y - x, b.x + E, b.y + x); break; case "to-top-right": case "to-right-top": i = t.createLinearGradient(b.x - E, b.y + x, b.x + E, b.y - x); break; case "to-bottom-left": case "to-left-bottom": i = t.createLinearGradient(b.x + E, b.y - x, b.x - E, b.y + x); break; case "to-top-left": case "to-left-top": i = t.createLinearGradient(b.x + E, b.y + x, b.x - E, b.y - x); break; } } if (!i) return null; for (var k = u.length === s.length, _ = s.length, D = 0; D < _; D++) i.addColorStop(k ? u[D] : D / (_ - 1), "rgba(" + s[D][0] + "," + s[D][1] + "," + s[D][2] + "," + a + ")"); return i; }; br.gradientFillStyle = function(t, e, r, n) { var a = this.createGradientStyleFor(t, "background", e, r, n); if (!a) return null; t.fillStyle = a; }; br.colorFillStyle = function(t, e, r, n, a) { t.fillStyle = "rgba(" + e + "," + r + "," + n + "," + a + ")"; }; br.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); } }; br.gradientStrokeStyle = function(t, e, r, n) { var a = this.createGradientStyleFor(t, "line", e, r, n); if (!a) return null; t.strokeStyle = a; }; br.colorStrokeStyle = function(t, e, r, n, a) { t.strokeStyle = "rgba(" + e + "," + r + "," + n + "," + a + ")"; }; br.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); } }; br.matchCanvasSize = function(t) { var e = this, r = e.data, n = e.findContainerClientCoords(), a = n[2], i = n[3], o = e.getPixelRatio(), s = e.motionBlurPxRatio; (t === e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_NODE] || t === e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_DRAG]) && (o = s); var u = a * o, l = i * o, c; if (!(u === e.canvasWidth && l === e.canvasHeight)) { e.fontCaches = null; var d = r.canvasContainer; d.style.width = a + "px", d.style.height = i + "px"; for (var v = 0; v < e.CANVAS_LAYERS; v++) c = r.canvases[v], c.width = u, c.height = l, c.style.width = a + "px", c.style.height = i + "px"; for (var v = 0; v < e.BUFFER_COUNT; v++) c = r.bufferCanvases[v], c.width = u, c.height = l, c.style.width = a + "px", c.style.height = i + "px"; e.textureMult = 1, o <= 1 && (c = r.bufferCanvases[e.TEXTURE_BUFFER], e.textureMult = 2, c.width = u * e.textureMult, c.height = l * e.textureMult), e.canvasWidth = u, e.canvasHeight = l; } }; br.renderTo = function(t, e, r, n) { this.render({ forcedContext: t, forcedZoom: e, forcedPan: r, drawAllLayers: !0, forcedPxRatio: n }); }; br.render = function(t) { t = t || cp(); var e = t.forcedContext, r = t.drawAllLayers, n = t.drawOnlyNodeLayer, a = t.forcedZoom, i = t.forcedPan, o = this, s = t.forcedPxRatio === void 0 ? this.getPixelRatio() : t.forcedPxRatio, u = o.cy, l = o.data, c = l.canvasNeedsRedraw, d = o.textureOnViewport && !e && (o.pinching || o.hoverData.dragging || o.swipePanning || o.data.wheelZooming), v = t.motionBlur !== void 0 ? t.motionBlur : o.motionBlur, h = o.motionBlurPxRatio, f = u.hasCompoundNodes(), p = o.hoverData.draggingEles, m = !!(o.hoverData.selecting || o.touchData.selecting); v = v && !e && o.motionBlurEnabled && !m; var g = v; e || (o.prevPxRatio !== s && (o.invalidateContainerClientCoordsCache(), o.matchCanvasSize(o.container), o.redrawHint("eles", !0), o.redrawHint("drag", !0)), o.prevPxRatio = s), !e && o.motionBlurTimeout && clearTimeout(o.motionBlurTimeout), v && (o.mbFrames == null && (o.mbFrames = 0), o.mbFrames++, o.mbFrames < 3 && (g = !1), o.mbFrames > o.minMbLowQualFrames && (o.motionBlurPxRatio = o.mbPxRBlurry)), o.clearingMotionBlur && (o.motionBlurPxRatio = 1), o.textureDrawLastFrame && !d && (c[o.NODE] = !0, c[o.SELECT_BOX] = !0); var y = u.style(), b = u.zoom(), w = a !== void 0 ? a : b, C = u.pan(), E = { x: C.x, y: C.y }, x = { zoom: b, pan: { x: C.x, y: C.y } }, T = o.prevViewport, k = T === void 0 || x.zoom !== T.zoom || x.pan.x !== T.pan.x || x.pan.y !== T.pan.y; !k && !(p && !f) && (o.motionBlurPxRatio = 1), i && (E = i), w *= s, E.x *= s, E.y *= s; var _ = o.getCachedZSortedEles(); function D(fe, me, xe, ke, Ce) { var De = fe.globalCompositeOperation; fe.globalCompositeOperation = "destination-out", o.colorFillStyle(fe, 255, 255, 255, o.motionBlurTransparency), fe.fillRect(me, xe, ke, Ce), fe.globalCompositeOperation = De; } function O(fe, me) { var xe, ke, Ce, De; !o.clearingMotionBlur && (fe === l.bufferContexts[o.MOTIONBLUR_BUFFER_NODE] || fe === l.bufferContexts[o.MOTIONBLUR_BUFFER_DRAG]) ? (xe = { x: C.x * h, y: C.y * h }, ke = b * h, Ce = o.canvasWidth * h, De = o.canvasHeight * h) : (xe = E, ke = w, Ce = o.canvasWidth, De = o.canvasHeight), fe.setTransform(1, 0, 0, 1, 0, 0), me === "motionBlur" ? D(fe, 0, 0, Ce, De) : !e && (me === void 0 || me) && fe.clearRect(0, 0, Ce, De), r || (fe.translate(xe.x, xe.y), fe.scale(ke, ke)), i && fe.translate(i.x, i.y), a && fe.scale(a, a); } if (d || (o.textureDrawLastFrame = !1), d) { if (o.textureDrawLastFrame = !0, !o.textureCache) { o.textureCache = {}, o.textureCache.bb = u.mutableElements().boundingBox(), o.textureCache.texture = o.data.bufferCanvases[o.TEXTURE_BUFFER]; var F = o.data.bufferContexts[o.TEXTURE_BUFFER]; F.setTransform(1, 0, 0, 1, 0, 0), F.clearRect(0, 0, o.canvasWidth * o.textureMult, o.canvasHeight * o.textureMult), o.render({ forcedContext: F, drawOnlyNodeLayer: !0, forcedPxRatio: s * o.textureMult }); var x = o.textureCache.viewport = { zoom: u.zoom(), pan: u.pan(), width: o.canvasWidth, height: o.canvasHeight }; x.mpan = { x: (0 - x.pan.x) / x.zoom, y: (0 - x.pan.y) / x.zoom }; } c[o.DRAG] = !1, c[o.NODE] = !1; var L = l.contexts[o.NODE], B = o.textureCache.texture, x = o.textureCache.viewport; L.setTransform(1, 0, 0, 1, 0, 0), v ? D(L, 0, 0, x.width, x.height) : L.clearRect(0, 0, x.width, x.height); var I = y.core("outside-texture-bg-color").value, M = y.core("outside-texture-bg-opacity").value; o.colorFillStyle(L, I[0], I[1], I[2], M), L.fillRect(0, 0, x.width, x.height); var b = u.zoom(); O(L, !1), L.clearRect(x.mpan.x, x.mpan.y, x.width / x.zoom / s, x.height / x.zoom / s), L.drawImage(B, x.mpan.x, x.mpan.y, x.width / x.zoom / s, x.height / x.zoom / s); } else o.textureOnViewport && !e && (o.textureCache = null); var A = u.extent(), R = o.pinching || o.hoverData.dragging || o.swipePanning || o.data.wheelZooming || o.hoverData.draggingEles || o.cy.animated(), K = o.hideEdgesOnViewport && R, H = []; if (H[o.NODE] = !c[o.NODE] && v && !o.clearedForMotionBlur[o.NODE] || o.clearingMotionBlur, H[o.NODE] && (o.clearedForMotionBlur[o.NODE] = !0), H[o.DRAG] = !c[o.DRAG] && v && !o.clearedForMotionBlur[o.DRAG] || o.clearingMotionBlur, H[o.DRAG] && (o.clearedForMotionBlur[o.DRAG] = !0), c[o.NODE] || r || n || H[o.NODE]) { var q = v && !H[o.NODE] && h !== 1, L = e || (q ? o.data.bufferContexts[o.MOTIONBLUR_BUFFER_NODE] : l.contexts[o.NODE]), ee = v && !q ? "motionBlur" : void 0; O(L, ee), K ? o.drawCachedNodes(L, _.nondrag, s, A) : o.drawLayeredElements(L, _.nondrag, s, A), o.debug && o.drawDebugPoints(L, _.nondrag), !r && !v && (c[o.NODE] = !1); } if (!n && (c[o.DRAG] || r || H[o.DRAG])) { var q = v && !H[o.DRAG] && h !== 1, L = e || (q ? o.data.bufferContexts[o.MOTIONBLUR_BUFFER_DRAG] : l.contexts[o.DRAG]); O(L, v && !q ? "motionBlur" : void 0), K ? o.drawCachedNodes(L, _.drag, s, A) : o.drawCachedElements(L, _.drag, s, A), o.debug && o.drawDebugPoints(L, _.drag), !r && !v && (c[o.DRAG] = !1); } if (o.showFps || !n && c[o.SELECT_BOX] && !r) { var L = e || l.contexts[o.SELECT_BOX]; if (O(L), o.selection[4] == 1 && (o.hoverData.selecting || o.touchData.selecting)) { var b = o.cy.zoom(), se = y.core("selection-box-border-width").value / b; L.lineWidth = se, L.fillStyle = "rgba(" + y.core("selection-box-color").value[0] + "," + y.core("selection-box-color").value[1] + "," + y.core("selection-box-color").value[2] + "," + y.core("selection-box-opacity").value + ")", L.fillRect(o.selection[0], o.selection[1], o.selection[2] - o.selection[0], o.selection[3] - o.selection[1]), se > 0 && (L.strokeStyle = "rgba(" + y.core("selection-box-border-color").value[0] + "," + y.core("selection-box-border-color").value[1] + "," + y.core("selection-box-border-color").value[2] + "," + y.core("selection-box-opacity").value + ")", L.strokeRect(o.selection[0], o.selection[1], o.selection[2] - o.selection[0], o.selection[3] - o.selection[1])); } if (l.bgActivePosistion && !o.hoverData.selecting) { var b = o.cy.zoom(), oe = l.bgActivePosistion; L.fillStyle = "rgba(" + y.core("active-bg-color").value[0] + "," + y.core("active-bg-color").value[1] + "," + y.core("active-bg-color").value[2] + "," + y.core("active-bg-opacity").value + ")", L.beginPath(), L.arc(oe.x, oe.y, y.core("active-bg-size").pfValue / b, 0, 2 * Math.PI), L.fill(); } var ne = o.lastRedrawTime; if (o.showFps && ne) { ne = Math.round(ne); var ue = Math.round(1e3 / ne); L.setTransform(1, 0, 0, 1, 0, 0), L.fillStyle = "rgba(255, 0, 0, 0.75)", L.strokeStyle = "rgba(255, 0, 0, 0.75)", L.lineWidth = 1, L.fillText("1 frame = " + ne + " ms = " + ue + " fps", 0, 20); var te = 60; L.strokeRect(0, 30, 250, 20), L.fillRect(0, 30, 250 * Math.min(ue / te, 1), 20); } r || (c[o.SELECT_BOX] = !1); } if (v && h !== 1) { var $ = l.contexts[o.NODE], G = o.data.bufferCanvases[o.MOTIONBLUR_BUFFER_NODE], Q = l.contexts[o.DRAG], ge = o.data.bufferCanvases[o.MOTIONBLUR_BUFFER_DRAG], Ee = function(me, xe, ke) { me.setTransform(1, 0, 0, 1, 0, 0), ke || !g ? me.clearRect(0, 0, o.canvasWidth, o.canvasHeight) : D(me, 0, 0, o.canvasWidth, o.canvasHeight); var Ce = h; me.drawImage( xe, // img 0, 0, // sx, sy o.canvasWidth * Ce, o.canvasHeight * Ce, // sw, sh 0, 0, // x, y o.canvasWidth, o.canvasHeight // w, h ); }; (c[o.NODE] || H[o.NODE]) && (Ee($, G, H[o.NODE]), c[o.NODE] = !1), (c[o.DRAG] || H[o.DRAG]) && (Ee(Q, ge, H[o.DRAG]), c[o.DRAG] = !1); } o.prevViewport = x, o.clearingMotionBlur && (o.clearingMotionBlur = !1, o.motionBlurCleared = !0, o.motionBlur = !0), v && (o.motionBlurTimeout = setTimeout(function() { o.motionBlurTimeout = null, o.clearedForMotionBlur[o.NODE] = !1, o.clearedForMotionBlur[o.DRAG] = !1, o.motionBlur = !1, o.clearingMotionBlur = !d, o.mbFrames = 0, c[o.NODE] = !0, c[o.DRAG] = !0, o.redraw(); }, kO)), e || u.emit("render"); }; var jn = {}; jn.drawPolygonPath = function(t, e, r, n, a, i) { var o = n / 2, s = a / 2; t.beginPath && t.beginPath(), t.moveTo(e + o * i[0], r + s * i[1]); for (var u = 1; u < i.length / 2; u++) t.lineTo(e + o * i[u * 2], r + s * i[u * 2 + 1]); t.closePath(); }; jn.drawRoundPolygonPath = function(t, e, r, n, a, i, o) { o.forEach(function(s) { return lg(t, s); }), t.closePath(); }; jn.drawRoundRectanglePath = function(t, e, r, n, a, i) { var o = n / 2, s = a / 2, u = i === "auto" ? ba(n, a) : Math.min(i, s, o); t.beginPath && t.beginPath(), t.moveTo(e, r - s), t.arcTo(e + o, r - s, e + o, r, u), t.arcTo(e + o, r + s, e, r + s, u), t.arcTo(e - o, r + s, e - o, r, u), t.arcTo(e - o, r - s, e, r - s, u), t.lineTo(e, r - s), t.closePath(); }; jn.drawBottomRoundRectanglePath = function(t, e, r, n, a, i) { var o = n / 2, s = a / 2, u = i === "auto" ? ba(n, a) : i; t.beginPath && t.beginPath(), t.moveTo(e, r - s), t.lineTo(e + o, r - s), t.lineTo(e + o, r), t.arcTo(e + o, r + s, e, r + s, u), t.arcTo(e - o, r + s, e - o, r, u), t.lineTo(e - o, r - s), t.lineTo(e, r - s), t.closePath(); }; jn.drawCutRectanglePath = function(t, e, r, n, a, i, o) { var s = n / 2, u = a / 2, l = o === "auto" ? hc() : o; t.beginPath && t.beginPath(), t.moveTo(e - s + l, r - u), t.lineTo(e + s - l, r - u), t.lineTo(e + s, r - u + l), t.lineTo(e + s, r + u - l), t.lineTo(e + s - l, r + u), t.lineTo(e - s + l, r + u), t.lineTo(e - s, r + u - l), t.lineTo(e - s, r - u + l), t.closePath(); }; jn.drawBarrelPath = function(t, e, r, n, a) { var i = n / 2, o = a / 2, s = e - i, u = e + i, l = r - o, c = r + o, d = lu(n, a), v = d.widthOffset, h = d.heightOffset, f = d.ctrlPtOffsetPct * v; t.beginPath && t.beginPath(), t.moveTo(s, l + h), t.lineTo(s, c - h), t.quadraticCurveTo(s + f, c, s + v, c), t.lineTo(u - v, c), t.quadraticCurveTo(u - f, c, u, c - h), t.lineTo(u, l + h), t.quadraticCurveTo(u - f, l, u - v, l), t.lineTo(s + v, l), t.quadraticCurveTo(s + f, l, s, l + h), t.closePath(); }; var dv = Math.sin(0), fv = Math.cos(0), wu = {}, xu = {}, xg = Math.PI / 40; for (var $a = 0 * Math.PI; $a < 2 * Math.PI; $a += xg) wu[$a] = Math.sin($a), xu[$a] = Math.cos($a); jn.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, o, s = n / 2, u = a / 2, l = 0 * Math.PI; l < 2 * Math.PI; l += xg) i = e - s * wu[l] * dv + s * xu[l] * fv, o = r + u * xu[l] * dv + u * wu[l] * fv, l === 0 ? t.moveTo(i, o) : t.lineTo(i, o); t.closePath(); }; var Mo = {}; Mo.createBuffer = function(t, e) { var r = document.createElement("canvas"); return r.width = t, r.height = e, [r, r.getContext("2d")]; }; Mo.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], o = t.full ? Math.ceil(n.h) : a[3], s = be(t.maxWidth) || be(t.maxHeight), u = this.getPixelRatio(), l = 1; if (t.scale !== void 0) i *= t.scale, o *= t.scale, l = t.scale; else if (s) { var c = 1 / 0, d = 1 / 0; be(t.maxWidth) && (c = l * t.maxWidth / i), be(t.maxHeight) && (d = l * t.maxHeight / o), l = Math.min(c, d), i *= l, o *= l; } s || (i *= u, o *= u, l *= u); var v = document.createElement("canvas"); v.width = i, v.height = o, v.style.width = i + "px", v.style.height = o + "px"; var h = v.getContext("2d"); if (i > 0 && o > 0) { h.clearRect(0, 0, i, o), h.globalCompositeOperation = "source-over"; var f = this.getCachedZSortedEles(); if (t.full) h.translate(-n.x1 * l, -n.y1 * l), h.scale(l, l), this.drawElements(h, f), h.scale(1 / l, 1 / l), h.translate(n.x1 * l, n.y1 * l); else { var p = e.pan(), m = { x: p.x * l, y: p.y * l }; l *= e.zoom(), h.translate(m.x, m.y), h.scale(l, l), this.drawElements(h, f), h.scale(1 / l, 1 / l), h.translate(-m.x, -m.y); } t.bg && (h.globalCompositeOperation = "destination-over", h.fillStyle = t.bg, h.rect(0, 0, i, o), h.fill()); } return v; }; function SO(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 vv(t) { var e = t.indexOf(","); return t.substr(e + 1); } function Cg(t, e, r) { var n = function() { return e.toDataURL(r, t.quality); }; switch (t.output) { case "blob-promise": return new hi(function(a, i) { try { e.toBlob(function(o) { o != null ? a(o) : i(new Error("`canvas.toBlob()` sent a null value in its callback")); }, r, t.quality); } catch (o) { i(o); } }); case "blob": return SO(vv(n()), r); case "base64": return vv(n()); case "base64uri": default: return n(); } } Mo.png = function(t) { return Cg(t, this.bufferCanvasImage(t), "image/png"); }; Mo.jpg = function(t) { return Cg(t, this.bufferCanvasImage(t), "image/jpeg"); }; var Eg = {}; Eg.nodeShapeImpl = function(t, e, r, n, a, i, o, s) { switch (t) { case "ellipse": return this.drawEllipsePath(e, r, n, a, i); case "polygon": return this.drawPolygonPath(e, r, n, a, i, o); case "round-polygon": return this.drawRoundPolygonPath(e, r, n, a, i, o, s); case "roundrectangle": case "round-rectangle": return this.drawRoundRectanglePath(e, r, n, a, i, s); case "cutrectangle": case "cut-rectangle": return this.drawCutRectanglePath(e, r, n, a, i, o, s); case "bottomroundrectangle": case "bottom-round-rectangle": return this.drawBottomRoundRectanglePath(e, r, n, a, i, s); case "barrel": return this.drawBarrelPath(e, r, n, a, i); } }; var TO = kg, je = kg.prototype; je.CANVAS_LAYERS = 3; je.SELECT_BOX = 0; je.DRAG = 1; je.NODE = 2; je.BUFFER_COUNT = 3; je.TEXTURE_BUFFER = 0; je.MOTIONBLUR_BUFFER_NODE = 1; je.MOTIONBLUR_BUFFER_DRAG = 2; function kg(t) { var e = this, r = e.cy.window(), n = r.document; e.data = { canvases: new Array(je.CANVAS_LAYERS), contexts: new Array(je.CANVAS_LAYERS), canvasNeedsRedraw: new Array(je.CANVAS_LAYERS), bufferCanvases: new Array(je.BUFFER_COUNT), bufferContexts: new Array(je.CANVAS_LAYERS) }; var a = "-webkit-tap-highlight-color", i = "rgba(0,0,0,0)"; e.data.canvasContainer = n.createElement("div"); var o = e.data.canvasContainer.style; e.data.canvasContainer.style[a] = i, o.position = "relative", o.zIndex = "0", o.overflow = "hidden"; var s = t.cy.container(); s.appendChild(e.data.canvasContainer), s.style[a] = i; var u = { "-webkit-user-select": "none", "-moz-user-select": "-moz-none", "user-select": "none", "-webkit-tap-highlight-color": "rgba(0,0,0,0)", "outline-style": "none" }; vT() && (u["-ms-touch-action"] = "none", u["touch-action"] = "none"); for (var l = 0; l < je.CANVAS_LAYERS; l++) { var c = e.data.canvases[l] = n.createElement("canvas"); e.data.contexts[l] = c.getContext("2d"), Object.keys(u).forEach(function(te) { c.style[te] = u[te]; }), c.style.position = "absolute", c.setAttribute("data-id", "layer" + l), c.style.zIndex = String(je.CANVAS_LAYERS - l), e.data.canvasContainer.appendChild(c), e.data.canvasNeedsRedraw[l] = !1; } e.data.topCanvas = e.data.canvases[0], e.data.canvases[je.NODE].setAttribute("data-id", "layer" + je.NODE + "-node"), e.data.canvases[je.SELECT_BOX].setAttribute("data-id", "layer" + je.SELECT_BOX + "-selectbox"), e.data.canvases[je.DRAG].setAttribute("data-id", "layer" + je.DRAG + "-drag"); for (var l = 0; l < je.BUFFER_COUNT; l++) e.data.bufferCanvases[l] = n.createElement("canvas"), e.data.bufferContexts[l] = e.data.bufferCanvases[l].getContext("2d"), e.data.bufferCanvases[l].style.position = "absolute", e.data.bufferCanvases[l].setAttribute("data-id", "buffer" + l), e.data.bufferCanvases[l].style.zIndex = String(-l - 1), e.data.bufferCanvases[l].style.visibility = "hidden"; e.pathsEnabled = !0; var d = pr(), v = function($) { return { x: ($.x1 + $.x2) / 2, y: ($.y1 + $.y2) / 2 }; }, h = function($) { return { x: -$.w / 2, y: -$.h / 2 }; }, f = function($) { var G = $[0]._private, Q = G.oldBackgroundTimestamp === G.backgroundTimestamp; return !Q; }, p = function($) { return $[0]._private.nodeKey; }, m = function($) { return $[0]._private.labelStyleKey; }, g = function($) { return $[0]._private.sourceLabelStyleKey; }, y = function($) { return $[0]._private.targetLabelStyleKey; }, b = function($, G, Q, ge, Ee) { return e.drawElement($, G, Q, !1, !1, Ee); }, w = function($, G, Q, ge, Ee) { return e.drawElementText($, G, Q, ge, "main", Ee); }, C = function($, G, Q, ge, Ee) { return e.drawElementText($, G, Q, ge, "source", Ee); }, E = function($, G, Q, ge, Ee) { return e.drawElementText($, G, Q, ge, "target", Ee); }, x = function($) { return $.boundingBox(), $[0]._private.bodyBounds; }, T = function($) { return $.boundingBox(), $[0]._private.labelBounds.main || d; }, k = function($) { return $.boundingBox(), $[0]._private.labelBounds.source || d; }, _ = function($) { return $.boundingBox(), $[0]._private.labelBounds.target || d; }, D = function($, G) { return G; }, O = function($) { return v(x($)); }, F = function($, G, Q) { var ge = $ ? $ + "-" : ""; return { x: G.x + Q.pstyle(ge + "text-margin-x").pfValue, y: G.y + Q.pstyle(ge + "text-margin-y").pfValue }; }, L = function($, G, Q) { var ge = $[0]._private.rscratch; return { x: ge[G], y: ge[Q] }; }, B = function($) { return F("", L($, "labelX", "labelY"), $); }, I = function($) { return F("source", L($, "sourceLabelX", "sourceLabelY"), $); }, M = function($) { return F("target", L($, "targetLabelX", "targetLabelY"), $); }, A = function($) { return h(x($)); }, R = function($) { return h(k($)); }, K = function($) { return h(_($)); }, H = function($) { var G = T($), Q = h(T($)); if ($.isNode()) { switch ($.pstyle("text-halign").value) { case "left": Q.x = -G.w; break; case "right": Q.x = 0; break; } switch ($.pstyle("text-valign").value) { case "top": Q.y = -G.h; break; case "bottom": Q.y = 0; break; } } return Q; }, q = e.data.eleTxrCache = new Ri(e, { getKey: p, doesEleInvalidateKey: f, drawElement: b, getBoundingBox: x, getRotationPoint: O, getRotationOffset: A, allowEdgeTxrCaching: !1, allowParentTxrCaching: !1 }), ee = e.data.lblTxrCache = new Ri(e, { getKey: m, drawElement: w, getBoundingBox: T, getRotationPoint: B, getRotationOffset: H, isVisible: D }), se = e.data.slbTxrCache = new Ri(e, { getKey: g, drawElement: C, getBoundingBox: k, getRotationPoint: I, getRotationOffset: R, isVisible: D }), oe = e.data.tlbTxrCache = new Ri(e, { getKey: y, drawElement: E, getBoundingBox: _, getRotationPoint: M, getRotationOffset: K, isVisible: D }), ne = e.data.lyrTxrCache = new mg(e); e.onUpdateEleCalcs(function($, G) { q.invalidateElements(G), ee.invalidateElements(G), se.invalidateElements(G), oe.invalidateElements(G), ne.invalidateElements(G); for (var Q = 0; Q < G.length; Q++) { var ge = G[Q]._private; ge.oldBackgroundTimestamp = ge.backgroundTimestamp; } }); var ue = function($) { for (var G = 0; G < $.length; G++) ne.enqueueElementRefinement($[G].ele); }; q.onDequeue(ue), ee.onDequeue(ue), se.onDequeue(ue), oe.onDequeue(ue); } je.redrawHint = function(t, e) { var r = this; switch (t) { case "eles": r.data.canvasNeedsRedraw[je.NODE] = e; break; case "drag": r.data.canvasNeedsRedraw[je.DRAG] = e; break; case "select": r.data.canvasNeedsRedraw[je.SELECT_BOX] = e; break; } }; var _O = typeof Path2D < "u"; je.path2dEnabled = function(t) { if (t === void 0) return this.pathsEnabled; this.pathsEnabled = !!t; }; je.usePaths = function() { return _O && this.pathsEnabled; }; je.setImgSmoothing = function(t, e) { t.imageSmoothingEnabled != null ? t.imageSmoothingEnabled = e : (t.webkitImageSmoothingEnabled = e, t.mozImageSmoothingEnabled = e, t.msImageSmoothingEnabled = e); }; je.getImgSmoothing = function(t) { return t.imageSmoothingEnabled != null ? t.imageSmoothingEnabled : t.webkitImageSmoothingEnabled || t.mozImageSmoothingEnabled || t.msImageSmoothingEnabled; }; je.makeOffscreenCanvas = function(t, e) { var r; if ((typeof OffscreenCanvas > "u" ? "undefined" : Ft(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; }; [yg, on, En, Dc, Pa, Ci, br, jn, Mo, Eg].forEach(function(t) { Re(je, t); }); var DO = [{ name: "null", impl: ig }, { name: "base", impl: pg }, { name: "canvas", impl: TO }], PO = [{ type: "layout", extensions: MP }, { type: "renderer", extensions: DO }], Sg = {}, Tg = {}; function _g(t, e, r) { var n = r, a = function(T) { tt("Can not register `" + e + "` for `" + t + "` since `" + T + "` already exists in the prototype and can not be overridden"); }; if (t === "core") { if (fo.prototype[e]) return a(e); fo.prototype[e] = r; } else if (t === "collection") { if (Gt.prototype[e]) return a(e); Gt.prototype[e] = r; } else if (t === "layout") { for (var i = function(T) { this.options = T, r.call(this, T), Xe(this._private) || (this._private = {}), this._private.cy = T.cy, this._private.listeners = [], this.createEmitter(); }, o = i.prototype = Object.create(r.prototype), s = [], u = 0; u < s.length; u++) { var l = s[u]; o[l] = o[l] || function() { return this; }; } o.start && !o.run ? o.run = function() { return this.start(), this; } : !o.start && o.run && (o.start = function() { return this.run(), this; }); var c = r.prototype.stop; o.stop = function() { var x = this.options; if (x && x.animate) { var T = this.animations; if (T) for (var k = 0; k < T.length; k++) T[k].stop(); } return c ? c.call(this) : this.emit("layoutstop"), this; }, o.destroy || (o.destroy = function() { return this; }), o.cy = function() { return this._private.cy; }; var d = function(T) { return T._private.cy; }, v = { addEventFields: function(T, k) { k.layout = T, k.cy = d(T), k.target = T; }, bubble: function() { return !0; }, parent: function(T) { return d(T); } }; Re(o, { createEmitter: function() { return this._private.emitter = new ul(v, this), this; }, emitter: function() { return this._private.emitter; }, on: function(T, k) { return this.emitter().on(T, k), this; }, one: function(T, k) { return this.emitter().one(T, k), this; }, once: function(T, k) { return this.emitter().one(T, k), this; }, removeListener: function(T, k) { return this.emitter().removeListener(T, k), this; }, removeAllListeners: function() { return this.emitter().removeAllListeners(), this; }, emit: function(T, k) { return this.emitter().emit(T, k), this; } }), et.eventAliasesOn(o), n = i; } else if (t === "renderer" && e !== "null" && e !== "base") { var h = Dg("renderer", "base"), f = h.prototype, p = r, m = r.prototype, g = function() { h.apply(this, arguments), p.apply(this, arguments); }, y = g.prototype; for (var b in f) { var w = f[b], C = m[b] != null; if (C) return a(b); y[b] = w; } for (var E in m) y[E] = m[E]; f.clientFunctions.forEach(function(x) { y[x] = y[x] || function() { yt("Renderer does not implement `renderer." + x + "()` on its prototype"); }; }), n = g; } else if (t === "__proto__" || t === "constructor" || t === "prototype") return yt(t + " is an illegal type to be registered, possibly lead to prototype pollutions"); return Jh({ map: Sg, keys: [t, e], value: n }); } function Dg(t, e) { return ep({ map: Sg, keys: [t, e] }); } function OO(t, e, r, n, a) { return Jh({ map: Tg, keys: [t, e, r, n], value: a }); } function LO(t, e, r, n) { return ep({ map: Tg, keys: [t, e, r, n] }); } var Cu = function() { if (arguments.length === 2) return Dg.apply(null, arguments); if (arguments.length === 3) return _g.apply(null, arguments); if (arguments.length === 4) return LO.apply(null, arguments); if (arguments.length === 5) return OO.apply(null, arguments); yt("Invalid extension access syntax"); }; fo.prototype.extension = Cu; PO.forEach(function(t) { t.extensions.forEach(function(e) { _g(t.type, e.name, e.impl); }); }); var Pg = function t() { if (!(this instanceof t)) return new t(); this.length = 0; }, Ca = Pg.prototype; Ca.instanceString = function() { return "stylesheet"; }; Ca.selector = function(t) { var e = this.length++; return this[e] = { selector: t, properties: [] }, this; }; Ca.css = function(t, e) { var r = this.length - 1; if (Fe(t)) this[r].properties.push({ name: t, value: e }); else if (Xe(t)) for (var n = t, a = Object.keys(n), i = 0; i < a.length; i++) { var o = a[i], s = n[o]; if (s != null) { var u = rr.properties[o] || rr.properties[Js(o)]; if (u != null) { var l = u.name, c = s; this[r].properties.push({ name: l, value: c }); } } } return this; }; Ca.style = Ca.css; Ca.generateStyle = function(t) { var e = new rr(t); return this.appendToStyle(e); }; Ca.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 o = a[i]; t.css(o.name, o.value); } } return t; }; var IO = "3.30.2", Ea = function(e) { if (e === void 0 && (e = {}), Xe(e)) return new fo(e); if (Fe(e)) return Cu.apply(Cu, arguments); }; Ea.use = function(t) { var e = Array.prototype.slice.call(arguments, 1); return e.unshift(Ea), t.apply(null, e), this; }; Ea.warnings = function(t) { return lp(t); }; Ea.version = IO; Ea.stylesheet = Ea.Stylesheet = Pg; let FO = class extends EventTarget { constructor(r, n) { super(); Ir(this, "cyg", null); Ir(this, "nodes", []); Ir(this, "edges", []); Ir(this, "axons", []); Ir(this, "dendrites", []); Ir(this, "somas", []); Ir(this, "labelCache", /* @__PURE__ */ new Map()); Ir(this, "graphCanvas", null); this.labelCache = r, this.graphCanvas = n; } async addConnectivity(r) { var n; if (this.axons = r.axons.map((a) => JSON.stringify(a)), this.dendrites = r.dendrites.map((a) => JSON.stringify(a)), (n = r.somas) != null && n.length && (this.somas = r.somas.map((a) => JSON.stringify(a))), r.connectivity.length) for (const a of r.connectivity) { const i = await this.graphNode(a[0]), o = await this.graphNode(a[1]); this.nodes.push(i), this.nodes.push(o), this.edges.push({ id: `${i.id}_${o.id}`, source: i.id, target: o.id }); } else this.nodes.push({ id: "MISSING", label: "NO PATHS" }); } showConnectivity(r) { this.cyg = new RO(this, r), this.cyg.on("tap-node", (n) => { const a = new CustomEvent("tap-node", { detail: n.detail }); this.dispatchEvent(a); }); } selectConnectivity(r) { var n; if ((n = this.cyg) != null && n.cy) { let a = ""; this.cyg.cy.elements().forEach((i) => { const o = i.data("label"), s = Eu(o); $O(r, s) && (a = i.id()); }), a && this.cyg.cy.$id(a).select(); } } clearConnectivity() { var r; (r = this.cyg) != null && r.cy && (this.cyg.cy.remove(), this.cyg.cy = null); } reset() { var r; (r = this.cyg) != null && r.cy && this.cyg.cy.reset(); } zoom(r) { var n; if ((n = this.cyg) != null && n.cy) { const a = this.cyg.cy.zoom(), i = this.cyg.cy.width(), o = this.cyg.cy.height(), s = { x: i / 2, y: o / 2 }; this.cyg.cy.zoom({ level: a + r, renderedPosition: s }); } } enableZoom(r) { var n; (n = this.cyg) != null && n.cy && this.cyg.cy.userZoomingEnabled(r); } get elements() { return [ ...this.nodes.map((r) => ({ data: r })), ...this.edges.map((r) => ({ data: r })) ]; } get roots() { return [ ...this.dendrites, ...this.somas ]; } async graphNode(r) { const n = JSON.stringify(r), a = [r[0], ...r[1]], i = []; for (const s of a) { const u = this.labelCache.has(s) ? this.labelCache.get(s) : ""; i.push(u); } a.push(...i); const o = { id: n, label: a.join(` `) }; return this.axons.includes(n) ? this.dendrites.includes(n) || this.somas.includes(n) ? o["both-a-d"] = !0 : o.axon = !0 : (this.dendrites.includes(n) || this.somas.includes(n)) && (o.dendrite = !0), o; } on(r, n) { this.addEventListener(r, n); } }; const AO = "#8300bf", MO = "#f3ecf6", BO = [ { selector: "node", style: { label: function(t) { return NO(t.data("label")); }, // 'background-color': '#80F0F0', "background-color": "transparent", "background-opacity": "0", "text-valign": "center", "text-wrap": "wrap", width: "80px", height: "80px", "text-max-width": "80px", "font-size": "6px", shape: "round-rectangle", "border-width": 1, "border-style": "solid", "border-color": "gray" } }, { selector: "node[axon]", style: { // 'background-color': 'green', shape: "round-diamond", width: "100px", height: "100px" } }, { selector: "node[dendrite]", style: { // 'background-color': 'red', shape: "ellipse" } }, { selector: "node[both-a-d]", style: { // 'background-color': 'gray', shape: "round-rectangle" } }, { selector: "edge", style: { width: 1, "line-color": "dimgray", "target-arrow-color": "dimgray", "target-arrow-shape": "triangle", "curve-style": "bezier" } }, { selector: "node.active", style: { "border-color": AO, "background-color": MO, "background-opacity": 0.75 } } ]; function NO(t) { const e = t.split(` `), r = e.length / 2, n = e.slice(r); return Og(n.join(` `)); } function Og(t) { return t.split(` `).map((e) => e && e[0] >= "a" && e[0] <= "z" ? e.charAt(0).toUpperCase() + e.slice(1) : e).join(` `); } function Eu(t) { const e = t ? t.split(` `) : [], r = []; for (let n = 0; n < e.length / 2; n++) r.push({ id: e[n], label: e[n + e.length / 2] }); return r; } function $O(t, e) { t.sort((r, n) => r.id < n.id ? -1 : r.id > n.id ? 1 : 0), e.sort((r, n) => r.id < n.id ? -1 : r.id > n.id ? 1 : 0); for (let r = 0; r < t.length; r++) if (JSON.stringify(t[r]) !== JSON.stringify(e[r])) return !1; return !0; } class RO extends EventTarget { constructor(r, n) { var a; super(); Ir(this, "cy"); Ir(this, "tooltip"); this.cy = Ea({ container: n, elements: r.elements, layout: { name: "breadthfirst", circle: !1, roots: r.roots }, directed: !0, style: BO, minZoom: 0.5, maxZoom: 10, wheelSensitivity: 0.4 }).on("mouseover", "node", this.overNode.bind(this)).on("mouseout", "node", this.exitNode.bind(this)).on("position", "node", this.moveNode.bind(this)), this.tooltip = document.createElement("div"), this.tooltip.className = "cy-graph-tooltip", this.tooltip.hidden = !0, (a = n == null ? void 0 : n.lastChild) == null || a.appendChild(this.tooltip); } remove() { this.cy && this.cy.destroy(); } checkRightBoundary(r) { var n; r + this.tooltip.offsetWidth >= ((n = this.tooltip.parentElement) == null ? void 0 : n.offsetWidth) && (this.tooltip.style.left = `${r - this.tooltip.offsetWidth}px`); } overNode(r) { const a = r.target.data(), { label: i } = a, s = Eu(i).map((u) => u.label + " (" + u.id + ")"); this.tooltip.innerText = Og(s.join(` `)), this.tooltip.style.left = `${r.renderedPosition.x}px`, this.tooltip.style.top = `${r.renderedPosition.y}px`, this.tooltip.style.maxWidth = "240px", this.tooltip.style.zIndex = 2, this.tooltip.hidden = !1, this.checkRightBoundary(r.renderedPosition.x), this.tapNode(r, !0); } moveNode(r) { const n = r.target; this.tooltip.style.left = `${n.renderedPosition().x}px`, this.tooltip.style.top = `${n.renderedPosition().y}px`, this.checkRightBoundary(n.renderedPosition().x); } exitNode(r) { this.tooltip.hidden = !0, this.tapNode(r, !1); } tapNode(r, n) { const a = r.target, i = a.data(); let { label: o } = i; n ? a.addClass("active") : (a.removeClass("active"), o = "", setTimeout(() => { a.unselect(); })); const s = Eu(o), u = new CustomEvent("tap-node", { detail: s }); this.dispatchEvent(u); } on(r, n) { this.addEventListener(r, n); } } const zO = 1.3, VO = 24 * 60 * 60 * 1e3, HO = "Reset position", hv = "Lock zoom", qO = "Unlock zoom", KO = "Zoom in", UO = "Zoom out", pv = 0.25, GO = "#8300bf", WO = 3e3, YO = { name: "ConnectivityGraph", props: { /** * Entity to load its connectivity graph. */ entry: { type: String, default: "" }, mapServer: { type: String, default: "" }, selectedConnectivityData: { type: Array, default: [] } }, data: function() { return { loading: !0, connectivityGraph: null, selectedSource: "", pathList: [], schemaVersion: "", knowledgeByPath: /* @__PURE__ */ new Map(), labelledTerms: /* @__PURE__ */ new Set(), labelCache: /* @__PURE__ */ new Map(), resetLabel: HO, zoomLockLabel: hv, zoomInLabel: KO, zoomOutLabel: UO, iconColor: GO, zoomEnabled: !1, connectivityError: null, timeoutID: void 0 }; }, mounted() { this.refreshCache(), this.loadCacheData(), this.run().then((t) => { this.showGraph(this.entry); }); }, methods: { loadCacheData: function() { const t = sessionStorage.getItem("connectivity-graph-source"), e = sessionStorage.getItem("connectivity-graph-labels"), r = sessionStorage.getItem("connectivity-graph-pathlist"), n = sessionStorage.getItem("connectivity-graph-schema-version"); if (t && (this.selectedSource = t), r && (this.pathList = JSON.parse(r)), e) { const a = JSON.parse(e); this.labelCache = new Map(Object.entries(a)); } n && (this.schemaVersion = n); }, removeAllCacheData: function() { [ "connectivity-graph-expiry", "connectivity-graph-source", "connectivity-graph-labels", "connectivity-graph-pathlist", "connectivity-graph-schema-version" ].forEach((e) => { sessionStorage.removeItem(e); }); }, refreshCache: function() { const t = sessionStorage.getItem("connectivity-graph-expiry"); (/* @__PURE__ */ new Date()).getTime() > t && this.removeAllCacheData(); }, updateCacheExpiry: function() { const e = (/* @__PURE__ */ new Date()).getTime() + VO; sessionStorage.setItem("connectivity-graph-expiry", e); }, run: async function() { if (this.schemaVersion || (this.schemaVersion = await this.getSchemaVersion(), sessionStorage.setItem("connectivity-graph-schema-version", this.schemaVersion), this.updateCacheExpiry()), this.schemaVersion < zO) { console.warn("No Server!"); return; } this.showSpinner(), this.selectedSource || (this.selectedSource = await this.setSourceList(), sessionStorage.setItem("connectivity-graph-source", this.selectedSource), this.updateCacheExpiry()), await this.setPathList(this.selectedSource), this.hideSpinner(); }, showGraph: async function(t) { const e = this.$refs.graphCanvas; this.showSpinner(), this.connectivityGraph = new FO(this.labelCache, e), await this.connectivityGraph.addConnectivity(this.knowledgeByPath.get(t)), this.hideSpinner(), this.connectivityGraph.showConnectivity(e), this.selectedConnectivityData.length && this.connectivityGraph.selectConnectivity(this.selectedConnectivityData), this.connectivityGraph.on("tap-node", (r) => { const n = r.detail; this.$emit("tap-node", n); }); }, query: async function(t, e) { const r = `${this.mapServer}knowledge/query/`, n = { sql: t, params: e }; try { const a = await fetch(r, { method: "POST", headers: { Accept: "application/json; charset=utf-8", "Cache-Control": "no-store", "Content-Type": "application/json" }, body: JSON.stringify(n) }); if (!a.ok) throw new Error(`Cannot access ${r}`); return await a.json(); } catch { return { values: [] }; } }, setSourceList: async function() { const t = await this.getJsonData(`${this.mapServer}knowledge/sources`), e = t ? t.sources || [] : []; let r = ""; for (const n of e) n && r === "" && (r = n); return r; }, loadPathData: async function(t) { const e = await this.query( `select entity, knowledge from knowledge where entity like 'ilxtr:%' and source=? order by entity`, [t] ); return e ? e.values : []; }, setPathList: async function(t) { this.pathList.length || (this.pathList = await this.loadPathData(t), sessionStorage.setItem("connectivity-graph-pathlist", JSON.stringify(this.pathList)), this.updateCacheExpiry()), this.knowledgeByPath.clear(), this.labelledTerms = /* @__PURE__ */ new Set(); for (const [e, r] of this.pathList) { const n = JSON.parse(r); "connectivity" in n && (this.knowledgeByPath.set(e, n), this.cacheLabels(n)); } return this.labelCache.size || await this.getCachedTermLabels(), ""; }, getSchemaVersion: async function() { const t = await this.getJsonData(`${this.mapServer}knowledge/schema-version`); return t && +t.version || 0; }, getJsonData: async function(t) { try { const e = await fetch(t, { method: "GET", headers: { Accept: "application/json; charset=utf-8", "Cache-Control": "no-store", "Content-Type": "application/json" } }); return e.ok || console.error(`Cannot access ${t}`), await e.json(); } catch { return null; } }, getCachedTermLabels: async function() { if (this.labelledTerms.size) { const t = await this.query( `select entity, knowledge from knowledge where entity in (?${", ?".repeat(this.labelledTerms.size - 1)}) order by source desc`, [...this.labelledTerms.values()] ); let e = null; for (const [n, a] of t.values) if (n !== e) { const i = JSON.parse(a); this.labelCache.set(n, i.label || n), e = n; } const r = Object.fromEntries(this.labelCache); sessionStorage.setItem("connectivity-graph-labels", JSON.stringify(r)), this.updateCacheExpiry(); } }, cacheNodeLabels: function(t) { for (const e of [t[0], ...t[1]]) this.labelledTerms.add(e); }, cacheLabels: async function(t) { for (const e of t.connectivity) this.cacheNodeLabels(e[0]), this.cacheNodeLabels(e[1]); }, showSpinner: function() { this.loading = !0; }, hideSpinner: function() { this.loading = !1; }, reset: function() { this.connectivityGraph.reset(); }, zoomIn: function() { this.connectivityGraph.zoom(pv); }, zoomOut: function() { this.connectivityGraph.zoom(-pv); }, /** * Enable/disable user zoom for scrolling */ toggleZoom: function() { this.zoomEnabled = !this.zoomEnabled, this.zoomLockLabel = this.zoomEnabled ? qO : hv, this.connectivityGraph.enableZoom(!this.zoomEnabled); }, showErrorMessage: function(t) { this.connectivityError = { ...t }, this.timeoutID && clearTimeout(this.timeoutID), this.timeoutID = setTimeout(() => { this.connectivityError = null; }, WO); } } }, ZO = { class: "connectivity-graph" }, XO = { ref: "graphCanvas", class: "graph-canvas" }, jO = { class: "control-panel control-panel-tools" }, QO = { class: "visually-hidden" }, JO = { class: "visually-hidden" }, eL = { class: "visually-hidden" }, tL = { class: "visually-hidden" }, rL = /* @__PURE__ */ A0('
Origin
Components
Destination
', 1), nL = { key: 0, class: "connectivity-graph-error" }, aL = { key: 0 }; function iL(t, e, r, n, a, i) { const o = t2, s = Vt, u = Hr, l = ko, c = C2, d = T2, v = I2, h = A2, f = ac; return Ze((N(), Z("div", ZO, [ X("div", XO, null, 512), X("div", jO, [ X("div", { class: ie(["tools", { "zoom-locked": t.zoomEnabled }]) }, [ J(l, { content: t.resetLabel, placement: "top", effect: "control-tooltip" }, { default: U(() => [ J(u, { class: "control-button", size: "small", onClick: i.reset }, { default: U(() => [ J(s, { color: "white" }, { default: U(() => [ J(o) ]), _: 1 }), X("span", QO, Ie(t.resetLabel), 1) ]), _: 1 }, 8, ["onClick"]) ]), _: 1 }, 8, ["content"]), J(l, { content: t.zoomLockLabel, placement: "top", effect: "control-tooltip" }, { default: U(() => [ J(u, { class: "control-button", size: "small", onClick: i.toggleZoom }, { default: U(() => [ J(s, { color: "white" }, { default: U(() => [ t.zoomEnabled ? (N(), ye(c, { key: 0 })) : (N(), ye(d, { key: 1 })) ]), _: 1 }), X("span", JO, Ie(t.zoomLockLabel), 1) ]), _: 1 }, 8, ["onClick"]) ]), _: 1 }, 8, ["content"]), J(l, { content: t.zoomInLabel, placement: "left", effect: "control-tooltip" }, { default: U(() => [ J(u, { class: "control-button", size: "small", onClick: i.zoomIn }, { default: U(() => [ J(s, { color: "white" }, { default: U(() => [ J(v) ]), _: 1 }), X("span", eL, Ie(t.zoomInLabel), 1) ]), _: 1 }, 8, ["onClick"]) ]), _: 1 }, 8, ["content"]), J(l, { content: t.zoomOutLabel, placement: "left", effect: "control-tooltip" }, { default: U(() => [ J(u, { class: "control-button", size: "small", onClick: i.zoomOut }, { default: U(() => [ J(s, { color: "white" }, { default: U(() => [ J(h) ]), _: 1 }), X("span", tL, Ie(t.zoomOutLabel), 1) ]), _: 1 }, 8, ["onClick"]) ]), _: 1 }, 8, ["content"]) ], 2) ]), rL, t.connectivityError ? (N(), Z("div", nL, [ t.connectivityError.errorConnectivities ? (N(), Z("strong", aL, Ie(t.connectivityError.errorConnectivities), 1)) : he("", !0), ze(" " + Ie(t.connectivityError.errorMessage), 1) ])) : he("", !0) ])), [ [f, t.loading] ]); } const VI = /* @__PURE__ */ Ur(YO, [["render", iL], ["__scopeId", "data-v-6acf6401"]]), gv = "Copy to clipboard", oL = "Copied!", sL = "#8300bf", lL = { name: "CopyToClipboard", props: { content: { type: String, default: "" }, /** * `theme: light` will show white button, * to use when the button is over other readable text content. * Default button is transparent. */ theme: { type: String, default: "" } }, data: function() { return { textLabel: gv, autoHideTimeout: 0, iconColor: sL }; }, methods: { copyToClipboard: async function() { let t = !0; this.autoHideTimeout = 600; try { const e = this.content.replaceAll(` `, ""), r = document.createElement("div"); r.innerHTML = this.content; const n = r.textContent || r.innerText || "", a = new Blob([e], { type: "text/html" }), i = new Blob([n], { type: "text/plain" }), o = new ClipboardItem({ "text/html": a, "text/plain": i }); await navigator.clipboard.write([o]); } catch (e) { console.error( "Error when trying to use navigator.clipboard.write()", e ), t = !1; } t ? this.textLabel = oL : this.textLabel = "Error trying to copy to clipboard!"; }, resetSettings: function() { this.autoHideTimeout = 0, this.textLabel = gv; } } }, uL = { class: "visually-hidden" }; function cL(t, e, r, n, a, i) { const o = d2, s = Vt, u = Hr, l = ko; return N(), ye(l, { content: t.textLabel, placement: "bottom", "hide-after": t.autoHideTimeout, effect: "clipboard-tooltip", onHide: i.resetSettings }, { default: U(() => [ J(u, { class: ie(["copy-clipboard-button", r.theme]), size: "small", onClick: i.copyToClipboard }, { default: U(() => [ J(s, { color: t.iconColor }, { default: U(() => [ J(o) ]), _: 1 }, 8, ["color"]), X("span", uL, Ie(t.textLabel), 1) ]), _: 1 }, 8, ["class", "onClick"]) ]), _: 1 }, 8, ["content", "hide-after", "onHide"]); } const HI = /* @__PURE__ */ Ur(lL, [["render", cL], ["__scopeId", "data-v-de3b5311"]]), dL = function(t) { return t ? t.charAt(0).toUpperCase() + t.slice(1) : ""; }, fL = { name: "ConnectionDialog", props: { connectionEntry: { type: Object, default: {} }, inDrawing: { type: Boolean, default: !1 }, connectionExist: { type: Boolean, default: !1 } }, data: function() { return { tooltipId: void 0 }; }, methods: { shadowDisplay: function(t) { return this.tooltipId === t ? "always" : "hover"; }, capitalise: function(t) { return dL(t); }, handleTooltip: function(t) { this.tooltipId = this.tooltipId === t ? void 0 : t, this.$emit("featureTooltip", this.tooltipId); } } }, Pc = (t) => (po("data-v-8168ee98"), t = t(), go(), t), vL = { class: "dialog-container" }, hL = /* @__PURE__ */ Pc(() => /* @__PURE__ */ X("span", { class: "dialog-title" }, "Finalise drawing", -1)), pL = /* @__PURE__ */ Pc(() => /* @__PURE__ */ X("span", { class: "dialog-title" }, "Visualise connection", -1)), gL = /* @__PURE__ */ Pc(() => /* @__PURE__ */ X("b", null, [ /* @__PURE__ */ X("span", null, "Related Features") ], -1)); function mL(t, e, r, n, a, i) { const o = Hr, s = yE, u = Qs, l = So, c = EE; return N(), Z("div", vL, [ J(u, null, { default: U(() => [ J(l, null, { default: U(() => [ r.inDrawing ? (N(), ye(u, { key: 0 }, { default: U(() => [ hL, J(s, null, { default: U(() => [ J(o, { type: "primary", plain: "", onClick: e[0] || (e[0] = (d) => t.$emit("confirmDrawn", !0)) }, { default: U(() => [ ze(" Confirm ") ]), _: 1 }), J(o, { type: "primary", plain: "", onClick: e[1] || (e[1] = (d) => t.$emit("cancelDrawn", !0)) }, { default: U(() => [ ze(" Cancel ") ]), _: 1 }) ]), _: 1 }) ]), _: 1 })) : (N(), ye(u, { key: 1 }, { default: U(() => [ pL, J(o, { type: "primary", plain: "", onClick: e[2] || (e[2] = (d) => t.$emit("dialogDisplay", !1)) }, { default: U(() => [ ze(" Close ") ]), _: 1 }) ]), _: 1 })) ]), _: 1 }) ]), _: 1 }), r.connectionExist ? (N(), ye(u, { key: 0 }, { default: U(() => [ J(l, null, { default: U(() => [ gL, (N(!0), Z(Qe, null, Jt(r.connectionEntry, (d, v) => (N(), ye(u, { key: v }, { default: U(() => [ J(c, { shadow: i.shadowDisplay(v), onClick: (h) => i.handleTooltip(v) }, { default: U(() => [ X("span", null, Ie(i.capitalise(d.label)), 1) ]), _: 2 }, 1032, ["shadow", "onClick"]) ]), _: 2 }, 1024))), 128)) ]), _: 1 }) ]), _: 1 })) : he("", !0) ]); } const yL = /* @__PURE__ */ Ur(fL, [["render", mL], ["__scopeId", "data-v-8168ee98"]]), Lg = (t, e) => { const r = t.__vccOpts || t; for (const [n, a] of e) r[n] = a; return r; }, bL = ["xlink:href"], wL = { __name: "SvgIcon", props: { /** * The svg icon to show. */ icon: { type: String, required: !0 }, /** * The option to spin the icon. */ spin: { type: Boolean, default: !1 } }, setup(t) { return (e, r) => (N(), Z("svg", { class: ie(["map-icon", { "map-icon-spin": t.spin }]) }, [ X("use", { "xlink:href": `#${t.icon}` }, null, 8, bL) ], 2)); } }, xL = /* @__PURE__ */ Lg(wL, [["__scopeId", "data-v-e172d5ff"]]), Ig = ` 2horpanel ? `, Fg = ` 2vertpanel ? `, Ag = ` 3panel ? `, Mg = ` 4panel ? `, Bg = ` 2horpanel ? `, Ng = ` 2horpanel ? `, $g = ` 4panel ? `, Rg = ` changeBckgd `, zg = ` close no bk `, Vg = ` close `, Hg = ` closeFullScreen `, qg = ` Comment `, Kg = ` Connection `, Ug = ` dock `, Gg = ` drawLine `, Wg = ` drawPoint `, Yg = ` drawPolygon `, Zg = ` drawTrash `, Xg = ` fitWindow `, jg = ` fullScreen `, Qg = 'DataPortal-Icons', Jg = ` magnifyingGlass `, e0 = `Created by Wahyu Prihantorofrom the Noun Project`, t0 = ` openMap `, r0 = ` Artboard Copy 6 `, n0 = ` permalink `, a0 = ` play `, i0 = ` resetZoom `, o0 = ` singlepanel ? `, s0 = ` tooltips ? `, l0 = ` undock `, u0 = ` zoomIn `, c0 = ` zoomOut `, d0 = (t, e, r, n) => { const a = ["title", "desc", "defs", "style"], i = ["width", "height"], o = n || []; let s = document.createElement("div"); s.innerHTML = t, a.map((l) => { const c = s.querySelector(l); c && c.remove(); }), i.map((l) => { s.querySelector("svg").removeAttribute(l); }), n && o.map((l) => { Object.values(s.querySelectorAll(`[${l}]`)).map((c) => { c.removeAttribute(l); }); }); const u = s.innerHTML; return s = null, u; }, f0 = (t) => [ // Remove XML stuffs and comments [/<\?xml[\s\S]*?>/gi, ""], [//gi, ""], [//gi, ""], // SVG XML -> HTML5 [/\<([A-Za-z]+)([^\>]*)\/\>/g, "<$1$2>"], // convert self-closing XML SVG nodes to explicitly closed HTML5 SVG nodes [/\s+/g, " "], // replace whitespace sequences with a single space [/\> \<"] // remove whitespace between tags ].reduce((e, r) => "".replace.apply(e, r), t).trim(), CL = !0, EL = !0, kL = ["fill"], ku = /* @__PURE__ */ Object.assign({ "/assets/icons/2horpanel.svg": Ig, "/assets/icons/2vertpanel.svg": Fg, "/assets/icons/3panel.svg": Ag, "/assets/icons/4panel.svg": Mg, "/assets/icons/5panel.svg": Bg, "/assets/icons/6panel.svg": Ng, "/assets/icons/6panelVertical.svg": $g, "/assets/icons/changeBckgd.svg": Rg, "/assets/icons/close-no-bk.svg": zg, "/assets/icons/close.svg": Vg, "/assets/icons/closeFullScreen.svg": Hg, "/assets/icons/comment.svg": qg, "/assets/icons/connection.svg": Kg, "/assets/icons/dock.svg": Ug, "/assets/icons/drawLine.svg": Gg, "/assets/icons/drawPoint.svg": Wg, "/assets/icons/drawPolygon.svg": Yg, "/assets/icons/drawTrash.svg": Zg, "/assets/icons/fitWindow.svg": Xg, "/assets/icons/fullScreen.svg": jg, "/assets/icons/help.svg": Qg, "/assets/icons/magnifyingGlass.svg": Jg, "/assets/icons/noun-filter.svg": e0, "/assets/icons/openMap.svg": t0, "/assets/icons/pause.svg": r0, "/assets/icons/permalink.svg": n0, "/assets/icons/play.svg": a0, "/assets/icons/resetZoom.svg": i0, "/assets/icons/singlepanel.svg": o0, "/assets/icons/tooltips.svg": s0, "/assets/icons/undock.svg": l0, "/assets/icons/zoomIn.svg": u0, "/assets/icons/zoomOut.svg": c0 }), SL = Object.keys(ku).map((t) => { const e = d0(ku[t], CL, EL, kL), r = t.replace(/^.+\/(\w+).svg$/, "$1"); return f0(e).replace("", "symbol>"); }); SL.join(` `); const Su = /* @__PURE__ */ Object.assign({ "/assets/icons/2horpanel.svg": Ig, "/assets/icons/2vertpanel.svg": Fg, "/assets/icons/3panel.svg": Ag, "/assets/icons/4panel.svg": Mg, "/assets/icons/5panel.svg": Bg, "/assets/icons/6panel.svg": Ng, "/assets/icons/6panelVertical.svg": $g, "/assets/icons/changeBckgd.svg": Rg, "/assets/icons/close-no-bk.svg": zg, "/assets/icons/close.svg": Vg, "/assets/icons/closeFullScreen.svg": Hg, "/assets/icons/comment.svg": qg, "/assets/icons/connection.svg": Kg, "/assets/icons/dock.svg": Ug, "/assets/icons/drawLine.svg": Gg, "/assets/icons/drawPoint.svg": Wg, "/assets/icons/drawPolygon.svg": Yg, "/assets/icons/drawTrash.svg": Zg, "/assets/icons/fitWindow.svg": Xg, "/assets/icons/fullScreen.svg": jg, "/assets/icons/help.svg": Qg, "/assets/icons/magnifyingGlass.svg": Jg, "/assets/icons/noun-filter.svg": e0, "/assets/icons/openMap.svg": t0, "/assets/icons/pause.svg": r0, "/assets/icons/permalink.svg": n0, "/assets/icons/play.svg": a0, "/assets/icons/resetZoom.svg": i0, "/assets/icons/singlepanel.svg": o0, "/assets/icons/tooltips.svg": s0, "/assets/icons/undock.svg": l0, "/assets/icons/zoomIn.svg": u0, "/assets/icons/zoomOut.svg": c0 }), TL = Object.keys(Su).map((t) => { const e = d0(Su[t]), r = t.replace(/^.+\/(\w+).svg$/, "$1"); return f0(e).replace("", "symbol>"); }), _L = { name: "MapSvgSpriteColor", svgContext: Su, svgSprite: TL.join(` `) // concatenate all symbols into $options.svgSprite }, DL = ["innerHTML"]; function PL(t, e, r, n, a, i) { return N(), Z("svg", { width: "0", height: "0", style: { display: "none" }, innerHTML: t.$options.svgSprite }, null, 8, DL); } const OL = /* @__PURE__ */ Lg(_L, [["render", PL]]), LL = (t, e) => { let r, n, a, i, o, s; e.style.left = "", e.style.top = "", e.addEventListener( "mousedown", (l) => { l.preventDefault(), r = e.offsetLeft, n = e.offsetTop, a = l.clientX, i = l.clientY, e.addEventListener("mousemove", u, !1), document.addEventListener( "mouseup", () => { e.removeEventListener("mousemove", u, !1); }, !1 ); }, !1 ); function u(l) { l.preventDefault(), o = r - (a - l.clientX), s = n - (i - l.clientY), e.style.left = `${o}px`, e.style.top = `${s}px`; } }, IL = { name: "DrawToolbar", components: { MapSvgIcon: xL, MapSvgSpriteColor: OL }, props: { /** * Optional * * Associated with the Connection dialog. * This is needed to display the dialog and provides the additional drag capability to the dialog. * * e.g. * :mapCanvas="{ * containerHTML: appRef, // Reference to the map canvas container. * class: '.maplibregl-canvas', // CSS selector for the map canvas. * }" */ mapCanvas: { type: Object, default: void 0 }, /** * Array of toolbar options to display. * 'Connection' requires 'LineString' is included in the toolbar options. */ toolbarOptions: { type: Array, default: [ "Edit", "Delete", "Point", "LineString", "Polygon", "Connection" ] }, /** * Optional * * To update the toolbar icons or filter the features based on the tool type. * e.g. "All tools", "Point", "LineString", "Polygon" or "None". */ drawnType: { type: String, default: "All tools" }, activeDrawTool: { required: !0 }, activeDrawMode: { required: !0 }, /** * Optional * * Associated with the Connection dialog. * This will popup a dialog if new feature is drawn and map canvas exists. */ newlyDrawnEntry: { type: Object, default: {} }, /** * Optional * * Associated with the Connection dialog. * This will add entries to the dialog. */ connectionEntry: { type: Object, default: {} }, /** * Add following to the top hoverVisibilities array to enable tooltips for each icon. * [ * { value: false, refs: 'toolbarPopover', ref: 'editPopover' }, * { value: false, refs: 'toolbarPopover', ref: 'deletePopover' }, * { value: false, refs: 'toolbarPopover', ref: 'pointPopover' }, * { value: false, refs: 'toolbarPopover', ref: 'lineStringPopover' }, * { value: false, refs: 'toolbarPopover', ref: 'polygonPopover' }, * { value: false, refs: 'toolbarPopover', ref: 'connectionPopover' }, * ] */ hoverVisibilities: { type: Array, required: !0, default: [ { value: !1, ref: "editPopover" }, { value: !1, ref: "deletePopover" }, { value: !1, ref: "pointPopover" }, { value: !1, ref: "lineStringPopover" }, { value: !1, ref: "polygonPopover" }, { value: !1, ref: "connectionPopover" } ] } }, data: function() { return { toolbarIcons: [ { name: "Edit", active: !1, disabled: !1 }, { name: "Delete", active: !1, disabled: !1 }, { name: "Point", active: !1, disabled: !1 }, { name: "LineString", active: !1, disabled: !1 }, { name: "Polygon", active: !1, disabled: !1 }, { name: "Connection", active: !1, disabled: !0 } ], connectionDisplay: !1, dialogPosition: { offsetX: 0, offsetY: 0, x: void 0, y: void 0 } }; }, computed: { showAllToolIcons: function() { return this.drawnType === "All tools" || this.drawnType === "None"; }, showEditModeIcon: function() { return this.toolbarOptions.includes("Edit"); }, showDeleteModeIcon: function() { return this.toolbarOptions.includes("Delete"); }, showDrawPointIcon: function() { return this.toolbarOptions.includes("Point") && (this.showAllToolIcons || this.drawnType === "Point"); }, showDrawLineStringIcon: function() { return this.toolbarOptions.includes("LineString") && (this.showAllToolIcons || this.drawnType === "LineString"); }, showDrawPolygonIcon: function() { return this.toolbarOptions.includes("Polygon") && (this.showAllToolIcons || this.drawnType === "Polygon"); }, showConnectionIcon: function() { return this.toolbarOptions.includes("Connection") && this.toolbarOptions.includes("LineString") && (this.showAllToolIcons || this.drawnType === "LineString"); }, inDrawing: function() { return this.activeDrawTool !== void 0; }, newlyDrawnExist: function() { return Object.keys(this.newlyDrawnEntry).length > 0; }, connectionExist: function() { return Object.keys(this.connectionEntry).length > 0; } }, watch: { drawnType: function() { this.disabledToolbarConnectionIcon(!0); }, activeDrawMode: function(t) { this.updateToolbarIcons(t), t === "Delete" && (this.connectionDisplay = !1); }, activeDrawTool: function(t) { this.updateToolbarIcons(t), t || (this.connectionDisplay = !1); }, newlyDrawnExist: function(t) { t && (this.connectionDisplay = !0); }, connectionExist: function(t) { this.disabledToolbarConnectionIcon(!t), t || (this.connectionDisplay = !1); }, connectionDisplay: function(t) { this.activeToolbarConnectionIcon(t), t ? this.dialogCssHacks() : this.$emit("featureTooltip", void 0); }, dialogPosition: { handler: function() { const t = this.$el.getBoundingClientRect(); this.dialogPosition.offsetX = t.x, this.dialogPosition.offsetY = t.y; }, deep: !0, once: !0 } }, methods: { iconDisabled: function(t) { return this.toolbarIcons.filter((e) => e.name === t)[0].disabled; }, modeClickEvent: function(t) { if (!this.iconDisabled(t)) { const e = this.activeDrawMode === t ? void 0 : t; this.$emit("clickToolbar", "mode", e); } }, toolClickEvent: function(t) { if (!this.iconDisabled(t)) { const e = this.activeDrawTool === t ? void 0 : t; this.$emit("clickToolbar", "tool", e); } }, connectionClickEvent: function() { !this.iconDisabled("Connection") && !this.newlyDrawnExist && (this.connectionDisplay = !this.connectionDisplay); }, updateToolbarIcons: function(t) { this.toolbarIcons.map((e) => { e.name === t ? e.active = !0 : e.active = !1; }), this.toolbarIcons.filter((e) => e.name !== "Connection" && e.name !== t).map((e) => { t ? e.disabled = !0 : e.disabled = !1; }), this.toolbarCssHacks(); }, disabledToolbarConnectionIcon: function(t) { this.toolbarIcons.filter((e) => e.name === "Connection").map((e) => { t ? e.disabled = !0 : e.disabled = !1, this.activeDrawMode === "Delete" && (e.disabled = !0); }), this.toolbarCssHacks(); }, activeToolbarConnectionIcon: function(t) { this.toolbarIcons.filter((e) => e.name === "Connection").map((e) => { t ? e.active = !0 : e.active = !1; }), this.toolbarCssHacks(); }, toolbarCssHacks: function() { this.$nextTick(() => { this.toolbarIcons.map((t) => { const e = this.$el.querySelector(`.draw${t.name}`); e && (t.active ? e.classList.add("active") : e.classList.remove("active"), t.disabled ? e.classList.add("disabled") : e.classList.remove("disabled")); }); }); }, dialogCssHacks: function() { this.$nextTick(() => { const t = this.$el.querySelector(".connection-dialog"); LL(this.mapCanvas.containerHTML, t); let e, r; const n = this.mapCanvas.containerHTML.getBoundingClientRect(), a = t.getBoundingClientRect(); this.dialogPosition.x > n.width / 2 ? e = this.dialogPosition.x - a.width : e = this.dialogPosition.x, this.dialogPosition.y > n.height / 2 ? r = this.dialogPosition.y - a.height : r = this.dialogPosition.y, t.style.transform = `translate(${e - this.dialogPosition.offsetX}px, ${r - this.dialogPosition.offsetY}px)`; }); }, hoverIndex: function(t) { return this.hoverVisibilities.findIndex((e) => e.ref === t); }, showTooltip: function(t) { this.$emit("showTooltip", t); }, hideTooltip: function(t) { this.$emit("hideTooltip", t); }, dialogPopUpPositionHandler: function(t) { t.preventDefault(), this.dialogPosition.x = t.clientX, this.dialogPosition.y = t.clientY, this.activeDrawTool === "Point" && this.dialogCssHacks(); } }, mounted: function() { this.$nextTick(() => { this.toolbarCssHacks(), this.mapCanvas && this.mapCanvas.containerHTML.querySelector(this.mapCanvas.class).addEventListener("click", this.dialogPopUpPositionHandler, !1); }); }, destroyed: function() { this.mapCanvas && this.mapCanvas.containerHTML.querySelector(this.mapCanvas.class).removeEventListener("click", this.dialogPopUpPositionHandler, !1); } }, FL = { class: "toolbar-container" }, AL = { class: "toolbar-icons" }; function ML(t, e, r, n, a, i) { const o = Qt("map-svg-sprite-color"), s = Qt("map-svg-icon"), u = rc, l = yL; return N(), Z("div", FL, [ J(o), X("div", AL, [ i.showEditModeIcon ? (N(), ye(u, { key: 0, content: "Edit Mode", placement: "top", teleported: !1, trigger: "manual", width: "100", "popper-class": "flatmap-popper", visible: r.hoverVisibilities[i.hoverIndex("editPopover")].value, ref: "editPopover" }, { reference: U(() => [ J(s, { icon: "comment", class: "icon-button drawEdit", onClick: e[0] || (e[0] = (c) => i.modeClickEvent("Edit")), onMouseover: e[1] || (e[1] = (c) => i.showTooltip(i.hoverIndex("editPopover"))), onMouseout: e[2] || (e[2] = (c) => i.hideTooltip(i.hoverIndex("editPopover"))) }) ]), _: 1 }, 8, ["visible"])) : he("", !0), i.showDeleteModeIcon ? (N(), ye(u, { key: 1, content: "Delete Mode", placement: "top", teleported: !1, trigger: "manual", width: "100", "popper-class": "flatmap-popper", visible: r.hoverVisibilities[i.hoverIndex("deletePopover")].value, ref: "deletePopover" }, { reference: U(() => [ J(s, { icon: "drawTrash", class: "icon-button drawDelete", onClick: e[3] || (e[3] = (c) => i.modeClickEvent("Delete")), onMouseover: e[4] || (e[4] = (c) => i.showTooltip(i.hoverIndex("deletePopover"))), onMouseout: e[5] || (e[5] = (c) => i.hideTooltip(i.hoverIndex("deletePopover"))) }) ]), _: 1 }, 8, ["visible"])) : he("", !0), i.showDrawPointIcon ? (N(), ye(u, { key: 2, content: "Draw Point", placement: "top", teleported: !1, trigger: "manual", width: "100", "popper-class": "flatmap-popper", visible: r.hoverVisibilities[i.hoverIndex("pointPopover")].value, ref: "pointPopover" }, { reference: U(() => [ J(s, { icon: "drawPoint", class: "icon-button drawPoint", onClick: e[6] || (e[6] = (c) => i.toolClickEvent("Point")), onMouseover: e[7] || (e[7] = (c) => i.showTooltip(i.hoverIndex("pointPopover"))), onMouseout: e[8] || (e[8] = (c) => i.hideTooltip(i.hoverIndex("pointPopover"))) }) ]), _: 1 }, 8, ["visible"])) : he("", !0), i.showDrawLineStringIcon ? (N(), ye(u, { key: 3, content: "Draw LineString", placement: "top", teleported: !1, trigger: "manual", width: "100", "popper-class": "flatmap-popper", visible: r.hoverVisibilities[i.hoverIndex("lineStringPopover")].value, ref: "drawLinePopover" }, { reference: U(() => [ J(s, { icon: "drawLine", class: "icon-button drawLineString", onClick: e[9] || (e[9] = (c) => i.toolClickEvent("LineString")), onMouseover: e[10] || (e[10] = (c) => i.showTooltip(i.hoverIndex("lineStringPopover"))), onMouseout: e[11] || (e[11] = (c) => i.hideTooltip(i.hoverIndex("lineStringPopover"))) }) ]), _: 1 }, 8, ["visible"])) : he("", !0), i.showDrawPolygonIcon ? (N(), ye(u, { key: 4, content: "Draw Polygon", placement: "top", teleported: !1, trigger: "manual", width: "100", "popper-class": "flatmap-popper", visible: r.hoverVisibilities[i.hoverIndex("polygonPopover")].value, ref: "polygonPopover" }, { reference: U(() => [ J(s, { icon: "drawPolygon", class: "icon-button drawPolygon", onClick: e[12] || (e[12] = (c) => i.toolClickEvent("Polygon")), onMouseover: e[13] || (e[13] = (c) => i.showTooltip(i.hoverIndex("polygonPopover"))), onMouseout: e[14] || (e[14] = (c) => i.hideTooltip(i.hoverIndex("polygonPopover"))) }) ]), _: 1 }, 8, ["visible"])) : he("", !0), i.showConnectionIcon ? (N(), ye(u, { key: 5, content: "Connectivity", placement: "top", teleported: !1, trigger: "manual", width: "100", "popper-class": "flatmap-popper", visible: r.hoverVisibilities[i.hoverIndex("connectionPopover")].value, ref: "connectionPopover" }, { reference: U(() => [ J(s, { icon: "connection", class: "icon-button drawConnection", onClick: e[15] || (e[15] = (c) => i.connectionClickEvent()), onMouseover: e[16] || (e[16] = (c) => i.showTooltip(i.hoverIndex("connectionPopover"))), onMouseout: e[17] || (e[17] = (c) => i.hideTooltip(i.hoverIndex("connectionPopover"))) }) ]), _: 1 }, 8, ["visible"])) : he("", !0) ]), r.mapCanvas ? Ze((N(), ye(l, { key: 0, class: "connection-dialog", connectionEntry: r.connectionEntry, inDrawing: i.inDrawing, connectionExist: i.connectionExist, onDialogDisplay: e[18] || (e[18] = (c) => i.connectionClickEvent()), onConfirmDrawn: e[19] || (e[19] = (c) => t.$emit("confirmDrawn", c)), onCancelDrawn: e[20] || (e[20] = (c) => t.$emit("cancelDrawn", c)), onFeatureTooltip: e[21] || (e[21] = (c) => t.$emit("featureTooltip", c)) }, null, 8, ["connectionEntry", "inDrawing", "connectionExist"])), [ [mt, t.connectionDisplay] ]) : he("", !0) ]); } const qI = /* @__PURE__ */ Ur(IL, [["render", ML], ["__scopeId", "data-v-6ac1a744"]]), BL = { name: "HelpModeDialog", props: { /** * MultiFlatmapRef from multiflatmapvuer. Provide this when using with MultiFlatmap. */ multiflatmapRef: { type: Object, default: null }, /** * FlatmapRef from flatmapvuer. Provide this when using with Flatmap. */ flatmapRef: { type: Object, default: null }, /** * ScaffoldRef from scaffoldvuer. Provide this when using with Scaffold. */ scaffoldRef: { type: Object, default: null }, /** * The flag for last tooltip item. */ lastItem: { type: Boolean, default: !1, required: !1 } }, mounted: function() { this.toggleHelpModeHighlight(!0), this.toggleTooltipHighlight(); }, unmounted: function() { this.toggleHelpModeHighlight(!1); }, watch: { lastItem: function(t) { t && this.toggleTooltipHighlight(); } }, methods: { /** * This function will be called on clicking Next button. * * @public */ showNext: function() { this.$emit("show-next"); }, /** * This function will be called on clicking Finish button. * * @public */ finishHelpMode: function() { this.$emit("finish-help-mode"); }, /** * This function must be called on 'shown-map-tooltip' event. * * @public */ toggleTooltipPinHighlight: function() { const t = this.getCurrentFlatmap(); this.resetHighlightedItems(), this.$nextTick(() => { var i; const e = t.querySelectorAll(".maplibregl-marker"), r = t.querySelector( ".flatmap-popup-popper" ), n = ((i = r == null ? void 0 : r.style) == null ? void 0 : i.transform) || "", a = this.extractMarkerPosition(n); e.forEach((o) => { const s = o.style.transform; this.extractMarkerPosition(s) === a && o.classList.add("in-help-highlight"); }); }); }, /** * This function must be called on 'shown-tooltip' event. * * @public */ toggleTooltipHighlight: function() { this.resetHighlightedItems(), this.$nextTick(() => { document.querySelectorAll( '.el-popper:not([style*="none"])' ).forEach((e) => { const r = e.classList.contains("flatmap-popper"), n = e.classList.contains( "el-fade-in-linear-enter-active" ); (r || n) && this.toggleHighlight(e); }); }); }, toggleHighlight: function(t) { const e = (t == null ? void 0 : t.id) || "", r = document.querySelector( `[aria-describedby="${e}"]` ); r && r.classList.add("in-help-highlight"); }, resetHighlightedItems: function() { document.querySelectorAll(".in-help-highlight").forEach((e) => { e.classList.remove("in-help-highlight"); }); }, getCurrentScaffold: function() { var e; return ((e = this.scaffoldRef) == null ? void 0 : e.$el) || null; }, getCurrentMultiflatmap: function() { var e; return ((e = this.multiflatmapRef) == null ? void 0 : e.$el) || null; }, getCurrentFlatmap: function() { var r; const t = this.flatmapRef || ((r = this.multiflatmapRef) == null ? void 0 : r.getCurrentFlatmap()); return (t == null ? void 0 : t.$el) || null; }, toggleHelpModeHighlight: function(t) { const e = this.getCurrentMultiflatmap(), r = this.getCurrentFlatmap(), n = this.getCurrentScaffold(), a = document.querySelectorAll(".in-help-highlight"); e && (t ? e.classList.add("in-help") : e.classList.remove("in-help")), r && (t ? r.classList.add("in-help") : r.classList.remove("in-help")), n && (t ? n.classList.add("in-help") : n.classList.remove("in-help")), t || a.forEach((i) => { i.classList.remove("in-help-highlight"); }); }, /** * Temporary solution to find the position of map marker from popover */ extractMarkerPosition: function(t) { const e = /translate\((.*?)\)/g, r = t.match(e); return r ? r[r.length - 1].slice(10, -1) : ""; } } }, Oc = (t) => (po("data-v-3efb89fb"), t = t(), go(), t), NL = /* @__PURE__ */ Oc(() => /* @__PURE__ */ X("h4", null, "Help Mode", -1)), $L = /* @__PURE__ */ Oc(() => /* @__PURE__ */ X("p", null, [ /* @__PURE__ */ ze(" All caught up! "), /* @__PURE__ */ X("br"), /* @__PURE__ */ ze(" Click 'Help' to restart. ") ], -1)), RL = /* @__PURE__ */ Oc(() => /* @__PURE__ */ X("p", null, 'Click "Next" to see the next item.', -1)); function zL(t, e, r, n, a, i) { const o = Hr; return N(), Z("div", { class: ie(["help-mode-dialog", { finish: r.lastItem }]) }, [ NL, r.lastItem ? (N(), Z(Qe, { key: 0 }, [ $L, X("div", null, [ J(o, { class: "button", onClick: i.finishHelpMode }, { default: U(() => [ ze(" Finish ") ]), _: 1 }, 8, ["onClick"]) ]) ], 64)) : (N(), Z(Qe, { key: 1 }, [ RL, X("div", null, [ J(o, { class: "button", onClick: i.showNext }, { default: U(() => [ ze(" Next ") ]), _: 1 }, 8, ["onClick"]), J(o, { class: "button secondary", onClick: i.finishHelpMode }, { default: U(() => [ ze(" Exit Help Mode ") ]), _: 1 }, 8, ["onClick"]) ]) ], 64)) ], 2); } const KI = /* @__PURE__ */ Ur(BL, [["render", zL], ["__scopeId", "data-v-3efb89fb"]]); function VL(t) { return { all: t = t || /* @__PURE__ */ new Map(), on: function(e, r) { var n = t.get(e); n ? n.push(r) : t.set(e, [r]); }, off: function(e, r) { var n = t.get(e); n && (r ? n.splice(n.indexOf(r) >>> 0, 1) : t.set(e, [])); }, emit: function(e, r) { var n = t.get(e); n && n.slice().map(function(a) { a(r); }), (n = t.get("*")) && n.slice().map(function(a) { a(e, r); }); } }; } const Gi = new VL(), HL = { name: "ExternalResourceCard", props: { resources: { type: Array, default: () => [] } }, data: function() { return { pubmeds: [], pubmedIds: [], ElIconNotebook: jr(k2) }; }, methods: { capitalise: function(t) { return t.charAt(0).toUpperCase() + t.slice(1); }, openUrl: function(t) { Gi.emit("open-pubmed-url", t), window.open(t, "_blank"); } } }, qL = { class: "resource-container" }; function KL(t, e, r, n, a, i) { const o = Hr; return N(), Z("div", qL, [ (N(!0), Z(Qe, null, Jt(r.resources, (s) => (N(), Z("div", { key: s.id, class: "resource" }, [ s.id === "pubmed" ? (N(), ye(o, { key: 0, class: "button", id: "open-pubmed-button", icon: t.ElIconNotebook, onClick: (u) => i.openUrl(s.url) }, { default: U(() => [ ze(" Open publications in PubMed ") ]), _: 2 }, 1032, ["icon", "onClick"])) : he("", !0) ]))), 128)) ]); } const UL = /* @__PURE__ */ Ur(HL, [["render", KL], ["__scopeId", "data-v-4f8d8b0f"]]), GL = (t) => t.replace(/\w\S*/g, (e) => e.charAt(0).toUpperCase() + e.substr(1).toLowerCase()), WL = function(t) { return t ? t.charAt(0).toUpperCase() + t.slice(1) : ""; }, YL = { name: "ProvenancePopup", props: { tooltipEntry: { type: Object, default: () => ({ destinations: [], origins: [], components: [], destinationsWithDatasets: [], originsWithDatasets: [], componentsWithDatasets: [], resource: void 0 }) } }, inject: ["getFeaturesAlert"], data: function() { return { controller: void 0, activeSpecies: void 0, pubmedSearchUrl: "", loading: !1, showToolip: !1, showDetails: !1, originDescriptions: { motor: "is the location of the initial cell body of the circuit", sensory: "is the location of the initial cell body in the PNS circuit" }, componentsWithDatasets: [], uberons: [{ id: void 0, name: void 0 }] }; }, computed: { featuresAlert() { return this.getFeaturesAlert(); }, resources: function() { let t = []; return this.tooltipEntry && this.tooltipEntry.hyperlinks && (t = this.tooltipEntry.hyperlinks), t; }, originDescription: function() { return this.tooltipEntry && this.tooltipEntry.title && this.tooltipEntry.title.toLowerCase().includes("motor") ? this.originDescriptions.motor : this.originDescriptions.sensory; }, provSpeciesDescription: function() { let t = "Studied in"; return this.tooltipEntry.provenanceTaxonomyLabel.forEach((e) => { t += ` ${e},`; }), t = t.slice(0, -1), t += " species", t; } }, methods: { titleCase: function(t) { return GL(t); }, capitalise: function(t) { return WL(t); }, openUrl: function(t) { window.open(t, "_blank"); }, openAll: function() { Gi.emit("onActionClick", { type: "Facets", labels: this.tooltipEntry.componentsWithDatasets.map((t) => t.name) }); }, openAxons: function() { Gi.emit("onActionClick", { type: "Facets", labels: this.tooltipEntry.destinationsWithDatasets.map((t) => t.name) }); }, openDendrites: function() { Gi.emit("onActionClick", { type: "Facets", labels: this.tooltipEntry.originsWithDatasets.map((t) => t.name) }); }, pubmedSearchUrlUpdate: function(t) { this.pubmedSearchUrl = t; } } }, Ei = (t) => (po("data-v-ef9a0f6d"), t = t(), go(), t), ZL = { key: 0, class: "main" }, XL = { key: 0, class: "block" }, jL = { class: "title" }, QL = { key: 0, class: "subtitle" }, JL = { key: 1, class: "block" }, eI = { class: "title" }, tI = { key: 2, class: "attribute-title-container" }, rI = /* @__PURE__ */ Ei(() => /* @__PURE__ */ X("span", { class: "attribute-title" }, "Alert", -1)), nI = { style: { "word-break": "keep-all" } }, aI = { class: "content-container scrollbar" }, iI = { key: 0, class: "block" }, oI = { class: "attribute-title-container" }, sI = /* @__PURE__ */ Ei(() => /* @__PURE__ */ X("span", { class: "attribute-title" }, "Origin", -1)), lI = { style: { "word-break": "keep-all" } }, uI = /* @__PURE__ */ Ei(() => /* @__PURE__ */ X("i", null, "Origin", -1)), cI = ["origin-item-label"], dI = { key: 0, class: "separator" }, fI = { key: 1, class: "block" }, vI = /* @__PURE__ */ Ei(() => /* @__PURE__ */ X("div", { class: "attribute-title-container" }, [ /* @__PURE__ */ X("div", { class: "attribute-title" }, "Components") ], -1)), hI = ["component-item-label"], pI = { key: 0, class: "separator" }, gI = { key: 2, class: "block" }, mI = { class: "attribute-title-container" }, yI = /* @__PURE__ */ Ei(() => /* @__PURE__ */ X("span", { class: "attribute-title" }, "Destination", -1)), bI = /* @__PURE__ */ Ei(() => /* @__PURE__ */ X("span", { style: { "word-break": "keep-all" } }, [ /* @__PURE__ */ X("i", null, "Destination"), /* @__PURE__ */ ze(" is where the axons terminate ") ], -1)), wI = ["destination-item-label"], xI = { key: 0, class: "separator" }; function CI(t, e, r, n, a, i) { const o = O2, s = Vt, u = rc, l = qv, c = Gs, d = Hr, v = UL, h = ac; return r.tooltipEntry ? Ze((N(), Z("div", ZL, [ r.tooltipEntry.title ? (N(), Z("div", XL, [ X("div", jL, Ie(i.capitalise(r.tooltipEntry.title)), 1), r.tooltipEntry.provenanceTaxonomyLabel && r.tooltipEntry.provenanceTaxonomyLabel.length > 0 ? (N(), Z("div", QL, Ie(i.provSpeciesDescription), 1)) : he("", !0) ])) : (N(), Z("div", JL, [ X("div", eI, Ie(r.tooltipEntry.featureId), 1) ])), i.featuresAlert ? (N(), Z("div", tI, [ rI, J(u, { width: "250", trigger: "hover", teleported: !1, "popper-class": "popover-origin-help" }, { reference: U(() => [ J(s, { class: "info" }, { default: U(() => [ J(o) ]), _: 1 }) ]), default: U(() => [ X("span", nI, Ie(i.featuresAlert), 1) ]), _: 1 }) ])) : he("", !0), Ze(X("div", { class: "hide", id: "hide-path-info", onClick: e[0] || (e[0] = (f) => t.showDetails = !1) }, [ ze(" Hide path information "), J(s, null, { default: U(() => [ J(l) ]), _: 1 }) ], 512), [ [mt, t.showDetails] ]), Ze(X("div", { class: "hide", id: "show-path-info", onClick: e[1] || (e[1] = (f) => t.showDetails = !0) }, [ ze(" Show path information "), J(s, null, { default: U(() => [ J(c) ]), _: 1 }) ], 512), [ [mt, !t.showDetails] ]), J(ui, { name: "slide-fade" }, { default: U(() => [ Ze(X("div", aI, [ ze(Ie(r.tooltipEntry.paths) + " ", 1), r.tooltipEntry.origins && r.tooltipEntry.origins.length > 0 ? (N(), Z("div", iI, [ X("div", oI, [ sI, J(u, { width: "250", trigger: "hover", teleported: !1, "popper-class": "popover-origin-help" }, { reference: U(() => [ J(s, { class: "info" }, { default: U(() => [ J(o) ]), _: 1 }) ]), default: U(() => [ X("span", lI, [ uI, ze(" " + Ie(i.originDescription), 1) ]) ]), _: 1 }) ]), (N(!0), Z(Qe, null, Jt(r.tooltipEntry.origins, (f, p) => (N(), Z("div", { class: "attribute-content", "origin-item-label": f, key: f }, [ ze(Ie(i.capitalise(f)) + " ", 1), p != r.tooltipEntry.origins.length - 1 ? (N(), Z("div", dI)) : he("", !0) ], 8, cI))), 128)), Ze(J(d, { class: "button", id: "open-dendrites-button", onClick: i.openDendrites }, { default: U(() => [ ze(" Explore origin data ") ]), _: 1 }, 8, ["onClick"]), [ [ mt, r.tooltipEntry.originsWithDatasets && r.tooltipEntry.originsWithDatasets.length > 0 ] ]) ])) : he("", !0), r.tooltipEntry.components && r.tooltipEntry.components.length > 0 ? (N(), Z("div", fI, [ vI, (N(!0), Z(Qe, null, Jt(r.tooltipEntry.components, (f, p) => (N(), Z("div", { class: "attribute-content", "component-item-label": f, key: f }, [ ze(Ie(i.capitalise(f)) + " ", 1), p != r.tooltipEntry.components.length - 1 ? (N(), Z("div", pI)) : he("", !0) ], 8, hI))), 128)) ])) : he("", !0), r.tooltipEntry.destinations && r.tooltipEntry.destinations.length > 0 ? (N(), Z("div", gI, [ X("div", mI, [ yI, J(u, { width: "250", trigger: "hover", teleported: !1, "popper-class": "popover-origin-help" }, { reference: U(() => [ J(s, { class: "info" }, { default: U(() => [ J(o) ]), _: 1 }) ]), default: U(() => [ bI ]), _: 1 }) ]), (N(!0), Z(Qe, null, Jt(r.tooltipEntry.destinations, (f, p) => (N(), Z("div", { class: "attribute-content", "destination-item-label": f, key: f }, [ ze(Ie(i.capitalise(f)) + " ", 1), p != r.tooltipEntry.destinations.length - 1 ? (N(), Z("div", xI)) : he("", !0) ], 8, wI))), 128)), Ze(J(d, { class: "button", onClick: i.openAxons }, { default: U(() => [ ze(" Explore destination data ") ]), _: 1 }, 8, ["onClick"]), [ [ mt, r.tooltipEntry.destinationsWithDatasets && r.tooltipEntry.destinationsWithDatasets.length > 0 ] ]) ])) : he("", !0), Ze(J(d, { class: "button", onClick: i.openAll }, { default: U(() => [ ze(" Search for data on components ") ]), _: 1 }, 8, ["onClick"]), [ [ mt, r.tooltipEntry.componentsWithDatasets && r.tooltipEntry.componentsWithDatasets.length > 0 ] ]), J(v, { resources: i.resources }, null, 8, ["resources"]) ], 512), [ [mt, t.showDetails] ]) ]), _: 1 }) ])), [ [h, t.loading] ]) : he("", !0); } const EI = /* @__PURE__ */ Ur(YL, [["render", CI], ["__scopeId", "data-v-ef9a0f6d"]]), kI = { name: "Tooltip", props: { tooltipEntry: { type: Object }, annotationDisplay: { type: Boolean, default: !1 }, annotationEntry: { type: Object } }, mounted: function() { Gi.on("onActionClick", (t) => { this.$emit("onActionClick", t); }); } }, SI = { class: "tooltip-container", id: "tooltip-container" }; function TI(t, e, r, n, a, i) { const o = ZS, s = EI; return N(), Z("div", SI, [ r.annotationDisplay ? (N(), ye(o, { key: 0, annotationEntry: r.annotationEntry, onAnnotation: e[0] || (e[0] = (u) => t.$emit("annotation", u)) }, null, 8, ["annotationEntry"])) : (N(), ye(s, { key: 1, tooltipEntry: r.tooltipEntry }, null, 8, ["tooltipEntry"])) ]); } const UI = /* @__PURE__ */ Ur(kI, [["render", TI], ["__scopeId", "data-v-229b3988"]]), _I = { name: "TreeControls", props: { /** * The type of map that the TreeControls is used. Either "flatmap" or "scaffold". */ mapType: { type: String, required: !0 }, isReady: { type: Boolean, default: !0 }, /** * The title of the TreeControls. */ title: { type: String }, /** * The data of the tree. */ treeData: { type: Array, default: function() { return []; } }, showColourPicker: { type: Boolean, default: !1 }, /** * The active node of the tree. */ active: { type: [String, Array], required: !0 }, /** * The hover node of the tree. */ hover: { type: [String, Array], required: !0 }, enableFilter: { type: Boolean, default: !0 } }, data: function() { return { defaultExpandedKeys: ["All"], filterText: "", myPopperClass: "hide-scaffold-colour-popup", tooltipVisible: !1, tooltipLabel: "", tooltipAtBottom: !1 }; }, computed: { isFlatmap: function() { return this.mapType === "flatmap"; }, isScaffold: function() { return this.mapType === "scaffold"; }, nodeKey: function() { if (this.isFlatmap) return "key"; if (this.isScaffold) return "id"; }, expandedKeys: function() { if (this.isFlatmap) return this.defaultExpandedKeys; if (this.isScaffold) return []; } }, watch: { showColourPicker: { immediate: !0, handler: function() { this.showColourPicker ? this.myPopperClass = "showPicker" : this.myPopperClass = "hide-scaffold-colour-popup"; } }, filterText: { handler: function(t) { this.$refs.regionTree && this.$refs.regionTree.filter(t); } } }, methods: { filterNode: function(t, e) { return t ? e.label ? e.label.toLowerCase().includes(t.toLowerCase()) : !1 : !0; }, setColour: function(t, e) { this.$emit("setColour", t, e); }, getBackgroundStyles: function(t) { return "colour" in t ? { background: t.colour } : {}; }, nodeIsActive: function(t) { return this.active === t.models; }, nodeIsHover: function(t) { return this.hover === t.models; }, changeActiveByNode: function(t, e = !1) { this.isFlatmap ? t.models && this.$emit("changeActive", t.models) : this.isScaffold && (t.isPrimitives || t.isRegion) && this.$emit("changeActive", t, e); }, changeHoverByNode: function(t, e = !1) { this.isFlatmap ? t.models && this.$emit("changeHover", t.models) : this.isScaffold && t.isPrimitives && this.$emit("changeHover", t, e); }, checkChanged: function(t, e) { if (this.isFlatmap) { const r = e.checkedKeys.includes(t.key); t.key === "All" ? this.$emit("checkAll", r) : this.$emit("checkChanged", { key: t.key, value: r }); } else this.isScaffold && this.$emit("checkChanged", t, e); }, displayTooltip: function(t, e, r) { const a = r.target.closest(".el-tree-node__content"), i = a.clientWidth, o = a.getBoundingClientRect().x, s = a.querySelector(".lastChildInItem"); let u = 0; if (s) { const c = s.getBoundingClientRect(); u = c.x + c.width - o; } const l = u > i; this.tooltipVisible = l && e, this.tooltipLabel = t, this.tooltipAtBottom = 0.5 > r.layerY / this.$refs.treeContainer.clientHeight; } }, unmounted: function() { this.sortedPrimitiveGroups = void 0; }, mounted: function() { this.$refs.regionTree && this.$refs.regionTree.filter(this.filterText); } }, DI = { class: "selections-container" }, PI = { class: "title-text" }, OI = { class: "tree-container", ref: "treeContainer" }, LI = { class: "tooltip-text" }, II = ["onClick", "onMouseover", "onMouseenter"], FI = ["onClick", "onMouseover", "onMouseenter"], AI = { class: "lastChildInItem" }, MI = { key: 0, class: "node-options" }; function BI(t, e, r, n, a, i) { const o = So, s = Eo, u = Qs, l = rc, c = _k, d = LS, v = ac; return N(), Z("div", DI, [ r.title ? (N(), ye(u, { key: 0 }, { default: U(() => [ J(o, { span: 12 }, { default: U(() => [ X("div", PI, Ie(r.title), 1) ]), _: 1 }), r.enableFilter ? (N(), ye(o, { key: 0, span: 12 }, { default: U(() => [ X("div", null, [ J(s, { class: "tree-filter-input", modelValue: t.filterText, "onUpdate:modelValue": e[0] || (e[0] = (h) => t.filterText = h), placeholder: "Filter " + r.title }, null, 8, ["modelValue", "placeholder"]) ]) ]), _: 1 })) : he("", !0) ]), _: 1 })) : he("", !0), X("div", OI, [ X("div", { class: ie(["tree-tooltip", t.tooltipAtBottom ? "bottom" : ""]) }, [ J(l, { ref: "tooltip", visible: t.tooltipVisible && t.tooltipLabel !== "", placement: "top", "show-arrow": !1, teleported: !1, trigger: "manual", "popper-class": "tree-tooltip-popper", "virtual-triggering": "", width: 260 }, { default: U(() => [ X("div", LI, Ie(t.tooltipLabel), 1) ]), _: 1 }, 8, ["visible"]) ], 2), Ze((N(), ye(d, { ref: "regionTree", "element-loading-background": "rgba(0, 0, 0, 0.3)", "show-checkbox": "", "node-key": i.nodeKey, data: r.treeData, "check-strictly": !1, "expand-on-click-node": !1, "render-after-expand": !1, "default-expanded-keys": i.expandedKeys, onCheck: i.checkChanged, indent: 8, "filter-node-method": i.filterNode, class: ie([r.mapType === "flatmap" ? "hide_grandchildren_checkbox" : ""]) }, { default: U(({ node: h, data: f }) => [ r.mapType === "flatmap" ? (N(), Z("span", { key: 0, class: ie(["region-tree-node", { activeItem: i.nodeIsActive(f), hoverItem: i.nodeIsHover(f) }]), onClick: (p) => i.changeActiveByNode(f), onMouseover: (p) => i.changeHoverByNode(f, !1), onMouseenter: (p) => i.displayTooltip(h.label, !0, p), onMouseleave: e[1] || (e[1] = (p) => i.displayTooltip("", !1, p)) }, [ X("div", { style: lt(i.getBackgroundStyles(f)), class: "lastChildInItem" }, Ie(h.label), 5) ], 42, II)) : r.mapType === "scaffold" ? (N(), Z("span", { key: 1, class: ie(["region-tree-node", { activeItem: r.active.includes(f.id), hoverItem: r.hover.includes(f.id) }]), onClick: (p) => i.changeActiveByNode(f, !0), onMouseover: (p) => i.changeHoverByNode(f, !0, p), onMouseenter: (p) => i.displayTooltip(h.label, !0, p), onMouseleave: e[2] || (e[2] = (p) => i.displayTooltip("", !1, p)) }, [ f.isPrimitives ? (N(), ye(c, { key: 0, class: ie({ "show-picker": r.showColourPicker }), modelValue: f.activeColour, "onUpdate:modelValue": (p) => f.activeColour = p, size: "small", "popper-class": t.myPopperClass, onChange: (p) => i.setColour(f, p) }, null, 8, ["class", "modelValue", "onUpdate:modelValue", "popper-class", "onChange"])) : he("", !0), X("div", AI, [ X("span", null, Ie(h.label), 1), f.isTextureSlides ? (N(), Z("span", MI, " (Texture) ")) : he("", !0) ]) ], 42, FI)) : he("", !0) ]), _: 1 }, 8, ["node-key", "data", "default-expanded-keys", "onCheck", "filter-node-method", "class"])), [ [v, !r.isReady] ]) ], 512) ]); } const GI = /* @__PURE__ */ Ur(_I, [["render", BI], ["__scopeId", "data-v-823a8388"]]); export { ZS as AnnotationPopup, VI as ConnectivityGraph, HI as CopyToClipboard, RI as CreateTooltipContent, qI as DrawToolbar, KI as HelpModeDialog, UI as Tooltip, GI as TreeControls };