import * as r from "react";
import { useIsoLayoutEffect as a } from "../../../../../../@base-ui_utils@0.2.4_@types_react@18.3.27_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/utils/esm/useIsoLayoutEffect.js";
import { isSafari as u } from "../../../../../../@base-ui_utils@0.2.4_@types_react@18.3.27_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/utils/esm/detectBrowser.js";
import { visuallyHidden as i } from "../../../../../../@base-ui_utils@0.2.4_@types_react@18.3.27_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/utils/esm/visuallyHidden.js";
import { jsx as f } from "react/jsx-runtime";
const d = /* @__PURE__ */ r.forwardRef(function(t, e) {
  const [o, s] = r.useState();
  return a(() => {
    u && s("button");
  }, []), /* @__PURE__ */ f("span", {
    ...t,
    ref: e,
    style: i,
    "aria-hidden": o ? void 0 : !0,
    ...{
      tabIndex: 0,
      // Role is only for VoiceOver
      role: o
    },
    "data-base-ui-focus-guard": ""
  });
});
process.env.NODE_ENV !== "production" && (d.displayName = "FocusGuard");
export {
  d as FocusGuard
};
