import { defineComponent, useSlots, computed, ref, resolveComponent, createBlock, openBlock, mergeProps, createSlots, withCtx, unref, renderSlot } from 'vue';
import { getGmExports } from '../../../../utils/src/elementPlus/exports.mjs';
import { popoverEmits, popoverProps } from './popover.mjs';

var _sfc_main = /* @__PURE__ */ defineComponent({
  ...{
    name: "GmPopover"
  },
  __name: "Popover",
  props: popoverProps,
  emits: popoverEmits,
  setup(__props, { expose: __expose, emit: __emit }) {
    const slots = useSlots();
    const props = __props;
    const emit = __emit;
    const onUpdateVisible = computed(() => {
      return props["onUpdate:visible"];
    });
    const beforeEnter = () => {
      emit("before-enter");
    };
    const beforeLeave = () => {
      emit("before-leave");
    };
    const afterEnter = () => {
      emit("after-enter");
    };
    const afterLeave = () => {
      emit("after-leave");
    };
    const elRef = ref();
    const exposeNames = ["hide"];
    const { exposeFns } = getGmExports(elRef, exposeNames);
    __expose({
      ...exposeFns
    });
    return (_ctx, _cache) => {
      const _component_el_popover = resolveComponent("el-popover");
      return openBlock(), createBlock(_component_el_popover, mergeProps(props, {
        "onUpdate:visible": onUpdateVisible.value,
        onBeforeShow: beforeEnter,
        onBeforeHide: beforeLeave,
        onShow: afterEnter,
        onHide: afterLeave
      }), createSlots({
        _: 2
        /* DYNAMIC */
      }, [
        unref(slots).reference ? {
          name: "reference",
          fn: withCtx(() => [
            renderSlot(_ctx.$slots, "reference")
          ]),
          key: "0"
        } : void 0,
        unref(slots).default ? {
          name: "default",
          fn: withCtx(() => [
            renderSlot(_ctx.$slots, "default")
          ]),
          key: "1"
        } : void 0
      ]), 1040, ["onUpdate:visible"]);
    };
  }
});

export { _sfc_main as default };
//# sourceMappingURL=Popover.vue2.mjs.map
