import '@das-fed/ui/packages/components/text-tooltip/style.css';
import { createStyle as Dn } from "@das-fed/utils/style";
import { getVarValue as Et, getVar as Rn, setThemeRule as In } from "@das-fed/web/packages/theme/index";
import { ref as Te } from "vue";
import { useZIndex as Pn } from "@das-fed/utils/hooks/popup-manager/use-zindex";
import { currentLang as xo } from "@das-fed/web/packages/i18n/index";
/*!
 * OverlayScrollbars
 * Version: 2.6.1
 *
 * Copyright (c) Rene Haas | KingSora.
 * https://github.com/KingSora
 *
 * Released under the MIT license.
 */
const xt = (t, e) => {
  const { o, u: n, _: s } = t;
  let c = o, r;
  const l = (i, f) => {
    const p = c, T = i, L = f || (n ? !n(p, T) : p !== T);
    return (L || s) && (c = T, r = p), [c, L, r];
  };
  return [e ? (i) => l(e(c, r), i) : l, (i) => [c, !!i, r]];
}, co = typeof window < "u", ht = co ? window : {}, he = Math.max, Mn = Math.min, Ue = Math.round, Wo = ht.cancelAnimationFrame, Uo = ht.requestAnimationFrame, je = ht.setTimeout, Xe = ht.clearTimeout, Ee = (t) => typeof ht[t] < "u" ? ht[t] : void 0, Nn = Ee("MutationObserver"), wo = Ee("IntersectionObserver"), ye = Ee("ResizeObserver"), Ge = Ee("ScrollTimeline"), jo = co && Node.ELEMENT_NODE, { toString: Vn, hasOwnProperty: Ve } = Object.prototype, zn = /^\[object (.+)\]$/, ue = (t) => t === void 0, Oe = (t) => t === null, _n = (t) => ue(t) || Oe(t) ? `${t}` : Vn.call(t).replace(zn, "$1").toLowerCase(), Ot = (t) => typeof t == "number", $e = (t) => typeof t == "string", Xo = (t) => typeof t == "boolean", $t = (t) => typeof t == "function", St = (t) => Array.isArray(t), ie = (t) => typeof t == "object" && !St(t) && !Oe(t), Ae = (t) => {
  const e = !!t && t.length, o = Ot(e) && e > -1 && e % 1 == 0;
  return St(t) || !$t(t) && o ? e > 0 && ie(t) ? e - 1 in t : !0 : !1;
}, xe = (t) => {
  if (!t || !ie(t) || _n(t) !== "object")
    return !1;
  let e;
  const o = "constructor", n = t[o], s = n && n.prototype, c = Ve.call(t, o), r = s && Ve.call(s, "isPrototypeOf");
  if (n && !c && !r)
    return !1;
  for (e in t)
    ;
  return ue(e) || Ve.call(t, e);
}, re = (t) => {
  const e = HTMLElement;
  return t ? e ? t instanceof e : t.nodeType === jo : !1;
}, Le = (t) => {
  const e = Element;
  return t ? e ? t instanceof e : t.nodeType === jo : !1;
};
function Y(t, e) {
  if (Ae(t))
    for (let o = 0; o < t.length && e(t[o], o, t) !== !1; o++)
      ;
  else t && Y(Object.keys(t), (o) => e(t[o], o, t));
  return t;
}
const He = (t, e) => t.indexOf(e) >= 0, At = (t, e) => t.concat(e), Q = (t, e, o) => (!$e(e) && Ae(e) ? Array.prototype.push.apply(t, e) : t.push(e), t), Wt = (t) => Array.from(t || []), Go = (t) => St(t) ? t : [t], Ye = (t) => !!t && !t.length, So = (t) => Wt(new Set(t)), bt = (t, e, o) => {
  Y(t, (s) => s && s.apply(void 0, e || [])), !o && (t.length = 0);
}, Yo = "paddingTop", qo = "paddingRight", Zo = "paddingLeft", Ko = "paddingBottom", Jo = "marginLeft", Qo = "marginRight", tn = "marginBottom", ke = "overflowX", De = "overflowY", Zt = "width", Kt = "height", Jt = "hidden", en = "visible", ro = (t, e, o, n) => {
  if (t && e) {
    let s = !0;
    return Y(o, (c) => {
      const r = t[c], l = e[c];
      r !== l && (s = !1);
    }), s;
  }
  return !1;
}, on = (t, e) => ro(t, e, ["w", "h"]), nn = (t, e) => ro(t, e, ["x", "y"]), Bn = (t, e) => ro(t, e, ["t", "r", "b", "l"]), wt = () => {
}, N = (t, ...e) => t.bind(0, ...e), Dt = (t) => {
  let e;
  const o = t ? je : Uo, n = t ? Xe : Wo;
  return [(s) => {
    n(e), e = o(s, $t(t) ? t() : t);
  }, () => n(e)];
}, sn = (t, e) => {
  let o, n, s, c = wt;
  const { v: r, p: l, S: a } = e || {}, u = function(L) {
    c(), Xe(o), o = n = void 0, c = wt, t.apply(this, L);
  }, i = (T) => a && n ? a(n, T) : T, f = () => {
    c !== wt && u(i(s) || s);
  }, p = function() {
    const L = Wt(arguments), H = $t(r) ? r() : r;
    if (Ot(H) && H >= 0) {
      const D = $t(l) ? l() : l, S = Ot(D) && D >= 0, h = H > 0 ? je : Uo, E = H > 0 ? Xe : Wo, I = i(L) || L, _ = u.bind(0, I);
      c();
      const F = h(_, H);
      c = () => E(F), S && !o && (o = je(f, D)), n = s = I;
    } else
      u(L);
  };
  return p.m = f, p;
}, cn = (t, e) => Object.prototype.hasOwnProperty.call(t, e), Lt = (t) => t ? Object.keys(t) : [], G = (t, e, o, n, s, c, r) => {
  const l = [e, o, n, s, c, r];
  return (typeof t != "object" || Oe(t)) && !$t(t) && (t = {}), Y(l, (a) => {
    Y(a, (u, i) => {
      const f = a[i];
      if (t === f)
        return !0;
      const p = St(f);
      if (f && xe(f)) {
        const T = t[i];
        let L = T;
        p && !St(T) ? L = [] : !p && !xe(T) && (L = {}), t[i] = G(L, f);
      } else
        t[i] = p ? f.slice() : f;
    });
  }), t;
}, rn = (t, e) => Y(G({}, t), (o, n, s) => {
  o === void 0 ? delete s[n] : o && xe(o) && (s[n] = rn(o));
}), lo = (t) => {
  for (const e in t)
    return !1;
  return !0;
}, qe = (t, e, o) => he(t, Mn(e, o)), _t = (t) => Wt(new Set((St(t) ? t : (t || "").split(" ")).filter((e) => e))), Re = (t, e) => t && t.getAttribute(e), yt = (t, e, o) => {
  Y(_t(e), (n) => {
    t && t.setAttribute(n, o || "");
  });
}, Tt = (t, e) => {
  Y(_t(e), (o) => t && t.removeAttribute(o));
}, Ie = (t, e) => {
  const o = _t(Re(t, e)), n = N(yt, t, e), s = (c, r) => {
    const l = new Set(o);
    return Y(_t(c), (a) => l[r](a)), Wt(l).join(" ");
  };
  return {
    O: (c) => n(s(c, "delete")),
    $: (c) => n(s(c, "add")),
    C: (c) => {
      const r = _t(c);
      return r.reduce((l, a) => l && o.includes(a), r.length > 0);
    }
  };
}, ln = (t, e, o) => {
  Ie(t, e).O(o);
}, ae = (t, e, o) => (Ie(t, e).$(o), N(ln, t, e, o)), be = (t, e, o, n) => {
  (n ? ae : ln)(t, e, o);
}, Fn = (t, e, o) => Ie(t, e).C(o), an = (t) => Ie(t, "class"), io = (t, e) => {
  an(t).O(e);
}, we = (t, e) => (an(t).$(e), N(io, t, e)), Co = co && Element.prototype, un = (t, e) => {
  const o = [], n = e ? Le(e) && e : document;
  return n ? Q(o, n.querySelectorAll(t)) : o;
}, Wn = (t, e) => {
  const o = e ? Le(e) && e : document;
  return o ? o.querySelector(t) : null;
}, Ze = (t, e) => Le(t) ? (Co.matches || Co.msMatchesSelector).call(t, e) : !1, Ke = (t) => t ? Wt(t.childNodes) : [], Qt = (t) => t && t.parentElement, Xt = (t, e) => Le(t) && t.closest(e), Un = (t, e, o) => {
  const n = Xt(t, e), s = t && Wn(o, n), c = Xt(s, e) === n;
  return n && s ? n === t || s === t || c && Xt(Xt(t, o), e) !== n : !1;
}, Pt = (t) => {
  if (Ae(t))
    Y(Wt(t), (e) => Pt(e));
  else if (t) {
    const e = Qt(t);
    e && e.removeChild(t);
  }
}, dn = (t, e, o) => {
  if (o && t) {
    let n = e, s;
    return Ae(o) ? (s = document.createDocumentFragment(), Y(o, (c) => {
      c === n && (n = c.previousSibling), s.appendChild(c);
    })) : s = o, e && (n ? n !== e && (n = n.nextSibling) : n = t.firstChild), t.insertBefore(s, n || null), () => Pt(o);
  }
  return wt;
}, gt = (t, e) => dn(t, null, e), To = (t, e) => dn(Qt(t), t && t.nextSibling, e), Gt = (t) => {
  const e = document.createElement("div");
  return yt(e, "class", t), e;
}, fn = (t) => {
  const e = Gt();
  return e.innerHTML = t.trim(), Y(Ke(e), (o) => Pt(o));
}, jn = /^--/, Eo = (t, e) => t.getPropertyValue(e) || t[e] || "", ao = (t) => {
  const e = t || 0;
  return isFinite(e) ? e : 0;
}, me = (t) => ao(parseFloat(t || "")), Oo = (t) => `${(ao(t) * 100).toFixed(3)}%`, Je = (t) => `${ao(t)}px`;
function te(t, e) {
  t && Y(e, (o, n) => {
    try {
      const s = t.style, c = Ot(o) ? Je(o) : (o || "") + "";
      jn.test(n) ? s.setProperty(n, c) : s[n] = c;
    } catch {
    }
  });
}
function Bt(t, e, o) {
  const n = $e(e);
  let s = n ? "" : {};
  if (t) {
    const c = ht.getComputedStyle(t, o) || t.style;
    s = n ? Eo(c, e) : e.reduce((r, l) => (r[l] = Eo(c, l), r), s);
  }
  return s;
}
const It = (t) => Bt(t, "direction") === "rtl", $o = (t, e, o) => {
  const n = e ? `${e}-` : "", s = o ? `-${o}` : "", c = `${n}top${s}`, r = `${n}right${s}`, l = `${n}bottom${s}`, a = `${n}left${s}`, u = Bt(t, [c, r, l, a]);
  return {
    t: me(u[c]),
    r: me(u[r]),
    b: me(u[l]),
    l: me(u[a])
  };
}, ze = (t, e) => `translate${ie(t) ? `(${t.x},${t.y})` : `${e ? "X" : "Y"}(${t})`}`, Xn = {
  w: 0,
  h: 0
}, Pe = (t, e) => e ? {
  w: e[`${t}Width`],
  h: e[`${t}Height`]
} : Xn, Gn = (t) => Pe("inner", t || ht), le = N(Pe, "offset"), pn = N(Pe, "client"), Qe = N(Pe, "scroll"), uo = (t) => {
  const e = parseFloat(Bt(t, Zt)) || 0, o = parseFloat(Bt(t, Kt)) || 0;
  return {
    w: e - Ue(e),
    h: o - Ue(o)
  };
}, Yt = (t) => t.getBoundingClientRect(), to = (t) => !!(t && (t[Kt] || t[Zt])), mn = (t, e) => {
  const o = to(t);
  return !to(e) && o;
}, Ao = (t, e, o, n) => {
  Y(_t(e), (s) => {
    t.removeEventListener(s, o, n);
  });
}, nt = (t, e, o, n) => {
  var s;
  const c = (s = n && n.H) != null ? s : !0, r = n && n.I || !1, l = n && n.A || !1, a = {
    passive: c,
    capture: r
  };
  return N(bt, _t(e).map((u) => {
    const i = l ? (f) => {
      Ao(t, u, i, r), o(f);
    } : o;
    return t.addEventListener(u, i, a), N(Ao, t, u, i, r);
  }));
}, fo = (t) => t.stopPropagation(), Lo = (t) => t.preventDefault(), Yn = {
  x: 0,
  y: 0
}, _e = (t) => {
  const e = t && Yt(t);
  return e ? {
    x: e.left + ht.scrollX,
    y: e.top + ht.scrollY
  } : Yn;
}, Se = (t, e, o) => o ? o.n ? -t + 0 : o.i ? e - t : t : t, Ho = (t, e) => [Se(0, t, e), Se(t, t, e)], ko = (t, e, o) => qe(0, 1, Se(t, e, o) / e || 0), Mt = (t, e) => {
  const { x: o, y: n } = Ot(e) ? {
    x: e,
    y: e
  } : e || {};
  Ot(o) && (t.scrollLeft = o), Ot(n) && (t.scrollTop = n);
}, ee = (t) => ({
  x: t.scrollLeft,
  y: t.scrollTop
}), Do = (t, e) => {
  Y(Go(e), t);
}, eo = (t) => {
  const e = /* @__PURE__ */ new Map(), o = (c, r) => {
    if (c) {
      const l = e.get(c);
      Do((a) => {
        l && l[a ? "delete" : "clear"](a);
      }, r);
    } else
      e.forEach((l) => {
        l.clear();
      }), e.clear();
  }, n = (c, r) => {
    if ($e(c)) {
      const u = e.get(c) || /* @__PURE__ */ new Set();
      return e.set(c, u), Do((i) => {
        $t(i) && u.add(i);
      }, r), N(o, c, r);
    }
    Xo(r) && r && o();
    const l = Lt(c), a = [];
    return Y(l, (u) => {
      const i = c[u];
      i && Q(a, n(u, i));
    }), N(bt, a);
  }, s = (c, r) => {
    Y(Wt(e.get(c)), (l) => {
      r && !Ye(r) ? l.apply(0, r) : l();
    });
  };
  return n(t || {}), [n, o, s];
}, Ro = (t) => JSON.stringify(t, (e, o) => {
  if ($t(o))
    throw 0;
  return o;
}), Io = (t, e) => t ? `${e}`.split(".").reduce((o, n) => o && cn(o, n) ? o[n] : void 0, t) : void 0, qn = {
  paddingAbsolute: !1,
  showNativeOverlaidScrollbars: !1,
  update: {
    elementEvents: [["img", "load"]],
    debounce: [0, 33],
    attributes: null,
    ignoreMutation: null
  },
  overflow: {
    x: "scroll",
    y: "scroll"
  },
  scrollbars: {
    theme: "os-theme-dark",
    visibility: "auto",
    autoHide: "never",
    autoHideDelay: 1300,
    autoHideSuspend: !1,
    dragScroll: !0,
    clickScroll: !1,
    pointers: ["mouse", "touch", "pen"]
  }
}, gn = (t, e) => {
  const o = {}, n = At(Lt(e), Lt(t));
  return Y(n, (s) => {
    const c = t[s], r = e[s];
    if (ie(c) && ie(r))
      G(o[s] = {}, gn(c, r)), lo(o[s]) && delete o[s];
    else if (cn(e, s) && r !== c) {
      let l = !0;
      if (St(c) || St(r))
        try {
          Ro(c) === Ro(r) && (l = !1);
        } catch {
        }
      l && (o[s] = r);
    }
  }), o;
}, Po = (t, e, o) => (n) => [Io(t, n), o || Io(e, n) !== void 0], de = "data-overlayscrollbars", hn = "os-environment", Zn = `${hn}-scrollbar-hidden`, Be = `${de}-initialize`, mt = de, bn = `${mt}-overflow-x`, vn = `${mt}-overflow-y`, yn = "overflowVisible", Kn = "scrollbarPressed", oo = "updating", Jn = "body", Rt = `${de}-viewport`, Qn = "arrange", xn = "scrollbarHidden", qt = yn, no = `${de}-padding`, ts = qt, Mo = `${de}-content`, po = "os-size-observer", es = `${po}-appear`, os = `${po}-listener`, ns = "os-trinsic-observer", ss = "os-theme-none", ft = "os-scrollbar", cs = `${ft}-rtl`, rs = `${ft}-horizontal`, ls = `${ft}-vertical`, wn = `${ft}-track`, mo = `${ft}-handle`, is = `${ft}-visible`, as = `${ft}-cornerless`, No = `${ft}-interaction`, Vo = `${ft}-unusable`, so = `${ft}-auto-hide`, zo = `${so}-hidden`, _o = `${ft}-wheel`, us = `${wn}-interactive`, ds = `${mo}-interactive`, Sn = {}, Cn = {}, fs = (t) => {
  Y(t, (e) => Y(e, (o, n) => {
    Sn[n] = e[n];
  }));
}, Tn = (t, e, o) => Lt(t).map((n) => {
  const { static: s, instance: c } = t[n], [r, l, a] = o || [], u = o ? c : s;
  if (u) {
    const i = o ? u(r, l, e) : u(e);
    return (a || Cn)[n] = i;
  }
}), oe = (t) => Cn[t], ps = "__osOptionsValidationPlugin", ms = "__osSizeObserverPlugin", gs = (t, e) => {
  const { T: o } = e, [n, s] = t("showNativeOverlaidScrollbars");
  return [n && o.x && o.y, s];
}, Ce = (t) => t.indexOf(en) === 0, En = (t, e) => {
  const { D: o } = t, n = (a) => {
    const u = Bt(o, a), f = (e ? e[a] : u) === "scroll";
    return [u, f];
  }, [s, c] = n(ke), [r, l] = n(De);
  return {
    k: {
      x: s,
      y: r
    },
    R: {
      x: c,
      y: l
    }
  };
}, hs = (t, e, o, n) => {
  const s = e.x || e.y, c = (i, f) => {
    const p = Ce(i), T = p && s ? "hidden" : "", L = f && p && i.replace(`${en}-`, "") || T;
    return [f && !p ? i : "", Ce(L) ? "hidden" : L];
  }, [r, l] = c(o.x, e.x), [a, u] = c(o.y, e.y);
  return n[ke] = l && a ? l : r, n[De] = u && r ? u : a, En(t, n);
}, go = "__osScrollbarsHidingPlugin", bs = "__osClickScrollPlugin";
let Fe;
const vs = () => {
  const t = (h, E, R, I) => {
    gt(h, E);
    const _ = pn(E), F = le(E), z = uo(R);
    return I && Pt(E), {
      x: F.h - _.h + z.h,
      y: F.w - _.w + z.w
    };
  }, e = (h) => {
    let E = !1;
    const R = we(h, Zn);
    try {
      E = Bt(h, "scrollbar-width") === "none" || Bt(h, "display", "::-webkit-scrollbar") === "none";
    } catch {
    }
    return R(), E;
  }, o = (h, E) => {
    te(h, {
      [ke]: Jt,
      [De]: Jt,
      direction: "rtl"
    }), Mt(h, {
      x: 0
    });
    const R = _e(h), I = _e(E);
    Mt(h, {
      x: -999
    });
    const _ = _e(E);
    return {
      i: R.x === I.x,
      n: I.x !== _.x
    };
  }, { body: n } = document, c = fn(`<div class="${hn}"><div></div></div>`)[0], r = c.firstChild, [l, , a] = eo(), [u, i] = xt({
    o: t(n, c, r),
    u: nn
  }, N(t, n, c, r, !0)), [f] = i(), p = e(c), T = {
    x: f.x === 0,
    y: f.y === 0
  }, L = {
    elements: {
      host: null,
      padding: !p,
      viewport: (h) => p && h === h.ownerDocument.body && h,
      content: !1
    },
    scrollbars: {
      slot: !0
    },
    cancel: {
      nativeScrollbarsOverlaid: !1,
      body: null
    }
  }, H = G({}, qn), P = N(G, {}, H), D = N(G, {}, L), S = {
    P: f,
    T,
    L: p,
    J: !!Ge,
    K: o(c, r),
    Z: N(l, "r"),
    G: D,
    tt: (h) => G(L, h) && D(),
    nt: P,
    ot: (h) => G(H, h) && P(),
    st: G({}, L),
    et: G({}, H)
  };
  return Tt(c, "style"), Pt(c), ht.addEventListener("resize", () => {
    let h;
    if (!p && (!T.x || !T.y)) {
      const E = oe(go);
      h = !!(E ? E.Y() : wt)(S, u);
    }
    a("r", [h]);
  }), S;
}, vt = () => (Fe || (Fe = vs()), Fe), ho = (t, e) => $t(e) ? e.apply(0, t) : e, ys = (t, e, o, n) => {
  const s = ue(n) ? o : n;
  return ho(t, s) || e.apply(0, t);
}, On = (t, e, o, n) => {
  const s = ue(n) ? o : n, c = ho(t, s);
  return !!c && (re(c) ? c : e.apply(0, t));
}, xs = (t, e) => {
  const { nativeScrollbarsOverlaid: o, body: n } = e || {}, { T: s, L: c, G: r } = vt(), { nativeScrollbarsOverlaid: l, body: a } = r().cancel, u = o ?? l, i = ue(n) ? a : n, f = (s.x || s.y) && u, p = t && (Oe(i) ? !c : i);
  return !!f || !!p;
}, bo = /* @__PURE__ */ new WeakMap(), ws = (t, e) => {
  bo.set(t, e);
}, Ss = (t) => {
  bo.delete(t);
}, $n = (t) => bo.get(t), Cs = (t, e, o) => {
  let n = !1;
  const s = o ? /* @__PURE__ */ new WeakMap() : !1, c = () => {
    n = !0;
  }, r = (l) => {
    if (s && o) {
      const a = o.map((u) => {
        const [i, f] = u || [];
        return [f && i ? (l || un)(i, t) : [], f];
      });
      Y(a, (u) => Y(u[0], (i) => {
        const f = u[1], p = s.get(i) || [];
        if (t.contains(i) && f) {
          const L = nt(i, f, (H) => {
            n ? (L(), s.delete(i)) : e(H);
          });
          s.set(i, Q(p, L));
        } else
          bt(p), s.delete(i);
      }));
    }
  };
  return r(), [c, r];
}, Bo = (t, e, o, n) => {
  let s = !1;
  const { ct: c, rt: r, lt: l, it: a, ut: u, ft: i } = n || {}, f = sn(() => s && o(!0), {
    v: 33,
    p: 99
  }), [p, T] = Cs(t, f, l), L = c || [], H = r || [], P = At(L, H), D = (h, E) => {
    if (!Ye(E)) {
      const R = u || wt, I = i || wt, _ = [], F = [];
      let z = !1, w = !1;
      if (Y(E, (v) => {
        const { attributeName: $, target: y, type: O, oldValue: C, addedNodes: V, removedNodes: j } = v, W = O === "attributes", B = O === "childList", Z = t === y, et = W && $, K = et && Re(y, $ || "") || null, A = et && C !== K, tt = He(H, $) && A;
        if (e && (B || !Z)) {
          const ot = W && A, it = ot && a && Ze(y, a), m = (it ? !R(y, $, C, K) : !W || ot) && !I(v, !!it, t, n);
          Y(V, (g) => Q(_, g)), Y(j, (g) => Q(_, g)), w = w || m;
        }
        !e && Z && A && !R(y, $, C, K) && (Q(F, $), z = z || tt);
      }), T((v) => So(_).reduce(($, y) => (Q($, un(v, y)), Ze(y, v) ? Q($, y) : $), [])), e)
        return !h && w && o(!1), [!1];
      if (!Ye(F) || z) {
        const v = [So(F), z];
        return !h && o.apply(0, v), v;
      }
    }
  }, S = new Nn(N(D, !1));
  return [() => (S.observe(t, {
    attributes: !0,
    attributeOldValue: !0,
    attributeFilter: P,
    subtree: e,
    childList: e,
    characterData: e
  }), s = !0, () => {
    s && (p(), S.disconnect(), s = !1);
  }), () => {
    if (s)
      return f.m(), D(!0, S.takeRecords());
  }];
}, An = (t, e, o) => {
  const { _t: s, dt: c } = o || {}, r = oe(ms), { K: l } = vt(), a = N(It, t), [u] = xt({
    o: !1,
    _: !0
  });
  return () => {
    const i = [], p = fn(`<div class="${po}"><div class="${os}"></div></div>`)[0], T = p.firstChild, L = (H) => {
      const P = H instanceof ResizeObserverEntry, D = !P && St(H);
      let S = !1, h = !1, E = !0;
      if (P) {
        const [R, , I] = u(H.contentRect), _ = to(R), F = mn(R, I);
        h = !I || F, S = !h && !_, E = !S;
      } else D ? [, E] = H : h = H === !0;
      if (s && E) {
        const R = D ? H[0] : It(p);
        Mt(p, {
          x: Se(3333333, 3333333, R && l),
          y: 3333333
        });
      }
      S || e({
        vt: D ? H : void 0,
        ht: !D,
        dt: h
      });
    };
    if (ye) {
      const H = new ye((P) => L(P.pop()));
      H.observe(T), Q(i, () => {
        H.disconnect();
      });
    } else if (r) {
      const [H, P] = r(T, L, c);
      Q(i, At([we(p, es), nt(p, "animationstart", H)], P));
    } else
      return wt;
    if (s) {
      const [H] = xt({
        o: void 0
      }, a);
      Q(i, nt(p, "scroll", (P) => {
        const D = H(), [S, h, E] = D;
        h && (io(T, "ltr rtl"), we(T, S ? "rtl" : "ltr"), L([!!S, h, E])), fo(P);
      }));
    }
    return N(bt, Q(i, gt(t, p)));
  };
}, Ts = (t, e) => {
  let o;
  const n = (a) => a.h === 0 || a.isIntersecting || a.intersectionRatio > 0, s = Gt(ns), [c] = xt({
    o: !1
  }), r = (a, u) => {
    if (a) {
      const i = c(n(a)), [, f] = i;
      return f && !u && e(i) && [i];
    }
  }, l = (a, u) => r(u.pop(), a);
  return [() => {
    const a = [];
    if (wo)
      o = new wo(N(l, !1), {
        root: t
      }), o.observe(s), Q(a, () => {
        o.disconnect();
      });
    else {
      const u = () => {
        const i = le(s);
        r(i);
      };
      Q(a, An(s, u)()), u();
    }
    return N(bt, Q(a, gt(t, s)));
  }, () => o && l(!0, o.takeRecords())];
}, Es = (t, e, o, n) => {
  let s, c, r, l, a, u;
  const { L: i } = vt(), f = `[${mt}]`, p = `[${Rt}]`, T = ["tabindex"], L = ["wrap", "cols", "rows"], H = ["id", "class", "style", "open"], { gt: P, bt: D, D: S, wt: h, St: E, V: R, yt: I, Ot: _ } = t, F = {
    $t: !1,
    N: It(P)
  }, z = vt(), w = oe(go), [v] = xt({
    u: on,
    o: {
      w: 0,
      h: 0
    }
  }, () => {
    const d = w && w.M(t, e, F, z, o).W, m = I(qt), g = !R && I(Qn), b = g && ee(S);
    _(qt), R && _(oo, !0);
    const x = g && d && d()[0], k = Qe(h), M = Qe(S), U = uo(S);
    return _(qt, m), R && _(oo), x && x(), Mt(S, b), {
      w: M.w + k.w + U.w,
      h: M.h + k.h + U.h
    };
  }), $ = E ? L : At(H, L), y = sn(n, {
    v: () => s,
    p: () => c,
    S(d, m) {
      const [g] = d, [b] = m;
      return [At(Lt(g), Lt(b)).reduce((x, k) => (x[k] = g[k] || b[k], x), {})];
    }
  }), O = (d) => {
    if (R) {
      const m = It(P);
      G(d, {
        Ct: u !== m
      }), G(F, {
        N: m
      }), u = m;
    }
  }, C = (d) => {
    Y(d || T, (m) => {
      if (He(T, m)) {
        const g = Re(D, m);
        $e(g) ? yt(S, m, g) : Tt(S, m);
      }
    });
  }, V = (d, m) => {
    const [g, b] = d, x = {
      xt: b
    };
    return G(F, {
      $t: g
    }), !m && n(x), x;
  }, j = ({ ht: d, vt: m, dt: g }) => {
    const x = !(d && !g && !m) && i ? y : n, [k, M] = m || [], U = {
      ht: d || g,
      dt: g,
      Ct: M
    };
    O(U), m && G(F, {
      N: k
    }), x(U);
  }, W = (d, m) => {
    const [, g] = v(), b = {
      Ht: g
    };
    return O(b), g && !m && (d ? n : y)(b), b;
  }, B = (d, m, g) => {
    const b = {
      It: m
    };
    return O(b), m && !g ? y(b) : R || C(d), b;
  }, { Z } = z, [et, K] = h ? Ts(D, V) : [], A = !R && An(D, j, {
    dt: !0,
    _t: !0
  }), [tt, ot] = Bo(D, !1, B, {
    rt: H,
    ct: At(H, T)
  }), it = R && ye && new ye((d) => {
    const m = d[d.length - 1].contentRect;
    j({
      ht: !0,
      dt: mn(m, a)
    }), a = m;
  });
  return [() => {
    C(), it && it.observe(D);
    const d = A && A(), m = et && et(), g = tt(), b = Z((x) => {
      const [, k] = v();
      y({
        zt: x,
        Ht: k
      });
    });
    return () => {
      it && it.disconnect(), d && d(), m && m(), l && l(), g(), b();
    };
  }, ({ Et: d, At: m, Tt: g }) => {
    const b = {}, [x] = d("update.ignoreMutation"), [k, M] = d("update.attributes"), [U, q] = d("update.elementEvents"), [rt, at] = d("update.debounce"), J = q || M, lt = m || g, Nt = (X) => $t(x) && x(X);
    if (J) {
      r && r(), l && l();
      const [X, ct] = Bo(h || S, !0, W, {
        ct: At($, k || []),
        lt: U,
        it: f,
        ft: (ut, dt) => {
          const { target: st, attributeName: pt } = ut;
          return (!dt && pt && !R ? Un(st, f, p) : !1) || !!Xt(st, `.${ft}`) || !!Nt(ut);
        }
      });
      l = X(), r = ct;
    }
    if (at)
      if (y.m(), St(rt)) {
        const X = rt[0], ct = rt[1];
        s = Ot(X) && X, c = Ot(ct) && ct;
      } else Ot(rt) ? (s = rt, c = !1) : (s = !1, c = !1);
    if (lt) {
      const X = ot(), ct = K && K(), ut = r && r();
      X && G(b, B(X[0], X[1], lt)), ct && G(b, V(ct[0], lt)), ut && G(b, W(ut[0], lt));
    }
    return O(b), b;
  }, F];
}, Os = (t, e, o, n) => {
  const { G: s, K: c } = vt(), { scrollbars: r } = s(), { slot: l } = r, { gt: a, bt: u, D: i, Dt: f, kt: p, Rt: T, V: L } = e, { scrollbars: H } = f ? {} : t, { slot: P } = H || {}, D = /* @__PURE__ */ new Map(), S = (d) => Ge && new Ge({
    source: p,
    axis: d
  }), h = S("x"), E = S("y"), R = On([a, u, i], () => L && T ? a : u, l, P), I = (d, m) => {
    if (m) {
      const U = d ? Zt : Kt, { Mt: q, Vt: rt } = m, at = Yt(rt)[U], J = Yt(q)[U];
      return qe(0, 1, at / J || 0);
    }
    const g = d ? "x" : "y", { Lt: b, Pt: x } = o, k = x[g], M = b[g];
    return qe(0, 1, k / (k + M) || 0);
  }, _ = (d, m, g, b) => {
    const x = I(g, d);
    return 1 / x * (1 - x) * (b ? 1 - m : m) || 0;
  }, F = (d, m) => G(d, m ? {
    clear: ["left"]
  } : {}), z = (d) => {
    D.forEach((m, g) => {
      (d ? He(Go(d), g) : !0) && (Y(m || [], (x) => {
        x && x.cancel();
      }), D.delete(g));
    });
  }, w = (d, m, g, b) => {
    const x = D.get(d) || [], k = x.find((M) => M && M.timeline === m);
    k ? k.effect = new KeyframeEffect(d, g, {
      composite: b
    }) : D.set(d, At(x, [d.animate(g, {
      timeline: m,
      composite: b
    })]));
  }, v = (d, m, g) => {
    const b = g ? we : io;
    Y(d, (x) => {
      b(x.Ut, m);
    });
  }, $ = (d, m) => {
    Y(d, (g) => {
      const [b, x] = m(g);
      te(b, x);
    });
  }, y = (d, m) => {
    $(d, (g) => {
      const { Vt: b } = g;
      return [b, {
        [m ? Zt : Kt]: Oo(I(m))
      }];
    });
  }, O = (d, m) => {
    const { Lt: g } = o, b = m ? g.x : g.y, x = (k, M, U) => ze(Oo(_(k, ko(M, b, U), m, U)), m);
    if (h && E)
      Y(d, (k) => {
        const { Ut: M, Vt: U } = k, q = m && It(M) && c;
        w(U, m ? h : E, F({
          transform: Ho(b, q).map((rt) => x(k, rt, q))
        }, q));
      });
    else {
      const k = ee(p);
      $(d, (M) => {
        const { Vt: U, Ut: q } = M;
        return [U, {
          transform: x(M, m ? k.x : k.y, m && It(q) && c)
        }];
      });
    }
  }, C = (d) => L && !T && Qt(d) === i, V = [], j = [], W = [], B = (d, m, g) => {
    const b = Xo(g), x = b ? g : !0, k = b ? !g : !0;
    x && v(j, d, m), k && v(W, d, m);
  }, Z = () => {
    y(j, !0), y(W);
  }, et = () => {
    O(j, !0), O(W);
  }, K = () => {
    if (L) {
      const { Lt: d } = o, m = 0.5;
      if (h && E)
        Y(At(W, j), ({ Ut: g }) => {
          if (C(g)) {
            const b = (x, k, M) => {
              const U = M && It(g) && c;
              w(g, x, F({
                transform: Ho(k - m, U).map((q) => ze(Je(q), M))
              }, U), "add");
            };
            b(h, d.x, !0), b(E, d.y);
          } else
            z(g);
        });
      else {
        const g = ee(p), b = (x) => {
          const { Ut: k } = x, M = C(k) && k, U = (q, rt, at) => {
            const J = ko(q, rt, at), lt = rt * J;
            return Je(at ? -lt : lt);
          };
          return [M, {
            transform: M ? ze({
              x: U(g.x, d.x, It(k) && c),
              y: U(g.y, d.y)
            }) : ""
          }];
        };
        $(j, b), $(W, b);
      }
    }
  }, A = (d) => {
    const g = Gt(`${ft} ${d ? rs : ls}`), b = Gt(wn), x = Gt(mo), k = {
      Ut: g,
      Mt: b,
      Vt: x
    };
    return Q(d ? j : W, k), Q(V, [gt(g, b), gt(b, x), N(Pt, g), z, n(k, B, O, d)]), k;
  }, tt = N(A, !0), ot = N(A, !1), it = () => (gt(R, j[0].Ut), gt(R, W[0].Ut), N(bt, V));
  return tt(), ot(), [{
    Bt: Z,
    Nt: et,
    jt: K,
    Ft: B,
    qt: {
      J: h,
      Wt: j,
      Xt: tt,
      Yt: N($, j)
    },
    Jt: {
      J: E,
      Wt: W,
      Xt: ot,
      Yt: N($, W)
    }
  }, it];
}, $s = (t, e, o) => {
  const { bt: n, kt: s, Kt: c } = e;
  return (r, l, a, u) => {
    const { Ut: i, Mt: f, Vt: p } = r, [T, L] = Dt(333), [H, P] = Dt(), D = N(a, [r], u), S = !!s.scrollBy, h = `client${u ? "X" : "Y"}`, E = u ? Zt : Kt, R = u ? "left" : "top", I = u ? "w" : "h", _ = u ? "x" : "y", F = (v) => v.propertyName.indexOf(E) > -1, z = () => {
      const v = "pointerup pointerleave pointercancel lostpointercapture", $ = (y, O) => (C) => {
        const { Lt: V } = o, j = le(f)[I] - le(p)[I], B = O * C / j * V[_];
        Mt(s, {
          [_]: y + B
        });
      };
      return nt(f, "pointerdown", (y) => {
        const O = Xt(y.target, `.${mo}`) === p, C = O ? p : f, V = t.scrollbars, { button: j, isPrimary: W, pointerType: B } = y, { pointers: Z } = V;
        if (j === 0 && W && V[O ? "dragScroll" : "clickScroll"] && (Z || []).includes(B)) {
          const K = !O && y.shiftKey, A = N(Yt, p), tt = N(Yt, f), ot = (J, lt) => (J || A())[R] - (lt || tt())[R], it = Ue(Yt(s)[E]) / le(s)[I] || 1, d = $(ee(s)[_] || 0, 1 / it), m = y[h], g = A(), b = tt(), x = g[E], k = ot(g, b) + x / 2, M = m - b[R], U = O ? 0 : M - k, q = (J) => {
            bt(at), C.releasePointerCapture(J.pointerId);
          }, at = [ae(n, mt, Kn), nt(c, v, q), nt(c, "selectstart", (J) => Lo(J), {
            H: !1
          }), nt(f, v, q), nt(f, "pointermove", (J) => {
            const lt = J[h] - m;
            (O || K) && d(U + lt);
          })];
          if (C.setPointerCapture(y.pointerId), K)
            d(U);
          else if (!O) {
            const J = oe(bs);
            J && Q(at, J(d, ot, U, x, M));
          }
        }
      });
    };
    let w = !0;
    return N(bt, [nt(i, "pointerenter", () => {
      l(No, !0);
    }), nt(i, "pointerleave pointercancel", () => {
      l(No, !1);
    }), nt(i, "wheel", (v) => {
      const { deltaX: $, deltaY: y, deltaMode: O } = v;
      S && w && O === 0 && Qt(i) === n && s.scrollBy({
        left: $,
        top: y,
        behavior: "smooth"
      }), w = !1, l(_o, !0), T(() => {
        w = !0, l(_o);
      }), Lo(v);
    }, {
      H: !1,
      I: !0
    }), nt(p, "transitionstart", (v) => {
      if (F(v)) {
        const $ = () => {
          D(), H($);
        };
        $();
      }
    }), nt(p, "transitionend transitioncancel", (v) => {
      F(v) && (P(), D());
    }), nt(i, "mousedown", N(nt, c, "click", fo, {
      A: !0,
      I: !0
    }), {
      I: !0
    }), z(), L, P]);
  };
}, As = (t, e, o, n, s, c) => {
  let r, l, a, u, i, f = wt, p = 0;
  const [T, L] = Dt(), [H, P] = Dt(), [D, S] = Dt(100), [h, E] = Dt(100), [R, I] = Dt(100), [_, F] = Dt(() => p), [z, w] = Os(t, s, n, $s(e, s, n)), { bt: v, Zt: $, Rt: y } = s, { Ft: O, Bt: C, Nt: V, jt: j } = z, W = (A) => {
    O(so, A, !0), O(so, A, !1);
  }, B = (A, tt) => {
    if (F(), A)
      O(zo);
    else {
      const ot = N(O, zo, !0);
      p > 0 && !tt ? _(ot) : ot();
    }
  }, Z = (A) => A.pointerType === "mouse", et = (A) => {
    Z(A) && (u = l, u && B(!0));
  }, K = [S, F, E, I, P, L, () => f(), nt(v, "pointerover", et, {
    A: !0
  }), nt(v, "pointerenter", et), nt(v, "pointerleave", (A) => {
    Z(A) && (u = !1, l && B(!1));
  }), nt(v, "pointermove", (A) => {
    Z(A) && r && T(() => {
      S(), B(!0), h(() => {
        r && B(!1);
      });
    });
  }), nt($, "scroll", (A) => {
    H(() => {
      V(), a && B(!0), D(() => {
        a && !u && B(!1);
      });
    }), c(A), j();
  })];
  return [() => N(bt, Q(K, w())), ({ Et: A, Tt: tt, Gt: ot, Qt: it }) => {
    const { tn: d, nn: m, sn: g } = it || {}, { Ct: b, dt: x } = ot || {}, { N: k } = o, { T: M } = vt(), { k: U, en: q } = n, [rt, at] = A("showNativeOverlaidScrollbars"), [J, lt] = A("scrollbars.theme"), [Nt, X] = A("scrollbars.visibility"), [ct, ut] = A("scrollbars.autoHide"), [dt, st] = A("scrollbars.autoHideSuspend"), [pt] = A("scrollbars.autoHideDelay"), [Vt, Ut] = A("scrollbars.dragScroll"), [Ct, zt] = A("scrollbars.clickScroll"), [Ht, Me] = A("overflow"), kt = x && !tt, Ne = q.x || q.y, ne = d || m || b || tt, fe = g || X || Me, pe = rt && M.x && M.y, se = (ce, jt, vo) => {
      const yo = ce.includes("scroll") && (Nt === "visible" || Nt === "auto" && jt === "scroll");
      return O(is, yo, vo), yo;
    };
    if (p = pt, kt && (dt && Ne ? (W(!1), f(), R(() => {
      f = nt($, "scroll", N(W, !0), {
        A: !0
      });
    })) : W(!0)), at && O(ss, pe), lt && (O(i), O(J, !0), i = J), st && !dt && W(!0), ut && (r = ct === "move", l = ct === "leave", a = ct !== "never", B(!a, !0)), Ut && O(ds, Vt), zt && O(us, Ct), fe) {
      const ce = se(Ht.x, U.x, !0), jt = se(Ht.y, U.y, !1);
      O(as, !(ce && jt));
    }
    ne && (C(), V(), j(), O(Vo, !q.x, !0), O(Vo, !q.y, !1), O(cs, k && !y));
  }, {}, z];
}, Ls = (t) => {
  const e = vt(), { G: o, L: n } = e, { elements: s } = o(), { host: c, padding: r, viewport: l, content: a } = s, u = re(t), i = u ? {} : t, { elements: f } = i, { host: p, padding: T, viewport: L, content: H } = f || {}, P = u ? t : i.target, D = Ze(P, "textarea"), S = P.ownerDocument, h = S.documentElement, E = P === S.body, R = S.defaultView, I = () => S.activeElement, _ = (X) => {
    X && X.focus && X.focus();
  }, F = N(ys, [P]), z = N(On, [P]), w = N(ho, [P]), v = N(Gt, ""), $ = N(F, v, l), y = N(z, v, a), O = $(L), C = O === P, V = C && E, j = !C && y(H), W = !C && re(O) && O === j, B = W && !!w(a), Z = B ? $() : O, et = B ? j : y(), A = V ? h : W ? Z : O, tt = D ? F(v, c, p) : P, ot = V ? A : tt, it = W ? et : j, d = {
    gt: P,
    bt: ot,
    D: A,
    cn: !C && z(v, r, T),
    wt: it,
    kt: V ? h : A,
    Zt: V ? S : A,
    rn: E ? h : P,
    ln: R,
    Kt: S,
    St: D,
    Rt: E,
    Dt: u,
    V: C,
    an: W,
    yt: (X) => Fn(A, C ? mt : Rt, X),
    Ot: (X, ct) => be(A, C ? mt : Rt, X, ct)
  }, m = Lt(d).reduce((X, ct) => {
    const ut = d[ct];
    return Q(X, ut && re(ut) && !Qt(ut) ? ut : !1);
  }, []), g = (X) => X ? He(m, X) : null, { gt: b, bt: x, cn: k, D: M, wt: U } = d, q = [() => {
    Tt(x, [mt, Be]), Tt(b, Be), E && Tt(h, [Be, mt]);
  }], rt = D && g(x);
  let at = D ? b : Ke([U, M, k, x, b].find((X) => g(X) === !1));
  const J = V ? b : U || M, lt = N(bt, q);
  return [d, () => {
    const X = I(), ct = (st) => {
      gt(Qt(st), Ke(st)), Pt(st);
    }, ut = (st) => st ? nt(st, "focusin focusout focus blur", (pt) => {
      fo(pt), pt.stopImmediatePropagation();
    }, {
      I: !0,
      H: !1
    }) : wt, dt = ut(X);
    if (yt(x, mt, C ? "viewport" : "host"), yt(k, no, ""), yt(U, Mo, ""), C || (yt(M, Rt, ""), E && ae(h, mt, Jn)), rt && (To(b, x), Q(q, () => {
      To(x, b), Pt(x);
    })), gt(J, at), gt(x, k), gt(k || x, !C && M), gt(M, U), Q(q, [dt, () => {
      const st = I(), pt = ut(st);
      Tt(k, no), Tt(U, Mo), Tt(M, [bn, vn, Rt]), g(U) && ct(U), g(M) && ct(M), g(k) && ct(k), _(st), pt();
    }]), n && !C && (ae(M, Rt, xn), Q(q, N(Tt, M, Rt))), !C && R.top === R && X === P) {
      const st = "tabindex", pt = Re(M, st);
      yt(M, st, "-1"), _(M);
      const Vt = () => pt ? yt(M, st, pt) : Tt(M, st), Ut = nt(S, "pointerdown keydown", () => {
        Vt(), Ut();
      });
      Q(q, [Vt, Ut]);
    } else
      _(X);
    return dt(), at = 0, lt;
  }, lt];
}, Hs = ({ wt: t }) => ({ Gt: e, un: o, Tt: n }) => {
  const { xt: s } = e || {}, { $t: c } = o;
  t && (s || n) && te(t, {
    [Kt]: c && "100%"
  });
}, ks = ({ bt: t, cn: e, D: o, V: n }, s) => {
  const [c, r] = xt({
    u: Bn,
    o: $o()
  }, N($o, t, "padding", ""));
  return ({ Et: l, Gt: a, un: u, Tt: i }) => {
    let [f, p] = r(i);
    const { L: T } = vt(), { ht: L, Ht: H, Ct: P } = a || {}, { N: D } = u, [S, h] = l("paddingAbsolute");
    (L || p || (i || H)) && ([f, p] = c(i));
    const R = !n && (h || P || p);
    if (R) {
      const I = !S || !e && !T, _ = f.r + f.l, F = f.t + f.b, z = {
        [Qo]: I && !D ? -_ : 0,
        [tn]: I ? -F : 0,
        [Jo]: I && D ? -_ : 0,
        top: I ? -f.t : 0,
        right: I ? D ? -f.r : "auto" : 0,
        left: I ? D ? "auto" : -f.l : 0,
        [Zt]: I && `calc(100% + ${_}px)`
      }, w = {
        [Yo]: I ? f.t : 0,
        [qo]: I ? f.r : 0,
        [Ko]: I ? f.b : 0,
        [Zo]: I ? f.l : 0
      };
      te(e || o, z), te(o, w), G(s, {
        cn: f,
        fn: !I,
        j: e ? w : G({}, z, w)
      });
    }
    return {
      _n: R
    };
  };
}, Ds = (t, e) => {
  const o = vt(), { bt: n, cn: s, D: c, V: r, Ot: l, Rt: a, ln: u } = t, { L: i } = o, f = a && r, p = N(he, 0), T = {
    u: on,
    o: {
      w: 0,
      h: 0
    }
  }, L = {
    u: nn,
    o: {
      x: Jt,
      y: Jt
    }
  }, H = (w, v) => {
    const $ = ht.devicePixelRatio % 1 !== 0 ? 1 : 0, y = {
      w: p(w.w - v.w),
      h: p(w.h - v.h)
    };
    return {
      w: y.w > $ ? y.w : 0,
      h: y.h > $ ? y.h : 0
    };
  }, [P, D] = xt(T, N(uo, c)), [S, h] = xt(T, N(Qe, c)), [E, R] = xt(T), [I, _] = xt(T), [F] = xt(L), z = oe(go);
  return ({ Et: w, Gt: v, un: $, Tt: y }, { _n: O }) => {
    const { ht: C, Ht: V, Ct: j, zt: W } = v || {}, B = z && z.M(t, e, $, o, w), { q: Z, W: et, X: K } = B || {}, [A, tt] = gs(w, o), [ot, it] = w("overflow"), d = C || O || V || j || W || tt, m = Ce(ot.x), g = Ce(ot.y), b = m || g;
    let x = D(y), k = h(y), M = R(y), U = _(y), q;
    if (tt && i && l(xn, !A), d) {
      b && l(qt, !1);
      const [Ct, zt] = et ? et(q) : [], [Ht, Me] = x = P(y), [kt, Ne] = k = S(y), ne = pn(c), fe = kt, pe = ne;
      Ct && Ct(), (Ne || Me || tt) && zt && !A && Z && Z(zt, kt, Ht);
      const se = Gn(u), ce = {
        w: p(he(kt.w, fe.w) + Ht.w),
        h: p(he(kt.h, fe.h) + Ht.h)
      }, jt = {
        w: p((f ? se.w : pe.w + p(ne.w - kt.w)) + Ht.w),
        h: p((f ? se.h : pe.h + p(ne.h - kt.h)) + Ht.h)
      };
      U = I(jt), M = E(H(ce, jt), y);
    }
    const [rt, at] = U, [J, lt] = M, [Nt, X] = k, [ct, ut] = x, dt = {
      x: J.w > 0,
      y: J.h > 0
    }, st = m && g && (dt.x || dt.y) || m && dt.x && !dt.y || g && dt.y && !dt.x;
    if (O || j || W || ut || X || at || lt || it || tt || d) {
      const Ct = {}, zt = hs(t, dt, ot, Ct);
      K && K(zt, $, !!Z && Z(zt, Nt, ct), Ct), r ? (yt(n, bn, Ct[ke]), yt(n, vn, Ct[De])) : te(c, Ct);
    }
    be(n, mt, yn, st), be(s, no, ts, st), r || be(c, Rt, qt, b);
    const [Vt, Ut] = F(En(t).k);
    return G(e, {
      k: Vt,
      Pt: {
        x: rt.w,
        y: rt.h
      },
      Lt: {
        x: J.w,
        y: J.h
      },
      en: dt
    }), {
      sn: Ut,
      tn: at,
      nn: lt
    };
  };
}, Rs = (t) => {
  const [e, o, n] = Ls(t), s = {
    cn: {
      t: 0,
      r: 0,
      b: 0,
      l: 0
    },
    fn: !1,
    j: {
      [Qo]: 0,
      [tn]: 0,
      [Jo]: 0,
      [Yo]: 0,
      [qo]: 0,
      [Ko]: 0,
      [Zo]: 0
    },
    Pt: {
      x: 0,
      y: 0
    },
    Lt: {
      x: 0,
      y: 0
    },
    k: {
      x: Jt,
      y: Jt
    },
    en: {
      x: !1,
      y: !1
    }
  }, { gt: c, D: r, V: l } = e, { L: a, T: u } = vt(), i = !a && (u.x || u.y), f = [Hs(e), ks(e, s), Ds(e, s)];
  return [o, (p) => {
    const T = {}, H = i && ee(r), P = l ? ae(r, mt, oo) : wt;
    return Y(f, (D) => {
      G(T, D(p, T) || {});
    }), P(), Mt(r, H), !l && Mt(c, 0), T;
  }, s, e, n];
}, Is = (t, e, o, n) => {
  const s = Po(e, {}), [c, r, l, a, u] = Rs(t), [i, f, p] = Es(a, l, s, (S) => {
    D({}, S);
  }), [T, L, , H] = As(t, e, p, l, a, n), P = (S) => Lt(S).some((h) => !!S[h]), D = (S, h) => {
    const { dn: E, Tt: R, At: I, vn: _ } = S, F = E || {}, z = !!R, w = {
      Et: Po(e, F, z),
      dn: F,
      Tt: z
    };
    if (_)
      return L(w), !1;
    const v = h || f(G({}, w, {
      At: I
    })), $ = r(G({}, w, {
      un: p,
      Gt: v
    }));
    L(G({}, w, {
      Gt: v,
      Qt: $
    }));
    const y = P(v), O = P($), C = y || O || !lo(F) || z;
    return C && o(S, {
      Gt: v,
      Qt: $
    }), C;
  };
  return [() => {
    const { rn: S, D: h } = a, E = ee(S), R = [i(), c(), T()];
    return Mt(h, E), N(bt, R);
  }, D, () => ({
    hn: p,
    pn: l
  }), {
    gn: a,
    bn: H
  }, u];
}, Ft = (t, e, o) => {
  const { nt: n } = vt(), s = re(t), c = s ? t : t.target, r = $n(c);
  if (e && !r) {
    let l = !1;
    const a = [], u = {}, i = (w) => {
      const v = rn(w), $ = oe(ps);
      return $ ? $(v, !0) : v;
    }, f = G({}, n(), i(e)), [p, T, L] = eo(), [H, P, D] = eo(o), S = (w, v) => {
      D(w, v), L(w, v);
    }, [h, E, R, I, _] = Is(t, f, ({ dn: w, Tt: v }, { Gt: $, Qt: y }) => {
      const { ht: O, Ct: C, xt: V, Ht: j, It: W, dt: B } = $, { tn: Z, nn: et, sn: K } = y;
      S("updated", [z, {
        updateHints: {
          sizeChanged: !!O,
          directionChanged: !!C,
          heightIntrinsicChanged: !!V,
          overflowEdgeChanged: !!Z,
          overflowAmountChanged: !!et,
          overflowStyleChanged: !!K,
          contentMutation: !!j,
          hostMutation: !!W,
          appear: !!B
        },
        changedOptions: w || {},
        force: !!v
      }]);
    }, (w) => S("scroll", [z, w])), F = (w) => {
      Ss(c), bt(a), l = !0, S("destroyed", [z, w]), T(), P();
    }, z = {
      options(w, v) {
        if (w) {
          const $ = v ? n() : {}, y = gn(f, G($, i(w)));
          lo(y) || (G(f, y), E({
            dn: y
          }));
        }
        return G({}, f);
      },
      on: H,
      off: (w, v) => {
        w && v && P(w, v);
      },
      state() {
        const { hn: w, pn: v } = R(), { N: $ } = w, { Pt: y, Lt: O, k: C, en: V, cn: j, fn: W } = v;
        return G({}, {
          overflowEdge: y,
          overflowAmount: O,
          overflowStyle: C,
          hasOverflow: V,
          padding: j,
          paddingAbsolute: W,
          directionRTL: $,
          destroyed: l
        });
      },
      elements() {
        const { gt: w, bt: v, cn: $, D: y, wt: O, kt: C, Zt: V } = I.gn, { qt: j, Jt: W } = I.bn, B = (et) => {
          const { Vt: K, Mt: A, Ut: tt } = et;
          return {
            scrollbar: tt,
            track: A,
            handle: K
          };
        }, Z = (et) => {
          const { Wt: K, Xt: A } = et, tt = B(K[0]);
          return G({}, tt, {
            clone: () => {
              const ot = B(A());
              return E({
                vn: !0
              }), ot;
            }
          });
        };
        return G({}, {
          target: w,
          host: v,
          padding: $ || y,
          viewport: y,
          content: O || y,
          scrollOffsetElement: C,
          scrollEventElement: V,
          scrollbarHorizontal: Z(j),
          scrollbarVertical: Z(W)
        });
      },
      update: (w) => E({
        Tt: w,
        At: !0
      }),
      destroy: N(F, !1),
      plugin: (w) => u[Lt(w)[0]]
    };
    return Q(a, [_]), ws(c, z), Tn(Sn, Ft, [z, p, u]), xs(I.gn.Rt, !s && t.cancel) ? (F(!0), z) : (Q(a, h()), S("initialized", [z]), z.update(!0), z);
  }
  return r;
};
Ft.plugin = (t) => {
  const e = St(t), o = e ? t : [t], n = o.map((s) => Tn(s, Ft)[0]);
  return fs(o), e ? n : n[0];
};
Ft.valid = (t) => {
  const e = t && t.elements, o = $t(e) && e();
  return xe(o) && !!$n(o.target);
};
Ft.env = () => {
  const { P: t, T: e, L: o, K: n, J: s, st: c, et: r, G: l, tt: a, nt: u, ot: i } = vt();
  return G({}, {
    scrollbarsSize: t,
    scrollbarsOverlaid: e,
    scrollbarsHiding: o,
    rtlScrollBehavior: n,
    scrollTimeline: s,
    staticDefaultInitialization: c,
    staticDefaultOptions: r,
    getDefaultInitialization: l,
    setDefaultInitialization: a,
    getDefaultOptions: u,
    setDefaultOptions: i
  });
};
const Ln = Te(999999), We = Te(380), Ps = () => {
  Dn("das-ui-text", [
    {
      className: ".das-ui-text-context",
      style: { position: "relative", overflow: "hidden", "text-overflow": "ellipsis", "white-space": "nowrap", "letter-spacing": "-0.1px" }
    },
    {
      className: "#das-ui-text-tooltip",
      style: {
        position: "fixed",
        "z-index": Ln.value
        // 'box-shadow': `0px 4px 10px 0px ${getVarValue('--das-ui-text-tooltip-shadow').value}`,
      }
    },
    {
      className: "#das-ui-text-tooltip-context",
      style: {
        "box-sizing": "border-box",
        "max-width": "380px",
        "max-height": "114px",
        padding: "10px",
        "font-size": "12px",
        color: Et("--das-ui-text-tooltip-text-color").value,
        background: Et("--das-ui-text-tooltip-bgcolor").value,
        "border-radius": "2px",
        // 'word-break': 'break-all',
        "line-height": 1.5,
        "overflow-y": "hidden"
      }
    },
    {
      className: "#das-ui-text-tooltip-context *",
      style: {
        color: "#212121 !important"
      }
    },
    // {
    //   className: '#das-ui-text-tooltip:after',
    //   style: {
    //     content: '',
    //     position: 'absolute',
    //     height: '12px',
    //     width: '8px',
    //     'background-color': getVarValue('--das-ui-text-tooltip-bgcolor').value,
    //     'box-shadow': '3px 3px 5px rgba(0, 0, 0, 0.15)',
    //     'border-color': getVarValue('--das-ui-dropdown-bgff-color').value,
    //     'border-radius': '0',
    //     'z-index': '-1',
    //     transform: 'rotate(45deg)',
    //     bottom: '-4px',
    //     left: '10px',
    //   },
    // },
    {
      className: "#tooltip-scroll-content",
      style: {
        width: "100%",
        height: "100%"
      }
    },
    {
      className: ".das-scrollbar",
      style: {
        " --os-handle-bg": Et("--das-ui-scrollbar-thumb-color").value,
        "--os-handle-bg-hover": Et("--das-ui-scrollbar-thumb-hover-color").value,
        "--os-handle-bg-active": Et("--das-ui-scrollbar-thumb-hover-color").value,
        "--os-padding-perpendicular": Et("--das-ui-scrollbar-padding").value,
        "--os-size": "10px",
        "box-sizing": "border-box",
        ":hover": {
          // 悬浮时滚动条变大
          "--os-padding-perpendicular": 0
        }
      }
    }
  ]);
}, Hn = (t) => {
  window.inTextTooltip = !0, t.stopPropagation();
}, ge = Te(0);
let kn = Te(null);
const ve = () => {
  var o;
  clearTimeout(kn.value);
  const t = document.getElementById("das-ui-text-tooltip");
  t && ((o = document.body) == null || o.removeChild(t)), window.inTextTooltip = !1;
  const e = document.getElementById("das-ui-text-tooltip-context");
  e && e.removeEventListener("mouseover", Hn);
}, Fo = (t) => {
  let e = document.getElementById("das-ui-text-tooltip");
  const o = t.clientX, n = t.clientY, s = e == null ? void 0 : e.getBoundingClientRect();
  if (e && o >= s.left && o <= s.right && n >= s.top && n <= s.bottom)
    return !0;
  ve();
}, Ms = async (t, e) => {
  let o = t;
  return e.target && (typeof e.target == "string" && (o = e.target), typeof e.target == "function" && (o = await e.target(t))), o;
}, Ws = {
  beforeMount() {
    Ps();
  },
  async mounted(t, e, o) {
    const n = (o ? e.value : e) || {};
    let s = (n == null ? void 0 : n.deep) ?? !0;
    if ((n == null ? void 0 : n.disabled) ?? !1) {
      const i = document.querySelectorAll(".das-ui-text-context");
      i.length && (i[0].style.textOverflow = "auto", i[0].style.overflow = "visible");
      return;
    }
    let r = (n == null ? void 0 : n.customContent) || "";
    ge.value === 0 && window.addEventListener("wheel", Fo), ge.value++;
    let l = await Ms(t, n);
    const a = l.classList;
    l.dataset.customContent = r;
    let u = !0;
    a.contains("das-ui-text-context") || a.add("das-ui-text-context"), l.onmouseenter = (i) => {
      const p = i.composedPath()[0], { x: T, y: L, width: H, height: P, top: D, left: S, bottom: h, right: E } = p.getBoundingClientRect(), R = window.getComputedStyle(p, null), I = parseFloat(R.getPropertyValue("padding-left"));
      Ln.value = Pn().nextZIndex();
      const _ = document.createRange();
      _.setStart(l, 0);
      let F = s ? l.childNodes.length : 1;
      _.setEnd(l, F);
      const z = parseFloat(R.paddingRight), w = parseFloat(R.paddingLeft), v = Math.round(_.getBoundingClientRect().width), $ = Math.round(l.getBoundingClientRect().width) - z - w;
      if (v > $) {
        const O = (window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth) - E;
        setTimeout(async () => {
          let C = document.getElementById("das-ui-text-tooltip");
          if (!C) {
            C = document.createElement("div"), C.style.cssText = `left: ${T + I}px;`, C.setAttribute("id", "das-ui-text-tooltip");
            const B = document.createElement("div");
            B.setAttribute("id", "das-ui-text-tooltip-context"), B && (B.style.wordBreak = xo.value == "zh-CN" ? "break-all" : "normal"), B.addEventListener("mouseover", Hn);
            const Z = document.createElement("div");
            Z.setAttribute("id", "tooltip-scroll-content"), B.appendChild(Z), C.appendChild(B), document.body.appendChild(C);
            const et = "os-theme-dark das-scrollbar", K = document.getElementById("tooltip-scroll-content");
            if (K) {
              K.innerHTML = l.dataset.customContent || l.innerHTML;
              const A = {
                scrollbars: {
                  autoHide: "leave",
                  autoHideDelay: 0,
                  theme: et
                },
                overflow: { y: "scroll" }
              };
              l.dataset.customContent ? kn.value = setTimeout(() => {
                Ft(B, A);
              }, 10) : Ft(B, A);
            }
          }
          const V = document.createElement("span");
          if (V.textContent = "", V.style.position = "absolute", V.style.height = "12px", V.style.width = "8px", V.style.backgroundColor = Et("--das-ui-text-tooltip-bgcolor").value, V.style.boxShadow = "3px 3px 5px rgba(0, 0, 0, 0.15)", V.style.borderColor = Et("--das-ui-dropdown-bgff-color").value, V.style.borderRadius = "0px", V.style.zIndex = "-1", V.style.transform = "rotate(45deg)", V.style.left = "10px", O + H <= We.value) {
            let B = C.offsetWidth >= We.value ? We.value : C.offsetWidth;
            C.style.cssText = `left: ${T + I - B / 4}px;`, V.style.left = `${B / 2}px`;
          }
          C.appendChild(V);
          let j = l.dataset.customContent && xo.value != "zh-CN" ? C.offsetHeight - 10 : C.offsetHeight, W = L - 10 - j;
          W * 1 < 0 ? (C.style.top = `${h + 5}px`, V.style.top = "-4px", V.style.boxShadow = "3px -3px 5px rgba(0, 0, 0, 0.15)", C.style.boxShadow = `0px -4px 10px 0px ${Et("--das-ui-text-tooltip-shadow").value}`) : (C.style.top = `${W}px`, V.style.bottom = "-4px", C.style.boxShadow = `0px 4px 10px 0px ${Et("--das-ui-text-tooltip-shadow").value}`), C.onmouseenter = (B) => {
            u = !1;
          }, C.onmouseleave = (B) => {
            u = !0, setTimeout(() => {
              ve();
            }, 200);
          };
        }, 200);
      }
    }, l.onmouseleave = (i) => {
      setTimeout(() => {
        u && ve();
      }, 200);
    };
  },
  // 指令与元素解绑时
  unmounted() {
    ve(), ge.value--, ge.value === 0 && window.removeEventListener("wheel", Fo);
  }
}, Ns = {
  "--demo-alert-bg": {
    light: "#fff",
    dark: "rgba(255,255,255,.2)"
  },
  "--das-ui-text-tooltip-shadow": "rgba(0, 0, 0, 0.2)",
  "--das-ui-text-tooltip-bgcolor": "#fff",
  "--das-ui-text-tooltip-text-color": Rn("--das-ui-color-normal")
};
In(Ns);
export {
  Ws as default,
  Ws as vDasTooltip
};
