import { provide, inject, defineComponent, toRef } from 'vue';

const MenuContextKey = Symbol("menuContextKey");
function useProvideMenu(props) {
  provide(MenuContextKey, props);
}
function useInjectMenu() {
  return inject(MenuContextKey);
}
const ForceRenderKey = Symbol("ForceRenderKey");
function useProvideForceRender(forceRender) {
  provide(ForceRenderKey, forceRender);
}
function useInjectForceRender() {
  return inject(ForceRenderKey, false);
}
const MenuFirstLevelContextKey = Symbol("menuFirstLevelContextKey");
function useProvideFirstLevel(firstLevel) {
  provide(MenuFirstLevelContextKey, firstLevel);
}
function useInjectFirstLevel() {
  return inject(MenuFirstLevelContextKey, true);
}
const MenuContextProvider = defineComponent({
  compatConfig: { MODE: 3 },
  name: "MenuContextProvider",
  inheritAttrs: false,
  props: {
    mode: { type: String, default: void 0 },
    overflowDisabled: { type: Boolean, default: void 0 }
  },
  setup(props, { slots }) {
    const menuContext = useInjectMenu();
    const newContext = { ...menuContext };
    if (props.mode !== void 0)
      newContext.mode = toRef(props, "mode");
    if (props.overflowDisabled !== void 0)
      newContext.overflowDisabled = toRef(props, "overflowDisabled");
    useProvideMenu(newContext);
    return () => {
      var _a;
      return (_a = slots.default) == null ? void 0 : _a.call(slots);
    };
  }
});

export { MenuContextKey, MenuContextProvider, MenuFirstLevelContextKey, useProvideMenu as default, useInjectFirstLevel, useInjectForceRender, useInjectMenu, useProvideFirstLevel, useProvideForceRender, useProvideMenu };
//# sourceMappingURL=useMenuContext.mjs.map
