smart-chat-asp
Version:
smartChat component
1,822 lines (1,821 loc) • 3.7 MB
JavaScript
import { ref as ae, readonly as Xo, watch as Qt, computed as ee, getCurrentInstance as ti, onMounted as Wn, onBeforeUnmount as ir, onBeforeMount as aa, reactive as Sd, inject as at, onActivated as tI, onDeactivated as JS, createTextVNode as Xn, Fragment as rn, Comment as Wp, defineComponent as Le, provide as Mt, withDirectives as Rr, toRef as rt, h as O, Teleport as Kp, nextTick as Tn, renderSlot as Ji, mergeProps as Lo, isVNode as g6, shallowRef as Qp, watchEffect as xn, Transition as oo, TransitionGroup as nI, vShow as Do, cloneVNode as ev, Text as rI, markRaw as Zi, onUnmounted as Ml, normalizeClass as tr, openBlock as je, createElementBlock as Bt, createVNode as ft, unref as ve, withCtx as Nt, toDisplayString as sn, createBlock as Dt, useAttrs as _6, effectScope as tv, toRaw as Ia, hasInjectionContext as b6, isRef as _s, isReactive as jp, getCurrentScope as oI, onScopeDispose as iI, toRefs as g1, createElementVNode as ct, createCommentVNode as ln, renderList as bs, onUpdated as S6, resolveDynamicComponent as vr, normalizeStyle as Fb, createStaticVNode as aI, defineAsyncComponent as v6, useSlots as E6 } from "vue";
function C6(e) {
let t = ".", n = "__", r = "--", o;
if (e) {
let _ = e.blockPrefix;
_ && (t = _), _ = e.elementPrefix, _ && (n = _), _ = e.modifierPrefix, _ && (r = _);
}
const i = {
install(_) {
o = _.c;
const b = _.context;
b.bem = {}, b.bem.b = null, b.bem.els = null;
}
};
function a(_) {
let b, S;
return {
before(E) {
b = E.bem.b, S = E.bem.els, E.bem.els = null;
},
after(E) {
E.bem.b = b, E.bem.els = S;
},
$({ context: E, props: y }) {
return _ = typeof _ == "string" ? _ : _({ context: E, props: y }), E.bem.b = _, `${(y == null ? void 0 : y.bPrefix) || t}${E.bem.b}`;
}
};
}
function s(_) {
let b;
return {
before(S) {
b = S.bem.els;
},
after(S) {
S.bem.els = b;
},
$({ context: S, props: E }) {
return _ = typeof _ == "string" ? _ : _({ context: S, props: E }), S.bem.els = _.split(",").map((y) => y.trim()), S.bem.els.map((y) => `${(E == null ? void 0 : E.bPrefix) || t}${S.bem.b}${n}${y}`).join(", ");
}
};
}
function l(_) {
return {
$({ context: b, props: S }) {
_ = typeof _ == "string" ? _ : _({ context: b, props: S });
const E = _.split(",").map((w) => w.trim());
function y(w) {
return E.map((N) => `&${(S == null ? void 0 : S.bPrefix) || t}${b.bem.b}${w !== void 0 ? `${n}${w}` : ""}${r}${N}`).join(", ");
}
const A = b.bem.els;
if (A !== null) {
if (process.env.NODE_ENV !== "production" && A.length >= 2)
throw Error(`[css-render/plugin-bem]: m(${_}) is invalid, using modifier inside multiple elements is not allowed`);
return y(A[0]);
} else
return y();
}
};
}
function c(_) {
return {
$({ context: b, props: S }) {
_ = typeof _ == "string" ? _ : _({ context: b, props: S });
const E = b.bem.els;
if (process.env.NODE_ENV !== "production" && E !== null && E.length >= 2)
throw Error(`[css-render/plugin-bem]: notM(${_}) is invalid, using modifier inside multiple elements is not allowed`);
return `&:not(${(S == null ? void 0 : S.bPrefix) || t}${b.bem.b}${E !== null && E.length > 0 ? `${n}${E[0]}` : ""}${r}${_})`;
}
};
}
return Object.assign(i, {
cB: (..._) => o(a(_[0]), _[1], _[2]),
cE: (..._) => o(s(_[0]), _[1], _[2]),
cM: (..._) => o(l(_[0]), _[1], _[2]),
cNotM: (..._) => o(c(_[0]), _[1], _[2])
}), i;
}
function y6(e) {
let t = 0;
for (let n = 0; n < e.length; ++n)
e[n] === "&" && ++t;
return t;
}
const sI = /\s*,(?![^(]*\))\s*/g, T6 = /\s+/g;
function x6(e, t) {
const n = [];
return t.split(sI).forEach((r) => {
let o = y6(r);
if (o) {
if (o === 1) {
e.forEach((a) => {
n.push(r.replace("&", a));
});
return;
}
} else {
e.forEach((a) => {
n.push(
// eslint-disable-next-line @typescript-eslint/strict-boolean-expressions
(a && a + " ") + r
);
});
return;
}
let i = [
r
];
for (; o--; ) {
const a = [];
i.forEach((s) => {
e.forEach((l) => {
a.push(s.replace("&", l));
});
}), i = a;
}
i.forEach((a) => n.push(a));
}), n;
}
function R6(e, t) {
const n = [];
return t.split(sI).forEach((r) => {
e.forEach((o) => {
n.push((o && o + " ") + r);
});
}), n;
}
function A6(e) {
let t = [""];
return e.forEach((n) => {
n = n && n.trim(), // eslint-disable-next-line @typescript-eslint/strict-boolean-expressions
n && (n.includes("&") ? t = x6(t, n) : t = R6(t, n));
}), t.join(", ").replace(T6, " ");
}
function _1(e) {
if (!e)
return;
const t = e.parentElement;
t && t.removeChild(e);
}
function Xp(e, t) {
return (t ?? document.head).querySelector(`style[cssr-id="${e}"]`);
}
function O6(e) {
const t = document.createElement("style");
return t.setAttribute("cssr-id", e), t;
}
function Kd(e) {
return e ? /^\s*@(s|m)/.test(e) : !1;
}
const w6 = /[A-Z]/g;
function lI(e) {
return e.replace(w6, (t) => "-" + t.toLowerCase());
}
function N6(e, t = " ") {
return typeof e == "object" && e !== null ? ` {
` + Object.entries(e).map((n) => t + ` ${lI(n[0])}: ${n[1]};`).join(`
`) + `
` + t + "}" : `: ${e};`;
}
function I6(e, t, n) {
return typeof e == "function" ? e({
context: t.context,
props: n
}) : e;
}
function b1(e, t, n, r) {
if (!t)
return "";
const o = I6(t, n, r);
if (!o)
return "";
if (typeof o == "string")
return `${e} {
${o}
}`;
const i = Object.keys(o);
if (i.length === 0)
return n.config.keepEmptyBlock ? e + ` {
}` : "";
const a = e ? [
e + " {"
] : [];
return i.forEach((s) => {
const l = o[s];
if (s === "raw") {
a.push(`
` + l + `
`);
return;
}
s = lI(s), l != null && a.push(` ${s}${N6(l)}`);
}), e && a.push("}"), a.join(`
`);
}
function Bb(e, t, n) {
e && e.forEach((r) => {
if (Array.isArray(r))
Bb(r, t, n);
else if (typeof r == "function") {
const o = r(t);
Array.isArray(o) ? Bb(o, t, n) : o && n(o);
} else
r && n(r);
});
}
function cI(e, t, n, r, o) {
const i = e.$;
let a = "";
if (!i || typeof i == "string")
Kd(i) ? a = i : t.push(i);
else if (typeof i == "function") {
const c = i({
context: r.context,
props: o
});
Kd(c) ? a = c : t.push(c);
} else if (i.before && i.before(r.context), !i.$ || typeof i.$ == "string")
Kd(i.$) ? a = i.$ : t.push(i.$);
else if (i.$) {
const c = i.$({
context: r.context,
props: o
});
Kd(c) ? a = c : t.push(c);
}
const s = A6(t), l = b1(s, e.props, r, o);
a ? n.push(`${a} {`) : l.length && n.push(l), e.children && Bb(e.children, {
context: r.context,
props: o
}, (c) => {
if (typeof c == "string") {
const d = b1(s, { raw: c }, r, o);
n.push(d);
} else
cI(c, t, n, r, o);
}), t.pop(), a && n.push("}"), i && i.after && i.after(r.context);
}
function D6(e, t, n) {
const r = [];
return cI(e, [], r, t, n), r.join(`
`);
}
function Wc(e) {
for (var t = 0, n, r = 0, o = e.length; o >= 4; ++r, o -= 4)
n = e.charCodeAt(r) & 255 | (e.charCodeAt(++r) & 255) << 8 | (e.charCodeAt(++r) & 255) << 16 | (e.charCodeAt(++r) & 255) << 24, n = /* Math.imul(k, m): */
(n & 65535) * 1540483477 + ((n >>> 16) * 59797 << 16), n ^= /* k >>> r: */
n >>> 24, t = /* Math.imul(k, m): */
(n & 65535) * 1540483477 + ((n >>> 16) * 59797 << 16) ^ /* Math.imul(h, m): */
(t & 65535) * 1540483477 + ((t >>> 16) * 59797 << 16);
switch (o) {
case 3:
t ^= (e.charCodeAt(r + 2) & 255) << 16;
case 2:
t ^= (e.charCodeAt(r + 1) & 255) << 8;
case 1:
t ^= e.charCodeAt(r) & 255, t = /* Math.imul(h, m): */
(t & 65535) * 1540483477 + ((t >>> 16) * 59797 << 16);
}
return t ^= t >>> 13, t = /* Math.imul(h, m): */
(t & 65535) * 1540483477 + ((t >>> 16) * 59797 << 16), ((t ^ t >>> 15) >>> 0).toString(36);
}
typeof window < "u" && (window.__cssrContext = {});
function k6(e, t, n, r) {
const { els: o } = t;
if (n === void 0)
o.forEach(_1), t.els = [];
else {
const i = Xp(n, r);
i && o.includes(i) && (_1(i), t.els = o.filter((a) => a !== i));
}
}
function S1(e, t) {
e.push(t);
}
function M6(e, t, n, r, o, i, a, s, l) {
let c;
if (n === void 0 && (c = t.render(r), n = Wc(c)), l) {
l.adapter(n, c ?? t.render(r));
return;
}
s === void 0 && (s = document.head);
const d = Xp(n, s);
if (d !== null && !i)
return d;
const m = d ?? O6(n);
if (c === void 0 && (c = t.render(r)), m.textContent = c, d !== null)
return d;
if (a) {
const f = s.querySelector(`meta[name="${a}"]`);
if (f)
return s.insertBefore(m, f), S1(t.els, m), m;
}
return o ? s.insertBefore(m, s.querySelector("style, link")) : s.appendChild(m), S1(t.els, m), m;
}
function L6(e) {
return D6(this, this.instance, e);
}
function P6(e = {}) {
const { id: t, ssr: n, props: r, head: o = !1, force: i = !1, anchorMetaName: a, parent: s } = e;
return M6(this.instance, this, t, r, o, i, a, s, n);
}
function F6(e = {}) {
const { id: t, parent: n } = e;
k6(this.instance, this, t, n);
}
const Qd = function(e, t, n, r) {
return {
instance: e,
$: t,
props: n,
children: r,
els: [],
render: L6,
mount: P6,
unmount: F6
};
}, B6 = function(e, t, n, r) {
return Array.isArray(t) ? Qd(e, { $: null }, null, t) : Array.isArray(n) ? Qd(e, t, null, n) : Array.isArray(r) ? Qd(e, t, n, r) : Qd(e, t, n, null);
};
function dI(e = {}) {
const t = {
c: (...n) => B6(t, ...n),
use: (n, ...r) => n.install(t, ...r),
find: Xp,
context: {},
config: e
};
return t;
}
function U6(e, t) {
if (e === void 0)
return !1;
if (t) {
const { context: { ids: n } } = t;
return n.has(e);
}
return Xp(e) !== null;
}
const z6 = "n", Kc = `.${z6}-`, $6 = "__", H6 = "--", uI = dI(), pI = C6({
blockPrefix: Kc,
elementPrefix: $6,
modifierPrefix: H6
});
uI.use(pI);
const {
c: ue,
find: Wtt
} = uI, {
cB: X,
cE: ce,
cM: de,
cNotM: yn
} = pI;
function Ll(e) {
return ue(({
props: {
bPrefix: t
}
}) => `${t || Kc}modal, ${t || Kc}drawer`, [e]);
}
function vd(e) {
return ue(({
props: {
bPrefix: t
}
}) => `${t || Kc}popover`, [e]);
}
function mI(e) {
return ue(({
props: {
bPrefix: t
}
}) => `&${t || Kc}modal`, e);
}
const G6 = (...e) => ue(">", [X(...e)]);
function Qe(e, t) {
return e + (t === "default" ? "" : t.replace(/^[a-z]/, (n) => n.toUpperCase()));
}
let tp = [];
const fI = /* @__PURE__ */ new WeakMap();
function q6() {
tp.forEach((e) => e(...fI.get(e))), tp = [];
}
function np(e, ...t) {
fI.set(e, t), !tp.includes(e) && tp.push(e) === 1 && requestAnimationFrame(q6);
}
function ko(e, t) {
let { target: n } = e;
for (; n; ) {
if (n.dataset && n.dataset[t] !== void 0)
return !0;
n = n.parentElement;
}
return !1;
}
function Ss(e) {
return e.composedPath()[0] || null;
}
function Zo(e) {
return typeof e == "string" ? e.endsWith("px") ? Number(e.slice(0, e.length - 2)) : Number(e) : e;
}
function xr(e) {
if (e != null)
return typeof e == "number" ? `${e}px` : e.endsWith("px") ? e : `${e}px`;
}
function hr(e, t) {
const n = e.trim().split(/\s+/g), r = {
top: n[0]
};
switch (n.length) {
case 1:
r.right = n[0], r.bottom = n[0], r.left = n[0];
break;
case 2:
r.right = n[1], r.left = n[1], r.bottom = n[0];
break;
case 3:
r.right = n[1], r.bottom = n[2], r.left = n[1];
break;
case 4:
r.right = n[1], r.bottom = n[2], r.left = n[3];
break;
default:
throw new Error("[seemly/getMargin]:" + e + " is not a valid value.");
}
return t === void 0 ? r : r[t];
}
function Y6(e, t) {
const [n, r] = e.split(" ");
return t ? t === "row" ? n : r : {
row: n,
col: r || n
};
}
const v1 = {
aliceblue: "#F0F8FF",
antiquewhite: "#FAEBD7",
aqua: "#0FF",
aquamarine: "#7FFFD4",
azure: "#F0FFFF",
beige: "#F5F5DC",
bisque: "#FFE4C4",
black: "#000",
blanchedalmond: "#FFEBCD",
blue: "#00F",
blueviolet: "#8A2BE2",
brown: "#A52A2A",
burlywood: "#DEB887",
cadetblue: "#5F9EA0",
chartreuse: "#7FFF00",
chocolate: "#D2691E",
coral: "#FF7F50",
cornflowerblue: "#6495ED",
cornsilk: "#FFF8DC",
crimson: "#DC143C",
cyan: "#0FF",
darkblue: "#00008B",
darkcyan: "#008B8B",
darkgoldenrod: "#B8860B",
darkgray: "#A9A9A9",
darkgrey: "#A9A9A9",
darkgreen: "#006400",
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: "#F0F",
gainsboro: "#DCDCDC",
ghostwhite: "#F8F8FF",
gold: "#FFD700",
goldenrod: "#DAA520",
gray: "#808080",
grey: "#808080",
green: "#008000",
greenyellow: "#ADFF2F",
honeydew: "#F0FFF0",
hotpink: "#FF69B4",
indianred: "#CD5C5C",
indigo: "#4B0082",
ivory: "#FFFFF0",
khaki: "#F0E68C",
lavender: "#E6E6FA",
lavenderblush: "#FFF0F5",
lawngreen: "#7CFC00",
lemonchiffon: "#FFFACD",
lightblue: "#ADD8E6",
lightcoral: "#F08080",
lightcyan: "#E0FFFF",
lightgoldenrodyellow: "#FAFAD2",
lightgray: "#D3D3D3",
lightgrey: "#D3D3D3",
lightgreen: "#90EE90",
lightpink: "#FFB6C1",
lightsalmon: "#FFA07A",
lightseagreen: "#20B2AA",
lightskyblue: "#87CEFA",
lightslategray: "#778899",
lightslategrey: "#778899",
lightsteelblue: "#B0C4DE",
lightyellow: "#FFFFE0",
lime: "#0F0",
limegreen: "#32CD32",
linen: "#FAF0E6",
magenta: "#F0F",
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: "#F00",
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: "#FFF",
whitesmoke: "#F5F5F5",
yellow: "#FF0",
yellowgreen: "#9ACD32",
transparent: "#0000"
};
function V6(e, t, n) {
t /= 100, n /= 100;
let r = (o, i = (o + e / 60) % 6) => n - n * t * Math.max(Math.min(i, 4 - i, 1), 0);
return [r(5) * 255, r(3) * 255, r(1) * 255];
}
function W6(e, t, n) {
t /= 100, n /= 100;
let r = t * Math.min(n, 1 - n), o = (i, a = (i + e / 30) % 12) => n - r * Math.max(Math.min(a - 3, 9 - a, 1), -1);
return [o(0) * 255, o(8) * 255, o(4) * 255];
}
const Ii = "^\\s*", Di = "\\s*$", Da = "\\s*((\\.\\d+)|(\\d+(\\.\\d*)?))%\\s*", mo = "\\s*((\\.\\d+)|(\\d+(\\.\\d*)?))\\s*", is = "([0-9A-Fa-f])", as = "([0-9A-Fa-f]{2})", hI = new RegExp(`${Ii}hsl\\s*\\(${mo},${Da},${Da}\\)${Di}`), gI = new RegExp(`${Ii}hsv\\s*\\(${mo},${Da},${Da}\\)${Di}`), _I = new RegExp(`${Ii}hsla\\s*\\(${mo},${Da},${Da},${mo}\\)${Di}`), bI = new RegExp(`${Ii}hsva\\s*\\(${mo},${Da},${Da},${mo}\\)${Di}`), K6 = new RegExp(`${Ii}rgb\\s*\\(${mo},${mo},${mo}\\)${Di}`), Q6 = new RegExp(`${Ii}rgba\\s*\\(${mo},${mo},${mo},${mo}\\)${Di}`), j6 = new RegExp(`${Ii}#${is}${is}${is}${Di}`), X6 = new RegExp(`${Ii}#${as}${as}${as}${Di}`), Z6 = new RegExp(`${Ii}#${is}${is}${is}${is}${Di}`), J6 = new RegExp(`${Ii}#${as}${as}${as}${as}${Di}`);
function Kr(e) {
return parseInt(e, 16);
}
function eF(e) {
try {
let t;
if (t = _I.exec(e))
return [
rp(t[1]),
ya(t[5]),
ya(t[9]),
us(t[13])
];
if (t = hI.exec(e))
return [rp(t[1]), ya(t[5]), ya(t[9]), 1];
throw new Error(`[seemly/hsla]: Invalid color value ${e}.`);
} catch (t) {
throw t;
}
}
function tF(e) {
try {
let t;
if (t = bI.exec(e))
return [
rp(t[1]),
ya(t[5]),
ya(t[9]),
us(t[13])
];
if (t = gI.exec(e))
return [rp(t[1]), ya(t[5]), ya(t[9]), 1];
throw new Error(`[seemly/hsva]: Invalid color value ${e}.`);
} catch (t) {
throw t;
}
}
function ra(e) {
try {
let t;
if (t = X6.exec(e))
return [Kr(t[1]), Kr(t[2]), Kr(t[3]), 1];
if (t = K6.exec(e))
return [kr(t[1]), kr(t[5]), kr(t[9]), 1];
if (t = Q6.exec(e))
return [
kr(t[1]),
kr(t[5]),
kr(t[9]),
us(t[13])
];
if (t = j6.exec(e))
return [
Kr(t[1] + t[1]),
Kr(t[2] + t[2]),
Kr(t[3] + t[3]),
1
];
if (t = J6.exec(e))
return [
Kr(t[1]),
Kr(t[2]),
Kr(t[3]),
us(Kr(t[4]) / 255)
];
if (t = Z6.exec(e))
return [
Kr(t[1] + t[1]),
Kr(t[2] + t[2]),
Kr(t[3] + t[3]),
us(Kr(t[4] + t[4]) / 255)
];
if (e in v1)
return ra(v1[e]);
if (hI.test(e) || _I.test(e)) {
const [n, r, o, i] = eF(e);
return [...W6(n, r, o), i];
} else if (gI.test(e) || bI.test(e)) {
const [n, r, o, i] = tF(e);
return [...V6(n, r, o), i];
}
throw new Error(`[seemly/rgba]: Invalid color value ${e}.`);
} catch (t) {
throw t;
}
}
function nF(e) {
return e > 1 ? 1 : e < 0 ? 0 : e;
}
function Ub(e, t, n, r) {
return `rgba(${kr(e)}, ${kr(t)}, ${kr(n)}, ${nF(r)})`;
}
function Hf(e, t, n, r, o) {
return kr((e * t * (1 - r) + n * r) / o);
}
function yt(e, t) {
Array.isArray(e) || (e = ra(e)), Array.isArray(t) || (t = ra(t));
const n = e[3], r = t[3], o = us(n + r - n * r);
return Ub(Hf(e[0], n, t[0], r, o), Hf(e[1], n, t[1], r, o), Hf(e[2], n, t[2], r, o), o);
}
function Ke(e, t) {
const [n, r, o, i = 1] = Array.isArray(e) ? e : ra(e);
return typeof t.alpha == "number" ? Ub(n, r, o, t.alpha) : Ub(n, r, o, i);
}
function rr(e, t) {
const [n, r, o, i = 1] = Array.isArray(e) ? e : ra(e), { lightness: a = 1, alpha: s = 1 } = t;
return rF([n * a, r * a, o * a, i * s]);
}
function us(e) {
const t = Math.round(Number(e) * 100) / 100;
return t > 1 ? 1 : t < 0 ? 0 : t;
}
function rp(e) {
const t = Math.round(Number(e));
return t >= 360 || t < 0 ? 0 : t;
}
function kr(e) {
const t = Math.round(Number(e));
return t > 255 ? 255 : t < 0 ? 0 : t;
}
function ya(e) {
const t = Math.round(Number(e));
return t > 100 ? 100 : t < 0 ? 0 : t;
}
function rF(e) {
const [t, n, r] = e;
return 3 in e ? `rgba(${kr(t)}, ${kr(n)}, ${kr(r)}, ${us(e[3])})` : `rgba(${kr(t)}, ${kr(n)}, ${kr(r)}, 1)`;
}
function Pl(e = 8) {
return Math.random().toString(16).slice(2, 2 + e);
}
function oF(e, t) {
const n = [];
for (let r = 0; r < e; ++r)
n.push(t);
return n;
}
function wu(e) {
return e.composedPath()[0];
}
const iF = {
mousemoveoutside: /* @__PURE__ */ new WeakMap(),
clickoutside: /* @__PURE__ */ new WeakMap()
};
function aF(e, t, n) {
if (e === "mousemoveoutside") {
const r = (o) => {
t.contains(wu(o)) || n(o);
};
return {
mousemove: r,
touchstart: r
};
} else if (e === "clickoutside") {
let r = !1;
const o = (a) => {
r = !t.contains(wu(a));
}, i = (a) => {
r && (t.contains(wu(a)) || n(a));
};
return {
mousedown: o,
mouseup: i,
touchstart: o,
touchend: i
};
}
return console.error(
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
`[evtd/create-trap-handler]: name \`${e}\` is invalid. This could be a bug of evtd.`
), {};
}
function SI(e, t, n) {
const r = iF[e];
let o = r.get(t);
o === void 0 && r.set(t, o = /* @__PURE__ */ new WeakMap());
let i = o.get(n);
return i === void 0 && o.set(n, i = aF(e, t, n)), i;
}
function sF(e, t, n, r) {
if (e === "mousemoveoutside" || e === "clickoutside") {
const o = SI(e, t, n);
return Object.keys(o).forEach((i) => {
Sn(i, document, o[i], r);
}), !0;
}
return !1;
}
function lF(e, t, n, r) {
if (e === "mousemoveoutside" || e === "clickoutside") {
const o = SI(e, t, n);
return Object.keys(o).forEach((i) => {
gn(i, document, o[i], r);
}), !0;
}
return !1;
}
function cF() {
if (typeof window > "u")
return {
on: () => {
},
off: () => {
}
};
const e = /* @__PURE__ */ new WeakMap(), t = /* @__PURE__ */ new WeakMap();
function n() {
e.set(this, !0);
}
function r() {
e.set(this, !0), t.set(this, !0);
}
function o(x, k, M) {
const L = x[k];
return x[k] = function() {
return M.apply(x, arguments), L.apply(x, arguments);
}, x;
}
function i(x, k) {
x[k] = Event.prototype[k];
}
const a = /* @__PURE__ */ new WeakMap(), s = Object.getOwnPropertyDescriptor(Event.prototype, "currentTarget");
function l() {
var x;
return (x = a.get(this)) !== null && x !== void 0 ? x : null;
}
function c(x, k) {
s !== void 0 && Object.defineProperty(x, "currentTarget", {
configurable: !0,
enumerable: !0,
get: k ?? s.get
});
}
const d = {
bubble: {},
capture: {}
}, m = {};
function f() {
const x = function(k) {
const { type: M, eventPhase: L, bubbles: H } = k, W = wu(k);
if (L === 2)
return;
const J = L === 1 ? "capture" : "bubble";
let G = W;
const $ = [];
for (; G === null && (G = window), $.push(G), G !== window; )
G = G.parentNode || null;
const P = d.capture[M], Q = d.bubble[M];
if (o(k, "stopPropagation", n), o(k, "stopImmediatePropagation", r), c(k, l), J === "capture") {
if (P === void 0)
return;
for (let oe = $.length - 1; oe >= 0 && !e.has(k); --oe) {
const ie = $[oe], V = P.get(ie);
if (V !== void 0) {
a.set(k, ie);
for (const U of V) {
if (t.has(k))
break;
U(k);
}
}
if (oe === 0 && !H && Q !== void 0) {
const U = Q.get(ie);
if (U !== void 0)
for (const Z of U) {
if (t.has(k))
break;
Z(k);
}
}
}
} else if (J === "bubble") {
if (Q === void 0)
return;
for (let oe = 0; oe < $.length && !e.has(k); ++oe) {
const ie = $[oe], V = Q.get(ie);
if (V !== void 0) {
a.set(k, ie);
for (const U of V) {
if (t.has(k))
break;
U(k);
}
}
}
}
i(k, "stopPropagation"), i(k, "stopImmediatePropagation"), c(k);
};
return x.displayName = "evtdUnifiedHandler", x;
}
function g() {
const x = function(k) {
const { type: M, eventPhase: L } = k;
if (L !== 2)
return;
const H = m[M];
H !== void 0 && H.forEach((W) => W(k));
};
return x.displayName = "evtdUnifiedWindowEventHandler", x;
}
const _ = f(), b = g();
function S(x, k) {
const M = d[x];
return M[k] === void 0 && (M[k] = /* @__PURE__ */ new Map(), window.addEventListener(k, _, x === "capture")), M[k];
}
function E(x) {
return m[x] === void 0 && (m[x] = /* @__PURE__ */ new Set(), window.addEventListener(x, b)), m[x];
}
function y(x, k) {
let M = x.get(k);
return M === void 0 && x.set(k, M = /* @__PURE__ */ new Set()), M;
}
function A(x, k, M, L) {
const H = d[k][M];
if (H !== void 0) {
const W = H.get(x);
if (W !== void 0 && W.has(L))
return !0;
}
return !1;
}
function w(x, k) {
const M = m[x];
return !!(M !== void 0 && M.has(k));
}
function N(x, k, M, L) {
let H;
if (typeof L == "object" && L.once === !0 ? H = (P) => {
T(x, k, H, L), M(P);
} : H = M, sF(x, k, H, L))
return;
const J = L === !0 || typeof L == "object" && L.capture === !0 ? "capture" : "bubble", G = S(J, x), $ = y(G, k);
if ($.has(H) || $.add(H), k === window) {
const P = E(x);
P.has(H) || P.add(H);
}
}
function T(x, k, M, L) {
if (lF(x, k, M, L))
return;
const W = L === !0 || typeof L == "object" && L.capture === !0, J = W ? "capture" : "bubble", G = S(J, x), $ = y(G, k);
if (k === window && !A(k, W ? "bubble" : "capture", x, M) && w(x, M)) {
const Q = m[x];
Q.delete(M), Q.size === 0 && (window.removeEventListener(x, b), m[x] = void 0);
}
$.has(M) && $.delete(M), $.size === 0 && G.delete(k), G.size === 0 && (window.removeEventListener(x, _, J === "capture"), d[J][x] = void 0);
}
return {
on: N,
off: T
};
}
const { on: Sn, off: gn } = cF();
function dF(e) {
const t = ae(!!e.value);
if (t.value)
return Xo(t);
const n = Qt(e, (r) => {
r && (t.value = !0, n());
});
return Xo(t);
}
function Rn(e) {
const t = ee(e), n = ae(t.value);
return Qt(t, (r) => {
n.value = r;
}), typeof e == "function" ? n : {
__v_isRef: !0,
get value() {
return n.value;
},
set value(r) {
e.set(r);
}
};
}
function Zp() {
return ti() !== null;
}
const nv = typeof window < "u";
let fl, Lc;
const uF = () => {
var e, t;
fl = nv ? (t = (e = document) === null || e === void 0 ? void 0 : e.fonts) === null || t === void 0 ? void 0 : t.ready : void 0, Lc = !1, fl !== void 0 ? fl.then(() => {
Lc = !0;
}) : Lc = !0;
};
uF();
function vI(e) {
if (Lc)
return;
let t = !1;
Wn(() => {
Lc || fl == null || fl.then(() => {
t || e();
});
}), ir(() => {
t = !0;
});
}
const Nc = ae(null);
function E1(e) {
if (e.clientX > 0 || e.clientY > 0)
Nc.value = {
x: e.clientX,
y: e.clientY
};
else {
const { target: t } = e;
if (t instanceof Element) {
const { left: n, top: r, width: o, height: i } = t.getBoundingClientRect();
n > 0 || r > 0 ? Nc.value = {
x: n + o / 2,
y: r + i / 2
} : Nc.value = { x: 0, y: 0 };
} else
Nc.value = null;
}
}
let jd = 0, C1 = !0;
function EI() {
if (!nv)
return Xo(ae(null));
jd === 0 && Sn("click", document, E1, !0);
const e = () => {
jd += 1;
};
return C1 && (C1 = Zp()) ? (aa(e), ir(() => {
jd -= 1, jd === 0 && gn("click", document, E1, !0);
})) : e(), Xo(Nc);
}
const pF = ae(void 0);
let Xd = 0;
function y1() {
pF.value = Date.now();
}
let T1 = !0;
function CI(e) {
if (!nv)
return Xo(ae(!1));
const t = ae(!1);
let n = null;
function r() {
n !== null && window.clearTimeout(n);
}
function o() {
r(), t.value = !0, n = window.setTimeout(() => {
t.value = !1;
}, e);
}
Xd === 0 && Sn("click", window, y1, !0);
const i = () => {
Xd += 1, Sn("click", window, o, !0);
};
return T1 && (T1 = Zp()) ? (aa(i), ir(() => {
Xd -= 1, Xd === 0 && gn("click", window, y1, !0), gn("click", window, o, !0), r();
})) : i(), Xo(t);
}
let Zd = 0;
const mF = typeof window < "u" && window.matchMedia !== void 0, Oa = ae(null);
let Vo, ss;
function op(e) {
e.matches && (Oa.value = "dark");
}
function ip(e) {
e.matches && (Oa.value = "light");
}
function fF() {
Vo = window.matchMedia("(prefers-color-scheme: dark)"), ss = window.matchMedia("(prefers-color-scheme: light)"), Vo.matches ? Oa.value = "dark" : ss.matches ? Oa.value = "light" : Oa.value = null, Vo.addEventListener ? (Vo.addEventListener("change", op), ss.addEventListener("change", ip)) : Vo.addListener && (Vo.addListener(op), ss.addListener(ip));
}
function hF() {
"removeEventListener" in Vo ? (Vo.removeEventListener("change", op), ss.removeEventListener("change", ip)) : "removeListener" in Vo && (Vo.removeListener(op), ss.removeListener(ip)), Vo = void 0, ss = void 0;
}
let x1 = !0;
function gF() {
return process.env.NODE_ENV !== "test" && !mF ? Xo(Oa) : process.env.NODE_ENV === "test" && window.matchMedia === void 0 ? Xo(Oa) : (Zd === 0 && fF(), x1 && (x1 = Zp()) && (aa(() => {
Zd += 1;
}), ir(() => {
Zd -= 1, Zd === 0 && hF();
})), Xo(Oa));
}
function Or(e, t) {
return Qt(e, (n) => {
n !== void 0 && (t.value = n);
}), ee(() => e.value === void 0 ? t.value : e.value);
}
function Is() {
const e = ae(!1);
return Wn(() => {
e.value = !0;
}), Xo(e);
}
function ap(e, t) {
return ee(() => {
for (const n of t)
if (e[n] !== void 0)
return e[n];
return e[t[t.length - 1]];
});
}
const _F = (typeof window > "u" ? !1 : /iPad|iPhone|iPod/.test(navigator.platform) || navigator.platform === "MacIntel" && navigator.maxTouchPoints > 1) && // eslint-disable-next-line @typescript-eslint/strict-boolean-expressions
!window.MSStream;
function bF() {
return _F;
}
function SF(e = {}, t) {
const n = Sd({
ctrl: !1,
command: !1,
win: !1,
shift: !1,
tab: !1
}), { keydown: r, keyup: o } = e, i = (l) => {
switch (l.key) {
case "Control":
n.ctrl = !0;
break;
case "Meta":
n.command = !0, n.win = !0;
break;
case "Shift":
n.shift = !0;
break;
case "Tab":
n.tab = !0;
break;
}
r !== void 0 && Object.keys(r).forEach((c) => {
if (c !== l.key)
return;
const d = r[c];
if (typeof d == "function")
d(l);
else {
const { stop: m = !1, prevent: f = !1 } = d;
m && l.stopPropagation(), f && l.preventDefault(), d.handler(l);
}
});
}, a = (l) => {
switch (l.key) {
case "Control":
n.ctrl = !1;
break;
case "Meta":
n.command = !1, n.win = !1;
break;
case "Shift":
n.shift = !1;
break;
case "Tab":
n.tab = !1;
break;
}
o !== void 0 && Object.keys(o).forEach((c) => {
if (c !== l.key)
return;
const d = o[c];
if (typeof d == "function")
d(l);
else {
const { stop: m = !1, prevent: f = !1 } = d;
m && l.stopPropagation(), f && l.preventDefault(), d.handler(l);
}
});
}, s = () => {
(t === void 0 || t.value) && (Sn("keydown", document, i), Sn("keyup", document, a)), t !== void 0 && Qt(t, (l) => {
l ? (Sn("keydown", document, i), Sn("keyup", document, a)) : (gn("keydown", document, i), gn("keyup", document, a));
});
};
return Zp() ? (aa(s), ir(() => {
(t === void 0 || t.value) && (gn("keydown", document, i), gn("keyup", document, a));
})) : s(), Xo(n);
}
const rv = "n-internal-select-menu", yI = "n-internal-select-menu-body", Jp = "n-drawer-body", em = "n-modal-body", vF = "n-modal-provider", TI = "n-modal", Ed = "n-popover-body", xI = "__disabled__";
function ho(e) {
const t = at(em, null), n = at(Jp, null), r = at(Ed, null), o = at(yI, null), i = ae();
if (typeof document < "u") {
i.value = document.fullscreenElement;
const a = () => {
i.value = document.fullscreenElement;
};
Wn(() => {
Sn("fullscreenchange", document, a);
}), ir(() => {
gn("fullscreenchange", document, a);
});
}
return Rn(() => {
var a;
const {
to: s
} = e;
return s !== void 0 ? s === !1 ? xI : s === !0 ? i.value || "body" : s : t != null && t.value ? (a = t.value.$el) !== null && a !== void 0 ? a : t.value : n != null && n.value ? n.value : r != null && r.value ? r.value : o != null && o.value ? o.value : s ?? (i.value || "body");
});
}
ho.tdkey = xI;
ho.propTo = {
type: [String, Object, Boolean],
default: void 0
};
function EF(e, t, n) {
if (!t)
return e;
const r = ae(e.value);
let o = null;
return Qt(e, (i) => {
o !== null && window.clearTimeout(o), i === !0 ? n && !n.value ? r.value = !0 : o = window.setTimeout(() => {
r.value = !0;
}, t) : r.value = !1;
}), r;
}
const Ds = typeof document < "u" && typeof window < "u", ov = ae(!1);
function R1() {
ov.value = !0;
}
function A1() {
ov.value = !1;
}
let fc = 0;
function CF() {
return Ds && (aa(() => {
fc || (window.addEventListener("compositionstart", R1), window.addEventListener("compositionend", A1)), fc++;
}), ir(() => {
fc <= 1 ? (window.removeEventListener("compositionstart", R1), window.removeEventListener("compositionend", A1), fc = 0) : fc--;
})), ov;
}
let js = 0, O1 = "", w1 = "", N1 = "", I1 = "";
const D1 = ae("0px");
function yF(e) {
if (typeof document > "u")
return;
const t = document.documentElement;
let n, r = !1;
const o = () => {
t.style.marginRight = O1, t.style.overflow = w1, t.style.overflowX = N1, t.style.overflowY = I1, D1.value = "0px";
};
Wn(() => {
n = Qt(e, (i) => {
if (i) {
if (!js) {
const a = window.innerWidth - t.offsetWidth;
a > 0 && (O1 = t.style.marginRight, t.style.marginRight = `${a}px`, D1.value = `${a}px`), w1 = t.style.overflow, N1 = t.style.overflowX, I1 = t.style.overflowY, t.style.overflow = "hidden", t.style.overflowX = "hidden", t.style.overflowY = "hidden";
}
r = !0, js++;
} else
js--, js || o(), r = !1;
}, {
immediate: !0
});
}), ir(() => {
n == null || n(), r && (js--, js || o(), r = !1);
});
}
function iv(e) {
const t = {
isDeactivated: !1
};
let n = !1;
return tI(() => {
if (t.isDeactivated = !1, !n) {
n = !0;
return;
}
e();
}), JS(() => {
t.isDeactivated = !0, n || (n = !0);
}), t;
}
function zb(e, t, n = "default") {
const r = t[n];
if (r === void 0)
throw new Error(`[vueuc/${e}]: slot[${n}] is empty.`);
return r();
}
function $b(e, t = !0, n = []) {
return e.forEach((r) => {
if (r !== null) {
if (typeof r != "object") {
(typeof r == "string" || typeof r == "number") && n.push(Xn(String(r)));
return;
}
if (Array.isArray(r)) {
$b(r, t, n);
return;
}
if (r.type === rn) {
if (r.children === null)
return;
Array.isArray(r.children) && $b(r.children, t, n);
} else
r.type !== Wp && n.push(r);
}
}), n;
}
function k1(e, t, n = "default") {
const r = t[n];
if (r === void 0)
throw new Error(`[vueuc/${e}]: slot[${n}] is empty.`);
const o = $b(r());
if (o.length === 1)
return o[0];
throw new Error(`[vueuc/${e}]: slot[${n}] should have exactly one child.`);
}
let _a = null;
function RI() {
if (_a === null && (_a = document.getElementById("v-binder-view-measurer"), _a === null)) {
_a = document.createElement("div"), _a.id = "v-binder-view-measurer";
const { style: e } = _a;
e.position = "fixed", e.left = "0", e.right = "0", e.top = "0", e.bottom = "0", e.pointerEvents = "none", e.visibility = "hidden", document.body.appendChild(_a);
}
return _a.getBoundingClientRect();
}
function TF(e, t) {
const n = RI();
return {
top: t,
left: e,
height: 0,
width: 0,
right: n.width - e,
bottom: n.height - t
};
}
function Gf(e) {
const t = e.getBoundingClientRect(), n = RI();
return {
left: t.left - n.left,
top: t.top - n.top,
bottom: n.height + n.top - t.bottom,
right: n.width + n.left - t.right,
width: t.width,
height: t.height
};
}
function xF(e) {
return e.nodeType === 9 ? null : e.parentNode;
}
function AI(e) {
if (e === null)
return null;
const t = xF(e);
if (t === null)
return null;
if (t.nodeType === 9)
return document;
if (t.nodeType === 1) {
const { overflow: n, overflowX: r, overflowY: o } = getComputedStyle(t);
if (/(auto|scroll|overlay)/.test(n + o + r))
return t;
}
return AI(t);
}
const RF = Le({
name: "Binder",
props: {
syncTargetWithParent: Boolean,
syncTarget: {
type: Boolean,
default: !0
}
},
setup(e) {
var t;
Mt("VBinder", (t = ti()) === null || t === void 0 ? void 0 : t.proxy);
const n = at("VBinder", null), r = ae(null), o = (E) => {
r.value = E, n && e.syncTargetWithParent && n.setTargetRef(E);
};
let i = [];
const a = () => {
let E = r.value;
for (; E = AI(E), E !== null; )
i.push(E);
for (const y of i)
Sn("scroll", y, m, !0);
}, s = () => {
for (const E of i)
gn("scroll", E, m, !0);
i = [];
}, l = /* @__PURE__ */ new Set(), c = (E) => {
l.size === 0 && a(), l.has(E) || l.add(E);
}, d = (E) => {
l.has(E) && l.delete(E), l.size === 0 && s();
}, m = () => {
np(f);
}, f = () => {
l.forEach((E) => E());
}, g = /* @__PURE__ */ new Set(), _ = (E) => {
g.size === 0 && Sn("resize", window, S), g.has(E) || g.add(E);
}, b = (E) => {
g.has(E) && g.delete(E), g.size === 0 && gn("resize", window, S);
}, S = () => {
g.forEach((E) => E());
};
return ir(() => {
gn("resize", window, S), s();
}), {
targetRef: r,
setTargetRef: o,
addScrollListener: c,
removeScrollListener: d,
addResizeListener: _,
removeResizeListener: b
};
},
render() {
return zb("binder", this.$slots);
}
}), tm = RF, nm = Le({
name: "Target",
setup() {
const { setTargetRef: e, syncTarget: t } = at("VBinder");
return {
syncTarget: t,
setTargetDirective: {
mounted: e,
updated: e
}
};
},
render() {
const { syncTarget: e, setTargetDirective: t } = this;
return e ? Rr(k1("follower", this.$slots), [
[t]
]) : k1("follower", this.$slots);
}
}), Xs = "@@mmoContext", AF = {
mounted(e, { value: t }) {
e[Xs] = {
handler: void 0
}, typeof t == "function" && (e[Xs].handler = t, Sn("mousemoveoutside", e, t));
},
updated(e, { value: t }) {
const n = e[Xs];
typeof t == "function" ? n.handler ? n.handler !== t && (gn("mousemoveoutside", e, n.handler), n.handler = t, Sn("mousemoveoutside", e, t)) : (e[Xs].handler = t, Sn("mousemoveoutside", e, t)) : n.handler && (gn("mousemoveoutside", e, n.handler), n.handler = void 0);
},
unmounted(e) {
const { handler: t } = e[Xs];
t && gn("mousemoveoutside", e, t), e[Xs].handler = void 0;
}
}, OF = AF, Zs = "@@coContext", wF = {
mounted(e, { value: t, modifiers: n }) {
e[Zs] = {
handler: void 0
}, typeof t == "function" && (e[Zs].handler = t, Sn("clickoutside", e, t, {
capture: n.capture
}));
},
updated(e, { value: t, modifiers: n }) {
const r = e[Zs];
typeof t == "function" ? r.handler ? r.handler !== t && (gn("clickoutside", e, r.handler, {
capture: n.capture
}), r.handler = t, Sn("clickoutside", e, t, {
capture: n.capture
})) : (e[Zs].handler = t, Sn("clickoutside", e, t, {
capture: n.capture
})) : r.handler && (gn("clickoutside", e, r.handler, {
capture: n.capture
}), r.handler = void 0);
},
unmounted(e, { modifiers: t }) {
const { handler: n } = e[Zs];
n && gn("clickoutside", e, n, {
capture: t.capture
}), e[Zs].handler = void 0;
}
}, Sl = wF;
function NF(e, t) {
console.error(`[vdirs/${e}]: ${t}`);
}
class IF {
constructor() {
this.elementZIndex = /* @__PURE__ */ new Map(), this.nextZIndex = 2e3;
}
get elementCount() {
return this.elementZIndex.size;
}
ensureZIndex(t, n) {
const { elementZIndex: r } = this;
if (n !== void 0) {
t.style.zIndex = `${n}`, r.delete(t);
return;
}
const { nextZIndex: o } = this;
r.has(t) && r.get(t) + 1 === this.nextZIndex || (t.style.zIndex = `${o}`, r.set(t, o), this.nextZIndex = o + 1, this.squashState());
}
unregister(t, n) {
const { elementZIndex: r } = this;
r.has(t) ? r.delete(t) : n === void 0 && NF("z-index-manager/unregister-element", "Element not found when unregistering."), this.squashState();
}
squashState() {
const { elementCount: t } = this;
t || (this.nextZIndex = 2e3), this.nextZIndex - t > 2500 && this.rearrange();
}
rearrange() {
const t = Array.from(this.elementZIndex.entries());
t.sort((n, r) => n[1] - r[1]), this.nextZIndex = 2e3, t.forEach((n) => {
const r = n[0], o = this.nextZIndex++;
`${o}` !== r.style.zIndex && (r.style.zIndex = `${o}`);
});
}
}
const qf = new IF(), Js = "@@ziContext", DF = {
mounted(e, t) {
const { value: n = {} } = t, { zIndex: r, enabled: o } = n;
e[Js] = {
enabled: !!o,
initialized: !1
}, o && (qf.ensureZIndex(e, r), e[Js].initialized = !0);
},
updated(e, t) {
const { value: n = {} } = t, { zIndex: r, enabled: o } = n, i = e[Js].enabled;
o && !i && (qf.ensureZIndex(e, r), e[Js].initialized = !0), e[Js].enabled = !!o;
},
unmounted(e, t) {
if (!e[Js].initialized)
return;
const { value: n = {} } = t, { zIndex: r } = n;
qf.unregister(e, r);
}
}, av = DF, kF = "@css-render/vue3-ssr";
function MF(e, t) {
return `<style cssr-id="${e}">
${t}
</style>`;
}
function LF(e, t, n) {
const { styles: r, ids: o } = n;
o.has(e) || r !== null && (o.add(e), r.push(MF(e, t)));
}
const PF = typeof document < "u";
function Ba() {
if (PF)
return;
const e = at(kF, null);
if (e !== null)
return {
adapter: (t, n) => LF(t, n, e),
context: e
};
}
function M1(e, t) {
console.error(`[vueuc/${e}]: ${t}`);
}
const { c: vi } = dI(), rm = "vueuc-style";
function L1(e) {
return e & -e;
}
class OI {
/**
* @param l length of the array
* @param min min value of the array
*/
constructor(t, n) {
this.l = t, this.min = n;
const r = new Array(t + 1);
for (let o = 0; o < t + 1; ++o)
r[o] = 0;
this.ft = r;
}
/**
* Add arr[i] by n, start from 0
* @param i the index of the element to be added
* @param n the value to be added
*/
add(t, n) {
if (n === 0)
return;
const { l: r, ft: o } = this;
for (t += 1; t <= r; )
o[t] += n, t += L1(t);
}
/**
* Get the value of index i
* @param i index
* @returns value of the index
*/
get(t) {
return this.sum(t + 1) - this.sum(t);
}
/**
* Get the sum of first i elements
* @param i count of head elements to be added
* @returns the sum of first i elements
*/
sum(t) {
if (t === void 0 && (t = this.l), t <= 0)
return 0;
const { ft: n, min: r, l: o } = this;
if (t > o)
throw new Error("[FinweckTree.sum]: `i` is larger than length.");
let i = t * r;
for (; t > 0; )
i += n[t], t -= L1(t);
return i;
}
/**
* Get the largest count of head elements whose sum are <= threshold
* @param threshold
* @returns the largest count of head elements whose sum are <= threshold
*/
getBound(t) {
let n = 0, r = this.l;
for (; r > n; ) {
const o = Math.floor((n + r) / 2), i = this.sum(o);
if (i > t) {
r = o;
continue;
} else if (i < t) {
if (n === o)
return this.sum(n + 1) <= t ? n + 1 : o;
n = o;
} else
return o;
}
return n;
}
}
function P1(e) {
return typeof e == "string" ? document.querySelector(e) : e();
}
const wI = Le({
name: "LazyTeleport",
props: {
to: {
type: [String, Object],
default: void 0
},
disabled: Boolean,
show: {
type: Boolean,
required: !0
}
},
setup(e) {
return {
showTeleport: dF(rt(e, "show")),
mergedTo: ee(() => {
const { to: t } = e;
return t ?? "body";
})
};
},
render() {
return this.showTeleport ? this.disabled ? zb("lazy-teleport", this.$slots) : O(Kp, {
disabled: this.disabled,
to: this.mergedTo
}, zb("lazy-teleport", this.$slots)) : null;
}
}), Jd = {
top: "bottom",
bottom: "top",
left: "right",
right: "left"
}, F1 = {
start: "end",
center: "center",
end: "start"
}, Yf = {
top: "height",
bottom: "height",
left: "width",
right: "width"
}, FF = {
"bottom-start": "top left",
bottom: "top center",
"bottom-end": "top right",
"top-start": "bottom left",
top: "bottom center",
"top-end": "bottom right",
"right-start": "top left",
right: "center left",
"right-end": "bottom left",
"left-start": "top right",
left: "center right",
"left-end": "bottom right"
}, BF = {
"bottom-start": "bottom left",
bottom: "bottom center",
"bottom-end": "bottom right",
"top-start": "top left",
top: "top center",
"top-end": "top right",
"right-start": "top right",
right: "center right",
"right-end": "bottom right",
"left-start": "top left",
left: "center left",
"left-end": "bottom left"
}, UF = {
"bottom-start": "right",
"bottom-end": "left",
"top-start": "right",
"top-end": "left",
"right-start": "bottom",
"right-end": "top",
"left-start": "bottom",
"left-end": "top"
}, B1 = {
top: !0,
bottom: !1,
left: !0,
right: !1
// left--
}, U1 = {
top: "end",
bottom: "start",
left: "end",
right: "start"
};
function zF(e, t, n, r, o, i) {
if (!o || i)
return { placement: e, top: 0, left: 0 };
const [a, s] = e.split("-");
let l = s ?? "center", c = {
top: 0,
left: 0
};
const d = (g, _, b) => {
let S = 0, E = 0;
const y = n[g] - t[_] - t[g];
return y > 0 && r && (b ? E = B1[_] ? y : -y : S = B1[_] ? y : -y), {
left: S,
top: E
};
}, m = a === "left" || a === "right";
if (l !== "center") {
const g = UF[e], _ = Jd[g], b = Yf[g];
if (n[b] > t[b]) {
if (
// current space is not enough
// ----------[ target ]---------|
// -------[ follower ]
t[g] + t[b] < n[b]
) {
const S = (n[b] - t[b]) / 2;
t[g] < S || t[_] < S ? t[g] < t[_] ? (l = F1[s], c = d(b, _, m)) : c = d(b, g, m) : l = "center";
}
} else
n[b] < t[b] && t[_] < 0 && // opposite align has larger space
// ------------[ target ]
// ----------------[follower]
t[g] > t[_] && (l = F1[s]);
} else {
const g = a === "bottom" || a === "top" ? "left" : "top", _ = Jd[g], b = Yf[g], S = (n[b] - t[b]) / 2;
// center is not enough
// ----------- [ target ]--|
// -------[ follower ]
(t[g] < S || t[_] < S) && (t[g] > t[_] ? (l = U1[g], c = d(b, g, m)) : (l = U1[_], c = d(b, _, m)));
}
let f = a;
return (
// space is not enough
t[a] < n[Yf[a]] && // opposite position's space is larger
t[a] < t[Jd[a]] && (f = Jd[a]), {
placement: l !== "center" ? `${f}-${l}` : f,
left: c.left,
top: c.top
}
);
}
function $F(e, t) {
return t ? BF[e] : FF[e];
}
function HF(e, t, n, r, o, i) {
if (i)
switch (e) {
case "bottom-start":
return {
top: `${Math.round(n.top - t.top + n.height)}px`,
left: `${Math.round(n.left - t.left)}px`,
transform: "translateY(-100%)"
};
case "bottom-end":
return {
top: `${Math.round(n.top - t.top + n.height)}px`,
left: `${Math.round(n.left - t.left + n.width)}px`,
transform: "translateX(-100%) translateY(-100%)"
};
case "top-start":
return {
top: `${Math.round(n.top - t.top)}px`,
left: `${Math.round(n.left - t.left)}px`,
transform: ""
};
case "top-end":
return {
top: `${Math.round(n.top - t.top)}px`,
left: `${Math.round(n.left - t.left + n.width)}px`,
transform: "translateX(-100%)"
};
case "right-start":
return {
top: `${Math.round(n.top - t.top)}px`,
left: `${Math.round(n.left - t.left + n.width)}px`,
transform: "translateX(-100%)"
};
case "right-end":
return {
top: `${Math.round(n.top - t.top + n.height)}px`,
left: `${Math.round(n.left - t.left + n.width)}px`,
transform: "translateX(-100%) translateY(-100%)"
};
case "left-start":
return {
top: `${Math.round(n.top - t.top)}px`,
left: `${Math.round(n.left - t.left)}px`,
transform: ""
};
case "left-end":
return {
top: `${Math.round(n.top - t.top + n.height)}px`,
left: `${Math.round(n.left - t.left)}px`,
transform: "translateY(-100%)"
};
case "top":
return {
top: `${Math.round(n.top - t.top)}px`,
left: `${Math.round(n.left - t.left + n.width / 2)}px`,
transform: "translateX(-50%)"
};
case "right":
return {
top: `${Math.round(n.top - t.top + n.height / 2)}px`,
left: `${Math.round(n.left - t.left + n.