import { b as d } from "./useFocusVisible-_CKiSck5.es.js";
import { $ as c, c as a } from "./utils-V7nfNEif.es.js";
import { $ as o } from "./focusWithoutScrolling-CDw3JYiq.es.js";
let n = /* @__PURE__ */ new Map(), f = /* @__PURE__ */ new Set();
function s() {
  for (const [e] of n)
    "isConnected" in e && !e.isConnected && n.delete(e);
}
function b(e) {
  requestAnimationFrame(() => {
    s(), n.size === 0 ? e() : f.add(e);
  });
}
function p(e) {
  const t = c(e);
  if (d() === "virtual") {
    let i = a(t);
    b(() => {
      const r = a(t);
      (r === i || r === t.body) && e.isConnected && o(e);
    });
  } else o(e);
}
export {
  p as $,
  b as a
};
//# sourceMappingURL=focusSafely-hLKtxoJI.es.js.map
