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

'use strict';

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

var vue = require('vue');
var iconsVueNext = require('@ldesign/icons-vue-next');
var tooltip_index = require('../../tooltip/index.js');
var hooks_useConfig = require('../../hooks/useConfig.js');
var imageViewer_utils = require('../utils.js');
var imageViewer_base_ImageModalIcon = require('./ImageModalIcon.js');
require('../../utils/withInstall.js');
require('../../tooltip/tooltip.js');
require('@babel/runtime/helpers/slicedToArray');
require('@babel/runtime/helpers/defineProperty');
require('lodash/isFunction');
require('lodash/omit');
require('../../popup/props.js');
require('../../popup/index.js');
require('../../popup/popup.js');
require('@popperjs/core');
require('lodash/isObject');
require('lodash/isString');
require('../../hooks/useVModel.js');
require('lodash/kebabCase');
require('../../utils/dom.js');
require('../../_chunks/dep-7f0559c3.js');
require('lodash/isArray');
require('../../utils/easing.js');
require('../../_common/js/utils/set-style.js');
require('../../popup/container.js');
require('@babel/runtime/helpers/toConsumableArray');
require('../../hooks/useResizeObserver.js');
require('../../hooks/tnode.js');
require('lodash/camelCase');
require('../../utils/render-tnode.js');
require('lodash/isEmpty');
require('../../config-provider/useConfig.js');
require('lodash/cloneDeep');
require('../../config-provider/context.js');
require('lodash/mergeWith');
require('lodash/merge');
require('../../_common/js/global-config/default-config.js');
require('../../_common/js/global-config/locale/zh_CN.js');
require('@babel/runtime/helpers/typeof');
require('dayjs');
require('../../tooltip/util.js');
require('../../tooltip/props.js');

var TImageViewerUtils = vue.defineComponent({
  name: "TImageViewerUtils",
  props: {
    scale: Number,
    onRotate: Function,
    onZoomIn: Function,
    onZoomOut: Function,
    onMirror: Function,
    onReset: Function,
    currentImage: {
      type: Object,
      "default": function _default() {
        return {};
      }
    }
  },
  setup: function setup(props) {
    var classPrefix = hooks_useConfig.usePrefixClass();
    return function () {
      return vue.createVNode("div", {
        "class": "".concat(classPrefix.value, "-image-viewer__utils")
      }, [vue.createVNode("div", {
        "class": "".concat(classPrefix.value, "-image-viewer__utils-content")
      }, [vue.createVNode(tooltip_index.Tooltip, {
        "overlayClassName": "".concat(classPrefix.value, "-image-viewer__utils--tip"),
        "content": "\u955C\u50CF",
        "destroyOnClose": true,
        "placement": "top",
        "showArrow": true,
        "theme": "default"
      }, {
        "default": function _default() {
          return [vue.createVNode(imageViewer_base_ImageModalIcon["default"], {
            "onClick": props.onMirror,
            "icon": function icon() {
              return vue.createVNode(iconsVueNext.MirrorIcon, {
                "size": "medium"
              }, null);
            }
          }, null)];
        }
      }), vue.createVNode(tooltip_index.Tooltip, {
        "overlayClassName": "".concat(classPrefix.value, "-image-viewer__utils--tip"),
        "content": "\u65CB\u8F6C",
        "destroyOnClose": true,
        "placement": "top",
        "showArrow": true,
        "theme": "default"
      }, {
        "default": function _default() {
          return [vue.createVNode(imageViewer_base_ImageModalIcon["default"], {
            "onClick": props.onRotate,
            "icon": function icon() {
              return vue.createVNode(iconsVueNext.RotationIcon, {
                "size": "medium"
              }, null);
            }
          }, null)];
        }
      }), vue.createVNode(imageViewer_base_ImageModalIcon["default"], {
        "icon": function icon() {
          return vue.createVNode(iconsVueNext.ZoomOutIcon, {
            "size": "medium"
          }, null);
        },
        "onClick": props.onZoomOut
      }, null), vue.createVNode(imageViewer_base_ImageModalIcon["default"], {
        "class": "".concat(classPrefix.value, "-image-viewer__utils-scale"),
        "size": "medium",
        "label": "".concat(props.scale * 100, "%")
      }, null), vue.createVNode(imageViewer_base_ImageModalIcon["default"], {
        "icon": function icon() {
          return vue.createVNode(iconsVueNext.ZoomInIcon, {
            "size": "medium"
          }, null);
        },
        "onClick": props.onZoomIn
      }, null), vue.createVNode(tooltip_index.Tooltip, {
        "overlayClassName": "".concat(classPrefix.value, "-image-viewer__utils--tip"),
        "content": "\u539F\u59CB\u5927\u5C0F",
        "destroyOnClose": true,
        "placement": "top",
        "showArrow": true,
        "theme": "default"
      }, {
        "default": function _default() {
          return [vue.createVNode("div", {
            "class": "".concat(classPrefix.value, "-image-viewer__modal-icon")
          }, [vue.createVNode(imageViewer_base_ImageModalIcon["default"], {
            "icon": function icon() {
              return vue.createVNode(iconsVueNext.ImageIcon, {
                "size": "medium"
              }, null);
            },
            "onClick": props.onReset
          }, null)])];
        }
      }), props.currentImage.download && vue.createVNode(imageViewer_base_ImageModalIcon["default"], {
        "icon": function icon() {
          return vue.createVNode(iconsVueNext.DownloadIcon, {
            "size": "medium"
          }, null);
        },
        "onClick": function onClick() {
          imageViewer_utils.downloadFile(props.currentImage.mainImage);
        }
      }, null)])]);
    };
  }
});

exports["default"] = TImageViewerUtils;
//# sourceMappingURL=ImageViewerUtils.js.map
