var p = function(r) {
  return r.tagName === "TEXTAREA";
}, w = function(r, e) {
  var o = window.getComputedStyle(r);
  return (
    // not-not-scrollable
    o[e] !== "hidden" && // contains scroll inside self
    !(o.overflowY === o.overflowX && !p(r) && o[e] === "visible")
  );
}, y = function(r) {
  return w(r, "overflowY");
}, H = function(r) {
  return w(r, "overflowX");
}, R = function(r, e) {
  var o = e.ownerDocument, t = e;
  do {
    typeof ShadowRoot < "u" && t instanceof ShadowRoot && (t = t.host);
    var v = g(r, t);
    if (v) {
      var n = b(r, t), a = n[1], l = n[2];
      if (a > l)
        return !0;
    }
    t = t.parentNode;
  } while (t && t !== o.body);
  return !1;
}, B = function(r) {
  var e = r.scrollTop, o = r.scrollHeight, t = r.clientHeight;
  return [
    e,
    o,
    t
  ];
}, V = function(r) {
  var e = r.scrollLeft, o = r.scrollWidth, t = r.clientWidth;
  return [
    e,
    o,
    t
  ];
}, g = function(r, e) {
  return r === "v" ? y(e) : H(e);
}, b = function(r, e) {
  return r === "v" ? B(e) : V(e);
}, D = function(r, e) {
  return r === "h" && e === "rtl" ? -1 : 1;
}, W = function(r, e, o, t, v) {
  var n = D(r, window.getComputedStyle(e).direction), a = n * t, l = o.target, f = e.contains(l), c = !1, d = a > 0, s = 0, h = 0;
  do {
    var i = b(r, l), u = i[0], m = i[1], C = i[2], S = m - C - n * u;
    (u || S) && g(r, l) && (s += S, h += u), l instanceof ShadowRoot ? l = l.host : l = l.parentNode;
  } while (
    // portaled content
    !f && l !== document.body || // self content
    f && (e.contains(l) || e === l)
  );
  return (d && Math.abs(s) < 1 || !d && Math.abs(h) < 1) && (c = !0), c;
};
export {
  W as handleScroll,
  R as locationCouldBeScrolled
};
//# sourceMappingURL=handleScroll.js.map
