import { Loading as Ts, CircleCheck as Dl, CircleClose as As, Close as si, ArrowDown as ki, Warning as Os, WarningFilled as Ms, ArrowLeft as Ps } from "@element-plus/icons-vue";
import { getCurrentScope as Nl, onScopeDispose as _s, unref as v, getCurrentInstance as ge, onMounted as pe, nextTick as ce, ref as _, readonly as Ls, watch as W, warn as Bl, watchEffect as xs, onBeforeUnmount as Be, inject as q, computed as b, isRef as lt, shallowRef as ho, onBeforeMount as Vl, provide as fe, defineComponent as B, openBlock as S, createElementBlock as x, mergeProps as Nt, renderSlot as H, toRef as Je, onUnmounted as zl, createBlock as V, Transition as Bn, withCtx as k, withDirectives as ie, createElementVNode as R, normalizeClass as P, normalizeStyle as se, vShow as Ee, Fragment as he, createVNode as L, reactive as ut, onActivated as Hl, onUpdated as jl, resolveDynamicComponent as Re, createCommentVNode as z, cloneVNode as Kl, Text as Fs, Comment as Ul, Teleport as Wl, onDeactivated as ql, toDisplayString as ne, useSlots as Eo, toRaw as vo, withModifiers as le, vModelCheckbox as mo, createTextVNode as Z, toRefs as un, vModelRadio as Rs, h as Yt, createSlots as $s, resolveComponent as Fe, resolveDirective as Gl, toHandlerKey as Jl, renderList as Ye, withKeys as Cn, vModelText as Yl, createApp as Zl, createStaticVNode as Ql, markRaw as Ge } from "vue";
import { MapSvgIcon as Xl, MapSvgSpriteColor as eu } from "@abi-software/svg-sprite";
import { Tooltip as tu, TreeControls as nu, DrawToolbar as ou, fetchLabels as iu, getFlatmapFilterOptions as au } from "@abi-software/map-utilities";
import * as Ds from "https://cdn.jsdelivr.net/npm/@abi-software/flatmap-viewer@4.3.0/+esm";
import { AnnotationService as su } from "@abi-software/sparc-annotation";
import { defineStore as ru, mapState as lu } from "pinia";
const it = (e, t, { checkForDefaultPrevented: n = !0 } = {}) => (i) => {
const a = e == null ? void 0 : e(i);
if (n === !1 || !a)
return t == null ? void 0 : t(i);
};
var la;
const re = typeof window < "u", uu = (e) => typeof e == "string", Ns = () => {
}, ri = re && ((la = window == null ? void 0 : window.navigator) == null ? void 0 : la.userAgent) && /iP(ad|hone|od)/.test(window.navigator.userAgent);
function Ti(e) {
return typeof e == "function" ? e() : v(e);
}
function cu(e) {
return e;
}
function Vn(e) {
return Nl() ? (_s(e), !0) : !1;
}
function du(e, t = !0) {
ge() ? pe(e) : t ? e() : ce(e);
}
function ua(e, t, n = {}) {
const {
immediate: o = !0
} = n, i = _(!1);
let a = null;
function s() {
a && (clearTimeout(a), a = null);
}
function r() {
i.value = !1, s();
}
function l(...u) {
s(), i.value = !0, a = setTimeout(() => {
i.value = !1, a = null, e(...u);
}, Ti(t));
}
return o && (i.value = !0, re && l()), Vn(r), {
isPending: Ls(i),
start: l,
stop: r
};
}
function st(e) {
var t;
const n = Ti(e);
return (t = n == null ? void 0 : n.$el) != null ? t : n;
}
const Io = re ? window : void 0;
function ze(...e) {
let t, n, o, i;
if (uu(e[0]) || Array.isArray(e[0]) ? ([n, o, i] = e, t = Io) : [t, n, o, i] = e, !t)
return Ns;
Array.isArray(n) || (n = [n]), Array.isArray(o) || (o = [o]);
const a = [], s = () => {
a.forEach((c) => c()), a.length = 0;
}, r = (c, d, f, m) => (c.addEventListener(d, f, m), () => c.removeEventListener(d, f, m)), l = W(() => [st(t), Ti(i)], ([c, d]) => {
s(), c && a.push(...n.flatMap((f) => o.map((m) => r(c, f, m, d))));
}, { immediate: !0, flush: "post" }), u = () => {
l(), s();
};
return Vn(u), u;
}
let ca = !1;
function fu(e, t, n = {}) {
const { window: o = Io, ignore: i = [], capture: a = !0, detectIframe: s = !1 } = n;
if (!o)
return;
ri && !ca && (ca = !0, Array.from(o.document.body.children).forEach((f) => f.addEventListener("click", Ns)));
let r = !0;
const l = (f) => i.some((m) => {
if (typeof m == "string")
return Array.from(o.document.querySelectorAll(m)).some((p) => p === f.target || f.composedPath().includes(p));
{
const p = st(m);
return p && (f.target === p || f.composedPath().includes(p));
}
}), c = [
ze(o, "click", (f) => {
const m = st(e);
if (!(!m || m === f.target || f.composedPath().includes(m))) {
if (f.detail === 0 && (r = !l(f)), !r) {
r = !0;
return;
}
t(f);
}
}, { passive: !0, capture: a }),
ze(o, "pointerdown", (f) => {
const m = st(e);
m && (r = !f.composedPath().includes(m) && !l(f));
}, { passive: !0 }),
s && ze(o, "blur", (f) => {
var m;
const p = st(e);
((m = o.document.activeElement) == null ? void 0 : m.tagName) === "IFRAME" && !(p != null && p.contains(o.document.activeElement)) && t(f);
})
].filter(Boolean);
return () => c.forEach((f) => f());
}
function Bs(e, t = !1) {
const n = _(), o = () => n.value = !!e();
return o(), du(o, t), n;
}
const da = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, fa = "__vueuse_ssr_handlers__";
da[fa] = da[fa] || {};
var pa = Object.getOwnPropertySymbols, pu = Object.prototype.hasOwnProperty, hu = Object.prototype.propertyIsEnumerable, vu = (e, t) => {
var n = {};
for (var o in e)
pu.call(e, o) && t.indexOf(o) < 0 && (n[o] = e[o]);
if (e != null && pa)
for (var o of pa(e))
t.indexOf(o) < 0 && hu.call(e, o) && (n[o] = e[o]);
return n;
};
function bt(e, t, n = {}) {
const o = n, { window: i = Io } = o, a = vu(o, ["window"]);
let s;
const r = Bs(() => i && "ResizeObserver" in i), l = () => {
s && (s.disconnect(), s = void 0);
}, u = W(() => st(e), (d) => {
l(), r.value && i && d && (s = new ResizeObserver(t), s.observe(d, a));
}, { immediate: !0, flush: "post" }), c = () => {
l(), u();
};
return Vn(c), {
isSupported: r,
stop: c
};
}
var ha = Object.getOwnPropertySymbols, mu = Object.prototype.hasOwnProperty, gu = Object.prototype.propertyIsEnumerable, yu = (e, t) => {
var n = {};
for (var o in e)
mu.call(e, o) && t.indexOf(o) < 0 && (n[o] = e[o]);
if (e != null && ha)
for (var o of ha(e))
t.indexOf(o) < 0 && gu.call(e, o) && (n[o] = e[o]);
return n;
};
function bu(e, t, n = {}) {
const o = n, { window: i = Io } = o, a = yu(o, ["window"]);
let s;
const r = Bs(() => i && "MutationObserver" in i), l = () => {
s && (s.disconnect(), s = void 0);
}, u = W(() => st(e), (d) => {
l(), r.value && i && d && (s = new MutationObserver(t), s.observe(d, a));
}, { immediate: !0 }), c = () => {
l(), u();
};
return Vn(c), {
isSupported: r,
stop: c
};
}
var va;
(function(e) {
e.UP = "UP", e.RIGHT = "RIGHT", e.DOWN = "DOWN", e.LEFT = "LEFT", e.NONE = "NONE";
})(va || (va = {}));
var wu = Object.defineProperty, ma = Object.getOwnPropertySymbols, Su = Object.prototype.hasOwnProperty, Cu = Object.prototype.propertyIsEnumerable, ga = (e, t, n) => t in e ? wu(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, Eu = (e, t) => {
for (var n in t || (t = {}))
Su.call(t, n) && ga(e, n, t[n]);
if (ma)
for (var n of ma(t))
Cu.call(t, n) && ga(e, n, t[n]);
return e;
};
const Iu = {
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]
};
Eu({
linear: cu
}, Iu);
/**
* @vue/shared v3.5.13
* (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 Lt = () => {
}, ku = Object.prototype.hasOwnProperty, ya = (e, t) => ku.call(e, t), Ie = Array.isArray, Se = (e) => typeof e == "function", He = (e) => typeof e == "string", ke = (e) => e !== null && typeof e == "object", Tu = Object.prototype.toString, Au = (e) => Tu.call(e), Uo = (e) => Au(e).slice(8, -1), Vs = (e) => {
const t = /* @__PURE__ */ Object.create(null);
return (n) => t[n] || (t[n] = e(n));
}, Ou = /-(\w)/g, Mu = Vs(
(e) => e.replace(Ou, (t, n) => n ? n.toUpperCase() : "")
), Pu = /\B([A-Z])/g, _u = Vs(
(e) => e.replace(Pu, "-$1").toLowerCase()
);
var zs = typeof global == "object" && global && global.Object === Object && global, Lu = typeof self == "object" && self && self.Object === Object && self, tt = zs || Lu || Function("return this")(), Qe = tt.Symbol, Hs = Object.prototype, xu = Hs.hasOwnProperty, Fu = Hs.toString, En = Qe ? Qe.toStringTag : void 0;
function Ru(e) {
var t = xu.call(e, En), n = e[En];
try {
e[En] = void 0;
var o = !0;
} catch {
}
var i = Fu.call(e);
return o && (t ? e[En] = n : delete e[En]), i;
}
var $u = Object.prototype, Du = $u.toString;
function Nu(e) {
return Du.call(e);
}
var Bu = "[object Null]", Vu = "[object Undefined]", ba = Qe ? Qe.toStringTag : void 0;
function cn(e) {
return e == null ? e === void 0 ? Vu : Bu : ba && ba in Object(e) ? Ru(e) : Nu(e);
}
function en(e) {
return e != null && typeof e == "object";
}
var zu = "[object Symbol]";
function ko(e) {
return typeof e == "symbol" || en(e) && cn(e) == zu;
}
function Hu(e, t) {
for (var n = -1, o = e == null ? 0 : e.length, i = Array(o); ++n < o; )
i[n] = t(e[n], n, e);
return i;
}
var je = Array.isArray, ju = 1 / 0, wa = Qe ? Qe.prototype : void 0, Sa = wa ? wa.toString : void 0;
function js(e) {
if (typeof e == "string")
return e;
if (je(e))
return Hu(e, js) + "";
if (ko(e))
return Sa ? Sa.call(e) : "";
var t = e + "";
return t == "0" && 1 / e == -ju ? "-0" : t;
}
var Ku = /\s/;
function Uu(e) {
for (var t = e.length; t-- && Ku.test(e.charAt(t)); )
;
return t;
}
var Wu = /^\s+/;
function qu(e) {
return e && e.slice(0, Uu(e) + 1).replace(Wu, "");
}
function It(e) {
var t = typeof e;
return e != null && (t == "object" || t == "function");
}
var Ca = NaN, Gu = /^[-+]0x[0-9a-f]+$/i, Ju = /^0b[01]+$/i, Yu = /^0o[0-7]+$/i, Zu = parseInt;
function Ea(e) {
if (typeof e == "number")
return e;
if (ko(e))
return Ca;
if (It(e)) {
var t = typeof e.valueOf == "function" ? e.valueOf() : e;
e = It(t) ? t + "" : t;
}
if (typeof e != "string")
return e === 0 ? e : +e;
e = qu(e);
var n = Ju.test(e);
return n || Yu.test(e) ? Zu(e.slice(2), n ? 2 : 8) : Gu.test(e) ? Ca : +e;
}
function Ks(e) {
return e;
}
var Qu = "[object AsyncFunction]", Xu = "[object Function]", ec = "[object GeneratorFunction]", tc = "[object Proxy]";
function Us(e) {
if (!It(e))
return !1;
var t = cn(e);
return t == Xu || t == ec || t == Qu || t == tc;
}
var Wo = tt["__core-js_shared__"], Ia = function() {
var e = /[^.]+$/.exec(Wo && Wo.keys && Wo.keys.IE_PROTO || "");
return e ? "Symbol(src)_1." + e : "";
}();
function nc(e) {
return !!Ia && Ia in e;
}
var oc = Function.prototype, ic = oc.toString;
function Bt(e) {
if (e != null) {
try {
return ic.call(e);
} catch {
}
try {
return e + "";
} catch {
}
}
return "";
}
var ac = /[\\^$.*+?()[\]{}|]/g, sc = /^\[object .+?Constructor\]$/, rc = Function.prototype, lc = Object.prototype, uc = rc.toString, cc = lc.hasOwnProperty, dc = RegExp(
"^" + uc.call(cc).replace(ac, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
);
function fc(e) {
if (!It(e) || nc(e))
return !1;
var t = Us(e) ? dc : sc;
return t.test(Bt(e));
}
function pc(e, t) {
return e == null ? void 0 : e[t];
}
function Vt(e, t) {
var n = pc(e, t);
return fc(n) ? n : void 0;
}
var li = Vt(tt, "WeakMap");
function hc(e, t, n) {
switch (n.length) {
case 0:
return e.call(t);
case 1:
return e.call(t, n[0]);
case 2:
return e.call(t, n[0], n[1]);
case 3:
return e.call(t, n[0], n[1], n[2]);
}
return e.apply(t, n);
}
var vc = 800, mc = 16, gc = Date.now;
function yc(e) {
var t = 0, n = 0;
return function() {
var o = gc(), i = mc - (o - n);
if (n = o, i > 0) {
if (++t >= vc)
return arguments[0];
} else
t = 0;
return e.apply(void 0, arguments);
};
}
function bc(e) {
return function() {
return e;
};
}
var go = function() {
try {
var e = Vt(Object, "defineProperty");
return e({}, "", {}), e;
} catch {
}
}(), wc = go ? function(e, t) {
return go(e, "toString", {
configurable: !0,
enumerable: !1,
value: bc(t),
writable: !0
});
} : Ks, Sc = yc(wc);
function Cc(e, t, n, o) {
e.length;
for (var i = n + 1; i--; )
if (t(e[i], i, e))
return i;
return -1;
}
var Ec = 9007199254740991, Ic = /^(?:0|[1-9]\d*)$/;
function Ai(e, t) {
var n = typeof e;
return t = t ?? Ec, !!t && (n == "number" || n != "symbol" && Ic.test(e)) && e > -1 && e % 1 == 0 && e < t;
}
function kc(e, t, n) {
t == "__proto__" && go ? go(e, t, {
configurable: !0,
enumerable: !0,
value: n,
writable: !0
}) : e[t] = n;
}
function Oi(e, t) {
return e === t || e !== e && t !== t;
}
var Tc = Object.prototype, Ac = Tc.hasOwnProperty;
function Oc(e, t, n) {
var o = e[t];
(!(Ac.call(e, t) && Oi(o, n)) || n === void 0 && !(t in e)) && kc(e, t, n);
}
var ka = Math.max;
function Mc(e, t, n) {
return t = ka(t === void 0 ? e.length - 1 : t, 0), function() {
for (var o = arguments, i = -1, a = ka(o.length - t, 0), s = Array(a); ++i < a; )
s[i] = o[t + i];
i = -1;
for (var r = Array(t + 1); ++i < t; )
r[i] = o[i];
return r[t] = n(s), hc(e, this, r);
};
}
var Pc = 9007199254740991;
function Mi(e) {
return typeof e == "number" && e > -1 && e % 1 == 0 && e <= Pc;
}
function _c(e) {
return e != null && Mi(e.length) && !Us(e);
}
var Lc = Object.prototype;
function xc(e) {
var t = e && e.constructor, n = typeof t == "function" && t.prototype || Lc;
return e === n;
}
function Fc(e, t) {
for (var n = -1, o = Array(e); ++n < e; )
o[n] = t(n);
return o;
}
var Rc = "[object Arguments]";
function Ta(e) {
return en(e) && cn(e) == Rc;
}
var Ws = Object.prototype, $c = Ws.hasOwnProperty, Dc = Ws.propertyIsEnumerable, Pi = Ta(/* @__PURE__ */ function() {
return arguments;
}()) ? Ta : function(e) {
return en(e) && $c.call(e, "callee") && !Dc.call(e, "callee");
};
function Nc() {
return !1;
}
var qs = typeof exports == "object" && exports && !exports.nodeType && exports, Aa = qs && typeof module == "object" && module && !module.nodeType && module, Bc = Aa && Aa.exports === qs, Oa = Bc ? tt.Buffer : void 0, Vc = Oa ? Oa.isBuffer : void 0, ui = Vc || Nc, zc = "[object Arguments]", Hc = "[object Array]", jc = "[object Boolean]", Kc = "[object Date]", Uc = "[object Error]", Wc = "[object Function]", qc = "[object Map]", Gc = "[object Number]", Jc = "[object Object]", Yc = "[object RegExp]", Zc = "[object Set]", Qc = "[object String]", Xc = "[object WeakMap]", ed = "[object ArrayBuffer]", td = "[object DataView]", nd = "[object Float32Array]", od = "[object Float64Array]", id = "[object Int8Array]", ad = "[object Int16Array]", sd = "[object Int32Array]", rd = "[object Uint8Array]", ld = "[object Uint8ClampedArray]", ud = "[object Uint16Array]", cd = "[object Uint32Array]", ae = {};
ae[nd] = ae[od] = ae[id] = ae[ad] = ae[sd] = ae[rd] = ae[ld] = ae[ud] = ae[cd] = !0;
ae[zc] = ae[Hc] = ae[ed] = ae[jc] = ae[td] = ae[Kc] = ae[Uc] = ae[Wc] = ae[qc] = ae[Gc] = ae[Jc] = ae[Yc] = ae[Zc] = ae[Qc] = ae[Xc] = !1;
function dd(e) {
return en(e) && Mi(e.length) && !!ae[cn(e)];
}
function fd(e) {
return function(t) {
return e(t);
};
}
var Gs = typeof exports == "object" && exports && !exports.nodeType && exports, An = Gs && typeof module == "object" && module && !module.nodeType && module, pd = An && An.exports === Gs, qo = pd && zs.process, Ma = function() {
try {
var e = An && An.require && An.require("util").types;
return e || qo && qo.binding && qo.binding("util");
} catch {
}
}(), Pa = Ma && Ma.isTypedArray, Js = Pa ? fd(Pa) : dd, hd = Object.prototype, vd = hd.hasOwnProperty;
function md(e, t) {
var n = je(e), o = !n && Pi(e), i = !n && !o && ui(e), a = !n && !o && !i && Js(e), s = n || o || i || a, r = s ? Fc(e.length, String) : [], l = r.length;
for (var u in e)
vd.call(e, u) && !(s && // Safari 9 has enumerable `arguments.length` in strict mode.
(u == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
i && (u == "offset" || u == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays.
a && (u == "buffer" || u == "byteLength" || u == "byteOffset") || // Skip index properties.
Ai(u, l))) && r.push(u);
return r;
}
function gd(e, t) {
return function(n) {
return e(t(n));
};
}
var yd = gd(Object.keys, Object), bd = Object.prototype, wd = bd.hasOwnProperty;
function Sd(e) {
if (!xc(e))
return yd(e);
var t = [];
for (var n in Object(e))
wd.call(e, n) && n != "constructor" && t.push(n);
return t;
}
function Ys(e) {
return _c(e) ? md(e) : Sd(e);
}
var Cd = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, Ed = /^\w*$/;
function _i(e, t) {
if (je(e))
return !1;
var n = typeof e;
return n == "number" || n == "symbol" || n == "boolean" || e == null || ko(e) ? !0 : Ed.test(e) || !Cd.test(e) || t != null && e in Object(t);
}
var _n = Vt(Object, "create");
function Id() {
this.__data__ = _n ? _n(null) : {}, this.size = 0;
}
function kd(e) {
var t = this.has(e) && delete this.__data__[e];
return this.size -= t ? 1 : 0, t;
}
var Td = "__lodash_hash_undefined__", Ad = Object.prototype, Od = Ad.hasOwnProperty;
function Md(e) {
var t = this.__data__;
if (_n) {
var n = t[e];
return n === Td ? void 0 : n;
}
return Od.call(t, e) ? t[e] : void 0;
}
var Pd = Object.prototype, _d = Pd.hasOwnProperty;
function Ld(e) {
var t = this.__data__;
return _n ? t[e] !== void 0 : _d.call(t, e);
}
var xd = "__lodash_hash_undefined__";
function Fd(e, t) {
var n = this.__data__;
return this.size += this.has(e) ? 0 : 1, n[e] = _n && t === void 0 ? xd : t, this;
}
function Rt(e) {
var t = -1, n = e == null ? 0 : e.length;
for (this.clear(); ++t < n; ) {
var o = e[t];
this.set(o[0], o[1]);
}
}
Rt.prototype.clear = Id;
Rt.prototype.delete = kd;
Rt.prototype.get = Md;
Rt.prototype.has = Ld;
Rt.prototype.set = Fd;
function Rd() {
this.__data__ = [], this.size = 0;
}
function To(e, t) {
for (var n = e.length; n--; )
if (Oi(e[n][0], t))
return n;
return -1;
}
var $d = Array.prototype, Dd = $d.splice;
function Nd(e) {
var t = this.__data__, n = To(t, e);
if (n < 0)
return !1;
var o = t.length - 1;
return n == o ? t.pop() : Dd.call(t, n, 1), --this.size, !0;
}
function Bd(e) {
var t = this.__data__, n = To(t, e);
return n < 0 ? void 0 : t[n][1];
}
function Vd(e) {
return To(this.__data__, e) > -1;
}
function zd(e, t) {
var n = this.__data__, o = To(n, e);
return o < 0 ? (++this.size, n.push([e, t])) : n[o][1] = t, this;
}
function ft(e) {
var t = -1, n = e == null ? 0 : e.length;
for (this.clear(); ++t < n; ) {
var o = e[t];
this.set(o[0], o[1]);
}
}
ft.prototype.clear = Rd;
ft.prototype.delete = Nd;
ft.prototype.get = Bd;
ft.prototype.has = Vd;
ft.prototype.set = zd;
var Ln = Vt(tt, "Map");
function Hd() {
this.size = 0, this.__data__ = {
hash: new Rt(),
map: new (Ln || ft)(),
string: new Rt()
};
}
function jd(e) {
var t = typeof e;
return t == "string" || t == "number" || t == "symbol" || t == "boolean" ? e !== "__proto__" : e === null;
}
function Ao(e, t) {
var n = e.__data__;
return jd(t) ? n[typeof t == "string" ? "string" : "hash"] : n.map;
}
function Kd(e) {
var t = Ao(this, e).delete(e);
return this.size -= t ? 1 : 0, t;
}
function Ud(e) {
return Ao(this, e).get(e);
}
function Wd(e) {
return Ao(this, e).has(e);
}
function qd(e, t) {
var n = Ao(this, e), o = n.size;
return n.set(e, t), this.size += n.size == o ? 0 : 1, this;
}
function pt(e) {
var t = -1, n = e == null ? 0 : e.length;
for (this.clear(); ++t < n; ) {
var o = e[t];
this.set(o[0], o[1]);
}
}
pt.prototype.clear = Hd;
pt.prototype.delete = Kd;
pt.prototype.get = Ud;
pt.prototype.has = Wd;
pt.prototype.set = qd;
var Gd = "Expected a function";
function Li(e, t) {
if (typeof e != "function" || t != null && typeof t != "function")
throw new TypeError(Gd);
var n = function() {
var o = arguments, i = t ? t.apply(this, o) : o[0], a = n.cache;
if (a.has(i))
return a.get(i);
var s = e.apply(this, o);
return n.cache = a.set(i, s) || a, s;
};
return n.cache = new (Li.Cache || pt)(), n;
}
Li.Cache = pt;
var Jd = 500;
function Yd(e) {
var t = Li(e, function(o) {
return n.size === Jd && n.clear(), o;
}), n = t.cache;
return t;
}
var Zd = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g, Qd = /\\(\\)?/g, Xd = Yd(function(e) {
var t = [];
return e.charCodeAt(0) === 46 && t.push(""), e.replace(Zd, function(n, o, i, a) {
t.push(i ? a.replace(Qd, "$1") : o || n);
}), t;
});
function ef(e) {
return e == null ? "" : js(e);
}
function Oo(e, t) {
return je(e) ? e : _i(e, t) ? [e] : Xd(ef(e));
}
var tf = 1 / 0;
function zn(e) {
if (typeof e == "string" || ko(e))
return e;
var t = e + "";
return t == "0" && 1 / e == -tf ? "-0" : t;
}
function xi(e, t) {
t = Oo(t, e);
for (var n = 0, o = t.length; e != null && n < o; )
e = e[zn(t[n++])];
return n && n == o ? e : void 0;
}
function at(e, t, n) {
var o = e == null ? void 0 : xi(e, t);
return o === void 0 ? n : o;
}
function Zs(e, t) {
for (var n = -1, o = t.length, i = e.length; ++n < o; )
e[i + n] = t[n];
return e;
}
var _a = Qe ? Qe.isConcatSpreadable : void 0;
function nf(e) {
return je(e) || Pi(e) || !!(_a && e && e[_a]);
}
function of(e, t, n, o, i) {
var a = -1, s = e.length;
for (n || (n = nf), i || (i = []); ++a < s; ) {
var r = e[a];
n(r) ? Zs(i, r) : i[i.length] = r;
}
return i;
}
function af(e) {
var t = e == null ? 0 : e.length;
return t ? of(e) : [];
}
function sf(e) {
return Sc(Mc(e, void 0, af), e + "");
}
function St() {
if (!arguments.length)
return [];
var e = arguments[0];
return je(e) ? e : [e];
}
function rf() {
this.__data__ = new ft(), this.size = 0;
}
function lf(e) {
var t = this.__data__, n = t.delete(e);
return this.size = t.size, n;
}
function uf(e) {
return this.__data__.get(e);
}
function cf(e) {
return this.__data__.has(e);
}
var df = 200;
function ff(e, t) {
var n = this.__data__;
if (n instanceof ft) {
var o = n.__data__;
if (!Ln || o.length < df - 1)
return o.push([e, t]), this.size = ++n.size, this;
n = this.__data__ = new pt(o);
}
return n.set(e, t), this.size = n.size, this;
}
function rt(e) {
var t = this.__data__ = new ft(e);
this.size = t.size;
}
rt.prototype.clear = rf;
rt.prototype.delete = lf;
rt.prototype.get = uf;
rt.prototype.has = cf;
rt.prototype.set = ff;
function pf(e, t) {
for (var n = -1, o = e == null ? 0 : e.length, i = 0, a = []; ++n < o; ) {
var s = e[n];
t(s, n, e) && (a[i++] = s);
}
return a;
}
function hf() {
return [];
}
var vf = Object.prototype, mf = vf.propertyIsEnumerable, La = Object.getOwnPropertySymbols, gf = La ? function(e) {
return e == null ? [] : (e = Object(e), pf(La(e), function(t) {
return mf.call(e, t);
}));
} : hf;
function yf(e, t, n) {
var o = t(e);
return je(e) ? o : Zs(o, n(e));
}
function xa(e) {
return yf(e, Ys, gf);
}
var ci = Vt(tt, "DataView"), di = Vt(tt, "Promise"), fi = Vt(tt, "Set"), Fa = "[object Map]", bf = "[object Object]", Ra = "[object Promise]", $a = "[object Set]", Da = "[object WeakMap]", Na = "[object DataView]", wf = Bt(ci), Sf = Bt(Ln), Cf = Bt(di), Ef = Bt(fi), If = Bt(li), wt = cn;
(ci && wt(new ci(new ArrayBuffer(1))) != Na || Ln && wt(new Ln()) != Fa || di && wt(di.resolve()) != Ra || fi && wt(new fi()) != $a || li && wt(new li()) != Da) && (wt = function(e) {
var t = cn(e), n = t == bf ? e.constructor : void 0, o = n ? Bt(n) : "";
if (o)
switch (o) {
case wf:
return Na;
case Sf:
return Fa;
case Cf:
return Ra;
case Ef:
return $a;
case If:
return Da;
}
return t;
});
var Ba = tt.Uint8Array, kf = "__lodash_hash_undefined__";
function Tf(e) {
return this.__data__.set(e, kf), this;
}
function Af(e) {
return this.__data__.has(e);
}
function yo(e) {
var t = -1, n = e == null ? 0 : e.length;
for (this.__data__ = new pt(); ++t < n; )
this.add(e[t]);
}
yo.prototype.add = yo.prototype.push = Tf;
yo.prototype.has = Af;
function Of(e, t) {
for (var n = -1, o = e == null ? 0 : e.length; ++n < o; )
if (t(e[n], n, e))
return !0;
return !1;
}
function Mf(e, t) {
return e.has(t);
}
var Pf = 1, _f = 2;
function Qs(e, t, n, o, i, a) {
var s = n & Pf, r = e.length, l = t.length;
if (r != l && !(s && l > r))
return !1;
var u = a.get(e), c = a.get(t);
if (u && c)
return u == t && c == e;
var d = -1, f = !0, m = n & _f ? new yo() : void 0;
for (a.set(e, t), a.set(t, e); ++d < r; ) {
var p = e[d], h = t[d];
if (o)
var g = s ? o(h, p, d, t, e, a) : o(p, h, d, e, t, a);
if (g !== void 0) {
if (g)
continue;
f = !1;
break;
}
if (m) {
if (!Of(t, function(y, w) {
if (!Mf(m, w) && (p === y || i(p, y, n, o, a)))
return m.push(w);
})) {
f = !1;
break;
}
} else if (!(p === h || i(p, h, n, o, a))) {
f = !1;
break;
}
}
return a.delete(e), a.delete(t), f;
}
function Lf(e) {
var t = -1, n = Array(e.size);
return e.forEach(function(o, i) {
n[++t] = [i, o];
}), n;
}
function xf(e) {
var t = -1, n = Array(e.size);
return e.forEach(function(o) {
n[++t] = o;
}), n;
}
var Ff = 1, Rf = 2, $f = "[object Boolean]", Df = "[object Date]", Nf = "[object Error]", Bf = "[object Map]", Vf = "[object Number]", zf = "[object RegExp]", Hf = "[object Set]", jf = "[object String]", Kf = "[object Symbol]", Uf = "[object ArrayBuffer]", Wf = "[object DataView]", Va = Qe ? Qe.prototype : void 0, Go = Va ? Va.valueOf : void 0;
function qf(e, t, n, o, i, a, s) {
switch (n) {
case Wf:
if (e.byteLength != t.byteLength || e.byteOffset != t.byteOffset)
return !1;
e = e.buffer, t = t.buffer;
case Uf:
return !(e.byteLength != t.byteLength || !a(new Ba(e), new Ba(t)));
case $f:
case Df:
case Vf:
return Oi(+e, +t);
case Nf:
return e.name == t.name && e.message == t.message;
case zf:
case jf:
return e == t + "";
case Bf:
var r = Lf;
case Hf:
var l = o & Ff;
if (r || (r = xf), e.size != t.size && !l)
return !1;
var u = s.get(e);
if (u)
return u == t;
o |= Rf, s.set(e, t);
var c = Qs(r(e), r(t), o, i, a, s);
return s.delete(e), c;
case Kf:
if (Go)
return Go.call(e) == Go.call(t);
}
return !1;
}
var Gf = 1, Jf = Object.prototype, Yf = Jf.hasOwnProperty;
function Zf(e, t, n, o, i, a) {
var s = n & Gf, r = xa(e), l = r.length, u = xa(t), c = u.length;
if (l != c && !s)
return !1;
for (var d = l; d--; ) {
var f = r[d];
if (!(s ? f in t : Yf.call(t, f)))
return !1;
}
var m = a.get(e), p = a.get(t);
if (m && p)
return m == t && p == e;
var h = !0;
a.set(e, t), a.set(t, e);
for (var g = s; ++d < l; ) {
f = r[d];
var y = e[f], w = t[f];
if (o)
var M = s ? o(w, y, f, t, e, a) : o(y, w, f, e, t, a);
if (!(M === void 0 ? y === w || i(y, w, n, o, a) : M)) {
h = !1;
break;
}
g || (g = f == "constructor");
}
if (h && !g) {
var T = e.constructor, E = t.constructor;
T != E && "constructor" in e && "constructor" in t && !(typeof T == "function" && T instanceof T && typeof E == "function" && E instanceof E) && (h = !1);
}
return a.delete(e), a.delete(t), h;
}
var Qf = 1, za = "[object Arguments]", Ha = "[object Array]", to = "[object Object]", Xf = Object.prototype, ja = Xf.hasOwnProperty;
function ep(e, t, n, o, i, a) {
var s = je(e), r = je(t), l = s ? Ha : wt(e), u = r ? Ha : wt(t);
l = l == za ? to : l, u = u == za ? to : u;
var c = l == to, d = u == to, f = l == u;
if (f && ui(e)) {
if (!ui(t))
return !1;
s = !0, c = !1;
}
if (f && !c)
return a || (a = new rt()), s || Js(e) ? Qs(e, t, n, o, i, a) : qf(e, t, l, n, o, i, a);
if (!(n & Qf)) {
var m = c && ja.call(e, "__wrapped__"), p = d && ja.call(t, "__wrapped__");
if (m || p) {
var h = m ? e.value() : e, g = p ? t.value() : t;
return a || (a = new rt()), i(h, g, n, o, a);
}
}
return f ? (a || (a = new rt()), Zf(e, t, n, o, i, a)) : !1;
}
function Mo(e, t, n, o, i) {
return e === t ? !0 : e == null || t == null || !en(e) && !en(t) ? e !== e && t !== t : ep(e, t, n, o, Mo, i);
}
var tp = 1, np = 2;
function op(e, t, n, o) {
var i = n.length, a = i;
if (e == null)
return !a;
for (e = Object(e); i--; ) {
var s = n[i];
if (s[2] ? s[1] !== e[s[0]] : !(s[0] in e))
return !1;
}
for (; ++i < a; ) {
s = n[i];
var r = s[0], l = e[r], u = s[1];
if (s[2]) {
if (l === void 0 && !(r in e))
return !1;
} else {
var c = new rt(), d;
if (!(d === void 0 ? Mo(u, l, tp | np, o, c) : d))
return !1;
}
}
return !0;
}
function Xs(e) {
return e === e && !It(e);
}
function ip(e) {
for (var t = Ys(e), n = t.length; n--; ) {
var o = t[n], i = e[o];
t[n] = [o, i, Xs(i)];
}
return t;
}
function er(e, t) {
return function(n) {
return n == null ? !1 : n[e] === t && (t !== void 0 || e in Object(n));
};
}
function ap(e) {
var t = ip(e);
return t.length == 1 && t[0][2] ? er(t[0][0], t[0][1]) : function(n) {
return n === e || op(n, e, t);
};
}
function sp(e, t) {
return e != null && t in Object(e);
}
function rp(e, t, n) {
t = Oo(t, e);
for (var o = -1, i = t.length, a = !1; ++o < i; ) {
var s = zn(t[o]);
if (!(a = e != null && n(e, s)))
break;
e = e[s];
}
return a || ++o != i ? a : (i = e == null ? 0 : e.length, !!i && Mi(i) && Ai(s, i) && (je(e) || Pi(e)));
}
function tr(e, t) {
return e != null && rp(e, t, sp);
}
var lp = 1, up = 2;
function cp(e, t) {
return _i(e) && Xs(t) ? er(zn(e), t) : function(n) {
var o = at(n, e);
return o === void 0 && o === t ? tr(n, e) : Mo(t, o, lp | up);
};
}
function dp(e) {
return function(t) {
return t == null ? void 0 : t[e];
};
}
function fp(e) {
return function(t) {
return xi(t, e);
};
}
function pp(e) {
return _i(e) ? dp(zn(e)) : fp(e);
}
function hp(e) {
return typeof e == "function" ? e : e == null ? Ks : typeof e == "object" ? je(e) ? cp(e[0], e[1]) : ap(e) : pp(e);
}
var Jo = function() {
return tt.Date.now();
}, vp = "Expected a function", mp = Math.max, gp = Math.min;
function yp(e, t, n) {
var o, i, a, s, r, l, u = 0, c = !1, d = !1, f = !0;
if (typeof e != "function")
throw new TypeError(vp);
t = Ea(t) || 0, It(n) && (c = !!n.leading, d = "maxWait" in n, a = d ? mp(Ea(n.maxWait) || 0, t) : a, f = "trailing" in n ? !!n.trailing : f);
function m(A) {
var O = o, D = i;
return o = i = void 0, u = A, s = e.apply(D, O), s;
}
function p(A) {
return u = A, r = setTimeout(y, t), c ? m(A) : s;
}
function h(A) {
var O = A - l, D = A - u, N = t - O;
return d ? gp(N, a - D) : N;
}
function g(A) {
var O = A - l, D = A - u;
return l === void 0 || O >= t || O < 0 || d && D >= a;
}
function y() {
var A = Jo();
if (g(A))
return w(A);
r = setTimeout(y, h(A));
}
function w(A) {
return r = void 0, f && o ? m(A) : (o = i = void 0, s);
}
function M() {
r !== void 0 && clearTimeout(r), u = 0, o = l = i = r = void 0;
}
function T() {
return r === void 0 ? s : w(Jo());
}
function E() {
var A = Jo(), O = g(A);
if (o = arguments, i = this, l = A, O) {
if (r === void 0)
return p(l);
if (d)
return clearTimeout(r), r = setTimeout(y, t), m(l);
}
return r === void 0 && (r = setTimeout(y, t)), s;
}
return E.cancel = M, E.flush = T, E;
}
function bp(e, t, n) {
var o = e == null ? 0 : e.length;
if (!o)
return -1;
var i = o - 1;
return Cc(e, hp(t), i);
}
function pi(e) {
for (var t = -1, n = e == null ? 0 : e.length, o = {}; ++t < n; ) {
var i = e[t];
o[i[0]] = i[1];
}
return o;
}
function bo(e, t) {
return Mo(e, t);
}
function Po(e) {
return e == null;
}
function nr(e) {
return e === void 0;
}
function wp(e, t, n, o) {
if (!It(e))
return e;
t = Oo(t, e);
for (var i = -1, a = t.length, s = a - 1, r = e; r != null && ++i < a; ) {
var l = zn(t[i]), u = n;
if (l === "__proto__" || l === "constructor" || l === "prototype")
return e;
if (i != s) {
var c = r[l];
u = void 0, u === void 0 && (u = It(c) ? c : Ai(t[i + 1]) ? [] : {});
}
Oc(r, l, u), r = r[l];
}
return e;
}
function Sp(e, t, n) {
for (var o = -1, i = t.length, a = {}; ++o < i; ) {
var s = t[o], r = xi(e, s);
n(r, s) && wp(a, Oo(s, e), r);
}
return a;
}
function Cp(e, t) {
return Sp(e, t, function(n, o) {
return tr(e, o);
});
}
var or = sf(function(e, t) {
return e == null ? {} : Cp(e, t);
});
const Ct = (e) => e === void 0, ct = (e) => typeof e == "boolean", ve = (e) => typeof e == "number", xt = (e) => typeof Element > "u" ? !1 : e instanceof Element, xn = (e) => Po(e), Ep = (e) => He(e) ? !Number.isNaN(Number(e)) : !1, Ip = (e = "") => e.replace(/[|\\{}()[\]^$+*?.]/g, "\\$&").replace(/-/g, "\\x2d"), Ka = (e) => Object.keys(e);
class ir extends Error {
constructor(t) {
super(t), this.name = "ElementPlusError";
}
}
function ar(e, t) {
throw new ir(`[${e}] ${t}`);
}
function Oe(e, t) {
if (process.env.NODE_ENV !== "production") {
const n = He(e) ? new ir(`[${e}] ${t}`) : e;
console.warn(n);
}
}
const kp = "utils/dom/style", sr = (e = "") => e.split(" ").filter((t) => !!t.trim()), Ua = (e, t) => {
if (!e || !t)
return !1;
if (t.includes(" "))
throw new Error("className should not contain space.");
return e.classList.contains(t);
}, hi = (e, t) => {
!e || !t.trim() || e.classList.add(...sr(t));
}, Fn = (e, t) => {
!e || !t.trim() || e.classList.remove(...sr(t));
}, Zt = (e, t) => {
var n;
if (!re || !e || !t)
return "";
let o = Mu(t);
o === "float" && (o = "cssFloat");
try {
const i = e.style[o];
if (i)
return i;
const a = (n = document.defaultView) == null ? void 0 : n.getComputedStyle(e, "");
return a ? a[o] : "";
} catch {
return e.style[o];
}
};
function $t(e, t = "px") {
if (!e)
return "";
if (ve(e) || Ep(e))
return `${e}${t}`;
if (He(e))
return e;
Oe(kp, "binding value must be a string or number");
}
let no;
const Tp = (e) => {
var t;
if (!re)
return 0;
if (no !== void 0)
return no;
const n = document.createElement("div");
n.className = `${e}-scrollbar__wrap`, n.style.visibility = "hidden", n.style.width = "100px", n.style.position = "absolute", n.style.top = "-9999px", document.body.appendChild(n);
const o = n.offsetWidth;
n.style.overflow = "scroll";
const i = document.createElement("div");
i.style.width = "100%", n.appendChild(i);
const a = i.offsetWidth;
return (t = n.parentNode) == null || t.removeChild(n), no = o - a, no;
};
function Ap(e, t) {
if (!re)
return;
if (!t) {
e.scrollTop = 0;
return;
}
const n = [];
let o = t.offsetParent;
for (; o !== null && e !== o && e.contains(o); )
n.push(o), o = o.offsetParent;
const i = t.offsetTop + n.reduce((l, u) => l + u.offsetTop, 0), a = i + t.offsetHeight, s = e.scrollTop, r = s + e.clientHeight;
i < s ? e.scrollTop = i : a > r && (e.scrollTop = a - e.clientHeight);
}
const rr = "__epPropKey", U = (e) => e, Op = (e) => ke(e) && !!e[rr], _o = (e, t) => {
if (!ke(e) || Op(e))
return e;
const { values: n, required: o, default: i, type: a, validator: s } = e, l = {
type: a,
required: !!o,
validator: n || s ? (u) => {
let c = !1, d = [];
if (n && (d = Array.from(n), ya(e, "default") && d.push(i), c || (c = d.includes(u))), s && (c || (c = s(u))), !c && d.length > 0) {
const f = [...new Set(d)].map((m) => JSON.stringify(m)).join(", ");
Bl(`Invalid prop: validation failed${t ? ` for prop "${t}"` : ""}. Expected one of [${f}], got value ${JSON.stringify(u)}.`);
}
return c;
} : void 0,
[rr]: !0
};
return ya(e, "default") && (l.default = i), l;
}, Q = (e) => pi(Object.entries(e).map(([t, n]) => [
t,
_o(n, t)
])), tn = U([
String,
Object,
Function
]), Mp = {
Close: si
}, Pp = {
validating: Ts,
success: Dl,
error: As
}, Me = (e, t) => {
if (e.install = (n) => {
for (const o of [e, ...Object.values(t ?? {})])
n.component(o.name, o);
}, t)
for (const [n, o] of Object.entries(t))
e[n] = o;
return e;
}, _p = (e, t) => (e.install = (n) => {
n.directive(t, e);
}, e), zt = (e) => (e.install = Lt, e), Lp = (...e) => (t) => {
e.forEach((n) => {
Se(n) ? n(t) : n.value = t;
});
}, Rn = {
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"
}, we = "update:modelValue", Fi = "change", lr = ["", "default", "small", "large"];
var co = /* @__PURE__ */ ((e) => (e[e.TEXT = 1] = "TEXT", e[e.CLASS = 2] = "CLASS", e[e.STYLE = 4] = "STYLE", e[e.PROPS = 8] = "PROPS", e[e.FULL_PROPS = 16] = "FULL_PROPS", e[e.HYDRATE_EVENTS = 32] = "HYDRATE_EVENTS", e[e.STABLE_FRAGMENT = 64] = "STABLE_FRAGMENT", e[e.KEYED_FRAGMENT = 128] = "KEYED_FRAGMENT", e[e.UNKEYED_FRAGMENT = 256] = "UNKEYED_FRAGMENT", e[e.NEED_PATCH = 512] = "NEED_PATCH", e[e.DYNAMIC_SLOTS = 1024] = "DYNAMIC_SLOTS", e[e.HOISTED = -1] = "HOISTED", e[e.BAIL = -2] = "BAIL", e))(co || {});
const xp = (e) => /([\uAC00-\uD7AF\u3130-\u318F])+/gi.test(e), In = (e) => e, Xt = ({ from: e, replacement: t, scope: n, version: o, ref: i, type: a = "API" }, s) => {
W(() => v(s), (r) => {
r && Oe(n, `[${a}] ${e} is about to be deprecated in version ${o}, please use ${t} instead.
For more detail, please visit: ${i}
`);
}, {
immediate: !0
});
}, Fp = (e, t, n, o) => {
let i = {
offsetX: 0,
offsetY: 0
};
const a = (u) => {
const c = u.clientX, d = u.clientY, { offsetX: f, offsetY: m } = i, p = e.value.getBoundingClientRect(), h = p.left, g = p.top, y = p.width, w = p.height, M = document.documentElement.clientWidth, T = document.documentElement.clientHeight, E = -h + f, A = -g + m, O = M - h - y + f, D = T - g - w + m, N = (I) => {
let K = f + I.clientX - c, J = m + I.clientY - d;
o != null && o.value || (K = Math.min(Math.max(K, E), O), J = Math.min(Math.max(J, A), D)), i = {
offsetX: K,
offsetY: J
}, e.value && (e.value.style.transform = `translate(${$t(K)}, ${$t(J)})`);
}, j = () => {
document.removeEventListener("mousemove", N), document.removeEventListener("mouseup", j);
};
document.addEventListener("mousemove", N), document.addEventListener("mouseup", j);
}, s = () => {
t.value && e.value && t.value.addEventListener("mousedown", a);
}, r = () => {
t.value && e.value && t.value.removeEventListener("mousedown", a);
}, l = () => {
i = {
offsetX: 0,
offsetY: 0
}, e.value && (e.value.style.transform = "none");
};
return pe(() => {
xs(() => {
n.value ? s() : r();
});
}), Be(() => {
r();
}), {
resetPosition: l
};
};
var Rp = {
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 $p = (e) => (t, n) => Dp(t, n, v(e)), Dp = (e, t, n) => at(n, e, e).replace(/\{(\w+)\}/g, (o, i) => {
var a;
return `${(a = t == null ? void 0 : t[i]) != null ? a : `{${i}}`}`;
}), Np = (e) => {
const t = b(() => v(e).name), n = lt(e) ? e : _(e);
return {
lang: t,
locale: n,
t: $p(e)
};
}, ur = Symbol("localeContextKey"), Ri = (e) => {
const t = e || q(ur, _());
return Np(b(() => t.value || Rp));
}, On = "el", Bp = "is-", Pt = (e, t, n, o, i) => {
let a = `${e}-${t}`;
return n && (a += `-${n}`), o && (a += `__${o}`), i && (a += `--${i}`), a;
}, cr = Symbol("namespaceContextKey"), $i = (e) => {
const t = e || (ge() ? q(cr, _(On)) : _(On));
return b(() => v(t) || On);
}, ee = (e, t) => {
const n = $i(t);
return {
namespace: n,
b: (h = "") => Pt(n.value, e, h, "", ""),
e: (h) => h ? Pt(n.value, e, "", h, "") : "",
m: (h) => h ? Pt(n.value, e, "", "", h) : "",
be: (h, g) => h && g ? Pt(n.value, e, h, g, "") : "",
em: (h, g) => h && g ? Pt(n.value, e, "", h, g) : "",
bm: (h, g) => h && g ? Pt(n.value, e, h, "", g) : "",
bem: (h, g, y) => h && g && y ? Pt(n.value, e, h, g, y) : "",
is: (h, ...g) => {
const y = g.length >= 1 ? g[0] : !0;
return h && y ? `${Bp}${h}` : "";
},
cssVar: (h) => {
const g = {};
for (const y in h)
h[y] && (g[`--${n.value}-${y}`] = h[y]);
return g;
},
cssVarName: (h) => `--${n.value}-${h}`,
cssVarBlock: (h) => {
const g = {};
for (const y in h)
h[y] && (g[`--${n.value}-${e}-${y}`] = h[y]);
return g;
},
cssVarBlockName: (h) => `--${n.value}-${e}-${h}`
};
}, Vp = (e, t = {}) => {
lt(e) || ar("[useLockscreen]", "You need to pass a ref param to this function");
const n = t.ns || ee("popup"), o = b(() => n.bm("parent", "hidden"));
if (!re || Ua(document.body, o.value))
return;
let i = 0, a = !1, s = "0";
const r = () => {
setTimeout(() => {
Fn(document == null ? void 0 : document.body, o.value), a && document && (document.body.style.width = s);
}, 200);
};
W(e, (l) => {
if (!l) {
r();
return;
}
a = !Ua(document.body, o.value), a && (s = document.body.style.width), i = Tp(n.namespace.value);
const u = document.documentElement.clientHeight < document.body.scrollHeight, c = Zt(document.body, "overflowY");
i > 0 && (u || c === "scroll") && a && (document.body.style.width = `calc(100% - ${i}px)`), hi(document.body, o.value);
}), _s(() => r());
}, zp = _o({
type: U(Boolean),
default: null
}), Hp = _o({
type: U(Function)
}), jp = (e) => {
const t = `update:${e}`, n = `onUpdate:${e}`, o = [t], i = {
[e]: zp,
[n]: Hp
};
return {
useModelToggle: ({
indicator: s,
toggleReason: r,
shouldHideWhenRouteChanges: l,
shouldProceed: u,
onShow: c,
onHide: d
}) => {
const f = ge(), { emit: m } = f, p = f.props, h = b(() => Se(p[n])), g = b(() => p[e] === null), y = (O) => {
s.value !== !0 && (s.value = !0, r && (r.value = O), Se(c) && c(O));
}, w = (O) => {
s.value !== !1 && (s.value = !1, r && (r.value = O), Se(d) && d(O));
}, M = (O) => {
if (p.disabled === !0 || Se(u) && !u())
return;
const D = h.value && re;
D && m(t, !0), (g.value || !D) && y(O);
}, T = (O) => {
if (p.disabled === !0 || !re)
return;
const D = h.value && re;
D && m(t, !1), (g.value || !D) && w(O);
}, E = (O) => {
ct(O) && (p.disabled && O ? h.value && m(t, !1) : s.value !== O && (O ? y() : w()));
}, A = () => {
s.value ? T() : M();
};
return W(() => p[e], E), l && f.appContext.config.globalProperties.$route !== void 0 && W(() => ({
...f.proxy.$route
}), () => {
l.value && s.value && T();
}), pe(() => {
E(p[e]);
}), {
hide: T,
show: M,
toggle: A,
hasUpdateHandler: h
};
},
useModelToggleProps: i,
useModelToggleEmits: o
};
}, dr = (e) => {
const t = ge();
return b(() => {
var n, o;
return (o = (n = t == null ? void 0 : t.proxy) == null ? void 0 : n.$props) == null ? void 0 : o[e];
});
};
var Te = "top", De = "bottom", Ne = "right", Ae = "left", Di = "auto", Hn = [Te, De, Ne, Ae], nn = "start", $n = "end", Kp = "clippingParents", fr = "viewport", kn = "popper", Up = "reference", Wa = Hn.reduce(function(e, t) {
return e.concat([t + "-" + nn, t + "-" + $n]);
}, []), Lo = [].concat(Hn, [Di]).reduce(function(e, t) {
return e.concat([t, t + "-" + nn, t + "-" + $n]);
}, []), Wp = "beforeRead", qp = "read", Gp = "afterRead", Jp = "beforeMain", Yp = "main", Zp = "afterMain", Qp = "beforeWrite", Xp = "write", eh = "afterWrite", th = [Wp, qp, Gp, Jp, Yp, Zp, Qp, Xp, eh];
function Xe(e) {
return e ? (e.nodeName || "").toLowerCase() : null;
}
function Ke(e) {
if (e == null) return window;
if (e.toString() !== "[object Window]") {
var t = e.ownerDocument;
return t && t.defaultView || window;
}
return e;
}
function on(e) {
var t = Ke(e).Element;
return e instanceof t || e instanceof Element;
}
function $e(e) {
var t = Ke(e).HTMLElement;
return e instanceof t || e instanceof HTMLElement;
}
function Ni(e) {
if (typeof ShadowRoot > "u") return !1;
var t = Ke(e).ShadowRoot;
return e instanceof t || e instanceof ShadowRoot;
}
function nh(e) {
var t = e.state;
Object.keys(t.elements).forEach(function(n) {
var o = t.styles[n] || {}, i = t.attributes[n] || {}, a = t.elements[n];
!$e(a) || !Xe(a) || (Object.assign(a.style, o), Object.keys(i).forEach(function(s) {
var r = i[s];
r === !1 ? a.removeAttribute(s) : a.setAttribute(s, r === !0 ? "" : r);
}));
});
}
function oh(e) {
var t = e.state, n = { popper: { position: t.options.strategy, left: "0", top: "0", margin: "0" }, arrow: { position: "absolute" }, reference: {} };
return Object.assign(t.elements.popper.style, n.popper), t.styles = n, t.elements.arrow && Object.assign(t.elements.arrow.style, n.arrow), function() {
Object.keys(t.elements).forEach(function(o) {
var i = t.elements[o], a = t.attributes[o] || {}, s = Object.keys(t.styles.hasOwnProperty(o) ? t.styles[o] : n[o]), r = s.reduce(function(l, u) {
return l[u] = "", l;
}, {});
!$e(i) || !Xe(i) || (Object.assign(i.style, r), Object.keys(a).forEach(function(l) {
i.removeAttribute(l);
}));
});
};
}
var pr = { name: "applyStyles", enabled: !0, phase: "write", fn: nh, effect: oh, requires: ["computeStyles"] };
function Ze(e) {
return e.split("-")[0];
}
var Ft = Math.max, wo = Math.min, an = Math.round;
function sn(e, t) {
t === void 0 && (t = !1);
var n = e.getBoundingClientRect(), o = 1, i = 1;
if ($e(e) && t) {
var a = e.offsetHeight, s = e.offsetWidth;
s > 0 && (o = an(n.width) / s || 1), a > 0 && (i = an(n.height) / a || 1);
}
return { width: n.width / o, height: n.height / i, top: n.top / i, right: n.right / o, bottom: n.bottom / i, left: n.left / o, x: n.left / o, y: n.top / i };
}
function Bi(e) {
var t = sn(e), n = e.offsetWidth, o = e.offsetHeight;
return Math.abs(t.width - n) <= 1 && (n = t.width), Math.abs(t.height - o) <= 1 && (o = t.height), { x: e.offsetLeft, y: e.offsetTop, width: n, height: o };
}
function hr(e, t) {
var n = t.getRootNode && t.getRootNode();
if (e.contains(t)) return !0;
if (n && Ni(n)) {
var o = t;
do {
if (o && e.isSameNode(o)) return !0;
o = o.parentNode || o.host;
} while (o);
}
return !1;
}
function dt(e) {
return Ke(e).getComputedStyle(e);
}
function ih(e) {
return ["table", "td", "th"].indexOf(Xe(e)) >= 0;
}
function kt(e) {
return ((on(e) ? e.ownerDocument : e.document) || window.document).documentElement;
}
function xo(e) {
return Xe(e) === "html" ? e : e.assignedSlot || e.parentNode || (Ni(e) ? e.host : null) || kt(e);
}
function qa(e) {
return !$e(e) || dt(e).position === "fixed" ? null : e.offsetParent;
}
function ah(e) {
var t = navigator.userAgent.toLowerCase().indexOf("firefox") !== -1, n = navigator.userAgent.indexOf("Trident") !== -1;
if (n && $e(e)) {
var o = dt(e);
if (o.position === "fixed") return null;
}
var i = xo(e);
for (Ni(i) && (i = i.host); $e(i) && ["html", "body"].indexOf(Xe(i)) < 0; ) {
var a = dt(i);
if (a.transform !== "none" || a.perspective !== "none" || a.contain === "paint" || ["transform", "perspective"].indexOf(a.willChange) !== -1 || t && a.willChange === "filter" || t && a.filter && a.filter !== "none") return i;
i = i.parentNode;
}
return null;
}
function jn(e) {
for (var t = Ke(e), n = qa(e); n && ih(n) && dt(n).position === "static"; ) n = qa(n);
return n && (Xe(n) === "html" || Xe(n) === "body" && dt(n).position === "static") ? t : n || ah(e) || t;
}
function Vi(e) {
return ["top", "bottom"].indexOf(e) >= 0 ? "x" : "y";
}
function Mn(e, t, n) {
return Ft(e, wo(t, n));
}
function sh(e, t, n) {
var o = Mn(e, t, n);
return o > n ? n : o;
}
function vr() {
return { top: 0, right: 0, bottom: 0, left: 0 };
}
function mr(e) {
return Object.assign({}, vr(), e);
}
function gr(e, t) {
return t.reduce(function(n, o) {
return n[o] = e, n;
}, {});
}
var rh = function(e, t) {
return e = typeof e == "function" ? e(Object.assign({}, t.rects, { placement: t.placement })) : e, mr(typeof e != "number" ? e : gr(e, Hn));
};
function lh(e) {
var t, n = e.state, o = e.name, i = e.options, a = n.elements.arrow, s = n.modifiersData.popperOffsets, r = Ze(n.placement), l = Vi(r), u = [Ae, Ne].indexOf(r) >= 0, c = u ? "height" : "width";
if (!(!a || !s)) {
var d = rh(i.padding, n), f = Bi(a), m = l === "y" ? Te : Ae, p = l === "y" ? De : Ne, h = n.rects.reference[c] + n.rects.reference[l] - s[l] - n.rects.popper[c], g = s[l] - n.rects.reference[l], y = jn(a), w = y ? l === "y" ? y.clientHeight || 0 : y.clientWidth || 0 : 0, M = h / 2 - g / 2, T = d[m], E = w - f[c] - d[p], A = w / 2 - f[c] / 2 + M, O = Mn(T, A, E), D = l;
n.modifiersData[o] = (t = {}, t[D] = O, t.centerOffset = O - A, t);
}
}
function uh(e) {
var t = e.state, n = e.options, o = n.element, i = o === void 0 ? "[data-popper-arrow]" : o;
i != null && (typeof i == "string" && (i = t.elements.popper.querySelector(i), !i) || !hr(t.elements.popper, i) || (t.elements.arrow = i));
}
var ch = { name: "arrow", enabled: !0, phase: "main", fn: lh, effect: uh, requires: ["popperOffsets"], requiresIfExists: ["preventOverflow"] };
function rn(e) {
return e.split("-")[1];
}
var dh = { top: "auto", right: "auto", bottom: "auto", left: "auto" };
function fh(e) {
var t = e.x, n = e.y, o = window, i = o.devicePixelRatio || 1;
return { x: an(t * i) / i || 0, y: an(n * i) / i || 0 };
}
function Ga(e) {
var t, n = e.popper, o = e.popperRect, i = e.placement, a = e.variation, s = e.offsets, r = e.position, l = e.gpuAcceleration, u = e.adaptive, c = e.roundOffsets, d = e.isFixed, f = s.x, m = f === void 0 ? 0 : f, p = s.y, h = p === void 0 ? 0 : p, g = typeof c == "function" ? c({ x: m, y: h }) : { x: m, y: h };
m = g.x, h = g.y;
var y = s.hasOwnProperty("x"), w = s.hasOwnProperty("y"), M = Ae, T = Te, E = window;
if (u) {
var A = jn(n), O = "clientHeight", D = "clientWidth";
if (A === Ke(n) && (A = kt(n), dt(A).position !== "static" && r === "absolute" && (O = "scrollHeight", D = "scrollWidth")), A = A, i === Te || (i === Ae || i === Ne) && a === $n) {
T = De;
var N = d && A === E && E.visualViewport ? E.visualViewport.height : A[O];
h -= N - o.height, h *= l ? 1 : -1;
}
if (i === Ae || (i === Te || i === De) && a === $n) {
M = Ne;
var j = d && A === E && E.visualViewport ? E.visualViewport.width : A[D];
m -= j - o.width, m *= l ? 1 : -1;
}
}
var I = Object.assign({ position: r }, u && dh), K = c === !0 ? fh({ x: m, y: h }) : { x: m, y: h };
if (m = K.x, h = K.y, l) {
var J;
return Object.assign({}, I, (J = {}, J[T] = w ? "0" : "", J[M] = y ? "0" : "", J.transform = (E.devicePixelRatio || 1) <= 1 ? "translate(" + m + "px, " + h + "px)" : "translate3d(" + m + "px, " + h + "px, 0)", J));
}
return Object.assign({}, I, (t = {}, t[T] = w ? h + "px" : "", t[M] = y ? m + "px" : "", t.transform = "", t));
}
function ph(e) {
var t = e.state, n = e.options, o = n.gpuAcceleration, i = o === void 0 ? !0 : o, a = n.adaptive, s = a === void 0 ? !0 : a, r = n.roundOffsets, l = r === void 0 ? !0 : r, u = { placement: Ze(t.placement), variation: rn(t.placement), popper: t.elements.popper, popperRect: t.rects.popper, gpuAcceleration: i, isFixed: t.options.strategy === "fixed" };
t.modifiersData.popperOffsets != null && (t.styles.popper = Object.assign({}, t.styles.popper, Ga(Object.assign({}, u, { offsets: t.modifiersData.popperOffsets, position: t.options.strategy, adaptive: s, roundOffsets: l })))), t.modifiersData.arrow != null && (t.styles.arrow = Object.assign({}, t.styles.arrow, Ga(Object.assign({}, u, { offsets: t.modifiersData.arrow, position: "absolute", adaptive: !1, roundOffsets: l })))), t.attributes.popper = Object.assign({}, t.attributes.popper, { "data-popper-placement": t.placement });
}
var yr = { name: "computeStyles", enabled: !0, phase: "beforeWrite", fn: ph, data: {} }, oo = { passive: !0 };
function hh(e) {
var t = e.state, n = e.instance, o = e.options, i = o.scroll, a = i === void 0 ? !0 : i, s = o.resize, r = s === void 0 ? !0 : s, l = Ke(t.elements.popper), u = [].concat(t.scrollParents.reference, t.scrollParents.popper);
return a && u.forEach(function(c) {
c.addEventListener("scroll", n.update, oo);
}), r && l.addEventListener("resize", n.update, oo), function() {
a && u.forEach(function(c) {
c.removeEventListener("scroll", n.update, oo);
}), r && l.removeEventListener("resize", n.update, oo);
};
}
var br = { name: "eventListeners", enabled: !0, phase: "write", fn: function() {
}, effect: hh, data: {} }, vh = { left: "right", right: "left", bottom: "top", top: "bottom" };
function fo(e) {
return e.replace(/left|right|bottom|top/g, function(t) {
return vh[t];
});
}
var mh = { start: "end", end: "start" };
function Ja(e) {
return e.replace(/start|end/g, function(t) {
return mh[t];
});
}
function zi(e) {
var t = Ke(e), n = t.pageXOffset, o = t.pageYOffset;
return { scrollLeft: n, scrollTop: o };
}
function Hi(e) {
return sn(kt(e)).left + zi(e).scrollLeft;
}
function gh(e) {
var t = Ke(e), n = kt(e), o = t.visualViewport, i = n.clientWidth, a = n.clientHeight, s = 0, r = 0;
return o && (i = o.width, a = o.height, /^((?!chrome|android).)*safari/i.test(navigator.userAgent) || (s = o.offsetLeft, r = o.offsetTop)), { width: i, height: a, x: s + Hi(e), y: r };
}
function yh(e) {
var t, n = kt(e), o = zi(e), i = (t = e.ownerDocument) == null ? void 0 : t.body, a = Ft(n.scrollWidth, n.clientWidth, i ? i.scrollWidth : 0, i ? i.clientWidth : 0), s = Ft(n.scrollHeight, n.clientHeight, i ? i.scrollHeight : 0, i ? i.clientHeight : 0), r = -o.scrollLeft + Hi(e), l = -o.scrollTop;
return dt(i || n).direction === "rtl" && (r += Ft(n.clientWidth, i ? i.clientWidth : 0) - a), { width: a, height: s, x: r, y: l };
}
function ji(e) {
var t = dt(e), n = t.overflow, o = t.overflowX, i = t.overflowY;
return /auto|scroll|overlay|hidden/.test(n + i + o);
}
function wr(e) {
return ["html", "body", "#document"].indexOf(Xe(e)) >= 0 ? e.ownerDocument.body : $e(e) && ji(e) ? e : wr(xo(e));
}
function Pn(e, t) {
var n;
t === void 0 && (t = []);
var o = wr(e), i = o === ((n = e.ownerDocument) == null ? void 0 : n.body), a = Ke(o), s = i ? [a].concat(a.visualViewport || [], ji(o) ? o : []) : o, r = t.concat(s);
return i ? r : r.concat(Pn(xo(s)));
}
function vi(e) {
return Object.assign({}, e, { left: e.x, top: e.y, right: e.x + e.width, bottom: e.y + e.height });
}
function bh(e) {
var t = sn(e);
return t.top = t.top + e.clientTop, t.left = t.left + e.clientLeft, t.bottom = t.top + e.clientHeight, t.right = t.left + e.clientWidth, t.width = e.clientWidth, t.height = e.clientHeight, t.x = t.left, t.y = t.top, t;
}
function Ya(e, t) {
return t === fr ? vi(gh(e)) : on(t) ? bh(t) : vi(yh(kt(e)));
}
function wh(e) {
var t = Pn(xo(e)), n = ["absolute", "fixed"].indexOf(dt(e).position) >= 0, o = n && $e(e) ? jn(e) : e;
return on(o) ? t.filter(function(i) {
return on(i) && hr(i, o) && Xe(i) !== "body";
}) : [];
}
function Sh(e, t, n) {
var o = t === "clippingParents" ? wh(e) : [].concat(t), i = [].concat(o, [n]), a = i[0], s = i.reduce(function(r, l) {
var u = Ya(e, l);
return r.top = Ft(u.top, r.top), r.right = wo(u.right, r.right), r.bottom = wo(u.bottom, r.bottom), r.left = Ft(u.left, r.left), r;
}, Ya(e, a));
return s.width = s.right - s.left, s.height = s.bottom - s.top, s.x = s.left, s.y = s.top, s;
}
function Sr(e) {
var t = e.reference, n = e.element, o = e.placement, i = o ? Ze(o) : null, a = o ? rn(o) : null, s = t.x + t.width / 2 - n.width / 2, r = t.y + t.height / 2 - n.height / 2, l;
switch (i) {
case Te:
l = { x: s, y: t.y - n.height };
break;
case De:
l = { x: s, y: t.y + t.height };
break;
case Ne:
l = { x: t.x + t.width, y: r };
break;
case Ae:
l = { x: t.x - n.width, y: r };
break;
default:
l = { x: t.x, y: t.y };
}
var u = i ? Vi(i) : null;
if (u != null) {
var c = u === "y" ? "height" : "width";
switch (a) {
case nn:
l[u] = l[u] - (t[c] / 2 - n[c] / 2);
break;
case $n:
l[u] = l[u] + (t[c] / 2 - n[c] / 2);
break;
}
}
return l;
}
function Dn(e, t) {
t === void 0 && (t = {});
var n = t, o = n.placement, i = o === void 0 ? e.placement : o, a = n.boundary, s = a === void 0 ? Kp : a, r = n.rootBoundary, l = r === void 0 ? fr : r, u = n.elementContext, c = u === void 0 ? kn : u, d = n.altBoundary, f = d === void 0 ? !1 : d, m = n.padding, p = m === void 0 ? 0 : m, h = mr(typeof p != "number" ? p : gr(p, Hn)), g = c === kn ? Up : kn, y = e.rects.popper, w = e.elements[f ? g : c], M = Sh(on(w) ? w : w.contextElement || kt(e.elements.popper), s, l), T = sn(e.elements.reference), E = Sr({ reference: T, element: y, strategy: "absolute", placement: i }), A = vi(Object.assign({}, y, E)), O = c === kn ? A : T, D = { top: M.top - O.top + h.top, bottom: O.bottom - M.bottom + h.bottom, left: M.left - O.left + h.left, right: O.right - M.right + h.right }, N = e.modifiersData.offset;
if (c === kn && N) {
var j = N[i];
Object.keys(D).forEach(function(I) {
var K = [Ne, De].indexOf(I) >= 0 ? 1 : -1, J = [Te, De].indexOf(I) >= 0 ? "y" : "x";
D[I] += j[J] * K;
});
}
return D;
}
function Ch(e, t) {
t === void 0 && (t = {});
var n = t, o = n.placement, i = n.boundary, a = n.rootBoundary, s = n.padding, r = n.flipVariations, l = n.allowedAutoPlacements, u = l === void 0 ? Lo : l, c = rn(o), d = c ? r ? Wa : Wa.filter(function(p) {
return rn(p) === c;
}) : Hn, f = d.filter(function(p) {
return u.indexOf(p) >= 0;
});
f.length === 0 && (f = d);
var m = f.reduce(function(p, h) {
return p[h] = Dn(e, { placement: h, boundary: i, rootBoundary: a, padding: s })[Ze(h)], p;
}, {});
return Object.keys(m).sort(function(p, h) {
return m[p] - m[h];
});
}
function Eh(e) {
if (Ze(e) === Di) return [];
var t = fo(e);
return [Ja(e), t, Ja(t)];
}
function Ih(e) {
var t = e.state, n = e.options, o = e.name;
if (!t.modifiersData[o]._skip) {
for (var i = n.mainAxis, a = i === void 0 ? !0 : i, s = n.altAxis, r = s === void 0 ? !0 : s, l = n.fallbackPlacements, u = n.padding, c = n.boundary, d = n.rootBoundary, f = n.altBoundary, m = n.flipVariations, p = m === void 0 ? !0 : m, h = n.allowedAutoPlacements, g = t.options.placement, y = Ze(g), w = y === g, M = l || (w || !p ? [fo(g)] : Eh(g)), T = [g].concat(M).reduce(function(We, Ce) {
return We.concat(Ze(Ce) === Di ? Ch(t, { placement: Ce, boundary: c, rootBoundary: d, padding: u, flipVariations: p, allowedAutoPlacements: h }) : Ce);
}, []), E = t.rects.reference, A = t.rects.popper, O = /* @__PURE__ */ new Map(), D = !0, N = T[0], j = 0; j < T.length; j++) {
var I = T[j], K = Ze(I), J = rn(I) === nn, de = [Te, De].indexOf(K) >= 0, Y = de ? "width" : "height", $ = Dn(t, { placement: I, boundary: c, rootBoundary: d, altBoundary: f, padding: u }), te = de ? J ? Ne : Ae : J ? De : Te;
E[Y] > A[Y] && (te = fo(te));
var xe = fo(te), ye = [];
if (a && ye.push($[K] <= 0), r && ye.push($[te] <= 0, $[xe] <= 0), ye.every(function(We) {
return We;
})) {
N = I, D = !1;
break;
}
O.set(I, ye);
}
if (D) for (var be = p ? 3 : 1, Pe = function(We) {
var Ce = T.find(function(ue) {
var Tt = O.get(ue);
if (Tt) return Tt.slice(0, We).every(function(ht) {
return ht;
});
});
if (Ce) return N = Ce, "break";
}, Ue = be; Ue > 0; Ue--) {
var jt = Pe(Ue);
if (jt === "break") break;
}
t.placement !== N && (t.modifiersData[o]._skip = !0, t.placement = N, t.reset = !0);
}
}
var kh = { name: "flip", enabled: !0, phase: "main", fn: Ih, requiresIfExists: ["offset"], data: { _skip: !1 } };
function Za(e, t, n) {
return n === void 0 && (n = { x: 0, y: 0 }), { top: e.top - t.height - n.y, right: e.right - t.width + n.x, bottom: e.bottom - t.height + n.y, left: e.left - t.width - n.x };
}
function Qa(e) {
return [Te, Ne, De, Ae].some(function(t) {
return e[t] >= 0;
});
}
function Th(e) {
var t = e.state, n = e.name, o = t.rects.reference, i = t.rects.popper, a = t.modifiersData.preventOverflow, s = Dn(t, { elementContext: "reference" }), r = Dn(t, { altBoundary: !0 }), l = Za(s, o), u = Za(r, i, a), c = Qa(l), d = Qa(u);
t.modifiersData[n] = { referenceClippingOffsets: l, popperEscapeOffsets: u, isReferenceHidden: c, hasPopperEscaped: d }, t.attributes.popper = Object.assign({}, t.attributes.popper, { "data-popper-reference-hidden": c, "data-popper-escaped": d });
}
var Ah = { name: "hide", enabled: !0, phase: "main", requiresIfExists: ["preventOverflow"], fn: Th };
function Oh(e, t, n) {
var o = Ze(e), i = [Ae, Te].indexOf(o) >= 0 ? -1 : 1, a = typeof n == "function" ? n(Object.assign({}, t, { placement: e })) : n, s = a[0], r = a[1];
return s = s || 0, r = (r || 0) * i, [Ae, Ne].indexOf(o) >= 0 ? { x: r, y: s } : { x: s, y: r };
}
function Mh(e) {
var t = e.state, n = e.options, o = e.name, i = n.offset, a = i === void 0 ? [0, 0] : i, s = Lo.reduce(function(c, d) {
return c[d] = Oh(d, t.rects, a), c;
}, {}), r = s[t.placement], l = r.x, u = r.y;
t.modifiersData.popperOffsets != null && (t.modifiersData.popperOffsets.x += l, t.modifiersData.popperOffsets.y += u), t.modifiersData[o] = s;
}
var Ph = { name: "offset", enabled: !0, phase: "main", requires: ["popperOffsets"], fn: Mh };
function _h(e) {
var t = e.state, n = e.name;
t.modifiersData[n] = Sr({ reference: t.rects.reference, element: t.rects.popper, strategy: "absolute", placement: t.placement });
}
var Cr = { name: "popperOffsets", enabled: !0, phase: "read", fn: _h, data: {} };
function Lh(e) {
return e === "x" ? "y" : "x";
}
function xh(e) {
var t = e.state, n = e.options, o = e.name, i = n.mainAxis, a = i === void 0 ? !0 : i, s = n.altAxis, r = s === void 0 ? !1 : s, l = n.boundary, u = n.rootBoundary, c = n.altBoundary, d = n.padding, f = n.tether, m = f === void 0 ? !0 : f, p = n.tetherOffset, h = p === void 0 ? 0 : p, g = Dn(t, { boundary: l, rootBoundary: u, padding: d, altBoundary: c }), y = Ze(t.placement), w = rn(t.placement), M = !w, T = Vi(y), E = Lh(T), A = t.modifiersData.popperOffsets, O = t.rects.reference, D = t.rects.popper, N = typeof h == "function" ? h(Object.assign({}, t.rects, { placement: t.placement })) : h, j = typeof N == "number" ? { mainAxis: N, altAxis: N } : Object.assign({ mainAxis: 0, altAxis: 0 }, N), I = t.modifiersData.offset ? t.modifiersData.offset[t.placement] : null, K = { x: 0, y: 0 };
if (A) {
if (a) {
var J, de = T === "y" ? Te : Ae, Y = T === "y" ? De : Ne, $ = T === "y" ? "height" : "width", te = A[T], xe = te + g[de], ye = te - g[Y], be = m ? -D[$] / 2 : 0, Pe = w === nn ? O[$] : D[$], Ue = w === nn ? -D[$] : -O[$], jt = t.elements.arrow, We = m && jt ? Bi(jt) : { width: 0, height: 0 }, Ce = t.modifiersData["arrow#persistent"] ? t.modifiersData["arrow#persistent"].padding : vr(), ue = Ce[de], Tt = Ce[Y], ht = Mn(0, O[$], We[$]), qn = M ? O[$] / 2 - be - ht - ue - j.mainAxis : Pe - ht - ue - j.mainAxis, Gn = M ? -O[$] / 2 + be + ht + Tt + j.mainAxis : Ue + ht + Tt + j.mainAxis, hn = t.elements.arrow && jn(t.elements.arrow), zo = hn ? T === "y" ? hn.clientTop || 0 : hn.clientLeft || 0 : 0, Jn = (J = I == null ? void 0 : I[T]) != null ? J : 0, Ho = te + qn - Jn - zo, jo = te + Gn - Jn, At = Mn(m ? wo(xe, Ho) : xe, te, m ? Ft(ye, jo) : ye);
A[T] = At, K[T] = At - te;
}
if (r) {
var vn, Kt = T === "x" ? Te : Ae, Yn = T === "x" ? De : Ne, nt = A[E], Ut = E === "y" ? "height" : "width", mn = nt + g[Kt], Zn = nt - g[Yn], Ot = [Te, Ae].indexOf(y) !== -1, gn = (vn = I == null ? void 0 : I[E]) != null ? vn : 0, yn = Ot ? mn : nt - O[Ut] - D[Ut] - gn + j.altAxis, bn = Ot ? nt + O[Ut] + D[Ut] - gn - j.altAxis : Zn, wn = m && Ot ? sh(yn, nt, bn) : Mn(m ? yn : mn, nt, m ? bn : Zn);
A[E] = wn, K[E] = wn - nt;
}
t.modifiersData[o] = K;
}
}
var Fh = { name: "preventOverflow", enabled: !0, phase: "main", fn: xh, requiresIfExists: ["offset"] };
function Rh(e) {
return { scrollLeft: e.scrollLeft, scrollTop: e.scrollTop };
}
function $h(e) {
return e === Ke(e) || !$e(e) ? zi(e) : Rh(e);
}
function Dh(e) {
var t = e.getBoundingClientRect(), n = an(t.width) / e.offsetWidth || 1, o = an(t.height) / e.offsetHeight || 1;
return n !== 1 || o !== 1;
}
function Nh(e, t, n) {
n === void 0 && (n = !1);
var o = $e(t), i = $e(t) && Dh(t), a = kt(t), s = sn(e, i), r = { scrollLeft: 0, scrollTop: 0 }, l = { x: 0, y: 0 };
return (o || !o && !n) && ((Xe(t) !== "body" || ji(a)) && (r = $h(t)), $e(t) ? (l = sn(t, !0), l.x += t.clientLeft, l.y += t.clientTop) : a && (l.x = Hi(a))), { x: s.left + r.scrollLeft - l.x, y: s.top + r.scrollTop - l.y, width: s.width, height: s.height };
}
function Bh(e) {
var t = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Set(), o = [];
e.forEach(function(a) {
t.set(a.name, a);
});
function i(a) {
n.add(a.name);
var s = [].concat(a.requires || [], a.requiresIfExists || []);
s.forEach(function(r) {
if (!n.has(r)) {
var l = t.get(r);
l && i(l);
}
}), o.push(a);
}
return e.forEach(function(a) {
n.has(a.name) || i(a);
}), o;
}
function Vh(e) {
var t = Bh(e);
return th.reduce(function(n, o) {
return n.concat(t.filter(function(i) {
return i.phase === o;
}));
}, []);
}
function zh(e) {
var t;
return function() {
return t || (t = new Promise(function(n) {
Promise.resolve().then(function() {
t = void 0, n(e());
});
})), t;
};
}
function Hh(e) {
var t = e.reduce(function(n, o) {
var i = n[o.name];
return n[o.name] = i ? Object.assign({}, i, o, { options: Object.assign({}, i.options, o.options), data: Object.assign({}, i.data, o.data) }) : o, n;
}, {});
return Object.keys(t).map(function(n) {
return t[n];
});
}
var Xa = { placement: "bottom", modifiers: [], strategy: "absolute" };
function es() {
for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++) t[n] = arguments[n];
return !t.some(function(o) {
return !(o && typeof o.getBoundingClientRect == "function");
});
}
function Ki(e) {
e === void 0 && (e = {});
var t = e, n = t.defaultModifiers, o = n === void 0 ? [] : n, i = t.defaultOptions, a = i === void 0 ? Xa : i;
return function(s, r, l) {
l === void 0 && (l = a);
var u = { placement: "bottom", orderedModifiers: [], options: Object.assign({}, Xa, a), modifiersData: {}, elements: { reference: s, popper: r }, attributes: {}, styles: {} }, c = [], d = !1, f = { state: u, setOptions: function(h) {
var g = typeof h == "function" ? h(u.options) : h;
p(), u.options = Object.assign({}, a, u.options, g), u.scrollParents = { reference: on(s) ? Pn(s) : s.contextElement ? Pn(s.contextElement) : [], popper: Pn(r) };
var y = Vh(Hh([].concat(o, u.options.modifiers)));
return u.orderedModifiers = y.filter(function(w) {
return w.enabled;
}), m(), f.update();
}, forceUpdate: function() {
if (!d) {
var h = u.elements, g = h.reference, y = h.popper;
if (es(g, y)) {
u.rects = { reference: Nh(g, jn(y), u.options.strategy === "fixed"), popper: Bi(y) }, u.reset = !1, u.placement = u.options.placement, u.orderedModifiers.forEach(function(D) {
return u.modifiersData[D.name] = Object.assign({}, D.data);
});
for (var w = 0; w < u.orderedModifiers.length; w++) {
if (u.reset === !0) {
u.reset = !1, w = -1;
continue;
}
var M = u.orderedModifiers[w], T = M.fn, E = M.options, A = E === void 0 ? {} : E, O = M.name;
typeof T == "function" && (u = T({ state: u, options: A, name: O, instance: f }) || u);
}
}
}
}, update: zh(function() {
return new Promise(function(h) {
f.forceUpdate(), h(u);
});
}), destroy: function() {
p(), d = !0;
} };
if (!es(s, r)) return f;
f.setOptions(l).then(function(h) {
!d && l.onFirstUpdate && l.onFirstUpdate(h);
});
function m() {
u.orderedModifiers.forEach(function(h) {
var g = h.name, y = h.options, w = y === void 0 ? {} : y, M = h.effect;
if (typeof M == "function") {
var T = M({ state: u, name: g, instance: f, options: w }), E = function() {
};
c.push(T || E);
}
});
}
function p() {
c.forEach(function(h) {
return h();
}), c = [];
}
return f;
};
}
Ki();
var jh = [br, Cr, yr, pr];
Ki({ defaultModifiers: jh });
var Kh = [br, Cr, yr, pr, Ph, kh, Fh, ch, Ah], Uh = Ki({ defaultModifiers: Kh });
const Wh = (e, t, n = {}) => {
const o = {
name: "updateState",
enabled: !0,
phase: "write",
fn: ({ state: l }) => {
const u = qh(l);
Object.assign(s.value, u);
},
requires: ["computeStyles"]
}, i = b(() => {
const { onFirstUpdate: l, placement: u, strategy: c, modifiers: d } = v(n);
return {
onFirstUpdate: l,
placement: u || "bottom",
strategy: c || "absolute",
modifiers: [
...d || [],
o,
{ name: "applyStyles", enabled: !1 }
]
};
}), a = ho(), s = _({
styles: {
popper: {
position: v(i).strategy,
left: "0",
top: "0"
},
arrow: {
position: "absolute"
}
},
attributes: {}
}), r = () => {
a.value && (a.value.destroy(), a.value = void 0);
};
return W(i, (l) => {
const u = v(a);
u && u.setOptions(l);
}, {
deep: !0
}), W([e, t], ([l, u]) => {
r(), !(!l || !u) && (a.value = Uh(l, u, v(i)));
}), Be(() => {
r();
}), {
state: b(() => {
var l;
return { ...((l = v(a)) == null ? void 0 : l.state) || {} };
}),
styles: b(() => v(s).styles),
attributes: b(() => v(s).attributes),
update: () => {
var l;
return (l = v(a)) == null ? void 0 : l.update();
},
forceUpdate: () => {
var l;
return (l = v(a)) == null ? void 0 : l.forceUpdate();
},
instanceRef: b(() => v(a))
};
};
function qh(e) {
const t = Object.keys(e.elements), n = pi(t.map((i) => [i, e.styles[i] || {}])), o = pi(t.map((i) => [i, e.attributes[i]]));
return {
styles: n,
attributes: o
};
}
const Er = (e) => {
if (!e)
return { onClick: Lt, onMousedown: Lt, onMouseup: Lt };
let t = !1, n = !1;
return { onClick: (s) => {
t && n && e(s), t = n = !1;
}, onMousedown: (s) => {
t = s.target === s.currentTarget;
}, onMouseup: (s) => {
n = s.target === s.currentTarget;
} };
};
function ts() {
let e;
const t = (o, i) => {
n(), e = window.setTimeout(o, i);
}, n = () => window.clearTimeout(e);
return Vn(() => n()), {
registerTimeout: t,
cancelTimeout: n
};
}
const mi = {
prefix: Math.floor(Math.random() * 1e4),
current: 0
}, Gh = Symbol("elIdInjection"), Ir = () => ge() ? q(Gh, mi) : mi, Dt = (e) => {
const t = Ir();
!re && t === mi && Oe("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 n = $i();
return b(() => v(e) || `${n.value}-id-${t.prefix}-${t.current++}`);
};
let Qt = [];
const ns = (e) => {
const t = e;
t.key === Rn.esc && Qt.forEach((n) => n(t));
}, Jh = (e) => {
pe(() => {
Qt.length === 0 && document.addEventListener("keydown", ns), re && Qt.push(e);
}), Be(() => {
Qt = Qt.filter((t) => t !== e), Qt.length === 0 && re && document.removeEventListener("keydown", ns);
});
};
let os;
const kr = () => {
const e = $i(), t = Ir(), n = b(() => `${e.value}-popper-container-${t.prefix}`), o = b(() => `#${n.value}`);
return {
id: n,
selector: o
};
}, Yh = (e) => {
const t = document.createElement("div");
return t.id = e, document.body.appendChild(t), t;
}, Zh = () => {
const { id: e, selector: t } = kr();
return Vl(() => {
re && (process.env.NODE_ENV === "test" || !os || !document.body.querySelector(t.value)) && (os = Yh(e.value));
}), {
id: e,
selector: t
};
}, Qh = Q({
showAfter: {
type: Number,
default: 0
},
hideAfter: {
type: Number,
default: 200
},
autoClose: {
type: Number,
default: 0
}
}), Xh = ({
showAfter: e,
hideAfter: t,
autoClose: n,
open: o,
close: i
}) => {
const { registerTimeout: a } = ts(), {
registerTimeout: s,
cancelTimeout: r
} = ts();
return {
onOpen: (c) => {
a(() => {
o(c);
const d = v(n);
ve(d) && d > 0 && s(() => {
i(c);
}, d);
}, v(e));
},
onClose: (c) => {
r(), a(() => {
i(c);
}, v(t));
}
};
}, Tr = Symbol("elForwardRef"), ev = (e) => {
fe(Tr, {
setForwardRef: (n) => {
e.value = n;
}
});
}, tv = (e) => ({
mounted(t) {
e(t);
},
updated(t) {
e(t);
},
unmounted() {
e(null);
}
}), is = {
current: 0
}, as = _(0), Ar = 2e3, ss = Symbol("elZIndexContextKey"), Or = Symbol("zIndexContextKey"), Ui = (e) => {
const t = ge() ? q(ss, is) : is, n = e || (ge() ? q(Or, void 0) : void 0), o = b(() => {
const s = v(n);
return ve(s) ? s : Ar;
}), i = b(() => o.value + as.value), a = () => (t.current++, as.value = t.current, i.value);
return !re && !q(ss) && Oe("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: o,
currentZIndex: i,
nextZIndex: a
};
}, dn = _o({
type: String,
values: lr,
required: !1
}), Mr = Symbol("size"), nv = () => {
const e = q(Mr, {});
return b(() => v(e.size) || "");
};
function ov(e, {
beforeFocus: t,
afterFocus: n,
beforeBlur: o,
afterBlur: i
} = {}) {
const a = ge(), { emit: s } = a, r = ho(), l = _(!1), u = (f) => {
Se(t) && t(f) || l.value || (l.value = !0, s("focus", f), n == null || n());
}, c = (f) => {
var m;
Se(o) && o(f) || f.relatedTarget && ((m = r.value) != null && m.contains(f.relatedTarget)) || (l.value = !1, s("blur", f), i == null || i());
}, d = () => {
var f, m;
(f = r.value) != null && f.contains(document.activeElement) && r.value !== document.activeElement || (m = e.value) == null || m.focus();
};
return W(r, (f) => {
f && f.setAttribute("tabindex", "-1");
}), ze(r, "focus", u, !0), ze(r, "blur", c, !0), ze(r, "click", d, !0), process.env.NODE_ENV === "test" && pe(() => {
const f = xt(e.value) ? e.value : document.querySelector("input,textarea");
f && (ze(f, "focus", u, !0), ze(f, "blur", c, !0));
}), {
isFocused: l,
wrapperRef: r,
handleFocus: u,
handleBlur: c
};
}
function iv({
afterComposition: e,
emit: t
}) {
const n = _(!1), o = (r) => {
t == null || t("compositionstart", r), n.value = !0;
}, i = (r) => {
var l;
t == null || t("compositionupdate", r);
const u = (l = r.target) == null ? void 0 : l.value, c = u[u.length - 1] || "";
n.value = !xp(c);
}, a = (r) => {
t == null || t("compositionend", r), n.value && (n.value = !1, ce(() => e(r)));
};
return {
isComposing: n,
handleComposition: (r) => {
r.type === "compositionend" ? a(r) : i(r);
},
handleCompositionStart: o,
handleCompositionUpdate: i,
handleCompositionEnd: a
};
}
const Pr = Symbol("emptyValuesContextKey"), av = "use-empty-values", sv = ["", void 0, null], rv = void 0, lv = Q({
emptyValues: Array,
valueOnClear: {
type: [String, Number, Boolean, Function],
default: void 0,
validator: (e) => Se(e) ? !e() : !e
}
}), uv = (e, t) => {
const n = ge() ? q(Pr, _({})) : _({}), o = b(() => e.emptyValues || n.value.emptyValues || sv), i = b(() => Se(e.valueOnClear) ? e.valueOnClear() : e.valueOnClear !== void 0 ? e.valueOnClear : Se(n.value.valueOnClear) ? n.value.valueOnClear() : n.value.valueOnClear !== void 0 ? n.value.valueOnClear : rv), a = (s) => o.value.includes(s);
return o.value.includes(i.value) || Oe(av, "value-on-clear should be a value of empty-values"), {
emptyValues: o,
valueOnClear: i,
isEmptyValue: a
};
}, cv = Q({
ariaLabel: String,
ariaOrientation: {
type: String,
values: ["horizontal", "vertical", "undefined"]
},
ariaControls: String
}), Ht = (e) => or(cv, e), _r = Symbol(), So = _();
function Fo(e, t = void 0) {
const n = ge() ? q(_r, So) : So;
return e ? b(() => {
var o, i;
return (i = (o = n.value) == null ? void 0 : o[e]) != null ? i : t;
}) : n;
}
function dv(e, t) {
const n = Fo(), o = ee(e, b(() => {
var r;
return ((r = n.value) == null ? void 0 : r.namespace) || On;
})), i = Ri(b(() => {
var r;
return (r = n.value) == null ? void 0 : r.locale;
})), a = Ui(b(() => {
var r;
return ((r = n.value) == null ? void 0 : r.zIndex) || Ar;
})), s = b(() => {
var r;
return v(t) || ((r = n.value) == null ? void 0 : r.size) || "";
});
return fv(b(() => v(n) || {})), {
ns: o,
locale: i,
zIndex: a,
size: s
};
}
const fv = (e, t, n = !1) => {
var o;
const i = !!ge(), a = i ? Fo() : void 0, s = (o = void 0) != null ? o : i ? fe : void 0;
if (!s) {
Oe("provideGlobalConfig", "provideGlobalConfig() can only be used inside setup().");
return;
}
const r = b(() => {
const l = v(e);
return a != null && a.value ? pv(a.value, l) : l;
});
return s(_r, r), s(ur, b(() => r.value.locale)), s(cr, b(() => r.value.namespace)), s(Or, b(() => r.value.zIndex)), s(Mr, {
size: b(() => r.value.size || "")
}), s(Pr, b(() => ({
emptyValues: r.value.emptyValues,
valueOnClear: r.value.valueOnClear
}))), (n || !So.value) && (So.value = r.value), r;
}, pv = (e, t) => {
const n = [.../* @__PURE__ */ new Set([...Ka(e), ...Ka(t)])], o = {};
for (const i of n)
o[i] = t[i] !== void 0 ? t[i] : e[i];
return o;
};
var X = (e, t) => {
const n = e.__vccOpts || e;
for (const [o, i] of t)
n[o] = i;
return n;
};
const hv = Q({
size: {
type: U([Number, String])
},
color: {
type: String
}
}), vv = B({
name: "ElIcon",
inheritAttrs: !1
}), mv = /* @__PURE__ */ B({
...vv,
props: hv,
setup(e) {
const t = e, n = ee("icon"), o = b(() => {
const { size: i, color: a } = t;
return !i && !a ? {} : {
fontSize: Ct(i) ? void 0 : $t(i),
"--color": a
};
});
return (i, a) => (S(), x("i", Nt({
class: v(n).b(),
style: v(o)
}, i.$attrs), [
H(i.$slots, "default")
], 16));
}
});
var gv = /* @__PURE__ */ X(mv, [["__file", "icon.vue"]]);
const et = Me(gv), Wi = Symbol("formContextKey"), Co = Symbol("formItemContextKey"), ln = (e, t = {}) => {
const n = _(void 0), o = t.prop ? n : dr("size"), i = t.global ? n : nv(), a = t.form ? { size: void 0 } : q(Wi, void 0), s = t.formItem ? { size: void 0 } : q(Co, void 0);
return b(() => o.value || v(e) || (s == null ? void 0 : s.size) || (a == null ? void 0 : a.size) || i.value || "");
}, Ro = (e) => {
const t = dr("disabled"), n = q(Wi, void 0);
return b(() => t.value || v(e) || (n == null ? void 0 : n.disabled) || !1);
}, fn = () => {
const e = q(Wi, void 0), t = q(Co, void 0);
return {
form: e,
formItem: t
};
}, $o = (e, {
formItemContext: t,
disableIdGeneration: n,
disableIdManagement: o
}) => {
n || (n = _(!1)), o || (o = _(!1));
const i = _();
let a;
const s = b(() => {
var r;
return !!(!(e.label || e.ariaLabel) && t && t.inputIds && ((r = t.inputIds) == null ? void 0 : r.length) <= 1);
});
return pe(() => {
a = W([Je(e, "id"), n], ([r, l]) => {
const u = r ?? (l ? void 0 : Dt().value);
u !== i.value && (t != null && t.removeInputId && (i.value && t.removeInputId(i.value), !(o != null && o.value) && !l && u && t.addInputId(u)), i.value = u);
}, { immediate: !0 });
}), zl(() => {
a && a(), t != null && t.removeInputId && i.value && t.removeInputId(i.value);
}), {
isLabeledByFormItem: s,
inputId: i
};
}, qt = 4, yv = {
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"
}
}, bv = ({
move: e,
size: t,
bar: n
}) => ({
[n.size]: t,
transform: `translate${n.axis}(${e}%)`
}), qi = Symbol("scrollbarContextKey"), wv = Q({
vertical: Boolean,
size: String,
move: Number,
ratio: {
type: Number,
required: !0
},
always: Boolean
}), Sv = "Thumb", Cv = /* @__PURE__ */ B({
__name: "thumb",
props: wv,
setup(e) {
const t = e, n = q(qi), o = ee("scrollbar");
n || ar(Sv, "can not inject scrollbar context");
const i = _(), a = _(), s = _({}), r = _(!1);
let l = !1, u = !1, c = re ? document.onselectstart : null;
const d = b(() => yv[t.vertical ? "vertical" : "horizontal"]), f = b(() => bv({
size: t.size,
move: t.move,
bar: d.value
})), m = b(() => i.value[d.value.offset] ** 2 / n.wrapElement[d.value.scrollSize] / t.ratio / a.value[d.value.offset]), p = (A) => {
var O;
if (A.stopPropagation(), A.ctrlKey || [1, 2].includes(A.button))
return;
(O = window.getSelection()) == null || O.removeAllRanges(), g(A);
const D = A.currentTarget;
D && (s.value[d.value.axis] = D[d.value.offset] - (A[d.value.client] - D.getBoundingClientRect()[d.value.direction]));
}, h = (A) => {
if (!a.value || !i.value || !n.wrapElement)
return;
const O = Math.abs(A.target.getBoundingClientRect()[d.value.direction] - A[d.value.client]), D = a.value[d.value.offset] / 2, N = (O - D) * 100 * m.value / i.value[d.value.offset];
n.wrapElement[d.value.scroll] = N * n.wrapElement[d.value.scrollSize] / 100;
}, g = (A) => {
A.stopImmediatePropagation(), l = !0, document.addEventListener("mousemove", y), document.addEventListener("mouseup", w), c = document.onselectstart, document.onselectstart = () => !1;
}, y = (A) => {
if (!i.value || !a.value || l === !1)
return;
const O = s.value[d.value.axis];
if (!O)
return;
const D = (i.value.getBoundingClientRect()[d.value.direction] - A[d.value.client]) * -1, N = a.value[d.value.offset] - O, j = (D - N) * 100 * m.value / i.value[d.value.offset];
n.wrapElement[d.value.scroll] = j * n.wrapElement[d.value.scrollSize] / 100;
}, w = () => {
l = !1, s.value[d.value.axis] = 0, document.removeEventListener("mousemove", y), document.removeEventListener("mouseup", w), E(), u && (r.value = !1);
}, M = () => {
u = !1, r.value = !!t.size;
}, T = () => {
u = !0, r.value = l;
};
Be(() => {
E(), document.removeEventListener("mouseup", w);
});
const E = () => {
document.onselectstart !== c && (document.onselectstart = c);
};
return ze(Je(n, "scrollbarElement"), "mousemove", M), ze(Je(n, "scrollbarElement"), "mouseleave", T), (A, O) => (S(), V(Bn, {
name: v(o).b("fade"),
persisted: ""
}, {
default: k(() => [
ie(R("div", {
ref_key: "instance",
ref: i,
class: P([v(o).e("bar"), v(o).is(v(d).key)]),
onMousedown: h
}, [
R("div", {
ref_key: "thumb",
ref: a,
class: P(v(o).e("thumb")),
style: se(v(f)),
onMousedown: p
}, null, 38)
], 34), [
[Ee, A.always || r.value]
])
]),
_: 1
}, 8, ["name"]));
}
});
var rs = /* @__PURE__ */ X(Cv, [["__file", "thumb.vue"]]);
const Ev = Q({
always: {
type: Boolean,
default: !0
},
minSize: {
type: Number,
required: !0
}
}), Iv = /* @__PURE__ */ B({
__name: "bar",
props: Ev,
setup(e, { expose: t }) {
const n = e, o = q(qi), i = _(0), a = _(0), s = _(""), r = _(""), l = _(1), u = _(1);
return t({
handleScroll: (f) => {
if (f) {
const m = f.offsetHeight - qt, p = f.offsetWidth - qt;
a.value = f.scrollTop * 100 / m * l.value, i.value = f.scrollLeft * 100 / p * u.value;
}
},
update: () => {
const f = o == null ? void 0 : o.wrapElement;
if (!f)
return;
const m = f.offsetHeight - qt, p = f.offsetWidth - qt, h = m ** 2 / f.scrollHeight, g = p ** 2 / f.scrollWidth, y = Math.max(h, n.minSize), w = Math.max(g, n.minSize);
l.value = h / (m - h) / (y / (m - y)), u.value = g / (p - g) / (w / (p - w)), r.value = y + qt < m ? `${y}px` : "", s.value = w + qt < p ? `${w}px` : "";
}
}), (f, m) => (S(), x(he, null, [
L(rs, {
move: i.value,
ratio: u.value,
size: s.value,
always: f.always
}, null, 8, ["move", "ratio", "size", "always"]),
L(rs, {
move: a.value,
ratio: l.value,
size: r.value,
vertical: "",
always: f.always
}, null, 8, ["move", "ratio", "size", "always"])
], 64));
}
});
var kv = /* @__PURE__ */ X(Iv, [["__file", "bar.vue"]]);
const Tv = Q({
height: {
type: [String, Number],
default: ""
},
maxHeight: {
type: [String, Number],
default: ""
},
native: {
type: Boolean,
default: !1
},
wrapStyle: {
type: U([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,
...Ht(["ariaLabel", "ariaOrientation"])
}), Av = {
scroll: ({
scrollTop: e,
scrollLeft: t
}) => [e, t].every(ve)
}, gi = "ElScrollbar", Ov = B({
name: gi
}), Mv = /* @__PURE__ */ B({
...Ov,
props: Tv,
emits: Av,
setup(e, { expose: t, emit: n }) {
const o = e, i = ee("scrollbar");
let a, s, r = 0, l = 0;
const u = _(), c = _(), d = _(), f = _(), m = b(() => {
const E = {};
return o.height && (E.height = $t(o.height)), o.maxHeight && (E.maxHeight = $t(o.maxHeight)), [o.wrapStyle, E];
}), p = b(() => [
o.wrapClass,
i.e("wrap"),
{ [i.em("wrap", "hidden-default")]: !o.native }
]), h = b(() => [i.e("view"), o.viewClass]), g = () => {
var E;
c.value && ((E = f.value) == null || E.handleScroll(c.value), r = c.value.scrollTop, l = c.value.scrollLeft, n("scroll", {
scrollTop: c.value.scrollTop,
scrollLeft: c.value.scrollLeft
}));
};
function y(E, A) {
ke(E) ? c.value.scrollTo(E) : ve(E) && ve(A) && c.value.scrollTo(E, A);
}
const w = (E) => {
if (!ve(E)) {
Oe(gi, "value must be a number");
return;
}
c.value.scrollTop = E;
}, M = (E) => {
if (!ve(E)) {
Oe(gi, "value must be a number");
return;
}
c.value.scrollLeft = E;
}, T = () => {
var E;
(E = f.value) == null || E.update();
};
return W(() => o.noresize, (E) => {
E ? (a == null || a(), s == null || s()) : ({ stop: a } = bt(d, T), s = ze("resize", T));
}, { immediate: !0 }), W(() => [o.maxHeight, o.height], () => {
o.native || ce(() => {
var E;
T(), c.value && ((E = f.value) == null || E.handleScroll(c.value));
});
}), fe(qi, ut({
scrollbarElement: u,
wrapElement: c
})), Hl(() => {
c.value && (c.value.scrollTop = r, c.value.scrollLeft = l);
}), pe(() => {
o.native || ce(() => {
T();
});
}), jl(() => T()), t({
wrapRef: c,
update: T,
scrollTo: y,
setScrollTop: w,
setScrollLeft: M,
handleScroll: g
}), (E, A) => (S(), x("div", {
ref_key: "scrollbarRef",
ref: u,
class: P(v(i).b())
}, [
R("div", {
ref_key: "wrapRef",
ref: c,
class: P(v(p)),
style: se(v(m)),
tabindex: E.tabindex,
onScroll: g
}, [
(S(), V(Re(E.tag), {
id: E.id,
ref_key: "resizeRef",
ref: d,
class: P(v(h)),
style: se(E.viewStyle),
role: E.role,
"aria-label": E.ariaLabel,
"aria-orientation": E.ariaOrientation
}, {
default: k(() => [
H(E.$slots, "default")
]),
_: 3
}, 8, ["id", "class", "style", "role", "aria-label", "aria-orientation"]))
], 46, ["tabindex"]),
E.native ? z("v-if", !0) : (S(), V(kv, {
key: 0,
ref_key: "barRef",
ref: f,
always: E.always,
"min-size": E.minSize
}, null, 8, ["always", "min-size"]))
], 2));
}
});
var Pv = /* @__PURE__ */ X(Mv, [["__file", "scrollbar.vue"]]);
const _v = Me(Pv), Gi = Symbol("popper"), Lr = Symbol("popperContent"), Lv = [
"dialog",
"grid",
"group",
"listbox",
"menu",
"navigation",
"tooltip",
"tree"
], xr = Q({
role: {
type: String,
values: Lv,
default: "tooltip"
}
}), xv = B({
name: "ElPopper",
inheritAttrs: !1
}), Fv = /* @__PURE__ */ B({
...xv,
props: xr,
setup(e, { expose: t }) {
const n = e, o = _(), i = _(), a = _(), s = _(), r = b(() => n.role), l = {
triggerRef: o,
popperInstanceRef: i,
contentRef: a,
referenceRef: s,
role: r
};
return t(l), fe(Gi, l), (u, c) => H(u.$slots, "default");
}
});
var Rv = /* @__PURE__ */ X(Fv, [["__file", "popper.vue"]]);
const Fr = Q({
arrowOffset: {
type: Number,
default: 5
}
}), $v = B({
name: "ElPopperArrow",
inheritAttrs: !1
}), Dv = /* @__PURE__ */ B({
...$v,
props: Fr,
setup(e, { expose: t }) {
const n = e, o = ee("popper"), { arrowOffset: i, arrowRef: a, arrowStyle: s } = q(Lr, void 0);
return W(() => n.arrowOffset, (r) => {
i.value = r;
}), Be(() => {
a.value = void 0;
}), t({
arrowRef: a
}), (r, l) => (S(), x("span", {
ref_key: "arrowRef",
ref: a,
class: P(v(o).e("arrow")),
style: se(v(s)),
"data-popper-arrow": ""
}, null, 6));
}
});
var Nv = /* @__PURE__ */ X(Dv, [["__file", "arrow.vue"]]);
const Yo = "ElOnlyChild", Bv = B({
name: Yo,
setup(e, {
slots: t,
attrs: n
}) {
var o;
const i = q(Tr), a = tv((o = i == null ? void 0 : i.setForwardRef) != null ? o : Lt);
return () => {
var s;
const r = (s = t.default) == null ? void 0 : s.call(t, n);
if (!r)
return null;
if (r.length > 1)
return Oe(Yo, "requires exact only one valid child."), null;
const l = Rr(r);
return l ? ie(Kl(l, n), [[a]]) : (Oe(Yo, "no valid child node found"), null);
};
}
});
function Rr(e) {
if (!e)
return null;
const t = e;
for (const n of t) {
if (ke(n))
switch (n.type) {
case Ul:
continue;
case Fs:
case "svg":
return ls(n);
case he:
return Rr(n.children);
default:
return n;
}
return ls(n);
}
return null;
}
function ls(e) {
const t = ee("only-child");
return L("span", {
class: t.e("content")
}, [e]);
}
const $r = Q({
virtualRef: {
type: U(Object)
},
virtualTriggering: Boolean,
onMouseenter: {
type: U(Function)
},
onMouseleave: {
type: U(Function)
},
onClick: {
type: U(Function)
},
onKeydown: {
type: U(Function)
},
onFocus: {
type: U(Function)
},
onBlur: {
type: U(Function)
},
onContextmenu: {
type: U(Function)
},
id: String,
open: Boolean
}), Vv = B({
name: "ElPopperTrigger",
inheritAttrs: !1
}), zv = /* @__PURE__ */ B({
...Vv,
props: $r,
setup(e, { expose: t }) {
const n = e, { role: o, triggerRef: i } = q(Gi, void 0);
ev(i);
const a = b(() => r.value ? n.id : void 0), s = b(() => {
if (o && o.value === "tooltip")
return n.open && n.id ? n.id : void 0;
}), r = b(() => {
if (o && o.value !== "tooltip")
return o.value;
}), l = b(() => r.value ? `${n.open}` : void 0);
let u;
const c = [
"onMouseenter",
"onMouseleave",
"onClick",
"onKeydown",
"onFocus",
"onBlur",
"onContextmenu"
];
return pe(() => {
W(() => n.virtualRef, (d) => {
d && (i.value = st(d));
}, {
immediate: !0
}), W(i, (d, f) => {
u == null || u(), u = void 0, xt(d) && (c.forEach((m) => {
var p;
const h = n[m];
h && (d.addEventListener(m.slice(2).toLowerCase(), h), (p = f == null ? void 0 : f.removeEventListener) == null || p.call(f, m.slice(2).toLowerCase(), h));
}), u = W([a, s, r, l], (m) => {
[
"aria-controls",
"aria-describedby",
"aria-haspopup",
"aria-expanded"
].forEach((p, h) => {
Po(m[h]) ? d.removeAttribute(p) : d.setAttribute(p, m[h]);
});
}, { immediate: !0 })), xt(f) && [
"aria-controls",
"aria-describedby",
"aria-haspopup",
"aria-expanded"
].forEach((m) => f.removeAttribute(m));
}, {
immediate: !0
});
}), Be(() => {
if (u == null || u(), u = void 0, i.value && xt(i.value)) {
const d = i.value;
c.forEach((f) => {
const m = n[f];
m && d.removeEventListener(f.slice(2).toLowerCase(), m);
}), i.value = void 0;
}
}), t({
triggerRef: i
}), (d, f) => d.virtualTriggering ? z("v-if", !0) : (S(), V(v(Bv), Nt({ key: 0 }, d.$attrs, {
"aria-controls": v(a),
"aria-describedby": v(s),
"aria-expanded": v(l),
"aria-haspopup": v(r)
}), {
default: k(() => [
H(d.$slots, "default")
]),
_: 3
}, 16, ["aria-controls", "aria-describedby", "aria-expanded", "aria-haspopup"]));
}
});
var Hv = /* @__PURE__ */ X(zv, [["__file", "trigger.vue"]]);
const Zo = "focus-trap.focus-after-trapped", Qo = "focus-trap.focus-after-released", jv = "focus-trap.focusout-prevented", us = {
cancelable: !0,
bubbles: !1
}, Kv = {
cancelable: !0,
bubbles: !1
}, cs = "focusAfterTrapped", ds = "focusAfterReleased", Dr = Symbol("elFocusTrap"), Ji = _(), Do = _(0), Yi = _(0);
let io = 0;
const Nr = (e) => {
const t = [], n = document.createTreeWalker(e, NodeFilter.SHOW_ELEMENT, {
acceptNode: (o) => {
const i = o.tagName === "INPUT" && o.type === "hidden";
return o.disabled || o.hidden || i ? NodeFilter.FILTER_SKIP : o.tabIndex >= 0 || o === document.activeElement ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
}
});
for (; n.nextNode(); )
t.push(n.currentNode);
return t;
}, fs = (e, t) => {
for (const n of e)
if (!Uv(n, t))
return n;
}, Uv = (e, t) => {
if (process.env.NODE_ENV === "test")
return !1;
if (getComputedStyle(e).visibility === "hidden")
return !0;
for (; e; ) {
if (t && e === t)
return !1;
if (getComputedStyle(e).display === "none")
return !0;
e = e.parentElement;
}
return !1;
}, Wv = (e) => {
const t = Nr(e), n = fs(t, e), o = fs(t.reverse(), e);
return [n, o];
}, qv = (e) => e instanceof HTMLInputElement && "select" in e, gt = (e, t) => {
if (e && e.focus) {
const n = document.activeElement;
e.focus({ preventScroll: !0 }), Yi.value = window.performance.now(), e !== n && qv(e) && t && e.select();
}
};
function ps(e, t) {
const n = [...e], o = e.indexOf(t);
return o !== -1 && n.splice(o, 1), n;
}
const Gv = () => {
let e = [];
return {
push: (o) => {
const i = e[0];
i && o !== i && i.pause(), e = ps(e, o), e.unshift(o);
},
remove: (o) => {
var i, a;
e = ps(e, o), (a = (i = e[0]) == null ? void 0 : i.resume) == null || a.call(i);
}
};
}, Jv = (e, t = !1) => {
const n = document.activeElement;
for (const o of e)
if (gt(o, t), document.activeElement !== n)
return;
}, hs = Gv(), Yv = () => Do.value > Yi.value, ao = () => {
Ji.value = "pointer", Do.value = window.performance.now();
}, vs = () => {
Ji.value = "keyboard", Do.value = window.performance.now();
}, Zv = () => (pe(() => {
io === 0 && (document.addEventListener("mousedown", ao), document.addEventListener("touchstart", ao), document.addEventListener("keydown", vs)), io++;
}), Be(() => {
io--, io <= 0 && (document.removeEventListener("mousedown", ao), document.removeEventListener("touchstart", ao), document.removeEventListener("keydown", vs));
}), {
focusReason: Ji,
lastUserFocusTimestamp: Do,
lastAutomatedFocusTimestamp: Yi
}), so = (e) => new CustomEvent(jv, {
...Kv,
detail: e
}), Qv = B({
name: "ElFocusTrap",
inheritAttrs: !1,
props: {
loop: Boolean,
trapped: Boolean,
focusTrapEl: Object,
focusStartEl: {
type: [Object, String],
default: "first"
}
},
emits: [
cs,
ds,
"focusin",
"focusout",
"focusout-prevented",
"release-requested"
],
setup(e, { emit: t }) {
const n = _();
let o, i;
const { focusReason: a } = Zv();
Jh((p) => {
e.trapped && !s.paused && t("release-requested", p);
});
const s = {
paused: !1,
pause() {
this.paused = !0;
},
resume() {
this.paused = !1;
}
}, r = (p) => {
if (!e.loop && !e.trapped || s.paused)
return;
const { key: h, altKey: g, ctrlKey: y, metaKey: w, currentTarget: M, shiftKey: T } = p, { loop: E } = e, A = h === Rn.tab && !g && !y && !w, O = document.activeElement;
if (A && O) {
const D = M, [N, j] = Wv(D);
if (N && j) {
if (!T && O === j) {
const K = so({
focusReason: a.value
});
t("focusout-prevented", K), K.defaultPrevented || (p.preventDefault(), E && gt(N, !0));
} else if (T && [N, D].includes(O)) {
const K = so({
focusReason: a.value
});
t("focusout-prevented", K), K.defaultPrevented || (p.preventDefault(), E && gt(j, !0));
}
} else if (O === D) {
const K = so({
focusReason: a.value
});
t("focusout-prevented", K), K.defaultPrevented || p.preventDefault();
}
}
};
fe(Dr, {
focusTrapRef: n,
onKeydown: r
}), W(() => e.focusTrapEl, (p) => {
p && (n.value = p);
}, { immediate: !0 }), W([n], ([p], [h]) => {
p && (p.addEventListener("keydown", r), p.addEventListener("focusin", c), p.addEventListener("focusout", d)), h && (h.removeEventListener("keydown", r), h.removeEventListener("focusin", c), h.removeEventListener("focusout", d));
});
const l = (p) => {
t(cs, p);
}, u = (p) => t(ds, p), c = (p) => {
const h = v(n);
if (!h)
return;
const g = p.target, y = p.relatedTarget, w = g && h.contains(g);
e.trapped || y && h.contains(y) || (o = y), w && t("focusin", p), !s.paused && e.trapped && (w ? i = g : gt(i, !0));
}, d = (p) => {
const h = v(n);
if (!(s.paused || !h))
if (e.trapped) {
const g = p.relatedTarget;
!Po(g) && !h.contains(g) && setTimeout(() => {
if (!s.paused && e.trapped) {
const y = so({
focusReason: a.value
});
t("focusout-prevented", y), y.defaultPrevented || gt(i, !0);
}
}, 0);
} else {
const g = p.target;
g && h.contains(g) || t("focusout", p);
}
};
async function f() {
await ce();
const p = v(n);
if (p) {
hs.push(s);
const h = p.contains(document.activeElement) ? o : document.activeElement;
if (o = h, !p.contains(h)) {
const y = new Event(Zo, us);
p.addEventListener(Zo, l), p.dispatchEvent(y), y.defaultPrevented || ce(() => {
let w = e.focusStartEl;
He(w) || (gt(w), document.activeElement !== w && (w = "first")), w === "first" && Jv(Nr(p), !0), (document.activeElement === h || w === "container") && gt(p);
});
}
}
}
function m() {
const p = v(n);
if (p) {
p.removeEventListener(Zo, l);
const h = new CustomEvent(Qo, {
...us,
detail: {
focusReason: a.value
}
});
p.addEventListener(Qo, u), p.dispatchEvent(h), !h.defaultPrevented && (a.value == "keyboard" || !Yv() || p.contains(document.activeElement)) && gt(o ?? document.body), p.removeEventListener(Qo, u), hs.remove(s);
}
}
return pe(() => {
e.trapped && f(), W(() => e.trapped, (p) => {
p ? f() : m();
});
}), Be(() => {
e.trapped && m(), n.value && (n.value.removeEventListener("keydown", r), n.value.removeEventListener("focusin", c), n.value.removeEventListener("focusout", d), n.value = void 0);
}), {
onKeydown: r
};
}
});
function Xv(e, t, n, o, i, a) {
return H(e.$slots, "default", { handleKeydown: e.onKeydown });
}
var Br = /* @__PURE__ */ X(Qv, [["render", Xv], ["__file", "focus-trap.vue"]]);
const em = ["fixed", "absolute"], tm = Q({
boundariesPadding: {
type: Number,
default: 0
},
fallbackPlacements: {
type: U(Array),
default: void 0
},
gpuAcceleration: {
type: Boolean,
default: !0
},
offset: {
type: Number,
default: 12
},
placement: {
type: String,
values: Lo,
default: "bottom"
},
popperOptions: {
type: U(Object),
default: () => ({})
},
strategy: {
type: String,
values: em,
default: "absolute"
}
}), Vr = Q({
...tm,
id: String,
style: {
type: U([String, Array, Object])
},
className: {
type: U([String, Array, Object])
},
effect: {
type: U(String),
default: "dark"
},
visible: Boolean,
enterable: {
type: Boolean,
default: !0
},
pure: Boolean,
focusOnShow: {
type: Boolean,
default: !1
},
trapping: {
type: Boolean,
default: !1
},
popperClass: {
type: U([String, Array, Object])
},
popperStyle: {
type: U([String, Array, Object])
},
referenceEl: {
type: U(Object)
},
triggerTargetEl: {
type: U(Object)
},
stopPopperMouseEvent: {
type: Boolean,
default: !0
},
virtualTriggering: Boolean,
zIndex: Number,
...Ht(["ariaLabel"])
}), nm = {
mouseenter: (e) => e instanceof MouseEvent,
mouseleave: (e) => e instanceof MouseEvent,
focus: () => !0,
blur: () => !0,
close: () => !0
}, om = (e, t = []) => {
const { placement: n, strategy: o, popperOptions: i } = e, a = {
placement: n,
strategy: o,
...i,
modifiers: [...am(e), ...t]
};
return sm(a, i == null ? void 0 : i.modifiers), a;
}, im = (e) => {
if (re)
return st(e);
};
function am(e) {
const { offset: t, gpuAcceleration: n, fallbackPlacements: o } = e;
return [
{
name: "offset",
options: {
offset: [0, t ?? 12]
}
},
{
name: "preventOverflow",
options: {
padding: {
top: 2,
bottom: 2,
left: 5,
right: 5
}
}
},
{
name: "flip",
options: {
padding: 5,
fallbackPlacements: o
}
},
{
name: "computeStyles",
options: {
gpuAcceleration: n
}
}
];
}
function sm(e, t) {
t && (e.modifiers = [...e.modifiers, ...t ?? []]);
}
const rm = 0, lm = (e) => {
const { popperInstanceRef: t, contentRef: n, triggerRef: o, role: i } = q(Gi, void 0), a = _(), s = _(), r = b(() => ({
name: "eventListeners",
enabled: !!e.visible
})), l = b(() => {
var y;
const w = v(a), M = (y = v(s)) != null ? y : rm;
return {
name: "arrow",
enabled: !nr(w),
options: {
element: w,
padding: M
}
};
}), u = b(() => ({
onFirstUpdate: () => {
p();
},
...om(e, [
v(l),
v(r)
])
})), c = b(() => im(e.referenceEl) || v(o)), { attributes: d, state: f, styles: m, update: p, forceUpdate: h, instanceRef: g } = Wh(c, n, u);
return W(g, (y) => t.value = y), pe(() => {
W(() => {
var y;
return (y = v(c)) == null ? void 0 : y.getBoundingClientRect();
}, () => {
p();
});
}), {
attributes: d,
arrowRef: a,
contentRef: n,
instanceRef: g,
state: f,
styles: m,
role: i,
forceUpdate: h,
update: p
};
}, um = (e, {
attributes: t,
styles: n,
role: o
}) => {
const { nextZIndex: i } = Ui(), a = ee("popper"), s = b(() => v(t).popper), r = _(ve(e.zIndex) ? e.zIndex : i()), l = b(() => [
a.b(),
a.is("pure", e.pure),
a.is(e.effect),
e.popperClass
]), u = b(() => [
{ zIndex: v(r) },
v(n).popper,
e.popperStyle || {}
]), c = b(() => o.value === "dialog" ? "false" : void 0), d = b(() => v(n).arrow || {});
return {
ariaModal: c,
arrowStyle: d,
contentAttrs: s,
contentClass: l,
contentStyle: u,
contentZIndex: r,
updateZIndex: () => {
r.value = ve(e.zIndex) ? e.zIndex : i();
}
};
}, cm = (e, t) => {
const n = _(!1), o = _();
return {
focusStartRef: o,
trapped: n,
onFocusAfterReleased: (u) => {
var c;
((c = u.detail) == null ? void 0 : c.focusReason) !== "pointer" && (o.value = "first", t("blur"));
},
onFocusAfterTrapped: () => {
t("focus");
},
onFocusInTrap: (u) => {
e.visible && !n.value && (u.target && (o.value = u.target), n.value = !0);
},
onFocusoutPrevented: (u) => {
e.trapping || (u.detail.focusReason === "pointer" && u.preventDefault(), n.value = !1);
},
onReleaseRequested: () => {
n.value = !1, t("close");
}
};
}, dm = B({
name: "ElPopperContent"
}), fm = /* @__PURE__ */ B({
...dm,
props: Vr,
emits: nm,
setup(e, { expose: t, emit: n }) {
const o = e, {
focusStartRef: i,
trapped: a,
onFocusAfterReleased: s,
onFocusAfterTrapped: r,
onFocusInTrap: l,
onFocusoutPrevented: u,
onReleaseRequested: c
} = cm(o, n), { attributes: d, arrowRef: f, contentRef: m, styles: p, instanceRef: h, role: g, update: y } = lm(o), {
ariaModal: w,
arrowStyle: M,
contentAttrs: T,
contentClass: E,
contentStyle: A,
updateZIndex: O
} = um(o, {
styles: p,
attributes: d,
role: g
}), D = q(Co, void 0), N = _();
fe(Lr, {
arrowStyle: M,
arrowRef: f,
arrowOffset: N
}), D && fe(Co, {
...D,
addInputId: Lt,
removeInputId: Lt
});
let j;
const I = (J = !0) => {
y(), J && O();
}, K = () => {
I(!1), o.visible && o.focusOnShow ? a.value = !0 : o.visible === !1 && (a.value = !1);
};
return pe(() => {
W(() => o.triggerTargetEl, (J, de) => {
j == null || j(), j = void 0;
const Y = v(J || m.value), $ = v(de || m.value);
xt(Y) && (j = W([g, () => o.ariaLabel, w, () => o.id], (te) => {
["role", "aria-label", "aria-modal", "id"].forEach((xe, ye) => {
Po(te[ye]) ? Y.removeAttribute(xe) : Y.setAttribute(xe, te[ye]);
});
}, { immediate: !0 })), $ !== Y && xt($) && ["role", "aria-label", "aria-modal", "id"].forEach((te) => {
$.removeAttribute(te);
});
}, { immediate: !0 }), W(() => o.visible, K, { immediate: !0 });
}), Be(() => {
j == null || j(), j = void 0;
}), t({
popperContentRef: m,
popperInstanceRef: h,
updatePopper: I,
contentStyle: A
}), (J, de) => (S(), x("div", Nt({
ref_key: "contentRef",
ref: m
}, v(T), {
style: v(A),
class: v(E),
tabindex: "-1",
onMouseenter: (Y) => J.$emit("mouseenter", Y),
onMouseleave: (Y) => J.$emit("mouseleave", Y)
}), [
L(v(Br), {
trapped: v(a),
"trap-on-focus-in": !0,
"focus-trap-el": v(m),
"focus-start-el": v(i),
onFocusAfterTrapped: v(r),
onFocusAfterReleased: v(s),
onFocusin: v(l),
onFocusoutPrevented: v(u),
onReleaseRequested: v(c)
}, {
default: k(() => [
H(J.$slots, "default")
]),
_: 3
}, 8, ["trapped", "focus-trap-el", "focus-start-el", "onFocusAfterTrapped", "onFocusAfterReleased", "onFocusin", "onFocusoutPrevented", "onReleaseRequested"])
], 16, ["onMouseenter", "onMouseleave"]));
}
});
var pm = /* @__PURE__ */ X(fm, [["__file", "content.vue"]]);
const hm = Me(Rv), Zi = Symbol("elTooltip"), Le = Q({
...Qh,
...Vr,
appendTo: {
type: U([String, Object])
},
content: {
type: String,
default: ""
},
rawContent: Boolean,
persistent: Boolean,
visible: {
type: U(Boolean),
default: null
},
transition: String,
teleported: {
type: Boolean,
default: !0
},
disabled: Boolean,
...Ht(["ariaLabel"])
}), Nn = Q({
...$r,
disabled: Boolean,
trigger: {
type: U([String, Array]),
default: "hover"
},
triggerKeys: {
type: U(Array),
default: () => [Rn.enter, Rn.space]
}
}), {
useModelToggleProps: vm,
useModelToggleEmits: mm,
useModelToggle: gm
} = jp("visible"), ym = Q({
...xr,
...vm,
...Le,
...Nn,
...Fr,
showArrow: {
type: Boolean,
default: !0
}
}), bm = [
...mm,
"before-show",
"before-hide",
"show",
"hide",
"open",
"close"
], wm = (e, t) => Ie(e) ? e.includes(t) : e === t, Gt = (e, t, n) => (o) => {
wm(v(e), t) && n(o);
}, Sm = B({
name: "ElTooltipTrigger"
}), Cm = /* @__PURE__ */ B({
...Sm,
props: Nn,
setup(e, { expose: t }) {
const n = e, o = ee("tooltip"), { controlled: i, id: a, open: s, onOpen: r, onClose: l, onToggle: u } = q(Zi, void 0), c = _(null), d = () => {
if (v(i) || n.disabled)
return !0;
}, f = Je(n, "trigger"), m = it(d, Gt(f, "hover", r)), p = it(d, Gt(f, "hover", l)), h = it(d, Gt(f, "click", (T) => {
T.button === 0 && u(T);
})), g = it(d, Gt(f, "focus", r)), y = it(d, Gt(f, "focus", l)), w = it(d, Gt(f, "contextmenu", (T) => {
T.preventDefault(), u(T);
})), M = it(d, (T) => {
const { code: E } = T;
n.triggerKeys.includes(E) && (T.preventDefault(), u(T));
});
return t({
triggerRef: c
}), (T, E) => (S(), V(v(Hv), {
id: v(a),
"virtual-ref": T.virtualRef,
open: v(s),
"virtual-triggering": T.virtualTriggering,
class: P(v(o).e("trigger")),
onBlur: v(y),
onClick: v(h),
onContextmenu: v(w),
onFocus: v(g),
onMouseenter: v(m),
onMouseleave: v(p),
onKeydown: v(M)
}, {
default: k(() => [
H(T.$slots, "default")
]),
_: 3
}, 8, ["id", "virtual-ref", "open", "virtual-triggering", "class", "onBlur", "onClick", "onContextmenu", "onFocus", "onMouseenter", "onMouseleave", "onKeydown"]));
}
});
var Em = /* @__PURE__ */ X(Cm, [["__file", "trigger.vue"]]);
const Im = Q({
to: {
type: U([String, Object]),
required: !0
},
disabled: Boolean
}), km = /* @__PURE__ */ B({
__name: "teleport",
props: Im,
setup(e) {
return (t, n) => t.disabled ? H(t.$slots, "default", { key: 0 }) : (S(), V(Wl, {
key: 1,
to: t.to
}, [
H(t.$slots, "default")
], 8, ["to"]));
}
});
var Tm = /* @__PURE__ */ X(km, [["__file", "teleport.vue"]]);
const zr = Me(Tm), Am = B({
name: "ElTooltipContent",
inheritAttrs: !1
}), Om = /* @__PURE__ */ B({
...Am,
props: Le,
setup(e, { expose: t }) {
const n = e, { selector: o } = kr(), i = ee("tooltip"), a = _(null);
let s;
const {
controlled: r,
id: l,
open: u,
trigger: c,
onClose: d,
onOpen: f,
onShow: m,
onHide: p,
onBeforeShow: h,
onBeforeHide: g
} = q(Zi, void 0), y = b(() => n.transition || `${i.namespace.value}-fade-in-linear`), w = b(() => process.env.NODE_ENV === "test" ? !0 : n.persistent);
Be(() => {
s == null || s();
});
const M = b(() => v(w) ? !0 : v(u)), T = b(() => n.disabled ? !1 : v(u)), E = b(() => n.appendTo || o.value), A = b(() => {
var $;
return ($ = n.style) != null ? $ : {};
}), O = _(!0), D = () => {
p(), O.value = !0;
}, N = () => {
if (v(r))
return !0;
}, j = it(N, () => {
n.enterable && v(c) === "hover" && f();
}), I = it(N, () => {
v(c) === "hover" && d();
}), K = () => {
var $, te;
(te = ($ = a.value) == null ? void 0 : $.updatePopper) == null || te.call($), h == null || h();
}, J = () => {
g == null || g();
}, de = () => {
m(), s = fu(b(() => {
var $;
return ($ = a.value) == null ? void 0 : $.popperContentRef;
}), () => {
if (v(r))
return;
v(c) !== "hover" && d();
});
}, Y = () => {
n.virtualTriggering || d();
};
return W(() => v(u), ($) => {
$ ? O.value = !1 : s == null || s();
}, {
flush: "post"
}), W(() => n.content, () => {
var $, te;
(te = ($ = a.value) == null ? void 0 : $.updatePopper) == null || te.call($);
}), t({
contentRef: a
}), ($, te) => (S(), V(v(zr), {
disabled: !$.teleported,
to: v(E)
}, {
default: k(() => [
L(Bn, {
name: v(y),
onAfterLeave: D,
onBeforeEnter: K,
onAfterEnter: de,
onBeforeLeave: J
}, {
default: k(() => [
v(M) ? ie((S(), V(v(pm), Nt({
key: 0,
id: v(l),
ref_key: "contentRef",
ref: a
}, $.$attrs, {
"aria-label": $.ariaLabel,
"aria-hidden": O.value,
"boundaries-padding": $.boundariesPadding,
"fallback-placements": $.fallbackPlacements,
"gpu-acceleration": $.gpuAcceleration,
offset: $.offset,
placement: $.placement,
"popper-options": $.popperOptions,
strategy: $.strategy,
effect: $.effect,
enterable: $.enterable,
pure: $.pure,
"popper-class": $.popperClass,
"popper-style": [$.popperStyle, v(A)],
"reference-el": $.referenceEl,
"trigger-target-el": $.triggerTargetEl,
visible: v(T),
"z-index": $.zIndex,
onMouseenter: v(j),
onMouseleave: v(I),
onBlur: Y,
onClose: v(d)
}), {
default: k(() => [
H($.$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"])), [
[Ee, v(T)]
]) : z("v-if", !0)
]),
_: 3
}, 8, ["name"])
]),
_: 3
}, 8, ["disabled", "to"]));
}
});
var Mm = /* @__PURE__ */ X(Om, [["__file", "content.vue"]]);
const Pm = B({
name: "ElTooltip"
}), _m = /* @__PURE__ */ B({
...Pm,
props: ym,
emits: bm,
setup(e, { expose: t, emit: n }) {
const o = e;
Zh();
const i = Dt(), a = _(), s = _(), r = () => {
var y;
const w = v(a);
w && ((y = w.popperInstanceRef) == null || y.update());
}, l = _(!1), u = _(), { show: c, hide: d, hasUpdateHandler: f } = gm({
indicator: l,
toggleReason: u
}), { onOpen: m, onClose: p } = Xh({
showAfter: Je(o, "showAfter"),
hideAfter: Je(o, "hideAfter"),
autoClose: Je(o, "autoClose"),
open: c,
close: d
}), h = b(() => ct(o.visible) && !f.value);
fe(Zi, {
controlled: h,
id: i,
open: Ls(l),
trigger: Je(o, "trigger"),
onOpen: (y) => {
m(y);
},
onClose: (y) => {
p(y);
},
onToggle: (y) => {
v(l) ? p(y) : m(y);
},
onShow: () => {
n("show", u.value);
},
onHide: () => {
n("hide", u.value);
},
onBeforeShow: () => {
n("before-show", u.value);
},
onBeforeHide: () => {
n("before-hide", u.value);
},
updatePopper: r
}), W(() => o.disabled, (y) => {
y && l.value && (l.value = !1);
});
const g = (y) => {
var w, M;
const T = (M = (w = s.value) == null ? void 0 : w.contentRef) == null ? void 0 : M.popperContentRef, E = (y == null ? void 0 : y.relatedTarget) || document.activeElement;
return T && T.contains(E);
};
return ql(() => l.value && d()), t({
popperRef: a,
contentRef: s,
isFocusInsideContent: g,
updatePopper: r,
onOpen: m,
onClose: p,
hide: d
}), (y, w) => (S(), V(v(hm), {
ref_key: "popperRef",
ref: a,
role: y.role
}, {
default: k(() => [
L(Em, {
disabled: y.disabled,
trigger: y.trigger,
"trigger-keys": y.triggerKeys,
"virtual-ref": y.virtualRef,
"virtual-triggering": y.virtualTriggering
}, {
default: k(() => [
y.$slots.default ? H(y.$slots, "default", { key: 0 }) : z("v-if", !0)
]),
_: 3
}, 8, ["disabled", "trigger", "trigger-keys", "virtual-ref", "virtual-triggering"]),
L(Mm, {
ref_key: "contentRef",
ref: s,
"aria-label": y.ariaLabel,
"boundaries-padding": y.boundariesPadding,
content: y.content,
disabled: y.disabled,
effect: y.effect,
enterable: y.enterable,
"fallback-placements": y.fallbackPlacements,
"hide-after": y.hideAfter,
"gpu-acceleration": y.gpuAcceleration,
offset: y.offset,
persistent: y.persistent,
"popper-class": y.popperClass,
"popper-style": y.popperStyle,
placement: y.placement,
"popper-options": y.popperOptions,
pure: y.pure,
"raw-content": y.rawContent,
"reference-el": y.referenceEl,
"trigger-target-el": y.triggerTargetEl,
"show-after": y.showAfter,
strategy: y.strategy,
teleported: y.teleported,
transition: y.transition,
"virtual-triggering": y.virtualTriggering,
"z-index": y.zIndex,
"append-to": y.appendTo
}, {
default: k(() => [
H(y.$slots, "content", {}, () => [
y.rawContent ? (S(), x("span", {
key: 0,
innerHTML: y.content
}, null, 8, ["innerHTML"])) : (S(), x("span", { key: 1 }, ne(y.content), 1))
]),
y.showArrow ? (S(), V(v(Nv), {
key: 0,
"arrow-offset": y.arrowOffset
}, null, 8, ["arrow-offset"])) : z("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 Lm = /* @__PURE__ */ X(_m, [["__file", "tooltip.vue"]]);
const Hr = Me(Lm), jr = Symbol("buttonGroupContextKey"), xm = (e, t) => {
Xt({
from: "type.text",
replacement: "link",
version: "3.0.0",
scope: "props",
ref: "https://element-plus.org/en-US/component/button.html#button-attributes"
}, b(() => e.type === "text"));
const n = q(jr, void 0), o = Fo("button"), { form: i } = fn(), a = ln(b(() => n == null ? void 0 : n.size)), s = Ro(), r = _(), l = Eo(), u = b(() => e.type || (n == null ? void 0 : n.type) || ""), c = b(() => {
var p, h, g;
return (g = (h = e.autoInsertSpace) != null ? h : (p = o.value) == null ? void 0 : p.autoInsertSpace) != null ? g : !1;
}), d = b(() => e.tag === "button" ? {
ariaDisabled: s.value || e.loading,
disabled: s.value || e.loading,
autofocus: e.autofocus,
type: e.nativeType
} : {}), f = b(() => {
var p;
const h = (p = l.default) == null ? void 0 : p.call(l);
if (c.value && (h == null ? void 0 : h.length) === 1) {
const g = h[0];
if ((g == null ? void 0 : g.type) === Fs) {
const y = g.children;
return new RegExp("^\\p{Unified_Ideograph}{2}$", "u").test(y.trim());
}
}
return !1;
});
return {
_disabled: s,
_size: a,
_type: u,
_ref: r,
_props: d,
shouldAddSpace: f,
handleClick: (p) => {
if (s.value || e.loading) {
p.stopPropagation();
return;
}
e.nativeType === "reset" && (i == null || i.resetFields()), t("click", p);
}
};
}, Fm = [
"default",
"primary",
"success",
"warning",
"info",
"danger",
"text",
""
], Rm = ["button", "submit", "reset"], yi = Q({
size: dn,
disabled: Boolean,
type: {
type: String,
values: Fm,
default: ""
},
icon: {
type: tn
},
nativeType: {
type: String,
values: Rm,
default: "button"
},
loading: Boolean,
loadingIcon: {
type: tn,
default: () => Ts
},
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: U([String, Object]),
default: "button"
}
}), $m = {
click: (e) => e instanceof MouseEvent
};
function me(e, t) {
Dm(e) && (e = "100%");
var n = Nm(e);
return e = t === 360 ? e : Math.min(t, Math.max(0, parseFloat(e))), n && (e = parseInt(String(e * t), 10) / 100), Math.abs(e - t) < 1e-6 ? 1 : (t === 360 ? e = (e < 0 ? e % t + t : e % t) / parseFloat(String(t)) : e = e % t / parseFloat(String(t)), e);
}
function ro(e) {
return Math.min(1, Math.max(0, e));
}
function Dm(e) {
return typeof e == "string" && e.indexOf(".") !== -1 && parseFloat(e) === 1;
}
function Nm(e) {
return typeof e == "string" && e.indexOf("%") !== -1;
}
function Kr(e) {
return e = parseFloat(e), (isNaN(e) || e < 0 || e > 1) && (e = 1), e;
}
function lo(e) {
return e <= 1 ? "".concat(Number(e) * 100, "%") : e;
}
function _t(e) {
return e.length === 1 ? "0" + e : String(e);
}
function Bm(e, t, n) {
return {
r: me(e, 255) * 255,
g: me(t, 255) * 255,
b: me(n, 255) * 255
};
}
function ms(e, t, n) {
e = me(e, 255), t = me(t, 255), n = me(n, 255);
var o = Math.max(e, t, n), i = Math.min(e, t, n), a = 0, s = 0, r = (o + i) / 2;
if (o === i)
s = 0, a = 0;
else {
var l = o - i;
switch (s = r > 0.5 ? l / (2 - o - i) : l / (o + i), o) {
case e:
a = (t - n) / l + (t < n ? 6 : 0);
break;
case t:
a = (n - e) / l + 2;
break;
case n:
a = (e - t) / l + 4;
break;
}
a /= 6;
}
return { h: a, s, l: r };
}
function Xo(e, t, n) {
return n < 0 && (n += 1), n > 1 && (n -= 1), n < 1 / 6 ? e + (t - e) * (6 * n) : n < 1 / 2 ? t : n < 2 / 3 ? e + (t - e) * (2 / 3 - n) * 6 : e;
}
function Vm(e, t, n) {
var o, i, a;
if (e = me(e, 360), t = me(t, 100), n = me(n, 100), t === 0)
i = n, a = n, o = n;
else {
var s = n < 0.5 ? n * (1 + t) : n + t - n * t, r = 2 * n - s;
o = Xo(r, s, e + 1 / 3), i = Xo(r, s, e), a = Xo(r, s, e - 1 / 3);
}
return { r: o * 255, g: i * 255, b: a * 255 };
}
function gs(e, t, n) {
e = me(e, 255), t = me(t, 255), n = me(n, 255);
var o = Math.max(e, t, n), i = Math.min(e, t, n), a = 0, s = o, r = o - i, l = o === 0 ? 0 : r / o;
if (o === i)
a = 0;
else {
switch (o) {
case e:
a = (t - n) / r + (t < n ? 6 : 0);
break;
case t:
a = (n - e) / r + 2;
break;
case n:
a = (e - t) / r + 4;
break;
}
a /= 6;
}
return { h: a, s: l, v: s };
}
function zm(e, t, n) {
e = me(e, 360) * 6, t = me(t, 100), n = me(n, 100);
var o = Math.floor(e), i = e - o, a = n * (1 - t), s = n * (1 - i * t), r = n * (1 - (1 - i) * t), l = o % 6, u = [n, s, a, a, r, n][l], c = [r, n, n, s, a, a][l], d = [a, a, r, n, n, s][l];
return { r: u * 255, g: c * 255, b: d * 255 };
}
function ys(e, t, n, o) {
var i = [
_t(Math.round(e).toString(16)),
_t(Math.round(t).toString(16)),
_t(Math.round(n).toString(16))
];
return o && i[0].startsWith(i[0].charAt(1)) && i[1].startsWith(i[1].charAt(1)) && i[2].startsWith(i[2].charAt(1)) ? i[0].charAt(0) + i[1].charAt(0) + i[2].charAt(0) : i.join("");
}
function Hm(e, t, n, o, i) {
var a = [
_t(Math.round(e).toString(16)),
_t(Math.round(t).toString(16)),
_t(Math.round(n).toString(16)),
_t(jm(o))
];
return i && a[0].startsWith(a[0].charAt(1)) && a[1].startsWith(a[1].charAt(1)) && a[2].startsWith(a[2].charAt(1)) && a[3].startsWith(a[3].charAt(1)) ? a[0].charAt(0) + a[1].charAt(0) + a[2].charAt(0) + a[3].charAt(0) : a.join("");
}
function jm(e) {
return Math.round(parseFloat(e) * 255).toString(16);
}
function bs(e) {
return _e(e) / 255;
}
function _e(e) {
return parseInt(e, 16);
}
function Km(e) {
return {
r: e >> 16,
g: (e & 65280) >> 8,
b: e & 255
};
}
var bi = {
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 Um(e) {
var t = { r: 0, g: 0, b: 0 }, n = 1, o = null, i = null, a = null, s = !1, r = !1;
return typeof e == "string" && (e = Gm(e)), typeof e == "object" && (ot(e.r) && ot(e.g) && ot(e.b) ? (t = Bm(e.r, e.g, e.b), s = !0, r = String(e.r).substr(-1) === "%" ? "prgb" : "rgb") : ot(e.h) && ot(e.s) && ot(e.v) ? (o = lo(e.s), i = lo(e.v), t = zm(e.h, o, i), s = !0, r = "hsv") : ot(e.h) && ot(e.s) && ot(e.l) && (o = lo(e.s), a = lo(e.l), t = Vm(e.h, o, a), s = !0, r = "hsl"), Object.prototype.hasOwnProperty.call(e, "a") && (n = e.a)), n = Kr(n), {
ok: s,
format: e.format || r,
r: Math.min(255, Math.max(t.r, 0)),
g: Math.min(255, Math.max(t.g, 0)),
b: Math.min(255, Math.max(t.b, 0)),
a: n
};
}
var Wm = "[-\\+]?\\d+%?", qm = "[-\\+]?\\d*\\.\\d+%?", Et = "(?:".concat(qm, ")|(?:").concat(Wm, ")"), ei = "[\\s|\\(]+(".concat(Et, ")[,|\\s]+(").concat(Et, ")[,|\\s]+(").concat(Et, ")\\s*\\)?"), ti = "[\\s|\\(]+(".concat(Et, ")[,|\\s]+(").concat(Et, ")[,|\\s]+(").concat(Et, ")[,|\\s]+(").concat(Et, ")\\s*\\)?"), Ve = {
CSS_UNIT: new RegExp(Et),
rgb: new RegExp("rgb" + ei),
rgba: new RegExp("rgba" + ti),
hsl: new RegExp("hsl" + ei),
hsla: new RegExp("hsla" + ti),
hsv: new RegExp("hsv" + ei),
hsva: new RegExp("hsva" + ti),
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 Gm(e) {
if (e = e.trim().toLowerCase(), e.length === 0)
return !1;
var t = !1;
if (bi[e])
e = bi[e], t = !0;
else if (e === "transparent")
return { r: 0, g: 0, b: 0, a: 0, format: "name" };
var n = Ve.rgb.exec(e);
return n ? { r: n[1], g: n[2], b: n[3] } : (n = Ve.rgba.exec(e), n ? { r: n[1], g: n[2], b: n[3], a: n[4] } : (n = Ve.hsl.exec(e), n ? { h: n[1], s: n[2], l: n[3] } : (n = Ve.hsla.exec(e), n ? { h: n[1], s: n[2], l: n[3], a: n[4] } : (n = Ve.hsv.exec(e), n ? { h: n[1], s: n[2], v: n[3] } : (n = Ve.hsva.exec(e), n ? { h: n[1], s: n[2], v: n[3], a: n[4] } : (n = Ve.hex8.exec(e), n ? {
r: _e(n[1]),
g: _e(n[2]),
b: _e(n[3]),
a: bs(n[4]),
format: t ? "name" : "hex8"
} : (n = Ve.hex6.exec(e), n ? {
r: _e(n[1]),
g: _e(n[2]),
b: _e(n[3]),
format: t ? "name" : "hex"
} : (n = Ve.hex4.exec(e), n ? {
r: _e(n[1] + n[1]),
g: _e(n[2] + n[2]),
b: _e(n[3] + n[3]),
a: bs(n[4] + n[4]),
format: t ? "name" : "hex8"
} : (n = Ve.hex3.exec(e), n ? {
r: _e(n[1] + n[1]),
g: _e(n[2] + n[2]),
b: _e(n[3] + n[3]),
format: t ? "name" : "hex"
} : !1)))))))));
}
function ot(e) {
return !!Ve.CSS_UNIT.exec(String(e));
}
var Jm = (
/** @class */
function() {
function e(t, n) {
t === void 0 && (t = ""), n === void 0 && (n = {});
var o;
if (t instanceof e)
return t;
typeof t == "number" && (t = Km(t)), this.originalInput = t;
var i = Um(t);
this.originalInput = t, this.r = i.r, this.g = i.g, this.b = i.b, this.a = i.a, this.roundA = Math.round(100 * this.a) / 100, this.format = (o = n.format) !== null && o !== void 0 ? o : i.format, this.gradientType = n.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 = i.ok;
}
return e.prototype.isDark = function() {
return this.getBrightness() < 128;
}, e.prototype.isLight = function() {
return !this.isDark();
}, e.prototype.getBrightness = function() {
var t = this.toRgb();
return (t.r * 299 + t.g * 587 + t.b * 114) / 1e3;
}, e.prototype.getLuminance = function() {
var t = this.toRgb(), n, o, i, a = t.r / 255, s = t.g / 255, r = t.b / 255;
return a <= 0.03928 ? n = a / 12.92 : n = Math.pow((a + 0.055) / 1.055, 2.4), s <= 0.03928 ? o = s / 12.92 : o = Math.pow((s + 0.055) / 1.055, 2.4), r <= 0.03928 ? i = r / 12.92 : i = Math.pow((r + 0.055) / 1.055, 2.4), 0.2126 * n + 0.7152 * o + 0.0722 * i;
}, e.prototype.getAlpha = function() {
return this.a;
}, e.prototype.setAlpha = function(t) {
return this.a = Kr(t), this.roundA = Math.round(100 * this.a) / 100, this;
}, e.prototype.isMonochrome = function() {
var t = this.toHsl().s;
return t === 0;
}, e.prototype.toHsv = function() {
var t = gs(this.r, this.g, this.b);
return { h: t.h * 360, s: t.s, v: t.v, a: this.a };
}, e.prototype.toHsvString = function() {
var t = gs(this.r, this.g, this.b), n = Math.round(t.h * 360), o = Math.round(t.s * 100), i = Math.round(t.v * 100);
return this.a === 1 ? "hsv(".concat(n, ", ").concat(o, "%, ").concat(i, "%)") : "hsva(".concat(n, ", ").concat(o, "%, ").concat(i, "%, ").concat(this.roundA, ")");
}, e.prototype.toHsl = function() {
var t = ms(this.r, this.g, this.b);
return { h: t.h * 360, s: t.s, l: t.l, a: this.a };
}, e.prototype.toHslString = function() {
var t = ms(this.r, this.g, this.b), n = Math.round(t.h * 360), o = Math.round(t.s * 100), i = Math.round(t.l * 100);
return this.a === 1 ? "hsl(".concat(n, ", ").concat(o, "%, ").concat(i, "%)") : "hsla(".concat(n, ", ").concat(o, "%, ").concat(i, "%, ").concat(this.roundA, ")");
}, e.prototype.toHex = function(t) {
return t === void 0 && (t = !1), ys(this.r, this.g, this.b, t);
}, e.prototype.toHexString = function(t) {
return t === void 0 && (t = !1), "#" + this.toHex(t);
}, e.prototype.toHex8 = function(t) {
return t === void 0 && (t = !1), Hm(this.r, this.g, this.b, this.a, t);
}, e.prototype.toHex8String = function(t) {
return t === void 0 && (t = !1), "#" + this.toHex8(t);
}, e.prototype.toHexShortString = function(t) {
return t === void 0 && (t = !1), this.a === 1 ? this.toHexString(t) : this.toHex8String(t);
}, e.prototype.toRgb = function() {
return {
r: Math.round(this.r),
g: Math.round(this.g),
b: Math.round(this.b),
a: this.a
};
}, e.prototype.toRgbString = function() {
var t = Math.round(this.r), n = Math.round(this.g), o = Math.round(this.b);
return this.a === 1 ? "rgb(".concat(t, ", ").concat(n, ", ").concat(o, ")") : "rgba(".concat(t, ", ").concat(n, ", ").concat(o, ", ").concat(this.roundA, ")");
}, e.prototype.toPercentageRgb = function() {
var t = function(n) {
return "".concat(Math.round(me(n, 255) * 100), "%");
};
return {
r: t(this.r),
g: t(this.g),
b: t(this.b),
a: this.a
};
}, e.prototype.toPercentageRgbString = function() {
var t = function(n) {
return Math.round(me(n, 255) * 100);
};
return this.a === 1 ? "rgb(".concat(t(this.r), "%, ").concat(t(this.g), "%, ").concat(t(this.b), "%)") : "rgba(".concat(t(this.r), "%, ").concat(t(this.g), "%, ").concat(t(this.b), "%, ").concat(this.roundA, ")");
}, e.prototype.toName = function() {
if (this.a === 0)
return "transparent";
if (this.a < 1)
return !1;
for (var t = "#" + ys(this.r, this.g, this.b, !1), n = 0, o = Object.entries(bi); n < o.length; n++) {
var i = o[n], a = i[0], s = i[1];
if (t === s)
return a;
}
return !1;
}, e.prototype.toString = function(t) {
var n = !!t;
t = t ?? this.format;
var o = !1, i = this.a < 1 && this.a >= 0, a = !n && i && (t.startsWith("hex") || t === "name");
return a ? t === "name" && this.a === 0 ? this.toName() : this.toRgbString() : (t === "rgb" && (o = this.toRgbString()), t === "prgb" && (o = this.toPercentageRgbString()), (t === "hex" || t === "hex6") && (o = this.toHexString()), t === "hex3" && (o = this.toHexString(!0)), t === "hex4" && (o = this.toHex8String(!0)), t === "hex8" && (o = this.toHex8String()), t === "name" && (o = this.toName()), t === "hsl" && (o = this.toHslString()), t === "hsv" && (o = this.toHsvString()), o || this.toHexString());
}, e.prototype.toNumber = function() {
return (Math.round(this.r) << 16) + (Math.round(this.g) << 8) + Math.round(this.b);
}, e.prototype.clone = function() {
return new e(this.toString());
}, e.prototype.lighten = function(t) {
t === void 0 && (t = 10);
var n = this.toHsl();
return n.l += t / 100, n.l = ro(n.l), new e(n);
}, e.prototype.brighten = function(t) {
t === void 0 && (t = 10);
var n = this.toRgb();
return n.r = Math.max(0, Math.min(255, n.r - Math.round(255 * -(t / 100)))), n.g = Math.max(0, Math.min(255, n.g - Math.round(255 * -(t / 100)))), n.b = Math.max(0, Math.min(255, n.b - Math.round(255 * -(t / 100)))), new e(n);
}, e.prototype.darken = function(t) {
t === void 0 && (t = 10);
var n = this.toHsl();
return n.l -= t / 100, n.l = ro(n.l), new e(n);
}, e.prototype.tint = function(t) {
return t === void 0 && (t = 10), this.mix("white", t);
}, e.prototype.shade = function(t) {
return t === void 0 && (t = 10), this.mix("black", t);
}, e.prototype.desaturate = function(t) {
t === void 0 && (t = 10);
var n = this.toHsl();
return n.s -= t / 100, n.s = ro(n.s), new e(n);
}, e.prototype.saturate = function(t) {
t === void 0 && (t = 10);
var n = this.toHsl();
return n.s += t / 100, n.s = ro(n.s), new e(n);
}, e.prototype.greyscale = function() {
return this.desaturate(100);
}, e.prototype.spin = function(t) {
var n = this.toHsl(), o = (n.h + t) % 360;
return n.h = o < 0 ? 360 + o : o, new e(n);
}, e.prototype.mix = function(t, n) {
n === void 0 && (n = 50);
var o = this.toRgb(), i = new e(t).toRgb(), a = n / 100, s = {
r: (i.r - o.r) * a + o.r,
g: (i.g - o.g) * a + o.g,
b: (i.b - o.b) * a + o.b,
a: (i.a - o.a) * a + o.a
};
return new e(s);
}, e.prototype.analogous = function(t, n) {
t === void 0 && (t = 6), n === void 0 && (n = 30);
var o = this.toHsl(), i = 360 / n, a = [this];
for (o.h = (o.h - (i * t >> 1) + 720) % 360; --t; )
o.h = (o.h + i) % 360, a.push(new e(o));
return a;
}, e.prototype.complement = function() {
var t = this.toHsl();
return t.h = (t.h + 180) % 360, new e(t);
}, e.prototype.monochromatic = function(t) {
t === void 0 && (t = 6);
for (var n = this.toHsv(), o = n.h, i = n.s, a = n.v, s = [], r = 1 / t; t--; )
s.push(new e({ h: o, s: i, v: a })), a = (a + r) % 1;
return s;
}, e.prototype.splitcomplement = function() {
var t = this.toHsl(), n = t.h;
return [
this,
new e({ h: (n + 72) % 360, s: t.s, l: t.l }),
new e({ h: (n + 216) % 360, s: t.s, l: t.l })
];
}, e.prototype.onBackground = function(t) {
var n = this.toRgb(), o = new e(t).toRgb(), i = n.a + o.a * (1 - n.a);
return new e({
r: (n.r * n.a + o.r * o.a * (1 - n.a)) / i,
g: (n.g * n.a + o.g * o.a * (1 - n.a)) / i,
b: (n.b * n.a + o.b * o.a * (1 - n.a)) / i,
a: i
});
}, e.prototype.triad = function() {
return this.polyad(3);
}, e.prototype.tetrad = function() {
return this.polyad(4);
}, e.prototype.polyad = function(t) {
for (var n = this.toHsl(), o = n.h, i = [this], a = 360 / t, s = 1; s < t; s++)
i.push(new e({ h: (o + s * a) % 360, s: n.s, l: n.l }));
return i;
}, e.prototype.equals = function(t) {
return this.toRgbString() === new e(t).toRgbString();
}, e;
}()
);
function mt(e, t = 20) {
return e.mix("#141414", t).toString();
}
function Ym(e) {
const t = Ro(), n = ee("button");
return b(() => {
let o = {}, i = e.color;
if (i) {
const a = i.match(/var\((.*?)\)/);
a && (i = window.getComputedStyle(window.document.documentElement).getPropertyValue(a[1]));
const s = new Jm(i), r = e.dark ? s.tint(20).toString() : mt(s, 20);
if (e.plain)
o = n.cssVarBlock({
"bg-color": e.dark ? mt(s, 90) : s.tint(90).toString(),
"text-color": i,
"border-color": e.dark ? mt(s, 50) : s.tint(50).toString(),
"hover-text-color": `var(${n.cssVarName("color-white")})`,
"hover-bg-color": i,
"hover-border-color": i,
"active-bg-color": r,
"active-text-color": `var(${n.cssVarName("color-white")})`,
"active-border-color": r
}), t.value && (o[n.cssVarBlockName("disabled-bg-color")] = e.dark ? mt(s, 90) : s.tint(90).toString(), o[n.cssVarBlockName("disabled-text-color")] = e.dark ? mt(s, 50) : s.tint(50).toString(), o[n.cssVarBlockName("disabled-border-color")] = e.dark ? mt(s, 80) : s.tint(80).toString());
else {
const l = e.dark ? mt(s, 30) : s.tint(30).toString(), u = s.isDark() ? `var(${n.cssVarName("color-white")})` : `var(${n.cssVarName("color-black")})`;
if (o = n.cssVarBlock({
"bg-color": i,
"text-color": u,
"border-color": i,
"hover-bg-color": l,
"hover-text-color": u,
"hover-border-color": l,
"active-bg-color": r,
"active-border-color": r
}), t.value) {
const c = e.dark ? mt(s, 50) : s.tint(50).toString();
o[n.cssVarBlockName("disabled-bg-color")] = c, o[n.cssVarBlockName("disabled-text-color")] = e.dark ? "rgba(255, 255, 255, 0.5)" : `var(${n.cssVarName("color-white")})`, o[n.cssVarBlockName("disabled-border-color")] = c;
}
}
}
return o;
});
}
const Zm = B({
name: "ElButton"
}), Qm = /* @__PURE__ */ B({
...Zm,
props: yi,
emits: $m,
setup(e, { expose: t, emit: n }) {
const o = e, i = Ym(o), a = ee("button"), { _ref: s, _size: r, _type: l, _disabled: u, _props: c, shouldAddSpace: d, handleClick: f } = xm(o, n), m = b(() => [
a.b(),
a.m(l.value),
a.m(r.value),
a.is("disabled", u.value),
a.is("loading", o.loading),
a.is("plain", o.plain),
a.is("round", o.round),
a.is("circle", o.circle),
a.is("text", o.text),
a.is("link", o.link),
a.is("has-bg", o.bg)
]);
return t({
ref: s,
size: r,
type: l,
disabled: u,
shouldAddSpace: d
}), (p, h) => (S(), V(Re(p.tag), Nt({
ref_key: "_ref",
ref: s
}, v(c), {
class: v(m),
style: v(i),
onClick: v(f)
}), {
default: k(() => [
p.loading ? (S(), x(he, { key: 0 }, [
p.$slots.loading ? H(p.$slots, "loading", { key: 0 }) : (S(), V(v(et), {
key: 1,
class: P(v(a).is("loading"))
}, {
default: k(() => [
(S(), V(Re(p.loadingIcon)))
]),
_: 1
}, 8, ["class"]))
], 64)) : p.icon || p.$slots.icon ? (S(), V(v(et), { key: 1 }, {
default: k(() => [
p.icon ? (S(), V(Re(p.icon), { key: 0 })) : H(p.$slots, "icon", { key: 1 })
]),
_: 3
})) : z("v-if", !0),
p.$slots.default ? (S(), x("span", {
key: 2,
class: P({ [v(a).em("text", "expand")]: v(d) })
}, [
H(p.$slots, "default")
], 2)) : z("v-if", !0)
]),
_: 3
}, 16, ["class", "style", "onClick"]));
}
});
var Xm = /* @__PURE__ */ X(Qm, [["__file", "button.vue"]]);
const eg = {
size: yi.size,
type: yi.type
}, tg = B({
name: "ElButtonGroup"
}), ng = /* @__PURE__ */ B({
...tg,
props: eg,
setup(e) {
const t = e;
fe(jr, ut({
size: Je(t, "size"),
type: Je(t, "type")
}));
const n = ee("button");
return (o, i) => (S(), x("div", {
class: P(v(n).b("group"))
}, [
H(o.$slots, "default")
], 2));
}
});
var Ur = /* @__PURE__ */ X(ng, [["__file", "button-group.vue"]]);
const Wr = Me(Xm, {
ButtonGroup: Ur
});
zt(Ur);
var og = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
function ig(e) {
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
}
const yt = /* @__PURE__ */ new Map();
if (re) {
let e;
document.addEventListener("mousedown", (t) => e = t), document.addEventListener("mouseup", (t) => {
if (e) {
for (const n of yt.values())
for (const { documentHandler: o } of n)
o(t, e);
e = void 0;
}
});
}
function ws(e, t) {
let n = [];
return Array.isArray(t.arg) ? n = t.arg : xt(t.arg) && n.push(t.arg), function(o, i) {
const a = t.instance.popperRef, s = o.target, r = i == null ? void 0 : i.target, l = !t || !t.instance, u = !s || !r, c = e.contains(s) || e.contains(r), d = e === s, f = n.length && n.some((p) => p == null ? void 0 : p.contains(s)) || n.length && n.includes(r), m = a && (a.contains(s) || a.contains(r));
l || u || c || d || f || m || t.value(o, i);
};
}
const ag = {
beforeMount(e, t) {
yt.has(e) || yt.set(e, []), yt.get(e).push({
documentHandler: ws(e, t),
bindingFn: t.value
});
},
updated(e, t) {
yt.has(e) || yt.set(e, []);
const n = yt.get(e), o = n.findIndex((a) => a.bindingFn === t.oldValue), i = {
documentHandler: ws(e, t),
bindingFn: t.value
};
o >= 0 ? n.splice(o, 1, i) : n.push(i);
},
unmounted(e) {
yt.delete(e);
}
}, qr = {
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: dn,
tabindex: [String, Number],
validateEvent: {
type: Boolean,
default: !0
},
...Ht(["ariaControls"])
}, Gr = {
[we]: (e) => He(e) || ve(e) || ct(e),
change: (e) => He(e) || ve(e) || ct(e)
}, pn = Symbol("checkboxGroupContextKey"), sg = ({
model: e,
isChecked: t
}) => {
const n = q(pn, void 0), o = b(() => {
var a, s;
const r = (a = n == null ? void 0 : n.max) == null ? void 0 : a.value, l = (s = n == null ? void 0 : n.min) == null ? void 0 : s.value;
return !Ct(r) && e.value.length >= r && !t.value || !Ct(l) && e.value.length <= l && t.value;
});
return {
isDisabled: Ro(b(() => (n == null ? void 0 : n.disabled.value) || o.value)),
isLimitDisabled: o
};
}, rg = (e, {
model: t,
isLimitExceeded: n,
hasOwnLabel: o,
isDisabled: i,
isLabeledByFormItem: a
}) => {
const s = q(pn, void 0), { formItem: r } = fn(), { emit: l } = ge();
function u(p) {
var h, g, y, w;
return [!0, e.trueValue, e.trueLabel].includes(p) ? (g = (h = e.trueValue) != null ? h : e.trueLabel) != null ? g : !0 : (w = (y = e.falseValue) != null ? y : e.falseLabel) != null ? w : !1;
}
function c(p, h) {
l("change", u(p), h);
}
function d(p) {
if (n.value)
return;
const h = p.target;
l("change", u(h.checked), p);
}
async function f(p) {
n.value || !o.value && !i.value && a.value && (p.composedPath().some((y) => y.tagName === "LABEL") || (t.value = u([!1, e.falseValue, e.falseLabel].includes(t.value)), await ce(), c(t.value, p)));
}
const m = b(() => (s == null ? void 0 : s.validateEvent) || e.validateEvent);
return W(() => e.modelValue, () => {
m.value && (r == null || r.validate("change").catch((p) => Oe(p)));
}), {
handleChange: d,
onClickRoot: f
};
}, lg = (e) => {
const t = _(!1), { emit: n } = ge(), o = q(pn, void 0), i = b(() => Ct(o) === !1), a = _(!1), s = b({
get() {
var r, l;
return i.value ? (r = o == null ? void 0 : o.modelValue) == null ? void 0 : r.value : (l = e.modelValue) != null ? l : t.value;
},
set(r) {
var l, u;
i.value && Ie(r) ? (a.value = ((l = o == null ? void 0 : o.max) == null ? void 0 : l.value) !== void 0 && r.length > (o == null ? void 0 : o.max.value) && r.length > s.value.length, a.value === !1 && ((u = o == null ? void 0 : o.changeEvent) == null || u.call(o, r))) : (n(we, r), t.value = r);
}
});
return {
model: s,
isGroup: i,
isLimitExceeded: a
};
}, ug = (e, t, { model: n }) => {
const o = q(pn, void 0), i = _(!1), a = b(() => xn(e.value) ? e.label : e.value), s = b(() => {
const c = n.value;
return ct(c) ? c : Ie(c) ? ke(a.value) ? c.map(vo).some((d) => bo(d, a.value)) : c.map(vo).includes(a.value) : c != null ? c === e.trueValue || c === e.trueLabel : !!c;
}), r = ln(b(() => {
var c;
return (c = o == null ? void 0 : o.size) == null ? void 0 : c.value;
}), {
prop: !0
}), l = ln(b(() => {
var c;
return (c = o == null ? void 0 : o.size) == null ? void 0 : c.value;
})), u = b(() => !!t.default || !xn(a.value));
return {
checkboxButtonSize: r,
isChecked: s,
isFocused: i,
checkboxSize: l,
hasOwnLabel: u,
actualValue: a
};
}, Jr = (e, t) => {
const { formItem: n } = fn(), { model: o, isGroup: i, isLimitExceeded: a } = lg(e), {
isFocused: s,
isChecked: r,
checkboxButtonSize: l,
checkboxSize: u,
hasOwnLabel: c,
actualValue: d
} = ug(e, t, { model: o }), { isDisabled: f } = sg({ model: o, isChecked: r }), { inputId: m, isLabeledByFormItem: p } = $o(e, {
formItemContext: n,
disableIdGeneration: c,
disableIdManagement: i
}), { handleChange: h, onClickRoot: g } = rg(e, {
model: o,
isLimitExceeded: a,
hasOwnLabel: c,
isDisabled: f,
isLabeledByFormItem: p
});
return (() => {
function w() {
var M, T;
Ie(o.value) && !o.value.includes(d.value) ? o.value.push(d.value) : o.value = (T = (M = e.trueValue) != null ? M : e.trueLabel) != null ? T : !0;
}
e.checked && w();
})(), Xt({
from: "label act as value",
replacement: "value",
version: "3.0.0",
scope: "el-checkbox",
ref: "https://element-plus.org/en-US/component/checkbox.html"
}, b(() => i.value && xn(e.value))), Xt({
from: "true-label",
replacement: "true-value",
version: "3.0.0",
scope: "el-checkbox",
ref: "https://element-plus.org/en-US/component/checkbox.html"
}, b(() => !!e.trueLabel)), Xt({
from: "false-label",
replacement: "false-value",
version: "3.0.0",
scope: "el-checkbox",
ref: "https://element-plus.org/en-US/component/checkbox.html"
}, b(() => !!e.falseLabel)), {
inputId: m,
isLabeledByFormItem: p,
isChecked: r,
isDisabled: f,
isFocused: s,
checkboxButtonSize: l,
checkboxSize: u,
hasOwnLabel: c,
model: o,
actualValue: d,
handleChange: h,
onClickRoot: g
};
}, cg = B({
name: "ElCheckbox"
}), dg = /* @__PURE__ */ B({
...cg,
props: qr,
emits: Gr,
setup(e) {
const t = e, n = Eo(), {
inputId: o,
isLabeledByFormItem: i,
isChecked: a,
isDisabled: s,
isFocused: r,
checkboxSize: l,
hasOwnLabel: u,
model: c,
actualValue: d,
handleChange: f,
onClickRoot: m
} = Jr(t, n), p = ee("checkbox"), h = b(() => [
p.b(),
p.m(l.value),
p.is("disabled", s.value),
p.is("bordered", t.border),
p.is("checked", a.value)
]), g = b(() => [
p.e("input"),
p.is("disabled", s.value),
p.is("checked", a.value),
p.is("indeterminate", t.indeterminate),
p.is("focus", r.value)
]);
return (y, w) => (S(), V(Re(!v(u) && v(i) ? "span" : "label"), {
class: P(v(h)),
"aria-controls": y.indeterminate ? y.ariaControls : null,
onClick: v(m)
}, {
default: k(() => {
var M, T, E, A;
return [
R("span", {
class: P(v(g))
}, [
y.trueValue || y.falseValue || y.trueLabel || y.falseLabel ? ie((S(), x("input", {
key: 0,
id: v(o),
"onUpdate:modelValue": (O) => lt(c) ? c.value = O : null,
class: P(v(p).e("original")),
type: "checkbox",
indeterminate: y.indeterminate,
name: y.name,
tabindex: y.tabindex,
disabled: v(s),
"true-value": (T = (M = y.trueValue) != null ? M : y.trueLabel) != null ? T : !0,
"false-value": (A = (E = y.falseValue) != null ? E : y.falseLabel) != null ? A : !1,
onChange: v(f),
onFocus: (O) => r.value = !0,
onBlur: (O) => r.value = !1,
onClick: le(() => {
}, ["stop"])
}, null, 42, ["id", "onUpdate:modelValue", "indeterminate", "name", "tabindex", "disabled", "true-value", "false-value", "onChange", "onFocus", "onBlur", "onClick"])), [
[mo, v(c)]
]) : ie((S(), x("input", {
key: 1,
id: v(o),
"onUpdate:modelValue": (O) => lt(c) ? c.value = O : null,
class: P(v(p).e("original")),
type: "checkbox",
indeterminate: y.indeterminate,
disabled: v(s),
value: v(d),
name: y.name,
tabindex: y.tabindex,
onChange: v(f),
onFocus: (O) => r.value = !0,
onBlur: (O) => r.value = !1,
onClick: le(() => {
}, ["stop"])
}, null, 42, ["id", "onUpdate:modelValue", "indeterminate", "disabled", "value", "name", "tabindex", "onChange", "onFocus", "onBlur", "onClick"])), [
[mo, v(c)]
]),
R("span", {
class: P(v(p).e("inner"))
}, null, 2)
], 2),
v(u) ? (S(), x("span", {
key: 0,
class: P(v(p).e("label"))
}, [
H(y.$slots, "default"),
y.$slots.default ? z("v-if", !0) : (S(), x(he, { key: 0 }, [
Z(ne(y.label), 1)
], 64))
], 2)) : z("v-if", !0)
];
}),
_: 3
}, 8, ["class", "aria-controls", "onClick"]));
}
});
var fg = /* @__PURE__ */ X(dg, [["__file", "checkbox.vue"]]);
const pg = B({
name: "ElCheckboxButton"
}), hg = /* @__PURE__ */ B({
...pg,
props: qr,
emits: Gr,
setup(e) {
const t = e, n = Eo(), {
isFocused: o,
isChecked: i,
isDisabled: a,
checkboxButtonSize: s,
model: r,
actualValue: l,
handleChange: u
} = Jr(t, n), c = q(pn, void 0), d = ee("checkbox"), f = b(() => {
var p, h, g, y;
const w = (h = (p = c == null ? void 0 : c.fill) == null ? void 0 : p.value) != null ? h : "";
return {
backgroundColor: w,
borderColor: w,
color: (y = (g = c == null ? void 0 : c.textColor) == null ? void 0 : g.value) != null ? y : "",
boxShadow: w ? `-1px 0 0 0 ${w}` : void 0
};
}), m = b(() => [
d.b("button"),
d.bm("button", s.value),
d.is("disabled", a.value),
d.is("checked", i.value),
d.is("focus", o.value)
]);
return (p, h) => {
var g, y, w, M;
return S(), x("label", {
class: P(v(m))
}, [
p.trueValue || p.falseValue || p.trueLabel || p.falseLabel ? ie((S(), x("input", {
key: 0,
"onUpdate:modelValue": (T) => lt(r) ? r.value = T : null,
class: P(v(d).be("button", "original")),
type: "checkbox",
name: p.name,
tabindex: p.tabindex,
disabled: v(a),
"true-value": (y = (g = p.trueValue) != null ? g : p.trueLabel) != null ? y : !0,
"false-value": (M = (w = p.falseValue) != null ? w : p.falseLabel) != null ? M : !1,
onChange: v(u),
onFocus: (T) => o.value = !0,
onBlur: (T) => o.value = !1,
onClick: le(() => {
}, ["stop"])
}, null, 42, ["onUpdate:modelValue", "name", "tabindex", "disabled", "true-value", "false-value", "onChange", "onFocus", "onBlur", "onClick"])), [
[mo, v(r)]
]) : ie((S(), x("input", {
key: 1,
"onUpdate:modelValue": (T) => lt(r) ? r.value = T : null,
class: P(v(d).be("button", "original")),
type: "checkbox",
name: p.name,
tabindex: p.tabindex,
disabled: v(a),
value: v(l),
onChange: v(u),
onFocus: (T) => o.value = !0,
onBlur: (T) => o.value = !1,
onClick: le(() => {
}, ["stop"])
}, null, 42, ["onUpdate:modelValue", "name", "tabindex", "disabled", "value", "onChange", "onFocus", "onBlur", "onClick"])), [
[mo, v(r)]
]),
p.$slots.default || p.label ? (S(), x("span", {
key: 2,
class: P(v(d).be("button", "inner")),
style: se(v(i) ? v(f) : void 0)
}, [
H(p.$slots, "default", {}, () => [
Z(ne(p.label), 1)
])
], 6)) : z("v-if", !0)
], 2);
};
}
});
var Yr = /* @__PURE__ */ X(hg, [["__file", "checkbox-button.vue"]]);
const vg = Q({
modelValue: {
type: U(Array),
default: () => []
},
disabled: Boolean,
min: Number,
max: Number,
size: dn,
fill: String,
textColor: String,
tag: {
type: String,
default: "div"
},
validateEvent: {
type: Boolean,
default: !0
},
...Ht(["ariaLabel"])
}), mg = {
[we]: (e) => Ie(e),
change: (e) => Ie(e)
}, gg = B({
name: "ElCheckboxGroup"
}), yg = /* @__PURE__ */ B({
...gg,
props: vg,
emits: mg,
setup(e, { emit: t }) {
const n = e, o = ee("checkbox"), { formItem: i } = fn(), { inputId: a, isLabeledByFormItem: s } = $o(n, {
formItemContext: i
}), r = async (u) => {
t(we, u), await ce(), t("change", u);
}, l = b({
get() {
return n.modelValue;
},
set(u) {
r(u);
}
});
return fe(pn, {
...or(un(n), [
"size",
"min",
"max",
"disabled",
"validateEvent",
"fill",
"textColor"
]),
modelValue: l,
changeEvent: r
}), W(() => n.modelValue, () => {
n.validateEvent && (i == null || i.validate("change").catch((u) => Oe(u)));
}), (u, c) => {
var d;
return S(), V(Re(u.tag), {
id: v(a),
class: P(v(o).b("group")),
role: "group",
"aria-label": v(s) ? void 0 : u.ariaLabel || "checkbox-group",
"aria-labelledby": v(s) ? (d = v(i)) == null ? void 0 : d.labelId : void 0
}, {
default: k(() => [
H(u.$slots, "default")
]),
_: 3
}, 8, ["id", "class", "aria-label", "aria-labelledby"]);
};
}
});
var Zr = /* @__PURE__ */ X(yg, [["__file", "checkbox-group.vue"]]);
const Qr = Me(fg, {
CheckboxButton: Yr,
CheckboxGroup: Zr
});
zt(Yr);
const Xr = zt(Zr), el = Q({
modelValue: {
type: [String, Number, Boolean],
default: void 0
},
size: dn,
disabled: Boolean,
label: {
type: [String, Number, Boolean],
default: void 0
},
value: {
type: [String, Number, Boolean],
default: void 0
},
name: {
type: String,
default: void 0
}
}), bg = Q({
...el,
border: Boolean
}), tl = {
[we]: (e) => He(e) || ve(e) || ct(e),
[Fi]: (e) => He(e) || ve(e) || ct(e)
}, nl = Symbol("radioGroupKey"), ol = (e, t) => {
const n = _(), o = q(nl, void 0), i = b(() => !!o), a = b(() => xn(e.value) ? e.label : e.value), s = b({
get() {
return i.value ? o.modelValue : e.modelValue;
},
set(d) {
i.value ? o.changeEvent(d) : t && t(we, d), n.value.checked = e.modelValue === a.value;
}
}), r = ln(b(() => o == null ? void 0 : o.size)), l = Ro(b(() => o == null ? void 0 : o.disabled)), u = _(!1), c = b(() => l.value || i.value && s.value !== a.value ? -1 : 0);
return Xt({
from: "label act as value",
replacement: "value",
version: "3.0.0",
scope: "el-radio",
ref: "https://element-plus.org/en-US/component/radio.html"
}, b(() => i.value && xn(e.value))), {
radioRef: n,
isGroup: i,
radioGroup: o,
focus: u,
size: r,
disabled: l,
tabIndex: c,
modelValue: s,
actualValue: a
};
}, wg = B({
name: "ElRadio"
}), Sg = /* @__PURE__ */ B({
...wg,
props: bg,
emits: tl,
setup(e, { emit: t }) {
const n = e, o = ee("radio"), { radioRef: i, radioGroup: a, focus: s, size: r, disabled: l, modelValue: u, actualValue: c } = ol(n, t);
function d() {
ce(() => t("change", u.value));
}
return (f, m) => {
var p;
return S(), x("label", {
class: P([
v(o).b(),
v(o).is("disabled", v(l)),
v(o).is("focus", v(s)),
v(o).is("bordered", f.border),
v(o).is("checked", v(u) === v(c)),
v(o).m(v(r))
])
}, [
R("span", {
class: P([
v(o).e("input"),
v(o).is("disabled", v(l)),
v(o).is("checked", v(u) === v(c))
])
}, [
ie(R("input", {
ref_key: "radioRef",
ref: i,
"onUpdate:modelValue": (h) => lt(u) ? u.value = h : null,
class: P(v(o).e("original")),
value: v(c),
name: f.name || ((p = v(a)) == null ? void 0 : p.name),
disabled: v(l),
checked: v(u) === v(c),
type: "radio",
onFocus: (h) => s.value = !0,
onBlur: (h) => s.value = !1,
onChange: d,
onClick: le(() => {
}, ["stop"])
}, null, 42, ["onUpdate:modelValue", "value", "name", "disabled", "checked", "onFocus", "onBlur", "onClick"]), [
[Rs, v(u)]
]),
R("span", {
class: P(v(o).e("inner"))
}, null, 2)
], 2),
R("span", {
class: P(v(o).e("label")),
onKeydown: le(() => {
}, ["stop"])
}, [
H(f.$slots, "default", {}, () => [
Z(ne(f.label), 1)
])
], 42, ["onKeydown"])
], 2);
};
}
});
var Cg = /* @__PURE__ */ X(Sg, [["__file", "radio.vue"]]);
const Eg = Q({
...el
}), Ig = B({
name: "ElRadioButton"
}), kg = /* @__PURE__ */ B({
...Ig,
props: Eg,
setup(e) {
const t = e, n = ee("radio"), { radioRef: o, focus: i, size: a, disabled: s, modelValue: r, radioGroup: l, actualValue: u } = ol(t), c = b(() => ({
backgroundColor: (l == null ? void 0 : l.fill) || "",
borderColor: (l == null ? void 0 : l.fill) || "",
boxShadow: l != null && l.fill ? `-1px 0 0 0 ${l.fill}` : "",
color: (l == null ? void 0 : l.textColor) || ""
}));
return (d, f) => {
var m;
return S(), x("label", {
class: P([
v(n).b("button"),
v(n).is("active", v(r) === v(u)),
v(n).is("disabled", v(s)),
v(n).is("focus", v(i)),
v(n).bm("button", v(a))
])
}, [
ie(R("input", {
ref_key: "radioRef",
ref: o,
"onUpdate:modelValue": (p) => lt(r) ? r.value = p : null,
class: P(v(n).be("button", "original-radio")),
value: v(u),
type: "radio",
name: d.name || ((m = v(l)) == null ? void 0 : m.name),
disabled: v(s),
onFocus: (p) => i.value = !0,
onBlur: (p) => i.value = !1,
onClick: le(() => {
}, ["stop"])
}, null, 42, ["onUpdate:modelValue", "value", "name", "disabled", "onFocus", "onBlur", "onClick"]), [
[Rs, v(r)]
]),
R("span", {
class: P(v(n).be("button", "inner")),
style: se(v(r) === v(u) ? v(c) : {}),
onKeydown: le(() => {
}, ["stop"])
}, [
H(d.$slots, "default", {}, () => [
Z(ne(d.label), 1)
])
], 46, ["onKeydown"])
], 2);
};
}
});
var il = /* @__PURE__ */ X(kg, [["__file", "radio-button.vue"]]);
const Tg = Q({
id: {
type: String,
default: void 0
},
size: dn,
disabled: Boolean,
modelValue: {
type: [String, Number, Boolean],
default: void 0
},
fill: {
type: String,
default: ""
},
textColor: {
type: String,
default: ""
},
name: {
type: String,
default: void 0
},
validateEvent: {
type: Boolean,
default: !0
},
...Ht(["ariaLabel"])
}), Ag = tl, Og = B({
name: "ElRadioGroup"
}), Mg = /* @__PURE__ */ B({
...Og,
props: Tg,
emits: Ag,
setup(e, { emit: t }) {
const n = e, o = ee("radio"), i = Dt(), a = _(), { formItem: s } = fn(), { inputId: r, isLabeledByFormItem: l } = $o(n, {
formItemContext: s
}), u = (d) => {
t(we, d), ce(() => t("change", d));
};
pe(() => {
const d = a.value.querySelectorAll("[type=radio]"), f = d[0];
!Array.from(d).some((m) => m.checked) && f && (f.tabIndex = 0);
});
const c = b(() => n.name || i.value);
return fe(nl, ut({
...un(n),
changeEvent: u,
name: c
})), W(() => n.modelValue, () => {
n.validateEvent && (s == null || s.validate("change").catch((d) => Oe(d)));
}), (d, f) => (S(), x("div", {
id: v(r),
ref_key: "radioGroupRef",
ref: a,
class: P(v(o).b("group")),
role: "radiogroup",
"aria-label": v(l) ? void 0 : d.ariaLabel || "radio-group",
"aria-labelledby": v(l) ? v(s).labelId : void 0
}, [
H(d.$slots, "default")
], 10, ["id", "aria-label", "aria-labelledby"]));
}
});
var al = /* @__PURE__ */ X(Mg, [["__file", "radio-group.vue"]]);
const sl = Me(Cg, {
RadioButton: il,
RadioGroup: al
}), rl = zt(al);
zt(il);
const wi = Q({
type: {
type: String,
values: ["primary", "success", "info", "warning", "danger"],
default: "primary"
},
closable: Boolean,
disableTransitions: Boolean,
hit: Boolean,
color: String,
size: {
type: String,
values: lr
},
effect: {
type: String,
values: ["dark", "light", "plain"],
default: "light"
},
round: Boolean
}), Pg = {
close: (e) => e instanceof MouseEvent,
click: (e) => e instanceof MouseEvent
}, _g = B({
name: "ElTag"
}), Lg = /* @__PURE__ */ B({
..._g,
props: wi,
emits: Pg,
setup(e, { emit: t }) {
const n = e, o = ln(), i = ee("tag"), a = b(() => {
const { type: u, hit: c, effect: d, closable: f, round: m } = n;
return [
i.b(),
i.is("closable", f),
i.m(u || "primary"),
i.m(o.value),
i.m(d),
i.is("hit", c),
i.is("round", m)
];
}), s = (u) => {
t("close", u);
}, r = (u) => {
t("click", u);
}, l = (u) => {
u.component.subTree.component.bum = null;
};
return (u, c) => u.disableTransitions ? (S(), x("span", {
key: 0,
class: P(v(a)),
style: se({ backgroundColor: u.color }),
onClick: r
}, [
R("span", {
class: P(v(i).e("content"))
}, [
H(u.$slots, "default")
], 2),
u.closable ? (S(), V(v(et), {
key: 0,
class: P(v(i).e("close")),
onClick: le(s, ["stop"])
}, {
default: k(() => [
L(v(si))
]),
_: 1
}, 8, ["class", "onClick"])) : z("v-if", !0)
], 6)) : (S(), V(Bn, {
key: 1,
name: `${v(i).namespace.value}-zoom-in-center`,
appear: "",
onVnodeMounted: l
}, {
default: k(() => [
R("span", {
class: P(v(a)),
style: se({ backgroundColor: u.color }),
onClick: r
}, [
R("span", {
class: P(v(i).e("content"))
}, [
H(u.$slots, "default")
], 2),
u.closable ? (S(), V(v(et), {
key: 0,
class: P(v(i).e("close")),
onClick: le(s, ["stop"])
}, {
default: k(() => [
L(v(si))
]),
_: 1
}, 8, ["class", "onClick"])) : z("v-if", !0)
], 6)
]),
_: 3
}, 8, ["name"]));
}
});
var xg = /* @__PURE__ */ X(Lg, [["__file", "tag.vue"]]);
const Fg = Me(xg), ll = Symbol("rowContextKey"), Rg = [
"start",
"center",
"end",
"space-around",
"space-between",
"space-evenly"
], $g = ["top", "middle", "bottom"], Dg = Q({
tag: {
type: String,
default: "div"
},
gutter: {
type: Number,
default: 0
},
justify: {
type: String,
values: Rg,
default: "start"
},
align: {
type: String,
values: $g
}
}), Ng = B({
name: "ElRow"
}), Bg = /* @__PURE__ */ B({
...Ng,
props: Dg,
setup(e) {
const t = e, n = ee("row"), o = b(() => t.gutter);
fe(ll, {
gutter: o
});
const i = b(() => {
const s = {};
return t.gutter && (s.marginRight = s.marginLeft = `-${t.gutter / 2}px`), s;
}), a = b(() => [
n.b(),
n.is(`justify-${t.justify}`, t.justify !== "start"),
n.is(`align-${t.align}`, !!t.align)
]);
return (s, r) => (S(), V(Re(s.tag), {
class: P(v(a)),
style: se(v(i))
}, {
default: k(() => [
H(s.$slots, "default")
]),
_: 3
}, 8, ["class", "style"]));
}
});
var Vg = /* @__PURE__ */ X(Bg, [["__file", "row.vue"]]);
const Kn = Me(Vg), zg = Q({
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: U([Number, Object]),
default: () => In({})
},
sm: {
type: U([Number, Object]),
default: () => In({})
},
md: {
type: U([Number, Object]),
default: () => In({})
},
lg: {
type: U([Number, Object]),
default: () => In({})
},
xl: {
type: U([Number, Object]),
default: () => In({})
}
}), Hg = B({
name: "ElCol"
}), jg = /* @__PURE__ */ B({
...Hg,
props: zg,
setup(e) {
const t = e, { gutter: n } = q(ll, { gutter: b(() => 0) }), o = ee("col"), i = b(() => {
const s = {};
return n.value && (s.paddingLeft = s.paddingRight = `${n.value / 2}px`), s;
}), a = b(() => {
const s = [];
return ["span", "offset", "pull", "push"].forEach((u) => {
const c = t[u];
ve(c) && (u === "span" ? s.push(o.b(`${t[u]}`)) : c > 0 && s.push(o.b(`${u}-${t[u]}`)));
}), ["xs", "sm", "md", "lg", "xl"].forEach((u) => {
ve(t[u]) ? s.push(o.b(`${u}-${t[u]}`)) : ke(t[u]) && Object.entries(t[u]).forEach(([c, d]) => {
s.push(c !== "span" ? o.b(`${u}-${c}-${d}`) : o.b(`${u}-${d}`));
});
}), n.value && s.push(o.is("guttered")), [o.b(), s];
});
return (s, r) => (S(), V(Re(s.tag), {
class: P(v(a)),
style: se(v(i))
}, {
default: k(() => [
H(s.$slots, "default")
]),
_: 3
}, 8, ["class", "style"]));
}
});
var Kg = /* @__PURE__ */ X(jg, [["__file", "col.vue"]]);
const Un = Me(Kg), Ug = Q({
mask: {
type: Boolean,
default: !0
},
customMaskEvent: Boolean,
overlayClass: {
type: U([
String,
Array,
Object
])
},
zIndex: {
type: U([String, Number])
}
}), Wg = {
click: (e) => e instanceof MouseEvent
}, qg = "overlay";
var Gg = B({
name: "ElOverlay",
props: Ug,
emits: Wg,
setup(e, { slots: t, emit: n }) {
const o = ee(qg), i = (l) => {
n("click", l);
}, { onClick: a, onMousedown: s, onMouseup: r } = Er(e.customMaskEvent ? void 0 : i);
return () => e.mask ? L("div", {
class: [o.b(), e.overlayClass],
style: {
zIndex: e.zIndex
},
onClick: a,
onMousedown: s,
onMouseup: r
}, [H(t, "default")], co.STYLE | co.CLASS | co.PROPS, ["onClick", "onMouseup", "onMousedown"]) : Yt("div", {
class: e.overlayClass,
style: {
zIndex: e.zIndex,
position: "fixed",
top: "0px",
right: "0px",
bottom: "0px",
left: "0px"
}
}, [H(t, "default")]);
}
});
const Jg = Gg, ul = Symbol("dialogInjectionKey"), cl = Q({
center: Boolean,
alignCenter: Boolean,
closeIcon: {
type: tn
},
draggable: Boolean,
overflow: Boolean,
fullscreen: Boolean,
showClose: {
type: Boolean,
default: !0
},
title: {
type: String,
default: ""
},
ariaLevel: {
type: String,
default: "2"
}
}), Yg = {
close: () => !0
}, Zg = B({ name: "ElDialogContent" }), Qg = /* @__PURE__ */ B({
...Zg,
props: cl,
emits: Yg,
setup(e, { expose: t }) {
const n = e, { t: o } = Ri(), { Close: i } = Mp, { dialogRef: a, headerRef: s, bodyId: r, ns: l, style: u } = q(ul), { focusTrapRef: c } = q(Dr), d = b(() => [
l.b(),
l.is("fullscreen", n.fullscreen),
l.is("draggable", n.draggable),
l.is("align-center", n.alignCenter),
{ [l.m("center")]: n.center }
]), f = Lp(c, a), m = b(() => n.draggable), p = b(() => n.overflow), { resetPosition: h } = Fp(a, s, m, p);
return t({
resetPosition: h
}), (g, y) => (S(), x("div", {
ref: v(f),
class: P(v(d)),
style: se(v(u)),
tabindex: "-1"
}, [
R("header", {
ref_key: "headerRef",
ref: s,
class: P([v(l).e("header"), { "show-close": g.showClose }])
}, [
H(g.$slots, "header", {}, () => [
R("span", {
role: "heading",
"aria-level": g.ariaLevel,
class: P(v(l).e("title"))
}, ne(g.title), 11, ["aria-level"])
]),
g.showClose ? (S(), x("button", {
key: 0,
"aria-label": v(o)("el.dialog.close"),
class: P(v(l).e("headerbtn")),
type: "button",
onClick: (w) => g.$emit("close")
}, [
L(v(et), {
class: P(v(l).e("close"))
}, {
default: k(() => [
(S(), V(Re(g.closeIcon || v(i))))
]),
_: 1
}, 8, ["class"])
], 10, ["aria-label", "onClick"])) : z("v-if", !0)
], 2),
R("div", {
id: v(r),
class: P(v(l).e("body"))
}, [
H(g.$slots, "default")
], 10, ["id"]),
g.$slots.footer ? (S(), x("footer", {
key: 0,
class: P(v(l).e("footer"))
}, [
H(g.$slots, "footer")
], 2)) : z("v-if", !0)
], 6));
}
});
var Xg = /* @__PURE__ */ X(Qg, [["__file", "dialog-content.vue"]]);
const ey = Q({
...cl,
appendToBody: Boolean,
appendTo: {
type: U([String, Object]),
default: "body"
},
beforeClose: {
type: U(Function)
},
destroyOnClose: Boolean,
closeOnClickModal: {
type: Boolean,
default: !0
},
closeOnPressEscape: {
type: Boolean,
default: !0
},
lockScroll: {
type: Boolean,
default: !0
},
modal: {
type: Boolean,
default: !0
},
openDelay: {
type: Number,
default: 0
},
closeDelay: {
type: Number,
default: 0
},
top: {
type: String
},
modelValue: Boolean,
modalClass: String,
width: {
type: [String, Number]
},
zIndex: {
type: Number
},
trapFocus: Boolean,
headerAriaLevel: {
type: String,
default: "2"
}
}), ty = {
open: () => !0,
opened: () => !0,
close: () => !0,
closed: () => !0,
[we]: (e) => ct(e),
openAutoFocus: () => !0,
closeAutoFocus: () => !0
}, ny = (e, t) => {
var n;
const i = ge().emit, { nextZIndex: a } = Ui();
let s = "";
const r = Dt(), l = Dt(), u = _(!1), c = _(!1), d = _(!1), f = _((n = e.zIndex) != null ? n : a());
let m, p;
const h = Fo("namespace", On), g = b(() => {
const Y = {}, $ = `--${h.value}-dialog`;
return e.fullscreen || (e.top && (Y[`${$}-margin-top`] = e.top), e.width && (Y[`${$}-width`] = $t(e.width))), Y;
}), y = b(() => e.alignCenter ? { display: "flex" } : {});
function w() {
i("opened");
}
function M() {
i("closed"), i(we, !1), e.destroyOnClose && (d.value = !1);
}
function T() {
i("close");
}
function E() {
p == null || p(), m == null || m(), e.openDelay && e.openDelay > 0 ? { stop: m } = ua(() => N(), e.openDelay) : N();
}
function A() {
m == null || m(), p == null || p(), e.closeDelay && e.closeDelay > 0 ? { stop: p } = ua(() => j(), e.closeDelay) : j();
}
function O() {
function Y($) {
$ || (c.value = !0, u.value = !1);
}
e.beforeClose ? e.beforeClose(Y) : A();
}
function D() {
e.closeOnClickModal && O();
}
function N() {
re && (u.value = !0);
}
function j() {
u.value = !1;
}
function I() {
i("openAutoFocus");
}
function K() {
i("closeAutoFocus");
}
function J(Y) {
var $;
(($ = Y.detail) == null ? void 0 : $.focusReason) === "pointer" && Y.preventDefault();
}
e.lockScroll && Vp(u);
function de() {
e.closeOnPressEscape && O();
}
return W(() => e.modelValue, (Y) => {
Y ? (c.value = !1, E(), d.value = !0, f.value = nr(e.zIndex) ? a() : f.value++, ce(() => {
i("open"), t.value && (t.value.scrollTop = 0);
})) : u.value && A();
}), W(() => e.fullscreen, (Y) => {
t.value && (Y ? (s = t.value.style.transform, t.value.style.transform = "") : t.value.style.transform = s);
}), pe(() => {
e.modelValue && (u.value = !0, d.value = !0, E());
}), {
afterEnter: w,
afterLeave: M,
beforeLeave: T,
handleClose: O,
onModalClick: D,
close: A,
doClose: j,
onOpenAutoFocus: I,
onCloseAutoFocus: K,
onCloseRequested: de,
onFocusoutPrevented: J,
titleId: r,
bodyId: l,
closed: c,
style: g,
overlayDialogStyle: y,
rendered: d,
visible: u,
zIndex: f
};
}, oy = B({
name: "ElDialog",
inheritAttrs: !1
}), iy = /* @__PURE__ */ B({
...oy,
props: ey,
emits: ty,
setup(e, { expose: t }) {
const n = e, o = Eo();
Xt({
scope: "el-dialog",
from: "the title slot",
replacement: "the header slot",
version: "3.0.0",
ref: "https://element-plus.org/en-US/component/dialog.html#slots"
}, b(() => !!o.title));
const i = ee("dialog"), a = _(), s = _(), r = _(), {
visible: l,
titleId: u,
bodyId: c,
style: d,
overlayDialogStyle: f,
rendered: m,
zIndex: p,
afterEnter: h,
afterLeave: g,
beforeLeave: y,
handleClose: w,
onModalClick: M,
onOpenAutoFocus: T,
onCloseAutoFocus: E,
onCloseRequested: A,
onFocusoutPrevented: O
} = ny(n, a);
fe(ul, {
dialogRef: a,
headerRef: s,
bodyId: c,
ns: i,
rendered: m,
style: d
});
const D = Er(M), N = b(() => n.draggable && !n.fullscreen);
return t({
visible: l,
dialogContentRef: r,
resetPosition: () => {
var I;
(I = r.value) == null || I.resetPosition();
}
}), (I, K) => (S(), V(v(zr), {
to: I.appendTo,
disabled: I.appendTo !== "body" ? !1 : !I.appendToBody
}, {
default: k(() => [
L(Bn, {
name: "dialog-fade",
onAfterEnter: v(h),
onAfterLeave: v(g),
onBeforeLeave: v(y),
persisted: ""
}, {
default: k(() => [
ie(L(v(Jg), {
"custom-mask-event": "",
mask: I.modal,
"overlay-class": I.modalClass,
"z-index": v(p)
}, {
default: k(() => [
R("div", {
role: "dialog",
"aria-modal": "true",
"aria-label": I.title || void 0,
"aria-labelledby": I.title ? void 0 : v(u),
"aria-describedby": v(c),
class: P(`${v(i).namespace.value}-overlay-dialog`),
style: se(v(f)),
onClick: v(D).onClick,
onMousedown: v(D).onMousedown,
onMouseup: v(D).onMouseup
}, [
L(v(Br), {
loop: "",
trapped: v(l),
"focus-start-el": "container",
onFocusAfterTrapped: v(T),
onFocusAfterReleased: v(E),
onFocusoutPrevented: v(O),
onReleaseRequested: v(A)
}, {
default: k(() => [
v(m) ? (S(), V(Xg, Nt({
key: 0,
ref_key: "dialogContentRef",
ref: r
}, I.$attrs, {
center: I.center,
"align-center": I.alignCenter,
"close-icon": I.closeIcon,
draggable: v(N),
overflow: I.overflow,
fullscreen: I.fullscreen,
"show-close": I.showClose,
title: I.title,
"aria-level": I.headerAriaLevel,
onClose: v(w)
}), $s({
header: k(() => [
I.$slots.title ? H(I.$slots, "title", { key: 1 }) : H(I.$slots, "header", {
key: 0,
close: v(w),
titleId: v(u),
titleClass: v(i).e("title")
})
]),
default: k(() => [
H(I.$slots, "default")
]),
_: 2
}, [
I.$slots.footer ? {
name: "footer",
fn: k(() => [
H(I.$slots, "footer")
])
} : void 0
]), 1040, ["center", "align-center", "close-icon", "draggable", "overflow", "fullscreen", "show-close", "title", "aria-level", "onClose"])) : z("v-if", !0)
]),
_: 3
}, 8, ["trapped", "onFocusAfterTrapped", "onFocusAfterReleased", "onFocusoutPrevented", "onReleaseRequested"])
], 46, ["aria-label", "aria-labelledby", "aria-describedby", "onClick", "onMousedown", "onMouseup"])
]),
_: 3
}, 8, ["mask", "overlay-class", "z-index"]), [
[Ee, v(l)]
])
]),
_: 3
}, 8, ["onAfterEnter", "onAfterLeave", "onBeforeLeave"])
]),
_: 3
}, 8, ["to", "disabled"]));
}
});
var ay = /* @__PURE__ */ X(iy, [["__file", "dialog.vue"]]);
const sy = Me(ay), ry = /* @__PURE__ */ B({
inheritAttrs: !1
});
function ly(e, t, n, o, i, a) {
return H(e.$slots, "default");
}
var uy = /* @__PURE__ */ X(ry, [["render", ly], ["__file", "collection.vue"]]);
const cy = /* @__PURE__ */ B({
name: "ElCollectionItem",
inheritAttrs: !1
});
function dy(e, t, n, o, i, a) {
return H(e.$slots, "default");
}
var fy = /* @__PURE__ */ X(cy, [["render", dy], ["__file", "collection-item.vue"]]);
const py = "data-el-collection-item", hy = (e) => {
const t = `El${e}Collection`, n = `${t}Item`, o = Symbol(t), i = Symbol(n), a = {
...uy,
name: t,
setup() {
const r = _(null), l = /* @__PURE__ */ new Map();
fe(o, {
itemMap: l,
getItems: () => {
const c = v(r);
if (!c)
return [];
const d = Array.from(c.querySelectorAll(`[${py}]`));
return [...l.values()].sort((m, p) => d.indexOf(m.ref) - d.indexOf(p.ref));
},
collectionRef: r
});
}
}, s = {
...fy,
name: n,
setup(r, { attrs: l }) {
const u = _(null), c = q(o, void 0);
fe(i, {
collectionItemRef: u
}), pe(() => {
const d = v(u);
d && c.itemMap.set(d, {
ref: d,
...l
});
}), Be(() => {
const d = v(u);
c.itemMap.delete(d);
});
}
};
return {
COLLECTION_INJECTION_KEY: o,
COLLECTION_ITEM_INJECTION_KEY: i,
ElCollection: a,
ElCollectionItem: s
};
}, ni = Q({
trigger: Nn.trigger,
effect: {
...Le.effect,
default: "light"
},
type: {
type: U(String)
},
placement: {
type: U(String),
default: "bottom"
},
popperOptions: {
type: U(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: U([Number, String]),
default: 0
},
maxHeight: {
type: U([Number, String]),
default: ""
},
popperClass: {
type: String,
default: ""
},
disabled: Boolean,
role: {
type: String,
default: "menu"
},
buttonProps: {
type: U(Object)
},
teleported: Le.teleported
});
Q({
command: {
type: [Object, String, Number],
default: () => ({})
},
disabled: Boolean,
divided: Boolean,
textValue: String,
icon: {
type: tn
}
});
Q({
onKeydown: { type: U(Function) }
});
hy("Dropdown");
const dl = Symbol("ElSelectGroup"), No = Symbol("ElSelect");
function vy(e, t) {
const n = q(No), o = q(dl, { disabled: !1 }), i = b(() => c(St(n.props.modelValue), e.value)), a = b(() => {
var m;
if (n.props.multiple) {
const p = St((m = n.props.modelValue) != null ? m : []);
return !i.value && p.length >= n.props.multipleLimit && n.props.multipleLimit > 0;
} else
return !1;
}), s = b(() => e.label || (ke(e.value) ? "" : e.value)), r = b(() => e.value || e.label || ""), l = b(() => e.disabled || t.groupDisabled || a.value), u = ge(), c = (m = [], p) => {
if (ke(e.value)) {
const h = n.props.valueKey;
return m && m.some((g) => vo(at(g, h)) === at(p, h));
} else
return m && m.includes(p);
}, d = () => {
!e.disabled && !o.disabled && (n.states.hoveringIndex = n.optionsArray.indexOf(u.proxy));
}, f = (m) => {
const p = new RegExp(Ip(m), "i");
t.visible = p.test(s.value) || e.created;
};
return W(() => s.value, () => {
!e.created && !n.props.remote && n.setSelected();
}), W(() => e.value, (m, p) => {
const { remote: h, valueKey: g } = n.props;
if (m !== p && (n.onOptionDestroy(p, u.proxy), n.onOptionCreate(u.proxy)), !e.created && !h) {
if (g && ke(m) && ke(p) && m[g] === p[g])
return;
n.setSelected();
}
}), W(() => o.disabled, () => {
t.groupDisabled = o.disabled;
}, { immediate: !0 }), {
select: n,
currentLabel: s,
currentValue: r,
itemSelected: i,
isDisabled: l,
hoverItem: d,
updateOption: f
};
}
const my = B({
name: "ElOption",
componentName: "ElOption",
props: {
value: {
required: !0,
type: [String, Number, Boolean, Object]
},
label: [String, Number],
created: Boolean,
disabled: Boolean
},
setup(e) {
const t = ee("select"), n = Dt(), o = b(() => [
t.be("dropdown", "item"),
t.is("disabled", v(r)),
t.is("selected", v(s)),
t.is("hovering", v(f))
]), i = ut({
index: -1,
groupDisabled: !1,
visible: !0,
hover: !1
}), {
currentLabel: a,
itemSelected: s,
isDisabled: r,
select: l,
hoverItem: u,
updateOption: c
} = vy(e, i), { visible: d, hover: f } = un(i), m = ge().proxy;
l.onOptionCreate(m), Be(() => {
const h = m.value, { selected: g } = l.states, w = (l.props.multiple ? g : [g]).some((M) => M.value === m.value);
ce(() => {
l.states.cachedOptions.get(h) === m && !w && l.states.cachedOptions.delete(h);
}), l.onOptionDestroy(h, m);
});
function p() {
r.value || l.handleOptionSelect(m);
}
return {
ns: t,
id: n,
containerKls: o,
currentLabel: a,
itemSelected: s,
isDisabled: r,
select: l,
hoverItem: u,
updateOption: c,
visible: d,
hover: f,
selectOptionClick: p,
states: i
};
}
});
function gy(e, t, n, o, i, a) {
return ie((S(), x("li", {
id: e.id,
class: P(e.containerKls),
role: "option",
"aria-disabled": e.isDisabled || void 0,
"aria-selected": e.itemSelected,
onMouseenter: e.hoverItem,
onClick: le(e.selectOptionClick, ["stop"])
}, [
H(e.$slots, "default", {}, () => [
R("span", null, ne(e.currentLabel), 1)
])
], 42, ["id", "aria-disabled", "aria-selected", "onMouseenter", "onClick"])), [
[Ee, e.visible]
]);
}
var Qi = /* @__PURE__ */ X(my, [["render", gy], ["__file", "option.vue"]]);
const yy = B({
name: "ElSelectDropdown",
componentName: "ElSelectDropdown",
setup() {
const e = q(No), t = ee("select"), n = b(() => e.props.popperClass), o = b(() => e.props.multiple), i = b(() => e.props.fitInputWidth), a = _("");
function s() {
var r;
a.value = `${(r = e.selectRef) == null ? void 0 : r.offsetWidth}px`;
}
return pe(() => {
s(), bt(e.selectRef, s);
}), {
ns: t,
minWidth: a,
popperClass: n,
isMultiple: o,
isFitInputWidth: i
};
}
});
function by(e, t, n, o, i, a) {
return S(), x("div", {
class: P([e.ns.b("dropdown"), e.ns.is("multiple", e.isMultiple), e.popperClass]),
style: se({ [e.isFitInputWidth ? "width" : "minWidth"]: e.minWidth })
}, [
e.$slots.header ? (S(), x("div", {
key: 0,
class: P(e.ns.be("dropdown", "header"))
}, [
H(e.$slots, "header")
], 2)) : z("v-if", !0),
H(e.$slots, "default"),
e.$slots.footer ? (S(), x("div", {
key: 1,
class: P(e.ns.be("dropdown", "footer"))
}, [
H(e.$slots, "footer")
], 2)) : z("v-if", !0)
], 6);
}
var wy = /* @__PURE__ */ X(yy, [["render", by], ["__file", "select-dropdown.vue"]]);
const Sy = 11, Cy = (e, t) => {
const { t: n } = Ri(), o = Dt(), i = ee("select"), a = ee("input"), s = ut({
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
}), r = _(null), l = _(null), u = _(null), c = _(null), d = _(null), f = _(null), m = _(null), p = _(null), h = _(null), g = _(null), y = _(null), w = _(null), {
isComposing: M,
handleCompositionStart: T,
handleCompositionUpdate: E,
handleCompositionEnd: A
} = iv({
afterComposition: (C) => bn(C)
}), { wrapperRef: O, isFocused: D } = ov(d, {
beforeFocus() {
return $.value;
},
afterFocus() {
e.automaticDropdown && !N.value && (N.value = !0, s.menuVisibleOnFocus = !0);
},
beforeBlur(C) {
var F, G;
return ((F = u.value) == null ? void 0 : F.isFocusInsideContent(C)) || ((G = c.value) == null ? void 0 : G.isFocusInsideContent(C));
},
afterBlur() {
N.value = !1, s.menuVisibleOnFocus = !1;
}
}), N = _(!1), j = _(), { form: I, formItem: K } = fn(), { inputId: J } = $o(e, {
formItemContext: K
}), { valueOnClear: de, isEmptyValue: Y } = uv(e), $ = b(() => e.disabled || (I == null ? void 0 : I.disabled)), te = b(() => Ie(e.modelValue) ? e.modelValue.length > 0 : !Y(e.modelValue)), xe = b(() => e.clearable && !$.value && s.inputHovering && te.value), ye = b(() => e.remote && e.filterable && !e.remoteShowSuffix ? "" : e.suffixIcon), be = b(() => i.is("reverse", ye.value && N.value)), Pe = b(() => (K == null ? void 0 : K.validateState) || ""), Ue = b(() => Pp[Pe.value]), jt = b(() => e.remote ? 300 : 0), We = b(() => e.loading ? e.loadingText || n("el.select.loading") : e.remote && !s.inputValue && s.options.size === 0 ? !1 : e.filterable && s.inputValue && s.options.size > 0 && Ce.value === 0 ? e.noMatchText || n("el.select.noMatch") : s.options.size === 0 ? e.noDataText || n("el.select.noData") : null), Ce = b(() => ue.value.filter((C) => C.visible).length), ue = b(() => {
const C = Array.from(s.options.values()), F = [];
return s.optionValues.forEach((G) => {
const oe = C.findIndex((vt) => vt.value === G);
oe > -1 && F.push(C[oe]);
}), F.length >= C.length ? F : C;
}), Tt = b(() => Array.from(s.cachedOptions.values())), ht = b(() => {
const C = ue.value.filter((F) => !F.created).some((F) => F.currentLabel === s.inputValue);
return e.filterable && e.allowCreate && s.inputValue !== "" && !C;
}), qn = () => {
e.filterable && Se(e.filterMethod) || e.filterable && e.remote && Se(e.remoteMethod) || ue.value.forEach((C) => {
var F;
(F = C.updateOption) == null || F.call(C, s.inputValue);
});
}, Gn = ln(), hn = b(() => ["small"].includes(Gn.value) ? "small" : "default"), zo = b({
get() {
return N.value && We.value !== !1;
},
set(C) {
N.value = C;
}
}), Jn = b(() => {
if (e.multiple && !Ct(e.modelValue))
return St(e.modelValue).length === 0 && !s.inputValue;
const C = Ie(e.modelValue) ? e.modelValue[0] : e.modelValue;
return e.filterable || Ct(C) ? !s.inputValue : !0;
}), Ho = b(() => {
var C;
const F = (C = e.placeholder) != null ? C : n("el.select.placeholder");
return e.multiple || !te.value ? F : s.selectedLabel;
}), jo = b(() => ri ? null : "mouseenter");
W(() => e.modelValue, (C, F) => {
e.multiple && e.filterable && !e.reserveKeyword && (s.inputValue = "", At("")), Kt(), !bo(C, F) && e.validateEvent && (K == null || K.validate("change").catch((G) => Oe(G)));
}, {
flush: "post",
deep: !0
}), W(() => N.value, (C) => {
C ? At(s.inputValue) : (s.inputValue = "", s.previousQuery = null, s.isBeforeHide = !0), t("visible-change", C);
}), W(() => s.options.entries(), () => {
var C;
if (!re)
return;
const F = ((C = r.value) == null ? void 0 : C.querySelectorAll("input")) || [];
(!e.filterable && !e.defaultFirstOption && !Ct(e.modelValue) || !Array.from(F).includes(document.activeElement)) && Kt(), e.defaultFirstOption && (e.filterable || e.remote) && Ce.value && vn();
}, {
flush: "post"
}), W(() => s.hoveringIndex, (C) => {
ve(C) && C > -1 ? j.value = ue.value[C] || {} : j.value = {}, ue.value.forEach((F) => {
F.hover = j.value === F;
});
}), xs(() => {
s.isBeforeHide || qn();
});
const At = (C) => {
s.previousQuery === C || M.value || (s.previousQuery = C, e.filterable && Se(e.filterMethod) ? e.filterMethod(C) : e.filterable && e.remote && Se(e.remoteMethod) && e.remoteMethod(C), e.defaultFirstOption && (e.filterable || e.remote) && Ce.value ? ce(vn) : ce(nt));
}, vn = () => {
const C = ue.value.filter((oe) => oe.visible && !oe.disabled && !oe.states.groupDisabled), F = C.find((oe) => oe.created), G = C[0];
s.hoveringIndex = oa(ue.value, F || G);
}, Kt = () => {
if (e.multiple)
s.selectedLabel = "";
else {
const F = Ie(e.modelValue) ? e.modelValue[0] : e.modelValue, G = Yn(F);
s.selectedLabel = G.currentLabel, s.selected = [G];
return;
}
const C = [];
Ct(e.modelValue) || St(e.modelValue).forEach((F) => {
C.push(Yn(F));
}), s.selected = C;
}, Yn = (C) => {
let F;
const G = Uo(C).toLowerCase() === "object", oe = Uo(C).toLowerCase() === "null", vt = Uo(C).toLowerCase() === "undefined";
for (let Mt = s.cachedOptions.size - 1; Mt >= 0; Mt--) {
const qe = Tt.value[Mt];
if (G ? at(qe.value, e.valueKey) === at(C, e.valueKey) : qe.value === C) {
F = {
value: C,
currentLabel: qe.currentLabel,
get isDisabled() {
return qe.isDisabled;
}
};
break;
}
}
if (F)
return F;
const Wt = G ? C.label : !oe && !vt ? C : "";
return {
value: C,
currentLabel: Wt
};
}, nt = () => {
s.hoveringIndex = ue.value.findIndex((C) => s.selected.some((F) => Ko(F) === Ko(C)));
}, Ut = () => {
s.selectionWidth = l.value.getBoundingClientRect().width;
}, mn = () => {
s.calculatorWidth = f.value.getBoundingClientRect().width;
}, Zn = () => {
s.collapseItemWidth = y.value.getBoundingClientRect().width;
}, Ot = () => {
var C, F;
(F = (C = u.value) == null ? void 0 : C.updatePopper) == null || F.call(C);
}, gn = () => {
var C, F;
(F = (C = c.value) == null ? void 0 : C.updatePopper) == null || F.call(C);
}, yn = () => {
s.inputValue.length > 0 && !N.value && (N.value = !0), At(s.inputValue);
}, bn = (C) => {
if (s.inputValue = C.target.value, e.remote)
wn();
else
return yn();
}, wn = yp(() => {
yn();
}, jt.value), Sn = (C) => {
bo(e.modelValue, C) || t(Fi, C);
}, bl = (C) => bp(C, (F) => !s.disabledOptions.has(F)), wl = (C) => {
if (e.multiple && C.code !== Rn.delete && C.target.value.length <= 0) {
const F = St(e.modelValue).slice(), G = bl(F);
if (G < 0)
return;
const oe = F[G];
F.splice(G, 1), t(we, F), Sn(F), t("remove-tag", oe);
}
}, Sl = (C, F) => {
const G = s.selected.indexOf(F);
if (G > -1 && !$.value) {
const oe = St(e.modelValue).slice();
oe.splice(G, 1), t(we, oe), Sn(oe), t("remove-tag", F.value);
}
C.stopPropagation(), Xn();
}, ta = (C) => {
C.stopPropagation();
const F = e.multiple ? [] : de.value;
if (e.multiple)
for (const G of s.selected)
G.isDisabled && F.push(G.value);
t(we, F), Sn(F), s.hoveringIndex = -1, N.value = !1, t("clear"), Xn();
}, na = (C) => {
var F;
if (e.multiple) {
const G = St((F = e.modelValue) != null ? F : []).slice(), oe = oa(G, C.value);
oe > -1 ? G.splice(oe, 1) : (e.multipleLimit <= 0 || G.length < e.multipleLimit) && G.push(C.value), t(we, G), Sn(G), C.created && At(""), e.filterable && !e.reserveKeyword && (s.inputValue = "");
} else
t(we, C.value), Sn(C.value), N.value = !1;
Xn(), !N.value && ce(() => {
Qn(C);
});
}, oa = (C = [], F) => {
if (!ke(F))
return C.indexOf(F);
const G = e.valueKey;
let oe = -1;
return C.some((vt, Wt) => vo(at(vt, G)) === at(F, G) ? (oe = Wt, !0) : !1), oe;
}, Qn = (C) => {
var F, G, oe, vt, Wt;
const eo = Ie(C) ? C[0] : C;
let Mt = null;
if (eo != null && eo.value) {
const qe = ue.value.filter((ra) => ra.value === eo.value);
qe.length > 0 && (Mt = qe[0].$el);
}
if (u.value && Mt) {
const qe = (vt = (oe = (G = (F = u.value) == null ? void 0 : F.popperRef) == null ? void 0 : G.contentRef) == null ? void 0 : oe.querySelector) == null ? void 0 : vt.call(oe, `.${i.be("dropdown", "wrap")}`);
qe && Ap(qe, Mt);
}
(Wt = w.value) == null || Wt.handleScroll();
}, Cl = (C) => {
s.options.set(C.value, C), s.cachedOptions.set(C.value, C), C.disabled && s.disabledOptions.set(C.value, C);
}, El = (C, F) => {
s.options.get(C) === F && s.options.delete(C);
}, Il = b(() => {
var C, F;
return (F = (C = u.value) == null ? void 0 : C.popperRef) == null ? void 0 : F.contentRef;
}), kl = () => {
s.isBeforeHide = !1, ce(() => Qn(s.selected));
}, Xn = () => {
var C;
(C = d.value) == null || C.focus();
}, ia = () => {
var C;
(C = d.value) == null || C.blur();
}, Tl = (C) => {
ta(C);
}, Al = () => {
N.value = !1, D.value && ia();
}, Ol = () => {
s.inputValue.length > 0 ? s.inputValue = "" : N.value = !1;
}, aa = () => {
$.value || (ri && (s.inputHovering = !0), s.menuVisibleOnFocus ? s.menuVisibleOnFocus = !1 : N.value = !N.value);
}, Ml = () => {
N.value ? ue.value[s.hoveringIndex] && na(ue.value[s.hoveringIndex]) : aa();
}, Ko = (C) => ke(C.value) ? at(C.value, e.valueKey) : C.value, Pl = b(() => ue.value.filter((C) => C.visible).every((C) => C.disabled)), _l = b(() => e.multiple ? e.collapseTags ? s.selected.slice(0, e.maxCollapseTags) : s.selected : []), Ll = b(() => e.multiple ? e.collapseTags ? s.selected.slice(e.maxCollapseTags) : [] : []), sa = (C) => {
if (!N.value) {
N.value = !0;
return;
}
if (!(s.options.size === 0 || s.filteredOptionsCount === 0 || M.value) && !Pl.value) {
C === "next" ? (s.hoveringIndex++, s.hoveringIndex === s.options.size && (s.hoveringIndex = 0)) : C === "prev" && (s.hoveringIndex--, s.hoveringIndex < 0 && (s.hoveringIndex = s.options.size - 1));
const F = ue.value[s.hoveringIndex];
(F.disabled === !0 || F.states.groupDisabled === !0 || !F.visible) && sa(C), ce(() => Qn(j.value));
}
}, xl = () => {
if (!l.value)
return 0;
const C = window.getComputedStyle(l.value);
return Number.parseFloat(C.gap || "6px");
}, Fl = b(() => {
const C = xl();
return { maxWidth: `${y.value && e.maxCollapseTags === 1 ? s.selectionWidth - s.collapseItemWidth - C : s.selectionWidth}px` };
}), Rl = b(() => ({ maxWidth: `${s.selectionWidth}px` })), $l = b(() => ({
width: `${Math.max(s.calculatorWidth, Sy)}px`
}));
return bt(l, Ut), bt(f, mn), bt(h, Ot), bt(O, Ot), bt(g, gn), bt(y, Zn), pe(() => {
Kt();
}), {
inputId: J,
contentId: o,
nsSelect: i,
nsInput: a,
states: s,
isFocused: D,
expanded: N,
optionsArray: ue,
hoverOption: j,
selectSize: Gn,
filteredOptionsCount: Ce,
resetCalculatorWidth: mn,
updateTooltip: Ot,
updateTagTooltip: gn,
debouncedOnInputChange: wn,
onInput: bn,
deletePrevTag: wl,
deleteTag: Sl,
deleteSelected: ta,
handleOptionSelect: na,
scrollToOption: Qn,
hasModelValue: te,
shouldShowPlaceholder: Jn,
currentPlaceholder: Ho,
mouseEnterEventName: jo,
showClose: xe,
iconComponent: ye,
iconReverse: be,
validateState: Pe,
validateIcon: Ue,
showNewOption: ht,
updateOptions: qn,
collapseTagSize: hn,
setSelected: Kt,
selectDisabled: $,
emptyText: We,
handleCompositionStart: T,
handleCompositionUpdate: E,
handleCompositionEnd: A,
onOptionCreate: Cl,
onOptionDestroy: El,
handleMenuEnter: kl,
focus: Xn,
blur: ia,
handleClearClick: Tl,
handleClickOutside: Al,
handleEsc: Ol,
toggleMenu: aa,
selectOption: Ml,
getValueKey: Ko,
navigateOptions: sa,
dropdownMenuVisible: zo,
showTagList: _l,
collapseTagList: Ll,
tagStyle: Fl,
collapseTagStyle: Rl,
inputStyle: $l,
popperRef: Il,
inputRef: d,
tooltipRef: u,
tagTooltipRef: c,
calculatorRef: f,
prefixRef: m,
suffixRef: p,
selectRef: r,
wrapperRef: O,
selectionRef: l,
scrollbarRef: w,
menuRef: h,
tagMenuRef: g,
collapseItemRef: y
};
};
var Ey = B({
name: "ElOptions",
setup(e, { slots: t }) {
const n = q(No);
let o = [];
return () => {
var i, a;
const s = (i = t.default) == null ? void 0 : i.call(t), r = [];
function l(u) {
Ie(u) && u.forEach((c) => {
var d, f, m, p;
const h = (d = (c == null ? void 0 : c.type) || {}) == null ? void 0 : d.name;
h === "ElOptionGroup" ? l(!He(c.children) && !Ie(c.children) && Se((f = c.children) == null ? void 0 : f.default) ? (m = c.children) == null ? void 0 : m.default() : c.children) : h === "ElOption" ? r.push((p = c.props) == null ? void 0 : p.value) : Ie(c.children) && l(c.children);
});
}
return s.length && l((a = s[0]) == null ? void 0 : a.children), bo(r, o) || (o = r, n && (n.states.optionValues = r)), s;
};
}
});
const Iy = Q({
name: String,
id: String,
modelValue: {
type: [Array, String, Number, Boolean, Object],
default: void 0
},
autocomplete: {
type: String,
default: "off"
},
automaticDropdown: Boolean,
size: dn,
effect: {
type: U(String),
default: "light"
},
disabled: Boolean,
clearable: Boolean,
filterable: Boolean,
allowCreate: Boolean,
loading: Boolean,
popperClass: {
type: String,
default: ""
},
popperOptions: {
type: U(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: Le.teleported,
persistent: {
type: Boolean,
default: !0
},
clearIcon: {
type: tn,
default: As
},
fitInputWidth: Boolean,
suffixIcon: {
type: tn,
default: ki
},
tagType: { ...wi.type, default: "info" },
tagEffect: { ...wi.effect, default: "light" },
validateEvent: {
type: Boolean,
default: !0
},
remoteShowSuffix: Boolean,
placement: {
type: U(String),
values: Lo,
default: "bottom-start"
},
fallbackPlacements: {
type: U(Array),
default: ["bottom-start", "top-start", "right", "left"]
},
appendTo: String,
...lv,
...Ht(["ariaLabel"])
}), Ss = "ElSelect", ky = B({
name: Ss,
componentName: Ss,
components: {
ElSelectMenu: wy,
ElOption: Qi,
ElOptions: Ey,
ElTag: Fg,
ElScrollbar: _v,
ElTooltip: Hr,
ElIcon: et
},
directives: { ClickOutside: ag },
props: Iy,
emits: [
we,
Fi,
"remove-tag",
"clear",
"visible-change",
"focus",
"blur"
],
setup(e, { emit: t }) {
const n = b(() => {
const { modelValue: a, multiple: s } = e, r = s ? [] : void 0;
return Ie(a) ? s ? a : r : s ? r : a;
}), o = ut({
...un(e),
modelValue: n
}), i = Cy(o, t);
return fe(No, ut({
props: o,
states: i.states,
optionsArray: i.optionsArray,
handleOptionSelect: i.handleOptionSelect,
onOptionCreate: i.onOptionCreate,
onOptionDestroy: i.onOptionDestroy,
selectRef: i.selectRef,
setSelected: i.setSelected
})), {
...i,
modelValue: n
};
}
});
function Ty(e, t, n, o, i, a) {
const s = Fe("el-tag"), r = Fe("el-tooltip"), l = Fe("el-icon"), u = Fe("el-option"), c = Fe("el-options"), d = Fe("el-scrollbar"), f = Fe("el-select-menu"), m = Gl("click-outside");
return ie((S(), x("div", {
ref: "selectRef",
class: P([e.nsSelect.b(), e.nsSelect.m(e.selectSize)]),
[Jl(e.mouseEnterEventName)]: (p) => e.states.inputHovering = !0,
onMouseleave: (p) => e.states.inputHovering = !1
}, [
L(r, {
ref: "tooltipRef",
visible: e.dropdownMenuVisible,
placement: e.placement,
teleported: e.teleported,
"popper-class": [e.nsSelect.e("popper"), e.popperClass],
"popper-options": e.popperOptions,
"fallback-placements": e.fallbackPlacements,
effect: e.effect,
pure: "",
trigger: "click",
transition: `${e.nsSelect.namespace.value}-zoom-in-top`,
"stop-popper-mouse-event": !1,
"gpu-acceleration": !1,
persistent: e.persistent,
"append-to": e.appendTo,
onBeforeShow: e.handleMenuEnter,
onHide: (p) => e.states.isBeforeHide = !1
}, {
default: k(() => {
var p;
return [
R("div", {
ref: "wrapperRef",
class: P([
e.nsSelect.e("wrapper"),
e.nsSelect.is("focused", e.isFocused),
e.nsSelect.is("hovering", e.states.inputHovering),
e.nsSelect.is("filterable", e.filterable),
e.nsSelect.is("disabled", e.selectDisabled)
]),
onClick: le(e.toggleMenu, ["prevent"])
}, [
e.$slots.prefix ? (S(), x("div", {
key: 0,
ref: "prefixRef",
class: P(e.nsSelect.e("prefix"))
}, [
H(e.$slots, "prefix")
], 2)) : z("v-if", !0),
R("div", {
ref: "selectionRef",
class: P([
e.nsSelect.e("selection"),
e.nsSelect.is("near", e.multiple && !e.$slots.prefix && !!e.states.selected.length)
])
}, [
e.multiple ? H(e.$slots, "tag", { key: 0 }, () => [
(S(!0), x(he, null, Ye(e.showTagList, (h) => (S(), x("div", {
key: e.getValueKey(h),
class: P(e.nsSelect.e("selected-item"))
}, [
L(s, {
closable: !e.selectDisabled && !h.isDisabled,
size: e.collapseTagSize,
type: e.tagType,
effect: e.tagEffect,
"disable-transitions": "",
style: se(e.tagStyle),
onClose: (g) => e.deleteTag(g, h)
}, {
default: k(() => [
R("span", {
class: P(e.nsSelect.e("tags-text"))
}, [
H(e.$slots, "label", {
label: h.currentLabel,
value: h.value
}, () => [
Z(ne(h.currentLabel), 1)
])
], 2)
]),
_: 2
}, 1032, ["closable", "size", "type", "effect", "style", "onClose"])
], 2))), 128)),
e.collapseTags && e.states.selected.length > e.maxCollapseTags ? (S(), V(r, {
key: 0,
ref: "tagTooltipRef",
disabled: e.dropdownMenuVisible || !e.collapseTagsTooltip,
"fallback-placements": ["bottom", "top", "right", "left"],
effect: e.effect,
placement: "bottom",
teleported: e.teleported
}, {
default: k(() => [
R("div", {
ref: "collapseItemRef",
class: P(e.nsSelect.e("selected-item"))
}, [
L(s, {
closable: !1,
size: e.collapseTagSize,
type: e.tagType,
effect: e.tagEffect,
"disable-transitions": "",
style: se(e.collapseTagStyle)
}, {
default: k(() => [
R("span", {
class: P(e.nsSelect.e("tags-text"))
}, " + " + ne(e.states.selected.length - e.maxCollapseTags), 3)
]),
_: 1
}, 8, ["size", "type", "effect", "style"])
], 2)
]),
content: k(() => [
R("div", {
ref: "tagMenuRef",
class: P(e.nsSelect.e("selection"))
}, [
(S(!0), x(he, null, Ye(e.collapseTagList, (h) => (S(), x("div", {
key: e.getValueKey(h),
class: P(e.nsSelect.e("selected-item"))
}, [
L(s, {
class: "in-tooltip",
closable: !e.selectDisabled && !h.isDisabled,
size: e.collapseTagSize,
type: e.tagType,
effect: e.tagEffect,
"disable-transitions": "",
onClose: (g) => e.deleteTag(g, h)
}, {
default: k(() => [
R("span", {
class: P(e.nsSelect.e("tags-text"))
}, [
H(e.$slots, "label", {
label: h.currentLabel,
value: h.value
}, () => [
Z(ne(h.currentLabel), 1)
])
], 2)
]),
_: 2
}, 1032, ["closable", "size", "type", "effect", "onClose"])
], 2))), 128))
], 2)
]),
_: 3
}, 8, ["disabled", "effect", "teleported"])) : z("v-if", !0)
]) : z("v-if", !0),
e.selectDisabled ? z("v-if", !0) : (S(), x("div", {
key: 1,
class: P([
e.nsSelect.e("selected-item"),
e.nsSelect.e("input-wrapper"),
e.nsSelect.is("hidden", !e.filterable)
])
}, [
ie(R("input", {
id: e.inputId,
ref: "inputRef",
"onUpdate:modelValue": (h) => e.states.inputValue = h,
type: "text",
name: e.name,
class: P([e.nsSelect.e("input"), e.nsSelect.is(e.selectSize)]),
disabled: e.selectDisabled,
autocomplete: e.autocomplete,
style: se(e.inputStyle),
role: "combobox",
readonly: !e.filterable,
spellcheck: "false",
"aria-activedescendant": ((p = e.hoverOption) == null ? void 0 : p.id) || "",
"aria-controls": e.contentId,
"aria-expanded": e.dropdownMenuVisible,
"aria-label": e.ariaLabel,
"aria-autocomplete": "none",
"aria-haspopup": "listbox",
onKeydown: [
Cn(le((h) => e.navigateOptions("next"), ["stop", "prevent"]), ["down"]),
Cn(le((h) => e.navigateOptions("prev"), ["stop", "prevent"]), ["up"]),
Cn(le(e.handleEsc, ["stop", "prevent"]), ["esc"]),
Cn(le(e.selectOption, ["stop", "prevent"]), ["enter"]),
Cn(le(e.deletePrevTag, ["stop"]), ["delete"])
],
onCompositionstart: e.handleCompositionStart,
onCompositionupdate: e.handleCompositionUpdate,
onCompositionend: e.handleCompositionEnd,
onInput: e.onInput,
onClick: le(e.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"]), [
[Yl, e.states.inputValue]
]),
e.filterable ? (S(), x("span", {
key: 0,
ref: "calculatorRef",
"aria-hidden": "true",
class: P(e.nsSelect.e("input-calculator")),
textContent: ne(e.states.inputValue)
}, null, 10, ["textContent"])) : z("v-if", !0)
], 2)),
e.shouldShowPlaceholder ? (S(), x("div", {
key: 2,
class: P([
e.nsSelect.e("selected-item"),
e.nsSelect.e("placeholder"),
e.nsSelect.is("transparent", !e.hasModelValue || e.expanded && !e.states.inputValue)
])
}, [
e.hasModelValue ? H(e.$slots, "label", {
key: 0,
label: e.currentPlaceholder,
value: e.modelValue
}, () => [
R("span", null, ne(e.currentPlaceholder), 1)
]) : (S(), x("span", { key: 1 }, ne(e.currentPlaceholder), 1))
], 2)) : z("v-if", !0)
], 2),
R("div", {
ref: "suffixRef",
class: P(e.nsSelect.e("suffix"))
}, [
e.iconComponent && !e.showClose ? (S(), V(l, {
key: 0,
class: P([e.nsSelect.e("caret"), e.nsSelect.e("icon"), e.iconReverse])
}, {
default: k(() => [
(S(), V(Re(e.iconComponent)))
]),
_: 1
}, 8, ["class"])) : z("v-if", !0),
e.showClose && e.clearIcon ? (S(), V(l, {
key: 1,
class: P([
e.nsSelect.e("caret"),
e.nsSelect.e("icon"),
e.nsSelect.e("clear")
]),
onClick: e.handleClearClick
}, {
default: k(() => [
(S(), V(Re(e.clearIcon)))
]),
_: 1
}, 8, ["class", "onClick"])) : z("v-if", !0),
e.validateState && e.validateIcon ? (S(), V(l, {
key: 2,
class: P([e.nsInput.e("icon"), e.nsInput.e("validateIcon")])
}, {
default: k(() => [
(S(), V(Re(e.validateIcon)))
]),
_: 1
}, 8, ["class"])) : z("v-if", !0)
], 2)
], 10, ["onClick"])
];
}),
content: k(() => [
L(f, { ref: "menuRef" }, {
default: k(() => [
e.$slots.header ? (S(), x("div", {
key: 0,
class: P(e.nsSelect.be("dropdown", "header")),
onClick: le(() => {
}, ["stop"])
}, [
H(e.$slots, "header")
], 10, ["onClick"])) : z("v-if", !0),
ie(L(d, {
id: e.contentId,
ref: "scrollbarRef",
tag: "ul",
"wrap-class": e.nsSelect.be("dropdown", "wrap"),
"view-class": e.nsSelect.be("dropdown", "list"),
class: P([e.nsSelect.is("empty", e.filteredOptionsCount === 0)]),
role: "listbox",
"aria-label": e.ariaLabel,
"aria-orientation": "vertical"
}, {
default: k(() => [
e.showNewOption ? (S(), V(u, {
key: 0,
value: e.states.inputValue,
created: !0
}, null, 8, ["value"])) : z("v-if", !0),
L(c, null, {
default: k(() => [
H(e.$slots, "default")
]),
_: 3
})
]),
_: 3
}, 8, ["id", "wrap-class", "view-class", "class", "aria-label"]), [
[Ee, e.states.options.size > 0 && !e.loading]
]),
e.$slots.loading && e.loading ? (S(), x("div", {
key: 1,
class: P(e.nsSelect.be("dropdown", "loading"))
}, [
H(e.$slots, "loading")
], 2)) : e.loading || e.filteredOptionsCount === 0 ? (S(), x("div", {
key: 2,
class: P(e.nsSelect.be("dropdown", "empty"))
}, [
H(e.$slots, "empty", {}, () => [
R("span", null, ne(e.emptyText), 1)
])
], 2)) : z("v-if", !0),
e.$slots.footer ? (S(), x("div", {
key: 3,
class: P(e.nsSelect.be("dropdown", "footer")),
onClick: le(() => {
}, ["stop"])
}, [
H(e.$slots, "footer")
], 10, ["onClick"])) : z("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"])), [
[m, e.handleClickOutside, e.popperRef]
]);
}
var Ay = /* @__PURE__ */ X(ky, [["render", Ty], ["__file", "select.vue"]]);
const Oy = B({
name: "ElOptionGroup",
componentName: "ElOptionGroup",
props: {
label: String,
disabled: Boolean
},
setup(e) {
const t = ee("select"), n = _(null), o = ge(), i = _([]);
fe(dl, ut({
...un(e)
}));
const a = b(() => i.value.some((u) => u.visible === !0)), s = (u) => {
var c, d;
return ((c = u.type) == null ? void 0 : c.name) === "ElOption" && !!((d = u.component) != null && d.proxy);
}, r = (u) => {
const c = St(u), d = [];
return c.forEach((f) => {
var m, p;
s(f) ? d.push(f.component.proxy) : (m = f.children) != null && m.length ? d.push(...r(f.children)) : (p = f.component) != null && p.subTree && d.push(...r(f.component.subTree));
}), d;
}, l = () => {
i.value = r(o.subTree);
};
return pe(() => {
l();
}), bu(n, l, {
attributes: !0,
subtree: !0,
childList: !0
}), {
groupRef: n,
visible: a,
ns: t
};
}
});
function My(e, t, n, o, i, a) {
return ie((S(), x("ul", {
ref: "groupRef",
class: P(e.ns.be("group", "wrap"))
}, [
R("li", {
class: P(e.ns.be("group", "title"))
}, ne(e.label), 3),
R("li", null, [
R("ul", {
class: P(e.ns.b("group"))
}, [
H(e.$slots, "default")
], 2)
])
], 2)), [
[Ee, e.visible]
]);
}
var fl = /* @__PURE__ */ X(Oy, [["render", My], ["__file", "option-group.vue"]]);
const Bo = Me(Ay, {
Option: Qi,
OptionGroup: fl
}), Xi = zt(Qi);
zt(fl);
const Py = Q({
trigger: Nn.trigger,
placement: ni.placement,
disabled: Nn.disabled,
visible: Le.visible,
transition: Le.transition,
popperOptions: ni.popperOptions,
tabindex: ni.tabindex,
content: Le.content,
popperStyle: Le.popperStyle,
popperClass: Le.popperClass,
enterable: {
...Le.enterable,
default: !0
},
effect: {
...Le.effect,
default: "light"
},
teleported: Le.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
}
}), _y = {
"update:visible": (e) => ct(e),
"before-enter": () => !0,
"before-leave": () => !0,
"after-enter": () => !0,
"after-leave": () => !0
}, Ly = "onUpdate:visible", xy = B({
name: "ElPopover"
}), Fy = /* @__PURE__ */ B({
...xy,
props: Py,
emits: _y,
setup(e, { expose: t, emit: n }) {
const o = e, i = b(() => o[Ly]), a = ee("popover"), s = _(), r = b(() => {
var g;
return (g = v(s)) == null ? void 0 : g.popperRef;
}), l = b(() => [
{
width: $t(o.width)
},
o.popperStyle
]), u = b(() => [a.b(), o.popperClass, { [a.m("plain")]: !!o.content }]), c = b(() => o.transition === `${a.namespace.value}-fade-in-linear`), d = () => {
var g;
(g = s.value) == null || g.hide();
}, f = () => {
n("before-enter");
}, m = () => {
n("before-leave");
}, p = () => {
n("after-enter");
}, h = () => {
n("update:visible", !1), n("after-leave");
};
return t({
popperRef: r,
hide: d
}), (g, y) => (S(), V(v(Hr), Nt({
ref_key: "tooltipRef",
ref: s
}, g.$attrs, {
trigger: g.trigger,
placement: g.placement,
disabled: g.disabled,
visible: g.visible,
transition: g.transition,
"popper-options": g.popperOptions,
tabindex: g.tabindex,
content: g.content,
offset: g.offset,
"show-after": g.showAfter,
"hide-after": g.hideAfter,
"auto-close": g.autoClose,
"show-arrow": g.showArrow,
"aria-label": g.title,
effect: g.effect,
enterable: g.enterable,
"popper-class": v(u),
"popper-style": v(l),
teleported: g.teleported,
persistent: g.persistent,
"gpu-acceleration": v(c),
"onUpdate:visible": v(i),
onBeforeShow: f,
onBeforeHide: m,
onShow: p,
onHide: h
}), {
content: k(() => [
g.title ? (S(), x("div", {
key: 0,
class: P(v(a).e("title")),
role: "title"
}, ne(g.title), 3)) : z("v-if", !0),
H(g.$slots, "default", {}, () => [
Z(ne(g.content), 1)
])
]),
default: k(() => [
g.$slots.reference ? H(g.$slots, "reference", { key: 0 }) : z("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 Ry = /* @__PURE__ */ X(Fy, [["__file", "popover.vue"]]);
const Cs = (e, t) => {
const n = t.arg || t.value, o = n == null ? void 0 : n.popperRef;
o && (o.triggerRef = e);
};
var $y = {
mounted(e, t) {
Cs(e, t);
},
updated(e, t) {
Cs(e, t);
}
};
const Dy = "popover", pl = _p($y, Dy), Vo = Me(Ry, {
directive: pl
});
function Ny(e) {
let t;
const n = _(!1), o = ut({
...e,
originalPosition: "",
originalOverflow: "",
visible: !1
});
function i(f) {
o.text = f;
}
function a() {
const f = o.parent, m = d.ns;
if (!f.vLoadingAddClassList) {
let p = f.getAttribute("loading-number");
p = Number.parseInt(p) - 1, p ? f.setAttribute("loading-number", p.toString()) : (Fn(f, m.bm("parent", "relative")), f.removeAttribute("loading-number")), Fn(f, m.bm("parent", "hidden"));
}
s(), c.unmount();
}
function s() {
var f, m;
(m = (f = d.$el) == null ? void 0 : f.parentNode) == null || m.removeChild(d.$el);
}
function r() {
var f;
e.beforeClose && !e.beforeClose() || (n.value = !0, clearTimeout(t), t = setTimeout(l, 400), o.visible = !1, (f = e.closed) == null || f.call(e));
}
function l() {
if (!n.value)
return;
const f = o.parent;
n.value = !1, f.vLoadingAddClassList = void 0, a();
}
const u = B({
name: "ElLoading",
setup(f, { expose: m }) {
const { ns: p, zIndex: h } = dv("loading");
return m({
ns: p,
zIndex: h
}), () => {
const g = o.spinner || o.svg, y = Yt("svg", {
class: "circular",
viewBox: o.svgViewBox ? o.svgViewBox : "0 0 50 50",
...g ? { innerHTML: g } : {}
}, [
Yt("circle", {
class: "path",
cx: "25",
cy: "25",
r: "20",
fill: "none"
})
]), w = o.text ? Yt("p", { class: p.b("text") }, [o.text]) : void 0;
return Yt(Bn, {
name: p.b("fade"),
onAfterLeave: l
}, {
default: k(() => [
ie(L("div", {
style: {
backgroundColor: o.background || ""
},
class: [
p.b("mask"),
o.customClass,
o.fullscreen ? "is-fullscreen" : ""
]
}, [
Yt("div", {
class: p.b("spinner")
}, [y, w])
]), [[Ee, o.visible]])
])
});
};
}
}), c = Zl(u), d = c.mount(document.createElement("div"));
return {
...un(o),
setText: i,
removeElLoadingChild: s,
close: r,
handleAfterLeave: l,
vm: d,
get $el() {
return d.$el;
}
};
}
let uo;
const Si = function(e = {}) {
if (!re)
return;
const t = By(e);
if (t.fullscreen && uo)
return uo;
const n = Ny({
...t,
closed: () => {
var i;
(i = t.closed) == null || i.call(t), t.fullscreen && (uo = void 0);
}
});
Vy(t, t.parent, n), Es(t, t.parent, n), t.parent.vLoadingAddClassList = () => Es(t, t.parent, n);
let o = t.parent.getAttribute("loading-number");
return o ? o = `${Number.parseInt(o) + 1}` : o = "1", t.parent.setAttribute("loading-number", o), t.parent.appendChild(n.$el), ce(() => n.visible.value = t.visible), t.fullscreen && (uo = n), n;
}, By = (e) => {
var t, n, o, i;
let a;
return He(e.target) ? a = (t = document.querySelector(e.target)) != null ? t : document.body : a = e.target || document.body, {
parent: a === document.body || e.body ? document.body : a,
background: e.background || "",
svg: e.svg || "",
svgViewBox: e.svgViewBox || "",
spinner: e.spinner || !1,
text: e.text || "",
fullscreen: a === document.body && ((n = e.fullscreen) != null ? n : !0),
lock: (o = e.lock) != null ? o : !1,
customClass: e.customClass || "",
visible: (i = e.visible) != null ? i : !0,
beforeClose: e.beforeClose,
closed: e.closed,
target: a
};
}, Vy = async (e, t, n) => {
const { nextZIndex: o } = n.vm.zIndex || n.vm._.exposed.zIndex, i = {};
if (e.fullscreen)
n.originalPosition.value = Zt(document.body, "position"), n.originalOverflow.value = Zt(document.body, "overflow"), i.zIndex = o();
else if (e.parent === document.body) {
n.originalPosition.value = Zt(document.body, "position"), await ce();
for (const a of ["top", "left"]) {
const s = a === "top" ? "scrollTop" : "scrollLeft";
i[a] = `${e.target.getBoundingClientRect()[a] + document.body[s] + document.documentElement[s] - Number.parseInt(Zt(document.body, `margin-${a}`), 10)}px`;
}
for (const a of ["height", "width"])
i[a] = `${e.target.getBoundingClientRect()[a]}px`;
} else
n.originalPosition.value = Zt(t, "position");
for (const [a, s] of Object.entries(i))
n.$el.style[a] = s;
}, Es = (e, t, n) => {
const o = n.vm.ns || n.vm._.exposed.ns;
["absolute", "fixed", "sticky"].includes(n.originalPosition.value) ? Fn(t, o.bm("parent", "relative")) : hi(t, o.bm("parent", "relative")), e.fullscreen && e.lock ? hi(t, o.bm("parent", "hidden")) : Fn(t, o.bm("parent", "hidden"));
}, po = Symbol("ElLoading"), Is = (e, t) => {
var n, o, i, a;
const s = t.instance, r = (f) => ke(t.value) ? t.value[f] : void 0, l = (f) => {
const m = He(f) && (s == null ? void 0 : s[f]) || f;
return m && _(m);
}, u = (f) => l(r(f) || e.getAttribute(`element-loading-${_u(f)}`)), c = (n = r("fullscreen")) != null ? n : t.modifiers.fullscreen, d = {
text: u("text"),
svg: u("svg"),
svgViewBox: u("svgViewBox"),
spinner: u("spinner"),
background: u("background"),
customClass: u("customClass"),
fullscreen: c,
target: (o = r("target")) != null ? o : c ? void 0 : e,
body: (i = r("body")) != null ? i : t.modifiers.body,
lock: (a = r("lock")) != null ? a : t.modifiers.lock
};
e[po] = {
options: d,
instance: Si(d)
};
}, zy = (e, t) => {
for (const n of Object.keys(t))
lt(t[n]) && (t[n].value = e[n]);
}, Ci = {
mounted(e, t) {
t.value && Is(e, t);
},
updated(e, t) {
const n = e[po];
t.oldValue !== t.value && (t.value && !t.oldValue ? Is(e, t) : t.value && t.oldValue ? ke(t.value) && zy(t.value, n.options) : n == null || n.instance.close());
},
unmounted(e) {
var t;
(t = e[po]) == null || t.instance.close(), e[po] = null;
}
}, Hy = {
install(e) {
e.directive("loading", Ci), e.config.globalProperties.$loading = Si;
},
directive: Ci,
service: Si
}, Wn = (e, t) => {
const n = e.__vccOpts || e;
for (const [o, i] of t)
n[o] = i;
return n;
}, jy = {
name: "SelectionsGroup",
components: {
Checkbox: Qr,
CheckboxGroup: Xr,
Col: Un,
Icon: et,
Row: Kn,
ElIconWarning: Os
},
methods: {
/**
* Function to toggle paths to default.
* Also called when the associated button is pressed.
*/
reset: function() {
this.checkAll = !0, this.checkedItems = [], this.selections.forEach((e) => {
!("enabled" in e) || e.enabled === !0 ? this.checkedItems.push(e[this.identifierKey]) : this.checkAll = !1;
});
},
setCheckboxActionData: function(e, t) {
if (e) {
const n = e.querySelector('input[type="checkbox"]'), o = e.querySelector(".el-checkbox__label"), a = e.closest(".selections-container").querySelector(".checkall-display-text");
let s = "";
n && (s = n.checked ? "checked" : "unchecked"), this.checkboxActionData = {
selectionsTitle: a ? a.innerText : "",
property: n && t !== "all" ? n.value : "",
label: o ? o.innerText : "",
checked: s
};
} else
this.checkboxActionData = {
selectionsTitle: "",
property: "",
label: "",
checked: ""
};
},
onCheckboxNativeChange: function(e) {
const t = e.target.closest(".checkbox-container");
this.setCheckboxActionData(t, "individual");
},
onAllCheckboxNativeChange: function(e) {
const t = e.target.closest(".all-checkbox");
this.setCheckboxActionData(t, "all");
},
visibilityToggle: function(e, t) {
this.$emit("changed", { key: e, value: t }), e === this.checkboxActionData.property && (this.checkboxActionData.checked = t ? "checked" : "unchecked"), this.$emit("selections-data-changed", this.checkboxActionData);
},
checkboxMouseEnterEmit: function(e, t) {
this.$emit("checkboxMouseEnter", { key: e, value: t, selections: this.selections, checked: this.checkedItems });
},
handleCheckedItemsChange: function(e) {
let t = e.length;
this.checkAll = t === this.selections.length;
},
handleCheckAllChange: function(e) {
this.checkedItems = e ? this.selections.map((t) => t[this.identifierKey]) : [], this.$emit("checkAll", {
keys: this.selections.map((t) => t[this.identifierKey]),
value: e
}), this.checkboxActionData.property = this.identifierKey, this.checkboxActionData.checked = e ? "checked" : "unchecked", this.$emit("selections-data-changed", this.checkboxActionData);
},
getBackgroundStyles: function(e) {
return "colour" in e && this.colourStyle === "background" ? { background: e.colour } : {};
},
getState: function() {
const t = this.checkedItems.length === this.selections.length;
return {
checkAll: t,
checked: t ? [] : this.checkedItems
};
},
setState: function(e) {
var t;
if (this.checkAll = e.checkAll, this.checkedItems.length = 0, (t = e.checked) != null && t.length)
this.checkedItems.push(...e.checked), this.selections.forEach((n) => {
const o = n[this.identifierKey];
this.$emit("changed", { key: o, value: this.checkedItems.includes(o) });
});
else {
const n = this.selections.map((i) => i[this.identifierKey]);
let o = !1;
this.checkAll && (o = !0, this.checkedItems.push(...n)), this.$emit("checkAll", { keys: n, value: o });
}
},
hasLineStyles: function(e) {
return "colour" in e && this.colourStyle === "line";
},
getLineStyles: function(e) {
return "colour" in e && this.colourStyle === "line" ? "dashed" in e && e.dashed === !0 ? { background: `repeating-linear-gradient(90deg,${e.colour},${e.colour} 6px,transparent 0,transparent 9px)` } : { background: e.colour } : { display: "None" };
}
},
props: {
colourStyle: {
type: String,
default: "line"
},
helpMessage: {
type: String,
default: ""
},
identifierKey: {
type: String,
default: "id"
},
labelKey: {
type: String,
default: "label"
},
title: {
type: String,
default: ""
},
selections: {
type: Array,
default: function() {
return [];
}
},
showAsLegend: {
type: Boolean,
default: !1
}
},
computed: {
isIndeterminate: function() {
return !(this.checkedItems.length === 0 || this.checkAll);
}
},
data: function() {
return {
checkedItems: [],
checkAll: !0,
checkboxActionData: {
selectionsTitle: "",
property: "",
label: "",
checked: ""
}
};
},
mounted: function() {
this.reset();
}
}, Ky = { class: "selections-container" }, Uy = { class: "checkall-display-text" }, Wy = { style: { "word-break": "keep-all" } }, qy = { class: "checkbox-group-inner" }, Gy = ["onMouseenter", "onMouseleave"];
function Jy(e, t, n, o, i, a) {
const s = Os, r = et, l = Vo, u = Un, c = Qr, d = Kn, f = Xr;
return S(), x("div", Ky, [
L(d, null, {
default: k(() => [
L(u, { span: 12 }, {
default: k(() => [
R("span", Uy, ne(n.title), 1),
n.helpMessage ? (S(), V(l, {
key: 0,
width: "250",
trigger: "hover",
teleported: !1,
"popper-class": "popover-origin-help"
}, $s({
default: k(() => [
R("span", Wy, ne(n.helpMessage), 1)
]),
_: 2
}, [
n.helpMessage ? {
name: "reference",
fn: k(() => [
L(r, { class: "info" }, {
default: k(() => [
L(s)
]),
_: 1
})
]),
key: "0"
} : void 0
]), 1024)) : z("", !0)
]),
_: 1
}),
L(u, { span: 12 }, {
default: k(() => [
n.selections && n.selections.length > 1 && !n.showAsLegend ? (S(), V(c, {
key: 0,
class: "all-checkbox",
indeterminate: a.isIndeterminate,
modelValue: e.checkAll,
"onUpdate:modelValue": t[0] || (t[0] = (m) => e.checkAll = m),
onChange: a.handleCheckAllChange,
onClick: a.onAllCheckboxNativeChange
}, {
default: k(() => t[2] || (t[2] = [
Z("Display all")
])),
_: 1
}, 8, ["indeterminate", "modelValue", "onChange", "onClick"])) : z("", !0)
]),
_: 1
})
]),
_: 1
}),
L(f, {
class: P({ "show-as-legend": n.showAsLegend, "checkbox-group": !n.showAsLegend }),
modelValue: e.checkedItems,
"onUpdate:modelValue": t[1] || (t[1] = (m) => e.checkedItems = m),
size: "small",
onChange: a.handleCheckedItemsChange
}, {
default: k(() => [
R("div", qy, [
(S(!0), x(he, null, Ye(n.selections, (m) => (S(), V(d, {
key: m[n.identifierKey],
label: m[n.identifierKey]
}, {
default: k(() => [
R("div", {
class: "checkbox-container",
onMouseenter: (p) => a.checkboxMouseEnterEmit(m[n.identifierKey], !0),
onMouseleave: (p) => a.checkboxMouseEnterEmit(m[n.identifierKey], !1)
}, [
L(c, {
class: "my-checkbox",
label: m[n.identifierKey],
value: m[n.identifierKey],
onChange: (p) => a.visibilityToggle(m[n.identifierKey], p),
onClick: a.onCheckboxNativeChange,
checked: !("enabled" in m) || m.enabled === !0
}, {
default: k(() => [
L(d, { class: "checkbox-row" }, {
default: k(() => [
a.hasLineStyles(m) ? (S(), V(u, {
key: 0,
span: 4
}, {
default: k(() => [
R("div", {
class: "path-visual",
style: se(a.getLineStyles(m))
}, null, 4)
]),
_: 2
}, 1024)) : z("", !0),
L(u, { span: 20 }, {
default: k(() => [
R("div", {
style: se(a.getBackgroundStyles(m))
}, ne(m[n.labelKey]), 5)
]),
_: 2
}, 1024)
]),
_: 2
}, 1024)
]),
_: 2
}, 1032, ["label", "value", "onChange", "onClick", "checked"])
], 40, Gy)
]),
_: 2
}, 1032, ["label"]))), 128))
])
]),
_: 1
}, 8, ["class", "modelValue", "onChange"])
]);
}
const hl = /* @__PURE__ */ Wn(jy, [["render", Jy], ["__scopeId", "data-v-35fb97d0"]]), Yy = '', Zy = {
name: "DynamicLegends",
props: {
identifierKey: {
type: String,
default: "id"
},
styleKey: {
type: String,
default: "style"
},
title: {
type: String,
default: ""
},
legends: {
type: Array,
default: function() {
return [];
}
},
showStarInLegend: {
type: Boolean,
default: !1
}
},
computed: {
clipPathLegends: function() {
return ["exoid", "hexagon"];
}
},
methods: {
capitalise: function(e) {
return e.charAt(0).toUpperCase() + e.slice(1).toLowerCase();
},
customStyle: function(e) {
const t = e.color ? e.color : e.colour;
let n = t || "transparent", o = e.border ? e.border : "black";
if (t && !e.border && (o = n), e[this.styleKey] === "star") {
let i = Yy.replace("", n);
return i = i.replace("", o), i = i.replace("", o ? "2" : "0"), i = "data:image/svg+xml," + encodeURIComponent(i), { color: n, "background-image": `url(${i})` };
} else return e[this.styleKey] === "line" ? { color: n } : { "background-color": n, "border-color": o };
},
customClipPathStyle: function(e, t) {
const n = this.customStyle(e);
return t ? n["background-color"] = n["border-color"] : n.scale = 0.7, n;
},
legendStyle: function(e) {
return e[this.styleKey] === "star" ? e[this.identifierKey] === "Featured dataset marker" && !this.showStarInLegend ? void 0 : "star" : this.clipPathLegends.includes(e[this.styleKey]) ? e[this.styleKey] : e[this.styleKey] === "line" ? [e[this.styleKey], e.dashed ? "dashed" : "", e.arrow ? "arrow" : ""] : [e[this.styleKey], "shape"];
}
}
}, Qy = { class: "legend-group" }, Xy = ["label"], eb = {
key: 0,
class: "legend-item"
}, tb = { class: "label" };
function nb(e, t, n, o, i, a) {
return S(), x("div", Qy, [
(S(!0), x(he, null, Ye(n.legends, (s) => (S(), x("div", {
class: "legend-container",
key: s[n.identifierKey],
label: s[n.identifierKey]
}, [
a.legendStyle(s) ? (S(), x("div", eb, [
a.clipPathLegends.includes(a.legendStyle(s)) ? (S(), x("div", {
key: 0,
class: P(a.legendStyle(s)),
style: se(a.customClipPathStyle(s, !0))
}, [
R("div", {
class: P(a.legendStyle(s)),
style: se(a.customClipPathStyle(s, !1))
}, null, 6)
], 6)) : (S(), x("div", {
key: 1,
class: P(a.legendStyle(s)),
style: se(a.customStyle(s))
}, null, 6)),
R("div", tb, ne(a.capitalise(s[n.identifierKey])), 1)
])) : z("", !0)
], 8, Xy))), 128))
]);
}
const ob = /* @__PURE__ */ Wn(Zy, [["render", nb], ["__scopeId", "data-v-0c2b00a9"]]), ib = {
name: "SvgLegends"
}, ab = { class: "legends-container" }, sb = {
version: "1.1",
id: "Layer_1",
x: "0px",
y: "0px",
viewBox: "0 0 500 500",
style: { "enable-background": "new 0 0 500 500" },
xmlns: "http://www.w3.org/2000/svg",
"xmlns:bx": "https://boxy-svg.com"
};
function rb(e, t, n, o, i, a) {
return S(), x("div", ab, [
(S(), x("svg", sb, t[0] || (t[0] = [
Ql(' Tissue region Brain nuclei Ganglia Ganglionated nerve plexus ', 9)
]))),
t[1] || (t[1] = R("svg", {
width: "72px",
height: "72px",
viewBox: "0 0 24 24",
fill: "yellow"
}, null, -1))
]);
}
const lb = /* @__PURE__ */ Wn(ib, [["render", rb], ["__scopeId", "data-v-88079d87"]]), ub = ``, Tn = function(e) {
return e ? [...new Set(e.map((t) => JSON.stringify(t)))].map(
(t) => JSON.parse(t)
) : [];
}, oi = [], Ei = async function(e, t) {
const n = t.filter(
(a) => oi.some((s) => s.taxon === a)
), o = oi.filter(
(a) => n.includes(a.taxon)
), i = t.filter(
(a) => !n.includes(a)
);
if (i.length) {
const a = await e.queryLabels(i);
if (a.length)
return a.forEach((s) => {
let { entity: r, label: l } = s;
l === "Mammalia" && (l = "Mammalia not otherwise specified");
const u = { taxon: r, label: l };
o.push(u), oi.push(u);
}), o;
} else
return o;
}, ii = function(e, t) {
if (!e || !t) return !1;
let n = JSON.stringify(e), o = JSON.stringify(t);
return n.indexOf(o) !== -1;
}, Jt = (e, t) => {
const n = e.name ?? e, o = t.name ?? t, i = n.toUpperCase(), a = o.toUpperCase();
return i < a ? -1 : i > a ? 1 : 0;
};
let cb = function() {
this.initialise = function(e) {
this.flatmapAPI = e, this.destinations = [], this.origins = [], this.components = [], this.rawURLs = [], this.controller = void 0, this.uberons = [], this.lookUp = [], this.connectivitySource = "map", this.noMapConnectivity = !1;
}, this.createTooltipData = async function(e, t) {
let n = [];
t.feature.hyperlinks && t.feature.hyperlinks.length > 0 ? n = t.feature.hyperlinks : n = this.rawURLs;
let o;
if (t.provenanceTaxonomy) {
o = [];
try {
const a = await Ei(e, t.provenanceTaxonomy);
a.length && a.forEach((s) => {
const { label: r } = s;
o.push(r);
});
} catch (a) {
console.log(a);
}
}
return {
destinations: this.destinations,
origins: this.origins,
components: this.components,
destinationsWithDatasets: this.destinationsWithDatasets,
originsWithDatasets: this.originsWithDatasets,
componentsWithDatasets: this.componentsWithDatasets,
title: t.label,
featureId: t.resource,
hyperlinks: n,
provenanceTaxonomy: t.provenanceTaxonomy,
provenanceTaxonomyLabel: o,
connectivitySource: this.connectivitySource,
noMapConnectivity: this.noMapConnectivity
};
}, this.updateTooltipData = function(e) {
return {
...e,
origins: this.origins,
originsWithDatasets: this.originsWithDatasets,
components: this.components,
componentsWithDatasets: this.componentsWithDatasets,
destinations: this.destinations,
destinationsWithDatasets: this.destinationsWithDatasets,
connectivitySource: this.connectivitySource,
noMapConnectivity: this.noMapConnectivity
};
}, this.createComponentsLabelList = function(e, t) {
let n = [];
return e.forEach((o) => {
n.push(this.createLabelFromNeuralNode(o[0]), t), o.length === 2 && n.push(this.createLabelFromNeuralNode(o[1]), t);
}), n;
}, this.createLabelLookup = function(e, t) {
return new Promise(async (n) => {
let o = {};
this.uberons = [];
const i = await Ei(e, t);
i.length && (i.forEach((a) => {
const { taxon: s, label: r } = a;
o[s] = r, this.uberons.push({
id: s,
name: r
});
}), n(o));
});
}, this.buildConnectivitySqlStatement = function(e) {
let t = "select knowledge from knowledge where entity in (";
if (e.length === 1)
t += `'${e[0]}')`;
else if (e.length > 1)
for (let n in e)
t += `'${e[n]}'${n >= e.length - 1 ? ")" : ","} `;
return t;
}, this.buildLabelSqlStatement = function(e) {
let t = "select entity, label from labels where entity in (";
if (e.length === 1)
t += `'${e[0]}')`;
else if (e.length > 1)
for (let n in e)
t += `'${e[n]}'${n >= e.length - 1 ? ")" : ","} `;
return t;
}, this.findAllIdsFromConnectivity = function(e) {
let t = e.connectivity.flat(), n = [...new Set(t)], o = [];
return n.forEach((i) => {
Array.isArray(i) ? o.push(i.flat()) : o.push(i);
}), [...new Set(o.flat())];
}, this.flattenConnectivity = function(e) {
let t = e.flat(), n = [...new Set(t)], o = [];
return n.forEach((i) => {
Array.isArray(i) ? o.push(i.flat()) : o.push(i);
}), o.flat();
}, this.findComponents = function(e, t, n, o) {
let i = e.connectivity.flat(), a = Tn(i), s = [], r = !1;
return a.forEach((l) => {
r = !1, ii(t, l) && (r = !0), o && ii(o, l) && (r = !0), ii(n, l) && (r = !0), r || s.push(l);
}), s;
}, this.retrieveFlatmapKnowledgeForEvent = async function(e, t) {
this.controller && this.controller.abort(), this.controller = new AbortController(), this.controller.signal;
const n = t.resource;
if (this.destinations = [], this.origins = [], this.components = [], this.rawURLs = [], !n || n.length === 0 || !n[0]) return;
let o = this.queryForConnectivityNew(e, n[0]);
return await Promise.all([o]);
}, this.queryForConnectivityNew = function(e, t, n = "map", o = !0) {
return this.connectivitySource = n, new Promise((i) => {
(n === "map" ? this.queryMapConnectivity(e.provenance.uuid, t) : e.queryKnowledge(t)).then((s) => {
if (this.checkConnectivityExists(s)) {
n === "map" && (this.noMapConnectivity = !1);
let r = s;
o ? this.processConnectivity(e, r).then((l) => {
s.references && (this.rawURLs = [...s.references]), i(l);
}) : i(r);
} else n === "map" ? (this.connectivitySource = "sckan", this.noMapConnectivity = !0, e.queryKnowledge(t).then((r) => {
if (this.checkConnectivityExists(r)) {
let l = r;
o ? this.processConnectivity(e, l).then((u) => {
r.references && (this.rawURLs = [...r.references]), i(u);
}) : i(l);
} else
i(!1);
}).catch(() => i(!1))) : i(!1);
}).catch((s) => {
s.name === "AbortError" || console.warn(`Unable to get the knowledge for the entity ${t}.`), i(!1);
});
});
}, this.queryMapConnectivity = async function(e, t) {
const n = this.flatmapAPI + `flatmap/${e}/connectivity/${t}`;
try {
const o = await fetch(n);
if (!o.ok)
throw new Error(`Response status: ${o.status}`);
return await o.json();
} catch (o) {
throw new Error(o);
}
}, this.queryForConnectivity = function(e, t, n, o = !0) {
const i = { sql: this.buildConnectivitySqlStatement(t) }, a = {
method: "POST",
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify(i),
...n ? { signal: n } : {}
// add signal to header if it exists
};
return new Promise((s) => {
fetch(`${this.flatmapAPI}knowledge/query/`, a).then((r) => r.json()).then((r) => {
if (this.connectivityExists(r)) {
let l = JSON.parse(r.values[0][0]);
o ? this.processConnectivity(e, l).then((u) => {
s(u);
}) : s(l);
} else
s(!1);
}).catch((r) => {
r.name === "AbortError" || console.error("Error:", r), s(!1);
});
});
}, this.checkConnectivityExists = function(e) {
var t;
return e && ((t = e.connectivity) == null ? void 0 : t.length);
}, this.connectivityExists = function(e) {
return !!(e.values && e.values.length > 0 && JSON.parse(e.values[0][0]).connectivity && JSON.parse(e.values[0][0]).connectivity.length > 0);
}, this.findIfNodeIsSingle = function(e) {
return e.length === 1 ? (console.error("Server returns a single node", e), e[0]) : e.length === 2 && e[1].length === 0 ? e[0] : !1;
}, this.createLabelFromNeuralNode = function(e, t) {
let n = this.findIfNodeIsSingle(e);
if (n)
return t[n];
let o = t[e[0]];
return e.length === 2 && e[1].length > 0 && e[1].forEach((i) => {
t[i] == null ? o += `, ${i}` : o += `, ${t[i]}`;
}), o;
}, this.flattenAndFindDatasets = function(e, t, n) {
let o = this.flattenConnectivity(e), i = this.flattenConnectivity(t), a = this.flattenConnectivity(n);
this.originsWithDatasets = this.uberons.filter(
(s) => o.indexOf(s.id) !== -1
).sort(Jt), this.componentsWithDatasets = this.uberons.filter(
(s) => i.indexOf(s.id) !== -1
).sort(Jt), this.destinationsWithDatasets = this.uberons.filter(
(s) => a.indexOf(s.id) !== -1
).sort(Jt);
}, this.processConnectivity = function(e, t) {
return new Promise((n) => {
let o = [], i = [], a;
if (t && t["node-phenotypes"]) {
const l = ["ilxtr:hasSomaLocatedIn"], u = ["ilxtr:hasAxonPresynapticElementIn", "ilxtr:hasAxonSensorySubcellularElementIn"];
l.forEach((c) => {
c in t["node-phenotypes"] && o.push(...t["node-phenotypes"][c]);
}), o = Tn(o), u.forEach((c) => {
c in t["node-phenotypes"] && i.push(...t["node-phenotypes"][c]);
}), i = Tn(i);
} else
i = Tn(t.axons), t.somas && t.somas.length > 0 && o.push(...t.somas), t.dendrites && t.dendrites.length > 0 && o.push(...t.dendrites), o = Tn(o), a = t.somas;
const s = this.findComponents(t, i, o, a), r = this.findAllIdsFromConnectivity(t);
this.createLabelLookup(e, r).then((l) => {
this.origins = o.map(
(u) => this.createLabelFromNeuralNode(u, l)
).sort(Jt), this.components = s.map(
(u) => this.createLabelFromNeuralNode(u, l)
).sort(Jt), this.destinations = i.map(
(u) => this.createLabelFromNeuralNode(u, l)
).sort(Jt), this.flattenAndFindDatasets(o, s, i), n({
ids: {
dendrites: o,
components: s,
axons: i
},
labels: {
origins: this.origins,
components: this.components,
destinations: this.destinations
}
});
});
});
}, this.buildPubmedSqlStatement = function(e) {
let t = "select distinct publication from publications where entity in (";
if (e.length === 1)
t += `'${e[0]}')`;
else if (e.length > 1)
for (let n in e)
t += `'${e[n]}'${n >= e.length - 1 ? ")" : ","} `;
return t;
}, this.buildPubmedSqlStatementForModels = function(e) {
return `select distinct publication from publications where entity = '${e}'`;
}, this.queryKnowledge = async (e, t) => {
const n = `${this.flatmapAPI}/knowledge/query/`, i = await fetch(n, {
method: "POST",
headers: {
Accept: "application/json"
},
body: JSON.stringify({ sql: e, params: t })
});
if (!i.ok)
throw new Error(`Cannot access ${n}`);
const a = await i.json();
if ("error" in a)
throw new TypeError(a.error);
return a.values;
};
};
async function db(e) {
const t = sessionStorage.getItem("flatmap-knowledge");
if (t) {
const i = JSON.parse(t).filter((a) => a.references && a.references.length).filter((a) => a.references.includes(e));
if (i.length)
return i.map((s) => s.id);
}
return [];
}
async function fb(e, t, n) {
const i = `select knowledge from knowledge
where source="${ea(e)}" and
knowledge like "%${t}%" order by source desc`;
return (await n.queryKnowledge(i)).map((l) => JSON.parse(l)).map((l) => l.id);
}
function ea(e) {
return pb(e.provenance);
}
function pb(e) {
let t = "";
if (e != null && e.connectivity) {
const n = e.connectivity;
"knowledge-source" in n ? t = n["knowledge-source"] : "npo" in n && (t = `${n.npo.release}-npo`);
}
return t;
}
async function hb(e, t) {
const n = ea(e), o = `select knowledge from knowledge
where source="${n}"
order by source desc`;
vl();
const i = sessionStorage.getItem("flatmap-knowledge"), a = sessionStorage.getItem("flatmap-knowledge-source");
if (!i || a !== n) {
const r = (await t.queryKnowledge(o)).map((l) => JSON.parse(l));
return sessionStorage.setItem("flatmap-knowledge", JSON.stringify(r)), sessionStorage.setItem("flatmap-knowledge-source", n), vb(), r;
}
return JSON.parse(i);
}
function vb() {
const n = (/* @__PURE__ */ new Date()).getTime() + 864e5;
sessionStorage.setItem("flatmap-knowledge-expiry", n);
}
function mb() {
[
"flatmap-knowledge",
"flatmap-knowledge-expiry",
"flatmap-knowledge-source"
].forEach((t) => {
sessionStorage.removeItem(t);
});
}
function vl() {
const e = sessionStorage.getItem("flatmap-knowledge-expiry");
(/* @__PURE__ */ new Date()).getTime() > e && mb();
}
const ai = (e) => e && e.charAt(0).toUpperCase() + e.slice(1), gb = '';
var ml = { exports: {} };
(function(e, t) {
(function(n, o) {
e.exports = o();
})(typeof window < "u" ? window : og, function() {
if (typeof window > "u")
return null;
var n = typeof window < "u" && window.Math == Math ? window : typeof self < "u" && self.Math == Math ? self : Function("return this")(), o = n.requestAnimationFrame || n.mozRequestAnimationFrame || n.webkitRequestAnimationFrame || function(c) {
return n.setTimeout(c, 20);
}, i = n.cancelAnimationFrame || n.mozCancelAnimationFrame || n.webkitCancelAnimationFrame || function(c) {
n.clearTimeout(c);
};
function a(c, d) {
var f = Object.prototype.toString.call(c), m = f === "[object Array]" || f === "[object NodeList]" || f === "[object HTMLCollection]" || f === "[object Object]" || typeof jQuery < "u" && c instanceof jQuery || typeof Elements < "u" && c instanceof Elements, p = 0, h = c.length;
if (m)
for (; p < h; p++)
d(c[p]);
else
d(c);
}
function s(c) {
if (!c.getBoundingClientRect)
return {
width: c.offsetWidth,
height: c.offsetHeight
};
var d = c.getBoundingClientRect();
return {
width: Math.round(d.width),
height: Math.round(d.height)
};
}
function r(c, d) {
Object.keys(d).forEach(function(f) {
c.style[f] = d[f];
});
}
var l = function(c, d) {
var f = 0;
function m() {
var h = [];
this.add = function(w) {
h.push(w);
};
var g, y;
this.call = function(w) {
for (g = 0, y = h.length; g < y; g++)
h[g].call(this, w);
}, this.remove = function(w) {
var M = [];
for (g = 0, y = h.length; g < y; g++)
h[g] !== w && M.push(h[g]);
h = M;
}, this.length = function() {
return h.length;
};
}
function p(h, g) {
if (h) {
if (h.resizedAttached) {
h.resizedAttached.add(g);
return;
}
h.resizedAttached = new m(), h.resizedAttached.add(g), h.resizeSensor = document.createElement("div"), h.resizeSensor.dir = "ltr", h.resizeSensor.className = "resize-sensor";
var y = {
pointerEvents: "none",
position: "absolute",
left: "0px",
top: "0px",
right: "0px",
bottom: "0px",
overflow: "hidden",
zIndex: "-1",
visibility: "hidden",
maxWidth: "100%"
}, w = {
position: "absolute",
left: "0px",
top: "0px",
transition: "0s"
};
r(h.resizeSensor, y);
var M = document.createElement("div");
M.className = "resize-sensor-expand", r(M, y);
var T = document.createElement("div");
r(T, w), M.appendChild(T);
var E = document.createElement("div");
E.className = "resize-sensor-shrink", r(E, y);
var A = document.createElement("div");
r(A, w), r(A, { width: "200%", height: "200%" }), E.appendChild(A), h.resizeSensor.appendChild(M), h.resizeSensor.appendChild(E), h.appendChild(h.resizeSensor);
var O = window.getComputedStyle(h), D = O ? O.getPropertyValue("position") : null;
D !== "absolute" && D !== "relative" && D !== "fixed" && D !== "sticky" && (h.style.position = "relative");
var N = !1, j = 0, I = s(h), K = 0, J = 0, de = !0;
f = 0;
var Y = function() {
var be = h.offsetWidth, Pe = h.offsetHeight;
T.style.width = be + 10 + "px", T.style.height = Pe + 10 + "px", M.scrollLeft = be + 10, M.scrollTop = Pe + 10, E.scrollLeft = be + 10, E.scrollTop = Pe + 10;
}, $ = function() {
if (de) {
var be = h.offsetWidth === 0 && h.offsetHeight === 0;
if (be) {
f || (f = o(function() {
f = 0, $();
}));
return;
} else
de = !1;
}
Y();
};
h.resizeSensor.resetSensor = $;
var te = function() {
j = 0, N && (K = I.width, J = I.height, h.resizedAttached && h.resizedAttached.call(I));
}, xe = function() {
I = s(h), N = I.width !== K || I.height !== J, N && !j && (j = o(te)), $();
}, ye = function(be, Pe, Ue) {
be.attachEvent ? be.attachEvent("on" + Pe, Ue) : be.addEventListener(Pe, Ue);
};
ye(M, "scroll", xe), ye(E, "scroll", xe), f = o(function() {
f = 0, $();
});
}
}
a(c, function(h) {
p(h, d);
}), this.detach = function(h) {
f || (i(f), f = 0), l.detach(c, h);
}, this.reset = function() {
c.resizeSensor.resetSensor();
};
};
if (l.reset = function(c) {
a(c, function(d) {
d.resizeSensor.resetSensor();
});
}, l.detach = function(c, d) {
a(c, function(f) {
f && (f.resizedAttached && typeof d == "function" && (f.resizedAttached.remove(d), f.resizedAttached.length()) || f.resizeSensor && (f.contains(f.resizeSensor) && f.removeChild(f.resizeSensor), delete f.resizeSensor, delete f.resizedAttached));
});
}, typeof MutationObserver < "u") {
var u = new MutationObserver(function(c) {
for (var d in c)
if (c.hasOwnProperty(d))
for (var f = c[d].addedNodes, m = 0; m < f.length; m++)
f[m].resizeSensor && l.reset(f[m]);
});
document.addEventListener("DOMContentLoaded", function(c) {
u.observe(document.body, {
childList: !0,
subtree: !0
});
});
}
return l;
});
})(ml);
var yb = ml.exports;
const bb = /* @__PURE__ */ ig(yb), wb = ru("main", {
state: () => ({
userProfile: {
token: ""
}
}),
getters: {
userToken(e) {
return e.userProfile.token;
}
},
actions: {
setUserToken(e) {
this.userProfile.token = e;
}
}
});
function Sb(e) {
return { all: e = e || /* @__PURE__ */ new Map(), on: function(t, n) {
var o = e.get(t);
o ? o.push(n) : e.set(t, [n]);
}, off: function(t, n) {
var o = e.get(t);
o && (n ? o.splice(o.indexOf(n) >>> 0, 1) : e.set(t, []));
}, emit: function(t, n) {
var o = e.get(t);
o && o.slice().map(function(i) {
i(n);
}), (o = e.get("*")) && o.slice().map(function(i) {
i(t, n);
});
} };
}
const Ii = new Sb(), Cb = "cannot be found on the map.", Eb = (e) => {
let t = { lng: 0, lat: 0 }, n;
return e.type === "Polygon" ? e.coordinates.length && (n = e.coordinates[0]) : n = e.coordinates, n && (e.type !== "Point" ? (n.map((o) => {
t.lng += parseFloat(o[0]), t.lat += parseFloat(o[1]);
}), t.lng = t.lng / n.length, t.lat = t.lat / n.length) : (t.lng += parseFloat(n[0]), t.lat += parseFloat(n[1]))), t;
}, gl = (e, t) => {
const n = [];
let o = e.organs ? e.organs : e.ftus;
const i = o ? o.filter(
(a, s) => o.findIndex((r) => r.label === a.label) === s
) : void 0;
return i && i.forEach((a) => {
const s = {
label: a.label,
models: a.models,
key: `${t}.${a.label}`
}, r = gl(a, s.key);
r.length > 0 && (s.children = r), n.push(s);
}), n;
}, Ib = {
name: "FlatmapVuer",
components: {
Button: Wr,
Col: Un,
Loading: Hy,
Radio: sl,
Icon: et,
RadioGroup: rl,
Row: Kn,
Select: Bo,
Dialog: sy,
MapSvgIcon: Xl,
MapSvgSpriteColor: eu,
Tooltip: tu,
TreeControls: nu,
SelectionsGroup: hl,
SvgLegends: lb,
ElIconWarningFilled: Ms,
ElIconArrowDown: ki,
ElIconArrowLeft: Ps,
DrawToolbar: ou
},
beforeCreate: function() {
this.setStateRequired = !1;
},
setup(e) {
let t = q("$annotator");
return t || (t = Ge(new su(`${e.flatmapAPI}annotator`)), fe("$annotator", t)), { annotator: t };
},
methods: {
enableFeatureResetOnClick: function(e) {
this.mapImp && this.mapImp.enableFeatureResetOnClick(e);
},
/**
*
* @param filter format should follow #makeStyleFilter (flatmap-viewer)
*/
setVisibilityFilter: function(e) {
this.mapImp && (e ? this.mapImp.setVisibilityFilter(e) : this.mapImp.clearVisibilityFilter());
},
/**
* @public
* Function to manually send aborted signal when annotation tooltip popup or sidebar tab closed.
*/
manualAbortedOnClose: function() {
this.annotationSidebar && this.$emit("annotation-close"), this.closeTooltip(), this.annotationEventCallback({}, { type: "aborted" }), this.initialiseDrawing();
},
/**
* @public
* Function to initialise drawing.
*/
initialiseDrawing: function() {
this.connectionEntry = {}, this.activeDrawTool = void 0, this.activeDrawMode = void 0, this.drawnCreatedEvent = {};
},
/**
* @public
* Function to cancel a newly drawn feature.
*/
cancelDrawnFeature: function() {
this.isValidDrawnCreated && (this.annotationSidebar && this.$emit("annotation-close"), this.closeTooltip(), this.annotationEntry = [{
...this.drawnCreatedEvent.feature,
resourceId: this.serverURL
}], this.rollbackAnnotationEvent(), this.initialiseDrawing());
},
/**
* @public
* Function to display connected features' tooltip for drawn connectivity.
* @param {String} `id`
*/
connectedFeatureTooltip: function(e) {
if (this.mapImp)
if (e) {
const t = Number(e);
let o = { feature: t ? this.mapImp.featureProperties(t) : { feature: this.existDrawnFeatures.find((i) => i.id === e.trim()) } };
this.checkAndCreatePopups([o], !1);
} else
this.closeTooltip();
},
/**
* @public
* Function to confirm a newly drawn feature.
*/
confirmDrawnFeature: function() {
this.isValidDrawnCreated && (this.checkAndCreatePopups([this.drawnCreatedEvent], !1), Object.keys(this.connectionEntry).length > 0 && (this.annotationEntry[0].feature.connection = this.connectionEntry), this.initialiseDrawing());
},
/**
* @public
* Function to process the annotation toolbar click events.
* @arg {String} `type`
* @arg {String} `name`
*/
toolbarEvent: function(e, t) {
if (!this.isValidDrawnCreated) {
if (this.manualAbortedOnClose(), this.doubleClickedFeature = !1, this.changeAnnotationDrawMode({ mode: "simple_select" }), e === "mode")
this.activeDrawMode = t;
else if (e === "tool") {
if (this.cancelDrawnFeature(), t) {
const n = t.replace(/[A-Z]/g, (o) => `_${o.toLowerCase()}`);
this.changeAnnotationDrawMode({ mode: `draw${n}` });
}
this.activeDrawTool = t;
}
}
},
/**
* @public
* Function to fire annotation event based on the provided ``data``.
* Either edit or delete action.
* @arg {Object} `data`
*/
annotationDrawModeEvent: function(e) {
this.activeDrawMode === "Edit" ? this.doubleClickedFeature && (e.feature.feature.geometry.type !== "Point" && (this.changeAnnotationDrawMode({
mode: "direct_select",
options: { featureId: e.feature.feature.id }
}), this.modifyAnnotationFeature()), this.doubleClickedFeature = !1) : this.activeDrawMode === "Delete" && (this.changeAnnotationDrawMode({
mode: "simple_select",
options: { featureIds: [e.feature.feature.id] }
}), this.modifyAnnotationFeature());
},
/**
* Function to create connectivity body from existing entries.
*/
createConnectivityBody: function() {
if (Object.keys(this.connectionEntry).length > 0) {
const e = Object.values(this.connectionEntry), t = {
type: "connectivity",
source: e[0],
target: e[e.length - 1],
intermediates: e.filter((n, o) => o !== 0 && o !== e.length - 1)
};
this.annotationEntry[0].body = t;
}
},
/**
* @public
* Function to update the annotation draw mode.
* @arg {Object} `mode`
*/
changeAnnotationDrawMode: function(e) {
this.mapImp && this.mapImp.changeAnnotationDrawMode(e);
},
/**
* @public
* Function to remove all drawn annotations from flatmap annotation layer.
*/
clearAnnotationFeature: function() {
this.mapImp && this.mapImp.clearAnnotationFeature();
},
/**
* @public
* Function to fire the ``trash`` action.
* See https://github.com/mapbox/mapbox-gl-draw/blob/main/docs/API.md#trash-draw for more details.
*/
modifyAnnotationFeature: function() {
this.mapImp && this.mapImp.removeAnnotationFeature();
},
/**
* @public
* Function to rollback the failure drawn from flatmap annotation layer.
*/
rollbackAnnotationEvent: function() {
this.mapImp && this.annotationEntry.length > 0 && ["created", "updated", "deleted"].includes(this.annotationEntry[0].type) && (this.mapImp.rollbackAnnotationEvent(this.annotationEntry[0]), this.annotationEntry = []);
},
/**
* @public
* Function to commit the emitted ``annotation`` data from successful new drawn to flatmap annotation layer.
* @arg {Object} `annotation`
*/
commitAnnotationEvent: function(e) {
this.mapImp && (this.offlineAnnotationEnabled && (this.offlineAnnotations = JSON.parse(sessionStorage.getItem("anonymous-annotation")) || [], this.offlineAnnotations.push(e), this.annotationEntry[0].type === "deleted" && (this.offlineAnnotations = this.offlineAnnotations.filter((t) => t.resource !== this.serverURL || t.item.id !== e.item.id)), sessionStorage.setItem("anonymous-annotation", JSON.stringify(this.offlineAnnotations))), ["created", "updated", "deleted"].includes(this.annotationEntry[0].type) && (this.featureAnnotationSubmitted = !0, this.mapImp.commitAnnotationEvent(this.annotationEntry[0]), e.body.comment === "Position Updated" ? this.annotationEntry[0].positionUpdated = !1 : this.annotationEntry[0].type === "deleted" && (this.annotationSidebar && this.$emit("annotation-close"), this.closeTooltip(), this.annotationEntry = []), this.addAnnotationFeature()));
},
/**
* @public
* Function to fetch annotated item id.
* @arg {String} `userId`,
* @arg {String} `participated`
*/
fetchAnnotatedItemIds: async function(e = void 0, t = void 0) {
let n;
return this.offlineAnnotationEnabled ? (this.offlineAnnotations = JSON.parse(sessionStorage.getItem("anonymous-annotation")) || [], n = this.offlineAnnotations.filter((o) => o.resource === this.serverURL).map((o) => o.item.id)) : (n = await this.annotator.annotatedItemIds(this.userToken, this.serverURL, e, t), "resource" in n && (n = n.itemIds)), n;
},
/**
* @public
* Function to add existing drawn annotations to flatmap.
*/
setFeatureAnnotated: async function() {
if (this.mapImp) {
const e = await this.fetchAnnotatedItemIds();
for (const t of e)
this.mapImp.setFeatureAnnotated(t);
}
},
/**
* @public
* Function to fetch drawn features.
* @arg {String} `userId`,
* @arg {String} `participated`
*/
fetchDrawnFeatures: async function(e, t) {
let n;
if (this.offlineAnnotationEnabled)
this.offlineAnnotations = JSON.parse(sessionStorage.getItem("anonymous-annotation")) || [], n = this.offlineAnnotations.filter((o) => o.feature && o.resource === this.serverURL).map((o) => o.feature);
else {
const o = await this.fetchAnnotatedItemIds(e, t);
n = await this.annotator.drawnFeatures(this.userToken, this.serverURL, o), "resource" in n && (n = n.features);
}
return n;
},
/**
* @public
* Function to draw existing drawn annotations based on selector.
*/
addAnnotationFeature: async function() {
if (this.mapImp) {
this.featureAnnotationSubmitted || (this.clearAnnotationFeature(), this.loading = !0);
const e = this.annotationFrom === "Anyone" ? void 0 : this.authorisedUser.orcid ? this.authorisedUser.orcid : "0000-0000-0000-0000", t = this.annotationFrom === "Anyone" ? void 0 : this.annotationFrom === "Me", n = await this.fetchDrawnFeatures(e, t);
if (this.existDrawnFeatures = n, this.loading = !1, !this.featureAnnotationSubmitted)
for (const o of n)
this.mapImp.addAnnotationFeature(o);
}
},
/**
* @public
* Function to display annotator toolbar.
* @arg {Boolean} `flag`
*/
showAnnotator: function(e) {
this.mapImp && (this.mapImp.showAnnotator(e), this.$el.querySelector(".maplibregl-ctrl-group").style.display = "none");
},
/**
* @public
* Function to switch the type of person who annotated.
* @arg {Boolean} `flag`
*/
setAnnotationFrom: function(e) {
this.annotationFrom = e, this.mapImp && (this.manualAbortedOnClose(), this.addAnnotationFeature());
},
/**
* Function to emit offline annotation enabled status
*/
emitOfflineAnnotationUpdate: function() {
this.$emit("update-offline-annotation-enabled", this.offlineAnnotationEnabled);
},
/**
* @public
* Function to switch from 2D to 3D
* @arg {Boolean} `flag`
*/
setFlightPath3D: function(e) {
this.flightPath3DRadio = e, this.mapImp && this.mapImp.enableFlightPaths(e);
},
/**
* @public
* Function to view the latest map (example when you are on legacy map).
*/
viewLatestMap: function() {
let e = this.biologicalSex ? this.biologicalSex : void 0;
this.entry === "NCBITaxon:9606" && (e = "PATO:0000384");
const t = {
entry: this.entry,
biologicalSex: e,
viewport: this.mapImp.getState()
};
this.$emit("view-latest-map", t);
},
/**
* @public
* Function to change the background colour of the map
* by providing the ``colour``.
* @arg {String} `colour`
*/
backgroundChangeCallback: function(e) {
this.currentBackground = e, this.mapImp && this.mapImp.setBackgroundColour(this.currentBackground, 1);
},
/**
* @public
* Function to process a list of a FC flatmap's systems.
* @arg {Array} `systems`
*/
processSystems: function(e) {
if (this.systems.length = 0, e && e.length > 0) {
const t = { label: "All", key: "All", children: [] };
e.forEach((n) => {
const o = {
colour: n.colour,
enabled: n.enabled,
label: n.id,
key: n.id
}, i = gl(n, o.key);
i.length > 0 && (o.children = i), t.children.push(o);
}), this.systems.push(t);
}
},
/**
* @public
* Function to add taxon identifiers into the taxon connectivity array,
* by retrieving their corresponding labels using the flatmap API.
* @arg {String} `flatmapAPI`,
* @arg {Array} `taxonIdentifiers`
*/
processTaxon: function(e, t) {
this.taxonConnectivity.length = 0, Ei(this.mapImp, e).then((n) => {
n.length && n.forEach((o) => {
let i = !0;
t && (i = t.checkAll ? !0 : t.checked.includes(o.taxon)), this.taxonConnectivity.push({ ...o, enabled: i }), this.mapImp && this.mapImp.enableConnectivityByTaxonIds(o.taxon, i);
});
});
},
/**
* @public
* Function to show or hide the display of the bottom-left drawer container.
*/
toggleDrawer: function() {
this.drawerOpen = !this.drawerOpen;
},
/**
* @public
* Function to toggle colour/greyscale of organs.
* The parameter ``flag`` is a boolean, ``true`` (colour) and ``false`` (greyscale).
* @arg {Boolean} `flag`
*/
setColour: function(e) {
this.colourRadio = e, this.mapImp && this.mapImp.setPaint({ coloured: e, outlined: this.outlinesRadio });
},
/**
* @public
* Function to toggle outlines f organs.
* The parameter ``flag`` is a boolean, ``true`` to show outlines, ``false`` to hide outlines.
* @arg {Boolean} `flag`
*/
setOutlines: function(e) {
this.outlinesRadio = e, this.mapImp && this.mapImp.setPaint({ coloured: this.colourRadio, outlined: e });
},
setInitMapState: function() {
if (this.mapImp) {
const e = this.mapImp.map, t = this.mapImp.options.bounds, n = [
[t[0], t[1]],
[t[2], t[3]]
];
e.setMaxBounds(null), e.setRenderWorldCopies(!1), this.initMapState = Ge({
initBounds: n
});
}
},
/**
* @public
* Function to toggle paths to default.
* Also called when the associated button is pressed.
*/
resetView: function() {
if (this.mapImp) {
const e = this.mapImp.map, { initBounds: t } = this.initMapState;
e.resetNorthPitch({
animate: !1
}), t && e.fitBounds(t, {
animate: !1
}), this.$refs.skcanSelection && this.$refs.skcanSelection.reset(), this.$refs.layersSelection && this.$refs.layersSelection.reset(), this.$refs.systemsSelection && this.$refs.pathwaysSelection.reset(), this.$refs.pathwaysSelection && this.$refs.pathwaysSelection.reset();
}
},
/**
* @public
* Function to zoom in.
* Also called when the associated button is pressed.
*/
zoomIn: function() {
this.mapImp && this.mapImp.zoomIn();
},
/**
* @public
* Function to zoom out.
* Also called when the associated button is pressed.
*/
zoomOut: function() {
this.mapImp && this.mapImp.zoomOut();
},
onSelectionsDataChanged: function(e) {
this.$emit("pathway-selection-changed", e);
},
/**
* // Currently not in use
* Function to show or hide paths valid in SCKAN
* by providing ``{key, value}`` pair in ``payload``.
* @arg payload
*/
sckanSelected: function(e) {
this.mapImp && this.mapImp.enableSckanPath(e.key, e.value);
},
/**
* // Currently not in use
* Function to show or hide all paths valid in SCKAN.
* @arg payload
*/
checkAllSCKAN: function(e) {
this.mapImp && e.keys.forEach(
(t) => this.mapImp.enableSckanPath(t, e.value)
);
},
/**
* Function to highlight paths and features
* @param data
*/
zoomToFeatures: function(e) {
this.mapImp && this.mapImp.zoomToFeatures(e);
},
/**
* @public
* Function to highlight the connected paths
* by providing path model identifier, ``pathId`` or ``anatomicalId``.
* @arg {string} `pathId` or `anatomicalId`
*/
retrieveConnectedPaths: async function(e, t = {}) {
var n, o, i, a, s;
if (this.mapImp) {
let r = [], l = (n = t.target) != null && n.length ? t.target : [];
const u = [...this.mapImp.pathModelNodes(e)], c = await this.mapImp.queryPathsForFeatures(e);
if (u.length) {
if (!l.length) {
const d = (o = t.type) != null && o.length ? t.type : ["all"], f = await this.flatmapQueries.queryForConnectivityNew(this.mapImp, e[0]), m = (i = f == null ? void 0 : f.ids) == null ? void 0 : i.dendrites.flat(1 / 0), p = (a = f == null ? void 0 : f.ids) == null ? void 0 : a.components.flat(1 / 0), h = (s = f == null ? void 0 : f.ids) == null ? void 0 : s.axons.flat(1 / 0);
let g = [];
d.includes("origins") && g.push(...m), d.includes("components") && g.push(...p), d.includes("destinations") && g.push(...h), d.includes("all") && g.push(...m, ...p, ...h), l = [...new Set(g)];
}
u.forEach((d) => {
this.mapImp.nodePathModels(d).forEach((m) => {
const h = this.mapImp.pathModelNodes(m).map((y) => this.mapImp.featureProperties(y).models);
l.filter((y) => h.includes(y)).length && !r.includes(m) && r.push(m);
});
});
} else c.length && (l.length ? c.forEach((d) => {
const m = this.mapImp.pathModelNodes(d).map((h) => this.mapImp.featureProperties(h).models);
l.filter((h) => m.includes(h)).length && !r.includes(d) && r.push(d);
}) : r = c);
return r = [.../* @__PURE__ */ new Set([...r, ...e])], r;
}
},
resetMapFilter: function() {
const e = this.mapFilters.alert;
let t;
const n = { "tile-layer": "pathways" }, o = { NOT: n };
e.with && !e.without ? t = {
OR: [o, { AND: [n, { HAS: "alert" }] }]
} : !e.with && e.without ? t = {
OR: [o, { AND: [n, { NOT: { HAS: "alert" } }] }]
} : !e.with && !e.without && (t = o), this.setVisibilityFilter(t);
},
/**
* @public
* Function to enable/disable mouse enter and leave event for
* alert checkbox
* @arg {Object} `payload`
*/
alertMouseEnterEmitted: function(e) {
if (this.mapImp)
if (e.value) {
let t;
const n = { "tile-layer": "pathways" }, o = { NOT: n };
if (e.key === "alert" || e.key === "withoutAlert") {
const i = e.key === "alert" ? { HAS: "alert" } : { NOT: { HAS: "alert" } };
t = { OR: [o, { AND: [n, i] }] };
}
this.setVisibilityFilter(t);
} else
this.resetMapFilter();
},
/**
* @public
* Function to enable/disable (show/hide) pathways with/without alert
* by providing ``kay, value`` ``payload`` object ``{alertKey, true/false}``.
* @arg {Object} `payload`
*/
alertSelected: function(e) {
this.mapImp && (e.key === "alert" ? e.value ? this.mapFilters.alert.with = !0 : this.mapFilters.alert.with = !1 : e.key === "withoutAlert" && (e.value ? this.mapFilters.alert.without = !0 : this.mapFilters.alert.without = !1), this.resetMapFilter());
},
/**
* @public
* Function to enable/disable (show/hide) all alerts
* option by providing ``flag`` (true/false).
* @arg {Boolean} `flag`
*/
checkAllAlerts: function(e) {
this.mapImp && (e.value ? (this.mapFilters.alert.without = !0, this.mapFilters.alert.with = !0) : (this.mapFilters.alert.without = !1, this.mapFilters.alert.with = !1), this.resetMapFilter());
},
/**
* @public
* Function to enable/disable (show/hide) the system
* by providing ``kay, value`` ``payload`` object ``{systemId, true/false}``.
* @arg {Object} `payload`
*/
systemSelected: function(e) {
this.mapImp && this.mapImp.enableSystem(e.key, e.value);
},
/**
* @public
* Function to enable/disable (show/hide) all systems
* by providing ``flag`` (true/false).
* @arg {Boolean} `flag`
*/
checkAllSystems: function(e) {
this.mapImp && this.systems[0].children.forEach(
(t) => this.mapImp.enableSystem(t.label, e)
);
},
/**
* @public
* Function to display features with annotation matching the provided term.
* @arg {String} `models`
*/
ftuSelected: function(e) {
this.searchAndShowResult(e, !0, !0);
},
/**
* @public
* Function to show or hide the layer
* by providing ``{layerId, true/false}`` in ``payload``.
* @arg {Object} `payload`
*/
layersSelected: function(e) {
this.mapImp && this.mapImp.enableLayer(e.key, e.value);
},
/**
* @public
* Function to show or hide all layers
* by providing ``payload`` with ``payload.keys`` array and ``payload.value`` flag.
* @arg {Object} `payload`
*/
checkAllLayers: function(e) {
this.mapImp && e.keys.forEach(
(t) => this.mapImp.enableLayer(t, e.value)
);
},
/**
* @public
* Function to show or hide connectivity features studied in particular species
* by providing ``{taxonId, true/false}`` in ``payload.key, payload.value``.
* @arg {Object} `payload`
*/
taxonsSelected: function(e) {
this.mapImp && this.mapImp.enableConnectivityByTaxonIds(e.key, e.value);
},
taxonMouseEnterEmitted: function(e) {
if (this.mapImp)
if (e.value) {
clearTimeout(this.taxonLeaveDelay);
let t = this.mapImp.taxonFeatureIds(e.key);
this.mapImp.enableConnectivityByTaxonIds(e.key, e.value), this.mapImp.zoomToGeoJSONFeatures(t, { noZoomIn: !0 });
} else
this.taxonLeaveDelay = setTimeout(() => {
this.mapImp.unselectGeoJSONFeatures(), e.selections.forEach((t) => {
let n = e.checked.includes(t.taxon);
this.mapImp.enableConnectivityByTaxonIds(t.taxon, n);
});
}, 1e3);
},
/**
* @public
* Function to show or hide connectivity features studied in particular species
* by providing ``payload`` with ``payload.keys`` array and ``payload.value`` flag.
* @arg {Object} `payload`
*/
checkAllTaxons: function(e) {
this.mapImp && this.mapImp.enableConnectivityByTaxonIds(e.keys, e.value);
},
/**
* @public
* Function to hide or show paths of a given type
* by providing ``{pathType, true/false}`` in ``payload.key, payload.value``.
* @arg {Object} `payload`
*/
pathwaysSelected: function(e) {
this.mapImp && this.mapImp.enablePath(e.key, e.value);
},
/**
* @public
* Function to hide or show paths of a given type
* by providing ``payload`` with ``payload.keys`` array and ``payload.value`` flag.
* @arg {Object} `payload`
*/
checkAllPathways: function(e) {
this.mapImp && e.keys.forEach(
(t) => this.mapImp.enablePath(t, e.value)
);
},
/**
* @public
* Function to generate callbacks as a result of panning/zooming the map.
* ``flag`` (boolean) - generate callbacks when ``true``, otherwise disable them.
* @arg {Boolean} `flag`
*/
enablePanZoomEvents: function(e) {
this.mapImp.enablePanZoomEvents(e);
},
/**
* @public
* Function to process annotation callbacks, invoked when events occur with the map.
* @arg {Object} `payload`,
* @arg {Object} `data`
*/
annotationEventCallback: function(e, t) {
if (t.type === "aborted")
this.featureAnnotationSubmitted ? this.featureAnnotationSubmitted = !1 : this.rollbackAnnotationEvent(), this.annotationEntry = [];
else if (t.type === "modeChanged")
t.feature.mode === "direct_select" && (this.doubleClickedFeature = !0), this.annotationSidebar && t.feature.mode === "simple_select" && this.activeDrawMode === "Deleted" && this.annotationEventCallback({}, { type: "aborted" });
else if (t.type === "selectionChanged") {
if (this.selectedDrawnFeature = t.feature.features.length === 0 ? void 0 : t.feature.features[0], e.feature.feature = this.selectedDrawnFeature, !this.activeDrawTool)
if (this.connectionEntry = {}, this.selectedDrawnFeature) {
const n = this.existDrawnFeatures.find(
(o) => o.id === this.selectedDrawnFeature.id
);
n && n.connection && (this.connectionEntry = n.connection), this.annotationDrawModeEvent(e);
} else
this.annotationSidebar && this.previousEditEvent.type === "updated" && (this.annotationEntry = [{
...this.previousEditEvent,
resourceId: this.serverURL
}], this.annotationEventCallback({}, { type: "aborted" })), this.previousEditEvent = {};
} else {
if (t.type === "created" || t.type === "updated") {
t.type === "updated" && t.feature.action && (t.positionUpdated = t.feature.action === "move");
const n = this.mapImp.refreshAnnotationFeatureGeometry(t.feature);
e.feature.feature = n;
}
t.type === "created" ? this.drawnCreatedEvent = e : this.checkAndCreatePopups([e]);
}
t.type === "updated" && (this.previousEditEvent = t), t.type === "deleted" ? this.previousDeletedEvent = t : this.previousDeletedEvent = {};
},
/**
* @public
* A callback function, invoked when events occur with the map.
* The first parameter gives the type of event, the second provides details about the event.
* _(This is the ``callback`` function from ``MapManager.loadMap()``)_.
*/
eventCallback: function() {
return (e, t, ...n) => {
if (e === "annotation") {
const o = {
feature: t,
userData: n,
eventType: e
};
this.annotationEventCallback(o, t);
} else if (e !== "pan-zoom") {
const o = t.label, i = [t.models], a = this.entry, s = this.biologicalSex, r = t.alert;
let l;
t.taxons && (typeof t.taxons != "object" ? l = JSON.parse(t.taxons) : l = t.taxons);
let u = [{
dataset: t.dataset,
biologicalSex: s,
taxonomy: a,
resource: i,
label: o,
feature: t,
userData: n,
eventType: e,
provenanceTaxonomy: l,
alert: r
}];
if (e === "click") {
const c = Object.keys(t).includes("id");
if (!c) {
u = [];
const f = t.mapUUID, m = /* @__PURE__ */ new Set();
for (let [p, h] of Object.entries(t))
if (p !== "mapUUID") {
const g = h.id, y = h.label, w = [h.models];
let M;
if (h.taxons && (typeof h.taxons != "object" ? M = JSON.parse(h.taxons) : M = h.taxons), m.has(g)) continue;
m.add(g), u.push({
dataset: h.dataset,
biologicalSex: s,
taxonomy: a,
resource: w,
label: y,
feature: h,
userData: n,
eventType: e,
provenanceTaxonomy: M,
alert: h.alert,
mapUUID: f
});
}
}
const d = c ? t : t[0];
if (this.setConnectivityDataSource(this.viewingMode, d), this.viewingMode !== "Neuron Connection") {
if (this.currentActive = d.models ? d.models : "", this.activeDrawTool && !this.isValidDrawnCreated) {
const f = d.featureId || this.existDrawnFeatures.find(
(m) => m.id === d.id
);
if (this.activeDrawTool === "LineString" && f) {
const m = d.featureId ? d.featureId : d.id, p = d.label ? d.label : `Feature ${d.id}`;
this.connectionEntry[` ${m}`] = Object.assign(
{ label: p },
Object.fromEntries(
Object.entries(d).filter(([h]) => ["featureId", "models"].includes(h)).map(([h, g]) => [h === "featureId" ? "id" : h, g])
)
);
}
}
}
} else e === "mouseenter" && this.viewingMode !== "Neuron Connection" && (this.currentHover = t.models ? t.models : "");
t && t.type !== "marker" && e === "click" && // Disable popup when drawing
!this.activeDrawTool && this.checkAndCreatePopups(u), this.$emit("resource-selected", u);
} else
this.$emit("pan-zoom-callback", t);
};
},
/**
* The data for connectivity data source is just a placeholder data
* to check which part of the map is clicked, e.g., path or feture or empty area,
* based on the viewing mode.
* The "connectivity-info-close" event will be emitted based on this data
* when there has a click event on map.
* @param viewingMode
* @param data
*/
setConnectivityDataSource: function(e, t) {
this.connectivityDataSource = t.source, (e === "Neuron Connection" || e === "Annotation") && (this.connectivityDataSource = t.featureId);
},
/**
* @public
* Function triggered by viewing mode change.
* (e.g., from 'Exploration' to 'Annotation')
* All tooltips and popups currently showing on map will be closed
* @arg {String} `modeName`
*/
changeViewingMode: function(e) {
e && (this.viewingMode = e), this.manualAbortedOnClose();
},
/**
* @public
* Function to remove active tooltips on map.
*/
removeActiveTooltips: function() {
this.mapImp && this.mapImp.removePopup(), this.$el.querySelectorAll(".flatmap-tooltip-popup").forEach((t) => t.remove());
},
/**
* Function to create tooltip for the provided connectivity data.
* @arg {Array} `connectivityData`
*/
createTooltipForConnectivity: function(e, t) {
const n = document.createElement("div");
n.classList.add("flatmap-feature-label"), e.forEach((o, i) => {
const { label: a } = o;
if (n.append(ai(a)), i + 1 < e.length) {
const s = document.createElement("hr");
n.appendChild(s);
}
}), this.mapImp.showPopup(
t,
n,
{
className: "custom-popup flatmap-tooltip-popup",
positionAtLastClick: !1,
preserveSelection: !0
}
);
},
/**
* Function to show connectivity tooltips on the map
* and highlight the nerve.
* @arg {Object} `payload`
*/
showConnectivityTooltips: function(e) {
const { connectivityInfo: t, data: n } = e, o = [], i = [], a = [], s = [];
if (t && t.featureId && o.push(...t.featureId), this.mapImp) {
if (n.forEach((f) => {
const m = this.mapImp.search(f.id);
if (m != null && m.results.length) {
const p = m == null ? void 0 : m.results[0].featureId;
a.push({ featureId: p, ...f });
} else
s.push(f);
}), a.length) {
let f = a[0].featureId;
this.mapImp.annotations.forEach((m) => {
const p = m["anatomical-nodes"];
if (p) {
const h = p.join("");
a.every(
(y) => h.indexOf(y.id) !== -1
) && (f = m.featureId, i.push(f));
}
}), this.createTooltipForConnectivity(a, f);
} else
this.removeActiveTooltips();
this.emitConnectivityError(s);
const r = o.reduce((f, m) => {
const p = this.mapImp.pathways.paths[m], h = p ? p.connectivity : null;
if (h) {
const g = h.flat(1 / 0);
f.push(...g);
}
return f;
}, []), l = [...new Set(r)], u = [...o, ...l], d = [
...this.mapImp.modelFeatureIdList(u),
...i
];
this.mapImp.selectGeoJSONFeatures(d);
}
},
showConnectivitiesByReference: function(e) {
this.searchConnectivitiesByReference(e).then((t) => {
this.mapImp.selectFeatures(t);
});
},
searchConnectivitiesByReference: async function(e) {
const t = sessionStorage.getItem("flatmap-knowledge");
let n = [];
return t ? n = await db(e) : n = await fb(this.mapImp, e, this.flatmapQueries), n;
},
getFlatmapKnowledge: function() {
let e = [];
const t = sessionStorage.getItem("flatmap-knowledge");
return t && (e = JSON.parse(t)), e;
},
emitConnectivityError: function(e) {
this.$emit("connectivity-error", {
data: {
errorData: e,
errorMessage: Cb
}
});
},
checkConnectivityTooltipEntry: function(e) {
return e != null && e.length ? e.find((t) => {
var n, o;
return ((n = t == null ? void 0 : t.destinations) == null ? void 0 : n.length) || ((o = t == null ? void 0 : t.components) == null ? void 0 : o.length);
}) !== void 0 : !1;
},
changeConnectivitySource: async function(e) {
const { entry: t, connectivitySource: n } = e;
t.mapId === this.mapImp.id && (await this.flatmapQueries.queryForConnectivityNew(this.mapImp, t.featureId[0], n), this.tooltipEntry = this.tooltipEntry.map((o) => o.featureId[0] === t.featureId[0] ? this.flatmapQueries.updateTooltipData(o) : o), this.checkConnectivityTooltipEntry(this.tooltipEntry) && this.$emit("connectivity-info-open", this.tooltipEntry));
},
/**
* @public
* Function to create/display tooltips from the provided ``data``.
* _checkNeuronClicked shows a neuron path pop up if a path was recently clicked._
* @arg {Object} `data`
*/
checkAndCreatePopups: async function(e, t = !0) {
var n;
if (this.viewingMode === "Annotation") {
const o = e.filter((i) => i.feature).map((i) => i.feature);
if (o.length > 0)
if (this.annotationSidebar && this.previousDeletedEvent.type === "deleted" && (this.annotationEntry = [{
...this.previousDeletedEvent,
resourceId: this.serverURL
}], this.annotationEventCallback({}, { type: "aborted" })), this.annotationEntry = [], o.forEach((i) => {
var a;
this.annotationEntry.push({
...i,
resourceId: this.serverURL,
featureId: i.featureId ? i.featureId : (a = i.feature) == null ? void 0 : a.id,
offline: this.offlineAnnotationEnabled
});
}), o[0].feature)
this.activeDrawTool || this.activeDrawMode || this.isValidDrawnCreated ? (this.featureAnnotationSubmitted = !1, this.activeDrawTool && this.createConnectivityBody(), this.displayTooltip(
o[0].feature.id,
Eb(o[0].feature.geometry)
)) : this.rollbackAnnotationEvent();
else {
const i = this.annotationEntry.filter((a) => a.featureId && a.models).map((a) => a.models);
i.length > 0 && this.displayTooltip(i);
}
else
this.annotation = {};
} else if (this.viewingMode === "Neuron Connection" && t) {
const o = e.map((a) => a.resource[0]);
if (o.find((a) => !a.startsWith("ilxtr:"))) {
const a = Array.isArray(o) ? [...o] : [o];
a.length === 1 && a.push([]);
const s = (n = e[0].feature) == null ? void 0 : n.featureId, r = this.mapImp.annotations.get(s), l = r == null ? void 0 : r["anatomical-nodes"], u = r == null ? void 0 : r.models;
let c, d = a;
const f = r == null ? void 0 : r.models;
l != null && l.length && (c = l.find(
(E) => JSON.parse(E)[0] === u
)), c ? d = JSON.parse(c) : f && (d = [f, []]);
const m = d.flat(1 / 0), p = [...new Set(m)], g = (await iu(this.flatmapAPI, p)).reduce((E, A) => {
const O = A[0], D = JSON.parse(A[1]);
return D.source === this.mapImp.knowledgeSource && E.push({ id: O, label: D.label }), E;
}, []), y = [];
for (let E = 0; E < p.length; E++) {
const A = g.find((O) => O.id === p[E]);
A && y.push(A.label);
}
const w = ai(y.join(", ")), M = {
facet: JSON.stringify(d),
facetPropPath: `flatmap.connectivity.source.${this.connectionType.toLowerCase()}`,
tagLabel: w,
// used tagLabel here instead of label since the label and value are different
term: this.connectionType
};
this.connectivityFilters.some((E) => E.facet === M.facet && E.facetPropPath === M.facetPropPath) || this.connectivityFilters.push(M), this.$emit("neuron-connection-feature-click", {
filters: this.connectivityFilters,
search: ""
});
} else {
const a = o.join();
this.connectionType.toLowerCase() === "all" && this.$emit("neuron-connection-feature-click", {
filters: [],
search: a
});
}
} else {
hb(this.mapImp, this.flatmapQueries);
let o = [];
if (this.tooltipEntry = e.filter((i) => i.resource[0] in this.mapImp.pathways.paths).map((i) => ({ title: i.label, featureId: i.resource, ready: !1 })), this.tooltipEntry.length) {
this.$emit("connectivity-info-open", this.tooltipEntry);
for (let a = 0; a < e.length; a++)
o.push(await this.getKnowledgeTooltip(e[a]));
this.tooltipEntry = await Promise.all(o);
const i = this.tooltipEntry.map((a) => a.featureId[0]);
i.length > 0 && this.displayTooltip(i);
}
}
},
/**
* Updates the connectivity filters in flatmap when there are changes in the sidebar.
* @public
* @param {Array} payload - The array of filter items to update.
*/
updateConnectivityFilters: function(e) {
e.length && (this.connectivityFilters = e.filter((t) => t.facet.toLowerCase() !== "show all"));
},
resetConnectivityfilters: function(e) {
e.length ? this.connectivityFilters = this.connectivityFilters.filter(
(t) => e.some((n) => n.facetPropPath === t.facetPropPath && n.facet !== t.facet)
) : this.connectivityFilters = [];
},
getKnowledgeTooltip: async function(e) {
const t = await this.flatmapQueries.retrieveFlatmapKnowledgeForEvent(this.mapImp, e);
let n = await this.flatmapQueries.createTooltipData(this.mapImp, e);
return (t && t[0] || e.feature.hyperlinks && e.feature.hyperlinks.length > 0) && (n.featuresAlert = e.alert, n.knowledgeSource = ea(this.mapImp), n.mapId = this.mapImp.provenance.id, n.mapuuid = this.mapImp.provenance.uuid), n.ready = !0, n;
},
/**
* A hack to remove flatmap tooltips while popup is open
*/
popUpCssHacks: function() {
const e = document.querySelector(".flatmap-tooltip-popup"), t = document.querySelector(".maplibregl-popup-close-button");
e && (e.style.display = "none"), t.style.display = "block", this.$refs.tooltip.$el.style.display = "flex", t.onclick = () => {
this.$emit("connectivity-info-close"), e && (e.style.display = "block");
};
},
/**
* @public
* Function to close tooltip.
*/
closeTooltip: function() {
this.$refs.tooltip && (this.$refs.tooltip.$el.style.display = "none"), document.querySelectorAll(".maplibregl-popup").forEach((e) => {
e.style.display = "none";
});
},
/**
* @public
* Function to show popup on map.
* @arg {String} `featureId`,
* @arg {Object} `node`,
* @arg {Object} `options`
*/
showPopup: function(e, t, n) {
let o = n;
this.mapImp && (o ? o.className || (o.className = "custom-popup") : o = { className: "custom-popup", positionAtLastClick: !0 }, this.mapImp.showPopup(e, t, o));
},
/**
* @public
* Function to show marker popup.
* @arg {String} `featureId`,
* @arg {Object} `node`,
* @arg {Object} `options`
*/
showMarkerPopup: function(e, t, n) {
this.mapImp && this.mapImp.showMarkerPopup(e, t, n);
},
/**
* @public
* Function to close minimap.
*/
closeMinimap: function() {
let e = this.$refs.flatmapContainer.querySelector(
".maplibregl-ctrl-minimap"
);
this.minimapSmall ? (e.classList.add("enlarge"), e.classList.remove("shrink")) : (e.classList.add("shrink"), e.classList.remove("enlarge")), this.minimapSmall = !this.minimapSmall;
},
/**
* Function to add resize button to minimap.
*/
addResizeButtonToMinimap: function() {
let e = this.$refs.flatmapContainer.querySelector(
".maplibregl-ctrl-minimap"
);
e && (this.$refs.minimapResize && this.$refs.minimapResize.$el.parentNode && this.$refs.minimapResize.$el.parentNode.removeChild(
this.$refs.minimapResize.$el
), e.appendChild(this.$refs.minimapResize.$el), this.minimapResizeShow = !0);
},
/**
* @public
* Function to set help mode
* by providing flag ``helpMode`` (true/false).
* @arg {Boolean} `helpMode`
*/
setHelpMode: function(e) {
const t = this.hoverVisibilities.length, n = t - 1, o = this.hoverVisibilities[this.helpModeActiveIndex];
if (o) {
const i = o == null ? void 0 : o.refs, a = o == null ? void 0 : o.ref, s = this.$refs[i || a];
if (s) {
const { parentElement: r, nextElementSibling: l } = s.$el, u = (c) => c && (c.classList.contains("pathway-container") || c.classList.contains("pathway-location"));
(u(r) || u(l)) && (this.requiresDrawer ? this.drawerOpen = !0 : this.helpModeActiveIndex += 1);
} else
this.helpModeActiveIndex += 1;
}
e || (this.helpModeActiveIndex = this.helpModeInitialIndex), this.viewingMode !== "Annotation" && this.helpModeActiveIndex > 9 && (this.helpModeActiveIndex = n), e && this.helpModeActiveIndex >= n && this.$emit("help-mode-last-item", !0), e && !this.helpModeDialog ? (this.inHelp = !0, this.hoverVisibilities.forEach((i) => {
i.value = !0;
})) : e && this.helpModeDialog && t > this.helpModeActiveIndex ? this.helpModeActiveIndex > -1 ? (this.closeFlatmapHelpPopup(), setTimeout(() => {
this.inHelp = !1, this.hoverVisibilities.forEach((i) => {
i.value = !1;
}), this.showTooltip(this.helpModeActiveIndex, 200);
}, 300)) : this.helpModeActiveIndex === -1 && this.openFlatmapHelpPopup() : (this.inHelp = !1, this.hoverVisibilities.forEach((i) => {
i.value = !1;
}), this.closeFlatmapHelpPopup());
},
/**
* @public
* Function to show tooltip
* by providing ``tooltipNumber``.
* @arg {Number} `tooltipNumber`
* @arg {Number} `timeout` _(default: `500`)_
*/
showTooltip: function(e, t = 500) {
this.inHelp || (clearTimeout(this.tooltipWait[e]), this.tooltipWait[e] = setTimeout(() => {
this.hoverVisibilities[e].value = !0, this.$emit("shown-tooltip");
}, t));
},
/**
* @public
* Function to hide tooltip
* by providing ``tooltipNumber``.
* @arg {Number} `tooltipNumber`
* @arg {Number} `timeout` _(default: `500`)_
*/
hideTooltip: function(e, t = 500) {
this.inHelp || (clearTimeout(this.tooltipWait[e]), this.tooltipWait[e] = setTimeout(() => {
this.hoverVisibilities[e].value = !1;
}, t));
},
/**
* @public
* Function to display tooltip
* by providing featureId (``feature``).
* @arg {String} `feature`
* @arg {String} `geometry` _(default: `undefined`)_
*/
displayTooltip: function(e, t = void 0) {
let n, o = { className: "flatmapvuer-popover" };
if (t)
n = e, o.annotationFeatureGeometry = t;
else {
const i = Array.isArray(e) ? e[0] : e;
i && (n = this.mapImp.modelFeatureIds(i)[0]), this.activeDrawTool || (o.positionAtLastClick = !0);
}
this.connectivityInfoSidebar && this.tooltipEntry.length && this.viewingMode !== "Annotation" && this.checkConnectivityTooltipEntry(this.tooltipEntry) && this.$emit("connectivity-info-open", this.tooltipEntry), this.annotationSidebar && this.viewingMode === "Annotation" && this.$emit("annotation-open", { annotationEntry: this.annotationEntry, commitCallback: this.commitAnnotationEvent }), n && !this.disableUI && (this.viewingMode === "Annotation" && !this.annotationSidebar || this.viewingMode === "Exploration" && !this.connectivityInfoSidebar) && (this.tooltipDisplay = !0, this.$nextTick(() => {
this.mapImp.showPopup(n, this.$refs.tooltip.$el, o), this.popUpCssHacks();
}));
},
/**
* Move the map to the left side
* to the visible area of the feature IDs
* because the sidebar is opened
* @arg featureIds
*/
moveMap: function(e, t = {}) {
if (this.mapImp) {
const { offsetX: n = 0, offsetY: o = 0, zoom: i = 4 } = t, a = this.mapImp.map, s = this.mapImp.bounds.toArray();
this.mapImp.zoomToFeatures(e, { noZoomIn: !0 }), this.showPathwaysDrawer(!1), s != null && s.length && setTimeout(() => {
a.fitBounds(s, {
offset: [n, o],
zoom: i,
animate: !0
});
});
}
},
/**
* @public
* Function to open Flatmap Help Popup.
*/
openFlatmapHelpPopup: function() {
if (this.mapImp) {
let e = this.mapImp.modelFeatureIds("UBERON:0000948");
e && e.length > 0 && (this.mapImp.showPopup(e[0], "Click for more information", {
anchor: "top",
className: "flatmap-popup-popper"
}), this.$emit("shown-map-tooltip"));
}
},
/**
* @public
* Function to close Flatmap Help Popup.
*/
closeFlatmapHelpPopup: function() {
this.$el.querySelectorAll(".maplibregl-popup-close-button").forEach((e) => {
e.click();
});
},
/**
* @public
* Function to get annotation labels.
*/
getLabels: function() {
let e = [];
if (this.mapImp) {
let t = this.mapImp.annotations;
for (let n of t.values())
n.label && e.push(n.label);
return Array.from(new Set(e));
}
},
/**
* Function to get and store the state (object) of the map in
* the provided argument
*/
getVisibilityState: function(e) {
if (["alertSelection", "pathwaysSelection", "taxonSelection"].forEach((n) => {
let o = this.$refs[n];
o && (e[n] = o.getState());
}), this.$refs.treeControls) {
const n = this.$refs.treeControls.$refs.regionTree.getCheckedKeys();
e.systemsSelection = n.filter((o) => !o.includes("."));
}
},
/**
* Function to set and restore the visibility state (object) of
* the map with the provided argument
*/
setVisibilityState: function(e) {
["alertSelection", "pathwaysSelection", "taxonSelection"].forEach((n) => {
const o = e[n];
if (o) {
const i = this.$refs[n];
i && i.setState(o);
}
}), "systemsSelection" in e && this.$refs.treeControls && (this.$refs.treeControls.$refs.regionTree.setCheckedKeys(e.systemsSelection), this.systems[0].children.forEach((n) => {
this.mapImp.enableSystem(n.key, e.systemsSelection.includes(n.key));
}));
},
/**
* @public
* Function to get the state (object) of the map.
*/
getState: function() {
if (this.mapImp) {
let e = {
entry: this.entry,
viewport: this.mapImp.getState()
};
const t = this.mapImp.getIdentifier();
return this.biologicalSex ? e.biologicalSex = this.biologicalSex : t && t.biologicalSex && (e.biologicalSex = t.biologicalSex), t && t.uuid && (e.uuid = t.uuid), e.viewingMode = this.viewingMode, e.searchTerm = this.searchTerm, e.flightPath3D = this.flightPath3DRadio, e.colour = this.colourRadio, e.outlines = this.outlinesRadio, e.background = this.currentBackground, this.offlineAnnotationEnabled && (e.offlineAnnotations = sessionStorage.getItem("anonymous-annotation")), this.getVisibilityState(e), e;
}
},
/**
* @public
* Function to set state (object) for the map.
* @arg {Object} `state`
*/
setState: function(e) {
e && (this.mapImp && e.entry && this.entry == e.entry && (!e.biologicalSex || e.biologicalSex === this.biologicalSex) ? this.restoreMapState(e) : this.createFlatmap(e), this.setStateRequired = !1);
},
/**
* @public
* Function to restore map's state
* from the ``state`` provided.
* @arg {Object} `state`
*/
restoreMapState: function(e) {
if (e) {
if (e.viewport && this.mapImp.setState(e.viewport), e.offlineAnnotations && sessionStorage.setItem("anonymous-annotation", e.offlineAnnotations), e.viewingMode && this.changeViewingMode(e.viewingMode), "flightPath3D" in e && this.setFlightPath3D(e.flightPath3D), "colour" in e && this.setColour(e.colour), "outlines" in e && this.setOutlines(e.outlines), e.background && this.backgroundChangeCallback(e.background), e.searchTerm) {
const t = e.searchTerm;
this.searchAndShowResult(t, !0, !0);
}
this.setVisibilityState(e);
}
},
/**
* @public
* Function to show flight path option
* (3D option)
* based on the map version (currently 1.6 and above).
* @arg {String} `mapVersion`
*/
setFlightPathInfo: function(e) {
(e === 1.6 || e > 1.6) && (this.displayFlightPathOption = !0, this.setFlightPath3D(!1));
},
/**
* @public
* Function to create Flatmap
* by providing the ``state``.
* @arg {Object} `state`
*/
createFlatmap: function(e) {
if (!this.mapImp && !this.loading) {
this.loading = !0;
let t = !1;
this.displayMinimap && (t = { position: "top-right" });
let n = { taxon: this.entry };
this.uuid && (n.uuid = this.uuid), e ? (e.uuid ? n = { uuid: e.uuid } : e.entry && (n.taxon = e.entry), e.biologicalSex ? n.biologicalSex = e.biologicalSex : n.taxon === "NCBITaxon:9606" && (n.biologicalSex = "PATO:0000384")) : this.biologicalSex && (n.biologicalSex = this.biologicalSex), this.mapManagerRef.loadMap(
n,
this.eventCallback(),
{
//fullscreenControl: false,
//annotatable: false,
//debug: true,
minZoom: this.minZoom,
tooltips: this.tooltips,
minimap: t,
container: this.$refs.display
// tooltipDelay: 15, // new feature to delay tooltips showing
}
).then((i) => {
this.mapImp = i, this.serverURL = this.mapImp.makeServerUrl("").slice(0, -1);
let a = this.mapImp.details.version;
this.setFlightPathInfo(a);
const s = this._stateToBeSet ? this._stateToBeSet : e;
this.onFlatmapReady(s), this.$nextTick(() => this.restoreMapState(s));
});
} else e && (this._stateToBeSet = {
...e
}, this.mapImp && !this.loading && this.restoreMapState(this._stateToBeSet));
},
/**
* @public
* Function to compute path controls maximum height.
*/
computePathControlsMaximumHeight() {
const e = this.$refs.display;
if (e) {
const t = getComputedStyle(e), n = parseInt(t.paddingTop) + parseInt(t.paddingBottom), o = e.clientHeight - n;
this.pathwaysMaxHeight = o - 170;
}
},
/**
* @public
* Function to resize the map.
*/
mapResize: function() {
try {
this.computePathControlsMaximumHeight(), this.mapImp && (this.mapImp.resize(), this.showMinimap(this.displayMinimap));
} catch {
console.error("Map resize error");
}
},
getFilterSources: function() {
const e = ["kind", "taxons"];
let t = /* @__PURE__ */ new Set(), n = /* @__PURE__ */ new Set(), o = /* @__PURE__ */ new Map();
for (const a of this.mapImp.annotations.values())
if (a.source) {
"alert" in a ? t.add(a.source) : n.add(a.source);
for (const [s, r] of Object.entries(a))
if (e.includes(s)) {
o.has(s) || o.set(s, /* @__PURE__ */ new Map());
const l = o.get(s), u = (c) => {
const d = c;
l.has(d) || l.set(d, /* @__PURE__ */ new Set()), l.get(d).add(`${a.source}`);
};
Array.isArray(r) ? r.forEach(u) : u(r);
}
}
let i = {
alert: {
with: [...t],
without: [...n]
}
};
for (const [a, s] of o.entries()) {
i[a] = {};
for (const [r, l] of s.entries())
i[a][r] = [...l.values()];
}
return i;
},
getFilterOptions: async function(e, t) {
const n = t || this.getFlatmapKnowledge(), o = this.pathways;
return await au(this.flatmapAPI, e, n, o);
},
/**
* @public
* This function is used for functions that need to run immediately after the flatmap is loaded.
*/
onFlatmapReady: function(e) {
var t;
this.sensor = Ge(new bb(this.$refs.display, this.mapResize)), ((t = this.mapImp.options) == null ? void 0 : t.style) === "functional" && (this.isFC = !0), this.mapImp.setBackgroundOpacity(1), this.backgroundChangeCallback(this.currentBackground), this.pathways = this.mapImp.pathTypes(), this.pathways = this.pathways.filter((n) => n.enabled && n.type !== "other"), this.processSystems(this.mapImp.getSystems()), this.processTaxon(this.mapImp.taxonIdentifiers, e ? e.taxonSelection : void 0), this.containsAlert = "alert" in this.mapImp.featureFilterRanges(), this.flatmapLegends = this.mapImp.flatmapLegend, this.addResizeButtonToMinimap(), this.loading = !1, this.computePathControlsMaximumHeight(), this.mapResize(), this.handleMapClick(), this.setInitMapState(), this.$emit("ready", this);
},
/**
* @public
* Function to handle mouse click on map area
* after the map is loaded.
*/
handleMapClick: function() {
const e = this.mapImp.map;
e && e.on("click", (t) => {
this.connectivityDataSource || this.$emit("connectivity-info-close"), this.connectivityDataSource = "";
});
},
/**
* @public
* Function to show or hide the minimap
* by providing ``flag`` (boolean) value.
* @arg {Boolean} `flag`
*/
showMinimap: function(e) {
this.mapImp && this.mapImp.showMinimap(e);
},
/**
* @public
* Function to show or hide the pathways drawer
* by providing ``flag`` (boolean) value.
* @arg {Boolean} `flag`
*/
showPathwaysDrawer: function(e) {
this.drawerOpen = e;
},
/**
* @public
* Function to display features with annotation matching the provided term,
* with the option to display the label/connectivity information using displayInfo flag.
* @arg {String} `term`,
* @arg {String} `displayInfo`
* @arg {String} `mapclick` Similate the event as it is triggered by an user click
*/
searchAndShowResult: function(e, t, n = !0) {
var o;
if (this.mapImp) {
if (e === void 0 || e === "")
return this.mapImp.clearSearchResults(), this.viewingMode === "Exploration" ? this.$emit("connectivity-info-close") : this.viewingMode === "Annotation" && this.manualAbortedOnClose(), this.searchTerm = "", !0;
{
const i = this.mapImp.search(e);
if ((o = i == null ? void 0 : i.results) != null && o.length) {
if (this.mapImp.showSearchResults(i), t) {
let a;
for (let s = 0; s < i.results.length; s++) {
a = i.results[s].featureId;
const r = this.mapImp.annotation(a);
if (a && (r != null && r.label)) break;
}
if (a) {
const s = this.mapImp.featureProperties(a), r = {
resource: [s.models],
feature: s,
label: s.label,
provenanceTaxonomy: s.taxons,
alert: s.alert
};
this.checkAndCreatePopups([r], n), this.mapImp.showPopup(a, ai(s.label), {
className: "custom-popup",
positionAtLastClick: !1,
preserveSelection: !0
});
}
}
return this.searchTerm = e, !0;
} else this.mapImp.clearSearchResults();
}
}
return !1;
},
/**
* @public
* Public method to highlight connected paths for neuron connection mode,
* to highlight paths for other display maps on spit screen.
* @arg {Array} `paths`
*/
highlightConnectedPaths: function(e) {
if (e.length) {
const t = e.filter((o) => o in this.mapImp.pathways.paths), n = this.mapImp.modelFeatureIdList(t);
this.mapImp.selectGeoJSONFeatures(n);
}
},
/**
* @public
* Function to show search suggestions
* from the ``term`` provided.
* @arg {String} `term`
*/
searchSuggestions: function(e) {
return this.mapImp ? this.mapImp.search(e) : [];
},
onActionClick: function(e) {
Ii.emit("onActionClick", e);
},
setConnectionType: function(e) {
this.connectionType = e;
}
},
props: {
/**
* The taxon identifier of the species represented by the map.
*/
entry: {
type: String,
required: !0
},
/**
* The unique ``uuid`` of the flatmap.
* If given then this exact map will be loaded,
* overriding ``taxon`` and ``biologicalSex``.
*/
uuid: String,
/**
* The biological sex of the species represented by the map.
* This is specified as metadata in the map's source file.
*/
biologicalSex: {
type: String,
default: ""
},
/**
* The minimum zoom level of the map.
*/
minZoom: {
type: Number,
default: 1
},
/**
* The option to add another feature label _(`FeatureSmallSymbolLayer`)_
* when this `tooltips` is set to `false`.
*/
tooltips: {
type: Boolean,
default: !0
},
/**
* The option to show tooltips for help mode.
*/
helpMode: {
type: Boolean,
default: !1
},
/**
* The active item index of help mode.
*/
helpModeActiveItem: {
type: Number,
default: 0
},
/**
* The option to use helpModeDialog.
* On default, `false`, clicking help will show all tooltips.
* If `true`, clicking help will show the help-mode-dialog.
*/
helpModeDialog: {
type: Boolean,
default: !1
},
/**
* The last item of help mode.
*/
helpModeLastItem: {
type: Boolean,
default: !1
},
/**
* The initial index number for help mode tooltips.
* Set negative (e.g. -2) if there are other tooltips outside of `hoverVisibilities`.
*/
helpModeInitialIndex: {
type: Number,
default: 0
},
/**
* The option to create map on component mounted.
*/
renderAtMounted: {
type: Boolean,
default: !0
},
/**
* The option to display minimap at the top-right corner of the map.
*/
displayMinimap: {
type: Boolean,
default: !1
},
/**
* The option to show warning. Example for legacy or beta maps.
*/
displayWarning: {
type: Boolean,
default: !1
},
/**
* Flag to determine rather open map UI should be
* presented or not.
*/
enableOpenMapUI: {
type: Boolean,
default: !1
},
/**
* The data to show different map options.
* Available at the bottom-left corner ("Open new map" tooltip).
*/
openMapOptions: {
type: Array,
default: function() {
return [
{
display: "Open AC Map",
key: "AC"
},
{
display: "Open FC Map",
key: "FC"
},
{
display: "Open 3D Human Map",
key: "3D"
}
];
}
},
/**
* The option to show star in legend area.
*/
showStarInLegend: {
type: Boolean,
default: !1
},
/**
* Flag to determine whether this is legacy map or not.
* ``displayWarning`` should be shown for legacy map.
*/
isLegacy: {
type: Boolean,
default: !1
},
/**
* The option to show the latest changes.
*/
displayLatestChanges: {
type: Boolean,
default: !1
},
/**
* State containing state of the flatmap.
*/
state: {
type: Object,
default: void 0
},
/**
* Flatmap's Map Manager to use as single Map Manager
* if the FlatmapVuer is loaded from MultiFlatmapVuer.
*/
mapManager: {
type: Object,
default: void 0
},
/**
* Specify the endpoint of the flatmap server.
*/
flatmapAPI: {
type: String,
default: "https://mapcore-demo.org/current/flatmap/v3/"
},
/**
* Specify the endpoint of the SPARC API.
*/
sparcAPI: {
type: String,
default: "https://api.sparc.science/"
},
/**
* Flag to disable UIs on Map
*/
disableUI: {
type: Boolean,
default: !1
},
/**
* The option to show connectivity information in sidebar
*/
connectivityInfoSidebar: {
type: Boolean,
default: !1
},
/**
* The option to show annotation in sidebar
*/
annotationSidebar: {
type: Boolean,
default: !1
},
/**
* The option to show local settings UI
* (background colour, flight path, viewing mode, etc.)
*/
showLocalSettings: {
type: Boolean,
default: !0
},
/**
* The option to show open new map button
*/
showOpenMapButton: {
type: Boolean,
default: !0
},
/**
* The option to show pathway drawer
*/
showPathwayFilter: {
type: Boolean,
default: !0
},
/**
* Allow to add and display extra legends to drawer
*/
externalLegends: {
type: Array,
default: []
}
},
provide() {
return {
flatmapAPI: this.flatmapAPI,
sparcAPI: this.sparcAPI,
userApiKey: this.userToken
};
},
data: function() {
return {
sensor: null,
mapManagerRef: void 0,
flatmapQueries: void 0,
annotationEntry: [],
//tooltip display has to be set to false until it is rendered
//for the first time, otherwise it may display an arrow at a
//undesired location.
tooltipDisplay: !1,
serverURL: void 0,
layers: [],
pathways: [],
initMapState: Ge({}),
sckanDisplay: [
{
label: "Display Path with SCKAN",
key: "VALID"
}
],
systems: [],
taxonConnectivity: [],
pathwaysMaxHeight: 1e3,
tooltipWait: Ge([]),
hoverVisibilities: [
{ value: !1, ref: "markerPopover" },
// 0
{ value: !1, ref: "zoomInPopover" },
// 1
{ value: !1, ref: "zoomOutPopover" },
// 2
{ value: !1, ref: "zoomFitPopover" },
// 3
{ value: !1, ref: "openMapPopover" },
// 4
{ value: !1, ref: "settingsPopover" },
// 5
{ value: !1, ref: "checkBoxPopover" },
// 6
{ value: !1, ref: "warningPopover" },
// 7
{ value: !1, ref: "whatsNewPopover" },
// 8
{ value: !1, ref: "featuredMarkerPopover" },
// 9
{ value: !1, refs: "toolbarPopover", ref: "editPopover" },
// 10
{ value: !1, refs: "toolbarPopover", ref: "deletePopover" },
// 11
{ value: !1, refs: "toolbarPopover", ref: "pointPopover" },
// 12
{ value: !1, refs: "toolbarPopover", ref: "lineStringPopover" },
// 13
{ value: !1, refs: "toolbarPopover", ref: "polygonPopover" },
// 14
{ value: !1, refs: "toolbarPopover", ref: "connectionPopover" }
// 15
],
helpModeActiveIndex: this.helpModeInitialIndex,
yellowstar: gb,
isFC: !1,
inHelp: !1,
currentBackground: "white",
availableBackground: ["white", "lightskyblue", "black"],
loading: !1,
flatmapMarker: ub,
tooltipEntry: [],
connectivityDataSource: "",
connectivityTooltipVisible: !1,
drawerOpen: !1,
flightPath3DRadio: !1,
displayFlightPathOption: !1,
colourRadio: !0,
outlinesRadio: !0,
minimapResizeShow: !1,
minimapSmall: !1,
currentActive: "",
selectedDrawnFeature: void 0,
// Clicked drawn annotation
currentHover: "",
viewingMode: "Exploration",
viewingModes: {
Exploration: "Find relevant research and view detail of neural pathways by selecting a pathway to view its connections and data sources",
"Neuron Connection": "Discover Neuron connections by selecting a neuron and viewing its associated network connections",
Annotation: ["View feature annotations", "Add, comment on and view feature annotations"]
},
connectionType: "All",
offlineAnnotationEnabled: !1,
offlineAnnotations: [],
annotationFrom: "Anyone",
annotatedSource: ["Anyone", "Me", "Others"],
openMapRef: void 0,
backgroundIconRef: void 0,
toolbarOptions: [
"Edit",
"Delete",
"Point",
"LineString",
"Polygon",
"Connection"
],
annotator: void 0,
authorisedUser: void 0,
activeDrawMode: void 0,
activeDrawTool: void 0,
featureAnnotationSubmitted: !1,
drawnCreatedEvent: {},
previousEditEvent: {},
previousDeletedEvent: {},
connectionEntry: {},
existDrawnFeatures: [],
// Store all exist drawn features
doubleClickedFeature: !1,
containsAlert: !1,
alertOptions: [
{
label: "Display Path With Alerts",
key: "alert",
enabled: !0
},
{
label: "Display Path Without Alerts",
key: "withoutAlert",
enabled: !0
}
],
mapFilters: Ge({
alert: {
with: !0,
without: !0
}
}),
searchTerm: "",
taxonLeaveDelay: void 0,
connectivityFilters: [],
flatmapLegends: []
};
},
computed: {
...lu(wb, ["userToken"]),
isValidDrawnCreated: function() {
return Object.keys(this.drawnCreatedEvent).length > 0;
},
requiresDrawer: function() {
var e, t, n, o;
return this.loading ? (this.drawerOpen = !1, !1) : ((e = this.systems) == null ? void 0 : e.length) > 0 || this.containsAlert && this.alertOptions || ((t = this.pathways) == null ? void 0 : t.length) > 0 || ((n = this.taxonConnectivity) == null ? void 0 : n.length) > 0 || ((o = this.legendEntry) == null ? void 0 : o.length) > 0 ? (this.drawerOpen = !0, !0) : (this.drawerOpen = !1, !1);
},
modeDescription: function() {
let e = this.viewingModes[this.viewingMode];
return this.viewingMode === "Annotation" ? this.authorisedUser ? e[1] : e[0] : e;
},
legendEntry: function() {
return [...this.flatmapLegends, ...this.externalLegends];
}
},
watch: {
entry: function() {
this.state || this.createFlatmap();
},
helpMode: function(e, t) {
e !== t && this.setHelpMode(e);
},
helpModeActiveItem: function() {
this.helpMode && (this.helpModeActiveIndex += 1, this.setHelpMode(this.helpMode));
},
state: {
handler: function(e, t) {
e !== t && (this.mapManagerRef ? this.setState(e) : this.setStateRequired = !0);
},
immediate: !0,
deep: !0
},
viewingMode: function(e) {
this.clearAnnotationFeature(), e === "Annotation" && (this.loading = !0, this.annotator.authenticate(this.userToken).then((t) => {
t.name && t.email && t.canUpdate ? (this.authorisedUser = t, this.offlineAnnotationEnabled = !1) : (this.authorisedUser = void 0, this.offlineAnnotationEnabled = !0), this.emitOfflineAnnotationUpdate(), this.setFeatureAnnotated(), this.addAnnotationFeature(), this.loading = !1;
}));
},
disableUI: function(e) {
e && this.closeTooltip();
},
activeDrawTool: function(e) {
let t = [], n = { x: null, y: null };
const o = this.$el.querySelector(".maplibregl-canvas"), i = () => {
o.removeEventListener("keydown", a), o.removeEventListener("click", s);
}, a = (r) => {
if (!["Escape", "Enter"].includes(r.key)) return;
const l = e === "Point" && t.length === 1 || e === "LineString" && t.length >= 2 || e === "Polygon" && t.length >= 3;
(r.key === "Escape" || r.key === "Enter" && !l) && (this.activeDrawTool = void 0), i();
}, s = (r) => {
const l = o.getBoundingClientRect(), u = r.clientX - l.left, c = r.clientY - l.top;
if (Math.sqrt((u - n.x) ** 2 + (c - n.y) ** 2) < 8) {
this.isValidDrawnCreated || (this.activeDrawTool = void 0), i();
return;
}
n = { x: u, y: c }, t.push(n);
};
e && (i(), o.addEventListener("keydown", a), o.addEventListener("click", s));
}
},
created: function() {
this.mapManager ? this.mapManagerRef = this.mapManager : (this.mapManagerRef = Ge(new Ds.MapViewer(this.flatmapAPI, { container: void 0 })), this.$emit("mapmanager-loaded", this.mapManagerRef));
},
mounted: function() {
this.openMapRef = ho(this.$refs.openMapRef), this.backgroundIconRef = ho(this.$refs.backgroundIconRef), this.tooltipWait.length = this.hoverVisibilities.length, this.flatmapQueries = Ge(new cb()), this.flatmapQueries.initialise(this.flatmapAPI), this.state ? this.setStateRequired && this.setState(this.state) : this.renderAtMounted && this.createFlatmap(), vl();
}
}, kb = {
class: "flatmap-container",
ref: "flatmapContainer",
"element-loading-text": "Loading...",
"element-loading-background": "rgba(0, 0, 0, 0.3)"
}, Tb = { style: { height: "100%", width: "100%", position: "relative", "overflow-y": "none" } }, Ab = {
style: { height: "100%", width: "100%" },
ref: "display"
}, Ob = { class: "beta-popovers" }, Mb = {
key: 2,
class: "warning-text"
}, Pb = { class: "bottom-right-control" }, _b = ["innerHTML"], Lb = { style: { "margin-bottom": "2px" } }, xb = {
key: 0,
class: "viewing-mode-title"
}, Fb = ["onClick"], Rb = ["onClick"];
function $b(e, t, n, o, i, a) {
const s = Fe("map-svg-sprite-color"), r = Ms, l = et, u = Vo, c = ki, d = Fe("DrawToolbar"), f = Fe("map-svg-icon"), m = ob, p = Fe("tree-controls"), h = hl, g = Ps, y = Wr, w = Kn, M = Un, T = Xi, E = Bo, A = sl, O = rl, D = Fe("Tooltip"), N = pl, j = Ci;
return ie((S(), x("div", kb, [
L(s),
R("div", Tb, [
R("div", Ab, null, 512),
ie(R("div", Ob, [
R("div", null, [
L(u, {
placement: "right",
"popper-class": "warning-popper flatmap-popper",
teleported: !1,
visible: e.hoverVisibilities[7].value,
ref: "warningPopover"
}, {
reference: k(() => [
R("div", {
class: "warning-icon",
onMouseover: t[7] || (t[7] = (I) => a.showTooltip(7)),
onMouseout: t[8] || (t[8] = (I) => a.hideTooltip(7))
}, [
n.displayWarning || n.isLegacy ? (S(), V(l, { key: 0 }, {
default: k(() => [
L(r)
]),
_: 1
})) : z("", !0),
n.isLegacy ? (S(), x(he, { key: 1 }, [
t[33] || (t[33] = R("span", { class: "warning-text" }, "Legacy Map", -1)),
R("div", {
class: "latest-map-text",
onClick: t[6] || (t[6] = (...I) => a.viewLatestMap && a.viewLatestMap(...I))
}, " Click here for the latest map ")
], 64)) : n.displayWarning ? (S(), x("span", Mb, "Beta")) : z("", !0)
], 32)
]),
default: k(() => [
n.isLegacy ? (S(), x("p", {
key: 0,
onMouseover: t[0] || (t[0] = (I) => a.showTooltip(7)),
onMouseout: t[1] || (t[1] = (I) => a.hideTooltip(7))
}, " This is a legacy map, you may view the latest map instead. ", 32)) : e.isFC ? (S(), x("p", {
key: 1,
onMouseover: t[2] || (t[2] = (I) => a.showTooltip(7)),
onMouseout: t[3] || (t[3] = (I) => a.hideTooltip(7))
}, t[31] || (t[31] = [
Z(" This map displays the connectivity of individual neurons. Specifically, those which align with (parts of) the neuron populations from the "),
R("a", {
href: "https://sparc.science/resources/1ZUKXU2YmLcn2reCyXjlew",
target: "_blank"
}, " ApiNATOMY ", -1),
Z(" models available in "),
R("a", {
href: "https://sparc.science/resources/6eg3VpJbwQR4B84CjrvmyD",
target: "_blank"
}, " SCKAN ", -1),
Z(". ")
]), 32)) : (S(), x("p", {
key: 2,
onMouseover: t[4] || (t[4] = (I) => a.showTooltip(7)),
onMouseout: t[5] || (t[5] = (I) => a.hideTooltip(7))
}, t[32] || (t[32] = [
Z(" This map displays the connectivity of neuron populations. Specifically, those from the primarily rat-based "),
R("a", {
href: "https://sparc.science/resources/1ZUKXU2YmLcn2reCyXjlew",
target: "_blank"
}, " ApiNATOMY ", -1),
Z(" models available in "),
R("a", {
href: "https://sparc.science/resources/6eg3VpJbwQR4B84CjrvmyD",
target: "_blank"
}, " SCKAN ", -1),
Z(". New connectivity and species specificity will be added as the SPARC program progresses. ")
]), 32))
]),
_: 1
}, 8, ["visible"])
]),
n.displayLatestChanges ? (S(), V(u, {
key: 0,
placement: "right",
teleported: !1,
trigger: "manual",
"popper-class": "warning-popper flatmap-popper",
visible: e.hoverVisibilities[8].value,
ref: "whatsNewPopover"
}, {
reference: k(() => [
n.displayLatestChanges ? (S(), x("div", {
key: 0,
class: "latest-changesicon",
onMouseover: t[9] || (t[9] = (I) => a.showTooltip(8)),
onMouseout: t[10] || (t[10] = (I) => a.hideTooltip(8))
}, [
L(l, null, {
default: k(() => [
L(r)
]),
_: 1
}),
t[34] || (t[34] = R("span", { class: "warning-text" }, "What's new?", -1))
], 32)) : z("", !0)
]),
default: k(() => t[35] || (t[35] = [
R("b", null, "Connectivity References", -1),
R("p", null, " Connectivity references have been improved and available in various formats. ", -1),
R("b", null, "Improved state storing", -1),
R("p", null, " Current selection and visibility filters are now stored when creating a permalink. ", -1)
])),
_: 1
}, 8, ["visible"])) : z("", !0)
], 512), [
[Ee, !n.disableUI]
]),
ie(L(l, {
class: P(["minimap-resize", { enlarge: e.minimapSmall, shrink: !e.minimapSmall }]),
ref: "minimapResize",
onClick: a.closeMinimap
}, {
default: k(() => [
L(c)
]),
_: 1
}, 8, ["class", "onClick"]), [
[Ee, e.minimapResizeShow]
]),
e.viewingMode === "Annotation" && (e.authorisedUser || e.offlineAnnotationEnabled) && !n.disableUI ? (S(), V(d, {
key: 0,
mapCanvas: {
containerHTML: this.$el,
class: ".maplibregl-canvas"
},
toolbarOptions: e.toolbarOptions,
activeDrawTool: e.activeDrawTool,
activeDrawMode: e.activeDrawMode,
newlyDrawnEntry: e.drawnCreatedEvent,
connectionEntry: e.connectionEntry,
hoverVisibilities: e.hoverVisibilities,
onClickToolbar: a.toolbarEvent,
onFeatureTooltip: a.connectedFeatureTooltip,
onConfirmDrawn: a.confirmDrawnFeature,
onCancelDrawn: a.cancelDrawnFeature,
onShowTooltip: a.showTooltip,
onHideTooltip: a.hideTooltip,
ref: "toolbarPopover"
}, null, 8, ["mapCanvas", "toolbarOptions", "activeDrawTool", "activeDrawMode", "newlyDrawnEntry", "connectionEntry", "hoverVisibilities", "onClickToolbar", "onFeatureTooltip", "onConfirmDrawn", "onCancelDrawn", "onShowTooltip", "onHideTooltip"])) : z("", !0),
ie(R("div", Pb, [
L(u, {
content: "Zoom in",
placement: "left",
teleported: !1,
trigger: "manual",
width: "70",
"popper-class": "flatmap-popper",
visible: e.hoverVisibilities[1].value,
ref: "zoomInPopover"
}, {
reference: k(() => [
R("div", {
class: "icon-button-container",
onClick: t[11] || (t[11] = (I) => a.zoomIn()),
onMouseover: t[12] || (t[12] = (I) => a.showTooltip(1)),
onMouseout: t[13] || (t[13] = (I) => a.hideTooltip(1))
}, [
L(f, {
class: "icon-button zoomIn",
icon: "zoomIn"
})
], 32)
]),
_: 1
}, 8, ["visible"]),
L(u, {
content: "Zoom out",
placement: "top-end",
teleported: !1,
trigger: "manual",
width: "70",
"popper-class": "flatmap-popper",
visible: e.hoverVisibilities[2].value,
ref: "zoomOutPopover"
}, {
reference: k(() => [
R("div", {
class: "icon-button-container",
onClick: t[14] || (t[14] = (I) => a.zoomOut()),
onMouseover: t[15] || (t[15] = (I) => a.showTooltip(2)),
onMouseout: t[16] || (t[16] = (I) => a.hideTooltip(2))
}, [
L(f, {
class: "icon-button zoomOut",
icon: "zoomOut"
})
], 32)
]),
_: 1
}, 8, ["visible"]),
L(u, {
content: "Reset",
placement: "top",
teleported: !1,
trigger: "manual",
width: "70",
"popper-class": "flatmap-popper",
visible: e.hoverVisibilities[3].value,
ref: "zoomFitPopover"
}, {
reference: k(() => [
R("div", {
class: "icon-button-container",
onClick: t[17] || (t[17] = (I) => a.resetView()),
onMouseover: t[18] || (t[18] = (I) => a.showTooltip(3)),
onMouseout: t[19] || (t[19] = (I) => a.hideTooltip(3))
}, [
L(f, {
class: "icon-button fitWindow",
icon: "fitWindow"
})
], 32)
]),
default: k(() => [
t[36] || (t[36] = R("div", null, [
Z(" Fit to "),
R("br"),
Z(" window ")
], -1))
]),
_: 1
}, 8, ["visible"])
], 512), [
[Ee, !n.disableUI]
]),
L(u, {
content: "Change pathway visibility",
placement: "right",
teleported: !1,
trigger: "manual",
offset: -18,
"popper-class": "flatmap-popper",
visible: e.hoverVisibilities[6].value,
ref: "checkBoxPopover"
}, {
reference: k(() => [
ie(R("div", {
class: P(["pathway-location", { open: e.drawerOpen, close: !e.drawerOpen }])
}, [
ie((S(), x("div", {
class: P(["pathway-container", { open: e.drawerOpen, close: !e.drawerOpen }]),
style: se({ "max-height": e.pathwaysMaxHeight + "px" })
}, [
L(u, {
content: "Location of the featured dataset",
placement: "bottom",
teleported: !0,
trigger: "manual",
width: "max-content",
offset: -10,
"popper-class": "flatmap-popper flatmap-teleport-popper",
visible: e.hoverVisibilities[9].value && n.showStarInLegend,
ref: "featuredMarkerPopover"
}, {
reference: k(() => [
ie((S(), x("div", {
onMouseover: t[20] || (t[20] = (I) => a.showTooltip(9)),
onMouseout: t[21] || (t[21] = (I) => a.hideTooltip(9))
}, [
a.legendEntry.length ? (S(), V(m, {
key: 0,
identifierKey: "prompt",
colourKey: "colour",
styleKey: "style",
legends: a.legendEntry,
showStarInLegend: !0,
class: "svg-legends-container"
}, null, 8, ["legends"])) : z("", !0)
], 32)), [
[N, void 0, "featuredMarkerPopover"]
])
]),
_: 1
}, 8, ["visible"]),
L(u, {
content: "Find these markers for data. The number inside the markers is the number of datasets available for each marker.",
placement: "right",
teleported: !1,
width: "200",
trigger: "manual",
"popper-class": "flatmap-popper flatmap-marker-popper",
visible: e.hoverVisibilities[0].value,
ref: "markerPopover"
}, {
reference: k(() => [
ie(R("div", {
class: "flatmap-marker-help",
innerHTML: e.flatmapMarker
}, null, 8, _b), [
[Ee, e.hoverVisibilities[0].value],
[N, void 0, "markerPopover"]
])
]),
_: 1
}, 8, ["visible"]),
e.isFC && e.systems && e.systems.length > 0 ? (S(), V(p, {
key: 0,
class: "treeControls",
mapType: "flatmap",
title: "Systems",
treeData: e.systems,
active: e.currentActive,
hover: e.currentHover,
onCheckChanged: a.systemSelected,
onCheckAll: a.checkAllSystems,
onChangeActive: a.ftuSelected,
ref: "treeControls"
}, null, 8, ["treeData", "active", "hover", "onCheckChanged", "onCheckAll", "onChangeActive"])) : z("", !0),
e.containsAlert && e.alertOptions && n.showPathwayFilter ? (S(), V(h, {
title: "Alert",
labelKey: "label",
identifierKey: "key",
selections: e.alertOptions,
onChanged: a.alertSelected,
onCheckboxMouseEnter: a.alertMouseEnterEmitted,
onSelectionsDataChanged: a.onSelectionsDataChanged,
onCheckAll: a.checkAllAlerts,
ref: "alertSelection",
key: "alertSelection"
}, null, 8, ["selections", "onChanged", "onCheckboxMouseEnter", "onSelectionsDataChanged", "onCheckAll"])) : z("", !0),
e.pathways && e.pathways.length > 0 ? (S(), V(h, {
title: "Pathways",
labelKey: "label",
identifierKey: "type",
colourStyle: "line",
selections: e.pathways,
showAsLegend: !n.showPathwayFilter,
onChanged: a.pathwaysSelected,
onSelectionsDataChanged: a.onSelectionsDataChanged,
onCheckAll: a.checkAllPathways,
ref: "pathwaysSelection",
key: "pathwaysSelection"
}, null, 8, ["selections", "showAsLegend", "onChanged", "onSelectionsDataChanged", "onCheckAll"])) : z("", !0),
e.taxonConnectivity && e.taxonConnectivity.length > 0 && n.showPathwayFilter ? (S(), V(h, {
title: "Studied in",
labelKey: "label",
identifierKey: "taxon",
helpMessage: "Evidence exists that this set of neuron populations have been studied in the given species.",
selections: e.taxonConnectivity,
onChanged: a.taxonsSelected,
onCheckboxMouseEnter: a.taxonMouseEnterEmitted,
onSelectionsDataChanged: a.onSelectionsDataChanged,
onCheckAll: a.checkAllTaxons,
ref: "taxonSelection",
key: "taxonSelection"
}, null, 8, ["selections", "onChanged", "onCheckboxMouseEnter", "onSelectionsDataChanged", "onCheckAll"])) : z("", !0)
], 6)), [
[N, void 0, "checkBoxPopover"]
]),
R("div", {
onClick: t[22] || (t[22] = (...I) => a.toggleDrawer && a.toggleDrawer(...I)),
class: P(["drawer-button", { open: e.drawerOpen, close: !e.drawerOpen }])
}, [
L(l, null, {
default: k(() => [
L(g)
]),
_: 1
})
], 2)
], 2), [
[Ee, !n.disableUI && a.requiresDrawer]
])
]),
_: 1
}, 8, ["visible"]),
e.openMapRef ? (S(), V(u, {
key: 1,
ref: "open-map-popover",
"virtual-ref": e.openMapRef,
placement: "top-start",
width: "136",
teleported: !1,
trigger: "click",
"popper-class": "open-map-popper non-selectable",
"virtual-triggering": ""
}, {
default: k(() => [
(S(!0), x(he, null, Ye(n.openMapOptions, (I) => (S(), V(w, {
key: I.key
}, {
default: k(() => [
L(y, {
type: "primary",
plain: "",
onClick: (K) => e.$emit("open-map", I.key)
}, {
default: k(() => [
Z(ne(I.display), 1)
]),
_: 2
}, 1032, ["onClick"])
]),
_: 2
}, 1024))), 128))
]),
_: 1
}, 8, ["virtual-ref"])) : z("", !0),
L(u, {
ref: "backgroundPopover",
"virtual-ref": e.backgroundIconRef,
placement: "top-start",
width: "320",
teleported: !1,
trigger: "click",
"popper-class": "background-popper h-auto",
"virtual-triggering": ""
}, {
default: k(() => [
R("div", null, [
L(w, { class: "backgroundText" }, {
default: k(() => t[37] || (t[37] = [
Z("Viewing Mode")
])),
_: 1
}),
L(w, { class: "backgroundControl" }, {
default: k(() => [
R("div", Lb, [
(S(!0), x(he, null, Ye(e.viewingModes, (I, K, J) => (S(), x(he, { key: K }, [
K === e.viewingMode ? (S(), x("span", xb, [
R("b", null, ne(K), 1)
])) : (S(), x("span", {
key: 1,
class: "viewing-mode-unselected",
onClick: (de) => a.changeViewingMode(K)
}, ne(K), 9, Fb))
], 64))), 128))
]),
L(w, { class: "viewing-mode-description" }, {
default: k(() => [
Z(ne(a.modeDescription), 1)
]),
_: 1
}),
e.viewingMode === "Annotation" && e.offlineAnnotationEnabled ? (S(), V(w, {
key: 0,
class: "viewing-mode-description"
}, {
default: k(() => t[38] || (t[38] = [
Z(" (Anonymous annotate) ")
])),
_: 1
})) : z("", !0)
]),
_: 1
}),
e.viewingMode === "Annotation" && e.authorisedUser ? (S(), x(he, { key: 0 }, [
L(w, { class: "backgroundText" }, {
default: k(() => t[39] || (t[39] = [
Z("Annotations From")
])),
_: 1
}),
L(w, { class: "backgroundControl" }, {
default: k(() => [
L(E, {
teleported: !1,
modelValue: e.annotationFrom,
"onUpdate:modelValue": t[23] || (t[23] = (I) => e.annotationFrom = I),
placeholder: "Select",
class: "select-box",
"popper-class": "flatmap_dropdown",
onChange: a.setAnnotationFrom
}, {
default: k(() => [
(S(!0), x(he, null, Ye(e.annotatedSource, (I) => (S(), V(T, {
key: I,
label: I,
value: I
}, {
default: k(() => [
L(w, null, {
default: k(() => [
L(M, { span: 12 }, {
default: k(() => [
Z(ne(I), 1)
]),
_: 2
}, 1024)
]),
_: 2
}, 1024)
]),
_: 2
}, 1032, ["label", "value"]))), 128))
]),
_: 1
}, 8, ["modelValue", "onChange"])
]),
_: 1
})
], 64)) : z("", !0),
e.displayFlightPathOption ? (S(), V(w, {
key: 1,
class: "backgroundSpacer"
})) : z("", !0),
e.displayFlightPathOption ? (S(), V(w, {
key: 2,
class: "backgroundText"
}, {
default: k(() => t[40] || (t[40] = [
Z("Flight path display")
])),
_: 1
})) : z("", !0),
e.displayFlightPathOption ? (S(), V(w, {
key: 3,
class: "backgroundControl"
}, {
default: k(() => [
L(O, {
modelValue: e.flightPath3DRadio,
"onUpdate:modelValue": t[24] || (t[24] = (I) => e.flightPath3DRadio = I),
class: "flatmap-radio",
onChange: a.setFlightPath3D
}, {
default: k(() => [
L(A, { value: !1 }, {
default: k(() => t[41] || (t[41] = [
Z("2D")
])),
_: 1
}),
L(A, { value: !0 }, {
default: k(() => t[42] || (t[42] = [
Z("3D")
])),
_: 1
})
]),
_: 1
}, 8, ["modelValue", "onChange"])
]),
_: 1
})) : z("", !0),
L(w, { class: "backgroundSpacer" }),
L(w, { class: "backgroundText" }, {
default: k(() => t[43] || (t[43] = [
Z("Organs display")
])),
_: 1
}),
L(w, { class: "backgroundControl" }, {
default: k(() => [
L(O, {
modelValue: e.colourRadio,
"onUpdate:modelValue": t[25] || (t[25] = (I) => e.colourRadio = I),
class: "flatmap-radio",
onChange: a.setColour
}, {
default: k(() => [
L(A, { value: !0 }, {
default: k(() => t[44] || (t[44] = [
Z("Colour")
])),
_: 1
}),
L(A, { value: !1 }, {
default: k(() => t[45] || (t[45] = [
Z("Greyscale")
])),
_: 1
})
]),
_: 1
}, 8, ["modelValue", "onChange"])
]),
_: 1
}),
L(w, { class: "backgroundSpacer" }),
L(w, { class: "backgroundText" }, {
default: k(() => t[46] || (t[46] = [
Z("Outlines display")
])),
_: 1
}),
L(w, { class: "backgroundControl" }, {
default: k(() => [
L(O, {
modelValue: e.outlinesRadio,
"onUpdate:modelValue": t[26] || (t[26] = (I) => e.outlinesRadio = I),
class: "flatmap-radio",
onChange: a.setOutlines
}, {
default: k(() => [
L(A, { value: !0 }, {
default: k(() => t[47] || (t[47] = [
Z("Show")
])),
_: 1
}),
L(A, { value: !1 }, {
default: k(() => t[48] || (t[48] = [
Z("Hide")
])),
_: 1
})
]),
_: 1
}, 8, ["modelValue", "onChange"])
]),
_: 1
}),
L(w, { class: "backgroundSpacer" }),
L(w, { class: "backgroundText" }, {
default: k(() => t[49] || (t[49] = [
Z("Change background")
])),
_: 1
}),
L(w, { class: "backgroundControl" }, {
default: k(() => [
(S(!0), x(he, null, Ye(e.availableBackground, (I) => (S(), x("div", {
key: I,
class: P([
"backgroundChoice",
I,
I == e.currentBackground ? "active" : ""
]),
onClick: (K) => a.backgroundChangeCallback(I)
}, null, 10, Rb))), 128))
]),
_: 1
})
])
]),
_: 1
}, 8, ["virtual-ref"]),
ie(R("div", {
class: P(["settings-group", { open: e.drawerOpen, close: !e.drawerOpen }])
}, [
n.showOpenMapButton ? (S(), V(w, { key: 0 }, {
default: k(() => [
L(u, {
visible: e.hoverVisibilities[4].value,
content: "Open new map",
placement: "right",
teleported: !1,
"popper-class": "flatmap-popper",
ref: "openMapPopover"
}, {
reference: k(() => [
n.enableOpenMapUI && n.openMapOptions.length > 0 ? (S(), x("div", {
key: 0,
ref: "openMapRef",
class: "icon-button-container",
onMouseover: t[27] || (t[27] = (I) => a.showTooltip(4)),
onMouseout: t[28] || (t[28] = (I) => a.hideTooltip(4))
}, [
L(f, {
icon: "openMap",
class: "icon-button open-map-button"
})
], 544)) : z("", !0)
]),
_: 1
}, 8, ["visible"])
]),
_: 1
})) : z("", !0),
n.showLocalSettings ? (S(), V(w, { key: 1 }, {
default: k(() => [
L(u, {
content: "Change settings",
placement: "right",
visible: e.hoverVisibilities[5].value,
teleported: !1,
trigger: "manual",
"popper-class": "flatmap-popper",
ref: "settingsPopover"
}, {
reference: k(() => [
R("div", {
ref: "backgroundIconRef",
class: "icon-button-container",
onMouseover: t[29] || (t[29] = (I) => a.showTooltip(5)),
onMouseout: t[30] || (t[30] = (I) => a.hideTooltip(5))
}, [
L(f, {
icon: "changeBckgd",
class: "icon-button"
})
], 544)
]),
_: 1
}, 8, ["visible"])
]),
_: 1
})) : z("", !0)
], 2), [
[Ee, !n.disableUI]
]),
e.tooltipDisplay ? (S(), V(D, {
key: 2,
ref: "tooltip",
class: "tooltip",
annotationEntry: e.annotationEntry,
tooltipEntry: e.tooltipEntry,
annotationDisplay: e.viewingMode === "Annotation",
onAnnotation: a.commitAnnotationEvent,
onOnActionClick: a.onActionClick
}, null, 8, ["annotationEntry", "tooltipEntry", "annotationDisplay", "onAnnotation", "onOnActionClick"])) : z("", !0)
])
])), [
[j, e.loading]
]);
}
const yl = /* @__PURE__ */ Wn(Ib, [["render", $b], ["__scopeId", "data-v-6afc0531"]]), ks = {
"NCBITaxon:10114": "01fedbf9-d783-509c-a10c-827941ab13da",
"NCBITaxon:9823": "a336ac04-24db-561f-a25f-1c994fe17410",
"NCBITaxon:9606": "42ed6323-f645-5fbe-bada-9581819cf689",
"NCBITaxon:10090": "25285fab-48a0-5620-a6a0-f9a0374837d5",
"NCBITaxon:9685": "73060497-46a6-52bf-b975-cac511c127cb"
}, Db = {
name: "MultiFlatmapVuer",
components: {
Col: Un,
Row: Kn,
Option: Xi,
Select: Bo,
Popover: Vo,
FlatmapVuer: yl
},
created: function() {
this.loadMapManager();
},
mounted: function() {
this.initialise(), Ii.on("onActionClick", (e) => {
this.resourceSelected(e);
}), Ii.on("open-pubmed-url", (e) => {
this.$emit("open-pubmed-url", e);
});
},
methods: {
/**
* @public
* Function to initialise the component when mounted.
* It returns a promise.
*/
initialise: function() {
return new Promise((e) => {
this.requireInitialisation ? (this.requireInitialisation = !1, fetch(this.flatmapAPI).then((t) => t.json()).then((t) => {
Object.keys(this.availableSpecies).forEach((o) => {
const i = this.availableSpecies[o].uuid;
if (i && t.map((a) => a.uuid).indexOf(i) > 0)
this.speciesList[o] = this.availableSpecies[o];
else
for (let a = 0; a < t.length; a++)
if (this.availableSpecies[o].taxo === t[a].taxon)
if (this.availableSpecies[o].biologicalSex) {
if (t[a].biologicalSex && t[a].biologicalSex === this.availableSpecies[o].biologicalSex) {
this.speciesList[o] = this.availableSpecies[o];
break;
}
} else {
this.speciesList[o] = this.availableSpecies[o];
break;
}
});
let n = this.initial;
if (this.state) {
const o = this.state.state;
(!o || !o.uuid && !o.entry) && this.state.species ? n = this.state.species : n = void 0;
}
n && (n && this.speciesList[n] !== void 0 ? this.activeSpecies = n : this.activeSpecies = Object.keys(this.speciesList)[0], this.setSpecies(
this.activeSpecies,
this.state ? this.state.state : void 0,
5
)), this.initialised = !0, e(), this.resolveList.forEach((o) => {
o();
});
})) : this.initialised ? e() : this.resolveList.push(e);
});
},
/**
* Function to load `mapManager` to create flatmap.
*/
loadMapManager: function() {
this.mapManagerRef || (this.mapManager ? this.mapManagerRef = this.mapManager : (this.mapManagerRef = Ge(new Ds.MapViewer(this.flatmapAPI, { container: void 0 })), this.$emit("mapmanager-loaded", this.mapManagerRef)));
},
/**
* @public
* Function to emit ``resource-selected`` event with provided ``resource``.
* @arg {Object} `action`
*/
resourceSelected: function(e) {
this.$emit("resource-selected", e);
},
/**
* @public
* Function to emit ``ready`` event after the flatmap is loaded.
* @arg {Object} `component`
*/
FlatmapReady: function(e) {
this.$emit("ready", e);
},
/**
* @public
* Function to get the current active map.
*/
getCurrentFlatmap: function() {
return this.$refs[this.activeSpecies][0];
},
/**
* @public
* Function to emit ``pan-zoom-callback`` event
* from the event emitted in ``callback`` function from ``MapManager.loadMap()``.
* @arg {Object} `payload`
*/
panZoomCallback: function(e) {
this.$emit("pan-zoom-callback", e);
},
onAnnotationClose: function() {
this.$emit("annotation-close");
},
onAnnotationOpen: function(e) {
this.$emit("annotation-open", e);
},
updateOfflineAnnotationEnabled: function(e) {
this.$emit("update-offline-annotation-enabled", e);
},
onConnectivityInfoClose: function() {
this.$emit("connectivity-info-close");
},
onConnectivityInfoOpen: function(e) {
this.$emit("connectivity-info-open", e);
},
onConnectivityError: function(e) {
this.$emit("connectivity-error", e);
},
onNeuronConnectionFeatureClick: function(e) {
this.$emit("neuron-connection-feature-click", e);
},
onSelectionsDataChanged: function(e) {
this.$emit("pathway-selection-changed", e);
},
/**
* @public
* Function to show popup on map.
* @arg {String} `featureId`,
* @arg {Object} `node`,
* @arg {Object} `options`
*/
showPopup: function(e, t, n) {
this.getCurrentFlatmap().showPopup(e, t, n);
},
/**
* @public
* Function to show marker popup.
* @arg {String} `featureId`,
* @arg {Object} `node`,
* @arg {Object} `options`
*/
showMarkerPopup: function(e, t, n) {
this.getCurrentFlatmap().showMarkerPopup(e, t, n);
},
/**
* @public
* Function to set species.
* This function is called on the first load and
* when user changes the species.
* @arg {Array} `species`,
* @arg {Object} `state`,
* @arg {Number} `numberOfRetry`
*/
setSpecies: function(e, t, n) {
if (this.$refs && e in this.$refs)
this.activeSpecies = e, this.$refs[this.activeSpecies][0].createFlatmap(t), this.$emit("flatmapChanged", this.activeSpecies);
else if (n) {
const o = n - 1;
o >= 0 && this.$nextTick(() => {
this.setSpecies(e, t, o);
});
}
},
/**
* Function to switch to the latest existing map from
* a legacy map of the same species.
* @arg state
*
* @private
*/
viewLatestMap: function(e) {
const t = Object.keys(this.speciesList);
for (let n = 0; n < t.length; n++) {
const o = this.speciesList[t[n]];
if (!o.isLegacy && o.taxo === e.entry && o.biologicalSex === e.biologicalSex) {
this.setSpecies(t[n], e, 0);
return;
}
}
},
/**
* Create a legacy entry with the provided information
* @arg state,
* @arg taxo,
*
* @private
*/
createLegacyEntry: function(e, t, n) {
if (n && t) {
let o = "Legacy";
return e.species && (e.species.slice(0, 6) === "Legacy" ? o = e.species : o = o + ` ${e.species}`), this.speciesList[o] = {
taxo: t,
isLegacy: !0,
displayWarning: !0
}, {
species: o,
state: {
entry: t,
uuid: n,
viewport: e.state.viewport,
searchTerm: e.state.searchTerm
}
};
}
},
/**
* Function used to translate the legacy map state to one that can be used in current
* flatmap if required. If it is a legacy, an Select entry will be added
* @arg state
*
* @private
*/
updateState: function(e) {
return new Promise((t) => {
if (e && e.state) {
const n = e.state;
if (n.uuid) {
if (n.entry)
return new Promise(() => {
const o = { taxon: n.entry };
n.biologicalSex && (o.biologicalSex = n.biologicalSex), this.mapManagerRef.findMap(o).then((i) => {
if (i.uuid !== n.uuid)
return this.createLegacyEntry(
e,
n.entry,
n.uuid
);
}).then((i) => {
t(i || e);
}).catch(() => {
t(e);
});
});
} else if (n.entry) {
const o = n.entry in ks ? ks[n.entry] : void 0, i = this.createLegacyEntry(
e,
n.entry,
o
);
t(i || e);
}
}
t(e);
});
},
/**
* @public
* Function used for getting the current states of the scene. This exported states
* can be imported using the importStates method.
*/
getState: function() {
let e = {
species: this.activeSpecies,
state: void 0
}, t = this.getCurrentFlatmap();
return e.state = t.getState(), e;
},
/**
* @public
* Function used for importing the states of the scene. This exported states
* can be imported using the read states method.
* @arg {Object} state
*/
setState: function(e) {
e && (this.loadMapManager(), this.updateState(e).then((t) => {
this.initialise().then(() => {
t.species && t.species !== this.activeSpecies ? this.setSpecies(t.species, t.state, 5) : t.state && this.getCurrentFlatmap().setState(t.state);
});
}));
},
/**
* @public
* Function to activate help mode tooltip by item index number
* @arg {Number} `index`
*/
activateTooltipByIndex: function(e) {
return e === this.helpModeActiveItem && this.helpMode;
},
/**
* @public
* Function to check the last item of help mode
* @arg {Boolean} `isLastItem`
*/
onHelpModeLastItem: function(e) {
e && this.$emit("help-mode-last-item", !0);
},
/**
* @public
* Function to emit event after a tooltip is shown.
*/
onTooltipShown: function() {
this.$emit("shown-tooltip");
},
/**
* @public
* Function to emit event after a tooltip on the map is shown.
*/
onMapTooltipShown: function() {
this.$emit("shown-map-tooltip");
},
/**
* @public
* Function to change the view mode of the map.
* @arg {String} `modeName`
*/
changeViewingMode: function(e) {
this.getCurrentFlatmap().changeViewingMode(e);
},
setConnectionType: function(e) {
this.getCurrentFlatmap().setConnectionType(e);
}
},
props: {
/**
* Initial species for the flatmap.
* This value will be ignored if a valid state object is provided.
*/
initial: {
type: String,
default: ""
},
/**
* The minimum zoom level of the map.
*/
minZoom: {
type: Number,
default: 1
},
/**
* The option to create map on component mounted.
*/
renderAtMounted: {
type: Boolean,
default: !1
},
/**
* The option to show tooltips for help mode.
*/
helpMode: {
type: Boolean,
default: !1
},
/**
* The active item index of help mode.
*/
helpModeActiveItem: {
type: Number,
default: 0
},
/**
* The option to use helpModeDialog.
* On default, `false`, clicking help will show all tooltips.
* If `true`, clicking help will show the help-mode-dialog.
*/
helpModeDialog: {
type: Boolean,
default: !1
},
/**
* The last item of help mode.
*/
helpModeLastItem: {
type: Boolean,
default: !1
},
/**
* The option to display minimap at the top-right corner of the map.
*/
displayMinimap: {
type: Boolean,
default: !1
},
/**
* The option to show star in legend area.
*/
showStarInLegend: {
type: Boolean,
default: !1
},
/**
* Flag to determine rather open map UI should be
* presented or not.
*/
enableOpenMapUI: {
type: Boolean,
default: !1
},
/**
* The data to show different map options.
* Available at the bottom-left corner ("Open new map" tooltip).
*/
openMapOptions: {
type: Array
},
/**
* The available species data for different maps.
* This data is used for multi flatmaps.
*/
availableSpecies: {
type: Object,
/**
* ```{
'Human Female': {
taxo: 'NCBITaxon:9606',
biologicalSex: 'PATO:0000383',
iconClass: 'mapicon-icon_human',
displayWarning: true,
},
'Human Male': {
taxo: 'NCBITaxon:9606',
biologicalSex: 'PATO:0000384',
iconClass: 'mapicon-icon_human',
displayWarning: true,
},
Rat: {
taxo: 'NCBITaxon:10114',
iconClass: 'mapicon-icon_rat',
displayLatestChanges: true,
},
Mouse: {
taxo: 'NCBITaxon:10090',
iconClass: 'mapicon-icon_mouse',
displayWarning: true,
},
Pig: {
taxo: 'NCBITaxon:9823',
iconClass: 'mapicon-icon_pig',
displayWarning: true,
},
Cat: {
taxo: 'NCBITaxon:9685',
iconClass: 'mapicon-icon_cat',
displayWarning: true,
},
}```
*/
default: function() {
return {
"Human Female": {
taxo: "NCBITaxon:9606",
biologicalSex: "PATO:0000383",
iconClass: "mapicon-icon_human",
displayWarning: !0
},
"Human Male": {
taxo: "NCBITaxon:9606",
biologicalSex: "PATO:0000384",
iconClass: "mapicon-icon_human",
displayWarning: !0
},
Rat: {
taxo: "NCBITaxon:10114",
iconClass: "mapicon-icon_rat",
displayLatestChanges: !0
},
Mouse: {
taxo: "NCBITaxon:10090",
iconClass: "mapicon-icon_mouse",
displayWarning: !0
},
Pig: {
taxo: "NCBITaxon:9823",
iconClass: "mapicon-icon_pig",
displayWarning: !0
},
Cat: {
taxo: "NCBITaxon:9685",
iconClass: "mapicon-icon_cat",
displayWarning: !0
}
};
}
},
/**
* State containing state of the flatmap.
*/
state: {
type: Object,
default: void 0
},
/**
* Flatmap's Map Manager to use as single Map Manager
* when the value is provided.
*/
mapManager: {
type: Object,
default: void 0
},
/**
* Specify the endpoint of the flatmap server.
*/
flatmapAPI: {
type: String,
default: "https://mapcore-demo.org/current/flatmap/v3/"
},
/**
* Specify the endpoint of the SPARC API.
*/
sparcAPI: {
type: String,
default: "https://api.sparc.science/"
},
/**
* Flag to disable UIs on Map
*/
disableUI: {
type: Boolean,
default: !1
},
/**
* The option to show connectivity information in sidebar
*/
connectivityInfoSidebar: {
type: Boolean,
default: !1
},
/**
* The option to show connectivity information in sidebar
*/
annotationSidebar: {
type: Boolean,
default: !1
},
/**
* The option to show local settings UI
* (background colour, flight path, viewing mode, etc.)
*/
showLocalSettings: {
type: Boolean,
default: !0
},
/**
* The option to show open new map button
*/
showOpenMapButton: {
type: Boolean,
default: !0
},
/**
* The option to show pathway drawer
*/
showPathwayFilter: {
type: Boolean,
default: !0
},
/**
* Allow to add and display extra legends to drawer
*/
externalLegends: {
type: Array,
default: []
}
},
data: function() {
return {
activeSpecies: void 0,
speciesList: {},
requireInitialisation: !0,
resolveList: Ge([]),
initialised: !1,
mapManagerRef: void 0
};
},
watch: {
state: {
handler: function(e) {
this.setState(e);
},
immediate: !0,
deep: !0
}
}
}, Nb = {
class: "multi-container",
ref: "multiContainer"
}, Bb = {
key: 0,
style: { position: "absolute", "z-index": "100" }
}, Vb = { class: "select-box-icon" };
function zb(e, t, n, o, i, a) {
const s = Xi, r = Bo, l = Vo, u = yl;
return S(), x("div", Nb, [
n.disableUI ? z("", !0) : (S(), x("div", Bb, [
t[2] || (t[2] = R("div", { class: "species-display-text" }, "Species", -1)),
L(l, {
content: "Select a species",
placement: "right",
trigger: "manual",
"popper-class": "flatmap-popper flatmap-teleport-popper right-popper",
width: "max-content",
visible: a.activateTooltipByIndex(0),
teleported: !1,
ref: "selectPopover"
}, {
reference: k(() => [
L(r, {
id: "flatmap-select",
teleported: !1,
modelValue: e.activeSpecies,
"onUpdate:modelValue": t[0] || (t[0] = (c) => e.activeSpecies = c),
placeholder: "Select",
class: "select-box",
"popper-class": "flatmap-dropdown",
onChange: a.setSpecies
}, {
default: k(() => [
(S(!0), x(he, null, Ye(e.speciesList, (c, d) => (S(), V(s, {
key: d,
label: d,
value: d
}, {
default: k(() => [
R("span", Vb, [
R("i", {
class: P(c.iconClass)
}, null, 2)
]),
Z(" " + ne(d), 1)
]),
_: 2
}, 1032, ["label", "value"]))), 128))
]),
_: 1
}, 8, ["modelValue", "onChange"])
]),
_: 1
}, 8, ["visible"])
])),
(S(!0), x(he, null, Ye(e.speciesList, (c, d) => ie((S(), V(u, {
key: d,
entry: c.taxo,
uuid: c.uuid,
biologicalSex: c.biologicalSex,
displayWarning: c.displayWarning,
displayLatestChanges: c.displayLatestChanges,
isLegacy: c.isLegacy,
ref_for: !0,
ref: d,
enableOpenMapUI: n.enableOpenMapUI,
openMapOptions: n.openMapOptions,
disableUI: n.disableUI,
onViewLatestMap: a.viewLatestMap,
onResourceSelected: a.resourceSelected,
onReady: a.FlatmapReady,
onPanZoomCallback: a.panZoomCallback,
annotationSidebar: n.annotationSidebar,
onAnnotationOpen: a.onAnnotationOpen,
onAnnotationClose: a.onAnnotationClose,
onUpdateOfflineAnnotationEnabled: a.updateOfflineAnnotationEnabled,
connectivityInfoSidebar: n.connectivityInfoSidebar,
onConnectivityInfoOpen: a.onConnectivityInfoOpen,
onConnectivityInfoClose: a.onConnectivityInfoClose,
onConnectivityError: a.onConnectivityError,
onNeuronConnectionFeatureClick: a.onNeuronConnectionFeatureClick,
onOpenMap: t[1] || (t[1] = (f) => e.$emit("open-map", f)),
onPathwaySelectionChanged: a.onSelectionsDataChanged,
minZoom: n.minZoom,
helpMode: e.activeSpecies == d && n.helpMode,
helpModeActiveItem: n.helpModeActiveItem,
helpModeDialog: n.helpModeDialog,
helpModeInitialIndex: -2,
onHelpModeLastItem: a.onHelpModeLastItem,
onShownTooltip: a.onTooltipShown,
onShownMapTooltip: a.onMapTooltipShown,
renderAtMounted: n.renderAtMounted,
displayMinimap: n.displayMinimap,
showStarInLegend: n.showStarInLegend,
style: { height: "100%" },
mapManager: e.mapManagerRef,
flatmapAPI: n.flatmapAPI,
sparcAPI: n.sparcAPI,
showLocalSettings: n.showLocalSettings,
showOpenMapButton: n.showOpenMapButton,
showPathwayFilter: n.showPathwayFilter,
externalLegends: n.externalLegends
}, null, 8, ["entry", "uuid", "biologicalSex", "displayWarning", "displayLatestChanges", "isLegacy", "enableOpenMapUI", "openMapOptions", "disableUI", "onViewLatestMap", "onResourceSelected", "onReady", "onPanZoomCallback", "annotationSidebar", "onAnnotationOpen", "onAnnotationClose", "onUpdateOfflineAnnotationEnabled", "connectivityInfoSidebar", "onConnectivityInfoOpen", "onConnectivityInfoClose", "onConnectivityError", "onNeuronConnectionFeatureClick", "onPathwaySelectionChanged", "minZoom", "helpMode", "helpModeActiveItem", "helpModeDialog", "onHelpModeLastItem", "onShownTooltip", "onShownMapTooltip", "renderAtMounted", "displayMinimap", "showStarInLegend", "mapManager", "flatmapAPI", "sparcAPI", "showLocalSettings", "showOpenMapButton", "showPathwayFilter", "externalLegends"])), [
[Ee, e.activeSpecies == d]
])), 128))
], 512);
}
const Gb = /* @__PURE__ */ Wn(Db, [["render", zb], ["__scopeId", "data-v-d3d2df18"]]);
export {
yl as FlatmapVuer,
Gb as MultiFlatmapVuer
};