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

'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

var _defineProperty = require('@babel/runtime/helpers/defineProperty');
var VueCompositionAPI = require('@vue/composition-api');
var dialog_index = require('../../dialog/index.js');
var hooks_useConfig = require('../../hooks/useConfig.js');
var hooks_tnode = require('../../hooks/tnode.js');
var imageViewer_props = require('../props.js');
var imageViewer_base_ImageViewerUtils = require('./ImageViewerUtils.js');
var imageViewer_base_ImageItem = require('./ImageItem.js');
require('../../utils/withInstall.js');
require('vue');
require('lodash/capitalize');
require('../../dialog/dialog.js');
require('lodash/isNumber');
require('lodash/throttle');
require('@ldesign/icons-vue');
require('../../button/index.js');
require('../../button/button.js');
require('../../loading/index.js');
require('../../loading/directive.js');
require('lodash/isObject');
require('lodash/mapKeys');
require('lodash/isEqual');
require('../../loading/plugin.js');
require('../../config.js');
require('../../utils/dom.js');
require('raf');
require('lodash/isString');
require('../../utils/easing.js');
require('../../loading/loading.js');
require('../../utils/render-tnode.js');
require('@babel/runtime/helpers/typeof');
require('lodash/camelCase');
require('lodash/kebabCase');
require('../../utils/transfer-dom.js');
require('../../config-provider/config-receiver.js');
require('lodash/mergeWith');
require('../../config-provider/context.js');
require('lodash/merge');
require('../../_common/js/global-config/default-config.js');
require('../../_common/js/global-config/locale/zh_CN.js');
require('../../_chunks/dep-7c884501.js');
require('dayjs');
require('../../utils/mixins.js');
require('../../loading/props.js');
require('../../loading/icon/gradient.js');
require('../../_common/js/loading/circle-adapter.js');
require('../../_common/js/utils/set-style.js');
require('../../_common/js/utils/helper.js');
require('@babel/runtime/helpers/toConsumableArray');
require('@babel/runtime/helpers/objectWithoutProperties');
require('@babel/runtime/helpers/slicedToArray');
require('lodash/isNull');
require('lodash/isUndefined');
require('lodash/isArray');
require('../../utils/ripple.js');
require('../../button/props.js');
require('../../utils/event.js');
require('../../utils/helper.js');
require('../../hooks/useDestroyOnClose.js');
require('../../_common/js/utils/getScrollbarWidth.js');
require('../../dialog/stack.js');
require('../../dialog/props.js');
require('../../dialog/actions.js');
require('../../_chunks/dep-c3e1ffac.js');
require('../../dialog/plugin.js');
require('../../config-provider/config-provider.js');
require('lodash/cloneDeep');
require('../../config-provider/useConfig.js');
require('lodash/isEmpty');
require('lodash/isFunction');
require('../../hooks/render-tnode.js');
require('../../tooltip/index.js');
require('../../utils/map-props.js');
require('../../tooltip/tooltip.js');
require('../../popup/props.js');
require('../../popup/popup.js');
require('@popperjs/core');
require('../../popup/container.js');
require('../../popup/utils.js');
require('../../popup/trigger.js');
require('../../tooltip/props.js');
require('../utils.js');
require('./ImageModalIcon.js');
require('../hooks.js');

function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }

var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);

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__default["default"](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: imageViewer_props["default"].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: imageViewer_props["default"].onClose,
  draggable: {
    type: Boolean,
    "default": true
  },
  viewerScale: {
    type: Object,
    "default": function _default() {
      return {};
    }
  },
  showOverlay: Boolean,
  closeBtn: imageViewer_props["default"].closeBtn
};
var TImageViewerModal = VueCompositionAPI.defineComponent({
  name: "TImageViewerModal",
  props: _objectSpread({}, defaultProps),
  setup: function setup(props2) {
    var classPrefix = hooks_useConfig.usePrefixClass();
    var renderJSX = hooks_tnode.useTNodeJSX();
    var style = VueCompositionAPI.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_index.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(imageViewer_base_ImageViewerUtils["default"], {
            "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(imageViewer_base_ImageItem["default"], {
      "attrs": {
        "rotate": this.rotate,
        "scale": this.scale,
        "mirror": this.mirror,
        "src": this.currentImage.mainImage,
        "placementSrc": this.currentImage.thumbnail
      }
    })])]);
  }
});

exports["default"] = TImageViewerModal;
//# sourceMappingURL=ImageViewerModal.js.map
