import { animate as e, makeEaseOut as t } from "./utils.js";
import "./downloadContent.js";
function n(e, t) {
	let n = e.scrollTop, r = e.getBoundingClientRect().height, i = t.offsetTop;
	return i + t.getBoundingClientRect().height < r + n && i > n;
}
function r(e, t) {
	let n = e.scrollTop, r = e.getBoundingClientRect().height, i = t.offsetTop;
	return i + t.getBoundingClientRect().height < r + n ? "ceil" : i > n ? "floor" : "visible";
}
function i(i, a, o = {}) {
	let s = i.scrollTop, c = i.getBoundingClientRect().height, l = a.getBoundingClientRect().height, u = a.offsetTop, d = r(i, a);
	d !== "visible" && (n(i, a) || e({
		duration: o.duration || 100,
		timing: t((e) => e),
		draw: (e) => {
			i.scrollTop = s + e * ((d === "floor" ? u - (c - l) : u) - s);
		}
	}));
}
function a(e, t, n, r) {
	return e.addEventListener(t, n, r), function() {
		e.removeEventListener(t, n);
	};
}
function o(e, t) {
	let n = t.getBoundingClientRect();
	return e.x < n.x || e.x > n.x + n.width || e.y < n.y || e.y > n.y + n.height;
}
export { o as detectOutside, a as eventListener, r as getElementScrollPosition, n as isElementVisible, i as scrollIntoView };

//# sourceMappingURL=dom.js.map