import { ownerDocument } from "./owner-document.jsx";

/**
 * Returns the window that owns `node`, falling back to the ambient `window`
 * global when `node` is null or detached. Use this instead of reading
 * `window` directly so realm-sensitive checks (`node instanceof
 * win.HTMLElement`) work across iframes.
 */
export function ownerWindow(node) {
  const doc = ownerDocument(node);
  return doc.defaultView ?? window;
}
//# sourceMappingURL=owner-window.jsx.map
