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AuB,EAAOnqC,iBAAiB,MAC7S,CrByBI08B,IAASb,GAAmB,0EAA0EW,MsBjE1G,GAA0B7wC,UAAY","sources":["webpack://customer-portal/./node_modules/warning/warning.js","webpack://customer-portal/pdf.js/webpack/bootstrap","webpack://customer-portal/pdf.js/webpack/runtime/define property getters","webpack://customer-portal/pdf.js/webpack/runtime/hasOwnProperty shorthand","webpack://customer-portal/pdf.js/./src/shared/util.js","webpack://customer-portal/pdf.js/./src/display/base_factory.js","webpack://customer-portal/pdf.js/./src/display/display_utils.js","webpack://customer-portal/pdf.js/./src/display/editor/toolbar.js","webpack://customer-portal/pdf.js/./src/display/editor/tools.js","webpack://customer-portal/pdf.js/./src/display/editor/alt_text.js","webpack://customer-portal/pdf.js/./src/display/editor/editor.js","webpack://customer-portal/pdf.js/./src/shared/murmurhash3.js","webpack://customer-portal/pdf.js/./src/display/annotation_storage.js","webpack://customer-portal/pdf.js/./src/display/font_loader.js","webpack://customer-portal/pdf.js/./src/display/node_utils.js","webpack://customer-portal/pdf.js/./src/display/pattern_helper.js","webpack://customer-portal/pdf.js/./src/shared/image_utils.js","webpack://customer-portal/pdf.js/./src/display/canvas.js","webpack://customer-portal/pdf.js/./src/display/worker_options.js","webpack://customer-portal/pdf.js/./src/shared/message_handler.js","webpack://customer-portal/pdf.js/./src/display/metadata.js","webpack://customer-portal/pdf.js/./src/display/optional_content_config.js","webpack://customer-portal/pdf.js/./src/display/transport_stream.js","webpack://customer-portal/pdf.js/./src/display/network_utils.js","webpack://customer-portal/pdf.js/./src/display/content_disposition.js","webpack://customer-portal/pdf.js/./src/display/fetch_stream.js","webpack://customer-portal/pdf.js/./src/display/network.js","webpack://customer-portal/pdf.js/./src/display/node_stream.js","webpack://customer-portal/pdf.js/./src/display/text_layer.js","webpack://customer-portal/pdf.js/./src/display/xfa_text.js","webpack://customer-portal/pdf.js/./src/display/api.js","webpack://customer-portal/pdf.js/./src/shared/scripting_utils.js","webpack://customer-portal/pdf.js/./src/display/xfa_layer.js","webpack://customer-portal/pdf.js/./src/display/annotation_layer.js","webpack://customer-portal/pdf.js/./src/display/editor/freetext.js","webpack://customer-portal/pdf.js/./src/display/editor/outliner.js","webpack://customer-portal/pdf.js/./src/display/editor/color_picker.js","webpack://customer-portal/pdf.js/./src/display/editor/highlight.js","webpack://customer-portal/pdf.js/./src/display/editor/ink.js","webpack://customer-portal/pdf.js/./src/display/editor/stamp.js","webpack://customer-portal/pdf.js/./src/display/editor/annotation_editor_layer.js","webpack://customer-portal/pdf.js/./src/display/draw_layer.js","webpack://customer-portal/./node_modules/make-event-props/dist/esm/index.js","webpack://customer-portal/./node_modules/make-cancellable-promise/dist/esm/index.js","webpack://customer-portal/./node_modules/tiny-invariant/dist/esm/tiny-invariant.js","webpack://customer-portal/./node_modules/dequal/dist/index.mjs","webpack://customer-portal/./node_modules/react-pdf/dist/esm/DocumentContext.js","webpack://customer-portal/./node_modules/react-pdf/dist/esm/Message.js","webpack://customer-portal/./node_modules/react-pdf/dist/esm/LinkService.js","webpack://customer-portal/./node_modules/react-pdf/dist/esm/PasswordResponses.js","webpack://customer-portal/./node_modules/react-pdf/dist/esm/shared/utils.js","webpack://customer-portal/./node_modules/react-pdf/dist/esm/shared/hooks/useResolver.js","webpack://customer-portal/./node_modules/react-pdf/dist/esm/Document.js","webpack://customer-portal/./node_modules/react-pdf/dist/esm/OutlineContext.js","webpack://customer-portal/./node_modules/react-pdf/dist/esm/Ref.js","webpack://customer-portal/./node_modules/react-pdf/dist/esm/shared/hooks/useCachedValue.js","webpack://customer-portal/./node_modules/react-pdf/dist/esm/shared/hooks/useDocumentContext.js","webpack://customer-portal/./node_modules/react-pdf/dist/esm/shared/hooks/useOutlineContext.js","webpack://customer-portal/./node_modules/react-pdf/dist/esm/OutlineItem.js","webpack://customer-portal/./node_modules/react-pdf/dist/esm/Outline.js","webpack://customer-portal/./node_modules/merge-refs/dist/esm/index.js","webpack://customer-portal/./node_modules/react-pdf/dist/esm/PageContext.js","webpack://customer-portal/./node_modules/react-pdf/dist/esm/shared/constants.js","webpack://customer-portal/./node_modules/react-pdf/dist/esm/shared/structTreeUtils.js","webpack://customer-portal/./node_modules/react-pdf/dist/esm/StructTreeItem.js","webpack://customer-portal/./node_modules/react-pdf/dist/esm/shared/hooks/usePageContext.js","webpack://customer-portal/./node_modules/react-pdf/dist/esm/StructTree.js","webpack://customer-portal/./node_modules/react-pdf/dist/esm/Page/Canvas.js","webpack://customer-portal/./node_modules/react-pdf/dist/esm/Page/TextLayer.js","webpack://customer-portal/./node_modules/react-pdf/dist/esm/Page/AnnotationLayer.js","webpack://customer-portal/./node_modules/react-pdf/dist/esm/Page.js","webpack://customer-portal/./node_modules/react-pdf/dist/esm/Thumbnail.js","webpack://customer-portal/./node_modules/react-pdf/dist/esm/index.js"],"sourcesContent":["/**\n * Copyright (c) 2014-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\n/**\n * Similar to invariant but only logs a warning if the condition is not met.\n * This can be used to log issues in development environments in critical\n * paths. Removing the logging code for production environments will keep the\n * same logic and follow the same code paths.\n */\n\nvar __DEV__ = process.env.NODE_ENV !== 'production';\n\nvar warning = function() {};\n\nif (__DEV__) {\n var printWarning = function printWarning(format, args) {\n var len = arguments.length;\n args = new Array(len > 1 ? len - 1 : 0);\n for (var key = 1; key < len; key++) {\n args[key - 1] = arguments[key];\n }\n var argIndex = 0;\n var message = 'Warning: ' +\n format.replace(/%s/g, function() {\n return args[argIndex++];\n });\n if (typeof console !== 'undefined') {\n console.error(message);\n }\n try {\n // --- Welcome to debugging React ---\n // This error was thrown as a convenience so that you can use this stack\n // to find the callsite that caused this warning to fire.\n throw new Error(message);\n } catch (x) {}\n }\n\n warning = function(condition, format, args) {\n var len = arguments.length;\n args = new Array(len > 2 ? len - 2 : 0);\n for (var key = 2; key < len; key++) {\n args[key - 2] = arguments[key];\n }\n if (format === undefined) {\n throw new Error(\n '`warning(condition, format, ...args)` requires a warning ' +\n 'message argument'\n );\n }\n if (!condition) {\n printWarning.apply(null, [format].concat(args));\n }\n };\n}\n\nmodule.exports = warning;\n","// The require scope\nvar __webpack_require__ = {};\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","/* Copyright 2012 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/* globals process */\n\n// NW.js / Electron is a browser context, but copies some Node.js objects; see\n// http://docs.nwjs.io/en/latest/For%20Users/Advanced/JavaScript%20Contexts%20in%20NW.js/#access-nodejs-and-nwjs-api-in-browser-context\n// https://www.electronjs.org/docs/api/process#processversionselectron-readonly\n// https://www.electronjs.org/docs/api/process#processtype-readonly\nconst isNodeJS =\n (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"GENERIC\")) &&\n typeof process === \"object\" &&\n process + \"\" === \"[object process]\" &&\n !process.versions.nw &&\n !(process.versions.electron && process.type && process.type !== \"browser\");\n\nconst IDENTITY_MATRIX = [1, 0, 0, 1, 0, 0];\nconst FONT_IDENTITY_MATRIX = [0.001, 0, 0, 0.001, 0, 0];\n\nconst MAX_IMAGE_SIZE_TO_CACHE = 10e6; // Ten megabytes.\n\n// Represent the percentage of the height of a single-line field over\n// the font size. Acrobat seems to use this value.\nconst LINE_FACTOR = 1.35;\nconst LINE_DESCENT_FACTOR = 0.35;\nconst BASELINE_FACTOR = LINE_DESCENT_FACTOR / LINE_FACTOR;\n\n/**\n * Refer to the `WorkerTransport.getRenderingIntent`-method in the API, to see\n * how these flags are being used:\n * - ANY, DISPLAY, and PRINT are the normal rendering intents, note the\n * `PDFPageProxy.{render, getOperatorList, getAnnotations}`-methods.\n * - ANNOTATIONS_FORMS, ANNOTATIONS_STORAGE, ANNOTATIONS_DISABLE control which\n * annotations are rendered onto the canvas (i.e. by being included in the\n * operatorList), note the `PDFPageProxy.{render, getOperatorList}`-methods\n * and their `annotationMode`-option.\n * - OPLIST is used with the `PDFPageProxy.getOperatorList`-method, note the\n * `OperatorList`-constructor (on the worker-thread).\n */\nconst RenderingIntentFlag = {\n ANY: 0x01,\n DISPLAY: 0x02,\n PRINT: 0x04,\n SAVE: 0x08,\n ANNOTATIONS_FORMS: 0x10,\n ANNOTATIONS_STORAGE: 0x20,\n ANNOTATIONS_DISABLE: 0x40,\n OPLIST: 0x100,\n};\n\nconst AnnotationMode = {\n DISABLE: 0,\n ENABLE: 1,\n ENABLE_FORMS: 2,\n ENABLE_STORAGE: 3,\n};\n\nconst AnnotationEditorPrefix = \"pdfjs_internal_editor_\";\n\nconst AnnotationEditorType = {\n DISABLE: -1,\n NONE: 0,\n FREETEXT: 3,\n HIGHLIGHT: 9,\n STAMP: 13,\n INK: 15,\n};\n\nconst AnnotationEditorParamsType = {\n RESIZE: 1,\n CREATE: 2,\n FREETEXT_SIZE: 11,\n FREETEXT_COLOR: 12,\n FREETEXT_OPACITY: 13,\n INK_COLOR: 21,\n INK_THICKNESS: 22,\n INK_OPACITY: 23,\n HIGHLIGHT_COLOR: 31,\n HIGHLIGHT_DEFAULT_COLOR: 32,\n HIGHLIGHT_THICKNESS: 33,\n HIGHLIGHT_FREE: 34,\n HIGHLIGHT_SHOW_ALL: 35,\n};\n\n// Permission flags from Table 22, Section 7.6.3.2 of the PDF specification.\nconst PermissionFlag = {\n PRINT: 0x04,\n MODIFY_CONTENTS: 0x08,\n COPY: 0x10,\n MODIFY_ANNOTATIONS: 0x20,\n FILL_INTERACTIVE_FORMS: 0x100,\n COPY_FOR_ACCESSIBILITY: 0x200,\n ASSEMBLE: 0x400,\n PRINT_HIGH_QUALITY: 0x800,\n};\n\nconst TextRenderingMode = {\n FILL: 0,\n STROKE: 1,\n FILL_STROKE: 2,\n INVISIBLE: 3,\n FILL_ADD_TO_PATH: 4,\n STROKE_ADD_TO_PATH: 5,\n FILL_STROKE_ADD_TO_PATH: 6,\n ADD_TO_PATH: 7,\n FILL_STROKE_MASK: 3,\n ADD_TO_PATH_FLAG: 4,\n};\n\nconst ImageKind = {\n GRAYSCALE_1BPP: 1,\n RGB_24BPP: 2,\n RGBA_32BPP: 3,\n};\n\nconst AnnotationType = {\n TEXT: 1,\n LINK: 2,\n FREETEXT: 3,\n LINE: 4,\n SQUARE: 5,\n CIRCLE: 6,\n POLYGON: 7,\n POLYLINE: 8,\n HIGHLIGHT: 9,\n UNDERLINE: 10,\n SQUIGGLY: 11,\n STRIKEOUT: 12,\n STAMP: 13,\n CARET: 14,\n INK: 15,\n POPUP: 16,\n FILEATTACHMENT: 17,\n SOUND: 18,\n MOVIE: 19,\n WIDGET: 20,\n SCREEN: 21,\n PRINTERMARK: 22,\n TRAPNET: 23,\n WATERMARK: 24,\n THREED: 25,\n REDACT: 26,\n};\n\nconst AnnotationReplyType = {\n GROUP: \"Group\",\n REPLY: \"R\",\n};\n\nconst AnnotationFlag = {\n INVISIBLE: 0x01,\n HIDDEN: 0x02,\n PRINT: 0x04,\n NOZOOM: 0x08,\n NOROTATE: 0x10,\n NOVIEW: 0x20,\n READONLY: 0x40,\n LOCKED: 0x80,\n TOGGLENOVIEW: 0x100,\n LOCKEDCONTENTS: 0x200,\n};\n\nconst AnnotationFieldFlag = {\n READONLY: 0x0000001,\n REQUIRED: 0x0000002,\n NOEXPORT: 0x0000004,\n MULTILINE: 0x0001000,\n PASSWORD: 0x0002000,\n NOTOGGLETOOFF: 0x0004000,\n RADIO: 0x0008000,\n PUSHBUTTON: 0x0010000,\n COMBO: 0x0020000,\n EDIT: 0x0040000,\n SORT: 0x0080000,\n FILESELECT: 0x0100000,\n MULTISELECT: 0x0200000,\n DONOTSPELLCHECK: 0x0400000,\n DONOTSCROLL: 0x0800000,\n COMB: 0x1000000,\n RICHTEXT: 0x2000000,\n RADIOSINUNISON: 0x2000000,\n COMMITONSELCHANGE: 0x4000000,\n};\n\nconst AnnotationBorderStyleType = {\n SOLID: 1,\n DASHED: 2,\n BEVELED: 3,\n INSET: 4,\n UNDERLINE: 5,\n};\n\nconst AnnotationActionEventType = {\n E: \"Mouse Enter\",\n X: \"Mouse Exit\",\n D: \"Mouse Down\",\n U: \"Mouse Up\",\n Fo: \"Focus\",\n Bl: \"Blur\",\n PO: \"PageOpen\",\n PC: \"PageClose\",\n PV: \"PageVisible\",\n PI: \"PageInvisible\",\n K: \"Keystroke\",\n F: \"Format\",\n V: \"Validate\",\n C: \"Calculate\",\n};\n\nconst DocumentActionEventType = {\n WC: \"WillClose\",\n WS: \"WillSave\",\n DS: \"DidSave\",\n WP: \"WillPrint\",\n DP: \"DidPrint\",\n};\n\nconst PageActionEventType = {\n O: \"PageOpen\",\n C: \"PageClose\",\n};\n\nconst VerbosityLevel = {\n ERRORS: 0,\n WARNINGS: 1,\n INFOS: 5,\n};\n\nconst CMapCompressionType = {\n NONE: 0,\n BINARY: 1,\n};\n\n// All the possible operations for an operator list.\nconst OPS = {\n // Intentionally start from 1 so it is easy to spot bad operators that will be\n // 0's.\n // PLEASE NOTE: We purposely keep any removed operators commented out, since\n // re-numbering the list would risk breaking third-party users.\n dependency: 1,\n setLineWidth: 2,\n setLineCap: 3,\n setLineJoin: 4,\n setMiterLimit: 5,\n setDash: 6,\n setRenderingIntent: 7,\n setFlatness: 8,\n setGState: 9,\n save: 10,\n restore: 11,\n transform: 12,\n moveTo: 13,\n lineTo: 14,\n curveTo: 15,\n curveTo2: 16,\n curveTo3: 17,\n closePath: 18,\n rectangle: 19,\n stroke: 20,\n closeStroke: 21,\n fill: 22,\n eoFill: 23,\n fillStroke: 24,\n eoFillStroke: 25,\n closeFillStroke: 26,\n closeEOFillStroke: 27,\n endPath: 28,\n clip: 29,\n eoClip: 30,\n beginText: 31,\n endText: 32,\n setCharSpacing: 33,\n setWordSpacing: 34,\n setHScale: 35,\n setLeading: 36,\n setFont: 37,\n setTextRenderingMode: 38,\n setTextRise: 39,\n moveText: 40,\n setLeadingMoveText: 41,\n setTextMatrix: 42,\n nextLine: 43,\n showText: 44,\n showSpacedText: 45,\n nextLineShowText: 46,\n nextLineSetSpacingShowText: 47,\n setCharWidth: 48,\n setCharWidthAndBounds: 49,\n setStrokeColorSpace: 50,\n setFillColorSpace: 51,\n setStrokeColor: 52,\n setStrokeColorN: 53,\n setFillColor: 54,\n setFillColorN: 55,\n setStrokeGray: 56,\n setFillGray: 57,\n setStrokeRGBColor: 58,\n setFillRGBColor: 59,\n setStrokeCMYKColor: 60,\n setFillCMYKColor: 61,\n shadingFill: 62,\n beginInlineImage: 63,\n beginImageData: 64,\n endInlineImage: 65,\n paintXObject: 66,\n markPoint: 67,\n markPointProps: 68,\n beginMarkedContent: 69,\n beginMarkedContentProps: 70,\n endMarkedContent: 71,\n beginCompat: 72,\n endCompat: 73,\n paintFormXObjectBegin: 74,\n paintFormXObjectEnd: 75,\n beginGroup: 76,\n endGroup: 77,\n // beginAnnotations: 78,\n // endAnnotations: 79,\n beginAnnotation: 80,\n endAnnotation: 81,\n // paintJpegXObject: 82,\n paintImageMaskXObject: 83,\n paintImageMaskXObjectGroup: 84,\n paintImageXObject: 85,\n paintInlineImageXObject: 86,\n paintInlineImageXObjectGroup: 87,\n paintImageXObjectRepeat: 88,\n paintImageMaskXObjectRepeat: 89,\n paintSolidColorImageMask: 90,\n constructPath: 91,\n};\n\nconst PasswordResponses = {\n NEED_PASSWORD: 1,\n INCORRECT_PASSWORD: 2,\n};\n\nlet verbosity = VerbosityLevel.WARNINGS;\n\nfunction setVerbosityLevel(level) {\n if (Number.isInteger(level)) {\n verbosity = level;\n }\n}\n\nfunction getVerbosityLevel() {\n return verbosity;\n}\n\n// A notice for devs. These are good for things that are helpful to devs, such\n// as warning that Workers were disabled, which is important to devs but not\n// end users.\nfunction info(msg) {\n if (verbosity >= VerbosityLevel.INFOS) {\n console.log(`Info: ${msg}`);\n }\n}\n\n// Non-fatal warnings.\nfunction warn(msg) {\n if (verbosity >= VerbosityLevel.WARNINGS) {\n console.log(`Warning: ${msg}`);\n }\n}\n\nfunction unreachable(msg) {\n throw new Error(msg);\n}\n\nfunction assert(cond, msg) {\n if (!cond) {\n unreachable(msg);\n }\n}\n\n// Checks if URLs use one of the allowed protocols, e.g. to avoid XSS.\nfunction _isValidProtocol(url) {\n switch (url?.protocol) {\n case \"http:\":\n case \"https:\":\n case \"ftp:\":\n case \"mailto:\":\n case \"tel:\":\n return true;\n default:\n return false;\n }\n}\n\n/**\n * Attempts to create a valid absolute URL.\n *\n * @param {URL|string} url - An absolute, or relative, URL.\n * @param {URL|string} [baseUrl] - An absolute URL.\n * @param {Object} [options]\n * @returns Either a valid {URL}, or `null` otherwise.\n */\nfunction createValidAbsoluteUrl(url, baseUrl = null, options = null) {\n if (!url) {\n return null;\n }\n try {\n if (options && typeof url === \"string\") {\n // Let URLs beginning with \"www.\" default to using the \"http://\" protocol.\n if (options.addDefaultProtocol && url.startsWith(\"www.\")) {\n const dots = url.match(/\\./g);\n // Avoid accidentally matching a *relative* URL pointing to a file named\n // e.g. \"www.pdf\" or similar.\n if (dots?.length >= 2) {\n url = `http://${url}`;\n }\n }\n\n // According to ISO 32000-1:2008, section 12.6.4.7, URIs should be encoded\n // in 7-bit ASCII. Some bad PDFs use UTF-8 encoding; see bug 1122280.\n if (options.tryConvertEncoding) {\n try {\n url = stringToUTF8String(url);\n } catch {}\n }\n }\n\n const absoluteUrl = baseUrl ? new URL(url, baseUrl) : new URL(url);\n if (_isValidProtocol(absoluteUrl)) {\n return absoluteUrl;\n }\n } catch {\n /* `new URL()` will throw on incorrect data. */\n }\n return null;\n}\n\nfunction shadow(obj, prop, value, nonSerializable = false) {\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) {\n assert(\n prop in obj,\n `shadow: Property \"${prop && prop.toString()}\" not found in object.`\n );\n }\n Object.defineProperty(obj, prop, {\n value,\n enumerable: !nonSerializable,\n configurable: true,\n writable: false,\n });\n return value;\n}\n\n/**\n * @type {any}\n */\nconst BaseException = (function BaseExceptionClosure() {\n // eslint-disable-next-line no-shadow\n function BaseException(message, name) {\n if (this.constructor === BaseException) {\n unreachable(\"Cannot initialize BaseException.\");\n }\n this.message = message;\n this.name = name;\n }\n BaseException.prototype = new Error();\n BaseException.constructor = BaseException;\n\n return BaseException;\n})();\n\nclass PasswordException extends BaseException {\n constructor(msg, code) {\n super(msg, \"PasswordException\");\n this.code = code;\n }\n}\n\nclass UnknownErrorException extends BaseException {\n constructor(msg, details) {\n super(msg, \"UnknownErrorException\");\n this.details = details;\n }\n}\n\nclass InvalidPDFException extends BaseException {\n constructor(msg) {\n super(msg, \"InvalidPDFException\");\n }\n}\n\nclass MissingPDFException extends BaseException {\n constructor(msg) {\n super(msg, \"MissingPDFException\");\n }\n}\n\nclass UnexpectedResponseException extends BaseException {\n constructor(msg, status) {\n super(msg, \"UnexpectedResponseException\");\n this.status = status;\n }\n}\n\n/**\n * Error caused during parsing PDF data.\n */\nclass FormatError extends BaseException {\n constructor(msg) {\n super(msg, \"FormatError\");\n }\n}\n\n/**\n * Error used to indicate task cancellation.\n */\nclass AbortException extends BaseException {\n constructor(msg) {\n super(msg, \"AbortException\");\n }\n}\n\nfunction bytesToString(bytes) {\n if (typeof bytes !== \"object\" || bytes?.length === undefined) {\n unreachable(\"Invalid argument for bytesToString\");\n }\n const length = bytes.length;\n const MAX_ARGUMENT_COUNT = 8192;\n if (length < MAX_ARGUMENT_COUNT) {\n return String.fromCharCode.apply(null, bytes);\n }\n const strBuf = [];\n for (let i = 0; i < length; i += MAX_ARGUMENT_COUNT) {\n const chunkEnd = Math.min(i + MAX_ARGUMENT_COUNT, length);\n const chunk = bytes.subarray(i, chunkEnd);\n strBuf.push(String.fromCharCode.apply(null, chunk));\n }\n return strBuf.join(\"\");\n}\n\nfunction stringToBytes(str) {\n if (typeof str !== \"string\") {\n unreachable(\"Invalid argument for stringToBytes\");\n }\n const length = str.length;\n const bytes = new Uint8Array(length);\n for (let i = 0; i < length; ++i) {\n bytes[i] = str.charCodeAt(i) & 0xff;\n }\n return bytes;\n}\n\nfunction string32(value) {\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) {\n assert(\n typeof value === \"number\" && Math.abs(value) < 2 ** 32,\n `string32: Unexpected input \"${value}\".`\n );\n }\n return String.fromCharCode(\n (value >> 24) & 0xff,\n (value >> 16) & 0xff,\n (value >> 8) & 0xff,\n value & 0xff\n );\n}\n\nfunction objectSize(obj) {\n return Object.keys(obj).length;\n}\n\n// Ensure that the returned Object has a `null` prototype; hence why\n// `Object.fromEntries(...)` is not used.\nfunction objectFromMap(map) {\n const obj = Object.create(null);\n for (const [key, value] of map) {\n obj[key] = value;\n }\n return obj;\n}\n\n// Checks the endianness of the platform.\nfunction isLittleEndian() {\n const buffer8 = new Uint8Array(4);\n buffer8[0] = 1;\n const view32 = new Uint32Array(buffer8.buffer, 0, 1);\n return view32[0] === 1;\n}\n\n// Checks if it's possible to eval JS expressions.\nfunction isEvalSupported() {\n try {\n new Function(\"\"); // eslint-disable-line no-new, no-new-func\n return true;\n } catch {\n return false;\n }\n}\n\nclass FeatureTest {\n static get isLittleEndian() {\n return shadow(this, \"isLittleEndian\", isLittleEndian());\n }\n\n static get isEvalSupported() {\n return shadow(this, \"isEvalSupported\", isEvalSupported());\n }\n\n static get isOffscreenCanvasSupported() {\n return shadow(\n this,\n \"isOffscreenCanvasSupported\",\n typeof OffscreenCanvas !== \"undefined\"\n );\n }\n\n static get platform() {\n if (\n (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) ||\n (typeof navigator !== \"undefined\" &&\n typeof navigator?.platform === \"string\")\n ) {\n return shadow(this, \"platform\", {\n isMac: navigator.platform.includes(\"Mac\"),\n });\n }\n return shadow(this, \"platform\", { isMac: false });\n }\n\n static get isCSSRoundSupported() {\n return shadow(\n this,\n \"isCSSRoundSupported\",\n globalThis.CSS?.supports?.(\"width: round(1.5px, 1px)\")\n );\n }\n}\n\nconst hexNumbers = Array.from(Array(256).keys(), n =>\n n.toString(16).padStart(2, \"0\")\n);\n\nclass Util {\n static makeHexColor(r, g, b) {\n return `#${hexNumbers[r]}${hexNumbers[g]}${hexNumbers[b]}`;\n }\n\n // Apply a scaling matrix to some min/max values.\n // If a scaling factor is negative then min and max must be\n // swapped.\n static scaleMinMax(transform, minMax) {\n let temp;\n if (transform[0]) {\n if (transform[0] < 0) {\n temp = minMax[0];\n minMax[0] = minMax[2];\n minMax[2] = temp;\n }\n minMax[0] *= transform[0];\n minMax[2] *= transform[0];\n\n if (transform[3] < 0) {\n temp = minMax[1];\n minMax[1] = minMax[3];\n minMax[3] = temp;\n }\n minMax[1] *= transform[3];\n minMax[3] *= transform[3];\n } else {\n temp = minMax[0];\n minMax[0] = minMax[1];\n minMax[1] = temp;\n temp = minMax[2];\n minMax[2] = minMax[3];\n minMax[3] = temp;\n\n if (transform[1] < 0) {\n temp = minMax[1];\n minMax[1] = minMax[3];\n minMax[3] = temp;\n }\n minMax[1] *= transform[1];\n minMax[3] *= transform[1];\n\n if (transform[2] < 0) {\n temp = minMax[0];\n minMax[0] = minMax[2];\n minMax[2] = temp;\n }\n minMax[0] *= transform[2];\n minMax[2] *= transform[2];\n }\n minMax[0] += transform[4];\n minMax[1] += transform[5];\n minMax[2] += transform[4];\n minMax[3] += transform[5];\n }\n\n // Concatenates two transformation matrices together and returns the result.\n static transform(m1, m2) {\n return [\n m1[0] * m2[0] + m1[2] * m2[1],\n m1[1] * m2[0] + m1[3] * m2[1],\n m1[0] * m2[2] + m1[2] * m2[3],\n m1[1] * m2[2] + m1[3] * m2[3],\n m1[0] * m2[4] + m1[2] * m2[5] + m1[4],\n m1[1] * m2[4] + m1[3] * m2[5] + m1[5],\n ];\n }\n\n // For 2d affine transforms\n static applyTransform(p, m) {\n const xt = p[0] * m[0] + p[1] * m[2] + m[4];\n const yt = p[0] * m[1] + p[1] * m[3] + m[5];\n return [xt, yt];\n }\n\n static applyInverseTransform(p, m) {\n const d = m[0] * m[3] - m[1] * m[2];\n const xt = (p[0] * m[3] - p[1] * m[2] + m[2] * m[5] - m[4] * m[3]) / d;\n const yt = (-p[0] * m[1] + p[1] * m[0] + m[4] * m[1] - m[5] * m[0]) / d;\n return [xt, yt];\n }\n\n // Applies the transform to the rectangle and finds the minimum axially\n // aligned bounding box.\n static getAxialAlignedBoundingBox(r, m) {\n const p1 = this.applyTransform(r, m);\n const p2 = this.applyTransform(r.slice(2, 4), m);\n const p3 = this.applyTransform([r[0], r[3]], m);\n const p4 = this.applyTransform([r[2], r[1]], m);\n return [\n Math.min(p1[0], p2[0], p3[0], p4[0]),\n Math.min(p1[1], p2[1], p3[1], p4[1]),\n Math.max(p1[0], p2[0], p3[0], p4[0]),\n Math.max(p1[1], p2[1], p3[1], p4[1]),\n ];\n }\n\n static inverseTransform(m) {\n const d = m[0] * m[3] - m[1] * m[2];\n return [\n m[3] / d,\n -m[1] / d,\n -m[2] / d,\n m[0] / d,\n (m[2] * m[5] - m[4] * m[3]) / d,\n (m[4] * m[1] - m[5] * m[0]) / d,\n ];\n }\n\n // This calculation uses Singular Value Decomposition.\n // The SVD can be represented with formula A = USV. We are interested in the\n // matrix S here because it represents the scale values.\n static singularValueDecompose2dScale(m) {\n const transpose = [m[0], m[2], m[1], m[3]];\n\n // Multiply matrix m with its transpose.\n const a = m[0] * transpose[0] + m[1] * transpose[2];\n const b = m[0] * transpose[1] + m[1] * transpose[3];\n const c = m[2] * transpose[0] + m[3] * transpose[2];\n const d = m[2] * transpose[1] + m[3] * transpose[3];\n\n // Solve the second degree polynomial to get roots.\n const first = (a + d) / 2;\n const second = Math.sqrt((a + d) ** 2 - 4 * (a * d - c * b)) / 2;\n const sx = first + second || 1;\n const sy = first - second || 1;\n\n // Scale values are the square roots of the eigenvalues.\n return [Math.sqrt(sx), Math.sqrt(sy)];\n }\n\n // Normalize rectangle rect=[x1, y1, x2, y2] so that (x1,y1) < (x2,y2)\n // For coordinate systems whose origin lies in the bottom-left, this\n // means normalization to (BL,TR) ordering. For systems with origin in the\n // top-left, this means (TL,BR) ordering.\n static normalizeRect(rect) {\n const r = rect.slice(0); // clone rect\n if (rect[0] > rect[2]) {\n r[0] = rect[2];\n r[2] = rect[0];\n }\n if (rect[1] > rect[3]) {\n r[1] = rect[3];\n r[3] = rect[1];\n }\n return r;\n }\n\n // Returns a rectangle [x1, y1, x2, y2] corresponding to the\n // intersection of rect1 and rect2. If no intersection, returns 'null'\n // The rectangle coordinates of rect1, rect2 should be [x1, y1, x2, y2]\n static intersect(rect1, rect2) {\n const xLow = Math.max(\n Math.min(rect1[0], rect1[2]),\n Math.min(rect2[0], rect2[2])\n );\n const xHigh = Math.min(\n Math.max(rect1[0], rect1[2]),\n Math.max(rect2[0], rect2[2])\n );\n if (xLow > xHigh) {\n return null;\n }\n const yLow = Math.max(\n Math.min(rect1[1], rect1[3]),\n Math.min(rect2[1], rect2[3])\n );\n const yHigh = Math.min(\n Math.max(rect1[1], rect1[3]),\n Math.max(rect2[1], rect2[3])\n );\n if (yLow > yHigh) {\n return null;\n }\n\n return [xLow, yLow, xHigh, yHigh];\n }\n\n static #getExtremumOnCurve(x0, x1, x2, x3, y0, y1, y2, y3, t, minMax) {\n if (t <= 0 || t >= 1) {\n return;\n }\n const mt = 1 - t;\n const tt = t * t;\n const ttt = tt * t;\n const x = mt * (mt * (mt * x0 + 3 * t * x1) + 3 * tt * x2) + ttt * x3;\n const y = mt * (mt * (mt * y0 + 3 * t * y1) + 3 * tt * y2) + ttt * y3;\n minMax[0] = Math.min(minMax[0], x);\n minMax[1] = Math.min(minMax[1], y);\n minMax[2] = Math.max(minMax[2], x);\n minMax[3] = Math.max(minMax[3], y);\n }\n\n static #getExtremum(x0, x1, x2, x3, y0, y1, y2, y3, a, b, c, minMax) {\n if (Math.abs(a) < 1e-12) {\n if (Math.abs(b) >= 1e-12) {\n this.#getExtremumOnCurve(\n x0,\n x1,\n x2,\n x3,\n y0,\n y1,\n y2,\n y3,\n -c / b,\n minMax\n );\n }\n return;\n }\n\n const delta = b ** 2 - 4 * c * a;\n if (delta < 0) {\n return;\n }\n const sqrtDelta = Math.sqrt(delta);\n const a2 = 2 * a;\n this.#getExtremumOnCurve(\n x0,\n x1,\n x2,\n x3,\n y0,\n y1,\n y2,\n y3,\n (-b + sqrtDelta) / a2,\n minMax\n );\n this.#getExtremumOnCurve(\n x0,\n x1,\n x2,\n x3,\n y0,\n y1,\n y2,\n y3,\n (-b - sqrtDelta) / a2,\n minMax\n );\n }\n\n // From https://github.com/adobe-webplatform/Snap.svg/blob/b365287722a72526000ac4bfcf0ce4cac2faa015/src/path.js#L852\n static bezierBoundingBox(x0, y0, x1, y1, x2, y2, x3, y3, minMax) {\n if (minMax) {\n minMax[0] = Math.min(minMax[0], x0, x3);\n minMax[1] = Math.min(minMax[1], y0, y3);\n minMax[2] = Math.max(minMax[2], x0, x3);\n minMax[3] = Math.max(minMax[3], y0, y3);\n } else {\n minMax = [\n Math.min(x0, x3),\n Math.min(y0, y3),\n Math.max(x0, x3),\n Math.max(y0, y3),\n ];\n }\n this.#getExtremum(\n x0,\n x1,\n x2,\n x3,\n y0,\n y1,\n y2,\n y3,\n 3 * (-x0 + 3 * (x1 - x2) + x3),\n 6 * (x0 - 2 * x1 + x2),\n 3 * (x1 - x0),\n minMax\n );\n this.#getExtremum(\n x0,\n x1,\n x2,\n x3,\n y0,\n y1,\n y2,\n y3,\n 3 * (-y0 + 3 * (y1 - y2) + y3),\n 6 * (y0 - 2 * y1 + y2),\n 3 * (y1 - y0),\n minMax\n );\n return minMax;\n }\n}\n\nconst PDFStringTranslateTable = [\n 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x2d8,\n 0x2c7, 0x2c6, 0x2d9, 0x2dd, 0x2db, 0x2da, 0x2dc, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n 0, 0, 0, 0, 0, 0, 0, 0, 0x2022, 0x2020, 0x2021, 0x2026, 0x2014, 0x2013, 0x192,\n 0x2044, 0x2039, 0x203a, 0x2212, 0x2030, 0x201e, 0x201c, 0x201d, 0x2018,\n 0x2019, 0x201a, 0x2122, 0xfb01, 0xfb02, 0x141, 0x152, 0x160, 0x178, 0x17d,\n 0x131, 0x142, 0x153, 0x161, 0x17e, 0, 0x20ac,\n];\n\nfunction stringToPDFString(str) {\n // See section 7.9.2.2 Text String Type.\n // The string can contain some language codes bracketed with 0x0b,\n // so we must remove them.\n if (str[0] >= \"\\xEF\") {\n let encoding;\n if (str[0] === \"\\xFE\" && str[1] === \"\\xFF\") {\n encoding = \"utf-16be\";\n if (str.length % 2 === 1) {\n str = str.slice(0, -1);\n }\n } else if (str[0] === \"\\xFF\" && str[1] === \"\\xFE\") {\n encoding = \"utf-16le\";\n if (str.length % 2 === 1) {\n str = str.slice(0, -1);\n }\n } else if (str[0] === \"\\xEF\" && str[1] === \"\\xBB\" && str[2] === \"\\xBF\") {\n encoding = \"utf-8\";\n }\n\n if (encoding) {\n try {\n const decoder = new TextDecoder(encoding, { fatal: true });\n const buffer = stringToBytes(str);\n const decoded = decoder.decode(buffer);\n if (!decoded.includes(\"\\x1b\")) {\n return decoded;\n }\n return decoded.replaceAll(/\\x1b[^\\x1b]*(?:\\x1b|$)/g, \"\");\n } catch (ex) {\n warn(`stringToPDFString: \"${ex}\".`);\n }\n }\n }\n // ISO Latin 1\n const strBuf = [];\n for (let i = 0, ii = str.length; i < ii; i++) {\n const charCode = str.charCodeAt(i);\n if (charCode === 0x1b) {\n // eslint-disable-next-line no-empty\n while (++i < ii && str.charCodeAt(i) !== 0x1b) {}\n continue;\n }\n const code = PDFStringTranslateTable[charCode];\n strBuf.push(code ? String.fromCharCode(code) : str.charAt(i));\n }\n return strBuf.join(\"\");\n}\n\nfunction stringToUTF8String(str) {\n return decodeURIComponent(escape(str));\n}\n\nfunction utf8StringToString(str) {\n return unescape(encodeURIComponent(str));\n}\n\nfunction isArrayEqual(arr1, arr2) {\n if (arr1.length !== arr2.length) {\n return false;\n }\n for (let i = 0, ii = arr1.length; i < ii; i++) {\n if (arr1[i] !== arr2[i]) {\n return false;\n }\n }\n return true;\n}\n\nfunction getModificationDate(date = new Date()) {\n const buffer = [\n date.getUTCFullYear().toString(),\n (date.getUTCMonth() + 1).toString().padStart(2, \"0\"),\n date.getUTCDate().toString().padStart(2, \"0\"),\n date.getUTCHours().toString().padStart(2, \"0\"),\n date.getUTCMinutes().toString().padStart(2, \"0\"),\n date.getUTCSeconds().toString().padStart(2, \"0\"),\n ];\n\n return buffer.join(\"\");\n}\n\nlet NormalizeRegex = null;\nlet NormalizationMap = null;\nfunction normalizeUnicode(str) {\n if (!NormalizeRegex) {\n // In order to generate the following regex:\n // - create a PDF containing all the chars in the range 0000-FFFF with\n // a NFKC which is different of the char.\n // - copy and paste all those chars and get the ones where NFKC is\n // required.\n // It appears that most the chars here contain some ligatures.\n NormalizeRegex =\n /([\\u00a0\\u00b5\\u037e\\u0eb3\\u2000-\\u200a\\u202f\\u2126\\ufb00-\\ufb04\\ufb06\\ufb20-\\ufb36\\ufb38-\\ufb3c\\ufb3e\\ufb40-\\ufb41\\ufb43-\\ufb44\\ufb46-\\ufba1\\ufba4-\\ufba9\\ufbae-\\ufbb1\\ufbd3-\\ufbdc\\ufbde-\\ufbe7\\ufbea-\\ufbf8\\ufbfc-\\ufbfd\\ufc00-\\ufc5d\\ufc64-\\ufcf1\\ufcf5-\\ufd3d\\ufd88\\ufdf4\\ufdfa-\\ufdfb\\ufe71\\ufe77\\ufe79\\ufe7b\\ufe7d]+)|(\\ufb05+)/gu;\n NormalizationMap = new Map([[\"ļ¬…\", \"Åæt\"]]);\n }\n return str.replaceAll(NormalizeRegex, (_, p1, p2) =>\n p1 ? p1.normalize(\"NFKC\") : NormalizationMap.get(p2)\n );\n}\n\nfunction getUuid() {\n if (\n (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) ||\n (typeof crypto !== \"undefined\" && typeof crypto?.randomUUID === \"function\")\n ) {\n return crypto.randomUUID();\n }\n const buf = new Uint8Array(32);\n if (\n typeof crypto !== \"undefined\" &&\n typeof crypto?.getRandomValues === \"function\"\n ) {\n crypto.getRandomValues(buf);\n } else {\n for (let i = 0; i < 32; i++) {\n buf[i] = Math.floor(Math.random() * 255);\n }\n }\n return bytesToString(buf);\n}\n\nconst AnnotationPrefix = \"pdfjs_internal_id_\";\n\nconst FontRenderOps = {\n BEZIER_CURVE_TO: 0,\n MOVE_TO: 1,\n LINE_TO: 2,\n QUADRATIC_CURVE_TO: 3,\n RESTORE: 4,\n SAVE: 5,\n SCALE: 6,\n TRANSFORM: 7,\n TRANSLATE: 8,\n};\n\nexport {\n AbortException,\n AnnotationActionEventType,\n AnnotationBorderStyleType,\n AnnotationEditorParamsType,\n AnnotationEditorPrefix,\n AnnotationEditorType,\n AnnotationFieldFlag,\n AnnotationFlag,\n AnnotationMode,\n AnnotationPrefix,\n AnnotationReplyType,\n AnnotationType,\n assert,\n BaseException,\n BASELINE_FACTOR,\n bytesToString,\n CMapCompressionType,\n createValidAbsoluteUrl,\n DocumentActionEventType,\n FeatureTest,\n FONT_IDENTITY_MATRIX,\n FontRenderOps,\n FormatError,\n getModificationDate,\n getUuid,\n getVerbosityLevel,\n IDENTITY_MATRIX,\n ImageKind,\n info,\n InvalidPDFException,\n isArrayEqual,\n isNodeJS,\n LINE_DESCENT_FACTOR,\n LINE_FACTOR,\n MAX_IMAGE_SIZE_TO_CACHE,\n MissingPDFException,\n normalizeUnicode,\n objectFromMap,\n objectSize,\n OPS,\n PageActionEventType,\n PasswordException,\n PasswordResponses,\n PermissionFlag,\n RenderingIntentFlag,\n setVerbosityLevel,\n shadow,\n string32,\n stringToBytes,\n stringToPDFString,\n stringToUTF8String,\n TextRenderingMode,\n UnexpectedResponseException,\n UnknownErrorException,\n unreachable,\n utf8StringToString,\n Util,\n VerbosityLevel,\n warn,\n};\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 */\n\nimport { CMapCompressionType, unreachable } from \"../shared/util.js\";\n\nclass BaseFilterFactory {\n constructor() {\n if (this.constructor === BaseFilterFactory) {\n unreachable(\"Cannot initialize BaseFilterFactory.\");\n }\n }\n\n addFilter(maps) {\n return \"none\";\n }\n\n addHCMFilter(fgColor, bgColor) {\n return \"none\";\n }\n\n addAlphaFilter(map) {\n return \"none\";\n }\n\n addLuminosityFilter(map) {\n return \"none\";\n }\n\n addHighlightHCMFilter(filterName, fgColor, bgColor, newFgColor, newBgColor) {\n return \"none\";\n }\n\n destroy(keepHCM = false) {}\n}\n\nclass BaseCanvasFactory {\n constructor() {\n if (this.constructor === BaseCanvasFactory) {\n unreachable(\"Cannot initialize BaseCanvasFactory.\");\n }\n }\n\n create(width, height) {\n if (width <= 0 || height <= 0) {\n throw new Error(\"Invalid canvas size\");\n }\n const canvas = this._createCanvas(width, height);\n return {\n canvas,\n context: canvas.getContext(\"2d\"),\n };\n }\n\n reset(canvasAndContext, width, height) {\n if (!canvasAndContext.canvas) {\n throw new Error(\"Canvas is not specified\");\n }\n if (width <= 0 || height <= 0) {\n throw new Error(\"Invalid canvas size\");\n }\n canvasAndContext.canvas.width = width;\n canvasAndContext.canvas.height = height;\n }\n\n destroy(canvasAndContext) {\n if (!canvasAndContext.canvas) {\n throw new Error(\"Canvas is not specified\");\n }\n // Zeroing the width and height cause Firefox to release graphics\n // resources immediately, which can greatly reduce memory consumption.\n canvasAndContext.canvas.width = 0;\n canvasAndContext.canvas.height = 0;\n canvasAndContext.canvas = null;\n canvasAndContext.context = null;\n }\n\n /**\n * @ignore\n */\n _createCanvas(width, height) {\n unreachable(\"Abstract method `_createCanvas` called.\");\n }\n}\n\nclass BaseCMapReaderFactory {\n constructor({ baseUrl = null, isCompressed = true }) {\n if (this.constructor === BaseCMapReaderFactory) {\n unreachable(\"Cannot initialize BaseCMapReaderFactory.\");\n }\n this.baseUrl = baseUrl;\n this.isCompressed = isCompressed;\n }\n\n async fetch({ name }) {\n if (!this.baseUrl) {\n throw new Error(\n 'The CMap \"baseUrl\" parameter must be specified, ensure that ' +\n 'the \"cMapUrl\" and \"cMapPacked\" API parameters are provided.'\n );\n }\n if (!name) {\n throw new Error(\"CMap name must be specified.\");\n }\n const url = this.baseUrl + name + (this.isCompressed ? \".bcmap\" : \"\");\n const compressionType = this.isCompressed\n ? CMapCompressionType.BINARY\n : CMapCompressionType.NONE;\n\n return this._fetchData(url, compressionType).catch(reason => {\n throw new Error(\n `Unable to load ${this.isCompressed ? \"binary \" : \"\"}CMap at: ${url}`\n );\n });\n }\n\n /**\n * @ignore\n */\n _fetchData(url, compressionType) {\n unreachable(\"Abstract method `_fetchData` called.\");\n }\n}\n\nclass BaseStandardFontDataFactory {\n constructor({ baseUrl = null }) {\n if (this.constructor === BaseStandardFontDataFactory) {\n unreachable(\"Cannot initialize BaseStandardFontDataFactory.\");\n }\n this.baseUrl = baseUrl;\n }\n\n async fetch({ filename }) {\n if (!this.baseUrl) {\n throw new Error(\n 'The standard font \"baseUrl\" parameter must be specified, ensure that ' +\n 'the \"standardFontDataUrl\" API parameter is provided.'\n );\n }\n if (!filename) {\n throw new Error(\"Font filename must be specified.\");\n }\n const url = `${this.baseUrl}${filename}`;\n\n return this._fetchData(url).catch(reason => {\n throw new Error(`Unable to load font data at: ${url}`);\n });\n }\n\n /**\n * @ignore\n */\n _fetchData(url) {\n unreachable(\"Abstract method `_fetchData` called.\");\n }\n}\n\nclass BaseSVGFactory {\n constructor() {\n if (this.constructor === BaseSVGFactory) {\n unreachable(\"Cannot initialize BaseSVGFactory.\");\n }\n }\n\n create(width, height, skipDimensions = false) {\n if (width <= 0 || height <= 0) {\n throw new Error(\"Invalid SVG dimensions\");\n }\n const svg = this._createSVG(\"svg:svg\");\n svg.setAttribute(\"version\", \"1.1\");\n\n if (!skipDimensions) {\n svg.setAttribute(\"width\", `${width}px`);\n svg.setAttribute(\"height\", `${height}px`);\n }\n\n svg.setAttribute(\"preserveAspectRatio\", \"none\");\n svg.setAttribute(\"viewBox\", `0 0 ${width} ${height}`);\n\n return svg;\n }\n\n createElement(type) {\n if (typeof type !== \"string\") {\n throw new Error(\"Invalid SVG element type\");\n }\n return this._createSVG(type);\n }\n\n /**\n * @ignore\n */\n _createSVG(type) {\n unreachable(\"Abstract method `_createSVG` called.\");\n }\n}\n\nexport {\n BaseCanvasFactory,\n BaseCMapReaderFactory,\n BaseFilterFactory,\n BaseStandardFontDataFactory,\n BaseSVGFactory,\n};\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 */\n\nimport {\n BaseCanvasFactory,\n BaseCMapReaderFactory,\n BaseFilterFactory,\n BaseStandardFontDataFactory,\n BaseSVGFactory,\n} from \"./base_factory.js\";\nimport {\n BaseException,\n FeatureTest,\n shadow,\n stringToBytes,\n Util,\n warn,\n} from \"../shared/util.js\";\n\nconst SVG_NS = \"http://www.w3.org/2000/svg\";\n\nclass PixelsPerInch {\n static CSS = 96.0;\n\n static PDF = 72.0;\n\n static PDF_TO_CSS_UNITS = this.CSS / this.PDF;\n}\n\n/**\n * FilterFactory aims to create some SVG filters we can use when drawing an\n * image (or whatever) on a canvas.\n * Filters aren't applied with ctx.putImageData because it just overwrites the\n * underlying pixels.\n * With these filters, it's possible for example to apply some transfer maps on\n * an image without the need to apply them on the pixel arrays: the renderer\n * does the magic for us.\n */\nclass DOMFilterFactory extends BaseFilterFactory {\n #_cache;\n\n #_defs;\n\n #docId;\n\n #document;\n\n #_hcmCache;\n\n #id = 0;\n\n constructor({ docId, ownerDocument = globalThis.document } = {}) {\n super();\n this.#docId = docId;\n this.#document = ownerDocument;\n }\n\n get #cache() {\n return (this.#_cache ||= new Map());\n }\n\n get #hcmCache() {\n return (this.#_hcmCache ||= new Map());\n }\n\n get #defs() {\n if (!this.#_defs) {\n const div = this.#document.createElement(\"div\");\n const { style } = div;\n style.visibility = \"hidden\";\n style.contain = \"strict\";\n style.width = style.height = 0;\n style.position = \"absolute\";\n style.top = style.left = 0;\n style.zIndex = -1;\n\n const svg = this.#document.createElementNS(SVG_NS, \"svg\");\n svg.setAttribute(\"width\", 0);\n svg.setAttribute(\"height\", 0);\n this.#_defs = this.#document.createElementNS(SVG_NS, \"defs\");\n div.append(svg);\n svg.append(this.#_defs);\n this.#document.body.append(div);\n }\n return this.#_defs;\n }\n\n #createTables(maps) {\n if (maps.length === 1) {\n const mapR = maps[0];\n const buffer = new Array(256);\n for (let i = 0; i < 256; i++) {\n buffer[i] = mapR[i] / 255;\n }\n\n const table = buffer.join(\",\");\n return [table, table, table];\n }\n\n const [mapR, mapG, mapB] = maps;\n const bufferR = new Array(256);\n const bufferG = new Array(256);\n const bufferB = new Array(256);\n for (let i = 0; i < 256; i++) {\n bufferR[i] = mapR[i] / 255;\n bufferG[i] = mapG[i] / 255;\n bufferB[i] = mapB[i] / 255;\n }\n return [bufferR.join(\",\"), bufferG.join(\",\"), bufferB.join(\",\")];\n }\n\n addFilter(maps) {\n if (!maps) {\n return \"none\";\n }\n\n // When a page is zoomed the page is re-drawn but the maps are likely\n // the same.\n let value = this.#cache.get(maps);\n if (value) {\n return value;\n }\n\n const [tableR, tableG, tableB] = this.#createTables(maps);\n const key = maps.length === 1 ? tableR : `${tableR}${tableG}${tableB}`;\n\n value = this.#cache.get(key);\n if (value) {\n this.#cache.set(maps, value);\n return value;\n }\n\n // We create a SVG filter: feComponentTransferElement\n // https://www.w3.org/TR/SVG11/filters.html#feComponentTransferElement\n\n const id = `g_${this.#docId}_transfer_map_${this.#id++}`;\n const url = `url(#${id})`;\n this.#cache.set(maps, url);\n this.#cache.set(key, url);\n\n const filter = this.#createFilter(id);\n this.#addTransferMapConversion(tableR, tableG, tableB, filter);\n\n return url;\n }\n\n addHCMFilter(fgColor, bgColor) {\n const key = `${fgColor}-${bgColor}`;\n const filterName = \"base\";\n let info = this.#hcmCache.get(filterName);\n if (info?.key === key) {\n return info.url;\n }\n\n if (info) {\n info.filter?.remove();\n info.key = key;\n info.url = \"none\";\n info.filter = null;\n } else {\n info = {\n key,\n url: \"none\",\n filter: null,\n };\n this.#hcmCache.set(filterName, info);\n }\n\n if (!fgColor || !bgColor) {\n return info.url;\n }\n\n const fgRGB = this.#getRGB(fgColor);\n fgColor = Util.makeHexColor(...fgRGB);\n const bgRGB = this.#getRGB(bgColor);\n bgColor = Util.makeHexColor(...bgRGB);\n this.#defs.style.color = \"\";\n\n if (\n (fgColor === \"#000000\" && bgColor === \"#ffffff\") ||\n fgColor === bgColor\n ) {\n return info.url;\n }\n\n // https://developer.mozilla.org/en-US/docs/Web/Accessibility/Understanding_Colors_and_Luminance\n //\n // Relative luminance:\n // https://www.w3.org/TR/WCAG20/#relativeluminancedef\n //\n // We compute the rounded luminance of the default background color.\n // Then for every color in the pdf, if its rounded luminance is the\n // same as the background one then it's replaced by the new\n // background color else by the foreground one.\n const map = new Array(256);\n for (let i = 0; i <= 255; i++) {\n const x = i / 255;\n map[i] = x <= 0.03928 ? x / 12.92 : ((x + 0.055) / 1.055) ** 2.4;\n }\n const table = map.join(\",\");\n\n const id = `g_${this.#docId}_hcm_filter`;\n const filter = (info.filter = this.#createFilter(id));\n this.#addTransferMapConversion(table, table, table, filter);\n this.#addGrayConversion(filter);\n\n const getSteps = (c, n) => {\n const start = fgRGB[c] / 255;\n const end = bgRGB[c] / 255;\n const arr = new Array(n + 1);\n for (let i = 0; i <= n; i++) {\n arr[i] = start + (i / n) * (end - start);\n }\n return arr.join(\",\");\n };\n this.#addTransferMapConversion(\n getSteps(0, 5),\n getSteps(1, 5),\n getSteps(2, 5),\n filter\n );\n\n info.url = `url(#${id})`;\n return info.url;\n }\n\n addAlphaFilter(map) {\n // When a page is zoomed the page is re-drawn but the maps are likely\n // the same.\n let value = this.#cache.get(map);\n if (value) {\n return value;\n }\n\n const [tableA] = this.#createTables([map]);\n const key = `alpha_${tableA}`;\n\n value = this.#cache.get(key);\n if (value) {\n this.#cache.set(map, value);\n return value;\n }\n\n const id = `g_${this.#docId}_alpha_map_${this.#id++}`;\n const url = `url(#${id})`;\n this.#cache.set(map, url);\n this.#cache.set(key, url);\n\n const filter = this.#createFilter(id);\n this.#addTransferMapAlphaConversion(tableA, filter);\n\n return url;\n }\n\n addLuminosityFilter(map) {\n // When a page is zoomed the page is re-drawn but the maps are likely\n // the same.\n let value = this.#cache.get(map || \"luminosity\");\n if (value) {\n return value;\n }\n\n let tableA, key;\n if (map) {\n [tableA] = this.#createTables([map]);\n key = `luminosity_${tableA}`;\n } else {\n key = \"luminosity\";\n }\n\n value = this.#cache.get(key);\n if (value) {\n this.#cache.set(map, value);\n return value;\n }\n\n const id = `g_${this.#docId}_luminosity_map_${this.#id++}`;\n const url = `url(#${id})`;\n this.#cache.set(map, url);\n this.#cache.set(key, url);\n\n const filter = this.#createFilter(id);\n this.#addLuminosityConversion(filter);\n if (map) {\n this.#addTransferMapAlphaConversion(tableA, filter);\n }\n\n return url;\n }\n\n addHighlightHCMFilter(filterName, fgColor, bgColor, newFgColor, newBgColor) {\n const key = `${fgColor}-${bgColor}-${newFgColor}-${newBgColor}`;\n let info = this.#hcmCache.get(filterName);\n if (info?.key === key) {\n return info.url;\n }\n\n if (info) {\n info.filter?.remove();\n info.key = key;\n info.url = \"none\";\n info.filter = null;\n } else {\n info = {\n key,\n url: \"none\",\n filter: null,\n };\n this.#hcmCache.set(filterName, info);\n }\n\n if (!fgColor || !bgColor) {\n return info.url;\n }\n\n const [fgRGB, bgRGB] = [fgColor, bgColor].map(this.#getRGB.bind(this));\n let fgGray = Math.round(\n 0.2126 * fgRGB[0] + 0.7152 * fgRGB[1] + 0.0722 * fgRGB[2]\n );\n let bgGray = Math.round(\n 0.2126 * bgRGB[0] + 0.7152 * bgRGB[1] + 0.0722 * bgRGB[2]\n );\n let [newFgRGB, newBgRGB] = [newFgColor, newBgColor].map(\n this.#getRGB.bind(this)\n );\n if (bgGray < fgGray) {\n [fgGray, bgGray, newFgRGB, newBgRGB] = [\n bgGray,\n fgGray,\n newBgRGB,\n newFgRGB,\n ];\n }\n this.#defs.style.color = \"\";\n\n // Now we can create the filters to highlight some canvas parts.\n // The colors in the pdf will almost be Canvas and CanvasText, hence we\n // want to filter them to finally get Highlight and HighlightText.\n // Since we're in HCM the background color and the foreground color should\n // be really different when converted to grayscale (if they're not then it\n // means that we've a poor contrast). Once the canvas colors are converted\n // to grayscale we can easily map them on their new colors.\n // The grayscale step is important because if we've something like:\n // fgColor = #FF....\n // bgColor = #FF....\n // then we are enable to map the red component on the new red components\n // which can be different.\n\n const getSteps = (fg, bg, n) => {\n const arr = new Array(256);\n const step = (bgGray - fgGray) / n;\n const newStart = fg / 255;\n const newStep = (bg - fg) / (255 * n);\n let prev = 0;\n for (let i = 0; i <= n; i++) {\n const k = Math.round(fgGray + i * step);\n const value = newStart + i * newStep;\n for (let j = prev; j <= k; j++) {\n arr[j] = value;\n }\n prev = k + 1;\n }\n for (let i = prev; i < 256; i++) {\n arr[i] = arr[prev - 1];\n }\n return arr.join(\",\");\n };\n\n const id = `g_${this.#docId}_hcm_${filterName}_filter`;\n const filter = (info.filter = this.#createFilter(id));\n\n this.#addGrayConversion(filter);\n this.#addTransferMapConversion(\n getSteps(newFgRGB[0], newBgRGB[0], 5),\n getSteps(newFgRGB[1], newBgRGB[1], 5),\n getSteps(newFgRGB[2], newBgRGB[2], 5),\n filter\n );\n\n info.url = `url(#${id})`;\n return info.url;\n }\n\n destroy(keepHCM = false) {\n if (keepHCM && this.#hcmCache.size !== 0) {\n return;\n }\n if (this.#_defs) {\n this.#_defs.parentNode.parentNode.remove();\n this.#_defs = null;\n }\n if (this.#_cache) {\n this.#_cache.clear();\n this.#_cache = null;\n }\n this.#id = 0;\n }\n\n #addLuminosityConversion(filter) {\n const feColorMatrix = this.#document.createElementNS(\n SVG_NS,\n \"feColorMatrix\"\n );\n feColorMatrix.setAttribute(\"type\", \"matrix\");\n feColorMatrix.setAttribute(\n \"values\",\n \"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.3 0.59 0.11 0 0\"\n );\n filter.append(feColorMatrix);\n }\n\n #addGrayConversion(filter) {\n const feColorMatrix = this.#document.createElementNS(\n SVG_NS,\n \"feColorMatrix\"\n );\n feColorMatrix.setAttribute(\"type\", \"matrix\");\n feColorMatrix.setAttribute(\n \"values\",\n \"0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0 0 0 1 0\"\n );\n filter.append(feColorMatrix);\n }\n\n #createFilter(id) {\n const filter = this.#document.createElementNS(SVG_NS, \"filter\");\n filter.setAttribute(\"color-interpolation-filters\", \"sRGB\");\n filter.setAttribute(\"id\", id);\n this.#defs.append(filter);\n\n return filter;\n }\n\n #appendFeFunc(feComponentTransfer, func, table) {\n const feFunc = this.#document.createElementNS(SVG_NS, func);\n feFunc.setAttribute(\"type\", \"discrete\");\n feFunc.setAttribute(\"tableValues\", table);\n feComponentTransfer.append(feFunc);\n }\n\n #addTransferMapConversion(rTable, gTable, bTable, filter) {\n const feComponentTransfer = this.#document.createElementNS(\n SVG_NS,\n \"feComponentTransfer\"\n );\n filter.append(feComponentTransfer);\n this.#appendFeFunc(feComponentTransfer, \"feFuncR\", rTable);\n this.#appendFeFunc(feComponentTransfer, \"feFuncG\", gTable);\n this.#appendFeFunc(feComponentTransfer, \"feFuncB\", bTable);\n }\n\n #addTransferMapAlphaConversion(aTable, filter) {\n const feComponentTransfer = this.#document.createElementNS(\n SVG_NS,\n \"feComponentTransfer\"\n );\n filter.append(feComponentTransfer);\n this.#appendFeFunc(feComponentTransfer, \"feFuncA\", aTable);\n }\n\n #getRGB(color) {\n this.#defs.style.color = color;\n return getRGB(getComputedStyle(this.#defs).getPropertyValue(\"color\"));\n }\n}\n\nclass DOMCanvasFactory extends BaseCanvasFactory {\n constructor({ ownerDocument = globalThis.document } = {}) {\n super();\n this._document = ownerDocument;\n }\n\n /**\n * @ignore\n */\n _createCanvas(width, height) {\n const canvas = this._document.createElement(\"canvas\");\n canvas.width = width;\n canvas.height = height;\n return canvas;\n }\n}\n\nasync function fetchData(url, type = \"text\") {\n if (\n (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) ||\n isValidFetchUrl(url, document.baseURI)\n ) {\n const response = await fetch(url);\n if (!response.ok) {\n throw new Error(response.statusText);\n }\n switch (type) {\n case \"arraybuffer\":\n return response.arrayBuffer();\n case \"blob\":\n return response.blob();\n case \"json\":\n return response.json();\n }\n return response.text();\n }\n\n // The Fetch API is not supported.\n return new Promise((resolve, reject) => {\n const request = new XMLHttpRequest();\n request.open(\"GET\", url, /* async = */ true);\n request.responseType = type;\n\n request.onreadystatechange = () => {\n if (request.readyState !== XMLHttpRequest.DONE) {\n return;\n }\n if (request.status === 200 || request.status === 0) {\n switch (type) {\n case \"arraybuffer\":\n case \"blob\":\n case \"json\":\n resolve(request.response);\n return;\n }\n resolve(request.responseText);\n return;\n }\n reject(new Error(request.statusText));\n };\n\n request.send(null);\n });\n}\n\nclass DOMCMapReaderFactory extends BaseCMapReaderFactory {\n /**\n * @ignore\n */\n _fetchData(url, compressionType) {\n return fetchData(\n url,\n /* type = */ this.isCompressed ? \"arraybuffer\" : \"text\"\n ).then(data => ({\n cMapData:\n data instanceof ArrayBuffer\n ? new Uint8Array(data)\n : stringToBytes(data),\n compressionType,\n }));\n }\n}\n\nclass DOMStandardFontDataFactory extends BaseStandardFontDataFactory {\n /**\n * @ignore\n */\n _fetchData(url) {\n return fetchData(url, /* type = */ \"arraybuffer\").then(\n data => new Uint8Array(data)\n );\n }\n}\n\nclass DOMSVGFactory extends BaseSVGFactory {\n /**\n * @ignore\n */\n _createSVG(type) {\n return document.createElementNS(SVG_NS, type);\n }\n}\n\n/**\n * @typedef {Object} PageViewportParameters\n * @property {Array} viewBox - The xMin, yMin, xMax and\n * yMax coordinates.\n * @property {number} scale - The scale of the viewport.\n * @property {number} rotation - The rotation, in degrees, of the viewport.\n * @property {number} [offsetX] - The horizontal, i.e. x-axis, offset. The\n * default value is `0`.\n * @property {number} [offsetY] - The vertical, i.e. y-axis, offset. The\n * default value is `0`.\n * @property {boolean} [dontFlip] - If true, the y-axis will not be flipped.\n * The default value is `false`.\n */\n\n/**\n * @typedef {Object} PageViewportCloneParameters\n * @property {number} [scale] - The scale, overriding the one in the cloned\n * viewport. The default value is `this.scale`.\n * @property {number} [rotation] - The rotation, in degrees, overriding the one\n * in the cloned viewport. The default value is `this.rotation`.\n * @property {number} [offsetX] - The horizontal, i.e. x-axis, offset.\n * The default value is `this.offsetX`.\n * @property {number} [offsetY] - The vertical, i.e. y-axis, offset.\n * The default value is `this.offsetY`.\n * @property {boolean} [dontFlip] - If true, the x-axis will not be flipped.\n * The default value is `false`.\n */\n\n/**\n * PDF page viewport created based on scale, rotation and offset.\n */\nclass PageViewport {\n /**\n * @param {PageViewportParameters}\n */\n constructor({\n viewBox,\n scale,\n rotation,\n offsetX = 0,\n offsetY = 0,\n dontFlip = false,\n }) {\n this.viewBox = viewBox;\n this.scale = scale;\n this.rotation = rotation;\n this.offsetX = offsetX;\n this.offsetY = offsetY;\n\n // creating transform to convert pdf coordinate system to the normal\n // canvas like coordinates taking in account scale and rotation\n const centerX = (viewBox[2] + viewBox[0]) / 2;\n const centerY = (viewBox[3] + viewBox[1]) / 2;\n let rotateA, rotateB, rotateC, rotateD;\n // Normalize the rotation, by clamping it to the [0, 360) range.\n rotation %= 360;\n if (rotation < 0) {\n rotation += 360;\n }\n switch (rotation) {\n case 180:\n rotateA = -1;\n rotateB = 0;\n rotateC = 0;\n rotateD = 1;\n break;\n case 90:\n rotateA = 0;\n rotateB = 1;\n rotateC = 1;\n rotateD = 0;\n break;\n case 270:\n rotateA = 0;\n rotateB = -1;\n rotateC = -1;\n rotateD = 0;\n break;\n case 0:\n rotateA = 1;\n rotateB = 0;\n rotateC = 0;\n rotateD = -1;\n break;\n default:\n throw new Error(\n \"PageViewport: Invalid rotation, must be a multiple of 90 degrees.\"\n );\n }\n\n if (dontFlip) {\n rotateC = -rotateC;\n rotateD = -rotateD;\n }\n\n let offsetCanvasX, offsetCanvasY;\n let width, height;\n if (rotateA === 0) {\n offsetCanvasX = Math.abs(centerY - viewBox[1]) * scale + offsetX;\n offsetCanvasY = Math.abs(centerX - viewBox[0]) * scale + offsetY;\n width = (viewBox[3] - viewBox[1]) * scale;\n height = (viewBox[2] - viewBox[0]) * scale;\n } else {\n offsetCanvasX = Math.abs(centerX - viewBox[0]) * scale + offsetX;\n offsetCanvasY = Math.abs(centerY - viewBox[1]) * scale + offsetY;\n width = (viewBox[2] - viewBox[0]) * scale;\n height = (viewBox[3] - viewBox[1]) * scale;\n }\n // creating transform for the following operations:\n // translate(-centerX, -centerY), rotate and flip vertically,\n // scale, and translate(offsetCanvasX, offsetCanvasY)\n this.transform = [\n rotateA * scale,\n rotateB * scale,\n rotateC * scale,\n rotateD * scale,\n offsetCanvasX - rotateA * scale * centerX - rotateC * scale * centerY,\n offsetCanvasY - rotateB * scale * centerX - rotateD * scale * centerY,\n ];\n\n this.width = width;\n this.height = height;\n }\n\n /**\n * The original, un-scaled, viewport dimensions.\n * @type {Object}\n */\n get rawDims() {\n const { viewBox } = this;\n return shadow(this, \"rawDims\", {\n pageWidth: viewBox[2] - viewBox[0],\n pageHeight: viewBox[3] - viewBox[1],\n pageX: viewBox[0],\n pageY: viewBox[1],\n });\n }\n\n /**\n * Clones viewport, with optional additional properties.\n * @param {PageViewportCloneParameters} [params]\n * @returns {PageViewport} Cloned viewport.\n */\n clone({\n scale = this.scale,\n rotation = this.rotation,\n offsetX = this.offsetX,\n offsetY = this.offsetY,\n dontFlip = false,\n } = {}) {\n return new PageViewport({\n viewBox: this.viewBox.slice(),\n scale,\n rotation,\n offsetX,\n offsetY,\n dontFlip,\n });\n }\n\n /**\n * Converts PDF point to the viewport coordinates. For examples, useful for\n * converting PDF location into canvas pixel coordinates.\n * @param {number} x - The x-coordinate.\n * @param {number} y - The y-coordinate.\n * @returns {Array} Array containing `x`- and `y`-coordinates of the\n * point in the viewport coordinate space.\n * @see {@link convertToPdfPoint}\n * @see {@link convertToViewportRectangle}\n */\n convertToViewportPoint(x, y) {\n return Util.applyTransform([x, y], this.transform);\n }\n\n /**\n * Converts PDF rectangle to the viewport coordinates.\n * @param {Array} rect - The xMin, yMin, xMax and yMax coordinates.\n * @returns {Array} Array containing corresponding coordinates of the\n * rectangle in the viewport coordinate space.\n * @see {@link convertToViewportPoint}\n */\n convertToViewportRectangle(rect) {\n const topLeft = Util.applyTransform([rect[0], rect[1]], this.transform);\n const bottomRight = Util.applyTransform([rect[2], rect[3]], this.transform);\n return [topLeft[0], topLeft[1], bottomRight[0], bottomRight[1]];\n }\n\n /**\n * Converts viewport coordinates to the PDF location. For examples, useful\n * for converting canvas pixel location into PDF one.\n * @param {number} x - The x-coordinate.\n * @param {number} y - The y-coordinate.\n * @returns {Array} Array containing `x`- and `y`-coordinates of the\n * point in the PDF coordinate space.\n * @see {@link convertToViewportPoint}\n */\n convertToPdfPoint(x, y) {\n return Util.applyInverseTransform([x, y], this.transform);\n }\n}\n\nclass RenderingCancelledException extends BaseException {\n constructor(msg, extraDelay = 0) {\n super(msg, \"RenderingCancelledException\");\n this.extraDelay = extraDelay;\n }\n}\n\nfunction isDataScheme(url) {\n const ii = url.length;\n let i = 0;\n while (i < ii && url[i].trim() === \"\") {\n i++;\n }\n return url.substring(i, i + 5).toLowerCase() === \"data:\";\n}\n\nfunction isPdfFile(filename) {\n return typeof filename === \"string\" && /\\.pdf$/i.test(filename);\n}\n\n/**\n * Gets the filename from a given URL.\n * @param {string} url\n * @returns {string}\n */\nfunction getFilenameFromUrl(url) {\n [url] = url.split(/[#?]/, 1);\n return url.substring(url.lastIndexOf(\"/\") + 1);\n}\n\n/**\n * Returns the filename or guessed filename from the url (see issue 3455).\n * @param {string} url - The original PDF location.\n * @param {string} defaultFilename - The value returned if the filename is\n * unknown, or the protocol is unsupported.\n * @returns {string} Guessed PDF filename.\n */\nfunction getPdfFilenameFromUrl(url, defaultFilename = \"document.pdf\") {\n if (typeof url !== \"string\") {\n return defaultFilename;\n }\n if (isDataScheme(url)) {\n warn('getPdfFilenameFromUrl: ignore \"data:\"-URL for performance reasons.');\n return defaultFilename;\n }\n const reURI = /^(?:(?:[^:]+:)?\\/\\/[^/]+)?([^?#]*)(\\?[^#]*)?(#.*)?$/;\n // SCHEME HOST 1.PATH 2.QUERY 3.REF\n // Pattern to get last matching NAME.pdf\n const reFilename = /[^/?#=]+\\.pdf\\b(?!.*\\.pdf\\b)/i;\n const splitURI = reURI.exec(url);\n let suggestedFilename =\n reFilename.exec(splitURI[1]) ||\n reFilename.exec(splitURI[2]) ||\n reFilename.exec(splitURI[3]);\n if (suggestedFilename) {\n suggestedFilename = suggestedFilename[0];\n if (suggestedFilename.includes(\"%\")) {\n // URL-encoded %2Fpath%2Fto%2Ffile.pdf should be file.pdf\n try {\n suggestedFilename = reFilename.exec(\n decodeURIComponent(suggestedFilename)\n )[0];\n } catch {\n // Possible (extremely rare) errors:\n // URIError \"Malformed URI\", e.g. for \"%AA.pdf\"\n // TypeError \"null has no properties\", e.g. for \"%2F.pdf\"\n }\n }\n }\n return suggestedFilename || defaultFilename;\n}\n\nclass StatTimer {\n started = Object.create(null);\n\n times = [];\n\n time(name) {\n if (name in this.started) {\n warn(`Timer is already running for ${name}`);\n }\n this.started[name] = Date.now();\n }\n\n timeEnd(name) {\n if (!(name in this.started)) {\n warn(`Timer has not been started for ${name}`);\n }\n this.times.push({\n name,\n start: this.started[name],\n end: Date.now(),\n });\n // Remove timer from started so it can be called again.\n delete this.started[name];\n }\n\n toString() {\n // Find the longest name for padding purposes.\n const outBuf = [];\n let longest = 0;\n for (const { name } of this.times) {\n longest = Math.max(name.length, longest);\n }\n for (const { name, start, end } of this.times) {\n outBuf.push(`${name.padEnd(longest)} ${end - start}ms\\n`);\n }\n return outBuf.join(\"\");\n }\n}\n\nfunction isValidFetchUrl(url, baseUrl) {\n if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) {\n throw new Error(\"Not implemented: isValidFetchUrl\");\n }\n try {\n const { protocol } = baseUrl ? new URL(url, baseUrl) : new URL(url);\n // The Fetch API only supports the http/https protocols, and not file/ftp.\n return protocol === \"http:\" || protocol === \"https:\";\n } catch {\n return false; // `new URL()` will throw on incorrect data.\n }\n}\n\n/**\n * Event handler to suppress context menu.\n */\nfunction noContextMenu(e) {\n e.preventDefault();\n}\n\n// Deprecated API function -- display regardless of the `verbosity` setting.\nfunction deprecated(details) {\n console.log(\"Deprecated API usage: \" + details);\n}\n\nlet pdfDateStringRegex;\n\nclass PDFDateString {\n /**\n * Convert a PDF date string to a JavaScript `Date` object.\n *\n * The PDF date string format is described in section 7.9.4 of the official\n * PDF 32000-1:2008 specification. However, in the PDF 1.7 reference (sixth\n * edition) Adobe describes the same format including a trailing apostrophe.\n * This syntax in incorrect, but Adobe Acrobat creates PDF files that contain\n * them. We ignore all apostrophes as they are not necessary for date parsing.\n *\n * Moreover, Adobe Acrobat doesn't handle changing the date to universal time\n * and doesn't use the user's time zone (effectively ignoring the HH' and mm'\n * parts of the date string).\n *\n * @param {string} input\n * @returns {Date|null}\n */\n static toDateObject(input) {\n if (!input || typeof input !== \"string\") {\n return null;\n }\n\n // Lazily initialize the regular expression.\n pdfDateStringRegex ||= new RegExp(\n \"^D:\" + // Prefix (required)\n \"(\\\\d{4})\" + // Year (required)\n \"(\\\\d{2})?\" + // Month (optional)\n \"(\\\\d{2})?\" + // Day (optional)\n \"(\\\\d{2})?\" + // Hour (optional)\n \"(\\\\d{2})?\" + // Minute (optional)\n \"(\\\\d{2})?\" + // Second (optional)\n \"([Z|+|-])?\" + // Universal time relation (optional)\n \"(\\\\d{2})?\" + // Offset hour (optional)\n \"'?\" + // Splitting apostrophe (optional)\n \"(\\\\d{2})?\" + // Offset minute (optional)\n \"'?\" // Trailing apostrophe (optional)\n );\n\n // Optional fields that don't satisfy the requirements from the regular\n // expression (such as incorrect digit counts or numbers that are out of\n // range) will fall back the defaults from the specification.\n const matches = pdfDateStringRegex.exec(input);\n if (!matches) {\n return null;\n }\n\n // JavaScript's `Date` object expects the month to be between 0 and 11\n // instead of 1 and 12, so we have to correct for that.\n const year = parseInt(matches[1], 10);\n let month = parseInt(matches[2], 10);\n month = month >= 1 && month <= 12 ? month - 1 : 0;\n let day = parseInt(matches[3], 10);\n day = day >= 1 && day <= 31 ? day : 1;\n let hour = parseInt(matches[4], 10);\n hour = hour >= 0 && hour <= 23 ? hour : 0;\n let minute = parseInt(matches[5], 10);\n minute = minute >= 0 && minute <= 59 ? minute : 0;\n let second = parseInt(matches[6], 10);\n second = second >= 0 && second <= 59 ? second : 0;\n const universalTimeRelation = matches[7] || \"Z\";\n let offsetHour = parseInt(matches[8], 10);\n offsetHour = offsetHour >= 0 && offsetHour <= 23 ? offsetHour : 0;\n let offsetMinute = parseInt(matches[9], 10) || 0;\n offsetMinute = offsetMinute >= 0 && offsetMinute <= 59 ? offsetMinute : 0;\n\n // Universal time relation 'Z' means that the local time is equal to the\n // universal time, whereas the relations '+'/'-' indicate that the local\n // time is later respectively earlier than the universal time. Every date\n // is normalized to universal time.\n if (universalTimeRelation === \"-\") {\n hour += offsetHour;\n minute += offsetMinute;\n } else if (universalTimeRelation === \"+\") {\n hour -= offsetHour;\n minute -= offsetMinute;\n }\n\n return new Date(Date.UTC(year, month, day, hour, minute, second));\n }\n}\n\n/**\n * NOTE: This is (mostly) intended to support printing of XFA forms.\n */\nfunction getXfaPageViewport(xfaPage, { scale = 1, rotation = 0 }) {\n const { width, height } = xfaPage.attributes.style;\n const viewBox = [0, 0, parseInt(width), parseInt(height)];\n\n return new PageViewport({\n viewBox,\n scale,\n rotation,\n });\n}\n\nfunction getRGB(color) {\n if (color.startsWith(\"#\")) {\n const colorRGB = parseInt(color.slice(1), 16);\n return [\n (colorRGB & 0xff0000) >> 16,\n (colorRGB & 0x00ff00) >> 8,\n colorRGB & 0x0000ff,\n ];\n }\n\n if (color.startsWith(\"rgb(\")) {\n // getComputedStyle(...).color returns a `rgb(R, G, B)` color.\n return color\n .slice(/* \"rgb(\".length */ 4, -1) // Strip out \"rgb(\" and \")\".\n .split(\",\")\n .map(x => parseInt(x));\n }\n\n if (color.startsWith(\"rgba(\")) {\n return color\n .slice(/* \"rgba(\".length */ 5, -1) // Strip out \"rgba(\" and \")\".\n .split(\",\")\n .map(x => parseInt(x))\n .slice(0, 3);\n }\n\n warn(`Not a valid color format: \"${color}\"`);\n return [0, 0, 0];\n}\n\nfunction getColorValues(colors) {\n const span = document.createElement(\"span\");\n span.style.visibility = \"hidden\";\n document.body.append(span);\n for (const name of colors.keys()) {\n span.style.color = name;\n const computedColor = window.getComputedStyle(span).color;\n colors.set(name, getRGB(computedColor));\n }\n span.remove();\n}\n\nfunction getCurrentTransform(ctx) {\n const { a, b, c, d, e, f } = ctx.getTransform();\n return [a, b, c, d, e, f];\n}\n\nfunction getCurrentTransformInverse(ctx) {\n const { a, b, c, d, e, f } = ctx.getTransform().invertSelf();\n return [a, b, c, d, e, f];\n}\n\n/**\n * @param {HTMLDivElement} div\n * @param {PageViewport} viewport\n * @param {boolean} mustFlip\n * @param {boolean} mustRotate\n */\nfunction setLayerDimensions(\n div,\n viewport,\n mustFlip = false,\n mustRotate = true\n) {\n if (viewport instanceof PageViewport) {\n const { pageWidth, pageHeight } = viewport.rawDims;\n const { style } = div;\n const useRound = FeatureTest.isCSSRoundSupported;\n\n const w = `var(--scale-factor) * ${pageWidth}px`,\n h = `var(--scale-factor) * ${pageHeight}px`;\n const widthStr = useRound ? `round(${w}, 1px)` : `calc(${w})`,\n heightStr = useRound ? `round(${h}, 1px)` : `calc(${h})`;\n\n if (!mustFlip || viewport.rotation % 180 === 0) {\n style.width = widthStr;\n style.height = heightStr;\n } else {\n style.width = heightStr;\n style.height = widthStr;\n }\n }\n\n if (mustRotate) {\n div.setAttribute(\"data-main-rotation\", viewport.rotation);\n }\n}\n\nexport {\n deprecated,\n DOMCanvasFactory,\n DOMCMapReaderFactory,\n DOMFilterFactory,\n DOMStandardFontDataFactory,\n DOMSVGFactory,\n fetchData,\n getColorValues,\n getCurrentTransform,\n getCurrentTransformInverse,\n getFilenameFromUrl,\n getPdfFilenameFromUrl,\n getRGB,\n getXfaPageViewport,\n isDataScheme,\n isPdfFile,\n isValidFetchUrl,\n noContextMenu,\n PageViewport,\n PDFDateString,\n PixelsPerInch,\n RenderingCancelledException,\n setLayerDimensions,\n StatTimer,\n};\n","/* Copyright 2023 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\nimport { noContextMenu } from \"../display_utils.js\";\n\nclass EditorToolbar {\n #toolbar = null;\n\n #colorPicker = null;\n\n #editor;\n\n #buttons = null;\n\n constructor(editor) {\n this.#editor = editor;\n }\n\n render() {\n const editToolbar = (this.#toolbar = document.createElement(\"div\"));\n editToolbar.className = \"editToolbar\";\n editToolbar.setAttribute(\"role\", \"toolbar\");\n editToolbar.addEventListener(\"contextmenu\", noContextMenu);\n editToolbar.addEventListener(\"pointerdown\", EditorToolbar.#pointerDown);\n\n const buttons = (this.#buttons = document.createElement(\"div\"));\n buttons.className = \"buttons\";\n editToolbar.append(buttons);\n\n const position = this.#editor.toolbarPosition;\n if (position) {\n const { style } = editToolbar;\n const x =\n this.#editor._uiManager.direction === \"ltr\"\n ? 1 - position[0]\n : position[0];\n style.insetInlineEnd = `${100 * x}%`;\n style.top = `calc(${\n 100 * position[1]\n }% + var(--editor-toolbar-vert-offset))`;\n }\n\n this.#addDeleteButton();\n\n return editToolbar;\n }\n\n static #pointerDown(e) {\n e.stopPropagation();\n }\n\n #focusIn(e) {\n this.#editor._focusEventsAllowed = false;\n e.preventDefault();\n e.stopPropagation();\n }\n\n #focusOut(e) {\n this.#editor._focusEventsAllowed = true;\n e.preventDefault();\n e.stopPropagation();\n }\n\n #addListenersToElement(element) {\n // If we're clicking on a button with the keyboard or with\n // the mouse, we don't want to trigger any focus events on\n // the editor.\n element.addEventListener(\"focusin\", this.#focusIn.bind(this), {\n capture: true,\n });\n element.addEventListener(\"focusout\", this.#focusOut.bind(this), {\n capture: true,\n });\n element.addEventListener(\"contextmenu\", noContextMenu);\n }\n\n hide() {\n this.#toolbar.classList.add(\"hidden\");\n this.#colorPicker?.hideDropdown();\n }\n\n show() {\n this.#toolbar.classList.remove(\"hidden\");\n }\n\n #addDeleteButton() {\n const button = document.createElement(\"button\");\n button.className = \"delete\";\n button.tabIndex = 0;\n button.setAttribute(\n \"data-l10n-id\",\n `pdfjs-editor-remove-${this.#editor.editorType}-button`\n );\n this.#addListenersToElement(button);\n button.addEventListener(\"click\", e => {\n this.#editor._uiManager.delete();\n });\n this.#buttons.append(button);\n }\n\n get #divider() {\n const divider = document.createElement(\"div\");\n divider.className = \"divider\";\n return divider;\n }\n\n addAltTextButton(button) {\n this.#addListenersToElement(button);\n this.#buttons.prepend(button, this.#divider);\n }\n\n addColorPicker(colorPicker) {\n this.#colorPicker = colorPicker;\n const button = colorPicker.renderButton();\n this.#addListenersToElement(button);\n this.#buttons.prepend(button, this.#divider);\n }\n\n remove() {\n this.#toolbar.remove();\n this.#colorPicker?.destroy();\n this.#colorPicker = null;\n }\n}\n\nclass HighlightToolbar {\n #buttons = null;\n\n #toolbar = null;\n\n #uiManager;\n\n constructor(uiManager) {\n this.#uiManager = uiManager;\n }\n\n #render() {\n const editToolbar = (this.#toolbar = document.createElement(\"div\"));\n editToolbar.className = \"editToolbar\";\n editToolbar.setAttribute(\"role\", \"toolbar\");\n editToolbar.addEventListener(\"contextmenu\", noContextMenu);\n\n const buttons = (this.#buttons = document.createElement(\"div\"));\n buttons.className = \"buttons\";\n editToolbar.append(buttons);\n\n this.#addHighlightButton();\n\n return editToolbar;\n }\n\n #getLastPoint(boxes, isLTR) {\n let lastY = 0;\n let lastX = 0;\n for (const box of boxes) {\n const y = box.y + box.height;\n if (y < lastY) {\n continue;\n }\n const x = box.x + (isLTR ? box.width : 0);\n if (y > lastY) {\n lastX = x;\n lastY = y;\n continue;\n }\n if (isLTR) {\n if (x > lastX) {\n lastX = x;\n }\n } else if (x < lastX) {\n lastX = x;\n }\n }\n return [isLTR ? 1 - lastX : lastX, lastY];\n }\n\n show(parent, boxes, isLTR) {\n const [x, y] = this.#getLastPoint(boxes, isLTR);\n const { style } = (this.#toolbar ||= this.#render());\n parent.append(this.#toolbar);\n style.insetInlineEnd = `${100 * x}%`;\n style.top = `calc(${100 * y}% + var(--editor-toolbar-vert-offset))`;\n }\n\n hide() {\n this.#toolbar.remove();\n }\n\n #addHighlightButton() {\n const button = document.createElement(\"button\");\n button.className = \"highlightButton\";\n button.tabIndex = 0;\n button.setAttribute(\"data-l10n-id\", `pdfjs-highlight-floating-button1`);\n const span = document.createElement(\"span\");\n button.append(span);\n span.className = \"visuallyHidden\";\n span.setAttribute(\"data-l10n-id\", \"pdfjs-highlight-floating-button-label\");\n button.addEventListener(\"contextmenu\", noContextMenu);\n button.addEventListener(\"click\", () => {\n this.#uiManager.highlightSelection(\"floating_button\");\n });\n this.#buttons.append(button);\n }\n}\n\nexport { EditorToolbar, HighlightToolbar };\n","/* Copyright 2022 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\n/** @typedef {import(\"./editor.js\").AnnotationEditor} AnnotationEditor */\n// eslint-disable-next-line max-len\n/** @typedef {import(\"./annotation_editor_layer.js\").AnnotationEditorLayer} AnnotationEditorLayer */\n\nimport {\n AnnotationEditorParamsType,\n AnnotationEditorPrefix,\n AnnotationEditorType,\n FeatureTest,\n getUuid,\n shadow,\n Util,\n warn,\n} from \"../../shared/util.js\";\nimport {\n fetchData,\n getColorValues,\n getRGB,\n PixelsPerInch,\n} from \"../display_utils.js\";\nimport { HighlightToolbar } from \"./toolbar.js\";\n\nfunction bindEvents(obj, element, names) {\n for (const name of names) {\n element.addEventListener(name, obj[name].bind(obj));\n }\n}\n\n/**\n * Convert a number between 0 and 100 into an hex number between 0 and 255.\n * @param {number} opacity\n * @return {string}\n */\nfunction opacityToHex(opacity) {\n return Math.round(Math.min(255, Math.max(1, 255 * opacity)))\n .toString(16)\n .padStart(2, \"0\");\n}\n\n/**\n * Class to create some unique ids for the different editors.\n */\nclass IdManager {\n #id = 0;\n\n constructor() {\n if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"TESTING\")) {\n Object.defineProperty(this, \"reset\", {\n value: () => (this.#id = 0),\n });\n }\n }\n\n /**\n * Get a unique id.\n * @returns {string}\n */\n get id() {\n return `${AnnotationEditorPrefix}${this.#id++}`;\n }\n}\n\n/**\n * Class to manage the images used by the editors.\n * The main idea is to try to minimize the memory used by the images.\n * The images are cached and reused when possible\n * We use a refCounter to know when an image is not used anymore but we need to\n * be able to restore an image after a remove+undo, so we keep a file reference\n * or an url one.\n */\nclass ImageManager {\n #baseId = getUuid();\n\n #id = 0;\n\n #cache = null;\n\n static get _isSVGFittingCanvas() {\n // By default, Firefox doesn't rescale without preserving the aspect ratio\n // when drawing an SVG image on a canvas, see https://bugzilla.mozilla.org/1547776.\n // The \"workaround\" is to append \"svgView(preserveAspectRatio(none))\" to the\n // url, but according to comment #15, it seems that it leads to unexpected\n // behavior in Safari.\n const svg = `data:image/svg+xml;charset=UTF-8,`;\n const canvas = new OffscreenCanvas(1, 3);\n const ctx = canvas.getContext(\"2d\");\n const image = new Image();\n image.src = svg;\n const promise = image.decode().then(() => {\n ctx.drawImage(image, 0, 0, 1, 1, 0, 0, 1, 3);\n return new Uint32Array(ctx.getImageData(0, 0, 1, 1).data.buffer)[0] === 0;\n });\n\n return shadow(this, \"_isSVGFittingCanvas\", promise);\n }\n\n async #get(key, rawData) {\n this.#cache ||= new Map();\n let data = this.#cache.get(key);\n if (data === null) {\n // We already tried to load the image but it failed.\n return null;\n }\n if (data?.bitmap) {\n data.refCounter += 1;\n return data;\n }\n try {\n data ||= {\n bitmap: null,\n id: `image_${this.#baseId}_${this.#id++}`,\n refCounter: 0,\n isSvg: false,\n };\n let image;\n if (typeof rawData === \"string\") {\n data.url = rawData;\n image = await fetchData(rawData, \"blob\");\n } else {\n image = data.file = rawData;\n }\n\n if (image.type === \"image/svg+xml\") {\n // Unfortunately, createImageBitmap doesn't work with SVG images.\n // (see https://bugzilla.mozilla.org/1841972).\n const mustRemoveAspectRatioPromise = ImageManager._isSVGFittingCanvas;\n const fileReader = new FileReader();\n const imageElement = new Image();\n const imagePromise = new Promise((resolve, reject) => {\n imageElement.onload = () => {\n data.bitmap = imageElement;\n data.isSvg = true;\n resolve();\n };\n fileReader.onload = async () => {\n const url = (data.svgUrl = fileReader.result);\n // We need to set the preserveAspectRatio to none in order to let\n // the image fits the canvas when resizing.\n imageElement.src = (await mustRemoveAspectRatioPromise)\n ? `${url}#svgView(preserveAspectRatio(none))`\n : url;\n };\n imageElement.onerror = fileReader.onerror = reject;\n });\n fileReader.readAsDataURL(image);\n await imagePromise;\n } else {\n data.bitmap = await createImageBitmap(image);\n }\n data.refCounter = 1;\n } catch (e) {\n console.error(e);\n data = null;\n }\n this.#cache.set(key, data);\n if (data) {\n this.#cache.set(data.id, data);\n }\n return data;\n }\n\n async getFromFile(file) {\n const { lastModified, name, size, type } = file;\n return this.#get(`${lastModified}_${name}_${size}_${type}`, file);\n }\n\n async getFromUrl(url) {\n return this.#get(url, url);\n }\n\n async getFromId(id) {\n this.#cache ||= new Map();\n const data = this.#cache.get(id);\n if (!data) {\n return null;\n }\n if (data.bitmap) {\n data.refCounter += 1;\n return data;\n }\n\n if (data.file) {\n return this.getFromFile(data.file);\n }\n return this.getFromUrl(data.url);\n }\n\n getSvgUrl(id) {\n const data = this.#cache.get(id);\n if (!data?.isSvg) {\n return null;\n }\n return data.svgUrl;\n }\n\n deleteId(id) {\n this.#cache ||= new Map();\n const data = this.#cache.get(id);\n if (!data) {\n return;\n }\n data.refCounter -= 1;\n if (data.refCounter !== 0) {\n return;\n }\n data.bitmap = null;\n }\n\n // We can use the id only if it belongs this manager.\n // We must take care of having the right manager because we can copy/paste\n // some images from other documents, hence it'd be a pity to use an id from an\n // other manager.\n isValidId(id) {\n return id.startsWith(`image_${this.#baseId}_`);\n }\n}\n\n/**\n * Class to handle undo/redo.\n * Commands are just saved in a buffer.\n * If we hit some memory issues we could likely use a circular buffer.\n * It has to be used as a singleton.\n */\nclass CommandManager {\n #commands = [];\n\n #locked = false;\n\n #maxSize;\n\n #position = -1;\n\n constructor(maxSize = 128) {\n this.#maxSize = maxSize;\n }\n\n /**\n * @typedef {Object} addOptions\n * @property {function} cmd\n * @property {function} undo\n * @property {function} [post]\n * @property {boolean} mustExec\n * @property {number} type\n * @property {boolean} overwriteIfSameType\n * @property {boolean} keepUndo\n */\n\n /**\n * Add a new couple of commands to be used in case of redo/undo.\n * @param {addOptions} options\n */\n add({\n cmd,\n undo,\n post,\n mustExec,\n type = NaN,\n overwriteIfSameType = false,\n keepUndo = false,\n }) {\n if (mustExec) {\n cmd();\n }\n\n if (this.#locked) {\n return;\n }\n\n const save = { cmd, undo, post, type };\n if (this.#position === -1) {\n if (this.#commands.length > 0) {\n // All the commands have been undone and then a new one is added\n // hence we clear the queue.\n this.#commands.length = 0;\n }\n this.#position = 0;\n this.#commands.push(save);\n return;\n }\n\n if (overwriteIfSameType && this.#commands[this.#position].type === type) {\n // For example when we change a color we don't want to\n // be able to undo all the steps, hence we only want to\n // keep the last undoable action in this sequence of actions.\n if (keepUndo) {\n save.undo = this.#commands[this.#position].undo;\n }\n this.#commands[this.#position] = save;\n return;\n }\n\n const next = this.#position + 1;\n if (next === this.#maxSize) {\n this.#commands.splice(0, 1);\n } else {\n this.#position = next;\n if (next < this.#commands.length) {\n this.#commands.splice(next);\n }\n }\n\n this.#commands.push(save);\n }\n\n /**\n * Undo the last command.\n */\n undo() {\n if (this.#position === -1) {\n // Nothing to undo.\n return;\n }\n\n // Avoid to insert something during the undo execution.\n this.#locked = true;\n const { undo, post } = this.#commands[this.#position];\n undo();\n post?.();\n this.#locked = false;\n\n this.#position -= 1;\n }\n\n /**\n * Redo the last command.\n */\n redo() {\n if (this.#position < this.#commands.length - 1) {\n this.#position += 1;\n\n // Avoid to insert something during the redo execution.\n this.#locked = true;\n const { cmd, post } = this.#commands[this.#position];\n cmd();\n post?.();\n this.#locked = false;\n }\n }\n\n /**\n * Check if there is something to undo.\n * @returns {boolean}\n */\n hasSomethingToUndo() {\n return this.#position !== -1;\n }\n\n /**\n * Check if there is something to redo.\n * @returns {boolean}\n */\n hasSomethingToRedo() {\n return this.#position < this.#commands.length - 1;\n }\n\n destroy() {\n this.#commands = null;\n }\n}\n\n/**\n * Class to handle the different keyboards shortcuts we can have on mac or\n * non-mac OSes.\n */\nclass KeyboardManager {\n /**\n * Create a new keyboard manager class.\n * @param {Array} callbacks - an array containing an array of shortcuts\n * and a callback to call.\n * A shortcut is a string like `ctrl+c` or `mac+ctrl+c` for mac OS.\n */\n constructor(callbacks) {\n this.buffer = [];\n this.callbacks = new Map();\n this.allKeys = new Set();\n\n const { isMac } = FeatureTest.platform;\n for (const [keys, callback, options = {}] of callbacks) {\n for (const key of keys) {\n const isMacKey = key.startsWith(\"mac+\");\n if (isMac && isMacKey) {\n this.callbacks.set(key.slice(4), { callback, options });\n this.allKeys.add(key.split(\"+\").at(-1));\n } else if (!isMac && !isMacKey) {\n this.callbacks.set(key, { callback, options });\n this.allKeys.add(key.split(\"+\").at(-1));\n }\n }\n }\n }\n\n /**\n * Serialize an event into a string in order to match a\n * potential key for a callback.\n * @param {KeyboardEvent} event\n * @returns {string}\n */\n #serialize(event) {\n if (event.altKey) {\n this.buffer.push(\"alt\");\n }\n if (event.ctrlKey) {\n this.buffer.push(\"ctrl\");\n }\n if (event.metaKey) {\n this.buffer.push(\"meta\");\n }\n if (event.shiftKey) {\n this.buffer.push(\"shift\");\n }\n this.buffer.push(event.key);\n const str = this.buffer.join(\"+\");\n this.buffer.length = 0;\n\n return str;\n }\n\n /**\n * Execute a callback, if any, for a given keyboard event.\n * The self is used as `this` in the callback.\n * @param {Object} self\n * @param {KeyboardEvent} event\n * @returns\n */\n exec(self, event) {\n if (!this.allKeys.has(event.key)) {\n return;\n }\n const info = this.callbacks.get(this.#serialize(event));\n if (!info) {\n return;\n }\n const {\n callback,\n options: { bubbles = false, args = [], checker = null },\n } = info;\n\n if (checker && !checker(self, event)) {\n return;\n }\n callback.bind(self, ...args, event)();\n\n // For example, ctrl+s in a FreeText must be handled by the viewer, hence\n // the event must bubble.\n if (!bubbles) {\n event.stopPropagation();\n event.preventDefault();\n }\n }\n}\n\nclass ColorManager {\n static _colorsMapping = new Map([\n [\"CanvasText\", [0, 0, 0]],\n [\"Canvas\", [255, 255, 255]],\n ]);\n\n get _colors() {\n if (\n typeof PDFJSDev !== \"undefined\" &&\n PDFJSDev.test(\"LIB\") &&\n typeof document === \"undefined\"\n ) {\n return shadow(this, \"_colors\", ColorManager._colorsMapping);\n }\n\n const colors = new Map([\n [\"CanvasText\", null],\n [\"Canvas\", null],\n ]);\n getColorValues(colors);\n return shadow(this, \"_colors\", colors);\n }\n\n /**\n * In High Contrast Mode, the color on the screen is not always the\n * real color used in the pdf.\n * For example in some cases white can appear to be black but when saving\n * we want to have white.\n * @param {string} color\n * @returns {Array}\n */\n convert(color) {\n const rgb = getRGB(color);\n if (!window.matchMedia(\"(forced-colors: active)\").matches) {\n return rgb;\n }\n\n for (const [name, RGB] of this._colors) {\n if (RGB.every((x, i) => x === rgb[i])) {\n return ColorManager._colorsMapping.get(name);\n }\n }\n return rgb;\n }\n\n /**\n * An input element must have its color value as a hex string\n * and not as color name.\n * So this function converts a name into an hex string.\n * @param {string} name\n * @returns {string}\n */\n getHexCode(name) {\n const rgb = this._colors.get(name);\n if (!rgb) {\n return name;\n }\n return Util.makeHexColor(...rgb);\n }\n}\n\n/**\n * A pdf has several pages and each of them when it will rendered\n * will have an AnnotationEditorLayer which will contain the some\n * new Annotations associated to an editor in order to modify them.\n *\n * This class is used to manage all the different layers, editors and\n * some action like copy/paste, undo/redo, ...\n */\nclass AnnotationEditorUIManager {\n #activeEditor = null;\n\n #allEditors = new Map();\n\n #allLayers = new Map();\n\n #altTextManager = null;\n\n #annotationStorage = null;\n\n #changedExistingAnnotations = null;\n\n #commandManager = new CommandManager();\n\n #currentPageIndex = 0;\n\n #deletedAnnotationsElementIds = new Set();\n\n #draggingEditors = null;\n\n #editorTypes = null;\n\n #editorsToRescale = new Set();\n\n #enableHighlightFloatingButton = false;\n\n #filterFactory = null;\n\n #focusMainContainerTimeoutId = null;\n\n #highlightColors = null;\n\n #highlightWhenShiftUp = false;\n\n #highlightToolbar = null;\n\n #idManager = new IdManager();\n\n #isEnabled = false;\n\n #isWaiting = false;\n\n #lastActiveElement = null;\n\n #mainHighlightColorPicker = null;\n\n #mlManager = null;\n\n #mode = AnnotationEditorType.NONE;\n\n #selectedEditors = new Set();\n\n #selectedTextNode = null;\n\n #pageColors = null;\n\n #showAllStates = null;\n\n #boundBlur = this.blur.bind(this);\n\n #boundFocus = this.focus.bind(this);\n\n #boundCopy = this.copy.bind(this);\n\n #boundCut = this.cut.bind(this);\n\n #boundPaste = this.paste.bind(this);\n\n #boundKeydown = this.keydown.bind(this);\n\n #boundKeyup = this.keyup.bind(this);\n\n #boundOnEditingAction = this.onEditingAction.bind(this);\n\n #boundOnPageChanging = this.onPageChanging.bind(this);\n\n #boundOnScaleChanging = this.onScaleChanging.bind(this);\n\n #boundSelectionChange = this.#selectionChange.bind(this);\n\n #boundOnRotationChanging = this.onRotationChanging.bind(this);\n\n #previousStates = {\n isEditing: false,\n isEmpty: true,\n hasSomethingToUndo: false,\n hasSomethingToRedo: false,\n hasSelectedEditor: false,\n hasSelectedText: false,\n };\n\n #translation = [0, 0];\n\n #translationTimeoutId = null;\n\n #container = null;\n\n #viewer = null;\n\n static TRANSLATE_SMALL = 1; // page units.\n\n static TRANSLATE_BIG = 10; // page units.\n\n static get _keyboardManager() {\n const proto = AnnotationEditorUIManager.prototype;\n\n /**\n * If the focused element is an input, we don't want to handle the arrow.\n * For example, sliders can be controlled with the arrow keys.\n */\n const arrowChecker = self =>\n self.#container.contains(document.activeElement) &&\n document.activeElement.tagName !== \"BUTTON\" &&\n self.hasSomethingToControl();\n\n const textInputChecker = (_self, { target: el }) => {\n if (el instanceof HTMLInputElement) {\n const { type } = el;\n return type !== \"text\" && type !== \"number\";\n }\n return true;\n };\n\n const small = this.TRANSLATE_SMALL;\n const big = this.TRANSLATE_BIG;\n\n return shadow(\n this,\n \"_keyboardManager\",\n new KeyboardManager([\n [\n [\"ctrl+a\", \"mac+meta+a\"],\n proto.selectAll,\n { checker: textInputChecker },\n ],\n [[\"ctrl+z\", \"mac+meta+z\"], proto.undo, { checker: textInputChecker }],\n [\n // On mac, depending of the OS version, the event.key is either \"z\" or\n // \"Z\" when the user presses \"meta+shift+z\".\n [\n \"ctrl+y\",\n \"ctrl+shift+z\",\n \"mac+meta+shift+z\",\n \"ctrl+shift+Z\",\n \"mac+meta+shift+Z\",\n ],\n proto.redo,\n { checker: textInputChecker },\n ],\n [\n [\n \"Backspace\",\n \"alt+Backspace\",\n \"ctrl+Backspace\",\n \"shift+Backspace\",\n \"mac+Backspace\",\n \"mac+alt+Backspace\",\n \"mac+ctrl+Backspace\",\n \"Delete\",\n \"ctrl+Delete\",\n \"shift+Delete\",\n \"mac+Delete\",\n ],\n proto.delete,\n { checker: textInputChecker },\n ],\n [\n [\"Enter\", \"mac+Enter\"],\n proto.addNewEditorFromKeyboard,\n {\n // Those shortcuts can be used in the toolbar for some other actions\n // like zooming, hence we need to check if the container has the\n // focus.\n checker: (self, { target: el }) =>\n !(el instanceof HTMLButtonElement) &&\n self.#container.contains(el) &&\n !self.isEnterHandled,\n },\n ],\n [\n [\" \", \"mac+ \"],\n proto.addNewEditorFromKeyboard,\n {\n // Those shortcuts can be used in the toolbar for some other actions\n // like zooming, hence we need to check if the container has the\n // focus.\n checker: (self, { target: el }) =>\n !(el instanceof HTMLButtonElement) &&\n self.#container.contains(document.activeElement),\n },\n ],\n [[\"Escape\", \"mac+Escape\"], proto.unselectAll],\n [\n [\"ArrowLeft\", \"mac+ArrowLeft\"],\n proto.translateSelectedEditors,\n { args: [-small, 0], checker: arrowChecker },\n ],\n [\n [\"ctrl+ArrowLeft\", \"mac+shift+ArrowLeft\"],\n proto.translateSelectedEditors,\n { args: [-big, 0], checker: arrowChecker },\n ],\n [\n [\"ArrowRight\", \"mac+ArrowRight\"],\n proto.translateSelectedEditors,\n { args: [small, 0], checker: arrowChecker },\n ],\n [\n [\"ctrl+ArrowRight\", \"mac+shift+ArrowRight\"],\n proto.translateSelectedEditors,\n { args: [big, 0], checker: arrowChecker },\n ],\n [\n [\"ArrowUp\", \"mac+ArrowUp\"],\n proto.translateSelectedEditors,\n { args: [0, -small], checker: arrowChecker },\n ],\n [\n [\"ctrl+ArrowUp\", \"mac+shift+ArrowUp\"],\n proto.translateSelectedEditors,\n { args: [0, -big], checker: arrowChecker },\n ],\n [\n [\"ArrowDown\", \"mac+ArrowDown\"],\n proto.translateSelectedEditors,\n { args: [0, small], checker: arrowChecker },\n ],\n [\n [\"ctrl+ArrowDown\", \"mac+shift+ArrowDown\"],\n proto.translateSelectedEditors,\n { args: [0, big], checker: arrowChecker },\n ],\n ])\n );\n }\n\n constructor(\n container,\n viewer,\n altTextManager,\n eventBus,\n pdfDocument,\n pageColors,\n highlightColors,\n enableHighlightFloatingButton,\n mlManager\n ) {\n this.#container = container;\n this.#viewer = viewer;\n this.#altTextManager = altTextManager;\n this._eventBus = eventBus;\n this._eventBus._on(\"editingaction\", this.#boundOnEditingAction);\n this._eventBus._on(\"pagechanging\", this.#boundOnPageChanging);\n this._eventBus._on(\"scalechanging\", this.#boundOnScaleChanging);\n this._eventBus._on(\"rotationchanging\", this.#boundOnRotationChanging);\n this.#addSelectionListener();\n this.#addKeyboardManager();\n this.#annotationStorage = pdfDocument.annotationStorage;\n this.#filterFactory = pdfDocument.filterFactory;\n this.#pageColors = pageColors;\n this.#highlightColors = highlightColors || null;\n this.#enableHighlightFloatingButton = enableHighlightFloatingButton;\n this.#mlManager = mlManager || null;\n this.viewParameters = {\n realScale: PixelsPerInch.PDF_TO_CSS_UNITS,\n rotation: 0,\n };\n this.isShiftKeyDown = false;\n\n if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"TESTING\")) {\n Object.defineProperty(this, \"reset\", {\n value: () => {\n this.selectAll();\n this.delete();\n this.#idManager.reset();\n },\n });\n }\n }\n\n destroy() {\n this.#removeKeyboardManager();\n this.#removeFocusManager();\n this._eventBus._off(\"editingaction\", this.#boundOnEditingAction);\n this._eventBus._off(\"pagechanging\", this.#boundOnPageChanging);\n this._eventBus._off(\"scalechanging\", this.#boundOnScaleChanging);\n this._eventBus._off(\"rotationchanging\", this.#boundOnRotationChanging);\n for (const layer of this.#allLayers.values()) {\n layer.destroy();\n }\n this.#allLayers.clear();\n this.#allEditors.clear();\n this.#editorsToRescale.clear();\n this.#activeEditor = null;\n this.#selectedEditors.clear();\n this.#commandManager.destroy();\n this.#altTextManager?.destroy();\n this.#highlightToolbar?.hide();\n this.#highlightToolbar = null;\n if (this.#focusMainContainerTimeoutId) {\n clearTimeout(this.#focusMainContainerTimeoutId);\n this.#focusMainContainerTimeoutId = null;\n }\n if (this.#translationTimeoutId) {\n clearTimeout(this.#translationTimeoutId);\n this.#translationTimeoutId = null;\n }\n this.#removeSelectionListener();\n }\n\n async mlGuess(data) {\n return this.#mlManager?.guess(data) || null;\n }\n\n get hasMLManager() {\n return !!this.#mlManager;\n }\n\n get hcmFilter() {\n return shadow(\n this,\n \"hcmFilter\",\n this.#pageColors\n ? this.#filterFactory.addHCMFilter(\n this.#pageColors.foreground,\n this.#pageColors.background\n )\n : \"none\"\n );\n }\n\n get direction() {\n return shadow(\n this,\n \"direction\",\n getComputedStyle(this.#container).direction\n );\n }\n\n get highlightColors() {\n return shadow(\n this,\n \"highlightColors\",\n this.#highlightColors\n ? new Map(\n this.#highlightColors\n .split(\",\")\n .map(pair => pair.split(\"=\").map(x => x.trim()))\n )\n : null\n );\n }\n\n get highlightColorNames() {\n return shadow(\n this,\n \"highlightColorNames\",\n this.highlightColors\n ? new Map(Array.from(this.highlightColors, e => e.reverse()))\n : null\n );\n }\n\n setMainHighlightColorPicker(colorPicker) {\n this.#mainHighlightColorPicker = colorPicker;\n }\n\n editAltText(editor) {\n this.#altTextManager?.editAltText(this, editor);\n }\n\n onPageChanging({ pageNumber }) {\n this.#currentPageIndex = pageNumber - 1;\n }\n\n focusMainContainer() {\n this.#container.focus();\n }\n\n findParent(x, y) {\n for (const layer of this.#allLayers.values()) {\n const {\n x: layerX,\n y: layerY,\n width,\n height,\n } = layer.div.getBoundingClientRect();\n if (\n x >= layerX &&\n x <= layerX + width &&\n y >= layerY &&\n y <= layerY + height\n ) {\n return layer;\n }\n }\n return null;\n }\n\n disableUserSelect(value = false) {\n this.#viewer.classList.toggle(\"noUserSelect\", value);\n }\n\n addShouldRescale(editor) {\n this.#editorsToRescale.add(editor);\n }\n\n removeShouldRescale(editor) {\n this.#editorsToRescale.delete(editor);\n }\n\n onScaleChanging({ scale }) {\n this.commitOrRemove();\n this.viewParameters.realScale = scale * PixelsPerInch.PDF_TO_CSS_UNITS;\n for (const editor of this.#editorsToRescale) {\n editor.onScaleChanging();\n }\n }\n\n onRotationChanging({ pagesRotation }) {\n this.commitOrRemove();\n this.viewParameters.rotation = pagesRotation;\n }\n\n #getAnchorElementForSelection({ anchorNode }) {\n return anchorNode.nodeType === Node.TEXT_NODE\n ? anchorNode.parentElement\n : anchorNode;\n }\n\n highlightSelection(methodOfCreation = \"\") {\n const selection = document.getSelection();\n if (!selection || selection.isCollapsed) {\n return;\n }\n const { anchorNode, anchorOffset, focusNode, focusOffset } = selection;\n const text = selection.toString();\n const anchorElement = this.#getAnchorElementForSelection(selection);\n const textLayer = anchorElement.closest(\".textLayer\");\n const boxes = this.getSelectionBoxes(textLayer);\n if (!boxes) {\n return;\n }\n selection.empty();\n if (this.#mode === AnnotationEditorType.NONE) {\n this._eventBus.dispatch(\"showannotationeditorui\", {\n source: this,\n mode: AnnotationEditorType.HIGHLIGHT,\n });\n this.showAllEditors(\"highlight\", true, /* updateButton = */ true);\n }\n for (const layer of this.#allLayers.values()) {\n if (layer.hasTextLayer(textLayer)) {\n layer.createAndAddNewEditor({ x: 0, y: 0 }, false, {\n methodOfCreation,\n boxes,\n anchorNode,\n anchorOffset,\n focusNode,\n focusOffset,\n text,\n });\n break;\n }\n }\n }\n\n #displayHighlightToolbar() {\n const selection = document.getSelection();\n if (!selection || selection.isCollapsed) {\n return;\n }\n const anchorElement = this.#getAnchorElementForSelection(selection);\n const textLayer = anchorElement.closest(\".textLayer\");\n const boxes = this.getSelectionBoxes(textLayer);\n if (!boxes) {\n return;\n }\n this.#highlightToolbar ||= new HighlightToolbar(this);\n this.#highlightToolbar.show(textLayer, boxes, this.direction === \"ltr\");\n }\n\n /**\n * Add an editor in the annotation storage.\n * @param {AnnotationEditor} editor\n */\n addToAnnotationStorage(editor) {\n if (\n !editor.isEmpty() &&\n this.#annotationStorage &&\n !this.#annotationStorage.has(editor.id)\n ) {\n this.#annotationStorage.setValue(editor.id, editor);\n }\n }\n\n #selectionChange() {\n const selection = document.getSelection();\n if (!selection || selection.isCollapsed) {\n if (this.#selectedTextNode) {\n this.#highlightToolbar?.hide();\n this.#selectedTextNode = null;\n this.#dispatchUpdateStates({\n hasSelectedText: false,\n });\n }\n return;\n }\n const { anchorNode } = selection;\n if (anchorNode === this.#selectedTextNode) {\n return;\n }\n\n const anchorElement = this.#getAnchorElementForSelection(selection);\n const textLayer = anchorElement.closest(\".textLayer\");\n if (!textLayer) {\n if (this.#selectedTextNode) {\n this.#highlightToolbar?.hide();\n this.#selectedTextNode = null;\n this.#dispatchUpdateStates({\n hasSelectedText: false,\n });\n }\n return;\n }\n this.#highlightToolbar?.hide();\n this.#selectedTextNode = anchorNode;\n this.#dispatchUpdateStates({\n hasSelectedText: true,\n });\n\n if (\n this.#mode !== AnnotationEditorType.HIGHLIGHT &&\n this.#mode !== AnnotationEditorType.NONE\n ) {\n return;\n }\n\n if (this.#mode === AnnotationEditorType.HIGHLIGHT) {\n this.showAllEditors(\"highlight\", true, /* updateButton = */ true);\n }\n\n this.#highlightWhenShiftUp = this.isShiftKeyDown;\n if (!this.isShiftKeyDown) {\n const pointerup = e => {\n if (e.type === \"pointerup\" && e.button !== 0) {\n // Do nothing on right click.\n return;\n }\n window.removeEventListener(\"pointerup\", pointerup);\n window.removeEventListener(\"blur\", pointerup);\n if (e.type === \"pointerup\") {\n this.#onSelectEnd(\"main_toolbar\");\n }\n };\n window.addEventListener(\"pointerup\", pointerup);\n window.addEventListener(\"blur\", pointerup);\n }\n }\n\n #onSelectEnd(methodOfCreation = \"\") {\n if (this.#mode === AnnotationEditorType.HIGHLIGHT) {\n this.highlightSelection(methodOfCreation);\n } else if (this.#enableHighlightFloatingButton) {\n this.#displayHighlightToolbar();\n }\n }\n\n #addSelectionListener() {\n document.addEventListener(\"selectionchange\", this.#boundSelectionChange);\n }\n\n #removeSelectionListener() {\n document.removeEventListener(\"selectionchange\", this.#boundSelectionChange);\n }\n\n #addFocusManager() {\n window.addEventListener(\"focus\", this.#boundFocus);\n window.addEventListener(\"blur\", this.#boundBlur);\n }\n\n #removeFocusManager() {\n window.removeEventListener(\"focus\", this.#boundFocus);\n window.removeEventListener(\"blur\", this.#boundBlur);\n }\n\n blur() {\n this.isShiftKeyDown = false;\n if (this.#highlightWhenShiftUp) {\n this.#highlightWhenShiftUp = false;\n this.#onSelectEnd(\"main_toolbar\");\n }\n if (!this.hasSelection) {\n return;\n }\n // When several editors are selected and the window loses focus, we want to\n // keep the last active element in order to be able to focus it again when\n // the window gets the focus back but we don't want to trigger any focus\n // callbacks else only one editor will be selected.\n const { activeElement } = document;\n for (const editor of this.#selectedEditors) {\n if (editor.div.contains(activeElement)) {\n this.#lastActiveElement = [editor, activeElement];\n editor._focusEventsAllowed = false;\n break;\n }\n }\n }\n\n focus() {\n if (!this.#lastActiveElement) {\n return;\n }\n const [lastEditor, lastActiveElement] = this.#lastActiveElement;\n this.#lastActiveElement = null;\n lastActiveElement.addEventListener(\n \"focusin\",\n () => {\n lastEditor._focusEventsAllowed = true;\n },\n { once: true }\n );\n lastActiveElement.focus();\n }\n\n #addKeyboardManager() {\n // The keyboard events are caught at the container level in order to be able\n // to execute some callbacks even if the current page doesn't have focus.\n window.addEventListener(\"keydown\", this.#boundKeydown);\n window.addEventListener(\"keyup\", this.#boundKeyup);\n }\n\n #removeKeyboardManager() {\n window.removeEventListener(\"keydown\", this.#boundKeydown);\n window.removeEventListener(\"keyup\", this.#boundKeyup);\n }\n\n #addCopyPasteListeners() {\n document.addEventListener(\"copy\", this.#boundCopy);\n document.addEventListener(\"cut\", this.#boundCut);\n document.addEventListener(\"paste\", this.#boundPaste);\n }\n\n #removeCopyPasteListeners() {\n document.removeEventListener(\"copy\", this.#boundCopy);\n document.removeEventListener(\"cut\", this.#boundCut);\n document.removeEventListener(\"paste\", this.#boundPaste);\n }\n\n addEditListeners() {\n this.#addKeyboardManager();\n this.#addCopyPasteListeners();\n }\n\n removeEditListeners() {\n this.#removeKeyboardManager();\n this.#removeCopyPasteListeners();\n }\n\n /**\n * Copy callback.\n * @param {ClipboardEvent} event\n */\n copy(event) {\n event.preventDefault();\n\n // An editor is being edited so just commit it.\n this.#activeEditor?.commitOrRemove();\n\n if (!this.hasSelection) {\n return;\n }\n\n const editors = [];\n for (const editor of this.#selectedEditors) {\n const serialized = editor.serialize(/* isForCopying = */ true);\n if (serialized) {\n editors.push(serialized);\n }\n }\n if (editors.length === 0) {\n return;\n }\n\n event.clipboardData.setData(\"application/pdfjs\", JSON.stringify(editors));\n }\n\n /**\n * Cut callback.\n * @param {ClipboardEvent} event\n */\n cut(event) {\n this.copy(event);\n this.delete();\n }\n\n /**\n * Paste callback.\n * @param {ClipboardEvent} event\n */\n paste(event) {\n event.preventDefault();\n const { clipboardData } = event;\n for (const item of clipboardData.items) {\n for (const editorType of this.#editorTypes) {\n if (editorType.isHandlingMimeForPasting(item.type)) {\n editorType.paste(item, this.currentLayer);\n return;\n }\n }\n }\n\n let data = clipboardData.getData(\"application/pdfjs\");\n if (!data) {\n return;\n }\n\n try {\n data = JSON.parse(data);\n } catch (ex) {\n warn(`paste: \"${ex.message}\".`);\n return;\n }\n\n if (!Array.isArray(data)) {\n return;\n }\n\n this.unselectAll();\n const layer = this.currentLayer;\n\n try {\n const newEditors = [];\n for (const editor of data) {\n const deserializedEditor = layer.deserialize(editor);\n if (!deserializedEditor) {\n return;\n }\n newEditors.push(deserializedEditor);\n }\n\n const cmd = () => {\n for (const editor of newEditors) {\n this.#addEditorToLayer(editor);\n }\n this.#selectEditors(newEditors);\n };\n const undo = () => {\n for (const editor of newEditors) {\n editor.remove();\n }\n };\n this.addCommands({ cmd, undo, mustExec: true });\n } catch (ex) {\n warn(`paste: \"${ex.message}\".`);\n }\n }\n\n /**\n * Keydown callback.\n * @param {KeyboardEvent} event\n */\n keydown(event) {\n if (!this.isShiftKeyDown && event.key === \"Shift\") {\n this.isShiftKeyDown = true;\n }\n if (\n this.#mode !== AnnotationEditorType.NONE &&\n !this.isEditorHandlingKeyboard\n ) {\n AnnotationEditorUIManager._keyboardManager.exec(this, event);\n }\n }\n\n /**\n * Keyup callback.\n * @param {KeyboardEvent} event\n */\n keyup(event) {\n if (this.isShiftKeyDown && event.key === \"Shift\") {\n this.isShiftKeyDown = false;\n if (this.#highlightWhenShiftUp) {\n this.#highlightWhenShiftUp = false;\n this.#onSelectEnd(\"main_toolbar\");\n }\n }\n }\n\n /**\n * Execute an action for a given name.\n * For example, the user can click on the \"Undo\" entry in the context menu\n * and it'll trigger the undo action.\n */\n onEditingAction({ name }) {\n switch (name) {\n case \"undo\":\n case \"redo\":\n case \"delete\":\n case \"selectAll\":\n this[name]();\n break;\n case \"highlightSelection\":\n this.highlightSelection(\"context_menu\");\n break;\n }\n }\n\n /**\n * Update the different possible states of this manager, e.g. is there\n * something to undo, redo, ...\n * @param {Object} details\n */\n #dispatchUpdateStates(details) {\n const hasChanged = Object.entries(details).some(\n ([key, value]) => this.#previousStates[key] !== value\n );\n\n if (hasChanged) {\n this._eventBus.dispatch(\"annotationeditorstateschanged\", {\n source: this,\n details: Object.assign(this.#previousStates, details),\n });\n // We could listen on our own event but it sounds like a bit weird and\n // it's a way to simpler to handle that stuff here instead of having to\n // add something in every place where an editor can be unselected.\n if (\n this.#mode === AnnotationEditorType.HIGHLIGHT &&\n details.hasSelectedEditor === false\n ) {\n this.#dispatchUpdateUI([\n [AnnotationEditorParamsType.HIGHLIGHT_FREE, true],\n ]);\n }\n }\n }\n\n #dispatchUpdateUI(details) {\n this._eventBus.dispatch(\"annotationeditorparamschanged\", {\n source: this,\n details,\n });\n }\n\n /**\n * Set the editing state.\n * It can be useful to temporarily disable it when the user is editing a\n * FreeText annotation.\n * @param {boolean} isEditing\n */\n setEditingState(isEditing) {\n if (isEditing) {\n this.#addFocusManager();\n this.#addCopyPasteListeners();\n this.#dispatchUpdateStates({\n isEditing: this.#mode !== AnnotationEditorType.NONE,\n isEmpty: this.#isEmpty(),\n hasSomethingToUndo: this.#commandManager.hasSomethingToUndo(),\n hasSomethingToRedo: this.#commandManager.hasSomethingToRedo(),\n hasSelectedEditor: false,\n });\n } else {\n this.#removeFocusManager();\n this.#removeCopyPasteListeners();\n this.#dispatchUpdateStates({\n isEditing: false,\n });\n this.disableUserSelect(false);\n }\n }\n\n registerEditorTypes(types) {\n if (this.#editorTypes) {\n return;\n }\n this.#editorTypes = types;\n for (const editorType of this.#editorTypes) {\n this.#dispatchUpdateUI(editorType.defaultPropertiesToUpdate);\n }\n }\n\n /**\n * Get an id.\n * @returns {string}\n */\n getId() {\n return this.#idManager.id;\n }\n\n get currentLayer() {\n return this.#allLayers.get(this.#currentPageIndex);\n }\n\n getLayer(pageIndex) {\n return this.#allLayers.get(pageIndex);\n }\n\n get currentPageIndex() {\n return this.#currentPageIndex;\n }\n\n /**\n * Add a new layer for a page which will contains the editors.\n * @param {AnnotationEditorLayer} layer\n */\n addLayer(layer) {\n this.#allLayers.set(layer.pageIndex, layer);\n if (this.#isEnabled) {\n layer.enable();\n } else {\n layer.disable();\n }\n }\n\n /**\n * Remove a layer.\n * @param {AnnotationEditorLayer} layer\n */\n removeLayer(layer) {\n this.#allLayers.delete(layer.pageIndex);\n }\n\n /**\n * Change the editor mode (None, FreeText, Ink, ...)\n * @param {number} mode\n * @param {string|null} editId\n * @param {boolean} [isFromKeyboard] - true if the mode change is due to a\n * keyboard action.\n */\n updateMode(mode, editId = null, isFromKeyboard = false) {\n if (this.#mode === mode) {\n return;\n }\n this.#mode = mode;\n if (mode === AnnotationEditorType.NONE) {\n this.setEditingState(false);\n this.#disableAll();\n return;\n }\n this.setEditingState(true);\n this.#enableAll();\n this.unselectAll();\n for (const layer of this.#allLayers.values()) {\n layer.updateMode(mode);\n }\n if (!editId && isFromKeyboard) {\n this.addNewEditorFromKeyboard();\n return;\n }\n\n if (!editId) {\n return;\n }\n for (const editor of this.#allEditors.values()) {\n if (editor.annotationElementId === editId) {\n this.setSelected(editor);\n editor.enterInEditMode();\n break;\n }\n }\n }\n\n addNewEditorFromKeyboard() {\n if (this.currentLayer.canCreateNewEmptyEditor()) {\n this.currentLayer.addNewEditor();\n }\n }\n\n /**\n * Update the toolbar if it's required to reflect the tool currently used.\n * @param {number} mode\n * @returns {undefined}\n */\n updateToolbar(mode) {\n if (mode === this.#mode) {\n return;\n }\n this._eventBus.dispatch(\"switchannotationeditormode\", {\n source: this,\n mode,\n });\n }\n\n /**\n * Update a parameter in the current editor or globally.\n * @param {number} type\n * @param {*} value\n */\n updateParams(type, value) {\n if (!this.#editorTypes) {\n return;\n }\n\n switch (type) {\n case AnnotationEditorParamsType.CREATE:\n this.currentLayer.addNewEditor();\n return;\n case AnnotationEditorParamsType.HIGHLIGHT_DEFAULT_COLOR:\n this.#mainHighlightColorPicker?.updateColor(value);\n break;\n case AnnotationEditorParamsType.HIGHLIGHT_SHOW_ALL:\n this._eventBus.dispatch(\"reporttelemetry\", {\n source: this,\n details: {\n type: \"editing\",\n data: {\n type: \"highlight\",\n action: \"toggle_visibility\",\n },\n },\n });\n (this.#showAllStates ||= new Map()).set(type, value);\n this.showAllEditors(\"highlight\", value);\n break;\n }\n\n for (const editor of this.#selectedEditors) {\n editor.updateParams(type, value);\n }\n\n for (const editorType of this.#editorTypes) {\n editorType.updateDefaultParams(type, value);\n }\n }\n\n showAllEditors(type, visible, updateButton = false) {\n for (const editor of this.#allEditors.values()) {\n if (editor.editorType === type) {\n editor.show(visible);\n }\n }\n const state =\n this.#showAllStates?.get(AnnotationEditorParamsType.HIGHLIGHT_SHOW_ALL) ??\n true;\n if (state !== visible) {\n this.#dispatchUpdateUI([\n [AnnotationEditorParamsType.HIGHLIGHT_SHOW_ALL, visible],\n ]);\n }\n }\n\n enableWaiting(mustWait = false) {\n if (this.#isWaiting === mustWait) {\n return;\n }\n this.#isWaiting = mustWait;\n for (const layer of this.#allLayers.values()) {\n if (mustWait) {\n layer.disableClick();\n } else {\n layer.enableClick();\n }\n layer.div.classList.toggle(\"waiting\", mustWait);\n }\n }\n\n /**\n * Enable all the layers.\n */\n #enableAll() {\n if (!this.#isEnabled) {\n this.#isEnabled = true;\n for (const layer of this.#allLayers.values()) {\n layer.enable();\n }\n for (const editor of this.#allEditors.values()) {\n editor.enable();\n }\n }\n }\n\n /**\n * Disable all the layers.\n */\n #disableAll() {\n this.unselectAll();\n if (this.#isEnabled) {\n this.#isEnabled = false;\n for (const layer of this.#allLayers.values()) {\n layer.disable();\n }\n for (const editor of this.#allEditors.values()) {\n editor.disable();\n }\n }\n }\n\n /**\n * Get all the editors belonging to a given page.\n * @param {number} pageIndex\n * @returns {Array}\n */\n getEditors(pageIndex) {\n const editors = [];\n for (const editor of this.#allEditors.values()) {\n if (editor.pageIndex === pageIndex) {\n editors.push(editor);\n }\n }\n return editors;\n }\n\n /**\n * Get an editor with the given id.\n * @param {string} id\n * @returns {AnnotationEditor}\n */\n getEditor(id) {\n return this.#allEditors.get(id);\n }\n\n /**\n * Add a new editor.\n * @param {AnnotationEditor} editor\n */\n addEditor(editor) {\n this.#allEditors.set(editor.id, editor);\n }\n\n /**\n * Remove an editor.\n * @param {AnnotationEditor} editor\n */\n removeEditor(editor) {\n if (editor.div.contains(document.activeElement)) {\n if (this.#focusMainContainerTimeoutId) {\n clearTimeout(this.#focusMainContainerTimeoutId);\n }\n this.#focusMainContainerTimeoutId = setTimeout(() => {\n // When the div is removed from DOM the focus can move on the\n // document.body, so we need to move it back to the main container.\n this.focusMainContainer();\n this.#focusMainContainerTimeoutId = null;\n }, 0);\n }\n this.#allEditors.delete(editor.id);\n this.unselect(editor);\n if (\n !editor.annotationElementId ||\n !this.#deletedAnnotationsElementIds.has(editor.annotationElementId)\n ) {\n this.#annotationStorage?.remove(editor.id);\n }\n }\n\n /**\n * The annotation element with the given id has been deleted.\n * @param {AnnotationEditor} editor\n */\n addDeletedAnnotationElement(editor) {\n this.#deletedAnnotationsElementIds.add(editor.annotationElementId);\n this.addChangedExistingAnnotation(editor);\n editor.deleted = true;\n }\n\n /**\n * Check if the annotation element with the given id has been deleted.\n * @param {string} annotationElementId\n * @returns {boolean}\n */\n isDeletedAnnotationElement(annotationElementId) {\n return this.#deletedAnnotationsElementIds.has(annotationElementId);\n }\n\n /**\n * The annotation element with the given id have been restored.\n * @param {AnnotationEditor} editor\n */\n removeDeletedAnnotationElement(editor) {\n this.#deletedAnnotationsElementIds.delete(editor.annotationElementId);\n this.removeChangedExistingAnnotation(editor);\n editor.deleted = false;\n }\n\n /**\n * Add an editor to the layer it belongs to or add it to the global map.\n * @param {AnnotationEditor} editor\n */\n #addEditorToLayer(editor) {\n const layer = this.#allLayers.get(editor.pageIndex);\n if (layer) {\n layer.addOrRebuild(editor);\n } else {\n this.addEditor(editor);\n this.addToAnnotationStorage(editor);\n }\n }\n\n /**\n * Set the given editor as the active one.\n * @param {AnnotationEditor} editor\n */\n setActiveEditor(editor) {\n if (this.#activeEditor === editor) {\n return;\n }\n\n this.#activeEditor = editor;\n if (editor) {\n this.#dispatchUpdateUI(editor.propertiesToUpdate);\n }\n }\n\n get #lastSelectedEditor() {\n let ed = null;\n for (ed of this.#selectedEditors) {\n // Iterate to get the last element.\n }\n return ed;\n }\n\n /**\n * Update the UI of the active editor.\n * @param {AnnotationEditor} editor\n */\n updateUI(editor) {\n if (this.#lastSelectedEditor === editor) {\n this.#dispatchUpdateUI(editor.propertiesToUpdate);\n }\n }\n\n /**\n * Add or remove an editor the current selection.\n * @param {AnnotationEditor} editor\n */\n toggleSelected(editor) {\n if (this.#selectedEditors.has(editor)) {\n this.#selectedEditors.delete(editor);\n editor.unselect();\n this.#dispatchUpdateStates({\n hasSelectedEditor: this.hasSelection,\n });\n return;\n }\n this.#selectedEditors.add(editor);\n editor.select();\n this.#dispatchUpdateUI(editor.propertiesToUpdate);\n this.#dispatchUpdateStates({\n hasSelectedEditor: true,\n });\n }\n\n /**\n * Set the last selected editor.\n * @param {AnnotationEditor} editor\n */\n setSelected(editor) {\n for (const ed of this.#selectedEditors) {\n if (ed !== editor) {\n ed.unselect();\n }\n }\n this.#selectedEditors.clear();\n\n this.#selectedEditors.add(editor);\n editor.select();\n this.#dispatchUpdateUI(editor.propertiesToUpdate);\n this.#dispatchUpdateStates({\n hasSelectedEditor: true,\n });\n }\n\n /**\n * Check if the editor is selected.\n * @param {AnnotationEditor} editor\n */\n isSelected(editor) {\n return this.#selectedEditors.has(editor);\n }\n\n get firstSelectedEditor() {\n return this.#selectedEditors.values().next().value;\n }\n\n /**\n * Unselect an editor.\n * @param {AnnotationEditor} editor\n */\n unselect(editor) {\n editor.unselect();\n this.#selectedEditors.delete(editor);\n this.#dispatchUpdateStates({\n hasSelectedEditor: this.hasSelection,\n });\n }\n\n get hasSelection() {\n return this.#selectedEditors.size !== 0;\n }\n\n get isEnterHandled() {\n return (\n this.#selectedEditors.size === 1 &&\n this.firstSelectedEditor.isEnterHandled\n );\n }\n\n /**\n * Undo the last command.\n */\n undo() {\n this.#commandManager.undo();\n this.#dispatchUpdateStates({\n hasSomethingToUndo: this.#commandManager.hasSomethingToUndo(),\n hasSomethingToRedo: true,\n isEmpty: this.#isEmpty(),\n });\n }\n\n /**\n * Redo the last undoed command.\n */\n redo() {\n this.#commandManager.redo();\n this.#dispatchUpdateStates({\n hasSomethingToUndo: true,\n hasSomethingToRedo: this.#commandManager.hasSomethingToRedo(),\n isEmpty: this.#isEmpty(),\n });\n }\n\n /**\n * Add a command to execute (cmd) and another one to undo it.\n * @param {Object} params\n */\n addCommands(params) {\n this.#commandManager.add(params);\n this.#dispatchUpdateStates({\n hasSomethingToUndo: true,\n hasSomethingToRedo: false,\n isEmpty: this.#isEmpty(),\n });\n }\n\n #isEmpty() {\n if (this.#allEditors.size === 0) {\n return true;\n }\n\n if (this.#allEditors.size === 1) {\n for (const editor of this.#allEditors.values()) {\n return editor.isEmpty();\n }\n }\n\n return false;\n }\n\n /**\n * Delete the current editor or all.\n */\n delete() {\n this.commitOrRemove();\n if (!this.hasSelection) {\n return;\n }\n\n const editors = [...this.#selectedEditors];\n const cmd = () => {\n for (const editor of editors) {\n editor.remove();\n }\n };\n const undo = () => {\n for (const editor of editors) {\n this.#addEditorToLayer(editor);\n }\n };\n\n this.addCommands({ cmd, undo, mustExec: true });\n }\n\n commitOrRemove() {\n // An editor is being edited so just commit it.\n this.#activeEditor?.commitOrRemove();\n }\n\n hasSomethingToControl() {\n return this.#activeEditor || this.hasSelection;\n }\n\n /**\n * Select the editors.\n * @param {Array} editors\n */\n #selectEditors(editors) {\n for (const editor of this.#selectedEditors) {\n editor.unselect();\n }\n this.#selectedEditors.clear();\n for (const editor of editors) {\n if (editor.isEmpty()) {\n continue;\n }\n this.#selectedEditors.add(editor);\n editor.select();\n }\n this.#dispatchUpdateStates({ hasSelectedEditor: this.hasSelection });\n }\n\n /**\n * Select all the editors.\n */\n selectAll() {\n for (const editor of this.#selectedEditors) {\n editor.commit();\n }\n this.#selectEditors(this.#allEditors.values());\n }\n\n /**\n * Unselect all the selected editors.\n */\n unselectAll() {\n if (this.#activeEditor) {\n // An editor is being edited so just commit it.\n this.#activeEditor.commitOrRemove();\n if (this.#mode !== AnnotationEditorType.NONE) {\n // If the mode is NONE, we want to really unselect the editor, hence we\n // mustn't return here.\n return;\n }\n }\n\n if (!this.hasSelection) {\n return;\n }\n for (const editor of this.#selectedEditors) {\n editor.unselect();\n }\n this.#selectedEditors.clear();\n this.#dispatchUpdateStates({\n hasSelectedEditor: false,\n });\n }\n\n translateSelectedEditors(x, y, noCommit = false) {\n if (!noCommit) {\n this.commitOrRemove();\n }\n if (!this.hasSelection) {\n return;\n }\n\n this.#translation[0] += x;\n this.#translation[1] += y;\n const [totalX, totalY] = this.#translation;\n const editors = [...this.#selectedEditors];\n\n // We don't want to have an undo/redo for each translation so we wait a bit\n // before adding the command to the command manager.\n const TIME_TO_WAIT = 1000;\n\n if (this.#translationTimeoutId) {\n clearTimeout(this.#translationTimeoutId);\n }\n\n this.#translationTimeoutId = setTimeout(() => {\n this.#translationTimeoutId = null;\n this.#translation[0] = this.#translation[1] = 0;\n\n this.addCommands({\n cmd: () => {\n for (const editor of editors) {\n if (this.#allEditors.has(editor.id)) {\n editor.translateInPage(totalX, totalY);\n }\n }\n },\n undo: () => {\n for (const editor of editors) {\n if (this.#allEditors.has(editor.id)) {\n editor.translateInPage(-totalX, -totalY);\n }\n }\n },\n mustExec: false,\n });\n }, TIME_TO_WAIT);\n\n for (const editor of editors) {\n editor.translateInPage(x, y);\n }\n }\n\n /**\n * Set up the drag session for moving the selected editors.\n */\n setUpDragSession() {\n // Note: don't use any references to the editor's parent which can be null\n // if the editor belongs to a destroyed page.\n if (!this.hasSelection) {\n return;\n }\n // Avoid to have spurious text selection in the text layer when dragging.\n this.disableUserSelect(true);\n this.#draggingEditors = new Map();\n for (const editor of this.#selectedEditors) {\n this.#draggingEditors.set(editor, {\n savedX: editor.x,\n savedY: editor.y,\n savedPageIndex: editor.pageIndex,\n newX: 0,\n newY: 0,\n newPageIndex: -1,\n });\n }\n }\n\n /**\n * Ends the drag session.\n * @returns {boolean} true if at least one editor has been moved.\n */\n endDragSession() {\n if (!this.#draggingEditors) {\n return false;\n }\n this.disableUserSelect(false);\n const map = this.#draggingEditors;\n this.#draggingEditors = null;\n let mustBeAddedInUndoStack = false;\n\n for (const [{ x, y, pageIndex }, value] of map) {\n value.newX = x;\n value.newY = y;\n value.newPageIndex = pageIndex;\n mustBeAddedInUndoStack ||=\n x !== value.savedX ||\n y !== value.savedY ||\n pageIndex !== value.savedPageIndex;\n }\n\n if (!mustBeAddedInUndoStack) {\n return false;\n }\n\n const move = (editor, x, y, pageIndex) => {\n if (this.#allEditors.has(editor.id)) {\n // The editor can be undone/redone on a page which is not visible (and\n // which potentially has no annotation editor layer), hence we need to\n // use the pageIndex instead of the parent.\n const parent = this.#allLayers.get(pageIndex);\n if (parent) {\n editor._setParentAndPosition(parent, x, y);\n } else {\n editor.pageIndex = pageIndex;\n editor.x = x;\n editor.y = y;\n }\n }\n };\n\n this.addCommands({\n cmd: () => {\n for (const [editor, { newX, newY, newPageIndex }] of map) {\n move(editor, newX, newY, newPageIndex);\n }\n },\n undo: () => {\n for (const [editor, { savedX, savedY, savedPageIndex }] of map) {\n move(editor, savedX, savedY, savedPageIndex);\n }\n },\n mustExec: true,\n });\n\n return true;\n }\n\n /**\n * Drag the set of selected editors.\n * @param {number} tx\n * @param {number} ty\n */\n dragSelectedEditors(tx, ty) {\n if (!this.#draggingEditors) {\n return;\n }\n for (const editor of this.#draggingEditors.keys()) {\n editor.drag(tx, ty);\n }\n }\n\n /**\n * Rebuild the editor (usually on undo/redo actions) on a potentially\n * non-rendered page.\n * @param {AnnotationEditor} editor\n */\n rebuild(editor) {\n if (editor.parent === null) {\n const parent = this.getLayer(editor.pageIndex);\n if (parent) {\n parent.changeParent(editor);\n parent.addOrRebuild(editor);\n } else {\n this.addEditor(editor);\n this.addToAnnotationStorage(editor);\n editor.rebuild();\n }\n } else {\n editor.parent.addOrRebuild(editor);\n }\n }\n\n get isEditorHandlingKeyboard() {\n return (\n this.getActive()?.shouldGetKeyboardEvents() ||\n (this.#selectedEditors.size === 1 &&\n this.firstSelectedEditor.shouldGetKeyboardEvents())\n );\n }\n\n /**\n * Is the current editor the one passed as argument?\n * @param {AnnotationEditor} editor\n * @returns\n */\n isActive(editor) {\n return this.#activeEditor === editor;\n }\n\n /**\n * Get the current active editor.\n * @returns {AnnotationEditor|null}\n */\n getActive() {\n return this.#activeEditor;\n }\n\n /**\n * Get the current editor mode.\n * @returns {number}\n */\n getMode() {\n return this.#mode;\n }\n\n get imageManager() {\n return shadow(this, \"imageManager\", new ImageManager());\n }\n\n getSelectionBoxes(textLayer) {\n if (!textLayer) {\n return null;\n }\n const selection = document.getSelection();\n for (let i = 0, ii = selection.rangeCount; i < ii; i++) {\n if (\n !textLayer.contains(selection.getRangeAt(i).commonAncestorContainer)\n ) {\n return null;\n }\n }\n\n const {\n x: layerX,\n y: layerY,\n width: parentWidth,\n height: parentHeight,\n } = textLayer.getBoundingClientRect();\n\n // We must rotate the boxes because we want to have them in the non-rotated\n // page coordinates.\n let rotator;\n switch (textLayer.getAttribute(\"data-main-rotation\")) {\n case \"90\":\n rotator = (x, y, w, h) => ({\n x: (y - layerY) / parentHeight,\n y: 1 - (x + w - layerX) / parentWidth,\n width: h / parentHeight,\n height: w / parentWidth,\n });\n break;\n case \"180\":\n rotator = (x, y, w, h) => ({\n x: 1 - (x + w - layerX) / parentWidth,\n y: 1 - (y + h - layerY) / parentHeight,\n width: w / parentWidth,\n height: h / parentHeight,\n });\n break;\n case \"270\":\n rotator = (x, y, w, h) => ({\n x: 1 - (y + h - layerY) / parentHeight,\n y: (x - layerX) / parentWidth,\n width: h / parentHeight,\n height: w / parentWidth,\n });\n break;\n default:\n rotator = (x, y, w, h) => ({\n x: (x - layerX) / parentWidth,\n y: (y - layerY) / parentHeight,\n width: w / parentWidth,\n height: h / parentHeight,\n });\n break;\n }\n\n const boxes = [];\n for (let i = 0, ii = selection.rangeCount; i < ii; i++) {\n const range = selection.getRangeAt(i);\n if (range.collapsed) {\n continue;\n }\n for (const { x, y, width, height } of range.getClientRects()) {\n if (width === 0 || height === 0) {\n continue;\n }\n boxes.push(rotator(x, y, width, height));\n }\n }\n return boxes.length === 0 ? null : boxes;\n }\n\n addChangedExistingAnnotation({ annotationElementId, id }) {\n (this.#changedExistingAnnotations ||= new Map()).set(\n annotationElementId,\n id\n );\n }\n\n removeChangedExistingAnnotation({ annotationElementId }) {\n this.#changedExistingAnnotations?.delete(annotationElementId);\n }\n\n renderAnnotationElement(annotation) {\n const editorId = this.#changedExistingAnnotations?.get(annotation.data.id);\n if (!editorId) {\n return;\n }\n const editor = this.#annotationStorage.getRawValue(editorId);\n if (!editor) {\n return;\n }\n if (this.#mode === AnnotationEditorType.NONE && !editor.hasBeenModified) {\n return;\n }\n editor.renderAnnotationElement(annotation);\n }\n}\n\nexport {\n AnnotationEditorUIManager,\n bindEvents,\n ColorManager,\n CommandManager,\n KeyboardManager,\n opacityToHex,\n};\n","/* Copyright 2023 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\nimport { noContextMenu } from \"../display_utils.js\";\n\nclass AltText {\n #altText = \"\";\n\n #altTextDecorative = false;\n\n #altTextButton = null;\n\n #altTextTooltip = null;\n\n #altTextTooltipTimeout = null;\n\n #altTextWasFromKeyBoard = false;\n\n #editor = null;\n\n static _l10nPromise = null;\n\n constructor(editor) {\n this.#editor = editor;\n }\n\n static initialize(l10nPromise) {\n AltText._l10nPromise ||= l10nPromise;\n }\n\n async render() {\n const altText = (this.#altTextButton = document.createElement(\"button\"));\n altText.className = \"altText\";\n const msg = await AltText._l10nPromise.get(\n \"pdfjs-editor-alt-text-button-label\"\n );\n altText.textContent = msg;\n altText.setAttribute(\"aria-label\", msg);\n altText.tabIndex = \"0\";\n altText.addEventListener(\"contextmenu\", noContextMenu);\n altText.addEventListener(\"pointerdown\", event => event.stopPropagation());\n\n const onClick = event => {\n event.preventDefault();\n this.#editor._uiManager.editAltText(this.#editor);\n };\n altText.addEventListener(\"click\", onClick, { capture: true });\n altText.addEventListener(\"keydown\", event => {\n if (event.target === altText && event.key === \"Enter\") {\n this.#altTextWasFromKeyBoard = true;\n onClick(event);\n }\n });\n await this.#setState();\n\n return altText;\n }\n\n finish() {\n if (!this.#altTextButton) {\n return;\n }\n this.#altTextButton.focus({ focusVisible: this.#altTextWasFromKeyBoard });\n this.#altTextWasFromKeyBoard = false;\n }\n\n isEmpty() {\n return !this.#altText && !this.#altTextDecorative;\n }\n\n get data() {\n return {\n altText: this.#altText,\n decorative: this.#altTextDecorative,\n };\n }\n\n /**\n * Set the alt text data.\n */\n set data({ altText, decorative }) {\n if (this.#altText === altText && this.#altTextDecorative === decorative) {\n return;\n }\n this.#altText = altText;\n this.#altTextDecorative = decorative;\n this.#setState();\n }\n\n toggle(enabled = false) {\n if (!this.#altTextButton) {\n return;\n }\n if (!enabled && this.#altTextTooltipTimeout) {\n clearTimeout(this.#altTextTooltipTimeout);\n this.#altTextTooltipTimeout = null;\n }\n this.#altTextButton.disabled = !enabled;\n }\n\n destroy() {\n this.#altTextButton?.remove();\n this.#altTextButton = null;\n this.#altTextTooltip = null;\n }\n\n async #setState() {\n const button = this.#altTextButton;\n if (!button) {\n return;\n }\n if (!this.#altText && !this.#altTextDecorative) {\n button.classList.remove(\"done\");\n this.#altTextTooltip?.remove();\n return;\n }\n button.classList.add(\"done\");\n\n AltText._l10nPromise\n .get(\"pdfjs-editor-alt-text-edit-button-label\")\n .then(msg => {\n button.setAttribute(\"aria-label\", msg);\n });\n let tooltip = this.#altTextTooltip;\n if (!tooltip) {\n this.#altTextTooltip = tooltip = document.createElement(\"span\");\n tooltip.className = \"tooltip\";\n tooltip.setAttribute(\"role\", \"tooltip\");\n const id = (tooltip.id = `alt-text-tooltip-${this.#editor.id}`);\n button.setAttribute(\"aria-describedby\", id);\n\n const DELAY_TO_SHOW_TOOLTIP = 100;\n button.addEventListener(\"mouseenter\", () => {\n this.#altTextTooltipTimeout = setTimeout(() => {\n this.#altTextTooltipTimeout = null;\n this.#altTextTooltip.classList.add(\"show\");\n this.#editor._reportTelemetry({\n action: \"alt_text_tooltip\",\n });\n }, DELAY_TO_SHOW_TOOLTIP);\n });\n button.addEventListener(\"mouseleave\", () => {\n if (this.#altTextTooltipTimeout) {\n clearTimeout(this.#altTextTooltipTimeout);\n this.#altTextTooltipTimeout = null;\n }\n this.#altTextTooltip?.classList.remove(\"show\");\n });\n }\n tooltip.innerText = this.#altTextDecorative\n ? await AltText._l10nPromise.get(\n \"pdfjs-editor-alt-text-decorative-tooltip\"\n )\n : this.#altText;\n\n if (!tooltip.parentNode) {\n button.append(tooltip);\n }\n\n const element = this.#editor.getImageForAltText();\n element?.setAttribute(\"aria-describedby\", tooltip.id);\n }\n}\n\nexport { AltText };\n","/* Copyright 2022 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\n// eslint-disable-next-line max-len\n/** @typedef {import(\"./annotation_editor_layer.js\").AnnotationEditorLayer} AnnotationEditorLayer */\n\nimport {\n AnnotationEditorUIManager,\n bindEvents,\n ColorManager,\n KeyboardManager,\n} from \"./tools.js\";\nimport { FeatureTest, shadow, unreachable } from \"../../shared/util.js\";\nimport { AltText } from \"./alt_text.js\";\nimport { EditorToolbar } from \"./toolbar.js\";\nimport { noContextMenu } from \"../display_utils.js\";\n\n/**\n * @typedef {Object} AnnotationEditorParameters\n * @property {AnnotationEditorUIManager} uiManager - the global manager\n * @property {AnnotationEditorLayer} parent - the layer containing this editor\n * @property {string} id - editor id\n * @property {number} x - x-coordinate\n * @property {number} y - y-coordinate\n */\n\n/**\n * Base class for editors.\n */\nclass AnnotationEditor {\n #allResizerDivs = null;\n\n #altText = null;\n\n #disabled = false;\n\n #keepAspectRatio = false;\n\n #resizersDiv = null;\n\n #savedDimensions = null;\n\n #boundFocusin = this.focusin.bind(this);\n\n #boundFocusout = this.focusout.bind(this);\n\n #editToolbar = null;\n\n #focusedResizerName = \"\";\n\n #hasBeenClicked = false;\n\n #initialPosition = null;\n\n #isEditing = false;\n\n #isInEditMode = false;\n\n #isResizerEnabledForKeyboard = false;\n\n #moveInDOMTimeout = null;\n\n #prevDragX = 0;\n\n #prevDragY = 0;\n\n #telemetryTimeouts = null;\n\n _initialOptions = Object.create(null);\n\n _isVisible = true;\n\n _uiManager = null;\n\n _focusEventsAllowed = true;\n\n _l10nPromise = null;\n\n #isDraggable = false;\n\n #zIndex = AnnotationEditor._zIndex++;\n\n static _borderLineWidth = -1;\n\n static _colorManager = new ColorManager();\n\n static _zIndex = 1;\n\n // Time to wait (in ms) before sending the telemetry data.\n // We wait a bit to avoid sending too many requests when changing something\n // like the thickness of a line.\n static _telemetryTimeout = 1000;\n\n static get _resizerKeyboardManager() {\n const resize = AnnotationEditor.prototype._resizeWithKeyboard;\n const small = AnnotationEditorUIManager.TRANSLATE_SMALL;\n const big = AnnotationEditorUIManager.TRANSLATE_BIG;\n\n return shadow(\n this,\n \"_resizerKeyboardManager\",\n new KeyboardManager([\n [[\"ArrowLeft\", \"mac+ArrowLeft\"], resize, { args: [-small, 0] }],\n [\n [\"ctrl+ArrowLeft\", \"mac+shift+ArrowLeft\"],\n resize,\n { args: [-big, 0] },\n ],\n [[\"ArrowRight\", \"mac+ArrowRight\"], resize, { args: [small, 0] }],\n [\n [\"ctrl+ArrowRight\", \"mac+shift+ArrowRight\"],\n resize,\n { args: [big, 0] },\n ],\n [[\"ArrowUp\", \"mac+ArrowUp\"], resize, { args: [0, -small] }],\n [[\"ctrl+ArrowUp\", \"mac+shift+ArrowUp\"], resize, { args: [0, -big] }],\n [[\"ArrowDown\", \"mac+ArrowDown\"], resize, { args: [0, small] }],\n [[\"ctrl+ArrowDown\", \"mac+shift+ArrowDown\"], resize, { args: [0, big] }],\n [\n [\"Escape\", \"mac+Escape\"],\n AnnotationEditor.prototype._stopResizingWithKeyboard,\n ],\n ])\n );\n }\n\n /**\n * @param {AnnotationEditorParameters} parameters\n */\n constructor(parameters) {\n if (this.constructor === AnnotationEditor) {\n unreachable(\"Cannot initialize AnnotationEditor.\");\n }\n\n this.parent = parameters.parent;\n this.id = parameters.id;\n this.width = this.height = null;\n this.pageIndex = parameters.parent.pageIndex;\n this.name = parameters.name;\n this.div = null;\n this._uiManager = parameters.uiManager;\n this.annotationElementId = null;\n this._willKeepAspectRatio = false;\n this._initialOptions.isCentered = parameters.isCentered;\n this._structTreeParentId = null;\n\n const {\n rotation,\n rawDims: { pageWidth, pageHeight, pageX, pageY },\n } = this.parent.viewport;\n\n this.rotation = rotation;\n this.pageRotation =\n (360 + rotation - this._uiManager.viewParameters.rotation) % 360;\n this.pageDimensions = [pageWidth, pageHeight];\n this.pageTranslation = [pageX, pageY];\n\n const [width, height] = this.parentDimensions;\n this.x = parameters.x / width;\n this.y = parameters.y / height;\n\n this.isAttachedToDOM = false;\n this.deleted = false;\n }\n\n get editorType() {\n return Object.getPrototypeOf(this).constructor._type;\n }\n\n static get _defaultLineColor() {\n return shadow(\n this,\n \"_defaultLineColor\",\n this._colorManager.getHexCode(\"CanvasText\")\n );\n }\n\n static deleteAnnotationElement(editor) {\n const fakeEditor = new FakeEditor({\n id: editor.parent.getNextId(),\n parent: editor.parent,\n uiManager: editor._uiManager,\n });\n fakeEditor.annotationElementId = editor.annotationElementId;\n fakeEditor.deleted = true;\n fakeEditor._uiManager.addToAnnotationStorage(fakeEditor);\n }\n\n /**\n * Initialize the l10n stuff for this type of editor.\n * @param {Object} l10n\n */\n static initialize(l10n, _uiManager, options) {\n AnnotationEditor._l10nPromise ||= new Map(\n [\n \"pdfjs-editor-alt-text-button-label\",\n \"pdfjs-editor-alt-text-edit-button-label\",\n \"pdfjs-editor-alt-text-decorative-tooltip\",\n \"pdfjs-editor-resizer-label-topLeft\",\n \"pdfjs-editor-resizer-label-topMiddle\",\n \"pdfjs-editor-resizer-label-topRight\",\n \"pdfjs-editor-resizer-label-middleRight\",\n \"pdfjs-editor-resizer-label-bottomRight\",\n \"pdfjs-editor-resizer-label-bottomMiddle\",\n \"pdfjs-editor-resizer-label-bottomLeft\",\n \"pdfjs-editor-resizer-label-middleLeft\",\n ].map(str => [\n str,\n l10n.get(str.replaceAll(/([A-Z])/g, c => `-${c.toLowerCase()}`)),\n ])\n );\n if (options?.strings) {\n for (const str of options.strings) {\n AnnotationEditor._l10nPromise.set(str, l10n.get(str));\n }\n }\n if (AnnotationEditor._borderLineWidth !== -1) {\n return;\n }\n const style = getComputedStyle(document.documentElement);\n AnnotationEditor._borderLineWidth =\n parseFloat(style.getPropertyValue(\"--outline-width\")) || 0;\n }\n\n /**\n * Update the default parameters for this type of editor.\n * @param {number} _type\n * @param {*} _value\n */\n static updateDefaultParams(_type, _value) {}\n\n /**\n * Get the default properties to set in the UI for this type of editor.\n * @returns {Array}\n */\n static get defaultPropertiesToUpdate() {\n return [];\n }\n\n /**\n * Check if this kind of editor is able to handle the given mime type for\n * pasting.\n * @param {string} mime\n * @returns {boolean}\n */\n static isHandlingMimeForPasting(mime) {\n return false;\n }\n\n /**\n * Extract the data from the clipboard item and delegate the creation of the\n * editor to the parent.\n * @param {DataTransferItem} item\n * @param {AnnotationEditorLayer} parent\n */\n static paste(item, parent) {\n unreachable(\"Not implemented\");\n }\n\n /**\n * Get the properties to update in the UI for this editor.\n * @returns {Array}\n */\n get propertiesToUpdate() {\n return [];\n }\n\n get _isDraggable() {\n return this.#isDraggable;\n }\n\n set _isDraggable(value) {\n this.#isDraggable = value;\n this.div?.classList.toggle(\"draggable\", value);\n }\n\n /**\n * @returns {boolean} true if the editor handles the Enter key itself.\n */\n get isEnterHandled() {\n return true;\n }\n\n center() {\n const [pageWidth, pageHeight] = this.pageDimensions;\n switch (this.parentRotation) {\n case 90:\n this.x -= (this.height * pageHeight) / (pageWidth * 2);\n this.y += (this.width * pageWidth) / (pageHeight * 2);\n break;\n case 180:\n this.x += this.width / 2;\n this.y += this.height / 2;\n break;\n case 270:\n this.x += (this.height * pageHeight) / (pageWidth * 2);\n this.y -= (this.width * pageWidth) / (pageHeight * 2);\n break;\n default:\n this.x -= this.width / 2;\n this.y -= this.height / 2;\n break;\n }\n this.fixAndSetPosition();\n }\n\n /**\n * Add some commands into the CommandManager (undo/redo stuff).\n * @param {Object} params\n */\n addCommands(params) {\n this._uiManager.addCommands(params);\n }\n\n get currentLayer() {\n return this._uiManager.currentLayer;\n }\n\n /**\n * This editor will be behind the others.\n */\n setInBackground() {\n this.div.style.zIndex = 0;\n }\n\n /**\n * This editor will be in the foreground.\n */\n setInForeground() {\n this.div.style.zIndex = this.#zIndex;\n }\n\n setParent(parent) {\n if (parent !== null) {\n this.pageIndex = parent.pageIndex;\n this.pageDimensions = parent.pageDimensions;\n } else {\n // The editor is being removed from the DOM, so we need to stop resizing.\n this.#stopResizing();\n }\n this.parent = parent;\n }\n\n /**\n * onfocus callback.\n */\n focusin(event) {\n if (!this._focusEventsAllowed) {\n return;\n }\n if (!this.#hasBeenClicked) {\n this.parent.setSelected(this);\n } else {\n this.#hasBeenClicked = false;\n }\n }\n\n /**\n * onblur callback.\n * @param {FocusEvent} event\n */\n focusout(event) {\n if (!this._focusEventsAllowed) {\n return;\n }\n\n if (!this.isAttachedToDOM) {\n return;\n }\n\n // In case of focusout, the relatedTarget is the element which\n // is grabbing the focus.\n // So if the related target is an element under the div for this\n // editor, then the editor isn't unactive.\n const target = event.relatedTarget;\n if (target?.closest(`#${this.id}`)) {\n return;\n }\n\n event.preventDefault();\n\n if (!this.parent?.isMultipleSelection) {\n this.commitOrRemove();\n }\n }\n\n commitOrRemove() {\n if (this.isEmpty()) {\n this.remove();\n } else {\n this.commit();\n }\n }\n\n /**\n * Commit the data contained in this editor.\n */\n commit() {\n this.addToAnnotationStorage();\n }\n\n addToAnnotationStorage() {\n this._uiManager.addToAnnotationStorage(this);\n }\n\n /**\n * Set the editor position within its parent.\n * @param {number} x\n * @param {number} y\n * @param {number} tx - x-translation in screen coordinates.\n * @param {number} ty - y-translation in screen coordinates.\n */\n setAt(x, y, tx, ty) {\n const [width, height] = this.parentDimensions;\n [tx, ty] = this.screenToPageTranslation(tx, ty);\n\n this.x = (x + tx) / width;\n this.y = (y + ty) / height;\n\n this.fixAndSetPosition();\n }\n\n #translate([width, height], x, y) {\n [x, y] = this.screenToPageTranslation(x, y);\n\n this.x += x / width;\n this.y += y / height;\n\n this.fixAndSetPosition();\n }\n\n /**\n * Translate the editor position within its parent.\n * @param {number} x - x-translation in screen coordinates.\n * @param {number} y - y-translation in screen coordinates.\n */\n translate(x, y) {\n // We don't change the initial position because the move here hasn't been\n // done by the user.\n this.#translate(this.parentDimensions, x, y);\n }\n\n /**\n * Translate the editor position within its page and adjust the scroll\n * in order to have the editor in the view.\n * @param {number} x - x-translation in page coordinates.\n * @param {number} y - y-translation in page coordinates.\n */\n translateInPage(x, y) {\n this.#initialPosition ||= [this.x, this.y];\n this.#translate(this.pageDimensions, x, y);\n this.div.scrollIntoView({ block: \"nearest\" });\n }\n\n drag(tx, ty) {\n this.#initialPosition ||= [this.x, this.y];\n const [parentWidth, parentHeight] = this.parentDimensions;\n this.x += tx / parentWidth;\n this.y += ty / parentHeight;\n if (this.parent && (this.x < 0 || this.x > 1 || this.y < 0 || this.y > 1)) {\n // It's possible to not have a parent: for example, when the user is\n // dragging all the selected editors but this one on a page which has been\n // destroyed.\n // It's why we need to check for it. In such a situation, it isn't really\n // a problem to not find a new parent: it's something which is related to\n // what the user is seeing, hence it depends on how pages are layed out.\n\n // The element will be outside of its parent so change the parent.\n const { x, y } = this.div.getBoundingClientRect();\n if (this.parent.findNewParent(this, x, y)) {\n this.x -= Math.floor(this.x);\n this.y -= Math.floor(this.y);\n }\n }\n\n // The editor can be moved wherever the user wants, so we don't need to fix\n // the position: it'll be done when the user will release the mouse button.\n\n let { x, y } = this;\n const [bx, by] = this.getBaseTranslation();\n x += bx;\n y += by;\n\n this.div.style.left = `${(100 * x).toFixed(2)}%`;\n this.div.style.top = `${(100 * y).toFixed(2)}%`;\n this.div.scrollIntoView({ block: \"nearest\" });\n }\n\n get _hasBeenMoved() {\n return (\n !!this.#initialPosition &&\n (this.#initialPosition[0] !== this.x ||\n this.#initialPosition[1] !== this.y)\n );\n }\n\n /**\n * Get the translation to take into account the editor border.\n * The CSS engine positions the element by taking the border into account so\n * we must apply the opposite translation to have the editor in the right\n * position.\n * @returns {Array}\n */\n getBaseTranslation() {\n const [parentWidth, parentHeight] = this.parentDimensions;\n const { _borderLineWidth } = AnnotationEditor;\n const x = _borderLineWidth / parentWidth;\n const y = _borderLineWidth / parentHeight;\n switch (this.rotation) {\n case 90:\n return [-x, y];\n case 180:\n return [x, y];\n case 270:\n return [x, -y];\n default:\n return [-x, -y];\n }\n }\n\n /**\n * @returns {boolean} true if position must be fixed (i.e. make the x and y\n * living in the page).\n */\n get _mustFixPosition() {\n return true;\n }\n\n /**\n * Fix the position of the editor in order to keep it inside its parent page.\n * @param {number} [rotation] - the rotation of the page.\n */\n fixAndSetPosition(rotation = this.rotation) {\n const [pageWidth, pageHeight] = this.pageDimensions;\n let { x, y, width, height } = this;\n width *= pageWidth;\n height *= pageHeight;\n x *= pageWidth;\n y *= pageHeight;\n\n if (this._mustFixPosition) {\n switch (rotation) {\n case 0:\n x = Math.max(0, Math.min(pageWidth - width, x));\n y = Math.max(0, Math.min(pageHeight - height, y));\n break;\n case 90:\n x = Math.max(0, Math.min(pageWidth - height, x));\n y = Math.min(pageHeight, Math.max(width, y));\n break;\n case 180:\n x = Math.min(pageWidth, Math.max(width, x));\n y = Math.min(pageHeight, Math.max(height, y));\n break;\n case 270:\n x = Math.min(pageWidth, Math.max(height, x));\n y = Math.max(0, Math.min(pageHeight - width, y));\n break;\n }\n }\n\n this.x = x /= pageWidth;\n this.y = y /= pageHeight;\n\n const [bx, by] = this.getBaseTranslation();\n x += bx;\n y += by;\n\n const { style } = this.div;\n style.left = `${(100 * x).toFixed(2)}%`;\n style.top = `${(100 * y).toFixed(2)}%`;\n\n this.moveInDOM();\n }\n\n static #rotatePoint(x, y, angle) {\n switch (angle) {\n case 90:\n return [y, -x];\n case 180:\n return [-x, -y];\n case 270:\n return [-y, x];\n default:\n return [x, y];\n }\n }\n\n /**\n * Convert a screen translation into a page one.\n * @param {number} x\n * @param {number} y\n */\n screenToPageTranslation(x, y) {\n return AnnotationEditor.#rotatePoint(x, y, this.parentRotation);\n }\n\n /**\n * Convert a page translation into a screen one.\n * @param {number} x\n * @param {number} y\n */\n pageTranslationToScreen(x, y) {\n return AnnotationEditor.#rotatePoint(x, y, 360 - this.parentRotation);\n }\n\n #getRotationMatrix(rotation) {\n switch (rotation) {\n case 90: {\n const [pageWidth, pageHeight] = this.pageDimensions;\n return [0, -pageWidth / pageHeight, pageHeight / pageWidth, 0];\n }\n case 180:\n return [-1, 0, 0, -1];\n case 270: {\n const [pageWidth, pageHeight] = this.pageDimensions;\n return [0, pageWidth / pageHeight, -pageHeight / pageWidth, 0];\n }\n default:\n return [1, 0, 0, 1];\n }\n }\n\n get parentScale() {\n return this._uiManager.viewParameters.realScale;\n }\n\n get parentRotation() {\n return (this._uiManager.viewParameters.rotation + this.pageRotation) % 360;\n }\n\n get parentDimensions() {\n const {\n parentScale,\n pageDimensions: [pageWidth, pageHeight],\n } = this;\n const scaledWidth = pageWidth * parentScale;\n const scaledHeight = pageHeight * parentScale;\n return FeatureTest.isCSSRoundSupported\n ? [Math.round(scaledWidth), Math.round(scaledHeight)]\n : [scaledWidth, scaledHeight];\n }\n\n /**\n * Set the dimensions of this editor.\n * @param {number} width\n * @param {number} height\n */\n setDims(width, height) {\n const [parentWidth, parentHeight] = this.parentDimensions;\n this.div.style.width = `${((100 * width) / parentWidth).toFixed(2)}%`;\n if (!this.#keepAspectRatio) {\n this.div.style.height = `${((100 * height) / parentHeight).toFixed(2)}%`;\n }\n }\n\n fixDims() {\n const { style } = this.div;\n const { height, width } = style;\n const widthPercent = width.endsWith(\"%\");\n const heightPercent = !this.#keepAspectRatio && height.endsWith(\"%\");\n if (widthPercent && heightPercent) {\n return;\n }\n\n const [parentWidth, parentHeight] = this.parentDimensions;\n if (!widthPercent) {\n style.width = `${((100 * parseFloat(width)) / parentWidth).toFixed(2)}%`;\n }\n if (!this.#keepAspectRatio && !heightPercent) {\n style.height = `${((100 * parseFloat(height)) / parentHeight).toFixed(\n 2\n )}%`;\n }\n }\n\n /**\n * Get the translation used to position this editor when it's created.\n * @returns {Array}\n */\n getInitialTranslation() {\n return [0, 0];\n }\n\n #createResizers() {\n if (this.#resizersDiv) {\n return;\n }\n this.#resizersDiv = document.createElement(\"div\");\n this.#resizersDiv.classList.add(\"resizers\");\n // When the resizers are used with the keyboard, they're focusable, hence\n // we want to have them in this order (top left, top middle, top right, ...)\n // in the DOM to have the focus order correct.\n const classes = this._willKeepAspectRatio\n ? [\"topLeft\", \"topRight\", \"bottomRight\", \"bottomLeft\"]\n : [\n \"topLeft\",\n \"topMiddle\",\n \"topRight\",\n \"middleRight\",\n \"bottomRight\",\n \"bottomMiddle\",\n \"bottomLeft\",\n \"middleLeft\",\n ];\n for (const name of classes) {\n const div = document.createElement(\"div\");\n this.#resizersDiv.append(div);\n div.classList.add(\"resizer\", name);\n div.setAttribute(\"data-resizer-name\", name);\n div.addEventListener(\n \"pointerdown\",\n this.#resizerPointerdown.bind(this, name)\n );\n div.addEventListener(\"contextmenu\", noContextMenu);\n div.tabIndex = -1;\n }\n this.div.prepend(this.#resizersDiv);\n }\n\n #resizerPointerdown(name, event) {\n event.preventDefault();\n const { isMac } = FeatureTest.platform;\n if (event.button !== 0 || (event.ctrlKey && isMac)) {\n return;\n }\n\n this.#altText?.toggle(false);\n\n const boundResizerPointermove = this.#resizerPointermove.bind(this, name);\n const savedDraggable = this._isDraggable;\n this._isDraggable = false;\n const pointerMoveOptions = { passive: true, capture: true };\n this.parent.togglePointerEvents(false);\n window.addEventListener(\n \"pointermove\",\n boundResizerPointermove,\n pointerMoveOptions\n );\n window.addEventListener(\"contextmenu\", noContextMenu);\n const savedX = this.x;\n const savedY = this.y;\n const savedWidth = this.width;\n const savedHeight = this.height;\n const savedParentCursor = this.parent.div.style.cursor;\n const savedCursor = this.div.style.cursor;\n this.div.style.cursor = this.parent.div.style.cursor =\n window.getComputedStyle(event.target).cursor;\n\n const pointerUpCallback = () => {\n this.parent.togglePointerEvents(true);\n this.#altText?.toggle(true);\n this._isDraggable = savedDraggable;\n window.removeEventListener(\"pointerup\", pointerUpCallback);\n window.removeEventListener(\"blur\", pointerUpCallback);\n window.removeEventListener(\n \"pointermove\",\n boundResizerPointermove,\n pointerMoveOptions\n );\n window.removeEventListener(\"contextmenu\", noContextMenu);\n this.parent.div.style.cursor = savedParentCursor;\n this.div.style.cursor = savedCursor;\n\n this.#addResizeToUndoStack(savedX, savedY, savedWidth, savedHeight);\n };\n window.addEventListener(\"pointerup\", pointerUpCallback);\n // If the user switches to another window (with alt+tab), then we end the\n // resize session.\n window.addEventListener(\"blur\", pointerUpCallback);\n }\n\n #addResizeToUndoStack(savedX, savedY, savedWidth, savedHeight) {\n const newX = this.x;\n const newY = this.y;\n const newWidth = this.width;\n const newHeight = this.height;\n if (\n newX === savedX &&\n newY === savedY &&\n newWidth === savedWidth &&\n newHeight === savedHeight\n ) {\n return;\n }\n\n this.addCommands({\n cmd: () => {\n this.width = newWidth;\n this.height = newHeight;\n this.x = newX;\n this.y = newY;\n const [parentWidth, parentHeight] = this.parentDimensions;\n this.setDims(parentWidth * newWidth, parentHeight * newHeight);\n this.fixAndSetPosition();\n },\n undo: () => {\n this.width = savedWidth;\n this.height = savedHeight;\n this.x = savedX;\n this.y = savedY;\n const [parentWidth, parentHeight] = this.parentDimensions;\n this.setDims(parentWidth * savedWidth, parentHeight * savedHeight);\n this.fixAndSetPosition();\n },\n mustExec: true,\n });\n }\n\n #resizerPointermove(name, event) {\n const [parentWidth, parentHeight] = this.parentDimensions;\n const savedX = this.x;\n const savedY = this.y;\n const savedWidth = this.width;\n const savedHeight = this.height;\n const minWidth = AnnotationEditor.MIN_SIZE / parentWidth;\n const minHeight = AnnotationEditor.MIN_SIZE / parentHeight;\n\n // 10000 because we multiply by 100 and use toFixed(2) in fixAndSetPosition.\n // Without rounding, the positions of the corners other than the top left\n // one can be slightly wrong.\n const round = x => Math.round(x * 10000) / 10000;\n const rotationMatrix = this.#getRotationMatrix(this.rotation);\n const transf = (x, y) => [\n rotationMatrix[0] * x + rotationMatrix[2] * y,\n rotationMatrix[1] * x + rotationMatrix[3] * y,\n ];\n const invRotationMatrix = this.#getRotationMatrix(360 - this.rotation);\n const invTransf = (x, y) => [\n invRotationMatrix[0] * x + invRotationMatrix[2] * y,\n invRotationMatrix[1] * x + invRotationMatrix[3] * y,\n ];\n let getPoint;\n let getOpposite;\n let isDiagonal = false;\n let isHorizontal = false;\n\n switch (name) {\n case \"topLeft\":\n isDiagonal = true;\n getPoint = (w, h) => [0, 0];\n getOpposite = (w, h) => [w, h];\n break;\n case \"topMiddle\":\n getPoint = (w, h) => [w / 2, 0];\n getOpposite = (w, h) => [w / 2, h];\n break;\n case \"topRight\":\n isDiagonal = true;\n getPoint = (w, h) => [w, 0];\n getOpposite = (w, h) => [0, h];\n break;\n case \"middleRight\":\n isHorizontal = true;\n getPoint = (w, h) => [w, h / 2];\n getOpposite = (w, h) => [0, h / 2];\n break;\n case \"bottomRight\":\n isDiagonal = true;\n getPoint = (w, h) => [w, h];\n getOpposite = (w, h) => [0, 0];\n break;\n case \"bottomMiddle\":\n getPoint = (w, h) => [w / 2, h];\n getOpposite = (w, h) => [w / 2, 0];\n break;\n case \"bottomLeft\":\n isDiagonal = true;\n getPoint = (w, h) => [0, h];\n getOpposite = (w, h) => [w, 0];\n break;\n case \"middleLeft\":\n isHorizontal = true;\n getPoint = (w, h) => [0, h / 2];\n getOpposite = (w, h) => [w, h / 2];\n break;\n }\n\n const point = getPoint(savedWidth, savedHeight);\n const oppositePoint = getOpposite(savedWidth, savedHeight);\n let transfOppositePoint = transf(...oppositePoint);\n const oppositeX = round(savedX + transfOppositePoint[0]);\n const oppositeY = round(savedY + transfOppositePoint[1]);\n let ratioX = 1;\n let ratioY = 1;\n\n let [deltaX, deltaY] = this.screenToPageTranslation(\n event.movementX,\n event.movementY\n );\n [deltaX, deltaY] = invTransf(deltaX / parentWidth, deltaY / parentHeight);\n\n if (isDiagonal) {\n const oldDiag = Math.hypot(savedWidth, savedHeight);\n ratioX = ratioY = Math.max(\n Math.min(\n Math.hypot(\n oppositePoint[0] - point[0] - deltaX,\n oppositePoint[1] - point[1] - deltaY\n ) / oldDiag,\n // Avoid the editor to be larger than the page.\n 1 / savedWidth,\n 1 / savedHeight\n ),\n // Avoid the editor to be smaller than the minimum size.\n minWidth / savedWidth,\n minHeight / savedHeight\n );\n } else if (isHorizontal) {\n ratioX =\n Math.max(\n minWidth,\n Math.min(1, Math.abs(oppositePoint[0] - point[0] - deltaX))\n ) / savedWidth;\n } else {\n ratioY =\n Math.max(\n minHeight,\n Math.min(1, Math.abs(oppositePoint[1] - point[1] - deltaY))\n ) / savedHeight;\n }\n\n const newWidth = round(savedWidth * ratioX);\n const newHeight = round(savedHeight * ratioY);\n transfOppositePoint = transf(...getOpposite(newWidth, newHeight));\n const newX = oppositeX - transfOppositePoint[0];\n const newY = oppositeY - transfOppositePoint[1];\n\n this.width = newWidth;\n this.height = newHeight;\n this.x = newX;\n this.y = newY;\n\n this.setDims(parentWidth * newWidth, parentHeight * newHeight);\n this.fixAndSetPosition();\n }\n\n altTextFinish() {\n this.#altText?.finish();\n }\n\n /**\n * Add a toolbar for this editor.\n * @returns {Promise}\n */\n async addEditToolbar() {\n if (this.#editToolbar || this.#isInEditMode) {\n return this.#editToolbar;\n }\n this.#editToolbar = new EditorToolbar(this);\n this.div.append(this.#editToolbar.render());\n if (this.#altText) {\n this.#editToolbar.addAltTextButton(await this.#altText.render());\n }\n\n return this.#editToolbar;\n }\n\n removeEditToolbar() {\n if (!this.#editToolbar) {\n return;\n }\n this.#editToolbar.remove();\n this.#editToolbar = null;\n\n // We destroy the alt text but we don't null it because we want to be able\n // to restore it in case the user undoes the deletion.\n this.#altText?.destroy();\n }\n\n getClientDimensions() {\n return this.div.getBoundingClientRect();\n }\n\n async addAltTextButton() {\n if (this.#altText) {\n return;\n }\n AltText.initialize(AnnotationEditor._l10nPromise);\n this.#altText = new AltText(this);\n await this.addEditToolbar();\n }\n\n get altTextData() {\n return this.#altText?.data;\n }\n\n /**\n * Set the alt text data.\n */\n set altTextData(data) {\n if (!this.#altText) {\n return;\n }\n this.#altText.data = data;\n }\n\n hasAltText() {\n return !this.#altText?.isEmpty();\n }\n\n /**\n * Render this editor in a div.\n * @returns {HTMLDivElement | null}\n */\n render() {\n this.div = document.createElement(\"div\");\n this.div.setAttribute(\"data-editor-rotation\", (360 - this.rotation) % 360);\n this.div.className = this.name;\n this.div.setAttribute(\"id\", this.id);\n this.div.tabIndex = this.#disabled ? -1 : 0;\n if (!this._isVisible) {\n this.div.classList.add(\"hidden\");\n }\n\n this.setInForeground();\n\n this.div.addEventListener(\"focusin\", this.#boundFocusin);\n this.div.addEventListener(\"focusout\", this.#boundFocusout);\n\n const [parentWidth, parentHeight] = this.parentDimensions;\n if (this.parentRotation % 180 !== 0) {\n this.div.style.maxWidth = `${((100 * parentHeight) / parentWidth).toFixed(\n 2\n )}%`;\n this.div.style.maxHeight = `${(\n (100 * parentWidth) /\n parentHeight\n ).toFixed(2)}%`;\n }\n\n const [tx, ty] = this.getInitialTranslation();\n this.translate(tx, ty);\n\n bindEvents(this, this.div, [\"pointerdown\"]);\n\n return this.div;\n }\n\n /**\n * Onpointerdown callback.\n * @param {PointerEvent} event\n */\n pointerdown(event) {\n const { isMac } = FeatureTest.platform;\n if (event.button !== 0 || (event.ctrlKey && isMac)) {\n // Avoid to focus this editor because of a non-left click.\n event.preventDefault();\n return;\n }\n\n this.#hasBeenClicked = true;\n\n if (this._isDraggable) {\n this.#setUpDragSession(event);\n return;\n }\n\n this.#selectOnPointerEvent(event);\n }\n\n #selectOnPointerEvent(event) {\n const { isMac } = FeatureTest.platform;\n if (\n (event.ctrlKey && !isMac) ||\n event.shiftKey ||\n (event.metaKey && isMac)\n ) {\n this.parent.toggleSelected(this);\n } else {\n this.parent.setSelected(this);\n }\n }\n\n #setUpDragSession(event) {\n const isSelected = this._uiManager.isSelected(this);\n this._uiManager.setUpDragSession();\n\n let pointerMoveOptions, pointerMoveCallback;\n if (isSelected) {\n this.div.classList.add(\"moving\");\n pointerMoveOptions = { passive: true, capture: true };\n this.#prevDragX = event.clientX;\n this.#prevDragY = event.clientY;\n pointerMoveCallback = e => {\n const { clientX: x, clientY: y } = e;\n const [tx, ty] = this.screenToPageTranslation(\n x - this.#prevDragX,\n y - this.#prevDragY\n );\n this.#prevDragX = x;\n this.#prevDragY = y;\n this._uiManager.dragSelectedEditors(tx, ty);\n };\n window.addEventListener(\n \"pointermove\",\n pointerMoveCallback,\n pointerMoveOptions\n );\n }\n\n const pointerUpCallback = () => {\n window.removeEventListener(\"pointerup\", pointerUpCallback);\n window.removeEventListener(\"blur\", pointerUpCallback);\n if (isSelected) {\n this.div.classList.remove(\"moving\");\n window.removeEventListener(\n \"pointermove\",\n pointerMoveCallback,\n pointerMoveOptions\n );\n }\n\n this.#hasBeenClicked = false;\n if (!this._uiManager.endDragSession()) {\n this.#selectOnPointerEvent(event);\n }\n };\n window.addEventListener(\"pointerup\", pointerUpCallback);\n // If the user is using alt+tab during the dragging session, the pointerup\n // event could be not fired, but a blur event is fired so we can use it in\n // order to interrupt the dragging session.\n window.addEventListener(\"blur\", pointerUpCallback);\n }\n\n moveInDOM() {\n // Moving the editor in the DOM can be expensive, so we wait a bit before.\n // It's important to not block the UI (for example when changing the font\n // size in a FreeText).\n if (this.#moveInDOMTimeout) {\n clearTimeout(this.#moveInDOMTimeout);\n }\n this.#moveInDOMTimeout = setTimeout(() => {\n this.#moveInDOMTimeout = null;\n this.parent?.moveEditorInDOM(this);\n }, 0);\n }\n\n _setParentAndPosition(parent, x, y) {\n parent.changeParent(this);\n this.x = x;\n this.y = y;\n this.fixAndSetPosition();\n }\n\n /**\n * Convert the current rect into a page one.\n * @param {number} tx - x-translation in screen coordinates.\n * @param {number} ty - y-translation in screen coordinates.\n * @param {number} [rotation] - the rotation of the page.\n */\n getRect(tx, ty, rotation = this.rotation) {\n const scale = this.parentScale;\n const [pageWidth, pageHeight] = this.pageDimensions;\n const [pageX, pageY] = this.pageTranslation;\n const shiftX = tx / scale;\n const shiftY = ty / scale;\n const x = this.x * pageWidth;\n const y = this.y * pageHeight;\n const width = this.width * pageWidth;\n const height = this.height * pageHeight;\n\n switch (rotation) {\n case 0:\n return [\n x + shiftX + pageX,\n pageHeight - y - shiftY - height + pageY,\n x + shiftX + width + pageX,\n pageHeight - y - shiftY + pageY,\n ];\n case 90:\n return [\n x + shiftY + pageX,\n pageHeight - y + shiftX + pageY,\n x + shiftY + height + pageX,\n pageHeight - y + shiftX + width + pageY,\n ];\n case 180:\n return [\n x - shiftX - width + pageX,\n pageHeight - y + shiftY + pageY,\n x - shiftX + pageX,\n pageHeight - y + shiftY + height + pageY,\n ];\n case 270:\n return [\n x - shiftY - height + pageX,\n pageHeight - y - shiftX - width + pageY,\n x - shiftY + pageX,\n pageHeight - y - shiftX + pageY,\n ];\n default:\n throw new Error(\"Invalid rotation\");\n }\n }\n\n getRectInCurrentCoords(rect, pageHeight) {\n const [x1, y1, x2, y2] = rect;\n\n const width = x2 - x1;\n const height = y2 - y1;\n\n switch (this.rotation) {\n case 0:\n return [x1, pageHeight - y2, width, height];\n case 90:\n return [x1, pageHeight - y1, height, width];\n case 180:\n return [x2, pageHeight - y1, width, height];\n case 270:\n return [x2, pageHeight - y2, height, width];\n default:\n throw new Error(\"Invalid rotation\");\n }\n }\n\n /**\n * Executed once this editor has been rendered.\n */\n onceAdded() {}\n\n /**\n * Check if the editor contains something.\n * @returns {boolean}\n */\n isEmpty() {\n return false;\n }\n\n /**\n * Enable edit mode.\n */\n enableEditMode() {\n this.#isInEditMode = true;\n }\n\n /**\n * Disable edit mode.\n */\n disableEditMode() {\n this.#isInEditMode = false;\n }\n\n /**\n * Check if the editor is edited.\n * @returns {boolean}\n */\n isInEditMode() {\n return this.#isInEditMode;\n }\n\n /**\n * If it returns true, then this editor handles the keyboard\n * events itself.\n * @returns {boolean}\n */\n shouldGetKeyboardEvents() {\n return this.#isResizerEnabledForKeyboard;\n }\n\n /**\n * Check if this editor needs to be rebuilt or not.\n * @returns {boolean}\n */\n needsToBeRebuilt() {\n return this.div && !this.isAttachedToDOM;\n }\n\n /**\n * Rebuild the editor in case it has been removed on undo.\n *\n * To implement in subclasses.\n */\n rebuild() {\n this.div?.addEventListener(\"focusin\", this.#boundFocusin);\n this.div?.addEventListener(\"focusout\", this.#boundFocusout);\n }\n\n /**\n * Rotate the editor.\n * @param {number} angle\n */\n rotate(_angle) {}\n\n /**\n * Serialize the editor.\n * The result of the serialization will be used to construct a\n * new annotation to add to the pdf document.\n *\n * To implement in subclasses.\n * @param {boolean} [isForCopying]\n * @param {Object | null} [context]\n * @returns {Object | null}\n */\n serialize(isForCopying = false, context = null) {\n unreachable(\"An editor must be serializable\");\n }\n\n /**\n * Deserialize the editor.\n * The result of the deserialization is a new editor.\n *\n * @param {Object} data\n * @param {AnnotationEditorLayer} parent\n * @param {AnnotationEditorUIManager} uiManager\n * @returns {AnnotationEditor | null}\n */\n static deserialize(data, parent, uiManager) {\n const editor = new this.prototype.constructor({\n parent,\n id: parent.getNextId(),\n uiManager,\n });\n editor.rotation = data.rotation;\n\n const [pageWidth, pageHeight] = editor.pageDimensions;\n const [x, y, width, height] = editor.getRectInCurrentCoords(\n data.rect,\n pageHeight\n );\n editor.x = x / pageWidth;\n editor.y = y / pageHeight;\n editor.width = width / pageWidth;\n editor.height = height / pageHeight;\n\n return editor;\n }\n\n /**\n * Check if an existing annotation associated with this editor has been\n * modified.\n * @returns {boolean}\n */\n get hasBeenModified() {\n return (\n !!this.annotationElementId && (this.deleted || this.serialize() !== null)\n );\n }\n\n /**\n * Remove this editor.\n * It's used on ctrl+backspace action.\n */\n remove() {\n this.div.removeEventListener(\"focusin\", this.#boundFocusin);\n this.div.removeEventListener(\"focusout\", this.#boundFocusout);\n\n if (!this.isEmpty()) {\n // The editor is removed but it can be back at some point thanks to\n // undo/redo so we must commit it before.\n this.commit();\n }\n if (this.parent) {\n this.parent.remove(this);\n } else {\n this._uiManager.removeEditor(this);\n }\n\n if (this.#moveInDOMTimeout) {\n clearTimeout(this.#moveInDOMTimeout);\n this.#moveInDOMTimeout = null;\n }\n this.#stopResizing();\n this.removeEditToolbar();\n if (this.#telemetryTimeouts) {\n for (const timeout of this.#telemetryTimeouts.values()) {\n clearTimeout(timeout);\n }\n this.#telemetryTimeouts = null;\n }\n this.parent = null;\n }\n\n /**\n * @returns {boolean} true if this editor can be resized.\n */\n get isResizable() {\n return false;\n }\n\n /**\n * Add the resizers to this editor.\n */\n makeResizable() {\n if (this.isResizable) {\n this.#createResizers();\n this.#resizersDiv.classList.remove(\"hidden\");\n bindEvents(this, this.div, [\"keydown\"]);\n }\n }\n\n get toolbarPosition() {\n return null;\n }\n\n /**\n * onkeydown callback.\n * @param {KeyboardEvent} event\n */\n keydown(event) {\n if (\n !this.isResizable ||\n event.target !== this.div ||\n event.key !== \"Enter\"\n ) {\n return;\n }\n this._uiManager.setSelected(this);\n this.#savedDimensions = {\n savedX: this.x,\n savedY: this.y,\n savedWidth: this.width,\n savedHeight: this.height,\n };\n const children = this.#resizersDiv.children;\n if (!this.#allResizerDivs) {\n this.#allResizerDivs = Array.from(children);\n const boundResizerKeydown = this.#resizerKeydown.bind(this);\n const boundResizerBlur = this.#resizerBlur.bind(this);\n for (const div of this.#allResizerDivs) {\n const name = div.getAttribute(\"data-resizer-name\");\n div.setAttribute(\"role\", \"spinbutton\");\n div.addEventListener(\"keydown\", boundResizerKeydown);\n div.addEventListener(\"blur\", boundResizerBlur);\n div.addEventListener(\"focus\", this.#resizerFocus.bind(this, name));\n AnnotationEditor._l10nPromise\n .get(`pdfjs-editor-resizer-label-${name}`)\n .then(msg => div.setAttribute(\"aria-label\", msg));\n }\n }\n\n // We want to have the resizers in the visual order, so we move the first\n // (top-left) to the right place.\n const first = this.#allResizerDivs[0];\n let firstPosition = 0;\n for (const div of children) {\n if (div === first) {\n break;\n }\n firstPosition++;\n }\n const nextFirstPosition =\n (((360 - this.rotation + this.parentRotation) % 360) / 90) *\n (this.#allResizerDivs.length / 4);\n\n if (nextFirstPosition !== firstPosition) {\n // We need to reorder the resizers in the DOM in order to have the focus\n // on the top-left one.\n if (nextFirstPosition < firstPosition) {\n for (let i = 0; i < firstPosition - nextFirstPosition; i++) {\n this.#resizersDiv.append(this.#resizersDiv.firstChild);\n }\n } else if (nextFirstPosition > firstPosition) {\n for (let i = 0; i < nextFirstPosition - firstPosition; i++) {\n this.#resizersDiv.firstChild.before(this.#resizersDiv.lastChild);\n }\n }\n\n let i = 0;\n for (const child of children) {\n const div = this.#allResizerDivs[i++];\n const name = div.getAttribute(\"data-resizer-name\");\n AnnotationEditor._l10nPromise\n .get(`pdfjs-editor-resizer-label-${name}`)\n .then(msg => child.setAttribute(\"aria-label\", msg));\n }\n }\n\n this.#setResizerTabIndex(0);\n this.#isResizerEnabledForKeyboard = true;\n this.#resizersDiv.firstChild.focus({ focusVisible: true });\n event.preventDefault();\n event.stopImmediatePropagation();\n }\n\n #resizerKeydown(event) {\n AnnotationEditor._resizerKeyboardManager.exec(this, event);\n }\n\n #resizerBlur(event) {\n if (\n this.#isResizerEnabledForKeyboard &&\n event.relatedTarget?.parentNode !== this.#resizersDiv\n ) {\n this.#stopResizing();\n }\n }\n\n #resizerFocus(name) {\n this.#focusedResizerName = this.#isResizerEnabledForKeyboard ? name : \"\";\n }\n\n #setResizerTabIndex(value) {\n if (!this.#allResizerDivs) {\n return;\n }\n for (const div of this.#allResizerDivs) {\n div.tabIndex = value;\n }\n }\n\n _resizeWithKeyboard(x, y) {\n if (!this.#isResizerEnabledForKeyboard) {\n return;\n }\n this.#resizerPointermove(this.#focusedResizerName, {\n movementX: x,\n movementY: y,\n });\n }\n\n #stopResizing() {\n this.#isResizerEnabledForKeyboard = false;\n this.#setResizerTabIndex(-1);\n if (this.#savedDimensions) {\n const { savedX, savedY, savedWidth, savedHeight } = this.#savedDimensions;\n this.#addResizeToUndoStack(savedX, savedY, savedWidth, savedHeight);\n this.#savedDimensions = null;\n }\n }\n\n _stopResizingWithKeyboard() {\n this.#stopResizing();\n this.div.focus();\n }\n\n /**\n * Select this editor.\n */\n select() {\n this.makeResizable();\n this.div?.classList.add(\"selectedEditor\");\n if (!this.#editToolbar) {\n this.addEditToolbar().then(() => {\n if (this.div?.classList.contains(\"selectedEditor\")) {\n // The editor can have been unselected while we were waiting for the\n // edit toolbar to be created, hence we want to be sure that this\n // editor is still selected.\n this.#editToolbar?.show();\n }\n });\n return;\n }\n this.#editToolbar?.show();\n }\n\n /**\n * Unselect this editor.\n */\n unselect() {\n this.#resizersDiv?.classList.add(\"hidden\");\n this.div?.classList.remove(\"selectedEditor\");\n if (this.div?.contains(document.activeElement)) {\n // Don't use this.div.blur() because we don't know where the focus will\n // go.\n this._uiManager.currentLayer.div.focus({\n preventScroll: true,\n });\n }\n this.#editToolbar?.hide();\n }\n\n /**\n * Update some parameters which have been changed through the UI.\n * @param {number} type\n * @param {*} value\n */\n updateParams(type, value) {}\n\n /**\n * When the user disables the editing mode some editors can change some of\n * their properties.\n */\n disableEditing() {}\n\n /**\n * When the user enables the editing mode some editors can change some of\n * their properties.\n */\n enableEditing() {}\n\n /**\n * The editor is about to be edited.\n */\n enterInEditMode() {}\n\n /**\n * @returns {HTMLElement | null} the element requiring an alt text.\n */\n getImageForAltText() {\n return null;\n }\n\n /**\n * Get the div which really contains the displayed content.\n * @returns {HTMLDivElement | undefined}\n */\n get contentDiv() {\n return this.div;\n }\n\n /**\n * If true then the editor is currently edited.\n * @type {boolean}\n */\n get isEditing() {\n return this.#isEditing;\n }\n\n /**\n * When set to true, it means that this editor is currently edited.\n * @param {boolean} value\n */\n set isEditing(value) {\n this.#isEditing = value;\n if (!this.parent) {\n return;\n }\n if (value) {\n this.parent.setSelected(this);\n this.parent.setActiveEditor(this);\n } else {\n this.parent.setActiveEditor(null);\n }\n }\n\n /**\n * Set the aspect ratio to use when resizing.\n * @param {number} width\n * @param {number} height\n */\n setAspectRatio(width, height) {\n this.#keepAspectRatio = true;\n const aspectRatio = width / height;\n const { style } = this.div;\n style.aspectRatio = aspectRatio;\n style.height = \"auto\";\n }\n\n static get MIN_SIZE() {\n return 16;\n }\n\n static canCreateNewEmptyEditor() {\n return true;\n }\n\n /**\n * Get the data to report to the telemetry when the editor is added.\n * @returns {Object}\n */\n get telemetryInitialData() {\n return { action: \"added\" };\n }\n\n /**\n * The telemetry data to use when saving/printing.\n * @returns {Object|null}\n */\n get telemetryFinalData() {\n return null;\n }\n\n _reportTelemetry(data, mustWait = false) {\n if (mustWait) {\n this.#telemetryTimeouts ||= new Map();\n const { action } = data;\n let timeout = this.#telemetryTimeouts.get(action);\n if (timeout) {\n clearTimeout(timeout);\n }\n timeout = setTimeout(() => {\n this._reportTelemetry(data);\n this.#telemetryTimeouts.delete(action);\n if (this.#telemetryTimeouts.size === 0) {\n this.#telemetryTimeouts = null;\n }\n }, AnnotationEditor._telemetryTimeout);\n this.#telemetryTimeouts.set(action, timeout);\n return;\n }\n data.type ||= this.editorType;\n this._uiManager._eventBus.dispatch(\"reporttelemetry\", {\n source: this,\n details: {\n type: \"editing\",\n data,\n },\n });\n }\n\n /**\n * Show or hide this editor.\n * @param {boolean|undefined} visible\n */\n show(visible = this._isVisible) {\n this.div.classList.toggle(\"hidden\", !visible);\n this._isVisible = visible;\n }\n\n enable() {\n if (this.div) {\n this.div.tabIndex = 0;\n }\n this.#disabled = false;\n }\n\n disable() {\n if (this.div) {\n this.div.tabIndex = -1;\n }\n this.#disabled = true;\n }\n\n /**\n * Render an annotation in the annotation layer.\n * @param {Object} annotation\n * @returns {HTMLElement}\n */\n renderAnnotationElement(annotation) {\n let content = annotation.container.querySelector(\".annotationContent\");\n if (!content) {\n content = document.createElement(\"div\");\n content.classList.add(\"annotationContent\", this.editorType);\n annotation.container.prepend(content);\n } else if (content.nodeName === \"CANVAS\") {\n const canvas = content;\n content = document.createElement(\"div\");\n content.classList.add(\"annotationContent\", this.editorType);\n canvas.before(content);\n }\n\n return content;\n }\n\n resetAnnotationElement(annotation) {\n const { firstChild } = annotation.container;\n if (\n firstChild.nodeName === \"DIV\" &&\n firstChild.classList.contains(\"annotationContent\")\n ) {\n firstChild.remove();\n }\n }\n}\n\n// This class is used to fake an editor which has been deleted.\nclass FakeEditor extends AnnotationEditor {\n constructor(params) {\n super(params);\n this.annotationElementId = params.annotationElementId;\n this.deleted = true;\n }\n\n serialize() {\n return {\n id: this.annotationElementId,\n deleted: true,\n pageIndex: this.pageIndex,\n };\n }\n}\n\nexport { AnnotationEditor };\n","/* Copyright 2014 Opera Software ASA\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 *\n * Based on https://code.google.com/p/smhasher/wiki/MurmurHash3.\n * Hashes roughly 100 KB per millisecond on i7 3.4 GHz.\n */\n\nconst SEED = 0xc3d2e1f0;\n// Workaround for missing math precision in JS.\nconst MASK_HIGH = 0xffff0000;\nconst MASK_LOW = 0xffff;\n\nclass MurmurHash3_64 {\n constructor(seed) {\n this.h1 = seed ? seed & 0xffffffff : SEED;\n this.h2 = seed ? seed & 0xffffffff : SEED;\n }\n\n update(input) {\n let data, length;\n if (typeof input === \"string\") {\n data = new Uint8Array(input.length * 2);\n length = 0;\n for (let i = 0, ii = input.length; i < ii; i++) {\n const code = input.charCodeAt(i);\n if (code <= 0xff) {\n data[length++] = code;\n } else {\n data[length++] = code >>> 8;\n data[length++] = code & 0xff;\n }\n }\n } else if (ArrayBuffer.isView(input)) {\n data = input.slice();\n length = data.byteLength;\n } else {\n throw new Error(\"Invalid data format, must be a string or TypedArray.\");\n }\n\n const blockCounts = length >> 2;\n const tailLength = length - blockCounts * 4;\n // We don't care about endianness here.\n const dataUint32 = new Uint32Array(data.buffer, 0, blockCounts);\n let k1 = 0,\n k2 = 0;\n let h1 = this.h1,\n h2 = this.h2;\n const C1 = 0xcc9e2d51,\n C2 = 0x1b873593;\n const C1_LOW = C1 & MASK_LOW,\n C2_LOW = C2 & MASK_LOW;\n\n for (let i = 0; i < blockCounts; i++) {\n if (i & 1) {\n k1 = dataUint32[i];\n k1 = ((k1 * C1) & MASK_HIGH) | ((k1 * C1_LOW) & MASK_LOW);\n k1 = (k1 << 15) | (k1 >>> 17);\n k1 = ((k1 * C2) & MASK_HIGH) | ((k1 * C2_LOW) & MASK_LOW);\n h1 ^= k1;\n h1 = (h1 << 13) | (h1 >>> 19);\n h1 = h1 * 5 + 0xe6546b64;\n } else {\n k2 = dataUint32[i];\n k2 = ((k2 * C1) & MASK_HIGH) | ((k2 * C1_LOW) & MASK_LOW);\n k2 = (k2 << 15) | (k2 >>> 17);\n k2 = ((k2 * C2) & MASK_HIGH) | ((k2 * C2_LOW) & MASK_LOW);\n h2 ^= k2;\n h2 = (h2 << 13) | (h2 >>> 19);\n h2 = h2 * 5 + 0xe6546b64;\n }\n }\n\n k1 = 0;\n\n switch (tailLength) {\n case 3:\n k1 ^= data[blockCounts * 4 + 2] << 16;\n /* falls through */\n case 2:\n k1 ^= data[blockCounts * 4 + 1] << 8;\n /* falls through */\n case 1:\n k1 ^= data[blockCounts * 4];\n /* falls through */\n\n k1 = ((k1 * C1) & MASK_HIGH) | ((k1 * C1_LOW) & MASK_LOW);\n k1 = (k1 << 15) | (k1 >>> 17);\n k1 = ((k1 * C2) & MASK_HIGH) | ((k1 * C2_LOW) & MASK_LOW);\n if (blockCounts & 1) {\n h1 ^= k1;\n } else {\n h2 ^= k1;\n }\n }\n\n this.h1 = h1;\n this.h2 = h2;\n }\n\n hexdigest() {\n let h1 = this.h1,\n h2 = this.h2;\n\n h1 ^= h2 >>> 1;\n h1 = ((h1 * 0xed558ccd) & MASK_HIGH) | ((h1 * 0x8ccd) & MASK_LOW);\n h2 =\n ((h2 * 0xff51afd7) & MASK_HIGH) |\n (((((h2 << 16) | (h1 >>> 16)) * 0xafd7ed55) & MASK_HIGH) >>> 16);\n h1 ^= h2 >>> 1;\n h1 = ((h1 * 0x1a85ec53) & MASK_HIGH) | ((h1 * 0xec53) & MASK_LOW);\n h2 =\n ((h2 * 0xc4ceb9fe) & MASK_HIGH) |\n (((((h2 << 16) | (h1 >>> 16)) * 0xb9fe1a85) & MASK_HIGH) >>> 16);\n h1 ^= h2 >>> 1;\n\n return (\n (h1 >>> 0).toString(16).padStart(8, \"0\") +\n (h2 >>> 0).toString(16).padStart(8, \"0\")\n );\n }\n}\n\nexport { MurmurHash3_64 };\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\nimport { objectFromMap, unreachable } from \"../shared/util.js\";\nimport { AnnotationEditor } from \"./editor/editor.js\";\nimport { MurmurHash3_64 } from \"../shared/murmurhash3.js\";\n\nconst SerializableEmpty = Object.freeze({\n map: null,\n hash: \"\",\n transfer: undefined,\n});\n\n/**\n * Key/value storage for annotation data in forms.\n */\nclass AnnotationStorage {\n #modified = false;\n\n #storage = new Map();\n\n constructor() {\n // Callbacks to signal when the modification state is set or reset.\n // This is used by the viewer to only bind on `beforeunload` if forms\n // are actually edited to prevent doing so unconditionally since that\n // can have undesirable effects.\n this.onSetModified = null;\n this.onResetModified = null;\n this.onAnnotationEditor = null;\n }\n\n /**\n * Get the value for a given key if it exists, or return the default value.\n * @param {string} key\n * @param {Object} defaultValue\n * @returns {Object}\n */\n getValue(key, defaultValue) {\n const value = this.#storage.get(key);\n if (value === undefined) {\n return defaultValue;\n }\n\n return Object.assign(defaultValue, value);\n }\n\n /**\n * Get the value for a given key.\n * @param {string} key\n * @returns {Object}\n */\n getRawValue(key) {\n return this.#storage.get(key);\n }\n\n /**\n * Remove a value from the storage.\n * @param {string} key\n */\n remove(key) {\n this.#storage.delete(key);\n\n if (this.#storage.size === 0) {\n this.resetModified();\n }\n\n if (typeof this.onAnnotationEditor === \"function\") {\n for (const value of this.#storage.values()) {\n if (value instanceof AnnotationEditor) {\n return;\n }\n }\n this.onAnnotationEditor(null);\n }\n }\n\n /**\n * Set the value for a given key\n * @param {string} key\n * @param {Object} value\n */\n setValue(key, value) {\n const obj = this.#storage.get(key);\n let modified = false;\n if (obj !== undefined) {\n for (const [entry, val] of Object.entries(value)) {\n if (obj[entry] !== val) {\n modified = true;\n obj[entry] = val;\n }\n }\n } else {\n modified = true;\n this.#storage.set(key, value);\n }\n if (modified) {\n this.#setModified();\n }\n\n if (\n value instanceof AnnotationEditor &&\n typeof this.onAnnotationEditor === \"function\"\n ) {\n this.onAnnotationEditor(value.constructor._type);\n }\n }\n\n /**\n * Check if the storage contains the given key.\n * @param {string} key\n * @returns {boolean}\n */\n has(key) {\n return this.#storage.has(key);\n }\n\n /**\n * @returns {Object | null}\n */\n getAll() {\n return this.#storage.size > 0 ? objectFromMap(this.#storage) : null;\n }\n\n /**\n * @param {Object} obj\n */\n setAll(obj) {\n for (const [key, val] of Object.entries(obj)) {\n this.setValue(key, val);\n }\n }\n\n get size() {\n return this.#storage.size;\n }\n\n #setModified() {\n if (!this.#modified) {\n this.#modified = true;\n if (typeof this.onSetModified === \"function\") {\n this.onSetModified();\n }\n }\n }\n\n resetModified() {\n if (this.#modified) {\n this.#modified = false;\n if (typeof this.onResetModified === \"function\") {\n this.onResetModified();\n }\n }\n }\n\n /**\n * @returns {PrintAnnotationStorage}\n */\n get print() {\n return new PrintAnnotationStorage(this);\n }\n\n /**\n * PLEASE NOTE: Only intended for usage within the API itself.\n * @ignore\n */\n get serializable() {\n if (this.#storage.size === 0) {\n return SerializableEmpty;\n }\n const map = new Map(),\n hash = new MurmurHash3_64(),\n transfer = [];\n const context = Object.create(null);\n let hasBitmap = false;\n\n for (const [key, val] of this.#storage) {\n const serialized =\n val instanceof AnnotationEditor\n ? val.serialize(/* isForCopying = */ false, context)\n : val;\n if (serialized) {\n map.set(key, serialized);\n\n hash.update(`${key}:${JSON.stringify(serialized)}`);\n hasBitmap ||= !!serialized.bitmap;\n }\n }\n\n if (hasBitmap) {\n // We must transfer the bitmap data separately, since it can be changed\n // during serialization with SVG images.\n for (const value of map.values()) {\n if (value.bitmap) {\n transfer.push(value.bitmap);\n }\n }\n }\n\n return map.size > 0\n ? { map, hash: hash.hexdigest(), transfer }\n : SerializableEmpty;\n }\n\n get editorStats() {\n let stats = null;\n const typeToEditor = new Map();\n for (const value of this.#storage.values()) {\n if (!(value instanceof AnnotationEditor)) {\n continue;\n }\n const editorStats = value.telemetryFinalData;\n if (!editorStats) {\n continue;\n }\n const { type } = editorStats;\n if (!typeToEditor.has(type)) {\n typeToEditor.set(type, Object.getPrototypeOf(value).constructor);\n }\n stats ||= Object.create(null);\n const map = (stats[type] ||= new Map());\n for (const [key, val] of Object.entries(editorStats)) {\n if (key === \"type\") {\n continue;\n }\n let counters = map.get(key);\n if (!counters) {\n counters = new Map();\n map.set(key, counters);\n }\n const count = counters.get(val) ?? 0;\n counters.set(val, count + 1);\n }\n }\n for (const [type, editor] of typeToEditor) {\n stats[type] = editor.computeTelemetryFinalData(stats[type]);\n }\n return stats;\n }\n}\n\n/**\n * A special `AnnotationStorage` for use during printing, where the serializable\n * data is *frozen* upon initialization, to prevent scripting from modifying its\n * contents. (Necessary since printing is triggered synchronously in browsers.)\n */\nclass PrintAnnotationStorage extends AnnotationStorage {\n #serializable;\n\n constructor(parent) {\n super();\n const { map, hash, transfer } = parent.serializable;\n // Create a *copy* of the data, since Objects are passed by reference in JS.\n const clone = structuredClone(map, transfer ? { transfer } : null);\n\n this.#serializable = { map: clone, hash, transfer };\n }\n\n /**\n * @returns {PrintAnnotationStorage}\n */\n // eslint-disable-next-line getter-return\n get print() {\n unreachable(\"Should not call PrintAnnotationStorage.print\");\n }\n\n /**\n * PLEASE NOTE: Only intended for usage within the API itself.\n * @ignore\n */\n get serializable() {\n return this.#serializable;\n }\n}\n\nexport { AnnotationStorage, PrintAnnotationStorage, SerializableEmpty };\n","/* Copyright 2012 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\nimport {\n assert,\n bytesToString,\n FontRenderOps,\n isNodeJS,\n shadow,\n string32,\n unreachable,\n warn,\n} from \"../shared/util.js\";\n\nclass FontLoader {\n #systemFonts = new Set();\n\n constructor({\n ownerDocument = globalThis.document,\n styleElement = null, // For testing only.\n }) {\n this._document = ownerDocument;\n\n this.nativeFontFaces = new Set();\n this.styleElement =\n typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")\n ? styleElement\n : null;\n\n if (typeof PDFJSDev === \"undefined\" || !PDFJSDev.test(\"MOZCENTRAL\")) {\n this.loadingRequests = [];\n this.loadTestFontId = 0;\n }\n }\n\n addNativeFontFace(nativeFontFace) {\n this.nativeFontFaces.add(nativeFontFace);\n this._document.fonts.add(nativeFontFace);\n }\n\n removeNativeFontFace(nativeFontFace) {\n this.nativeFontFaces.delete(nativeFontFace);\n this._document.fonts.delete(nativeFontFace);\n }\n\n insertRule(rule) {\n if (!this.styleElement) {\n this.styleElement = this._document.createElement(\"style\");\n this._document.documentElement\n .getElementsByTagName(\"head\")[0]\n .append(this.styleElement);\n }\n const styleSheet = this.styleElement.sheet;\n styleSheet.insertRule(rule, styleSheet.cssRules.length);\n }\n\n clear() {\n for (const nativeFontFace of this.nativeFontFaces) {\n this._document.fonts.delete(nativeFontFace);\n }\n this.nativeFontFaces.clear();\n this.#systemFonts.clear();\n\n if (this.styleElement) {\n // Note: ChildNode.remove doesn't throw if the parentNode is undefined.\n this.styleElement.remove();\n this.styleElement = null;\n }\n }\n\n async loadSystemFont({ systemFontInfo: info, _inspectFont }) {\n if (!info || this.#systemFonts.has(info.loadedName)) {\n return;\n }\n assert(\n !this.disableFontFace,\n \"loadSystemFont shouldn't be called when `disableFontFace` is set.\"\n );\n\n if (this.isFontLoadingAPISupported) {\n const { loadedName, src, style } = info;\n const fontFace = new FontFace(loadedName, src, style);\n this.addNativeFontFace(fontFace);\n try {\n await fontFace.load();\n this.#systemFonts.add(loadedName);\n _inspectFont?.(info);\n } catch {\n warn(\n `Cannot load system font: ${info.baseFontName}, installing it could help to improve PDF rendering.`\n );\n\n this.removeNativeFontFace(fontFace);\n }\n return;\n }\n\n unreachable(\n \"Not implemented: loadSystemFont without the Font Loading API.\"\n );\n }\n\n async bind(font) {\n // Add the font to the DOM only once; skip if the font is already loaded.\n if (font.attached || (font.missingFile && !font.systemFontInfo)) {\n return;\n }\n font.attached = true;\n\n if (font.systemFontInfo) {\n await this.loadSystemFont(font);\n return;\n }\n\n if (this.isFontLoadingAPISupported) {\n const nativeFontFace = font.createNativeFontFace();\n if (nativeFontFace) {\n this.addNativeFontFace(nativeFontFace);\n try {\n await nativeFontFace.loaded;\n } catch (ex) {\n warn(`Failed to load font '${nativeFontFace.family}': '${ex}'.`);\n\n // When font loading failed, fall back to the built-in font renderer.\n font.disableFontFace = true;\n throw ex;\n }\n }\n return; // The font was, asynchronously, loaded.\n }\n\n // !this.isFontLoadingAPISupported\n const rule = font.createFontFaceRule();\n if (rule) {\n this.insertRule(rule);\n\n if (this.isSyncFontLoadingSupported) {\n return; // The font was, synchronously, loaded.\n }\n if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) {\n throw new Error(\"Not implemented: async font loading\");\n }\n await new Promise(resolve => {\n const request = this._queueLoadingCallback(resolve);\n this._prepareFontLoadEvent(font, request);\n });\n // The font was, asynchronously, loaded.\n }\n }\n\n get isFontLoadingAPISupported() {\n const hasFonts = !!this._document?.fonts;\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) {\n return shadow(\n this,\n \"isFontLoadingAPISupported\",\n hasFonts && !this.styleElement\n );\n }\n return shadow(this, \"isFontLoadingAPISupported\", hasFonts);\n }\n\n get isSyncFontLoadingSupported() {\n if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) {\n return shadow(this, \"isSyncFontLoadingSupported\", true);\n }\n\n let supported = false;\n if (typeof PDFJSDev === \"undefined\" || !PDFJSDev.test(\"CHROME\")) {\n if (isNodeJS) {\n // Node.js - we can pretend that sync font loading is supported.\n supported = true;\n } else if (\n typeof navigator !== \"undefined\" &&\n typeof navigator?.userAgent === \"string\" &&\n // User agent string sniffing is bad, but there is no reliable way to\n // tell if the font is fully loaded and ready to be used with canvas.\n /Mozilla\\/5.0.*?rv:\\d+.*? Gecko/.test(navigator.userAgent)\n ) {\n // Firefox, from version 14, supports synchronous font loading.\n supported = true;\n }\n }\n return shadow(this, \"isSyncFontLoadingSupported\", supported);\n }\n\n _queueLoadingCallback(callback) {\n if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) {\n throw new Error(\"Not implemented: _queueLoadingCallback\");\n }\n\n function completeRequest() {\n assert(!request.done, \"completeRequest() cannot be called twice.\");\n request.done = true;\n\n // Sending all completed requests in order of how they were queued.\n while (loadingRequests.length > 0 && loadingRequests[0].done) {\n const otherRequest = loadingRequests.shift();\n setTimeout(otherRequest.callback, 0);\n }\n }\n\n const { loadingRequests } = this;\n const request = {\n done: false,\n complete: completeRequest,\n callback,\n };\n loadingRequests.push(request);\n return request;\n }\n\n get _loadTestFont() {\n if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) {\n throw new Error(\"Not implemented: _loadTestFont\");\n }\n\n // This is a CFF font with 1 glyph for '.' that fills its entire width\n // and height.\n const testFont = atob(\n \"T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQA\" +\n \"FQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAA\" +\n \"ALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgA\" +\n \"AAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1\" +\n \"AAsD6AAAAADOBOTLAAAAAM4K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4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQAC\" +\n \"AQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3\" +\n \"Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTj\" +\n \"FQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA==\"\n );\n return shadow(this, \"_loadTestFont\", testFont);\n }\n\n _prepareFontLoadEvent(font, request) {\n if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) {\n throw new Error(\"Not implemented: _prepareFontLoadEvent\");\n }\n\n /** Hack begin */\n // There's currently no event when a font has finished downloading so the\n // following code is a dirty hack to 'guess' when a font is ready.\n // It's assumed fonts are loaded in order, so add a known test font after\n // the desired fonts and then test for the loading of that test font.\n\n function int32(data, offset) {\n return (\n (data.charCodeAt(offset) << 24) |\n (data.charCodeAt(offset + 1) << 16) |\n (data.charCodeAt(offset + 2) << 8) |\n (data.charCodeAt(offset + 3) & 0xff)\n );\n }\n function spliceString(s, offset, remove, insert) {\n const chunk1 = s.substring(0, offset);\n const chunk2 = s.substring(offset + remove);\n return chunk1 + insert + chunk2;\n }\n let i, ii;\n\n // The temporary canvas is used to determine if fonts are loaded.\n const canvas = this._document.createElement(\"canvas\");\n canvas.width = 1;\n canvas.height = 1;\n const ctx = canvas.getContext(\"2d\");\n\n let called = 0;\n function isFontReady(name, callback) {\n // With setTimeout clamping this gives the font ~100ms to load.\n if (++called > 30) {\n warn(\"Load test font never loaded.\");\n callback();\n return;\n }\n ctx.font = \"30px \" + name;\n ctx.fillText(\".\", 0, 20);\n const imageData = ctx.getImageData(0, 0, 1, 1);\n if (imageData.data[3] > 0) {\n callback();\n return;\n }\n setTimeout(isFontReady.bind(null, name, callback));\n }\n\n const loadTestFontId = `lt${Date.now()}${this.loadTestFontId++}`;\n // Chromium seems to cache fonts based on a hash of the actual font data,\n // so the font must be modified for each load test else it will appear to\n // be loaded already.\n // TODO: This could maybe be made faster by avoiding the btoa of the full\n // font by splitting it in chunks before hand and padding the font id.\n let data = this._loadTestFont;\n const COMMENT_OFFSET = 976; // has to be on 4 byte boundary (for checksum)\n data = spliceString(\n data,\n COMMENT_OFFSET,\n loadTestFontId.length,\n loadTestFontId\n );\n // CFF checksum is important for IE, adjusting it\n const CFF_CHECKSUM_OFFSET = 16;\n const XXXX_VALUE = 0x58585858; // the \"comment\" filled with 'X'\n let checksum = int32(data, CFF_CHECKSUM_OFFSET);\n for (i = 0, ii = loadTestFontId.length - 3; i < ii; i += 4) {\n checksum = (checksum - XXXX_VALUE + int32(loadTestFontId, i)) | 0;\n }\n if (i < loadTestFontId.length) {\n // align to 4 bytes boundary\n checksum = (checksum - XXXX_VALUE + int32(loadTestFontId + \"XXX\", i)) | 0;\n }\n data = spliceString(data, CFF_CHECKSUM_OFFSET, 4, string32(checksum));\n\n const url = `url(data:font/opentype;base64,${btoa(data)});`;\n const rule = `@font-face {font-family:\"${loadTestFontId}\";src:${url}}`;\n this.insertRule(rule);\n\n const div = this._document.createElement(\"div\");\n div.style.visibility = \"hidden\";\n div.style.width = div.style.height = \"10px\";\n div.style.position = \"absolute\";\n div.style.top = div.style.left = \"0px\";\n\n for (const name of [font.loadedName, loadTestFontId]) {\n const span = this._document.createElement(\"span\");\n span.textContent = \"Hi\";\n span.style.fontFamily = name;\n div.append(span);\n }\n this._document.body.append(div);\n\n isFontReady(loadTestFontId, () => {\n div.remove();\n request.complete();\n });\n /** Hack end */\n }\n}\n\nclass FontFaceObject {\n constructor(translatedData, { disableFontFace = false, inspectFont = null }) {\n this.compiledGlyphs = Object.create(null);\n // importing translated data\n for (const i in translatedData) {\n this[i] = translatedData[i];\n }\n this.disableFontFace = disableFontFace === true;\n this._inspectFont = inspectFont;\n }\n\n createNativeFontFace() {\n if (!this.data || this.disableFontFace) {\n return null;\n }\n let nativeFontFace;\n if (!this.cssFontInfo) {\n nativeFontFace = new FontFace(this.loadedName, this.data, {});\n } else {\n const css = {\n weight: this.cssFontInfo.fontWeight,\n };\n if (this.cssFontInfo.italicAngle) {\n css.style = `oblique ${this.cssFontInfo.italicAngle}deg`;\n }\n nativeFontFace = new FontFace(\n this.cssFontInfo.fontFamily,\n this.data,\n css\n );\n }\n\n this._inspectFont?.(this);\n return nativeFontFace;\n }\n\n createFontFaceRule() {\n if (!this.data || this.disableFontFace) {\n return null;\n }\n const data = bytesToString(this.data);\n // Add the @font-face rule to the document.\n const url = `url(data:${this.mimetype};base64,${btoa(data)});`;\n let rule;\n if (!this.cssFontInfo) {\n rule = `@font-face {font-family:\"${this.loadedName}\";src:${url}}`;\n } else {\n let css = `font-weight: ${this.cssFontInfo.fontWeight};`;\n if (this.cssFontInfo.italicAngle) {\n css += `font-style: oblique ${this.cssFontInfo.italicAngle}deg;`;\n }\n rule = `@font-face {font-family:\"${this.cssFontInfo.fontFamily}\";${css}src:${url}}`;\n }\n\n this._inspectFont?.(this, url);\n return rule;\n }\n\n getPathGenerator(objs, character) {\n if (this.compiledGlyphs[character] !== undefined) {\n return this.compiledGlyphs[character];\n }\n\n let cmds;\n try {\n cmds = objs.get(this.loadedName + \"_path_\" + character);\n } catch (ex) {\n warn(`getPathGenerator - ignoring character: \"${ex}\".`);\n }\n\n if (!Array.isArray(cmds) || cmds.length === 0) {\n return (this.compiledGlyphs[character] = function (c, size) {\n // No-op function, to allow rendering to continue.\n });\n }\n\n const commands = [];\n for (let i = 0, ii = cmds.length; i < ii; ) {\n switch (cmds[i++]) {\n case FontRenderOps.BEZIER_CURVE_TO:\n {\n const [a, b, c, d, e, f] = cmds.slice(i, i + 6);\n commands.push(ctx => ctx.bezierCurveTo(a, b, c, d, e, f));\n i += 6;\n }\n break;\n case FontRenderOps.MOVE_TO:\n {\n const [a, b] = cmds.slice(i, i + 2);\n commands.push(ctx => ctx.moveTo(a, b));\n i += 2;\n }\n break;\n case FontRenderOps.LINE_TO:\n {\n const [a, b] = cmds.slice(i, i + 2);\n commands.push(ctx => ctx.lineTo(a, b));\n i += 2;\n }\n break;\n case FontRenderOps.QUADRATIC_CURVE_TO:\n {\n const [a, b, c, d] = cmds.slice(i, i + 4);\n commands.push(ctx => ctx.quadraticCurveTo(a, b, c, d));\n i += 4;\n }\n break;\n case FontRenderOps.RESTORE:\n commands.push(ctx => ctx.restore());\n break;\n case FontRenderOps.SAVE:\n commands.push(ctx => ctx.save());\n break;\n case FontRenderOps.SCALE:\n // The scale command must be at the third position, after save and\n // transform (for the font matrix) commands (see also\n // font_renderer.js).\n // The goal is to just scale the canvas and then run the commands loop\n // without the need to pass the size parameter to each command.\n assert(\n commands.length === 2,\n \"Scale command is only valid at the third position.\"\n );\n break;\n case FontRenderOps.TRANSFORM:\n {\n const [a, b, c, d, e, f] = cmds.slice(i, i + 6);\n commands.push(ctx => ctx.transform(a, b, c, d, e, f));\n i += 6;\n }\n break;\n case FontRenderOps.TRANSLATE:\n {\n const [a, b] = cmds.slice(i, i + 2);\n commands.push(ctx => ctx.translate(a, b));\n i += 2;\n }\n break;\n }\n }\n\n return (this.compiledGlyphs[character] = function glyphDrawer(ctx, size) {\n commands[0](ctx);\n commands[1](ctx);\n ctx.scale(size, -size);\n for (let i = 2, ii = commands.length; i < ii; i++) {\n commands[i](ctx);\n }\n });\n }\n}\n\nexport { FontFaceObject, FontLoader };\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\nimport {\n BaseCanvasFactory,\n BaseCMapReaderFactory,\n BaseFilterFactory,\n BaseStandardFontDataFactory,\n} from \"./base_factory.js\";\nimport { isNodeJS, warn } from \"../shared/util.js\";\n\nif (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) {\n throw new Error(\n 'Module \"./node_utils.js\" shall not be used with MOZCENTRAL builds.'\n );\n}\n\nif (isNodeJS) {\n // eslint-disable-next-line no-var\n var packageCapability = Promise.withResolvers();\n // eslint-disable-next-line no-var\n var packageMap = null;\n\n const loadPackages = async () => {\n // Native packages.\n const fs = await __non_webpack_import__(\"fs\"),\n http = await __non_webpack_import__(\"http\"),\n https = await __non_webpack_import__(\"https\"),\n url = await __non_webpack_import__(\"url\");\n\n // Optional, third-party, packages.\n let canvas, path2d;\n if (typeof PDFJSDev !== \"undefined\" && !PDFJSDev.test(\"SKIP_BABEL\")) {\n try {\n canvas = await __non_webpack_import__(\"canvas\");\n } catch {}\n try {\n path2d = await __non_webpack_import__(\"path2d\");\n } catch {}\n }\n\n return new Map(Object.entries({ fs, http, https, url, canvas, path2d }));\n };\n\n loadPackages().then(\n map => {\n packageMap = map;\n packageCapability.resolve();\n\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"SKIP_BABEL\")) {\n return;\n }\n if (!globalThis.DOMMatrix) {\n const DOMMatrix = map.get(\"canvas\")?.DOMMatrix;\n\n if (DOMMatrix) {\n globalThis.DOMMatrix = DOMMatrix;\n } else {\n warn(\"Cannot polyfill `DOMMatrix`, rendering may be broken.\");\n }\n }\n if (!globalThis.Path2D) {\n const CanvasRenderingContext2D =\n map.get(\"canvas\")?.CanvasRenderingContext2D;\n const applyPath2DToCanvasRenderingContext =\n map.get(\"path2d\")?.applyPath2DToCanvasRenderingContext;\n const Path2D = map.get(\"path2d\")?.Path2D;\n\n if (\n CanvasRenderingContext2D &&\n applyPath2DToCanvasRenderingContext &&\n Path2D\n ) {\n applyPath2DToCanvasRenderingContext(CanvasRenderingContext2D);\n globalThis.Path2D = Path2D;\n } else {\n warn(\"Cannot polyfill `Path2D`, rendering may be broken.\");\n }\n }\n },\n reason => {\n warn(`loadPackages: ${reason}`);\n\n packageMap = new Map();\n packageCapability.resolve();\n }\n );\n}\n\nclass NodePackages {\n static get promise() {\n return packageCapability.promise;\n }\n\n static get(name) {\n return packageMap?.get(name);\n }\n}\n\nconst fetchData = function (url) {\n const fs = NodePackages.get(\"fs\");\n return fs.promises.readFile(url).then(data => new Uint8Array(data));\n};\n\nclass NodeFilterFactory extends BaseFilterFactory {}\n\nclass NodeCanvasFactory extends BaseCanvasFactory {\n /**\n * @ignore\n */\n _createCanvas(width, height) {\n const canvas = NodePackages.get(\"canvas\");\n return canvas.createCanvas(width, height);\n }\n}\n\nclass NodeCMapReaderFactory extends BaseCMapReaderFactory {\n /**\n * @ignore\n */\n _fetchData(url, compressionType) {\n return fetchData(url).then(data => ({ cMapData: data, compressionType }));\n }\n}\n\nclass NodeStandardFontDataFactory extends BaseStandardFontDataFactory {\n /**\n * @ignore\n */\n _fetchData(url) {\n return fetchData(url);\n }\n}\n\nexport {\n NodeCanvasFactory,\n NodeCMapReaderFactory,\n NodeFilterFactory,\n NodePackages,\n NodeStandardFontDataFactory,\n};\n","/* Copyright 2014 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\nimport { FormatError, info, unreachable, Util } from \"../shared/util.js\";\nimport { getCurrentTransform } from \"./display_utils.js\";\n\nconst PathType = {\n FILL: \"Fill\",\n STROKE: \"Stroke\",\n SHADING: \"Shading\",\n};\n\nfunction applyBoundingBox(ctx, bbox) {\n if (!bbox) {\n return;\n }\n const width = bbox[2] - bbox[0];\n const height = bbox[3] - bbox[1];\n const region = new Path2D();\n region.rect(bbox[0], bbox[1], width, height);\n ctx.clip(region);\n}\n\nclass BaseShadingPattern {\n constructor() {\n if (this.constructor === BaseShadingPattern) {\n unreachable(\"Cannot initialize BaseShadingPattern.\");\n }\n }\n\n getPattern() {\n unreachable(\"Abstract method `getPattern` called.\");\n }\n}\n\nclass RadialAxialShadingPattern extends BaseShadingPattern {\n constructor(IR) {\n super();\n this._type = IR[1];\n this._bbox = IR[2];\n this._colorStops = IR[3];\n this._p0 = IR[4];\n this._p1 = IR[5];\n this._r0 = IR[6];\n this._r1 = IR[7];\n this.matrix = null;\n }\n\n _createGradient(ctx) {\n let grad;\n if (this._type === \"axial\") {\n grad = ctx.createLinearGradient(\n this._p0[0],\n this._p0[1],\n this._p1[0],\n this._p1[1]\n );\n } else if (this._type === \"radial\") {\n grad = ctx.createRadialGradient(\n this._p0[0],\n this._p0[1],\n this._r0,\n this._p1[0],\n this._p1[1],\n this._r1\n );\n }\n\n for (const colorStop of this._colorStops) {\n grad.addColorStop(colorStop[0], colorStop[1]);\n }\n return grad;\n }\n\n getPattern(ctx, owner, inverse, pathType) {\n let pattern;\n if (pathType === PathType.STROKE || pathType === PathType.FILL) {\n const ownerBBox = owner.current.getClippedPathBoundingBox(\n pathType,\n getCurrentTransform(ctx)\n ) || [0, 0, 0, 0];\n // Create a canvas that is only as big as the current path. This doesn't\n // allow us to cache the pattern, but it generally creates much smaller\n // canvases and saves memory use. See bug 1722807 for an example.\n const width = Math.ceil(ownerBBox[2] - ownerBBox[0]) || 1;\n const height = Math.ceil(ownerBBox[3] - ownerBBox[1]) || 1;\n\n const tmpCanvas = owner.cachedCanvases.getCanvas(\n \"pattern\",\n width,\n height,\n true\n );\n\n const tmpCtx = tmpCanvas.context;\n tmpCtx.clearRect(0, 0, tmpCtx.canvas.width, tmpCtx.canvas.height);\n tmpCtx.beginPath();\n tmpCtx.rect(0, 0, tmpCtx.canvas.width, tmpCtx.canvas.height);\n // Non shading fill patterns are positioned relative to the base transform\n // (usually the page's initial transform), but we may have created a\n // smaller canvas based on the path, so we must account for the shift.\n tmpCtx.translate(-ownerBBox[0], -ownerBBox[1]);\n inverse = Util.transform(inverse, [\n 1,\n 0,\n 0,\n 1,\n ownerBBox[0],\n ownerBBox[1],\n ]);\n\n tmpCtx.transform(...owner.baseTransform);\n if (this.matrix) {\n tmpCtx.transform(...this.matrix);\n }\n applyBoundingBox(tmpCtx, this._bbox);\n\n tmpCtx.fillStyle = this._createGradient(tmpCtx);\n tmpCtx.fill();\n\n pattern = ctx.createPattern(tmpCanvas.canvas, \"no-repeat\");\n const domMatrix = new DOMMatrix(inverse);\n pattern.setTransform(domMatrix);\n } else {\n // Shading fills are applied relative to the current matrix which is also\n // how canvas gradients work, so there's no need to do anything special\n // here.\n applyBoundingBox(ctx, this._bbox);\n pattern = this._createGradient(ctx);\n }\n return pattern;\n }\n}\n\nfunction drawTriangle(data, context, p1, p2, p3, c1, c2, c3) {\n // Very basic Gouraud-shaded triangle rasterization algorithm.\n const coords = context.coords,\n colors = context.colors;\n const bytes = data.data,\n rowSize = data.width * 4;\n let tmp;\n if (coords[p1 + 1] > coords[p2 + 1]) {\n tmp = p1;\n p1 = p2;\n p2 = tmp;\n tmp = c1;\n c1 = c2;\n c2 = tmp;\n }\n if (coords[p2 + 1] > coords[p3 + 1]) {\n tmp = p2;\n p2 = p3;\n p3 = tmp;\n tmp = c2;\n c2 = c3;\n c3 = tmp;\n }\n if (coords[p1 + 1] > coords[p2 + 1]) {\n tmp = p1;\n p1 = p2;\n p2 = tmp;\n tmp = c1;\n c1 = c2;\n c2 = tmp;\n }\n const x1 = (coords[p1] + context.offsetX) * context.scaleX;\n const y1 = (coords[p1 + 1] + context.offsetY) * context.scaleY;\n const x2 = (coords[p2] + context.offsetX) * context.scaleX;\n const y2 = (coords[p2 + 1] + context.offsetY) * context.scaleY;\n const x3 = (coords[p3] + context.offsetX) * context.scaleX;\n const y3 = (coords[p3 + 1] + context.offsetY) * context.scaleY;\n if (y1 >= y3) {\n return;\n }\n const c1r = colors[c1],\n c1g = colors[c1 + 1],\n c1b = colors[c1 + 2];\n const c2r = colors[c2],\n c2g = colors[c2 + 1],\n c2b = colors[c2 + 2];\n const c3r = colors[c3],\n c3g = colors[c3 + 1],\n c3b = colors[c3 + 2];\n\n const minY = Math.round(y1),\n maxY = Math.round(y3);\n let xa, car, cag, cab;\n let xb, cbr, cbg, cbb;\n for (let y = minY; y <= maxY; y++) {\n if (y < y2) {\n const k = y < y1 ? 0 : (y1 - y) / (y1 - y2);\n xa = x1 - (x1 - x2) * k;\n car = c1r - (c1r - c2r) * k;\n cag = c1g - (c1g - c2g) * k;\n cab = c1b - (c1b - c2b) * k;\n } else {\n let k;\n if (y > y3) {\n k = 1;\n } else if (y2 === y3) {\n k = 0;\n } else {\n k = (y2 - y) / (y2 - y3);\n }\n xa = x2 - (x2 - x3) * k;\n car = c2r - (c2r - c3r) * k;\n cag = c2g - (c2g - c3g) * k;\n cab = c2b - (c2b - c3b) * k;\n }\n\n let k;\n if (y < y1) {\n k = 0;\n } else if (y > y3) {\n k = 1;\n } else {\n k = (y1 - y) / (y1 - y3);\n }\n xb = x1 - (x1 - x3) * k;\n cbr = c1r - (c1r - c3r) * k;\n cbg = c1g - (c1g - c3g) * k;\n cbb = c1b - (c1b - c3b) * k;\n const x1_ = Math.round(Math.min(xa, xb));\n const x2_ = Math.round(Math.max(xa, xb));\n let j = rowSize * y + x1_ * 4;\n for (let x = x1_; x <= x2_; x++) {\n k = (xa - x) / (xa - xb);\n if (k < 0) {\n k = 0;\n } else if (k > 1) {\n k = 1;\n }\n bytes[j++] = (car - (car - cbr) * k) | 0;\n bytes[j++] = (cag - (cag - cbg) * k) | 0;\n bytes[j++] = (cab - (cab - cbb) * k) | 0;\n bytes[j++] = 255;\n }\n }\n}\n\nfunction drawFigure(data, figure, context) {\n const ps = figure.coords;\n const cs = figure.colors;\n let i, ii;\n switch (figure.type) {\n case \"lattice\":\n const verticesPerRow = figure.verticesPerRow;\n const rows = Math.floor(ps.length / verticesPerRow) - 1;\n const cols = verticesPerRow - 1;\n for (i = 0; i < rows; i++) {\n let q = i * verticesPerRow;\n for (let j = 0; j < cols; j++, q++) {\n drawTriangle(\n data,\n context,\n ps[q],\n ps[q + 1],\n ps[q + verticesPerRow],\n cs[q],\n cs[q + 1],\n cs[q + verticesPerRow]\n );\n drawTriangle(\n data,\n context,\n ps[q + verticesPerRow + 1],\n ps[q + 1],\n ps[q + verticesPerRow],\n cs[q + verticesPerRow + 1],\n cs[q + 1],\n cs[q + verticesPerRow]\n );\n }\n }\n break;\n case \"triangles\":\n for (i = 0, ii = ps.length; i < ii; i += 3) {\n drawTriangle(\n data,\n context,\n ps[i],\n ps[i + 1],\n ps[i + 2],\n cs[i],\n cs[i + 1],\n cs[i + 2]\n );\n }\n break;\n default:\n throw new Error(\"illegal figure\");\n }\n}\n\nclass MeshShadingPattern extends BaseShadingPattern {\n constructor(IR) {\n super();\n this._coords = IR[2];\n this._colors = IR[3];\n this._figures = IR[4];\n this._bounds = IR[5];\n this._bbox = IR[7];\n this._background = IR[8];\n this.matrix = null;\n }\n\n _createMeshCanvas(combinedScale, backgroundColor, cachedCanvases) {\n // we will increase scale on some weird factor to let antialiasing take\n // care of \"rough\" edges\n const EXPECTED_SCALE = 1.1;\n // MAX_PATTERN_SIZE is used to avoid OOM situation.\n const MAX_PATTERN_SIZE = 3000; // 10in @ 300dpi shall be enough\n // We need to keep transparent border around our pattern for fill():\n // createPattern with 'no-repeat' will bleed edges across entire area.\n const BORDER_SIZE = 2;\n\n const offsetX = Math.floor(this._bounds[0]);\n const offsetY = Math.floor(this._bounds[1]);\n const boundsWidth = Math.ceil(this._bounds[2]) - offsetX;\n const boundsHeight = Math.ceil(this._bounds[3]) - offsetY;\n\n const width = Math.min(\n Math.ceil(Math.abs(boundsWidth * combinedScale[0] * EXPECTED_SCALE)),\n MAX_PATTERN_SIZE\n );\n const height = Math.min(\n Math.ceil(Math.abs(boundsHeight * combinedScale[1] * EXPECTED_SCALE)),\n MAX_PATTERN_SIZE\n );\n const scaleX = boundsWidth / width;\n const scaleY = boundsHeight / height;\n\n const context = {\n coords: this._coords,\n colors: this._colors,\n offsetX: -offsetX,\n offsetY: -offsetY,\n scaleX: 1 / scaleX,\n scaleY: 1 / scaleY,\n };\n\n const paddedWidth = width + BORDER_SIZE * 2;\n const paddedHeight = height + BORDER_SIZE * 2;\n\n const tmpCanvas = cachedCanvases.getCanvas(\n \"mesh\",\n paddedWidth,\n paddedHeight,\n false\n );\n const tmpCtx = tmpCanvas.context;\n\n const data = tmpCtx.createImageData(width, height);\n if (backgroundColor) {\n const bytes = data.data;\n for (let i = 0, ii = bytes.length; i < ii; i += 4) {\n bytes[i] = backgroundColor[0];\n bytes[i + 1] = backgroundColor[1];\n bytes[i + 2] = backgroundColor[2];\n bytes[i + 3] = 255;\n }\n }\n for (const figure of this._figures) {\n drawFigure(data, figure, context);\n }\n tmpCtx.putImageData(data, BORDER_SIZE, BORDER_SIZE);\n const canvas = tmpCanvas.canvas;\n\n return {\n canvas,\n offsetX: offsetX - BORDER_SIZE * scaleX,\n offsetY: offsetY - BORDER_SIZE * scaleY,\n scaleX,\n scaleY,\n };\n }\n\n getPattern(ctx, owner, inverse, pathType) {\n applyBoundingBox(ctx, this._bbox);\n let scale;\n if (pathType === PathType.SHADING) {\n scale = Util.singularValueDecompose2dScale(getCurrentTransform(ctx));\n } else {\n // Obtain scale from matrix and current transformation matrix.\n scale = Util.singularValueDecompose2dScale(owner.baseTransform);\n if (this.matrix) {\n const matrixScale = Util.singularValueDecompose2dScale(this.matrix);\n scale = [scale[0] * matrixScale[0], scale[1] * matrixScale[1]];\n }\n }\n\n // Rasterizing on the main thread since sending/queue large canvases\n // might cause OOM.\n const temporaryPatternCanvas = this._createMeshCanvas(\n scale,\n pathType === PathType.SHADING ? null : this._background,\n owner.cachedCanvases\n );\n\n if (pathType !== PathType.SHADING) {\n ctx.setTransform(...owner.baseTransform);\n if (this.matrix) {\n ctx.transform(...this.matrix);\n }\n }\n\n ctx.translate(\n temporaryPatternCanvas.offsetX,\n temporaryPatternCanvas.offsetY\n );\n ctx.scale(temporaryPatternCanvas.scaleX, temporaryPatternCanvas.scaleY);\n\n return ctx.createPattern(temporaryPatternCanvas.canvas, \"no-repeat\");\n }\n}\n\nclass DummyShadingPattern extends BaseShadingPattern {\n getPattern() {\n return \"hotpink\";\n }\n}\n\nfunction getShadingPattern(IR) {\n switch (IR[0]) {\n case \"RadialAxial\":\n return new RadialAxialShadingPattern(IR);\n case \"Mesh\":\n return new MeshShadingPattern(IR);\n case \"Dummy\":\n return new DummyShadingPattern();\n }\n throw new Error(`Unknown IR type: ${IR[0]}`);\n}\n\nconst PaintType = {\n COLORED: 1,\n UNCOLORED: 2,\n};\n\nclass TilingPattern {\n // 10in @ 300dpi shall be enough.\n static MAX_PATTERN_SIZE = 3000;\n\n constructor(IR, color, ctx, canvasGraphicsFactory, baseTransform) {\n this.operatorList = IR[2];\n this.matrix = IR[3];\n this.bbox = IR[4];\n this.xstep = IR[5];\n this.ystep = IR[6];\n this.paintType = IR[7];\n this.tilingType = IR[8];\n this.color = color;\n this.ctx = ctx;\n this.canvasGraphicsFactory = canvasGraphicsFactory;\n this.baseTransform = baseTransform;\n }\n\n createPatternCanvas(owner) {\n const operatorList = this.operatorList;\n const bbox = this.bbox;\n const xstep = this.xstep;\n const ystep = this.ystep;\n const paintType = this.paintType;\n const tilingType = this.tilingType;\n const color = this.color;\n const canvasGraphicsFactory = this.canvasGraphicsFactory;\n\n info(\"TilingType: \" + tilingType);\n\n // A tiling pattern as defined by PDF spec 8.7.2 is a cell whose size is\n // described by bbox, and may repeat regularly by shifting the cell by\n // xstep and ystep.\n // Because the HTML5 canvas API does not support pattern repetition with\n // gaps in between, we use the xstep/ystep instead of the bbox's size.\n //\n // This has the following consequences (similarly for ystep):\n //\n // - If xstep is the same as bbox, then there is no observable difference.\n //\n // - If xstep is larger than bbox, then the pattern canvas is partially\n // empty: the area bounded by bbox is painted, the outside area is void.\n //\n // - If xstep is smaller than bbox, then the pixels between xstep and the\n // bbox boundary will be missing. This is INCORRECT behavior.\n // \"Figures on adjacent tiles should not overlap\" (PDF spec 8.7.3.1),\n // but overlapping cells without common pixels are still valid.\n // TODO: Fix the implementation, to allow this scenario to be painted\n // correctly.\n\n const x0 = bbox[0],\n y0 = bbox[1],\n x1 = bbox[2],\n y1 = bbox[3];\n\n // Obtain scale from matrix and current transformation matrix.\n const matrixScale = Util.singularValueDecompose2dScale(this.matrix);\n const curMatrixScale = Util.singularValueDecompose2dScale(\n this.baseTransform\n );\n const combinedScale = [\n matrixScale[0] * curMatrixScale[0],\n matrixScale[1] * curMatrixScale[1],\n ];\n\n // Use width and height values that are as close as possible to the end\n // result when the pattern is used. Too low value makes the pattern look\n // blurry. Too large value makes it look too crispy.\n const dimx = this.getSizeAndScale(\n xstep,\n this.ctx.canvas.width,\n combinedScale[0]\n );\n const dimy = this.getSizeAndScale(\n ystep,\n this.ctx.canvas.height,\n combinedScale[1]\n );\n\n const tmpCanvas = owner.cachedCanvases.getCanvas(\n \"pattern\",\n dimx.size,\n dimy.size,\n true\n );\n const tmpCtx = tmpCanvas.context;\n const graphics = canvasGraphicsFactory.createCanvasGraphics(tmpCtx);\n graphics.groupLevel = owner.groupLevel;\n\n this.setFillAndStrokeStyleToContext(graphics, paintType, color);\n\n let adjustedX0 = x0;\n let adjustedY0 = y0;\n let adjustedX1 = x1;\n let adjustedY1 = y1;\n // Some bounding boxes have negative x0/y0 coordinates which will cause the\n // some of the drawing to be off of the canvas. To avoid this shift the\n // bounding box over.\n if (x0 < 0) {\n adjustedX0 = 0;\n adjustedX1 += Math.abs(x0);\n }\n if (y0 < 0) {\n adjustedY0 = 0;\n adjustedY1 += Math.abs(y0);\n }\n tmpCtx.translate(-(dimx.scale * adjustedX0), -(dimy.scale * adjustedY0));\n graphics.transform(dimx.scale, 0, 0, dimy.scale, 0, 0);\n\n // To match CanvasGraphics beginDrawing we must save the context here or\n // else we end up with unbalanced save/restores.\n tmpCtx.save();\n\n this.clipBbox(graphics, adjustedX0, adjustedY0, adjustedX1, adjustedY1);\n\n graphics.baseTransform = getCurrentTransform(graphics.ctx);\n\n graphics.executeOperatorList(operatorList);\n\n graphics.endDrawing();\n\n return {\n canvas: tmpCanvas.canvas,\n scaleX: dimx.scale,\n scaleY: dimy.scale,\n offsetX: adjustedX0,\n offsetY: adjustedY0,\n };\n }\n\n getSizeAndScale(step, realOutputSize, scale) {\n // xstep / ystep may be negative -- normalize.\n step = Math.abs(step);\n // MAX_PATTERN_SIZE is used to avoid OOM situation.\n // Use the destination canvas's size if it is bigger than the hard-coded\n // limit of MAX_PATTERN_SIZE to avoid clipping patterns that cover the\n // whole canvas.\n const maxSize = Math.max(TilingPattern.MAX_PATTERN_SIZE, realOutputSize);\n let size = Math.ceil(step * scale);\n if (size >= maxSize) {\n size = maxSize;\n } else {\n scale = size / step;\n }\n return { scale, size };\n }\n\n clipBbox(graphics, x0, y0, x1, y1) {\n const bboxWidth = x1 - x0;\n const bboxHeight = y1 - y0;\n graphics.ctx.rect(x0, y0, bboxWidth, bboxHeight);\n graphics.current.updateRectMinMax(getCurrentTransform(graphics.ctx), [\n x0,\n y0,\n x1,\n y1,\n ]);\n graphics.clip();\n graphics.endPath();\n }\n\n setFillAndStrokeStyleToContext(graphics, paintType, color) {\n const context = graphics.ctx,\n current = graphics.current;\n switch (paintType) {\n case PaintType.COLORED:\n const ctx = this.ctx;\n context.fillStyle = ctx.fillStyle;\n context.strokeStyle = ctx.strokeStyle;\n current.fillColor = ctx.fillStyle;\n current.strokeColor = ctx.strokeStyle;\n break;\n case PaintType.UNCOLORED:\n const cssColor = Util.makeHexColor(color[0], color[1], color[2]);\n context.fillStyle = cssColor;\n context.strokeStyle = cssColor;\n // Set color needed by image masks (fixes issues 3226 and 8741).\n current.fillColor = cssColor;\n current.strokeColor = cssColor;\n break;\n default:\n throw new FormatError(`Unsupported paint type: ${paintType}`);\n }\n }\n\n getPattern(ctx, owner, inverse, pathType) {\n // PDF spec 8.7.2 NOTE 1: pattern's matrix is relative to initial matrix.\n let matrix = inverse;\n if (pathType !== PathType.SHADING) {\n matrix = Util.transform(matrix, owner.baseTransform);\n if (this.matrix) {\n matrix = Util.transform(matrix, this.matrix);\n }\n }\n\n const temporaryPatternCanvas = this.createPatternCanvas(owner);\n\n let domMatrix = new DOMMatrix(matrix);\n // Rescale and so that the ctx.createPattern call generates a pattern with\n // the desired size.\n domMatrix = domMatrix.translate(\n temporaryPatternCanvas.offsetX,\n temporaryPatternCanvas.offsetY\n );\n domMatrix = domMatrix.scale(\n 1 / temporaryPatternCanvas.scaleX,\n 1 / temporaryPatternCanvas.scaleY\n );\n\n const pattern = ctx.createPattern(temporaryPatternCanvas.canvas, \"repeat\");\n pattern.setTransform(domMatrix);\n\n return pattern;\n }\n}\n\nexport { getShadingPattern, PathType, TilingPattern };\n","/* Copyright 2022 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\nimport { FeatureTest, ImageKind } from \"./util.js\";\n\nfunction convertToRGBA(params) {\n switch (params.kind) {\n case ImageKind.GRAYSCALE_1BPP:\n return convertBlackAndWhiteToRGBA(params);\n case ImageKind.RGB_24BPP:\n return convertRGBToRGBA(params);\n }\n\n return null;\n}\n\nfunction convertBlackAndWhiteToRGBA({\n src,\n srcPos = 0,\n dest,\n width,\n height,\n nonBlackColor = 0xffffffff,\n inverseDecode = false,\n}) {\n const black = FeatureTest.isLittleEndian ? 0xff000000 : 0x000000ff;\n const [zeroMapping, oneMapping] = inverseDecode\n ? [nonBlackColor, black]\n : [black, nonBlackColor];\n const widthInSource = width >> 3;\n const widthRemainder = width & 7;\n const srcLength = src.length;\n dest = new Uint32Array(dest.buffer);\n let destPos = 0;\n\n for (let i = 0; i < height; i++) {\n for (const max = srcPos + widthInSource; srcPos < max; srcPos++) {\n const elem = srcPos < srcLength ? src[srcPos] : 255;\n dest[destPos++] = elem & 0b10000000 ? oneMapping : zeroMapping;\n dest[destPos++] = elem & 0b1000000 ? oneMapping : zeroMapping;\n dest[destPos++] = elem & 0b100000 ? oneMapping : zeroMapping;\n dest[destPos++] = elem & 0b10000 ? oneMapping : zeroMapping;\n dest[destPos++] = elem & 0b1000 ? oneMapping : zeroMapping;\n dest[destPos++] = elem & 0b100 ? oneMapping : zeroMapping;\n dest[destPos++] = elem & 0b10 ? oneMapping : zeroMapping;\n dest[destPos++] = elem & 0b1 ? oneMapping : zeroMapping;\n }\n if (widthRemainder === 0) {\n continue;\n }\n const elem = srcPos < srcLength ? src[srcPos++] : 255;\n for (let j = 0; j < widthRemainder; j++) {\n dest[destPos++] = elem & (1 << (7 - j)) ? oneMapping : zeroMapping;\n }\n }\n return { srcPos, destPos };\n}\n\nfunction convertRGBToRGBA({\n src,\n srcPos = 0,\n dest,\n destPos = 0,\n width,\n height,\n}) {\n let i = 0;\n const len32 = src.length >> 2;\n const src32 = new Uint32Array(src.buffer, srcPos, len32);\n\n if (FeatureTest.isLittleEndian) {\n // It's a way faster to do the shuffle manually instead of working\n // component by component with some Uint8 arrays.\n for (; i < len32 - 2; i += 3, destPos += 4) {\n const s1 = src32[i]; // R2B1G1R1\n const s2 = src32[i + 1]; // G3R3B2G2\n const s3 = src32[i + 2]; // B4G4R4B3\n\n dest[destPos] = s1 | 0xff000000;\n dest[destPos + 1] = (s1 >>> 24) | (s2 << 8) | 0xff000000;\n dest[destPos + 2] = (s2 >>> 16) | (s3 << 16) | 0xff000000;\n dest[destPos + 3] = (s3 >>> 8) | 0xff000000;\n }\n\n for (let j = i * 4, jj = src.length; j < jj; j += 3) {\n dest[destPos++] =\n src[j] | (src[j + 1] << 8) | (src[j + 2] << 16) | 0xff000000;\n }\n } else {\n for (; i < len32 - 2; i += 3, destPos += 4) {\n const s1 = src32[i]; // R1G1B1R2\n const s2 = src32[i + 1]; // G2B2R3G3\n const s3 = src32[i + 2]; // B3R4G4B4\n\n dest[destPos] = s1 | 0xff;\n dest[destPos + 1] = (s1 << 24) | (s2 >>> 8) | 0xff;\n dest[destPos + 2] = (s2 << 16) | (s3 >>> 16) | 0xff;\n dest[destPos + 3] = (s3 << 8) | 0xff;\n }\n\n for (let j = i * 4, jj = src.length; j < jj; j += 3) {\n dest[destPos++] =\n (src[j] << 24) | (src[j + 1] << 16) | (src[j + 2] << 8) | 0xff;\n }\n }\n\n return { srcPos, destPos };\n}\n\nfunction grayToRGBA(src, dest) {\n if (FeatureTest.isLittleEndian) {\n for (let i = 0, ii = src.length; i < ii; i++) {\n dest[i] = (src[i] * 0x10101) | 0xff000000;\n }\n } else {\n for (let i = 0, ii = src.length; i < ii; i++) {\n dest[i] = (src[i] * 0x1010100) | 0x000000ff;\n }\n }\n}\n\nexport { convertBlackAndWhiteToRGBA, convertToRGBA, grayToRGBA };\n","/* Copyright 2012 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\nimport {\n FeatureTest,\n FONT_IDENTITY_MATRIX,\n IDENTITY_MATRIX,\n ImageKind,\n info,\n isNodeJS,\n OPS,\n shadow,\n TextRenderingMode,\n unreachable,\n Util,\n warn,\n} from \"../shared/util.js\";\nimport {\n getCurrentTransform,\n getCurrentTransformInverse,\n PixelsPerInch,\n} from \"./display_utils.js\";\nimport {\n getShadingPattern,\n PathType,\n TilingPattern,\n} from \"./pattern_helper.js\";\nimport { convertBlackAndWhiteToRGBA } from \"../shared/image_utils.js\";\n\n// contexts store most of the state we need natively.\n// However, PDF needs a bit more state, which we store here.\n// Minimal font size that would be used during canvas fillText operations.\nconst MIN_FONT_SIZE = 16;\n// Maximum font size that would be used during canvas fillText operations.\nconst MAX_FONT_SIZE = 100;\n\n// Defines the time the `executeOperatorList`-method is going to be executing\n// before it stops and schedules a continue of execution.\nconst EXECUTION_TIME = 15; // ms\n// Defines the number of steps before checking the execution time.\nconst EXECUTION_STEPS = 10;\n\n// To disable Type3 compilation, set the value to `-1`.\nconst MAX_SIZE_TO_COMPILE = 1000;\n\nconst FULL_CHUNK_HEIGHT = 16;\n\n/**\n * Overrides certain methods on a 2d ctx so that when they are called they\n * will also call the same method on the destCtx. The methods that are\n * overridden are all the transformation state modifiers, path creation, and\n * save/restore. We only forward these specific methods because they are the\n * only state modifiers that we cannot copy over when we switch contexts.\n *\n * To remove mirroring call `ctx._removeMirroring()`.\n *\n * @param {Object} ctx - The 2d canvas context that will duplicate its calls on\n * the destCtx.\n * @param {Object} destCtx - The 2d canvas context that will receive the\n * forwarded calls.\n */\nfunction mirrorContextOperations(ctx, destCtx) {\n if (ctx._removeMirroring) {\n throw new Error(\"Context is already forwarding operations.\");\n }\n ctx.__originalSave = ctx.save;\n ctx.__originalRestore = ctx.restore;\n ctx.__originalRotate = ctx.rotate;\n ctx.__originalScale = ctx.scale;\n ctx.__originalTranslate = ctx.translate;\n ctx.__originalTransform = ctx.transform;\n ctx.__originalSetTransform = ctx.setTransform;\n ctx.__originalResetTransform = ctx.resetTransform;\n ctx.__originalClip = ctx.clip;\n ctx.__originalMoveTo = ctx.moveTo;\n ctx.__originalLineTo = ctx.lineTo;\n ctx.__originalBezierCurveTo = ctx.bezierCurveTo;\n ctx.__originalRect = ctx.rect;\n ctx.__originalClosePath = ctx.closePath;\n ctx.__originalBeginPath = ctx.beginPath;\n\n ctx._removeMirroring = () => {\n ctx.save = ctx.__originalSave;\n ctx.restore = ctx.__originalRestore;\n ctx.rotate = ctx.__originalRotate;\n ctx.scale = ctx.__originalScale;\n ctx.translate = ctx.__originalTranslate;\n ctx.transform = ctx.__originalTransform;\n ctx.setTransform = ctx.__originalSetTransform;\n ctx.resetTransform = ctx.__originalResetTransform;\n\n ctx.clip = ctx.__originalClip;\n ctx.moveTo = ctx.__originalMoveTo;\n ctx.lineTo = ctx.__originalLineTo;\n ctx.bezierCurveTo = ctx.__originalBezierCurveTo;\n ctx.rect = ctx.__originalRect;\n ctx.closePath = ctx.__originalClosePath;\n ctx.beginPath = ctx.__originalBeginPath;\n delete ctx._removeMirroring;\n };\n\n ctx.save = function ctxSave() {\n destCtx.save();\n this.__originalSave();\n };\n\n ctx.restore = function ctxRestore() {\n destCtx.restore();\n this.__originalRestore();\n };\n\n ctx.translate = function ctxTranslate(x, y) {\n destCtx.translate(x, y);\n this.__originalTranslate(x, y);\n };\n\n ctx.scale = function ctxScale(x, y) {\n destCtx.scale(x, y);\n this.__originalScale(x, y);\n };\n\n ctx.transform = function ctxTransform(a, b, c, d, e, f) {\n destCtx.transform(a, b, c, d, e, f);\n this.__originalTransform(a, b, c, d, e, f);\n };\n\n ctx.setTransform = function ctxSetTransform(a, b, c, d, e, f) {\n destCtx.setTransform(a, b, c, d, e, f);\n this.__originalSetTransform(a, b, c, d, e, f);\n };\n\n ctx.resetTransform = function ctxResetTransform() {\n destCtx.resetTransform();\n this.__originalResetTransform();\n };\n\n ctx.rotate = function ctxRotate(angle) {\n destCtx.rotate(angle);\n this.__originalRotate(angle);\n };\n\n ctx.clip = function ctxRotate(rule) {\n destCtx.clip(rule);\n this.__originalClip(rule);\n };\n\n ctx.moveTo = function (x, y) {\n destCtx.moveTo(x, y);\n this.__originalMoveTo(x, y);\n };\n\n ctx.lineTo = function (x, y) {\n destCtx.lineTo(x, y);\n this.__originalLineTo(x, y);\n };\n\n ctx.bezierCurveTo = function (cp1x, cp1y, cp2x, cp2y, x, y) {\n destCtx.bezierCurveTo(cp1x, cp1y, cp2x, cp2y, x, y);\n this.__originalBezierCurveTo(cp1x, cp1y, cp2x, cp2y, x, y);\n };\n\n ctx.rect = function (x, y, width, height) {\n destCtx.rect(x, y, width, height);\n this.__originalRect(x, y, width, height);\n };\n\n ctx.closePath = function () {\n destCtx.closePath();\n this.__originalClosePath();\n };\n\n ctx.beginPath = function () {\n destCtx.beginPath();\n this.__originalBeginPath();\n };\n}\n\nclass CachedCanvases {\n constructor(canvasFactory) {\n this.canvasFactory = canvasFactory;\n this.cache = Object.create(null);\n }\n\n getCanvas(id, width, height) {\n let canvasEntry;\n if (this.cache[id] !== undefined) {\n canvasEntry = this.cache[id];\n this.canvasFactory.reset(canvasEntry, width, height);\n } else {\n canvasEntry = this.canvasFactory.create(width, height);\n this.cache[id] = canvasEntry;\n }\n return canvasEntry;\n }\n\n delete(id) {\n delete this.cache[id];\n }\n\n clear() {\n for (const id in this.cache) {\n const canvasEntry = this.cache[id];\n this.canvasFactory.destroy(canvasEntry);\n delete this.cache[id];\n }\n }\n}\n\nfunction drawImageAtIntegerCoords(\n ctx,\n srcImg,\n srcX,\n srcY,\n srcW,\n srcH,\n destX,\n destY,\n destW,\n destH\n) {\n const [a, b, c, d, tx, ty] = getCurrentTransform(ctx);\n if (b === 0 && c === 0) {\n // top-left corner is at (X, Y) and\n // bottom-right one is at (X + width, Y + height).\n\n // If leftX is 4.321 then it's rounded to 4.\n // If width is 10.432 then it's rounded to 11 because\n // rightX = leftX + width = 14.753 which is rounded to 15\n // so after rounding the total width is 11 (15 - 4).\n // It's why we can't just floor/ceil uniformly, it just depends\n // on the values we've.\n\n const tlX = destX * a + tx;\n const rTlX = Math.round(tlX);\n const tlY = destY * d + ty;\n const rTlY = Math.round(tlY);\n const brX = (destX + destW) * a + tx;\n\n // Some pdf contains images with 1x1 images so in case of 0-width after\n // scaling we must fallback on 1 to be sure there is something.\n const rWidth = Math.abs(Math.round(brX) - rTlX) || 1;\n const brY = (destY + destH) * d + ty;\n const rHeight = Math.abs(Math.round(brY) - rTlY) || 1;\n\n // We must apply a transformation in order to apply it on the image itself.\n // For example if a == 1 && d == -1, it means that the image itself is\n // mirrored w.r.t. the x-axis.\n ctx.setTransform(Math.sign(a), 0, 0, Math.sign(d), rTlX, rTlY);\n ctx.drawImage(srcImg, srcX, srcY, srcW, srcH, 0, 0, rWidth, rHeight);\n ctx.setTransform(a, b, c, d, tx, ty);\n\n return [rWidth, rHeight];\n }\n\n if (a === 0 && d === 0) {\n // This path is taken in issue9462.pdf (page 3).\n const tlX = destY * c + tx;\n const rTlX = Math.round(tlX);\n const tlY = destX * b + ty;\n const rTlY = Math.round(tlY);\n const brX = (destY + destH) * c + tx;\n const rWidth = Math.abs(Math.round(brX) - rTlX) || 1;\n const brY = (destX + destW) * b + ty;\n const rHeight = Math.abs(Math.round(brY) - rTlY) || 1;\n\n ctx.setTransform(0, Math.sign(b), Math.sign(c), 0, rTlX, rTlY);\n ctx.drawImage(srcImg, srcX, srcY, srcW, srcH, 0, 0, rHeight, rWidth);\n ctx.setTransform(a, b, c, d, tx, ty);\n\n return [rHeight, rWidth];\n }\n\n // Not a scale matrix so let the render handle the case without rounding.\n ctx.drawImage(srcImg, srcX, srcY, srcW, srcH, destX, destY, destW, destH);\n\n const scaleX = Math.hypot(a, b);\n const scaleY = Math.hypot(c, d);\n return [scaleX * destW, scaleY * destH];\n}\n\nfunction compileType3Glyph(imgData) {\n const { width, height } = imgData;\n if (width > MAX_SIZE_TO_COMPILE || height > MAX_SIZE_TO_COMPILE) {\n return null;\n }\n\n const POINT_TO_PROCESS_LIMIT = 1000;\n const POINT_TYPES = new Uint8Array([\n 0, 2, 4, 0, 1, 0, 5, 4, 8, 10, 0, 8, 0, 2, 1, 0,\n ]);\n\n const width1 = width + 1;\n let points = new Uint8Array(width1 * (height + 1));\n let i, j, j0;\n\n // decodes bit-packed mask data\n const lineSize = (width + 7) & ~7;\n let data = new Uint8Array(lineSize * height),\n pos = 0;\n for (const elem of imgData.data) {\n let mask = 128;\n while (mask > 0) {\n data[pos++] = elem & mask ? 0 : 255;\n mask >>= 1;\n }\n }\n\n // finding interesting points: every point is located between mask pixels,\n // so there will be points of the (width + 1)x(height + 1) grid. Every point\n // will have flags assigned based on neighboring mask pixels:\n // 4 | 8\n // --P--\n // 2 | 1\n // We are interested only in points with the flags:\n // - outside corners: 1, 2, 4, 8;\n // - inside corners: 7, 11, 13, 14;\n // - and, intersections: 5, 10.\n let count = 0;\n pos = 0;\n if (data[pos] !== 0) {\n points[0] = 1;\n ++count;\n }\n for (j = 1; j < width; j++) {\n if (data[pos] !== data[pos + 1]) {\n points[j] = data[pos] ? 2 : 1;\n ++count;\n }\n pos++;\n }\n if (data[pos] !== 0) {\n points[j] = 2;\n ++count;\n }\n for (i = 1; i < height; i++) {\n pos = i * lineSize;\n j0 = i * width1;\n if (data[pos - lineSize] !== data[pos]) {\n points[j0] = data[pos] ? 1 : 8;\n ++count;\n }\n // 'sum' is the position of the current pixel configuration in the 'TYPES'\n // array (in order 8-1-2-4, so we can use '>>2' to shift the column).\n let sum = (data[pos] ? 4 : 0) + (data[pos - lineSize] ? 8 : 0);\n for (j = 1; j < width; j++) {\n sum =\n (sum >> 2) +\n (data[pos + 1] ? 4 : 0) +\n (data[pos - lineSize + 1] ? 8 : 0);\n if (POINT_TYPES[sum]) {\n points[j0 + j] = POINT_TYPES[sum];\n ++count;\n }\n pos++;\n }\n if (data[pos - lineSize] !== data[pos]) {\n points[j0 + j] = data[pos] ? 2 : 4;\n ++count;\n }\n\n if (count > POINT_TO_PROCESS_LIMIT) {\n return null;\n }\n }\n\n pos = lineSize * (height - 1);\n j0 = i * width1;\n if (data[pos] !== 0) {\n points[j0] = 8;\n ++count;\n }\n for (j = 1; j < width; j++) {\n if (data[pos] !== data[pos + 1]) {\n points[j0 + j] = data[pos] ? 4 : 8;\n ++count;\n }\n pos++;\n }\n if (data[pos] !== 0) {\n points[j0 + j] = 4;\n ++count;\n }\n if (count > POINT_TO_PROCESS_LIMIT) {\n return null;\n }\n\n // building outlines\n const steps = new Int32Array([0, width1, -1, 0, -width1, 0, 0, 0, 1]);\n const path = new Path2D();\n\n for (i = 0; count && i <= height; i++) {\n let p = i * width1;\n const end = p + width;\n while (p < end && !points[p]) {\n p++;\n }\n if (p === end) {\n continue;\n }\n path.moveTo(p % width1, i);\n\n const p0 = p;\n let type = points[p];\n do {\n const step = steps[type];\n do {\n p += step;\n } while (!points[p]);\n\n const pp = points[p];\n if (pp !== 5 && pp !== 10) {\n // set new direction\n type = pp;\n // delete mark\n points[p] = 0;\n } else {\n // type is 5 or 10, ie, a crossing\n // set new direction\n type = pp & ((0x33 * type) >> 4);\n // set new type for \"future hit\"\n points[p] &= (type >> 2) | (type << 2);\n }\n path.lineTo(p % width1, (p / width1) | 0);\n\n if (!points[p]) {\n --count;\n }\n } while (p0 !== p);\n --i;\n }\n\n // Immediately release the, potentially large, `Uint8Array`s after parsing.\n data = null;\n points = null;\n\n const drawOutline = function (c) {\n c.save();\n // the path shall be painted in [0..1]x[0..1] space\n c.scale(1 / width, -1 / height);\n c.translate(0, -height);\n c.fill(path);\n c.beginPath();\n c.restore();\n };\n\n return drawOutline;\n}\n\nclass CanvasExtraState {\n constructor(width, height) {\n // Are soft masks and alpha values shapes or opacities?\n this.alphaIsShape = false;\n this.fontSize = 0;\n this.fontSizeScale = 1;\n this.textMatrix = IDENTITY_MATRIX;\n this.textMatrixScale = 1;\n this.fontMatrix = FONT_IDENTITY_MATRIX;\n this.leading = 0;\n // Current point (in user coordinates)\n this.x = 0;\n this.y = 0;\n // Start of text line (in text coordinates)\n this.lineX = 0;\n this.lineY = 0;\n // Character and word spacing\n this.charSpacing = 0;\n this.wordSpacing = 0;\n this.textHScale = 1;\n this.textRenderingMode = TextRenderingMode.FILL;\n this.textRise = 0;\n // Default fore and background colors\n this.fillColor = \"#000000\";\n this.strokeColor = \"#000000\";\n this.patternFill = false;\n // Note: fill alpha applies to all non-stroking operations\n this.fillAlpha = 1;\n this.strokeAlpha = 1;\n this.lineWidth = 1;\n this.activeSMask = null;\n this.transferMaps = \"none\";\n\n this.startNewPathAndClipBox([0, 0, width, height]);\n }\n\n clone() {\n const clone = Object.create(this);\n clone.clipBox = this.clipBox.slice();\n return clone;\n }\n\n setCurrentPoint(x, y) {\n this.x = x;\n this.y = y;\n }\n\n updatePathMinMax(transform, x, y) {\n [x, y] = Util.applyTransform([x, y], transform);\n this.minX = Math.min(this.minX, x);\n this.minY = Math.min(this.minY, y);\n this.maxX = Math.max(this.maxX, x);\n this.maxY = Math.max(this.maxY, y);\n }\n\n updateRectMinMax(transform, rect) {\n const p1 = Util.applyTransform(rect, transform);\n const p2 = Util.applyTransform(rect.slice(2), transform);\n const p3 = Util.applyTransform([rect[0], rect[3]], transform);\n const p4 = Util.applyTransform([rect[2], rect[1]], transform);\n\n this.minX = Math.min(this.minX, p1[0], p2[0], p3[0], p4[0]);\n this.minY = Math.min(this.minY, p1[1], p2[1], p3[1], p4[1]);\n this.maxX = Math.max(this.maxX, p1[0], p2[0], p3[0], p4[0]);\n this.maxY = Math.max(this.maxY, p1[1], p2[1], p3[1], p4[1]);\n }\n\n updateScalingPathMinMax(transform, minMax) {\n Util.scaleMinMax(transform, minMax);\n this.minX = Math.min(this.minX, minMax[0]);\n this.minY = Math.min(this.minY, minMax[1]);\n this.maxX = Math.max(this.maxX, minMax[2]);\n this.maxY = Math.max(this.maxY, minMax[3]);\n }\n\n updateCurvePathMinMax(transform, x0, y0, x1, y1, x2, y2, x3, y3, minMax) {\n const box = Util.bezierBoundingBox(x0, y0, x1, y1, x2, y2, x3, y3, minMax);\n if (minMax) {\n return;\n }\n this.updateRectMinMax(transform, box);\n }\n\n getPathBoundingBox(pathType = PathType.FILL, transform = null) {\n const box = [this.minX, this.minY, this.maxX, this.maxY];\n if (pathType === PathType.STROKE) {\n if (!transform) {\n unreachable(\"Stroke bounding box must include transform.\");\n }\n // Stroked paths can be outside of the path bounding box by 1/2 the line\n // width.\n const scale = Util.singularValueDecompose2dScale(transform);\n const xStrokePad = (scale[0] * this.lineWidth) / 2;\n const yStrokePad = (scale[1] * this.lineWidth) / 2;\n box[0] -= xStrokePad;\n box[1] -= yStrokePad;\n box[2] += xStrokePad;\n box[3] += yStrokePad;\n }\n return box;\n }\n\n updateClipFromPath() {\n const intersect = Util.intersect(this.clipBox, this.getPathBoundingBox());\n this.startNewPathAndClipBox(intersect || [0, 0, 0, 0]);\n }\n\n isEmptyClip() {\n return this.minX === Infinity;\n }\n\n startNewPathAndClipBox(box) {\n this.clipBox = box;\n this.minX = Infinity;\n this.minY = Infinity;\n this.maxX = 0;\n this.maxY = 0;\n }\n\n getClippedPathBoundingBox(pathType = PathType.FILL, transform = null) {\n return Util.intersect(\n this.clipBox,\n this.getPathBoundingBox(pathType, transform)\n );\n }\n}\n\nfunction putBinaryImageData(ctx, imgData) {\n if (typeof ImageData !== \"undefined\" && imgData instanceof ImageData) {\n ctx.putImageData(imgData, 0, 0);\n return;\n }\n\n // Put the image data to the canvas in chunks, rather than putting the\n // whole image at once. This saves JS memory, because the ImageData object\n // is smaller. It also possibly saves C++ memory within the implementation\n // of putImageData(). (E.g. in Firefox we make two short-lived copies of\n // the data passed to putImageData()). |n| shouldn't be too small, however,\n // because too many putImageData() calls will slow things down.\n //\n // Note: as written, if the last chunk is partial, the putImageData() call\n // will (conceptually) put pixels past the bounds of the canvas. But\n // that's ok; any such pixels are ignored.\n\n const height = imgData.height,\n width = imgData.width;\n const partialChunkHeight = height % FULL_CHUNK_HEIGHT;\n const fullChunks = (height - partialChunkHeight) / FULL_CHUNK_HEIGHT;\n const totalChunks = partialChunkHeight === 0 ? fullChunks : fullChunks + 1;\n\n const chunkImgData = ctx.createImageData(width, FULL_CHUNK_HEIGHT);\n let srcPos = 0,\n destPos;\n const src = imgData.data;\n const dest = chunkImgData.data;\n let i, j, thisChunkHeight, elemsInThisChunk;\n\n // There are multiple forms in which the pixel data can be passed, and\n // imgData.kind tells us which one this is.\n if (imgData.kind === ImageKind.GRAYSCALE_1BPP) {\n // Grayscale, 1 bit per pixel (i.e. black-and-white).\n const srcLength = src.byteLength;\n const dest32 = new Uint32Array(dest.buffer, 0, dest.byteLength >> 2);\n const dest32DataLength = dest32.length;\n const fullSrcDiff = (width + 7) >> 3;\n const white = 0xffffffff;\n const black = FeatureTest.isLittleEndian ? 0xff000000 : 0x000000ff;\n\n for (i = 0; i < totalChunks; i++) {\n thisChunkHeight = i < fullChunks ? FULL_CHUNK_HEIGHT : partialChunkHeight;\n destPos = 0;\n for (j = 0; j < thisChunkHeight; j++) {\n const srcDiff = srcLength - srcPos;\n let k = 0;\n const kEnd = srcDiff > fullSrcDiff ? width : srcDiff * 8 - 7;\n const kEndUnrolled = kEnd & ~7;\n let mask = 0;\n let srcByte = 0;\n for (; k < kEndUnrolled; k += 8) {\n srcByte = src[srcPos++];\n dest32[destPos++] = srcByte & 128 ? white : black;\n dest32[destPos++] = srcByte & 64 ? white : black;\n dest32[destPos++] = srcByte & 32 ? white : black;\n dest32[destPos++] = srcByte & 16 ? white : black;\n dest32[destPos++] = srcByte & 8 ? white : black;\n dest32[destPos++] = srcByte & 4 ? white : black;\n dest32[destPos++] = srcByte & 2 ? white : black;\n dest32[destPos++] = srcByte & 1 ? white : black;\n }\n for (; k < kEnd; k++) {\n if (mask === 0) {\n srcByte = src[srcPos++];\n mask = 128;\n }\n\n dest32[destPos++] = srcByte & mask ? white : black;\n mask >>= 1;\n }\n }\n // We ran out of input. Make all remaining pixels transparent.\n while (destPos < dest32DataLength) {\n dest32[destPos++] = 0;\n }\n\n ctx.putImageData(chunkImgData, 0, i * FULL_CHUNK_HEIGHT);\n }\n } else if (imgData.kind === ImageKind.RGBA_32BPP) {\n // RGBA, 32-bits per pixel.\n j = 0;\n elemsInThisChunk = width * FULL_CHUNK_HEIGHT * 4;\n for (i = 0; i < fullChunks; i++) {\n dest.set(src.subarray(srcPos, srcPos + elemsInThisChunk));\n srcPos += elemsInThisChunk;\n\n ctx.putImageData(chunkImgData, 0, j);\n j += FULL_CHUNK_HEIGHT;\n }\n if (i < totalChunks) {\n elemsInThisChunk = width * partialChunkHeight * 4;\n dest.set(src.subarray(srcPos, srcPos + elemsInThisChunk));\n\n ctx.putImageData(chunkImgData, 0, j);\n }\n } else if (imgData.kind === ImageKind.RGB_24BPP) {\n // RGB, 24-bits per pixel.\n thisChunkHeight = FULL_CHUNK_HEIGHT;\n elemsInThisChunk = width * thisChunkHeight;\n for (i = 0; i < totalChunks; i++) {\n if (i >= fullChunks) {\n thisChunkHeight = partialChunkHeight;\n elemsInThisChunk = width * thisChunkHeight;\n }\n\n destPos = 0;\n for (j = elemsInThisChunk; j--; ) {\n dest[destPos++] = src[srcPos++];\n dest[destPos++] = src[srcPos++];\n dest[destPos++] = src[srcPos++];\n dest[destPos++] = 255;\n }\n\n ctx.putImageData(chunkImgData, 0, i * FULL_CHUNK_HEIGHT);\n }\n } else {\n throw new Error(`bad image kind: ${imgData.kind}`);\n }\n}\n\nfunction putBinaryImageMask(ctx, imgData) {\n if (imgData.bitmap) {\n // The bitmap has been created in the worker.\n ctx.drawImage(imgData.bitmap, 0, 0);\n return;\n }\n\n // Slow path: OffscreenCanvas isn't available in the worker.\n const height = imgData.height,\n width = imgData.width;\n const partialChunkHeight = height % FULL_CHUNK_HEIGHT;\n const fullChunks = (height - partialChunkHeight) / FULL_CHUNK_HEIGHT;\n const totalChunks = partialChunkHeight === 0 ? fullChunks : fullChunks + 1;\n\n const chunkImgData = ctx.createImageData(width, FULL_CHUNK_HEIGHT);\n let srcPos = 0;\n const src = imgData.data;\n const dest = chunkImgData.data;\n\n for (let i = 0; i < totalChunks; i++) {\n const thisChunkHeight =\n i < fullChunks ? FULL_CHUNK_HEIGHT : partialChunkHeight;\n\n // Expand the mask so it can be used by the canvas. Any required\n // inversion has already been handled.\n\n ({ srcPos } = convertBlackAndWhiteToRGBA({\n src,\n srcPos,\n dest,\n width,\n height: thisChunkHeight,\n nonBlackColor: 0,\n }));\n\n ctx.putImageData(chunkImgData, 0, i * FULL_CHUNK_HEIGHT);\n }\n}\n\nfunction copyCtxState(sourceCtx, destCtx) {\n const properties = [\n \"strokeStyle\",\n \"fillStyle\",\n \"fillRule\",\n \"globalAlpha\",\n \"lineWidth\",\n \"lineCap\",\n \"lineJoin\",\n \"miterLimit\",\n \"globalCompositeOperation\",\n \"font\",\n \"filter\",\n ];\n for (const property of properties) {\n if (sourceCtx[property] !== undefined) {\n destCtx[property] = sourceCtx[property];\n }\n }\n if (sourceCtx.setLineDash !== undefined) {\n destCtx.setLineDash(sourceCtx.getLineDash());\n destCtx.lineDashOffset = sourceCtx.lineDashOffset;\n }\n}\n\nfunction resetCtxToDefault(ctx) {\n ctx.strokeStyle = ctx.fillStyle = \"#000000\";\n ctx.fillRule = \"nonzero\";\n ctx.globalAlpha = 1;\n ctx.lineWidth = 1;\n ctx.lineCap = \"butt\";\n ctx.lineJoin = \"miter\";\n ctx.miterLimit = 10;\n ctx.globalCompositeOperation = \"source-over\";\n ctx.font = \"10px sans-serif\";\n if (ctx.setLineDash !== undefined) {\n ctx.setLineDash([]);\n ctx.lineDashOffset = 0;\n }\n if (\n (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) ||\n !isNodeJS\n ) {\n const { filter } = ctx;\n if (filter !== \"none\" && filter !== \"\") {\n ctx.filter = \"none\";\n }\n }\n}\n\nfunction getImageSmoothingEnabled(transform, interpolate) {\n // In section 8.9.5.3 of the PDF spec, it's mentioned that the interpolate\n // flag should be used when the image is upscaled.\n // In Firefox, smoothing is always used when downscaling images (bug 1360415).\n\n if (interpolate) {\n return true;\n }\n\n const scale = Util.singularValueDecompose2dScale(transform);\n // Round to a 32bit float so that `<=` check below will pass for numbers that\n // are very close, but not exactly the same 64bit floats.\n scale[0] = Math.fround(scale[0]);\n scale[1] = Math.fround(scale[1]);\n const actualScale = Math.fround(\n (globalThis.devicePixelRatio || 1) * PixelsPerInch.PDF_TO_CSS_UNITS\n );\n return scale[0] <= actualScale && scale[1] <= actualScale;\n}\n\nconst LINE_CAP_STYLES = [\"butt\", \"round\", \"square\"];\nconst LINE_JOIN_STYLES = [\"miter\", \"round\", \"bevel\"];\nconst NORMAL_CLIP = {};\nconst EO_CLIP = {};\n\nclass CanvasGraphics {\n constructor(\n canvasCtx,\n commonObjs,\n objs,\n canvasFactory,\n filterFactory,\n { optionalContentConfig, markedContentStack = null },\n annotationCanvasMap,\n pageColors\n ) {\n this.ctx = canvasCtx;\n this.current = new CanvasExtraState(\n this.ctx.canvas.width,\n this.ctx.canvas.height\n );\n this.stateStack = [];\n this.pendingClip = null;\n this.pendingEOFill = false;\n this.res = null;\n this.xobjs = null;\n this.commonObjs = commonObjs;\n this.objs = objs;\n this.canvasFactory = canvasFactory;\n this.filterFactory = filterFactory;\n this.groupStack = [];\n this.processingType3 = null;\n // Patterns are painted relative to the initial page/form transform, see\n // PDF spec 8.7.2 NOTE 1.\n this.baseTransform = null;\n this.baseTransformStack = [];\n this.groupLevel = 0;\n this.smaskStack = [];\n this.smaskCounter = 0;\n this.tempSMask = null;\n this.suspendedCtx = null;\n this.contentVisible = true;\n this.markedContentStack = markedContentStack || [];\n this.optionalContentConfig = optionalContentConfig;\n this.cachedCanvases = new CachedCanvases(this.canvasFactory);\n this.cachedPatterns = new Map();\n this.annotationCanvasMap = annotationCanvasMap;\n this.viewportScale = 1;\n this.outputScaleX = 1;\n this.outputScaleY = 1;\n this.pageColors = pageColors;\n\n this._cachedScaleForStroking = [-1, 0];\n this._cachedGetSinglePixelWidth = null;\n this._cachedBitmapsMap = new Map();\n }\n\n getObject(data, fallback = null) {\n if (typeof data === \"string\") {\n return data.startsWith(\"g_\")\n ? this.commonObjs.get(data)\n : this.objs.get(data);\n }\n return fallback;\n }\n\n beginDrawing({\n transform,\n viewport,\n transparency = false,\n background = null,\n }) {\n // For pdfs that use blend modes we have to clear the canvas else certain\n // blend modes can look wrong since we'd be blending with a white\n // backdrop. The problem with a transparent backdrop though is we then\n // don't get sub pixel anti aliasing on text, creating temporary\n // transparent canvas when we have blend modes.\n const width = this.ctx.canvas.width;\n const height = this.ctx.canvas.height;\n\n const savedFillStyle = this.ctx.fillStyle;\n this.ctx.fillStyle = background || \"#ffffff\";\n this.ctx.fillRect(0, 0, width, height);\n this.ctx.fillStyle = savedFillStyle;\n\n if (transparency) {\n const transparentCanvas = this.cachedCanvases.getCanvas(\n \"transparent\",\n width,\n height\n );\n this.compositeCtx = this.ctx;\n this.transparentCanvas = transparentCanvas.canvas;\n this.ctx = transparentCanvas.context;\n this.ctx.save();\n // The transform can be applied before rendering, transferring it to\n // the new canvas.\n this.ctx.transform(...getCurrentTransform(this.compositeCtx));\n }\n\n this.ctx.save();\n resetCtxToDefault(this.ctx);\n if (transform) {\n this.ctx.transform(...transform);\n this.outputScaleX = transform[0];\n this.outputScaleY = transform[0];\n }\n this.ctx.transform(...viewport.transform);\n this.viewportScale = viewport.scale;\n\n this.baseTransform = getCurrentTransform(this.ctx);\n }\n\n executeOperatorList(\n operatorList,\n executionStartIdx,\n continueCallback,\n stepper\n ) {\n const argsArray = operatorList.argsArray;\n const fnArray = operatorList.fnArray;\n let i = executionStartIdx || 0;\n const argsArrayLen = argsArray.length;\n\n // Sometimes the OperatorList to execute is empty.\n if (argsArrayLen === i) {\n return i;\n }\n\n const chunkOperations =\n argsArrayLen - i > EXECUTION_STEPS &&\n typeof continueCallback === \"function\";\n const endTime = chunkOperations ? Date.now() + EXECUTION_TIME : 0;\n let steps = 0;\n\n const commonObjs = this.commonObjs;\n const objs = this.objs;\n let fnId;\n\n while (true) {\n if (stepper !== undefined && i === stepper.nextBreakPoint) {\n stepper.breakIt(i, continueCallback);\n return i;\n }\n\n fnId = fnArray[i];\n\n if (fnId !== OPS.dependency) {\n // eslint-disable-next-line prefer-spread\n this[fnId].apply(this, argsArray[i]);\n } else {\n for (const depObjId of argsArray[i]) {\n const objsPool = depObjId.startsWith(\"g_\") ? commonObjs : objs;\n\n // If the promise isn't resolved yet, add the continueCallback\n // to the promise and bail out.\n if (!objsPool.has(depObjId)) {\n objsPool.get(depObjId, continueCallback);\n return i;\n }\n }\n }\n\n i++;\n\n // If the entire operatorList was executed, stop as were done.\n if (i === argsArrayLen) {\n return i;\n }\n\n // If the execution took longer then a certain amount of time and\n // `continueCallback` is specified, interrupt the execution.\n if (chunkOperations && ++steps > EXECUTION_STEPS) {\n if (Date.now() > endTime) {\n continueCallback();\n return i;\n }\n steps = 0;\n }\n\n // If the operatorList isn't executed completely yet OR the execution\n // time was short enough, do another execution round.\n }\n }\n\n #restoreInitialState() {\n // Finishing all opened operations such as SMask group painting.\n while (this.stateStack.length || this.inSMaskMode) {\n this.restore();\n }\n\n this.ctx.restore();\n\n if (this.transparentCanvas) {\n this.ctx = this.compositeCtx;\n this.ctx.save();\n this.ctx.setTransform(1, 0, 0, 1, 0, 0); // Avoid apply transform twice\n this.ctx.drawImage(this.transparentCanvas, 0, 0);\n this.ctx.restore();\n this.transparentCanvas = null;\n }\n }\n\n endDrawing() {\n this.#restoreInitialState();\n\n this.cachedCanvases.clear();\n this.cachedPatterns.clear();\n\n for (const cache of this._cachedBitmapsMap.values()) {\n for (const canvas of cache.values()) {\n if (\n typeof HTMLCanvasElement !== \"undefined\" &&\n canvas instanceof HTMLCanvasElement\n ) {\n canvas.width = canvas.height = 0;\n }\n }\n cache.clear();\n }\n this._cachedBitmapsMap.clear();\n this.#drawFilter();\n }\n\n #drawFilter() {\n if (this.pageColors) {\n const hcmFilterId = this.filterFactory.addHCMFilter(\n this.pageColors.foreground,\n this.pageColors.background\n );\n if (hcmFilterId !== \"none\") {\n const savedFilter = this.ctx.filter;\n this.ctx.filter = hcmFilterId;\n this.ctx.drawImage(this.ctx.canvas, 0, 0);\n this.ctx.filter = savedFilter;\n }\n }\n }\n\n _scaleImage(img, inverseTransform) {\n // Vertical or horizontal scaling shall not be more than 2 to not lose the\n // pixels during drawImage operation, painting on the temporary canvas(es)\n // that are twice smaller in size.\n const width = img.width;\n const height = img.height;\n let widthScale = Math.max(\n Math.hypot(inverseTransform[0], inverseTransform[1]),\n 1\n );\n let heightScale = Math.max(\n Math.hypot(inverseTransform[2], inverseTransform[3]),\n 1\n );\n\n let paintWidth = width,\n paintHeight = height;\n let tmpCanvasId = \"prescale1\";\n let tmpCanvas, tmpCtx;\n while (\n (widthScale > 2 && paintWidth > 1) ||\n (heightScale > 2 && paintHeight > 1)\n ) {\n let newWidth = paintWidth,\n newHeight = paintHeight;\n if (widthScale > 2 && paintWidth > 1) {\n // See bug 1820511 (Windows specific bug).\n // TODO: once the above bug is fixed we could revert to:\n // newWidth = Math.ceil(paintWidth / 2);\n newWidth =\n paintWidth >= 16384\n ? Math.floor(paintWidth / 2) - 1 || 1\n : Math.ceil(paintWidth / 2);\n widthScale /= paintWidth / newWidth;\n }\n if (heightScale > 2 && paintHeight > 1) {\n // TODO: see the comment above.\n newHeight =\n paintHeight >= 16384\n ? Math.floor(paintHeight / 2) - 1 || 1\n : Math.ceil(paintHeight) / 2;\n heightScale /= paintHeight / newHeight;\n }\n tmpCanvas = this.cachedCanvases.getCanvas(\n tmpCanvasId,\n newWidth,\n newHeight\n );\n tmpCtx = tmpCanvas.context;\n tmpCtx.clearRect(0, 0, newWidth, newHeight);\n tmpCtx.drawImage(\n img,\n 0,\n 0,\n paintWidth,\n paintHeight,\n 0,\n 0,\n newWidth,\n newHeight\n );\n img = tmpCanvas.canvas;\n paintWidth = newWidth;\n paintHeight = newHeight;\n tmpCanvasId = tmpCanvasId === \"prescale1\" ? \"prescale2\" : \"prescale1\";\n }\n return {\n img,\n paintWidth,\n paintHeight,\n };\n }\n\n _createMaskCanvas(img) {\n const ctx = this.ctx;\n const { width, height } = img;\n const fillColor = this.current.fillColor;\n const isPatternFill = this.current.patternFill;\n const currentTransform = getCurrentTransform(ctx);\n\n let cache, cacheKey, scaled, maskCanvas;\n if ((img.bitmap || img.data) && img.count > 1) {\n const mainKey = img.bitmap || img.data.buffer;\n // We're reusing the same image several times, so we can cache it.\n // In case we've a pattern fill we just keep the scaled version of\n // the image.\n // Only the scaling part matters, the translation part is just used\n // to compute offsets (but not when filling patterns see #15573).\n // TODO: handle the case of a pattern fill if it's possible.\n cacheKey = JSON.stringify(\n isPatternFill\n ? currentTransform\n : [currentTransform.slice(0, 4), fillColor]\n );\n\n cache = this._cachedBitmapsMap.get(mainKey);\n if (!cache) {\n cache = new Map();\n this._cachedBitmapsMap.set(mainKey, cache);\n }\n const cachedImage = cache.get(cacheKey);\n if (cachedImage && !isPatternFill) {\n const offsetX = Math.round(\n Math.min(currentTransform[0], currentTransform[2]) +\n currentTransform[4]\n );\n const offsetY = Math.round(\n Math.min(currentTransform[1], currentTransform[3]) +\n currentTransform[5]\n );\n return {\n canvas: cachedImage,\n offsetX,\n offsetY,\n };\n }\n scaled = cachedImage;\n }\n\n if (!scaled) {\n maskCanvas = this.cachedCanvases.getCanvas(\"maskCanvas\", width, height);\n putBinaryImageMask(maskCanvas.context, img);\n }\n\n // Create the mask canvas at the size it will be drawn at and also set\n // its transform to match the current transform so if there are any\n // patterns applied they will be applied relative to the correct\n // transform.\n\n let maskToCanvas = Util.transform(currentTransform, [\n 1 / width,\n 0,\n 0,\n -1 / height,\n 0,\n 0,\n ]);\n maskToCanvas = Util.transform(maskToCanvas, [1, 0, 0, 1, 0, -height]);\n const [minX, minY, maxX, maxY] = Util.getAxialAlignedBoundingBox(\n [0, 0, width, height],\n maskToCanvas\n );\n const drawnWidth = Math.round(maxX - minX) || 1;\n const drawnHeight = Math.round(maxY - minY) || 1;\n const fillCanvas = this.cachedCanvases.getCanvas(\n \"fillCanvas\",\n drawnWidth,\n drawnHeight\n );\n const fillCtx = fillCanvas.context;\n\n // The offset will be the top-left cordinate mask.\n // If objToCanvas is [a,b,c,d,e,f] then:\n // - offsetX = min(a, c) + e\n // - offsetY = min(b, d) + f\n const offsetX = minX;\n const offsetY = minY;\n fillCtx.translate(-offsetX, -offsetY);\n fillCtx.transform(...maskToCanvas);\n\n if (!scaled) {\n // Pre-scale if needed to improve image smoothing.\n scaled = this._scaleImage(\n maskCanvas.canvas,\n getCurrentTransformInverse(fillCtx)\n );\n scaled = scaled.img;\n if (cache && isPatternFill) {\n cache.set(cacheKey, scaled);\n }\n }\n\n fillCtx.imageSmoothingEnabled = getImageSmoothingEnabled(\n getCurrentTransform(fillCtx),\n img.interpolate\n );\n\n drawImageAtIntegerCoords(\n fillCtx,\n scaled,\n 0,\n 0,\n scaled.width,\n scaled.height,\n 0,\n 0,\n width,\n height\n );\n fillCtx.globalCompositeOperation = \"source-in\";\n\n const inverse = Util.transform(getCurrentTransformInverse(fillCtx), [\n 1,\n 0,\n 0,\n 1,\n -offsetX,\n -offsetY,\n ]);\n fillCtx.fillStyle = isPatternFill\n ? fillColor.getPattern(ctx, this, inverse, PathType.FILL)\n : fillColor;\n\n fillCtx.fillRect(0, 0, width, height);\n\n if (cache && !isPatternFill) {\n // The fill canvas is put in the cache associated to the mask image\n // so we must remove from the cached canvas: it mustn't be used again.\n this.cachedCanvases.delete(\"fillCanvas\");\n cache.set(cacheKey, fillCanvas.canvas);\n }\n\n // Round the offsets to avoid drawing fractional pixels.\n return {\n canvas: fillCanvas.canvas,\n offsetX: Math.round(offsetX),\n offsetY: Math.round(offsetY),\n };\n }\n\n // Graphics state\n setLineWidth(width) {\n if (width !== this.current.lineWidth) {\n this._cachedScaleForStroking[0] = -1;\n }\n this.current.lineWidth = width;\n this.ctx.lineWidth = width;\n }\n\n setLineCap(style) {\n this.ctx.lineCap = LINE_CAP_STYLES[style];\n }\n\n setLineJoin(style) {\n this.ctx.lineJoin = LINE_JOIN_STYLES[style];\n }\n\n setMiterLimit(limit) {\n this.ctx.miterLimit = limit;\n }\n\n setDash(dashArray, dashPhase) {\n const ctx = this.ctx;\n if (ctx.setLineDash !== undefined) {\n ctx.setLineDash(dashArray);\n ctx.lineDashOffset = dashPhase;\n }\n }\n\n setRenderingIntent(intent) {\n // This operation is ignored since we haven't found a use case for it yet.\n }\n\n setFlatness(flatness) {\n // This operation is ignored since we haven't found a use case for it yet.\n }\n\n setGState(states) {\n for (const [key, value] of states) {\n switch (key) {\n case \"LW\":\n this.setLineWidth(value);\n break;\n case \"LC\":\n this.setLineCap(value);\n break;\n case \"LJ\":\n this.setLineJoin(value);\n break;\n case \"ML\":\n this.setMiterLimit(value);\n break;\n case \"D\":\n this.setDash(value[0], value[1]);\n break;\n case \"RI\":\n this.setRenderingIntent(value);\n break;\n case \"FL\":\n this.setFlatness(value);\n break;\n case \"Font\":\n this.setFont(value[0], value[1]);\n break;\n case \"CA\":\n this.current.strokeAlpha = value;\n break;\n case \"ca\":\n this.current.fillAlpha = value;\n this.ctx.globalAlpha = value;\n break;\n case \"BM\":\n this.ctx.globalCompositeOperation = value;\n break;\n case \"SMask\":\n this.current.activeSMask = value ? this.tempSMask : null;\n this.tempSMask = null;\n this.checkSMaskState();\n break;\n case \"TR\":\n this.ctx.filter = this.current.transferMaps =\n this.filterFactory.addFilter(value);\n break;\n }\n }\n }\n\n get inSMaskMode() {\n return !!this.suspendedCtx;\n }\n\n checkSMaskState() {\n const inSMaskMode = this.inSMaskMode;\n if (this.current.activeSMask && !inSMaskMode) {\n this.beginSMaskMode();\n } else if (!this.current.activeSMask && inSMaskMode) {\n this.endSMaskMode();\n }\n // Else, the state is okay and nothing needs to be done.\n }\n\n /**\n * Soft mask mode takes the current main drawing canvas and replaces it with\n * a temporary canvas. Any drawing operations that happen on the temporary\n * canvas need to be composed with the main canvas that was suspended (see\n * `compose()`). The temporary canvas also duplicates many of its operations\n * on the suspended canvas to keep them in sync, so that when the soft mask\n * mode ends any clipping paths or transformations will still be active and in\n * the right order on the canvas' graphics state stack.\n */\n beginSMaskMode() {\n if (this.inSMaskMode) {\n throw new Error(\"beginSMaskMode called while already in smask mode\");\n }\n const drawnWidth = this.ctx.canvas.width;\n const drawnHeight = this.ctx.canvas.height;\n const cacheId = \"smaskGroupAt\" + this.groupLevel;\n const scratchCanvas = this.cachedCanvases.getCanvas(\n cacheId,\n drawnWidth,\n drawnHeight\n );\n this.suspendedCtx = this.ctx;\n this.ctx = scratchCanvas.context;\n const ctx = this.ctx;\n ctx.setTransform(...getCurrentTransform(this.suspendedCtx));\n copyCtxState(this.suspendedCtx, ctx);\n mirrorContextOperations(ctx, this.suspendedCtx);\n\n this.setGState([\n [\"BM\", \"source-over\"],\n [\"ca\", 1],\n [\"CA\", 1],\n ]);\n }\n\n endSMaskMode() {\n if (!this.inSMaskMode) {\n throw new Error(\"endSMaskMode called while not in smask mode\");\n }\n // The soft mask is done, now restore the suspended canvas as the main\n // drawing canvas.\n this.ctx._removeMirroring();\n copyCtxState(this.ctx, this.suspendedCtx);\n this.ctx = this.suspendedCtx;\n\n this.suspendedCtx = null;\n }\n\n compose(dirtyBox) {\n if (!this.current.activeSMask) {\n return;\n }\n\n if (!dirtyBox) {\n dirtyBox = [0, 0, this.ctx.canvas.width, this.ctx.canvas.height];\n } else {\n dirtyBox[0] = Math.floor(dirtyBox[0]);\n dirtyBox[1] = Math.floor(dirtyBox[1]);\n dirtyBox[2] = Math.ceil(dirtyBox[2]);\n dirtyBox[3] = Math.ceil(dirtyBox[3]);\n }\n const smask = this.current.activeSMask;\n const suspendedCtx = this.suspendedCtx;\n\n this.composeSMask(suspendedCtx, smask, this.ctx, dirtyBox);\n // Whatever was drawn has been moved to the suspended canvas, now clear it\n // out of the current canvas.\n this.ctx.save();\n this.ctx.setTransform(1, 0, 0, 1, 0, 0);\n this.ctx.clearRect(0, 0, this.ctx.canvas.width, this.ctx.canvas.height);\n this.ctx.restore();\n }\n\n composeSMask(ctx, smask, layerCtx, layerBox) {\n const layerOffsetX = layerBox[0];\n const layerOffsetY = layerBox[1];\n const layerWidth = layerBox[2] - layerOffsetX;\n const layerHeight = layerBox[3] - layerOffsetY;\n if (layerWidth === 0 || layerHeight === 0) {\n return;\n }\n this.genericComposeSMask(\n smask.context,\n layerCtx,\n layerWidth,\n layerHeight,\n smask.subtype,\n smask.backdrop,\n smask.transferMap,\n layerOffsetX,\n layerOffsetY,\n smask.offsetX,\n smask.offsetY\n );\n ctx.save();\n ctx.globalAlpha = 1;\n ctx.globalCompositeOperation = \"source-over\";\n ctx.setTransform(1, 0, 0, 1, 0, 0);\n ctx.drawImage(layerCtx.canvas, 0, 0);\n ctx.restore();\n }\n\n genericComposeSMask(\n maskCtx,\n layerCtx,\n width,\n height,\n subtype,\n backdrop,\n transferMap,\n layerOffsetX,\n layerOffsetY,\n maskOffsetX,\n maskOffsetY\n ) {\n let maskCanvas = maskCtx.canvas;\n let maskX = layerOffsetX - maskOffsetX;\n let maskY = layerOffsetY - maskOffsetY;\n\n if (backdrop) {\n if (\n maskX < 0 ||\n maskY < 0 ||\n maskX + width > maskCanvas.width ||\n maskY + height > maskCanvas.height\n ) {\n const canvas = this.cachedCanvases.getCanvas(\n \"maskExtension\",\n width,\n height\n );\n const ctx = canvas.context;\n ctx.drawImage(maskCanvas, -maskX, -maskY);\n if (backdrop.some(c => c !== 0)) {\n ctx.globalCompositeOperation = \"destination-atop\";\n ctx.fillStyle = Util.makeHexColor(...backdrop);\n ctx.fillRect(0, 0, width, height);\n ctx.globalCompositeOperation = \"source-over\";\n }\n\n maskCanvas = canvas.canvas;\n maskX = maskY = 0;\n } else if (backdrop.some(c => c !== 0)) {\n maskCtx.save();\n maskCtx.globalAlpha = 1;\n maskCtx.setTransform(1, 0, 0, 1, 0, 0);\n const clip = new Path2D();\n clip.rect(maskX, maskY, width, height);\n maskCtx.clip(clip);\n maskCtx.globalCompositeOperation = \"destination-atop\";\n maskCtx.fillStyle = Util.makeHexColor(...backdrop);\n maskCtx.fillRect(maskX, maskY, width, height);\n maskCtx.restore();\n }\n }\n\n layerCtx.save();\n layerCtx.globalAlpha = 1;\n layerCtx.setTransform(1, 0, 0, 1, 0, 0);\n\n if (subtype === \"Alpha\" && transferMap) {\n layerCtx.filter = this.filterFactory.addAlphaFilter(transferMap);\n } else if (subtype === \"Luminosity\") {\n layerCtx.filter = this.filterFactory.addLuminosityFilter(transferMap);\n }\n\n const clip = new Path2D();\n clip.rect(layerOffsetX, layerOffsetY, width, height);\n layerCtx.clip(clip);\n layerCtx.globalCompositeOperation = \"destination-in\";\n layerCtx.drawImage(\n maskCanvas,\n maskX,\n maskY,\n width,\n height,\n layerOffsetX,\n layerOffsetY,\n width,\n height\n );\n layerCtx.restore();\n }\n\n save() {\n if (this.inSMaskMode) {\n // SMask mode may be turned on/off causing us to lose graphics state.\n // Copy the temporary canvas state to the main(suspended) canvas to keep\n // it in sync.\n copyCtxState(this.ctx, this.suspendedCtx);\n // Don't bother calling save on the temporary canvas since state is not\n // saved there.\n this.suspendedCtx.save();\n } else {\n this.ctx.save();\n }\n const old = this.current;\n this.stateStack.push(old);\n this.current = old.clone();\n }\n\n restore() {\n if (this.stateStack.length === 0 && this.inSMaskMode) {\n this.endSMaskMode();\n }\n if (this.stateStack.length !== 0) {\n this.current = this.stateStack.pop();\n if (this.inSMaskMode) {\n // Graphics state is stored on the main(suspended) canvas. Restore its\n // state then copy it over to the temporary canvas.\n this.suspendedCtx.restore();\n copyCtxState(this.suspendedCtx, this.ctx);\n } else {\n this.ctx.restore();\n }\n this.checkSMaskState();\n\n // Ensure that the clipping path is reset (fixes issue6413.pdf).\n this.pendingClip = null;\n\n this._cachedScaleForStroking[0] = -1;\n this._cachedGetSinglePixelWidth = null;\n }\n }\n\n transform(a, b, c, d, e, f) {\n this.ctx.transform(a, b, c, d, e, f);\n\n this._cachedScaleForStroking[0] = -1;\n this._cachedGetSinglePixelWidth = null;\n }\n\n // Path\n constructPath(ops, args, minMax) {\n const ctx = this.ctx;\n const current = this.current;\n let x = current.x,\n y = current.y;\n let startX, startY;\n const currentTransform = getCurrentTransform(ctx);\n\n // Most of the time the current transform is a scaling matrix\n // so we don't need to transform points before computing min/max:\n // we can compute min/max first and then smartly \"apply\" the\n // transform (see Util.scaleMinMax).\n // For rectangle, moveTo and lineTo, min/max are computed in the\n // worker (see evaluator.js).\n const isScalingMatrix =\n (currentTransform[0] === 0 && currentTransform[3] === 0) ||\n (currentTransform[1] === 0 && currentTransform[2] === 0);\n const minMaxForBezier = isScalingMatrix ? minMax.slice(0) : null;\n\n for (let i = 0, j = 0, ii = ops.length; i < ii; i++) {\n switch (ops[i] | 0) {\n case OPS.rectangle:\n x = args[j++];\n y = args[j++];\n const width = args[j++];\n const height = args[j++];\n\n const xw = x + width;\n const yh = y + height;\n ctx.moveTo(x, y);\n if (width === 0 || height === 0) {\n ctx.lineTo(xw, yh);\n } else {\n ctx.lineTo(xw, y);\n ctx.lineTo(xw, yh);\n ctx.lineTo(x, yh);\n }\n if (!isScalingMatrix) {\n current.updateRectMinMax(currentTransform, [x, y, xw, yh]);\n }\n ctx.closePath();\n break;\n case OPS.moveTo:\n x = args[j++];\n y = args[j++];\n ctx.moveTo(x, y);\n if (!isScalingMatrix) {\n current.updatePathMinMax(currentTransform, x, y);\n }\n break;\n case OPS.lineTo:\n x = args[j++];\n y = args[j++];\n ctx.lineTo(x, y);\n if (!isScalingMatrix) {\n current.updatePathMinMax(currentTransform, x, y);\n }\n break;\n case OPS.curveTo:\n startX = x;\n startY = y;\n x = args[j + 4];\n y = args[j + 5];\n ctx.bezierCurveTo(\n args[j],\n args[j + 1],\n args[j + 2],\n args[j + 3],\n x,\n y\n );\n current.updateCurvePathMinMax(\n currentTransform,\n startX,\n startY,\n args[j],\n args[j + 1],\n args[j + 2],\n args[j + 3],\n x,\n y,\n minMaxForBezier\n );\n j += 6;\n break;\n case OPS.curveTo2:\n startX = x;\n startY = y;\n ctx.bezierCurveTo(\n x,\n y,\n args[j],\n args[j + 1],\n args[j + 2],\n args[j + 3]\n );\n current.updateCurvePathMinMax(\n currentTransform,\n startX,\n startY,\n x,\n y,\n args[j],\n args[j + 1],\n args[j + 2],\n args[j + 3],\n minMaxForBezier\n );\n x = args[j + 2];\n y = args[j + 3];\n j += 4;\n break;\n case OPS.curveTo3:\n startX = x;\n startY = y;\n x = args[j + 2];\n y = args[j + 3];\n ctx.bezierCurveTo(args[j], args[j + 1], x, y, x, y);\n current.updateCurvePathMinMax(\n currentTransform,\n startX,\n startY,\n args[j],\n args[j + 1],\n x,\n y,\n x,\n y,\n minMaxForBezier\n );\n j += 4;\n break;\n case OPS.closePath:\n ctx.closePath();\n break;\n }\n }\n\n if (isScalingMatrix) {\n current.updateScalingPathMinMax(currentTransform, minMaxForBezier);\n }\n\n current.setCurrentPoint(x, y);\n }\n\n closePath() {\n this.ctx.closePath();\n }\n\n stroke(consumePath = true) {\n const ctx = this.ctx;\n const strokeColor = this.current.strokeColor;\n // For stroke we want to temporarily change the global alpha to the\n // stroking alpha.\n ctx.globalAlpha = this.current.strokeAlpha;\n if (this.contentVisible) {\n if (typeof strokeColor === \"object\" && strokeColor?.getPattern) {\n ctx.save();\n ctx.strokeStyle = strokeColor.getPattern(\n ctx,\n this,\n getCurrentTransformInverse(ctx),\n PathType.STROKE\n );\n this.rescaleAndStroke(/* saveRestore */ false);\n ctx.restore();\n } else {\n this.rescaleAndStroke(/* saveRestore */ true);\n }\n }\n if (consumePath) {\n this.consumePath(this.current.getClippedPathBoundingBox());\n }\n // Restore the global alpha to the fill alpha\n ctx.globalAlpha = this.current.fillAlpha;\n }\n\n closeStroke() {\n this.closePath();\n this.stroke();\n }\n\n fill(consumePath = true) {\n const ctx = this.ctx;\n const fillColor = this.current.fillColor;\n const isPatternFill = this.current.patternFill;\n let needRestore = false;\n\n if (isPatternFill) {\n ctx.save();\n ctx.fillStyle = fillColor.getPattern(\n ctx,\n this,\n getCurrentTransformInverse(ctx),\n PathType.FILL\n );\n needRestore = true;\n }\n\n const intersect = this.current.getClippedPathBoundingBox();\n if (this.contentVisible && intersect !== null) {\n if (this.pendingEOFill) {\n ctx.fill(\"evenodd\");\n this.pendingEOFill = false;\n } else {\n ctx.fill();\n }\n }\n\n if (needRestore) {\n ctx.restore();\n }\n if (consumePath) {\n this.consumePath(intersect);\n }\n }\n\n eoFill() {\n this.pendingEOFill = true;\n this.fill();\n }\n\n fillStroke() {\n this.fill(false);\n this.stroke(false);\n\n this.consumePath();\n }\n\n eoFillStroke() {\n this.pendingEOFill = true;\n this.fillStroke();\n }\n\n closeFillStroke() {\n this.closePath();\n this.fillStroke();\n }\n\n closeEOFillStroke() {\n this.pendingEOFill = true;\n this.closePath();\n this.fillStroke();\n }\n\n endPath() {\n this.consumePath();\n }\n\n // Clipping\n clip() {\n this.pendingClip = NORMAL_CLIP;\n }\n\n eoClip() {\n this.pendingClip = EO_CLIP;\n }\n\n // Text\n beginText() {\n this.current.textMatrix = IDENTITY_MATRIX;\n this.current.textMatrixScale = 1;\n this.current.x = this.current.lineX = 0;\n this.current.y = this.current.lineY = 0;\n }\n\n endText() {\n const paths = this.pendingTextPaths;\n const ctx = this.ctx;\n if (paths === undefined) {\n ctx.beginPath();\n return;\n }\n\n ctx.save();\n ctx.beginPath();\n for (const path of paths) {\n ctx.setTransform(...path.transform);\n ctx.translate(path.x, path.y);\n path.addToPath(ctx, path.fontSize);\n }\n ctx.restore();\n ctx.clip();\n ctx.beginPath();\n delete this.pendingTextPaths;\n }\n\n setCharSpacing(spacing) {\n this.current.charSpacing = spacing;\n }\n\n setWordSpacing(spacing) {\n this.current.wordSpacing = spacing;\n }\n\n setHScale(scale) {\n this.current.textHScale = scale / 100;\n }\n\n setLeading(leading) {\n this.current.leading = -leading;\n }\n\n setFont(fontRefName, size) {\n const fontObj = this.commonObjs.get(fontRefName);\n const current = this.current;\n\n if (!fontObj) {\n throw new Error(`Can't find font for ${fontRefName}`);\n }\n current.fontMatrix = fontObj.fontMatrix || FONT_IDENTITY_MATRIX;\n\n // A valid matrix needs all main diagonal elements to be non-zero\n // This also ensures we bypass FF bugzilla bug #719844.\n if (current.fontMatrix[0] === 0 || current.fontMatrix[3] === 0) {\n warn(\"Invalid font matrix for font \" + fontRefName);\n }\n\n // The spec for Tf (setFont) says that 'size' specifies the font 'scale',\n // and in some docs this can be negative (inverted x-y axes).\n if (size < 0) {\n size = -size;\n current.fontDirection = -1;\n } else {\n current.fontDirection = 1;\n }\n\n this.current.font = fontObj;\n this.current.fontSize = size;\n\n if (fontObj.isType3Font) {\n return; // we don't need ctx.font for Type3 fonts\n }\n\n const name = fontObj.loadedName || \"sans-serif\";\n const typeface =\n fontObj.systemFontInfo?.css || `\"${name}\", ${fontObj.fallbackName}`;\n\n let bold = \"normal\";\n if (fontObj.black) {\n bold = \"900\";\n } else if (fontObj.bold) {\n bold = \"bold\";\n }\n const italic = fontObj.italic ? \"italic\" : \"normal\";\n\n // Some font backends cannot handle fonts below certain size.\n // Keeping the font at minimal size and using the fontSizeScale to change\n // the current transformation matrix before the fillText/strokeText.\n // See https://bugzilla.mozilla.org/show_bug.cgi?id=726227\n let browserFontSize = size;\n if (size < MIN_FONT_SIZE) {\n browserFontSize = MIN_FONT_SIZE;\n } else if (size > MAX_FONT_SIZE) {\n browserFontSize = MAX_FONT_SIZE;\n }\n this.current.fontSizeScale = size / browserFontSize;\n\n this.ctx.font = `${italic} ${bold} ${browserFontSize}px ${typeface}`;\n }\n\n setTextRenderingMode(mode) {\n this.current.textRenderingMode = mode;\n }\n\n setTextRise(rise) {\n this.current.textRise = rise;\n }\n\n moveText(x, y) {\n this.current.x = this.current.lineX += x;\n this.current.y = this.current.lineY += y;\n }\n\n setLeadingMoveText(x, y) {\n this.setLeading(-y);\n this.moveText(x, y);\n }\n\n setTextMatrix(a, b, c, d, e, f) {\n this.current.textMatrix = [a, b, c, d, e, f];\n this.current.textMatrixScale = Math.hypot(a, b);\n\n this.current.x = this.current.lineX = 0;\n this.current.y = this.current.lineY = 0;\n }\n\n nextLine() {\n this.moveText(0, this.current.leading);\n }\n\n paintChar(character, x, y, patternTransform) {\n const ctx = this.ctx;\n const current = this.current;\n const font = current.font;\n const textRenderingMode = current.textRenderingMode;\n const fontSize = current.fontSize / current.fontSizeScale;\n const fillStrokeMode =\n textRenderingMode & TextRenderingMode.FILL_STROKE_MASK;\n const isAddToPathSet = !!(\n textRenderingMode & TextRenderingMode.ADD_TO_PATH_FLAG\n );\n const patternFill = current.patternFill && !font.missingFile;\n\n let addToPath;\n if (font.disableFontFace || isAddToPathSet || patternFill) {\n addToPath = font.getPathGenerator(this.commonObjs, character);\n }\n\n if (font.disableFontFace || patternFill) {\n ctx.save();\n ctx.translate(x, y);\n ctx.beginPath();\n addToPath(ctx, fontSize);\n if (patternTransform) {\n ctx.setTransform(...patternTransform);\n }\n if (\n fillStrokeMode === TextRenderingMode.FILL ||\n fillStrokeMode === TextRenderingMode.FILL_STROKE\n ) {\n ctx.fill();\n }\n if (\n fillStrokeMode === TextRenderingMode.STROKE ||\n fillStrokeMode === TextRenderingMode.FILL_STROKE\n ) {\n ctx.stroke();\n }\n ctx.restore();\n } else {\n if (\n fillStrokeMode === TextRenderingMode.FILL ||\n fillStrokeMode === TextRenderingMode.FILL_STROKE\n ) {\n ctx.fillText(character, x, y);\n }\n if (\n fillStrokeMode === TextRenderingMode.STROKE ||\n fillStrokeMode === TextRenderingMode.FILL_STROKE\n ) {\n ctx.strokeText(character, x, y);\n }\n }\n\n if (isAddToPathSet) {\n const paths = (this.pendingTextPaths ||= []);\n paths.push({\n transform: getCurrentTransform(ctx),\n x,\n y,\n fontSize,\n addToPath,\n });\n }\n }\n\n get isFontSubpixelAAEnabled() {\n // Checks if anti-aliasing is enabled when scaled text is painted.\n // On Windows GDI scaled fonts looks bad.\n const { context: ctx } = this.cachedCanvases.getCanvas(\n \"isFontSubpixelAAEnabled\",\n 10,\n 10\n );\n ctx.scale(1.5, 1);\n ctx.fillText(\"I\", 0, 10);\n const data = ctx.getImageData(0, 0, 10, 10).data;\n let enabled = false;\n for (let i = 3; i < data.length; i += 4) {\n if (data[i] > 0 && data[i] < 255) {\n enabled = true;\n break;\n }\n }\n return shadow(this, \"isFontSubpixelAAEnabled\", enabled);\n }\n\n showText(glyphs) {\n const current = this.current;\n const font = current.font;\n if (font.isType3Font) {\n return this.showType3Text(glyphs);\n }\n\n const fontSize = current.fontSize;\n if (fontSize === 0) {\n return undefined;\n }\n\n const ctx = this.ctx;\n const fontSizeScale = current.fontSizeScale;\n const charSpacing = current.charSpacing;\n const wordSpacing = current.wordSpacing;\n const fontDirection = current.fontDirection;\n const textHScale = current.textHScale * fontDirection;\n const glyphsLength = glyphs.length;\n const vertical = font.vertical;\n const spacingDir = vertical ? 1 : -1;\n const defaultVMetrics = font.defaultVMetrics;\n const widthAdvanceScale = fontSize * current.fontMatrix[0];\n\n const simpleFillText =\n current.textRenderingMode === TextRenderingMode.FILL &&\n !font.disableFontFace &&\n !current.patternFill;\n\n ctx.save();\n ctx.transform(...current.textMatrix);\n ctx.translate(current.x, current.y + current.textRise);\n\n if (fontDirection > 0) {\n ctx.scale(textHScale, -1);\n } else {\n ctx.scale(textHScale, 1);\n }\n\n let patternTransform;\n if (current.patternFill) {\n ctx.save();\n const pattern = current.fillColor.getPattern(\n ctx,\n this,\n getCurrentTransformInverse(ctx),\n PathType.FILL\n );\n patternTransform = getCurrentTransform(ctx);\n ctx.restore();\n ctx.fillStyle = pattern;\n }\n\n let lineWidth = current.lineWidth;\n const scale = current.textMatrixScale;\n if (scale === 0 || lineWidth === 0) {\n const fillStrokeMode =\n current.textRenderingMode & TextRenderingMode.FILL_STROKE_MASK;\n if (\n fillStrokeMode === TextRenderingMode.STROKE ||\n fillStrokeMode === TextRenderingMode.FILL_STROKE\n ) {\n lineWidth = this.getSinglePixelWidth();\n }\n } else {\n lineWidth /= scale;\n }\n\n if (fontSizeScale !== 1.0) {\n ctx.scale(fontSizeScale, fontSizeScale);\n lineWidth /= fontSizeScale;\n }\n\n ctx.lineWidth = lineWidth;\n\n if (font.isInvalidPDFjsFont) {\n const chars = [];\n let width = 0;\n for (const glyph of glyphs) {\n chars.push(glyph.unicode);\n width += glyph.width;\n }\n ctx.fillText(chars.join(\"\"), 0, 0);\n current.x += width * widthAdvanceScale * textHScale;\n ctx.restore();\n this.compose();\n\n return undefined;\n }\n\n let x = 0,\n i;\n for (i = 0; i < glyphsLength; ++i) {\n const glyph = glyphs[i];\n if (typeof glyph === \"number\") {\n x += (spacingDir * glyph * fontSize) / 1000;\n continue;\n }\n\n let restoreNeeded = false;\n const spacing = (glyph.isSpace ? wordSpacing : 0) + charSpacing;\n const character = glyph.fontChar;\n const accent = glyph.accent;\n let scaledX, scaledY;\n let width = glyph.width;\n if (vertical) {\n const vmetric = glyph.vmetric || defaultVMetrics;\n const vx =\n -(glyph.vmetric ? vmetric[1] : width * 0.5) * widthAdvanceScale;\n const vy = vmetric[2] * widthAdvanceScale;\n\n width = vmetric ? -vmetric[0] : width;\n scaledX = vx / fontSizeScale;\n scaledY = (x + vy) / fontSizeScale;\n } else {\n scaledX = x / fontSizeScale;\n scaledY = 0;\n }\n\n if (font.remeasure && width > 0) {\n // Some standard fonts may not have the exact width: rescale per\n // character if measured width is greater than expected glyph width\n // and subpixel-aa is enabled, otherwise just center the glyph.\n const measuredWidth =\n ((ctx.measureText(character).width * 1000) / fontSize) *\n fontSizeScale;\n if (width < measuredWidth && this.isFontSubpixelAAEnabled) {\n const characterScaleX = width / measuredWidth;\n restoreNeeded = true;\n ctx.save();\n ctx.scale(characterScaleX, 1);\n scaledX /= characterScaleX;\n } else if (width !== measuredWidth) {\n scaledX +=\n (((width - measuredWidth) / 2000) * fontSize) / fontSizeScale;\n }\n }\n\n // Only attempt to draw the glyph if it is actually in the embedded font\n // file or if there isn't a font file so the fallback font is shown.\n if (this.contentVisible && (glyph.isInFont || font.missingFile)) {\n if (simpleFillText && !accent) {\n // common case\n ctx.fillText(character, scaledX, scaledY);\n } else {\n this.paintChar(character, scaledX, scaledY, patternTransform);\n if (accent) {\n const scaledAccentX =\n scaledX + (fontSize * accent.offset.x) / fontSizeScale;\n const scaledAccentY =\n scaledY - (fontSize * accent.offset.y) / fontSizeScale;\n this.paintChar(\n accent.fontChar,\n scaledAccentX,\n scaledAccentY,\n patternTransform\n );\n }\n }\n }\n\n const charWidth = vertical\n ? width * widthAdvanceScale - spacing * fontDirection\n : width * widthAdvanceScale + spacing * fontDirection;\n x += charWidth;\n\n if (restoreNeeded) {\n ctx.restore();\n }\n }\n if (vertical) {\n current.y -= x;\n } else {\n current.x += x * textHScale;\n }\n ctx.restore();\n this.compose();\n\n return undefined;\n }\n\n showType3Text(glyphs) {\n // Type3 fonts - each glyph is a \"mini-PDF\"\n const ctx = this.ctx;\n const current = this.current;\n const font = current.font;\n const fontSize = current.fontSize;\n const fontDirection = current.fontDirection;\n const spacingDir = font.vertical ? 1 : -1;\n const charSpacing = current.charSpacing;\n const wordSpacing = current.wordSpacing;\n const textHScale = current.textHScale * fontDirection;\n const fontMatrix = current.fontMatrix || FONT_IDENTITY_MATRIX;\n const glyphsLength = glyphs.length;\n const isTextInvisible =\n current.textRenderingMode === TextRenderingMode.INVISIBLE;\n let i, glyph, width, spacingLength;\n\n if (isTextInvisible || fontSize === 0) {\n return;\n }\n this._cachedScaleForStroking[0] = -1;\n this._cachedGetSinglePixelWidth = null;\n\n ctx.save();\n ctx.transform(...current.textMatrix);\n ctx.translate(current.x, current.y);\n\n ctx.scale(textHScale, fontDirection);\n\n for (i = 0; i < glyphsLength; ++i) {\n glyph = glyphs[i];\n if (typeof glyph === \"number\") {\n spacingLength = (spacingDir * glyph * fontSize) / 1000;\n this.ctx.translate(spacingLength, 0);\n current.x += spacingLength * textHScale;\n continue;\n }\n\n const spacing = (glyph.isSpace ? wordSpacing : 0) + charSpacing;\n const operatorList = font.charProcOperatorList[glyph.operatorListId];\n if (!operatorList) {\n warn(`Type3 character \"${glyph.operatorListId}\" is not available.`);\n continue;\n }\n if (this.contentVisible) {\n this.processingType3 = glyph;\n this.save();\n ctx.scale(fontSize, fontSize);\n ctx.transform(...fontMatrix);\n this.executeOperatorList(operatorList);\n this.restore();\n }\n\n const transformed = Util.applyTransform([glyph.width, 0], fontMatrix);\n width = transformed[0] * fontSize + spacing;\n\n ctx.translate(width, 0);\n current.x += width * textHScale;\n }\n ctx.restore();\n this.processingType3 = null;\n }\n\n // Type3 fonts\n setCharWidth(xWidth, yWidth) {\n // We can safely ignore this since the width should be the same\n // as the width in the Widths array.\n }\n\n setCharWidthAndBounds(xWidth, yWidth, llx, lly, urx, ury) {\n this.ctx.rect(llx, lly, urx - llx, ury - lly);\n this.ctx.clip();\n this.endPath();\n }\n\n // Color\n getColorN_Pattern(IR) {\n let pattern;\n if (IR[0] === \"TilingPattern\") {\n const color = IR[1];\n const baseTransform = this.baseTransform || getCurrentTransform(this.ctx);\n const canvasGraphicsFactory = {\n createCanvasGraphics: ctx =>\n new CanvasGraphics(\n ctx,\n this.commonObjs,\n this.objs,\n this.canvasFactory,\n this.filterFactory,\n {\n optionalContentConfig: this.optionalContentConfig,\n markedContentStack: this.markedContentStack,\n }\n ),\n };\n pattern = new TilingPattern(\n IR,\n color,\n this.ctx,\n canvasGraphicsFactory,\n baseTransform\n );\n } else {\n pattern = this._getPattern(IR[1], IR[2]);\n }\n return pattern;\n }\n\n setStrokeColorN() {\n this.current.strokeColor = this.getColorN_Pattern(arguments);\n }\n\n setFillColorN() {\n this.current.fillColor = this.getColorN_Pattern(arguments);\n this.current.patternFill = true;\n }\n\n setStrokeRGBColor(r, g, b) {\n const color = Util.makeHexColor(r, g, b);\n this.ctx.strokeStyle = color;\n this.current.strokeColor = color;\n }\n\n setFillRGBColor(r, g, b) {\n const color = Util.makeHexColor(r, g, b);\n this.ctx.fillStyle = color;\n this.current.fillColor = color;\n this.current.patternFill = false;\n }\n\n _getPattern(objId, matrix = null) {\n let pattern;\n if (this.cachedPatterns.has(objId)) {\n pattern = this.cachedPatterns.get(objId);\n } else {\n pattern = getShadingPattern(this.getObject(objId));\n this.cachedPatterns.set(objId, pattern);\n }\n if (matrix) {\n pattern.matrix = matrix;\n }\n return pattern;\n }\n\n shadingFill(objId) {\n if (!this.contentVisible) {\n return;\n }\n const ctx = this.ctx;\n\n this.save();\n const pattern = this._getPattern(objId);\n ctx.fillStyle = pattern.getPattern(\n ctx,\n this,\n getCurrentTransformInverse(ctx),\n PathType.SHADING\n );\n\n const inv = getCurrentTransformInverse(ctx);\n if (inv) {\n const { width, height } = ctx.canvas;\n const [x0, y0, x1, y1] = Util.getAxialAlignedBoundingBox(\n [0, 0, width, height],\n inv\n );\n\n this.ctx.fillRect(x0, y0, x1 - x0, y1 - y0);\n } else {\n // HACK to draw the gradient onto an infinite rectangle.\n // PDF gradients are drawn across the entire image while\n // Canvas only allows gradients to be drawn in a rectangle\n // The following bug should allow us to remove this.\n // https://bugzilla.mozilla.org/show_bug.cgi?id=664884\n\n this.ctx.fillRect(-1e10, -1e10, 2e10, 2e10);\n }\n\n this.compose(this.current.getClippedPathBoundingBox());\n this.restore();\n }\n\n // Images\n beginInlineImage() {\n unreachable(\"Should not call beginInlineImage\");\n }\n\n beginImageData() {\n unreachable(\"Should not call beginImageData\");\n }\n\n paintFormXObjectBegin(matrix, bbox) {\n if (!this.contentVisible) {\n return;\n }\n this.save();\n this.baseTransformStack.push(this.baseTransform);\n\n if (matrix) {\n this.transform(...matrix);\n }\n this.baseTransform = getCurrentTransform(this.ctx);\n\n if (bbox) {\n const width = bbox[2] - bbox[0];\n const height = bbox[3] - bbox[1];\n this.ctx.rect(bbox[0], bbox[1], width, height);\n this.current.updateRectMinMax(getCurrentTransform(this.ctx), bbox);\n this.clip();\n this.endPath();\n }\n }\n\n paintFormXObjectEnd() {\n if (!this.contentVisible) {\n return;\n }\n this.restore();\n this.baseTransform = this.baseTransformStack.pop();\n }\n\n beginGroup(group) {\n if (!this.contentVisible) {\n return;\n }\n\n this.save();\n // If there's an active soft mask we don't want it enabled for the group, so\n // clear it out. The mask and suspended canvas will be restored in endGroup.\n if (this.inSMaskMode) {\n this.endSMaskMode();\n this.current.activeSMask = null;\n }\n\n const currentCtx = this.ctx;\n // TODO non-isolated groups - according to Rik at adobe non-isolated\n // group results aren't usually that different and they even have tools\n // that ignore this setting. Notes from Rik on implementing:\n // - When you encounter an transparency group, create a new canvas with\n // the dimensions of the bbox\n // - copy the content from the previous canvas to the new canvas\n // - draw as usual\n // - remove the backdrop alpha:\n // alphaNew = 1 - (1 - alpha)/(1 - alphaBackdrop) with 'alpha' the alpha\n // value of your transparency group and 'alphaBackdrop' the alpha of the\n // backdrop\n // - remove background color:\n // colorNew = color - alphaNew *colorBackdrop /(1 - alphaNew)\n if (!group.isolated) {\n info(\"TODO: Support non-isolated groups.\");\n }\n\n // TODO knockout - supposedly possible with the clever use of compositing\n // modes.\n if (group.knockout) {\n warn(\"Knockout groups not supported.\");\n }\n\n const currentTransform = getCurrentTransform(currentCtx);\n if (group.matrix) {\n currentCtx.transform(...group.matrix);\n }\n if (!group.bbox) {\n throw new Error(\"Bounding box is required.\");\n }\n\n // Based on the current transform figure out how big the bounding box\n // will actually be.\n let bounds = Util.getAxialAlignedBoundingBox(\n group.bbox,\n getCurrentTransform(currentCtx)\n );\n // Clip the bounding box to the current canvas.\n const canvasBounds = [\n 0,\n 0,\n currentCtx.canvas.width,\n currentCtx.canvas.height,\n ];\n bounds = Util.intersect(bounds, canvasBounds) || [0, 0, 0, 0];\n // Use ceil in case we're between sizes so we don't create canvas that is\n // too small and make the canvas at least 1x1 pixels.\n const offsetX = Math.floor(bounds[0]);\n const offsetY = Math.floor(bounds[1]);\n const drawnWidth = Math.max(Math.ceil(bounds[2]) - offsetX, 1);\n const drawnHeight = Math.max(Math.ceil(bounds[3]) - offsetY, 1);\n\n this.current.startNewPathAndClipBox([0, 0, drawnWidth, drawnHeight]);\n\n let cacheId = \"groupAt\" + this.groupLevel;\n if (group.smask) {\n // Using two cache entries is case if masks are used one after another.\n cacheId += \"_smask_\" + (this.smaskCounter++ % 2);\n }\n const scratchCanvas = this.cachedCanvases.getCanvas(\n cacheId,\n drawnWidth,\n drawnHeight\n );\n const groupCtx = scratchCanvas.context;\n\n // Since we created a new canvas that is just the size of the bounding box\n // we have to translate the group ctx.\n groupCtx.translate(-offsetX, -offsetY);\n groupCtx.transform(...currentTransform);\n\n if (group.smask) {\n // Saving state and cached mask to be used in setGState.\n this.smaskStack.push({\n canvas: scratchCanvas.canvas,\n context: groupCtx,\n offsetX,\n offsetY,\n subtype: group.smask.subtype,\n backdrop: group.smask.backdrop,\n transferMap: group.smask.transferMap || null,\n startTransformInverse: null, // used during suspend operation\n });\n } else {\n // Setup the current ctx so when the group is popped we draw it at the\n // right location.\n currentCtx.setTransform(1, 0, 0, 1, 0, 0);\n currentCtx.translate(offsetX, offsetY);\n currentCtx.save();\n }\n // The transparency group inherits all off the current graphics state\n // except the blend mode, soft mask, and alpha constants.\n copyCtxState(currentCtx, groupCtx);\n this.ctx = groupCtx;\n this.setGState([\n [\"BM\", \"source-over\"],\n [\"ca\", 1],\n [\"CA\", 1],\n ]);\n this.groupStack.push(currentCtx);\n this.groupLevel++;\n }\n\n endGroup(group) {\n if (!this.contentVisible) {\n return;\n }\n this.groupLevel--;\n const groupCtx = this.ctx;\n const ctx = this.groupStack.pop();\n this.ctx = ctx;\n // Turn off image smoothing to avoid sub pixel interpolation which can\n // look kind of blurry for some pdfs.\n this.ctx.imageSmoothingEnabled = false;\n\n if (group.smask) {\n this.tempSMask = this.smaskStack.pop();\n this.restore();\n } else {\n this.ctx.restore();\n const currentMtx = getCurrentTransform(this.ctx);\n this.restore();\n this.ctx.save();\n this.ctx.setTransform(...currentMtx);\n const dirtyBox = Util.getAxialAlignedBoundingBox(\n [0, 0, groupCtx.canvas.width, groupCtx.canvas.height],\n currentMtx\n );\n this.ctx.drawImage(groupCtx.canvas, 0, 0);\n this.ctx.restore();\n this.compose(dirtyBox);\n }\n }\n\n beginAnnotation(id, rect, transform, matrix, hasOwnCanvas) {\n // The annotations are drawn just after the page content.\n // The page content drawing can potentially have set a transform,\n // a clipping path, whatever...\n // So in order to have something clean, we restore the initial state.\n this.#restoreInitialState();\n resetCtxToDefault(this.ctx);\n\n this.ctx.save();\n this.save();\n\n if (this.baseTransform) {\n this.ctx.setTransform(...this.baseTransform);\n }\n\n if (rect) {\n const width = rect[2] - rect[0];\n const height = rect[3] - rect[1];\n\n if (hasOwnCanvas && this.annotationCanvasMap) {\n transform = transform.slice();\n transform[4] -= rect[0];\n transform[5] -= rect[1];\n\n rect = rect.slice();\n rect[0] = rect[1] = 0;\n rect[2] = width;\n rect[3] = height;\n\n const [scaleX, scaleY] = Util.singularValueDecompose2dScale(\n getCurrentTransform(this.ctx)\n );\n const { viewportScale } = this;\n const canvasWidth = Math.ceil(\n width * this.outputScaleX * viewportScale\n );\n const canvasHeight = Math.ceil(\n height * this.outputScaleY * viewportScale\n );\n\n this.annotationCanvas = this.canvasFactory.create(\n canvasWidth,\n canvasHeight\n );\n const { canvas, context } = this.annotationCanvas;\n this.annotationCanvasMap.set(id, canvas);\n this.annotationCanvas.savedCtx = this.ctx;\n this.ctx = context;\n this.ctx.save();\n this.ctx.setTransform(scaleX, 0, 0, -scaleY, 0, height * scaleY);\n\n resetCtxToDefault(this.ctx);\n } else {\n resetCtxToDefault(this.ctx);\n\n this.ctx.rect(rect[0], rect[1], width, height);\n this.ctx.clip();\n this.endPath();\n }\n }\n\n this.current = new CanvasExtraState(\n this.ctx.canvas.width,\n this.ctx.canvas.height\n );\n\n this.transform(...transform);\n this.transform(...matrix);\n }\n\n endAnnotation() {\n if (this.annotationCanvas) {\n this.ctx.restore();\n this.#drawFilter();\n\n this.ctx = this.annotationCanvas.savedCtx;\n delete this.annotationCanvas.savedCtx;\n delete this.annotationCanvas;\n }\n }\n\n paintImageMaskXObject(img) {\n if (!this.contentVisible) {\n return;\n }\n const count = img.count;\n img = this.getObject(img.data, img);\n img.count = count;\n\n const ctx = this.ctx;\n const glyph = this.processingType3;\n\n if (glyph) {\n if (glyph.compiled === undefined) {\n glyph.compiled = compileType3Glyph(img);\n }\n\n if (glyph.compiled) {\n glyph.compiled(ctx);\n return;\n }\n }\n const mask = this._createMaskCanvas(img);\n const maskCanvas = mask.canvas;\n\n ctx.save();\n // The mask is drawn with the transform applied. Reset the current\n // transform to draw to the identity.\n ctx.setTransform(1, 0, 0, 1, 0, 0);\n ctx.drawImage(maskCanvas, mask.offsetX, mask.offsetY);\n ctx.restore();\n this.compose();\n }\n\n paintImageMaskXObjectRepeat(\n img,\n scaleX,\n skewX = 0,\n skewY = 0,\n scaleY,\n positions\n ) {\n if (!this.contentVisible) {\n return;\n }\n\n img = this.getObject(img.data, img);\n\n const ctx = this.ctx;\n ctx.save();\n const currentTransform = getCurrentTransform(ctx);\n ctx.transform(scaleX, skewX, skewY, scaleY, 0, 0);\n const mask = this._createMaskCanvas(img);\n\n ctx.setTransform(\n 1,\n 0,\n 0,\n 1,\n mask.offsetX - currentTransform[4],\n mask.offsetY - currentTransform[5]\n );\n for (let i = 0, ii = positions.length; i < ii; i += 2) {\n const trans = Util.transform(currentTransform, [\n scaleX,\n skewX,\n skewY,\n scaleY,\n positions[i],\n positions[i + 1],\n ]);\n\n const [x, y] = Util.applyTransform([0, 0], trans);\n ctx.drawImage(mask.canvas, x, y);\n }\n ctx.restore();\n this.compose();\n }\n\n paintImageMaskXObjectGroup(images) {\n if (!this.contentVisible) {\n return;\n }\n const ctx = this.ctx;\n\n const fillColor = this.current.fillColor;\n const isPatternFill = this.current.patternFill;\n\n for (const image of images) {\n const { data, width, height, transform } = image;\n\n const maskCanvas = this.cachedCanvases.getCanvas(\n \"maskCanvas\",\n width,\n height\n );\n const maskCtx = maskCanvas.context;\n maskCtx.save();\n\n const img = this.getObject(data, image);\n putBinaryImageMask(maskCtx, img);\n\n maskCtx.globalCompositeOperation = \"source-in\";\n\n maskCtx.fillStyle = isPatternFill\n ? fillColor.getPattern(\n maskCtx,\n this,\n getCurrentTransformInverse(ctx),\n PathType.FILL\n )\n : fillColor;\n maskCtx.fillRect(0, 0, width, height);\n\n maskCtx.restore();\n\n ctx.save();\n ctx.transform(...transform);\n ctx.scale(1, -1);\n drawImageAtIntegerCoords(\n ctx,\n maskCanvas.canvas,\n 0,\n 0,\n width,\n height,\n 0,\n -1,\n 1,\n 1\n );\n ctx.restore();\n }\n this.compose();\n }\n\n paintImageXObject(objId) {\n if (!this.contentVisible) {\n return;\n }\n const imgData = this.getObject(objId);\n if (!imgData) {\n warn(\"Dependent image isn't ready yet\");\n return;\n }\n\n this.paintInlineImageXObject(imgData);\n }\n\n paintImageXObjectRepeat(objId, scaleX, scaleY, positions) {\n if (!this.contentVisible) {\n return;\n }\n const imgData = this.getObject(objId);\n if (!imgData) {\n warn(\"Dependent image isn't ready yet\");\n return;\n }\n\n const width = imgData.width;\n const height = imgData.height;\n const map = [];\n for (let i = 0, ii = positions.length; i < ii; i += 2) {\n map.push({\n transform: [scaleX, 0, 0, scaleY, positions[i], positions[i + 1]],\n x: 0,\n y: 0,\n w: width,\n h: height,\n });\n }\n this.paintInlineImageXObjectGroup(imgData, map);\n }\n\n applyTransferMapsToCanvas(ctx) {\n if (this.current.transferMaps !== \"none\") {\n ctx.filter = this.current.transferMaps;\n ctx.drawImage(ctx.canvas, 0, 0);\n ctx.filter = \"none\";\n }\n return ctx.canvas;\n }\n\n applyTransferMapsToBitmap(imgData) {\n if (this.current.transferMaps === \"none\") {\n return imgData.bitmap;\n }\n const { bitmap, width, height } = imgData;\n const tmpCanvas = this.cachedCanvases.getCanvas(\n \"inlineImage\",\n width,\n height\n );\n const tmpCtx = tmpCanvas.context;\n tmpCtx.filter = this.current.transferMaps;\n tmpCtx.drawImage(bitmap, 0, 0);\n tmpCtx.filter = \"none\";\n\n return tmpCanvas.canvas;\n }\n\n paintInlineImageXObject(imgData) {\n if (!this.contentVisible) {\n return;\n }\n const width = imgData.width;\n const height = imgData.height;\n const ctx = this.ctx;\n\n this.save();\n\n if (\n (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) ||\n !isNodeJS\n ) {\n // The filter, if any, will be applied in applyTransferMapsToBitmap.\n // It must be applied to the image before rescaling else some artifacts\n // could appear.\n // The final restore will reset it to its value.\n const { filter } = ctx;\n if (filter !== \"none\" && filter !== \"\") {\n ctx.filter = \"none\";\n }\n }\n\n // scale the image to the unit square\n ctx.scale(1 / width, -1 / height);\n\n let imgToPaint;\n if (imgData.bitmap) {\n imgToPaint = this.applyTransferMapsToBitmap(imgData);\n } else if (\n (typeof HTMLElement === \"function\" && imgData instanceof HTMLElement) ||\n !imgData.data\n ) {\n // typeof check is needed due to node.js support, see issue #8489\n imgToPaint = imgData;\n } else {\n const tmpCanvas = this.cachedCanvases.getCanvas(\n \"inlineImage\",\n width,\n height\n );\n const tmpCtx = tmpCanvas.context;\n putBinaryImageData(tmpCtx, imgData);\n imgToPaint = this.applyTransferMapsToCanvas(tmpCtx);\n }\n\n const scaled = this._scaleImage(\n imgToPaint,\n getCurrentTransformInverse(ctx)\n );\n ctx.imageSmoothingEnabled = getImageSmoothingEnabled(\n getCurrentTransform(ctx),\n imgData.interpolate\n );\n\n drawImageAtIntegerCoords(\n ctx,\n scaled.img,\n 0,\n 0,\n scaled.paintWidth,\n scaled.paintHeight,\n 0,\n -height,\n width,\n height\n );\n this.compose();\n this.restore();\n }\n\n paintInlineImageXObjectGroup(imgData, map) {\n if (!this.contentVisible) {\n return;\n }\n const ctx = this.ctx;\n let imgToPaint;\n if (imgData.bitmap) {\n imgToPaint = imgData.bitmap;\n } else {\n const w = imgData.width;\n const h = imgData.height;\n\n const tmpCanvas = this.cachedCanvases.getCanvas(\"inlineImage\", w, h);\n const tmpCtx = tmpCanvas.context;\n putBinaryImageData(tmpCtx, imgData);\n imgToPaint = this.applyTransferMapsToCanvas(tmpCtx);\n }\n\n for (const entry of map) {\n ctx.save();\n ctx.transform(...entry.transform);\n ctx.scale(1, -1);\n drawImageAtIntegerCoords(\n ctx,\n imgToPaint,\n entry.x,\n entry.y,\n entry.w,\n entry.h,\n 0,\n -1,\n 1,\n 1\n );\n ctx.restore();\n }\n this.compose();\n }\n\n paintSolidColorImageMask() {\n if (!this.contentVisible) {\n return;\n }\n this.ctx.fillRect(0, 0, 1, 1);\n this.compose();\n }\n\n // Marked content\n\n markPoint(tag) {\n // TODO Marked content.\n }\n\n markPointProps(tag, properties) {\n // TODO Marked content.\n }\n\n beginMarkedContent(tag) {\n this.markedContentStack.push({\n visible: true,\n });\n }\n\n beginMarkedContentProps(tag, properties) {\n if (tag === \"OC\") {\n this.markedContentStack.push({\n visible: this.optionalContentConfig.isVisible(properties),\n });\n } else {\n this.markedContentStack.push({\n visible: true,\n });\n }\n this.contentVisible = this.isContentVisible();\n }\n\n endMarkedContent() {\n this.markedContentStack.pop();\n this.contentVisible = this.isContentVisible();\n }\n\n // Compatibility\n\n beginCompat() {\n // TODO ignore undefined operators (should we do that anyway?)\n }\n\n endCompat() {\n // TODO stop ignoring undefined operators\n }\n\n // Helper functions\n\n consumePath(clipBox) {\n const isEmpty = this.current.isEmptyClip();\n if (this.pendingClip) {\n this.current.updateClipFromPath();\n }\n if (!this.pendingClip) {\n this.compose(clipBox);\n }\n const ctx = this.ctx;\n if (this.pendingClip) {\n if (!isEmpty) {\n if (this.pendingClip === EO_CLIP) {\n ctx.clip(\"evenodd\");\n } else {\n ctx.clip();\n }\n }\n this.pendingClip = null;\n }\n this.current.startNewPathAndClipBox(this.current.clipBox);\n ctx.beginPath();\n }\n\n getSinglePixelWidth() {\n if (!this._cachedGetSinglePixelWidth) {\n const m = getCurrentTransform(this.ctx);\n if (m[1] === 0 && m[2] === 0) {\n // Fast path\n this._cachedGetSinglePixelWidth =\n 1 / Math.min(Math.abs(m[0]), Math.abs(m[3]));\n } else {\n const absDet = Math.abs(m[0] * m[3] - m[2] * m[1]);\n const normX = Math.hypot(m[0], m[2]);\n const normY = Math.hypot(m[1], m[3]);\n this._cachedGetSinglePixelWidth = Math.max(normX, normY) / absDet;\n }\n }\n return this._cachedGetSinglePixelWidth;\n }\n\n getScaleForStroking() {\n // A pixel has thicknessX = thicknessY = 1;\n // A transformed pixel is a parallelogram and the thicknesses\n // corresponds to the heights.\n // The goal of this function is to rescale before setting the\n // lineWidth in order to have both thicknesses greater or equal\n // to 1 after transform.\n if (this._cachedScaleForStroking[0] === -1) {\n const { lineWidth } = this.current;\n const { a, b, c, d } = this.ctx.getTransform();\n let scaleX, scaleY;\n\n if (b === 0 && c === 0) {\n // Fast path\n const normX = Math.abs(a);\n const normY = Math.abs(d);\n if (normX === normY) {\n if (lineWidth === 0) {\n scaleX = scaleY = 1 / normX;\n } else {\n const scaledLineWidth = normX * lineWidth;\n scaleX = scaleY = scaledLineWidth < 1 ? 1 / scaledLineWidth : 1;\n }\n } else if (lineWidth === 0) {\n scaleX = 1 / normX;\n scaleY = 1 / normY;\n } else {\n const scaledXLineWidth = normX * lineWidth;\n const scaledYLineWidth = normY * lineWidth;\n scaleX = scaledXLineWidth < 1 ? 1 / scaledXLineWidth : 1;\n scaleY = scaledYLineWidth < 1 ? 1 / scaledYLineWidth : 1;\n }\n } else {\n // A pixel (base (x, y)) is transformed by M into a parallelogram:\n // - its area is |det(M)|;\n // - heightY (orthogonal to Mx) has a length: |det(M)| / norm(Mx);\n // - heightX (orthogonal to My) has a length: |det(M)| / norm(My).\n // heightX and heightY are the thicknesses of the transformed pixel\n // and they must be both greater or equal to 1.\n const absDet = Math.abs(a * d - b * c);\n const normX = Math.hypot(a, b);\n const normY = Math.hypot(c, d);\n if (lineWidth === 0) {\n scaleX = normY / absDet;\n scaleY = normX / absDet;\n } else {\n const baseArea = lineWidth * absDet;\n scaleX = normY > baseArea ? normY / baseArea : 1;\n scaleY = normX > baseArea ? normX / baseArea : 1;\n }\n }\n this._cachedScaleForStroking[0] = scaleX;\n this._cachedScaleForStroking[1] = scaleY;\n }\n return this._cachedScaleForStroking;\n }\n\n // Rescale before stroking in order to have a final lineWidth\n // with both thicknesses greater or equal to 1.\n rescaleAndStroke(saveRestore) {\n const { ctx } = this;\n const { lineWidth } = this.current;\n const [scaleX, scaleY] = this.getScaleForStroking();\n\n ctx.lineWidth = lineWidth || 1;\n\n if (scaleX === 1 && scaleY === 1) {\n ctx.stroke();\n return;\n }\n\n const dashes = ctx.getLineDash();\n if (saveRestore) {\n ctx.save();\n }\n\n ctx.scale(scaleX, scaleY);\n\n // How the dashed line is rendered depends on the current transform...\n // so we added a rescale to handle too thin lines and consequently\n // the way the line is dashed will be modified.\n // If scaleX === scaleY, the dashed lines will be rendered correctly\n // else we'll have some bugs (but only with too thin lines).\n // Here we take the max... why not taking the min... or something else.\n // Anyway, as said it's buggy when scaleX !== scaleY.\n if (dashes.length > 0) {\n const scale = Math.max(scaleX, scaleY);\n ctx.setLineDash(dashes.map(x => x / scale));\n ctx.lineDashOffset /= scale;\n }\n\n ctx.stroke();\n\n if (saveRestore) {\n ctx.restore();\n }\n }\n\n isContentVisible() {\n for (let i = this.markedContentStack.length - 1; i >= 0; i--) {\n if (!this.markedContentStack[i].visible) {\n return false;\n }\n }\n return true;\n }\n}\n\nfor (const op in OPS) {\n if (CanvasGraphics.prototype[op] !== undefined) {\n CanvasGraphics.prototype[OPS[op]] = CanvasGraphics.prototype[op];\n }\n}\n\nexport { CanvasGraphics };\n","/* Copyright 2018 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\nclass GlobalWorkerOptions {\n static #port = null;\n\n static #src = \"\";\n\n /**\n * @type {Worker | null}\n */\n static get workerPort() {\n return this.#port;\n }\n\n /**\n * @param {Worker | null} workerPort - Defines global port for worker process.\n * Overrides the `workerSrc` option.\n */\n static set workerPort(val) {\n if (\n !(typeof Worker !== \"undefined\" && val instanceof Worker) &&\n val !== null\n ) {\n throw new Error(\"Invalid `workerPort` type.\");\n }\n this.#port = val;\n }\n\n /**\n * @type {string}\n */\n static get workerSrc() {\n return this.#src;\n }\n\n /**\n * @param {string} workerSrc - A string containing the path and filename of\n * the worker file.\n *\n * NOTE: The `workerSrc` option should always be set, in order to prevent\n * any issues when using the PDF.js library.\n */\n static set workerSrc(val) {\n if (typeof val !== \"string\") {\n throw new Error(\"Invalid `workerSrc` type.\");\n }\n this.#src = val;\n }\n}\n\nexport { GlobalWorkerOptions };\n","/* Copyright 2018 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\nimport {\n AbortException,\n assert,\n MissingPDFException,\n PasswordException,\n UnexpectedResponseException,\n UnknownErrorException,\n unreachable,\n} from \"./util.js\";\n\nconst CallbackKind = {\n UNKNOWN: 0,\n DATA: 1,\n ERROR: 2,\n};\n\nconst StreamKind = {\n UNKNOWN: 0,\n CANCEL: 1,\n CANCEL_COMPLETE: 2,\n CLOSE: 3,\n ENQUEUE: 4,\n ERROR: 5,\n PULL: 6,\n PULL_COMPLETE: 7,\n START_COMPLETE: 8,\n};\n\nfunction wrapReason(reason) {\n if (\n !(\n reason instanceof Error ||\n (typeof reason === \"object\" && reason !== null)\n )\n ) {\n unreachable(\n 'wrapReason: Expected \"reason\" to be a (possibly cloned) Error.'\n );\n }\n switch (reason.name) {\n case \"AbortException\":\n return new AbortException(reason.message);\n case \"MissingPDFException\":\n return new MissingPDFException(reason.message);\n case \"PasswordException\":\n return new PasswordException(reason.message, reason.code);\n case \"UnexpectedResponseException\":\n return new UnexpectedResponseException(reason.message, reason.status);\n case \"UnknownErrorException\":\n return new UnknownErrorException(reason.message, reason.details);\n default:\n return new UnknownErrorException(reason.message, reason.toString());\n }\n}\n\nclass MessageHandler {\n constructor(sourceName, targetName, comObj) {\n this.sourceName = sourceName;\n this.targetName = targetName;\n this.comObj = comObj;\n this.callbackId = 1;\n this.streamId = 1;\n this.streamSinks = Object.create(null);\n this.streamControllers = Object.create(null);\n this.callbackCapabilities = Object.create(null);\n this.actionHandler = Object.create(null);\n\n this._onComObjOnMessage = event => {\n const data = event.data;\n if (data.targetName !== this.sourceName) {\n return;\n }\n if (data.stream) {\n this.#processStreamMessage(data);\n return;\n }\n if (data.callback) {\n const callbackId = data.callbackId;\n const capability = this.callbackCapabilities[callbackId];\n if (!capability) {\n throw new Error(`Cannot resolve callback ${callbackId}`);\n }\n delete this.callbackCapabilities[callbackId];\n\n if (data.callback === CallbackKind.DATA) {\n capability.resolve(data.data);\n } else if (data.callback === CallbackKind.ERROR) {\n capability.reject(wrapReason(data.reason));\n } else {\n throw new Error(\"Unexpected callback case\");\n }\n return;\n }\n const action = this.actionHandler[data.action];\n if (!action) {\n throw new Error(`Unknown action from worker: ${data.action}`);\n }\n if (data.callbackId) {\n const cbSourceName = this.sourceName;\n const cbTargetName = data.sourceName;\n\n new Promise(function (resolve) {\n resolve(action(data.data));\n }).then(\n function (result) {\n comObj.postMessage({\n sourceName: cbSourceName,\n targetName: cbTargetName,\n callback: CallbackKind.DATA,\n callbackId: data.callbackId,\n data: result,\n });\n },\n function (reason) {\n comObj.postMessage({\n sourceName: cbSourceName,\n targetName: cbTargetName,\n callback: CallbackKind.ERROR,\n callbackId: data.callbackId,\n reason: wrapReason(reason),\n });\n }\n );\n return;\n }\n if (data.streamId) {\n this.#createStreamSink(data);\n return;\n }\n action(data.data);\n };\n comObj.addEventListener(\"message\", this._onComObjOnMessage);\n }\n\n on(actionName, handler) {\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) {\n assert(\n typeof handler === \"function\",\n 'MessageHandler.on: Expected \"handler\" to be a function.'\n );\n }\n const ah = this.actionHandler;\n if (ah[actionName]) {\n throw new Error(`There is already an actionName called \"${actionName}\"`);\n }\n ah[actionName] = handler;\n }\n\n /**\n * Sends a message to the comObj to invoke the action with the supplied data.\n * @param {string} actionName - Action to call.\n * @param {JSON} data - JSON data to send.\n * @param {Array} [transfers] - List of transfers/ArrayBuffers.\n */\n send(actionName, data, transfers) {\n this.comObj.postMessage(\n {\n sourceName: this.sourceName,\n targetName: this.targetName,\n action: actionName,\n data,\n },\n transfers\n );\n }\n\n /**\n * Sends a message to the comObj to invoke the action with the supplied data.\n * Expects that the other side will callback with the response.\n * @param {string} actionName - Action to call.\n * @param {JSON} data - JSON data to send.\n * @param {Array} [transfers] - List of transfers/ArrayBuffers.\n * @returns {Promise} Promise to be resolved with response data.\n */\n sendWithPromise(actionName, data, transfers) {\n const callbackId = this.callbackId++;\n const capability = Promise.withResolvers();\n this.callbackCapabilities[callbackId] = capability;\n try {\n this.comObj.postMessage(\n {\n sourceName: this.sourceName,\n targetName: this.targetName,\n action: actionName,\n callbackId,\n data,\n },\n transfers\n );\n } catch (ex) {\n capability.reject(ex);\n }\n return capability.promise;\n }\n\n /**\n * Sends a message to the comObj to invoke the action with the supplied data.\n * Expect that the other side will callback to signal 'start_complete'.\n * @param {string} actionName - Action to call.\n * @param {JSON} data - JSON data to send.\n * @param {Object} queueingStrategy - Strategy to signal backpressure based on\n * internal queue.\n * @param {Array} [transfers] - List of transfers/ArrayBuffers.\n * @returns {ReadableStream} ReadableStream to read data in chunks.\n */\n sendWithStream(actionName, data, queueingStrategy, transfers) {\n const streamId = this.streamId++,\n sourceName = this.sourceName,\n targetName = this.targetName,\n comObj = this.comObj;\n\n return new ReadableStream(\n {\n start: controller => {\n const startCapability = Promise.withResolvers();\n this.streamControllers[streamId] = {\n controller,\n startCall: startCapability,\n pullCall: null,\n cancelCall: null,\n isClosed: false,\n };\n comObj.postMessage(\n {\n sourceName,\n targetName,\n action: actionName,\n streamId,\n data,\n desiredSize: controller.desiredSize,\n },\n transfers\n );\n // Return Promise for Async process, to signal success/failure.\n return startCapability.promise;\n },\n\n pull: controller => {\n const pullCapability = Promise.withResolvers();\n this.streamControllers[streamId].pullCall = pullCapability;\n comObj.postMessage({\n sourceName,\n targetName,\n stream: StreamKind.PULL,\n streamId,\n desiredSize: controller.desiredSize,\n });\n // Returning Promise will not call \"pull\"\n // again until current pull is resolved.\n return pullCapability.promise;\n },\n\n cancel: reason => {\n assert(reason instanceof Error, \"cancel must have a valid reason\");\n const cancelCapability = Promise.withResolvers();\n this.streamControllers[streamId].cancelCall = cancelCapability;\n this.streamControllers[streamId].isClosed = true;\n comObj.postMessage({\n sourceName,\n targetName,\n stream: StreamKind.CANCEL,\n streamId,\n reason: wrapReason(reason),\n });\n // Return Promise to signal success or failure.\n return cancelCapability.promise;\n },\n },\n queueingStrategy\n );\n }\n\n #createStreamSink(data) {\n const streamId = data.streamId,\n sourceName = this.sourceName,\n targetName = data.sourceName,\n comObj = this.comObj;\n const self = this,\n action = this.actionHandler[data.action];\n\n const streamSink = {\n enqueue(chunk, size = 1, transfers) {\n if (this.isCancelled) {\n return;\n }\n const lastDesiredSize = this.desiredSize;\n this.desiredSize -= size;\n // Enqueue decreases the desiredSize property of sink,\n // so when it changes from positive to negative,\n // set ready as unresolved promise.\n if (lastDesiredSize > 0 && this.desiredSize <= 0) {\n this.sinkCapability = Promise.withResolvers();\n this.ready = this.sinkCapability.promise;\n }\n comObj.postMessage(\n {\n sourceName,\n targetName,\n stream: StreamKind.ENQUEUE,\n streamId,\n chunk,\n },\n transfers\n );\n },\n\n close() {\n if (this.isCancelled) {\n return;\n }\n this.isCancelled = true;\n comObj.postMessage({\n sourceName,\n targetName,\n stream: StreamKind.CLOSE,\n streamId,\n });\n delete self.streamSinks[streamId];\n },\n\n error(reason) {\n assert(reason instanceof Error, \"error must have a valid reason\");\n if (this.isCancelled) {\n return;\n }\n this.isCancelled = true;\n comObj.postMessage({\n sourceName,\n targetName,\n stream: StreamKind.ERROR,\n streamId,\n reason: wrapReason(reason),\n });\n },\n\n sinkCapability: Promise.withResolvers(),\n onPull: null,\n onCancel: null,\n isCancelled: false,\n desiredSize: data.desiredSize,\n ready: null,\n };\n\n streamSink.sinkCapability.resolve();\n streamSink.ready = streamSink.sinkCapability.promise;\n this.streamSinks[streamId] = streamSink;\n\n new Promise(function (resolve) {\n resolve(action(data.data, streamSink));\n }).then(\n function () {\n comObj.postMessage({\n sourceName,\n targetName,\n stream: StreamKind.START_COMPLETE,\n streamId,\n success: true,\n });\n },\n function (reason) {\n comObj.postMessage({\n sourceName,\n targetName,\n stream: StreamKind.START_COMPLETE,\n streamId,\n reason: wrapReason(reason),\n });\n }\n );\n }\n\n #processStreamMessage(data) {\n const streamId = data.streamId,\n sourceName = this.sourceName,\n targetName = data.sourceName,\n comObj = this.comObj;\n const streamController = this.streamControllers[streamId],\n streamSink = this.streamSinks[streamId];\n\n switch (data.stream) {\n case StreamKind.START_COMPLETE:\n if (data.success) {\n streamController.startCall.resolve();\n } else {\n streamController.startCall.reject(wrapReason(data.reason));\n }\n break;\n case StreamKind.PULL_COMPLETE:\n if (data.success) {\n streamController.pullCall.resolve();\n } else {\n streamController.pullCall.reject(wrapReason(data.reason));\n }\n break;\n case StreamKind.PULL:\n // Ignore any pull after close is called.\n if (!streamSink) {\n comObj.postMessage({\n sourceName,\n targetName,\n stream: StreamKind.PULL_COMPLETE,\n streamId,\n success: true,\n });\n break;\n }\n // Pull increases the desiredSize property of sink, so when it changes\n // from negative to positive, set ready property as resolved promise.\n if (streamSink.desiredSize <= 0 && data.desiredSize > 0) {\n streamSink.sinkCapability.resolve();\n }\n // Reset desiredSize property of sink on every pull.\n streamSink.desiredSize = data.desiredSize;\n\n new Promise(function (resolve) {\n resolve(streamSink.onPull?.());\n }).then(\n function () {\n comObj.postMessage({\n sourceName,\n targetName,\n stream: StreamKind.PULL_COMPLETE,\n streamId,\n success: true,\n });\n },\n function (reason) {\n comObj.postMessage({\n sourceName,\n targetName,\n stream: StreamKind.PULL_COMPLETE,\n streamId,\n reason: wrapReason(reason),\n });\n }\n );\n break;\n case StreamKind.ENQUEUE:\n assert(streamController, \"enqueue should have stream controller\");\n if (streamController.isClosed) {\n break;\n }\n streamController.controller.enqueue(data.chunk);\n break;\n case StreamKind.CLOSE:\n assert(streamController, \"close should have stream controller\");\n if (streamController.isClosed) {\n break;\n }\n streamController.isClosed = true;\n streamController.controller.close();\n this.#deleteStreamController(streamController, streamId);\n break;\n case StreamKind.ERROR:\n assert(streamController, \"error should have stream controller\");\n streamController.controller.error(wrapReason(data.reason));\n this.#deleteStreamController(streamController, streamId);\n break;\n case StreamKind.CANCEL_COMPLETE:\n if (data.success) {\n streamController.cancelCall.resolve();\n } else {\n streamController.cancelCall.reject(wrapReason(data.reason));\n }\n this.#deleteStreamController(streamController, streamId);\n break;\n case StreamKind.CANCEL:\n if (!streamSink) {\n break;\n }\n\n new Promise(function (resolve) {\n resolve(streamSink.onCancel?.(wrapReason(data.reason)));\n }).then(\n function () {\n comObj.postMessage({\n sourceName,\n targetName,\n stream: StreamKind.CANCEL_COMPLETE,\n streamId,\n success: true,\n });\n },\n function (reason) {\n comObj.postMessage({\n sourceName,\n targetName,\n stream: StreamKind.CANCEL_COMPLETE,\n streamId,\n reason: wrapReason(reason),\n });\n }\n );\n streamSink.sinkCapability.reject(wrapReason(data.reason));\n streamSink.isCancelled = true;\n delete this.streamSinks[streamId];\n break;\n default:\n throw new Error(\"Unexpected stream case\");\n }\n }\n\n async #deleteStreamController(streamController, streamId) {\n // Delete the `streamController` only when the start, pull, and cancel\n // capabilities have settled, to prevent `TypeError`s.\n await Promise.allSettled([\n streamController.startCall?.promise,\n streamController.pullCall?.promise,\n streamController.cancelCall?.promise,\n ]);\n delete this.streamControllers[streamId];\n }\n\n destroy() {\n this.comObj.removeEventListener(\"message\", this._onComObjOnMessage);\n }\n}\n\nexport { MessageHandler };\n","/* Copyright 2012 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\nimport { objectFromMap } from \"../shared/util.js\";\n\nclass Metadata {\n #metadataMap;\n\n #data;\n\n constructor({ parsedData, rawData }) {\n this.#metadataMap = parsedData;\n this.#data = rawData;\n }\n\n getRaw() {\n return this.#data;\n }\n\n get(name) {\n return this.#metadataMap.get(name) ?? null;\n }\n\n getAll() {\n return objectFromMap(this.#metadataMap);\n }\n\n has(name) {\n return this.#metadataMap.has(name);\n }\n}\n\nexport { Metadata };\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\nimport {\n info,\n objectFromMap,\n RenderingIntentFlag,\n unreachable,\n warn,\n} from \"../shared/util.js\";\nimport { MurmurHash3_64 } from \"../shared/murmurhash3.js\";\n\nconst INTERNAL = Symbol(\"INTERNAL\");\n\nclass OptionalContentGroup {\n #isDisplay = false;\n\n #isPrint = false;\n\n #userSet = false;\n\n #visible = true;\n\n constructor(renderingIntent, { name, intent, usage }) {\n this.#isDisplay = !!(renderingIntent & RenderingIntentFlag.DISPLAY);\n this.#isPrint = !!(renderingIntent & RenderingIntentFlag.PRINT);\n\n this.name = name;\n this.intent = intent;\n this.usage = usage;\n }\n\n /**\n * @type {boolean}\n */\n get visible() {\n if (this.#userSet) {\n return this.#visible;\n }\n if (!this.#visible) {\n return false;\n }\n const { print, view } = this.usage;\n\n if (this.#isDisplay) {\n return view?.viewState !== \"OFF\";\n } else if (this.#isPrint) {\n return print?.printState !== \"OFF\";\n }\n return true;\n }\n\n /**\n * @ignore\n */\n _setVisible(internal, visible, userSet = false) {\n if (internal !== INTERNAL) {\n unreachable(\"Internal method `_setVisible` called.\");\n }\n this.#userSet = userSet;\n this.#visible = visible;\n }\n}\n\nclass OptionalContentConfig {\n #cachedGetHash = null;\n\n #groups = new Map();\n\n #initialHash = null;\n\n #order = null;\n\n constructor(data, renderingIntent = RenderingIntentFlag.DISPLAY) {\n this.renderingIntent = renderingIntent;\n\n this.name = null;\n this.creator = null;\n\n if (data === null) {\n return;\n }\n this.name = data.name;\n this.creator = data.creator;\n this.#order = data.order;\n for (const group of data.groups) {\n this.#groups.set(\n group.id,\n new OptionalContentGroup(renderingIntent, group)\n );\n }\n\n if (data.baseState === \"OFF\") {\n for (const group of this.#groups.values()) {\n group._setVisible(INTERNAL, false);\n }\n }\n\n for (const on of data.on) {\n this.#groups.get(on)._setVisible(INTERNAL, true);\n }\n\n for (const off of data.off) {\n this.#groups.get(off)._setVisible(INTERNAL, false);\n }\n\n // The following code must always run *last* in the constructor.\n this.#initialHash = this.getHash();\n }\n\n #evaluateVisibilityExpression(array) {\n const length = array.length;\n if (length < 2) {\n return true;\n }\n const operator = array[0];\n for (let i = 1; i < length; i++) {\n const element = array[i];\n let state;\n if (Array.isArray(element)) {\n state = this.#evaluateVisibilityExpression(element);\n } else if (this.#groups.has(element)) {\n state = this.#groups.get(element).visible;\n } else {\n warn(`Optional content group not found: ${element}`);\n return true;\n }\n switch (operator) {\n case \"And\":\n if (!state) {\n return false;\n }\n break;\n case \"Or\":\n if (state) {\n return true;\n }\n break;\n case \"Not\":\n return !state;\n default:\n return true;\n }\n }\n return operator === \"And\";\n }\n\n isVisible(group) {\n if (this.#groups.size === 0) {\n return true;\n }\n if (!group) {\n info(\"Optional content group not defined.\");\n return true;\n }\n if (group.type === \"OCG\") {\n if (!this.#groups.has(group.id)) {\n warn(`Optional content group not found: ${group.id}`);\n return true;\n }\n return this.#groups.get(group.id).visible;\n } else if (group.type === \"OCMD\") {\n // Per the spec, the expression should be preferred if available.\n if (group.expression) {\n return this.#evaluateVisibilityExpression(group.expression);\n }\n if (!group.policy || group.policy === \"AnyOn\") {\n // Default\n for (const id of group.ids) {\n if (!this.#groups.has(id)) {\n warn(`Optional content group not found: ${id}`);\n return true;\n }\n if (this.#groups.get(id).visible) {\n return true;\n }\n }\n return false;\n } else if (group.policy === \"AllOn\") {\n for (const id of group.ids) {\n if (!this.#groups.has(id)) {\n warn(`Optional content group not found: ${id}`);\n return true;\n }\n if (!this.#groups.get(id).visible) {\n return false;\n }\n }\n return true;\n } else if (group.policy === \"AnyOff\") {\n for (const id of group.ids) {\n if (!this.#groups.has(id)) {\n warn(`Optional content group not found: ${id}`);\n return true;\n }\n if (!this.#groups.get(id).visible) {\n return true;\n }\n }\n return false;\n } else if (group.policy === \"AllOff\") {\n for (const id of group.ids) {\n if (!this.#groups.has(id)) {\n warn(`Optional content group not found: ${id}`);\n return true;\n }\n if (this.#groups.get(id).visible) {\n return false;\n }\n }\n return true;\n }\n warn(`Unknown optional content policy ${group.policy}.`);\n return true;\n }\n warn(`Unknown group type ${group.type}.`);\n return true;\n }\n\n setVisibility(id, visible = true) {\n const group = this.#groups.get(id);\n if (!group) {\n warn(`Optional content group not found: ${id}`);\n return;\n }\n group._setVisible(INTERNAL, !!visible, /* userSet = */ true);\n\n this.#cachedGetHash = null;\n }\n\n setOCGState({ state, preserveRB }) {\n let operator;\n\n for (const elem of state) {\n switch (elem) {\n case \"ON\":\n case \"OFF\":\n case \"Toggle\":\n operator = elem;\n continue;\n }\n\n const group = this.#groups.get(elem);\n if (!group) {\n continue;\n }\n switch (operator) {\n case \"ON\":\n group._setVisible(INTERNAL, true);\n break;\n case \"OFF\":\n group._setVisible(INTERNAL, false);\n break;\n case \"Toggle\":\n group._setVisible(INTERNAL, !group.visible);\n break;\n }\n }\n\n this.#cachedGetHash = null;\n }\n\n get hasInitialVisibility() {\n return this.#initialHash === null || this.getHash() === this.#initialHash;\n }\n\n getOrder() {\n if (!this.#groups.size) {\n return null;\n }\n if (this.#order) {\n return this.#order.slice();\n }\n return [...this.#groups.keys()];\n }\n\n getGroups() {\n return this.#groups.size > 0 ? objectFromMap(this.#groups) : null;\n }\n\n getGroup(id) {\n return this.#groups.get(id) || null;\n }\n\n getHash() {\n if (this.#cachedGetHash !== null) {\n return this.#cachedGetHash;\n }\n const hash = new MurmurHash3_64();\n\n for (const [id, group] of this.#groups) {\n hash.update(`${id}:${group.visible}`);\n }\n return (this.#cachedGetHash = hash.hexdigest());\n }\n}\n\nexport { OptionalContentConfig };\n","/* Copyright 2012 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\n/** @typedef {import(\"../interfaces\").IPDFStream} IPDFStream */\n/** @typedef {import(\"../interfaces\").IPDFStreamReader} IPDFStreamReader */\n// eslint-disable-next-line max-len\n/** @typedef {import(\"../interfaces\").IPDFStreamRangeReader} IPDFStreamRangeReader */\n\nimport { assert } from \"../shared/util.js\";\nimport { isPdfFile } from \"./display_utils.js\";\n\n/** @implements {IPDFStream} */\nclass PDFDataTransportStream {\n constructor(\n pdfDataRangeTransport,\n { disableRange = false, disableStream = false }\n ) {\n assert(\n pdfDataRangeTransport,\n 'PDFDataTransportStream - missing required \"pdfDataRangeTransport\" argument.'\n );\n const { length, initialData, progressiveDone, contentDispositionFilename } =\n pdfDataRangeTransport;\n\n this._queuedChunks = [];\n this._progressiveDone = progressiveDone;\n this._contentDispositionFilename = contentDispositionFilename;\n\n if (initialData?.length > 0) {\n // Prevent any possible issues by only transferring a Uint8Array that\n // completely \"utilizes\" its underlying ArrayBuffer.\n const buffer =\n initialData instanceof Uint8Array &&\n initialData.byteLength === initialData.buffer.byteLength\n ? initialData.buffer\n : new Uint8Array(initialData).buffer;\n this._queuedChunks.push(buffer);\n }\n\n this._pdfDataRangeTransport = pdfDataRangeTransport;\n this._isStreamingSupported = !disableStream;\n this._isRangeSupported = !disableRange;\n this._contentLength = length;\n\n this._fullRequestReader = null;\n this._rangeReaders = [];\n\n pdfDataRangeTransport.addRangeListener((begin, chunk) => {\n this._onReceiveData({ begin, chunk });\n });\n\n pdfDataRangeTransport.addProgressListener((loaded, total) => {\n this._onProgress({ loaded, total });\n });\n\n pdfDataRangeTransport.addProgressiveReadListener(chunk => {\n this._onReceiveData({ chunk });\n });\n\n pdfDataRangeTransport.addProgressiveDoneListener(() => {\n this._onProgressiveDone();\n });\n\n pdfDataRangeTransport.transportReady();\n }\n\n _onReceiveData({ begin, chunk }) {\n // Prevent any possible issues by only transferring a Uint8Array that\n // completely \"utilizes\" its underlying ArrayBuffer.\n const buffer =\n chunk instanceof Uint8Array &&\n chunk.byteLength === chunk.buffer.byteLength\n ? chunk.buffer\n : new Uint8Array(chunk).buffer;\n\n if (begin === undefined) {\n if (this._fullRequestReader) {\n this._fullRequestReader._enqueue(buffer);\n } else {\n this._queuedChunks.push(buffer);\n }\n } else {\n const found = this._rangeReaders.some(function (rangeReader) {\n if (rangeReader._begin !== begin) {\n return false;\n }\n rangeReader._enqueue(buffer);\n return true;\n });\n assert(\n found,\n \"_onReceiveData - no `PDFDataTransportStreamRangeReader` instance found.\"\n );\n }\n }\n\n get _progressiveDataLength() {\n return this._fullRequestReader?._loaded ?? 0;\n }\n\n _onProgress(evt) {\n if (evt.total === undefined) {\n // Reporting to first range reader, if it exists.\n this._rangeReaders[0]?.onProgress?.({ loaded: evt.loaded });\n } else {\n this._fullRequestReader?.onProgress?.({\n loaded: evt.loaded,\n total: evt.total,\n });\n }\n }\n\n _onProgressiveDone() {\n this._fullRequestReader?.progressiveDone();\n this._progressiveDone = true;\n }\n\n _removeRangeReader(reader) {\n const i = this._rangeReaders.indexOf(reader);\n if (i >= 0) {\n this._rangeReaders.splice(i, 1);\n }\n }\n\n getFullReader() {\n assert(\n !this._fullRequestReader,\n \"PDFDataTransportStream.getFullReader can only be called once.\"\n );\n const queuedChunks = this._queuedChunks;\n this._queuedChunks = null;\n return new PDFDataTransportStreamReader(\n this,\n queuedChunks,\n this._progressiveDone,\n this._contentDispositionFilename\n );\n }\n\n getRangeReader(begin, end) {\n if (end <= this._progressiveDataLength) {\n return null;\n }\n const reader = new PDFDataTransportStreamRangeReader(this, begin, end);\n this._pdfDataRangeTransport.requestDataRange(begin, end);\n this._rangeReaders.push(reader);\n return reader;\n }\n\n cancelAllRequests(reason) {\n this._fullRequestReader?.cancel(reason);\n\n for (const reader of this._rangeReaders.slice(0)) {\n reader.cancel(reason);\n }\n this._pdfDataRangeTransport.abort();\n }\n}\n\n/** @implements {IPDFStreamReader} */\nclass PDFDataTransportStreamReader {\n constructor(\n stream,\n queuedChunks,\n progressiveDone = false,\n contentDispositionFilename = null\n ) {\n this._stream = stream;\n this._done = progressiveDone || false;\n this._filename = isPdfFile(contentDispositionFilename)\n ? contentDispositionFilename\n : null;\n this._queuedChunks = queuedChunks || [];\n this._loaded = 0;\n for (const chunk of this._queuedChunks) {\n this._loaded += chunk.byteLength;\n }\n this._requests = [];\n this._headersReady = Promise.resolve();\n stream._fullRequestReader = this;\n\n this.onProgress = null;\n }\n\n _enqueue(chunk) {\n if (this._done) {\n return; // Ignore new data.\n }\n if (this._requests.length > 0) {\n const requestCapability = this._requests.shift();\n requestCapability.resolve({ value: chunk, done: false });\n } else {\n this._queuedChunks.push(chunk);\n }\n this._loaded += chunk.byteLength;\n }\n\n get headersReady() {\n return this._headersReady;\n }\n\n get filename() {\n return this._filename;\n }\n\n get isRangeSupported() {\n return this._stream._isRangeSupported;\n }\n\n get isStreamingSupported() {\n return this._stream._isStreamingSupported;\n }\n\n get contentLength() {\n return this._stream._contentLength;\n }\n\n async read() {\n if (this._queuedChunks.length > 0) {\n const chunk = this._queuedChunks.shift();\n return { value: chunk, done: false };\n }\n if (this._done) {\n return { value: undefined, done: true };\n }\n const requestCapability = Promise.withResolvers();\n this._requests.push(requestCapability);\n return requestCapability.promise;\n }\n\n cancel(reason) {\n this._done = true;\n for (const requestCapability of this._requests) {\n requestCapability.resolve({ value: undefined, done: true });\n }\n this._requests.length = 0;\n }\n\n progressiveDone() {\n if (this._done) {\n return;\n }\n this._done = true;\n }\n}\n\n/** @implements {IPDFStreamRangeReader} */\nclass PDFDataTransportStreamRangeReader {\n constructor(stream, begin, end) {\n this._stream = stream;\n this._begin = begin;\n this._end = end;\n this._queuedChunk = null;\n this._requests = [];\n this._done = false;\n\n this.onProgress = null;\n }\n\n _enqueue(chunk) {\n if (this._done) {\n return; // ignore new data\n }\n if (this._requests.length === 0) {\n this._queuedChunk = chunk;\n } else {\n const requestsCapability = this._requests.shift();\n requestsCapability.resolve({ value: chunk, done: false });\n for (const requestCapability of this._requests) {\n requestCapability.resolve({ value: undefined, done: true });\n }\n this._requests.length = 0;\n }\n this._done = true;\n this._stream._removeRangeReader(this);\n }\n\n get isStreamingSupported() {\n return false;\n }\n\n async read() {\n if (this._queuedChunk) {\n const chunk = this._queuedChunk;\n this._queuedChunk = null;\n return { value: chunk, done: false };\n }\n if (this._done) {\n return { value: undefined, done: true };\n }\n const requestCapability = Promise.withResolvers();\n this._requests.push(requestCapability);\n return requestCapability.promise;\n }\n\n cancel(reason) {\n this._done = true;\n for (const requestCapability of this._requests) {\n requestCapability.resolve({ value: undefined, done: true });\n }\n this._requests.length = 0;\n this._stream._removeRangeReader(this);\n }\n}\n\nexport { PDFDataTransportStream };\n","/* Copyright 2012 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\nimport {\n assert,\n MissingPDFException,\n UnexpectedResponseException,\n} from \"../shared/util.js\";\nimport { getFilenameFromContentDispositionHeader } from \"./content_disposition.js\";\nimport { isPdfFile } from \"./display_utils.js\";\n\nfunction validateRangeRequestCapabilities({\n getResponseHeader,\n isHttp,\n rangeChunkSize,\n disableRange,\n}) {\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) {\n assert(\n Number.isInteger(rangeChunkSize) && rangeChunkSize > 0,\n \"rangeChunkSize must be an integer larger than zero.\"\n );\n }\n const returnValues = {\n allowRangeRequests: false,\n suggestedLength: undefined,\n };\n\n const length = parseInt(getResponseHeader(\"Content-Length\"), 10);\n if (!Number.isInteger(length)) {\n return returnValues;\n }\n\n returnValues.suggestedLength = length;\n\n if (length <= 2 * rangeChunkSize) {\n // The file size is smaller than the size of two chunks, so it does not\n // make any sense to abort the request and retry with a range request.\n return returnValues;\n }\n\n if (disableRange || !isHttp) {\n return returnValues;\n }\n if (getResponseHeader(\"Accept-Ranges\") !== \"bytes\") {\n return returnValues;\n }\n\n const contentEncoding = getResponseHeader(\"Content-Encoding\") || \"identity\";\n if (contentEncoding !== \"identity\") {\n return returnValues;\n }\n\n returnValues.allowRangeRequests = true;\n return returnValues;\n}\n\nfunction extractFilenameFromHeader(getResponseHeader) {\n const contentDisposition = getResponseHeader(\"Content-Disposition\");\n if (contentDisposition) {\n let filename = getFilenameFromContentDispositionHeader(contentDisposition);\n if (filename.includes(\"%\")) {\n try {\n filename = decodeURIComponent(filename);\n } catch {}\n }\n if (isPdfFile(filename)) {\n return filename;\n }\n }\n return null;\n}\n\nfunction createResponseStatusError(status, url) {\n if (status === 404 || (status === 0 && url.startsWith(\"file:\"))) {\n return new MissingPDFException('Missing PDF \"' + url + '\".');\n }\n return new UnexpectedResponseException(\n `Unexpected server response (${status}) while retrieving PDF \"${url}\".`,\n status\n );\n}\n\nfunction validateResponseStatus(status) {\n return status === 200 || status === 206;\n}\n\nexport {\n createResponseStatusError,\n extractFilenameFromHeader,\n validateRangeRequestCapabilities,\n validateResponseStatus,\n};\n","/* Copyright 2017 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\nimport { stringToBytes } from \"../shared/util.js\";\n\n// This getFilenameFromContentDispositionHeader function is adapted from\n// https://github.com/Rob--W/open-in-browser/blob/7e2e35a38b8b4e981b11da7b2f01df0149049e92/extension/content-disposition.js\n// with the following changes:\n// - Modified to conform to PDF.js's coding style.\n// - Move return to the end of the function to prevent Babel from dropping the\n// function declarations.\n\n/**\n * Extract file name from the Content-Disposition HTTP response header.\n *\n * @param {string} contentDisposition\n * @returns {string} Filename, if found in the Content-Disposition header.\n */\nfunction getFilenameFromContentDispositionHeader(contentDisposition) {\n let needsEncodingFixup = true;\n\n // filename*=ext-value (\"ext-value\" from RFC 5987, referenced by RFC 6266).\n let tmp = toParamRegExp(\"filename\\\\*\", \"i\").exec(contentDisposition);\n if (tmp) {\n tmp = tmp[1];\n let filename = rfc2616unquote(tmp);\n filename = unescape(filename);\n filename = rfc5987decode(filename);\n filename = rfc2047decode(filename);\n return fixupEncoding(filename);\n }\n\n // Continuations (RFC 2231 section 3, referenced by RFC 5987 section 3.1).\n // filename*n*=part\n // filename*n=part\n tmp = rfc2231getparam(contentDisposition);\n if (tmp) {\n // RFC 2047, section\n const filename = rfc2047decode(tmp);\n return fixupEncoding(filename);\n }\n\n // filename=value (RFC 5987, section 4.1).\n tmp = toParamRegExp(\"filename\", \"i\").exec(contentDisposition);\n if (tmp) {\n tmp = tmp[1];\n let filename = rfc2616unquote(tmp);\n filename = rfc2047decode(filename);\n return fixupEncoding(filename);\n }\n\n // After this line there are only function declarations. We cannot put\n // \"return\" here for readability because babel would then drop the function\n // declarations...\n function toParamRegExp(attributePattern, flags) {\n return new RegExp(\n \"(?:^|;)\\\\s*\" +\n attributePattern +\n \"\\\\s*=\\\\s*\" +\n // Captures: value = token | quoted-string\n // (RFC 2616, section 3.6 and referenced by RFC 6266 4.1)\n \"(\" +\n '[^\";\\\\s][^;\\\\s]*' +\n \"|\" +\n '\"(?:[^\"\\\\\\\\]|\\\\\\\\\"?)+\"?' +\n \")\",\n flags\n );\n }\n function textdecode(encoding, value) {\n if (encoding) {\n if (!/^[\\x00-\\xFF]+$/.test(value)) {\n return value;\n }\n try {\n const decoder = new TextDecoder(encoding, { fatal: true });\n const buffer = stringToBytes(value);\n value = decoder.decode(buffer);\n needsEncodingFixup = false;\n } catch {\n // TextDecoder constructor threw - unrecognized encoding.\n }\n }\n return value;\n }\n function fixupEncoding(value) {\n if (needsEncodingFixup && /[\\x80-\\xff]/.test(value)) {\n // Maybe multi-byte UTF-8.\n value = textdecode(\"utf-8\", value);\n if (needsEncodingFixup) {\n // Try iso-8859-1 encoding.\n value = textdecode(\"iso-8859-1\", value);\n }\n }\n return value;\n }\n function rfc2231getparam(contentDispositionStr) {\n const matches = [];\n let match;\n // Iterate over all filename*n= and filename*n*= with n being an integer\n // of at least zero. Any non-zero number must not start with '0'.\n const iter = toParamRegExp(\"filename\\\\*((?!0\\\\d)\\\\d+)(\\\\*?)\", \"ig\");\n while ((match = iter.exec(contentDispositionStr)) !== null) {\n let [, n, quot, part] = match; // eslint-disable-line prefer-const\n n = parseInt(n, 10);\n if (n in matches) {\n // Ignore anything after the invalid second filename*0.\n if (n === 0) {\n break;\n }\n continue;\n }\n matches[n] = [quot, part];\n }\n const parts = [];\n for (let n = 0; n < matches.length; ++n) {\n if (!(n in matches)) {\n // Numbers must be consecutive. Truncate when there is a hole.\n break;\n }\n let [quot, part] = matches[n]; // eslint-disable-line prefer-const\n part = rfc2616unquote(part);\n if (quot) {\n part = unescape(part);\n if (n === 0) {\n part = rfc5987decode(part);\n }\n }\n parts.push(part);\n }\n return parts.join(\"\");\n }\n function rfc2616unquote(value) {\n if (value.startsWith('\"')) {\n const parts = value.slice(1).split('\\\\\"');\n // Find the first unescaped \" and terminate there.\n for (let i = 0; i < parts.length; ++i) {\n const quotindex = parts[i].indexOf('\"');\n if (quotindex !== -1) {\n parts[i] = parts[i].slice(0, quotindex);\n parts.length = i + 1; // Truncates and stop the iteration.\n }\n parts[i] = parts[i].replaceAll(/\\\\(.)/g, \"$1\");\n }\n value = parts.join('\"');\n }\n return value;\n }\n function rfc5987decode(extvalue) {\n // Decodes \"ext-value\" from RFC 5987.\n const encodingend = extvalue.indexOf(\"'\");\n if (encodingend === -1) {\n // Some servers send \"filename*=\" without encoding 'language' prefix,\n // e.g. in https://github.com/Rob--W/open-in-browser/issues/26\n // Let's accept the value like Firefox (57) (Chrome 62 rejects it).\n return extvalue;\n }\n const encoding = extvalue.slice(0, encodingend);\n const langvalue = extvalue.slice(encodingend + 1);\n // Ignore language (RFC 5987 section 3.2.1, and RFC 6266 section 4.1 ).\n const value = langvalue.replace(/^[^']*'/, \"\");\n return textdecode(encoding, value);\n }\n function rfc2047decode(value) {\n // RFC 2047-decode the result. Firefox tried to drop support for it, but\n // backed out because some servers use it - https://bugzil.la/875615\n // Firefox's condition for decoding is here: https://searchfox.org/mozilla-central/rev/4a590a5a15e35d88a3b23dd6ac3c471cf85b04a8/netwerk/mime/nsMIMEHeaderParamImpl.cpp#742-748\n\n // We are more strict and only recognize RFC 2047-encoding if the value\n // starts with \"=?\", since then it is likely that the full value is\n // RFC 2047-encoded.\n\n // Firefox also decodes words even where RFC 2047 section 5 states:\n // \"An 'encoded-word' MUST NOT appear within a 'quoted-string'.\"\n if (!value.startsWith(\"=?\") || /[\\x00-\\x19\\x80-\\xff]/.test(value)) {\n return value;\n }\n // RFC 2047, section 2.4\n // encoded-word = \"=?\" charset \"?\" encoding \"?\" encoded-text \"?=\"\n // charset = token (but let's restrict to characters that denote a\n // possibly valid encoding).\n // encoding = q or b\n // encoded-text = any printable ASCII character other than ? or space.\n // ... but Firefox permits ? and space.\n return value.replaceAll(\n /=\\?([\\w-]*)\\?([QqBb])\\?((?:[^?]|\\?(?!=))*)\\?=/g,\n function (matches, charset, encoding, text) {\n if (encoding === \"q\" || encoding === \"Q\") {\n // RFC 2047 section 4.2.\n text = text.replaceAll(\"_\", \" \");\n text = text.replaceAll(/=([0-9a-fA-F]{2})/g, function (match, hex) {\n return String.fromCharCode(parseInt(hex, 16));\n });\n return textdecode(charset, text);\n } // else encoding is b or B - base64 (RFC 2047 section 4.1)\n try {\n text = atob(text);\n } catch {}\n return textdecode(charset, text);\n }\n );\n }\n\n return \"\";\n}\n\nexport { getFilenameFromContentDispositionHeader };\n","/* Copyright 2012 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\nimport { AbortException, assert, warn } from \"../shared/util.js\";\nimport {\n createResponseStatusError,\n extractFilenameFromHeader,\n validateRangeRequestCapabilities,\n validateResponseStatus,\n} from \"./network_utils.js\";\n\nif (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) {\n throw new Error(\n 'Module \"./fetch_stream.js\" shall not be used with MOZCENTRAL builds.'\n );\n}\n\nfunction createFetchOptions(headers, withCredentials, abortController) {\n return {\n method: \"GET\",\n headers,\n signal: abortController.signal,\n mode: \"cors\",\n credentials: withCredentials ? \"include\" : \"same-origin\",\n redirect: \"follow\",\n };\n}\n\nfunction createHeaders(httpHeaders) {\n const headers = new Headers();\n for (const property in httpHeaders) {\n const value = httpHeaders[property];\n if (value === undefined) {\n continue;\n }\n headers.append(property, value);\n }\n return headers;\n}\n\nfunction getArrayBuffer(val) {\n if (val instanceof Uint8Array) {\n return val.buffer;\n }\n if (val instanceof ArrayBuffer) {\n return val;\n }\n warn(`getArrayBuffer - unexpected data format: ${val}`);\n return new Uint8Array(val).buffer;\n}\n\n/** @implements {IPDFStream} */\nclass PDFFetchStream {\n constructor(source) {\n this.source = source;\n this.isHttp = /^https?:/i.test(source.url);\n this.httpHeaders = (this.isHttp && source.httpHeaders) || {};\n\n this._fullRequestReader = null;\n this._rangeRequestReaders = [];\n }\n\n get _progressiveDataLength() {\n return this._fullRequestReader?._loaded ?? 0;\n }\n\n getFullReader() {\n assert(\n !this._fullRequestReader,\n \"PDFFetchStream.getFullReader can only be called once.\"\n );\n this._fullRequestReader = new PDFFetchStreamReader(this);\n return this._fullRequestReader;\n }\n\n getRangeReader(begin, end) {\n if (end <= this._progressiveDataLength) {\n return null;\n }\n const reader = new PDFFetchStreamRangeReader(this, begin, end);\n this._rangeRequestReaders.push(reader);\n return reader;\n }\n\n cancelAllRequests(reason) {\n this._fullRequestReader?.cancel(reason);\n\n for (const reader of this._rangeRequestReaders.slice(0)) {\n reader.cancel(reason);\n }\n }\n}\n\n/** @implements {IPDFStreamReader} */\nclass PDFFetchStreamReader {\n constructor(stream) {\n this._stream = stream;\n this._reader = null;\n this._loaded = 0;\n this._filename = null;\n const source = stream.source;\n this._withCredentials = source.withCredentials || false;\n this._contentLength = source.length;\n this._headersCapability = Promise.withResolvers();\n this._disableRange = source.disableRange || false;\n this._rangeChunkSize = source.rangeChunkSize;\n if (!this._rangeChunkSize && !this._disableRange) {\n this._disableRange = true;\n }\n\n this._abortController = new AbortController();\n this._isStreamingSupported = !source.disableStream;\n this._isRangeSupported = !source.disableRange;\n\n this._headers = createHeaders(this._stream.httpHeaders);\n\n const url = source.url;\n fetch(\n url,\n createFetchOptions(\n this._headers,\n this._withCredentials,\n this._abortController\n )\n )\n .then(response => {\n if (!validateResponseStatus(response.status)) {\n throw createResponseStatusError(response.status, url);\n }\n this._reader = response.body.getReader();\n this._headersCapability.resolve();\n\n const getResponseHeader = name => response.headers.get(name);\n\n const { allowRangeRequests, suggestedLength } =\n validateRangeRequestCapabilities({\n getResponseHeader,\n isHttp: this._stream.isHttp,\n rangeChunkSize: this._rangeChunkSize,\n disableRange: this._disableRange,\n });\n\n this._isRangeSupported = allowRangeRequests;\n // Setting right content length.\n this._contentLength = suggestedLength || this._contentLength;\n\n this._filename = extractFilenameFromHeader(getResponseHeader);\n\n // We need to stop reading when range is supported and streaming is\n // disabled.\n if (!this._isStreamingSupported && this._isRangeSupported) {\n this.cancel(new AbortException(\"Streaming is disabled.\"));\n }\n })\n .catch(this._headersCapability.reject);\n\n this.onProgress = null;\n }\n\n get headersReady() {\n return this._headersCapability.promise;\n }\n\n get filename() {\n return this._filename;\n }\n\n get contentLength() {\n return this._contentLength;\n }\n\n get isRangeSupported() {\n return this._isRangeSupported;\n }\n\n get isStreamingSupported() {\n return this._isStreamingSupported;\n }\n\n async read() {\n await this._headersCapability.promise;\n const { value, done } = await this._reader.read();\n if (done) {\n return { value, done };\n }\n this._loaded += value.byteLength;\n this.onProgress?.({\n loaded: this._loaded,\n total: this._contentLength,\n });\n\n return { value: getArrayBuffer(value), done: false };\n }\n\n cancel(reason) {\n this._reader?.cancel(reason);\n this._abortController.abort();\n }\n}\n\n/** @implements {IPDFStreamRangeReader} */\nclass PDFFetchStreamRangeReader {\n constructor(stream, begin, end) {\n this._stream = stream;\n this._reader = null;\n this._loaded = 0;\n const source = stream.source;\n this._withCredentials = source.withCredentials || false;\n this._readCapability = Promise.withResolvers();\n this._isStreamingSupported = !source.disableStream;\n\n this._abortController = new AbortController();\n this._headers = createHeaders(this._stream.httpHeaders);\n this._headers.append(\"Range\", `bytes=${begin}-${end - 1}`);\n\n const url = source.url;\n fetch(\n url,\n createFetchOptions(\n this._headers,\n this._withCredentials,\n this._abortController\n )\n )\n .then(response => {\n if (!validateResponseStatus(response.status)) {\n throw createResponseStatusError(response.status, url);\n }\n this._readCapability.resolve();\n this._reader = response.body.getReader();\n })\n .catch(this._readCapability.reject);\n\n this.onProgress = null;\n }\n\n get isStreamingSupported() {\n return this._isStreamingSupported;\n }\n\n async read() {\n await this._readCapability.promise;\n const { value, done } = await this._reader.read();\n if (done) {\n return { value, done };\n }\n this._loaded += value.byteLength;\n this.onProgress?.({ loaded: this._loaded });\n\n return { value: getArrayBuffer(value), done: false };\n }\n\n cancel(reason) {\n this._reader?.cancel(reason);\n this._abortController.abort();\n }\n}\n\nexport { PDFFetchStream };\n","/* Copyright 2012 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\nimport { assert, stringToBytes } from \"../shared/util.js\";\nimport {\n createResponseStatusError,\n extractFilenameFromHeader,\n validateRangeRequestCapabilities,\n} from \"./network_utils.js\";\n\nif (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) {\n throw new Error(\n 'Module \"./network.js\" shall not be used with MOZCENTRAL builds.'\n );\n}\n\nconst OK_RESPONSE = 200;\nconst PARTIAL_CONTENT_RESPONSE = 206;\n\nfunction getArrayBuffer(xhr) {\n const data = xhr.response;\n if (typeof data !== \"string\") {\n return data;\n }\n return stringToBytes(data).buffer;\n}\n\nclass NetworkManager {\n constructor(url, args = {}) {\n this.url = url;\n this.isHttp = /^https?:/i.test(url);\n this.httpHeaders = (this.isHttp && args.httpHeaders) || Object.create(null);\n this.withCredentials = args.withCredentials || false;\n\n this.currXhrId = 0;\n this.pendingRequests = Object.create(null);\n }\n\n requestRange(begin, end, listeners) {\n const args = {\n begin,\n end,\n };\n for (const prop in listeners) {\n args[prop] = listeners[prop];\n }\n return this.request(args);\n }\n\n requestFull(listeners) {\n return this.request(listeners);\n }\n\n request(args) {\n const xhr = new XMLHttpRequest();\n const xhrId = this.currXhrId++;\n const pendingRequest = (this.pendingRequests[xhrId] = { xhr });\n\n xhr.open(\"GET\", this.url);\n xhr.withCredentials = this.withCredentials;\n for (const property in this.httpHeaders) {\n const value = this.httpHeaders[property];\n if (value === undefined) {\n continue;\n }\n xhr.setRequestHeader(property, value);\n }\n if (this.isHttp && \"begin\" in args && \"end\" in args) {\n xhr.setRequestHeader(\"Range\", `bytes=${args.begin}-${args.end - 1}`);\n pendingRequest.expectedStatus = PARTIAL_CONTENT_RESPONSE;\n } else {\n pendingRequest.expectedStatus = OK_RESPONSE;\n }\n xhr.responseType = \"arraybuffer\";\n\n if (args.onError) {\n xhr.onerror = function (evt) {\n args.onError(xhr.status);\n };\n }\n xhr.onreadystatechange = this.onStateChange.bind(this, xhrId);\n xhr.onprogress = this.onProgress.bind(this, xhrId);\n\n pendingRequest.onHeadersReceived = args.onHeadersReceived;\n pendingRequest.onDone = args.onDone;\n pendingRequest.onError = args.onError;\n pendingRequest.onProgress = args.onProgress;\n\n xhr.send(null);\n\n return xhrId;\n }\n\n onProgress(xhrId, evt) {\n const pendingRequest = this.pendingRequests[xhrId];\n if (!pendingRequest) {\n return; // Maybe abortRequest was called...\n }\n pendingRequest.onProgress?.(evt);\n }\n\n onStateChange(xhrId, evt) {\n const pendingRequest = this.pendingRequests[xhrId];\n if (!pendingRequest) {\n return; // Maybe abortRequest was called...\n }\n\n const xhr = pendingRequest.xhr;\n if (xhr.readyState >= 2 && pendingRequest.onHeadersReceived) {\n pendingRequest.onHeadersReceived();\n delete pendingRequest.onHeadersReceived;\n }\n\n if (xhr.readyState !== 4) {\n return;\n }\n\n if (!(xhrId in this.pendingRequests)) {\n // The XHR request might have been aborted in onHeadersReceived()\n // callback, in which case we should abort request.\n return;\n }\n\n delete this.pendingRequests[xhrId];\n\n // Success status == 0 can be on ftp, file and other protocols.\n if (xhr.status === 0 && this.isHttp) {\n pendingRequest.onError?.(xhr.status);\n return;\n }\n const xhrStatus = xhr.status || OK_RESPONSE;\n\n // From http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.35.2:\n // \"A server MAY ignore the Range header\". This means it's possible to\n // get a 200 rather than a 206 response from a range request.\n const ok_response_on_range_request =\n xhrStatus === OK_RESPONSE &&\n pendingRequest.expectedStatus === PARTIAL_CONTENT_RESPONSE;\n\n if (\n !ok_response_on_range_request &&\n xhrStatus !== pendingRequest.expectedStatus\n ) {\n pendingRequest.onError?.(xhr.status);\n return;\n }\n\n const chunk = getArrayBuffer(xhr);\n if (xhrStatus === PARTIAL_CONTENT_RESPONSE) {\n const rangeHeader = xhr.getResponseHeader(\"Content-Range\");\n const matches = /bytes (\\d+)-(\\d+)\\/(\\d+)/.exec(rangeHeader);\n pendingRequest.onDone({\n begin: parseInt(matches[1], 10),\n chunk,\n });\n } else if (chunk) {\n pendingRequest.onDone({\n begin: 0,\n chunk,\n });\n } else {\n pendingRequest.onError?.(xhr.status);\n }\n }\n\n getRequestXhr(xhrId) {\n return this.pendingRequests[xhrId].xhr;\n }\n\n isPendingRequest(xhrId) {\n return xhrId in this.pendingRequests;\n }\n\n abortRequest(xhrId) {\n const xhr = this.pendingRequests[xhrId].xhr;\n delete this.pendingRequests[xhrId];\n xhr.abort();\n }\n}\n\n/** @implements {IPDFStream} */\nclass PDFNetworkStream {\n constructor(source) {\n this._source = source;\n this._manager = new NetworkManager(source.url, {\n httpHeaders: source.httpHeaders,\n withCredentials: source.withCredentials,\n });\n this._rangeChunkSize = source.rangeChunkSize;\n this._fullRequestReader = null;\n this._rangeRequestReaders = [];\n }\n\n _onRangeRequestReaderClosed(reader) {\n const i = this._rangeRequestReaders.indexOf(reader);\n if (i >= 0) {\n this._rangeRequestReaders.splice(i, 1);\n }\n }\n\n getFullReader() {\n assert(\n !this._fullRequestReader,\n \"PDFNetworkStream.getFullReader can only be called once.\"\n );\n this._fullRequestReader = new PDFNetworkStreamFullRequestReader(\n this._manager,\n this._source\n );\n return this._fullRequestReader;\n }\n\n getRangeReader(begin, end) {\n const reader = new PDFNetworkStreamRangeRequestReader(\n this._manager,\n begin,\n end\n );\n reader.onClosed = this._onRangeRequestReaderClosed.bind(this);\n this._rangeRequestReaders.push(reader);\n return reader;\n }\n\n cancelAllRequests(reason) {\n this._fullRequestReader?.cancel(reason);\n\n for (const reader of this._rangeRequestReaders.slice(0)) {\n reader.cancel(reason);\n }\n }\n}\n\n/** @implements {IPDFStreamReader} */\nclass PDFNetworkStreamFullRequestReader {\n constructor(manager, source) {\n this._manager = manager;\n\n const args = {\n onHeadersReceived: this._onHeadersReceived.bind(this),\n onDone: this._onDone.bind(this),\n onError: this._onError.bind(this),\n onProgress: this._onProgress.bind(this),\n };\n this._url = source.url;\n this._fullRequestId = manager.requestFull(args);\n this._headersReceivedCapability = Promise.withResolvers();\n this._disableRange = source.disableRange || false;\n this._contentLength = source.length; // Optional\n this._rangeChunkSize = source.rangeChunkSize;\n if (!this._rangeChunkSize && !this._disableRange) {\n this._disableRange = true;\n }\n\n this._isStreamingSupported = false;\n this._isRangeSupported = false;\n\n this._cachedChunks = [];\n this._requests = [];\n this._done = false;\n this._storedError = undefined;\n this._filename = null;\n\n this.onProgress = null;\n }\n\n _onHeadersReceived() {\n const fullRequestXhrId = this._fullRequestId;\n const fullRequestXhr = this._manager.getRequestXhr(fullRequestXhrId);\n\n const getResponseHeader = name => fullRequestXhr.getResponseHeader(name);\n\n const { allowRangeRequests, suggestedLength } =\n validateRangeRequestCapabilities({\n getResponseHeader,\n isHttp: this._manager.isHttp,\n rangeChunkSize: this._rangeChunkSize,\n disableRange: this._disableRange,\n });\n\n if (allowRangeRequests) {\n this._isRangeSupported = true;\n }\n // Setting right content length.\n this._contentLength = suggestedLength || this._contentLength;\n\n this._filename = extractFilenameFromHeader(getResponseHeader);\n\n if (this._isRangeSupported) {\n // NOTE: by cancelling the full request, and then issuing range\n // requests, there will be an issue for sites where you can only\n // request the pdf once. However, if this is the case, then the\n // server should not be returning that it can support range requests.\n this._manager.abortRequest(fullRequestXhrId);\n }\n\n this._headersReceivedCapability.resolve();\n }\n\n _onDone(data) {\n if (data) {\n if (this._requests.length > 0) {\n const requestCapability = this._requests.shift();\n requestCapability.resolve({ value: data.chunk, done: false });\n } else {\n this._cachedChunks.push(data.chunk);\n }\n }\n this._done = true;\n if (this._cachedChunks.length > 0) {\n return;\n }\n for (const requestCapability of this._requests) {\n requestCapability.resolve({ value: undefined, done: true });\n }\n this._requests.length = 0;\n }\n\n _onError(status) {\n this._storedError = createResponseStatusError(status, this._url);\n this._headersReceivedCapability.reject(this._storedError);\n for (const requestCapability of this._requests) {\n requestCapability.reject(this._storedError);\n }\n this._requests.length = 0;\n this._cachedChunks.length = 0;\n }\n\n _onProgress(evt) {\n this.onProgress?.({\n loaded: evt.loaded,\n total: evt.lengthComputable ? evt.total : this._contentLength,\n });\n }\n\n get filename() {\n return this._filename;\n }\n\n get isRangeSupported() {\n return this._isRangeSupported;\n }\n\n get isStreamingSupported() {\n return this._isStreamingSupported;\n }\n\n get contentLength() {\n return this._contentLength;\n }\n\n get headersReady() {\n return this._headersReceivedCapability.promise;\n }\n\n async read() {\n if (this._storedError) {\n throw this._storedError;\n }\n if (this._cachedChunks.length > 0) {\n const chunk = this._cachedChunks.shift();\n return { value: chunk, done: false };\n }\n if (this._done) {\n return { value: undefined, done: true };\n }\n const requestCapability = Promise.withResolvers();\n this._requests.push(requestCapability);\n return requestCapability.promise;\n }\n\n cancel(reason) {\n this._done = true;\n this._headersReceivedCapability.reject(reason);\n for (const requestCapability of this._requests) {\n requestCapability.resolve({ value: undefined, done: true });\n }\n this._requests.length = 0;\n if (this._manager.isPendingRequest(this._fullRequestId)) {\n this._manager.abortRequest(this._fullRequestId);\n }\n this._fullRequestReader = null;\n }\n}\n\n/** @implements {IPDFStreamRangeReader} */\nclass PDFNetworkStreamRangeRequestReader {\n constructor(manager, begin, end) {\n this._manager = manager;\n\n const args = {\n onDone: this._onDone.bind(this),\n onError: this._onError.bind(this),\n onProgress: this._onProgress.bind(this),\n };\n this._url = manager.url;\n this._requestId = manager.requestRange(begin, end, args);\n this._requests = [];\n this._queuedChunk = null;\n this._done = false;\n this._storedError = undefined;\n\n this.onProgress = null;\n this.onClosed = null;\n }\n\n _close() {\n this.onClosed?.(this);\n }\n\n _onDone(data) {\n const chunk = data.chunk;\n if (this._requests.length > 0) {\n const requestCapability = this._requests.shift();\n requestCapability.resolve({ value: chunk, done: false });\n } else {\n this._queuedChunk = chunk;\n }\n this._done = true;\n for (const requestCapability of this._requests) {\n requestCapability.resolve({ value: undefined, done: true });\n }\n this._requests.length = 0;\n this._close();\n }\n\n _onError(status) {\n this._storedError = createResponseStatusError(status, this._url);\n for (const requestCapability of this._requests) {\n requestCapability.reject(this._storedError);\n }\n this._requests.length = 0;\n this._queuedChunk = null;\n }\n\n _onProgress(evt) {\n if (!this.isStreamingSupported) {\n this.onProgress?.({ loaded: evt.loaded });\n }\n }\n\n get isStreamingSupported() {\n return false;\n }\n\n async read() {\n if (this._storedError) {\n throw this._storedError;\n }\n if (this._queuedChunk !== null) {\n const chunk = this._queuedChunk;\n this._queuedChunk = null;\n return { value: chunk, done: false };\n }\n if (this._done) {\n return { value: undefined, done: true };\n }\n const requestCapability = Promise.withResolvers();\n this._requests.push(requestCapability);\n return requestCapability.promise;\n }\n\n cancel(reason) {\n this._done = true;\n for (const requestCapability of this._requests) {\n requestCapability.resolve({ value: undefined, done: true });\n }\n this._requests.length = 0;\n if (this._manager.isPendingRequest(this._requestId)) {\n this._manager.abortRequest(this._requestId);\n }\n this._close();\n }\n}\n\nexport { PDFNetworkStream };\n","/* Copyright 2012 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\nimport { AbortException, assert, MissingPDFException } from \"../shared/util.js\";\nimport {\n extractFilenameFromHeader,\n validateRangeRequestCapabilities,\n} from \"./network_utils.js\";\nimport { NodePackages } from \"./node_utils.js\";\n\nif (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) {\n throw new Error(\n 'Module \"./node_stream.js\" shall not be used with MOZCENTRAL builds.'\n );\n}\n\nconst fileUriRegex = /^file:\\/\\/\\/[a-zA-Z]:\\//;\n\nfunction parseUrl(sourceUrl) {\n const url = NodePackages.get(\"url\");\n const parsedUrl = url.parse(sourceUrl);\n if (parsedUrl.protocol === \"file:\" || parsedUrl.host) {\n return parsedUrl;\n }\n // Prepending 'file:///' to Windows absolute path.\n if (/^[a-z]:[/\\\\]/i.test(sourceUrl)) {\n return url.parse(`file:///${sourceUrl}`);\n }\n // Changes protocol to 'file:' if url refers to filesystem.\n if (!parsedUrl.host) {\n parsedUrl.protocol = \"file:\";\n }\n return parsedUrl;\n}\n\nclass PDFNodeStream {\n constructor(source) {\n this.source = source;\n this.url = parseUrl(source.url);\n this.isHttp =\n this.url.protocol === \"http:\" || this.url.protocol === \"https:\";\n // Check if url refers to filesystem.\n this.isFsUrl = this.url.protocol === \"file:\";\n this.httpHeaders = (this.isHttp && source.httpHeaders) || {};\n\n this._fullRequestReader = null;\n this._rangeRequestReaders = [];\n }\n\n get _progressiveDataLength() {\n return this._fullRequestReader?._loaded ?? 0;\n }\n\n getFullReader() {\n assert(\n !this._fullRequestReader,\n \"PDFNodeStream.getFullReader can only be called once.\"\n );\n this._fullRequestReader = this.isFsUrl\n ? new PDFNodeStreamFsFullReader(this)\n : new PDFNodeStreamFullReader(this);\n return this._fullRequestReader;\n }\n\n getRangeReader(start, end) {\n if (end <= this._progressiveDataLength) {\n return null;\n }\n const rangeReader = this.isFsUrl\n ? new PDFNodeStreamFsRangeReader(this, start, end)\n : new PDFNodeStreamRangeReader(this, start, end);\n this._rangeRequestReaders.push(rangeReader);\n return rangeReader;\n }\n\n cancelAllRequests(reason) {\n this._fullRequestReader?.cancel(reason);\n\n for (const reader of this._rangeRequestReaders.slice(0)) {\n reader.cancel(reason);\n }\n }\n}\n\nclass BaseFullReader {\n constructor(stream) {\n this._url = stream.url;\n this._done = false;\n this._storedError = null;\n this.onProgress = null;\n const source = stream.source;\n this._contentLength = source.length; // optional\n this._loaded = 0;\n this._filename = null;\n\n this._disableRange = source.disableRange || false;\n this._rangeChunkSize = source.rangeChunkSize;\n if (!this._rangeChunkSize && !this._disableRange) {\n this._disableRange = true;\n }\n\n this._isStreamingSupported = !source.disableStream;\n this._isRangeSupported = !source.disableRange;\n\n this._readableStream = null;\n this._readCapability = Promise.withResolvers();\n this._headersCapability = Promise.withResolvers();\n }\n\n get headersReady() {\n return this._headersCapability.promise;\n }\n\n get filename() {\n return this._filename;\n }\n\n get contentLength() {\n return this._contentLength;\n }\n\n get isRangeSupported() {\n return this._isRangeSupported;\n }\n\n get isStreamingSupported() {\n return this._isStreamingSupported;\n }\n\n async read() {\n await this._readCapability.promise;\n if (this._done) {\n return { value: undefined, done: true };\n }\n if (this._storedError) {\n throw this._storedError;\n }\n\n const chunk = this._readableStream.read();\n if (chunk === null) {\n this._readCapability = Promise.withResolvers();\n return this.read();\n }\n this._loaded += chunk.length;\n this.onProgress?.({\n loaded: this._loaded,\n total: this._contentLength,\n });\n\n // Ensure that `read()` method returns ArrayBuffer.\n const buffer = new Uint8Array(chunk).buffer;\n return { value: buffer, done: false };\n }\n\n cancel(reason) {\n // Call `this._error()` method when cancel is called\n // before _readableStream is set.\n if (!this._readableStream) {\n this._error(reason);\n return;\n }\n this._readableStream.destroy(reason);\n }\n\n _error(reason) {\n this._storedError = reason;\n this._readCapability.resolve();\n }\n\n _setReadableStream(readableStream) {\n this._readableStream = readableStream;\n readableStream.on(\"readable\", () => {\n this._readCapability.resolve();\n });\n\n readableStream.on(\"end\", () => {\n // Destroy readable to minimize resource usage.\n readableStream.destroy();\n this._done = true;\n this._readCapability.resolve();\n });\n\n readableStream.on(\"error\", reason => {\n this._error(reason);\n });\n\n // We need to stop reading when range is supported and streaming is\n // disabled.\n if (!this._isStreamingSupported && this._isRangeSupported) {\n this._error(new AbortException(\"streaming is disabled\"));\n }\n\n // Destroy ReadableStream if already in errored state.\n if (this._storedError) {\n this._readableStream.destroy(this._storedError);\n }\n }\n}\n\nclass BaseRangeReader {\n constructor(stream) {\n this._url = stream.url;\n this._done = false;\n this._storedError = null;\n this.onProgress = null;\n this._loaded = 0;\n this._readableStream = null;\n this._readCapability = Promise.withResolvers();\n const source = stream.source;\n this._isStreamingSupported = !source.disableStream;\n }\n\n get isStreamingSupported() {\n return this._isStreamingSupported;\n }\n\n async read() {\n await this._readCapability.promise;\n if (this._done) {\n return { value: undefined, done: true };\n }\n if (this._storedError) {\n throw this._storedError;\n }\n\n const chunk = this._readableStream.read();\n if (chunk === null) {\n this._readCapability = Promise.withResolvers();\n return this.read();\n }\n this._loaded += chunk.length;\n this.onProgress?.({ loaded: this._loaded });\n\n // Ensure that `read()` method returns ArrayBuffer.\n const buffer = new Uint8Array(chunk).buffer;\n return { value: buffer, done: false };\n }\n\n cancel(reason) {\n // Call `this._error()` method when cancel is called\n // before _readableStream is set.\n if (!this._readableStream) {\n this._error(reason);\n return;\n }\n this._readableStream.destroy(reason);\n }\n\n _error(reason) {\n this._storedError = reason;\n this._readCapability.resolve();\n }\n\n _setReadableStream(readableStream) {\n this._readableStream = readableStream;\n readableStream.on(\"readable\", () => {\n this._readCapability.resolve();\n });\n\n readableStream.on(\"end\", () => {\n // Destroy readableStream to minimize resource usage.\n readableStream.destroy();\n this._done = true;\n this._readCapability.resolve();\n });\n\n readableStream.on(\"error\", reason => {\n this._error(reason);\n });\n\n // Destroy readableStream if already in errored state.\n if (this._storedError) {\n this._readableStream.destroy(this._storedError);\n }\n }\n}\n\nfunction createRequestOptions(parsedUrl, headers) {\n return {\n protocol: parsedUrl.protocol,\n auth: parsedUrl.auth,\n host: parsedUrl.hostname,\n port: parsedUrl.port,\n path: parsedUrl.path,\n method: \"GET\",\n headers,\n };\n}\n\nclass PDFNodeStreamFullReader extends BaseFullReader {\n constructor(stream) {\n super(stream);\n\n const handleResponse = response => {\n if (response.statusCode === 404) {\n const error = new MissingPDFException(`Missing PDF \"${this._url}\".`);\n this._storedError = error;\n this._headersCapability.reject(error);\n return;\n }\n this._headersCapability.resolve();\n this._setReadableStream(response);\n\n // Make sure that headers name are in lower case, as mentioned\n // here: https://nodejs.org/api/http.html#http_message_headers.\n const getResponseHeader = name =>\n this._readableStream.headers[name.toLowerCase()];\n\n const { allowRangeRequests, suggestedLength } =\n validateRangeRequestCapabilities({\n getResponseHeader,\n isHttp: stream.isHttp,\n rangeChunkSize: this._rangeChunkSize,\n disableRange: this._disableRange,\n });\n\n this._isRangeSupported = allowRangeRequests;\n // Setting right content length.\n this._contentLength = suggestedLength || this._contentLength;\n\n this._filename = extractFilenameFromHeader(getResponseHeader);\n };\n\n this._request = null;\n if (this._url.protocol === \"http:\") {\n const http = NodePackages.get(\"http\");\n this._request = http.request(\n createRequestOptions(this._url, stream.httpHeaders),\n handleResponse\n );\n } else {\n const https = NodePackages.get(\"https\");\n this._request = https.request(\n createRequestOptions(this._url, stream.httpHeaders),\n handleResponse\n );\n }\n\n this._request.on(\"error\", reason => {\n this._storedError = reason;\n this._headersCapability.reject(reason);\n });\n // Note: `request.end(data)` is used to write `data` to request body\n // and notify end of request. But one should always call `request.end()`\n // even if there is no data to write -- (to notify the end of request).\n this._request.end();\n }\n}\n\nclass PDFNodeStreamRangeReader extends BaseRangeReader {\n constructor(stream, start, end) {\n super(stream);\n\n this._httpHeaders = {};\n for (const property in stream.httpHeaders) {\n const value = stream.httpHeaders[property];\n if (value === undefined) {\n continue;\n }\n this._httpHeaders[property] = value;\n }\n this._httpHeaders.Range = `bytes=${start}-${end - 1}`;\n\n const handleResponse = response => {\n if (response.statusCode === 404) {\n const error = new MissingPDFException(`Missing PDF \"${this._url}\".`);\n this._storedError = error;\n return;\n }\n this._setReadableStream(response);\n };\n\n this._request = null;\n if (this._url.protocol === \"http:\") {\n const http = NodePackages.get(\"http\");\n this._request = http.request(\n createRequestOptions(this._url, this._httpHeaders),\n handleResponse\n );\n } else {\n const https = NodePackages.get(\"https\");\n this._request = https.request(\n createRequestOptions(this._url, this._httpHeaders),\n handleResponse\n );\n }\n\n this._request.on(\"error\", reason => {\n this._storedError = reason;\n });\n this._request.end();\n }\n}\n\nclass PDFNodeStreamFsFullReader extends BaseFullReader {\n constructor(stream) {\n super(stream);\n\n let path = decodeURIComponent(this._url.path);\n\n // Remove the extra slash to get right path from url like `file:///C:/`\n if (fileUriRegex.test(this._url.href)) {\n path = path.replace(/^\\//, \"\");\n }\n\n const fs = NodePackages.get(\"fs\");\n fs.promises.lstat(path).then(\n stat => {\n // Setting right content length.\n this._contentLength = stat.size;\n\n this._setReadableStream(fs.createReadStream(path));\n this._headersCapability.resolve();\n },\n error => {\n if (error.code === \"ENOENT\") {\n error = new MissingPDFException(`Missing PDF \"${path}\".`);\n }\n this._storedError = error;\n this._headersCapability.reject(error);\n }\n );\n }\n}\n\nclass PDFNodeStreamFsRangeReader extends BaseRangeReader {\n constructor(stream, start, end) {\n super(stream);\n\n let path = decodeURIComponent(this._url.path);\n\n // Remove the extra slash to get right path from url like `file:///C:/`\n if (fileUriRegex.test(this._url.href)) {\n path = path.replace(/^\\//, \"\");\n }\n\n const fs = NodePackages.get(\"fs\");\n this._setReadableStream(fs.createReadStream(path, { start, end: end - 1 }));\n }\n}\n\nexport { PDFNodeStream };\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 */\n\n/** @typedef {import(\"./display_utils\").PageViewport} PageViewport */\n/** @typedef {import(\"./api\").TextContent} TextContent */\n\nimport { AbortException, Util, warn } from \"../shared/util.js\";\nimport { deprecated, setLayerDimensions } from \"./display_utils.js\";\n\n/**\n * @typedef {Object} TextLayerParameters\n * @property {ReadableStream | TextContent} textContentSource - Text content to\n * render, i.e. the value returned by the page's `streamTextContent` or\n * `getTextContent` method.\n * @property {HTMLElement} container - The DOM node that will contain the text\n * runs.\n * @property {PageViewport} viewport - The target viewport to properly layout\n * the text runs.\n */\n\n/**\n * @typedef {Object} TextLayerUpdateParameters\n * @property {PageViewport} viewport - The target viewport to properly layout\n * the text runs.\n * @property {function} [onBefore] - Callback invoked before the textLayer is\n * updated in the DOM.\n */\n\nconst MAX_TEXT_DIVS_TO_RENDER = 100000;\nconst DEFAULT_FONT_SIZE = 30;\nconst DEFAULT_FONT_ASCENT = 0.8;\n\nclass TextLayer {\n #capability = Promise.withResolvers();\n\n #container = null;\n\n #disableProcessItems = false;\n\n #fontInspectorEnabled = !!globalThis.FontInspector?.enabled;\n\n #lang = null;\n\n #layoutTextParams = null;\n\n #pageHeight = 0;\n\n #pageWidth = 0;\n\n #reader = null;\n\n #rootContainer = null;\n\n #rotation = 0;\n\n #scale = 0;\n\n #styleCache = Object.create(null);\n\n #textContentItemsStr = [];\n\n #textContentSource = null;\n\n #textDivs = [];\n\n #textDivProperties = new WeakMap();\n\n #transform = null;\n\n static #ascentCache = new Map();\n\n static #canvasContexts = new Map();\n\n static #pendingTextLayers = new Set();\n\n /**\n * @param {TextLayerParameters} options\n */\n constructor({ textContentSource, container, viewport }) {\n if (textContentSource instanceof ReadableStream) {\n this.#textContentSource = textContentSource;\n } else if (\n (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"GENERIC\")) &&\n typeof textContentSource === \"object\"\n ) {\n this.#textContentSource = new ReadableStream({\n start(controller) {\n controller.enqueue(textContentSource);\n controller.close();\n },\n });\n } else {\n throw new Error('No \"textContentSource\" parameter specified.');\n }\n this.#container = this.#rootContainer = container;\n\n this.#scale = viewport.scale * (globalThis.devicePixelRatio || 1);\n this.#rotation = viewport.rotation;\n this.#layoutTextParams = {\n prevFontSize: null,\n prevFontFamily: null,\n div: null,\n properties: null,\n ctx: null,\n };\n const { pageWidth, pageHeight, pageX, pageY } = viewport.rawDims;\n this.#transform = [1, 0, 0, -1, -pageX, pageY + pageHeight];\n this.#pageWidth = pageWidth;\n this.#pageHeight = pageHeight;\n\n setLayerDimensions(container, viewport);\n\n // Always clean-up the temporary canvas once rendering is no longer pending.\n this.#capability.promise\n .catch(() => {\n // Avoid \"Uncaught promise\" messages in the console.\n })\n .then(() => {\n TextLayer.#pendingTextLayers.delete(this);\n this.#layoutTextParams = null;\n this.#styleCache = null;\n });\n\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) {\n // For testing purposes.\n Object.defineProperty(this, \"pageWidth\", {\n get() {\n return this.#pageWidth;\n },\n });\n Object.defineProperty(this, \"pageHeight\", {\n get() {\n return this.#pageHeight;\n },\n });\n }\n }\n\n /**\n * Render the textLayer.\n * @returns {Promise}\n */\n render() {\n const pump = () => {\n this.#reader.read().then(({ value, done }) => {\n if (done) {\n this.#capability.resolve();\n return;\n }\n this.#lang ??= value.lang;\n Object.assign(this.#styleCache, value.styles);\n this.#processItems(value.items);\n pump();\n }, this.#capability.reject);\n };\n this.#reader = this.#textContentSource.getReader();\n TextLayer.#pendingTextLayers.add(this);\n pump();\n\n return this.#capability.promise;\n }\n\n /**\n * Update a previously rendered textLayer, if necessary.\n * @param {TextLayerUpdateParameters} options\n * @returns {undefined}\n */\n update({ viewport, onBefore = null }) {\n const scale = viewport.scale * (globalThis.devicePixelRatio || 1);\n const rotation = viewport.rotation;\n\n if (rotation !== this.#rotation) {\n onBefore?.();\n this.#rotation = rotation;\n setLayerDimensions(this.#rootContainer, { rotation });\n }\n\n if (scale !== this.#scale) {\n onBefore?.();\n this.#scale = scale;\n const params = {\n prevFontSize: null,\n prevFontFamily: null,\n div: null,\n properties: null,\n ctx: TextLayer.#getCtx(this.#lang),\n };\n for (const div of this.#textDivs) {\n params.properties = this.#textDivProperties.get(div);\n params.div = div;\n this.#layout(params);\n }\n }\n }\n\n /**\n * Cancel rendering of the textLayer.\n * @returns {undefined}\n */\n cancel() {\n const abortEx = new AbortException(\"TextLayer task cancelled.\");\n\n this.#reader?.cancel(abortEx).catch(() => {\n // Avoid \"Uncaught promise\" messages in the console.\n });\n this.#reader = null;\n\n this.#capability.reject(abortEx);\n }\n\n /**\n * @type {Array} HTML elements that correspond to the text items\n * of the textContent input.\n * This is output and will initially be set to an empty array.\n */\n get textDivs() {\n return this.#textDivs;\n }\n\n /**\n * @type {Array} Strings that correspond to the `str` property of\n * the text items of the textContent input.\n * This is output and will initially be set to an empty array\n */\n get textContentItemsStr() {\n return this.#textContentItemsStr;\n }\n\n #processItems(items) {\n if (this.#disableProcessItems) {\n return;\n }\n this.#layoutTextParams.ctx ||= TextLayer.#getCtx(this.#lang);\n\n const textDivs = this.#textDivs,\n textContentItemsStr = this.#textContentItemsStr;\n\n for (const item of items) {\n // No point in rendering many divs as it would make the browser\n // unusable even after the divs are rendered.\n if (textDivs.length > MAX_TEXT_DIVS_TO_RENDER) {\n warn(\"Ignoring additional textDivs for performance reasons.\");\n\n this.#disableProcessItems = true; // Avoid multiple warnings for one page.\n return;\n }\n\n if (item.str === undefined) {\n if (\n item.type === \"beginMarkedContentProps\" ||\n item.type === \"beginMarkedContent\"\n ) {\n const parent = this.#container;\n this.#container = document.createElement(\"span\");\n this.#container.classList.add(\"markedContent\");\n if (item.id !== null) {\n this.#container.setAttribute(\"id\", `${item.id}`);\n }\n parent.append(this.#container);\n } else if (item.type === \"endMarkedContent\") {\n this.#container = this.#container.parentNode;\n }\n continue;\n }\n textContentItemsStr.push(item.str);\n this.#appendText(item);\n }\n }\n\n #appendText(geom) {\n // Initialize all used properties to keep the caches monomorphic.\n const textDiv = document.createElement(\"span\");\n const textDivProperties = {\n angle: 0,\n canvasWidth: 0,\n hasText: geom.str !== \"\",\n hasEOL: geom.hasEOL,\n fontSize: 0,\n };\n this.#textDivs.push(textDiv);\n\n const tx = Util.transform(this.#transform, geom.transform);\n let angle = Math.atan2(tx[1], tx[0]);\n const style = this.#styleCache[geom.fontName];\n if (style.vertical) {\n angle += Math.PI / 2;\n }\n\n const fontFamily =\n (this.#fontInspectorEnabled && style.fontSubstitution) ||\n style.fontFamily;\n const fontHeight = Math.hypot(tx[2], tx[3]);\n const fontAscent =\n fontHeight * TextLayer.#getAscent(fontFamily, this.#lang);\n\n let left, top;\n if (angle === 0) {\n left = tx[4];\n top = tx[5] - fontAscent;\n } else {\n left = tx[4] + fontAscent * Math.sin(angle);\n top = tx[5] - fontAscent * Math.cos(angle);\n }\n\n const scaleFactorStr = \"calc(var(--scale-factor)*\";\n const divStyle = textDiv.style;\n // Setting the style properties individually, rather than all at once,\n // should be OK since the `textDiv` isn't appended to the document yet.\n if (this.#container === this.#rootContainer) {\n divStyle.left = `${((100 * left) / this.#pageWidth).toFixed(2)}%`;\n divStyle.top = `${((100 * top) / this.#pageHeight).toFixed(2)}%`;\n } else {\n // We're in a marked content span, hence we can't use percents.\n divStyle.left = `${scaleFactorStr}${left.toFixed(2)}px)`;\n divStyle.top = `${scaleFactorStr}${top.toFixed(2)}px)`;\n }\n divStyle.fontSize = `${scaleFactorStr}${fontHeight.toFixed(2)}px)`;\n divStyle.fontFamily = fontFamily;\n\n textDivProperties.fontSize = fontHeight;\n\n // Keeps screen readers from pausing on every new text span.\n textDiv.setAttribute(\"role\", \"presentation\");\n\n textDiv.textContent = geom.str;\n // geom.dir may be 'ttb' for vertical texts.\n textDiv.dir = geom.dir;\n\n // `fontName` is only used by the FontInspector, and we only use `dataset`\n // here to make the font name available in the debugger.\n if (this.#fontInspectorEnabled) {\n textDiv.dataset.fontName =\n style.fontSubstitutionLoadedName || geom.fontName;\n }\n if (angle !== 0) {\n textDivProperties.angle = angle * (180 / Math.PI);\n }\n // We don't bother scaling single-char text divs, because it has very\n // little effect on text highlighting. This makes scrolling on docs with\n // lots of such divs a lot faster.\n let shouldScaleText = false;\n if (geom.str.length > 1) {\n shouldScaleText = true;\n } else if (geom.str !== \" \" && geom.transform[0] !== geom.transform[3]) {\n const absScaleX = Math.abs(geom.transform[0]),\n absScaleY = Math.abs(geom.transform[3]);\n // When the horizontal/vertical scaling differs significantly, also scale\n // even single-char text to improve highlighting (fixes issue11713.pdf).\n if (\n absScaleX !== absScaleY &&\n Math.max(absScaleX, absScaleY) / Math.min(absScaleX, absScaleY) > 1.5\n ) {\n shouldScaleText = true;\n }\n }\n if (shouldScaleText) {\n textDivProperties.canvasWidth = style.vertical ? geom.height : geom.width;\n }\n this.#textDivProperties.set(textDiv, textDivProperties);\n\n // Finally, layout and append the text to the DOM.\n this.#layoutTextParams.div = textDiv;\n this.#layoutTextParams.properties = textDivProperties;\n this.#layout(this.#layoutTextParams);\n\n if (textDivProperties.hasText) {\n this.#container.append(textDiv);\n }\n if (textDivProperties.hasEOL) {\n const br = document.createElement(\"br\");\n br.setAttribute(\"role\", \"presentation\");\n this.#container.append(br);\n }\n }\n\n #layout(params) {\n const { div, properties, ctx, prevFontSize, prevFontFamily } = params;\n const { style } = div;\n let transform = \"\";\n if (properties.canvasWidth !== 0 && properties.hasText) {\n const { fontFamily } = style;\n const { canvasWidth, fontSize } = properties;\n\n if (prevFontSize !== fontSize || prevFontFamily !== fontFamily) {\n ctx.font = `${fontSize * this.#scale}px ${fontFamily}`;\n params.prevFontSize = fontSize;\n params.prevFontFamily = fontFamily;\n }\n\n // Only measure the width for multi-char text divs, see `appendText`.\n const { width } = ctx.measureText(div.textContent);\n\n if (width > 0) {\n transform = `scaleX(${(canvasWidth * this.#scale) / width})`;\n }\n }\n if (properties.angle !== 0) {\n transform = `rotate(${properties.angle}deg) ${transform}`;\n }\n if (transform.length > 0) {\n style.transform = transform;\n }\n }\n\n /**\n * Clean-up global textLayer data.\n * @returns {undefined}\n */\n static cleanup() {\n if (this.#pendingTextLayers.size > 0) {\n return;\n }\n this.#ascentCache.clear();\n\n for (const { canvas } of this.#canvasContexts.values()) {\n canvas.remove();\n }\n this.#canvasContexts.clear();\n }\n\n static #getCtx(lang = null) {\n let canvasContext = this.#canvasContexts.get((lang ||= \"\"));\n if (!canvasContext) {\n // We don't use an OffscreenCanvas here because we use serif/sans serif\n // fonts with it and they depends on the locale.\n // In Firefox, the element get a lang attribute that depends on\n // what Fluent returns for the locale and the OffscreenCanvas uses\n // the OS locale.\n // Those two locales can be different and consequently the used fonts will\n // be different (see bug 1869001).\n // Ideally, we should use in the text layer the fonts we've in the pdf (or\n // their replacements when they aren't embedded) and then we can use an\n // OffscreenCanvas.\n const canvas = document.createElement(\"canvas\");\n canvas.className = \"hiddenCanvasElement\";\n canvas.lang = lang;\n document.body.append(canvas);\n canvasContext = canvas.getContext(\"2d\", { alpha: false });\n this.#canvasContexts.set(lang, canvasContext);\n }\n return canvasContext;\n }\n\n static #getAscent(fontFamily, lang) {\n const cachedAscent = this.#ascentCache.get(fontFamily);\n if (cachedAscent) {\n return cachedAscent;\n }\n const ctx = this.#getCtx(lang);\n\n const savedFont = ctx.font;\n ctx.canvas.width = ctx.canvas.height = DEFAULT_FONT_SIZE;\n ctx.font = `${DEFAULT_FONT_SIZE}px ${fontFamily}`;\n const metrics = ctx.measureText(\"\");\n\n // Both properties aren't available by default in Firefox.\n let ascent = metrics.fontBoundingBoxAscent;\n let descent = Math.abs(metrics.fontBoundingBoxDescent);\n if (ascent) {\n const ratio = ascent / (ascent + descent);\n this.#ascentCache.set(fontFamily, ratio);\n\n ctx.canvas.width = ctx.canvas.height = 0;\n ctx.font = savedFont;\n return ratio;\n }\n\n // Try basic heuristic to guess ascent/descent.\n // Draw a g with baseline at 0,0 and then get the line\n // number where a pixel has non-null red component (starting\n // from bottom).\n ctx.strokeStyle = \"red\";\n ctx.clearRect(0, 0, DEFAULT_FONT_SIZE, DEFAULT_FONT_SIZE);\n ctx.strokeText(\"g\", 0, 0);\n let pixels = ctx.getImageData(\n 0,\n 0,\n DEFAULT_FONT_SIZE,\n DEFAULT_FONT_SIZE\n ).data;\n descent = 0;\n for (let i = pixels.length - 1 - 3; i >= 0; i -= 4) {\n if (pixels[i] > 0) {\n descent = Math.ceil(i / 4 / DEFAULT_FONT_SIZE);\n break;\n }\n }\n\n // Draw an A with baseline at 0,DEFAULT_FONT_SIZE and then get the line\n // number where a pixel has non-null red component (starting\n // from top).\n ctx.clearRect(0, 0, DEFAULT_FONT_SIZE, DEFAULT_FONT_SIZE);\n ctx.strokeText(\"A\", 0, DEFAULT_FONT_SIZE);\n pixels = ctx.getImageData(0, 0, DEFAULT_FONT_SIZE, DEFAULT_FONT_SIZE).data;\n ascent = 0;\n for (let i = 0, ii = pixels.length; i < ii; i += 4) {\n if (pixels[i] > 0) {\n ascent = DEFAULT_FONT_SIZE - Math.floor(i / 4 / DEFAULT_FONT_SIZE);\n break;\n }\n }\n\n ctx.canvas.width = ctx.canvas.height = 0;\n ctx.font = savedFont;\n\n const ratio = ascent ? ascent / (ascent + descent) : DEFAULT_FONT_ASCENT;\n this.#ascentCache.set(fontFamily, ratio);\n return ratio;\n }\n}\n\nfunction renderTextLayer() {\n if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) {\n return;\n }\n deprecated(\"`renderTextLayer`, please use `TextLayer` instead.\");\n\n const { textContentSource, container, viewport, ...rest } = arguments[0];\n const restKeys = Object.keys(rest);\n if (restKeys.length > 0) {\n warn(\"Ignoring `renderTextLayer` parameters: \" + restKeys.join(\", \"));\n }\n\n const textLayer = new TextLayer({\n textContentSource,\n container,\n viewport,\n });\n\n const { textDivs, textContentItemsStr } = textLayer;\n const promise = textLayer.render();\n\n // eslint-disable-next-line consistent-return\n return {\n promise,\n textDivs,\n textContentItemsStr,\n };\n}\n\nfunction updateTextLayer() {\n if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) {\n return;\n }\n deprecated(\"`updateTextLayer`, please use `TextLayer` instead.\");\n}\n\nexport { renderTextLayer, TextLayer, updateTextLayer };\n","/* Copyright 2021 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\n/** @typedef {import(\"./api\").TextContent} TextContent */\n\nclass XfaText {\n /**\n * Walk an XFA tree and create an array of text nodes that is compatible\n * with a regular PDFs TextContent. Currently, only TextItem.str is supported,\n * all other fields and styles haven't been implemented.\n *\n * @param {Object} xfa - An XFA fake DOM object.\n *\n * @returns {TextContent}\n */\n static textContent(xfa) {\n const items = [];\n const output = {\n items,\n styles: Object.create(null),\n };\n function walk(node) {\n if (!node) {\n return;\n }\n let str = null;\n const name = node.name;\n if (name === \"#text\") {\n str = node.value;\n } else if (!XfaText.shouldBuildText(name)) {\n return;\n } else if (node?.attributes?.textContent) {\n str = node.attributes.textContent;\n } else if (node.value) {\n str = node.value;\n }\n if (str !== null) {\n items.push({\n str,\n });\n }\n if (!node.children) {\n return;\n }\n for (const child of node.children) {\n walk(child);\n }\n }\n walk(xfa);\n return output;\n }\n\n /**\n * @param {string} name - DOM node name. (lower case)\n *\n * @returns {boolean} true if the DOM node should have a corresponding text\n * node.\n */\n static shouldBuildText(name) {\n return !(\n name === \"textarea\" ||\n name === \"input\" ||\n name === \"option\" ||\n name === \"select\"\n );\n }\n}\n\nexport { XfaText };\n","/* Copyright 2012 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\n/**\n * @module pdfjsLib\n */\n\nimport {\n AbortException,\n AnnotationMode,\n assert,\n getVerbosityLevel,\n info,\n InvalidPDFException,\n isNodeJS,\n MAX_IMAGE_SIZE_TO_CACHE,\n MissingPDFException,\n PasswordException,\n RenderingIntentFlag,\n setVerbosityLevel,\n shadow,\n stringToBytes,\n UnexpectedResponseException,\n UnknownErrorException,\n unreachable,\n warn,\n} from \"../shared/util.js\";\nimport {\n AnnotationStorage,\n PrintAnnotationStorage,\n SerializableEmpty,\n} from \"./annotation_storage.js\";\nimport {\n DOMCanvasFactory,\n DOMCMapReaderFactory,\n DOMFilterFactory,\n DOMStandardFontDataFactory,\n isDataScheme,\n isValidFetchUrl,\n PageViewport,\n RenderingCancelledException,\n StatTimer,\n} from \"./display_utils.js\";\nimport { FontFaceObject, FontLoader } from \"./font_loader.js\";\nimport {\n NodeCanvasFactory,\n NodeCMapReaderFactory,\n NodeFilterFactory,\n NodePackages,\n NodeStandardFontDataFactory,\n} from \"display-node_utils\";\nimport { CanvasGraphics } from \"./canvas.js\";\nimport { GlobalWorkerOptions } from \"./worker_options.js\";\nimport { MessageHandler } from \"../shared/message_handler.js\";\nimport { Metadata } from \"./metadata.js\";\nimport { OptionalContentConfig } from \"./optional_content_config.js\";\nimport { PDFDataTransportStream } from \"./transport_stream.js\";\nimport { PDFFetchStream } from \"display-fetch_stream\";\nimport { PDFNetworkStream } from \"display-network\";\nimport { PDFNodeStream } from \"display-node_stream\";\nimport { TextLayer } from \"./text_layer.js\";\nimport { XfaText } from \"./xfa_text.js\";\n\nconst DEFAULT_RANGE_CHUNK_SIZE = 65536; // 2^16 = 65536\nconst RENDERING_CANCELLED_TIMEOUT = 100; // ms\nconst DELAYED_CLEANUP_TIMEOUT = 5000; // ms\n\nconst DefaultCanvasFactory =\n typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"GENERIC\") && isNodeJS\n ? NodeCanvasFactory\n : DOMCanvasFactory;\nconst DefaultCMapReaderFactory =\n typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"GENERIC\") && isNodeJS\n ? NodeCMapReaderFactory\n : DOMCMapReaderFactory;\nconst DefaultFilterFactory =\n typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"GENERIC\") && isNodeJS\n ? NodeFilterFactory\n : DOMFilterFactory;\nconst DefaultStandardFontDataFactory =\n typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"GENERIC\") && isNodeJS\n ? NodeStandardFontDataFactory\n : DOMStandardFontDataFactory;\n\n/**\n * @typedef { Int8Array | Uint8Array | Uint8ClampedArray |\n * Int16Array | Uint16Array |\n * Int32Array | Uint32Array | Float32Array |\n * Float64Array\n * } TypedArray\n */\n\n/**\n * @typedef {Object} RefProxy\n * @property {number} num\n * @property {number} gen\n */\n\n/**\n * Document initialization / loading parameters object.\n *\n * @typedef {Object} DocumentInitParameters\n * @property {string | URL} [url] - The URL of the PDF.\n * @property {TypedArray | ArrayBuffer | Array | string} [data] -\n * Binary PDF data.\n * Use TypedArrays (Uint8Array) to improve the memory usage. If PDF data is\n * BASE64-encoded, use `atob()` to convert it to a binary string first.\n *\n * NOTE: If TypedArrays are used they will generally be transferred to the\n * worker-thread. This will help reduce main-thread memory usage, however\n * it will take ownership of the TypedArrays.\n * @property {Object} [httpHeaders] - Basic authentication headers.\n * @property {boolean} [withCredentials] - Indicates whether or not\n * cross-site Access-Control requests should be made using credentials such\n * as cookies or authorization headers. The default is `false`.\n * @property {string} [password] - For decrypting password-protected PDFs.\n * @property {number} [length] - The PDF file length. It's used for progress\n * reports and range requests operations.\n * @property {PDFDataRangeTransport} [range] - Allows for using a custom range\n * transport implementation.\n * @property {number} [rangeChunkSize] - Specify maximum number of bytes fetched\n * per range request. The default value is {@link DEFAULT_RANGE_CHUNK_SIZE}.\n * @property {PDFWorker} [worker] - The worker that will be used for loading and\n * parsing the PDF data.\n * @property {number} [verbosity] - Controls the logging level; the constants\n * from {@link VerbosityLevel} should be used.\n * @property {string} [docBaseUrl] - The base URL of the document, used when\n * attempting to recover valid absolute URLs for annotations, and outline\n * items, that (incorrectly) only specify relative URLs.\n * @property {string} [cMapUrl] - The URL where the predefined Adobe CMaps are\n * located. Include the trailing slash.\n * @property {boolean} [cMapPacked] - Specifies if the Adobe CMaps are binary\n * packed or not. The default value is `true`.\n * @property {Object} [CMapReaderFactory] - The factory that will be used when\n * reading built-in CMap files. Providing a custom factory is useful for\n * environments without Fetch API or `XMLHttpRequest` support, such as\n * Node.js. The default value is {DOMCMapReaderFactory}.\n * @property {boolean} [useSystemFonts] - When `true`, fonts that aren't\n * embedded in the PDF document will fallback to a system font.\n * The default value is `true` in web environments and `false` in Node.js;\n * unless `disableFontFace === true` in which case this defaults to `false`\n * regardless of the environment (to prevent completely broken fonts).\n * @property {string} [standardFontDataUrl] - The URL where the standard font\n * files are located. Include the trailing slash.\n * @property {Object} [StandardFontDataFactory] - The factory that will be used\n * when reading the standard font files. Providing a custom factory is useful\n * for environments without Fetch API or `XMLHttpRequest` support, such as\n * Node.js. The default value is {DOMStandardFontDataFactory}.\n * @property {boolean} [useWorkerFetch] - Enable using the Fetch API in the\n * worker-thread when reading CMap and standard font files. When `true`,\n * the `CMapReaderFactory` and `StandardFontDataFactory` options are ignored.\n * The default value is `true` in web environments and `false` in Node.js.\n * @property {boolean} [stopAtErrors] - Reject certain promises, e.g.\n * `getOperatorList`, `getTextContent`, and `RenderTask`, when the associated\n * PDF data cannot be successfully parsed, instead of attempting to recover\n * whatever possible of the data. The default value is `false`.\n * @property {number} [maxImageSize] - The maximum allowed image size in total\n * pixels, i.e. width * height. Images above this value will not be rendered.\n * Use -1 for no limit, which is also the default value.\n * @property {boolean} [isEvalSupported] - Determines if we can evaluate strings\n * as JavaScript. Primarily used to improve performance of PDF functions.\n * The default value is `true`.\n * @property {boolean} [isOffscreenCanvasSupported] - Determines if we can use\n * `OffscreenCanvas` in the worker. Primarily used to improve performance of\n * image conversion/rendering.\n * The default value is `true` in web environments and `false` in Node.js.\n * @property {number} [canvasMaxAreaInBytes] - The integer value is used to\n * know when an image must be resized (uses `OffscreenCanvas` in the worker).\n * If it's -1 then a possibly slow algorithm is used to guess the max value.\n * @property {boolean} [disableFontFace] - By default fonts are converted to\n * OpenType fonts and loaded via the Font Loading API or `@font-face` rules.\n * If disabled, fonts will be rendered using a built-in font renderer that\n * constructs the glyphs with primitive path commands.\n * The default value is `false` in web environments and `true` in Node.js.\n * @property {boolean} [fontExtraProperties] - Include additional properties,\n * which are unused during rendering of PDF documents, when exporting the\n * parsed font data from the worker-thread. This may be useful for debugging\n * purposes (and backwards compatibility), but note that it will lead to\n * increased memory usage. The default value is `false`.\n * @property {boolean} [enableXfa] - Render Xfa forms if any.\n * The default value is `false`.\n * @property {HTMLDocument} [ownerDocument] - Specify an explicit document\n * context to create elements with and to load resources, such as fonts,\n * into. Defaults to the current document.\n * @property {boolean} [disableRange] - Disable range request loading of PDF\n * files. When enabled, and if the server supports partial content requests,\n * then the PDF will be fetched in chunks. The default value is `false`.\n * @property {boolean} [disableStream] - Disable streaming of PDF file data.\n * By default PDF.js attempts to load PDF files in chunks. The default value\n * is `false`.\n * @property {boolean} [disableAutoFetch] - Disable pre-fetching of PDF file\n * data. When range requests are enabled PDF.js will automatically keep\n * fetching more data even if it isn't needed to display the current page.\n * The default value is `false`.\n *\n * NOTE: It is also necessary to disable streaming, see above, in order for\n * disabling of pre-fetching to work correctly.\n * @property {boolean} [pdfBug] - Enables special hooks for debugging PDF.js\n * (see `web/debugger.js`). The default value is `false`.\n * @property {Object} [canvasFactory] - The factory instance that will be used\n * when creating canvases. The default value is {new DOMCanvasFactory()}.\n * @property {Object} [filterFactory] - A factory instance that will be used\n * to create SVG filters when rendering some images on the main canvas.\n */\n\n/**\n * This is the main entry point for loading a PDF and interacting with it.\n *\n * NOTE: If a URL is used to fetch the PDF data a standard Fetch API call (or\n * XHR as fallback) is used, which means it must follow same origin rules,\n * e.g. no cross-domain requests without CORS.\n *\n * @param {string | URL | TypedArray | ArrayBuffer | DocumentInitParameters}\n * src - Can be a URL where a PDF file is located, a typed array (Uint8Array)\n * already populated with data, or a parameter object.\n * @returns {PDFDocumentLoadingTask}\n */\nfunction getDocument(src) {\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"GENERIC\")) {\n if (typeof src === \"string\" || src instanceof URL) {\n src = { url: src };\n } else if (src instanceof ArrayBuffer || ArrayBuffer.isView(src)) {\n src = { data: src };\n }\n }\n if (typeof src !== \"object\") {\n throw new Error(\"Invalid parameter in getDocument, need parameter object.\");\n }\n if (!src.url && !src.data && !src.range) {\n throw new Error(\n \"Invalid parameter object: need either .data, .range or .url\"\n );\n }\n const task = new PDFDocumentLoadingTask();\n const { docId } = task;\n\n const url = src.url ? getUrlProp(src.url) : null;\n const data = src.data ? getDataProp(src.data) : null;\n const httpHeaders = src.httpHeaders || null;\n const withCredentials = src.withCredentials === true;\n const password = src.password ?? null;\n const rangeTransport =\n src.range instanceof PDFDataRangeTransport ? src.range : null;\n const rangeChunkSize =\n Number.isInteger(src.rangeChunkSize) && src.rangeChunkSize > 0\n ? src.rangeChunkSize\n : DEFAULT_RANGE_CHUNK_SIZE;\n let worker = src.worker instanceof PDFWorker ? src.worker : null;\n const verbosity = src.verbosity;\n // Ignore \"data:\"-URLs, since they can't be used to recover valid absolute\n // URLs anyway. We want to avoid sending them to the worker-thread, since\n // they contain the *entire* PDF document and can thus be arbitrarily long.\n const docBaseUrl =\n typeof src.docBaseUrl === \"string\" && !isDataScheme(src.docBaseUrl)\n ? src.docBaseUrl\n : null;\n const cMapUrl = typeof src.cMapUrl === \"string\" ? src.cMapUrl : null;\n const cMapPacked = src.cMapPacked !== false;\n const CMapReaderFactory = src.CMapReaderFactory || DefaultCMapReaderFactory;\n const standardFontDataUrl =\n typeof src.standardFontDataUrl === \"string\"\n ? src.standardFontDataUrl\n : null;\n const StandardFontDataFactory =\n src.StandardFontDataFactory || DefaultStandardFontDataFactory;\n const ignoreErrors = src.stopAtErrors !== true;\n const maxImageSize =\n Number.isInteger(src.maxImageSize) && src.maxImageSize > -1\n ? src.maxImageSize\n : -1;\n const isEvalSupported = src.isEvalSupported !== false;\n const isOffscreenCanvasSupported =\n typeof src.isOffscreenCanvasSupported === \"boolean\"\n ? src.isOffscreenCanvasSupported\n : !isNodeJS;\n const canvasMaxAreaInBytes = Number.isInteger(src.canvasMaxAreaInBytes)\n ? src.canvasMaxAreaInBytes\n : -1;\n const disableFontFace =\n typeof src.disableFontFace === \"boolean\" ? src.disableFontFace : isNodeJS;\n const fontExtraProperties = src.fontExtraProperties === true;\n const enableXfa = src.enableXfa === true;\n const ownerDocument = src.ownerDocument || globalThis.document;\n const disableRange = src.disableRange === true;\n const disableStream = src.disableStream === true;\n const disableAutoFetch = src.disableAutoFetch === true;\n const pdfBug = src.pdfBug === true;\n\n // Parameters whose default values depend on other parameters.\n const length = rangeTransport ? rangeTransport.length : src.length ?? NaN;\n const useSystemFonts =\n typeof src.useSystemFonts === \"boolean\"\n ? src.useSystemFonts\n : !isNodeJS && !disableFontFace;\n const useWorkerFetch =\n typeof src.useWorkerFetch === \"boolean\"\n ? src.useWorkerFetch\n : (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) ||\n (CMapReaderFactory === DOMCMapReaderFactory &&\n StandardFontDataFactory === DOMStandardFontDataFactory &&\n cMapUrl &&\n standardFontDataUrl &&\n isValidFetchUrl(cMapUrl, document.baseURI) &&\n isValidFetchUrl(standardFontDataUrl, document.baseURI));\n const canvasFactory =\n src.canvasFactory || new DefaultCanvasFactory({ ownerDocument });\n const filterFactory =\n src.filterFactory || new DefaultFilterFactory({ docId, ownerDocument });\n\n // Parameters only intended for development/testing purposes.\n const styleElement =\n typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")\n ? src.styleElement\n : null;\n\n // Set the main-thread verbosity level.\n setVerbosityLevel(verbosity);\n\n // Ensure that the various factories can be initialized, when necessary,\n // since the user may provide *custom* ones.\n const transportFactory = {\n canvasFactory,\n filterFactory,\n };\n if (!useWorkerFetch) {\n transportFactory.cMapReaderFactory = new CMapReaderFactory({\n baseUrl: cMapUrl,\n isCompressed: cMapPacked,\n });\n transportFactory.standardFontDataFactory = new StandardFontDataFactory({\n baseUrl: standardFontDataUrl,\n });\n }\n\n if (!worker) {\n const workerParams = {\n verbosity,\n port: GlobalWorkerOptions.workerPort,\n };\n // Worker was not provided -- creating and owning our own. If message port\n // is specified in global worker options, using it.\n worker = workerParams.port\n ? PDFWorker.fromPort(workerParams)\n : new PDFWorker(workerParams);\n task._worker = worker;\n }\n\n const docParams = {\n docId,\n apiVersion:\n typeof PDFJSDev !== \"undefined\" && !PDFJSDev.test(\"TESTING\")\n ? PDFJSDev.eval(\"BUNDLE_VERSION\")\n : null,\n data,\n password,\n disableAutoFetch,\n rangeChunkSize,\n length,\n docBaseUrl,\n enableXfa,\n evaluatorOptions: {\n maxImageSize,\n disableFontFace,\n ignoreErrors,\n isEvalSupported,\n isOffscreenCanvasSupported,\n canvasMaxAreaInBytes,\n fontExtraProperties,\n useSystemFonts,\n cMapUrl: useWorkerFetch ? cMapUrl : null,\n standardFontDataUrl: useWorkerFetch ? standardFontDataUrl : null,\n },\n };\n const transportParams = {\n disableFontFace,\n fontExtraProperties,\n ownerDocument,\n pdfBug,\n styleElement,\n loadingParams: {\n disableAutoFetch,\n enableXfa,\n },\n };\n\n worker.promise\n .then(function () {\n if (task.destroyed) {\n throw new Error(\"Loading aborted\");\n }\n if (worker.destroyed) {\n throw new Error(\"Worker was destroyed\");\n }\n\n const workerIdPromise = worker.messageHandler.sendWithPromise(\n \"GetDocRequest\",\n docParams,\n data ? [data.buffer] : null\n );\n\n let networkStream;\n if (rangeTransport) {\n networkStream = new PDFDataTransportStream(rangeTransport, {\n disableRange,\n disableStream,\n });\n } else if (!data) {\n if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) {\n throw new Error(\"Not implemented: createPDFNetworkStream\");\n }\n const createPDFNetworkStream = params => {\n if (\n typeof PDFJSDev !== \"undefined\" &&\n PDFJSDev.test(\"GENERIC\") &&\n isNodeJS\n ) {\n const isFetchSupported = function () {\n return (\n typeof fetch !== \"undefined\" &&\n typeof Response !== \"undefined\" &&\n \"body\" in Response.prototype\n );\n };\n return isFetchSupported() && isValidFetchUrl(params.url)\n ? new PDFFetchStream(params)\n : new PDFNodeStream(params);\n }\n return isValidFetchUrl(params.url)\n ? new PDFFetchStream(params)\n : new PDFNetworkStream(params);\n };\n\n networkStream = createPDFNetworkStream({\n url,\n length,\n httpHeaders,\n withCredentials,\n rangeChunkSize,\n disableRange,\n disableStream,\n });\n }\n\n return workerIdPromise.then(workerId => {\n if (task.destroyed) {\n throw new Error(\"Loading aborted\");\n }\n if (worker.destroyed) {\n throw new Error(\"Worker was destroyed\");\n }\n\n const messageHandler = new MessageHandler(docId, workerId, worker.port);\n const transport = new WorkerTransport(\n messageHandler,\n task,\n networkStream,\n transportParams,\n transportFactory\n );\n task._transport = transport;\n messageHandler.send(\"Ready\", null);\n });\n })\n .catch(task._capability.reject);\n\n return task;\n}\n\nfunction getUrlProp(val) {\n if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) {\n return null; // The 'url' is unused with `PDFDataRangeTransport`.\n }\n if (val instanceof URL) {\n return val.href;\n }\n try {\n // The full path is required in the 'url' field.\n return new URL(val, window.location).href;\n } catch {\n if (\n typeof PDFJSDev !== \"undefined\" &&\n PDFJSDev.test(\"GENERIC\") &&\n isNodeJS &&\n typeof val === \"string\"\n ) {\n return val; // Use the url as-is in Node.js environments.\n }\n }\n throw new Error(\n \"Invalid PDF url data: \" +\n \"either string or URL-object is expected in the url property.\"\n );\n}\n\nfunction getDataProp(val) {\n // Converting string or array-like data to Uint8Array.\n if (\n typeof PDFJSDev !== \"undefined\" &&\n PDFJSDev.test(\"GENERIC\") &&\n isNodeJS &&\n typeof Buffer !== \"undefined\" && // eslint-disable-line no-undef\n val instanceof Buffer // eslint-disable-line no-undef\n ) {\n throw new Error(\n \"Please provide binary data as `Uint8Array`, rather than `Buffer`.\"\n );\n }\n if (val instanceof Uint8Array && val.byteLength === val.buffer.byteLength) {\n // Use the data as-is when it's already a Uint8Array that completely\n // \"utilizes\" its underlying ArrayBuffer, to prevent any possible\n // issues when transferring it to the worker-thread.\n return val;\n }\n if (typeof val === \"string\") {\n return stringToBytes(val);\n }\n if (\n val instanceof ArrayBuffer ||\n ArrayBuffer.isView(val) ||\n (typeof val === \"object\" && !isNaN(val?.length))\n ) {\n return new Uint8Array(val);\n }\n throw new Error(\n \"Invalid PDF binary data: either TypedArray, \" +\n \"string, or array-like object is expected in the data property.\"\n );\n}\n\nfunction isRefProxy(ref) {\n return (\n typeof ref === \"object\" &&\n Number.isInteger(ref?.num) &&\n ref.num >= 0 &&\n Number.isInteger(ref?.gen) &&\n ref.gen >= 0\n );\n}\n\n/**\n * @typedef {Object} OnProgressParameters\n * @property {number} loaded - Currently loaded number of bytes.\n * @property {number} total - Total number of bytes in the PDF file.\n */\n\n/**\n * The loading task controls the operations required to load a PDF document\n * (such as network requests) and provides a way to listen for completion,\n * after which individual pages can be rendered.\n */\nclass PDFDocumentLoadingTask {\n static #docId = 0;\n\n constructor() {\n this._capability = Promise.withResolvers();\n this._transport = null;\n this._worker = null;\n\n /**\n * Unique identifier for the document loading task.\n * @type {string}\n */\n this.docId = `d${PDFDocumentLoadingTask.#docId++}`;\n\n /**\n * Whether the loading task is destroyed or not.\n * @type {boolean}\n */\n this.destroyed = false;\n\n /**\n * Callback to request a password if a wrong or no password was provided.\n * The callback receives two parameters: a function that should be called\n * with the new password, and a reason (see {@link PasswordResponses}).\n * @type {function}\n */\n this.onPassword = null;\n\n /**\n * Callback to be able to monitor the loading progress of the PDF file\n * (necessary to implement e.g. a loading bar).\n * The callback receives an {@link OnProgressParameters} argument.\n * @type {function}\n */\n this.onProgress = null;\n }\n\n /**\n * Promise for document loading task completion.\n * @type {Promise}\n */\n get promise() {\n return this._capability.promise;\n }\n\n /**\n * Abort all network requests and destroy the worker.\n * @returns {Promise} A promise that is resolved when destruction is\n * completed.\n */\n async destroy() {\n this.destroyed = true;\n try {\n if (this._worker?.port) {\n this._worker._pendingDestroy = true;\n }\n await this._transport?.destroy();\n } catch (ex) {\n if (this._worker?.port) {\n delete this._worker._pendingDestroy;\n }\n throw ex;\n }\n\n this._transport = null;\n if (this._worker) {\n this._worker.destroy();\n this._worker = null;\n }\n }\n}\n\n/**\n * Abstract class to support range requests file loading.\n *\n * NOTE: The TypedArrays passed to the constructor and relevant methods below\n * will generally be transferred to the worker-thread. This will help reduce\n * main-thread memory usage, however it will take ownership of the TypedArrays.\n */\nclass PDFDataRangeTransport {\n /**\n * @param {number} length\n * @param {Uint8Array|null} initialData\n * @param {boolean} [progressiveDone]\n * @param {string} [contentDispositionFilename]\n */\n constructor(\n length,\n initialData,\n progressiveDone = false,\n contentDispositionFilename = null\n ) {\n this.length = length;\n this.initialData = initialData;\n this.progressiveDone = progressiveDone;\n this.contentDispositionFilename = contentDispositionFilename;\n\n this._rangeListeners = [];\n this._progressListeners = [];\n this._progressiveReadListeners = [];\n this._progressiveDoneListeners = [];\n this._readyCapability = Promise.withResolvers();\n }\n\n /**\n * @param {function} listener\n */\n addRangeListener(listener) {\n this._rangeListeners.push(listener);\n }\n\n /**\n * @param {function} listener\n */\n addProgressListener(listener) {\n this._progressListeners.push(listener);\n }\n\n /**\n * @param {function} listener\n */\n addProgressiveReadListener(listener) {\n this._progressiveReadListeners.push(listener);\n }\n\n /**\n * @param {function} listener\n */\n addProgressiveDoneListener(listener) {\n this._progressiveDoneListeners.push(listener);\n }\n\n /**\n * @param {number} begin\n * @param {Uint8Array|null} chunk\n */\n onDataRange(begin, chunk) {\n for (const listener of this._rangeListeners) {\n listener(begin, chunk);\n }\n }\n\n /**\n * @param {number} loaded\n * @param {number|undefined} total\n */\n onDataProgress(loaded, total) {\n this._readyCapability.promise.then(() => {\n for (const listener of this._progressListeners) {\n listener(loaded, total);\n }\n });\n }\n\n /**\n * @param {Uint8Array|null} chunk\n */\n onDataProgressiveRead(chunk) {\n this._readyCapability.promise.then(() => {\n for (const listener of this._progressiveReadListeners) {\n listener(chunk);\n }\n });\n }\n\n onDataProgressiveDone() {\n this._readyCapability.promise.then(() => {\n for (const listener of this._progressiveDoneListeners) {\n listener();\n }\n });\n }\n\n transportReady() {\n this._readyCapability.resolve();\n }\n\n /**\n * @param {number} begin\n * @param {number} end\n */\n requestDataRange(begin, end) {\n unreachable(\"Abstract method PDFDataRangeTransport.requestDataRange\");\n }\n\n abort() {}\n}\n\n/**\n * Proxy to a `PDFDocument` in the worker thread.\n */\nclass PDFDocumentProxy {\n constructor(pdfInfo, transport) {\n this._pdfInfo = pdfInfo;\n this._transport = transport;\n\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) {\n // For testing purposes.\n Object.defineProperty(this, \"getNetworkStreamName\", {\n value: () => this._transport.getNetworkStreamName(),\n });\n Object.defineProperty(this, \"getXFADatasets\", {\n value: () => this._transport.getXFADatasets(),\n });\n Object.defineProperty(this, \"getXRefPrevValue\", {\n value: () => this._transport.getXRefPrevValue(),\n });\n Object.defineProperty(this, \"getStartXRefPos\", {\n value: () => this._transport.getStartXRefPos(),\n });\n Object.defineProperty(this, \"getAnnotArray\", {\n value: pageIndex => this._transport.getAnnotArray(pageIndex),\n });\n }\n }\n\n /**\n * @type {AnnotationStorage} Storage for annotation data in forms.\n */\n get annotationStorage() {\n return this._transport.annotationStorage;\n }\n\n /**\n * @type {Object} The filter factory instance.\n */\n get filterFactory() {\n return this._transport.filterFactory;\n }\n\n /**\n * @type {number} Total number of pages in the PDF file.\n */\n get numPages() {\n return this._pdfInfo.numPages;\n }\n\n /**\n * @type {Array} A (not guaranteed to be) unique ID to\n * identify the PDF document.\n * NOTE: The first element will always be defined for all PDF documents,\n * whereas the second element is only defined for *modified* PDF documents.\n */\n get fingerprints() {\n return this._pdfInfo.fingerprints;\n }\n\n /**\n * @type {boolean} True if only XFA form.\n */\n get isPureXfa() {\n return shadow(this, \"isPureXfa\", !!this._transport._htmlForXfa);\n }\n\n /**\n * NOTE: This is (mostly) intended to support printing of XFA forms.\n *\n * @type {Object | null} An object representing a HTML tree structure\n * to render the XFA, or `null` when no XFA form exists.\n */\n get allXfaHtml() {\n return this._transport._htmlForXfa;\n }\n\n /**\n * @param {number} pageNumber - The page number to get. The first page is 1.\n * @returns {Promise} A promise that is resolved with\n * a {@link PDFPageProxy} object.\n */\n getPage(pageNumber) {\n return this._transport.getPage(pageNumber);\n }\n\n /**\n * @param {RefProxy} ref - The page reference.\n * @returns {Promise} A promise that is resolved with the page index,\n * starting from zero, that is associated with the reference.\n */\n getPageIndex(ref) {\n return this._transport.getPageIndex(ref);\n }\n\n /**\n * @returns {Promise>>} A promise that is resolved\n * with a mapping from named destinations to references.\n *\n * This can be slow for large documents. Use `getDestination` instead.\n */\n getDestinations() {\n return this._transport.getDestinations();\n }\n\n /**\n * @param {string} id - The named destination to get.\n * @returns {Promise | null>} A promise that is resolved with all\n * information of the given named destination, or `null` when the named\n * destination is not present in the PDF file.\n */\n getDestination(id) {\n return this._transport.getDestination(id);\n }\n\n /**\n * @returns {Promise | null>} A promise that is resolved with\n * an {Array} containing the page labels that correspond to the page\n * indexes, or `null` when no page labels are present in the PDF file.\n */\n getPageLabels() {\n return this._transport.getPageLabels();\n }\n\n /**\n * @returns {Promise} A promise that is resolved with a {string}\n * containing the page layout name.\n */\n getPageLayout() {\n return this._transport.getPageLayout();\n }\n\n /**\n * @returns {Promise} A promise that is resolved with a {string}\n * containing the page mode name.\n */\n getPageMode() {\n return this._transport.getPageMode();\n }\n\n /**\n * @returns {Promise} A promise that is resolved with an\n * {Object} containing the viewer preferences, or `null` when no viewer\n * preferences are present in the PDF file.\n */\n getViewerPreferences() {\n return this._transport.getViewerPreferences();\n }\n\n /**\n * @returns {Promise} A promise that is resolved with an {Array}\n * containing the destination, or `null` when no open action is present\n * in the PDF.\n */\n getOpenAction() {\n return this._transport.getOpenAction();\n }\n\n /**\n * @returns {Promise} A promise that is resolved with a lookup table\n * for mapping named attachments to their content.\n */\n getAttachments() {\n return this._transport.getAttachments();\n }\n\n /**\n * @returns {Promise} A promise that is resolved with\n * an {Object} with the JavaScript actions:\n * - from the name tree.\n * - from A or AA entries in the catalog dictionary.\n * , or `null` if no JavaScript exists.\n */\n getJSActions() {\n return this._transport.getDocJSActions();\n }\n\n /**\n * @typedef {Object} OutlineNode\n * @property {string} title\n * @property {boolean} bold\n * @property {boolean} italic\n * @property {Uint8ClampedArray} color - The color in RGB format to use for\n * display purposes.\n * @property {string | Array | null} dest\n * @property {string | null} url\n * @property {string | undefined} unsafeUrl\n * @property {boolean | undefined} newWindow\n * @property {number | undefined} count\n * @property {Array} items\n */\n\n /**\n * @returns {Promise>} A promise that is resolved with an\n * {Array} that is a tree outline (if it has one) of the PDF file.\n */\n getOutline() {\n return this._transport.getOutline();\n }\n\n /**\n * @typedef {Object} GetOptionalContentConfigParameters\n * @property {string} [intent] - Determines the optional content groups that\n * are visible by default; valid values are:\n * - 'display' (viewable groups).\n * - 'print' (printable groups).\n * - 'any' (all groups).\n * The default value is 'display'.\n */\n\n /**\n * @param {GetOptionalContentConfigParameters} [params] - Optional content\n * config parameters.\n * @returns {Promise} A promise that is resolved with\n * an {@link OptionalContentConfig} that contains all the optional content\n * groups (assuming that the document has any).\n */\n getOptionalContentConfig({ intent = \"display\" } = {}) {\n const { renderingIntent } = this._transport.getRenderingIntent(intent);\n\n return this._transport.getOptionalContentConfig(renderingIntent);\n }\n\n /**\n * @returns {Promise | null>} A promise that is resolved with\n * an {Array} that contains the permission flags for the PDF document, or\n * `null` when no permissions are present in the PDF file.\n */\n getPermissions() {\n return this._transport.getPermissions();\n }\n\n /**\n * @returns {Promise<{ info: Object, metadata: Metadata }>} A promise that is\n * resolved with an {Object} that has `info` and `metadata` properties.\n * `info` is an {Object} filled with anything available in the information\n * dictionary and similarly `metadata` is a {Metadata} object with\n * information from the metadata section of the PDF.\n */\n getMetadata() {\n return this._transport.getMetadata();\n }\n\n /**\n * @typedef {Object} MarkInfo\n * Properties correspond to Table 321 of the PDF 32000-1:2008 spec.\n * @property {boolean} Marked\n * @property {boolean} UserProperties\n * @property {boolean} Suspects\n */\n\n /**\n * @returns {Promise} A promise that is resolved with\n * a {MarkInfo} object that contains the MarkInfo flags for the PDF\n * document, or `null` when no MarkInfo values are present in the PDF file.\n */\n getMarkInfo() {\n return this._transport.getMarkInfo();\n }\n\n /**\n * @returns {Promise} A promise that is resolved with a\n * {Uint8Array} containing the raw data of the PDF document.\n */\n getData() {\n return this._transport.getData();\n }\n\n /**\n * @returns {Promise} A promise that is resolved with a\n * {Uint8Array} containing the full data of the saved document.\n */\n saveDocument() {\n return this._transport.saveDocument();\n }\n\n /**\n * @returns {Promise<{ length: number }>} A promise that is resolved when the\n * document's data is loaded. It is resolved with an {Object} that contains\n * the `length` property that indicates size of the PDF data in bytes.\n */\n getDownloadInfo() {\n return this._transport.downloadInfoCapability.promise;\n }\n\n /**\n * Cleans up resources allocated by the document on both the main and worker\n * threads.\n *\n * NOTE: Do not, under any circumstances, call this method when rendering is\n * currently ongoing since that may lead to rendering errors.\n *\n * @param {boolean} [keepLoadedFonts] - Let fonts remain attached to the DOM.\n * NOTE: This will increase persistent memory usage, hence don't use this\n * option unless absolutely necessary. The default value is `false`.\n * @returns {Promise} A promise that is resolved when clean-up has finished.\n */\n cleanup(keepLoadedFonts = false) {\n return this._transport.startCleanup(keepLoadedFonts || this.isPureXfa);\n }\n\n /**\n * Destroys the current document instance and terminates the worker.\n */\n destroy() {\n return this.loadingTask.destroy();\n }\n\n /**\n * @param {RefProxy} ref - The page reference.\n * @returns {number | null} The page number, if it's cached.\n */\n cachedPageNumber(ref) {\n return this._transport.cachedPageNumber(ref);\n }\n\n /**\n * @type {DocumentInitParameters} A subset of the current\n * {DocumentInitParameters}, which are needed in the viewer.\n */\n get loadingParams() {\n return this._transport.loadingParams;\n }\n\n /**\n * @type {PDFDocumentLoadingTask} The loadingTask for the current document.\n */\n get loadingTask() {\n return this._transport.loadingTask;\n }\n\n /**\n * @returns {Promise> | null>} A promise that is\n * resolved with an {Object} containing /AcroForm field data for the JS\n * sandbox, or `null` when no field data is present in the PDF file.\n */\n getFieldObjects() {\n return this._transport.getFieldObjects();\n }\n\n /**\n * @returns {Promise} A promise that is resolved with `true`\n * if some /AcroForm fields have JavaScript actions.\n */\n hasJSActions() {\n return this._transport.hasJSActions();\n }\n\n /**\n * @returns {Promise | null>} A promise that is resolved with an\n * {Array} containing IDs of annotations that have a calculation\n * action, or `null` when no such annotations are present in the PDF file.\n */\n getCalculationOrderIds() {\n return this._transport.getCalculationOrderIds();\n }\n}\n\n/**\n * Page getViewport parameters.\n *\n * @typedef {Object} GetViewportParameters\n * @property {number} scale - The desired scale of the viewport.\n * @property {number} [rotation] - The desired rotation, in degrees, of\n * the viewport. If omitted it defaults to the page rotation.\n * @property {number} [offsetX] - The horizontal, i.e. x-axis, offset.\n * The default value is `0`.\n * @property {number} [offsetY] - The vertical, i.e. y-axis, offset.\n * The default value is `0`.\n * @property {boolean} [dontFlip] - If true, the y-axis will not be\n * flipped. The default value is `false`.\n */\n\n/**\n * Page getTextContent parameters.\n *\n * @typedef {Object} getTextContentParameters\n * @property {boolean} [includeMarkedContent] - When true include marked\n * content items in the items array of TextContent. The default is `false`.\n * @property {boolean} [disableNormalization] - When true the text is *not*\n * normalized in the worker-thread. The default is `false`.\n */\n\n/**\n * Page text content.\n *\n * @typedef {Object} TextContent\n * @property {Array} items - Array of\n * {@link TextItem} and {@link TextMarkedContent} objects. TextMarkedContent\n * items are included when includeMarkedContent is true.\n * @property {Object} styles - {@link TextStyle} objects,\n * indexed by font name.\n * @property {string | null} lang - The document /Lang attribute.\n */\n\n/**\n * Page text content part.\n *\n * @typedef {Object} TextItem\n * @property {string} str - Text content.\n * @property {string} dir - Text direction: 'ttb', 'ltr' or 'rtl'.\n * @property {Array} transform - Transformation matrix.\n * @property {number} width - Width in device space.\n * @property {number} height - Height in device space.\n * @property {string} fontName - Font name used by PDF.js for converted font.\n * @property {boolean} hasEOL - Indicating if the text content is followed by a\n * line-break.\n */\n\n/**\n * Page text marked content part.\n *\n * @typedef {Object} TextMarkedContent\n * @property {string} type - Either 'beginMarkedContent',\n * 'beginMarkedContentProps', or 'endMarkedContent'.\n * @property {string} id - The marked content identifier. Only used for type\n * 'beginMarkedContentProps'.\n */\n\n/**\n * Text style.\n *\n * @typedef {Object} TextStyle\n * @property {number} ascent - Font ascent.\n * @property {number} descent - Font descent.\n * @property {boolean} vertical - Whether or not the text is in vertical mode.\n * @property {string} fontFamily - The possible font family.\n */\n\n/**\n * Page annotation parameters.\n *\n * @typedef {Object} GetAnnotationsParameters\n * @property {string} [intent] - Determines the annotations that are fetched,\n * can be 'display' (viewable annotations), 'print' (printable annotations),\n * or 'any' (all annotations). The default value is 'display'.\n */\n\n/**\n * Page render parameters.\n *\n * @typedef {Object} RenderParameters\n * @property {CanvasRenderingContext2D} canvasContext - A 2D context of a DOM\n * Canvas object.\n * @property {PageViewport} viewport - Rendering viewport obtained by calling\n * the `PDFPageProxy.getViewport` method.\n * @property {string} [intent] - Rendering intent, can be 'display', 'print',\n * or 'any'. The default value is 'display'.\n * @property {number} [annotationMode] Controls which annotations are rendered\n * onto the canvas, for annotations with appearance-data; the values from\n * {@link AnnotationMode} should be used. The following values are supported:\n * - `AnnotationMode.DISABLE`, which disables all annotations.\n * - `AnnotationMode.ENABLE`, which includes all possible annotations (thus\n * it also depends on the `intent`-option, see above).\n * - `AnnotationMode.ENABLE_FORMS`, which excludes annotations that contain\n * interactive form elements (those will be rendered in the display layer).\n * - `AnnotationMode.ENABLE_STORAGE`, which includes all possible annotations\n * (as above) but where interactive form elements are updated with data\n * from the {@link AnnotationStorage}-instance; useful e.g. for printing.\n * The default value is `AnnotationMode.ENABLE`.\n * @property {Array} [transform] - Additional transform, applied just\n * before viewport transform.\n * @property {CanvasGradient | CanvasPattern | string} [background] - Background\n * to use for the canvas.\n * Any valid `canvas.fillStyle` can be used: a `DOMString` parsed as CSS\n * value, a `CanvasGradient` object (a linear or radial gradient) or\n * a `CanvasPattern` object (a repetitive image). The default value is\n * 'rgb(255,255,255)'.\n *\n * NOTE: This option may be partially, or completely, ignored when the\n * `pageColors`-option is used.\n * @property {Object} [pageColors] - Overwrites background and foreground colors\n * with user defined ones in order to improve readability in high contrast\n * mode.\n * @property {Promise} [optionalContentConfigPromise] -\n * A promise that should resolve with an {@link OptionalContentConfig}\n * created from `PDFDocumentProxy.getOptionalContentConfig`. If `null`,\n * the configuration will be fetched automatically with the default visibility\n * states set.\n * @property {Map} [annotationCanvasMap] - Map some\n * annotation ids with canvases used to render them.\n * @property {PrintAnnotationStorage} [printAnnotationStorage]\n */\n\n/**\n * Page getOperatorList parameters.\n *\n * @typedef {Object} GetOperatorListParameters\n * @property {string} [intent] - Rendering intent, can be 'display', 'print',\n * or 'any'. The default value is 'display'.\n * @property {number} [annotationMode] Controls which annotations are included\n * in the operatorList, for annotations with appearance-data; the values from\n * {@link AnnotationMode} should be used. The following values are supported:\n * - `AnnotationMode.DISABLE`, which disables all annotations.\n * - `AnnotationMode.ENABLE`, which includes all possible annotations (thus\n * it also depends on the `intent`-option, see above).\n * - `AnnotationMode.ENABLE_FORMS`, which excludes annotations that contain\n * interactive form elements (those will be rendered in the display layer).\n * - `AnnotationMode.ENABLE_STORAGE`, which includes all possible annotations\n * (as above) but where interactive form elements are updated with data\n * from the {@link AnnotationStorage}-instance; useful e.g. for printing.\n * The default value is `AnnotationMode.ENABLE`.\n * @property {PrintAnnotationStorage} [printAnnotationStorage]\n */\n\n/**\n * Structure tree node. The root node will have a role \"Root\".\n *\n * @typedef {Object} StructTreeNode\n * @property {Array} children - Array of\n * {@link StructTreeNode} and {@link StructTreeContent} objects.\n * @property {string} role - element's role, already mapped if a role map exists\n * in the PDF.\n */\n\n/**\n * Structure tree content.\n *\n * @typedef {Object} StructTreeContent\n * @property {string} type - either \"content\" for page and stream structure\n * elements or \"object\" for object references.\n * @property {string} id - unique id that will map to the text layer.\n */\n\n/**\n * PDF page operator list.\n *\n * @typedef {Object} PDFOperatorList\n * @property {Array} fnArray - Array containing the operator functions.\n * @property {Array} argsArray - Array containing the arguments of the\n * functions.\n */\n\n/**\n * Proxy to a `PDFPage` in the worker thread.\n */\nclass PDFPageProxy {\n #delayedCleanupTimeout = null;\n\n #pendingCleanup = false;\n\n constructor(pageIndex, pageInfo, transport, pdfBug = false) {\n this._pageIndex = pageIndex;\n this._pageInfo = pageInfo;\n this._transport = transport;\n this._stats = pdfBug ? new StatTimer() : null;\n this._pdfBug = pdfBug;\n /** @type {PDFObjects} */\n this.commonObjs = transport.commonObjs;\n this.objs = new PDFObjects();\n\n this._maybeCleanupAfterRender = false;\n this._intentStates = new Map();\n this.destroyed = false;\n }\n\n /**\n * @type {number} Page number of the page. First page is 1.\n */\n get pageNumber() {\n return this._pageIndex + 1;\n }\n\n /**\n * @type {number} The number of degrees the page is rotated clockwise.\n */\n get rotate() {\n return this._pageInfo.rotate;\n }\n\n /**\n * @type {RefProxy | null} The reference that points to this page.\n */\n get ref() {\n return this._pageInfo.ref;\n }\n\n /**\n * @type {number} The default size of units in 1/72nds of an inch.\n */\n get userUnit() {\n return this._pageInfo.userUnit;\n }\n\n /**\n * @type {Array} An array of the visible portion of the PDF page in\n * user space units [x1, y1, x2, y2].\n */\n get view() {\n return this._pageInfo.view;\n }\n\n /**\n * @param {GetViewportParameters} params - Viewport parameters.\n * @returns {PageViewport} Contains 'width' and 'height' properties\n * along with transforms required for rendering.\n */\n getViewport({\n scale,\n rotation = this.rotate,\n offsetX = 0,\n offsetY = 0,\n dontFlip = false,\n } = {}) {\n return new PageViewport({\n viewBox: this.view,\n scale,\n rotation,\n offsetX,\n offsetY,\n dontFlip,\n });\n }\n\n /**\n * @param {GetAnnotationsParameters} [params] - Annotation parameters.\n * @returns {Promise>} A promise that is resolved with an\n * {Array} of the annotation objects.\n */\n getAnnotations({ intent = \"display\" } = {}) {\n const { renderingIntent } = this._transport.getRenderingIntent(intent);\n\n return this._transport.getAnnotations(this._pageIndex, renderingIntent);\n }\n\n /**\n * @returns {Promise} A promise that is resolved with an\n * {Object} with JS actions.\n */\n getJSActions() {\n return this._transport.getPageJSActions(this._pageIndex);\n }\n\n /**\n * @type {Object} The filter factory instance.\n */\n get filterFactory() {\n return this._transport.filterFactory;\n }\n\n /**\n * @type {boolean} True if only XFA form.\n */\n get isPureXfa() {\n return shadow(this, \"isPureXfa\", !!this._transport._htmlForXfa);\n }\n\n /**\n * @returns {Promise} A promise that is resolved with\n * an {Object} with a fake DOM object (a tree structure where elements\n * are {Object} with a name, attributes (class, style, ...), value and\n * children, very similar to a HTML DOM tree), or `null` if no XFA exists.\n */\n async getXfa() {\n return this._transport._htmlForXfa?.children[this._pageIndex] || null;\n }\n\n /**\n * Begins the process of rendering a page to the desired context.\n *\n * @param {RenderParameters} params - Page render parameters.\n * @returns {RenderTask} An object that contains a promise that is\n * resolved when the page finishes rendering.\n */\n render({\n canvasContext,\n viewport,\n intent = \"display\",\n annotationMode = AnnotationMode.ENABLE,\n transform = null,\n background = null,\n optionalContentConfigPromise = null,\n annotationCanvasMap = null,\n pageColors = null,\n printAnnotationStorage = null,\n }) {\n this._stats?.time(\"Overall\");\n\n const intentArgs = this._transport.getRenderingIntent(\n intent,\n annotationMode,\n printAnnotationStorage\n );\n const { renderingIntent, cacheKey } = intentArgs;\n // If there was a pending destroy, cancel it so no cleanup happens during\n // this call to render...\n this.#pendingCleanup = false;\n // ... and ensure that a delayed cleanup is always aborted.\n this.#abortDelayedCleanup();\n\n optionalContentConfigPromise ||=\n this._transport.getOptionalContentConfig(renderingIntent);\n\n let intentState = this._intentStates.get(cacheKey);\n if (!intentState) {\n intentState = Object.create(null);\n this._intentStates.set(cacheKey, intentState);\n }\n\n // Ensure that a pending `streamReader` cancel timeout is always aborted.\n if (intentState.streamReaderCancelTimeout) {\n clearTimeout(intentState.streamReaderCancelTimeout);\n intentState.streamReaderCancelTimeout = null;\n }\n\n const intentPrint = !!(renderingIntent & RenderingIntentFlag.PRINT);\n\n // If there's no displayReadyCapability yet, then the operatorList\n // was never requested before. Make the request and create the promise.\n if (!intentState.displayReadyCapability) {\n intentState.displayReadyCapability = Promise.withResolvers();\n intentState.operatorList = {\n fnArray: [],\n argsArray: [],\n lastChunk: false,\n separateAnnots: null,\n };\n\n this._stats?.time(\"Page Request\");\n this._pumpOperatorList(intentArgs);\n }\n\n const complete = error => {\n intentState.renderTasks.delete(internalRenderTask);\n\n // Attempt to reduce memory usage during *printing*, by always running\n // cleanup immediately once rendering has finished.\n if (this._maybeCleanupAfterRender || intentPrint) {\n this.#pendingCleanup = true;\n }\n this.#tryCleanup(/* delayed = */ !intentPrint);\n\n if (error) {\n internalRenderTask.capability.reject(error);\n\n this._abortOperatorList({\n intentState,\n reason: error instanceof Error ? error : new Error(error),\n });\n } else {\n internalRenderTask.capability.resolve();\n }\n\n if (this._stats) {\n this._stats.timeEnd(\"Rendering\");\n this._stats.timeEnd(\"Overall\");\n\n if (globalThis.Stats?.enabled) {\n globalThis.Stats.add(this.pageNumber, this._stats);\n }\n }\n };\n\n const internalRenderTask = new InternalRenderTask({\n callback: complete,\n // Only include the required properties, and *not* the entire object.\n params: {\n canvasContext,\n viewport,\n transform,\n background,\n },\n objs: this.objs,\n commonObjs: this.commonObjs,\n annotationCanvasMap,\n operatorList: intentState.operatorList,\n pageIndex: this._pageIndex,\n canvasFactory: this._transport.canvasFactory,\n filterFactory: this._transport.filterFactory,\n useRequestAnimationFrame: !intentPrint,\n pdfBug: this._pdfBug,\n pageColors,\n });\n\n (intentState.renderTasks ||= new Set()).add(internalRenderTask);\n const renderTask = internalRenderTask.task;\n\n Promise.all([\n intentState.displayReadyCapability.promise,\n optionalContentConfigPromise,\n ])\n .then(([transparency, optionalContentConfig]) => {\n if (this.destroyed) {\n complete();\n return;\n }\n this._stats?.time(\"Rendering\");\n\n if (!(optionalContentConfig.renderingIntent & renderingIntent)) {\n throw new Error(\n \"Must use the same `intent`-argument when calling the `PDFPageProxy.render` \" +\n \"and `PDFDocumentProxy.getOptionalContentConfig` methods.\"\n );\n }\n internalRenderTask.initializeGraphics({\n transparency,\n optionalContentConfig,\n });\n internalRenderTask.operatorListChanged();\n })\n .catch(complete);\n\n return renderTask;\n }\n\n /**\n * @param {GetOperatorListParameters} params - Page getOperatorList\n * parameters.\n * @returns {Promise} A promise resolved with an\n * {@link PDFOperatorList} object that represents the page's operator list.\n */\n getOperatorList({\n intent = \"display\",\n annotationMode = AnnotationMode.ENABLE,\n printAnnotationStorage = null,\n } = {}) {\n if (typeof PDFJSDev !== \"undefined\" && !PDFJSDev.test(\"GENERIC\")) {\n throw new Error(\"Not implemented: getOperatorList\");\n }\n function operatorListChanged() {\n if (intentState.operatorList.lastChunk) {\n intentState.opListReadCapability.resolve(intentState.operatorList);\n\n intentState.renderTasks.delete(opListTask);\n }\n }\n\n const intentArgs = this._transport.getRenderingIntent(\n intent,\n annotationMode,\n printAnnotationStorage,\n /* isOpList = */ true\n );\n let intentState = this._intentStates.get(intentArgs.cacheKey);\n if (!intentState) {\n intentState = Object.create(null);\n this._intentStates.set(intentArgs.cacheKey, intentState);\n }\n let opListTask;\n\n if (!intentState.opListReadCapability) {\n opListTask = Object.create(null);\n opListTask.operatorListChanged = operatorListChanged;\n intentState.opListReadCapability = Promise.withResolvers();\n (intentState.renderTasks ||= new Set()).add(opListTask);\n intentState.operatorList = {\n fnArray: [],\n argsArray: [],\n lastChunk: false,\n separateAnnots: null,\n };\n\n this._stats?.time(\"Page Request\");\n this._pumpOperatorList(intentArgs);\n }\n return intentState.opListReadCapability.promise;\n }\n\n /**\n * NOTE: All occurrences of whitespace will be replaced by\n * standard spaces (0x20).\n *\n * @param {getTextContentParameters} params - getTextContent parameters.\n * @returns {ReadableStream} Stream for reading text content chunks.\n */\n streamTextContent({\n includeMarkedContent = false,\n disableNormalization = false,\n } = {}) {\n const TEXT_CONTENT_CHUNK_SIZE = 100;\n\n return this._transport.messageHandler.sendWithStream(\n \"GetTextContent\",\n {\n pageIndex: this._pageIndex,\n includeMarkedContent: includeMarkedContent === true,\n disableNormalization: disableNormalization === true,\n },\n {\n highWaterMark: TEXT_CONTENT_CHUNK_SIZE,\n size(textContent) {\n return textContent.items.length;\n },\n }\n );\n }\n\n /**\n * NOTE: All occurrences of whitespace will be replaced by\n * standard spaces (0x20).\n *\n * @param {getTextContentParameters} params - getTextContent parameters.\n * @returns {Promise} A promise that is resolved with a\n * {@link TextContent} object that represents the page's text content.\n */\n getTextContent(params = {}) {\n if (this._transport._htmlForXfa) {\n // TODO: We need to revisit this once the XFA foreground patch lands and\n // only do this for non-foreground XFA.\n return this.getXfa().then(xfa => XfaText.textContent(xfa));\n }\n const readableStream = this.streamTextContent(params);\n\n return new Promise(function (resolve, reject) {\n function pump() {\n reader.read().then(function ({ value, done }) {\n if (done) {\n resolve(textContent);\n return;\n }\n textContent.lang ??= value.lang;\n Object.assign(textContent.styles, value.styles);\n textContent.items.push(...value.items);\n pump();\n }, reject);\n }\n\n const reader = readableStream.getReader();\n const textContent = {\n items: [],\n styles: Object.create(null),\n lang: null,\n };\n pump();\n });\n }\n\n /**\n * @returns {Promise} A promise that is resolved with a\n * {@link StructTreeNode} object that represents the page's structure tree,\n * or `null` when no structure tree is present for the current page.\n */\n getStructTree() {\n return this._transport.getStructTree(this._pageIndex);\n }\n\n /**\n * Destroys the page object.\n * @private\n */\n _destroy() {\n this.destroyed = true;\n\n const waitOn = [];\n for (const intentState of this._intentStates.values()) {\n this._abortOperatorList({\n intentState,\n reason: new Error(\"Page was destroyed.\"),\n force: true,\n });\n\n if (intentState.opListReadCapability) {\n // Avoid errors below, since the renderTasks are just stubs.\n continue;\n }\n for (const internalRenderTask of intentState.renderTasks) {\n waitOn.push(internalRenderTask.completed);\n internalRenderTask.cancel();\n }\n }\n this.objs.clear();\n this.#pendingCleanup = false;\n this.#abortDelayedCleanup();\n\n return Promise.all(waitOn);\n }\n\n /**\n * Cleans up resources allocated by the page.\n *\n * @param {boolean} [resetStats] - Reset page stats, if enabled.\n * The default value is `false`.\n * @returns {boolean} Indicates if clean-up was successfully run.\n */\n cleanup(resetStats = false) {\n this.#pendingCleanup = true;\n const success = this.#tryCleanup(/* delayed = */ false);\n\n if (resetStats && success) {\n this._stats &&= new StatTimer();\n }\n return success;\n }\n\n /**\n * Attempts to clean up if rendering is in a state where that's possible.\n * @param {boolean} [delayed] - Delay the cleanup, to e.g. improve zooming\n * performance in documents with large images.\n * The default value is `false`.\n * @returns {boolean} Indicates if clean-up was successfully run.\n */\n #tryCleanup(delayed = false) {\n this.#abortDelayedCleanup();\n\n if (!this.#pendingCleanup || this.destroyed) {\n return false;\n }\n if (delayed) {\n this.#delayedCleanupTimeout = setTimeout(() => {\n this.#delayedCleanupTimeout = null;\n this.#tryCleanup(/* delayed = */ false);\n }, DELAYED_CLEANUP_TIMEOUT);\n\n return false;\n }\n for (const { renderTasks, operatorList } of this._intentStates.values()) {\n if (renderTasks.size > 0 || !operatorList.lastChunk) {\n return false;\n }\n }\n this._intentStates.clear();\n this.objs.clear();\n this.#pendingCleanup = false;\n return true;\n }\n\n #abortDelayedCleanup() {\n if (this.#delayedCleanupTimeout) {\n clearTimeout(this.#delayedCleanupTimeout);\n this.#delayedCleanupTimeout = null;\n }\n }\n\n /**\n * @private\n */\n _startRenderPage(transparency, cacheKey) {\n const intentState = this._intentStates.get(cacheKey);\n if (!intentState) {\n return; // Rendering was cancelled.\n }\n this._stats?.timeEnd(\"Page Request\");\n\n // TODO Refactor RenderPageRequest to separate rendering\n // and operator list logic\n intentState.displayReadyCapability?.resolve(transparency);\n }\n\n /**\n * @private\n */\n _renderPageChunk(operatorListChunk, intentState) {\n // Add the new chunk to the current operator list.\n for (let i = 0, ii = operatorListChunk.length; i < ii; i++) {\n intentState.operatorList.fnArray.push(operatorListChunk.fnArray[i]);\n intentState.operatorList.argsArray.push(operatorListChunk.argsArray[i]);\n }\n intentState.operatorList.lastChunk = operatorListChunk.lastChunk;\n intentState.operatorList.separateAnnots = operatorListChunk.separateAnnots;\n\n // Notify all the rendering tasks there are more operators to be consumed.\n for (const internalRenderTask of intentState.renderTasks) {\n internalRenderTask.operatorListChanged();\n }\n\n if (operatorListChunk.lastChunk) {\n this.#tryCleanup(/* delayed = */ true);\n }\n }\n\n /**\n * @private\n */\n _pumpOperatorList({\n renderingIntent,\n cacheKey,\n annotationStorageSerializable,\n }) {\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) {\n assert(\n Number.isInteger(renderingIntent) && renderingIntent > 0,\n '_pumpOperatorList: Expected valid \"renderingIntent\" argument.'\n );\n }\n const { map, transfer } = annotationStorageSerializable;\n\n const readableStream = this._transport.messageHandler.sendWithStream(\n \"GetOperatorList\",\n {\n pageIndex: this._pageIndex,\n intent: renderingIntent,\n cacheKey,\n annotationStorage: map,\n },\n transfer\n );\n const reader = readableStream.getReader();\n\n const intentState = this._intentStates.get(cacheKey);\n intentState.streamReader = reader;\n\n const pump = () => {\n reader.read().then(\n ({ value, done }) => {\n if (done) {\n intentState.streamReader = null;\n return;\n }\n if (this._transport.destroyed) {\n return; // Ignore any pending requests if the worker was terminated.\n }\n this._renderPageChunk(value, intentState);\n pump();\n },\n reason => {\n intentState.streamReader = null;\n\n if (this._transport.destroyed) {\n return; // Ignore any pending requests if the worker was terminated.\n }\n if (intentState.operatorList) {\n // Mark operator list as complete.\n intentState.operatorList.lastChunk = true;\n\n for (const internalRenderTask of intentState.renderTasks) {\n internalRenderTask.operatorListChanged();\n }\n this.#tryCleanup(/* delayed = */ true);\n }\n\n if (intentState.displayReadyCapability) {\n intentState.displayReadyCapability.reject(reason);\n } else if (intentState.opListReadCapability) {\n intentState.opListReadCapability.reject(reason);\n } else {\n throw reason;\n }\n }\n );\n };\n pump();\n }\n\n /**\n * @private\n */\n _abortOperatorList({ intentState, reason, force = false }) {\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) {\n assert(\n reason instanceof Error,\n '_abortOperatorList: Expected valid \"reason\" argument.'\n );\n }\n\n if (!intentState.streamReader) {\n return;\n }\n // Ensure that a pending `streamReader` cancel timeout is always aborted.\n if (intentState.streamReaderCancelTimeout) {\n clearTimeout(intentState.streamReaderCancelTimeout);\n intentState.streamReaderCancelTimeout = null;\n }\n\n if (!force) {\n // Ensure that an Error occurring in *only* one `InternalRenderTask`, e.g.\n // multiple render() calls on the same canvas, won't break all rendering.\n if (intentState.renderTasks.size > 0) {\n return;\n }\n // Don't immediately abort parsing on the worker-thread when rendering is\n // cancelled, since that will unnecessarily delay re-rendering when (for\n // partially parsed pages) e.g. zooming/rotation occurs in the viewer.\n if (reason instanceof RenderingCancelledException) {\n let delay = RENDERING_CANCELLED_TIMEOUT;\n if (reason.extraDelay > 0 && reason.extraDelay < /* ms = */ 1000) {\n // Above, we prevent the total delay from becoming arbitrarily large.\n delay += reason.extraDelay;\n }\n\n intentState.streamReaderCancelTimeout = setTimeout(() => {\n intentState.streamReaderCancelTimeout = null;\n this._abortOperatorList({ intentState, reason, force: true });\n }, delay);\n return;\n }\n }\n intentState.streamReader\n .cancel(new AbortException(reason.message))\n .catch(() => {\n // Avoid \"Uncaught promise\" messages in the console.\n });\n intentState.streamReader = null;\n\n if (this._transport.destroyed) {\n return; // Ignore any pending requests if the worker was terminated.\n }\n // Remove the current `intentState`, since a cancelled `getOperatorList`\n // call on the worker-thread cannot be re-started...\n for (const [curCacheKey, curIntentState] of this._intentStates) {\n if (curIntentState === intentState) {\n this._intentStates.delete(curCacheKey);\n break;\n }\n }\n // ... and force clean-up to ensure that any old state is always removed.\n this.cleanup();\n }\n\n /**\n * @type {StatTimer | null} Returns page stats, if enabled; returns `null`\n * otherwise.\n */\n get stats() {\n return this._stats;\n }\n}\n\nclass LoopbackPort {\n #listeners = new Set();\n\n #deferred = Promise.resolve();\n\n postMessage(obj, transfer) {\n const event = {\n data: structuredClone(obj, transfer ? { transfer } : null),\n };\n\n this.#deferred.then(() => {\n for (const listener of this.#listeners) {\n listener.call(this, event);\n }\n });\n }\n\n addEventListener(name, listener) {\n this.#listeners.add(listener);\n }\n\n removeEventListener(name, listener) {\n this.#listeners.delete(listener);\n }\n\n terminate() {\n this.#listeners.clear();\n }\n}\n\n/**\n * @typedef {Object} PDFWorkerParameters\n * @property {string} [name] - The name of the worker.\n * @property {Worker} [port] - The `workerPort` object.\n * @property {number} [verbosity] - Controls the logging level;\n * the constants from {@link VerbosityLevel} should be used.\n */\n\nconst PDFWorkerUtil = {\n isWorkerDisabled: false,\n fakeWorkerId: 0,\n};\nif (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"GENERIC\")) {\n if (isNodeJS) {\n // Workers aren't supported in Node.js, force-disabling them there.\n PDFWorkerUtil.isWorkerDisabled = true;\n\n GlobalWorkerOptions.workerSrc ||= PDFJSDev.test(\"LIB\")\n ? \"../pdf.worker.js\"\n : \"./pdf.worker.mjs\";\n }\n\n // Check if URLs have the same origin. For non-HTTP based URLs, returns false.\n PDFWorkerUtil.isSameOrigin = function (baseUrl, otherUrl) {\n let base;\n try {\n base = new URL(baseUrl);\n if (!base.origin || base.origin === \"null\") {\n return false; // non-HTTP url\n }\n } catch {\n return false;\n }\n\n const other = new URL(otherUrl, base);\n return base.origin === other.origin;\n };\n\n PDFWorkerUtil.createCDNWrapper = function (url) {\n // We will rely on blob URL's property to specify origin.\n // We want this function to fail in case if createObjectURL or Blob do not\n // exist or fail for some reason -- our Worker creation will fail anyway.\n const wrapper = `await import(\"${url}\");`;\n return URL.createObjectURL(\n new Blob([wrapper], { type: \"text/javascript\" })\n );\n };\n}\n\n/**\n * PDF.js web worker abstraction that controls the instantiation of PDF\n * documents. Message handlers are used to pass information from the main\n * thread to the worker thread and vice versa. If the creation of a web\n * worker is not possible, a \"fake\" worker will be used instead.\n *\n * @param {PDFWorkerParameters} params - The worker initialization parameters.\n */\nclass PDFWorker {\n static #workerPorts;\n\n constructor({\n name = null,\n port = null,\n verbosity = getVerbosityLevel(),\n } = {}) {\n this.name = name;\n this.destroyed = false;\n this.verbosity = verbosity;\n\n this._readyCapability = Promise.withResolvers();\n this._port = null;\n this._webWorker = null;\n this._messageHandler = null;\n\n if (\n (typeof PDFJSDev === \"undefined\" || !PDFJSDev.test(\"MOZCENTRAL\")) &&\n port\n ) {\n if (PDFWorker.#workerPorts?.has(port)) {\n throw new Error(\"Cannot use more than one PDFWorker per port.\");\n }\n (PDFWorker.#workerPorts ||= new WeakMap()).set(port, this);\n this._initializeFromPort(port);\n return;\n }\n this._initialize();\n }\n\n /**\n * Promise for worker initialization completion.\n * @type {Promise}\n */\n get promise() {\n if (\n typeof PDFJSDev !== \"undefined\" &&\n PDFJSDev.test(\"GENERIC\") &&\n isNodeJS\n ) {\n // Ensure that all Node.js packages/polyfills have loaded.\n return Promise.all([NodePackages.promise, this._readyCapability.promise]);\n }\n return this._readyCapability.promise;\n }\n\n /**\n * The current `workerPort`, when it exists.\n * @type {Worker}\n */\n get port() {\n return this._port;\n }\n\n /**\n * The current MessageHandler-instance.\n * @type {MessageHandler}\n */\n get messageHandler() {\n return this._messageHandler;\n }\n\n _initializeFromPort(port) {\n if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) {\n throw new Error(\"Not implemented: _initializeFromPort\");\n }\n this._port = port;\n this._messageHandler = new MessageHandler(\"main\", \"worker\", port);\n this._messageHandler.on(\"ready\", function () {\n // Ignoring \"ready\" event -- MessageHandler should already be initialized\n // and ready to accept messages.\n });\n this._readyCapability.resolve();\n // Send global setting, e.g. verbosity level.\n this._messageHandler.send(\"configure\", {\n verbosity: this.verbosity,\n });\n }\n\n _initialize() {\n // If worker support isn't disabled explicit and the browser has worker\n // support, create a new web worker and test if it/the browser fulfills\n // all requirements to run parts of pdf.js in a web worker.\n // Right now, the requirement is, that an Uint8Array is still an\n // Uint8Array as it arrives on the worker. (Chrome added this with v.15.)\n if (\n !PDFWorkerUtil.isWorkerDisabled &&\n !PDFWorker.#mainThreadWorkerMessageHandler\n ) {\n let { workerSrc } = PDFWorker;\n\n try {\n // Wraps workerSrc path into blob URL, if the former does not belong\n // to the same origin.\n if (\n typeof PDFJSDev !== \"undefined\" &&\n PDFJSDev.test(\"GENERIC\") &&\n !PDFWorkerUtil.isSameOrigin(window.location.href, workerSrc)\n ) {\n workerSrc = PDFWorkerUtil.createCDNWrapper(\n new URL(workerSrc, window.location).href\n );\n }\n\n const worker = new Worker(workerSrc, { type: \"module\" });\n const messageHandler = new MessageHandler(\"main\", \"worker\", worker);\n const terminateEarly = () => {\n worker.removeEventListener(\"error\", onWorkerError);\n messageHandler.destroy();\n worker.terminate();\n if (this.destroyed) {\n this._readyCapability.reject(new Error(\"Worker was destroyed\"));\n } else {\n // Fall back to fake worker if the termination is caused by an\n // error (e.g. NetworkError / SecurityError).\n this._setupFakeWorker();\n }\n };\n\n const onWorkerError = () => {\n if (!this._webWorker) {\n // Worker failed to initialize due to an error. Clean up and fall\n // back to the fake worker.\n terminateEarly();\n }\n };\n worker.addEventListener(\"error\", onWorkerError);\n\n messageHandler.on(\"test\", data => {\n worker.removeEventListener(\"error\", onWorkerError);\n if (this.destroyed) {\n terminateEarly();\n return; // worker was destroyed\n }\n if (data) {\n this._messageHandler = messageHandler;\n this._port = worker;\n this._webWorker = worker;\n\n this._readyCapability.resolve();\n // Send global setting, e.g. verbosity level.\n messageHandler.send(\"configure\", {\n verbosity: this.verbosity,\n });\n } else {\n this._setupFakeWorker();\n messageHandler.destroy();\n worker.terminate();\n }\n });\n\n messageHandler.on(\"ready\", data => {\n worker.removeEventListener(\"error\", onWorkerError);\n if (this.destroyed) {\n terminateEarly();\n return; // worker was destroyed\n }\n try {\n sendTest();\n } catch {\n // We need fallback to a faked worker.\n this._setupFakeWorker();\n }\n });\n\n const sendTest = () => {\n const testObj = new Uint8Array();\n // Ensure that we can use `postMessage` transfers.\n messageHandler.send(\"test\", testObj, [testObj.buffer]);\n };\n\n // It might take time for the worker to initialize. We will try to send\n // the \"test\" message immediately, and once the \"ready\" message arrives.\n // The worker shall process only the first received \"test\" message.\n sendTest();\n return;\n } catch {\n info(\"The worker has been disabled.\");\n }\n }\n // Either workers are disabled, not supported or have thrown an exception.\n // Thus, we fallback to a faked worker.\n this._setupFakeWorker();\n }\n\n _setupFakeWorker() {\n if (!PDFWorkerUtil.isWorkerDisabled) {\n warn(\"Setting up fake worker.\");\n PDFWorkerUtil.isWorkerDisabled = true;\n }\n\n PDFWorker._setupFakeWorkerGlobal\n .then(WorkerMessageHandler => {\n if (this.destroyed) {\n this._readyCapability.reject(new Error(\"Worker was destroyed\"));\n return;\n }\n const port = new LoopbackPort();\n this._port = port;\n\n // All fake workers use the same port, making id unique.\n const id = `fake${PDFWorkerUtil.fakeWorkerId++}`;\n\n // If the main thread is our worker, setup the handling for the\n // messages -- the main thread sends to it self.\n const workerHandler = new MessageHandler(id + \"_worker\", id, port);\n WorkerMessageHandler.setup(workerHandler, port);\n\n const messageHandler = new MessageHandler(id, id + \"_worker\", port);\n this._messageHandler = messageHandler;\n this._readyCapability.resolve();\n // Send global setting, e.g. verbosity level.\n messageHandler.send(\"configure\", {\n verbosity: this.verbosity,\n });\n })\n .catch(reason => {\n this._readyCapability.reject(\n new Error(`Setting up fake worker failed: \"${reason.message}\".`)\n );\n });\n }\n\n /**\n * Destroys the worker instance.\n */\n destroy() {\n this.destroyed = true;\n if (this._webWorker) {\n // We need to terminate only web worker created resource.\n this._webWorker.terminate();\n this._webWorker = null;\n }\n PDFWorker.#workerPorts?.delete(this._port);\n this._port = null;\n if (this._messageHandler) {\n this._messageHandler.destroy();\n this._messageHandler = null;\n }\n }\n\n /**\n * @param {PDFWorkerParameters} params - The worker initialization parameters.\n */\n static fromPort(params) {\n if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) {\n throw new Error(\"Not implemented: fromPort\");\n }\n if (!params?.port) {\n throw new Error(\"PDFWorker.fromPort - invalid method signature.\");\n }\n const cachedPort = this.#workerPorts?.get(params.port);\n if (cachedPort) {\n if (cachedPort._pendingDestroy) {\n throw new Error(\n \"PDFWorker.fromPort - the worker is being destroyed.\\n\" +\n \"Please remember to await `PDFDocumentLoadingTask.destroy()`-calls.\"\n );\n }\n return cachedPort;\n }\n return new PDFWorker(params);\n }\n\n /**\n * The current `workerSrc`, when it exists.\n * @type {string}\n */\n static get workerSrc() {\n if (GlobalWorkerOptions.workerSrc) {\n return GlobalWorkerOptions.workerSrc;\n }\n throw new Error('No \"GlobalWorkerOptions.workerSrc\" specified.');\n }\n\n static get #mainThreadWorkerMessageHandler() {\n try {\n return globalThis.pdfjsWorker?.WorkerMessageHandler || null;\n } catch {\n return null;\n }\n }\n\n // Loads worker code into the main-thread.\n static get _setupFakeWorkerGlobal() {\n const loader = async () => {\n if (this.#mainThreadWorkerMessageHandler) {\n // The worker was already loaded using e.g. a `