\n * ```\n */\nexports.default = {\n bind: function bind(el, binding, vnode) {\n nodeList.push(el);\n var id = seed++;\n el[ctx] = {\n id: id,\n documentHandler: createDocumentHandler(el, binding, vnode),\n methodName: binding.expression,\n bindingFn: binding.value\n };\n },\n update: function update(el, binding, vnode) {\n el[ctx].documentHandler = createDocumentHandler(el, binding, vnode);\n el[ctx].methodName = binding.expression;\n el[ctx].bindingFn = binding.value;\n },\n unbind: function unbind(el) {\n var len = nodeList.length;\n\n for (var i = 0; i < len; i++) {\n if (nodeList[i][ctx].id === el[ctx].id) {\n nodeList.splice(i, 1);\n break;\n }\n }\n delete el[ctx];\n }\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/element-ui/lib/utils/clickoutside.js\n// module id = ISYW\n// module chunks = 0","var has = require('./_has');\nvar toIObject = require('./_to-iobject');\nvar arrayIndexOf = require('./_array-includes')(false);\nvar IE_PROTO = require('./_shared-key')('IE_PROTO');\n\nmodule.exports = function (object, names) {\n var O = toIObject(object);\n var i = 0;\n var result = [];\n var key;\n for (key in O) if (key != IE_PROTO) has(O, key) && result.push(key);\n // Don't enum bug & hidden keys\n while (names.length > i) if (has(O, key = names[i++])) {\n ~arrayIndexOf(result, key) || result.push(key);\n }\n return result;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/library/modules/_object-keys-internal.js\n// module id = Ibhu\n// module chunks = 0","'use strict';\n\nmodule.exports = function bind(fn, thisArg) {\n return function wrap() {\n var args = new Array(arguments.length);\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i];\n }\n return fn.apply(thisArg, args);\n };\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/axios/lib/helpers/bind.js\n// module id = JP+z\n// module chunks = 0","'use strict';\n\nvar utils = require('./utils');\nvar normalizeHeaderName = require('./helpers/normalizeHeaderName');\n\nvar DEFAULT_CONTENT_TYPE = {\n 'Content-Type': 'application/x-www-form-urlencoded'\n};\n\nfunction setContentTypeIfUnset(headers, value) {\n if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) {\n headers['Content-Type'] = value;\n }\n}\n\nfunction getDefaultAdapter() {\n var adapter;\n if (typeof XMLHttpRequest !== 'undefined') {\n // For browsers use XHR adapter\n adapter = require('./adapters/xhr');\n } else if (typeof process !== 'undefined' && Object.prototype.toString.call(process) === '[object process]') {\n // For node use HTTP adapter\n adapter = require('./adapters/http');\n }\n return adapter;\n}\n\nvar defaults = {\n adapter: getDefaultAdapter(),\n\n transformRequest: [function transformRequest(data, headers) {\n normalizeHeaderName(headers, 'Accept');\n normalizeHeaderName(headers, 'Content-Type');\n if (utils.isFormData(data) ||\n utils.isArrayBuffer(data) ||\n utils.isBuffer(data) ||\n utils.isStream(data) ||\n utils.isFile(data) ||\n utils.isBlob(data)\n ) {\n return data;\n }\n if (utils.isArrayBufferView(data)) {\n return data.buffer;\n }\n if (utils.isURLSearchParams(data)) {\n setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8');\n return data.toString();\n }\n if (utils.isObject(data)) {\n setContentTypeIfUnset(headers, 'application/json;charset=utf-8');\n return JSON.stringify(data);\n }\n return data;\n }],\n\n transformResponse: [function transformResponse(data) {\n /*eslint no-param-reassign:0*/\n if (typeof data === 'string') {\n try {\n data = JSON.parse(data);\n } catch (e) { /* Ignore */ }\n }\n return data;\n }],\n\n /**\n * A timeout in milliseconds to abort a request. If set to 0 (default) a\n * timeout is not created.\n */\n timeout: 0,\n\n xsrfCookieName: 'XSRF-TOKEN',\n xsrfHeaderName: 'X-XSRF-TOKEN',\n\n maxContentLength: -1,\n maxBodyLength: -1,\n\n validateStatus: function validateStatus(status) {\n return status >= 200 && status < 300;\n }\n};\n\ndefaults.headers = {\n common: {\n 'Accept': 'application/json, text/plain, */*'\n }\n};\n\nutils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) {\n defaults.headers[method] = {};\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE);\n});\n\nmodule.exports = defaults;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/axios/lib/defaults.js\n// module id = KCLY\n// module chunks = 0","exports.f = require('./_wks');\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/library/modules/_wks-ext.js\n// module id = Kh4W\n// module chunks = 0","/**\n * @licstart The following is the entire license notice for the\n * Javascript code in this page\n *\n * Copyright 2020 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @licend The above is the entire license notice for the\n * Javascript code in this page\n */\n\n(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"pdfjs-dist/web/pdf_viewer\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"pdfjs-dist/web/pdf_viewer\"] = factory();\n\telse\n\t\troot[\"pdfjs-dist/web/pdf_viewer\"] = root.pdfjsViewer = factory();\n})(this, function() {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __w_pdfjs_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId]) {\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/ \t\t}\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\ti: moduleId,\n/******/ \t\t\tl: false,\n/******/ \t\t\texports: {}\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __w_pdfjs_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.l = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__w_pdfjs_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__w_pdfjs_require__.c = installedModules;\n/******/\n/******/ \t// define getter function for harmony exports\n/******/ \t__w_pdfjs_require__.d = function(exports, name, getter) {\n/******/ \t\tif(!__w_pdfjs_require__.o(exports, name)) {\n/******/ \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n/******/ \t\t}\n/******/ \t};\n/******/\n/******/ \t// define __esModule on exports\n/******/ \t__w_pdfjs_require__.r = function(exports) {\n/******/ \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n/******/ \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n/******/ \t\t}\n/******/ \t\tObject.defineProperty(exports, '__esModule', { value: true });\n/******/ \t};\n/******/\n/******/ \t// create a fake namespace object\n/******/ \t// mode & 1: value is a module id, require it\n/******/ \t// mode & 2: merge all properties of value into the ns\n/******/ \t// mode & 4: return value when already ns object\n/******/ \t// mode & 8|1: behave like require\n/******/ \t__w_pdfjs_require__.t = function(value, mode) {\n/******/ \t\tif(mode & 1) value = __w_pdfjs_require__(value);\n/******/ \t\tif(mode & 8) return value;\n/******/ \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n/******/ \t\tvar ns = Object.create(null);\n/******/ \t\t__w_pdfjs_require__.r(ns);\n/******/ \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n/******/ \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __w_pdfjs_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n/******/ \t\treturn ns;\n/******/ \t};\n/******/\n/******/ \t// getDefaultExport function for compatibility with non-harmony modules\n/******/ \t__w_pdfjs_require__.n = function(module) {\n/******/ \t\tvar getter = module && module.__esModule ?\n/******/ \t\t\tfunction getDefault() { return module['default']; } :\n/******/ \t\t\tfunction getModuleExports() { return module; };\n/******/ \t\t__w_pdfjs_require__.d(getter, 'a', getter);\n/******/ \t\treturn getter;\n/******/ \t};\n/******/\n/******/ \t// Object.prototype.hasOwnProperty.call\n/******/ \t__w_pdfjs_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__w_pdfjs_require__.p = \"\";\n/******/\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __w_pdfjs_require__(__w_pdfjs_require__.s = 0);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ (function(module, exports, __w_pdfjs_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"AnnotationLayerBuilder\", {\n enumerable: true,\n get: function get() {\n return _annotation_layer_builder.AnnotationLayerBuilder;\n }\n});\nObject.defineProperty(exports, \"DefaultAnnotationLayerFactory\", {\n enumerable: true,\n get: function get() {\n return _annotation_layer_builder.DefaultAnnotationLayerFactory;\n }\n});\nObject.defineProperty(exports, \"DefaultTextLayerFactory\", {\n enumerable: true,\n get: function get() {\n return _text_layer_builder.DefaultTextLayerFactory;\n }\n});\nObject.defineProperty(exports, \"TextLayerBuilder\", {\n enumerable: true,\n get: function get() {\n return _text_layer_builder.TextLayerBuilder;\n }\n});\nObject.defineProperty(exports, \"EventBus\", {\n enumerable: true,\n get: function get() {\n return _ui_utils.EventBus;\n }\n});\nObject.defineProperty(exports, \"NullL10n\", {\n enumerable: true,\n get: function get() {\n return _ui_utils.NullL10n;\n }\n});\nObject.defineProperty(exports, \"ProgressBar\", {\n enumerable: true,\n get: function get() {\n return _ui_utils.ProgressBar;\n }\n});\nObject.defineProperty(exports, \"PDFLinkService\", {\n enumerable: true,\n get: function get() {\n return _pdf_link_service.PDFLinkService;\n }\n});\nObject.defineProperty(exports, \"SimpleLinkService\", {\n enumerable: true,\n get: function get() {\n return _pdf_link_service.SimpleLinkService;\n }\n});\nObject.defineProperty(exports, \"DownloadManager\", {\n enumerable: true,\n get: function get() {\n return _download_manager.DownloadManager;\n }\n});\nObject.defineProperty(exports, \"GenericL10n\", {\n enumerable: true,\n get: function get() {\n return _genericl10n.GenericL10n;\n }\n});\nObject.defineProperty(exports, \"PDFFindController\", {\n enumerable: true,\n get: function get() {\n return _pdf_find_controller.PDFFindController;\n }\n});\nObject.defineProperty(exports, \"PDFHistory\", {\n enumerable: true,\n get: function get() {\n return _pdf_history.PDFHistory;\n }\n});\nObject.defineProperty(exports, \"PDFPageView\", {\n enumerable: true,\n get: function get() {\n return _pdf_page_view.PDFPageView;\n }\n});\nObject.defineProperty(exports, \"PDFSinglePageViewer\", {\n enumerable: true,\n get: function get() {\n return _pdf_single_page_viewer.PDFSinglePageViewer;\n }\n});\nObject.defineProperty(exports, \"PDFViewer\", {\n enumerable: true,\n get: function get() {\n return _pdf_viewer.PDFViewer;\n }\n});\n\nvar _annotation_layer_builder = __w_pdfjs_require__(1);\n\nvar _text_layer_builder = __w_pdfjs_require__(8);\n\nvar _ui_utils = __w_pdfjs_require__(3);\n\nvar _pdf_link_service = __w_pdfjs_require__(7);\n\nvar _download_manager = __w_pdfjs_require__(9);\n\nvar _genericl10n = __w_pdfjs_require__(11);\n\nvar _pdf_find_controller = __w_pdfjs_require__(13);\n\nvar _pdf_history = __w_pdfjs_require__(15);\n\nvar _pdf_page_view = __w_pdfjs_require__(16);\n\nvar _pdf_single_page_viewer = __w_pdfjs_require__(18);\n\nvar _pdf_viewer = __w_pdfjs_require__(20);\n\nvar pdfjsVersion = '2.5.207';\nvar pdfjsBuild = '0974d605';\n\n/***/ }),\n/* 1 */\n/***/ (function(module, exports, __w_pdfjs_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.DefaultAnnotationLayerFactory = exports.AnnotationLayerBuilder = void 0;\n\nvar _pdfjsLib = __w_pdfjs_require__(2);\n\nvar _ui_utils = __w_pdfjs_require__(3);\n\nvar _pdf_link_service = __w_pdfjs_require__(7);\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nvar AnnotationLayerBuilder = /*#__PURE__*/function () {\n function AnnotationLayerBuilder(_ref) {\n var pageDiv = _ref.pageDiv,\n pdfPage = _ref.pdfPage,\n linkService = _ref.linkService,\n downloadManager = _ref.downloadManager,\n _ref$imageResourcesPa = _ref.imageResourcesPath,\n imageResourcesPath = _ref$imageResourcesPa === void 0 ? \"\" : _ref$imageResourcesPa,\n _ref$renderInteractiv = _ref.renderInteractiveForms,\n renderInteractiveForms = _ref$renderInteractiv === void 0 ? false : _ref$renderInteractiv,\n _ref$l10n = _ref.l10n,\n l10n = _ref$l10n === void 0 ? _ui_utils.NullL10n : _ref$l10n;\n\n _classCallCheck(this, AnnotationLayerBuilder);\n\n this.pageDiv = pageDiv;\n this.pdfPage = pdfPage;\n this.linkService = linkService;\n this.downloadManager = downloadManager;\n this.imageResourcesPath = imageResourcesPath;\n this.renderInteractiveForms = renderInteractiveForms;\n this.l10n = l10n;\n this.div = null;\n this._cancelled = false;\n }\n\n _createClass(AnnotationLayerBuilder, [{\n key: \"render\",\n value: function render(viewport) {\n var _this = this;\n\n var intent = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : \"display\";\n this.pdfPage.getAnnotations({\n intent: intent\n }).then(function (annotations) {\n if (_this._cancelled) {\n return;\n }\n\n var parameters = {\n viewport: viewport.clone({\n dontFlip: true\n }),\n div: _this.div,\n annotations: annotations,\n page: _this.pdfPage,\n imageResourcesPath: _this.imageResourcesPath,\n renderInteractiveForms: _this.renderInteractiveForms,\n linkService: _this.linkService,\n downloadManager: _this.downloadManager\n };\n\n if (_this.div) {\n _pdfjsLib.AnnotationLayer.update(parameters);\n } else {\n if (annotations.length === 0) {\n return;\n }\n\n _this.div = document.createElement(\"div\");\n _this.div.className = \"annotationLayer\";\n\n _this.pageDiv.appendChild(_this.div);\n\n parameters.div = _this.div;\n\n _pdfjsLib.AnnotationLayer.render(parameters);\n\n _this.l10n.translate(_this.div);\n }\n });\n }\n }, {\n key: \"cancel\",\n value: function cancel() {\n this._cancelled = true;\n }\n }, {\n key: \"hide\",\n value: function hide() {\n if (!this.div) {\n return;\n }\n\n this.div.setAttribute(\"hidden\", \"true\");\n }\n }]);\n\n return AnnotationLayerBuilder;\n}();\n\nexports.AnnotationLayerBuilder = AnnotationLayerBuilder;\n\nvar DefaultAnnotationLayerFactory = /*#__PURE__*/function () {\n function DefaultAnnotationLayerFactory() {\n _classCallCheck(this, DefaultAnnotationLayerFactory);\n }\n\n _createClass(DefaultAnnotationLayerFactory, [{\n key: \"createAnnotationLayerBuilder\",\n value: function createAnnotationLayerBuilder(pageDiv, pdfPage) {\n var imageResourcesPath = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : \"\";\n var renderInteractiveForms = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;\n var l10n = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : _ui_utils.NullL10n;\n return new AnnotationLayerBuilder({\n pageDiv: pageDiv,\n pdfPage: pdfPage,\n imageResourcesPath: imageResourcesPath,\n renderInteractiveForms: renderInteractiveForms,\n linkService: new _pdf_link_service.SimpleLinkService(),\n l10n: l10n\n });\n }\n }]);\n\n return DefaultAnnotationLayerFactory;\n}();\n\nexports.DefaultAnnotationLayerFactory = DefaultAnnotationLayerFactory;\n\n/***/ }),\n/* 2 */\n/***/ (function(module, exports, __w_pdfjs_require__) {\n\n\"use strict\";\n\n\nvar pdfjsLib;\n\nif (typeof window !== \"undefined\" && window[\"pdfjs-dist/build/pdf\"]) {\n pdfjsLib = window[\"pdfjs-dist/build/pdf\"];\n} else {\n pdfjsLib = require(\"../build/pdf.js\");\n}\n\nmodule.exports = pdfjsLib;\n\n/***/ }),\n/* 3 */\n/***/ (function(module, exports, __w_pdfjs_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.isValidRotation = isValidRotation;\nexports.isValidScrollMode = isValidScrollMode;\nexports.isValidSpreadMode = isValidSpreadMode;\nexports.isPortraitOrientation = isPortraitOrientation;\nexports.clamp = clamp;\nexports.getPDFFileNameFromURL = getPDFFileNameFromURL;\nexports.noContextMenuHandler = noContextMenuHandler;\nexports.parseQueryString = parseQueryString;\nexports.backtrackBeforeAllVisibleElements = backtrackBeforeAllVisibleElements;\nexports.getVisibleElements = getVisibleElements;\nexports.roundToDivide = roundToDivide;\nexports.getPageSizeInches = getPageSizeInches;\nexports.approximateFraction = approximateFraction;\nexports.getOutputScale = getOutputScale;\nexports.scrollIntoView = scrollIntoView;\nexports.watchScroll = watchScroll;\nexports.binarySearchFirstItem = binarySearchFirstItem;\nexports.normalizeWheelEventDelta = normalizeWheelEventDelta;\nexports.waitOnEventOrTimeout = waitOnEventOrTimeout;\nexports.moveToEndOfArray = moveToEndOfArray;\nexports.WaitOnType = exports.animationStarted = exports.ProgressBar = exports.EventBus = exports.NullL10n = exports.SpreadMode = exports.ScrollMode = exports.TextLayerMode = exports.RendererType = exports.PresentationModeState = exports.VERTICAL_PADDING = exports.SCROLLBAR_PADDING = exports.MAX_AUTO_SCALE = exports.UNKNOWN_SCALE = exports.MAX_SCALE = exports.MIN_SCALE = exports.DEFAULT_SCALE = exports.DEFAULT_SCALE_VALUE = exports.CSS_UNITS = exports.AutoPrintRegExp = void 0;\n\nvar _regenerator = _interopRequireDefault(__w_pdfjs_require__(4));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\n\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.\"); }\n\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); }\n\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; }\n\nfunction _iterableToArrayLimit(arr, i) { if (typeof Symbol === \"undefined\" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nfunction asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }\n\nfunction _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err); } _next(undefined); }); }; }\n\nvar CSS_UNITS = 96.0 / 72.0;\nexports.CSS_UNITS = CSS_UNITS;\nvar DEFAULT_SCALE_VALUE = \"auto\";\nexports.DEFAULT_SCALE_VALUE = DEFAULT_SCALE_VALUE;\nvar DEFAULT_SCALE = 1.0;\nexports.DEFAULT_SCALE = DEFAULT_SCALE;\nvar MIN_SCALE = 0.1;\nexports.MIN_SCALE = MIN_SCALE;\nvar MAX_SCALE = 10.0;\nexports.MAX_SCALE = MAX_SCALE;\nvar UNKNOWN_SCALE = 0;\nexports.UNKNOWN_SCALE = UNKNOWN_SCALE;\nvar MAX_AUTO_SCALE = 1.25;\nexports.MAX_AUTO_SCALE = MAX_AUTO_SCALE;\nvar SCROLLBAR_PADDING = 40;\nexports.SCROLLBAR_PADDING = SCROLLBAR_PADDING;\nvar VERTICAL_PADDING = 5;\nexports.VERTICAL_PADDING = VERTICAL_PADDING;\nvar PresentationModeState = {\n UNKNOWN: 0,\n NORMAL: 1,\n CHANGING: 2,\n FULLSCREEN: 3\n};\nexports.PresentationModeState = PresentationModeState;\nvar RendererType = {\n CANVAS: \"canvas\",\n SVG: \"svg\"\n};\nexports.RendererType = RendererType;\nvar TextLayerMode = {\n DISABLE: 0,\n ENABLE: 1,\n ENABLE_ENHANCE: 2\n};\nexports.TextLayerMode = TextLayerMode;\nvar ScrollMode = {\n UNKNOWN: -1,\n VERTICAL: 0,\n HORIZONTAL: 1,\n WRAPPED: 2\n};\nexports.ScrollMode = ScrollMode;\nvar SpreadMode = {\n UNKNOWN: -1,\n NONE: 0,\n ODD: 1,\n EVEN: 2\n};\nexports.SpreadMode = SpreadMode;\nvar AutoPrintRegExp = /\\bprint\\s*\\(/;\nexports.AutoPrintRegExp = AutoPrintRegExp;\n\nfunction formatL10nValue(text, args) {\n if (!args) {\n return text;\n }\n\n return text.replace(/\\{\\{\\s*(\\w+)\\s*\\}\\}/g, function (all, name) {\n return name in args ? args[name] : \"{{\" + name + \"}}\";\n });\n}\n\nvar NullL10n = {\n getLanguage: function getLanguage() {\n return _asyncToGenerator( /*#__PURE__*/_regenerator[\"default\"].mark(function _callee() {\n return _regenerator[\"default\"].wrap(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n return _context.abrupt(\"return\", \"en-us\");\n\n case 1:\n case \"end\":\n return _context.stop();\n }\n }\n }, _callee);\n }))();\n },\n getDirection: function getDirection() {\n return _asyncToGenerator( /*#__PURE__*/_regenerator[\"default\"].mark(function _callee2() {\n return _regenerator[\"default\"].wrap(function _callee2$(_context2) {\n while (1) {\n switch (_context2.prev = _context2.next) {\n case 0:\n return _context2.abrupt(\"return\", \"ltr\");\n\n case 1:\n case \"end\":\n return _context2.stop();\n }\n }\n }, _callee2);\n }))();\n },\n get: function get(property, args, fallback) {\n return _asyncToGenerator( /*#__PURE__*/_regenerator[\"default\"].mark(function _callee3() {\n return _regenerator[\"default\"].wrap(function _callee3$(_context3) {\n while (1) {\n switch (_context3.prev = _context3.next) {\n case 0:\n return _context3.abrupt(\"return\", formatL10nValue(fallback, args));\n\n case 1:\n case \"end\":\n return _context3.stop();\n }\n }\n }, _callee3);\n }))();\n },\n translate: function translate(element) {\n return _asyncToGenerator( /*#__PURE__*/_regenerator[\"default\"].mark(function _callee4() {\n return _regenerator[\"default\"].wrap(function _callee4$(_context4) {\n while (1) {\n switch (_context4.prev = _context4.next) {\n case 0:\n case \"end\":\n return _context4.stop();\n }\n }\n }, _callee4);\n }))();\n }\n};\nexports.NullL10n = NullL10n;\n\nfunction getOutputScale(ctx) {\n var devicePixelRatio = window.devicePixelRatio || 1;\n var backingStoreRatio = ctx.webkitBackingStorePixelRatio || ctx.mozBackingStorePixelRatio || ctx.msBackingStorePixelRatio || ctx.oBackingStorePixelRatio || ctx.backingStorePixelRatio || 1;\n var pixelRatio = devicePixelRatio / backingStoreRatio;\n return {\n sx: pixelRatio,\n sy: pixelRatio,\n scaled: pixelRatio !== 1\n };\n}\n\nfunction scrollIntoView(element, spot) {\n var skipOverflowHiddenElements = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n var parent = element.offsetParent;\n\n if (!parent) {\n console.error(\"offsetParent is not set -- cannot scroll\");\n return;\n }\n\n var offsetY = element.offsetTop + element.clientTop;\n var offsetX = element.offsetLeft + element.clientLeft;\n\n while (parent.clientHeight === parent.scrollHeight && parent.clientWidth === parent.scrollWidth || skipOverflowHiddenElements && getComputedStyle(parent).overflow === \"hidden\") {\n if (parent.dataset._scaleY) {\n offsetY /= parent.dataset._scaleY;\n offsetX /= parent.dataset._scaleX;\n }\n\n offsetY += parent.offsetTop;\n offsetX += parent.offsetLeft;\n parent = parent.offsetParent;\n\n if (!parent) {\n return;\n }\n }\n\n if (spot) {\n if (spot.top !== undefined) {\n offsetY += spot.top;\n }\n\n if (spot.left !== undefined) {\n offsetX += spot.left;\n parent.scrollLeft = offsetX;\n }\n }\n\n parent.scrollTop = offsetY;\n}\n\nfunction watchScroll(viewAreaElement, callback) {\n var debounceScroll = function debounceScroll(evt) {\n if (rAF) {\n return;\n }\n\n rAF = window.requestAnimationFrame(function viewAreaElementScrolled() {\n rAF = null;\n var currentX = viewAreaElement.scrollLeft;\n var lastX = state.lastX;\n\n if (currentX !== lastX) {\n state.right = currentX > lastX;\n }\n\n state.lastX = currentX;\n var currentY = viewAreaElement.scrollTop;\n var lastY = state.lastY;\n\n if (currentY !== lastY) {\n state.down = currentY > lastY;\n }\n\n state.lastY = currentY;\n callback(state);\n });\n };\n\n var state = {\n right: true,\n down: true,\n lastX: viewAreaElement.scrollLeft,\n lastY: viewAreaElement.scrollTop,\n _eventHandler: debounceScroll\n };\n var rAF = null;\n viewAreaElement.addEventListener(\"scroll\", debounceScroll, true);\n return state;\n}\n\nfunction parseQueryString(query) {\n var parts = query.split(\"&\");\n var params = Object.create(null);\n\n for (var i = 0, ii = parts.length; i < ii; ++i) {\n var param = parts[i].split(\"=\");\n var key = param[0].toLowerCase();\n var value = param.length > 1 ? param[1] : null;\n params[decodeURIComponent(key)] = decodeURIComponent(value);\n }\n\n return params;\n}\n\nfunction binarySearchFirstItem(items, condition) {\n var minIndex = 0;\n var maxIndex = items.length - 1;\n\n if (maxIndex < 0 || !condition(items[maxIndex])) {\n return items.length;\n }\n\n if (condition(items[minIndex])) {\n return minIndex;\n }\n\n while (minIndex < maxIndex) {\n var currentIndex = minIndex + maxIndex >> 1;\n var currentItem = items[currentIndex];\n\n if (condition(currentItem)) {\n maxIndex = currentIndex;\n } else {\n minIndex = currentIndex + 1;\n }\n }\n\n return minIndex;\n}\n\nfunction approximateFraction(x) {\n if (Math.floor(x) === x) {\n return [x, 1];\n }\n\n var xinv = 1 / x;\n var limit = 8;\n\n if (xinv > limit) {\n return [1, limit];\n } else if (Math.floor(xinv) === xinv) {\n return [1, xinv];\n }\n\n var x_ = x > 1 ? xinv : x;\n var a = 0,\n b = 1,\n c = 1,\n d = 1;\n\n while (true) {\n var p = a + c,\n q = b + d;\n\n if (q > limit) {\n break;\n }\n\n if (x_ <= p / q) {\n c = p;\n d = q;\n } else {\n a = p;\n b = q;\n }\n }\n\n var result;\n\n if (x_ - a / b < c / d - x_) {\n result = x_ === x ? [a, b] : [b, a];\n } else {\n result = x_ === x ? [c, d] : [d, c];\n }\n\n return result;\n}\n\nfunction roundToDivide(x, div) {\n var r = x % div;\n return r === 0 ? x : Math.round(x - r + div);\n}\n\nfunction getPageSizeInches(_ref) {\n var view = _ref.view,\n userUnit = _ref.userUnit,\n rotate = _ref.rotate;\n\n var _view = _slicedToArray(view, 4),\n x1 = _view[0],\n y1 = _view[1],\n x2 = _view[2],\n y2 = _view[3];\n\n var changeOrientation = rotate % 180 !== 0;\n var width = (x2 - x1) / 72 * userUnit;\n var height = (y2 - y1) / 72 * userUnit;\n return {\n width: changeOrientation ? height : width,\n height: changeOrientation ? width : height\n };\n}\n\nfunction backtrackBeforeAllVisibleElements(index, views, top) {\n if (index < 2) {\n return index;\n }\n\n var elt = views[index].div;\n var pageTop = elt.offsetTop + elt.clientTop;\n\n if (pageTop >= top) {\n elt = views[index - 1].div;\n pageTop = elt.offsetTop + elt.clientTop;\n }\n\n for (var i = index - 2; i >= 0; --i) {\n elt = views[i].div;\n\n if (elt.offsetTop + elt.clientTop + elt.clientHeight <= pageTop) {\n break;\n }\n\n index = i;\n }\n\n return index;\n}\n\nfunction getVisibleElements(scrollEl, views) {\n var sortByVisibility = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n var horizontal = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;\n var top = scrollEl.scrollTop,\n bottom = top + scrollEl.clientHeight;\n var left = scrollEl.scrollLeft,\n right = left + scrollEl.clientWidth;\n\n function isElementBottomAfterViewTop(view) {\n var element = view.div;\n var elementBottom = element.offsetTop + element.clientTop + element.clientHeight;\n return elementBottom > top;\n }\n\n function isElementRightAfterViewLeft(view) {\n var element = view.div;\n var elementRight = element.offsetLeft + element.clientLeft + element.clientWidth;\n return elementRight > left;\n }\n\n var visible = [],\n numViews = views.length;\n var firstVisibleElementInd = numViews === 0 ? 0 : binarySearchFirstItem(views, horizontal ? isElementRightAfterViewLeft : isElementBottomAfterViewTop);\n\n if (firstVisibleElementInd > 0 && firstVisibleElementInd < numViews && !horizontal) {\n firstVisibleElementInd = backtrackBeforeAllVisibleElements(firstVisibleElementInd, views, top);\n }\n\n var lastEdge = horizontal ? right : -1;\n\n for (var i = firstVisibleElementInd; i < numViews; i++) {\n var view = views[i],\n element = view.div;\n var currentWidth = element.offsetLeft + element.clientLeft;\n var currentHeight = element.offsetTop + element.clientTop;\n var viewWidth = element.clientWidth,\n viewHeight = element.clientHeight;\n var viewRight = currentWidth + viewWidth;\n var viewBottom = currentHeight + viewHeight;\n\n if (lastEdge === -1) {\n if (viewBottom >= bottom) {\n lastEdge = viewBottom;\n }\n } else if ((horizontal ? currentWidth : currentHeight) > lastEdge) {\n break;\n }\n\n if (viewBottom <= top || currentHeight >= bottom || viewRight <= left || currentWidth >= right) {\n continue;\n }\n\n var hiddenHeight = Math.max(0, top - currentHeight) + Math.max(0, viewBottom - bottom);\n var hiddenWidth = Math.max(0, left - currentWidth) + Math.max(0, viewRight - right);\n var percent = (viewHeight - hiddenHeight) * (viewWidth - hiddenWidth) * 100 / viewHeight / viewWidth | 0;\n visible.push({\n id: view.id,\n x: currentWidth,\n y: currentHeight,\n view: view,\n percent: percent\n });\n }\n\n var first = visible[0],\n last = visible[visible.length - 1];\n\n if (sortByVisibility) {\n visible.sort(function (a, b) {\n var pc = a.percent - b.percent;\n\n if (Math.abs(pc) > 0.001) {\n return -pc;\n }\n\n return a.id - b.id;\n });\n }\n\n return {\n first: first,\n last: last,\n views: visible\n };\n}\n\nfunction noContextMenuHandler(evt) {\n evt.preventDefault();\n}\n\nfunction isDataSchema(url) {\n var i = 0;\n var ii = url.length;\n\n while (i < ii && url[i].trim() === \"\") {\n i++;\n }\n\n return url.substring(i, i + 5).toLowerCase() === \"data:\";\n}\n\nfunction getPDFFileNameFromURL(url) {\n var defaultFilename = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : \"document.pdf\";\n\n if (typeof url !== \"string\") {\n return defaultFilename;\n }\n\n if (isDataSchema(url)) {\n console.warn(\"getPDFFileNameFromURL: \" + 'ignoring \"data:\" URL for performance reasons.');\n return defaultFilename;\n }\n\n var reURI = /^(?:(?:[^:]+:)?\\/\\/[^\\/]+)?([^?#]*)(\\?[^#]*)?(#.*)?$/;\n var reFilename = /[^\\/?#=]+\\.pdf\\b(?!.*\\.pdf\\b)/i;\n var splitURI = reURI.exec(url);\n var suggestedFilename = reFilename.exec(splitURI[1]) || reFilename.exec(splitURI[2]) || reFilename.exec(splitURI[3]);\n\n if (suggestedFilename) {\n suggestedFilename = suggestedFilename[0];\n\n if (suggestedFilename.includes(\"%\")) {\n try {\n suggestedFilename = reFilename.exec(decodeURIComponent(suggestedFilename))[0];\n } catch (ex) {}\n }\n }\n\n return suggestedFilename || defaultFilename;\n}\n\nfunction normalizeWheelEventDelta(evt) {\n var delta = Math.sqrt(evt.deltaX * evt.deltaX + evt.deltaY * evt.deltaY);\n var angle = Math.atan2(evt.deltaY, evt.deltaX);\n\n if (-0.25 * Math.PI < angle && angle < 0.75 * Math.PI) {\n delta = -delta;\n }\n\n var MOUSE_DOM_DELTA_PIXEL_MODE = 0;\n var MOUSE_DOM_DELTA_LINE_MODE = 1;\n var MOUSE_PIXELS_PER_LINE = 30;\n var MOUSE_LINES_PER_PAGE = 30;\n\n if (evt.deltaMode === MOUSE_DOM_DELTA_PIXEL_MODE) {\n delta /= MOUSE_PIXELS_PER_LINE * MOUSE_LINES_PER_PAGE;\n } else if (evt.deltaMode === MOUSE_DOM_DELTA_LINE_MODE) {\n delta /= MOUSE_LINES_PER_PAGE;\n }\n\n return delta;\n}\n\nfunction isValidRotation(angle) {\n return Number.isInteger(angle) && angle % 90 === 0;\n}\n\nfunction isValidScrollMode(mode) {\n return Number.isInteger(mode) && Object.values(ScrollMode).includes(mode) && mode !== ScrollMode.UNKNOWN;\n}\n\nfunction isValidSpreadMode(mode) {\n return Number.isInteger(mode) && Object.values(SpreadMode).includes(mode) && mode !== SpreadMode.UNKNOWN;\n}\n\nfunction isPortraitOrientation(size) {\n return size.width <= size.height;\n}\n\nvar WaitOnType = {\n EVENT: \"event\",\n TIMEOUT: \"timeout\"\n};\nexports.WaitOnType = WaitOnType;\n\nfunction waitOnEventOrTimeout(_ref2) {\n var target = _ref2.target,\n name = _ref2.name,\n _ref2$delay = _ref2.delay,\n delay = _ref2$delay === void 0 ? 0 : _ref2$delay;\n return new Promise(function (resolve, reject) {\n if (_typeof(target) !== \"object\" || !(name && typeof name === \"string\") || !(Number.isInteger(delay) && delay >= 0)) {\n throw new Error(\"waitOnEventOrTimeout - invalid parameters.\");\n }\n\n function handler(type) {\n if (target instanceof EventBus) {\n target._off(name, eventHandler);\n } else {\n target.removeEventListener(name, eventHandler);\n }\n\n if (timeout) {\n clearTimeout(timeout);\n }\n\n resolve(type);\n }\n\n var eventHandler = handler.bind(null, WaitOnType.EVENT);\n\n if (target instanceof EventBus) {\n target._on(name, eventHandler);\n } else {\n target.addEventListener(name, eventHandler);\n }\n\n var timeoutHandler = handler.bind(null, WaitOnType.TIMEOUT);\n var timeout = setTimeout(timeoutHandler, delay);\n });\n}\n\nvar animationStarted = new Promise(function (resolve) {\n window.requestAnimationFrame(resolve);\n});\nexports.animationStarted = animationStarted;\n\nfunction dispatchDOMEvent(eventName) {\n var args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;\n throw new Error(\"Not implemented: dispatchDOMEvent\");\n}\n\nvar EventBus = /*#__PURE__*/function () {\n function EventBus(options) {\n _classCallCheck(this, EventBus);\n\n this._listeners = Object.create(null);\n }\n\n _createClass(EventBus, [{\n key: \"on\",\n value: function on(eventName, listener) {\n this._on(eventName, listener, {\n external: true\n });\n }\n }, {\n key: \"off\",\n value: function off(eventName, listener) {\n this._off(eventName, listener, {\n external: true\n });\n }\n }, {\n key: \"dispatch\",\n value: function dispatch(eventName) {\n var eventListeners = this._listeners[eventName];\n\n if (!eventListeners || eventListeners.length === 0) {\n return;\n }\n\n var args = Array.prototype.slice.call(arguments, 1);\n var externalListeners;\n eventListeners.slice(0).forEach(function (_ref3) {\n var listener = _ref3.listener,\n external = _ref3.external;\n\n if (external) {\n if (!externalListeners) {\n externalListeners = [];\n }\n\n externalListeners.push(listener);\n return;\n }\n\n listener.apply(null, args);\n });\n\n if (externalListeners) {\n externalListeners.forEach(function (listener) {\n listener.apply(null, args);\n });\n externalListeners = null;\n }\n }\n }, {\n key: \"_on\",\n value: function _on(eventName, listener) {\n var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;\n var eventListeners = this._listeners[eventName];\n\n if (!eventListeners) {\n this._listeners[eventName] = eventListeners = [];\n }\n\n eventListeners.push({\n listener: listener,\n external: (options && options.external) === true\n });\n }\n }, {\n key: \"_off\",\n value: function _off(eventName, listener) {\n var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;\n var eventListeners = this._listeners[eventName];\n\n if (!eventListeners) {\n return;\n }\n\n for (var i = 0, ii = eventListeners.length; i < ii; i++) {\n if (eventListeners[i].listener === listener) {\n eventListeners.splice(i, 1);\n return;\n }\n }\n }\n }]);\n\n return EventBus;\n}();\n\nexports.EventBus = EventBus;\n\nfunction clamp(v, min, max) {\n return Math.min(Math.max(v, min), max);\n}\n\nvar ProgressBar = /*#__PURE__*/function () {\n function ProgressBar(id) {\n var _ref4 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},\n height = _ref4.height,\n width = _ref4.width,\n units = _ref4.units;\n\n _classCallCheck(this, ProgressBar);\n\n this.visible = true;\n this.div = document.querySelector(id + \" .progress\");\n this.bar = this.div.parentNode;\n this.height = height || 100;\n this.width = width || 100;\n this.units = units || \"%\";\n this.div.style.height = this.height + this.units;\n this.percent = 0;\n }\n\n _createClass(ProgressBar, [{\n key: \"_updateBar\",\n value: function _updateBar() {\n if (this._indeterminate) {\n this.div.classList.add(\"indeterminate\");\n this.div.style.width = this.width + this.units;\n return;\n }\n\n this.div.classList.remove(\"indeterminate\");\n var progressSize = this.width * this._percent / 100;\n this.div.style.width = progressSize + this.units;\n }\n }, {\n key: \"setWidth\",\n value: function setWidth(viewer) {\n if (!viewer) {\n return;\n }\n\n var container = viewer.parentNode;\n var scrollbarWidth = container.offsetWidth - viewer.offsetWidth;\n\n if (scrollbarWidth > 0) {\n this.bar.style.width = \"calc(100% - \".concat(scrollbarWidth, \"px)\");\n }\n }\n }, {\n key: \"hide\",\n value: function hide() {\n if (!this.visible) {\n return;\n }\n\n this.visible = false;\n this.bar.classList.add(\"hidden\");\n document.body.classList.remove(\"loadingInProgress\");\n }\n }, {\n key: \"show\",\n value: function show() {\n if (this.visible) {\n return;\n }\n\n this.visible = true;\n document.body.classList.add(\"loadingInProgress\");\n this.bar.classList.remove(\"hidden\");\n }\n }, {\n key: \"percent\",\n get: function get() {\n return this._percent;\n },\n set: function set(val) {\n this._indeterminate = isNaN(val);\n this._percent = clamp(val, 0, 100);\n\n this._updateBar();\n }\n }]);\n\n return ProgressBar;\n}();\n\nexports.ProgressBar = ProgressBar;\n\nfunction moveToEndOfArray(arr, condition) {\n var moved = [],\n len = arr.length;\n var write = 0;\n\n for (var read = 0; read < len; ++read) {\n if (condition(arr[read])) {\n moved.push(arr[read]);\n } else {\n arr[write] = arr[read];\n ++write;\n }\n }\n\n for (var _read = 0; write < len; ++_read, ++write) {\n arr[write] = moved[_read];\n }\n}\n\n/***/ }),\n/* 4 */\n/***/ (function(module, exports, __w_pdfjs_require__) {\n\n\"use strict\";\n\n\nmodule.exports = __w_pdfjs_require__(5);\n\n/***/ }),\n/* 5 */\n/***/ (function(module, exports, __w_pdfjs_require__) {\n\n\"use strict\";\n/* WEBPACK VAR INJECTION */(function(module) {\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nvar runtime = function (exports) {\n \"use strict\";\n\n var Op = Object.prototype;\n var hasOwn = Op.hasOwnProperty;\n var undefined;\n var $Symbol = typeof Symbol === \"function\" ? Symbol : {};\n var iteratorSymbol = $Symbol.iterator || \"@@iterator\";\n var asyncIteratorSymbol = $Symbol.asyncIterator || \"@@asyncIterator\";\n var toStringTagSymbol = $Symbol.toStringTag || \"@@toStringTag\";\n\n function wrap(innerFn, outerFn, self, tryLocsList) {\n var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;\n var generator = Object.create(protoGenerator.prototype);\n var context = new Context(tryLocsList || []);\n generator._invoke = makeInvokeMethod(innerFn, self, context);\n return generator;\n }\n\n exports.wrap = wrap;\n\n function tryCatch(fn, obj, arg) {\n try {\n return {\n type: \"normal\",\n arg: fn.call(obj, arg)\n };\n } catch (err) {\n return {\n type: \"throw\",\n arg: err\n };\n }\n }\n\n var GenStateSuspendedStart = \"suspendedStart\";\n var GenStateSuspendedYield = \"suspendedYield\";\n var GenStateExecuting = \"executing\";\n var GenStateCompleted = \"completed\";\n var ContinueSentinel = {};\n\n function Generator() {}\n\n function GeneratorFunction() {}\n\n function GeneratorFunctionPrototype() {}\n\n var IteratorPrototype = {};\n\n IteratorPrototype[iteratorSymbol] = function () {\n return this;\n };\n\n var getProto = Object.getPrototypeOf;\n var NativeIteratorPrototype = getProto && getProto(getProto(values([])));\n\n if (NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {\n IteratorPrototype = NativeIteratorPrototype;\n }\n\n var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);\n GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;\n GeneratorFunctionPrototype.constructor = GeneratorFunction;\n GeneratorFunctionPrototype[toStringTagSymbol] = GeneratorFunction.displayName = \"GeneratorFunction\";\n\n function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function (method) {\n prototype[method] = function (arg) {\n return this._invoke(method, arg);\n };\n });\n }\n\n exports.isGeneratorFunction = function (genFun) {\n var ctor = typeof genFun === \"function\" && genFun.constructor;\n return ctor ? ctor === GeneratorFunction || (ctor.displayName || ctor.name) === \"GeneratorFunction\" : false;\n };\n\n exports.mark = function (genFun) {\n if (Object.setPrototypeOf) {\n Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);\n } else {\n genFun.__proto__ = GeneratorFunctionPrototype;\n\n if (!(toStringTagSymbol in genFun)) {\n genFun[toStringTagSymbol] = \"GeneratorFunction\";\n }\n }\n\n genFun.prototype = Object.create(Gp);\n return genFun;\n };\n\n exports.awrap = function (arg) {\n return {\n __await: arg\n };\n };\n\n function AsyncIterator(generator, PromiseImpl) {\n function invoke(method, arg, resolve, reject) {\n var record = tryCatch(generator[method], generator, arg);\n\n if (record.type === \"throw\") {\n reject(record.arg);\n } else {\n var result = record.arg;\n var value = result.value;\n\n if (value && _typeof(value) === \"object\" && hasOwn.call(value, \"__await\")) {\n return PromiseImpl.resolve(value.__await).then(function (value) {\n invoke(\"next\", value, resolve, reject);\n }, function (err) {\n invoke(\"throw\", err, resolve, reject);\n });\n }\n\n return PromiseImpl.resolve(value).then(function (unwrapped) {\n result.value = unwrapped;\n resolve(result);\n }, function (error) {\n return invoke(\"throw\", error, resolve, reject);\n });\n }\n }\n\n var previousPromise;\n\n function enqueue(method, arg) {\n function callInvokeWithMethodAndArg() {\n return new PromiseImpl(function (resolve, reject) {\n invoke(method, arg, resolve, reject);\n });\n }\n\n return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();\n }\n\n this._invoke = enqueue;\n }\n\n defineIteratorMethods(AsyncIterator.prototype);\n\n AsyncIterator.prototype[asyncIteratorSymbol] = function () {\n return this;\n };\n\n exports.AsyncIterator = AsyncIterator;\n\n exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {\n if (PromiseImpl === void 0) PromiseImpl = Promise;\n var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);\n return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) {\n return result.done ? result.value : iter.next();\n });\n };\n\n function makeInvokeMethod(innerFn, self, context) {\n var state = GenStateSuspendedStart;\n return function invoke(method, arg) {\n if (state === GenStateExecuting) {\n throw new Error(\"Generator is already running\");\n }\n\n if (state === GenStateCompleted) {\n if (method === \"throw\") {\n throw arg;\n }\n\n return doneResult();\n }\n\n context.method = method;\n context.arg = arg;\n\n while (true) {\n var delegate = context.delegate;\n\n if (delegate) {\n var delegateResult = maybeInvokeDelegate(delegate, context);\n\n if (delegateResult) {\n if (delegateResult === ContinueSentinel) continue;\n return delegateResult;\n }\n }\n\n if (context.method === \"next\") {\n context.sent = context._sent = context.arg;\n } else if (context.method === \"throw\") {\n if (state === GenStateSuspendedStart) {\n state = GenStateCompleted;\n throw context.arg;\n }\n\n context.dispatchException(context.arg);\n } else if (context.method === \"return\") {\n context.abrupt(\"return\", context.arg);\n }\n\n state = GenStateExecuting;\n var record = tryCatch(innerFn, self, context);\n\n if (record.type === \"normal\") {\n state = context.done ? GenStateCompleted : GenStateSuspendedYield;\n\n if (record.arg === ContinueSentinel) {\n continue;\n }\n\n return {\n value: record.arg,\n done: context.done\n };\n } else if (record.type === \"throw\") {\n state = GenStateCompleted;\n context.method = \"throw\";\n context.arg = record.arg;\n }\n }\n };\n }\n\n function maybeInvokeDelegate(delegate, context) {\n var method = delegate.iterator[context.method];\n\n if (method === undefined) {\n context.delegate = null;\n\n if (context.method === \"throw\") {\n if (delegate.iterator[\"return\"]) {\n context.method = \"return\";\n context.arg = undefined;\n maybeInvokeDelegate(delegate, context);\n\n if (context.method === \"throw\") {\n return ContinueSentinel;\n }\n }\n\n context.method = \"throw\";\n context.arg = new TypeError(\"The iterator does not provide a 'throw' method\");\n }\n\n return ContinueSentinel;\n }\n\n var record = tryCatch(method, delegate.iterator, context.arg);\n\n if (record.type === \"throw\") {\n context.method = \"throw\";\n context.arg = record.arg;\n context.delegate = null;\n return ContinueSentinel;\n }\n\n var info = record.arg;\n\n if (!info) {\n context.method = \"throw\";\n context.arg = new TypeError(\"iterator result is not an object\");\n context.delegate = null;\n return ContinueSentinel;\n }\n\n if (info.done) {\n context[delegate.resultName] = info.value;\n context.next = delegate.nextLoc;\n\n if (context.method !== \"return\") {\n context.method = \"next\";\n context.arg = undefined;\n }\n } else {\n return info;\n }\n\n context.delegate = null;\n return ContinueSentinel;\n }\n\n defineIteratorMethods(Gp);\n Gp[toStringTagSymbol] = \"Generator\";\n\n Gp[iteratorSymbol] = function () {\n return this;\n };\n\n Gp.toString = function () {\n return \"[object Generator]\";\n };\n\n function pushTryEntry(locs) {\n var entry = {\n tryLoc: locs[0]\n };\n\n if (1 in locs) {\n entry.catchLoc = locs[1];\n }\n\n if (2 in locs) {\n entry.finallyLoc = locs[2];\n entry.afterLoc = locs[3];\n }\n\n this.tryEntries.push(entry);\n }\n\n function resetTryEntry(entry) {\n var record = entry.completion || {};\n record.type = \"normal\";\n delete record.arg;\n entry.completion = record;\n }\n\n function Context(tryLocsList) {\n this.tryEntries = [{\n tryLoc: \"root\"\n }];\n tryLocsList.forEach(pushTryEntry, this);\n this.reset(true);\n }\n\n exports.keys = function (object) {\n var keys = [];\n\n for (var key in object) {\n keys.push(key);\n }\n\n keys.reverse();\n return function next() {\n while (keys.length) {\n var key = keys.pop();\n\n if (key in object) {\n next.value = key;\n next.done = false;\n return next;\n }\n }\n\n next.done = true;\n return next;\n };\n };\n\n function values(iterable) {\n if (iterable) {\n var iteratorMethod = iterable[iteratorSymbol];\n\n if (iteratorMethod) {\n return iteratorMethod.call(iterable);\n }\n\n if (typeof iterable.next === \"function\") {\n return iterable;\n }\n\n if (!isNaN(iterable.length)) {\n var i = -1,\n next = function next() {\n while (++i < iterable.length) {\n if (hasOwn.call(iterable, i)) {\n next.value = iterable[i];\n next.done = false;\n return next;\n }\n }\n\n next.value = undefined;\n next.done = true;\n return next;\n };\n\n return next.next = next;\n }\n }\n\n return {\n next: doneResult\n };\n }\n\n exports.values = values;\n\n function doneResult() {\n return {\n value: undefined,\n done: true\n };\n }\n\n Context.prototype = {\n constructor: Context,\n reset: function reset(skipTempReset) {\n this.prev = 0;\n this.next = 0;\n this.sent = this._sent = undefined;\n this.done = false;\n this.delegate = null;\n this.method = \"next\";\n this.arg = undefined;\n this.tryEntries.forEach(resetTryEntry);\n\n if (!skipTempReset) {\n for (var name in this) {\n if (name.charAt(0) === \"t\" && hasOwn.call(this, name) && !isNaN(+name.slice(1))) {\n this[name] = undefined;\n }\n }\n }\n },\n stop: function stop() {\n this.done = true;\n var rootEntry = this.tryEntries[0];\n var rootRecord = rootEntry.completion;\n\n if (rootRecord.type === \"throw\") {\n throw rootRecord.arg;\n }\n\n return this.rval;\n },\n dispatchException: function dispatchException(exception) {\n if (this.done) {\n throw exception;\n }\n\n var context = this;\n\n function handle(loc, caught) {\n record.type = \"throw\";\n record.arg = exception;\n context.next = loc;\n\n if (caught) {\n context.method = \"next\";\n context.arg = undefined;\n }\n\n return !!caught;\n }\n\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n var record = entry.completion;\n\n if (entry.tryLoc === \"root\") {\n return handle(\"end\");\n }\n\n if (entry.tryLoc <= this.prev) {\n var hasCatch = hasOwn.call(entry, \"catchLoc\");\n var hasFinally = hasOwn.call(entry, \"finallyLoc\");\n\n if (hasCatch && hasFinally) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n } else if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n } else if (hasCatch) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n }\n } else if (hasFinally) {\n if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n } else {\n throw new Error(\"try statement without catch or finally\");\n }\n }\n }\n },\n abrupt: function abrupt(type, arg) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n\n if (entry.tryLoc <= this.prev && hasOwn.call(entry, \"finallyLoc\") && this.prev < entry.finallyLoc) {\n var finallyEntry = entry;\n break;\n }\n }\n\n if (finallyEntry && (type === \"break\" || type === \"continue\") && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc) {\n finallyEntry = null;\n }\n\n var record = finallyEntry ? finallyEntry.completion : {};\n record.type = type;\n record.arg = arg;\n\n if (finallyEntry) {\n this.method = \"next\";\n this.next = finallyEntry.finallyLoc;\n return ContinueSentinel;\n }\n\n return this.complete(record);\n },\n complete: function complete(record, afterLoc) {\n if (record.type === \"throw\") {\n throw record.arg;\n }\n\n if (record.type === \"break\" || record.type === \"continue\") {\n this.next = record.arg;\n } else if (record.type === \"return\") {\n this.rval = this.arg = record.arg;\n this.method = \"return\";\n this.next = \"end\";\n } else if (record.type === \"normal\" && afterLoc) {\n this.next = afterLoc;\n }\n\n return ContinueSentinel;\n },\n finish: function finish(finallyLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n\n if (entry.finallyLoc === finallyLoc) {\n this.complete(entry.completion, entry.afterLoc);\n resetTryEntry(entry);\n return ContinueSentinel;\n }\n }\n },\n \"catch\": function _catch(tryLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n\n if (entry.tryLoc === tryLoc) {\n var record = entry.completion;\n\n if (record.type === \"throw\") {\n var thrown = record.arg;\n resetTryEntry(entry);\n }\n\n return thrown;\n }\n }\n\n throw new Error(\"illegal catch attempt\");\n },\n delegateYield: function delegateYield(iterable, resultName, nextLoc) {\n this.delegate = {\n iterator: values(iterable),\n resultName: resultName,\n nextLoc: nextLoc\n };\n\n if (this.method === \"next\") {\n this.arg = undefined;\n }\n\n return ContinueSentinel;\n }\n };\n return exports;\n}(( false ? undefined : _typeof(module)) === \"object\" ? module.exports : {});\n\ntry {\n regeneratorRuntime = runtime;\n} catch (accidentalStrictMode) {\n Function(\"r\", \"regeneratorRuntime = r\")(runtime);\n}\n/* WEBPACK VAR INJECTION */}.call(this, __w_pdfjs_require__(6)(module)))\n\n/***/ }),\n/* 6 */\n/***/ (function(module, exports, __w_pdfjs_require__) {\n\n\"use strict\";\n\n\nmodule.exports = function (module) {\n if (!module.webpackPolyfill) {\n module.deprecate = function () {};\n\n module.paths = [];\n if (!module.children) module.children = [];\n Object.defineProperty(module, \"loaded\", {\n enumerable: true,\n get: function get() {\n return module.l;\n }\n });\n Object.defineProperty(module, \"id\", {\n enumerable: true,\n get: function get() {\n return module.i;\n }\n });\n module.webpackPolyfill = 1;\n }\n\n return module;\n};\n\n/***/ }),\n/* 7 */\n/***/ (function(module, exports, __w_pdfjs_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.SimpleLinkService = exports.PDFLinkService = void 0;\n\nvar _ui_utils = __w_pdfjs_require__(3);\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nvar PDFLinkService = /*#__PURE__*/function () {\n function PDFLinkService() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n eventBus = _ref.eventBus,\n _ref$externalLinkTarg = _ref.externalLinkTarget,\n externalLinkTarget = _ref$externalLinkTarg === void 0 ? null : _ref$externalLinkTarg,\n _ref$externalLinkRel = _ref.externalLinkRel,\n externalLinkRel = _ref$externalLinkRel === void 0 ? null : _ref$externalLinkRel,\n _ref$externalLinkEnab = _ref.externalLinkEnabled,\n externalLinkEnabled = _ref$externalLinkEnab === void 0 ? true : _ref$externalLinkEnab,\n _ref$ignoreDestinatio = _ref.ignoreDestinationZoom,\n ignoreDestinationZoom = _ref$ignoreDestinatio === void 0 ? false : _ref$ignoreDestinatio;\n\n _classCallCheck(this, PDFLinkService);\n\n this.eventBus = eventBus;\n this.externalLinkTarget = externalLinkTarget;\n this.externalLinkRel = externalLinkRel;\n this.externalLinkEnabled = externalLinkEnabled;\n this._ignoreDestinationZoom = ignoreDestinationZoom;\n this.baseUrl = null;\n this.pdfDocument = null;\n this.pdfViewer = null;\n this.pdfHistory = null;\n this._pagesRefCache = null;\n }\n\n _createClass(PDFLinkService, [{\n key: \"setDocument\",\n value: function setDocument(pdfDocument) {\n var baseUrl = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;\n this.baseUrl = baseUrl;\n this.pdfDocument = pdfDocument;\n this._pagesRefCache = Object.create(null);\n }\n }, {\n key: \"setViewer\",\n value: function setViewer(pdfViewer) {\n this.pdfViewer = pdfViewer;\n }\n }, {\n key: \"setHistory\",\n value: function setHistory(pdfHistory) {\n this.pdfHistory = pdfHistory;\n }\n }, {\n key: \"navigateTo\",\n value: function navigateTo(dest) {\n var _this = this;\n\n var goToDestination = function goToDestination(_ref2) {\n var namedDest = _ref2.namedDest,\n explicitDest = _ref2.explicitDest;\n var destRef = explicitDest[0];\n var pageNumber;\n\n if (destRef instanceof Object) {\n pageNumber = _this._cachedPageNumber(destRef);\n\n if (pageNumber === null) {\n _this.pdfDocument.getPageIndex(destRef).then(function (pageIndex) {\n _this.cachePageRef(pageIndex + 1, destRef);\n\n goToDestination({\n namedDest: namedDest,\n explicitDest: explicitDest\n });\n })[\"catch\"](function () {\n console.error(\"PDFLinkService.navigateTo: \\\"\".concat(destRef, \"\\\" is not \") + \"a valid page reference, for dest=\\\"\".concat(dest, \"\\\".\"));\n });\n\n return;\n }\n } else if (Number.isInteger(destRef)) {\n pageNumber = destRef + 1;\n } else {\n console.error(\"PDFLinkService.navigateTo: \\\"\".concat(destRef, \"\\\" is not \") + \"a valid destination reference, for dest=\\\"\".concat(dest, \"\\\".\"));\n return;\n }\n\n if (!pageNumber || pageNumber < 1 || pageNumber > _this.pagesCount) {\n console.error(\"PDFLinkService.navigateTo: \\\"\".concat(pageNumber, \"\\\" is not \") + \"a valid page number, for dest=\\\"\".concat(dest, \"\\\".\"));\n return;\n }\n\n if (_this.pdfHistory) {\n _this.pdfHistory.pushCurrentPosition();\n\n _this.pdfHistory.push({\n namedDest: namedDest,\n explicitDest: explicitDest,\n pageNumber: pageNumber\n });\n }\n\n _this.pdfViewer.scrollPageIntoView({\n pageNumber: pageNumber,\n destArray: explicitDest,\n ignoreDestinationZoom: _this._ignoreDestinationZoom\n });\n };\n\n new Promise(function (resolve, reject) {\n if (typeof dest === \"string\") {\n _this.pdfDocument.getDestination(dest).then(function (destArray) {\n resolve({\n namedDest: dest,\n explicitDest: destArray\n });\n });\n\n return;\n }\n\n resolve({\n namedDest: \"\",\n explicitDest: dest\n });\n }).then(function (data) {\n if (!Array.isArray(data.explicitDest)) {\n console.error(\"PDFLinkService.navigateTo: \\\"\".concat(data.explicitDest, \"\\\" is\") + \" not a valid destination array, for dest=\\\"\".concat(dest, \"\\\".\"));\n return;\n }\n\n goToDestination(data);\n });\n }\n }, {\n key: \"getDestinationHash\",\n value: function getDestinationHash(dest) {\n if (typeof dest === \"string\") {\n return this.getAnchorUrl(\"#\" + escape(dest));\n }\n\n if (Array.isArray(dest)) {\n var str = JSON.stringify(dest);\n return this.getAnchorUrl(\"#\" + escape(str));\n }\n\n return this.getAnchorUrl(\"\");\n }\n }, {\n key: \"getAnchorUrl\",\n value: function getAnchorUrl(anchor) {\n return (this.baseUrl || \"\") + anchor;\n }\n }, {\n key: \"setHash\",\n value: function setHash(hash) {\n var pageNumber, dest;\n\n if (hash.includes(\"=\")) {\n var params = (0, _ui_utils.parseQueryString)(hash);\n\n if (\"search\" in params) {\n this.eventBus.dispatch(\"findfromurlhash\", {\n source: this,\n query: params.search.replace(/\"/g, \"\"),\n phraseSearch: params.phrase === \"true\"\n });\n }\n\n if (\"page\" in params) {\n pageNumber = params.page | 0 || 1;\n }\n\n if (\"zoom\" in params) {\n var zoomArgs = params.zoom.split(\",\");\n var zoomArg = zoomArgs[0];\n var zoomArgNumber = parseFloat(zoomArg);\n\n if (!zoomArg.includes(\"Fit\")) {\n dest = [null, {\n name: \"XYZ\"\n }, zoomArgs.length > 1 ? zoomArgs[1] | 0 : null, zoomArgs.length > 2 ? zoomArgs[2] | 0 : null, zoomArgNumber ? zoomArgNumber / 100 : zoomArg];\n } else {\n if (zoomArg === \"Fit\" || zoomArg === \"FitB\") {\n dest = [null, {\n name: zoomArg\n }];\n } else if (zoomArg === \"FitH\" || zoomArg === \"FitBH\" || zoomArg === \"FitV\" || zoomArg === \"FitBV\") {\n dest = [null, {\n name: zoomArg\n }, zoomArgs.length > 1 ? zoomArgs[1] | 0 : null];\n } else if (zoomArg === \"FitR\") {\n if (zoomArgs.length !== 5) {\n console.error('PDFLinkService.setHash: Not enough parameters for \"FitR\".');\n } else {\n dest = [null, {\n name: zoomArg\n }, zoomArgs[1] | 0, zoomArgs[2] | 0, zoomArgs[3] | 0, zoomArgs[4] | 0];\n }\n } else {\n console.error(\"PDFLinkService.setHash: \\\"\".concat(zoomArg, \"\\\" is not \") + \"a valid zoom value.\");\n }\n }\n }\n\n if (dest) {\n this.pdfViewer.scrollPageIntoView({\n pageNumber: pageNumber || this.page,\n destArray: dest,\n allowNegativeOffset: true\n });\n } else if (pageNumber) {\n this.page = pageNumber;\n }\n\n if (\"pagemode\" in params) {\n this.eventBus.dispatch(\"pagemode\", {\n source: this,\n mode: params.pagemode\n });\n }\n\n if (\"nameddest\" in params) {\n this.navigateTo(params.nameddest);\n }\n } else {\n dest = unescape(hash);\n\n try {\n dest = JSON.parse(dest);\n\n if (!Array.isArray(dest)) {\n dest = dest.toString();\n }\n } catch (ex) {}\n\n if (typeof dest === \"string\" || isValidExplicitDestination(dest)) {\n this.navigateTo(dest);\n return;\n }\n\n console.error(\"PDFLinkService.setHash: \\\"\".concat(unescape(hash), \"\\\" is not \") + \"a valid destination.\");\n }\n }\n }, {\n key: \"executeNamedAction\",\n value: function executeNamedAction(action) {\n switch (action) {\n case \"GoBack\":\n if (this.pdfHistory) {\n this.pdfHistory.back();\n }\n\n break;\n\n case \"GoForward\":\n if (this.pdfHistory) {\n this.pdfHistory.forward();\n }\n\n break;\n\n case \"NextPage\":\n if (this.page < this.pagesCount) {\n this.page++;\n }\n\n break;\n\n case \"PrevPage\":\n if (this.page > 1) {\n this.page--;\n }\n\n break;\n\n case \"LastPage\":\n this.page = this.pagesCount;\n break;\n\n case \"FirstPage\":\n this.page = 1;\n break;\n\n default:\n break;\n }\n\n this.eventBus.dispatch(\"namedaction\", {\n source: this,\n action: action\n });\n }\n }, {\n key: \"cachePageRef\",\n value: function cachePageRef(pageNum, pageRef) {\n if (!pageRef) {\n return;\n }\n\n var refStr = pageRef.gen === 0 ? \"\".concat(pageRef.num, \"R\") : \"\".concat(pageRef.num, \"R\").concat(pageRef.gen);\n this._pagesRefCache[refStr] = pageNum;\n }\n }, {\n key: \"_cachedPageNumber\",\n value: function _cachedPageNumber(pageRef) {\n var refStr = pageRef.gen === 0 ? \"\".concat(pageRef.num, \"R\") : \"\".concat(pageRef.num, \"R\").concat(pageRef.gen);\n return this._pagesRefCache && this._pagesRefCache[refStr] || null;\n }\n }, {\n key: \"isPageVisible\",\n value: function isPageVisible(pageNumber) {\n return this.pdfViewer.isPageVisible(pageNumber);\n }\n }, {\n key: \"pagesCount\",\n get: function get() {\n return this.pdfDocument ? this.pdfDocument.numPages : 0;\n }\n }, {\n key: \"page\",\n get: function get() {\n return this.pdfViewer.currentPageNumber;\n },\n set: function set(value) {\n this.pdfViewer.currentPageNumber = value;\n }\n }, {\n key: \"rotation\",\n get: function get() {\n return this.pdfViewer.pagesRotation;\n },\n set: function set(value) {\n this.pdfViewer.pagesRotation = value;\n }\n }]);\n\n return PDFLinkService;\n}();\n\nexports.PDFLinkService = PDFLinkService;\n\nfunction isValidExplicitDestination(dest) {\n if (!Array.isArray(dest)) {\n return false;\n }\n\n var destLength = dest.length;\n\n if (destLength < 2) {\n return false;\n }\n\n var page = dest[0];\n\n if (!(_typeof(page) === \"object\" && Number.isInteger(page.num) && Number.isInteger(page.gen)) && !(Number.isInteger(page) && page >= 0)) {\n return false;\n }\n\n var zoom = dest[1];\n\n if (!(_typeof(zoom) === \"object\" && typeof zoom.name === \"string\")) {\n return false;\n }\n\n var allowNull = true;\n\n switch (zoom.name) {\n case \"XYZ\":\n if (destLength !== 5) {\n return false;\n }\n\n break;\n\n case \"Fit\":\n case \"FitB\":\n return destLength === 2;\n\n case \"FitH\":\n case \"FitBH\":\n case \"FitV\":\n case \"FitBV\":\n if (destLength !== 3) {\n return false;\n }\n\n break;\n\n case \"FitR\":\n if (destLength !== 6) {\n return false;\n }\n\n allowNull = false;\n break;\n\n default:\n return false;\n }\n\n for (var i = 2; i < destLength; i++) {\n var param = dest[i];\n\n if (!(typeof param === \"number\" || allowNull && param === null)) {\n return false;\n }\n }\n\n return true;\n}\n\nvar SimpleLinkService = /*#__PURE__*/function () {\n function SimpleLinkService() {\n _classCallCheck(this, SimpleLinkService);\n\n this.externalLinkTarget = null;\n this.externalLinkRel = null;\n this.externalLinkEnabled = true;\n this._ignoreDestinationZoom = false;\n }\n\n _createClass(SimpleLinkService, [{\n key: \"navigateTo\",\n value: function navigateTo(dest) {}\n }, {\n key: \"getDestinationHash\",\n value: function getDestinationHash(dest) {\n return \"#\";\n }\n }, {\n key: \"getAnchorUrl\",\n value: function getAnchorUrl(hash) {\n return \"#\";\n }\n }, {\n key: \"setHash\",\n value: function setHash(hash) {}\n }, {\n key: \"executeNamedAction\",\n value: function executeNamedAction(action) {}\n }, {\n key: \"cachePageRef\",\n value: function cachePageRef(pageNum, pageRef) {}\n }, {\n key: \"isPageVisible\",\n value: function isPageVisible(pageNumber) {\n return true;\n }\n }, {\n key: \"pagesCount\",\n get: function get() {\n return 0;\n }\n }, {\n key: \"page\",\n get: function get() {\n return 0;\n },\n set: function set(value) {}\n }, {\n key: \"rotation\",\n get: function get() {\n return 0;\n },\n set: function set(value) {}\n }]);\n\n return SimpleLinkService;\n}();\n\nexports.SimpleLinkService = SimpleLinkService;\n\n/***/ }),\n/* 8 */\n/***/ (function(module, exports, __w_pdfjs_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.DefaultTextLayerFactory = exports.TextLayerBuilder = void 0;\n\nvar _pdfjsLib = __w_pdfjs_require__(2);\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nvar EXPAND_DIVS_TIMEOUT = 300;\n\nvar TextLayerBuilder = /*#__PURE__*/function () {\n function TextLayerBuilder(_ref) {\n var textLayerDiv = _ref.textLayerDiv,\n eventBus = _ref.eventBus,\n pageIndex = _ref.pageIndex,\n viewport = _ref.viewport,\n _ref$findController = _ref.findController,\n findController = _ref$findController === void 0 ? null : _ref$findController,\n _ref$enhanceTextSelec = _ref.enhanceTextSelection,\n enhanceTextSelection = _ref$enhanceTextSelec === void 0 ? false : _ref$enhanceTextSelec;\n\n _classCallCheck(this, TextLayerBuilder);\n\n this.textLayerDiv = textLayerDiv;\n this.eventBus = eventBus;\n this.textContent = null;\n this.textContentItemsStr = [];\n this.textContentStream = null;\n this.renderingDone = false;\n this.pageIdx = pageIndex;\n this.pageNumber = this.pageIdx + 1;\n this.matches = [];\n this.viewport = viewport;\n this.textDivs = [];\n this.findController = findController;\n this.textLayerRenderTask = null;\n this.enhanceTextSelection = enhanceTextSelection;\n this._onUpdateTextLayerMatches = null;\n\n this._bindMouse();\n }\n\n _createClass(TextLayerBuilder, [{\n key: \"_finishRendering\",\n value: function _finishRendering() {\n this.renderingDone = true;\n\n if (!this.enhanceTextSelection) {\n var endOfContent = document.createElement(\"div\");\n endOfContent.className = \"endOfContent\";\n this.textLayerDiv.appendChild(endOfContent);\n }\n\n this.eventBus.dispatch(\"textlayerrendered\", {\n source: this,\n pageNumber: this.pageNumber,\n numTextDivs: this.textDivs.length\n });\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this = this;\n\n var timeout = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;\n\n if (!(this.textContent || this.textContentStream) || this.renderingDone) {\n return;\n }\n\n this.cancel();\n this.textDivs = [];\n var textLayerFrag = document.createDocumentFragment();\n this.textLayerRenderTask = (0, _pdfjsLib.renderTextLayer)({\n textContent: this.textContent,\n textContentStream: this.textContentStream,\n container: textLayerFrag,\n viewport: this.viewport,\n textDivs: this.textDivs,\n textContentItemsStr: this.textContentItemsStr,\n timeout: timeout,\n enhanceTextSelection: this.enhanceTextSelection\n });\n this.textLayerRenderTask.promise.then(function () {\n _this.textLayerDiv.appendChild(textLayerFrag);\n\n _this._finishRendering();\n\n _this._updateMatches();\n }, function (reason) {});\n\n if (!this._onUpdateTextLayerMatches) {\n this._onUpdateTextLayerMatches = function (evt) {\n if (evt.pageIndex === _this.pageIdx || evt.pageIndex === -1) {\n _this._updateMatches();\n }\n };\n\n this.eventBus._on(\"updatetextlayermatches\", this._onUpdateTextLayerMatches);\n }\n }\n }, {\n key: \"cancel\",\n value: function cancel() {\n if (this.textLayerRenderTask) {\n this.textLayerRenderTask.cancel();\n this.textLayerRenderTask = null;\n }\n\n if (this._onUpdateTextLayerMatches) {\n this.eventBus._off(\"updatetextlayermatches\", this._onUpdateTextLayerMatches);\n\n this._onUpdateTextLayerMatches = null;\n }\n }\n }, {\n key: \"setTextContentStream\",\n value: function setTextContentStream(readableStream) {\n this.cancel();\n this.textContentStream = readableStream;\n }\n }, {\n key: \"setTextContent\",\n value: function setTextContent(textContent) {\n this.cancel();\n this.textContent = textContent;\n }\n }, {\n key: \"_convertMatches\",\n value: function _convertMatches(matches, matchesLength) {\n if (!matches) {\n return [];\n }\n\n var findController = this.findController,\n textContentItemsStr = this.textContentItemsStr;\n var i = 0,\n iIndex = 0;\n var end = textContentItemsStr.length - 1;\n var queryLen = findController.state.query.length;\n var result = [];\n\n for (var m = 0, mm = matches.length; m < mm; m++) {\n var matchIdx = matches[m];\n\n while (i !== end && matchIdx >= iIndex + textContentItemsStr[i].length) {\n iIndex += textContentItemsStr[i].length;\n i++;\n }\n\n if (i === textContentItemsStr.length) {\n console.error(\"Could not find a matching mapping\");\n }\n\n var match = {\n begin: {\n divIdx: i,\n offset: matchIdx - iIndex\n }\n };\n\n if (matchesLength) {\n matchIdx += matchesLength[m];\n } else {\n matchIdx += queryLen;\n }\n\n while (i !== end && matchIdx > iIndex + textContentItemsStr[i].length) {\n iIndex += textContentItemsStr[i].length;\n i++;\n }\n\n match.end = {\n divIdx: i,\n offset: matchIdx - iIndex\n };\n result.push(match);\n }\n\n return result;\n }\n }, {\n key: \"_renderMatches\",\n value: function _renderMatches(matches) {\n if (matches.length === 0) {\n return;\n }\n\n var findController = this.findController,\n pageIdx = this.pageIdx,\n textContentItemsStr = this.textContentItemsStr,\n textDivs = this.textDivs;\n var isSelectedPage = pageIdx === findController.selected.pageIdx;\n var selectedMatchIdx = findController.selected.matchIdx;\n var highlightAll = findController.state.highlightAll;\n var prevEnd = null;\n var infinity = {\n divIdx: -1,\n offset: undefined\n };\n\n function beginText(begin, className) {\n var divIdx = begin.divIdx;\n textDivs[divIdx].textContent = \"\";\n appendTextToDiv(divIdx, 0, begin.offset, className);\n }\n\n function appendTextToDiv(divIdx, fromOffset, toOffset, className) {\n var div = textDivs[divIdx];\n var content = textContentItemsStr[divIdx].substring(fromOffset, toOffset);\n var node = document.createTextNode(content);\n\n if (className) {\n var span = document.createElement(\"span\");\n span.className = className;\n span.appendChild(node);\n div.appendChild(span);\n return;\n }\n\n div.appendChild(node);\n }\n\n var i0 = selectedMatchIdx,\n i1 = i0 + 1;\n\n if (highlightAll) {\n i0 = 0;\n i1 = matches.length;\n } else if (!isSelectedPage) {\n return;\n }\n\n for (var i = i0; i < i1; i++) {\n var match = matches[i];\n var begin = match.begin;\n var end = match.end;\n var isSelected = isSelectedPage && i === selectedMatchIdx;\n var highlightSuffix = isSelected ? \" selected\" : \"\";\n\n if (isSelected) {\n findController.scrollMatchIntoView({\n element: textDivs[begin.divIdx],\n pageIndex: pageIdx,\n matchIndex: selectedMatchIdx\n });\n }\n\n if (!prevEnd || begin.divIdx !== prevEnd.divIdx) {\n if (prevEnd !== null) {\n appendTextToDiv(prevEnd.divIdx, prevEnd.offset, infinity.offset);\n }\n\n beginText(begin);\n } else {\n appendTextToDiv(prevEnd.divIdx, prevEnd.offset, begin.offset);\n }\n\n if (begin.divIdx === end.divIdx) {\n appendTextToDiv(begin.divIdx, begin.offset, end.offset, \"highlight\" + highlightSuffix);\n } else {\n appendTextToDiv(begin.divIdx, begin.offset, infinity.offset, \"highlight begin\" + highlightSuffix);\n\n for (var n0 = begin.divIdx + 1, n1 = end.divIdx; n0 < n1; n0++) {\n textDivs[n0].className = \"highlight middle\" + highlightSuffix;\n }\n\n beginText(end, \"highlight end\" + highlightSuffix);\n }\n\n prevEnd = end;\n }\n\n if (prevEnd) {\n appendTextToDiv(prevEnd.divIdx, prevEnd.offset, infinity.offset);\n }\n }\n }, {\n key: \"_updateMatches\",\n value: function _updateMatches() {\n if (!this.renderingDone) {\n return;\n }\n\n var findController = this.findController,\n matches = this.matches,\n pageIdx = this.pageIdx,\n textContentItemsStr = this.textContentItemsStr,\n textDivs = this.textDivs;\n var clearedUntilDivIdx = -1;\n\n for (var i = 0, ii = matches.length; i < ii; i++) {\n var match = matches[i];\n var begin = Math.max(clearedUntilDivIdx, match.begin.divIdx);\n\n for (var n = begin, end = match.end.divIdx; n <= end; n++) {\n var div = textDivs[n];\n div.textContent = textContentItemsStr[n];\n div.className = \"\";\n }\n\n clearedUntilDivIdx = match.end.divIdx + 1;\n }\n\n if (!findController || !findController.highlightMatches) {\n return;\n }\n\n var pageMatches = findController.pageMatches[pageIdx] || null;\n var pageMatchesLength = findController.pageMatchesLength[pageIdx] || null;\n this.matches = this._convertMatches(pageMatches, pageMatchesLength);\n\n this._renderMatches(this.matches);\n }\n }, {\n key: \"_bindMouse\",\n value: function _bindMouse() {\n var _this2 = this;\n\n var div = this.textLayerDiv;\n var expandDivsTimer = null;\n div.addEventListener(\"mousedown\", function (evt) {\n if (_this2.enhanceTextSelection && _this2.textLayerRenderTask) {\n _this2.textLayerRenderTask.expandTextDivs(true);\n\n if (expandDivsTimer) {\n clearTimeout(expandDivsTimer);\n expandDivsTimer = null;\n }\n\n return;\n }\n\n var end = div.querySelector(\".endOfContent\");\n\n if (!end) {\n return;\n }\n\n var adjustTop = evt.target !== div;\n adjustTop = adjustTop && window.getComputedStyle(end).getPropertyValue(\"-moz-user-select\") !== \"none\";\n\n if (adjustTop) {\n var divBounds = div.getBoundingClientRect();\n var r = Math.max(0, (evt.pageY - divBounds.top) / divBounds.height);\n end.style.top = (r * 100).toFixed(2) + \"%\";\n }\n\n end.classList.add(\"active\");\n });\n div.addEventListener(\"mouseup\", function () {\n if (_this2.enhanceTextSelection && _this2.textLayerRenderTask) {\n expandDivsTimer = setTimeout(function () {\n if (_this2.textLayerRenderTask) {\n _this2.textLayerRenderTask.expandTextDivs(false);\n }\n\n expandDivsTimer = null;\n }, EXPAND_DIVS_TIMEOUT);\n return;\n }\n\n var end = div.querySelector(\".endOfContent\");\n\n if (!end) {\n return;\n }\n\n end.style.top = \"\";\n end.classList.remove(\"active\");\n });\n }\n }]);\n\n return TextLayerBuilder;\n}();\n\nexports.TextLayerBuilder = TextLayerBuilder;\n\nvar DefaultTextLayerFactory = /*#__PURE__*/function () {\n function DefaultTextLayerFactory() {\n _classCallCheck(this, DefaultTextLayerFactory);\n }\n\n _createClass(DefaultTextLayerFactory, [{\n key: \"createTextLayerBuilder\",\n value: function createTextLayerBuilder(textLayerDiv, pageIndex, viewport) {\n var enhanceTextSelection = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;\n var eventBus = arguments.length > 4 ? arguments[4] : undefined;\n return new TextLayerBuilder({\n textLayerDiv: textLayerDiv,\n pageIndex: pageIndex,\n viewport: viewport,\n enhanceTextSelection: enhanceTextSelection,\n eventBus: eventBus\n });\n }\n }]);\n\n return DefaultTextLayerFactory;\n}();\n\nexports.DefaultTextLayerFactory = DefaultTextLayerFactory;\n\n/***/ }),\n/* 9 */\n/***/ (function(module, exports, __w_pdfjs_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.DownloadManager = void 0;\n\nvar _pdfjsLib = __w_pdfjs_require__(2);\n\nvar _viewer_compatibility = __w_pdfjs_require__(10);\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\n;\nvar DISABLE_CREATE_OBJECT_URL = _viewer_compatibility.viewerCompatibilityParams.disableCreateObjectURL || false;\n\nfunction _download(blobUrl, filename) {\n var a = document.createElement(\"a\");\n\n if (!a.click) {\n throw new Error('DownloadManager: \"a.click()\" is not supported.');\n }\n\n a.href = blobUrl;\n a.target = \"_parent\";\n\n if (\"download\" in a) {\n a.download = filename;\n }\n\n (document.body || document.documentElement).appendChild(a);\n a.click();\n a.remove();\n}\n\nvar DownloadManager = /*#__PURE__*/function () {\n function DownloadManager(_ref) {\n var _ref$disableCreateObj = _ref.disableCreateObjectURL,\n disableCreateObjectURL = _ref$disableCreateObj === void 0 ? DISABLE_CREATE_OBJECT_URL : _ref$disableCreateObj;\n\n _classCallCheck(this, DownloadManager);\n\n this.disableCreateObjectURL = disableCreateObjectURL;\n }\n\n _createClass(DownloadManager, [{\n key: \"downloadUrl\",\n value: function downloadUrl(url, filename) {\n if (!(0, _pdfjsLib.createValidAbsoluteUrl)(url, \"http://example.com\")) {\n return;\n }\n\n _download(url + \"#pdfjs.action=download\", filename);\n }\n }, {\n key: \"downloadData\",\n value: function downloadData(data, filename, contentType) {\n if (navigator.msSaveBlob) {\n navigator.msSaveBlob(new Blob([data], {\n type: contentType\n }), filename);\n return;\n }\n\n var blobUrl = (0, _pdfjsLib.createObjectURL)(data, contentType, this.disableCreateObjectURL);\n\n _download(blobUrl, filename);\n }\n }, {\n key: \"download\",\n value: function download(blob, url, filename) {\n if (navigator.msSaveBlob) {\n if (!navigator.msSaveBlob(blob, filename)) {\n this.downloadUrl(url, filename);\n }\n\n return;\n }\n\n if (this.disableCreateObjectURL) {\n this.downloadUrl(url, filename);\n return;\n }\n\n var blobUrl = URL.createObjectURL(blob);\n\n _download(blobUrl, filename);\n }\n }]);\n\n return DownloadManager;\n}();\n\nexports.DownloadManager = DownloadManager;\n\n/***/ }),\n/* 10 */\n/***/ (function(module, exports, __w_pdfjs_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.viewerCompatibilityParams = void 0;\nvar compatibilityParams = Object.create(null);\n{\n var userAgent = typeof navigator !== \"undefined\" && navigator.userAgent || \"\";\n var platform = typeof navigator !== \"undefined\" && navigator.platform || \"\";\n var maxTouchPoints = typeof navigator !== \"undefined\" && navigator.maxTouchPoints || 1;\n var isAndroid = /Android/.test(userAgent);\n var isIE = /Trident/.test(userAgent);\n var isIOS = /\\b(iPad|iPhone|iPod)(?=;)/.test(userAgent) || platform === \"MacIntel\" && maxTouchPoints > 1;\n var isIOSChrome = /CriOS/.test(userAgent);\n\n (function checkOnBlobSupport() {\n if (isIE || isIOSChrome) {\n compatibilityParams.disableCreateObjectURL = true;\n }\n })();\n\n (function checkCanvasSizeLimitation() {\n if (isIOS || isAndroid) {\n compatibilityParams.maxCanvasPixels = 5242880;\n }\n })();\n}\nvar viewerCompatibilityParams = Object.freeze(compatibilityParams);\nexports.viewerCompatibilityParams = viewerCompatibilityParams;\n\n/***/ }),\n/* 11 */\n/***/ (function(module, exports, __w_pdfjs_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.GenericL10n = void 0;\n\nvar _regenerator = _interopRequireDefault(__w_pdfjs_require__(4));\n\n__w_pdfjs_require__(12);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\n\nfunction asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }\n\nfunction _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err); } _next(undefined); }); }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nvar webL10n = document.webL10n;\n\nvar GenericL10n = /*#__PURE__*/function () {\n function GenericL10n(lang) {\n _classCallCheck(this, GenericL10n);\n\n this._lang = lang;\n this._ready = new Promise(function (resolve, reject) {\n webL10n.setLanguage(lang, function () {\n resolve(webL10n);\n });\n });\n }\n\n _createClass(GenericL10n, [{\n key: \"getLanguage\",\n value: function () {\n var _getLanguage = _asyncToGenerator( /*#__PURE__*/_regenerator[\"default\"].mark(function _callee() {\n var l10n;\n return _regenerator[\"default\"].wrap(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n _context.next = 2;\n return this._ready;\n\n case 2:\n l10n = _context.sent;\n return _context.abrupt(\"return\", l10n.getLanguage());\n\n case 4:\n case \"end\":\n return _context.stop();\n }\n }\n }, _callee, this);\n }));\n\n function getLanguage() {\n return _getLanguage.apply(this, arguments);\n }\n\n return getLanguage;\n }()\n }, {\n key: \"getDirection\",\n value: function () {\n var _getDirection = _asyncToGenerator( /*#__PURE__*/_regenerator[\"default\"].mark(function _callee2() {\n var l10n;\n return _regenerator[\"default\"].wrap(function _callee2$(_context2) {\n while (1) {\n switch (_context2.prev = _context2.next) {\n case 0:\n _context2.next = 2;\n return this._ready;\n\n case 2:\n l10n = _context2.sent;\n return _context2.abrupt(\"return\", l10n.getDirection());\n\n case 4:\n case \"end\":\n return _context2.stop();\n }\n }\n }, _callee2, this);\n }));\n\n function getDirection() {\n return _getDirection.apply(this, arguments);\n }\n\n return getDirection;\n }()\n }, {\n key: \"get\",\n value: function () {\n var _get = _asyncToGenerator( /*#__PURE__*/_regenerator[\"default\"].mark(function _callee3(property, args, fallback) {\n var l10n;\n return _regenerator[\"default\"].wrap(function _callee3$(_context3) {\n while (1) {\n switch (_context3.prev = _context3.next) {\n case 0:\n _context3.next = 2;\n return this._ready;\n\n case 2:\n l10n = _context3.sent;\n return _context3.abrupt(\"return\", l10n.get(property, args, fallback));\n\n case 4:\n case \"end\":\n return _context3.stop();\n }\n }\n }, _callee3, this);\n }));\n\n function get(_x, _x2, _x3) {\n return _get.apply(this, arguments);\n }\n\n return get;\n }()\n }, {\n key: \"translate\",\n value: function () {\n var _translate = _asyncToGenerator( /*#__PURE__*/_regenerator[\"default\"].mark(function _callee4(element) {\n var l10n;\n return _regenerator[\"default\"].wrap(function _callee4$(_context4) {\n while (1) {\n switch (_context4.prev = _context4.next) {\n case 0:\n _context4.next = 2;\n return this._ready;\n\n case 2:\n l10n = _context4.sent;\n return _context4.abrupt(\"return\", l10n.translate(element));\n\n case 4:\n case \"end\":\n return _context4.stop();\n }\n }\n }, _callee4, this);\n }));\n\n function translate(_x4) {\n return _translate.apply(this, arguments);\n }\n\n return translate;\n }()\n }]);\n\n return GenericL10n;\n}();\n\nexports.GenericL10n = GenericL10n;\n\n/***/ }),\n/* 12 */\n/***/ (function(module, exports, __w_pdfjs_require__) {\n\n\"use strict\";\n\n\ndocument.webL10n = function (window, document, undefined) {\n var gL10nData = {};\n var gTextData = '';\n var gTextProp = 'textContent';\n var gLanguage = '';\n var gMacros = {};\n var gReadyState = 'loading';\n var gAsyncResourceLoading = true;\n\n function getL10nResourceLinks() {\n return document.querySelectorAll('link[type=\"application/l10n\"]');\n }\n\n function getL10nDictionary() {\n var script = document.querySelector('script[type=\"application/l10n\"]');\n return script ? JSON.parse(script.innerHTML) : null;\n }\n\n function getTranslatableChildren(element) {\n return element ? element.querySelectorAll('*[data-l10n-id]') : [];\n }\n\n function getL10nAttributes(element) {\n if (!element) return {};\n var l10nId = element.getAttribute('data-l10n-id');\n var l10nArgs = element.getAttribute('data-l10n-args');\n var args = {};\n\n if (l10nArgs) {\n try {\n args = JSON.parse(l10nArgs);\n } catch (e) {\n console.warn('could not parse arguments for #' + l10nId);\n }\n }\n\n return {\n id: l10nId,\n args: args\n };\n }\n\n function xhrLoadText(url, onSuccess, onFailure) {\n onSuccess = onSuccess || function _onSuccess(data) {};\n\n onFailure = onFailure || function _onFailure() {};\n\n var xhr = new XMLHttpRequest();\n xhr.open('GET', url, gAsyncResourceLoading);\n\n if (xhr.overrideMimeType) {\n xhr.overrideMimeType('text/plain; charset=utf-8');\n }\n\n xhr.onreadystatechange = function () {\n if (xhr.readyState == 4) {\n if (xhr.status == 200 || xhr.status === 0) {\n onSuccess(xhr.responseText);\n } else {\n onFailure();\n }\n }\n };\n\n xhr.onerror = onFailure;\n xhr.ontimeout = onFailure;\n\n try {\n xhr.send(null);\n } catch (e) {\n onFailure();\n }\n }\n\n function parseResource(href, lang, successCallback, failureCallback) {\n var baseURL = href.replace(/[^\\/]*$/, '') || './';\n\n function evalString(text) {\n if (text.lastIndexOf('\\\\') < 0) return text;\n return text.replace(/\\\\\\\\/g, '\\\\').replace(/\\\\n/g, '\\n').replace(/\\\\r/g, '\\r').replace(/\\\\t/g, '\\t').replace(/\\\\b/g, '\\b').replace(/\\\\f/g, '\\f').replace(/\\\\{/g, '{').replace(/\\\\}/g, '}').replace(/\\\\\"/g, '\"').replace(/\\\\'/g, \"'\");\n }\n\n function parseProperties(text, parsedPropertiesCallback) {\n var dictionary = {};\n var reBlank = /^\\s*|\\s*$/;\n var reComment = /^\\s*#|^\\s*$/;\n var reSection = /^\\s*\\[(.*)\\]\\s*$/;\n var reImport = /^\\s*@import\\s+url\\((.*)\\)\\s*$/i;\n var reSplit = /^([^=\\s]*)\\s*=\\s*(.+)$/;\n\n function parseRawLines(rawText, extendedSyntax, parsedRawLinesCallback) {\n var entries = rawText.replace(reBlank, '').split(/[\\r\\n]+/);\n var currentLang = '*';\n var genericLang = lang.split('-', 1)[0];\n var skipLang = false;\n var match = '';\n\n function nextEntry() {\n while (true) {\n if (!entries.length) {\n parsedRawLinesCallback();\n return;\n }\n\n var line = entries.shift();\n if (reComment.test(line)) continue;\n\n if (extendedSyntax) {\n match = reSection.exec(line);\n\n if (match) {\n currentLang = match[1].toLowerCase();\n skipLang = currentLang !== '*' && currentLang !== lang && currentLang !== genericLang;\n continue;\n } else if (skipLang) {\n continue;\n }\n\n match = reImport.exec(line);\n\n if (match) {\n loadImport(baseURL + match[1], nextEntry);\n return;\n }\n }\n\n var tmp = line.match(reSplit);\n\n if (tmp && tmp.length == 3) {\n dictionary[tmp[1]] = evalString(tmp[2]);\n }\n }\n }\n\n nextEntry();\n }\n\n function loadImport(url, callback) {\n xhrLoadText(url, function (content) {\n parseRawLines(content, false, callback);\n }, function () {\n console.warn(url + ' not found.');\n callback();\n });\n }\n\n parseRawLines(text, true, function () {\n parsedPropertiesCallback(dictionary);\n });\n }\n\n xhrLoadText(href, function (response) {\n gTextData += response;\n parseProperties(response, function (data) {\n for (var key in data) {\n var id,\n prop,\n index = key.lastIndexOf('.');\n\n if (index > 0) {\n id = key.substring(0, index);\n prop = key.substring(index + 1);\n } else {\n id = key;\n prop = gTextProp;\n }\n\n if (!gL10nData[id]) {\n gL10nData[id] = {};\n }\n\n gL10nData[id][prop] = data[key];\n }\n\n if (successCallback) {\n successCallback();\n }\n });\n }, failureCallback);\n }\n\n function loadLocale(lang, callback) {\n if (lang) {\n lang = lang.toLowerCase();\n }\n\n callback = callback || function _callback() {};\n\n clear();\n gLanguage = lang;\n var langLinks = getL10nResourceLinks();\n var langCount = langLinks.length;\n\n if (langCount === 0) {\n var dict = getL10nDictionary();\n\n if (dict && dict.locales && dict.default_locale) {\n console.log('using the embedded JSON directory, early way out');\n gL10nData = dict.locales[lang];\n\n if (!gL10nData) {\n var defaultLocale = dict.default_locale.toLowerCase();\n\n for (var anyCaseLang in dict.locales) {\n anyCaseLang = anyCaseLang.toLowerCase();\n\n if (anyCaseLang === lang) {\n gL10nData = dict.locales[lang];\n break;\n } else if (anyCaseLang === defaultLocale) {\n gL10nData = dict.locales[defaultLocale];\n }\n }\n }\n\n callback();\n } else {\n console.log('no resource to load, early way out');\n }\n\n gReadyState = 'complete';\n return;\n }\n\n var onResourceLoaded = null;\n var gResourceCount = 0;\n\n onResourceLoaded = function onResourceLoaded() {\n gResourceCount++;\n\n if (gResourceCount >= langCount) {\n callback();\n gReadyState = 'complete';\n }\n };\n\n function L10nResourceLink(link) {\n var href = link.href;\n\n this.load = function (lang, callback) {\n parseResource(href, lang, callback, function () {\n console.warn(href + ' not found.');\n console.warn('\"' + lang + '\" resource not found');\n gLanguage = '';\n callback();\n });\n };\n }\n\n for (var i = 0; i < langCount; i++) {\n var resource = new L10nResourceLink(langLinks[i]);\n resource.load(lang, onResourceLoaded);\n }\n }\n\n function clear() {\n gL10nData = {};\n gTextData = '';\n gLanguage = '';\n }\n\n function getPluralRules(lang) {\n var locales2rules = {\n 'af': 3,\n 'ak': 4,\n 'am': 4,\n 'ar': 1,\n 'asa': 3,\n 'az': 0,\n 'be': 11,\n 'bem': 3,\n 'bez': 3,\n 'bg': 3,\n 'bh': 4,\n 'bm': 0,\n 'bn': 3,\n 'bo': 0,\n 'br': 20,\n 'brx': 3,\n 'bs': 11,\n 'ca': 3,\n 'cgg': 3,\n 'chr': 3,\n 'cs': 12,\n 'cy': 17,\n 'da': 3,\n 'de': 3,\n 'dv': 3,\n 'dz': 0,\n 'ee': 3,\n 'el': 3,\n 'en': 3,\n 'eo': 3,\n 'es': 3,\n 'et': 3,\n 'eu': 3,\n 'fa': 0,\n 'ff': 5,\n 'fi': 3,\n 'fil': 4,\n 'fo': 3,\n 'fr': 5,\n 'fur': 3,\n 'fy': 3,\n 'ga': 8,\n 'gd': 24,\n 'gl': 3,\n 'gsw': 3,\n 'gu': 3,\n 'guw': 4,\n 'gv': 23,\n 'ha': 3,\n 'haw': 3,\n 'he': 2,\n 'hi': 4,\n 'hr': 11,\n 'hu': 0,\n 'id': 0,\n 'ig': 0,\n 'ii': 0,\n 'is': 3,\n 'it': 3,\n 'iu': 7,\n 'ja': 0,\n 'jmc': 3,\n 'jv': 0,\n 'ka': 0,\n 'kab': 5,\n 'kaj': 3,\n 'kcg': 3,\n 'kde': 0,\n 'kea': 0,\n 'kk': 3,\n 'kl': 3,\n 'km': 0,\n 'kn': 0,\n 'ko': 0,\n 'ksb': 3,\n 'ksh': 21,\n 'ku': 3,\n 'kw': 7,\n 'lag': 18,\n 'lb': 3,\n 'lg': 3,\n 'ln': 4,\n 'lo': 0,\n 'lt': 10,\n 'lv': 6,\n 'mas': 3,\n 'mg': 4,\n 'mk': 16,\n 'ml': 3,\n 'mn': 3,\n 'mo': 9,\n 'mr': 3,\n 'ms': 0,\n 'mt': 15,\n 'my': 0,\n 'nah': 3,\n 'naq': 7,\n 'nb': 3,\n 'nd': 3,\n 'ne': 3,\n 'nl': 3,\n 'nn': 3,\n 'no': 3,\n 'nr': 3,\n 'nso': 4,\n 'ny': 3,\n 'nyn': 3,\n 'om': 3,\n 'or': 3,\n 'pa': 3,\n 'pap': 3,\n 'pl': 13,\n 'ps': 3,\n 'pt': 3,\n 'rm': 3,\n 'ro': 9,\n 'rof': 3,\n 'ru': 11,\n 'rwk': 3,\n 'sah': 0,\n 'saq': 3,\n 'se': 7,\n 'seh': 3,\n 'ses': 0,\n 'sg': 0,\n 'sh': 11,\n 'shi': 19,\n 'sk': 12,\n 'sl': 14,\n 'sma': 7,\n 'smi': 7,\n 'smj': 7,\n 'smn': 7,\n 'sms': 7,\n 'sn': 3,\n 'so': 3,\n 'sq': 3,\n 'sr': 11,\n 'ss': 3,\n 'ssy': 3,\n 'st': 3,\n 'sv': 3,\n 'sw': 3,\n 'syr': 3,\n 'ta': 3,\n 'te': 3,\n 'teo': 3,\n 'th': 0,\n 'ti': 4,\n 'tig': 3,\n 'tk': 3,\n 'tl': 4,\n 'tn': 3,\n 'to': 0,\n 'tr': 0,\n 'ts': 3,\n 'tzm': 22,\n 'uk': 11,\n 'ur': 3,\n 've': 3,\n 'vi': 0,\n 'vun': 3,\n 'wa': 4,\n 'wae': 3,\n 'wo': 0,\n 'xh': 3,\n 'xog': 3,\n 'yo': 0,\n 'zh': 0,\n 'zu': 3\n };\n\n function isIn(n, list) {\n return list.indexOf(n) !== -1;\n }\n\n function isBetween(n, start, end) {\n return start <= n && n <= end;\n }\n\n var pluralRules = {\n '0': function _(n) {\n return 'other';\n },\n '1': function _(n) {\n if (isBetween(n % 100, 3, 10)) return 'few';\n if (n === 0) return 'zero';\n if (isBetween(n % 100, 11, 99)) return 'many';\n if (n == 2) return 'two';\n if (n == 1) return 'one';\n return 'other';\n },\n '2': function _(n) {\n if (n !== 0 && n % 10 === 0) return 'many';\n if (n == 2) return 'two';\n if (n == 1) return 'one';\n return 'other';\n },\n '3': function _(n) {\n if (n == 1) return 'one';\n return 'other';\n },\n '4': function _(n) {\n if (isBetween(n, 0, 1)) return 'one';\n return 'other';\n },\n '5': function _(n) {\n if (isBetween(n, 0, 2) && n != 2) return 'one';\n return 'other';\n },\n '6': function _(n) {\n if (n === 0) return 'zero';\n if (n % 10 == 1 && n % 100 != 11) return 'one';\n return 'other';\n },\n '7': function _(n) {\n if (n == 2) return 'two';\n if (n == 1) return 'one';\n return 'other';\n },\n '8': function _(n) {\n if (isBetween(n, 3, 6)) return 'few';\n if (isBetween(n, 7, 10)) return 'many';\n if (n == 2) return 'two';\n if (n == 1) return 'one';\n return 'other';\n },\n '9': function _(n) {\n if (n === 0 || n != 1 && isBetween(n % 100, 1, 19)) return 'few';\n if (n == 1) return 'one';\n return 'other';\n },\n '10': function _(n) {\n if (isBetween(n % 10, 2, 9) && !isBetween(n % 100, 11, 19)) return 'few';\n if (n % 10 == 1 && !isBetween(n % 100, 11, 19)) return 'one';\n return 'other';\n },\n '11': function _(n) {\n if (isBetween(n % 10, 2, 4) && !isBetween(n % 100, 12, 14)) return 'few';\n if (n % 10 === 0 || isBetween(n % 10, 5, 9) || isBetween(n % 100, 11, 14)) return 'many';\n if (n % 10 == 1 && n % 100 != 11) return 'one';\n return 'other';\n },\n '12': function _(n) {\n if (isBetween(n, 2, 4)) return 'few';\n if (n == 1) return 'one';\n return 'other';\n },\n '13': function _(n) {\n if (isBetween(n % 10, 2, 4) && !isBetween(n % 100, 12, 14)) return 'few';\n if (n != 1 && isBetween(n % 10, 0, 1) || isBetween(n % 10, 5, 9) || isBetween(n % 100, 12, 14)) return 'many';\n if (n == 1) return 'one';\n return 'other';\n },\n '14': function _(n) {\n if (isBetween(n % 100, 3, 4)) return 'few';\n if (n % 100 == 2) return 'two';\n if (n % 100 == 1) return 'one';\n return 'other';\n },\n '15': function _(n) {\n if (n === 0 || isBetween(n % 100, 2, 10)) return 'few';\n if (isBetween(n % 100, 11, 19)) return 'many';\n if (n == 1) return 'one';\n return 'other';\n },\n '16': function _(n) {\n if (n % 10 == 1 && n != 11) return 'one';\n return 'other';\n },\n '17': function _(n) {\n if (n == 3) return 'few';\n if (n === 0) return 'zero';\n if (n == 6) return 'many';\n if (n == 2) return 'two';\n if (n == 1) return 'one';\n return 'other';\n },\n '18': function _(n) {\n if (n === 0) return 'zero';\n if (isBetween(n, 0, 2) && n !== 0 && n != 2) return 'one';\n return 'other';\n },\n '19': function _(n) {\n if (isBetween(n, 2, 10)) return 'few';\n if (isBetween(n, 0, 1)) return 'one';\n return 'other';\n },\n '20': function _(n) {\n if ((isBetween(n % 10, 3, 4) || n % 10 == 9) && !(isBetween(n % 100, 10, 19) || isBetween(n % 100, 70, 79) || isBetween(n % 100, 90, 99))) return 'few';\n if (n % 1000000 === 0 && n !== 0) return 'many';\n if (n % 10 == 2 && !isIn(n % 100, [12, 72, 92])) return 'two';\n if (n % 10 == 1 && !isIn(n % 100, [11, 71, 91])) return 'one';\n return 'other';\n },\n '21': function _(n) {\n if (n === 0) return 'zero';\n if (n == 1) return 'one';\n return 'other';\n },\n '22': function _(n) {\n if (isBetween(n, 0, 1) || isBetween(n, 11, 99)) return 'one';\n return 'other';\n },\n '23': function _(n) {\n if (isBetween(n % 10, 1, 2) || n % 20 === 0) return 'one';\n return 'other';\n },\n '24': function _(n) {\n if (isBetween(n, 3, 10) || isBetween(n, 13, 19)) return 'few';\n if (isIn(n, [2, 12])) return 'two';\n if (isIn(n, [1, 11])) return 'one';\n return 'other';\n }\n };\n var index = locales2rules[lang.replace(/-.*$/, '')];\n\n if (!(index in pluralRules)) {\n console.warn('plural form unknown for [' + lang + ']');\n return function () {\n return 'other';\n };\n }\n\n return pluralRules[index];\n }\n\n gMacros.plural = function (str, param, key, prop) {\n var n = parseFloat(param);\n if (isNaN(n)) return str;\n if (prop != gTextProp) return str;\n\n if (!gMacros._pluralRules) {\n gMacros._pluralRules = getPluralRules(gLanguage);\n }\n\n var index = '[' + gMacros._pluralRules(n) + ']';\n\n if (n === 0 && key + '[zero]' in gL10nData) {\n str = gL10nData[key + '[zero]'][prop];\n } else if (n == 1 && key + '[one]' in gL10nData) {\n str = gL10nData[key + '[one]'][prop];\n } else if (n == 2 && key + '[two]' in gL10nData) {\n str = gL10nData[key + '[two]'][prop];\n } else if (key + index in gL10nData) {\n str = gL10nData[key + index][prop];\n } else if (key + '[other]' in gL10nData) {\n str = gL10nData[key + '[other]'][prop];\n }\n\n return str;\n };\n\n function getL10nData(key, args, fallback) {\n var data = gL10nData[key];\n\n if (!data) {\n console.warn('#' + key + ' is undefined.');\n\n if (!fallback) {\n return null;\n }\n\n data = fallback;\n }\n\n var rv = {};\n\n for (var prop in data) {\n var str = data[prop];\n str = substIndexes(str, args, key, prop);\n str = substArguments(str, args, key);\n rv[prop] = str;\n }\n\n return rv;\n }\n\n function substIndexes(str, args, key, prop) {\n var reIndex = /\\{\\[\\s*([a-zA-Z]+)\\(([a-zA-Z]+)\\)\\s*\\]\\}/;\n var reMatch = reIndex.exec(str);\n if (!reMatch || !reMatch.length) return str;\n var macroName = reMatch[1];\n var paramName = reMatch[2];\n var param;\n\n if (args && paramName in args) {\n param = args[paramName];\n } else if (paramName in gL10nData) {\n param = gL10nData[paramName];\n }\n\n if (macroName in gMacros) {\n var macro = gMacros[macroName];\n str = macro(str, param, key, prop);\n }\n\n return str;\n }\n\n function substArguments(str, args, key) {\n var reArgs = /\\{\\{\\s*(.+?)\\s*\\}\\}/g;\n return str.replace(reArgs, function (matched_text, arg) {\n if (args && arg in args) {\n return args[arg];\n }\n\n if (arg in gL10nData) {\n return gL10nData[arg];\n }\n\n console.log('argument {{' + arg + '}} for #' + key + ' is undefined.');\n return matched_text;\n });\n }\n\n function translateElement(element) {\n var l10n = getL10nAttributes(element);\n if (!l10n.id) return;\n var data = getL10nData(l10n.id, l10n.args);\n\n if (!data) {\n console.warn('#' + l10n.id + ' is undefined.');\n return;\n }\n\n if (data[gTextProp]) {\n if (getChildElementCount(element) === 0) {\n element[gTextProp] = data[gTextProp];\n } else {\n var children = element.childNodes;\n var found = false;\n\n for (var i = 0, l = children.length; i < l; i++) {\n if (children[i].nodeType === 3 && /\\S/.test(children[i].nodeValue)) {\n if (found) {\n children[i].nodeValue = '';\n } else {\n children[i].nodeValue = data[gTextProp];\n found = true;\n }\n }\n }\n\n if (!found) {\n var textNode = document.createTextNode(data[gTextProp]);\n element.insertBefore(textNode, element.firstChild);\n }\n }\n\n delete data[gTextProp];\n }\n\n for (var k in data) {\n element[k] = data[k];\n }\n }\n\n function getChildElementCount(element) {\n if (element.children) {\n return element.children.length;\n }\n\n if (typeof element.childElementCount !== 'undefined') {\n return element.childElementCount;\n }\n\n var count = 0;\n\n for (var i = 0; i < element.childNodes.length; i++) {\n count += element.nodeType === 1 ? 1 : 0;\n }\n\n return count;\n }\n\n function translateFragment(element) {\n element = element || document.documentElement;\n var children = getTranslatableChildren(element);\n var elementCount = children.length;\n\n for (var i = 0; i < elementCount; i++) {\n translateElement(children[i]);\n }\n\n translateElement(element);\n }\n\n return {\n get: function get(key, args, fallbackString) {\n var index = key.lastIndexOf('.');\n var prop = gTextProp;\n\n if (index > 0) {\n prop = key.substring(index + 1);\n key = key.substring(0, index);\n }\n\n var fallback;\n\n if (fallbackString) {\n fallback = {};\n fallback[prop] = fallbackString;\n }\n\n var data = getL10nData(key, args, fallback);\n\n if (data && prop in data) {\n return data[prop];\n }\n\n return '{{' + key + '}}';\n },\n getData: function getData() {\n return gL10nData;\n },\n getText: function getText() {\n return gTextData;\n },\n getLanguage: function getLanguage() {\n return gLanguage;\n },\n setLanguage: function setLanguage(lang, callback) {\n loadLocale(lang, function () {\n if (callback) callback();\n });\n },\n getDirection: function getDirection() {\n var rtlList = ['ar', 'he', 'fa', 'ps', 'ur'];\n var shortCode = gLanguage.split('-', 1)[0];\n return rtlList.indexOf(shortCode) >= 0 ? 'rtl' : 'ltr';\n },\n translate: translateFragment,\n getReadyState: function getReadyState() {\n return gReadyState;\n },\n ready: function ready(callback) {\n if (!callback) {\n return;\n } else if (gReadyState == 'complete' || gReadyState == 'interactive') {\n window.setTimeout(function () {\n callback();\n });\n } else if (document.addEventListener) {\n document.addEventListener('localized', function once() {\n document.removeEventListener('localized', once);\n callback();\n });\n }\n }\n };\n}(window, document);\n\n/***/ }),\n/* 13 */\n/***/ (function(module, exports, __w_pdfjs_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.PDFFindController = exports.FindState = void 0;\n\nvar _pdfjsLib = __w_pdfjs_require__(2);\n\nvar _pdf_find_utils = __w_pdfjs_require__(14);\n\nvar _ui_utils = __w_pdfjs_require__(3);\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nvar FindState = {\n FOUND: 0,\n NOT_FOUND: 1,\n WRAPPED: 2,\n PENDING: 3\n};\nexports.FindState = FindState;\nvar FIND_TIMEOUT = 250;\nvar MATCH_SCROLL_OFFSET_TOP = -50;\nvar MATCH_SCROLL_OFFSET_LEFT = -400;\nvar CHARACTERS_TO_NORMALIZE = {\n \"\\u2018\": \"'\",\n \"\\u2019\": \"'\",\n \"\\u201A\": \"'\",\n \"\\u201B\": \"'\",\n \"\\u201C\": '\"',\n \"\\u201D\": '\"',\n \"\\u201E\": '\"',\n \"\\u201F\": '\"',\n \"\\xBC\": \"1/4\",\n \"\\xBD\": \"1/2\",\n \"\\xBE\": \"3/4\"\n};\nvar normalizationRegex = null;\n\nfunction normalize(text) {\n if (!normalizationRegex) {\n var replace = Object.keys(CHARACTERS_TO_NORMALIZE).join(\"\");\n normalizationRegex = new RegExp(\"[\".concat(replace, \"]\"), \"g\");\n }\n\n return text.replace(normalizationRegex, function (ch) {\n return CHARACTERS_TO_NORMALIZE[ch];\n });\n}\n\nvar PDFFindController = /*#__PURE__*/function () {\n function PDFFindController(_ref) {\n var linkService = _ref.linkService,\n eventBus = _ref.eventBus;\n\n _classCallCheck(this, PDFFindController);\n\n this._linkService = linkService;\n this._eventBus = eventBus;\n\n this._reset();\n\n eventBus._on(\"findbarclose\", this._onFindBarClose.bind(this));\n }\n\n _createClass(PDFFindController, [{\n key: \"setDocument\",\n value: function setDocument(pdfDocument) {\n if (this._pdfDocument) {\n this._reset();\n }\n\n if (!pdfDocument) {\n return;\n }\n\n this._pdfDocument = pdfDocument;\n\n this._firstPageCapability.resolve();\n }\n }, {\n key: \"executeCommand\",\n value: function executeCommand(cmd, state) {\n var _this = this;\n\n if (!state) {\n return;\n }\n\n var pdfDocument = this._pdfDocument;\n\n if (this._state === null || this._shouldDirtyMatch(cmd, state)) {\n this._dirtyMatch = true;\n }\n\n this._state = state;\n\n if (cmd !== \"findhighlightallchange\") {\n this._updateUIState(FindState.PENDING);\n }\n\n this._firstPageCapability.promise.then(function () {\n if (!_this._pdfDocument || pdfDocument && _this._pdfDocument !== pdfDocument) {\n return;\n }\n\n _this._extractText();\n\n var findbarClosed = !_this._highlightMatches;\n var pendingTimeout = !!_this._findTimeout;\n\n if (_this._findTimeout) {\n clearTimeout(_this._findTimeout);\n _this._findTimeout = null;\n }\n\n if (cmd === \"find\") {\n _this._findTimeout = setTimeout(function () {\n _this._nextMatch();\n\n _this._findTimeout = null;\n }, FIND_TIMEOUT);\n } else if (_this._dirtyMatch) {\n _this._nextMatch();\n } else if (cmd === \"findagain\") {\n _this._nextMatch();\n\n if (findbarClosed && _this._state.highlightAll) {\n _this._updateAllPages();\n }\n } else if (cmd === \"findhighlightallchange\") {\n if (pendingTimeout) {\n _this._nextMatch();\n } else {\n _this._highlightMatches = true;\n }\n\n _this._updateAllPages();\n } else {\n _this._nextMatch();\n }\n });\n }\n }, {\n key: \"scrollMatchIntoView\",\n value: function scrollMatchIntoView(_ref2) {\n var _ref2$element = _ref2.element,\n element = _ref2$element === void 0 ? null : _ref2$element,\n _ref2$pageIndex = _ref2.pageIndex,\n pageIndex = _ref2$pageIndex === void 0 ? -1 : _ref2$pageIndex,\n _ref2$matchIndex = _ref2.matchIndex,\n matchIndex = _ref2$matchIndex === void 0 ? -1 : _ref2$matchIndex;\n\n if (!this._scrollMatches || !element) {\n return;\n } else if (matchIndex === -1 || matchIndex !== this._selected.matchIdx) {\n return;\n } else if (pageIndex === -1 || pageIndex !== this._selected.pageIdx) {\n return;\n }\n\n this._scrollMatches = false;\n var spot = {\n top: MATCH_SCROLL_OFFSET_TOP,\n left: MATCH_SCROLL_OFFSET_LEFT\n };\n (0, _ui_utils.scrollIntoView)(element, spot, true);\n }\n }, {\n key: \"_reset\",\n value: function _reset() {\n this._highlightMatches = false;\n this._scrollMatches = false;\n this._pdfDocument = null;\n this._pageMatches = [];\n this._pageMatchesLength = [];\n this._state = null;\n this._selected = {\n pageIdx: -1,\n matchIdx: -1\n };\n this._offset = {\n pageIdx: null,\n matchIdx: null,\n wrapped: false\n };\n this._extractTextPromises = [];\n this._pageContents = [];\n this._matchesCountTotal = 0;\n this._pagesToSearch = null;\n this._pendingFindMatches = Object.create(null);\n this._resumePageIdx = null;\n this._dirtyMatch = false;\n clearTimeout(this._findTimeout);\n this._findTimeout = null;\n this._firstPageCapability = (0, _pdfjsLib.createPromiseCapability)();\n }\n }, {\n key: \"_shouldDirtyMatch\",\n value: function _shouldDirtyMatch(cmd, state) {\n if (state.query !== this._state.query) {\n return true;\n }\n\n switch (cmd) {\n case \"findagain\":\n var pageNumber = this._selected.pageIdx + 1;\n var linkService = this._linkService;\n\n if (pageNumber >= 1 && pageNumber <= linkService.pagesCount && pageNumber !== linkService.page && !linkService.isPageVisible(pageNumber)) {\n return true;\n }\n\n return false;\n\n case \"findhighlightallchange\":\n return false;\n }\n\n return true;\n }\n }, {\n key: \"_prepareMatches\",\n value: function _prepareMatches(matchesWithLength, matches, matchesLength) {\n function isSubTerm(currentIndex) {\n var currentElem = matchesWithLength[currentIndex];\n var nextElem = matchesWithLength[currentIndex + 1];\n\n if (currentIndex < matchesWithLength.length - 1 && currentElem.match === nextElem.match) {\n currentElem.skipped = true;\n return true;\n }\n\n for (var i = currentIndex - 1; i >= 0; i--) {\n var prevElem = matchesWithLength[i];\n\n if (prevElem.skipped) {\n continue;\n }\n\n if (prevElem.match + prevElem.matchLength < currentElem.match) {\n break;\n }\n\n if (prevElem.match + prevElem.matchLength >= currentElem.match + currentElem.matchLength) {\n currentElem.skipped = true;\n return true;\n }\n }\n\n return false;\n }\n\n matchesWithLength.sort(function (a, b) {\n return a.match === b.match ? a.matchLength - b.matchLength : a.match - b.match;\n });\n\n for (var i = 0, len = matchesWithLength.length; i < len; i++) {\n if (isSubTerm(i)) {\n continue;\n }\n\n matches.push(matchesWithLength[i].match);\n matchesLength.push(matchesWithLength[i].matchLength);\n }\n }\n }, {\n key: \"_isEntireWord\",\n value: function _isEntireWord(content, startIdx, length) {\n if (startIdx > 0) {\n var first = content.charCodeAt(startIdx);\n var limit = content.charCodeAt(startIdx - 1);\n\n if ((0, _pdf_find_utils.getCharacterType)(first) === (0, _pdf_find_utils.getCharacterType)(limit)) {\n return false;\n }\n }\n\n var endIdx = startIdx + length - 1;\n\n if (endIdx < content.length - 1) {\n var last = content.charCodeAt(endIdx);\n\n var _limit = content.charCodeAt(endIdx + 1);\n\n if ((0, _pdf_find_utils.getCharacterType)(last) === (0, _pdf_find_utils.getCharacterType)(_limit)) {\n return false;\n }\n }\n\n return true;\n }\n }, {\n key: \"_calculatePhraseMatch\",\n value: function _calculatePhraseMatch(query, pageIndex, pageContent, entireWord) {\n var matches = [];\n var queryLen = query.length;\n var matchIdx = -queryLen;\n\n while (true) {\n matchIdx = pageContent.indexOf(query, matchIdx + queryLen);\n\n if (matchIdx === -1) {\n break;\n }\n\n if (entireWord && !this._isEntireWord(pageContent, matchIdx, queryLen)) {\n continue;\n }\n\n matches.push(matchIdx);\n }\n\n this._pageMatches[pageIndex] = matches;\n }\n }, {\n key: \"_calculateWordMatch\",\n value: function _calculateWordMatch(query, pageIndex, pageContent, entireWord) {\n var matchesWithLength = [];\n var queryArray = query.match(/\\S+/g);\n\n for (var i = 0, len = queryArray.length; i < len; i++) {\n var subquery = queryArray[i];\n var subqueryLen = subquery.length;\n var matchIdx = -subqueryLen;\n\n while (true) {\n matchIdx = pageContent.indexOf(subquery, matchIdx + subqueryLen);\n\n if (matchIdx === -1) {\n break;\n }\n\n if (entireWord && !this._isEntireWord(pageContent, matchIdx, subqueryLen)) {\n continue;\n }\n\n matchesWithLength.push({\n match: matchIdx,\n matchLength: subqueryLen,\n skipped: false\n });\n }\n }\n\n this._pageMatchesLength[pageIndex] = [];\n this._pageMatches[pageIndex] = [];\n\n this._prepareMatches(matchesWithLength, this._pageMatches[pageIndex], this._pageMatchesLength[pageIndex]);\n }\n }, {\n key: \"_calculateMatch\",\n value: function _calculateMatch(pageIndex) {\n var pageContent = this._pageContents[pageIndex];\n var query = this._query;\n var _this$_state = this._state,\n caseSensitive = _this$_state.caseSensitive,\n entireWord = _this$_state.entireWord,\n phraseSearch = _this$_state.phraseSearch;\n\n if (query.length === 0) {\n return;\n }\n\n if (!caseSensitive) {\n pageContent = pageContent.toLowerCase();\n query = query.toLowerCase();\n }\n\n if (phraseSearch) {\n this._calculatePhraseMatch(query, pageIndex, pageContent, entireWord);\n } else {\n this._calculateWordMatch(query, pageIndex, pageContent, entireWord);\n }\n\n if (this._state.highlightAll) {\n this._updatePage(pageIndex);\n }\n\n if (this._resumePageIdx === pageIndex) {\n this._resumePageIdx = null;\n\n this._nextPageMatch();\n }\n\n var pageMatchesCount = this._pageMatches[pageIndex].length;\n\n if (pageMatchesCount > 0) {\n this._matchesCountTotal += pageMatchesCount;\n\n this._updateUIResultsCount();\n }\n }\n }, {\n key: \"_extractText\",\n value: function _extractText() {\n var _this2 = this;\n\n if (this._extractTextPromises.length > 0) {\n return;\n }\n\n var promise = Promise.resolve();\n\n var _loop = function _loop(i, ii) {\n var extractTextCapability = (0, _pdfjsLib.createPromiseCapability)();\n _this2._extractTextPromises[i] = extractTextCapability.promise;\n promise = promise.then(function () {\n return _this2._pdfDocument.getPage(i + 1).then(function (pdfPage) {\n return pdfPage.getTextContent({\n normalizeWhitespace: true\n });\n }).then(function (textContent) {\n var textItems = textContent.items;\n var strBuf = [];\n\n for (var j = 0, jj = textItems.length; j < jj; j++) {\n strBuf.push(textItems[j].str);\n }\n\n _this2._pageContents[i] = normalize(strBuf.join(\"\"));\n extractTextCapability.resolve(i);\n }, function (reason) {\n console.error(\"Unable to get text content for page \".concat(i + 1), reason);\n _this2._pageContents[i] = \"\";\n extractTextCapability.resolve(i);\n });\n });\n };\n\n for (var i = 0, ii = this._linkService.pagesCount; i < ii; i++) {\n _loop(i, ii);\n }\n }\n }, {\n key: \"_updatePage\",\n value: function _updatePage(index) {\n if (this._scrollMatches && this._selected.pageIdx === index) {\n this._linkService.page = index + 1;\n }\n\n this._eventBus.dispatch(\"updatetextlayermatches\", {\n source: this,\n pageIndex: index\n });\n }\n }, {\n key: \"_updateAllPages\",\n value: function _updateAllPages() {\n this._eventBus.dispatch(\"updatetextlayermatches\", {\n source: this,\n pageIndex: -1\n });\n }\n }, {\n key: \"_nextMatch\",\n value: function _nextMatch() {\n var _this3 = this;\n\n var previous = this._state.findPrevious;\n var currentPageIndex = this._linkService.page - 1;\n var numPages = this._linkService.pagesCount;\n this._highlightMatches = true;\n\n if (this._dirtyMatch) {\n this._dirtyMatch = false;\n this._selected.pageIdx = this._selected.matchIdx = -1;\n this._offset.pageIdx = currentPageIndex;\n this._offset.matchIdx = null;\n this._offset.wrapped = false;\n this._resumePageIdx = null;\n this._pageMatches.length = 0;\n this._pageMatchesLength.length = 0;\n this._matchesCountTotal = 0;\n\n this._updateAllPages();\n\n for (var i = 0; i < numPages; i++) {\n if (this._pendingFindMatches[i] === true) {\n continue;\n }\n\n this._pendingFindMatches[i] = true;\n\n this._extractTextPromises[i].then(function (pageIdx) {\n delete _this3._pendingFindMatches[pageIdx];\n\n _this3._calculateMatch(pageIdx);\n });\n }\n }\n\n if (this._query === \"\") {\n this._updateUIState(FindState.FOUND);\n\n return;\n }\n\n if (this._resumePageIdx) {\n return;\n }\n\n var offset = this._offset;\n this._pagesToSearch = numPages;\n\n if (offset.matchIdx !== null) {\n var numPageMatches = this._pageMatches[offset.pageIdx].length;\n\n if (!previous && offset.matchIdx + 1 < numPageMatches || previous && offset.matchIdx > 0) {\n offset.matchIdx = previous ? offset.matchIdx - 1 : offset.matchIdx + 1;\n\n this._updateMatch(true);\n\n return;\n }\n\n this._advanceOffsetPage(previous);\n }\n\n this._nextPageMatch();\n }\n }, {\n key: \"_matchesReady\",\n value: function _matchesReady(matches) {\n var offset = this._offset;\n var numMatches = matches.length;\n var previous = this._state.findPrevious;\n\n if (numMatches) {\n offset.matchIdx = previous ? numMatches - 1 : 0;\n\n this._updateMatch(true);\n\n return true;\n }\n\n this._advanceOffsetPage(previous);\n\n if (offset.wrapped) {\n offset.matchIdx = null;\n\n if (this._pagesToSearch < 0) {\n this._updateMatch(false);\n\n return true;\n }\n }\n\n return false;\n }\n }, {\n key: \"_nextPageMatch\",\n value: function _nextPageMatch() {\n if (this._resumePageIdx !== null) {\n console.error(\"There can only be one pending page.\");\n }\n\n var matches = null;\n\n do {\n var pageIdx = this._offset.pageIdx;\n matches = this._pageMatches[pageIdx];\n\n if (!matches) {\n this._resumePageIdx = pageIdx;\n break;\n }\n } while (!this._matchesReady(matches));\n }\n }, {\n key: \"_advanceOffsetPage\",\n value: function _advanceOffsetPage(previous) {\n var offset = this._offset;\n var numPages = this._linkService.pagesCount;\n offset.pageIdx = previous ? offset.pageIdx - 1 : offset.pageIdx + 1;\n offset.matchIdx = null;\n this._pagesToSearch--;\n\n if (offset.pageIdx >= numPages || offset.pageIdx < 0) {\n offset.pageIdx = previous ? numPages - 1 : 0;\n offset.wrapped = true;\n }\n }\n }, {\n key: \"_updateMatch\",\n value: function _updateMatch() {\n var found = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n var state = FindState.NOT_FOUND;\n var wrapped = this._offset.wrapped;\n this._offset.wrapped = false;\n\n if (found) {\n var previousPage = this._selected.pageIdx;\n this._selected.pageIdx = this._offset.pageIdx;\n this._selected.matchIdx = this._offset.matchIdx;\n state = wrapped ? FindState.WRAPPED : FindState.FOUND;\n\n if (previousPage !== -1 && previousPage !== this._selected.pageIdx) {\n this._updatePage(previousPage);\n }\n }\n\n this._updateUIState(state, this._state.findPrevious);\n\n if (this._selected.pageIdx !== -1) {\n this._scrollMatches = true;\n\n this._updatePage(this._selected.pageIdx);\n }\n }\n }, {\n key: \"_onFindBarClose\",\n value: function _onFindBarClose(evt) {\n var _this4 = this;\n\n var pdfDocument = this._pdfDocument;\n\n this._firstPageCapability.promise.then(function () {\n if (!_this4._pdfDocument || pdfDocument && _this4._pdfDocument !== pdfDocument) {\n return;\n }\n\n if (_this4._findTimeout) {\n clearTimeout(_this4._findTimeout);\n _this4._findTimeout = null;\n }\n\n if (_this4._resumePageIdx) {\n _this4._resumePageIdx = null;\n _this4._dirtyMatch = true;\n }\n\n _this4._updateUIState(FindState.FOUND);\n\n _this4._highlightMatches = false;\n\n _this4._updateAllPages();\n });\n }\n }, {\n key: \"_requestMatchesCount\",\n value: function _requestMatchesCount() {\n var _this$_selected = this._selected,\n pageIdx = _this$_selected.pageIdx,\n matchIdx = _this$_selected.matchIdx;\n var current = 0,\n total = this._matchesCountTotal;\n\n if (matchIdx !== -1) {\n for (var i = 0; i < pageIdx; i++) {\n current += this._pageMatches[i] && this._pageMatches[i].length || 0;\n }\n\n current += matchIdx + 1;\n }\n\n if (current < 1 || current > total) {\n current = total = 0;\n }\n\n return {\n current: current,\n total: total\n };\n }\n }, {\n key: \"_updateUIResultsCount\",\n value: function _updateUIResultsCount() {\n this._eventBus.dispatch(\"updatefindmatchescount\", {\n source: this,\n matchesCount: this._requestMatchesCount()\n });\n }\n }, {\n key: \"_updateUIState\",\n value: function _updateUIState(state, previous) {\n this._eventBus.dispatch(\"updatefindcontrolstate\", {\n source: this,\n state: state,\n previous: previous,\n matchesCount: this._requestMatchesCount()\n });\n }\n }, {\n key: \"highlightMatches\",\n get: function get() {\n return this._highlightMatches;\n }\n }, {\n key: \"pageMatches\",\n get: function get() {\n return this._pageMatches;\n }\n }, {\n key: \"pageMatchesLength\",\n get: function get() {\n return this._pageMatchesLength;\n }\n }, {\n key: \"selected\",\n get: function get() {\n return this._selected;\n }\n }, {\n key: \"state\",\n get: function get() {\n return this._state;\n }\n }, {\n key: \"_query\",\n get: function get() {\n if (this._state.query !== this._rawQuery) {\n this._rawQuery = this._state.query;\n this._normalizedQuery = normalize(this._state.query);\n }\n\n return this._normalizedQuery;\n }\n }]);\n\n return PDFFindController;\n}();\n\nexports.PDFFindController = PDFFindController;\n\n/***/ }),\n/* 14 */\n/***/ (function(module, exports, __w_pdfjs_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.getCharacterType = getCharacterType;\nexports.CharacterType = void 0;\nvar CharacterType = {\n SPACE: 0,\n ALPHA_LETTER: 1,\n PUNCT: 2,\n HAN_LETTER: 3,\n KATAKANA_LETTER: 4,\n HIRAGANA_LETTER: 5,\n HALFWIDTH_KATAKANA_LETTER: 6,\n THAI_LETTER: 7\n};\nexports.CharacterType = CharacterType;\n\nfunction isAlphabeticalScript(charCode) {\n return charCode < 0x2e80;\n}\n\nfunction isAscii(charCode) {\n return (charCode & 0xff80) === 0;\n}\n\nfunction isAsciiAlpha(charCode) {\n return charCode >= 0x61 && charCode <= 0x7a || charCode >= 0x41 && charCode <= 0x5a;\n}\n\nfunction isAsciiDigit(charCode) {\n return charCode >= 0x30 && charCode <= 0x39;\n}\n\nfunction isAsciiSpace(charCode) {\n return charCode === 0x20 || charCode === 0x09 || charCode === 0x0d || charCode === 0x0a;\n}\n\nfunction isHan(charCode) {\n return charCode >= 0x3400 && charCode <= 0x9fff || charCode >= 0xf900 && charCode <= 0xfaff;\n}\n\nfunction isKatakana(charCode) {\n return charCode >= 0x30a0 && charCode <= 0x30ff;\n}\n\nfunction isHiragana(charCode) {\n return charCode >= 0x3040 && charCode <= 0x309f;\n}\n\nfunction isHalfwidthKatakana(charCode) {\n return charCode >= 0xff60 && charCode <= 0xff9f;\n}\n\nfunction isThai(charCode) {\n return (charCode & 0xff80) === 0x0e00;\n}\n\nfunction getCharacterType(charCode) {\n if (isAlphabeticalScript(charCode)) {\n if (isAscii(charCode)) {\n if (isAsciiSpace(charCode)) {\n return CharacterType.SPACE;\n } else if (isAsciiAlpha(charCode) || isAsciiDigit(charCode) || charCode === 0x5f) {\n return CharacterType.ALPHA_LETTER;\n }\n\n return CharacterType.PUNCT;\n } else if (isThai(charCode)) {\n return CharacterType.THAI_LETTER;\n } else if (charCode === 0xa0) {\n return CharacterType.SPACE;\n }\n\n return CharacterType.ALPHA_LETTER;\n }\n\n if (isHan(charCode)) {\n return CharacterType.HAN_LETTER;\n } else if (isKatakana(charCode)) {\n return CharacterType.KATAKANA_LETTER;\n } else if (isHiragana(charCode)) {\n return CharacterType.HIRAGANA_LETTER;\n } else if (isHalfwidthKatakana(charCode)) {\n return CharacterType.HALFWIDTH_KATAKANA_LETTER;\n }\n\n return CharacterType.ALPHA_LETTER;\n}\n\n/***/ }),\n/* 15 */\n/***/ (function(module, exports, __w_pdfjs_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.isDestHashesEqual = isDestHashesEqual;\nexports.isDestArraysEqual = isDestArraysEqual;\nexports.PDFHistory = void 0;\n\nvar _ui_utils = __w_pdfjs_require__(3);\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\n\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.\"); }\n\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); }\n\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; }\n\nfunction _iterableToArrayLimit(arr, i) { if (typeof Symbol === \"undefined\" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nvar HASH_CHANGE_TIMEOUT = 1000;\nvar POSITION_UPDATED_THRESHOLD = 50;\nvar UPDATE_VIEWAREA_TIMEOUT = 1000;\n\nfunction getCurrentHash() {\n return document.location.hash;\n}\n\nvar PDFHistory = /*#__PURE__*/function () {\n function PDFHistory(_ref) {\n var _this = this;\n\n var linkService = _ref.linkService,\n eventBus = _ref.eventBus;\n\n _classCallCheck(this, PDFHistory);\n\n this.linkService = linkService;\n this.eventBus = eventBus;\n this._initialized = false;\n this._fingerprint = \"\";\n this.reset();\n this._boundEvents = null;\n this._isViewerInPresentationMode = false;\n\n this.eventBus._on(\"presentationmodechanged\", function (evt) {\n _this._isViewerInPresentationMode = evt.active || evt.switchInProgress;\n });\n\n this.eventBus._on(\"pagesinit\", function () {\n _this._isPagesLoaded = false;\n\n var onPagesLoaded = function onPagesLoaded(evt) {\n _this.eventBus._off(\"pagesloaded\", onPagesLoaded);\n\n _this._isPagesLoaded = !!evt.pagesCount;\n };\n\n _this.eventBus._on(\"pagesloaded\", onPagesLoaded);\n });\n }\n\n _createClass(PDFHistory, [{\n key: \"initialize\",\n value: function initialize(_ref2) {\n var fingerprint = _ref2.fingerprint,\n _ref2$resetHistory = _ref2.resetHistory,\n resetHistory = _ref2$resetHistory === void 0 ? false : _ref2$resetHistory,\n _ref2$updateUrl = _ref2.updateUrl,\n updateUrl = _ref2$updateUrl === void 0 ? false : _ref2$updateUrl;\n\n if (!fingerprint || typeof fingerprint !== \"string\") {\n console.error('PDFHistory.initialize: The \"fingerprint\" must be a non-empty string.');\n return;\n }\n\n if (this._initialized) {\n this.reset();\n }\n\n var reInitialized = this._fingerprint !== \"\" && this._fingerprint !== fingerprint;\n this._fingerprint = fingerprint;\n this._updateUrl = updateUrl === true;\n this._initialized = true;\n\n this._bindEvents();\n\n var state = window.history.state;\n this._popStateInProgress = false;\n this._blockHashChange = 0;\n this._currentHash = getCurrentHash();\n this._numPositionUpdates = 0;\n this._uid = this._maxUid = 0;\n this._destination = null;\n this._position = null;\n\n if (!this._isValidState(state, true) || resetHistory) {\n var _this$_parseCurrentHa = this._parseCurrentHash(true),\n hash = _this$_parseCurrentHa.hash,\n page = _this$_parseCurrentHa.page,\n rotation = _this$_parseCurrentHa.rotation;\n\n if (!hash || reInitialized || resetHistory) {\n this._pushOrReplaceState(null, true);\n\n return;\n }\n\n this._pushOrReplaceState({\n hash: hash,\n page: page,\n rotation: rotation\n }, true);\n\n return;\n }\n\n var destination = state.destination;\n\n this._updateInternalState(destination, state.uid, true);\n\n if (this._uid > this._maxUid) {\n this._maxUid = this._uid;\n }\n\n if (destination.rotation !== undefined) {\n this._initialRotation = destination.rotation;\n }\n\n if (destination.dest) {\n this._initialBookmark = JSON.stringify(destination.dest);\n this._destination.page = null;\n } else if (destination.hash) {\n this._initialBookmark = destination.hash;\n } else if (destination.page) {\n this._initialBookmark = \"page=\".concat(destination.page);\n }\n }\n }, {\n key: \"reset\",\n value: function reset() {\n if (this._initialized) {\n this._pageHide();\n\n this._initialized = false;\n\n this._unbindEvents();\n }\n\n if (this._updateViewareaTimeout) {\n clearTimeout(this._updateViewareaTimeout);\n this._updateViewareaTimeout = null;\n }\n\n this._initialBookmark = null;\n this._initialRotation = null;\n }\n }, {\n key: \"push\",\n value: function push(_ref3) {\n var _this2 = this;\n\n var _ref3$namedDest = _ref3.namedDest,\n namedDest = _ref3$namedDest === void 0 ? null : _ref3$namedDest,\n explicitDest = _ref3.explicitDest,\n pageNumber = _ref3.pageNumber;\n\n if (!this._initialized) {\n return;\n }\n\n if (namedDest && typeof namedDest !== \"string\") {\n console.error(\"PDFHistory.push: \" + \"\\\"\".concat(namedDest, \"\\\" is not a valid namedDest parameter.\"));\n return;\n } else if (!Array.isArray(explicitDest)) {\n console.error(\"PDFHistory.push: \" + \"\\\"\".concat(explicitDest, \"\\\" is not a valid explicitDest parameter.\"));\n return;\n } else if (!(Number.isInteger(pageNumber) && pageNumber > 0 && pageNumber <= this.linkService.pagesCount)) {\n if (pageNumber !== null || this._destination) {\n console.error(\"PDFHistory.push: \" + \"\\\"\".concat(pageNumber, \"\\\" is not a valid pageNumber parameter.\"));\n return;\n }\n }\n\n var hash = namedDest || JSON.stringify(explicitDest);\n\n if (!hash) {\n return;\n }\n\n var forceReplace = false;\n\n if (this._destination && (isDestHashesEqual(this._destination.hash, hash) || isDestArraysEqual(this._destination.dest, explicitDest))) {\n if (this._destination.page) {\n return;\n }\n\n forceReplace = true;\n }\n\n if (this._popStateInProgress && !forceReplace) {\n return;\n }\n\n this._pushOrReplaceState({\n dest: explicitDest,\n hash: hash,\n page: pageNumber,\n rotation: this.linkService.rotation\n }, forceReplace);\n\n if (!this._popStateInProgress) {\n this._popStateInProgress = true;\n Promise.resolve().then(function () {\n _this2._popStateInProgress = false;\n });\n }\n }\n }, {\n key: \"pushCurrentPosition\",\n value: function pushCurrentPosition() {\n if (!this._initialized || this._popStateInProgress) {\n return;\n }\n\n this._tryPushCurrentPosition();\n }\n }, {\n key: \"back\",\n value: function back() {\n if (!this._initialized || this._popStateInProgress) {\n return;\n }\n\n var state = window.history.state;\n\n if (this._isValidState(state) && state.uid > 0) {\n window.history.back();\n }\n }\n }, {\n key: \"forward\",\n value: function forward() {\n if (!this._initialized || this._popStateInProgress) {\n return;\n }\n\n var state = window.history.state;\n\n if (this._isValidState(state) && state.uid < this._maxUid) {\n window.history.forward();\n }\n }\n }, {\n key: \"_pushOrReplaceState\",\n value: function _pushOrReplaceState(destination) {\n var forceReplace = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n var shouldReplace = forceReplace || !this._destination;\n var newState = {\n fingerprint: this._fingerprint,\n uid: shouldReplace ? this._uid : this._uid + 1,\n destination: destination\n };\n\n this._updateInternalState(destination, newState.uid);\n\n var newUrl;\n\n if (this._updateUrl && destination && destination.hash) {\n var baseUrl = document.location.href.split(\"#\")[0];\n\n if (!baseUrl.startsWith(\"file://\")) {\n newUrl = \"\".concat(baseUrl, \"#\").concat(destination.hash);\n }\n }\n\n if (shouldReplace) {\n window.history.replaceState(newState, \"\", newUrl);\n } else {\n this._maxUid = this._uid;\n window.history.pushState(newState, \"\", newUrl);\n }\n }\n }, {\n key: \"_tryPushCurrentPosition\",\n value: function _tryPushCurrentPosition() {\n var temporary = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n\n if (!this._position) {\n return;\n }\n\n var position = this._position;\n\n if (temporary) {\n position = Object.assign(Object.create(null), this._position);\n position.temporary = true;\n }\n\n if (!this._destination) {\n this._pushOrReplaceState(position);\n\n return;\n }\n\n if (this._destination.temporary) {\n this._pushOrReplaceState(position, true);\n\n return;\n }\n\n if (this._destination.hash === position.hash) {\n return;\n }\n\n if (!this._destination.page && (POSITION_UPDATED_THRESHOLD <= 0 || this._numPositionUpdates <= POSITION_UPDATED_THRESHOLD)) {\n return;\n }\n\n var forceReplace = false;\n\n if (this._destination.page >= position.first && this._destination.page <= position.page) {\n if (this._destination.dest || !this._destination.first) {\n return;\n }\n\n forceReplace = true;\n }\n\n this._pushOrReplaceState(position, forceReplace);\n }\n }, {\n key: \"_isValidState\",\n value: function _isValidState(state) {\n var checkReload = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n\n if (!state) {\n return false;\n }\n\n if (state.fingerprint !== this._fingerprint) {\n if (checkReload) {\n if (typeof state.fingerprint !== \"string\" || state.fingerprint.length !== this._fingerprint.length) {\n return false;\n }\n\n var _performance$getEntri = performance.getEntriesByType(\"navigation\"),\n _performance$getEntri2 = _slicedToArray(_performance$getEntri, 1),\n perfEntry = _performance$getEntri2[0];\n\n if (!perfEntry || perfEntry.type !== \"reload\") {\n return false;\n }\n } else {\n return false;\n }\n }\n\n if (!Number.isInteger(state.uid) || state.uid < 0) {\n return false;\n }\n\n if (state.destination === null || _typeof(state.destination) !== \"object\") {\n return false;\n }\n\n return true;\n }\n }, {\n key: \"_updateInternalState\",\n value: function _updateInternalState(destination, uid) {\n var removeTemporary = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n\n if (this._updateViewareaTimeout) {\n clearTimeout(this._updateViewareaTimeout);\n this._updateViewareaTimeout = null;\n }\n\n if (removeTemporary && destination && destination.temporary) {\n delete destination.temporary;\n }\n\n this._destination = destination;\n this._uid = uid;\n this._numPositionUpdates = 0;\n }\n }, {\n key: \"_parseCurrentHash\",\n value: function _parseCurrentHash() {\n var checkNameddest = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n var hash = unescape(getCurrentHash()).substring(1);\n var params = (0, _ui_utils.parseQueryString)(hash);\n var nameddest = params.nameddest || \"\";\n var page = params.page | 0;\n\n if (!(Number.isInteger(page) && page > 0 && page <= this.linkService.pagesCount) || checkNameddest && nameddest.length > 0) {\n page = null;\n }\n\n return {\n hash: hash,\n page: page,\n rotation: this.linkService.rotation\n };\n }\n }, {\n key: \"_updateViewarea\",\n value: function _updateViewarea(_ref4) {\n var _this3 = this;\n\n var location = _ref4.location;\n\n if (this._updateViewareaTimeout) {\n clearTimeout(this._updateViewareaTimeout);\n this._updateViewareaTimeout = null;\n }\n\n this._position = {\n hash: this._isViewerInPresentationMode ? \"page=\".concat(location.pageNumber) : location.pdfOpenParams.substring(1),\n page: this.linkService.page,\n first: location.pageNumber,\n rotation: location.rotation\n };\n\n if (this._popStateInProgress) {\n return;\n }\n\n if (POSITION_UPDATED_THRESHOLD > 0 && this._isPagesLoaded && this._destination && !this._destination.page) {\n this._numPositionUpdates++;\n }\n\n if (UPDATE_VIEWAREA_TIMEOUT > 0) {\n this._updateViewareaTimeout = setTimeout(function () {\n if (!_this3._popStateInProgress) {\n _this3._tryPushCurrentPosition(true);\n }\n\n _this3._updateViewareaTimeout = null;\n }, UPDATE_VIEWAREA_TIMEOUT);\n }\n }\n }, {\n key: \"_popState\",\n value: function _popState(_ref5) {\n var _this4 = this;\n\n var state = _ref5.state;\n var newHash = getCurrentHash(),\n hashChanged = this._currentHash !== newHash;\n this._currentHash = newHash;\n\n if (!state) {\n this._uid++;\n\n var _this$_parseCurrentHa2 = this._parseCurrentHash(),\n hash = _this$_parseCurrentHa2.hash,\n page = _this$_parseCurrentHa2.page,\n rotation = _this$_parseCurrentHa2.rotation;\n\n this._pushOrReplaceState({\n hash: hash,\n page: page,\n rotation: rotation\n }, true);\n\n return;\n }\n\n if (!this._isValidState(state)) {\n return;\n }\n\n this._popStateInProgress = true;\n\n if (hashChanged) {\n this._blockHashChange++;\n (0, _ui_utils.waitOnEventOrTimeout)({\n target: window,\n name: \"hashchange\",\n delay: HASH_CHANGE_TIMEOUT\n }).then(function () {\n _this4._blockHashChange--;\n });\n }\n\n var destination = state.destination;\n\n this._updateInternalState(destination, state.uid, true);\n\n if (this._uid > this._maxUid) {\n this._maxUid = this._uid;\n }\n\n if ((0, _ui_utils.isValidRotation)(destination.rotation)) {\n this.linkService.rotation = destination.rotation;\n }\n\n if (destination.dest) {\n this.linkService.navigateTo(destination.dest);\n } else if (destination.hash) {\n this.linkService.setHash(destination.hash);\n } else if (destination.page) {\n this.linkService.page = destination.page;\n }\n\n Promise.resolve().then(function () {\n _this4._popStateInProgress = false;\n });\n }\n }, {\n key: \"_pageHide\",\n value: function _pageHide() {\n if (!this._destination || this._destination.temporary) {\n this._tryPushCurrentPosition();\n }\n }\n }, {\n key: \"_bindEvents\",\n value: function _bindEvents() {\n if (this._boundEvents) {\n return;\n }\n\n this._boundEvents = {\n updateViewarea: this._updateViewarea.bind(this),\n popState: this._popState.bind(this),\n pageHide: this._pageHide.bind(this)\n };\n\n this.eventBus._on(\"updateviewarea\", this._boundEvents.updateViewarea);\n\n window.addEventListener(\"popstate\", this._boundEvents.popState);\n window.addEventListener(\"pagehide\", this._boundEvents.pageHide);\n }\n }, {\n key: \"_unbindEvents\",\n value: function _unbindEvents() {\n if (!this._boundEvents) {\n return;\n }\n\n this.eventBus._off(\"updateviewarea\", this._boundEvents.updateViewarea);\n\n window.removeEventListener(\"popstate\", this._boundEvents.popState);\n window.removeEventListener(\"pagehide\", this._boundEvents.pageHide);\n this._boundEvents = null;\n }\n }, {\n key: \"popStateInProgress\",\n get: function get() {\n return this._initialized && (this._popStateInProgress || this._blockHashChange > 0);\n }\n }, {\n key: \"initialBookmark\",\n get: function get() {\n return this._initialized ? this._initialBookmark : null;\n }\n }, {\n key: \"initialRotation\",\n get: function get() {\n return this._initialized ? this._initialRotation : null;\n }\n }]);\n\n return PDFHistory;\n}();\n\nexports.PDFHistory = PDFHistory;\n\nfunction isDestHashesEqual(destHash, pushHash) {\n if (typeof destHash !== \"string\" || typeof pushHash !== \"string\") {\n return false;\n }\n\n if (destHash === pushHash) {\n return true;\n }\n\n var _parseQueryString = (0, _ui_utils.parseQueryString)(destHash),\n nameddest = _parseQueryString.nameddest;\n\n if (nameddest === pushHash) {\n return true;\n }\n\n return false;\n}\n\nfunction isDestArraysEqual(firstDest, secondDest) {\n function isEntryEqual(first, second) {\n if (_typeof(first) !== _typeof(second)) {\n return false;\n }\n\n if (Array.isArray(first) || Array.isArray(second)) {\n return false;\n }\n\n if (first !== null && _typeof(first) === \"object\" && second !== null) {\n if (Object.keys(first).length !== Object.keys(second).length) {\n return false;\n }\n\n for (var key in first) {\n if (!isEntryEqual(first[key], second[key])) {\n return false;\n }\n }\n\n return true;\n }\n\n return first === second || Number.isNaN(first) && Number.isNaN(second);\n }\n\n if (!(Array.isArray(firstDest) && Array.isArray(secondDest))) {\n return false;\n }\n\n if (firstDest.length !== secondDest.length) {\n return false;\n }\n\n for (var i = 0, ii = firstDest.length; i < ii; i++) {\n if (!isEntryEqual(firstDest[i], secondDest[i])) {\n return false;\n }\n }\n\n return true;\n}\n\n/***/ }),\n/* 16 */\n/***/ (function(module, exports, __w_pdfjs_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.PDFPageView = void 0;\n\nvar _regenerator = _interopRequireDefault(__w_pdfjs_require__(4));\n\nvar _ui_utils = __w_pdfjs_require__(3);\n\nvar _pdfjsLib = __w_pdfjs_require__(2);\n\nvar _pdf_rendering_queue = __w_pdfjs_require__(17);\n\nvar _viewer_compatibility = __w_pdfjs_require__(10);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\n\nfunction asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }\n\nfunction _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err); } _next(undefined); }); }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nvar MAX_CANVAS_PIXELS = _viewer_compatibility.viewerCompatibilityParams.maxCanvasPixels || 16777216;\n\nvar PDFPageView = /*#__PURE__*/function () {\n function PDFPageView(options) {\n _classCallCheck(this, PDFPageView);\n\n var container = options.container;\n var defaultViewport = options.defaultViewport;\n this.id = options.id;\n this.renderingId = \"page\" + this.id;\n this.pdfPage = null;\n this.pageLabel = null;\n this.rotation = 0;\n this.scale = options.scale || _ui_utils.DEFAULT_SCALE;\n this.viewport = defaultViewport;\n this.pdfPageRotate = defaultViewport.rotation;\n this.hasRestrictedScaling = false;\n this.textLayerMode = Number.isInteger(options.textLayerMode) ? options.textLayerMode : _ui_utils.TextLayerMode.ENABLE;\n this.imageResourcesPath = options.imageResourcesPath || \"\";\n this.renderInteractiveForms = options.renderInteractiveForms || false;\n this.useOnlyCssZoom = options.useOnlyCssZoom || false;\n this.maxCanvasPixels = options.maxCanvasPixels || MAX_CANVAS_PIXELS;\n this.eventBus = options.eventBus;\n this.renderingQueue = options.renderingQueue;\n this.textLayerFactory = options.textLayerFactory;\n this.annotationLayerFactory = options.annotationLayerFactory;\n this.renderer = options.renderer || _ui_utils.RendererType.CANVAS;\n this.enableWebGL = options.enableWebGL || false;\n this.l10n = options.l10n || _ui_utils.NullL10n;\n this.paintTask = null;\n this.paintedViewportMap = new WeakMap();\n this.renderingState = _pdf_rendering_queue.RenderingStates.INITIAL;\n this.resume = null;\n this.error = null;\n this.annotationLayer = null;\n this.textLayer = null;\n this.zoomLayer = null;\n var div = document.createElement(\"div\");\n div.className = \"page\";\n div.style.width = Math.floor(this.viewport.width) + \"px\";\n div.style.height = Math.floor(this.viewport.height) + \"px\";\n div.setAttribute(\"data-page-number\", this.id);\n this.div = div;\n container.appendChild(div);\n }\n\n _createClass(PDFPageView, [{\n key: \"setPdfPage\",\n value: function setPdfPage(pdfPage) {\n this.pdfPage = pdfPage;\n this.pdfPageRotate = pdfPage.rotate;\n var totalRotation = (this.rotation + this.pdfPageRotate) % 360;\n this.viewport = pdfPage.getViewport({\n scale: this.scale * _ui_utils.CSS_UNITS,\n rotation: totalRotation\n });\n this.stats = pdfPage.stats;\n this.reset();\n }\n }, {\n key: \"destroy\",\n value: function destroy() {\n this.reset();\n\n if (this.pdfPage) {\n this.pdfPage.cleanup();\n }\n }\n }, {\n key: \"_resetZoomLayer\",\n value: function _resetZoomLayer() {\n var removeFromDOM = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n\n if (!this.zoomLayer) {\n return;\n }\n\n var zoomLayerCanvas = this.zoomLayer.firstChild;\n this.paintedViewportMap[\"delete\"](zoomLayerCanvas);\n zoomLayerCanvas.width = 0;\n zoomLayerCanvas.height = 0;\n\n if (removeFromDOM) {\n this.zoomLayer.remove();\n }\n\n this.zoomLayer = null;\n }\n }, {\n key: \"reset\",\n value: function reset() {\n var keepZoomLayer = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n var keepAnnotations = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n this.cancelRendering(keepAnnotations);\n this.renderingState = _pdf_rendering_queue.RenderingStates.INITIAL;\n var div = this.div;\n div.style.width = Math.floor(this.viewport.width) + \"px\";\n div.style.height = Math.floor(this.viewport.height) + \"px\";\n var childNodes = div.childNodes;\n var currentZoomLayerNode = keepZoomLayer && this.zoomLayer || null;\n var currentAnnotationNode = keepAnnotations && this.annotationLayer && this.annotationLayer.div || null;\n\n for (var i = childNodes.length - 1; i >= 0; i--) {\n var node = childNodes[i];\n\n if (currentZoomLayerNode === node || currentAnnotationNode === node) {\n continue;\n }\n\n div.removeChild(node);\n }\n\n div.removeAttribute(\"data-loaded\");\n\n if (currentAnnotationNode) {\n this.annotationLayer.hide();\n } else if (this.annotationLayer) {\n this.annotationLayer.cancel();\n this.annotationLayer = null;\n }\n\n if (!currentZoomLayerNode) {\n if (this.canvas) {\n this.paintedViewportMap[\"delete\"](this.canvas);\n this.canvas.width = 0;\n this.canvas.height = 0;\n delete this.canvas;\n }\n\n this._resetZoomLayer();\n }\n\n if (this.svg) {\n this.paintedViewportMap[\"delete\"](this.svg);\n delete this.svg;\n }\n\n this.loadingIconDiv = document.createElement(\"div\");\n this.loadingIconDiv.className = \"loadingIcon\";\n div.appendChild(this.loadingIconDiv);\n }\n }, {\n key: \"update\",\n value: function update(scale, rotation) {\n this.scale = scale || this.scale;\n\n if (typeof rotation !== \"undefined\") {\n this.rotation = rotation;\n }\n\n var totalRotation = (this.rotation + this.pdfPageRotate) % 360;\n this.viewport = this.viewport.clone({\n scale: this.scale * _ui_utils.CSS_UNITS,\n rotation: totalRotation\n });\n\n if (this.svg) {\n this.cssTransform(this.svg, true);\n this.eventBus.dispatch(\"pagerendered\", {\n source: this,\n pageNumber: this.id,\n cssTransform: true,\n timestamp: performance.now()\n });\n return;\n }\n\n var isScalingRestricted = false;\n\n if (this.canvas && this.maxCanvasPixels > 0) {\n var outputScale = this.outputScale;\n\n if ((Math.floor(this.viewport.width) * outputScale.sx | 0) * (Math.floor(this.viewport.height) * outputScale.sy | 0) > this.maxCanvasPixels) {\n isScalingRestricted = true;\n }\n }\n\n if (this.canvas) {\n if (this.useOnlyCssZoom || this.hasRestrictedScaling && isScalingRestricted) {\n this.cssTransform(this.canvas, true);\n this.eventBus.dispatch(\"pagerendered\", {\n source: this,\n pageNumber: this.id,\n cssTransform: true,\n timestamp: performance.now()\n });\n return;\n }\n\n if (!this.zoomLayer && !this.canvas.hasAttribute(\"hidden\")) {\n this.zoomLayer = this.canvas.parentNode;\n this.zoomLayer.style.position = \"absolute\";\n }\n }\n\n if (this.zoomLayer) {\n this.cssTransform(this.zoomLayer.firstChild);\n }\n\n this.reset(true, true);\n }\n }, {\n key: \"cancelRendering\",\n value: function cancelRendering() {\n var keepAnnotations = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n\n if (this.paintTask) {\n this.paintTask.cancel();\n this.paintTask = null;\n }\n\n this.resume = null;\n\n if (this.textLayer) {\n this.textLayer.cancel();\n this.textLayer = null;\n }\n\n if (!keepAnnotations && this.annotationLayer) {\n this.annotationLayer.cancel();\n this.annotationLayer = null;\n }\n }\n }, {\n key: \"cssTransform\",\n value: function cssTransform(target) {\n var redrawAnnotations = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n var width = this.viewport.width;\n var height = this.viewport.height;\n var div = this.div;\n target.style.width = target.parentNode.style.width = div.style.width = Math.floor(width) + \"px\";\n target.style.height = target.parentNode.style.height = div.style.height = Math.floor(height) + \"px\";\n var relativeRotation = this.viewport.rotation - this.paintedViewportMap.get(target).rotation;\n var absRotation = Math.abs(relativeRotation);\n var scaleX = 1,\n scaleY = 1;\n\n if (absRotation === 90 || absRotation === 270) {\n scaleX = height / width;\n scaleY = width / height;\n }\n\n var cssTransform = \"rotate(\" + relativeRotation + \"deg) \" + \"scale(\" + scaleX + \",\" + scaleY + \")\";\n target.style.transform = cssTransform;\n\n if (this.textLayer) {\n var textLayerViewport = this.textLayer.viewport;\n var textRelativeRotation = this.viewport.rotation - textLayerViewport.rotation;\n var textAbsRotation = Math.abs(textRelativeRotation);\n var scale = width / textLayerViewport.width;\n\n if (textAbsRotation === 90 || textAbsRotation === 270) {\n scale = width / textLayerViewport.height;\n }\n\n var textLayerDiv = this.textLayer.textLayerDiv;\n var transX, transY;\n\n switch (textAbsRotation) {\n case 0:\n transX = transY = 0;\n break;\n\n case 90:\n transX = 0;\n transY = \"-\" + textLayerDiv.style.height;\n break;\n\n case 180:\n transX = \"-\" + textLayerDiv.style.width;\n transY = \"-\" + textLayerDiv.style.height;\n break;\n\n case 270:\n transX = \"-\" + textLayerDiv.style.width;\n transY = 0;\n break;\n\n default:\n console.error(\"Bad rotation value.\");\n break;\n }\n\n textLayerDiv.style.transform = \"rotate(\" + textAbsRotation + \"deg) \" + \"scale(\" + scale + \", \" + scale + \") \" + \"translate(\" + transX + \", \" + transY + \")\";\n textLayerDiv.style.transformOrigin = \"0% 0%\";\n }\n\n if (redrawAnnotations && this.annotationLayer) {\n this.annotationLayer.render(this.viewport, \"display\");\n }\n }\n }, {\n key: \"getPagePoint\",\n value: function getPagePoint(x, y) {\n return this.viewport.convertToPdfPoint(x, y);\n }\n }, {\n key: \"draw\",\n value: function draw() {\n var _this = this;\n\n if (this.renderingState !== _pdf_rendering_queue.RenderingStates.INITIAL) {\n console.error(\"Must be in new state before drawing\");\n this.reset();\n }\n\n var div = this.div,\n pdfPage = this.pdfPage;\n\n if (!pdfPage) {\n this.renderingState = _pdf_rendering_queue.RenderingStates.FINISHED;\n\n if (this.loadingIconDiv) {\n div.removeChild(this.loadingIconDiv);\n delete this.loadingIconDiv;\n }\n\n return Promise.reject(new Error(\"pdfPage is not loaded\"));\n }\n\n this.renderingState = _pdf_rendering_queue.RenderingStates.RUNNING;\n var canvasWrapper = document.createElement(\"div\");\n canvasWrapper.style.width = div.style.width;\n canvasWrapper.style.height = div.style.height;\n canvasWrapper.classList.add(\"canvasWrapper\");\n\n if (this.annotationLayer && this.annotationLayer.div) {\n div.insertBefore(canvasWrapper, this.annotationLayer.div);\n } else {\n div.appendChild(canvasWrapper);\n }\n\n var textLayer = null;\n\n if (this.textLayerMode !== _ui_utils.TextLayerMode.DISABLE && this.textLayerFactory) {\n var textLayerDiv = document.createElement(\"div\");\n textLayerDiv.className = \"textLayer\";\n textLayerDiv.style.width = canvasWrapper.style.width;\n textLayerDiv.style.height = canvasWrapper.style.height;\n\n if (this.annotationLayer && this.annotationLayer.div) {\n div.insertBefore(textLayerDiv, this.annotationLayer.div);\n } else {\n div.appendChild(textLayerDiv);\n }\n\n textLayer = this.textLayerFactory.createTextLayerBuilder(textLayerDiv, this.id - 1, this.viewport, this.textLayerMode === _ui_utils.TextLayerMode.ENABLE_ENHANCE, this.eventBus);\n }\n\n this.textLayer = textLayer;\n var renderContinueCallback = null;\n\n if (this.renderingQueue) {\n renderContinueCallback = function renderContinueCallback(cont) {\n if (!_this.renderingQueue.isHighestPriority(_this)) {\n _this.renderingState = _pdf_rendering_queue.RenderingStates.PAUSED;\n\n _this.resume = function () {\n _this.renderingState = _pdf_rendering_queue.RenderingStates.RUNNING;\n cont();\n };\n\n return;\n }\n\n cont();\n };\n }\n\n var finishPaintTask = /*#__PURE__*/function () {\n var _ref = _asyncToGenerator( /*#__PURE__*/_regenerator[\"default\"].mark(function _callee(error) {\n return _regenerator[\"default\"].wrap(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n if (paintTask === _this.paintTask) {\n _this.paintTask = null;\n }\n\n if (!(error instanceof _pdfjsLib.RenderingCancelledException)) {\n _context.next = 4;\n break;\n }\n\n _this.error = null;\n return _context.abrupt(\"return\");\n\n case 4:\n _this.renderingState = _pdf_rendering_queue.RenderingStates.FINISHED;\n\n if (_this.loadingIconDiv) {\n div.removeChild(_this.loadingIconDiv);\n delete _this.loadingIconDiv;\n }\n\n _this._resetZoomLayer(true);\n\n _this.error = error;\n _this.stats = pdfPage.stats;\n\n _this.eventBus.dispatch(\"pagerendered\", {\n source: _this,\n pageNumber: _this.id,\n cssTransform: false,\n timestamp: performance.now()\n });\n\n if (!error) {\n _context.next = 12;\n break;\n }\n\n throw error;\n\n case 12:\n case \"end\":\n return _context.stop();\n }\n }\n }, _callee);\n }));\n\n return function finishPaintTask(_x) {\n return _ref.apply(this, arguments);\n };\n }();\n\n var paintTask = this.renderer === _ui_utils.RendererType.SVG ? this.paintOnSvg(canvasWrapper) : this.paintOnCanvas(canvasWrapper);\n paintTask.onRenderContinue = renderContinueCallback;\n this.paintTask = paintTask;\n var resultPromise = paintTask.promise.then(function () {\n return finishPaintTask(null).then(function () {\n if (textLayer) {\n var readableStream = pdfPage.streamTextContent({\n normalizeWhitespace: true\n });\n textLayer.setTextContentStream(readableStream);\n textLayer.render();\n }\n });\n }, function (reason) {\n return finishPaintTask(reason);\n });\n\n if (this.annotationLayerFactory) {\n if (!this.annotationLayer) {\n this.annotationLayer = this.annotationLayerFactory.createAnnotationLayerBuilder(div, pdfPage, this.imageResourcesPath, this.renderInteractiveForms, this.l10n);\n }\n\n this.annotationLayer.render(this.viewport, \"display\");\n }\n\n div.setAttribute(\"data-loaded\", true);\n this.eventBus.dispatch(\"pagerender\", {\n source: this,\n pageNumber: this.id\n });\n return resultPromise;\n }\n }, {\n key: \"paintOnCanvas\",\n value: function paintOnCanvas(canvasWrapper) {\n var renderCapability = (0, _pdfjsLib.createPromiseCapability)();\n var result = {\n promise: renderCapability.promise,\n onRenderContinue: function onRenderContinue(cont) {\n cont();\n },\n cancel: function cancel() {\n renderTask.cancel();\n }\n };\n var viewport = this.viewport;\n var canvas = document.createElement(\"canvas\");\n this.l10n.get(\"page_canvas\", {\n page: this.id\n }, \"Page {{page}}\").then(function (msg) {\n canvas.setAttribute(\"aria-label\", msg);\n });\n canvas.setAttribute(\"hidden\", \"hidden\");\n var isCanvasHidden = true;\n\n var showCanvas = function showCanvas() {\n if (isCanvasHidden) {\n canvas.removeAttribute(\"hidden\");\n isCanvasHidden = false;\n }\n };\n\n canvasWrapper.appendChild(canvas);\n this.canvas = canvas;\n canvas.mozOpaque = true;\n var ctx = canvas.getContext(\"2d\", {\n alpha: false\n });\n var outputScale = (0, _ui_utils.getOutputScale)(ctx);\n this.outputScale = outputScale;\n\n if (this.useOnlyCssZoom) {\n var actualSizeViewport = viewport.clone({\n scale: _ui_utils.CSS_UNITS\n });\n outputScale.sx *= actualSizeViewport.width / viewport.width;\n outputScale.sy *= actualSizeViewport.height / viewport.height;\n outputScale.scaled = true;\n }\n\n if (this.maxCanvasPixels > 0) {\n var pixelsInViewport = viewport.width * viewport.height;\n var maxScale = Math.sqrt(this.maxCanvasPixels / pixelsInViewport);\n\n if (outputScale.sx > maxScale || outputScale.sy > maxScale) {\n outputScale.sx = maxScale;\n outputScale.sy = maxScale;\n outputScale.scaled = true;\n this.hasRestrictedScaling = true;\n } else {\n this.hasRestrictedScaling = false;\n }\n }\n\n var sfx = (0, _ui_utils.approximateFraction)(outputScale.sx);\n var sfy = (0, _ui_utils.approximateFraction)(outputScale.sy);\n canvas.width = (0, _ui_utils.roundToDivide)(viewport.width * outputScale.sx, sfx[0]);\n canvas.height = (0, _ui_utils.roundToDivide)(viewport.height * outputScale.sy, sfy[0]);\n canvas.style.width = (0, _ui_utils.roundToDivide)(viewport.width, sfx[1]) + \"px\";\n canvas.style.height = (0, _ui_utils.roundToDivide)(viewport.height, sfy[1]) + \"px\";\n this.paintedViewportMap.set(canvas, viewport);\n var transform = !outputScale.scaled ? null : [outputScale.sx, 0, 0, outputScale.sy, 0, 0];\n var renderContext = {\n canvasContext: ctx,\n transform: transform,\n viewport: this.viewport,\n enableWebGL: this.enableWebGL,\n renderInteractiveForms: this.renderInteractiveForms\n };\n var renderTask = this.pdfPage.render(renderContext);\n\n renderTask.onContinue = function (cont) {\n showCanvas();\n\n if (result.onRenderContinue) {\n result.onRenderContinue(cont);\n } else {\n cont();\n }\n };\n\n renderTask.promise.then(function () {\n showCanvas();\n renderCapability.resolve(undefined);\n }, function (error) {\n showCanvas();\n renderCapability.reject(error);\n });\n return result;\n }\n }, {\n key: \"paintOnSvg\",\n value: function paintOnSvg(wrapper) {\n var _this2 = this;\n\n var cancelled = false;\n\n var ensureNotCancelled = function ensureNotCancelled() {\n if (cancelled) {\n throw new _pdfjsLib.RenderingCancelledException(\"Rendering cancelled, page \".concat(_this2.id), \"svg\");\n }\n };\n\n var pdfPage = this.pdfPage;\n var actualSizeViewport = this.viewport.clone({\n scale: _ui_utils.CSS_UNITS\n });\n var promise = pdfPage.getOperatorList().then(function (opList) {\n ensureNotCancelled();\n var svgGfx = new _pdfjsLib.SVGGraphics(pdfPage.commonObjs, pdfPage.objs);\n return svgGfx.getSVG(opList, actualSizeViewport).then(function (svg) {\n ensureNotCancelled();\n _this2.svg = svg;\n\n _this2.paintedViewportMap.set(svg, actualSizeViewport);\n\n svg.style.width = wrapper.style.width;\n svg.style.height = wrapper.style.height;\n _this2.renderingState = _pdf_rendering_queue.RenderingStates.FINISHED;\n wrapper.appendChild(svg);\n });\n });\n return {\n promise: promise,\n onRenderContinue: function onRenderContinue(cont) {\n cont();\n },\n cancel: function cancel() {\n cancelled = true;\n }\n };\n }\n }, {\n key: \"setPageLabel\",\n value: function setPageLabel(label) {\n this.pageLabel = typeof label === \"string\" ? label : null;\n\n if (this.pageLabel !== null) {\n this.div.setAttribute(\"data-page-label\", this.pageLabel);\n } else {\n this.div.removeAttribute(\"data-page-label\");\n }\n }\n }, {\n key: \"width\",\n get: function get() {\n return this.viewport.width;\n }\n }, {\n key: \"height\",\n get: function get() {\n return this.viewport.height;\n }\n }]);\n\n return PDFPageView;\n}();\n\nexports.PDFPageView = PDFPageView;\n\n/***/ }),\n/* 17 */\n/***/ (function(module, exports, __w_pdfjs_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.PDFRenderingQueue = exports.RenderingStates = void 0;\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nvar CLEANUP_TIMEOUT = 30000;\nvar RenderingStates = {\n INITIAL: 0,\n RUNNING: 1,\n PAUSED: 2,\n FINISHED: 3\n};\nexports.RenderingStates = RenderingStates;\n\nvar PDFRenderingQueue = /*#__PURE__*/function () {\n function PDFRenderingQueue() {\n _classCallCheck(this, PDFRenderingQueue);\n\n this.pdfViewer = null;\n this.pdfThumbnailViewer = null;\n this.onIdle = null;\n this.highestPriorityPage = null;\n this.idleTimeout = null;\n this.printing = false;\n this.isThumbnailViewEnabled = false;\n }\n\n _createClass(PDFRenderingQueue, [{\n key: \"setViewer\",\n value: function setViewer(pdfViewer) {\n this.pdfViewer = pdfViewer;\n }\n }, {\n key: \"setThumbnailViewer\",\n value: function setThumbnailViewer(pdfThumbnailViewer) {\n this.pdfThumbnailViewer = pdfThumbnailViewer;\n }\n }, {\n key: \"isHighestPriority\",\n value: function isHighestPriority(view) {\n return this.highestPriorityPage === view.renderingId;\n }\n }, {\n key: \"renderHighestPriority\",\n value: function renderHighestPriority(currentlyVisiblePages) {\n if (this.idleTimeout) {\n clearTimeout(this.idleTimeout);\n this.idleTimeout = null;\n }\n\n if (this.pdfViewer.forceRendering(currentlyVisiblePages)) {\n return;\n }\n\n if (this.pdfThumbnailViewer && this.isThumbnailViewEnabled) {\n if (this.pdfThumbnailViewer.forceRendering()) {\n return;\n }\n }\n\n if (this.printing) {\n return;\n }\n\n if (this.onIdle) {\n this.idleTimeout = setTimeout(this.onIdle.bind(this), CLEANUP_TIMEOUT);\n }\n }\n }, {\n key: \"getHighestPriority\",\n value: function getHighestPriority(visible, views, scrolledDown) {\n var visibleViews = visible.views;\n var numVisible = visibleViews.length;\n\n if (numVisible === 0) {\n return null;\n }\n\n for (var i = 0; i < numVisible; ++i) {\n var view = visibleViews[i].view;\n\n if (!this.isViewFinished(view)) {\n return view;\n }\n }\n\n if (scrolledDown) {\n var nextPageIndex = visible.last.id;\n\n if (views[nextPageIndex] && !this.isViewFinished(views[nextPageIndex])) {\n return views[nextPageIndex];\n }\n } else {\n var previousPageIndex = visible.first.id - 2;\n\n if (views[previousPageIndex] && !this.isViewFinished(views[previousPageIndex])) {\n return views[previousPageIndex];\n }\n }\n\n return null;\n }\n }, {\n key: \"isViewFinished\",\n value: function isViewFinished(view) {\n return view.renderingState === RenderingStates.FINISHED;\n }\n }, {\n key: \"renderView\",\n value: function renderView(view) {\n var _this = this;\n\n switch (view.renderingState) {\n case RenderingStates.FINISHED:\n return false;\n\n case RenderingStates.PAUSED:\n this.highestPriorityPage = view.renderingId;\n view.resume();\n break;\n\n case RenderingStates.RUNNING:\n this.highestPriorityPage = view.renderingId;\n break;\n\n case RenderingStates.INITIAL:\n this.highestPriorityPage = view.renderingId;\n view.draw()[\"finally\"](function () {\n _this.renderHighestPriority();\n })[\"catch\"](function (reason) {\n console.error(\"renderView: \\\"\".concat(reason, \"\\\"\"));\n });\n break;\n }\n\n return true;\n }\n }]);\n\n return PDFRenderingQueue;\n}();\n\nexports.PDFRenderingQueue = PDFRenderingQueue;\n\n/***/ }),\n/* 18 */\n/***/ (function(module, exports, __w_pdfjs_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.PDFSinglePageViewer = void 0;\n\nvar _base_viewer = __w_pdfjs_require__(19);\n\nvar _pdfjsLib = __w_pdfjs_require__(2);\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _get(target, property, receiver) { if (typeof Reflect !== \"undefined\" && Reflect.get) { _get = Reflect.get; } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return _get(target, property, receiver || target); }\n\nfunction _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nvar PDFSinglePageViewer = /*#__PURE__*/function (_BaseViewer) {\n _inherits(PDFSinglePageViewer, _BaseViewer);\n\n var _super = _createSuper(PDFSinglePageViewer);\n\n function PDFSinglePageViewer(options) {\n var _this;\n\n _classCallCheck(this, PDFSinglePageViewer);\n\n _this = _super.call(this, options);\n\n _this.eventBus._on(\"pagesinit\", function (evt) {\n _this._ensurePageViewVisible();\n });\n\n return _this;\n }\n\n _createClass(PDFSinglePageViewer, [{\n key: \"_resetView\",\n value: function _resetView() {\n _get(_getPrototypeOf(PDFSinglePageViewer.prototype), \"_resetView\", this).call(this);\n\n this._previousPageNumber = 1;\n this._shadowViewer = document.createDocumentFragment();\n this._updateScrollDown = null;\n }\n }, {\n key: \"_ensurePageViewVisible\",\n value: function _ensurePageViewVisible() {\n var pageView = this._pages[this._currentPageNumber - 1];\n var previousPageView = this._pages[this._previousPageNumber - 1];\n var viewerNodes = this.viewer.childNodes;\n\n switch (viewerNodes.length) {\n case 0:\n this.viewer.appendChild(pageView.div);\n break;\n\n case 1:\n if (viewerNodes[0] !== previousPageView.div) {\n throw new Error(\"_ensurePageViewVisible: Unexpected previously visible page.\");\n }\n\n if (pageView === previousPageView) {\n break;\n }\n\n this._shadowViewer.appendChild(previousPageView.div);\n\n this.viewer.appendChild(pageView.div);\n this.container.scrollTop = 0;\n break;\n\n default:\n throw new Error(\"_ensurePageViewVisible: Only one page should be visible at a time.\");\n }\n\n this._previousPageNumber = this._currentPageNumber;\n }\n }, {\n key: \"_scrollUpdate\",\n value: function _scrollUpdate() {\n if (this._updateScrollDown) {\n this._updateScrollDown();\n }\n\n _get(_getPrototypeOf(PDFSinglePageViewer.prototype), \"_scrollUpdate\", this).call(this);\n }\n }, {\n key: \"_scrollIntoView\",\n value: function _scrollIntoView(_ref) {\n var _this2 = this;\n\n var pageDiv = _ref.pageDiv,\n _ref$pageSpot = _ref.pageSpot,\n pageSpot = _ref$pageSpot === void 0 ? null : _ref$pageSpot,\n _ref$pageNumber = _ref.pageNumber,\n pageNumber = _ref$pageNumber === void 0 ? null : _ref$pageNumber;\n\n if (pageNumber) {\n this._setCurrentPageNumber(pageNumber);\n }\n\n var scrolledDown = this._currentPageNumber >= this._previousPageNumber;\n\n this._ensurePageViewVisible();\n\n this.update();\n\n _get(_getPrototypeOf(PDFSinglePageViewer.prototype), \"_scrollIntoView\", this).call(this, {\n pageDiv: pageDiv,\n pageSpot: pageSpot,\n pageNumber: pageNumber\n });\n\n this._updateScrollDown = function () {\n _this2.scroll.down = scrolledDown;\n _this2._updateScrollDown = null;\n };\n }\n }, {\n key: \"_getVisiblePages\",\n value: function _getVisiblePages() {\n return this._getCurrentVisiblePage();\n }\n }, {\n key: \"_updateHelper\",\n value: function _updateHelper(visiblePages) {}\n }, {\n key: \"_updateScrollMode\",\n value: function _updateScrollMode() {}\n }, {\n key: \"_updateSpreadMode\",\n value: function _updateSpreadMode() {}\n }, {\n key: \"_viewerElement\",\n get: function get() {\n return (0, _pdfjsLib.shadow)(this, \"_viewerElement\", this._shadowViewer);\n }\n }, {\n key: \"_isScrollModeHorizontal\",\n get: function get() {\n return (0, _pdfjsLib.shadow)(this, \"_isScrollModeHorizontal\", false);\n }\n }]);\n\n return PDFSinglePageViewer;\n}(_base_viewer.BaseViewer);\n\nexports.PDFSinglePageViewer = PDFSinglePageViewer;\n\n/***/ }),\n/* 19 */\n/***/ (function(module, exports, __w_pdfjs_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.BaseViewer = void 0;\n\nvar _ui_utils = __w_pdfjs_require__(3);\n\nvar _pdf_rendering_queue = __w_pdfjs_require__(17);\n\nvar _annotation_layer_builder = __w_pdfjs_require__(1);\n\nvar _pdfjsLib = __w_pdfjs_require__(2);\n\nvar _pdf_page_view = __w_pdfjs_require__(16);\n\nvar _pdf_link_service = __w_pdfjs_require__(7);\n\nvar _text_layer_builder = __w_pdfjs_require__(8);\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nvar DEFAULT_CACHE_SIZE = 10;\n\nfunction PDFPageViewBuffer(size) {\n var data = [];\n\n this.push = function (view) {\n var i = data.indexOf(view);\n\n if (i >= 0) {\n data.splice(i, 1);\n }\n\n data.push(view);\n\n if (data.length > size) {\n data.shift().destroy();\n }\n };\n\n this.resize = function (newSize, pagesToKeep) {\n size = newSize;\n\n if (pagesToKeep) {\n var pageIdsToKeep = new Set();\n\n for (var i = 0, iMax = pagesToKeep.length; i < iMax; ++i) {\n pageIdsToKeep.add(pagesToKeep[i].id);\n }\n\n (0, _ui_utils.moveToEndOfArray)(data, function (page) {\n return pageIdsToKeep.has(page.id);\n });\n }\n\n while (data.length > size) {\n data.shift().destroy();\n }\n };\n}\n\nfunction isSameScale(oldScale, newScale) {\n if (newScale === oldScale) {\n return true;\n }\n\n if (Math.abs(newScale - oldScale) < 1e-15) {\n return true;\n }\n\n return false;\n}\n\nvar BaseViewer = /*#__PURE__*/function () {\n function BaseViewer(options) {\n var _this = this;\n\n _classCallCheck(this, BaseViewer);\n\n if (this.constructor === BaseViewer) {\n throw new Error(\"Cannot initialize BaseViewer.\");\n }\n\n this._name = this.constructor.name;\n this.container = options.container;\n this.viewer = options.viewer || options.container.firstElementChild;\n this.eventBus = options.eventBus;\n this.linkService = options.linkService || new _pdf_link_service.SimpleLinkService();\n this.downloadManager = options.downloadManager || null;\n this.findController = options.findController || null;\n this.removePageBorders = options.removePageBorders || false;\n this.textLayerMode = Number.isInteger(options.textLayerMode) ? options.textLayerMode : _ui_utils.TextLayerMode.ENABLE;\n this.imageResourcesPath = options.imageResourcesPath || \"\";\n this.renderInteractiveForms = options.renderInteractiveForms || false;\n this.enablePrintAutoRotate = options.enablePrintAutoRotate || false;\n this.renderer = options.renderer || _ui_utils.RendererType.CANVAS;\n this.enableWebGL = options.enableWebGL || false;\n this.useOnlyCssZoom = options.useOnlyCssZoom || false;\n this.maxCanvasPixels = options.maxCanvasPixels;\n this.l10n = options.l10n || _ui_utils.NullL10n;\n this.defaultRenderingQueue = !options.renderingQueue;\n\n if (this.defaultRenderingQueue) {\n this.renderingQueue = new _pdf_rendering_queue.PDFRenderingQueue();\n this.renderingQueue.setViewer(this);\n } else {\n this.renderingQueue = options.renderingQueue;\n }\n\n this.scroll = (0, _ui_utils.watchScroll)(this.container, this._scrollUpdate.bind(this));\n this.presentationModeState = _ui_utils.PresentationModeState.UNKNOWN;\n this._onBeforeDraw = this._onAfterDraw = null;\n\n this._resetView();\n\n if (this.removePageBorders) {\n this.viewer.classList.add(\"removePageBorders\");\n }\n\n Promise.resolve().then(function () {\n _this.eventBus.dispatch(\"baseviewerinit\", {\n source: _this\n });\n });\n }\n\n _createClass(BaseViewer, [{\n key: \"getPageView\",\n value: function getPageView(index) {\n return this._pages[index];\n }\n }, {\n key: \"_setCurrentPageNumber\",\n value: function _setCurrentPageNumber(val) {\n var resetCurrentPageView = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n\n if (this._currentPageNumber === val) {\n if (resetCurrentPageView) {\n this._resetCurrentPageView();\n }\n\n return true;\n }\n\n if (!(0 < val && val <= this.pagesCount)) {\n return false;\n }\n\n this._currentPageNumber = val;\n this.eventBus.dispatch(\"pagechanging\", {\n source: this,\n pageNumber: val,\n pageLabel: this._pageLabels && this._pageLabels[val - 1]\n });\n\n if (resetCurrentPageView) {\n this._resetCurrentPageView();\n }\n\n return true;\n }\n }, {\n key: \"_onePageRenderedOrForceFetch\",\n value: function _onePageRenderedOrForceFetch() {\n if (!this.container.offsetParent || this._getVisiblePages().views.length === 0) {\n return Promise.resolve();\n }\n\n return this._onePageRenderedCapability.promise;\n }\n }, {\n key: \"setDocument\",\n value: function setDocument(pdfDocument) {\n var _this2 = this;\n\n if (this.pdfDocument) {\n this._cancelRendering();\n\n this._resetView();\n\n if (this.findController) {\n this.findController.setDocument(null);\n }\n }\n\n this.pdfDocument = pdfDocument;\n\n if (!pdfDocument) {\n return;\n }\n\n var pagesCount = pdfDocument.numPages;\n var firstPagePromise = pdfDocument.getPage(1);\n\n this._pagesCapability.promise.then(function () {\n _this2.eventBus.dispatch(\"pagesloaded\", {\n source: _this2,\n pagesCount: pagesCount\n });\n });\n\n this._onBeforeDraw = function (evt) {\n var pageView = _this2._pages[evt.pageNumber - 1];\n\n if (!pageView) {\n return;\n }\n\n _this2._buffer.push(pageView);\n };\n\n this.eventBus._on(\"pagerender\", this._onBeforeDraw);\n\n this._onAfterDraw = function (evt) {\n if (evt.cssTransform || _this2._onePageRenderedCapability.settled) {\n return;\n }\n\n _this2._onePageRenderedCapability.resolve();\n\n _this2.eventBus._off(\"pagerendered\", _this2._onAfterDraw);\n\n _this2._onAfterDraw = null;\n };\n\n this.eventBus._on(\"pagerendered\", this._onAfterDraw);\n\n firstPagePromise.then(function (firstPdfPage) {\n _this2._firstPageCapability.resolve(firstPdfPage);\n\n var scale = _this2.currentScale;\n var viewport = firstPdfPage.getViewport({\n scale: scale * _ui_utils.CSS_UNITS\n });\n var textLayerFactory = _this2.textLayerMode !== _ui_utils.TextLayerMode.DISABLE ? _this2 : null;\n\n for (var pageNum = 1; pageNum <= pagesCount; ++pageNum) {\n var pageView = new _pdf_page_view.PDFPageView({\n container: _this2._viewerElement,\n eventBus: _this2.eventBus,\n id: pageNum,\n scale: scale,\n defaultViewport: viewport.clone(),\n renderingQueue: _this2.renderingQueue,\n textLayerFactory: textLayerFactory,\n textLayerMode: _this2.textLayerMode,\n annotationLayerFactory: _this2,\n imageResourcesPath: _this2.imageResourcesPath,\n renderInteractiveForms: _this2.renderInteractiveForms,\n renderer: _this2.renderer,\n enableWebGL: _this2.enableWebGL,\n useOnlyCssZoom: _this2.useOnlyCssZoom,\n maxCanvasPixels: _this2.maxCanvasPixels,\n l10n: _this2.l10n\n });\n\n _this2._pages.push(pageView);\n }\n\n var firstPageView = _this2._pages[0];\n\n if (firstPageView) {\n firstPageView.setPdfPage(firstPdfPage);\n\n _this2.linkService.cachePageRef(1, firstPdfPage.ref);\n }\n\n if (_this2._spreadMode !== _ui_utils.SpreadMode.NONE) {\n _this2._updateSpreadMode();\n }\n\n _this2._onePageRenderedOrForceFetch().then(function () {\n if (_this2.findController) {\n _this2.findController.setDocument(pdfDocument);\n }\n\n if (pdfDocument.loadingParams.disableAutoFetch || pagesCount > 7500) {\n _this2._pagesCapability.resolve();\n\n return;\n }\n\n var getPagesLeft = pagesCount - 1;\n\n if (getPagesLeft <= 0) {\n _this2._pagesCapability.resolve();\n\n return;\n }\n\n var _loop = function _loop(_pageNum) {\n pdfDocument.getPage(_pageNum).then(function (pdfPage) {\n var pageView = _this2._pages[_pageNum - 1];\n\n if (!pageView.pdfPage) {\n pageView.setPdfPage(pdfPage);\n }\n\n _this2.linkService.cachePageRef(_pageNum, pdfPage.ref);\n\n if (--getPagesLeft === 0) {\n _this2._pagesCapability.resolve();\n }\n }, function (reason) {\n console.error(\"Unable to get page \".concat(_pageNum, \" to initialize viewer\"), reason);\n\n if (--getPagesLeft === 0) {\n _this2._pagesCapability.resolve();\n }\n });\n };\n\n for (var _pageNum = 2; _pageNum <= pagesCount; ++_pageNum) {\n _loop(_pageNum);\n }\n });\n\n _this2.eventBus.dispatch(\"pagesinit\", {\n source: _this2\n });\n\n if (_this2.defaultRenderingQueue) {\n _this2.update();\n }\n })[\"catch\"](function (reason) {\n console.error(\"Unable to initialize viewer\", reason);\n });\n }\n }, {\n key: \"setPageLabels\",\n value: function setPageLabels(labels) {\n if (!this.pdfDocument) {\n return;\n }\n\n if (!labels) {\n this._pageLabels = null;\n } else if (!(Array.isArray(labels) && this.pdfDocument.numPages === labels.length)) {\n this._pageLabels = null;\n console.error(\"\".concat(this._name, \".setPageLabels: Invalid page labels.\"));\n } else {\n this._pageLabels = labels;\n }\n\n for (var i = 0, ii = this._pages.length; i < ii; i++) {\n var pageView = this._pages[i];\n var label = this._pageLabels && this._pageLabels[i];\n pageView.setPageLabel(label);\n }\n }\n }, {\n key: \"_resetView\",\n value: function _resetView() {\n this._pages = [];\n this._currentPageNumber = 1;\n this._currentScale = _ui_utils.UNKNOWN_SCALE;\n this._currentScaleValue = null;\n this._pageLabels = null;\n this._buffer = new PDFPageViewBuffer(DEFAULT_CACHE_SIZE);\n this._location = null;\n this._pagesRotation = 0;\n this._pagesRequests = new WeakMap();\n this._firstPageCapability = (0, _pdfjsLib.createPromiseCapability)();\n this._onePageRenderedCapability = (0, _pdfjsLib.createPromiseCapability)();\n this._pagesCapability = (0, _pdfjsLib.createPromiseCapability)();\n this._scrollMode = _ui_utils.ScrollMode.VERTICAL;\n this._spreadMode = _ui_utils.SpreadMode.NONE;\n\n if (this._onBeforeDraw) {\n this.eventBus._off(\"pagerender\", this._onBeforeDraw);\n\n this._onBeforeDraw = null;\n }\n\n if (this._onAfterDraw) {\n this.eventBus._off(\"pagerendered\", this._onAfterDraw);\n\n this._onAfterDraw = null;\n }\n\n this.viewer.textContent = \"\";\n\n this._updateScrollMode();\n }\n }, {\n key: \"_scrollUpdate\",\n value: function _scrollUpdate() {\n if (this.pagesCount === 0) {\n return;\n }\n\n this.update();\n }\n }, {\n key: \"_scrollIntoView\",\n value: function _scrollIntoView(_ref) {\n var pageDiv = _ref.pageDiv,\n _ref$pageSpot = _ref.pageSpot,\n pageSpot = _ref$pageSpot === void 0 ? null : _ref$pageSpot,\n _ref$pageNumber = _ref.pageNumber,\n pageNumber = _ref$pageNumber === void 0 ? null : _ref$pageNumber;\n (0, _ui_utils.scrollIntoView)(pageDiv, pageSpot);\n }\n }, {\n key: \"_setScaleUpdatePages\",\n value: function _setScaleUpdatePages(newScale, newValue) {\n var noScroll = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n var preset = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;\n this._currentScaleValue = newValue.toString();\n\n if (isSameScale(this._currentScale, newScale)) {\n if (preset) {\n this.eventBus.dispatch(\"scalechanging\", {\n source: this,\n scale: newScale,\n presetValue: newValue\n });\n }\n\n return;\n }\n\n for (var i = 0, ii = this._pages.length; i < ii; i++) {\n this._pages[i].update(newScale);\n }\n\n this._currentScale = newScale;\n\n if (!noScroll) {\n var page = this._currentPageNumber,\n dest;\n\n if (this._location && !(this.isInPresentationMode || this.isChangingPresentationMode)) {\n page = this._location.pageNumber;\n dest = [null, {\n name: \"XYZ\"\n }, this._location.left, this._location.top, null];\n }\n\n this.scrollPageIntoView({\n pageNumber: page,\n destArray: dest,\n allowNegativeOffset: true\n });\n }\n\n this.eventBus.dispatch(\"scalechanging\", {\n source: this,\n scale: newScale,\n presetValue: preset ? newValue : undefined\n });\n\n if (this.defaultRenderingQueue) {\n this.update();\n }\n }\n }, {\n key: \"_setScale\",\n value: function _setScale(value) {\n var noScroll = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n var scale = parseFloat(value);\n\n if (scale > 0) {\n this._setScaleUpdatePages(scale, value, noScroll, false);\n } else {\n var currentPage = this._pages[this._currentPageNumber - 1];\n\n if (!currentPage) {\n return;\n }\n\n var noPadding = this.isInPresentationMode || this.removePageBorders;\n var hPadding = noPadding ? 0 : _ui_utils.SCROLLBAR_PADDING;\n var vPadding = noPadding ? 0 : _ui_utils.VERTICAL_PADDING;\n\n if (!noPadding && this._isScrollModeHorizontal) {\n var _ref2 = [vPadding, hPadding];\n hPadding = _ref2[0];\n vPadding = _ref2[1];\n }\n\n var pageWidthScale = (this.container.clientWidth - hPadding) / currentPage.width * currentPage.scale;\n var pageHeightScale = (this.container.clientHeight - vPadding) / currentPage.height * currentPage.scale;\n\n switch (value) {\n case \"page-actual\":\n scale = 1;\n break;\n\n case \"page-width\":\n scale = pageWidthScale;\n break;\n\n case \"page-height\":\n scale = pageHeightScale;\n break;\n\n case \"page-fit\":\n scale = Math.min(pageWidthScale, pageHeightScale);\n break;\n\n case \"auto\":\n var horizontalScale = (0, _ui_utils.isPortraitOrientation)(currentPage) ? pageWidthScale : Math.min(pageHeightScale, pageWidthScale);\n scale = Math.min(_ui_utils.MAX_AUTO_SCALE, horizontalScale);\n break;\n\n default:\n console.error(\"\".concat(this._name, \"._setScale: \\\"\").concat(value, \"\\\" is an unknown zoom value.\"));\n return;\n }\n\n this._setScaleUpdatePages(scale, value, noScroll, true);\n }\n }\n }, {\n key: \"_resetCurrentPageView\",\n value: function _resetCurrentPageView() {\n if (this.isInPresentationMode) {\n this._setScale(this._currentScaleValue, true);\n }\n\n var pageView = this._pages[this._currentPageNumber - 1];\n\n this._scrollIntoView({\n pageDiv: pageView.div\n });\n }\n }, {\n key: \"scrollPageIntoView\",\n value: function scrollPageIntoView(_ref3) {\n var pageNumber = _ref3.pageNumber,\n _ref3$destArray = _ref3.destArray,\n destArray = _ref3$destArray === void 0 ? null : _ref3$destArray,\n _ref3$allowNegativeOf = _ref3.allowNegativeOffset,\n allowNegativeOffset = _ref3$allowNegativeOf === void 0 ? false : _ref3$allowNegativeOf,\n _ref3$ignoreDestinati = _ref3.ignoreDestinationZoom,\n ignoreDestinationZoom = _ref3$ignoreDestinati === void 0 ? false : _ref3$ignoreDestinati;\n\n if (!this.pdfDocument) {\n return;\n }\n\n var pageView = Number.isInteger(pageNumber) && this._pages[pageNumber - 1];\n\n if (!pageView) {\n console.error(\"\".concat(this._name, \".scrollPageIntoView: \") + \"\\\"\".concat(pageNumber, \"\\\" is not a valid pageNumber parameter.\"));\n return;\n }\n\n if (this.isInPresentationMode || !destArray) {\n this._setCurrentPageNumber(pageNumber, true);\n\n return;\n }\n\n var x = 0,\n y = 0;\n var width = 0,\n height = 0,\n widthScale,\n heightScale;\n var changeOrientation = pageView.rotation % 180 !== 0;\n var pageWidth = (changeOrientation ? pageView.height : pageView.width) / pageView.scale / _ui_utils.CSS_UNITS;\n var pageHeight = (changeOrientation ? pageView.width : pageView.height) / pageView.scale / _ui_utils.CSS_UNITS;\n var scale = 0;\n\n switch (destArray[1].name) {\n case \"XYZ\":\n x = destArray[2];\n y = destArray[3];\n scale = destArray[4];\n x = x !== null ? x : 0;\n y = y !== null ? y : pageHeight;\n break;\n\n case \"Fit\":\n case \"FitB\":\n scale = \"page-fit\";\n break;\n\n case \"FitH\":\n case \"FitBH\":\n y = destArray[2];\n scale = \"page-width\";\n\n if (y === null && this._location) {\n x = this._location.left;\n y = this._location.top;\n }\n\n break;\n\n case \"FitV\":\n case \"FitBV\":\n x = destArray[2];\n width = pageWidth;\n height = pageHeight;\n scale = \"page-height\";\n break;\n\n case \"FitR\":\n x = destArray[2];\n y = destArray[3];\n width = destArray[4] - x;\n height = destArray[5] - y;\n var hPadding = this.removePageBorders ? 0 : _ui_utils.SCROLLBAR_PADDING;\n var vPadding = this.removePageBorders ? 0 : _ui_utils.VERTICAL_PADDING;\n widthScale = (this.container.clientWidth - hPadding) / width / _ui_utils.CSS_UNITS;\n heightScale = (this.container.clientHeight - vPadding) / height / _ui_utils.CSS_UNITS;\n scale = Math.min(Math.abs(widthScale), Math.abs(heightScale));\n break;\n\n default:\n console.error(\"\".concat(this._name, \".scrollPageIntoView: \") + \"\\\"\".concat(destArray[1].name, \"\\\" is not a valid destination type.\"));\n return;\n }\n\n if (!ignoreDestinationZoom) {\n if (scale && scale !== this._currentScale) {\n this.currentScaleValue = scale;\n } else if (this._currentScale === _ui_utils.UNKNOWN_SCALE) {\n this.currentScaleValue = _ui_utils.DEFAULT_SCALE_VALUE;\n }\n }\n\n if (scale === \"page-fit\" && !destArray[4]) {\n this._scrollIntoView({\n pageDiv: pageView.div,\n pageNumber: pageNumber\n });\n\n return;\n }\n\n var boundingRect = [pageView.viewport.convertToViewportPoint(x, y), pageView.viewport.convertToViewportPoint(x + width, y + height)];\n var left = Math.min(boundingRect[0][0], boundingRect[1][0]);\n var top = Math.min(boundingRect[0][1], boundingRect[1][1]);\n\n if (!allowNegativeOffset) {\n left = Math.max(left, 0);\n top = Math.max(top, 0);\n }\n\n this._scrollIntoView({\n pageDiv: pageView.div,\n pageSpot: {\n left: left,\n top: top\n },\n pageNumber: pageNumber\n });\n }\n }, {\n key: \"_updateLocation\",\n value: function _updateLocation(firstPage) {\n var currentScale = this._currentScale;\n var currentScaleValue = this._currentScaleValue;\n var normalizedScaleValue = parseFloat(currentScaleValue) === currentScale ? Math.round(currentScale * 10000) / 100 : currentScaleValue;\n var pageNumber = firstPage.id;\n var pdfOpenParams = \"#page=\" + pageNumber;\n pdfOpenParams += \"&zoom=\" + normalizedScaleValue;\n var currentPageView = this._pages[pageNumber - 1];\n var container = this.container;\n var topLeft = currentPageView.getPagePoint(container.scrollLeft - firstPage.x, container.scrollTop - firstPage.y);\n var intLeft = Math.round(topLeft[0]);\n var intTop = Math.round(topLeft[1]);\n pdfOpenParams += \",\" + intLeft + \",\" + intTop;\n this._location = {\n pageNumber: pageNumber,\n scale: normalizedScaleValue,\n top: intTop,\n left: intLeft,\n rotation: this._pagesRotation,\n pdfOpenParams: pdfOpenParams\n };\n }\n }, {\n key: \"_updateHelper\",\n value: function _updateHelper(visiblePages) {\n throw new Error(\"Not implemented: _updateHelper\");\n }\n }, {\n key: \"update\",\n value: function update() {\n var visible = this._getVisiblePages();\n\n var visiblePages = visible.views,\n numVisiblePages = visiblePages.length;\n\n if (numVisiblePages === 0) {\n return;\n }\n\n var newCacheSize = Math.max(DEFAULT_CACHE_SIZE, 2 * numVisiblePages + 1);\n\n this._buffer.resize(newCacheSize, visiblePages);\n\n this.renderingQueue.renderHighestPriority(visible);\n\n this._updateHelper(visiblePages);\n\n this._updateLocation(visible.first);\n\n this.eventBus.dispatch(\"updateviewarea\", {\n source: this,\n location: this._location\n });\n }\n }, {\n key: \"containsElement\",\n value: function containsElement(element) {\n return this.container.contains(element);\n }\n }, {\n key: \"focus\",\n value: function focus() {\n this.container.focus();\n }\n }, {\n key: \"_getCurrentVisiblePage\",\n value: function _getCurrentVisiblePage() {\n if (!this.pagesCount) {\n return {\n views: []\n };\n }\n\n var pageView = this._pages[this._currentPageNumber - 1];\n var element = pageView.div;\n var view = {\n id: pageView.id,\n x: element.offsetLeft + element.clientLeft,\n y: element.offsetTop + element.clientTop,\n view: pageView\n };\n return {\n first: view,\n last: view,\n views: [view]\n };\n }\n }, {\n key: \"_getVisiblePages\",\n value: function _getVisiblePages() {\n return (0, _ui_utils.getVisibleElements)(this.container, this._pages, true, this._isScrollModeHorizontal);\n }\n }, {\n key: \"isPageVisible\",\n value: function isPageVisible(pageNumber) {\n if (!this.pdfDocument) {\n return false;\n }\n\n if (pageNumber < 1 || pageNumber > this.pagesCount) {\n console.error(\"\".concat(this._name, \".isPageVisible: \\\"\").concat(pageNumber, \"\\\" is out of bounds.\"));\n return false;\n }\n\n return this._getVisiblePages().views.some(function (view) {\n return view.id === pageNumber;\n });\n }\n }, {\n key: \"cleanup\",\n value: function cleanup() {\n for (var i = 0, ii = this._pages.length; i < ii; i++) {\n if (this._pages[i] && this._pages[i].renderingState !== _pdf_rendering_queue.RenderingStates.FINISHED) {\n this._pages[i].reset();\n }\n }\n }\n }, {\n key: \"_cancelRendering\",\n value: function _cancelRendering() {\n for (var i = 0, ii = this._pages.length; i < ii; i++) {\n if (this._pages[i]) {\n this._pages[i].cancelRendering();\n }\n }\n }\n }, {\n key: \"_ensurePdfPageLoaded\",\n value: function _ensurePdfPageLoaded(pageView) {\n var _this3 = this;\n\n if (pageView.pdfPage) {\n return Promise.resolve(pageView.pdfPage);\n }\n\n if (this._pagesRequests.has(pageView)) {\n return this._pagesRequests.get(pageView);\n }\n\n var promise = this.pdfDocument.getPage(pageView.id).then(function (pdfPage) {\n if (!pageView.pdfPage) {\n pageView.setPdfPage(pdfPage);\n }\n\n _this3._pagesRequests[\"delete\"](pageView);\n\n return pdfPage;\n })[\"catch\"](function (reason) {\n console.error(\"Unable to get page for page view\", reason);\n\n _this3._pagesRequests[\"delete\"](pageView);\n });\n\n this._pagesRequests.set(pageView, promise);\n\n return promise;\n }\n }, {\n key: \"forceRendering\",\n value: function forceRendering(currentlyVisiblePages) {\n var _this4 = this;\n\n var visiblePages = currentlyVisiblePages || this._getVisiblePages();\n\n var scrollAhead = this._isScrollModeHorizontal ? this.scroll.right : this.scroll.down;\n var pageView = this.renderingQueue.getHighestPriority(visiblePages, this._pages, scrollAhead);\n\n if (pageView) {\n this._ensurePdfPageLoaded(pageView).then(function () {\n _this4.renderingQueue.renderView(pageView);\n });\n\n return true;\n }\n\n return false;\n }\n }, {\n key: \"createTextLayerBuilder\",\n value: function createTextLayerBuilder(textLayerDiv, pageIndex, viewport) {\n var enhanceTextSelection = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;\n var eventBus = arguments.length > 4 ? arguments[4] : undefined;\n return new _text_layer_builder.TextLayerBuilder({\n textLayerDiv: textLayerDiv,\n eventBus: eventBus,\n pageIndex: pageIndex,\n viewport: viewport,\n findController: this.isInPresentationMode ? null : this.findController,\n enhanceTextSelection: this.isInPresentationMode ? false : enhanceTextSelection\n });\n }\n }, {\n key: \"createAnnotationLayerBuilder\",\n value: function createAnnotationLayerBuilder(pageDiv, pdfPage) {\n var imageResourcesPath = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : \"\";\n var renderInteractiveForms = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;\n var l10n = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : _ui_utils.NullL10n;\n return new _annotation_layer_builder.AnnotationLayerBuilder({\n pageDiv: pageDiv,\n pdfPage: pdfPage,\n imageResourcesPath: imageResourcesPath,\n renderInteractiveForms: renderInteractiveForms,\n linkService: this.linkService,\n downloadManager: this.downloadManager,\n l10n: l10n\n });\n }\n }, {\n key: \"getPagesOverview\",\n value: function getPagesOverview() {\n var pagesOverview = this._pages.map(function (pageView) {\n var viewport = pageView.pdfPage.getViewport({\n scale: 1\n });\n return {\n width: viewport.width,\n height: viewport.height,\n rotation: viewport.rotation\n };\n });\n\n if (!this.enablePrintAutoRotate) {\n return pagesOverview;\n }\n\n var isFirstPagePortrait = (0, _ui_utils.isPortraitOrientation)(pagesOverview[0]);\n return pagesOverview.map(function (size) {\n if (isFirstPagePortrait === (0, _ui_utils.isPortraitOrientation)(size)) {\n return size;\n }\n\n return {\n width: size.height,\n height: size.width,\n rotation: (size.rotation + 90) % 360\n };\n });\n }\n }, {\n key: \"_updateScrollMode\",\n value: function _updateScrollMode() {\n var pageNumber = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;\n var scrollMode = this._scrollMode,\n viewer = this.viewer;\n viewer.classList.toggle(\"scrollHorizontal\", scrollMode === _ui_utils.ScrollMode.HORIZONTAL);\n viewer.classList.toggle(\"scrollWrapped\", scrollMode === _ui_utils.ScrollMode.WRAPPED);\n\n if (!this.pdfDocument || !pageNumber) {\n return;\n }\n\n if (this._currentScaleValue && isNaN(this._currentScaleValue)) {\n this._setScale(this._currentScaleValue, true);\n }\n\n this._setCurrentPageNumber(pageNumber, true);\n\n this.update();\n }\n }, {\n key: \"_updateSpreadMode\",\n value: function _updateSpreadMode() {\n var pageNumber = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;\n\n if (!this.pdfDocument) {\n return;\n }\n\n var viewer = this.viewer,\n pages = this._pages;\n viewer.textContent = \"\";\n\n if (this._spreadMode === _ui_utils.SpreadMode.NONE) {\n for (var i = 0, iMax = pages.length; i < iMax; ++i) {\n viewer.appendChild(pages[i].div);\n }\n } else {\n var parity = this._spreadMode - 1;\n var spread = null;\n\n for (var _i = 0, _iMax = pages.length; _i < _iMax; ++_i) {\n if (spread === null) {\n spread = document.createElement(\"div\");\n spread.className = \"spread\";\n viewer.appendChild(spread);\n } else if (_i % 2 === parity) {\n spread = spread.cloneNode(false);\n viewer.appendChild(spread);\n }\n\n spread.appendChild(pages[_i].div);\n }\n }\n\n if (!pageNumber) {\n return;\n }\n\n this._setCurrentPageNumber(pageNumber, true);\n\n this.update();\n }\n }, {\n key: \"pagesCount\",\n get: function get() {\n return this._pages.length;\n }\n }, {\n key: \"pageViewsReady\",\n get: function get() {\n if (!this._pagesCapability.settled) {\n return false;\n }\n\n return this._pages.every(function (pageView) {\n return pageView && pageView.pdfPage;\n });\n }\n }, {\n key: \"currentPageNumber\",\n get: function get() {\n return this._currentPageNumber;\n },\n set: function set(val) {\n if (!Number.isInteger(val)) {\n throw new Error(\"Invalid page number.\");\n }\n\n if (!this.pdfDocument) {\n return;\n }\n\n if (!this._setCurrentPageNumber(val, true)) {\n console.error(\"\".concat(this._name, \".currentPageNumber: \\\"\").concat(val, \"\\\" is not a valid page.\"));\n }\n }\n }, {\n key: \"currentPageLabel\",\n get: function get() {\n return this._pageLabels && this._pageLabels[this._currentPageNumber - 1];\n },\n set: function set(val) {\n if (!this.pdfDocument) {\n return;\n }\n\n var page = val | 0;\n\n if (this._pageLabels) {\n var i = this._pageLabels.indexOf(val);\n\n if (i >= 0) {\n page = i + 1;\n }\n }\n\n if (!this._setCurrentPageNumber(page, true)) {\n console.error(\"\".concat(this._name, \".currentPageLabel: \\\"\").concat(val, \"\\\" is not a valid page.\"));\n }\n }\n }, {\n key: \"currentScale\",\n get: function get() {\n return this._currentScale !== _ui_utils.UNKNOWN_SCALE ? this._currentScale : _ui_utils.DEFAULT_SCALE;\n },\n set: function set(val) {\n if (isNaN(val)) {\n throw new Error(\"Invalid numeric scale.\");\n }\n\n if (!this.pdfDocument) {\n return;\n }\n\n this._setScale(val, false);\n }\n }, {\n key: \"currentScaleValue\",\n get: function get() {\n return this._currentScaleValue;\n },\n set: function set(val) {\n if (!this.pdfDocument) {\n return;\n }\n\n this._setScale(val, false);\n }\n }, {\n key: \"pagesRotation\",\n get: function get() {\n return this._pagesRotation;\n },\n set: function set(rotation) {\n if (!(0, _ui_utils.isValidRotation)(rotation)) {\n throw new Error(\"Invalid pages rotation angle.\");\n }\n\n if (!this.pdfDocument) {\n return;\n }\n\n if (this._pagesRotation === rotation) {\n return;\n }\n\n this._pagesRotation = rotation;\n var pageNumber = this._currentPageNumber;\n\n for (var i = 0, ii = this._pages.length; i < ii; i++) {\n var pageView = this._pages[i];\n pageView.update(pageView.scale, rotation);\n }\n\n if (this._currentScaleValue) {\n this._setScale(this._currentScaleValue, true);\n }\n\n this.eventBus.dispatch(\"rotationchanging\", {\n source: this,\n pagesRotation: rotation,\n pageNumber: pageNumber\n });\n\n if (this.defaultRenderingQueue) {\n this.update();\n }\n }\n }, {\n key: \"firstPagePromise\",\n get: function get() {\n return this.pdfDocument ? this._firstPageCapability.promise : null;\n }\n }, {\n key: \"onePageRendered\",\n get: function get() {\n return this.pdfDocument ? this._onePageRenderedCapability.promise : null;\n }\n }, {\n key: \"pagesPromise\",\n get: function get() {\n return this.pdfDocument ? this._pagesCapability.promise : null;\n }\n }, {\n key: \"_viewerElement\",\n get: function get() {\n throw new Error(\"Not implemented: _viewerElement\");\n }\n }, {\n key: \"_isScrollModeHorizontal\",\n get: function get() {\n return this.isInPresentationMode ? false : this._scrollMode === _ui_utils.ScrollMode.HORIZONTAL;\n }\n }, {\n key: \"isInPresentationMode\",\n get: function get() {\n return this.presentationModeState === _ui_utils.PresentationModeState.FULLSCREEN;\n }\n }, {\n key: \"isChangingPresentationMode\",\n get: function get() {\n return this.presentationModeState === _ui_utils.PresentationModeState.CHANGING;\n }\n }, {\n key: \"isHorizontalScrollbarEnabled\",\n get: function get() {\n return this.isInPresentationMode ? false : this.container.scrollWidth > this.container.clientWidth;\n }\n }, {\n key: \"isVerticalScrollbarEnabled\",\n get: function get() {\n return this.isInPresentationMode ? false : this.container.scrollHeight > this.container.clientHeight;\n }\n }, {\n key: \"hasEqualPageSizes\",\n get: function get() {\n var firstPageView = this._pages[0];\n\n for (var i = 1, ii = this._pages.length; i < ii; ++i) {\n var pageView = this._pages[i];\n\n if (pageView.width !== firstPageView.width || pageView.height !== firstPageView.height) {\n return false;\n }\n }\n\n return true;\n }\n }, {\n key: \"scrollMode\",\n get: function get() {\n return this._scrollMode;\n },\n set: function set(mode) {\n if (this._scrollMode === mode) {\n return;\n }\n\n if (!(0, _ui_utils.isValidScrollMode)(mode)) {\n throw new Error(\"Invalid scroll mode: \".concat(mode));\n }\n\n this._scrollMode = mode;\n this.eventBus.dispatch(\"scrollmodechanged\", {\n source: this,\n mode: mode\n });\n\n this._updateScrollMode(this._currentPageNumber);\n }\n }, {\n key: \"spreadMode\",\n get: function get() {\n return this._spreadMode;\n },\n set: function set(mode) {\n if (this._spreadMode === mode) {\n return;\n }\n\n if (!(0, _ui_utils.isValidSpreadMode)(mode)) {\n throw new Error(\"Invalid spread mode: \".concat(mode));\n }\n\n this._spreadMode = mode;\n this.eventBus.dispatch(\"spreadmodechanged\", {\n source: this,\n mode: mode\n });\n\n this._updateSpreadMode(this._currentPageNumber);\n }\n }]);\n\n return BaseViewer;\n}();\n\nexports.BaseViewer = BaseViewer;\n\n/***/ }),\n/* 20 */\n/***/ (function(module, exports, __w_pdfjs_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.PDFViewer = void 0;\n\nvar _base_viewer = __w_pdfjs_require__(19);\n\nvar _pdfjsLib = __w_pdfjs_require__(2);\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _createForOfIteratorHelper(o, allowArrayLike) { var it; if (typeof Symbol === \"undefined\" || o[Symbol.iterator] == null) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = o[Symbol.iterator](); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it[\"return\"] != null) it[\"return\"](); } finally { if (didErr) throw err; } } }; }\n\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); }\n\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; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _get(target, property, receiver) { if (typeof Reflect !== \"undefined\" && Reflect.get) { _get = Reflect.get; } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return _get(target, property, receiver || target); }\n\nfunction _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nvar PDFViewer = /*#__PURE__*/function (_BaseViewer) {\n _inherits(PDFViewer, _BaseViewer);\n\n var _super = _createSuper(PDFViewer);\n\n function PDFViewer() {\n _classCallCheck(this, PDFViewer);\n\n return _super.apply(this, arguments);\n }\n\n _createClass(PDFViewer, [{\n key: \"_scrollIntoView\",\n value: function _scrollIntoView(_ref) {\n var pageDiv = _ref.pageDiv,\n _ref$pageSpot = _ref.pageSpot,\n pageSpot = _ref$pageSpot === void 0 ? null : _ref$pageSpot,\n _ref$pageNumber = _ref.pageNumber,\n pageNumber = _ref$pageNumber === void 0 ? null : _ref$pageNumber;\n\n if (!pageSpot && !this.isInPresentationMode) {\n var left = pageDiv.offsetLeft + pageDiv.clientLeft;\n var right = left + pageDiv.clientWidth;\n var _this$container = this.container,\n scrollLeft = _this$container.scrollLeft,\n clientWidth = _this$container.clientWidth;\n\n if (this._isScrollModeHorizontal || left < scrollLeft || right > scrollLeft + clientWidth) {\n pageSpot = {\n left: 0,\n top: 0\n };\n }\n }\n\n _get(_getPrototypeOf(PDFViewer.prototype), \"_scrollIntoView\", this).call(this, {\n pageDiv: pageDiv,\n pageSpot: pageSpot,\n pageNumber: pageNumber\n });\n }\n }, {\n key: \"_getVisiblePages\",\n value: function _getVisiblePages() {\n if (this.isInPresentationMode) {\n return this._getCurrentVisiblePage();\n }\n\n return _get(_getPrototypeOf(PDFViewer.prototype), \"_getVisiblePages\", this).call(this);\n }\n }, {\n key: \"_updateHelper\",\n value: function _updateHelper(visiblePages) {\n if (this.isInPresentationMode) {\n return;\n }\n\n var currentId = this._currentPageNumber;\n var stillFullyVisible = false;\n\n var _iterator = _createForOfIteratorHelper(visiblePages),\n _step;\n\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var page = _step.value;\n\n if (page.percent < 100) {\n break;\n }\n\n if (page.id === currentId) {\n stillFullyVisible = true;\n break;\n }\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n\n if (!stillFullyVisible) {\n currentId = visiblePages[0].id;\n }\n\n this._setCurrentPageNumber(currentId);\n }\n }, {\n key: \"_viewerElement\",\n get: function get() {\n return (0, _pdfjsLib.shadow)(this, \"_viewerElement\", this.viewer);\n }\n }]);\n\n return PDFViewer;\n}(_base_viewer.BaseViewer);\n\nexports.PDFViewer = PDFViewer;\n\n/***/ })\n/******/ ]);\n});\n//# sourceMappingURL=pdf_viewer.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/pdfjs-dist/es5/web/pdf_viewer.js\n// module id = Kv9K\n// module chunks = 0","var ctx = require('./_ctx');\nvar invoke = require('./_invoke');\nvar html = require('./_html');\nvar cel = require('./_dom-create');\nvar global = require('./_global');\nvar process = global.process;\nvar setTask = global.setImmediate;\nvar clearTask = global.clearImmediate;\nvar MessageChannel = global.MessageChannel;\nvar Dispatch = global.Dispatch;\nvar counter = 0;\nvar queue = {};\nvar ONREADYSTATECHANGE = 'onreadystatechange';\nvar defer, channel, port;\nvar run = function () {\n var id = +this;\n // eslint-disable-next-line no-prototype-builtins\n if (queue.hasOwnProperty(id)) {\n var fn = queue[id];\n delete queue[id];\n fn();\n }\n};\nvar listener = function (event) {\n run.call(event.data);\n};\n// Node.js 0.9+ & IE10+ has setImmediate, otherwise:\nif (!setTask || !clearTask) {\n setTask = function setImmediate(fn) {\n var args = [];\n var i = 1;\n while (arguments.length > i) args.push(arguments[i++]);\n queue[++counter] = function () {\n // eslint-disable-next-line no-new-func\n invoke(typeof fn == 'function' ? fn : Function(fn), args);\n };\n defer(counter);\n return counter;\n };\n clearTask = function clearImmediate(id) {\n delete queue[id];\n };\n // Node.js 0.8-\n if (require('./_cof')(process) == 'process') {\n defer = function (id) {\n process.nextTick(ctx(run, id, 1));\n };\n // Sphere (JS game engine) Dispatch API\n } else if (Dispatch && Dispatch.now) {\n defer = function (id) {\n Dispatch.now(ctx(run, id, 1));\n };\n // Browsers with MessageChannel, includes WebWorkers\n } else if (MessageChannel) {\n channel = new MessageChannel();\n port = channel.port2;\n channel.port1.onmessage = listener;\n defer = ctx(port.postMessage, port, 1);\n // Browsers with postMessage, skip WebWorkers\n // IE8 has postMessage, but it's sync & typeof its postMessage is 'object'\n } else if (global.addEventListener && typeof postMessage == 'function' && !global.importScripts) {\n defer = function (id) {\n global.postMessage(id + '', '*');\n };\n global.addEventListener('message', listener, false);\n // IE8-\n } else if (ONREADYSTATECHANGE in cel('script')) {\n defer = function (id) {\n html.appendChild(cel('script'))[ONREADYSTATECHANGE] = function () {\n html.removeChild(this);\n run.call(id);\n };\n };\n // Rest old browsers\n } else {\n defer = function (id) {\n setTimeout(ctx(run, id, 1), 0);\n };\n }\n}\nmodule.exports = {\n set: setTask,\n clear: clearTask\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/library/modules/_task.js\n// module id = L42u\n// module chunks = 0","var pIE = require('./_object-pie');\nvar createDesc = require('./_property-desc');\nvar toIObject = require('./_to-iobject');\nvar toPrimitive = require('./_to-primitive');\nvar has = require('./_has');\nvar IE8_DOM_DEFINE = require('./_ie8-dom-define');\nvar gOPD = Object.getOwnPropertyDescriptor;\n\nexports.f = require('./_descriptors') ? gOPD : function getOwnPropertyDescriptor(O, P) {\n O = toIObject(O);\n P = toPrimitive(P, true);\n if (IE8_DOM_DEFINE) try {\n return gOPD(O, P);\n } catch (e) { /* empty */ }\n if (has(O, P)) return createDesc(!pIE.f.call(O, P), O[P]);\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/library/modules/_object-gopd.js\n// module id = LKZe\n// module chunks = 0","// fallback for non-array-like ES3 and non-enumerable old V8 strings\nvar cof = require('./_cof');\n// eslint-disable-next-line no-prototype-builtins\nmodule.exports = Object('z').propertyIsEnumerable(0) ? Object : function (it) {\n return cof(it) == 'String' ? it.split('') : Object(it);\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/library/modules/_iobject.js\n// module id = MU5D\n// module chunks = 0","// check on default Array iterator\nvar Iterators = require('./_iterators');\nvar ITERATOR = require('./_wks')('iterator');\nvar ArrayProto = Array.prototype;\n\nmodule.exports = function (it) {\n return it !== undefined && (Iterators.Array === it || ArrayProto[ITERATOR] === it);\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/library/modules/_is-array-iter.js\n// module id = Mhyx\n// module chunks = 0","// 7.1.1 ToPrimitive(input [, PreferredType])\nvar isObject = require('./_is-object');\n// instead of the ES6 spec version, we didn't implement @@toPrimitive case\n// and the second argument - flag - preferred type is a string\nmodule.exports = function (it, S) {\n if (!isObject(it)) return it;\n var fn, val;\n if (S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;\n if (typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it))) return val;\n if (!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;\n throw TypeError(\"Can't convert object to primitive value\");\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/library/modules/_to-primitive.js\n// module id = MmMw\n// module chunks = 0","'use strict';\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\n/**\n * @fileOverview Kickass library to create and place poppers near their reference elements.\n * @version {{version}}\n * @license\n * Copyright (c) 2016 Federico Zivolo and contributors\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n//\n// Cross module loader\n// Supported: Node, AMD, Browser globals\n//\n;(function (root, factory) {\n if (typeof define === 'function' && define.amd) {\n // AMD. Register as an anonymous module.\n define(factory);\n } else if ((typeof module === 'undefined' ? 'undefined' : _typeof(module)) === 'object' && module.exports) {\n // Node. Does not work with strict CommonJS, but\n // only CommonJS-like environments that support module.exports,\n // like Node.\n module.exports = factory();\n } else {\n // Browser globals (root is window)\n root.Popper = factory();\n }\n})(undefined, function () {\n\n 'use strict';\n\n var root = window;\n\n // default options\n var DEFAULTS = {\n // placement of the popper\n placement: 'bottom',\n\n gpuAcceleration: true,\n\n // shift popper from its origin by the given amount of pixels (can be negative)\n offset: 0,\n\n // the element which will act as boundary of the popper\n boundariesElement: 'viewport',\n\n // amount of pixel used to define a minimum distance between the boundaries and the popper\n boundariesPadding: 5,\n\n // popper will try to prevent overflow following this order,\n // by default, then, it could overflow on the left and on top of the boundariesElement\n preventOverflowOrder: ['left', 'right', 'top', 'bottom'],\n\n // the behavior used by flip to change the placement of the popper\n flipBehavior: 'flip',\n\n arrowElement: '[x-arrow]',\n\n arrowOffset: 0,\n\n // list of functions used to modify the offsets before they are applied to the popper\n modifiers: ['shift', 'offset', 'preventOverflow', 'keepTogether', 'arrow', 'flip', 'applyStyle'],\n\n modifiersIgnored: [],\n\n forceAbsolute: false\n };\n\n /**\n * Create a new Popper.js instance\n * @constructor Popper\n * @param {HTMLElement} reference - The reference element used to position the popper\n * @param {HTMLElement|Object} popper\n * The HTML element used as popper, or a configuration used to generate the popper.\n * @param {String} [popper.tagName='div'] The tag name of the generated popper.\n * @param {Array} [popper.classNames=['popper']] Array of classes to apply to the generated popper.\n * @param {Array} [popper.attributes] Array of attributes to apply, specify `attr:value` to assign a value to it.\n * @param {HTMLElement|String} [popper.parent=window.document.body] The parent element, given as HTMLElement or as query string.\n * @param {String} [popper.content=''] The content of the popper, it can be text, html, or node; if it is not text, set `contentType` to `html` or `node`.\n * @param {String} [popper.contentType='text'] If `html`, the `content` will be parsed as HTML. If `node`, it will be appended as-is.\n * @param {String} [popper.arrowTagName='div'] Same as `popper.tagName` but for the arrow element.\n * @param {Array} [popper.arrowClassNames='popper__arrow'] Same as `popper.classNames` but for the arrow element.\n * @param {String} [popper.arrowAttributes=['x-arrow']] Same as `popper.attributes` but for the arrow element.\n * @param {Object} options\n * @param {String} [options.placement=bottom]\n * Placement of the popper accepted values: `top(-start, -end), right(-start, -end), bottom(-start, -right),\n * left(-start, -end)`\n *\n * @param {HTMLElement|String} [options.arrowElement='[x-arrow]']\n * The DOM Node used as arrow for the popper, or a CSS selector used to get the DOM node. It must be child of\n * its parent Popper. Popper.js will apply to the given element the style required to align the arrow with its\n * reference element.\n * By default, it will look for a child node of the popper with the `x-arrow` attribute.\n *\n * @param {Boolean} [options.gpuAcceleration=true]\n * When this property is set to true, the popper position will be applied using CSS3 translate3d, allowing the\n * browser to use the GPU to accelerate the rendering.\n * If set to false, the popper will be placed using `top` and `left` properties, not using the GPU.\n *\n * @param {Number} [options.offset=0]\n * Amount of pixels the popper will be shifted (can be negative).\n *\n * @param {String|Element} [options.boundariesElement='viewport']\n * The element which will define the boundaries of the popper position, the popper will never be placed outside\n * of the defined boundaries (except if `keepTogether` is enabled)\n *\n * @param {Number} [options.boundariesPadding=5]\n * Additional padding for the boundaries\n *\n * @param {Array} [options.preventOverflowOrder=['left', 'right', 'top', 'bottom']]\n * Order used when Popper.js tries to avoid overflows from the boundaries, they will be checked in order,\n * this means that the last ones will never overflow\n *\n * @param {String|Array} [options.flipBehavior='flip']\n * The behavior used by the `flip` modifier to change the placement of the popper when the latter is trying to\n * overlap its reference element. Defining `flip` as value, the placement will be flipped on\n * its axis (`right - left`, `top - bottom`).\n * You can even pass an array of placements (eg: `['right', 'left', 'top']` ) to manually specify\n * how alter the placement when a flip is needed. (eg. in the above example, it would first flip from right to left,\n * then, if even in its new placement, the popper is overlapping its reference element, it will be moved to top)\n *\n * @param {Array} [options.modifiers=[ 'shift', 'offset', 'preventOverflow', 'keepTogether', 'arrow', 'flip', 'applyStyle']]\n * List of functions used to modify the data before they are applied to the popper, add your custom functions\n * to this array to edit the offsets and placement.\n * The function should reflect the @params and @returns of preventOverflow\n *\n * @param {Array} [options.modifiersIgnored=[]]\n * Put here any built-in modifier name you want to exclude from the modifiers list\n * The function should reflect the @params and @returns of preventOverflow\n *\n * @param {Boolean} [options.removeOnDestroy=false]\n * Set to true if you want to automatically remove the popper when you call the `destroy` method.\n */\n function Popper(reference, popper, options) {\n this._reference = reference.jquery ? reference[0] : reference;\n this.state = {};\n\n // if the popper variable is a configuration object, parse it to generate an HTMLElement\n // generate a default popper if is not defined\n var isNotDefined = typeof popper === 'undefined' || popper === null;\n var isConfig = popper && Object.prototype.toString.call(popper) === '[object Object]';\n if (isNotDefined || isConfig) {\n this._popper = this.parse(isConfig ? popper : {});\n }\n // otherwise, use the given HTMLElement as popper\n else {\n this._popper = popper.jquery ? popper[0] : popper;\n }\n\n // with {} we create a new object with the options inside it\n this._options = Object.assign({}, DEFAULTS, options);\n\n // refactoring modifiers' list\n this._options.modifiers = this._options.modifiers.map(function (modifier) {\n // remove ignored modifiers\n if (this._options.modifiersIgnored.indexOf(modifier) !== -1) return;\n\n // set the x-placement attribute before everything else because it could be used to add margins to the popper\n // margins needs to be calculated to get the correct popper offsets\n if (modifier === 'applyStyle') {\n this._popper.setAttribute('x-placement', this._options.placement);\n }\n\n // return predefined modifier identified by string or keep the custom one\n return this.modifiers[modifier] || modifier;\n }.bind(this));\n\n // make sure to apply the popper position before any computation\n this.state.position = this._getPosition(this._popper, this._reference);\n setStyle(this._popper, { position: this.state.position, top: 0 });\n\n // fire the first update to position the popper in the right place\n this.update();\n\n // setup event listeners, they will take care of update the position in specific situations\n this._setupEventListeners();\n return this;\n }\n\n //\n // Methods\n //\n /**\n * Destroy the popper\n * @method\n * @memberof Popper\n */\n Popper.prototype.destroy = function () {\n this._popper.removeAttribute('x-placement');\n this._popper.style.left = '';\n this._popper.style.position = '';\n this._popper.style.top = '';\n this._popper.style[getSupportedPropertyName('transform')] = '';\n this._removeEventListeners();\n\n // remove the popper if user explicity asked for the deletion on destroy\n if (this._options.removeOnDestroy) {\n this._popper.remove();\n }\n return this;\n };\n\n /**\n * Updates the position of the popper, computing the new offsets and applying the new style\n * @method\n * @memberof Popper\n */\n Popper.prototype.update = function () {\n var data = { instance: this, styles: {} };\n\n // store placement inside the data object, modifiers will be able to edit `placement` if needed\n // and refer to _originalPlacement to know the original value\n data.placement = this._options.placement;\n data._originalPlacement = this._options.placement;\n\n // compute the popper and reference offsets and put them inside data.offsets\n data.offsets = this._getOffsets(this._popper, this._reference, data.placement);\n\n // get boundaries\n data.boundaries = this._getBoundaries(data, this._options.boundariesPadding, this._options.boundariesElement);\n\n data = this.runModifiers(data, this._options.modifiers);\n\n if (typeof this.state.updateCallback === 'function') {\n this.state.updateCallback(data);\n }\n };\n\n /**\n * If a function is passed, it will be executed after the initialization of popper with as first argument the Popper instance.\n * @method\n * @memberof Popper\n * @param {Function} callback\n */\n Popper.prototype.onCreate = function (callback) {\n // the createCallbacks return as first argument the popper instance\n callback(this);\n return this;\n };\n\n /**\n * If a function is passed, it will be executed after each update of popper with as first argument the set of coordinates and informations\n * used to style popper and its arrow.\n * NOTE: it doesn't get fired on the first call of the `Popper.update()` method inside the `Popper` constructor!\n * @method\n * @memberof Popper\n * @param {Function} callback\n */\n Popper.prototype.onUpdate = function (callback) {\n this.state.updateCallback = callback;\n return this;\n };\n\n /**\n * Helper used to generate poppers from a configuration file\n * @method\n * @memberof Popper\n * @param config {Object} configuration\n * @returns {HTMLElement} popper\n */\n Popper.prototype.parse = function (config) {\n var defaultConfig = {\n tagName: 'div',\n classNames: ['popper'],\n attributes: [],\n parent: root.document.body,\n content: '',\n contentType: 'text',\n arrowTagName: 'div',\n arrowClassNames: ['popper__arrow'],\n arrowAttributes: ['x-arrow']\n };\n config = Object.assign({}, defaultConfig, config);\n\n var d = root.document;\n\n var popper = d.createElement(config.tagName);\n addClassNames(popper, config.classNames);\n addAttributes(popper, config.attributes);\n if (config.contentType === 'node') {\n popper.appendChild(config.content.jquery ? config.content[0] : config.content);\n } else if (config.contentType === 'html') {\n popper.innerHTML = config.content;\n } else {\n popper.textContent = config.content;\n }\n\n if (config.arrowTagName) {\n var arrow = d.createElement(config.arrowTagName);\n addClassNames(arrow, config.arrowClassNames);\n addAttributes(arrow, config.arrowAttributes);\n popper.appendChild(arrow);\n }\n\n var parent = config.parent.jquery ? config.parent[0] : config.parent;\n\n // if the given parent is a string, use it to match an element\n // if more than one element is matched, the first one will be used as parent\n // if no elements are matched, the script will throw an error\n if (typeof parent === 'string') {\n parent = d.querySelectorAll(config.parent);\n if (parent.length > 1) {\n console.warn('WARNING: the given `parent` query(' + config.parent + ') matched more than one element, the first one will be used');\n }\n if (parent.length === 0) {\n throw 'ERROR: the given `parent` doesn\\'t exists!';\n }\n parent = parent[0];\n }\n // if the given parent is a DOM nodes list or an array of nodes with more than one element,\n // the first one will be used as parent\n if (parent.length > 1 && parent instanceof Element === false) {\n console.warn('WARNING: you have passed as parent a list of elements, the first one will be used');\n parent = parent[0];\n }\n\n // append the generated popper to its parent\n parent.appendChild(popper);\n\n return popper;\n\n /**\n * Adds class names to the given element\n * @function\n * @ignore\n * @param {HTMLElement} target\n * @param {Array} classes\n */\n function addClassNames(element, classNames) {\n classNames.forEach(function (className) {\n element.classList.add(className);\n });\n }\n\n /**\n * Adds attributes to the given element\n * @function\n * @ignore\n * @param {HTMLElement} target\n * @param {Array} attributes\n * @example\n * addAttributes(element, [ 'data-info:foobar' ]);\n */\n function addAttributes(element, attributes) {\n attributes.forEach(function (attribute) {\n element.setAttribute(attribute.split(':')[0], attribute.split(':')[1] || '');\n });\n }\n };\n\n /**\n * Helper used to get the position which will be applied to the popper\n * @method\n * @memberof Popper\n * @param config {HTMLElement} popper element\n * @param reference {HTMLElement} reference element\n * @returns {String} position\n */\n Popper.prototype._getPosition = function (popper, reference) {\n var container = getOffsetParent(reference);\n\n if (this._options.forceAbsolute) {\n return 'absolute';\n }\n\n // Decide if the popper will be fixed\n // If the reference element is inside a fixed context, the popper will be fixed as well to allow them to scroll together\n var isParentFixed = isFixed(reference, container);\n return isParentFixed ? 'fixed' : 'absolute';\n };\n\n /**\n * Get offsets to the popper\n * @method\n * @memberof Popper\n * @access private\n * @param {Element} popper - the popper element\n * @param {Element} reference - the reference element (the popper will be relative to this)\n * @returns {Object} An object containing the offsets which will be applied to the popper\n */\n Popper.prototype._getOffsets = function (popper, reference, placement) {\n placement = placement.split('-')[0];\n var popperOffsets = {};\n\n popperOffsets.position = this.state.position;\n var isParentFixed = popperOffsets.position === 'fixed';\n\n //\n // Get reference element position\n //\n var referenceOffsets = getOffsetRectRelativeToCustomParent(reference, getOffsetParent(popper), isParentFixed);\n\n //\n // Get popper sizes\n //\n var popperRect = getOuterSizes(popper);\n\n //\n // Compute offsets of popper\n //\n\n // depending by the popper placement we have to compute its offsets slightly differently\n if (['right', 'left'].indexOf(placement) !== -1) {\n popperOffsets.top = referenceOffsets.top + referenceOffsets.height / 2 - popperRect.height / 2;\n if (placement === 'left') {\n popperOffsets.left = referenceOffsets.left - popperRect.width;\n } else {\n popperOffsets.left = referenceOffsets.right;\n }\n } else {\n popperOffsets.left = referenceOffsets.left + referenceOffsets.width / 2 - popperRect.width / 2;\n if (placement === 'top') {\n popperOffsets.top = referenceOffsets.top - popperRect.height;\n } else {\n popperOffsets.top = referenceOffsets.bottom;\n }\n }\n\n // Add width and height to our offsets object\n popperOffsets.width = popperRect.width;\n popperOffsets.height = popperRect.height;\n\n return {\n popper: popperOffsets,\n reference: referenceOffsets\n };\n };\n\n /**\n * Setup needed event listeners used to update the popper position\n * @method\n * @memberof Popper\n * @access private\n */\n Popper.prototype._setupEventListeners = function () {\n // NOTE: 1 DOM access here\n this.state.updateBound = this.update.bind(this);\n root.addEventListener('resize', this.state.updateBound);\n // if the boundariesElement is window we don't need to listen for the scroll event\n if (this._options.boundariesElement !== 'window') {\n var target = getScrollParent(this._reference);\n // here it could be both `body` or `documentElement` thanks to Firefox, we then check both\n if (target === root.document.body || target === root.document.documentElement) {\n target = root;\n }\n target.addEventListener('scroll', this.state.updateBound);\n this.state.scrollTarget = target;\n }\n };\n\n /**\n * Remove event listeners used to update the popper position\n * @method\n * @memberof Popper\n * @access private\n */\n Popper.prototype._removeEventListeners = function () {\n // NOTE: 1 DOM access here\n root.removeEventListener('resize', this.state.updateBound);\n if (this._options.boundariesElement !== 'window' && this.state.scrollTarget) {\n this.state.scrollTarget.removeEventListener('scroll', this.state.updateBound);\n this.state.scrollTarget = null;\n }\n this.state.updateBound = null;\n };\n\n /**\n * Computed the boundaries limits and return them\n * @method\n * @memberof Popper\n * @access private\n * @param {Object} data - Object containing the property \"offsets\" generated by `_getOffsets`\n * @param {Number} padding - Boundaries padding\n * @param {Element} boundariesElement - Element used to define the boundaries\n * @returns {Object} Coordinates of the boundaries\n */\n Popper.prototype._getBoundaries = function (data, padding, boundariesElement) {\n // NOTE: 1 DOM access here\n var boundaries = {};\n var width, height;\n if (boundariesElement === 'window') {\n var body = root.document.body,\n html = root.document.documentElement;\n\n height = Math.max(body.scrollHeight, body.offsetHeight, html.clientHeight, html.scrollHeight, html.offsetHeight);\n width = Math.max(body.scrollWidth, body.offsetWidth, html.clientWidth, html.scrollWidth, html.offsetWidth);\n\n boundaries = {\n top: 0,\n right: width,\n bottom: height,\n left: 0\n };\n } else if (boundariesElement === 'viewport') {\n var offsetParent = getOffsetParent(this._popper);\n var scrollParent = getScrollParent(this._popper);\n var offsetParentRect = getOffsetRect(offsetParent);\n\n // Thanks the fucking native API, `document.body.scrollTop` & `document.documentElement.scrollTop`\n var getScrollTopValue = function getScrollTopValue(element) {\n return element == document.body ? Math.max(document.documentElement.scrollTop, document.body.scrollTop) : element.scrollTop;\n };\n var getScrollLeftValue = function getScrollLeftValue(element) {\n return element == document.body ? Math.max(document.documentElement.scrollLeft, document.body.scrollLeft) : element.scrollLeft;\n };\n\n // if the popper is fixed we don't have to substract scrolling from the boundaries\n var scrollTop = data.offsets.popper.position === 'fixed' ? 0 : getScrollTopValue(scrollParent);\n var scrollLeft = data.offsets.popper.position === 'fixed' ? 0 : getScrollLeftValue(scrollParent);\n\n boundaries = {\n top: 0 - (offsetParentRect.top - scrollTop),\n right: root.document.documentElement.clientWidth - (offsetParentRect.left - scrollLeft),\n bottom: root.document.documentElement.clientHeight - (offsetParentRect.top - scrollTop),\n left: 0 - (offsetParentRect.left - scrollLeft)\n };\n } else {\n if (getOffsetParent(this._popper) === boundariesElement) {\n boundaries = {\n top: 0,\n left: 0,\n right: boundariesElement.clientWidth,\n bottom: boundariesElement.clientHeight\n };\n } else {\n boundaries = getOffsetRect(boundariesElement);\n }\n }\n boundaries.left += padding;\n boundaries.right -= padding;\n boundaries.top = boundaries.top + padding;\n boundaries.bottom = boundaries.bottom - padding;\n return boundaries;\n };\n\n /**\n * Loop trough the list of modifiers and run them in order, each of them will then edit the data object\n * @method\n * @memberof Popper\n * @access public\n * @param {Object} data\n * @param {Array} modifiers\n * @param {Function} ends\n */\n Popper.prototype.runModifiers = function (data, modifiers, ends) {\n var modifiersToRun = modifiers.slice();\n if (ends !== undefined) {\n modifiersToRun = this._options.modifiers.slice(0, getArrayKeyIndex(this._options.modifiers, ends));\n }\n\n modifiersToRun.forEach(function (modifier) {\n if (isFunction(modifier)) {\n data = modifier.call(this, data);\n }\n }.bind(this));\n\n return data;\n };\n\n /**\n * Helper used to know if the given modifier depends from another one.\n * @method\n * @memberof Popper\n * @param {String} requesting - name of requesting modifier\n * @param {String} requested - name of requested modifier\n * @returns {Boolean}\n */\n Popper.prototype.isModifierRequired = function (requesting, requested) {\n var index = getArrayKeyIndex(this._options.modifiers, requesting);\n return !!this._options.modifiers.slice(0, index).filter(function (modifier) {\n return modifier === requested;\n }).length;\n };\n\n //\n // Modifiers\n //\n\n /**\n * Modifiers list\n * @namespace Popper.modifiers\n * @memberof Popper\n * @type {Object}\n */\n Popper.prototype.modifiers = {};\n\n /**\n * Apply the computed styles to the popper element\n * @method\n * @memberof Popper.modifiers\n * @argument {Object} data - The data object generated by `update` method\n * @returns {Object} The same data object\n */\n Popper.prototype.modifiers.applyStyle = function (data) {\n // apply the final offsets to the popper\n // NOTE: 1 DOM access here\n var styles = {\n position: data.offsets.popper.position\n };\n\n // round top and left to avoid blurry text\n var left = Math.round(data.offsets.popper.left);\n var top = Math.round(data.offsets.popper.top);\n\n // if gpuAcceleration is set to true and transform is supported, we use `translate3d` to apply the position to the popper\n // we automatically use the supported prefixed version if needed\n var prefixedProperty;\n if (this._options.gpuAcceleration && (prefixedProperty = getSupportedPropertyName('transform'))) {\n styles[prefixedProperty] = 'translate3d(' + left + 'px, ' + top + 'px, 0)';\n styles.top = 0;\n styles.left = 0;\n }\n // othwerise, we use the standard `left` and `top` properties\n else {\n styles.left = left;\n styles.top = top;\n }\n\n // any property present in `data.styles` will be applied to the popper,\n // in this way we can make the 3rd party modifiers add custom styles to it\n // Be aware, modifiers could override the properties defined in the previous\n // lines of this modifier!\n Object.assign(styles, data.styles);\n\n setStyle(this._popper, styles);\n\n // set an attribute which will be useful to style the tooltip (use it to properly position its arrow)\n // NOTE: 1 DOM access here\n this._popper.setAttribute('x-placement', data.placement);\n\n // if the arrow modifier is required and the arrow style has been computed, apply the arrow style\n if (this.isModifierRequired(this.modifiers.applyStyle, this.modifiers.arrow) && data.offsets.arrow) {\n setStyle(data.arrowElement, data.offsets.arrow);\n }\n\n return data;\n };\n\n /**\n * Modifier used to shift the popper on the start or end of its reference element side\n * @method\n * @memberof Popper.modifiers\n * @argument {Object} data - The data object generated by `update` method\n * @returns {Object} The data object, properly modified\n */\n Popper.prototype.modifiers.shift = function (data) {\n var placement = data.placement;\n var basePlacement = placement.split('-')[0];\n var shiftVariation = placement.split('-')[1];\n\n // if shift shiftVariation is specified, run the modifier\n if (shiftVariation) {\n var reference = data.offsets.reference;\n var popper = getPopperClientRect(data.offsets.popper);\n\n var shiftOffsets = {\n y: {\n start: { top: reference.top },\n end: { top: reference.top + reference.height - popper.height }\n },\n x: {\n start: { left: reference.left },\n end: { left: reference.left + reference.width - popper.width }\n }\n };\n\n var axis = ['bottom', 'top'].indexOf(basePlacement) !== -1 ? 'x' : 'y';\n\n data.offsets.popper = Object.assign(popper, shiftOffsets[axis][shiftVariation]);\n }\n\n return data;\n };\n\n /**\n * Modifier used to make sure the popper does not overflows from it's boundaries\n * @method\n * @memberof Popper.modifiers\n * @argument {Object} data - The data object generated by `update` method\n * @returns {Object} The data object, properly modified\n */\n Popper.prototype.modifiers.preventOverflow = function (data) {\n var order = this._options.preventOverflowOrder;\n var popper = getPopperClientRect(data.offsets.popper);\n\n var check = {\n left: function left() {\n var left = popper.left;\n if (popper.left < data.boundaries.left) {\n left = Math.max(popper.left, data.boundaries.left);\n }\n return { left: left };\n },\n right: function right() {\n var left = popper.left;\n if (popper.right > data.boundaries.right) {\n left = Math.min(popper.left, data.boundaries.right - popper.width);\n }\n return { left: left };\n },\n top: function top() {\n var top = popper.top;\n if (popper.top < data.boundaries.top) {\n top = Math.max(popper.top, data.boundaries.top);\n }\n return { top: top };\n },\n bottom: function bottom() {\n var top = popper.top;\n if (popper.bottom > data.boundaries.bottom) {\n top = Math.min(popper.top, data.boundaries.bottom - popper.height);\n }\n return { top: top };\n }\n };\n\n order.forEach(function (direction) {\n data.offsets.popper = Object.assign(popper, check[direction]());\n });\n\n return data;\n };\n\n /**\n * Modifier used to make sure the popper is always near its reference\n * @method\n * @memberof Popper.modifiers\n * @argument {Object} data - The data object generated by _update method\n * @returns {Object} The data object, properly modified\n */\n Popper.prototype.modifiers.keepTogether = function (data) {\n var popper = getPopperClientRect(data.offsets.popper);\n var reference = data.offsets.reference;\n var f = Math.floor;\n\n if (popper.right < f(reference.left)) {\n data.offsets.popper.left = f(reference.left) - popper.width;\n }\n if (popper.left > f(reference.right)) {\n data.offsets.popper.left = f(reference.right);\n }\n if (popper.bottom < f(reference.top)) {\n data.offsets.popper.top = f(reference.top) - popper.height;\n }\n if (popper.top > f(reference.bottom)) {\n data.offsets.popper.top = f(reference.bottom);\n }\n\n return data;\n };\n\n /**\n * Modifier used to flip the placement of the popper when the latter is starting overlapping its reference element.\n * Requires the `preventOverflow` modifier before it in order to work.\n * **NOTE:** This modifier will run all its previous modifiers everytime it tries to flip the popper!\n * @method\n * @memberof Popper.modifiers\n * @argument {Object} data - The data object generated by _update method\n * @returns {Object} The data object, properly modified\n */\n Popper.prototype.modifiers.flip = function (data) {\n // check if preventOverflow is in the list of modifiers before the flip modifier.\n // otherwise flip would not work as expected.\n if (!this.isModifierRequired(this.modifiers.flip, this.modifiers.preventOverflow)) {\n console.warn('WARNING: preventOverflow modifier is required by flip modifier in order to work, be sure to include it before flip!');\n return data;\n }\n\n if (data.flipped && data.placement === data._originalPlacement) {\n // seems like flip is trying to loop, probably there's not enough space on any of the flippable sides\n return data;\n }\n\n var placement = data.placement.split('-')[0];\n var placementOpposite = getOppositePlacement(placement);\n var variation = data.placement.split('-')[1] || '';\n\n var flipOrder = [];\n if (this._options.flipBehavior === 'flip') {\n flipOrder = [placement, placementOpposite];\n } else {\n flipOrder = this._options.flipBehavior;\n }\n\n flipOrder.forEach(function (step, index) {\n if (placement !== step || flipOrder.length === index + 1) {\n return;\n }\n\n placement = data.placement.split('-')[0];\n placementOpposite = getOppositePlacement(placement);\n\n var popperOffsets = getPopperClientRect(data.offsets.popper);\n\n // this boolean is used to distinguish right and bottom from top and left\n // they need different computations to get flipped\n var a = ['right', 'bottom'].indexOf(placement) !== -1;\n\n // using Math.floor because the reference offsets may contain decimals we are not going to consider here\n if (a && Math.floor(data.offsets.reference[placement]) > Math.floor(popperOffsets[placementOpposite]) || !a && Math.floor(data.offsets.reference[placement]) < Math.floor(popperOffsets[placementOpposite])) {\n // we'll use this boolean to detect any flip loop\n data.flipped = true;\n data.placement = flipOrder[index + 1];\n if (variation) {\n data.placement += '-' + variation;\n }\n data.offsets.popper = this._getOffsets(this._popper, this._reference, data.placement).popper;\n\n data = this.runModifiers(data, this._options.modifiers, this._flip);\n }\n }.bind(this));\n return data;\n };\n\n /**\n * Modifier used to add an offset to the popper, useful if you more granularity positioning your popper.\n * The offsets will shift the popper on the side of its reference element.\n * @method\n * @memberof Popper.modifiers\n * @argument {Object} data - The data object generated by _update method\n * @returns {Object} The data object, properly modified\n */\n Popper.prototype.modifiers.offset = function (data) {\n var offset = this._options.offset;\n var popper = data.offsets.popper;\n\n if (data.placement.indexOf('left') !== -1) {\n popper.top -= offset;\n } else if (data.placement.indexOf('right') !== -1) {\n popper.top += offset;\n } else if (data.placement.indexOf('top') !== -1) {\n popper.left -= offset;\n } else if (data.placement.indexOf('bottom') !== -1) {\n popper.left += offset;\n }\n return data;\n };\n\n /**\n * Modifier used to move the arrows on the edge of the popper to make sure them are always between the popper and the reference element\n * It will use the CSS outer size of the arrow element to know how many pixels of conjuction are needed\n * @method\n * @memberof Popper.modifiers\n * @argument {Object} data - The data object generated by _update method\n * @returns {Object} The data object, properly modified\n */\n Popper.prototype.modifiers.arrow = function (data) {\n var arrow = this._options.arrowElement;\n var arrowOffset = this._options.arrowOffset;\n\n // if the arrowElement is a string, suppose it's a CSS selector\n if (typeof arrow === 'string') {\n arrow = this._popper.querySelector(arrow);\n }\n\n // if arrow element is not found, don't run the modifier\n if (!arrow) {\n return data;\n }\n\n // the arrow element must be child of its popper\n if (!this._popper.contains(arrow)) {\n console.warn('WARNING: `arrowElement` must be child of its popper element!');\n return data;\n }\n\n // arrow depends on keepTogether in order to work\n if (!this.isModifierRequired(this.modifiers.arrow, this.modifiers.keepTogether)) {\n console.warn('WARNING: keepTogether modifier is required by arrow modifier in order to work, be sure to include it before arrow!');\n return data;\n }\n\n var arrowStyle = {};\n var placement = data.placement.split('-')[0];\n var popper = getPopperClientRect(data.offsets.popper);\n var reference = data.offsets.reference;\n var isVertical = ['left', 'right'].indexOf(placement) !== -1;\n\n var len = isVertical ? 'height' : 'width';\n var side = isVertical ? 'top' : 'left';\n var translate = isVertical ? 'translateY' : 'translateX';\n var altSide = isVertical ? 'left' : 'top';\n var opSide = isVertical ? 'bottom' : 'right';\n var arrowSize = getOuterSizes(arrow)[len];\n\n //\n // extends keepTogether behavior making sure the popper and its reference have enough pixels in conjuction\n //\n\n // top/left side\n if (reference[opSide] - arrowSize < popper[side]) {\n data.offsets.popper[side] -= popper[side] - (reference[opSide] - arrowSize);\n }\n // bottom/right side\n if (reference[side] + arrowSize > popper[opSide]) {\n data.offsets.popper[side] += reference[side] + arrowSize - popper[opSide];\n }\n\n // compute center of the popper\n var center = reference[side] + (arrowOffset || reference[len] / 2 - arrowSize / 2);\n\n var sideValue = center - popper[side];\n\n // prevent arrow from being placed not contiguously to its popper\n sideValue = Math.max(Math.min(popper[len] - arrowSize - 8, sideValue), 8);\n arrowStyle[side] = sideValue;\n arrowStyle[altSide] = ''; // make sure to remove any old style from the arrow\n\n data.offsets.arrow = arrowStyle;\n data.arrowElement = arrow;\n\n return data;\n };\n\n //\n // Helpers\n //\n\n /**\n * Get the outer sizes of the given element (offset size + margins)\n * @function\n * @ignore\n * @argument {Element} element\n * @returns {Object} object containing width and height properties\n */\n function getOuterSizes(element) {\n // NOTE: 1 DOM access here\n var _display = element.style.display,\n _visibility = element.style.visibility;\n element.style.display = 'block';element.style.visibility = 'hidden';\n var calcWidthToForceRepaint = element.offsetWidth;\n\n // original method\n var styles = root.getComputedStyle(element);\n var x = parseFloat(styles.marginTop) + parseFloat(styles.marginBottom);\n var y = parseFloat(styles.marginLeft) + parseFloat(styles.marginRight);\n var result = { width: element.offsetWidth + y, height: element.offsetHeight + x };\n\n // reset element styles\n element.style.display = _display;element.style.visibility = _visibility;\n return result;\n }\n\n /**\n * Get the opposite placement of the given one/\n * @function\n * @ignore\n * @argument {String} placement\n * @returns {String} flipped placement\n */\n function getOppositePlacement(placement) {\n var hash = { left: 'right', right: 'left', bottom: 'top', top: 'bottom' };\n return placement.replace(/left|right|bottom|top/g, function (matched) {\n return hash[matched];\n });\n }\n\n /**\n * Given the popper offsets, generate an output similar to getBoundingClientRect\n * @function\n * @ignore\n * @argument {Object} popperOffsets\n * @returns {Object} ClientRect like output\n */\n function getPopperClientRect(popperOffsets) {\n var offsets = Object.assign({}, popperOffsets);\n offsets.right = offsets.left + offsets.width;\n offsets.bottom = offsets.top + offsets.height;\n return offsets;\n }\n\n /**\n * Given an array and the key to find, returns its index\n * @function\n * @ignore\n * @argument {Array} arr\n * @argument keyToFind\n * @returns index or null\n */\n function getArrayKeyIndex(arr, keyToFind) {\n var i = 0,\n key;\n for (key in arr) {\n if (arr[key] === keyToFind) {\n return i;\n }\n i++;\n }\n return null;\n }\n\n /**\n * Get CSS computed property of the given element\n * @function\n * @ignore\n * @argument {Eement} element\n * @argument {String} property\n */\n function getStyleComputedProperty(element, property) {\n // NOTE: 1 DOM access here\n var css = root.getComputedStyle(element, null);\n return css[property];\n }\n\n /**\n * Returns the offset parent of the given element\n * @function\n * @ignore\n * @argument {Element} element\n * @returns {Element} offset parent\n */\n function getOffsetParent(element) {\n // NOTE: 1 DOM access here\n var offsetParent = element.offsetParent;\n return offsetParent === root.document.body || !offsetParent ? root.document.documentElement : offsetParent;\n }\n\n /**\n * Returns the scrolling parent of the given element\n * @function\n * @ignore\n * @argument {Element} element\n * @returns {Element} offset parent\n */\n function getScrollParent(element) {\n var parent = element.parentNode;\n\n if (!parent) {\n return element;\n }\n\n if (parent === root.document) {\n // Firefox puts the scrollTOp value on `documentElement` instead of `body`, we then check which of them is\n // greater than 0 and return the proper element\n if (root.document.body.scrollTop || root.document.body.scrollLeft) {\n return root.document.body;\n } else {\n return root.document.documentElement;\n }\n }\n\n // Firefox want us to check `-x` and `-y` variations as well\n if (['scroll', 'auto'].indexOf(getStyleComputedProperty(parent, 'overflow')) !== -1 || ['scroll', 'auto'].indexOf(getStyleComputedProperty(parent, 'overflow-x')) !== -1 || ['scroll', 'auto'].indexOf(getStyleComputedProperty(parent, 'overflow-y')) !== -1) {\n // If the detected scrollParent is body, we perform an additional check on its parentNode\n // in this way we'll get body if the browser is Chrome-ish, or documentElement otherwise\n // fixes issue #65\n return parent;\n }\n return getScrollParent(element.parentNode);\n }\n\n /**\n * Check if the given element is fixed or is inside a fixed parent\n * @function\n * @ignore\n * @argument {Element} element\n * @argument {Element} customContainer\n * @returns {Boolean} answer to \"isFixed?\"\n */\n function isFixed(element) {\n if (element === root.document.body) {\n return false;\n }\n if (getStyleComputedProperty(element, 'position') === 'fixed') {\n return true;\n }\n return element.parentNode ? isFixed(element.parentNode) : element;\n }\n\n /**\n * Set the style to the given popper\n * @function\n * @ignore\n * @argument {Element} element - Element to apply the style to\n * @argument {Object} styles - Object with a list of properties and values which will be applied to the element\n */\n function setStyle(element, styles) {\n function is_numeric(n) {\n return n !== '' && !isNaN(parseFloat(n)) && isFinite(n);\n }\n Object.keys(styles).forEach(function (prop) {\n var unit = '';\n // add unit if the value is numeric and is one of the following\n if (['width', 'height', 'top', 'right', 'bottom', 'left'].indexOf(prop) !== -1 && is_numeric(styles[prop])) {\n unit = 'px';\n }\n element.style[prop] = styles[prop] + unit;\n });\n }\n\n /**\n * Check if the given variable is a function\n * @function\n * @ignore\n * @argument {*} functionToCheck - variable to check\n * @returns {Boolean} answer to: is a function?\n */\n function isFunction(functionToCheck) {\n var getType = {};\n return functionToCheck && getType.toString.call(functionToCheck) === '[object Function]';\n }\n\n /**\n * Get the position of the given element, relative to its offset parent\n * @function\n * @ignore\n * @param {Element} element\n * @return {Object} position - Coordinates of the element and its `scrollTop`\n */\n function getOffsetRect(element) {\n var elementRect = {\n width: element.offsetWidth,\n height: element.offsetHeight,\n left: element.offsetLeft,\n top: element.offsetTop\n };\n\n elementRect.right = elementRect.left + elementRect.width;\n elementRect.bottom = elementRect.top + elementRect.height;\n\n // position\n return elementRect;\n }\n\n /**\n * Get bounding client rect of given element\n * @function\n * @ignore\n * @param {HTMLElement} element\n * @return {Object} client rect\n */\n function getBoundingClientRect(element) {\n var rect = element.getBoundingClientRect();\n\n // whether the IE version is lower than 11\n var isIE = navigator.userAgent.indexOf(\"MSIE\") != -1;\n\n // fix ie document bounding top always 0 bug\n var rectTop = isIE && element.tagName === 'HTML' ? -element.scrollTop : rect.top;\n\n return {\n left: rect.left,\n top: rectTop,\n right: rect.right,\n bottom: rect.bottom,\n width: rect.right - rect.left,\n height: rect.bottom - rectTop\n };\n }\n\n /**\n * Given an element and one of its parents, return the offset\n * @function\n * @ignore\n * @param {HTMLElement} element\n * @param {HTMLElement} parent\n * @return {Object} rect\n */\n function getOffsetRectRelativeToCustomParent(element, parent, fixed) {\n var elementRect = getBoundingClientRect(element);\n var parentRect = getBoundingClientRect(parent);\n\n if (fixed) {\n var scrollParent = getScrollParent(parent);\n parentRect.top += scrollParent.scrollTop;\n parentRect.bottom += scrollParent.scrollTop;\n parentRect.left += scrollParent.scrollLeft;\n parentRect.right += scrollParent.scrollLeft;\n }\n\n var rect = {\n top: elementRect.top - parentRect.top,\n left: elementRect.left - parentRect.left,\n bottom: elementRect.top - parentRect.top + elementRect.height,\n right: elementRect.left - parentRect.left + elementRect.width,\n width: elementRect.width,\n height: elementRect.height\n };\n return rect;\n }\n\n /**\n * Get the prefixed supported property name\n * @function\n * @ignore\n * @argument {String} property (camelCase)\n * @returns {String} prefixed property (camelCase)\n */\n function getSupportedPropertyName(property) {\n var prefixes = ['', 'ms', 'webkit', 'moz', 'o'];\n\n for (var i = 0; i < prefixes.length; i++) {\n var toCheck = prefixes[i] ? prefixes[i] + property.charAt(0).toUpperCase() + property.slice(1) : property;\n if (typeof root.document.body.style[toCheck] !== 'undefined') {\n return toCheck;\n }\n }\n return null;\n }\n\n /**\n * The Object.assign() method is used to copy the values of all enumerable own properties from one or more source\n * objects to a target object. It will return the target object.\n * This polyfill doesn't support symbol properties, since ES5 doesn't have symbols anyway\n * Source: https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Object/assign\n * @function\n * @ignore\n */\n if (!Object.assign) {\n Object.defineProperty(Object, 'assign', {\n enumerable: false,\n configurable: true,\n writable: true,\n value: function value(target) {\n if (target === undefined || target === null) {\n throw new TypeError('Cannot convert first argument to object');\n }\n\n var to = Object(target);\n for (var i = 1; i < arguments.length; i++) {\n var nextSource = arguments[i];\n if (nextSource === undefined || nextSource === null) {\n continue;\n }\n nextSource = Object(nextSource);\n\n var keysArray = Object.keys(nextSource);\n for (var nextIndex = 0, len = keysArray.length; nextIndex < len; nextIndex++) {\n var nextKey = keysArray[nextIndex];\n var desc = Object.getOwnPropertyDescriptor(nextSource, nextKey);\n if (desc !== undefined && desc.enumerable) {\n to[nextKey] = nextSource[nextKey];\n }\n }\n }\n return to;\n }\n });\n }\n\n return Popper;\n});\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/element-ui/lib/utils/popper.js\n// module id = NMof\n// module chunks = 0","var ctx = require('./_ctx');\nvar call = require('./_iter-call');\nvar isArrayIter = require('./_is-array-iter');\nvar anObject = require('./_an-object');\nvar toLength = require('./_to-length');\nvar getIterFn = require('./core.get-iterator-method');\nvar BREAK = {};\nvar RETURN = {};\nvar exports = module.exports = function (iterable, entries, fn, that, ITERATOR) {\n var iterFn = ITERATOR ? function () { return iterable; } : getIterFn(iterable);\n var f = ctx(fn, that, entries ? 2 : 1);\n var index = 0;\n var length, step, iterator, result;\n if (typeof iterFn != 'function') throw TypeError(iterable + ' is not iterable!');\n // fast case for arrays with default iterator\n if (isArrayIter(iterFn)) for (length = toLength(iterable.length); length > index; index++) {\n result = entries ? f(anObject(step = iterable[index])[0], step[1]) : f(iterable[index]);\n if (result === BREAK || result === RETURN) return result;\n } else for (iterator = iterFn.call(iterable); !(step = iterator.next()).done;) {\n result = call(iterator, f, step.value, entries);\n if (result === BREAK || result === RETURN) return result;\n }\n};\nexports.BREAK = BREAK;\nexports.RETURN = RETURN;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/library/modules/_for-of.js\n// module id = NWt+\n// module chunks = 0","/*!\n * vuex v3.5.1\n * (c) 2020 Evan You\n * @license MIT\n */\nfunction applyMixin (Vue) {\n var version = Number(Vue.version.split('.')[0]);\n\n if (version >= 2) {\n Vue.mixin({ beforeCreate: vuexInit });\n } else {\n // override init and inject vuex init procedure\n // for 1.x backwards compatibility.\n var _init = Vue.prototype._init;\n Vue.prototype._init = function (options) {\n if ( options === void 0 ) options = {};\n\n options.init = options.init\n ? [vuexInit].concat(options.init)\n : vuexInit;\n _init.call(this, options);\n };\n }\n\n /**\n * Vuex init hook, injected into each instances init hooks list.\n */\n\n function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }\n}\n\nvar target = typeof window !== 'undefined'\n ? window\n : typeof global !== 'undefined'\n ? global\n : {};\nvar devtoolHook = target.__VUE_DEVTOOLS_GLOBAL_HOOK__;\n\nfunction devtoolPlugin (store) {\n if (!devtoolHook) { return }\n\n store._devtoolHook = devtoolHook;\n\n devtoolHook.emit('vuex:init', store);\n\n devtoolHook.on('vuex:travel-to-state', function (targetState) {\n store.replaceState(targetState);\n });\n\n store.subscribe(function (mutation, state) {\n devtoolHook.emit('vuex:mutation', mutation, state);\n }, { prepend: true });\n\n store.subscribeAction(function (action, state) {\n devtoolHook.emit('vuex:action', action, state);\n }, { prepend: true });\n}\n\n/**\n * Get the first item that pass the test\n * by second argument function\n *\n * @param {Array} list\n * @param {Function} f\n * @return {*}\n */\nfunction find (list, f) {\n return list.filter(f)[0]\n}\n\n/**\n * Deep copy the given object considering circular structure.\n * This function caches all nested objects and its copies.\n * If it detects circular structure, use cached copy to avoid infinite loop.\n *\n * @param {*} obj\n * @param {Array