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