import { defineComponent, useSlots, ref, resolveComponent, createBlock, openBlock, mergeProps, createSlots, withCtx, unref, renderSlot, normalizeProps, guardReactiveProps, createVNode } from 'vue';
import '../../../../utils/index.mjs';
import VNodeRenderer from '../../common/VNodeRenderer.mjs';
import { uploadEmits, uploadProps } from './upload.mjs';
import { getGmExports } from '../../../../utils/src/elementPlus/exports.mjs';

var _sfc_main = /* @__PURE__ */ defineComponent({
  ...{
    name: "GmUpload"
  },
  __name: "Upload",
  props: uploadProps,
  emits: uploadEmits,
  setup(__props, { expose: __expose, emit: __emit }) {
    const slots = useSlots();
    const props = __props;
    const emit = __emit;
    const elRef = ref();
    const exposeEvents = ["abort", "submit", "clearFiles", "handleStart", "handleRemove"];
    const { exposeFns } = getGmExports(elRef, exposeEvents);
    __expose({
      ...exposeFns
    });
    return (_ctx, _cache) => {
      const _component_el_upload = resolveComponent("el-upload");
      return openBlock(), createBlock(
        _component_el_upload,
        mergeProps({
          ref_key: "elRef",
          ref: elRef
        }, props, {
          "onUpdate:fileList": _cache[0] || (_cache[0] = ($event) => emit("update:fileList", $event))
        }),
        createSlots({
          _: 2
          /* DYNAMIC */
        }, [
          unref(slots).default ? {
            name: "default",
            fn: withCtx((slotValue) => [
              renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps(slotValue)))
            ]),
            key: "0"
          } : void 0,
          unref(slots).trigger ? {
            name: "trigger",
            fn: withCtx(() => [
              createVNode(unref(VNodeRenderer), {
                vnode: unref(slots).trigger()
              }, null, 8, ["vnode"])
            ]),
            key: "1"
          } : void 0,
          unref(slots).tip ? {
            name: "tip",
            fn: withCtx(() => [
              createVNode(unref(VNodeRenderer), {
                vnode: unref(slots).tip()
              }, null, 8, ["vnode"])
            ]),
            key: "2"
          } : void 0,
          unref(slots).file ? {
            name: "file",
            fn: withCtx((slotValue) => [
              renderSlot(_ctx.$slots, "file", normalizeProps(guardReactiveProps(slotValue)))
            ]),
            key: "3"
          } : void 0
        ]),
        1040
        /* FULL_PROPS, DYNAMIC_SLOTS */
      );
    };
  }
});

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