epic-designer-gold
Version:
基于vue3的设计器,可视化开发页面表单
1,886 lines (1,885 loc) • 1.31 MB
JavaScript
import { g as zn, c as je } from "./_commonjsHelpers-BVfed4GL.js";
import { r as He } from "./_vue_commonjs-external-NwvjgbHK.js";
import { ref as Te, readonly as Jt, watch as Da, computed as lt, getCurrentInstance as Sh, onMounted as jn, onBeforeUnmount as la, onBeforeMount as Du, reactive as dC, createTextVNode as uC, Fragment as fW, Comment as lC, defineComponent as ca, provide as vW, inject as ld, withDirectives as gW, h as Ke, Teleport as cC, toRef as _n, nextTick as pW, renderSlot as bW, mergeProps as mC, onActivated as hC, onDeactivated as fC } from "vue";
function Pu(e) {
return e.composedPath()[0];
}
const vC = {
mousemoveoutside: /* @__PURE__ */ new WeakMap(),
clickoutside: /* @__PURE__ */ new WeakMap()
};
function gC(e, n, a) {
if (e === "mousemoveoutside") {
const i = (o) => {
n.contains(Pu(o)) || a(o);
};
return {
mousemove: i,
touchstart: i
};
} else if (e === "clickoutside") {
let i = !1;
const o = (v) => {
i = !n.contains(Pu(v));
}, h = (v) => {
i && (n.contains(Pu(v)) || a(v));
};
return {
mousedown: o,
mouseup: h,
touchstart: o,
touchend: h
};
}
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 yW(e, n, a) {
const i = vC[e];
let o = i.get(n);
o === void 0 && i.set(n, o = /* @__PURE__ */ new WeakMap());
let h = o.get(a);
return h === void 0 && o.set(a, h = gC(e, n, a)), h;
}
function pC(e, n, a, i) {
if (e === "mousemoveoutside" || e === "clickoutside") {
const o = yW(e, n, a);
return Object.keys(o).forEach((h) => {
Nt(h, document, o[h], i);
}), !0;
}
return !1;
}
function bC(e, n, a, i) {
if (e === "mousemoveoutside" || e === "clickoutside") {
const o = yW(e, n, a);
return Object.keys(o).forEach((h) => {
pt(h, document, o[h], i);
}), !0;
}
return !1;
}
function yC() {
if (typeof window > "u")
return {
on: () => {
},
off: () => {
}
};
const e = /* @__PURE__ */ new WeakMap(), n = /* @__PURE__ */ new WeakMap();
function a() {
e.set(this, !0);
}
function i() {
e.set(this, !0), n.set(this, !0);
}
function o(L, A, G) {
const re = L[A];
return L[A] = function() {
return G.apply(L, arguments), re.apply(L, arguments);
}, L;
}
function h(L, A) {
L[A] = Event.prototype[A];
}
const v = /* @__PURE__ */ new WeakMap(), p = Object.getOwnPropertyDescriptor(Event.prototype, "currentTarget");
function w() {
var L;
return (L = v.get(this)) !== null && L !== void 0 ? L : null;
}
function b(L, A) {
p !== void 0 && Object.defineProperty(L, "currentTarget", {
configurable: !0,
enumerable: !0,
get: A ?? p.get
});
}
const $ = {
bubble: {},
capture: {}
}, T = {};
function D() {
const L = function(A) {
const { type: G, eventPhase: re, bubbles: ve } = A, Fe = Pu(A);
if (re === 2)
return;
const R = re === 1 ? "capture" : "bubble";
let X = Fe;
const te = [];
for (; X === null && (X = window), te.push(X), X !== window; )
X = X.parentNode || null;
const me = $.capture[G], le = $.bubble[G];
if (o(A, "stopPropagation", a), o(A, "stopImmediatePropagation", i), b(A, w), R === "capture") {
if (me === void 0)
return;
for (let de = te.length - 1; de >= 0 && !e.has(A); --de) {
const ge = te[de], Pe = me.get(ge);
if (Pe !== void 0) {
v.set(A, ge);
for (const ye of Pe) {
if (n.has(A))
break;
ye(A);
}
}
if (de === 0 && !ve && le !== void 0) {
const ye = le.get(ge);
if (ye !== void 0)
for (const bt of ye) {
if (n.has(A))
break;
bt(A);
}
}
}
} else if (R === "bubble") {
if (le === void 0)
return;
for (let de = 0; de < te.length && !e.has(A); ++de) {
const ge = te[de], Pe = le.get(ge);
if (Pe !== void 0) {
v.set(A, ge);
for (const ye of Pe) {
if (n.has(A))
break;
ye(A);
}
}
}
}
h(A, "stopPropagation"), h(A, "stopImmediatePropagation"), b(A);
};
return L.displayName = "evtdUnifiedHandler", L;
}
function N() {
const L = function(A) {
const { type: G, eventPhase: re } = A;
if (re !== 2)
return;
const ve = T[G];
ve !== void 0 && ve.forEach((Fe) => Fe(A));
};
return L.displayName = "evtdUnifiedWindowEventHandler", L;
}
const k = D(), H = N();
function z(L, A) {
const G = $[L];
return G[A] === void 0 && (G[A] = /* @__PURE__ */ new Map(), window.addEventListener(A, k, L === "capture")), G[A];
}
function _(L) {
return T[L] === void 0 && (T[L] = /* @__PURE__ */ new Set(), window.addEventListener(L, H)), T[L];
}
function B(L, A) {
let G = L.get(A);
return G === void 0 && L.set(A, G = /* @__PURE__ */ new Set()), G;
}
function K(L, A, G, re) {
const ve = $[A][G];
if (ve !== void 0) {
const Fe = ve.get(L);
if (Fe !== void 0 && Fe.has(re))
return !0;
}
return !1;
}
function se(L, A) {
const G = T[L];
return !!(G !== void 0 && G.has(A));
}
function we(L, A, G, re) {
let ve;
if (typeof re == "object" && re.once === !0 ? ve = (me) => {
_e(L, A, ve, re), G(me);
} : ve = G, pC(L, A, ve, re))
return;
const R = re === !0 || typeof re == "object" && re.capture === !0 ? "capture" : "bubble", X = z(R, L), te = B(X, A);
if (te.has(ve) || te.add(ve), A === window) {
const me = _(L);
me.has(ve) || me.add(ve);
}
}
function _e(L, A, G, re) {
if (bC(L, A, G, re))
return;
const Fe = re === !0 || typeof re == "object" && re.capture === !0, R = Fe ? "capture" : "bubble", X = z(R, L), te = B(X, A);
if (A === window && !K(A, Fe ? "bubble" : "capture", L, G) && se(L, G)) {
const le = T[L];
le.delete(G), le.size === 0 && (window.removeEventListener(L, H), T[L] = void 0);
}
te.has(G) && te.delete(G), te.size === 0 && X.delete(A), X.size === 0 && (window.removeEventListener(L, k, R === "capture"), $[R][L] = void 0);
}
return {
on: we,
off: _e
};
}
const { on: Nt, off: pt } = yC(), wC = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
off: pt,
on: Nt
}, Symbol.toStringTag, { value: "Module" })), PC = /* @__PURE__ */ zn(wC);
let ku = [];
const wW = /* @__PURE__ */ new WeakMap();
function MC() {
ku.forEach((e) => e(...wW.get(e))), ku = [];
}
function Lh(e, ...n) {
wW.set(e, n), !ku.includes(e) && ku.push(e) === 1 && requestAnimationFrame(MC);
}
let vh = [], gh = [];
function $C() {
vh.forEach((e, n) => e(...gh[n])), vh = [], gh = [];
}
function kC(e, ...n) {
vh.push(e) === 1 && requestAnimationFrame($C), gh.push(n);
}
function FC(e) {
return e.nodeType === 9 ? null : e.parentNode;
}
function PW(e) {
if (e === null)
return null;
const n = FC(e);
if (n === null)
return null;
if (n.nodeType === 9)
return document.documentElement;
if (n.nodeType === 1) {
const { overflow: a, overflowX: i, overflowY: o } = getComputedStyle(n);
if (/(auto|scroll|overlay)/.test(a + o + i))
return n;
}
return PW(n);
}
function _C(e) {
return typeof e == "string" ? document.querySelector(e) : typeof e == "function" ? e() : e;
}
function WC(e, n) {
let { target: a } = e;
for (; a; ) {
if (a.dataset && a.dataset[n] !== void 0)
return !0;
a = a.parentElement;
}
return !1;
}
function MW(e) {
return e.composedPath()[0] || null;
}
function $W(e) {
if (typeof e == "number")
return {
"": e.toString()
};
const n = {};
return e.split(/ +/).forEach((a) => {
if (a === "")
return;
const [i, o] = a.split(":");
o === void 0 ? n[""] = i : n[i] = o;
}), n;
}
function xC(e, n) {
var a;
if (e == null)
return;
const i = $W(e);
if (n === void 0)
return i[""];
if (typeof n == "string")
return (a = i[n]) !== null && a !== void 0 ? a : i[""];
if (Array.isArray(n)) {
for (let o = n.length - 1; o >= 0; --o) {
const h = n[o];
if (h in i)
return i[h];
}
return i[""];
} else {
let o, h = -1;
return Object.keys(i).forEach((v) => {
const p = Number(v);
!Number.isNaN(p) && n >= p && p >= h && (h = p, o = i[v]);
}), o;
}
}
function ph(e) {
return typeof e == "string" ? e.endsWith("px") ? Number(e.slice(0, e.length - 2)) : Number(e) : e;
}
function Un(e) {
if (e != null)
return typeof e == "number" ? `${e}px` : e.endsWith("px") ? e : `${e}px`;
}
function AF(e, n) {
const a = e.trim().split(/\s+/g), i = {
top: a[0]
};
switch (a.length) {
case 1:
i.right = a[0], i.bottom = a[0], i.left = a[0];
break;
case 2:
i.right = a[1], i.left = a[1], i.bottom = a[0];
break;
case 3:
i.right = a[1], i.bottom = a[2], i.left = a[1];
break;
case 4:
i.right = a[1], i.bottom = a[2], i.left = a[3];
break;
default:
throw new Error("[seemly/getMargin]:" + e + " is not a valid value.");
}
return n === void 0 ? i : i[n];
}
function DC(e, n) {
const [a, i] = e.split(" ");
return n ? n === "row" ? a : i : {
row: a,
col: i || a
};
}
const HF = {
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 zC(e, n, a) {
n /= 100, a /= 100;
const i = n * Math.min(a, 1 - a) + a;
return [e, i ? (2 - 2 * a / i) * 100 : 0, i * 100];
}
function jC(e, n, a) {
n /= 100, a /= 100;
const i = a - a * n / 2, o = Math.min(i, 1 - i);
return [e, o ? (a - i) / o * 100 : 0, i * 100];
}
function kW(e, n, a) {
n /= 100, a /= 100;
let i = (o, h = (o + e / 60) % 6) => a - a * n * Math.max(Math.min(h, 4 - h, 1), 0);
return [i(5) * 255, i(3) * 255, i(1) * 255];
}
function TC(e, n, a) {
e /= 255, n /= 255, a /= 255;
let i = Math.max(e, n, a), o = i - Math.min(e, n, a), h = o && (i == e ? (n - a) / o : i == n ? 2 + (a - e) / o : 4 + (e - n) / o);
return [60 * (h < 0 ? h + 6 : h), i && o / i * 100, i * 100];
}
function SC(e, n, a) {
e /= 255, n /= 255, a /= 255;
let i = Math.max(e, n, a), o = i - Math.min(e, n, a), h = 1 - Math.abs(i + i - o - 1), v = o && (i == e ? (n - a) / o : i == n ? 2 + (a - e) / o : 4 + (e - n) / o);
return [60 * (v < 0 ? v + 6 : v), h ? o / h * 100 : 0, (i + i - o) * 50];
}
function FW(e, n, a) {
n /= 100, a /= 100;
let i = n * Math.min(a, 1 - a), o = (h, v = (h + e / 30) % 12) => a - i * Math.max(Math.min(v - 3, 9 - v, 1), -1);
return [o(0) * 255, o(8) * 255, o(4) * 255];
}
const ma = "^\\s*", ha = "\\s*$", Ya = "\\s*((\\.\\d+)|(\\d+(\\.\\d*)?))%\\s*", _t = "\\s*((\\.\\d+)|(\\d+(\\.\\d*)?))\\s*", Mn = "([0-9A-Fa-f])", $n = "([0-9A-Fa-f]{2})", _W = new RegExp(`${ma}hsl\\s*\\(${_t},${Ya},${Ya}\\)${ha}`), WW = new RegExp(`${ma}hsv\\s*\\(${_t},${Ya},${Ya}\\)${ha}`), xW = new RegExp(`${ma}hsla\\s*\\(${_t},${Ya},${Ya},${_t}\\)${ha}`), DW = new RegExp(`${ma}hsva\\s*\\(${_t},${Ya},${Ya},${_t}\\)${ha}`), LC = new RegExp(`${ma}rgb\\s*\\(${_t},${_t},${_t}\\)${ha}`), CC = new RegExp(`${ma}rgba\\s*\\(${_t},${_t},${_t},${_t}\\)${ha}`), Ch = new RegExp(`${ma}#${Mn}${Mn}${Mn}${ha}`), Eh = new RegExp(`${ma}#${$n}${$n}${$n}${ha}`), Oh = new RegExp(`${ma}#${Mn}${Mn}${Mn}${Mn}${ha}`), Nh = new RegExp(`${ma}#${$n}${$n}${$n}${$n}${ha}`);
function vt(e) {
return parseInt(e, 16);
}
function zW(e) {
try {
let n;
if (n = xW.exec(e))
return [
Zt(n[1]),
Ae(n[5]),
Ae(n[9]),
ua(n[13])
];
if (n = _W.exec(e))
return [Zt(n[1]), Ae(n[5]), Ae(n[9]), 1];
throw new Error(`[seemly/hsla]: Invalid color value ${e}.`);
} catch (n) {
throw n;
}
}
function jW(e) {
try {
let n;
if (n = DW.exec(e))
return [
Zt(n[1]),
Ae(n[5]),
Ae(n[9]),
ua(n[13])
];
if (n = WW.exec(e))
return [Zt(n[1]), Ae(n[5]), Ae(n[9]), 1];
throw new Error(`[seemly/hsva]: Invalid color value ${e}.`);
} catch (n) {
throw n;
}
}
function Ba(e) {
try {
let n;
if (n = Eh.exec(e))
return [vt(n[1]), vt(n[2]), vt(n[3]), 1];
if (n = LC.exec(e))
return [Ce(n[1]), Ce(n[5]), Ce(n[9]), 1];
if (n = CC.exec(e))
return [
Ce(n[1]),
Ce(n[5]),
Ce(n[9]),
ua(n[13])
];
if (n = Ch.exec(e))
return [
vt(n[1] + n[1]),
vt(n[2] + n[2]),
vt(n[3] + n[3]),
1
];
if (n = Nh.exec(e))
return [
vt(n[1]),
vt(n[2]),
vt(n[3]),
ua(vt(n[4]) / 255)
];
if (n = Oh.exec(e))
return [
vt(n[1] + n[1]),
vt(n[2] + n[2]),
vt(n[3] + n[3]),
ua(vt(n[4] + n[4]) / 255)
];
if (e in HF)
return Ba(HF[e]);
if (_W.test(e) || xW.test(e)) {
const [a, i, o, h] = zW(e);
return [...FW(a, i, o), h];
} else if (WW.test(e) || DW.test(e)) {
const [a, i, o, h] = jW(e);
return [...kW(a, i, o), h];
}
throw new Error(`[seemly/rgba]: Invalid color value ${e}.`);
} catch (n) {
throw n;
}
}
function EC(e) {
return e > 1 ? 1 : e < 0 ? 0 : e;
}
function OC(e, n, a) {
return `rgb(${Ce(e)}, ${Ce(n)}, ${Ce(a)})`;
}
function bh(e, n, a, i) {
return `rgba(${Ce(e)}, ${Ce(n)}, ${Ce(a)}, ${EC(i)})`;
}
function uc(e, n, a, i, o) {
return Ce((e * n * (1 - i) + a * i) / o);
}
function NC(e, n) {
Array.isArray(e) || (e = Ba(e)), Array.isArray(n) || (n = Ba(n));
const a = e[3], i = n[3], o = ua(a + i - a * i);
return bh(uc(e[0], a, n[0], i, o), uc(e[1], a, n[1], i, o), uc(e[2], a, n[2], i, o), o);
}
function AC(e, n) {
const [a, i, o, h = 1] = Array.isArray(e) ? e : Ba(e);
return typeof n.alpha == "number" ? bh(a, i, o, n.alpha) : bh(a, i, o, h);
}
function HC(e, n) {
const [a, i, o, h = 1] = Array.isArray(e) ? e : Ba(e), { lightness: v = 1, alpha: p = 1 } = n;
return SW([a * v, i * v, o * v, h * p]);
}
function TW(e) {
var n;
return (n = (Array.isArray(e) ? e : Ba(e))[3]) !== null && n !== void 0 ? n : 1;
}
function RC(e) {
return `${TW(e)}`;
}
function ua(e) {
const n = Math.round(Number(e) * 100) / 100;
return n > 1 ? 1 : n < 0 ? 0 : n;
}
function Zt(e) {
const n = Math.round(Number(e));
return n >= 360 || n < 0 ? 0 : n;
}
function Ce(e) {
const n = Math.round(Number(e));
return n > 255 ? 255 : n < 0 ? 0 : n;
}
function Ae(e) {
const n = Math.round(Number(e));
return n > 100 ? 100 : n < 0 ? 0 : n;
}
function IC(e) {
const [n, a, i] = Array.isArray(e) ? e : Ba(e);
return OC(n, a, i);
}
function SW(e) {
const [n, a, i] = e;
return 3 in e ? `rgba(${Ce(n)}, ${Ce(a)}, ${Ce(i)}, ${ua(e[3])})` : `rgba(${Ce(n)}, ${Ce(a)}, ${Ce(i)}, 1)`;
}
function VC(e) {
return `hsv(${Zt(e[0])}, ${Ae(e[1])}%, ${Ae(e[2])}%)`;
}
function XC(e) {
const [n, a, i] = e;
return 3 in e ? `hsva(${Zt(n)}, ${Ae(a)}%, ${Ae(i)}%, ${ua(e[3])})` : `hsva(${Zt(n)}, ${Ae(a)}%, ${Ae(i)}%, 1)`;
}
function qC(e) {
return `hsl(${Zt(e[0])}, ${Ae(e[1])}%, ${Ae(e[2])}%)`;
}
function YC(e) {
const [n, a, i] = e;
return 3 in e ? `hsla(${Zt(n)}, ${Ae(a)}%, ${Ae(i)}%, ${ua(e[3])})` : `hsla(${Zt(n)}, ${Ae(a)}%, ${Ae(i)}%, 1)`;
}
function BC(e) {
if (typeof e == "string") {
let i;
if (i = Eh.exec(e))
return `${i[0]}FF`;
if (i = Nh.exec(e))
return i[0];
if (i = Ch.exec(e))
return `#${i[1]}${i[1]}${i[2]}${i[2]}${i[3]}${i[3]}FF`;
if (i = Oh.exec(e))
return `#${i[1]}${i[1]}${i[2]}${i[2]}${i[3]}${i[3]}${i[4]}${i[4]}`;
throw new Error(`[seemly/toHexString]: Invalid hex value ${e}.`);
}
const n = `#${e.slice(0, 3).map((i) => Ce(i).toString(16).toUpperCase().padStart(2, "0")).join("")}`, a = e.length === 3 ? "FF" : Ce(e[3] * 255).toString(16).padStart(2, "0").toUpperCase();
return n + a;
}
function KC(e) {
if (typeof e == "string") {
let n;
if (n = Eh.exec(e))
return n[0];
if (n = Nh.exec(e))
return n[0].slice(0, 7);
if (n = Ch.exec(e) || Oh.exec(e))
return `#${n[1]}${n[1]}${n[2]}${n[2]}${n[3]}${n[3]}`;
throw new Error(`[seemly/toHexString]: Invalid hex value ${e}.`);
}
return `#${e.slice(0, 3).map((n) => Ce(n).toString(16).toUpperCase().padStart(2, "0")).join("")}`;
}
function LW(e = 8) {
return Math.random().toString(16).slice(2, 2 + e);
}
function GC(e, n) {
const a = [];
for (let i = 0; i < e; ++i)
a.push(n);
return a;
}
function QC(e, n) {
const a = [];
if (!n) {
for (let i = 0; i < e; ++i)
a.push(i);
return a;
}
for (let i = 0; i < e; ++i)
a.push(n(i));
return a;
}
async function JC(e) {
return new Promise((n) => {
setTimeout(n, e);
});
}
const ZC = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
beforeNextFrame: kC,
beforeNextFrameOnce: Lh,
changeColor: AC,
composite: NC,
createId: LW,
depx: ph,
getAlpha: TW,
getAlphaString: RC,
getGap: DC,
getMargin: AF,
getPadding: AF,
getPreciseEventTarget: MW,
getScrollParent: PW,
happensIn: WC,
hsl2hsv: zC,
hsl2rgb: FW,
hsla: zW,
hsv2hsl: jC,
hsv2rgb: kW,
hsva: jW,
indexMap: QC,
parseResponsiveProp: $W,
parseResponsivePropValue: xC,
pxfy: Un,
repeat: GC,
rgb2hsl: SC,
rgb2hsv: TC,
rgba: Ba,
roundAlpha: ua,
roundChannel: Ce,
roundDeg: Zt,
roundPercent: Ae,
scaleColor: HC,
sleep: JC,
toHexString: KC,
toHexaString: BC,
toHslString: qC,
toHslaString: YC,
toHsvString: VC,
toHsvaString: XC,
toRgbString: IC,
toRgbaString: SW,
unwrapElement: _C
}, Symbol.toStringTag, { value: "Module" })), Ah = /* @__PURE__ */ zn(ZC);
function CW(e) {
const n = Te(!!e.value);
if (n.value)
return Jt(n);
const a = Da(e, (i) => {
i && (n.value = !0, a());
});
return Jt(n);
}
function Dn(e) {
const n = lt(e), a = Te(n.value);
return Da(n, (i) => {
a.value = i;
}), typeof e == "function" ? a : {
__v_isRef: !0,
get value() {
return a.value;
},
set value(i) {
e.set(i);
}
};
}
function zu() {
return Sh() !== null;
}
const cd = typeof window < "u";
let er, od;
const UC = () => {
var e, n;
er = cd ? (n = (e = document) === null || e === void 0 ? void 0 : e.fonts) === null || n === void 0 ? void 0 : n.ready : void 0, od = !1, er !== void 0 ? er.then(() => {
od = !0;
}) : od = !0;
};
UC();
function EW(e) {
if (od)
return;
let n = !1;
jn(() => {
od || er == null || er.then(() => {
n || e();
});
}), la(() => {
n = !0;
});
}
const id = Te(null);
function RF(e) {
if (e.clientX > 0 || e.clientY > 0)
id.value = {
x: e.clientX,
y: e.clientY
};
else {
const { target: n } = e;
if (n instanceof Element) {
const { left: a, top: i, width: o, height: h } = n.getBoundingClientRect();
a > 0 || i > 0 ? id.value = {
x: a + o / 2,
y: i + h / 2
} : id.value = { x: 0, y: 0 };
} else
id.value = null;
}
}
let du = 0, IF = !0;
function eE() {
if (!cd)
return Jt(Te(null));
du === 0 && Nt("click", document, RF, !0);
const e = () => {
du += 1;
};
return IF && (IF = zu()) ? (Du(e), la(() => {
du -= 1, du === 0 && pt("click", document, RF, !0);
})) : e(), Jt(id);
}
const tE = Te(void 0);
let uu = 0;
function VF() {
tE.value = Date.now();
}
let XF = !0;
function aE(e) {
if (!cd)
return Jt(Te(!1));
const n = Te(!1);
let a = null;
function i() {
a !== null && window.clearTimeout(a);
}
function o() {
i(), n.value = !0, a = window.setTimeout(() => {
n.value = !1;
}, e);
}
uu === 0 && Nt("click", window, VF, !0);
const h = () => {
uu += 1, Nt("click", window, o, !0);
};
return XF && (XF = zu()) ? (Du(h), la(() => {
uu -= 1, uu === 0 && pt("click", window, VF, !0), pt("click", window, o, !0), i();
})) : h(), Jt(n);
}
let lu = 0;
const nE = typeof window < "u" && window.matchMedia !== void 0, Xa = Te(null);
let Qt, kn;
function Fu(e) {
e.matches && (Xa.value = "dark");
}
function _u(e) {
e.matches && (Xa.value = "light");
}
function rE() {
Qt = window.matchMedia("(prefers-color-scheme: dark)"), kn = window.matchMedia("(prefers-color-scheme: light)"), Qt.matches ? Xa.value = "dark" : kn.matches ? Xa.value = "light" : Xa.value = null, Qt.addEventListener ? (Qt.addEventListener("change", Fu), kn.addEventListener("change", _u)) : Qt.addListener && (Qt.addListener(Fu), kn.addListener(_u));
}
function iE() {
"removeEventListener" in Qt ? (Qt.removeEventListener("change", Fu), kn.removeEventListener("change", _u)) : "removeListener" in Qt && (Qt.removeListener(Fu), kn.removeListener(_u)), Qt = void 0, kn = void 0;
}
let qF = !0;
function oE() {
return process.env.NODE_ENV !== "test" && !nE ? Jt(Xa) : process.env.NODE_ENV === "test" && window.matchMedia === void 0 ? Jt(Xa) : (lu === 0 && rE(), qF && (qF = zu()) && (Du(() => {
lu += 1;
}), la(() => {
lu -= 1, lu === 0 && iE();
})), Jt(Xa));
}
function sE(e, n) {
return Da(e, (a) => {
a !== void 0 && (n.value = a);
}), lt(() => e.value === void 0 ? n.value : e.value);
}
function OW() {
const e = Te(!1);
return jn(() => {
e.value = !0;
}), Jt(e);
}
function dE(e, n) {
return lt(() => {
for (const a of n)
if (e[a] !== void 0)
return e[a];
return e[n[n.length - 1]];
});
}
const NW = (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 uE() {
return NW;
}
const lE = {
// mobile
// 0 ~ 640 doesn't mean it should display well in all the range,
// but means you should treat it like a mobile phone.)
xs: 0,
s: 640,
m: 1024,
l: 1280,
xl: 1536,
"2xl": 1920
// normal desktop display
};
function cE(e) {
return `(min-width: ${e}px)`;
}
const Ir = {};
function yh(e = lE) {
if (!cd)
return lt(() => []);
if (typeof window.matchMedia != "function")
return lt(() => []);
const n = Te({}), a = Object.keys(e), i = (o, h) => {
o.matches ? n.value[h] = !0 : n.value[h] = !1;
};
return a.forEach((o) => {
const h = e[o];
let v, p;
Ir[h] === void 0 ? (v = window.matchMedia(cE(h)), v.addEventListener ? v.addEventListener("change", (w) => {
p.forEach((b) => {
b(w, o);
});
}) : v.addListener && v.addListener((w) => {
p.forEach((b) => {
b(w, o);
});
}), p = /* @__PURE__ */ new Set(), Ir[h] = {
mql: v,
cbs: p
}) : (v = Ir[h].mql, p = Ir[h].cbs), p.add(i), v.matches && p.forEach((w) => {
w(v, o);
});
}), la(() => {
a.forEach((o) => {
const { cbs: h } = Ir[e[o]];
h.has(i) && h.delete(i);
});
}), lt(() => {
const { value: o } = n;
return a.filter((h) => o[h]);
});
}
function mE(e) {
if (!cd)
return lt(() => {
});
const n = e !== void 0 ? yh(e) : yh();
return lt(() => {
const { value: a } = n;
if (a.length !== 0)
return a[a.length - 1];
});
}
function hE(e = {}, n) {
const a = dC({
ctrl: !1,
command: !1,
win: !1,
shift: !1,
tab: !1
}), { keydown: i, keyup: o } = e, h = (w) => {
switch (w.key) {
case "Control":
a.ctrl = !0;
break;
case "Meta":
a.command = !0, a.win = !0;
break;
case "Shift":
a.shift = !0;
break;
case "Tab":
a.tab = !0;
break;
}
i !== void 0 && Object.keys(i).forEach((b) => {
if (b !== w.key)
return;
const $ = i[b];
if (typeof $ == "function")
$(w);
else {
const { stop: T = !1, prevent: D = !1 } = $;
T && w.stopPropagation(), D && w.preventDefault(), $.handler(w);
}
});
}, v = (w) => {
switch (w.key) {
case "Control":
a.ctrl = !1;
break;
case "Meta":
a.command = !1, a.win = !1;
break;
case "Shift":
a.shift = !1;
break;
case "Tab":
a.tab = !1;
break;
}
o !== void 0 && Object.keys(o).forEach((b) => {
if (b !== w.key)
return;
const $ = o[b];
if (typeof $ == "function")
$(w);
else {
const { stop: T = !1, prevent: D = !1 } = $;
T && w.stopPropagation(), D && w.preventDefault(), $.handler(w);
}
});
}, p = () => {
(n === void 0 || n.value) && (Nt("keydown", document, h), Nt("keyup", document, v)), n !== void 0 && Da(n, (w) => {
w ? (Nt("keydown", document, h), Nt("keyup", document, v)) : (pt("keydown", document, h), pt("keyup", document, v));
});
};
return zu() ? (Du(p), la(() => {
(n === void 0 || n.value) && (pt("keydown", document, h), pt("keyup", document, v));
})) : p(), Jt(a);
}
const fE = typeof window > "u" ? !1 : NW || window.safari !== void 0;
function vE() {
return fE;
}
const gE = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
onFontsReady: EW,
useBreakpoint: mE,
useBreakpoints: yh,
useClickPosition: eE,
useClicked: aE,
useCompitable: dE,
useFalseUntilTruthy: CW,
useIsIos: uE,
useIsMounted: OW,
useIsSafari: vE,
useKeyboard: hE,
useMemo: Dn,
useMergedState: sE,
useOsTheme: oE
}, Symbol.toStringTag, { value: "Module" })), pE = /* @__PURE__ */ zn(gE);
function wh(e, n, a = "default") {
const i = n[a];
if (i === void 0)
throw new Error(`[vueuc/${e}]: slot[${a}] is empty.`);
return i();
}
function Ph(e, n = !0, a = []) {
return e.forEach((i) => {
if (i !== null) {
if (typeof i != "object") {
(typeof i == "string" || typeof i == "number") && a.push(uC(String(i)));
return;
}
if (Array.isArray(i)) {
Ph(i, n, a);
return;
}
if (i.type === fW) {
if (i.children === null)
return;
Array.isArray(i.children) && Ph(i.children, n, a);
} else i.type !== lC && a.push(i);
}
}), a;
}
function YF(e, n, a = "default") {
const i = n[a];
if (i === void 0)
throw new Error(`[vueuc/${e}]: slot[${a}] is empty.`);
const o = Ph(i());
if (o.length === 1)
return o[0];
throw new Error(`[vueuc/${e}]: slot[${a}] should have exactly one child.`);
}
let Ia = null;
function AW() {
if (Ia === null && (Ia = document.getElementById("v-binder-view-measurer"), Ia === null)) {
Ia = document.createElement("div"), Ia.id = "v-binder-view-measurer";
const { style: e } = Ia;
e.position = "fixed", e.left = "0", e.right = "0", e.top = "0", e.bottom = "0", e.pointerEvents = "none", e.visibility = "hidden", document.body.appendChild(Ia);
}
return Ia.getBoundingClientRect();
}
function bE(e, n) {
const a = AW();
return {
top: n,
left: e,
height: 0,
width: 0,
right: a.width - e,
bottom: a.height - n
};
}
function lc(e) {
const n = e.getBoundingClientRect(), a = AW();
return {
left: n.left - a.left,
top: n.top - a.top,
bottom: a.height + a.top - n.bottom,
right: a.width + a.left - n.right,
width: n.width,
height: n.height
};
}
function yE(e) {
return e.nodeType === 9 ? null : e.parentNode;
}
function HW(e) {
if (e === null)
return null;
const n = yE(e);
if (n === null)
return null;
if (n.nodeType === 9)
return document;
if (n.nodeType === 1) {
const { overflow: a, overflowX: i, overflowY: o } = getComputedStyle(n);
if (/(auto|scroll|overlay)/.test(a + o + i))
return n;
}
return HW(n);
}
const BF = ca({
name: "Binder",
props: {
syncTargetWithParent: Boolean,
syncTarget: {
type: Boolean,
default: !0
}
},
setup(e) {
var n;
vW("VBinder", (n = Sh()) === null || n === void 0 ? void 0 : n.proxy);
const a = ld("VBinder", null), i = Te(null), o = (_) => {
i.value = _, a && e.syncTargetWithParent && a.setTargetRef(_);
};
let h = [];
const v = () => {
let _ = i.value;
for (; _ = HW(_), _ !== null; )
h.push(_);
for (const B of h)
Nt("scroll", B, T, !0);
}, p = () => {
for (const _ of h)
pt("scroll", _, T, !0);
h = [];
}, w = /* @__PURE__ */ new Set(), b = (_) => {
w.size === 0 && v(), w.has(_) || w.add(_);
}, $ = (_) => {
w.has(_) && w.delete(_), w.size === 0 && p();
}, T = () => {
Lh(D);
}, D = () => {
w.forEach((_) => _());
}, N = /* @__PURE__ */ new Set(), k = (_) => {
N.size === 0 && Nt("resize", window, z), N.has(_) || N.add(_);
}, H = (_) => {
N.has(_) && N.delete(_), N.size === 0 && pt("resize", window, z);
}, z = () => {
N.forEach((_) => _());
};
return la(() => {
pt("resize", window, z), p();
}), {
targetRef: i,
setTargetRef: o,
addScrollListener: b,
removeScrollListener: $,
addResizeListener: k,
removeResizeListener: H
};
},
render() {
return wh("binder", this.$slots);
}
}), KF = ca({
name: "Target",
setup() {
const { setTargetRef: e, syncTarget: n } = ld("VBinder");
return {
syncTarget: n,
setTargetDirective: {
mounted: e,
updated: e
}
};
},
render() {
const { syncTarget: e, setTargetDirective: n } = this;
return e ? gW(YF("follower", this.$slots), [
[n]
]) : YF("follower", this.$slots);
}
});
function wE(e, n) {
console.error(`[vdirs/${e}]: ${n}`);
}
class PE {
constructor() {
this.elementZIndex = /* @__PURE__ */ new Map(), this.nextZIndex = 2e3;
}
get elementCount() {
return this.elementZIndex.size;
}
ensureZIndex(n, a) {
const { elementZIndex: i } = this;
if (a !== void 0) {
n.style.zIndex = `${a}`, i.delete(n);
return;
}
const { nextZIndex: o } = this;
i.has(n) && i.get(n) + 1 === this.nextZIndex || (n.style.zIndex = `${o}`, i.set(n, o), this.nextZIndex = o + 1, this.squashState());
}
unregister(n, a) {
const { elementZIndex: i } = this;
i.has(n) ? i.delete(n) : a === void 0 && wE("z-index-manager/unregister-element", "Element not found when unregistering."), this.squashState();
}
squashState() {
const { elementCount: n } = this;
n || (this.nextZIndex = 2e3), this.nextZIndex - n > 2500 && this.rearrange();
}
rearrange() {
const n = Array.from(this.elementZIndex.entries());
n.sort((a, i) => a[1] - i[1]), this.nextZIndex = 2e3, n.forEach((a) => {
const i = a[0], o = this.nextZIndex++;
`${o}` !== i.style.zIndex && (i.style.zIndex = `${o}`);
});
}
}
const cc = new PE(), Zn = "@@ziContext", ME = {
mounted(e, n) {
const { value: a = {} } = n, { zIndex: i, enabled: o } = a;
e[Zn] = {
enabled: !!o,
initialized: !1
}, o && (cc.ensureZIndex(e, i), e[Zn].initialized = !0);
},
updated(e, n) {
const { value: a = {} } = n, { zIndex: i, enabled: o } = a, h = e[Zn].enabled;
o && !h && (cc.ensureZIndex(e, i), e[Zn].initialized = !0), e[Zn].enabled = !!o;
},
unmounted(e, n) {
if (!e[Zn].initialized)
return;
const { value: a = {} } = n, { zIndex: i } = a;
cc.unregister(e, i);
}
}, RW = "@css-render/vue3-ssr";
function $E(e, n) {
return `<style cssr-id="${e}">
${n}
</style>`;
}
function kE(e, n, a) {
const { styles: i, ids: o } = a;
o.has(e) || i !== null && (o.add(e), i.push($E(e, n)));
}
const FE = typeof document < "u";
function md() {
if (FE)
return;
const e = ld(RW, null);
if (e !== null)
return {
adapter: (n, a) => kE(n, a, e),
context: e
};
}
function _E(e) {
const n = [], a = {
styles: n,
ids: /* @__PURE__ */ new Set()
};
return e.provide(RW, a), {
collect() {
const i = n.join(`
`);
return n.length = 0, i;
}
};
}
const WE = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
setup: _E,
useSsrAdapter: md
}, Symbol.toStringTag, { value: "Module" }));
function GF(e, n) {
console.error(`[vueuc/${e}]: ${n}`);
}
function xE(e) {
let n = 0;
for (let a = 0; a < e.length; ++a)
e[a] === "&" && ++n;
return n;
}
const IW = /\s*,(?![^(]*\))\s*/g, DE = /\s+/g;
function zE(e, n) {
const a = [];
return n.split(IW).forEach((i) => {
let o = xE(i);
if (o) {
if (o === 1) {
e.forEach((v) => {
a.push(i.replace("&", v));
});
return;
}
} else {
e.forEach((v) => {
a.push(
// eslint-disable-next-line @typescript-eslint/strict-boolean-expressions
(v && v + " ") + i
);
});
return;
}
let h = [
i
];
for (; o--; ) {
const v = [];
h.forEach((p) => {
e.forEach((w) => {
v.push(p.replace("&", w));
});
}), h = v;
}
h.forEach((v) => a.push(v));
}), a;
}
function jE(e, n) {
const a = [];
return n.split(IW).forEach((i) => {
e.forEach((o) => {
a.push((o && o + " ") + i);
});
}), a;
}
function TE(e) {
let n = [""];
return e.forEach((a) => {
a = a && a.trim(), // eslint-disable-next-line @typescript-eslint/strict-boolean-expressions
a && (a.includes("&") ? n = zE(n, a) : n = jE(n, a));
}), n.join(", ").replace(DE, " ");
}
function QF(e) {
if (!e)
return;
const n = e.parentElement;
n && n.removeChild(e);
}
function ju(e, n) {
return (n ?? document.head).querySelector(`style[cssr-id="${e}"]`);
}
function SE(e) {
const n = document.createElement("style");
return n.setAttribute("cssr-id", e), n;
}
function cu(e) {
return e ? /^\s*@(s|m)/.test(e) : !1;
}
const LE = /[A-Z]/g;
function VW(e) {
return e.replace(LE, (n) => "-" + n.toLowerCase());
}
function CE(e, n = " ") {
return typeof e == "object" && e !== null ? ` {
` + Object.entries(e).map((a) => n + ` ${VW(a[0])}: ${a[1]};`).join(`
`) + `
` + n + "}" : `: ${e};`;
}
function EE(e, n, a) {
return typeof e == "function" ? e({
context: n.context,
props: a
}) : e;
}
function JF(e, n, a, i) {
if (!n)
return "";
const o = EE(n, a, i);
if (!o)
return "";
if (typeof o == "string")
return `${e} {
${o}
}`;
const h = Object.keys(o);
if (h.length === 0)
return a.config.keepEmptyBlock ? e + ` {
}` : "";
const v = e ? [
e + " {"
] : [];
return h.forEach((p) => {
const w = o[p];
if (p === "raw") {
v.push(`
` + w + `
`);
return;
}
p = VW(p), w != null && v.push(` ${p}${CE(w)}`);
}), e && v.push("}"), v.join(`
`);
}
function Mh(e, n, a) {
e && e.forEach((i) => {
if (Array.isArray(i))
Mh(i, n, a);
else if (typeof i == "function") {
const o = i(n);
Array.isArray(o) ? Mh(o, n, a) : o && a(o);
} else i && a(i);
});
}
function XW(e, n, a, i, o) {
const h = e.$;
let v = "";
if (!h || typeof h == "string")
cu(h) ? v = h : n.push(h);
else if (typeof h == "function") {
const b = h({
context: i.context,
props: o
});
cu(b) ? v = b : n.push(b);
} else if (h.before && h.before(i.context), !h.$ || typeof h.$ == "string")
cu(h.$) ? v = h.$ : n.push(h.$);
else if (h.$) {
const b = h.$({
context: i.context,
props: o
});
cu(b) ? v = b : n.push(b);
}
const p = TE(n), w = JF(p, e.props, i, o);
v ? a.push(`${v} {`) : w.length && a.push(w), e.children && Mh(e.children, {
context: i.context,
props: o
}, (b) => {
if (typeof b == "string") {
const $ = JF(p, { raw: b }, i, o);
a.push($);
} else
XW(b, n, a, i, o);
}), n.pop(), v && a.push("}"), h && h.after && h.after(i.context);
}
function OE(e, n, a) {
const i = [];
return XW(e, [], i, n, a), i.join(`
`);
}
function qW(e) {
for (var n = 0, a, i = 0, o = e.length; o >= 4; ++i, o -= 4)
a = e.charCodeAt(i) & 255 | (e.charCodeAt(++i) & 255) << 8 | (e.charCodeAt(++i) & 255) << 16 | (e.charCodeAt(++i) & 255) << 24, a = /* Math.imul(k, m): */
(a & 65535) * 1540483477 + ((a >>> 16) * 59797 << 16), a ^= /* k >>> r: */
a >>> 24, n = /* Math.imul(k, m): */
(a & 65535) * 1540483477 + ((a >>> 16) * 59797 << 16) ^ /* Math.imul(h, m): */
(n & 65535) * 1540483477 + ((n >>> 16) * 59797 << 16);
switch (o) {
case 3:
n ^= (e.charCodeAt(i + 2) & 255) << 16;
case 2:
n ^= (e.charCodeAt(i + 1) & 255) << 8;
case 1:
n ^= e.charCodeAt(i) & 255, n = /* Math.imul(h, m): */
(n & 65535) * 1540483477 + ((n >>> 16) * 59797 << 16);
}
return n ^= n >>> 13, n = /* Math.imul(h, m): */
(n & 65535) * 1540483477 + ((n >>> 16) * 59797 << 16), ((n ^ n >>> 15) >>> 0).toString(36);
}
typeof window < "u" && (window.__cssrContext = {});
function NE(e, n, a, i) {
const { els: o } = n;
if (a === void 0)
o.forEach(QF), n.els = [];
else {
const h = ju(a, i);
h && o.includes(h) && (QF(h), n.els = o.filter((v) => v !== h));
}
}
function ZF(e, n) {
e.push(n);
}
function AE(e, n, a, i, o, h, v, p, w) {
let b;
if (a === void 0 && (b = n.render(i), a = qW(b)), w) {
w.adapter(a, b ?? n.render(i));
return;
}
p === void 0 && (p = document.head);
const $ = ju(a, p);
if ($ !== null && !h)
return $;
const T = $ ?? SE(a);
if (b === void 0 && (b = n.render(i)), T.textContent = b, $ !== null)
return $;
if (v) {
const D = p.querySelector(`meta[name="${v}"]`);
if (D)
return p.insertBefore(T, D), ZF(n.els, T), T;
}
return o ? p.insertBefore(T, p.querySelector("style, link")) : p.appendChild(T), ZF(n.els, T), T;
}
function HE(e) {
return OE(this, this.instance, e);
}
function RE(e = {}) {
const { id: n, ssr: a, props: i, head: o = !1, force: h = !1, anchorMetaName: v, parent: p } = e;
return AE(this.instance, this, n, i, o, h, v, p, a);
}
function IE(e = {}) {
const { id: n, parent: a } = e;
NE(this.instance, this, n, a);
}
const mu = function(e, n, a, i) {
return {
instance: e,
$: n,
props: a,
children: i,
els: [],
render: HE,
mount: RE,
unmount: IE
};
}, VE = function(e, n, a, i) {
return Array.isArray(n) ? mu(e, { $: null }, null, n) : Array.isArray(a) ? mu(e, n, null, a) : Array.isArray(i) ? mu(e, n, a, i) : mu(e, n, a, null);
};
function $h(e = {}) {
const n = {
c: (...a) => VE(n, ...a),
use: (a, ...i) => a.install(n, ...i),
find: ju,
context: {},
config: e
};
return n;
}
function XE(e, n) {
if (e === void 0)
return !1;
if (n) {
const { context: { ids: a } } = n;
return a.has(e);
}
return ju(e) !== null;
}
const qE = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
CssRender: $h,
default: $h,
exists: XE,
hash: qW
}, Symbol.toStringTag, { value: "Module" })), { c: sa } = $h(), Tu = "vueuc-style";
function UF(e) {
return e & -e;
}
class YW {
/**
* @param l length of the array
* @param min min value of the array
*/
constructor(n, a) {
this.l = n, this.min = a;
const i = new Array(n + 1);
for (let o = 0; o < n + 1; ++o)
i[o] = 0;
this.ft = i;
}
/**
* 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(n, a) {
if (a === 0)
return;
const { l: i, ft: o } = this;
for (n += 1; n <= i; )
o[n] += a, n += UF(n);
}
/**
* Get the value of index i
* @param i index
* @returns value of the index
*/
get(n) {
return this.sum(n + 1) - this.sum(n);
}
/**
* Get the sum of first i elements
* @param i count of head elements to be added
* @returns the sum of first i elements
*/
sum(n) {
if (n === void 0 && (n = this.l), n <= 0)
return 0;
const { ft: a, min: i, l: o } = this;
if (n > o)
throw new Error("[FinweckTree.sum]: `i` is larger than length.");
let h = n * i;
for (; n > 0; )
h += a[n], n -= UF(n);
return h;
}
/**
* 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(n) {
let a = 0, i = this.l;
for (; i > a; ) {
const o = Math.floor((a + i) / 2), h = this.sum(o);
if (h > n) {
i = o;
continue;
} else if (h < n) {
if (a === o)
return this.sum(a + 1) <= n ? a + 1 : o;
a = o;
} else
return o;
}
return a;
}
}
function e_(e) {
return typeof e == "string" ? document.querySelector(e) : e() || null;
}
const kh = ca({
name: "LazyTeleport",
props: {
to: {
type: [String, Object],
default: void 0
},
disabled: Boolean,
show: {
type: Boolean,
required: !0
}
},
setup(e) {
return {
showTeleport: CW(_n(e, "show")),
mergedTo: lt(() => {
const { to: n } = e;
return n ?? "body";
})
};
},
render() {
return this.showTeleport ? this.disabled ? wh("lazy-teleport", this.$slots) : Ke(cC, {
disabled: this.disabled,
to: this.mergedTo
}, wh("lazy-teleport", this.$slots)) : null;
}
}), hu = {
top: "bottom",
bottom: "top",
left: "right",
right: "left"
}, t_ = {
start: "end",
center: "center",
end: "start"
}, mc = {
top: "height",
bottom: "height",
left: "width",
right: "width"
}, YE = {
"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"
}, BE = {
"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"
}, KE = {
"bottom-start": "right",
"bottom-end": "left",
"top-start": "right",
"top-end": "left",
"right-start": "bottom",
"right-end": "top",
"left-start": "bottom",
"left-end": "top"
}, a_ = {
top: !0,
// top++
bottom: !1,
// top--
left: !0,
// left++
right: !1
// left--
}, n_ = {
top: "end",
bottom: "start",
left: "end",
right: "start"
};
function GE(e, n, a, i, o, h) {
if (!o || h)
return { placement: e, top: 0, left: 0 };
const [v, p] = e.split("-");
let w = p ?? "center", b = {
top: 0,
left: 0
};
const $ = (N, k, H) => {
let z = 0, _ = 0;
const B = a[N] - n[k] - n[N];
return B > 0 && i && (H ? _ = a_[k] ? B : -B : z = a_[k] ? B : -B), {
left: z,
top: _
};
}, T = v === "left" || v === "right";
if (w !== "center") {
const N = KE[e], k = hu[N], H = mc[N];
if (a[H] > n[H]) {
if (
// current space is not enough
// ----------[ target ]---------|
// -------[ follower ]
n[N] + n[H] < a[H]
) {
const z = (a[H] - n[H]) / 2;
n[N] < z || n[k] < z ? n[N] < n[k] ? (w = t_[p], b = $(H, k, T)) : b = $(H, N, T) : w = "center";
}
} else a[H] < n[H] && n[k] < 0 && // opposite align has larger space
// ------------[ target ]
// ----------------[follower]
n[N] > n[k] && (w = t_[p]);
} else {
const N = v === "bottom" || v === "top" ? "left" : "top", k = hu[N], H = mc[N], z = (a[H] - n[H]) / 2;
// center is not enough
// ----------- [ target ]--|
// -------[ follower ]
(n[N] < z || n[k] < z) && (n[N] > n[k] ? (w = n_[N], b = $(H, N, T)) : (w = n_[k], b = $(H, k, T)));
}
let D = v;
return (
// space is not enough
n[v] < a[mc[v]] && // opposite position's space is larger
n[v] < n[hu[v]] && (D = hu[v]), {
placement: w !== "center" ? `${D}-${w}` : D,
left: b.left,
top: b.top
}
);
}
function QE(e, n) {
return n ? BE[e] : YE[e];
}
function JE(e, n, a, i, o, h) {
if (h)
switch (e) {
case "bottom-start":
return {
top: `${Math.round(a.top - n.top + a.height)}px`,
left: `${Math.round(a.left - n.left)}px`,
transform: "translateY(-100%)"
};
case "bottom-end":
return {
top: `${Math.round(a.top - n.top + a.height)}px`,
left: `${Math.round(a.left - n.left + a.width)}px`,
transform: "translateX(-100%) translateY(-100%)"
};
case "top-start":
return {
top: `${Math.round(a.top - n.top)}px`,
left: `${Math.round(a.left - n.left)}px`,
transform: ""
};
case "top-end":
return {
top: `${Math.round(a.top - n.top)}px`,
left: `${Math.round(a.left - n.left + a.width)}px`,
transform: "translateX(-100%)"
};
case "right-start":
return {
top: `${Math.round(a.top - n.top)}px`,
left: `${Math.round(a.left - n.left + a.width)}px`,
transform: "translateX(-100%)"
};
case "right-end":
return {
top: `${Math.round(a.top - n.top + a.height)}px`,
left: `${Math.round(a.left - n.left + a.width)}px`,
transform: "translateX(-100%) translateY(-100%)"
};
case "left-start":
return {
top: `${Math.round(a.top - n.top)}px`,
left: `${Math.round(a.left - n.left)}px`,
transform: ""
};
case "left-end":
return {
top: `${Math.round(a.top - n.top + a.height)}px`,
left: `${Math.round(a.left - n.left)}px`,
transform: "translateY(-100%)"
};
case "top":
return {
top: `${Math.round(a.top - n.top)}px`,
left: `${Math.round(a.left - n.left + a.width / 2)}px`,
transform: "translateX(-50%)"
};
case "right":
return {
top: `${Math.round(a.top - n.top + a.height / 2)}px`,