/*
 * ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
 * This devtool is neither made for production nor for readable output files.
 * It uses "eval()" calls to create a separate source file in the browser devtools.
 * If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
 * or disable the default devtool with "devtool: false".
 * If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
 */
(self["webpackJsonp_bos-platform"] = self["webpackJsonp_bos-platform"] || []).push([[3294],{

/***/ "./src/component/web/PDFViewer/PDFViewer.jsx":
/*!***************************************************!*\
  !*** ./src/component/web/PDFViewer/PDFViewer.jsx ***!
  \***************************************************/
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {

"use strict";
eval("\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\n__webpack_require__(/*! core-js/modules/es.symbol.js */ \"../../node_modules/core-js/modules/es.symbol.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.description.js */ \"../../node_modules/core-js/modules/es.symbol.description.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.iterator.js */ \"../../node_modules/core-js/modules/es.symbol.iterator.js\");\n__webpack_require__(/*! core-js/modules/es.array.from.js */ \"../../node_modules/core-js/modules/es.array.from.js\");\n__webpack_require__(/*! core-js/modules/es.array.iterator.js */ \"../../node_modules/core-js/modules/es.array.iterator.js\");\n__webpack_require__(/*! core-js/modules/es.array.slice.js */ \"../../node_modules/core-js/modules/es.array.slice.js\");\n__webpack_require__(/*! core-js/modules/es.date.to-string.js */ \"../../node_modules/core-js/modules/es.date.to-string.js\");\n__webpack_require__(/*! core-js/modules/es.function.name.js */ \"../../node_modules/core-js/modules/es.function.name.js\");\n__webpack_require__(/*! core-js/modules/es.object.define-property.js */ \"../../node_modules/core-js/modules/es.object.define-property.js\");\n__webpack_require__(/*! core-js/modules/es.object.get-own-property-descriptor.js */ \"../../node_modules/core-js/modules/es.object.get-own-property-descriptor.js\");\n__webpack_require__(/*! core-js/modules/es.object.to-string.js */ \"../../node_modules/core-js/modules/es.object.to-string.js\");\n__webpack_require__(/*! core-js/modules/es.regexp.to-string.js */ \"../../node_modules/core-js/modules/es.regexp.to-string.js\");\n__webpack_require__(/*! core-js/modules/es.string.iterator.js */ \"../../node_modules/core-js/modules/es.string.iterator.js\");\n__webpack_require__(/*! core-js/modules/es.weak-map.js */ \"../../node_modules/core-js/modules/es.weak-map.js\");\n__webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ \"../../node_modules/core-js/modules/web.dom-collections.iterator.js\");\nObject.defineProperty(exports, \"__esModule\", ({\n  value: true\n}));\nexports[\"default\"] = void 0;\n__webpack_require__(/*! core-js/modules/es.array.concat.js */ \"../../node_modules/core-js/modules/es.array.concat.js\");\n__webpack_require__(/*! core-js/modules/es.array.is-array.js */ \"../../node_modules/core-js/modules/es.array.is-array.js\");\n__webpack_require__(/*! core-js/modules/es.parse-int.js */ \"../../node_modules/core-js/modules/es.parse-int.js\");\n__webpack_require__(/*! core-js/modules/es.regexp.exec.js */ \"../../node_modules/core-js/modules/es.regexp.exec.js\");\nvar _react = _interopRequireWildcard(__webpack_require__(/*! react */ \"webpack/sharing/consume/default/react/react?dca2\"));\nvar _classnames = _interopRequireDefault(__webpack_require__(/*! classnames */ \"../../node_modules/classnames/index.js\"));\nvar _LoadingGIF = _interopRequireDefault(__webpack_require__(/*! @/component/common/LoadingGIF */ \"./src/component/common/LoadingGIF.js\"));\nvar _pdf_viewer = __webpack_require__(/*! pdfjs-dist216/legacy/web/pdf_viewer.js */ \"../../node_modules/pdfjs-dist216/legacy/web/pdf_viewer.js\");\nvar pdfjs = _interopRequireWildcard(__webpack_require__(/*! pdfjs-dist216/legacy/build/pdf */ \"../../node_modules/pdfjs-dist216/legacy/build/pdf.js\"));\nvar _PDFViewerToolbar = _interopRequireDefault(__webpack_require__(/*! ./PDFViewerToolbar */ \"./src/component/web/PDFViewer/PDFViewerToolbar.jsx\"));\nvar _lodash = __webpack_require__(/*! lodash */ \"../../node_modules/lodash/lodash.js\");\nvar _useFixArrayPrototypeError = _interopRequireDefault(__webpack_require__(/*! @/use/useFixArrayPrototypeError */ \"./src/use/useFixArrayPrototypeError.js\"));\nvar _style = _interopRequireDefault(__webpack_require__(/*! ./style.less */ \"./src/component/web/PDFViewer/style.less\"));\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\nfunction _getRequireWildcardCache(e) { if (\"function\" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }\nfunction _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || \"object\" != _typeof(e) && \"function\" != typeof e) return { \"default\": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if (\"default\" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n[\"default\"] = e, t && t.set(e, n), n; }\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }\nfunction _iterableToArrayLimit(r, l) { var t = null == r ? null : \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t[\"return\"] && (u = t[\"return\"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\npdfjs.GlobalWorkerOptions.workerSrc = __webpack_require__(/*! pdfjs-dist216/legacy/build/pdf.worker.entry */ \"../../node_modules/pdfjs-dist216/legacy/build/pdf.worker.entry.js\");\nvar PDFViewer = function PDFViewer(_ref) {\n  var url = _ref.url,\n    onLoad = _ref.onLoad;\n  var _useState = (0, _react.useState)(0),\n    _useState2 = _slicedToArray(_useState, 2),\n    totalPage = _useState2[0],\n    setTotalPage = _useState2[1];\n  var _useState3 = (0, _react.useState)(0),\n    _useState4 = _slicedToArray(_useState3, 2),\n    currentPage = _useState4[0],\n    setCurrentPage = _useState4[1];\n  var _useState5 = (0, _react.useState)(false),\n    _useState6 = _slicedToArray(_useState5, 2),\n    loading = _useState6[0],\n    setLoading = _useState6[1];\n  var pdfDocumentRef = (0, _react.useRef)(null);\n  var containerRef = (0, _react.useRef)(null);\n  var viewerRef = (0, _react.useRef)(null);\n  var scaleRef = (0, _react.useRef)(1);\n  (0, _useFixArrayPrototypeError[\"default\"])();\n  (0, _react.useEffect)(function () {\n    if (!containerRef.current) {\n      return;\n    }\n    var eventBus = new _pdf_viewer.EventBus();\n    viewerRef.current = new _pdf_viewer.PDFViewer({\n      container: containerRef.current,\n      eventBus: eventBus\n    });\n  }, []);\n  (0, _react.useEffect)(function () {\n    setLoading(true);\n    var options = {\n      url: url,\n      cMapUrl: 'public/thirdjs/cmaps/',\n      // 预定义Adobe CMaps所在的URL，包括尾部斜杠\n      cMapPacked: true,\n      // 指定Adobe CMaps是否为二进制打包\n      rangeChunkSize: 65536 * 8,\n      // 用于指定每个范围请求获取的最大字节数,\n      isEvalSupported: false\n    };\n    var task = pdfjs.getDocument(options);\n    task.promise.then(function (doc) {\n      console.log(\"Document \".concat(url, \" loaded \").concat(doc.numPages, \" page(s)\"));\n      doc.getPage(1).then(function (page) {\n        var _page$getViewport = page.getViewport({\n            scale: 1.5\n          }),\n          width = _page$getViewport.width;\n        var viewerWidth = containerRef.current.offsetWidth;\n        if (width > viewerWidth) {\n          scaleRef.current = viewerWidth / width;\n          viewerRef.current.currentScale = scaleRef.current;\n        }\n      });\n      viewerRef.current.setDocument(doc);\n      pdfDocumentRef.current = doc;\n      setTotalPage(doc.numPages);\n      setCurrentPage(1);\n      setLoading(false);\n      onLoad && onLoad();\n    }, function (reason) {\n      console.error(\"Error during \".concat(url, \" loading: \").concat(reason));\n      setLoading(false);\n      onLoad && onLoad();\n    });\n    return function () {\n      var _viewerRef$current, _viewerRef$current$de;\n      (_viewerRef$current = viewerRef.current) === null || _viewerRef$current === void 0 || (_viewerRef$current = _viewerRef$current.pdfDocument) === null || _viewerRef$current === void 0 || (_viewerRef$current$de = _viewerRef$current.destroy) === null || _viewerRef$current$de === void 0 || _viewerRef$current$de.call(_viewerRef$current);\n    };\n  }, [url]);\n  var handlePageChange = function handlePageChange(evt) {\n    var value = evt.target.value;\n    setCurrentPage(value);\n  };\n  var handleBlur = function handleBlur(evt) {\n    var value = evt.target.value;\n    if (!/\\d+/.test(value)) {\n      return;\n    }\n    var num = parseInt(value, 10);\n    num = num <= 0 ? 1 : num >= totalPage ? totalPage : num;\n    viewerRef.current.currentPageNumber = num;\n    var ele = document.body.querySelector(\"[data-page-number=\\\"\".concat(num, \"\\\"]\"));\n    if (ele) {\n      var offsetTop = ele.offsetTop;\n      containerRef.current.scrollTop = offsetTop;\n    }\n  };\n\n  /**\n   * 缩小\n   */\n  var handleZoomOut = function handleZoomOut() {\n    if (!viewerRef.current || scaleRef.current <= 0.2) {\n      return;\n    }\n    scaleRef.current -= 0.2;\n    viewerRef.current.currentScale = scaleRef.current;\n  };\n\n  /**\n   * 放大\n   */\n  var handleZoomIn = function handleZoomIn() {\n    if (!viewerRef.current || scaleRef.current >= 2) {\n      return;\n    }\n    scaleRef.current += 0.2;\n    viewerRef.current.currentScale = scaleRef.current;\n  };\n\n  /**\n   * 旋转\n   */\n  var handleRotate = function handleRotate() {\n    var newAngle = viewerRef.current.pagesRotation + 90;\n    viewerRef.current.pagesRotation = newAngle === 360 ? 0 : newAngle;\n  };\n  var handleScroll = (0, _lodash.debounce)(function () {\n    if (!viewerRef.current) {\n      return;\n    }\n    setCurrentPage(viewerRef.current.currentPageNumber);\n  }, 200);\n  return /*#__PURE__*/_react[\"default\"].createElement(\"div\", {\n    className: _style[\"default\"]['pdf-viewer-container']\n  }, /*#__PURE__*/_react[\"default\"].createElement(_PDFViewerToolbar[\"default\"], {\n    className: (0, _classnames[\"default\"])('kd-cq-attachment-previewer-toolbar', _style[\"default\"]['pdf-viewer-toolbar']),\n    currentPage: currentPage,\n    totalPage: totalPage,\n    onBlur: handleBlur,\n    onPageChange: handlePageChange,\n    onZoomOutClick: handleZoomOut,\n    onZoomInClick: handleZoomIn,\n    onRotateClick: handleRotate\n  }), /*#__PURE__*/_react[\"default\"].createElement(\"div\", {\n    className: (0, _classnames[\"default\"])(_style[\"default\"]['pdf-viewer-wrapper']),\n    ref: containerRef,\n    onScroll: handleScroll\n  }, /*#__PURE__*/_react[\"default\"].createElement(\"div\", {\n    className: (0, _classnames[\"default\"])(_style[\"default\"]['pdf-viewer'])\n  })), loading && /*#__PURE__*/_react[\"default\"].createElement(_LoadingGIF[\"default\"], {\n    className: _style[\"default\"]['pdf-loading']\n  }));\n};\nvar _default = exports[\"default\"] = PDFViewer;\n\n//# sourceURL=webpack://bos-platform/./src/component/web/PDFViewer/PDFViewer.jsx?");

/***/ }),

/***/ "./src/component/web/PDFViewer/PDFViewerToolbar.jsx":
/*!**********************************************************!*\
  !*** ./src/component/web/PDFViewer/PDFViewerToolbar.jsx ***!
  \**********************************************************/
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {

"use strict";
eval("\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\n__webpack_require__(/*! core-js/modules/es.symbol.js */ \"../../node_modules/core-js/modules/es.symbol.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.description.js */ \"../../node_modules/core-js/modules/es.symbol.description.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.iterator.js */ \"../../node_modules/core-js/modules/es.symbol.iterator.js\");\n__webpack_require__(/*! core-js/modules/es.array.iterator.js */ \"../../node_modules/core-js/modules/es.array.iterator.js\");\n__webpack_require__(/*! core-js/modules/es.object.define-property.js */ \"../../node_modules/core-js/modules/es.object.define-property.js\");\n__webpack_require__(/*! core-js/modules/es.object.get-own-property-descriptor.js */ \"../../node_modules/core-js/modules/es.object.get-own-property-descriptor.js\");\n__webpack_require__(/*! core-js/modules/es.object.to-string.js */ \"../../node_modules/core-js/modules/es.object.to-string.js\");\n__webpack_require__(/*! core-js/modules/es.string.iterator.js */ \"../../node_modules/core-js/modules/es.string.iterator.js\");\n__webpack_require__(/*! core-js/modules/es.weak-map.js */ \"../../node_modules/core-js/modules/es.weak-map.js\");\n__webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ \"../../node_modules/core-js/modules/web.dom-collections.iterator.js\");\nObject.defineProperty(exports, \"__esModule\", ({\n  value: true\n}));\nexports[\"default\"] = void 0;\nvar _react = _interopRequireWildcard(__webpack_require__(/*! react */ \"webpack/sharing/consume/default/react/react?dca2\"));\nvar _classnames = _interopRequireDefault(__webpack_require__(/*! classnames */ \"../../node_modules/classnames/index.js\"));\nvar _style = _interopRequireDefault(__webpack_require__(/*! ./style.less */ \"./src/component/web/PDFViewer/style.less\"));\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\nfunction _getRequireWildcardCache(e) { if (\"function\" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }\nfunction _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || \"object\" != _typeof(e) && \"function\" != typeof e) return { \"default\": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if (\"default\" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n[\"default\"] = e, t && t.set(e, n), n; }\nvar PDFViewerToolbar = function PDFViewerToolbar(_ref) {\n  var className = _ref.className,\n    currentPage = _ref.currentPage,\n    _ref$totalPage = _ref.totalPage,\n    totalPage = _ref$totalPage === void 0 ? '' : _ref$totalPage,\n    handlePageChange = _ref.onPageChange,\n    handleBlur = _ref.onBlur,\n    handleZoomOut = _ref.onZoomOutClick,\n    handleZoomIn = _ref.onZoomInClick,\n    handleRotate = _ref.onRotateClick;\n  return /*#__PURE__*/_react[\"default\"].createElement(\"div\", {\n    className: (0, _classnames[\"default\"])(_style[\"default\"]['toolbar-container'], className)\n  }, /*#__PURE__*/_react[\"default\"].createElement(\"div\", {\n    className: _style[\"default\"]['left-side']\n  }, /*#__PURE__*/_react[\"default\"].createElement(\"input\", {\n    className: (0, _classnames[\"default\"])('kd-cq-input', _style[\"default\"]['page-input']),\n    value: currentPage,\n    onChange: handlePageChange,\n    onBlur: handleBlur\n  }), /*#__PURE__*/_react[\"default\"].createElement(\"span\", null, \"/\"), /*#__PURE__*/_react[\"default\"].createElement(\"span\", {\n    className: _style[\"default\"].pages\n  }, totalPage)), /*#__PURE__*/_react[\"default\"].createElement(\"div\", {\n    className: _style[\"default\"]['right-side']\n  }, /*#__PURE__*/_react[\"default\"].createElement(\"div\", null, /*#__PURE__*/_react[\"default\"].createElement(\"i\", {\n    className: (0, _classnames[\"default\"])('kdfont kdfont-suoxiao', _style[\"default\"]['zoom-out-btn']),\n    onClick: handleZoomOut\n  }), /*#__PURE__*/_react[\"default\"].createElement(\"i\", {\n    className: (0, _classnames[\"default\"])('kdfont kdfont-fangda', _style[\"default\"]['zoom-in-btn']),\n    onClick: handleZoomIn\n  }), /*#__PURE__*/_react[\"default\"].createElement(\"i\", {\n    className: (0, _classnames[\"default\"])('kdfont kdfont-xuanzhuan', _style[\"default\"]['rotate-btn']),\n    onClick: handleRotate\n  }))));\n};\nvar _default = exports[\"default\"] = PDFViewerToolbar;\n\n//# sourceURL=webpack://bos-platform/./src/component/web/PDFViewer/PDFViewerToolbar.jsx?");

/***/ }),

/***/ "./src/component/web/PDFViewer/style.less":
/*!************************************************!*\
  !*** ./src/component/web/PDFViewer/style.less ***!
  \************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n// extracted by mini-css-extract-plugin\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\"pdf-viewer-container\":\"style_pdf-viewer-container_VOzi\",\"pdf-viewer-toolbar\":\"style_pdf-viewer-toolbar_2nb_\",\"pdf-viewer-wrapper\":\"style_pdf-viewer-wrapper_3rQM\",\"pdf-loading\":\"style_pdf-loading_24cc\",\"pdf-failed\":\"style_pdf-failed_3VIg\",\"pdf-viewer\":\"style_pdf-viewer_2HLT\",\"toolbar-container\":\"style_toolbar-container_9o9R\",\"page-input\":\"style_page-input_UpxE\",\"pages\":\"style_pages_3zE2\",\"zoom-out-btn\":\"style_zoom-out-btn_2WY3\",\"zoom-in-btn\":\"style_zoom-in-btn_1Quj\",\"rotate-btn\":\"style_rotate-btn_RVqG\"});\n\n//# sourceURL=webpack://bos-platform/./src/component/web/PDFViewer/style.less?");

/***/ }),

/***/ "?1b85":
/*!************************!*\
  !*** canvas (ignored) ***!
  \************************/
/***/ (function() {

eval("/* (ignored) */\n\n//# sourceURL=webpack://bos-platform/canvas_(ignored)?");

/***/ }),

/***/ "?022b":
/*!********************!*\
  !*** fs (ignored) ***!
  \********************/
/***/ (function() {

eval("/* (ignored) */\n\n//# sourceURL=webpack://bos-platform/fs_(ignored)?");

/***/ }),

/***/ "?7c40":
/*!**********************!*\
  !*** http (ignored) ***!
  \**********************/
/***/ (function() {

eval("/* (ignored) */\n\n//# sourceURL=webpack://bos-platform/http_(ignored)?");

/***/ }),

/***/ "?3a13":
/*!***********************!*\
  !*** https (ignored) ***!
  \***********************/
/***/ (function() {

eval("/* (ignored) */\n\n//# sourceURL=webpack://bos-platform/https_(ignored)?");

/***/ }),

/***/ "?ea48":
/*!*********************!*\
  !*** url (ignored) ***!
  \*********************/
/***/ (function() {

eval("/* (ignored) */\n\n//# sourceURL=webpack://bos-platform/url_(ignored)?");

/***/ }),

/***/ "?dcf6":
/*!**********************!*\
  !*** zlib (ignored) ***!
  \**********************/
/***/ (function() {

eval("/* (ignored) */\n\n//# sourceURL=webpack://bos-platform/zlib_(ignored)?");

/***/ })

}]);