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

'use strict';

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

var VueCompositionAPI = require('@vue/composition-api');
var iconsVue = require('@ldesign/icons-vue');
var tooltip_index = require('../../tooltip/index.js');
var imageViewer_utils = require('../utils.js');
var configProvider_useConfig = require('../../config-provider/useConfig.js');
var imageViewer_base_ImageModalIcon = require('./ImageModalIcon.js');
require('../../utils/map-props.js');
require('@babel/runtime/helpers/defineProperty');
require('@babel/runtime/helpers/objectWithoutProperties');
require('vue');
require('../../utils/withInstall.js');
require('lodash/capitalize');
require('../../tooltip/tooltip.js');
require('../../_chunks/dep-c3e1ffac.js');
require('lodash/isFunction');
require('../../popup/props.js');
require('../../popup/popup.js');
require('@babel/runtime/helpers/typeof');
require('@popperjs/core');
require('../../utils/dom.js');
require('raf');
require('lodash/isString');
require('../../utils/easing.js');
require('../../utils/render-tnode.js');
require('lodash/camelCase');
require('lodash/kebabCase');
require('../../utils/helper.js');
require('@babel/runtime/helpers/slicedToArray');
require('../../_common/js/utils/set-style.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('../../utils/event.js');
require('../../popup/container.js');
require('../../popup/utils.js');
require('../../popup/trigger.js');
require('../../tooltip/props.js');
require('../../hooks/useConfig.js');
require('../../hooks/tnode.js');
require('lodash/isEmpty');
require('../../hooks/render-tnode.js');
require('lodash/isObject');

var currentImage = {
  type: Object,
  "default": function _default() {
    return {};
  }
};
var TImageViewerUtils = VueCompositionAPI.defineComponent({
  name: "TImageViewerUtils",
  props: {
    scale: Number,
    rotateHandler: Function,
    zoomInHandler: Function,
    zoomOutHandler: Function,
    mirrorHandler: Function,
    resetHandler: Function,
    currentImage: currentImage
  },
  setup: function setup() {
    var _useConfig = configProvider_useConfig.useConfig("imageViewer"),
      classPrefix = _useConfig.classPrefix,
      globalConfig = _useConfig.global;
    return {
      classPrefix: classPrefix,
      globalConfig: globalConfig
    };
  },
  render: function render() {
    var _this = this;
    var h = arguments[0];
    return h("div", {
      "class": "".concat(this.classPrefix, "-image-viewer__utils")
    }, [h("div", {
      "class": "".concat(this.classPrefix, "-image-viewer__utils-content")
    }, [h(tooltip_index.Tooltip, {
      "attrs": {
        "overlayClassName": "".concat(this.classPrefix, "-image-viewer__utils--tip"),
        "content": this.globalConfig.mirrorTipText,
        "destroyOnClose": true,
        "placement": "top",
        "showArrow": true,
        "theme": "default"
      }
    }, [h(imageViewer_base_ImageModalIcon["default"], {
      "attrs": {
        "clickHandler": this.mirrorHandler,
        "icon": function icon() {
          return h(iconsVue.MirrorIcon, {
            "attrs": {
              "size": "medium"
            }
          });
        }
      }
    })]), h(tooltip_index.Tooltip, {
      "attrs": {
        "overlayClassName": "".concat(this.classPrefix, "-image-viewer__utils--tip"),
        "content": this.globalConfig.rotateTipText,
        "destroyOnClose": true,
        "placement": "top",
        "showArrow": true,
        "theme": "default"
      }
    }, [h(imageViewer_base_ImageModalIcon["default"], {
      "attrs": {
        "clickHandler": this.rotateHandler,
        "icon": function icon() {
          return h(iconsVue.RotationIcon, {
            "attrs": {
              "size": "medium"
            }
          });
        }
      }
    })]), h(imageViewer_base_ImageModalIcon["default"], {
      "attrs": {
        "icon": function icon() {
          return h(iconsVue.ZoomOutIcon, {
            "attrs": {
              "size": "medium"
            }
          });
        },
        "clickHandler": this.zoomOutHandler
      }
    }), h(imageViewer_base_ImageModalIcon["default"], {
      "class": "".concat(this.classPrefix, "-image-viewer__utils-scale"),
      "attrs": {
        "size": "medium",
        "label": "".concat(this.scale * 100, "%")
      }
    }), h(imageViewer_base_ImageModalIcon["default"], {
      "attrs": {
        "icon": function icon() {
          return h(iconsVue.ZoomInIcon, {
            "attrs": {
              "size": "medium"
            }
          });
        },
        "clickHandler": this.zoomInHandler
      }
    }), h(tooltip_index.Tooltip, {
      "attrs": {
        "overlayClassName": "".concat(this.classPrefix, "-image-viewer__utils--tip"),
        "content": this.globalConfig.originalSizeTipText,
        "destroyOnClose": true,
        "placement": "top",
        "showArrow": true,
        "theme": "default"
      }
    }, [h("div", {
      "class": "".concat(this.classPrefix, "-image-viewer__modal-icon")
    }, [h(imageViewer_base_ImageModalIcon["default"], {
      "attrs": {
        "icon": function icon() {
          return h(iconsVue.ImageIcon, {
            "attrs": {
              "size": "medium"
            }
          });
        },
        "clickHandler": this.resetHandler
      }
    })])]), this.currentImage.download && h(imageViewer_base_ImageModalIcon["default"], {
      "attrs": {
        "icon": function icon() {
          return h(iconsVue.DownloadIcon, {
            "attrs": {
              "size": "medium"
            }
          });
        },
        "clickHandler": function clickHandler() {
          imageViewer_utils.downloadFile(_this.currentImage.mainImage);
        }
      }
    })])]);
  }
});

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