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

import _defineProperty from '@babel/runtime/helpers/defineProperty';
import { defineComponent, computed } from '@vue/composition-api';
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 'vue';
import 'lodash/capitalize';
import '../../dialog/dialog.js';
import 'lodash/isNumber';
import 'lodash/throttle';
import '@ldesign/icons-vue';
import '../../button/index.js';
import '../../button/button.js';
import '../../loading/index.js';
import '../../loading/directive.js';
import 'lodash/isObject';
import 'lodash/mapKeys';
import 'lodash/isEqual';
import '../../loading/plugin.js';
import '../../config.js';
import '../../utils/dom.js';
import 'raf';
import 'lodash/isString';
import '../../utils/easing.js';
import '../../loading/loading.js';
import '../../utils/render-tnode.js';
import '@babel/runtime/helpers/typeof';
import 'lodash/camelCase';
import 'lodash/kebabCase';
import '../../utils/transfer-dom.js';
import '../../config-provider/config-receiver.js';
import 'lodash/mergeWith';
import '../../config-provider/context.js';
import 'lodash/merge';
import '../../_common/js/global-config/default-config.js';
import '../../_common/js/global-config/locale/zh_CN.js';
import '../../_chunks/dep-be599ec8.js';
import 'dayjs';
import '../../_chunks/dep-67ff4010.js';
import '../../config-provider/type.js';
import '../../utils/mixins.js';
import '../../loading/props.js';
import '../../loading/icon/gradient.js';
import '../../_common/js/loading/circle-adapter.js';
import '../../_common/js/utils/set-style.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/isArray';
import '../../loading/style';
import '../../loading/type.js';
import '../../utils/ripple.js';
import '../../button/props.js';
import '../../button/style';
import '../../button/type.js';
import '../../utils/event.js';
import '../../utils/helper.js';
import '../../hooks/useDestroyOnClose.js';
import '../../_common/js/utils/getScrollbarWidth.js';
import '../../dialog/stack.js';
import '../../dialog/props.js';
import '../../dialog/actions.js';
import '../../_chunks/dep-c89aafbb.js';
import '../../dialog/style';
import '../../dialog/type.js';
import '../../dialog/plugin.js';
import '../../config-provider/config-provider.js';
import 'lodash/cloneDeep';
import '../../config-provider/useConfig.js';
import 'lodash/isEmpty';
import 'lodash/isFunction';
import '../../hooks/render-tnode.js';
import '../../tooltip/index.js';
import '../../utils/map-props.js';
import '../../tooltip/tooltip.js';
import '../../popup/props.js';
import '../../popup/popup.js';
import '@popperjs/core';
import '../../popup/container.js';
import '../../popup/utils.js';
import '../../popup/trigger.js';
import '../../tooltip/props.js';
import '../../tooltip/style';
import '../../tooltip/type.js';
import '../utils.js';
import './ImageModalIcon.js';
import '../hooks.js';

function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
var defaultProps = {
  zIndex: Number,
  visible: Boolean,
  index: Number,
  images: props.images,
  scale: Number,
  rotate: Number,
  mirror: Number,
  currentImage: {
    type: Object,
    "default": function _default() {
      return {};
    }
  },
  rotateHandler: Function,
  zoomInHandler: Function,
  zoomOutHandler: Function,
  mirrorHandler: Function,
  resetHandler: Function,
  closeHandler: props.onClose,
  draggable: {
    type: Boolean,
    "default": true
  },
  viewerScale: {
    type: Object,
    "default": function _default() {
      return {};
    }
  },
  showOverlay: Boolean,
  closeBtn: props.closeBtn
};
var TImageViewerModal = defineComponent({
  name: "TImageViewerModal",
  props: _objectSpread({}, defaultProps),
  setup: function setup(props2) {
    var classPrefix = usePrefixClass();
    var renderJSX = useTNodeJSX();
    var style = computed(function () {
      return {
        minWidth: props2.viewerScale.minWidth,
        minHeight: props2.viewerScale.minHeight
      };
    });
    return {
      classPrefix: classPrefix,
      renderJSX: renderJSX,
      style: style
    };
  },
  render: function render() {
    var _this = this;
    var h = arguments[0];
    return h(Dialog, {
      "attrs": {
        "destroyOnClose": true,
        "visible": this.visible,
        "placement": "center",
        "mode": "modeless",
        "width": 1e3,
        "cancelBtn": null,
        "confirmBtn": null,
        "draggable": this.draggable,
        "zIndex": this.zIndex,
        "showOverlay": this.showOverlay,
        "header": this.title,
        "footer": function footer() {
          return h("div", {
            "class": "".concat(_this.classPrefix, "-image-viewer-mini__footer")
          }, [h(TImageViewerUtils, {
            "attrs": {
              "zoomInHandler": _this.zoomInHandler,
              "zoomOutHandler": _this.zoomOutHandler,
              "scale": _this.scale,
              "currentImage": _this.currentImage,
              "rotateHandler": _this.rotateHandler,
              "mirrorHandler": _this.mirrorHandler,
              "resetHandler": _this.resetHandler
            }
          })]);
        }
      },
      "on": {
        "close": this.closeHandler
      },
      "class": "".concat(this.classPrefix, "-image-viewer__dialog")
    }, [h("div", {
      "class": "".concat(this.classPrefix, "-image-viewer-mini__content"),
      "style": this.style
    }, [h(TImageItem, {
      "attrs": {
        "rotate": this.rotate,
        "scale": this.scale,
        "mirror": this.mirror,
        "src": this.currentImage.mainImage,
        "placementSrc": this.currentImage.thumbnail
      }
    })])]);
  }
});

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