"use strict";
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
const vue = require("vue");
const comp = require("../../ui/src/comp.js");
const XEUtils = require("xe-utils");
require("../../ui/index.js");
const event = require("../../../../@vxe-ui/core/es/src/event.js");
const index_esm = require("../../../../@vxe-ui/core/es/index.esm.js");
const icon = require("../../../../@vxe-ui/core/es/src/icon.js");
const VxeResultComponent = comp.defineVxeComponent({
  name: "VxeResult",
  props: {
    imageUrl: String,
    imageStyle: Object,
    icon: String,
    type: [String, Number],
    status: [String, Number],
    title: [String, Number],
    content: [String, Number]
  },
  emits: [],
  setup(props, context) {
    const { emit, slots } = context;
    const xID = XEUtils.uniqueId();
    const refElem = vue.ref();
    const reactData = vue.reactive({});
    const refMaps = {
      refElem
    };
    const computeMaps = {};
    const $xeResult = {
      xID,
      props,
      context,
      reactData,
      getRefMaps: () => refMaps,
      getComputeMaps: () => computeMaps
    };
    const dispatchEvent = (type, params, evnt) => {
      emit(type, event.createEvent(evnt, { $result: $xeResult }, params));
    };
    const collapsePaneMethods = {
      dispatchEvent
    };
    const collapsePanePrivateMethods = {};
    Object.assign($xeResult, collapsePaneMethods, collapsePanePrivateMethods);
    const renderVN = () => {
      const { imageUrl, imageStyle, icon: icon$1, title, type, content } = props;
      const status = props.status || type;
      const slotExtra = slots.extra;
      return vue.h("div", {
        ref: "refElem",
        class: ["vxe-result", {
          [`theme--${status}`]: status
        }]
      }, [
        vue.h("div", {
          class: "vxe-result--inner"
        }, [
          imageUrl ? vue.h("div", {
            class: "vxe-result--img-wrapper"
          }, [
            vue.h("img", {
              src: imageUrl,
              style: imageStyle
            })
          ]) : vue.h("div", {
            class: "vxe-result--icon-wrapper"
          }, [
            vue.h("i", {
              class: [icon$1, type ? icon.getIcon()[`RESULT_${type}`.toLocaleUpperCase()] : ""]
            })
          ]),
          vue.h("div", {
            class: "vxe-result--title-wrapper"
          }, `${title || ""}`),
          vue.h("div", {
            class: "vxe-result--content-wrapper"
          }, `${content || ""}`),
          slotExtra ? vue.h("div", {
            class: "vxe-result--extra-wrapper"
          }, slotExtra({})) : index_esm.renderEmptyElement()
        ])
      ]);
    };
    $xeResult.renderVN = renderVN;
    return $xeResult;
  },
  render() {
    return this.renderVN();
  }
});
exports.default = VxeResultComponent;
