/**
 * ldesign v0.4.2
 * (c) 2023 ldesign
 * @license MIT
 */

import { defineComponent, computed, createVNode } from 'vue';
import { Dialog } from '../../dialog/index.js';
import { usePrefixClass } from '../../hooks/useConfig.js';
import { useTNodeJSX } from '../../hooks/tnode.js';
import props from '../props.js';
import TImageViewerUtils from './ImageViewerUtils.js';
import TImageItem from './ImageItem.js';
import '../../utils/withInstall.js';
import '../../dialog/dialog.js';
import '@babel/runtime/helpers/defineProperty';
import '@ldesign/icons-vue-next';
import '../../hooks/useGlobalIcon.js';
import '../../config-provider/useConfig.js';
import 'lodash/cloneDeep';
import 'lodash/isFunction';
import 'lodash/isString';
import '../../config-provider/context.js';
import 'lodash/mergeWith';
import 'lodash/merge';
import 'lodash/isArray';
import '../../_common/js/global-config/default-config.js';
import '../../_common/js/global-config/locale/zh_CN.js';
import '@babel/runtime/helpers/typeof';
import '../../_chunks/dep-2e5d8948.js';
import 'dayjs';
import '../../_chunks/dep-4580aabe.js';
import '../../config-provider/type.js';
import '../../hooks/useDestroyOnClose.js';
import '../../_common/js/utils/getScrollbarWidth.js';
import '../../_common/js/utils/helper.js';
import '@babel/runtime/helpers/toConsumableArray';
import '@babel/runtime/helpers/objectWithoutProperties';
import '@babel/runtime/helpers/slicedToArray';
import 'lodash/isNull';
import 'lodash/isUndefined';
import 'lodash/isNumber';
import '../../hooks/useTeleport.js';
import '../../utils/dom.js';
import '../../utils/easing.js';
import '../../dialog/stack.js';
import '../../dialog/hooks.js';
import 'lodash/isObject';
import 'lodash/omit';
import '../../button/index.js';
import '../../button/button.js';
import '../../loading/index.js';
import '../../loading/directive.js';
import '../../loading/plugin.js';
import '../../loading/loading.js';
import '../../utils/render-tnode.js';
import 'lodash/isEmpty';
import 'lodash/camelCase';
import 'lodash/kebabCase';
import '../../loading/props.js';
import '../../loading/icon/gradient.js';
import '../../_common/js/loading/circle-adapter.js';
import '../../_common/js/utils/set-style.js';
import '../../loading/style';
import '../../loading/type.js';
import '../../hooks/useRipple.js';
import '../../utils/set-style.js';
import '../../hooks/useKeepAnimation.js';
import '../../form/hooks.js';
import '../../button/props.js';
import '../../button/style';
import '../../button/type.js';
import '../../dialog/props.js';
import '../../dialog/style';
import '../../dialog/type.js';
import '../../dialog/plugin.js';
import '../../tooltip/index.js';
import '../../tooltip/tooltip.js';
import '../../popup/props.js';
import '../../popup/index.js';
import '../../popup/popup.js';
import '@popperjs/core';
import '../../hooks/index.js';
import '../../hooks/icon.js';
import '../../hooks/slot.js';
import '../../hooks/useCommonClassName.js';
import '../../hooks/useDefaultValue.js';
import '../../hooks/useVirtualScroll.js';
import '../../hooks/useVModel.js';
import '../../popup/container.js';
import '../../hooks/useResizeObserver.js';
import '../../popup/style';
import '../../popup/type.js';
import '../../tooltip/util.js';
import '../../tooltip/props.js';
import '../../tooltip/style';
import '../../tooltip/type.js';
import '../utils.js';
import './ImageModalIcon.js';
import '../hooks.js';

var TImageViewerModal = defineComponent({
  name: "TImageViewerModal",
  props: {
    zIndex: Number,
    visible: Boolean,
    index: Number,
    images: props.images,
    scale: Number,
    rotate: Number,
    mirror: Number,
    title: props.title,
    currentImage: {
      type: Object,
      "default": function _default() {
        return {};
      }
    },
    onRotate: Function,
    onZoomIn: Function,
    onZoomOut: Function,
    onMirror: Function,
    onReset: Function,
    onClose: props.onClose,
    draggable: {
      type: Boolean,
      "default": true
    },
    viewerScale: {
      type: Object,
      "default": function _default() {
        return {};
      }
    },
    showOverlay: Boolean,
    closeBtn: props.closeBtn
  },
  setup: function setup(props2) {
    var classPrefix = usePrefixClass();
    var renderJSX = useTNodeJSX();
    var style = computed(function () {
      return {
        minWidth: props2.viewerScale.minWidth,
        minHeight: props2.viewerScale.minHeight
      };
    });
    return function () {
      return createVNode(Dialog, {
        "destroyOnClose": true,
        "attach": "body",
        "onClose": props2.onClose,
        "visible": props2.visible,
        "placement": "center",
        "mode": "modeless",
        "width": 1e3,
        "cancelBtn": null,
        "confirmBtn": null,
        "draggable": props2.draggable,
        "zIndex": props2.zIndex,
        "showOverlay": props2.showOverlay,
        "class": "".concat(classPrefix.value, "-image-viewer__dialog"),
        "header": renderJSX("title", ""),
        "footer": function footer() {
          return createVNode("div", {
            "class": "".concat(classPrefix.value, "-image-viewer-mini__footer")
          }, [createVNode(TImageViewerUtils, {
            "onZoomIn": props2.onZoomIn,
            "onZoomOut": props2.onZoomOut,
            "scale": props2.scale,
            "currentImage": props2.currentImage,
            "onRotate": props2.onRotate,
            "onMirror": props2.onMirror,
            "onReset": props2.onReset
          }, null)]);
        }
      }, {
        "default": function _default() {
          return [createVNode("div", {
            "class": "".concat(classPrefix.value, "-image-viewer-mini__content"),
            "style": style.value
          }, [createVNode(TImageItem, {
            "rotate": props2.rotate,
            "scale": props2.scale,
            "mirror": props2.mirror,
            "src": props2.currentImage.mainImage,
            "placementSrc": props2.currentImage.thumbnail
          }, null)])];
        }
      });
    };
  }
});

export { TImageViewerModal as default };
//# sourceMappingURL=ImageViewerModal.js.map
