UNPKG

@gits-id/tooltip

Version:

GITS Tooltip Component

1,736 lines 56.2 kB
import { pushScopeId as lt, popScopeId as pt, defineComponent as z, nextTick as dt, openBlock as L, createBlock as pe, createElementBlock as $e, normalizeClass as Ne, renderSlot as G, normalizeProps as ht, guardReactiveProps as ct, withScopeId as ut, resolveComponent as be, normalizeStyle as ye, withKeys as ft, createElementVNode as B, Fragment as mt, createCommentVNode as He, withCtx as ie, createVNode as gt, unref as wt } from "vue"; function O(e) { return e.split("-")[0]; } function V(e) { return e.split("-")[1]; } function ee(e) { return ["top", "bottom"].includes(O(e)) ? "x" : "y"; } function Ae(e) { return e === "y" ? "height" : "width"; } function De(e) { let { reference: t, floating: o, placement: i } = e; const n = t.x + t.width / 2 - o.width / 2, r = t.y + t.height / 2 - o.height / 2; let a; switch (O(i)) { case "top": a = { x: n, y: t.y - o.height }; break; case "bottom": a = { x: n, y: t.y + t.height }; break; case "right": a = { x: t.x + t.width, y: r }; break; case "left": a = { x: t.x - o.width, y: r }; break; default: a = { x: t.x, y: t.y }; } const s = ee(i), l = Ae(s); switch (V(i)) { case "start": a[s] = a[s] - (t[l] / 2 - o[l] / 2); break; case "end": a[s] = a[s] + (t[l] / 2 - o[l] / 2); break; } return a; } const yt = async (e, t, o) => { const { placement: i = "bottom", strategy: n = "absolute", middleware: r = [], platform: a } = o; if (process.env.NODE_ENV !== "production" && (a == null && console.error(["Floating UI: `platform` property was not passed to config. If you", "want to use Floating UI on the web, install @floating-ui/dom", "instead of the /core package. Otherwise, you can create your own", "`platform`: https://floating-ui.com/docs/platform"].join(" ")), r.filter((c) => { let { name: m } = c; return m === "autoPlacement" || m === "flip"; }).length > 1)) throw new Error(["Floating UI: duplicate `flip` and/or `autoPlacement`", "middleware detected. This will lead to an infinite loop. Ensure only", "one of either has been passed to the `middleware` array."].join(" ")); let s = await a.getElementRects({ reference: e, floating: t, strategy: n }), { x: l, y: p } = De({ ...s, placement: i }), d = i, f = {}, u = 0; for (let c = 0; c < r.length; c++) { if (process.env.NODE_ENV !== "production" && (u++, u > 100)) throw new Error(["Floating UI: The middleware lifecycle appears to be", "running in an infinite loop. This is usually caused by a `reset`", "continually being returned without a break condition."].join(" ")); const { name: m, fn: _ } = r[c], { x: w, y: g, data: v, reset: y } = await _({ x: l, y: p, initialPlacement: i, placement: d, strategy: n, middlewareData: f, rects: s, platform: a, elements: { reference: e, floating: t } }); if (l = w ?? l, p = g ?? p, f = { ...f, [m]: v ?? {} }, y) { typeof y == "object" && (y.placement && (d = y.placement), y.rects && (s = y.rects === !0 ? await a.getElementRects({ reference: e, floating: t, strategy: n }) : y.rects), { x: l, y: p } = De({ ...s, placement: d })), c = -1; continue; } } return { x: l, y: p, placement: d, strategy: n, middlewareData: f }; }; function vt(e) { return { top: 0, right: 0, bottom: 0, left: 0, ...e }; } function Ke(e) { return typeof e != "number" ? vt(e) : { top: e, right: e, bottom: e, left: e }; } function Pe(e) { return { ...e, top: e.y, left: e.x, right: e.x + e.width, bottom: e.y + e.height }; } async function de(e, t) { t === void 0 && (t = {}); const { x: o, y: i, platform: n, rects: r, elements: a, strategy: s } = e, { boundary: l = "clippingParents", rootBoundary: p = "viewport", elementContext: d = "floating", altBoundary: f = !1, padding: u = 0 } = t, c = Ke(u), _ = a[f ? d === "floating" ? "reference" : "floating" : d], w = await n.getClippingClientRect({ element: await n.isElement(_) ? _ : _.contextElement || await n.getDocumentElement({ element: a.floating }), boundary: l, rootBoundary: p }), g = Pe(await n.convertOffsetParentRelativeRectToViewportRelativeRect({ rect: d === "floating" ? { ...r.floating, x: o, y: i } : r.reference, offsetParent: await n.getOffsetParent({ element: a.floating }), strategy: s })); return { top: w.top - g.top + c.top, bottom: g.bottom - w.bottom + c.bottom, left: w.left - g.left + c.left, right: g.right - w.right + c.right }; } const _t = Math.min, R = Math.max; function Ce(e, t, o) { return R(e, _t(t, o)); } const $t = (e) => ({ name: "arrow", options: e, async fn(t) { const { element: o, padding: i = 0 } = e ?? {}, { x: n, y: r, placement: a, rects: s, platform: l } = t; if (o == null) return process.env.NODE_ENV !== "production" && console.warn("Floating UI: No `element` was passed to the `arrow` middleware."), {}; const p = Ke(i), d = { x: n, y: r }, f = O(a), u = ee(f), c = Ae(u), m = await l.getDimensions({ element: o }), _ = u === "y" ? "top" : "left", w = u === "y" ? "bottom" : "right", g = s.reference[c] + s.reference[u] - d[u] - s.floating[c], v = d[u] - s.reference[u], y = await l.getOffsetParent({ element: o }), $ = y ? u === "y" ? y.clientHeight || 0 : y.clientWidth || 0 : 0, I = g / 2 - v / 2, F = p[_], W = $ - m[c] - p[w], b = $ / 2 - m[c] / 2 + I, C = Ce(F, b, W); return { data: { [u]: C, centerOffset: b - C } }; } }), bt = { left: "right", right: "left", bottom: "top", top: "bottom" }; function ne(e) { return e.replace(/left|right|bottom|top/g, (t) => bt[t]); } function Je(e, t) { const o = V(e) === "start", i = ee(e), n = Ae(i); let r = i === "x" ? o ? "right" : "left" : o ? "bottom" : "top"; return t.reference[n] > t.floating[n] && (r = ne(r)), { main: r, cross: ne(r) }; } const Pt = { start: "end", end: "start" }; function Te(e) { return e.replace(/start|end/g, (t) => Pt[t]); } const Ct = ["top", "right", "bottom", "left"], Tt = /* @__PURE__ */ Ct.reduce((e, t) => e.concat(t, t + "-start", t + "-end"), []); function St(e, t, o) { return (e ? [...o.filter((n) => V(n) === e), ...o.filter((n) => V(n) !== e)] : o.filter((n) => O(n) === n)).filter((n) => e ? V(n) === e || (t ? Te(n) !== n : !1) : !0); } const xt = function(e) { return e === void 0 && (e = {}), { name: "autoPlacement", options: e, async fn(t) { var o, i, n, r, a, s; const { x: l, y: p, rects: d, middlewareData: f, placement: u } = t, { alignment: c = null, allowedPlacements: m = Tt, autoAlignment: _ = !0, ...w } = e; if ((o = f.autoPlacement) != null && o.skip) return {}; const g = St(c, _, m), v = await de(t, w), y = (i = (n = f.autoPlacement) == null ? void 0 : n.index) != null ? i : 0, $ = g[y], { main: I, cross: F } = Je($, d); if (u !== $) return { x: l, y: p, reset: { placement: g[0] } }; const W = [v[O($)], v[I], v[F]], b = [...(r = (a = f.autoPlacement) == null ? void 0 : a.overflows) != null ? r : [], { placement: $, overflows: W }], C = g[y + 1]; if (C) return { data: { index: y + 1, overflows: b }, reset: { placement: C } }; const j = b.slice().sort((U, K) => U.overflows[0] - K.overflows[0]), Y = (s = j.find((U) => { let { overflows: K } = U; return K.every((T) => T <= 0); })) == null ? void 0 : s.placement; return { data: { skip: !0 }, reset: { placement: Y ?? j[0].placement } }; } }; }; function Ot(e) { const t = ne(e); return [Te(e), t, Te(t)]; } const Nt = function(e) { return e === void 0 && (e = {}), { name: "flip", options: e, async fn(t) { var o, i; const { placement: n, middlewareData: r, rects: a, initialPlacement: s } = t; if ((o = r.flip) != null && o.skip) return {}; const { mainAxis: l = !0, crossAxis: p = !0, fallbackPlacements: d, fallbackStrategy: f = "bestFit", flipAlignment: u = !0, ...c } = e, m = O(n), w = d || (m === s || !u ? [ne(s)] : Ot(s)), g = [s, ...w], v = await de(t, c), y = []; let $ = ((i = r.flip) == null ? void 0 : i.overflows) || []; if (l && y.push(v[m]), p) { const { main: b, cross: C } = Je(n, a); y.push(v[b], v[C]); } if ($ = [...$, { placement: n, overflows: y }], !y.every((b) => b <= 0)) { var I, F; const b = ((I = (F = r.flip) == null ? void 0 : F.index) != null ? I : 0) + 1, C = g[b]; if (C) return { data: { index: b, overflows: $ }, reset: { placement: C } }; let j = "bottom"; switch (f) { case "bestFit": { var W; const Y = (W = $.slice().sort((U, K) => U.overflows.filter((T) => T > 0).reduce((T, we) => T + we, 0) - K.overflows.filter((T) => T > 0).reduce((T, we) => T + we, 0))[0]) == null ? void 0 : W.placement; Y && (j = Y); break; } case "initialPlacement": j = s; break; } return { data: { skip: !0 }, reset: { placement: j } }; } return {}; } }; }; function At(e) { let { placement: t, rects: o, value: i } = e; const n = O(t), r = ["left", "top"].includes(n) ? -1 : 1, a = typeof i == "function" ? i({ ...o, placement: t }) : i, { mainAxis: s, crossAxis: l } = typeof a == "number" ? { mainAxis: a, crossAxis: 0 } : { mainAxis: 0, crossAxis: 0, ...a }; return ee(n) === "x" ? { x: l, y: s * r } : { x: s * r, y: l }; } const Et = function(e) { return e === void 0 && (e = 0), { name: "offset", options: e, fn(t) { const { x: o, y: i, placement: n, rects: r } = t, a = At({ placement: n, rects: r, value: e }); return { x: o + a.x, y: i + a.y, data: a }; } }; }; function zt(e) { return e === "x" ? "y" : "x"; } const kt = function(e) { return e === void 0 && (e = {}), { name: "shift", options: e, async fn(t) { const { x: o, y: i, placement: n } = t, { mainAxis: r = !0, crossAxis: a = !1, limiter: s = { fn: (w) => { let { x: g, y: v } = w; return { x: g, y: v }; } }, ...l } = e, p = { x: o, y: i }, d = await de(t, l), f = ee(O(n)), u = zt(f); let c = p[f], m = p[u]; if (r) { const w = f === "y" ? "top" : "left", g = f === "y" ? "bottom" : "right", v = c + d[w], y = c - d[g]; c = Ce(v, c, y); } if (a) { const w = u === "y" ? "top" : "left", g = u === "y" ? "bottom" : "right", v = m + d[w], y = m - d[g]; m = Ce(v, m, y); } const _ = s.fn({ ...t, [f]: c, [u]: m }); return { ..._, data: { x: _.x - o, y: _.y - i } }; } }; }, Ht = function(e) { return e === void 0 && (e = {}), { name: "size", options: e, async fn(t) { var o; const { placement: i, rects: n, middlewareData: r } = t, { apply: a, ...s } = e; if ((o = r.size) != null && o.skip) return {}; const l = await de(t, s), p = O(i), d = V(i) === "end"; let f, u; p === "top" || p === "bottom" ? (f = p, u = d ? "left" : "right") : (u = p, f = d ? "top" : "bottom"); const c = R(l.left, 0), m = R(l.right, 0), _ = R(l.top, 0), w = R(l.bottom, 0), g = { height: n.floating.height - (["left", "right"].includes(i) ? 2 * (_ !== 0 || w !== 0 ? _ + w : R(l.top, l.bottom)) : l[f]), width: n.floating.width - (["top", "bottom"].includes(i) ? 2 * (c !== 0 || m !== 0 ? c + m : R(l.left, l.right)) : l[u]) }; return a?.({ ...g, ...n }), { data: { skip: !0 }, reset: { rects: !0 } }; } }; }; function Ee(e) { return e?.toString() === "[object Window]"; } function k(e) { if (e == null) return window; if (!Ee(e)) { const t = e.ownerDocument; return t && t.defaultView || window; } return e; } function he(e) { return k(e).getComputedStyle(e); } function S(e) { return Ee(e) ? "" : e ? (e.nodeName || "").toLowerCase() : ""; } function x(e) { return e instanceof k(e).HTMLElement; } function se(e) { return e instanceof k(e).Element; } function Dt(e) { return e instanceof k(e).Node; } function Qe(e) { const t = k(e).ShadowRoot; return e instanceof t || e instanceof ShadowRoot; } function ce(e) { const { overflow: t, overflowX: o, overflowY: i } = he(e); return /auto|scroll|overlay|hidden/.test(t + i + o); } function Rt(e) { return ["table", "td", "th"].includes(S(e)); } function Ze(e) { const t = navigator.userAgent.toLowerCase().includes("firefox"), o = he(e); return o.transform !== "none" || o.perspective !== "none" || o.contain === "paint" || ["transform", "perspective"].includes(o.willChange) || t && o.willChange === "filter" || t && (o.filter ? o.filter !== "none" : !1); } const Re = Math.min, J = Math.max, re = Math.round; function q(e, t) { t === void 0 && (t = !1); const o = e.getBoundingClientRect(); let i = 1, n = 1; return t && x(e) && (i = e.offsetWidth > 0 && re(o.width) / e.offsetWidth || 1, n = e.offsetHeight > 0 && re(o.height) / e.offsetHeight || 1), { width: o.width / i, height: o.height / n, top: o.top / n, right: o.right / i, bottom: o.bottom / n, left: o.left / i, x: o.left / i, y: o.top / n }; } function H(e) { return ((Dt(e) ? e.ownerDocument : e.document) || window.document).documentElement; } function ue(e) { return Ee(e) ? { scrollLeft: e.pageXOffset, scrollTop: e.pageYOffset } : { scrollLeft: e.scrollLeft, scrollTop: e.scrollTop }; } function et(e) { return q(H(e)).left + ue(e).scrollLeft; } function Bt(e) { const t = q(e); return re(t.width) !== e.offsetWidth || re(t.height) !== e.offsetHeight; } function Lt(e, t, o) { const i = x(t), n = H(t), r = q(e, i && Bt(t)); let a = { scrollLeft: 0, scrollTop: 0 }; const s = { x: 0, y: 0 }; if (i || !i && o !== "fixed") if ((S(t) !== "body" || ce(n)) && (a = ue(t)), x(t)) { const l = q(t, !0); s.x = l.x + t.clientLeft, s.y = l.y + t.clientTop; } else n && (s.x = et(n)); return { x: r.left + a.scrollLeft - s.x, y: r.top + a.scrollTop - s.y, width: r.width, height: r.height }; } function fe(e) { return S(e) === "html" ? e : e.assignedSlot || e.parentNode || (Qe(e) ? e.host : null) || H(e); } function Be(e) { return !x(e) || getComputedStyle(e).position === "fixed" ? null : e.offsetParent; } function Mt(e) { let t = fe(e); for (; x(t) && !["html", "body"].includes(S(t)); ) { if (Ze(t)) return t; t = t.parentNode; } return null; } function Se(e) { const t = k(e); let o = Be(e); for (; o && Rt(o) && getComputedStyle(o).position === "static"; ) o = Be(o); return o && (S(o) === "html" || S(o) === "body" && getComputedStyle(o).position === "static" && !Ze(o)) ? t : o || Mt(e) || t; } function Le(e) { return { width: e.offsetWidth, height: e.offsetHeight }; } function It(e) { let { rect: t, offsetParent: o, strategy: i } = e; const n = x(o), r = H(o); if (o === r) return t; let a = { scrollLeft: 0, scrollTop: 0 }; const s = { x: 0, y: 0 }; if ((n || !n && i !== "fixed") && ((S(o) !== "body" || ce(r)) && (a = ue(o)), x(o))) { const l = q(o, !0); s.x = l.x + o.clientLeft, s.y = l.y + o.clientTop; } return { ...t, x: t.x - a.scrollLeft + s.x, y: t.y - a.scrollTop + s.y }; } function Ft(e) { const t = k(e), o = H(e), i = t.visualViewport; let n = o.clientWidth, r = o.clientHeight, a = 0, s = 0; return i && (n = i.width, r = i.height, Math.abs(t.innerWidth / i.scale - i.width) < 0.01 && (a = i.offsetLeft, s = i.offsetTop)), { width: n, height: r, x: a, y: s }; } function Wt(e) { var t; const o = H(e), i = ue(e), n = (t = e.ownerDocument) == null ? void 0 : t.body, r = J(o.scrollWidth, o.clientWidth, n ? n.scrollWidth : 0, n ? n.clientWidth : 0), a = J(o.scrollHeight, o.clientHeight, n ? n.scrollHeight : 0, n ? n.clientHeight : 0); let s = -i.scrollLeft + et(e); const l = -i.scrollTop; return he(n || o).direction === "rtl" && (s += J(o.clientWidth, n ? n.clientWidth : 0) - r), { width: r, height: a, x: s, y: l }; } function tt(e) { return ["html", "body", "#document"].includes(S(e)) ? e.ownerDocument.body : x(e) && ce(e) ? e : tt(fe(e)); } function ae(e, t) { var o; t === void 0 && (t = []); const i = tt(e), n = i === ((o = e.ownerDocument) == null ? void 0 : o.body), r = k(i), a = n ? [r].concat(r.visualViewport || [], ce(i) ? i : []) : i, s = t.concat(a); return n ? s : s.concat(ae(fe(a))); } function jt(e, t) { const o = t.getRootNode == null ? void 0 : t.getRootNode(); if (e.contains(t)) return !0; if (o && Qe(o)) { let i = t; do { if (i && e === i) return !0; i = i.parentNode || i.host; } while (i); } return !1; } function Vt(e) { const t = q(e), o = t.top + e.clientTop, i = t.left + e.clientLeft; return { top: o, left: i, x: i, y: o, right: i + e.clientWidth, bottom: o + e.clientHeight, width: e.clientWidth, height: e.clientHeight }; } function Me(e, t) { return t === "viewport" ? Pe(Ft(e)) : se(t) ? Vt(t) : Pe(Wt(H(e))); } function Gt(e) { const t = ae(fe(e)), i = ["absolute", "fixed"].includes(he(e).position) && x(e) ? Se(e) : e; return se(i) ? t.filter((n) => se(n) && jt(n, i) && S(n) !== "body") : []; } function qt(e) { let { element: t, boundary: o, rootBoundary: i } = e; const r = [...o === "clippingParents" ? Gt(t) : [].concat(o), i], a = r[0], s = r.reduce((l, p) => { const d = Me(t, p); return l.top = J(d.top, l.top), l.right = Re(d.right, l.right), l.bottom = Re(d.bottom, l.bottom), l.left = J(d.left, l.left), l; }, Me(t, a)); return s.width = s.right - s.left, s.height = s.bottom - s.top, s.x = s.left, s.y = s.top, s; } const Xt = { getElementRects: (e) => { let { reference: t, floating: o, strategy: i } = e; return { reference: Lt(t, Se(o), i), floating: { ...Le(o), x: 0, y: 0 } }; }, convertOffsetParentRelativeRectToViewportRelativeRect: (e) => It(e), getOffsetParent: (e) => { let { element: t } = e; return Se(t); }, isElement: (e) => se(e), getDocumentElement: (e) => { let { element: t } = e; return H(t); }, getClippingClientRect: (e) => qt(e), getDimensions: (e) => { let { element: t } = e; return Le(t); }, getClientRects: (e) => { let { element: t } = e; return t.getClientRects(); } }, Yt = (e, t, o) => yt(e, t, { platform: Xt, ...o }); var Ut = Object.defineProperty, Kt = Object.defineProperties, Jt = Object.getOwnPropertyDescriptors, Ie = Object.getOwnPropertySymbols, Qt = Object.prototype.hasOwnProperty, Zt = Object.prototype.propertyIsEnumerable, Fe = (e, t, o) => t in e ? Ut(e, t, { enumerable: !0, configurable: !0, writable: !0, value: o }) : e[t] = o, E = (e, t) => { for (var o in t || (t = {})) Qt.call(t, o) && Fe(e, o, t[o]); if (Ie) for (var o of Ie(t)) Zt.call(t, o) && Fe(e, o, t[o]); return e; }, me = (e, t) => Kt(e, Jt(t)); const M = { disabled: !1, distance: 5, skidding: 0, container: "body", boundary: void 0, instantMove: !1, disposeTimeout: 5e3, popperTriggers: [], strategy: "absolute", preventOverflow: !0, flip: !0, shift: !0, overflowPadding: 0, arrowPadding: 0, arrowOverflow: !0, themes: { tooltip: { placement: "top", triggers: ["hover", "focus", "touch"], hideTriggers: (e) => [...e, "click"], delay: { show: 200, hide: 0 }, handleResize: !1, html: !1, loadingContent: "..." }, dropdown: { placement: "bottom", triggers: ["click"], delay: 0, handleResize: !0, autoHide: !0 }, menu: { $extend: "dropdown", triggers: ["hover", "focus"], popperTriggers: ["hover", "focus"], delay: { show: 0, hide: 400 } } } }; function le(e, t) { let o = M.themes[e] || {}, i; do i = o[t], typeof i > "u" ? o.$extend ? o = M.themes[o.$extend] || {} : (o = null, i = M[t]) : o = null; while (o); return i; } function eo(e) { const t = [e]; let o = M.themes[e] || {}; do o.$extend && !o.$resetCss ? (t.push(o.$extend), o = M.themes[o.$extend] || {}) : o = null; while (o); return t.map((i) => `v-popper--theme-${i}`); } function We(e) { const t = [e]; let o = M.themes[e] || {}; do o.$extend ? (t.push(o.$extend), o = M.themes[o.$extend] || {}) : o = null; while (o); return t; } let X = !1; if (typeof window < "u") { X = !1; try { const e = Object.defineProperty({}, "passive", { get() { X = !0; } }); window.addEventListener("test", null, e); } catch { } } let ot = !1; typeof window < "u" && typeof navigator < "u" && (ot = /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream); const to = ["auto", "top", "bottom", "left", "right"].reduce((e, t) => e.concat([ t, `${t}-start`, `${t}-end` ]), []), je = { hover: "mouseenter", focus: "focus", click: "click", touch: "touchstart" }, Ve = { hover: "mouseleave", focus: "blur", click: "click", touch: "touchend" }; function Ge(e, t) { const o = e.indexOf(t); o !== -1 && e.splice(o, 1); } function ve() { return new Promise((e) => requestAnimationFrame(() => { requestAnimationFrame(e); })); } const P = []; let D = null; const qe = {}; function Xe(e) { let t = qe[e]; return t || (t = qe[e] = []), t; } let xe = function() { }; typeof window < "u" && (xe = window.Element); function h(e) { return function(t) { return le(t.theme, e); }; } const _e = "__floating-vue__popper"; var it = () => z({ name: "VPopper", provide() { return { [_e]: { parentPopper: this } }; }, inject: { [_e]: { default: null } }, props: { theme: { type: String, required: !0 }, targetNodes: { type: Function, required: !0 }, referenceNode: { type: Function, default: null }, popperNode: { type: Function, required: !0 }, shown: { type: Boolean, default: !1 }, showGroup: { type: String, default: null }, ariaId: { default: null }, disabled: { type: Boolean, default: h("disabled") }, positioningDisabled: { type: Boolean, default: h("positioningDisabled") }, placement: { type: String, default: h("placement"), validator: (e) => to.includes(e) }, delay: { type: [String, Number, Object], default: h("delay") }, distance: { type: [Number, String], default: h("distance") }, skidding: { type: [Number, String], default: h("skidding") }, triggers: { type: Array, default: h("triggers") }, showTriggers: { type: [Array, Function], default: h("showTriggers") }, hideTriggers: { type: [Array, Function], default: h("hideTriggers") }, popperTriggers: { type: Array, default: h("popperTriggers") }, popperShowTriggers: { type: [Array, Function], default: h("popperShowTriggers") }, popperHideTriggers: { type: [Array, Function], default: h("popperHideTriggers") }, container: { type: [String, Object, xe, Boolean], default: h("container") }, boundary: { type: [String, xe], default: h("boundary") }, strategy: { type: String, validator: (e) => ["absolute", "fixed"].includes(e), default: h("strategy") }, autoHide: { type: [Boolean, Function], default: h("autoHide") }, handleResize: { type: Boolean, default: h("handleResize") }, instantMove: { type: Boolean, default: h("instantMove") }, eagerMount: { type: Boolean, default: h("eagerMount") }, popperClass: { type: [String, Array, Object], default: h("popperClass") }, computeTransformOrigin: { type: Boolean, default: h("computeTransformOrigin") }, autoMinSize: { type: Boolean, default: h("autoMinSize") }, autoSize: { type: [Boolean, String], default: h("autoSize") }, autoMaxSize: { type: Boolean, default: h("autoMaxSize") }, autoBoundaryMaxSize: { type: Boolean, default: h("autoBoundaryMaxSize") }, preventOverflow: { type: Boolean, default: h("preventOverflow") }, overflowPadding: { type: [Number, String], default: h("overflowPadding") }, arrowPadding: { type: [Number, String], default: h("arrowPadding") }, arrowOverflow: { type: Boolean, default: h("arrowOverflow") }, flip: { type: Boolean, default: h("flip") }, shift: { type: Boolean, default: h("shift") }, shiftCrossAxis: { type: Boolean, default: h("shiftCrossAxis") }, noAutoFocus: { type: Boolean, default: h("noAutoFocus") } }, emits: [ "show", "hide", "update:shown", "apply-show", "apply-hide", "close-group", "close-directive", "auto-hide", "resize", "dispose" ], data() { return { isShown: !1, isMounted: !1, skipTransition: !1, classes: { showFrom: !1, showTo: !1, hideFrom: !1, hideTo: !0 }, result: { x: 0, y: 0, placement: "", strategy: this.strategy, arrow: { x: 0, y: 0, centerOffset: 0 }, transformOrigin: null }, shownChildren: /* @__PURE__ */ new Set(), lastAutoHide: !0 }; }, computed: { popperId() { return this.ariaId != null ? this.ariaId : this.randomId; }, shouldMountContent() { return this.eagerMount || this.isMounted; }, slotData() { return { popperId: this.popperId, isShown: this.isShown, shouldMountContent: this.shouldMountContent, skipTransition: this.skipTransition, autoHide: typeof this.autoHide == "function" ? this.lastAutoHide : this.autoHide, show: this.show, hide: this.hide, handleResize: this.handleResize, onResize: this.onResize, classes: me(E({}, this.classes), { popperClass: this.popperClass }), result: this.positioningDisabled ? null : this.result, attrs: this.$attrs }; }, parentPopper() { var e; return (e = this[_e]) == null ? void 0 : e.parentPopper; }, hasPopperShowTriggerHover() { var e, t; return ((e = this.popperTriggers) == null ? void 0 : e.includes("hover")) || ((t = this.popperShowTriggers) == null ? void 0 : t.includes("hover")); } }, watch: E(E({ shown: "$_autoShowHide", disabled(e) { e ? this.dispose() : this.init(); }, async container() { this.isShown && (this.$_ensureTeleport(), await this.$_computePosition()); } }, [ "triggers", "positioningDisabled" ].reduce((e, t) => (e[t] = "$_refreshListeners", e), {})), [ "placement", "distance", "skidding", "boundary", "strategy", "overflowPadding", "arrowPadding", "preventOverflow", "shift", "shiftCrossAxis", "flip" ].reduce((e, t) => (e[t] = "$_computePosition", e), {})), created() { this.$_isDisposed = !0, this.randomId = `popper_${[Math.random(), Date.now()].map((e) => e.toString(36).substring(2, 10)).join("_")}`, this.autoMinSize && console.warn('[floating-vue] `autoMinSize` option is deprecated. Use `autoSize="min"` instead.'), this.autoMaxSize && console.warn("[floating-vue] `autoMaxSize` option is deprecated. Use `autoBoundaryMaxSize` instead."); }, mounted() { this.init(), this.$_detachPopperNode(); }, activated() { this.$_autoShowHide(); }, deactivated() { this.hide(); }, beforeUnmount() { this.dispose(); }, methods: { show({ event: e = null, skipDelay: t = !1, force: o = !1 } = {}) { var i, n; ((i = this.parentPopper) == null ? void 0 : i.lockedChild) && this.parentPopper.lockedChild !== this || (this.$_pendingHide = !1, (o || !this.disabled) && (((n = this.parentPopper) == null ? void 0 : n.lockedChild) === this && (this.parentPopper.lockedChild = null), this.$_scheduleShow(e, t), this.$emit("show"), this.$_showFrameLocked = !0, requestAnimationFrame(() => { this.$_showFrameLocked = !1; })), this.$emit("update:shown", !0)); }, hide({ event: e = null, skipDelay: t = !1 } = {}) { var o; if (!this.$_hideInProgress) { if (this.shownChildren.size > 0) { this.$_pendingHide = !0; return; } if (this.hasPopperShowTriggerHover && this.$_isAimingPopper()) { this.parentPopper && (this.parentPopper.lockedChild = this, clearTimeout(this.parentPopper.lockedChildTimer), this.parentPopper.lockedChildTimer = setTimeout(() => { this.parentPopper.lockedChild === this && (this.parentPopper.lockedChild.hide({ skipDelay: t }), this.parentPopper.lockedChild = null); }, 1e3)); return; } ((o = this.parentPopper) == null ? void 0 : o.lockedChild) === this && (this.parentPopper.lockedChild = null), this.$_pendingHide = !1, this.$_scheduleHide(e, t), this.$emit("hide"), this.$emit("update:shown", !1); } }, init() { var e, t; !this.$_isDisposed || (this.$_isDisposed = !1, this.isMounted = !1, this.$_events = [], this.$_preventShow = !1, this.$_referenceNode = (t = (e = this.referenceNode) == null ? void 0 : e.call(this)) != null ? t : this.$el, this.$_targetNodes = this.targetNodes().filter((o) => o.nodeType === o.ELEMENT_NODE), this.$_popperNode = this.popperNode(), this.$_innerNode = this.$_popperNode.querySelector(".v-popper__inner"), this.$_arrowNode = this.$_popperNode.querySelector(".v-popper__arrow-container"), this.$_swapTargetAttrs("title", "data-original-title"), this.$_detachPopperNode(), this.triggers.length && this.$_addEventListeners(), this.shown && this.show()); }, dispose() { this.$_isDisposed || (this.$_isDisposed = !0, this.$_removeEventListeners(), this.hide({ skipDelay: !0 }), this.$_detachPopperNode(), this.isMounted = !1, this.isShown = !1, this.$_updateParentShownChildren(!1), this.$_swapTargetAttrs("data-original-title", "title"), this.$emit("dispose")); }, async onResize() { this.isShown && (await this.$_computePosition(), this.$emit("resize")); }, async $_computePosition() { var e; if (this.$_isDisposed || this.positioningDisabled) return; const t = { strategy: this.strategy, middleware: [] }; (this.distance || this.skidding) && t.middleware.push(Et({ mainAxis: this.distance, crossAxis: this.skidding })); const o = this.placement.startsWith("auto"); if (o ? t.middleware.push(xt({ alignment: (e = this.placement.split("-")[1]) != null ? e : "" })) : t.placement = this.placement, this.preventOverflow && (this.shift && t.middleware.push(kt({ padding: this.overflowPadding, boundary: this.boundary, crossAxis: this.shiftCrossAxis })), !o && this.flip && t.middleware.push(Nt({ padding: this.overflowPadding, boundary: this.boundary }))), t.middleware.push($t({ element: this.$_arrowNode, padding: this.arrowPadding })), this.arrowOverflow && t.middleware.push({ name: "arrowOverflow", fn: ({ placement: n, rects: r, middlewareData: a }) => { let s; const { centerOffset: l } = a.arrow; return n.startsWith("top") || n.startsWith("bottom") ? s = Math.abs(l) > r.reference.width / 2 : s = Math.abs(l) > r.reference.height / 2, { data: { overflow: s } }; } }), this.autoMinSize || this.autoSize) { const n = this.autoSize ? this.autoSize : this.autoMinSize ? "min" : null; t.middleware.push({ name: "autoSize", fn: ({ rects: r, placement: a, middlewareData: s }) => { var l; if ((l = s.autoSize) != null && l.skip) return {}; let p, d; return a.startsWith("top") || a.startsWith("bottom") ? p = r.reference.width : d = r.reference.height, this.$_innerNode.style[n === "min" ? "minWidth" : n === "max" ? "maxWidth" : "width"] = p != null ? `${p}px` : null, this.$_innerNode.style[n === "min" ? "minHeight" : n === "max" ? "maxHeight" : "height"] = d != null ? `${d}px` : null, { data: { skip: !0 }, reset: { rects: !0 } }; } }); } (this.autoMaxSize || this.autoBoundaryMaxSize) && (this.$_innerNode.style.maxWidth = null, this.$_innerNode.style.maxHeight = null, t.middleware.push(Ht({ boundary: this.boundary, padding: this.overflowPadding, apply: ({ width: n, height: r }) => { this.$_innerNode.style.maxWidth = n != null ? `${n}px` : null, this.$_innerNode.style.maxHeight = r != null ? `${r}px` : null; } }))); const i = await Yt(this.$_referenceNode, this.$_popperNode, t); Object.assign(this.result, { x: i.x, y: i.y, placement: i.placement, strategy: i.strategy, arrow: E(E({}, i.middlewareData.arrow), i.middlewareData.arrowOverflow) }); }, $_scheduleShow(e = null, t = !1) { if (this.$_updateParentShownChildren(!0), this.$_hideInProgress = !1, clearTimeout(this.$_scheduleTimer), D && this.instantMove && D.instantMove && D !== this.parentPopper) { D.$_applyHide(!0), this.$_applyShow(!0); return; } t ? this.$_applyShow() : this.$_scheduleTimer = setTimeout(this.$_applyShow.bind(this), this.$_computeDelay("show")); }, $_scheduleHide(e = null, t = !1) { if (this.shownChildren.size > 0) { this.$_pendingHide = !0; return; } this.$_updateParentShownChildren(!1), this.$_hideInProgress = !0, clearTimeout(this.$_scheduleTimer), this.isShown && (D = this), t ? this.$_applyHide() : this.$_scheduleTimer = setTimeout(this.$_applyHide.bind(this), this.$_computeDelay("hide")); }, $_computeDelay(e) { const t = this.delay; return parseInt(t && t[e] || t || 0); }, async $_applyShow(e = !1) { clearTimeout(this.$_disposeTimer), clearTimeout(this.$_scheduleTimer), this.skipTransition = e, !this.isShown && (this.$_ensureTeleport(), await ve(), await this.$_computePosition(), await this.$_applyShowEffect(), this.positioningDisabled || this.$_registerEventListeners([ ...ae(this.$_referenceNode), ...ae(this.$_popperNode) ], "scroll", () => { this.$_computePosition(); })); }, async $_applyShowEffect() { if (this.$_hideInProgress) return; if (this.computeTransformOrigin) { const t = this.$_referenceNode.getBoundingClientRect(), o = this.$_popperNode.querySelector(".v-popper__wrapper"), i = o.parentNode.getBoundingClientRect(), n = t.x + t.width / 2 - (i.left + o.offsetLeft), r = t.y + t.height / 2 - (i.top + o.offsetTop); this.result.transformOrigin = `${n}px ${r}px`; } this.isShown = !0, this.$_applyAttrsToTarget({ "aria-describedby": this.popperId, "data-popper-shown": "" }); const e = this.showGroup; if (e) { let t; for (let o = 0; o < P.length; o++) t = P[o], t.showGroup !== e && (t.hide(), t.$emit("close-group")); } P.push(this), document.body.classList.add("v-popper--some-open"); for (const t of We(this.theme)) Xe(t).push(this), document.body.classList.add(`v-popper--some-open--${t}`); this.$emit("apply-show"), this.classes.showFrom = !0, this.classes.showTo = !1, this.classes.hideFrom = !1, this.classes.hideTo = !1, await ve(), this.classes.showFrom = !1, this.classes.showTo = !0, this.noAutoFocus || this.$_popperNode.focus(); }, async $_applyHide(e = !1) { if (this.shownChildren.size > 0) { this.$_pendingHide = !0, this.$_hideInProgress = !1; return; } if (clearTimeout(this.$_scheduleTimer), !this.isShown) return; this.skipTransition = e, Ge(P, this), P.length === 0 && document.body.classList.remove("v-popper--some-open"); for (const o of We(this.theme)) { const i = Xe(o); Ge(i, this), i.length === 0 && document.body.classList.remove(`v-popper--some-open--${o}`); } D === this && (D = null), this.isShown = !1, this.$_applyAttrsToTarget({ "aria-describedby": void 0, "data-popper-shown": void 0 }), clearTimeout(this.$_disposeTimer); const t = le(this.theme, "disposeTimeout"); t !== null && (this.$_disposeTimer = setTimeout(() => { this.$_popperNode && (this.$_detachPopperNode(), this.isMounted = !1); }, t)), this.$_removeEventListeners("scroll"), this.$emit("apply-hide"), this.classes.showFrom = !1, this.classes.showTo = !1, this.classes.hideFrom = !0, this.classes.hideTo = !1, await ve(), this.classes.hideFrom = !1, this.classes.hideTo = !0; }, $_autoShowHide() { this.shown ? this.show() : this.hide(); }, $_ensureTeleport() { if (this.$_isDisposed) return; let e = this.container; if (typeof e == "string" ? e = window.document.querySelector(e) : e === !1 && (e = this.$_targetNodes[0].parentNode), !e) throw new Error("No container for popover: " + this.container); e.appendChild(this.$_popperNode), this.isMounted = !0; }, $_addEventListeners() { const e = (o) => { this.isShown && !this.$_hideInProgress || (o.usedByTooltip = !0, !this.$_preventShow && this.show({ event: o })); }; this.$_registerTriggerListeners(this.$_targetNodes, je, this.triggers, this.showTriggers, e), this.$_registerTriggerListeners([this.$_popperNode], je, this.popperTriggers, this.popperShowTriggers, e); const t = (o) => { o.usedByTooltip || this.hide({ event: o }); }; this.$_registerTriggerListeners(this.$_targetNodes, Ve, this.triggers, this.hideTriggers, t), this.$_registerTriggerListeners([this.$_popperNode], Ve, this.popperTriggers, this.popperHideTriggers, t); }, $_registerEventListeners(e, t, o) { this.$_events.push({ targetNodes: e, eventType: t, handler: o }), e.forEach((i) => i.addEventListener(t, o, X ? { passive: !0 } : void 0)); }, $_registerTriggerListeners(e, t, o, i, n) { let r = o; i != null && (r = typeof i == "function" ? i(r) : i), r.forEach((a) => { const s = t[a]; s && this.$_registerEventListeners(e, s, n); }); }, $_removeEventListeners(e) { const t = []; this.$_events.forEach((o) => { const { targetNodes: i, eventType: n, handler: r } = o; !e || e === n ? i.forEach((a) => a.removeEventListener(n, r)) : t.push(o); }), this.$_events = t; }, $_refreshListeners() { this.$_isDisposed || (this.$_removeEventListeners(), this.$_addEventListeners()); }, $_handleGlobalClose(e, t = !1) { this.$_showFrameLocked || (this.hide({ event: e }), e.closePopover ? this.$emit("close-directive") : this.$emit("auto-hide"), t && (this.$_preventShow = !0, setTimeout(() => { this.$_preventShow = !1; }, 300))); }, $_detachPopperNode() { this.$_popperNode.parentNode && this.$_popperNode.parentNode.removeChild(this.$_popperNode); }, $_swapTargetAttrs(e, t) { for (const o of this.$_targetNodes) { const i = o.getAttribute(e); i && (o.removeAttribute(e), o.setAttribute(t, i)); } }, $_applyAttrsToTarget(e) { for (const t of this.$_targetNodes) for (const o in e) { const i = e[o]; i == null ? t.removeAttribute(o) : t.setAttribute(o, i); } }, $_updateParentShownChildren(e) { let t = this.parentPopper; for (; t; ) e ? t.shownChildren.add(this.randomId) : (t.shownChildren.delete(this.randomId), t.$_pendingHide && t.hide()), t = t.parentPopper; }, $_isAimingPopper() { const e = this.$_referenceNode.getBoundingClientRect(); if (Q >= e.left && Q <= e.right && Z >= e.top && Z <= e.bottom) { const t = this.$_popperNode.getBoundingClientRect(), o = Q - N, i = Z - A, r = t.left + t.width / 2 - N + (t.top + t.height / 2) - A + t.width + t.height, a = N + o * r, s = A + i * r; return te(N, A, a, s, t.left, t.top, t.left, t.bottom) || te(N, A, a, s, t.left, t.top, t.right, t.top) || te(N, A, a, s, t.right, t.top, t.right, t.bottom) || te(N, A, a, s, t.left, t.bottom, t.right, t.bottom); } return !1; } }, render() { return this.$slots.default(this.slotData); } }); typeof document < "u" && typeof window < "u" && (ot ? (document.addEventListener("touchstart", Ye, X ? { passive: !0, capture: !0 } : !0), document.addEventListener("touchend", io, X ? { passive: !0, capture: !0 } : !0)) : (window.addEventListener("mousedown", Ye, !0), window.addEventListener("click", oo, !0)), window.addEventListener("resize", ro)); function Ye(e) { for (let t = 0; t < P.length; t++) { const o = P[t]; try { const i = o.popperNode(); o.$_mouseDownContains = i.contains(e.target); } catch { } } } function oo(e) { nt(e); } function io(e) { nt(e, !0); } function nt(e, t = !1) { const o = {}; for (let i = P.length - 1; i >= 0; i--) { const n = P[i]; try { const r = n.$_containsGlobalTarget = no(n, e); n.$_pendingHide = !1, requestAnimationFrame(() => { if (n.$_pendingHide = !1, !o[n.randomId] && Ue(n, r, e)) { if (n.$_handleGlobalClose(e, t), !e.closeAllPopover && e.closePopover && r) { let s = n.parentPopper; for (; s; ) o[s.randomId] = !0, s = s.parentPopper; return; } let a = n.parentPopper; for (; a && Ue(a, a.$_containsGlobalTarget, e); ) { a.$_handleGlobalClose(e, t); a = a.parentPopper; } } }); } catch { } } } function no(e, t) { const o = e.popperNode(); return e.$_mouseDownContains || o.contains(t.target); } function Ue(e, t, o) { return o.closeAllPopover || o.closePopover && t || so(e, o) && !t; } function so(e, t) { if (typeof e.autoHide == "function") { const o = e.autoHide(t); return e.lastAutoHide = o, o; } return e.autoHide; } function ro(e) { for (let t = 0; t < P.length; t++) P[t].$_computePosition(e); } let N = 0, A = 0, Q = 0, Z = 0; typeof window < "u" && window.addEventListener("mousemove", (e) => { N = Q, A = Z, Q = e.clientX, Z = e.clientY; }, X ? { passive: !0 } : void 0); function te(e, t, o, i, n, r, a, s) { const l = ((a - n) * (t - r) - (s - r) * (e - n)) / ((s - r) * (o - e) - (a - n) * (i - t)), p = ((o - e) * (t - r) - (i - t) * (e - n)) / ((s - r) * (o - e) - (a - n) * (i - t)); return l >= 0 && l <= 1 && p >= 0 && p <= 1; } var ze = (e, t) => { const o = e.__vccOpts || e; for (const [i, n] of t) o[i] = n; return o; }; const ao = { extends: it() }; function lo(e, t, o, i, n, r) { return L(), $e("div", { ref: "reference", class: Ne(["v-popper", { "v-popper--shown": e.slotData.isShown }]) }, [ G(e.$slots, "default", ht(ct(e.slotData))) ], 2); } var po = /* @__PURE__ */ ze(ao, [["render", lo]]); function ho() { var e = window.navigator.userAgent, t = e.indexOf("MSIE "); if (t > 0) return parseInt(e.substring(t + 5, e.indexOf(".", t)), 10); var o = e.indexOf("Trident/"); if (o > 0) { var i = e.indexOf("rv:"); return parseInt(e.substring(i + 3, e.indexOf(".", i)), 10); } var n = e.indexOf("Edge/"); return n > 0 ? parseInt(e.substring(n + 5, e.indexOf(".", n)), 10) : -1; } let oe; function Oe() { Oe.init || (Oe.init = !0, oe = ho() !== -1); } var ge = { name: "ResizeObserver", props: { emitOnMount: { type: Boolean, default: !1 }, ignoreWidth: { type: Boolean, default: !1 }, ignoreHeight: { type: Boolean, default: !1 } }, emits: [ "notify" ], mounted() { Oe(), dt(() => { this._w = this.$el.offsetWidth, this._h = this.$el.offsetHeight, this.emitOnMount && this.emitSize(); }); const e = document.createElement("object"); this._resizeObject = e, e.setAttribute("aria-hidden", "true"), e.setAttribute("tabindex", -1), e.onload = this.addResizeHandlers, e.type = "text/html", oe && this.$el.appendChild(e), e.data = "about:blank", oe || this.$el.appendChild(e); }, beforeUnmount() { this.removeResizeHandlers(); }, methods: { compareAndNotify() { (!this.ignoreWidth && this._w !== this.$el.offsetWidth || !this.ignoreHeight && this._h !== this.$el.offsetHeight) && (this._w = this.$el.offsetWidth, this._h = this.$el.offsetHeight, this.emitSize()); }, emitSize() { this.$emit("notify", { width: this._w, height: this._h }); }, addResizeHandlers() { this._resizeObject.contentDocument.defaultView.addEventListener("resize", this.compareAndNotify), this.compareAndNotify(); }, removeResizeHandlers() { this._resizeObject && this._resizeObject.onload && (!oe && this._resizeObject.contentDocument && this._resizeObject.contentDocument.defaultView.removeEventListener("resize", this.compareAndNotify), this.$el.removeChild(this._resizeObject), this._resizeObject.onload = null, this._resizeObject = null); } } }; const co = /* @__PURE__ */ ut("data-v-b329ee4c"); lt("data-v-b329ee4c"); const uo = { class: "resize-observer", tabindex: "-1" }; pt(); const fo = /* @__PURE__ */ co((e, t, o, i, n, r) => (L(), pe("div", uo))); ge.render = fo; ge.__scopeId = "data-v-b329ee4c"; ge.__file = "src/components/ResizeObserver.vue"; var st = (e = "theme") => ({ computed: { themeClass() { return eo(this[e]); } } }); const mo = z({ name: "VPopperContent", components: { ResizeObserver: ge }, mixins: [ st() ], props: { popperId: String, theme: String, shown: Boolean, mounted: Boolean, skipTransition: Boolean, autoHide: Boolean, handleResize: Boolean, classes: Object, result: Object }, emits: [ "hide", "resize" ], methods: { toPx(e) { return e != null && !isNaN(e) ? `${e}px` : null; } } }), go = ["id", "aria-hidden", "tabindex", "data-popper-placement"], wo = { ref: "inner", class: "v-popper__inner" }, yo = /* @__PURE__ */ B("div", { class: "v-popper__arrow-outer" }, null, -1), vo = /* @__PURE__ */ B("div", { class: "v-popper__arrow-inner" }, null, -1), _o = [ yo, vo ]; function $o(e, t, o, i, n, r) { const a = be("ResizeObserver"); return L(), $e("div", { id: e.popperId, ref: "popover", class: Ne(["v-popper__popper", [ e.themeClass, e.classes.popperClass, { "v-popper__popper--shown": e.shown, "v-popper__popper--hidden": !e.shown, "v-popper__popper--show-from": e.classes.showFrom, "v-popper__popper--show-to": e.classes.showTo, "v-popper__popper--hide-from": e.classes.hideFrom, "v-popper__popper--hide-to": e.classes.hideTo, "v-popper__popper--skip-transition": e.skipTransition, "v-popper__popper--arrow