function e(e){return e!=null&&e===e.window}function t(t,n){if(typeof window>`u`)return 0;let r=n?`scrollTop`:`scrollLeft`,i=0;return e(t)?i=t[n?`scrollY`:`scrollX`]:t instanceof Document?i=t.documentElement[r]:(t instanceof HTMLElement||t)&&(i=t[r]),t&&!e(t)&&typeof i!=`number`&&(i=(t.ownerDocument??t).documentElement?.[r]),i}export{t as default,e as isWindow};