function u(n) {
  return n != null && n === n.window;
}
function d(n, i) {
  var f, o;
  if (typeof window > "u")
    return 0;
  const l = i ? "scrollTop" : "scrollLeft";
  let e = 0;
  return u(n) ? e = n[i ? "pageYOffset" : "pageXOffset"] : n instanceof Document ? e = n.documentElement[l] : (n instanceof HTMLElement || n) && (e = n[l]), n && !u(n) && typeof e != "number" && (e = (o = ((f = n.ownerDocument) !== null && f !== void 0 ? f : n).documentElement) === null || o === void 0 ? void 0 : o[l]), e;
}
export {
  d as default,
  u as isWindow
};
