import { useEventListener as e } from "./useEventListener.js";
import { requestTick as t } from "../helpers/utils.js";
import { onMounted as n } from "vue";
function r(r, i) {
	let a = t(() => {
		if (r.value) {
			let { scrollTop: e, scrollLeft: t, scrollHeight: n, scrollWidth: a, clientHeight: o, clientWidth: s } = document.documentElement, c = r.value.getBoundingClientRect();
			i({
				scrollTop: e,
				scrollLeft: t,
				scrollHeight: n,
				scrollWidth: a,
				clientHeight: o,
				clientWidth: s,
				offsetY: e + c.y,
				offsetX: t + c.x,
				top: c.top,
				right: c.right,
				bottom: c.bottom,
				left: c.left,
				width: c.width,
				height: c.height,
				x: c.x,
				y: c.y
			});
		}
	});
	n(a), e(window, "scroll", a, {
		capture: !0,
		passive: !0
	}), e(window, "resize", a, { passive: !0 }), e(window, "adjust", a, !0);
}
export { r as useElementPosition };

//# sourceMappingURL=usePosition.js.map