import formatErrorMessage from "../../../../utils/esm/formatErrorMessage.js";
import * as React from "react";
const ContextMenuRootContext = /* @__PURE__ */ React.createContext(void 0);
if (process.env.NODE_ENV !== "production") ContextMenuRootContext.displayName = "ContextMenuRootContext";
function useContextMenuRootContext(optional = true) {
  const context = React.useContext(ContextMenuRootContext);
  if (context === void 0 && !optional) {
    throw new Error(process.env.NODE_ENV !== "production" ? "Base UI: ContextMenuRootContext is missing. ContextMenu parts must be placed within <ContextMenu.Root>." : formatErrorMessage(25));
  }
  return context;
}
export {
  ContextMenuRootContext,
  useContextMenuRootContext
};
//# sourceMappingURL=ContextMenuRootContext.js.map
