import { o as c } from "./rolldown-runtime.js";
import { i as f } from "./vendor/react.js";
import { t as i } from "./safeReact.js";
var o = /* @__PURE__ */ c(f()), u = 0;
function m(t, a = "mui") {
  const [e, r] = o.useState(t), n = t || e;
  return o.useEffect(() => {
    e == null && (u += 1, r(`${a}-${u}`));
  }, [e, a]), n;
}
var s = i.useId;
function I(t, a) {
  if (s !== void 0) {
    const e = s();
    return t ?? (a ? `${a}-${e}` : e);
  }
  return m(t, a);
}
function _(t) {
  return I(t, "base-ui");
}
export {
  I as n,
  _ as t
};

//# sourceMappingURL=useBaseUiId.js.map