"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
var _vue = require("vue");
var _classNames = _interopRequireDefault(require("../_util/classNames"));
var _useConfigInject = _interopRequireDefault(require("../config-provider/hooks/useConfigInject"));
var _omit = _interopRequireDefault(require("../_util/omit"));
var _Element = require("./Element");
var _style = _interopRequireDefault(require("./style"));
const SkeletonImage = (0, _vue.defineComponent)({
  compatConfig: {
    MODE: 3
  },
  name: 'ASkeletonNode',
  inheritAttrs: false,
  props: (0, _omit.default)((0, _Element.skeletonElementProps)(), ['size', 'shape']),
  setup(props, {
    slots,
    attrs
  }) {
    const {
      prefixCls
    } = (0, _useConfigInject.default)('skeleton', props);
    const [wrapSSR, hashId] = (0, _style.default)(prefixCls);
    const cls = (0, _vue.computed)(() => (0, _classNames.default)(prefixCls.value, `${prefixCls.value}-element`, {
      [`${prefixCls.value}-active`]: props.active
    }, hashId.value, props.rootClassName));
    return () => {
      var _a;
      return wrapSSR((0, _vue.createVNode)("div", {
        "class": cls.value
      }, [(0, _vue.createVNode)("div", (0, _objectSpread2.default)({
        "class": `${prefixCls.value}-image`
      }, attrs), [(_a = slots.default) === null || _a === void 0 ? void 0 : _a.call(slots)])]));
    };
  }
});
var _default = exports.default = SkeletonImage;