import { defineComponent, computed, createVNode } from 'vue';
import { EyeOutlined } from '@ant-design/icons-vue';
import '../../../utils/index.mjs';
import '../../../locale/index.mjs';
import '../../../vue-components/index.mjs';
import useConfigInject from '../../config-provider/src/hooks/useConfigInject.mjs';
import useStyle from '../style/index.mjs';
import { icons } from './PreviewGroup.mjs';
import ImageInternal, { imageProps } from '../../../vue-components/vc-image/src/Image.mjs';
import { getTransitionName } from '../../../vue-components/transition/src/transition.mjs';
import localeValues from '../../../locale/lang/en_US.mjs';
import { classNames } from '../../../utils/dom/class.mjs';

var AImage = /* @__PURE__ */ defineComponent({
  name: "AImage",
  inheritAttrs: false,
  props: imageProps(),
  setup(props, {
    slots,
    attrs
  }) {
    const {
      prefixCls,
      rootPrefixCls,
      configProvider
    } = useConfigInject("image", props);
    const [wrapSSR, hashId] = useStyle(prefixCls);
    const mergedPreview = computed(() => {
      const {
        preview
      } = props;
      if (preview === false)
        return preview;
      const _preview = typeof preview === "object" ? preview : {};
      return {
        icons,
        ..._preview,
        transitionName: getTransitionName(rootPrefixCls.value, "zoom", _preview.transitionName),
        maskTransitionName: getTransitionName(rootPrefixCls.value, "fade", _preview.maskTransitionName)
      };
    });
    return () => {
      var _a, _b;
      const imageLocale = ((_b = (_a = configProvider.locale) == null ? void 0 : _a.value) == null ? void 0 : _b.Image) || localeValues.Image;
      const defaultPreviewMask = () => createVNode("div", {
        "class": `${prefixCls.value}-mask-info`
      }, [createVNode(EyeOutlined, null, null), imageLocale == null ? void 0 : imageLocale.preview]);
      const {
        previewMask = slots.previewMask || defaultPreviewMask
      } = props;
      return wrapSSR(createVNode(ImageInternal, {
        ...attrs,
        ...props,
        prefixCls: prefixCls.value,
        "preview": mergedPreview.value,
        "rootClassName": classNames(props.rootClassName, hashId.value)
      }, {
        ...slots,
        previewMask: typeof previewMask === "function" ? previewMask : null
      }));
    };
  }
});

export { AImage as default };
//# sourceMappingURL=Image.mjs.map
