import p from "./getBoundingClientRect.js";
import g from "./getNodeScroll.js";
import a from "./getNodeName.js";
import { isHTMLElement as n } from "./instanceOf.js";
import h from "./getWindowScrollBarX.js";
import u from "./getDocumentElement.js";
import s from "./isScrollParent.js";
import { round as d } from "../utils/math.js";
function v(e) {
  var t = e.getBoundingClientRect(), o = d(t.width) / e.offsetWidth || 1, l = d(t.height) / e.offsetHeight || 1;
  return o !== 1 || l !== 1;
}
function C(e, t, o) {
  o === void 0 && (o = !1);
  var l = n(t), f = n(t) && v(t), c = u(t), i = p(e, f, o), m = {
    scrollLeft: 0,
    scrollTop: 0
  }, r = {
    x: 0,
    y: 0
  };
  return (l || !l && !o) && ((a(t) !== "body" || // https://github.com/popperjs/popper-core/issues/1078
  s(c)) && (m = g(t)), n(t) ? (r = p(t, !0), r.x += t.clientLeft, r.y += t.clientTop) : c && (r.x = h(c))), {
    x: i.left + m.scrollLeft - r.x,
    y: i.top + m.scrollTop - r.y,
    width: i.width,
    height: i.height
  };
}
export {
  C as default
};
//# sourceMappingURL=getCompositeRect.js.map
