import { isHTMLElement as L } from "../../../../../../@floating-ui_utils@0.2.10/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js";
const d = "ArrowUp", h = "ArrowDown", R = "ArrowLeft", T = "ArrowRight", e = "Home", n = "End", P = /* @__PURE__ */ new Set([R, T]), H = /* @__PURE__ */ new Set([R, T, e, n]), E = /* @__PURE__ */ new Set([d, h]), Y = /* @__PURE__ */ new Set([d, h, e, n]), A = /* @__PURE__ */ new Set([...P, ...E]), F = /* @__PURE__ */ new Set([...A, e, n]), N = /* @__PURE__ */ new Set([d, h, R, T, e, n]), O = "Shift", u = "Control", W = "Alt", _ = "Meta", K = /* @__PURE__ */ new Set([O, u, W, _]);
function w(t) {
  return L(t) && t.tagName === "INPUT";
}
function B(t) {
  return !!(w(t) && t.selectionStart != null || L(t) && t.tagName === "TEXTAREA");
}
function y(t, o, f, c) {
  if (!t || !o || !o.scrollTo)
    return;
  let r = t.scrollLeft, a = t.scrollTop;
  const S = t.clientWidth < t.scrollWidth, M = t.clientHeight < t.scrollHeight;
  if (S && c !== "vertical") {
    const s = p(t, o, "left"), l = g(t), i = g(o);
    f === "ltr" && (s + o.offsetWidth + i.scrollMarginRight > t.scrollLeft + t.clientWidth - l.scrollPaddingRight ? r = s + o.offsetWidth + i.scrollMarginRight - t.clientWidth + l.scrollPaddingRight : s - i.scrollMarginLeft < t.scrollLeft + l.scrollPaddingLeft && (r = s - i.scrollMarginLeft - l.scrollPaddingLeft)), f === "rtl" && (s - i.scrollMarginRight < t.scrollLeft + l.scrollPaddingLeft ? r = s - i.scrollMarginLeft - l.scrollPaddingLeft : s + o.offsetWidth + i.scrollMarginRight > t.scrollLeft + t.clientWidth - l.scrollPaddingRight && (r = s + o.offsetWidth + i.scrollMarginRight - t.clientWidth + l.scrollPaddingRight));
  }
  if (M && c !== "horizontal") {
    const s = p(t, o, "top"), l = g(t), i = g(o);
    s - i.scrollMarginTop < t.scrollTop + l.scrollPaddingTop ? a = s - i.scrollMarginTop - l.scrollPaddingTop : s + o.offsetHeight + i.scrollMarginBottom > t.scrollTop + t.clientHeight - l.scrollPaddingBottom && (a = s + o.offsetHeight + i.scrollMarginBottom - t.clientHeight + l.scrollPaddingBottom);
  }
  t.scrollTo({
    left: r,
    top: a,
    behavior: "auto"
  });
}
function p(t, o, f) {
  const c = f === "left" ? "offsetLeft" : "offsetTop";
  let r = 0;
  for (; o.offsetParent && (r += o[c], o.offsetParent !== t); )
    o = o.offsetParent;
  return r;
}
function g(t) {
  const o = getComputedStyle(t);
  return {
    scrollMarginTop: parseFloat(o.scrollMarginTop) || 0,
    scrollMarginRight: parseFloat(o.scrollMarginRight) || 0,
    scrollMarginBottom: parseFloat(o.scrollMarginBottom) || 0,
    scrollMarginLeft: parseFloat(o.scrollMarginLeft) || 0,
    scrollPaddingTop: parseFloat(o.scrollPaddingTop) || 0,
    scrollPaddingRight: parseFloat(o.scrollPaddingRight) || 0,
    scrollPaddingBottom: parseFloat(o.scrollPaddingBottom) || 0,
    scrollPaddingLeft: parseFloat(o.scrollPaddingLeft) || 0
  };
}
export {
  F as ALL_KEYS,
  W as ALT,
  h as ARROW_DOWN,
  A as ARROW_KEYS,
  R as ARROW_LEFT,
  T as ARROW_RIGHT,
  d as ARROW_UP,
  N as COMPOSITE_KEYS,
  u as CONTROL,
  n as END,
  e as HOME,
  P as HORIZONTAL_KEYS,
  H as HORIZONTAL_KEYS_WITH_EXTRA_KEYS,
  _ as META,
  K as MODIFIER_KEYS,
  O as SHIFT,
  E as VERTICAL_KEYS,
  Y as VERTICAL_KEYS_WITH_EXTRA_KEYS,
  B as isNativeInput,
  y as scrollIntoViewIfNeeded
};
