/******/ (function() { // webpackBootstrap
/******/ 	"use strict";
/******/ 	var __webpack_modules__ = ({

/***/ 6867:
/***/ (function(module) {

module.exports = require("@zpc_npm/vue-iclient-icons");

/***/ }),

/***/ 7276:
/***/ (function(module) {

module.exports = require("html2canvas");

/***/ }),

/***/ 7025:
/***/ (function(module) {

module.exports = require("@zpc_npm/vue-iclient-leaflet");

/***/ }),

/***/ 4481:
/***/ (function(module) {

module.exports = require("@zpc_npm/vue-iclient-leaflet/_types/global-event");

/***/ }),

/***/ 1396:
/***/ (function(module) {

module.exports = require("@zpc_npm/vue-iclient-leaflet/init.js");

/***/ }),

/***/ 637:
/***/ (function(module) {

module.exports = require("vue");

/***/ })

/******/ 	});
/************************************************************************/
/******/ 	// The module cache
/******/ 	var __webpack_module_cache__ = {};
/******/ 	
/******/ 	// The require function
/******/ 	function __webpack_require__(moduleId) {
/******/ 		// Check if module is in cache
/******/ 		var cachedModule = __webpack_module_cache__[moduleId];
/******/ 		if (cachedModule !== undefined) {
/******/ 			return cachedModule.exports;
/******/ 		}
/******/ 		// Create a new module (and put it into the cache)
/******/ 		var module = __webpack_module_cache__[moduleId] = {
/******/ 			// no module.id needed
/******/ 			// no module.loaded needed
/******/ 			exports: {}
/******/ 		};
/******/ 	
/******/ 		// Execute the module function
/******/ 		__webpack_modules__[moduleId](module, module.exports, __webpack_require__);
/******/ 	
/******/ 		// Return the exports of the module
/******/ 		return module.exports;
/******/ 	}
/******/ 	
/************************************************************************/
/******/ 	/* webpack/runtime/compat get default export */
/******/ 	!function() {
/******/ 		// getDefaultExport function for compatibility with non-harmony modules
/******/ 		__webpack_require__.n = function(module) {
/******/ 			var getter = module && module.__esModule ?
/******/ 				function() { return module['default']; } :
/******/ 				function() { return module; };
/******/ 			__webpack_require__.d(getter, { a: getter });
/******/ 			return getter;
/******/ 		};
/******/ 	}();
/******/ 	
/******/ 	/* webpack/runtime/define property getters */
/******/ 	!function() {
/******/ 		// define getter functions for harmony exports
/******/ 		__webpack_require__.d = function(exports, definition) {
/******/ 			for(var key in definition) {
/******/ 				if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
/******/ 					Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
/******/ 				}
/******/ 			}
/******/ 		};
/******/ 	}();
/******/ 	
/******/ 	/* webpack/runtime/hasOwnProperty shorthand */
/******/ 	!function() {
/******/ 		__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }
/******/ 	}();
/******/ 	
/******/ 	/* webpack/runtime/make namespace object */
/******/ 	!function() {
/******/ 		// define __esModule on exports
/******/ 		__webpack_require__.r = function(exports) {
/******/ 			if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ 				Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ 			}
/******/ 			Object.defineProperty(exports, '__esModule', { value: true });
/******/ 		};
/******/ 	}();
/******/ 	
/************************************************************************/
var __webpack_exports__ = {};
// This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
!function() {
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);

// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  "default": function() { return /* reexport */ Screenshot; }
});

// EXTERNAL MODULE: external {"root":"Vue","commonjs":"vue","commonjs2":"vue","amd":"vue"}
var external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_ = __webpack_require__(637);
// EXTERNAL MODULE: external "@zpc_npm/vue-iclient-leaflet"
var vue_iclient_leaflet_ = __webpack_require__(7025);
// EXTERNAL MODULE: external "html2canvas"
var external_html2canvas_ = __webpack_require__(7276);
var external_html2canvas_default = /*#__PURE__*/__webpack_require__.n(external_html2canvas_);
// EXTERNAL MODULE: external "@zpc_npm/vue-iclient-leaflet/_types/global-event"
var global_event_ = __webpack_require__(4481);
var global_event_default = /*#__PURE__*/__webpack_require__.n(global_event_);
// EXTERNAL MODULE: external "@zpc_npm/vue-iclient-icons"
var vue_iclient_icons_ = __webpack_require__(6867);
;// CONCATENATED MODULE: ./node_modules/babel-loader/lib/index.js!./node_modules/vue-loader/dist/index.js??ruleSet[0]!./src/leaflet/screenshot/Screenshot.vue?vue&type=script&setup=true&lang=js

const _hoisted_1 = {
  class: "kq-2d-screenshot",
  style: {
    "z-index": "1000"
  }
};
const _hoisted_2 = ["href"];
const _hoisted_3 = {
  style: {
    "text-align": "center"
  }
};

const _hoisted_4 = /*#__PURE__*/(0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.createTextVNode)("保存");

const _hoisted_5 = /*#__PURE__*/(0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.createTextVNode)("关闭");






const __default__ = {
  name: "Kq2dScreenshot"
};
/* harmony default export */ var Screenshotvue_type_script_setup_true_lang_js = (/*#__PURE__*/Object.assign(__default__, {
  props: {
    // 截图设置框初始位置
    position: {
      type: [String, Object],
      default: {
        top: 16,
        left: 16
      }
    },
    // 组件初始化截图的宽度，默认值为mapView宽度的三分之一
    width: {
      type: Number
    },
    // 组件初始化截图的高度, 默认值为mapView高度的三分之一
    height: {
      type: Number
    }
  },
  emits: ["close"],

  setup(__props, {
    expose,
    emit
  }) {
    const props = __props;
    const mapTarget = global_event_default().getCurrentMapTarget();
    let labels = (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.reactive)({
      x: "宽度",
      y: "高度",
      xmax: document.documentElement.clientWidth || document.body.clientWidth,
      xmin: 0,
      ymax: document.documentElement.clientHeight || document.body.clientHeight,
      ymin: 0
    });
    let width_height = (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.reactive)({
      x: null,
      y: null
    });
    let rules = (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.reactive)({
      x: [{
        required: true,
        message: "请输入宽度",
        trigger: "blur"
      } // { min: labels.xmin, max: labels.xmax, message: "请输入正确范围的宽度", trigger: "blur" }
      ],
      y: [{
        required: true,
        message: "请输入高度",
        trigger: "blur"
      } // { min: labels.ymin, max: labels.ymax, message: "请输入正确范围的高度", trigger: "blur" }
      ]
    });
    let ruleFormRef = (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.ref)(null);
    let show_screenshot = (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.ref)(false);
    let show_setting = (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.ref)(false); // 下载截图的路径

    let downloadImgSrc = (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.ref)("");
    let screenBody_ref = (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.ref)(null);
    let mapImg_ref = (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.ref)(null);
    let downloadDom_ref = (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.ref)(null);
    let dataURL = null;
    let screenCanves = null;
    let context = null;
    let saveDiv = null;
    let actionType = "draw"; // 操作类型

    var isDown = false; // 是否按下鼠标

    var startPoint = []; // 起始点

    var widthImg = 0; // 截图宽度大小

    var heightImg = 0; // 截图高度大小

    var marginLeft = 0; // 截图左起始位置

    var marginTop = 0; // 截图上起始位置

    let leftTopPoint = []; // 左上点

    let rightBottom = []; // 右下点

    let leftTopPoint_ = []; // 按下鼠标原始的左上点

    let rightBottom_ = []; // 按下鼠标原始的右下点

    let loading = null;

    function onChangeWidth(val) {
      rightBottom[0] = rightBottom[0] + (val - widthImg);
      drawRect(leftTopPoint, rightBottom);
    }

    function onChangeHeight(val) {
      rightBottom[1] = rightBottom[1] + (val - heightImg);
      drawRect(leftTopPoint, rightBottom);
    } // 鼠标按下事件


    function mouseDown(e) {
      if (e.button === 2) {
        context.clearRect(0, 0, screenCanves.width, screenCanves.height);
        widthImg = screenCanves.width;
        heightImg = screenCanves.height;
        leftTopPoint = [];
        rightBottom = [];
        marginLeft = 0;
        marginTop = 0;
      } else {
        isDown = true;
        leftTopPoint_ = leftTopPoint;
        rightBottom_ = rightBottom;
        startPoint = [e.offsetX, e.offsetY];
      }
    } // 鼠标弹起事件


    function mouseUp(e) {
      isDown = false;
    } // 鼠标移动事件


    function mouseMove(e) {
      let stopPoint = [e.offsetX, e.offsetY];

      if (!isDown) {
        actionType = getActionType(stopPoint);
        return;
      } else {
        countRectPoints(actionType, stopPoint);
      }
    } // 鼠标右键事件


    function contextMenu(e) {
      e.stopPropagation();
      return false;
    } // 计算左上、右下两个点


    function countRectPoints(actionType, stopPoint) {
      let x = stopPoint[0] - startPoint[0];
      let y = stopPoint[1] - startPoint[1];

      switch (actionType) {
        case "leftTop":
          leftTopPoint = [leftTopPoint_[0] + x, leftTopPoint_[1] + y];
          rightBottom = rightBottom_;
          break;

        case "rightTop":
          leftTopPoint = [leftTopPoint_[0], leftTopPoint_[1] + y];
          rightBottom = [rightBottom_[0] + x, rightBottom_[1]];
          break;

        case "rightBottom":
          leftTopPoint = leftTopPoint_;
          rightBottom = [rightBottom_[0] + x, rightBottom_[1] + y];
          break;

        case "leftBottom":
          leftTopPoint = [leftTopPoint_[0] + x, leftTopPoint_[1]];
          rightBottom = [rightBottom_[0], rightBottom_[1] + y];
          break;

        case "left":
          leftTopPoint = [leftTopPoint_[0] + x, leftTopPoint_[1]];
          rightBottom = rightBottom_;
          break;

        case "top":
          leftTopPoint = [leftTopPoint_[0], leftTopPoint_[1] + y];
          rightBottom = rightBottom_;
          break;

        case "right":
          leftTopPoint = leftTopPoint_;
          rightBottom = [rightBottom_[0] + x, rightBottom_[1]];
          break;

        case "bottom":
          leftTopPoint = leftTopPoint_;
          rightBottom = [rightBottom_[0], rightBottom_[1] + y];
          break;

        case "move":
          leftTopPoint = [leftTopPoint_[0] + x, leftTopPoint_[1] + y];
          rightBottom = [rightBottom_[0] + x, rightBottom_[1] + y];
          break;

        case "draw":
          leftTopPoint = startPoint;
          rightBottom = stopPoint;
          break;
      }

      let minx = leftTopPoint[0] > rightBottom[0] ? rightBottom[0] : leftTopPoint[0];
      let miny = leftTopPoint[1] > rightBottom[1] ? rightBottom[1] : leftTopPoint[1];
      let maxx = leftTopPoint[0] > rightBottom[0] ? leftTopPoint[0] : rightBottom[0];
      let maxy = leftTopPoint[1] > rightBottom[1] ? leftTopPoint[1] : rightBottom[1];
      leftTopPoint = [minx, miny];
      rightBottom = [maxx, maxy];
      drawRect(leftTopPoint, rightBottom, true);
    } // 操作类型


    function getActionType(point) {
      let tolerance = 5;
      let leftTop_leftTopPoint = [leftTopPoint[0] - tolerance, leftTopPoint[1] - tolerance];
      let leftTop_rightBottom = [leftTopPoint[0] + 5, leftTopPoint[1] + tolerance];

      if (point[0] >= leftTop_leftTopPoint[0] && point[0] <= leftTop_rightBottom[0] && point[1] >= leftTop_leftTopPoint[1] && point[1] <= leftTop_rightBottom[1]) {
        screenCanves.style.cursor = "nw-resize";
        return "leftTop";
      }

      let rightTop_leftTopPoint = [rightBottom[0] - tolerance, leftTopPoint[1] - tolerance];
      let rightTop_rightBottom = [rightBottom[0] + tolerance, leftTopPoint[1] + tolerance];

      if (point[0] >= rightTop_leftTopPoint[0] && point[0] <= rightTop_rightBottom[0] && point[1] >= rightTop_leftTopPoint[1] && point[1] <= rightTop_rightBottom[1]) {
        screenCanves.style.cursor = "ne-resize";
        return "rightTop";
      }

      let rightBottom_leftTopPoint = [rightBottom[0] - tolerance, rightBottom[1] - tolerance];
      let rightBottom_rightBottom = [rightBottom[0] + tolerance, rightBottom[1] + tolerance];

      if (point[0] >= rightBottom_leftTopPoint[0] && point[0] <= rightBottom_rightBottom[0] && point[1] >= rightBottom_leftTopPoint[1] && point[1] <= rightBottom_rightBottom[1]) {
        screenCanves.style.cursor = "nw-resize";
        return "rightBottom";
      }

      let leftBottom_leftTopPoint = [leftTopPoint[0] - tolerance, rightBottom[1] - tolerance];
      let leftBottom_rightBottom = [leftTopPoint[0] + tolerance, rightBottom[1] + tolerance];

      if (point[0] >= leftBottom_leftTopPoint[0] && point[0] <= leftBottom_rightBottom[0] && point[1] >= leftBottom_leftTopPoint[1] && point[1] <= leftBottom_rightBottom[1]) {
        screenCanves.style.cursor = "ne-resize";
        return "leftBottom";
      }

      let left_leftTopPoint = [leftTopPoint[0] - tolerance, leftTopPoint[1] + tolerance];
      let left_rightBottom = [leftTopPoint[0] + tolerance, rightBottom[1] - tolerance];

      if (point[0] >= left_leftTopPoint[0] && point[0] <= left_rightBottom[0] && point[1] >= left_leftTopPoint[1] && point[1] <= left_rightBottom[1]) {
        screenCanves.style.cursor = "e-resize";
        return "left";
      }

      let top_leftTopPoint = [leftTopPoint[0] + tolerance, leftTopPoint[1] - tolerance];
      let top_rightBottom = [rightBottom[0] - tolerance, leftTopPoint[1] + tolerance];

      if (point[0] >= top_leftTopPoint[0] && point[0] <= top_rightBottom[0] && point[1] >= top_leftTopPoint[1] && point[1] <= top_rightBottom[1]) {
        screenCanves.style.cursor = "n-resize";
        return "top";
      }

      let right_leftTopPoint = [rightBottom[0] - tolerance, leftTopPoint[1] + tolerance];
      let right_rightBottom = [rightBottom[0] + tolerance, rightBottom[1] - tolerance];

      if (point[0] >= right_leftTopPoint[0] && point[0] <= right_rightBottom[0] && point[1] >= right_leftTopPoint[1] && point[1] <= right_rightBottom[1]) {
        screenCanves.style.cursor = "e-resize";
        return "right";
      }

      let bottom_leftTopPoint = [leftTopPoint[0] + tolerance, rightBottom[1] - tolerance];
      let bottom_rightBottom = [rightBottom[0] - tolerance, rightBottom[1] + tolerance];

      if (point[0] >= bottom_leftTopPoint[0] && point[0] <= bottom_rightBottom[0] && point[1] >= bottom_leftTopPoint[1] && point[1] <= bottom_rightBottom[1]) {
        screenCanves.style.cursor = "n-resize";
        return "bottom";
      }

      if (point[0] >= leftTopPoint[0] + tolerance && point[0] <= rightBottom[0] - tolerance && point[1] >= leftTopPoint[1] + tolerance && point[1] <= rightBottom[1] - tolerance) {
        screenCanves.style.cursor = "move";
        return "move";
      } else {
        screenCanves.style.cursor = "crosshair";
        return "draw";
      }
    }
    /**
     * 绘制遮罩
     * @param {Boolean} [syncSetting=false] - 是否同步设置框的宽高, 拖动截图框时触发，修改basewindow弹窗中的值不触发
     * @param {Boolean} [isInit = false] - 是否为初始化
     */


    function drawRect(leftTopPoint, rightBottom, syncSetting = false, isInit = false) {
      const {
        width,
        height
      } = props;
      context.clearRect(0, 0, screenCanves.width, screenCanves.height);
      let rectPoints = [];

      if (isInit) {
        if (width) {
          rightBottom[0] = leftTopPoint[0] + width;
        }

        if (height) {
          rightBottom[1] = leftTopPoint[1] + height;
        }
      }

      rectPoints.push([leftTopPoint[0], rightBottom[1]]);
      rectPoints.push([rightBottom[0], rightBottom[1]]);
      rectPoints.push([rightBottom[0], leftTopPoint[1]]);
      rectPoints.push([leftTopPoint[0], leftTopPoint[1]]);
      rectPoints.push([leftTopPoint[0], rightBottom[1]]); // 绘制遮罩

      context.beginPath();
      context.lineTo(0, 0);
      context.lineTo(screenCanves.width, 0);
      context.lineTo(screenCanves.width, screenCanves.height);
      context.lineTo(0, screenCanves.height);
      context.lineTo(0, 0);

      for (let p = 0; p < rectPoints.length; p++) {
        context.lineTo(rectPoints[p][0], rectPoints[p][1]);
      }

      context.fillStyle = "rgba(0, 0, 0, 0.4)"; //内部使用浅灰色

      context.fill();
      context.closePath(); // 绘制内矩形边框

      context.beginPath();
      context.strokeStyle = "#3388ff";
      context.lineWidth = 1;

      for (let p = 0; p < rectPoints.length; p++) {
        context.lineTo(rectPoints[p][0], rectPoints[p][1]);
      }

      context.stroke();
      context.closePath(); // 绘制内矩形操作点

      rectPoints.push([(leftTopPoint[0] + rightBottom[0]) / 2, leftTopPoint[1]]);
      rectPoints.push([rightBottom[0], (leftTopPoint[1] + rightBottom[1]) / 2]);
      rectPoints.push([(leftTopPoint[0] + rightBottom[0]) / 2, rightBottom[1]]);
      rectPoints.push([leftTopPoint[0], (leftTopPoint[1] + rightBottom[1]) / 2]);

      for (let p = 0; p < rectPoints.length; p++) {
        context.beginPath();
        context.arc(rectPoints[p][0], rectPoints[p][1], 4, 0, Math.PI * 2, true);
        context.fillStyle = "#3388ff";
        context.fill();
        context.closePath();
      }

      widthImg = rightBottom[0] - leftTopPoint[0];
      heightImg = rightBottom[1] - leftTopPoint[1];
      marginLeft = -leftTopPoint[0];
      marginTop = -leftTopPoint[1];

      if (syncSetting) {
        width_height.x = widthImg;
        width_height.y = heightImg;
      }
    }

    let _transform = {
      transform: null,
      viewBox: null
    };

    function transformation(type) {
      var leaflet_overlay_pane = document.getElementById(mapTarget).querySelector(".leaflet-overlay-pane").getElementsByTagName("svg");

      for (var i = 0, item; item = leaflet_overlay_pane[i++];) {
        if (type === 1) {
          _transform["transform"] = item.style.transform;
          _transform["viewBox"] = item.getAttribute("viewBox");
          item.removeAttribute("viewBox");
          item.style.transform = null;
        } else {
          item.style.transform = _transform["transform"];
          item.setAttribute("viewBox", _transform["viewBox"]);
        }
      }
    }

    function start() {
      transformation(1); // 重置截图框最大范围

      labels.xmax = document.getElementById(mapTarget).clientWidth;
      labels.ymax = document.getElementById(mapTarget).clientHeight;
      show_screenshot.value = true;
      loading = vue_iclient_leaflet_.KqLoading.service({
        lock: true,
        text: "加载中...",
        background: "rgba(0, 0, 0, 0.5)",
        target: document.getElementById(mapTarget)
      });
      let mapEl = document.getElementById(mapTarget);
      screenCanves = document.createElement("canvas");
      screenCanves.id = "screenCanves";
      screenCanves.style.position = "absolute";
      screenCanves.style.top = "0px";
      screenCanves.style.left = "0px";
      screenCanves.style.zIndex = "998";
      screenCanves.width = mapEl.clientWidth;
      screenCanves.height = mapEl.clientHeight;
      context = screenCanves.getContext("2d");

      screenCanves.oncontextmenu = function () {
        return false;
      };

      screenBody_ref.value.appendChild(screenCanves);
      saveDiv = document.createElement("div");
      external_html2canvas_default()(mapEl, {
        logging: true,
        // 启用日志记录以进行调试 (发现加上对去白边有帮助)
        allowTaint: true,
        // 否允许跨源图像污染画布
        backgroundColor: null,
        // 解决生成的图片有白边
        useCORS: true // 如果截图的内容里有图片,解决文件跨域问题

      }).then(canvas => {
        dataURL = canvas.toDataURL("image/png");
        (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.nextTick)(() => {
          mapImg_ref.value.src = dataURL;
          mapImg_ref.value.style.width = screenCanves.width + "px";
          mapImg_ref.value.style.height = screenCanves.height + "px";
          saveDiv.style.width = screenCanves.width + "px";
          saveDiv.style.height = screenCanves.height + "px";
          saveDiv.style.backgroundImage = "url(" + dataURL + ")";
          saveDiv.style.backgroundRepeat = "no-repeat";
          saveDiv.style.backgroundSize = screenCanves.width + "px " + screenCanves.height + "px";
          saveDiv.style.position = "absolute";
          saveDiv.style.top = "0px";
          saveDiv.style.zIndex = "0";
          leftTopPoint = [Math.round(screenCanves.width * 0.33), Math.round(screenCanves.height * 0.33)];
          rightBottom = [Math.round(screenCanves.width * 0.66), Math.round(screenCanves.height * 0.66)]; // 默认绘制3/1大小

          drawRect(leftTopPoint, rightBottom, true, true);
          loading.close();
          show_setting.value = true;
        });
      });
    }

    function close() {
      transformation(0);
      show_screenshot.value = false;
      show_setting.value = false;
      downloadImgSrc.value = null;
      loading && loading.close();

      var _screenCanves = document.getElementById(screenCanves.id);

      _screenCanves && _screenCanves.remove();
      mapImg_ref.value.removeAttribute("src");
      mapImg_ref.value.removeAttribute("style");
      emit("close");
    } // 保存


    function down(formEl) {
      if (!formEl || !formEl.$refs.child) return;
      formEl.$refs.child.validate(valid => {
        if (valid) {
          loading = vue_iclient_leaflet_.KqLoading.service({
            lock: true,
            text: "正在保存...",
            background: "rgba(0, 0, 0, 0.5)",
            target: document.getElementById(mapTarget)
          });
          saveDiv.style.width = widthImg + "px";
          saveDiv.style.height = heightImg + "px";
          saveDiv.style.backgroundPosition = marginLeft + "px " + marginTop + "px";
          console.log(widthImg + "|||" + heightImg);
          document.getElementById(mapTarget).appendChild(saveDiv);
          external_html2canvas_default()(saveDiv, {
            logging: true,
            // 启用日志记录以进行调试 (发现加上对去白边有帮助)
            allowTaint: true,
            // 否允许跨源图像污染画布
            backgroundColor: null,
            // 解决生成的图片有白边
            useCORS: true // 如果截图的内容里有图片,解决文件跨域问题

          }).then(canvas => {
            dataURL = canvas.toDataURL("image/png");
            (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.nextTick)(() => {
              document.getElementById(mapTarget).removeChild(saveDiv);
              downloadImgSrc.value = dataURL; // window.URL.createObjectURL(data);

              if (window.navigator.msSaveBlob) {
                let blobObject = new Blob([data]);
                window.navigator.msSaveBlob(blobObject, "截图.png");
              } else {
                (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.nextTick)(() => {
                  downloadDom_ref.value.click();
                });
              }

              loading.close();
            });
          });
        }
      });
    }

    (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.onMounted)(() => {});
    (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.onBeforeUnmount)(() => {
      close();
    });
    expose({
      start,
      close
    });
    return (_ctx, _cache) => {
      const _component_kq_input_number = (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.resolveComponent)("kq-input-number");

      const _component_kq_form_item = (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.resolveComponent)("kq-form-item");

      const _component_kq_form = (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.resolveComponent)("kq-form");

      const _component_kq_button = (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.resolveComponent)("kq-button");

      const _component_kq_base_window = (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.resolveComponent)("kq-base-window");

      return (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.withDirectives)(((0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.openBlock)(), (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.createElementBlock)("section", _hoisted_1, [(0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.createElementVNode)("div", {
        ref_key: "screenBody_ref",
        ref: screenBody_ref,
        class: "screen-body",
        onMousedown: _cache[0] || (_cache[0] = $event => mouseDown($event)),
        onMouseup: _cache[1] || (_cache[1] = $event => mouseUp($event)),
        onMousemove: _cache[2] || (_cache[2] = $event => mouseMove($event))
      }, [(0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.createElementVNode)("img", {
        ref_key: "mapImg_ref",
        ref: mapImg_ref
      }, null, 512
      /* NEED_PATCH */
      )], 544
      /* HYDRATE_EVENTS, NEED_PATCH */
      ), (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.createElementVNode)("a", {
        href: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.unref)(downloadImgSrc),
        download: "截图.png",
        ref_key: "downloadDom_ref",
        ref: downloadDom_ref
      }, null, 8
      /* PROPS */
      , _hoisted_2), (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.createVNode)(_component_kq_base_window, {
        modelValue: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.unref)(show_setting),
        "onUpdate:modelValue": _cache[7] || (_cache[7] = $event => (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.isRef)(show_setting) ? show_setting.value = $event : show_setting = $event),
        titleIcon: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.unref)(vue_iclient_icons_.IconPlaneClip),
        single: false,
        showClose: false,
        fixed: "absolute",
        position: __props.position,
        title: "截图",
        escClosable: false,
        id: "kq-2d-screenshot-setting"
      }, {
        default: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.withCtx)(() => [(0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.createVNode)(_component_kq_form, {
          model: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.unref)(width_height),
          "label-width": "54px",
          rules: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.unref)(rules),
          ref_key: "ruleFormRef",
          ref: ruleFormRef
        }, {
          default: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.withCtx)(() => [(0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.createVNode)(_component_kq_form_item, {
            label: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.unref)(labels).x,
            prop: "x"
          }, {
            default: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.withCtx)(() => [(0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.createVNode)(_component_kq_input_number, {
              modelValue: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.unref)(width_height).x,
              "onUpdate:modelValue": _cache[3] || (_cache[3] = $event => (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.unref)(width_height).x = $event),
              max: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.unref)(labels).xmax,
              min: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.unref)(labels).xmin,
              onChange: onChangeWidth
            }, null, 8
            /* PROPS */
            , ["modelValue", "max", "min"])]),
            _: 1
            /* STABLE */

          }, 8
          /* PROPS */
          , ["label"]), (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.createVNode)(_component_kq_form_item, {
            label: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.unref)(labels).y,
            prop: "y"
          }, {
            default: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.withCtx)(() => [(0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.createVNode)(_component_kq_input_number, {
              modelValue: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.unref)(width_height).y,
              "onUpdate:modelValue": _cache[4] || (_cache[4] = $event => (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.unref)(width_height).y = $event),
              max: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.unref)(labels).ymax,
              min: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.unref)(labels).ymin,
              onChange: onChangeHeight
            }, null, 8
            /* PROPS */
            , ["modelValue", "max", "min"])]),
            _: 1
            /* STABLE */

          }, 8
          /* PROPS */
          , ["label"])]),
          _: 1
          /* STABLE */

        }, 8
        /* PROPS */
        , ["model", "rules"]), (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.createElementVNode)("div", _hoisted_3, [(0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.createVNode)(_component_kq_button, {
          onClick: _cache[5] || (_cache[5] = $event => down((0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.unref)(ruleFormRef))),
          type: "primary"
        }, {
          default: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.withCtx)(() => [_hoisted_4]),
          _: 1
          /* STABLE */

        }), (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.createVNode)(_component_kq_button, {
          onClick: _cache[6] || (_cache[6] = $event => close()),
          type: "danger"
        }, {
          default: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.withCtx)(() => [_hoisted_5]),
          _: 1
          /* STABLE */

        })])]),
        _: 1
        /* STABLE */

      }, 8
      /* PROPS */
      , ["modelValue", "titleIcon", "position"])], 512
      /* NEED_PATCH */
      )), [[external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.vShow, (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.unref)(show_screenshot)]]);
    };
  }

}));
;// CONCATENATED MODULE: ./src/leaflet/screenshot/Screenshot.vue?vue&type=script&setup=true&lang=js
 
;// CONCATENATED MODULE: ./src/leaflet/screenshot/Screenshot.vue



const __exports__ = Screenshotvue_type_script_setup_true_lang_js;

/* harmony default export */ var Screenshot = (__exports__);
// EXTERNAL MODULE: external "@zpc_npm/vue-iclient-leaflet/init.js"
var init_js_ = __webpack_require__(1396);
var init_js_default = /*#__PURE__*/__webpack_require__.n(init_js_);
;// CONCATENATED MODULE: ./src/leaflet/screenshot/index.js



Screenshot.install = (Vue, opts) => {
  init_js_default()(Vue, opts);
  Vue.component(Screenshot.name, Screenshot);
};


}();
module.exports = __webpack_exports__;
/******/ })()
;