{"version":3,"file":"react-pdf-Dr7ew17c.js","sources":["../../node_modules/react-pdf/dist/esm/Message.js","../../node_modules/react-pdf/dist/esm/LinkService.js","../../node_modules/react-pdf/dist/esm/shared/utils.js","../../node_modules/react-pdf/dist/esm/shared/propTypes.js","../../node_modules/react-pdf/dist/esm/Document.js","../../node_modules/react-pdf/dist/esm/OutlineItem.js","../../node_modules/react-pdf/dist/esm/Outline.js","../../node_modules/react-pdf/dist/esm/Page/PageCanvas.js","../../node_modules/react-pdf/dist/esm/Page/PageSVG.js","../../node_modules/react-pdf/dist/esm/Page/TextLayer.js","../../node_modules/react-pdf/dist/esm/Page/AnnotationLayer.js","../../node_modules/react-pdf/dist/esm/Page.js","../../node_modules/react-pdf/dist/esm/entry.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nexport default function Message(_ref) {\n var children = _ref.children,\n type = _ref.type;\n return /*#__PURE__*/React.createElement(\"div\", {\n className: \"react-pdf__message react-pdf__message--\".concat(type)\n }, children);\n}\nMessage.propTypes = {\n children: PropTypes.node,\n type: PropTypes.oneOf(['error', 'loading', 'no-data']).isRequired\n};","import _classCallCheck from \"@babel/runtime/helpers/esm/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/esm/createClass\";\n/* Copyright 2015 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 */\nimport invariant from 'tiny-invariant';\nvar DEFAULT_LINK_REL = 'noopener noreferrer nofollow';\nvar LinkService = /*#__PURE__*/function () {\n function LinkService() {\n _classCallCheck(this, LinkService);\n this.externalLinkTarget = null;\n this.externalLinkRel = null;\n }\n _createClass(LinkService, [{\n key: \"setDocument\",\n value: function setDocument(pdfDocument) {\n this.pdfDocument = pdfDocument;\n }\n }, {\n key: \"setViewer\",\n value: function setViewer(pdfViewer) {\n this.pdfViewer = pdfViewer;\n }\n }, {\n key: \"setExternalLinkRel\",\n value: function setExternalLinkRel(externalLinkRel) {\n this.externalLinkRel = externalLinkRel;\n }\n }, {\n key: \"setExternalLinkTarget\",\n value: function setExternalLinkTarget(externalLinkTarget) {\n this.externalLinkTarget = externalLinkTarget;\n }\n }, {\n key: \"setHistory\",\n value: function setHistory() {}\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 0;\n },\n set: function set(value) {}\n }, {\n key: \"goToDestination\",\n value: function goToDestination(dest) {\n var _this = this;\n new Promise(function (resolve) {\n if (typeof dest === 'string') {\n _this.pdfDocument.getDestination(dest).then(resolve);\n } else if (Array.isArray(dest)) {\n resolve(dest);\n } else {\n dest.then(resolve);\n }\n }).then(function (explicitDest) {\n invariant(Array.isArray(explicitDest), \"\\\"\".concat(explicitDest, \"\\\" is not a valid destination array.\"));\n var destRef = explicitDest[0];\n new Promise(function (resolve) {\n if (destRef instanceof Object) {\n _this.pdfDocument.getPageIndex(destRef).then(function (pageIndex) {\n resolve(pageIndex);\n })[\"catch\"](function () {\n invariant(false, \"\\\"\".concat(destRef, \"\\\" is not a valid page reference.\"));\n });\n } else if (typeof destRef === 'number') {\n resolve(destRef);\n } else {\n invariant(false, \"\\\"\".concat(destRef, \"\\\" is not a valid destination reference.\"));\n }\n }).then(function (pageIndex) {\n var pageNumber = pageIndex + 1;\n invariant(pageNumber >= 1 && pageNumber <= _this.pagesCount, \"\\\"\".concat(pageNumber, \"\\\" is not a valid page number.\"));\n _this.pdfViewer.scrollPageIntoView({\n dest: dest,\n pageIndex: pageIndex,\n pageNumber: pageNumber\n });\n });\n });\n }\n }, {\n key: \"navigateTo\",\n value: function navigateTo(dest) {\n this.goToDestination(dest);\n }\n }, {\n key: \"goToPage\",\n value: function goToPage() {}\n }, {\n key: \"addLinkAttributes\",\n value: function addLinkAttributes(link, url, newWindow) {\n link.href = url;\n link.rel = this.externalLinkRel || DEFAULT_LINK_REL;\n link.target = newWindow ? '_blank' : this.externalLinkTarget || '';\n }\n }, {\n key: \"getDestinationHash\",\n value: function getDestinationHash() {\n return '#';\n }\n }, {\n key: \"getAnchorUrl\",\n value: function getAnchorUrl() {\n return '#';\n }\n }, {\n key: \"setHash\",\n value: function setHash() {}\n }, {\n key: \"executeNamedAction\",\n value: function executeNamedAction() {}\n }, {\n key: \"cachePageRef\",\n value: function cachePageRef() {}\n }, {\n key: \"isPageVisible\",\n value: function isPageVisible() {\n return true;\n }\n }, {\n key: \"isPageCached\",\n value: function isPageCached() {\n return true;\n }\n }]);\n return LinkService;\n}();\nexport { LinkService as default };","import _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport invariant from 'tiny-invariant';\nimport warning from 'tiny-warning';\n\n/**\n * Checks if we're running in a browser environment.\n */\nexport var isBrowser = typeof document !== 'undefined';\n\n/**\n * Checks whether we're running from a local file system.\n */\nexport var isLocalFileSystem = isBrowser && window.location.protocol === 'file:';\n\n/**\n * Checks whether a variable is defined.\n *\n * @param {*} variable Variable to check\n */\nexport function isDefined(variable) {\n return typeof variable !== 'undefined';\n}\n\n/**\n * Checks whether a variable is defined and not null.\n *\n * @param {*} variable Variable to check\n */\nexport function isProvided(variable) {\n return isDefined(variable) && variable !== null;\n}\n\n/**\n * Checks whether a variable provided is a string.\n *\n * @param {*} variable Variable to check\n */\nexport function isString(variable) {\n return typeof variable === 'string';\n}\n\n/**\n * Checks whether a variable provided is an ArrayBuffer.\n *\n * @param {*} variable Variable to check\n */\nexport function isArrayBuffer(variable) {\n return variable instanceof ArrayBuffer;\n}\n\n/**\n * Checks whether a variable provided is a Blob.\n *\n * @param {*} variable Variable to check\n */\nexport function isBlob(variable) {\n invariant(isBrowser, 'isBlob can only be used in a browser environment');\n return variable instanceof Blob;\n}\n\n/**\n * Checks whether a variable provided is a File.\n *\n * @param {*} variable Variable to check\n */\nexport function isFile(variable) {\n invariant(isBrowser, 'isFile can only be used in a browser environment');\n return variable instanceof File;\n}\n\n/**\n * Checks whether a string provided is a data URI.\n *\n * @param {string} str String to check\n */\nexport function isDataURI(str) {\n return isString(str) && /^data:/.test(str);\n}\nexport function dataURItoByteString(dataURI) {\n invariant(isDataURI(dataURI), 'Invalid data URI.');\n var _dataURI$split = dataURI.split(','),\n _dataURI$split2 = _slicedToArray(_dataURI$split, 2),\n headersString = _dataURI$split2[0],\n dataString = _dataURI$split2[1];\n var headers = headersString.split(';');\n if (headers.indexOf('base64') !== -1) {\n return atob(dataString);\n }\n return unescape(dataString);\n}\nexport function getDevicePixelRatio() {\n return isBrowser && window.devicePixelRatio || 1;\n}\nvar allowFileAccessFromFilesTip = 'On Chromium based browsers, you can use --allow-file-access-from-files flag for debugging purposes.';\nexport function displayCORSWarning() {\n warning(!isLocalFileSystem, \"Loading PDF as base64 strings/URLs may not work on protocols other than HTTP/HTTPS. \".concat(allowFileAccessFromFilesTip));\n}\nexport function displayWorkerWarning() {\n warning(!isLocalFileSystem, \"Loading PDF.js worker may not work on protocols other than HTTP/HTTPS. \".concat(allowFileAccessFromFilesTip));\n}\nexport function cancelRunningTask(runningTask) {\n if (runningTask && runningTask.cancel) runningTask.cancel();\n}\nexport function makePageCallback(page, scale) {\n Object.defineProperty(page, 'width', {\n get: function get() {\n return this.view[2] * scale;\n },\n configurable: true\n });\n Object.defineProperty(page, 'height', {\n get: function get() {\n return this.view[3] * scale;\n },\n configurable: true\n });\n Object.defineProperty(page, 'originalWidth', {\n get: function get() {\n return this.view[2];\n },\n configurable: true\n });\n Object.defineProperty(page, 'originalHeight', {\n get: function get() {\n return this.view[3];\n },\n configurable: true\n });\n return page;\n}\nexport function isCancelException(error) {\n return error.name === 'RenderingCancelledException';\n}\nexport function loadFromFile(file) {\n return new Promise(function (resolve, reject) {\n var reader = new FileReader();\n reader.onload = function () {\n return resolve(new Uint8Array(reader.result));\n };\n reader.onerror = function (event) {\n switch (event.target.error.code) {\n case event.target.error.NOT_FOUND_ERR:\n return reject(new Error('Error while reading a file: File not found.'));\n case event.target.error.NOT_READABLE_ERR:\n return reject(new Error('Error while reading a file: File not readable.'));\n case event.target.error.SECURITY_ERR:\n return reject(new Error('Error while reading a file: Security error.'));\n case event.target.error.ABORT_ERR:\n return reject(new Error('Error while reading a file: Aborted.'));\n default:\n return reject(new Error('Error while reading a file.'));\n }\n };\n reader.readAsArrayBuffer(file);\n return null;\n });\n}","import _typeof from \"@babel/runtime/helpers/esm/typeof\";\nimport _toConsumableArray from \"@babel/runtime/helpers/esm/toConsumableArray\";\nimport PropTypes from 'prop-types';\nimport { mouseEvents, touchEvents, keyboardEvents } from 'make-event-props';\nimport { isDefined } from './utils';\nimport LinkService from '../LinkService';\nexport var eventProps = function () {\n var result = {};\n [].concat(_toConsumableArray(mouseEvents), _toConsumableArray(touchEvents), _toConsumableArray(keyboardEvents)).forEach(function (eventName) {\n result[eventName] = PropTypes.func;\n });\n return result;\n}();\nvar fileTypes = [PropTypes.string, PropTypes.instanceOf(ArrayBuffer), PropTypes.shape({\n data: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),\n httpHeaders: PropTypes.object,\n range: PropTypes.object,\n url: PropTypes.string,\n withCredentials: PropTypes.bool\n})];\nif (typeof File !== 'undefined') {\n fileTypes.push(PropTypes.instanceOf(File));\n}\nif (typeof Blob !== 'undefined') {\n fileTypes.push(PropTypes.instanceOf(Blob));\n}\nexport var isClassName = PropTypes.oneOfType([PropTypes.string, PropTypes.arrayOf(PropTypes.string)]);\nexport var isFile = PropTypes.oneOfType(fileTypes);\nexport var isLinkService = PropTypes.instanceOf(LinkService);\nexport var isLinkTarget = PropTypes.oneOf(['_self', '_blank', '_parent', '_top']);\nexport var isPage = PropTypes.shape({\n commonObjs: PropTypes.shape({}).isRequired,\n getAnnotations: PropTypes.func.isRequired,\n getTextContent: PropTypes.func.isRequired,\n getViewport: PropTypes.func.isRequired,\n render: PropTypes.func.isRequired\n});\nexport var isPageIndex = function isPageIndex(props, propName, componentName) {\n var pageIndex = props[propName],\n pageNumber = props.pageNumber,\n pdf = props.pdf;\n if (!isDefined(pdf)) {\n return null;\n }\n if (isDefined(pageIndex)) {\n if (typeof pageIndex !== 'number') {\n return new Error(\"`\".concat(propName, \"` of type `\").concat(_typeof(pageIndex), \"` supplied to `\").concat(componentName, \"`, expected `number`.\"));\n }\n if (pageIndex < 0) {\n return new Error(\"Expected `\".concat(propName, \"` to be greater or equal to 0.\"));\n }\n var numPages = pdf.numPages;\n if (pageIndex + 1 > numPages) {\n return new Error(\"Expected `\".concat(propName, \"` to be less or equal to \").concat(numPages - 1, \".\"));\n }\n } else if (!isDefined(pageNumber)) {\n return new Error(\"`\".concat(propName, \"` not supplied. Either pageIndex or pageNumber must be supplied to `\").concat(componentName, \"`.\"));\n }\n\n // Everything is fine\n return null;\n};\nexport var isPageNumber = function isPageNumber(props, propName, componentName) {\n var pageNumber = props[propName],\n pageIndex = props.pageIndex,\n pdf = props.pdf;\n if (!isDefined(pdf)) {\n return null;\n }\n if (isDefined(pageNumber)) {\n if (typeof pageNumber !== 'number') {\n return new Error(\"`\".concat(propName, \"` of type `\").concat(_typeof(pageNumber), \"` supplied to `\").concat(componentName, \"`, expected `number`.\"));\n }\n if (pageNumber < 1) {\n return new Error(\"Expected `\".concat(propName, \"` to be greater or equal to 1.\"));\n }\n var numPages = pdf.numPages;\n if (pageNumber > numPages) {\n return new Error(\"Expected `\".concat(propName, \"` to be less or equal to \").concat(numPages, \".\"));\n }\n } else if (!isDefined(pageIndex)) {\n return new Error(\"`\".concat(propName, \"` not supplied. Either pageIndex or pageNumber must be supplied to `\").concat(componentName, \"`.\"));\n }\n\n // Everything is fine\n return null;\n};\nexport var isPdf = PropTypes.oneOfType([PropTypes.shape({\n getDestination: PropTypes.func.isRequired,\n getOutline: PropTypes.func.isRequired,\n getPage: PropTypes.func.isRequired,\n numPages: PropTypes.number.isRequired\n}), PropTypes.bool]);\nexport var isRef = PropTypes.oneOfType([PropTypes.func, PropTypes.shape({\n current: PropTypes.any\n})]);\nexport var isRenderMode = PropTypes.oneOf(['canvas', 'none', 'svg']);\nexport var isRotate = PropTypes.oneOf([0, 90, 180, 270]);","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/esm/objectWithoutProperties\";\nimport _typeof from \"@babel/runtime/helpers/esm/typeof\";\nimport _classCallCheck from \"@babel/runtime/helpers/esm/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/esm/createClass\";\nimport _assertThisInitialized from \"@babel/runtime/helpers/esm/assertThisInitialized\";\nimport _inherits from \"@babel/runtime/helpers/esm/inherits\";\nimport _possibleConstructorReturn from \"@babel/runtime/helpers/esm/possibleConstructorReturn\";\nimport _getPrototypeOf from \"@babel/runtime/helpers/esm/getPrototypeOf\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nvar _excluded = [\"url\"];\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\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); }; }\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\n/**\n * Loads a PDF document. Passes it to all children.\n */\nimport React, { PureComponent } from 'react';\nimport PropTypes from 'prop-types';\nimport makeEventProps from 'make-event-props';\nimport makeCancellable from 'make-cancellable-promise';\nimport clsx from 'clsx';\nimport invariant from 'tiny-invariant';\nimport warning from 'tiny-warning';\nimport * as pdfjs from 'pdfjs-dist/build/pdf';\nimport DocumentContext from './DocumentContext';\nimport Message from './Message';\nimport LinkService from './LinkService';\nimport PasswordResponses from './PasswordResponses';\nimport { cancelRunningTask, dataURItoByteString, displayCORSWarning, isArrayBuffer, isBlob, isBrowser, isDataURI, isFile, loadFromFile } from './shared/utils';\nimport { eventProps, isClassName, isFile as isFileProp, isRef } from './shared/propTypes';\nvar PDFDataRangeTransport = pdfjs.PDFDataRangeTransport;\nvar Document = /*#__PURE__*/function (_PureComponent) {\n _inherits(Document, _PureComponent);\n var _super = _createSuper(Document);\n function Document() {\n var _this;\n _classCallCheck(this, Document);\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n _this = _super.call.apply(_super, [this].concat(args));\n _defineProperty(_assertThisInitialized(_this), \"state\", {\n pdf: null\n });\n _defineProperty(_assertThisInitialized(_this), \"viewer\", {\n scrollPageIntoView: function scrollPageIntoView(_ref) {\n var dest = _ref.dest,\n pageIndex = _ref.pageIndex,\n pageNumber = _ref.pageNumber;\n // Handling jumping to internal links target\n var onItemClick = _this.props.onItemClick;\n\n // First, check if custom handling of onItemClick was provided\n if (onItemClick) {\n onItemClick({\n dest: dest,\n pageIndex: pageIndex,\n pageNumber: pageNumber\n });\n return;\n }\n\n // If not, try to look for target page within the .\n var page = _this.pages[pageIndex];\n if (page) {\n // Scroll to the page automatically\n page.scrollIntoView();\n return;\n }\n warning(false, \"An internal link leading to page \".concat(pageNumber, \" was clicked, but neither was provided with onItemClick nor it was able to find the page within itself. Either provide onItemClick to and handle navigating by yourself or ensure that all pages are rendered within .\"));\n }\n });\n _defineProperty(_assertThisInitialized(_this), \"linkService\", new LinkService());\n _defineProperty(_assertThisInitialized(_this), \"loadDocument\", function () {\n // If another rendering is in progress, let's cancel it\n cancelRunningTask(_this.runningTask);\n\n // If another loading is in progress, let's destroy it\n if (_this.loadingTask) _this.loadingTask.destroy();\n var cancellable = makeCancellable(_this.findDocumentSource());\n _this.runningTask = cancellable;\n cancellable.promise.then(function (source) {\n _this.onSourceSuccess();\n if (!source) {\n return;\n }\n _this.setState(function (prevState) {\n if (!prevState.pdf) {\n return null;\n }\n return {\n pdf: null\n };\n });\n var _this$props = _this.props,\n options = _this$props.options,\n onLoadProgress = _this$props.onLoadProgress,\n onPassword = _this$props.onPassword;\n var destroyable = pdfjs.getDocument(_objectSpread(_objectSpread({}, source), options));\n destroyable.onPassword = onPassword;\n if (onLoadProgress) {\n destroyable.onProgress = onLoadProgress;\n }\n _this.loadingTask = destroyable;\n destroyable.promise.then(function (pdf) {\n _this.setState(function (prevState) {\n if (prevState.pdf && prevState.pdf.fingerprint === pdf.fingerprint) {\n return null;\n }\n return {\n pdf: pdf\n };\n }, _this.onLoadSuccess);\n })[\"catch\"](function (error) {\n _this.onLoadError(error);\n });\n })[\"catch\"](function (error) {\n _this.onSourceError(error);\n });\n });\n _defineProperty(_assertThisInitialized(_this), \"setupLinkService\", function () {\n var _this$props2 = _this.props,\n externalLinkRel = _this$props2.externalLinkRel,\n externalLinkTarget = _this$props2.externalLinkTarget;\n _this.linkService.setViewer(_this.viewer);\n _this.linkService.setExternalLinkRel(externalLinkRel);\n _this.linkService.setExternalLinkTarget(externalLinkTarget);\n });\n _defineProperty(_assertThisInitialized(_this), \"onSourceSuccess\", function () {\n var onSourceSuccess = _this.props.onSourceSuccess;\n if (onSourceSuccess) onSourceSuccess();\n });\n _defineProperty(_assertThisInitialized(_this), \"onSourceError\", function (error) {\n warning(error);\n var onSourceError = _this.props.onSourceError;\n if (onSourceError) onSourceError(error);\n });\n _defineProperty(_assertThisInitialized(_this), \"onLoadSuccess\", function () {\n var onLoadSuccess = _this.props.onLoadSuccess;\n var pdf = _this.state.pdf;\n if (onLoadSuccess) onLoadSuccess(pdf);\n _this.pages = new Array(pdf.numPages);\n _this.linkService.setDocument(pdf);\n });\n _defineProperty(_assertThisInitialized(_this), \"onLoadError\", function (error) {\n _this.setState({\n pdf: false\n });\n warning(error);\n var onLoadError = _this.props.onLoadError;\n if (onLoadError) onLoadError(error);\n });\n _defineProperty(_assertThisInitialized(_this), \"findDocumentSource\", function () {\n return new Promise(function (resolve) {\n var file = _this.props.file;\n if (!file) {\n resolve(null);\n }\n\n // File is a string\n if (typeof file === 'string') {\n if (isDataURI(file)) {\n var fileByteString = dataURItoByteString(file);\n resolve({\n data: fileByteString\n });\n }\n displayCORSWarning();\n resolve({\n url: file\n });\n }\n\n // File is PDFDataRangeTransport\n if (file instanceof PDFDataRangeTransport) {\n resolve({\n range: file\n });\n }\n\n // File is an ArrayBuffer\n if (isArrayBuffer(file)) {\n resolve({\n data: file\n });\n }\n\n /**\n * The cases below are browser-only.\n * If you're running on a non-browser environment, these cases will be of no use.\n */\n if (isBrowser) {\n // File is a Blob\n if (isBlob(file) || isFile(file)) {\n loadFromFile(file).then(function (data) {\n resolve({\n data: data\n });\n });\n return;\n }\n }\n\n // At this point, file must be an object\n invariant(_typeof(file) === 'object', 'Invalid parameter in file, need either Uint8Array, string or a parameter object');\n invariant(file.url || file.data || file.range, 'Invalid parameter object: need either .data, .range or .url');\n\n // File .url is a string\n if (typeof file.url === 'string') {\n if (isDataURI(file.url)) {\n var url = file.url,\n otherParams = _objectWithoutProperties(file, _excluded);\n var _fileByteString = dataURItoByteString(url);\n resolve(_objectSpread({\n data: _fileByteString\n }, otherParams));\n }\n displayCORSWarning();\n }\n resolve(file);\n });\n });\n _defineProperty(_assertThisInitialized(_this), \"registerPage\", function (pageIndex, ref) {\n _this.pages[pageIndex] = ref;\n });\n _defineProperty(_assertThisInitialized(_this), \"unregisterPage\", function (pageIndex) {\n delete _this.pages[pageIndex];\n });\n return _this;\n }\n _createClass(Document, [{\n key: \"componentDidMount\",\n value: function componentDidMount() {\n this.loadDocument();\n this.setupLinkService();\n }\n }, {\n key: \"componentDidUpdate\",\n value: function componentDidUpdate(prevProps) {\n var file = this.props.file;\n if (file !== prevProps.file) {\n this.loadDocument();\n }\n }\n }, {\n key: \"componentWillUnmount\",\n value: function componentWillUnmount() {\n // If rendering is in progress, let's cancel it\n cancelRunningTask(this.runningTask);\n\n // If loading is in progress, let's destroy it\n if (this.loadingTask) this.loadingTask.destroy();\n }\n }, {\n key: \"childContext\",\n get: function get() {\n var linkService = this.linkService,\n registerPage = this.registerPage,\n unregisterPage = this.unregisterPage;\n var _this$props3 = this.props,\n imageResourcesPath = _this$props3.imageResourcesPath,\n renderMode = _this$props3.renderMode,\n rotate = _this$props3.rotate;\n var pdf = this.state.pdf;\n return {\n imageResourcesPath: imageResourcesPath,\n linkService: linkService,\n pdf: pdf,\n registerPage: registerPage,\n renderMode: renderMode,\n rotate: rotate,\n unregisterPage: unregisterPage\n };\n }\n }, {\n key: \"eventProps\",\n get: function get() {\n var _this2 = this;\n return makeEventProps(this.props, function () {\n return _this2.state.pdf;\n });\n }\n\n /**\n * Called when a document source is resolved correctly\n */\n }, {\n key: \"renderChildren\",\n value: function renderChildren() {\n var children = this.props.children;\n return /*#__PURE__*/React.createElement(DocumentContext.Provider, {\n value: this.childContext\n }, children);\n }\n }, {\n key: \"renderContent\",\n value: function renderContent() {\n var file = this.props.file;\n var pdf = this.state.pdf;\n if (!file) {\n var noData = this.props.noData;\n return /*#__PURE__*/React.createElement(Message, {\n type: \"no-data\"\n }, typeof noData === 'function' ? noData() : noData);\n }\n if (pdf === null) {\n var loading = this.props.loading;\n return /*#__PURE__*/React.createElement(Message, {\n type: \"loading\"\n }, typeof loading === 'function' ? loading() : loading);\n }\n if (pdf === false) {\n var error = this.props.error;\n return /*#__PURE__*/React.createElement(Message, {\n type: \"error\"\n }, typeof error === 'function' ? error() : error);\n }\n return this.renderChildren();\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this$props4 = this.props,\n className = _this$props4.className,\n inputRef = _this$props4.inputRef;\n return /*#__PURE__*/React.createElement(\"div\", _extends({\n className: clsx('react-pdf__Document', className),\n ref: inputRef\n }, this.eventProps), this.renderContent());\n }\n }]);\n return Document;\n}(PureComponent);\nexport { Document as default };\nDocument.defaultProps = {\n error: 'Failed to load PDF file.',\n loading: 'Loading PDF…',\n noData: 'No PDF file specified.',\n onPassword: function onPassword(callback, reason) {\n switch (reason) {\n case PasswordResponses.NEED_PASSWORD:\n {\n // eslint-disable-next-line no-alert\n var password = prompt('Enter the password to open this PDF file.');\n callback(password);\n break;\n }\n case PasswordResponses.INCORRECT_PASSWORD:\n {\n // eslint-disable-next-line no-alert\n var _password = prompt('Invalid password. Please try again.');\n callback(_password);\n break;\n }\n default:\n }\n }\n};\nvar isFunctionOrNode = PropTypes.oneOfType([PropTypes.func, PropTypes.node]);\nDocument.propTypes = _objectSpread(_objectSpread({}, eventProps), {}, {\n children: PropTypes.node,\n className: isClassName,\n error: isFunctionOrNode,\n externalLinkRel: PropTypes.string,\n externalLinkTarget: PropTypes.string,\n file: isFileProp,\n imageResourcesPath: PropTypes.string,\n inputRef: isRef,\n loading: isFunctionOrNode,\n noData: isFunctionOrNode,\n onItemClick: PropTypes.func,\n onLoadError: PropTypes.func,\n onLoadProgress: PropTypes.func,\n onLoadSuccess: PropTypes.func,\n onPassword: PropTypes.func,\n onSourceError: PropTypes.func,\n onSourceSuccess: PropTypes.func,\n rotate: PropTypes.number\n});","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/esm/objectWithoutProperties\";\nimport _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport _classCallCheck from \"@babel/runtime/helpers/esm/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/esm/createClass\";\nimport _assertThisInitialized from \"@babel/runtime/helpers/esm/assertThisInitialized\";\nimport _inherits from \"@babel/runtime/helpers/esm/inherits\";\nimport _possibleConstructorReturn from \"@babel/runtime/helpers/esm/possibleConstructorReturn\";\nimport _getPrototypeOf from \"@babel/runtime/helpers/esm/getPrototypeOf\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nvar _excluded = [\"item\"];\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); }; }\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\nimport React, { PureComponent } from 'react';\nimport PropTypes from 'prop-types';\nimport DocumentContext from './DocumentContext';\nimport OutlineContext from './OutlineContext';\nimport Ref from './Ref';\nimport { isDefined } from './shared/utils';\nimport { isPdf } from './shared/propTypes';\nexport var OutlineItemInternal = /*#__PURE__*/function (_PureComponent) {\n _inherits(OutlineItemInternal, _PureComponent);\n var _super = _createSuper(OutlineItemInternal);\n function OutlineItemInternal() {\n var _this;\n _classCallCheck(this, OutlineItemInternal);\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n _this = _super.call.apply(_super, [this].concat(args));\n _defineProperty(_assertThisInitialized(_this), \"getDestination\", function () {\n return new Promise(function (resolve, reject) {\n if (isDefined(_this.destination)) {\n resolve(_this.destination);\n return;\n }\n var _this$props = _this.props,\n item = _this$props.item,\n pdf = _this$props.pdf;\n if (typeof item.dest === 'string') {\n pdf.getDestination(item.dest).then(resolve)[\"catch\"](reject);\n } else {\n resolve(item.dest);\n }\n }).then(function (destination) {\n _this.destination = destination;\n return destination;\n });\n });\n _defineProperty(_assertThisInitialized(_this), \"getPageIndex\", function () {\n return new Promise(function (resolve, reject) {\n var pdf = _this.props.pdf;\n if (isDefined(_this.pageIndex)) {\n resolve(_this.pageIndex);\n return;\n }\n _this.getDestination().then(function (destination) {\n if (!destination) {\n return;\n }\n var _destination = _slicedToArray(destination, 1),\n ref = _destination[0];\n pdf.getPageIndex(new Ref(ref)).then(resolve)[\"catch\"](reject);\n });\n }).then(function (pageIndex) {\n _this.pageIndex = pageIndex;\n return _this.pageIndex;\n });\n });\n _defineProperty(_assertThisInitialized(_this), \"getPageNumber\", function () {\n return new Promise(function (resolve, reject) {\n if (isDefined(_this.pageNumber)) {\n resolve(_this.pageNumber);\n return;\n }\n _this.getPageIndex().then(function (pageIndex) {\n resolve(pageIndex + 1);\n })[\"catch\"](reject);\n }).then(function (pageNumber) {\n _this.pageNumber = pageNumber;\n return pageNumber;\n });\n });\n _defineProperty(_assertThisInitialized(_this), \"onClick\", function (event) {\n var onClick = _this.props.onClick;\n event.preventDefault();\n if (!onClick) {\n return false;\n }\n return Promise.all([_this.getDestination(), _this.getPageIndex(), _this.getPageNumber()]).then(function (_ref) {\n var _ref2 = _slicedToArray(_ref, 3),\n dest = _ref2[0],\n pageIndex = _ref2[1],\n pageNumber = _ref2[2];\n onClick({\n dest: dest,\n pageIndex: pageIndex,\n pageNumber: pageNumber\n });\n });\n });\n return _this;\n }\n _createClass(OutlineItemInternal, [{\n key: \"renderSubitems\",\n value: function renderSubitems() {\n var _this$props2 = this.props,\n item = _this$props2.item,\n otherProps = _objectWithoutProperties(_this$props2, _excluded);\n if (!item.items || !item.items.length) {\n return null;\n }\n var subitems = item.items;\n return /*#__PURE__*/React.createElement(\"ul\", null, subitems.map(function (subitem, subitemIndex) {\n return /*#__PURE__*/React.createElement(OutlineItemInternal, _extends({\n key: typeof subitem.destination === 'string' ? subitem.destination : subitemIndex,\n item: subitem\n }, otherProps));\n }));\n }\n }, {\n key: \"render\",\n value: function render() {\n var item = this.props.item;\n return /*#__PURE__*/React.createElement(\"li\", null, /*#__PURE__*/React.createElement(\"a\", {\n href: \"#\",\n onClick: this.onClick\n }, item.title), this.renderSubitems());\n }\n }]);\n return OutlineItemInternal;\n}(PureComponent);\nvar isDestination = PropTypes.oneOfType([PropTypes.string, PropTypes.arrayOf(PropTypes.any)]);\nOutlineItemInternal.propTypes = {\n item: PropTypes.shape({\n dest: isDestination,\n items: PropTypes.arrayOf(PropTypes.shape({\n dest: isDestination,\n title: PropTypes.string\n })),\n title: PropTypes.string\n }).isRequired,\n onClick: PropTypes.func,\n pdf: isPdf.isRequired\n};\nvar OutlineItem = function OutlineItem(props) {\n return /*#__PURE__*/React.createElement(DocumentContext.Consumer, null, function (documentContext) {\n return /*#__PURE__*/React.createElement(OutlineContext.Consumer, null, function (outlineContext) {\n return /*#__PURE__*/React.createElement(OutlineItemInternal, _extends({}, documentContext, outlineContext, props));\n });\n });\n};\nexport default OutlineItem;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _classCallCheck from \"@babel/runtime/helpers/esm/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/esm/createClass\";\nimport _assertThisInitialized from \"@babel/runtime/helpers/esm/assertThisInitialized\";\nimport _inherits from \"@babel/runtime/helpers/esm/inherits\";\nimport _possibleConstructorReturn from \"@babel/runtime/helpers/esm/possibleConstructorReturn\";\nimport _getPrototypeOf from \"@babel/runtime/helpers/esm/getPrototypeOf\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\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); }; }\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\nimport React, { PureComponent } from 'react';\nimport PropTypes from 'prop-types';\nimport makeCancellable from 'make-cancellable-promise';\nimport makeEventProps from 'make-event-props';\nimport clsx from 'clsx';\nimport invariant from 'tiny-invariant';\nimport warning from 'tiny-warning';\nimport DocumentContext from './DocumentContext';\nimport OutlineContext from './OutlineContext';\nimport OutlineItem from './OutlineItem';\nimport { cancelRunningTask } from './shared/utils';\nimport { eventProps, isClassName, isPdf, isRef } from './shared/propTypes';\nexport var OutlineInternal = /*#__PURE__*/function (_PureComponent) {\n _inherits(OutlineInternal, _PureComponent);\n var _super = _createSuper(OutlineInternal);\n function OutlineInternal() {\n var _this;\n _classCallCheck(this, OutlineInternal);\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n _this = _super.call.apply(_super, [this].concat(args));\n _defineProperty(_assertThisInitialized(_this), \"state\", {\n outline: null\n });\n _defineProperty(_assertThisInitialized(_this), \"loadOutline\", function () {\n var pdf = _this.props.pdf;\n _this.setState(function (prevState) {\n if (!prevState.outline) {\n return null;\n }\n return {\n outline: null\n };\n });\n var cancellable = makeCancellable(pdf.getOutline());\n _this.runningTask = cancellable;\n cancellable.promise.then(function (outline) {\n _this.setState({\n outline: outline\n }, _this.onLoadSuccess);\n })[\"catch\"](function (error) {\n _this.onLoadError(error);\n });\n });\n _defineProperty(_assertThisInitialized(_this), \"onLoadSuccess\", function () {\n var onLoadSuccess = _this.props.onLoadSuccess;\n var outline = _this.state.outline;\n if (onLoadSuccess) onLoadSuccess(outline);\n });\n _defineProperty(_assertThisInitialized(_this), \"onLoadError\", function (error) {\n _this.setState({\n outline: false\n });\n warning(error);\n var onLoadError = _this.props.onLoadError;\n if (onLoadError) onLoadError(error);\n });\n _defineProperty(_assertThisInitialized(_this), \"onItemClick\", function (_ref) {\n var dest = _ref.dest,\n pageIndex = _ref.pageIndex,\n pageNumber = _ref.pageNumber;\n var onItemClick = _this.props.onItemClick;\n if (onItemClick) {\n onItemClick({\n dest: dest,\n pageIndex: pageIndex,\n pageNumber: pageNumber\n });\n }\n });\n return _this;\n }\n _createClass(OutlineInternal, [{\n key: \"componentDidMount\",\n value: function componentDidMount() {\n var pdf = this.props.pdf;\n invariant(pdf, 'Attempted to load an outline, but no document was specified.');\n this.loadOutline();\n }\n }, {\n key: \"componentDidUpdate\",\n value: function componentDidUpdate(prevProps) {\n var pdf = this.props.pdf;\n if (prevProps.pdf && pdf !== prevProps.pdf) {\n this.loadOutline();\n }\n }\n }, {\n key: \"componentWillUnmount\",\n value: function componentWillUnmount() {\n cancelRunningTask(this.runningTask);\n }\n }, {\n key: \"childContext\",\n get: function get() {\n return {\n onClick: this.onItemClick\n };\n }\n }, {\n key: \"eventProps\",\n get: function get() {\n var _this2 = this;\n return makeEventProps(this.props, function () {\n return _this2.state.outline;\n });\n }\n\n /**\n * Called when an outline is read successfully\n */\n }, {\n key: \"renderOutline\",\n value: function renderOutline() {\n var outline = this.state.outline;\n return /*#__PURE__*/React.createElement(\"ul\", null, outline.map(function (item, itemIndex) {\n return /*#__PURE__*/React.createElement(OutlineItem, {\n key: typeof item.destination === 'string' ? item.destination : itemIndex,\n item: item\n });\n }));\n }\n }, {\n key: \"render\",\n value: function render() {\n var pdf = this.props.pdf;\n var outline = this.state.outline;\n if (!pdf || !outline) {\n return null;\n }\n var _this$props = this.props,\n className = _this$props.className,\n inputRef = _this$props.inputRef;\n return /*#__PURE__*/React.createElement(\"div\", _extends({\n className: clsx('react-pdf__Outline', className),\n ref: inputRef\n }, this.eventProps), /*#__PURE__*/React.createElement(OutlineContext.Provider, {\n value: this.childContext\n }, this.renderOutline()));\n }\n }]);\n return OutlineInternal;\n}(PureComponent);\nOutlineInternal.propTypes = _objectSpread({\n className: isClassName,\n inputRef: isRef,\n onItemClick: PropTypes.func,\n onLoadError: PropTypes.func,\n onLoadSuccess: PropTypes.func,\n pdf: isPdf\n}, eventProps);\nfunction Outline(props, ref) {\n return /*#__PURE__*/React.createElement(DocumentContext.Consumer, null, function (context) {\n return /*#__PURE__*/React.createElement(OutlineInternal, _extends({\n ref: ref\n }, context, props));\n });\n}\nexport default /*#__PURE__*/React.forwardRef(Outline);","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _classCallCheck from \"@babel/runtime/helpers/esm/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/esm/createClass\";\nimport _assertThisInitialized from \"@babel/runtime/helpers/esm/assertThisInitialized\";\nimport _inherits from \"@babel/runtime/helpers/esm/inherits\";\nimport _possibleConstructorReturn from \"@babel/runtime/helpers/esm/possibleConstructorReturn\";\nimport _getPrototypeOf from \"@babel/runtime/helpers/esm/getPrototypeOf\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\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); }; }\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\nimport React, { createRef, PureComponent } from 'react';\nimport PropTypes from 'prop-types';\nimport mergeRefs from 'merge-refs';\nimport warning from 'tiny-warning';\nimport * as pdfjs from 'pdfjs-dist/build/pdf';\nimport PageContext from '../PageContext';\nimport { getDevicePixelRatio, isCancelException, makePageCallback } from '../shared/utils';\nimport { isPage, isRef, isRotate } from '../shared/propTypes';\nvar ANNOTATION_MODE = pdfjs.AnnotationMode;\nexport var PageCanvasInternal = /*#__PURE__*/function (_PureComponent) {\n _inherits(PageCanvasInternal, _PureComponent);\n var _super = _createSuper(PageCanvasInternal);\n function PageCanvasInternal() {\n var _this;\n _classCallCheck(this, PageCanvasInternal);\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n _this = _super.call.apply(_super, [this].concat(args));\n _defineProperty(_assertThisInitialized(_this), \"canvasElement\", /*#__PURE__*/createRef());\n _defineProperty(_assertThisInitialized(_this), \"onRenderSuccess\", function () {\n _this.renderer = null;\n var _this$props = _this.props,\n onRenderSuccess = _this$props.onRenderSuccess,\n page = _this$props.page,\n scale = _this$props.scale;\n if (onRenderSuccess) onRenderSuccess(makePageCallback(page, scale));\n });\n _defineProperty(_assertThisInitialized(_this), \"onRenderError\", function (error) {\n if (isCancelException(error)) {\n return;\n }\n warning(error);\n var onRenderError = _this.props.onRenderError;\n if (onRenderError) onRenderError(error);\n });\n _defineProperty(_assertThisInitialized(_this), \"drawPageOnCanvas\", function () {\n var canvas = _this.canvasElement.current;\n if (!canvas) {\n return null;\n }\n var _assertThisInitialize = _assertThisInitialized(_this),\n renderViewport = _assertThisInitialize.renderViewport,\n viewport = _assertThisInitialize.viewport;\n var _this$props2 = _this.props,\n canvasBackground = _this$props2.canvasBackground,\n page = _this$props2.page,\n renderForms = _this$props2.renderForms;\n canvas.width = renderViewport.width;\n canvas.height = renderViewport.height;\n canvas.style.width = \"\".concat(Math.floor(viewport.width), \"px\");\n canvas.style.height = \"\".concat(Math.floor(viewport.height), \"px\");\n var renderContext = {\n annotationMode: renderForms ? ANNOTATION_MODE.ENABLE_FORMS : ANNOTATION_MODE.ENABLE,\n get canvasContext() {\n return canvas.getContext('2d', {\n alpha: false\n });\n },\n viewport: renderViewport\n };\n if (canvasBackground) {\n renderContext.background = canvasBackground;\n }\n\n // If another render is in progress, let's cancel it\n _this.cancelRenderingTask();\n var cancellable = page.render(renderContext);\n _this.renderer = cancellable;\n return cancellable.promise.then(_this.onRenderSuccess)[\"catch\"](_this.onRenderError);\n });\n return _this;\n }\n _createClass(PageCanvasInternal, [{\n key: \"componentDidMount\",\n value: function componentDidMount() {\n this.drawPageOnCanvas();\n }\n }, {\n key: \"componentDidUpdate\",\n value: function componentDidUpdate(prevProps) {\n var _this$props3 = this.props,\n canvasBackground = _this$props3.canvasBackground,\n devicePixelRatio = _this$props3.devicePixelRatio,\n page = _this$props3.page,\n renderForms = _this$props3.renderForms;\n if (canvasBackground !== prevProps.canvasBackground || devicePixelRatio !== prevProps.devicePixelRatio || renderForms !== prevProps.renderForms) {\n // Ensures the canvas will be re-rendered from scratch. Otherwise all form data will stay.\n page.cleanup();\n this.drawPageOnCanvas();\n }\n }\n }, {\n key: \"componentWillUnmount\",\n value: function componentWillUnmount() {\n this.cancelRenderingTask();\n var canvas = this.canvasElement.current;\n\n /**\n * Zeroing the width and height cause most browsers to release graphics\n * resources immediately, which can greatly reduce memory consumption.\n */\n if (canvas) {\n canvas.width = 0;\n canvas.height = 0;\n }\n }\n }, {\n key: \"cancelRenderingTask\",\n value: function cancelRenderingTask() {\n if (this.renderer) {\n this.renderer.cancel();\n this.renderer = null;\n }\n }\n\n /**\n * Called when a page is rendered successfully.\n */\n }, {\n key: \"devicePixelRatio\",\n get: function get() {\n var devicePixelRatio = this.props.devicePixelRatio;\n return devicePixelRatio || getDevicePixelRatio();\n }\n }, {\n key: \"renderViewport\",\n get: function get() {\n var devicePixelRatio = this.devicePixelRatio;\n var _this$props4 = this.props,\n page = _this$props4.page,\n rotate = _this$props4.rotate,\n scale = _this$props4.scale;\n return page.getViewport({\n scale: scale * devicePixelRatio,\n rotation: rotate\n });\n }\n }, {\n key: \"viewport\",\n get: function get() {\n var _this$props5 = this.props,\n page = _this$props5.page,\n rotate = _this$props5.rotate,\n scale = _this$props5.scale;\n return page.getViewport({\n scale: scale,\n rotation: rotate\n });\n }\n }, {\n key: \"render\",\n value: function render() {\n var canvasRef = this.props.canvasRef;\n return /*#__PURE__*/React.createElement(\"canvas\", {\n className: \"react-pdf__Page__canvas\",\n dir: \"ltr\",\n ref: mergeRefs(canvasRef, this.canvasElement),\n style: {\n display: 'block',\n userSelect: 'none'\n }\n });\n }\n }]);\n return PageCanvasInternal;\n}(PureComponent);\nPageCanvasInternal.propTypes = {\n canvasBackground: PropTypes.string,\n canvasRef: isRef,\n devicePixelRatio: PropTypes.number,\n onRenderError: PropTypes.func,\n onRenderSuccess: PropTypes.func,\n page: isPage.isRequired,\n renderForms: PropTypes.bool,\n rotate: isRotate,\n scale: PropTypes.number.isRequired\n};\nexport default function PageCanvas(props) {\n return /*#__PURE__*/React.createElement(PageContext.Consumer, null, function (context) {\n return /*#__PURE__*/React.createElement(PageCanvasInternal, _extends({}, context, props));\n });\n}","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _classCallCheck from \"@babel/runtime/helpers/esm/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/esm/createClass\";\nimport _assertThisInitialized from \"@babel/runtime/helpers/esm/assertThisInitialized\";\nimport _inherits from \"@babel/runtime/helpers/esm/inherits\";\nimport _possibleConstructorReturn from \"@babel/runtime/helpers/esm/possibleConstructorReturn\";\nimport _getPrototypeOf from \"@babel/runtime/helpers/esm/getPrototypeOf\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\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); }; }\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\nimport React, { PureComponent } from 'react';\nimport PropTypes from 'prop-types';\nimport warning from 'tiny-warning';\nimport * as pdfjs from 'pdfjs-dist/build/pdf';\nimport PageContext from '../PageContext';\nimport { isCancelException, makePageCallback } from '../shared/utils';\nimport { isPage, isRotate } from '../shared/propTypes';\nexport var PageSVGInternal = /*#__PURE__*/function (_PureComponent) {\n _inherits(PageSVGInternal, _PureComponent);\n var _super = _createSuper(PageSVGInternal);\n function PageSVGInternal() {\n var _this;\n _classCallCheck(this, PageSVGInternal);\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n _this = _super.call.apply(_super, [this].concat(args));\n _defineProperty(_assertThisInitialized(_this), \"state\", {\n svg: null\n });\n _defineProperty(_assertThisInitialized(_this), \"onRenderSuccess\", function () {\n _this.renderer = null;\n var _this$props = _this.props,\n onRenderSuccess = _this$props.onRenderSuccess,\n page = _this$props.page,\n scale = _this$props.scale;\n if (onRenderSuccess) onRenderSuccess(makePageCallback(page, scale));\n });\n _defineProperty(_assertThisInitialized(_this), \"onRenderError\", function (error) {\n if (isCancelException(error)) {\n return;\n }\n warning(error);\n var onRenderError = _this.props.onRenderError;\n if (onRenderError) onRenderError(error);\n });\n _defineProperty(_assertThisInitialized(_this), \"renderSVG\", function () {\n var page = _this.props.page;\n _this.renderer = page.getOperatorList();\n return _this.renderer.then(function (operatorList) {\n var svgGfx = new pdfjs.SVGGraphics(page.commonObjs, page.objs);\n _this.renderer = svgGfx.getSVG(operatorList, _this.viewport).then(function (svg) {\n _this.setState({\n svg: svg\n }, _this.onRenderSuccess);\n })[\"catch\"](_this.onRenderError);\n })[\"catch\"](_this.onRenderError);\n });\n _defineProperty(_assertThisInitialized(_this), \"drawPageOnContainer\", function (element) {\n var svg = _this.state.svg;\n if (!element || !svg) {\n return;\n }\n\n // Append SVG element to the main container, if this hasn't been done already\n if (!element.firstElementChild) {\n element.appendChild(svg);\n }\n var _this$viewport = _this.viewport,\n width = _this$viewport.width,\n height = _this$viewport.height;\n svg.setAttribute('width', width);\n svg.setAttribute('height', height);\n });\n return _this;\n }\n _createClass(PageSVGInternal, [{\n key: \"componentDidMount\",\n value: function componentDidMount() {\n this.renderSVG();\n }\n\n /**\n * Called when a page is rendered successfully.\n */\n }, {\n key: \"viewport\",\n get: function get() {\n var _this$props2 = this.props,\n page = _this$props2.page,\n rotate = _this$props2.rotate,\n scale = _this$props2.scale;\n return page.getViewport({\n scale: scale,\n rotation: rotate\n });\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this2 = this;\n var _this$viewport2 = this.viewport,\n width = _this$viewport2.width,\n height = _this$viewport2.height;\n return /*#__PURE__*/React.createElement(\"div\", {\n className: \"react-pdf__Page__svg\"\n // Note: This cannot be shortened, as we need this function to be called with each render.\n ,\n ref: function ref(_ref) {\n return _this2.drawPageOnContainer(_ref);\n },\n style: {\n display: 'block',\n backgroundColor: 'white',\n overflow: 'hidden',\n width: width,\n height: height,\n userSelect: 'none'\n }\n });\n }\n }]);\n return PageSVGInternal;\n}(PureComponent);\nPageSVGInternal.propTypes = {\n onRenderError: PropTypes.func,\n onRenderSuccess: PropTypes.func,\n page: isPage.isRequired,\n rotate: isRotate,\n scale: PropTypes.number.isRequired\n};\nexport default function PageSVG(props) {\n return /*#__PURE__*/React.createElement(PageContext.Consumer, null, function (context) {\n return /*#__PURE__*/React.createElement(PageSVGInternal, _extends({}, context, props));\n });\n}","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _classCallCheck from \"@babel/runtime/helpers/esm/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/esm/createClass\";\nimport _assertThisInitialized from \"@babel/runtime/helpers/esm/assertThisInitialized\";\nimport _inherits from \"@babel/runtime/helpers/esm/inherits\";\nimport _possibleConstructorReturn from \"@babel/runtime/helpers/esm/possibleConstructorReturn\";\nimport _getPrototypeOf from \"@babel/runtime/helpers/esm/getPrototypeOf\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\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); }; }\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\nimport React, { createRef, PureComponent } from 'react';\nimport PropTypes from 'prop-types';\nimport makeCancellable from 'make-cancellable-promise';\nimport invariant from 'tiny-invariant';\nimport warning from 'tiny-warning';\nimport * as pdfjs from 'pdfjs-dist/build/pdf';\nimport PageContext from '../PageContext';\nimport { cancelRunningTask } from '../shared/utils';\nimport { isPage, isRotate } from '../shared/propTypes';\nexport var TextLayerInternal = /*#__PURE__*/function (_PureComponent) {\n _inherits(TextLayerInternal, _PureComponent);\n var _super = _createSuper(TextLayerInternal);\n function TextLayerInternal() {\n var _this;\n _classCallCheck(this, TextLayerInternal);\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n _this = _super.call.apply(_super, [this].concat(args));\n _defineProperty(_assertThisInitialized(_this), \"state\", {\n textContent: null\n });\n _defineProperty(_assertThisInitialized(_this), \"layerElement\", /*#__PURE__*/createRef());\n _defineProperty(_assertThisInitialized(_this), \"endElement\", /*#__PURE__*/createRef());\n _defineProperty(_assertThisInitialized(_this), \"loadTextContent\", function () {\n var page = _this.props.page;\n var cancellable = makeCancellable(page.getTextContent());\n _this.runningTask = cancellable;\n cancellable.promise.then(function (textContent) {\n _this.setState({\n textContent: textContent\n }, _this.onLoadSuccess);\n })[\"catch\"](function (error) {\n _this.onLoadError(error);\n });\n });\n _defineProperty(_assertThisInitialized(_this), \"onLoadSuccess\", function () {\n var onGetTextSuccess = _this.props.onGetTextSuccess;\n var textContent = _this.state.textContent;\n if (onGetTextSuccess) onGetTextSuccess(textContent);\n });\n _defineProperty(_assertThisInitialized(_this), \"onLoadError\", function (error) {\n _this.setState({\n textItems: false\n });\n warning(error);\n var onGetTextError = _this.props.onGetTextError;\n if (onGetTextError) onGetTextError(error);\n });\n _defineProperty(_assertThisInitialized(_this), \"onRenderSuccess\", function () {\n var onRenderTextLayerSuccess = _this.props.onRenderTextLayerSuccess;\n if (onRenderTextLayerSuccess) onRenderTextLayerSuccess();\n });\n _defineProperty(_assertThisInitialized(_this), \"onRenderError\", function (error) {\n warning(error);\n var onRenderTextLayerError = _this.props.onRenderTextLayerError;\n if (onRenderTextLayerError) onRenderTextLayerError(error);\n });\n _defineProperty(_assertThisInitialized(_this), \"onMouseDown\", function () {\n var end = _this.endElement.current;\n if (!end) {\n return;\n }\n end.classList.add('active');\n });\n _defineProperty(_assertThisInitialized(_this), \"onMouseUp\", function () {\n var end = _this.endElement.current;\n if (!end) {\n return;\n }\n end.classList.remove('active');\n });\n return _this;\n }\n _createClass(TextLayerInternal, [{\n key: \"componentDidMount\",\n value: function componentDidMount() {\n var page = this.props.page;\n invariant(page, 'Attempted to load page text content, but no page was specified.');\n warning(parseInt(window.getComputedStyle(document.body).getPropertyValue('--react-pdf-text-layer'), 10) === 1, 'TextLayer styles not found. Read more: https://github.com/wojtekmaj/react-pdf#support-for-text-layer');\n this.loadTextContent();\n }\n }, {\n key: \"componentDidUpdate\",\n value: function componentDidUpdate(prevProps) {\n var page = this.props.page;\n if (prevProps.page && page !== prevProps.page) {\n this.loadTextContent();\n }\n }\n }, {\n key: \"componentWillUnmount\",\n value: function componentWillUnmount() {\n cancelRunningTask(this.runningTask);\n }\n }, {\n key: \"viewport\",\n get: function get() {\n var _this$props = this.props,\n page = _this$props.page,\n rotate = _this$props.rotate,\n scale = _this$props.scale;\n return page.getViewport({\n scale: scale,\n rotation: rotate\n });\n }\n }, {\n key: \"unrotatedViewport\",\n get: function get() {\n var _this$props2 = this.props,\n page = _this$props2.page,\n scale = _this$props2.scale;\n return page.getViewport({\n scale: scale\n });\n }\n\n /**\n * It might happen that the page is rotated by default. In such cases, we shouldn't rotate\n * text content.\n */\n }, {\n key: \"rotate\",\n get: function get() {\n var _this$props3 = this.props,\n page = _this$props3.page,\n rotate = _this$props3.rotate;\n return rotate - page.rotate;\n }\n }, {\n key: \"renderTextLayer\",\n value: function renderTextLayer() {\n var _this2 = this;\n var textContent = this.state.textContent;\n if (!textContent) {\n return null;\n }\n var container = this.layerElement.current;\n var viewport = this.viewport;\n var _this$props4 = this.props,\n customTextRenderer = _this$props4.customTextRenderer,\n pageIndex = _this$props4.pageIndex,\n pageNumber = _this$props4.pageNumber;\n\n // If another rendering is in progress, let's cancel it\n cancelRunningTask(this.runningTask);\n container.innerHTML = '';\n var parameters = {\n container: container,\n textContent: textContent,\n viewport: viewport\n };\n var cancellable = pdfjs.renderTextLayer(parameters);\n this.runningTask = cancellable;\n cancellable.promise.then(function () {\n var end = document.createElement('div');\n end.className = 'endOfContent';\n container.append(end);\n _this2.endElement.current = end;\n if (customTextRenderer) {\n var index = 0;\n textContent.items.forEach(function (item, itemIndex) {\n var child = _this2.layerElement.current.children[index];\n var content = customTextRenderer(_objectSpread({\n pageIndex: pageIndex,\n pageNumber: pageNumber,\n itemIndex: itemIndex\n }, item));\n child.innerHTML = content;\n index += item.str && item.hasEOL ? 2 : 1;\n });\n }\n _this2.onRenderSuccess();\n })[\"catch\"](function (error) {\n _this2.onRenderError(error);\n });\n }\n }, {\n key: \"render\",\n value: function render() {\n return (\n /*#__PURE__*/\n // eslint-disable-next-line jsx-a11y/no-static-element-interactions\n React.createElement(\"div\", {\n className: \"react-pdf__Page__textContent textLayer\",\n onMouseUp: this.onMouseUp,\n onMouseDown: this.onMouseDown,\n ref: this.layerElement\n }, this.renderTextLayer())\n );\n }\n }]);\n return TextLayerInternal;\n}(PureComponent);\nTextLayerInternal.propTypes = {\n customTextRenderer: PropTypes.func,\n onGetTextError: PropTypes.func,\n onGetTextSuccess: PropTypes.func,\n onRenderTextLayerError: PropTypes.func,\n onRenderTextLayerSuccess: PropTypes.func,\n page: isPage.isRequired,\n pageIndex: PropTypes.number.isRequired,\n pageNumber: PropTypes.number.isRequired,\n rotate: isRotate,\n scale: PropTypes.number\n};\nexport default function TextLayer(props) {\n return /*#__PURE__*/React.createElement(PageContext.Consumer, null, function (context) {\n return /*#__PURE__*/React.createElement(TextLayerInternal, _extends({}, context, props));\n });\n}","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _classCallCheck from \"@babel/runtime/helpers/esm/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/esm/createClass\";\nimport _assertThisInitialized from \"@babel/runtime/helpers/esm/assertThisInitialized\";\nimport _inherits from \"@babel/runtime/helpers/esm/inherits\";\nimport _possibleConstructorReturn from \"@babel/runtime/helpers/esm/possibleConstructorReturn\";\nimport _getPrototypeOf from \"@babel/runtime/helpers/esm/getPrototypeOf\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\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); }; }\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\nimport React, { createRef, PureComponent } from 'react';\nimport PropTypes from 'prop-types';\nimport makeCancellable from 'make-cancellable-promise';\nimport invariant from 'tiny-invariant';\nimport warning from 'tiny-warning';\nimport * as pdfjs from 'pdfjs-dist/build/pdf';\nimport DocumentContext from '../DocumentContext';\nimport PageContext from '../PageContext';\nimport { cancelRunningTask } from '../shared/utils';\nimport { isLinkService, isPage, isRotate } from '../shared/propTypes';\nexport var AnnotationLayerInternal = /*#__PURE__*/function (_PureComponent) {\n _inherits(AnnotationLayerInternal, _PureComponent);\n var _super = _createSuper(AnnotationLayerInternal);\n function AnnotationLayerInternal() {\n var _this;\n _classCallCheck(this, AnnotationLayerInternal);\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n _this = _super.call.apply(_super, [this].concat(args));\n _defineProperty(_assertThisInitialized(_this), \"state\", {\n annotations: null\n });\n _defineProperty(_assertThisInitialized(_this), \"layerElement\", /*#__PURE__*/createRef());\n _defineProperty(_assertThisInitialized(_this), \"loadAnnotations\", function () {\n var page = _this.props.page;\n var cancellable = makeCancellable(page.getAnnotations());\n _this.runningTask = cancellable;\n cancellable.promise.then(function (annotations) {\n _this.setState({\n annotations: annotations\n }, _this.onLoadSuccess);\n })[\"catch\"](function (error) {\n _this.onLoadError(error);\n });\n });\n _defineProperty(_assertThisInitialized(_this), \"onLoadSuccess\", function () {\n var onGetAnnotationsSuccess = _this.props.onGetAnnotationsSuccess;\n var annotations = _this.state.annotations;\n if (onGetAnnotationsSuccess) onGetAnnotationsSuccess(annotations);\n });\n _defineProperty(_assertThisInitialized(_this), \"onLoadError\", function (error) {\n _this.setState({\n annotations: false\n });\n warning(error);\n var onGetAnnotationsError = _this.props.onGetAnnotationsError;\n if (onGetAnnotationsError) onGetAnnotationsError(error);\n });\n _defineProperty(_assertThisInitialized(_this), \"onRenderSuccess\", function () {\n var onRenderAnnotationLayerSuccess = _this.props.onRenderAnnotationLayerSuccess;\n if (onRenderAnnotationLayerSuccess) onRenderAnnotationLayerSuccess();\n });\n _defineProperty(_assertThisInitialized(_this), \"onRenderError\", function (error) {\n warning(error);\n var onRenderAnnotationLayerError = _this.props.onRenderAnnotationLayerError;\n if (onRenderAnnotationLayerError) onRenderAnnotationLayerError(error);\n });\n return _this;\n }\n _createClass(AnnotationLayerInternal, [{\n key: \"componentDidMount\",\n value: function componentDidMount() {\n var page = this.props.page;\n invariant(page, 'Attempted to load page annotations, but no page was specified.');\n warning(parseInt(window.getComputedStyle(document.body).getPropertyValue('--react-pdf-annotation-layer'), 10) === 1, 'AnnotationLayer styles not found. Read more: https://github.com/wojtekmaj/react-pdf#support-for-annotations');\n this.loadAnnotations();\n }\n }, {\n key: \"componentDidUpdate\",\n value: function componentDidUpdate(prevProps) {\n var _this$props = this.props,\n page = _this$props.page,\n renderForms = _this$props.renderForms;\n if (prevProps.page && page !== prevProps.page || renderForms !== prevProps.renderForms) {\n this.loadAnnotations();\n }\n }\n }, {\n key: \"componentWillUnmount\",\n value: function componentWillUnmount() {\n cancelRunningTask(this.runningTask);\n }\n }, {\n key: \"viewport\",\n get: function get() {\n var _this$props2 = this.props,\n page = _this$props2.page,\n rotate = _this$props2.rotate,\n scale = _this$props2.scale;\n return page.getViewport({\n scale: scale,\n rotation: rotate\n });\n }\n }, {\n key: \"renderAnnotationLayer\",\n value: function renderAnnotationLayer() {\n var annotations = this.state.annotations;\n if (!annotations) {\n return;\n }\n var _this$props3 = this.props,\n imageResourcesPath = _this$props3.imageResourcesPath,\n linkService = _this$props3.linkService,\n page = _this$props3.page,\n renderForms = _this$props3.renderForms;\n var viewport = this.viewport.clone({\n dontFlip: true\n });\n var parameters = {\n annotations: annotations,\n div: this.layerElement.current,\n imageResourcesPath: imageResourcesPath,\n linkService: linkService,\n page: page,\n renderForms: renderForms,\n viewport: viewport\n };\n this.layerElement.current.innerHTML = '';\n try {\n pdfjs.AnnotationLayer.render(parameters);\n this.onRenderSuccess();\n } catch (error) {\n this.onRenderError(error);\n }\n }\n }, {\n key: \"render\",\n value: function render() {\n return /*#__PURE__*/React.createElement(\"div\", {\n className: \"react-pdf__Page__annotations annotationLayer\",\n ref: this.layerElement\n }, this.renderAnnotationLayer());\n }\n }]);\n return AnnotationLayerInternal;\n}(PureComponent);\nAnnotationLayerInternal.propTypes = {\n imageResourcesPath: PropTypes.string,\n linkService: isLinkService.isRequired,\n onGetAnnotationsError: PropTypes.func,\n onGetAnnotationsSuccess: PropTypes.func,\n onRenderAnnotationLayerError: PropTypes.func,\n onRenderAnnotationLayerSuccess: PropTypes.func,\n page: isPage,\n renderForms: PropTypes.bool,\n rotate: isRotate,\n scale: PropTypes.number\n};\nvar AnnotationLayer = function AnnotationLayer(props) {\n return /*#__PURE__*/React.createElement(DocumentContext.Consumer, null, function (documentContext) {\n return /*#__PURE__*/React.createElement(PageContext.Consumer, null, function (pageContext) {\n return /*#__PURE__*/React.createElement(AnnotationLayerInternal, _extends({}, documentContext, pageContext, props));\n });\n });\n};\nexport default AnnotationLayer;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _classCallCheck from \"@babel/runtime/helpers/esm/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/esm/createClass\";\nimport _assertThisInitialized from \"@babel/runtime/helpers/esm/assertThisInitialized\";\nimport _inherits from \"@babel/runtime/helpers/esm/inherits\";\nimport _possibleConstructorReturn from \"@babel/runtime/helpers/esm/possibleConstructorReturn\";\nimport _getPrototypeOf from \"@babel/runtime/helpers/esm/getPrototypeOf\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\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); }; }\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\nimport React, { createRef, PureComponent } from 'react';\nimport PropTypes from 'prop-types';\nimport makeCancellable from 'make-cancellable-promise';\nimport makeEventProps from 'make-event-props';\nimport clsx from 'clsx';\nimport mergeRefs from 'merge-refs';\nimport invariant from 'tiny-invariant';\nimport warning from 'tiny-warning';\nimport DocumentContext from './DocumentContext';\nimport PageContext from './PageContext';\nimport Message from './Message';\nimport PageCanvas from './Page/PageCanvas';\nimport PageSVG from './Page/PageSVG';\nimport TextLayer from './Page/TextLayer';\nimport AnnotationLayer from './Page/AnnotationLayer';\nimport { cancelRunningTask, isProvided, makePageCallback } from './shared/utils';\nimport { eventProps, isClassName, isPageIndex, isPageNumber, isPdf, isRef, isRenderMode, isRotate } from './shared/propTypes';\nvar defaultScale = 1;\nexport var PageInternal = /*#__PURE__*/function (_PureComponent) {\n _inherits(PageInternal, _PureComponent);\n var _super = _createSuper(PageInternal);\n function PageInternal() {\n var _this;\n _classCallCheck(this, PageInternal);\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n _this = _super.call.apply(_super, [this].concat(args));\n _defineProperty(_assertThisInitialized(_this), \"state\", {\n page: null\n });\n _defineProperty(_assertThisInitialized(_this), \"pageElement\", /*#__PURE__*/createRef());\n _defineProperty(_assertThisInitialized(_this), \"onLoadSuccess\", function () {\n var _this$props = _this.props,\n onLoadSuccess = _this$props.onLoadSuccess,\n registerPage = _this$props.registerPage;\n var page = _this.state.page;\n if (onLoadSuccess) onLoadSuccess(makePageCallback(page, _this.scale));\n if (registerPage) registerPage(_this.pageIndex, _this.pageElement.current);\n });\n _defineProperty(_assertThisInitialized(_this), \"onLoadError\", function (error) {\n _this.setState({\n page: false\n });\n warning(error);\n var onLoadError = _this.props.onLoadError;\n if (onLoadError) onLoadError(error);\n });\n _defineProperty(_assertThisInitialized(_this), \"loadPage\", function () {\n var pdf = _this.props.pdf;\n var pageNumber = _this.getPageNumber();\n if (!pageNumber) {\n return;\n }\n _this.setState(function (prevState) {\n if (!prevState.page) {\n return null;\n }\n return {\n page: null\n };\n });\n var cancellable = makeCancellable(pdf.getPage(pageNumber));\n _this.runningTask = cancellable;\n cancellable.promise.then(function (page) {\n _this.setState({\n page: page\n }, _this.onLoadSuccess);\n })[\"catch\"](function (error) {\n _this.onLoadError(error);\n });\n });\n return _this;\n }\n _createClass(PageInternal, [{\n key: \"componentDidMount\",\n value: function componentDidMount() {\n var pdf = this.props.pdf;\n invariant(pdf, 'Attempted to load a page, but no document was specified.');\n this.loadPage();\n }\n }, {\n key: \"componentDidUpdate\",\n value: function componentDidUpdate(prevProps) {\n var pdf = this.props.pdf;\n if (prevProps.pdf && pdf !== prevProps.pdf || this.getPageNumber() !== this.getPageNumber(prevProps)) {\n var unregisterPage = this.props.unregisterPage;\n if (unregisterPage) unregisterPage(this.getPageIndex(prevProps));\n this.loadPage();\n }\n }\n }, {\n key: \"componentWillUnmount\",\n value: function componentWillUnmount() {\n var unregisterPage = this.props.unregisterPage;\n if (unregisterPage) unregisterPage(this.pageIndex);\n cancelRunningTask(this.runningTask);\n }\n }, {\n key: \"childContext\",\n get: function get() {\n var pageIndex = this.pageIndex,\n pageNumber = this.pageNumber;\n var page = this.state.page;\n if (!page) {\n return {};\n }\n var _this$props2 = this.props,\n canvasBackground = _this$props2.canvasBackground,\n customTextRenderer = _this$props2.customTextRenderer,\n devicePixelRatio = _this$props2.devicePixelRatio,\n onGetAnnotationsError = _this$props2.onGetAnnotationsError,\n onGetAnnotationsSuccess = _this$props2.onGetAnnotationsSuccess,\n onGetTextError = _this$props2.onGetTextError,\n onGetTextSuccess = _this$props2.onGetTextSuccess,\n onRenderAnnotationLayerError = _this$props2.onRenderAnnotationLayerError,\n onRenderAnnotationLayerSuccess = _this$props2.onRenderAnnotationLayerSuccess,\n onRenderError = _this$props2.onRenderError,\n onRenderSuccess = _this$props2.onRenderSuccess,\n onRenderTextLayerError = _this$props2.onRenderTextLayerError,\n onRenderTextLayerSuccess = _this$props2.onRenderTextLayerSuccess,\n renderForms = _this$props2.renderForms,\n renderInteractiveForms = _this$props2.renderInteractiveForms;\n return {\n canvasBackground: canvasBackground,\n customTextRenderer: customTextRenderer,\n devicePixelRatio: devicePixelRatio,\n onGetAnnotationsError: onGetAnnotationsError,\n onGetAnnotationsSuccess: onGetAnnotationsSuccess,\n onGetTextError: onGetTextError,\n onGetTextSuccess: onGetTextSuccess,\n onRenderAnnotationLayerError: onRenderAnnotationLayerError,\n onRenderAnnotationLayerSuccess: onRenderAnnotationLayerSuccess,\n onRenderError: onRenderError,\n onRenderSuccess: onRenderSuccess,\n onRenderTextLayerError: onRenderTextLayerError,\n onRenderTextLayerSuccess: onRenderTextLayerSuccess,\n page: page,\n pageIndex: pageIndex,\n pageNumber: pageNumber,\n renderForms: renderForms !== null && renderForms !== void 0 ? renderForms : renderInteractiveForms,\n // For backward compatibility\n rotate: this.rotate,\n scale: this.scale\n };\n }\n\n /**\n * Called when a page is loaded successfully\n */\n }, {\n key: \"getPageIndex\",\n value: function getPageIndex() {\n var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.props;\n if (isProvided(props.pageNumber)) {\n return props.pageNumber - 1;\n }\n if (isProvided(props.pageIndex)) {\n return props.pageIndex;\n }\n return null;\n }\n }, {\n key: \"getPageNumber\",\n value: function getPageNumber() {\n var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.props;\n if (isProvided(props.pageNumber)) {\n return props.pageNumber;\n }\n if (isProvided(props.pageIndex)) {\n return props.pageIndex + 1;\n }\n return null;\n }\n }, {\n key: \"pageIndex\",\n get: function get() {\n return this.getPageIndex();\n }\n }, {\n key: \"pageNumber\",\n get: function get() {\n return this.getPageNumber();\n }\n }, {\n key: \"rotate\",\n get: function get() {\n var rotate = this.props.rotate;\n if (isProvided(rotate)) {\n return rotate;\n }\n var page = this.state.page;\n if (!page) {\n return null;\n }\n return page.rotate;\n }\n }, {\n key: \"scale\",\n get: function get() {\n var page = this.state.page;\n if (!page) {\n return null;\n }\n var _this$props3 = this.props,\n scale = _this$props3.scale,\n width = _this$props3.width,\n height = _this$props3.height;\n var rotate = this.rotate;\n\n // Be default, we'll render page at 100% * scale width.\n var pageScale = 1;\n\n // Passing scale explicitly null would cause the page not to render\n var scaleWithDefault = scale === null ? defaultScale : scale;\n\n // If width/height is defined, calculate the scale of the page so it could be of desired width.\n if (width || height) {\n var viewport = page.getViewport({\n scale: 1,\n rotation: rotate\n });\n pageScale = width ? width / viewport.width : height / viewport.height;\n }\n return scaleWithDefault * pageScale;\n }\n }, {\n key: \"eventProps\",\n get: function get() {\n var _this2 = this;\n return makeEventProps(this.props, function () {\n var page = _this2.state.page;\n if (!page) {\n return page;\n }\n return makePageCallback(page, _this2.scale);\n });\n }\n }, {\n key: \"pageKey\",\n get: function get() {\n return \"\".concat(this.pageIndex, \"@\").concat(this.scale, \"/\").concat(this.rotate);\n }\n }, {\n key: \"pageKeyNoScale\",\n get: function get() {\n return \"\".concat(this.pageIndex, \"/\").concat(this.rotate);\n }\n }, {\n key: \"renderMainLayer\",\n value: function renderMainLayer() {\n var _this$props4 = this.props,\n canvasRef = _this$props4.canvasRef,\n renderMode = _this$props4.renderMode;\n switch (renderMode) {\n case 'none':\n return null;\n case 'svg':\n return /*#__PURE__*/React.createElement(PageSVG, {\n key: \"\".concat(this.pageKeyNoScale, \"_svg\")\n });\n case 'canvas':\n default:\n return /*#__PURE__*/React.createElement(PageCanvas, {\n key: \"\".concat(this.pageKey, \"_canvas\"),\n canvasRef: canvasRef\n });\n }\n }\n }, {\n key: \"renderTextLayer\",\n value: function renderTextLayer() {\n var renderTextLayer = this.props.renderTextLayer;\n if (!renderTextLayer) {\n return null;\n }\n return /*#__PURE__*/React.createElement(TextLayer, {\n key: \"\".concat(this.pageKey, \"_text\")\n });\n }\n }, {\n key: \"renderAnnotationLayer\",\n value: function renderAnnotationLayer() {\n var renderAnnotationLayer = this.props.renderAnnotationLayer;\n if (!renderAnnotationLayer) {\n return null;\n }\n\n /**\n * As of now, PDF.js 2.0.943 returns warnings on unimplemented annotations in SVG mode.\n * Therefore, as a fallback, we render \"traditional\" AnnotationLayer component.\n */\n\n return /*#__PURE__*/React.createElement(AnnotationLayer, {\n key: \"\".concat(this.pageKey, \"_annotations\")\n });\n }\n }, {\n key: \"renderChildren\",\n value: function renderChildren() {\n var children = this.props.children;\n return /*#__PURE__*/React.createElement(PageContext.Provider, {\n value: this.childContext\n }, this.renderMainLayer(), this.renderTextLayer(), this.renderAnnotationLayer(), children);\n }\n }, {\n key: \"renderContent\",\n value: function renderContent() {\n var pageNumber = this.pageNumber;\n var pdf = this.props.pdf;\n var page = this.state.page;\n if (!pageNumber) {\n var noData = this.props.noData;\n return /*#__PURE__*/React.createElement(Message, {\n type: \"no-data\"\n }, typeof noData === 'function' ? noData() : noData);\n }\n if (pdf === null || page === null) {\n var loading = this.props.loading;\n return /*#__PURE__*/React.createElement(Message, {\n type: \"loading\"\n }, typeof loading === 'function' ? loading() : loading);\n }\n if (pdf === false || page === false) {\n var error = this.props.error;\n return /*#__PURE__*/React.createElement(Message, {\n type: \"error\"\n }, typeof error === 'function' ? error() : error);\n }\n return this.renderChildren();\n }\n }, {\n key: \"render\",\n value: function render() {\n var pageNumber = this.pageNumber;\n var _this$props5 = this.props,\n className = _this$props5.className,\n inputRef = _this$props5.inputRef;\n return /*#__PURE__*/React.createElement(\"div\", _extends({\n className: clsx('react-pdf__Page', className),\n \"data-page-number\": pageNumber,\n ref: mergeRefs(inputRef, this.pageElement),\n style: {\n position: 'relative',\n minWidth: 'min-content',\n minHeight: 'min-content'\n }\n }, this.eventProps), this.renderContent());\n }\n }]);\n return PageInternal;\n}(PureComponent);\nPageInternal.defaultProps = {\n error: 'Failed to load the page.',\n loading: 'Loading page…',\n noData: 'No page specified.',\n renderAnnotationLayer: true,\n renderMode: 'canvas',\n renderTextLayer: true,\n scale: defaultScale\n};\nvar isFunctionOrNode = PropTypes.oneOfType([PropTypes.func, PropTypes.node]);\nPageInternal.propTypes = _objectSpread(_objectSpread({}, eventProps), {}, {\n canvasBackground: PropTypes.string,\n children: PropTypes.node,\n className: isClassName,\n customTextRenderer: PropTypes.func,\n devicePixelRatio: PropTypes.number,\n error: isFunctionOrNode,\n height: PropTypes.number,\n imageResourcesPath: PropTypes.string,\n inputRef: isRef,\n loading: isFunctionOrNode,\n noData: isFunctionOrNode,\n onGetTextError: PropTypes.func,\n onGetTextSuccess: PropTypes.func,\n onLoadError: PropTypes.func,\n onLoadSuccess: PropTypes.func,\n onRenderError: PropTypes.func,\n onRenderSuccess: PropTypes.func,\n onRenderTextLayerError: PropTypes.func,\n onRenderTextLayerSuccess: PropTypes.func,\n pageIndex: isPageIndex,\n pageNumber: isPageNumber,\n pdf: isPdf,\n registerPage: PropTypes.func,\n renderAnnotationLayer: PropTypes.bool,\n renderForms: PropTypes.bool,\n renderInteractiveForms: PropTypes.bool,\n // For backward compatibility\n renderMode: isRenderMode,\n renderTextLayer: PropTypes.bool,\n rotate: isRotate,\n scale: PropTypes.number,\n unregisterPage: PropTypes.func,\n width: PropTypes.number\n});\nfunction Page(props, ref) {\n return /*#__PURE__*/React.createElement(DocumentContext.Consumer, null, function (context) {\n return /*#__PURE__*/React.createElement(PageInternal, _extends({\n ref: ref\n }, context, props));\n });\n}\nexport default /*#__PURE__*/React.forwardRef(Page);","import * as pdfjs from 'pdfjs-dist/build/pdf';\nimport Document from './Document';\nimport Outline from './Outline';\nimport Page from './Page';\nimport { displayWorkerWarning } from './shared/utils';\ndisplayWorkerWarning();\npdfjs.GlobalWorkerOptions.workerSrc = 'pdf.worker.js';\nexport { pdfjs, Document, Outline, Page };"],"names":["PropTypes","DEFAULT_LINK_REL","LinkService","_classCallCheck","_createClass","pdfDocument","pdfViewer","externalLinkRel","externalLinkTarget","value","dest","_this","resolve","explicitDest","invariant","destRef","pageIndex","pageNumber","link","url","newWindow","isDefined","variable","eventProps","result","_toConsumableArray","mouseEvents","touchEvents","keyboardEvents","eventName","fileTypes","isClassName","isFile","isLinkService","isPage","isPageIndex","props","propName","componentName","pdf","_typeof","numPages","isPageNumber","isPdf","isRef","isRenderMode","isRotate","ownKeys","object","enumerableOnly","keys","symbols","sym","_objectSpread","target","i","source","key","_defineProperty","isFunctionOrNode","isFileProp","isDestination","pdfjs.GlobalWorkerOptions"],"mappings":"6SAUYA,EAAU,KACdA,EAAU,MAAM,CAAC,QAAS,UAAW,SAAS,CAAC,EAAE,WCMzD,IAAIC,EAAmB,+BACnBC,EAA2B,UAAY,CACzC,SAASA,GAAc,CACrBC,EAAgB,KAAMD,CAAW,EACjC,KAAK,mBAAqB,KAC1B,KAAK,gBAAkB,IAC3B,CACE,OAAAE,EAAaF,EAAa,CAAC,CACzB,IAAK,cACL,MAAO,SAAqBG,EAAa,CACvC,KAAK,YAAcA,CACzB,CACA,EAAK,CACD,IAAK,YACL,MAAO,SAAmBC,EAAW,CACnC,KAAK,UAAYA,CACvB,CACA,EAAK,CACD,IAAK,qBACL,MAAO,SAA4BC,EAAiB,CAClD,KAAK,gBAAkBA,CAC7B,CACA,EAAK,CACD,IAAK,wBACL,MAAO,SAA+BC,EAAoB,CACxD,KAAK,mBAAqBA,CAChC,CACA,EAAK,CACD,IAAK,aACL,MAAO,UAAsB,CAAA,CACjC,EAAK,CACD,IAAK,aACL,IAAK,UAAe,CAClB,OAAO,KAAK,YAAc,KAAK,YAAY,SAAW,CAC5D,CACA,EAAK,CACD,IAAK,OACL,IAAK,UAAe,CAClB,OAAO,KAAK,UAAU,iBACvB,E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