let t;
function o() {
  if (t)
    return t;
  const e = document.createElement("div"), l = document.createElement("div");
  return l.style.width = "10px", l.style.height = "1px", e.appendChild(l), e.dir = "rtl", e.style.fontSize = "14px", e.style.width = "4px", e.style.height = "1px", e.style.position = "absolute", e.style.top = "-1000px", e.style.overflow = "scroll", document.body.appendChild(e), t = "reverse", e.scrollLeft > 0 ? t = "default" : (e.scrollLeft = 1, e.scrollLeft === 0 && (t = "negative")), document.body.removeChild(e), t;
}
function i(e, l) {
  const r = e.scrollLeft;
  if (l !== "rtl")
    return r;
  switch (o()) {
    case "negative":
      return e.scrollWidth - e.clientWidth + r;
    case "reverse":
      return e.scrollWidth - e.clientWidth - r;
    default:
      return r;
  }
}
export {
  o as detectScrollType,
  i as getNormalizedScrollLeft
};
