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;MACzB,KAAKA,gBAAL,CAAsBv7D,KAAtB;IALW;EAxDe;;AAAA;;;;;UCxNhC;UACA;;UAEA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;;UAEA;UACA;;UAEA;UACA;UACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACAA;;AAgBA;;AASA;;AAWA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAGA,MAAMy7D,eAC8B,UADpC;AAGA,MAAMC,aAC8B,WADpC;AAgB+C;EAC7C,IAAgC9iE,iBAAhC,EAA0C;IACxC,MAAM;MAAEi7D;IAAF,IAAoBh6D,mBAAOA,CAAC,EAAR,CAA1B;;IAEAE,qCAA2BS,UAAU;MACnC,OAAO,IAAIq5D,aAAJ,CAAkBr5D,MAAlB,CAAP;IADF;EAHF,OAMO;IACL,MAAM;MAAEg/D;IAAF,IAAuB3/D,mBAAOA,CAAC,EAAR,CAA7B;;IACA,MAAM;MAAEqhE;IAAF,IAAqBrhE,mBAAOA,CAAC,EAAR,CAA3B;;IAEAE,qCAA2BS,UAAU;MACnC,IAAI6b,oCAAgB7b,OAAOrO,GAAvBkqB,CAAJ,EAAiC;QAC/B,OAAO,IAAI6kD,cAAJ,CAAmB1gE,MAAnB,CAAP;MAFiC;;MAInC,OAAO,IAAIg/D,gBAAJ,CAAqBh/D,MAArB,CAAP;IAJF;EAX2C;AArF/C","sources":["webpack://pdfjs-dist/build/pdf/webpack/universalModuleDefinition","webpack://pdfjs-dist/build/pdf/src/shared/util.js","webpack://pdfjs-dist/build/pdf/src/shared/compatibility.js","webpack://pdfjs-dist/build/pdf/src/shared/is_node.js","webpack://pdfjs-dist/build/pdf/src/display/api.js","webpack://pdfjs-dist/build/pdf/src/display/display_utils.js","webpack://pdfjs-dist/build/pdf/src/display/base_factory.js","webpack://pdfjs-dist/build/pdf/src/display/font_loader.js","webpack://pdfjs-dist/build/pdf/src/display/annotation_storage.js","webpack://pdfjs-dist/build/pdf/src/shared/murmurhash3.js","webpack://pdfjs-dist/build/pdf/src/display/canvas.js","webpack://pdfjs-dist/build/pdf/src/display/pattern_helper.js","webpack://pdfjs-dist/build/pdf/src/shared/image_utils.js","webpack://pdfjs-dist/build/pdf/src/display/worker_options.js","webpack://pdfjs-dist/build/pdf/src/shared/message_handler.js","webpack://pdfjs-dist/build/pdf/src/display/metadata.js","webpack://pdfjs-dist/build/pdf/src/display/optional_content_config.js","webpack://pdfjs-dist/build/pdf/src/display/transport_stream.js","webpack://pdfjs-dist/build/pdf/src/display/xfa_text.js","webpack://pdfjs-dist/build/pdf/src/display/node_utils.js","webpack://pdfjs-dist/build/pdf/src/display/annotation_layer.js","webpack://pdfjs-dist/build/pdf/src/shared/scripting_utils.js","webpack://pdfjs-dist/build/pdf/src/display/xfa_layer.js","webpack://pdfjs-dist/build/pdf/src/display/text_layer.js","webpack://pdfjs-dist/build/pdf/src/display/svg.js","webpack://pdfjs-dist/build/pdf/src/display/node_stream.js","webpack://pdfjs-dist/build/pdf/src/display/network_utils.js","webpack://pdfjs-dist/build/pdf/src/display/content_disposition.js","webpack://pdfjs-dist/build/pdf/src/display/network.js","webpack://pdfjs-dist/build/pdf/src/display/fetch_stream.js","webpack://pdfjs-dist/build/pdf/webpack/bootstrap","webpack://pdfjs-dist/build/pdf/src/pdf.js"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"pdfjs-dist/build/pdf\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"pdfjs-dist/build/pdf\"] = factory();\n\telse\n\t\troot[\"pdfjs-dist/build/pdf\"] = factory();\n})(this, () => {\nreturn ","/* 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 \"./compatibility.js\";\n\nconst IDENTITY_MATRIX = [1, 0, 0, 1, 0, 0];\nconst FONT_IDENTITY_MATRIX = [0.001, 0, 0, 0.001, 0, 0];\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 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\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 AnnotationStateModelType = {\n MARKED: \"Marked\",\n REVIEW: \"Review\",\n};\n\nconst AnnotationMarkedState = {\n MARKED: \"Marked\",\n UNMARKED: \"Unmarked\",\n};\n\nconst AnnotationReviewState = {\n ACCEPTED: \"Accepted\",\n REJECTED: \"Rejected\",\n CANCELLED: \"Cancelled\",\n COMPLETED: \"Completed\",\n NONE: \"None\",\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 StreamType = {\n UNKNOWN: \"UNKNOWN\",\n FLATE: \"FLATE\",\n LZW: \"LZW\",\n DCT: \"DCT\",\n JPX: \"JPX\",\n JBIG: \"JBIG\",\n A85: \"A85\",\n AHX: \"AHX\",\n CCF: \"CCF\",\n RLX: \"RLX\", // PDF short name is 'RL', but telemetry requires three chars.\n};\n\nconst FontType = {\n UNKNOWN: \"UNKNOWN\",\n TYPE1: \"TYPE1\",\n TYPE1STANDARD: \"TYPE1STANDARD\",\n TYPE1C: \"TYPE1C\",\n CIDFONTTYPE0: \"CIDFONTTYPE0\",\n CIDFONTTYPE0C: \"CIDFONTTYPE0C\",\n TRUETYPE: \"TRUETYPE\",\n CIDFONTTYPE2: \"CIDFONTTYPE2\",\n TYPE3: \"TYPE3\",\n OPENTYPE: \"OPENTYPE\",\n TYPE0: \"TYPE0\",\n MMTYPE1: \"MMTYPE1\",\n};\n\nconst VerbosityLevel = {\n ERRORS: 0,\n WARNINGS: 1,\n INFOS: 5,\n};\n\nconst CMapCompressionType = {\n NONE: 0,\n BINARY: 1,\n STREAM: 2,\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 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 /** @deprecated unused */\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 UNSUPPORTED_FEATURES = {\n /** @deprecated unused */\n unknown: \"unknown\",\n forms: \"forms\",\n javaScript: \"javaScript\",\n signatures: \"signatures\",\n smask: \"smask\",\n shadingPattern: \"shadingPattern\",\n /** @deprecated unused */\n font: \"font\",\n errorTilingPattern: \"errorTilingPattern\",\n errorExtGState: \"errorExtGState\",\n errorXObject: \"errorXObject\",\n errorFontLoadType3: \"errorFontLoadType3\",\n errorFontState: \"errorFontState\",\n errorFontMissing: \"errorFontMissing\",\n errorFontTranslate: \"errorFontTranslate\",\n errorColorSpace: \"errorColorSpace\",\n errorOperatorList: \"errorOperatorList\",\n errorFontToUnicode: \"errorFontToUnicode\",\n errorFontLoadNative: \"errorFontLoadNative\",\n errorFontBuildPath: \"errorFontBuildPath\",\n errorFontGetPath: \"errorFontGetPath\",\n errorMarkedContent: \"errorMarkedContent\",\n errorContentSubStream: \"errorContentSubStream\",\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 if (!url) {\n return false;\n }\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 && 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 (ex) {}\n }\n }\n\n const absoluteUrl = baseUrl ? new URL(url, baseUrl) : new URL(url);\n if (_isValidProtocol(absoluteUrl)) {\n return absoluteUrl;\n }\n } catch (ex) {\n /* `new URL()` will throw on incorrect data. */\n }\n return null;\n}\n\nfunction shadow(obj, prop, value) {\n if (\n typeof PDFJSDev === \"undefined\" ||\n PDFJSDev.test(\"!PRODUCTION || TESTING\")\n ) {\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: true,\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 (\n typeof bytes !== \"object\" ||\n bytes === null ||\n bytes.length === undefined\n ) {\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\n/**\n * Gets length of the array (Array, Uint8Array, or string) in bytes.\n * @param {Array<any>|Uint8Array|string} arr\n * @returns {number}\n */\n// eslint-disable-next-line consistent-return\nfunction arrayByteLength(arr) {\n if (arr.length !== undefined) {\n return arr.length;\n }\n if (arr.byteLength !== undefined) {\n return arr.byteLength;\n }\n unreachable(\"Invalid argument for arrayByteLength\");\n}\n\n/**\n * Combines array items (arrays) into single Uint8Array object.\n * @param {Array<Array<any>|Uint8Array|string>} arr - the array of the arrays\n * (Array, Uint8Array, or string).\n * @returns {Uint8Array}\n */\nfunction arraysToBytes(arr) {\n const length = arr.length;\n // Shortcut: if first and only item is Uint8Array, return it.\n if (length === 1 && arr[0] instanceof Uint8Array) {\n return arr[0];\n }\n let resultLength = 0;\n for (let i = 0; i < length; i++) {\n resultLength += arrayByteLength(arr[i]);\n }\n let pos = 0;\n const data = new Uint8Array(resultLength);\n for (let i = 0; i < length; i++) {\n let item = arr[i];\n if (!(item instanceof Uint8Array)) {\n if (typeof item === \"string\") {\n item = stringToBytes(item);\n } else {\n item = new Uint8Array(item);\n }\n }\n const itemLength = item.byteLength;\n data.set(item, pos);\n pos += itemLength;\n }\n return data;\n}\n\nfunction string32(value) {\n if (\n typeof PDFJSDev === \"undefined\" ||\n PDFJSDev.test(\"!PRODUCTION || TESTING\")\n ) {\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 (e) {\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\nconst hexNumbers = [...Array(256).keys()].map(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 // swaped.\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[1];\n minMax[1] = temp;\n }\n minMax[0] *= transform[0];\n minMax[1] *= transform[0];\n\n if (transform[3] < 0) {\n temp = minMax[2];\n minMax[2] = minMax[3];\n minMax[3] = temp;\n }\n minMax[2] *= transform[3];\n minMax[3] *= transform[3];\n } else {\n temp = minMax[0];\n minMax[0] = minMax[2];\n minMax[2] = temp;\n temp = minMax[1];\n minMax[1] = minMax[3];\n minMax[3] = temp;\n\n if (transform[1] < 0) {\n temp = minMax[2];\n minMax[2] = minMax[3];\n minMax[3] = temp;\n }\n minMax[2] *= transform[1];\n minMax[3] *= transform[1];\n\n if (transform[2] < 0) {\n temp = minMax[0];\n minMax[0] = minMax[1];\n minMax[1] = temp;\n }\n minMax[0] *= transform[2];\n minMax[1] *= transform[2];\n }\n minMax[0] += transform[4];\n minMax[1] += transform[4];\n minMax[2] += transform[5];\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 = Util.applyTransform(r, m);\n const p2 = Util.applyTransform(r.slice(2, 4), m);\n const p3 = Util.applyTransform([r[0], r[3]], m);\n const p4 = Util.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 // Apply a generic 3d matrix M on a 3-vector v:\n // | a b c | | X |\n // | d e f | x | Y |\n // | g h i | | Z |\n // M is assumed to be serialized as [a,b,c,d,e,f,g,h,i],\n // with v as [X,Y,Z]\n static apply3dTransform(m, v) {\n return [\n m[0] * v[0] + m[1] * v[1] + m[2] * v[2],\n m[3] * v[0] + m[4] * v[1] + m[5] * v[2],\n m[6] * v[0] + m[7] * v[1] + m[8] * v[2],\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 // 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) {\n const tvalues = [],\n bounds = [[], []];\n let a, b, c, t, t1, t2, b2ac, sqrtb2ac;\n for (let i = 0; i < 2; ++i) {\n if (i === 0) {\n b = 6 * x0 - 12 * x1 + 6 * x2;\n a = -3 * x0 + 9 * x1 - 9 * x2 + 3 * x3;\n c = 3 * x1 - 3 * x0;\n } else {\n b = 6 * y0 - 12 * y1 + 6 * y2;\n a = -3 * y0 + 9 * y1 - 9 * y2 + 3 * y3;\n c = 3 * y1 - 3 * y0;\n }\n if (Math.abs(a) < 1e-12) {\n if (Math.abs(b) < 1e-12) {\n continue;\n }\n t = -c / b;\n if (0 < t && t < 1) {\n tvalues.push(t);\n }\n continue;\n }\n b2ac = b * b - 4 * c * a;\n sqrtb2ac = Math.sqrt(b2ac);\n if (b2ac < 0) {\n continue;\n }\n t1 = (-b + sqrtb2ac) / (2 * a);\n if (0 < t1 && t1 < 1) {\n tvalues.push(t1);\n }\n t2 = (-b - sqrtb2ac) / (2 * a);\n if (0 < t2 && t2 < 1) {\n tvalues.push(t2);\n }\n }\n\n let j = tvalues.length,\n mt;\n const jlen = j;\n while (j--) {\n t = tvalues[j];\n mt = 1 - t;\n bounds[0][j] =\n mt * mt * mt * x0 +\n 3 * mt * mt * t * x1 +\n 3 * mt * t * t * x2 +\n t * t * t * x3;\n bounds[1][j] =\n mt * mt * mt * y0 +\n 3 * mt * mt * t * y1 +\n 3 * mt * t * t * y2 +\n t * t * t * y3;\n }\n\n bounds[0][jlen] = x0;\n bounds[1][jlen] = y0;\n bounds[0][jlen + 1] = x3;\n bounds[1][jlen + 1] = y3;\n bounds[0].length = bounds[1].length = jlen + 2;\n\n return [\n Math.min(...bounds[0]),\n Math.min(...bounds[1]),\n Math.max(...bounds[0]),\n Math.max(...bounds[1]),\n ];\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 if (str[0] >= \"\\xEF\") {\n let encoding;\n if (str[0] === \"\\xFE\" && str[1] === \"\\xFF\") {\n encoding = \"utf-16be\";\n } else if (str[0] === \"\\xFF\" && str[1] === \"\\xFE\") {\n encoding = \"utf-16le\";\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 return decoder.decode(buffer);\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 code = PDFStringTranslateTable[str.charCodeAt(i)];\n strBuf.push(code ? String.fromCharCode(code) : str.charAt(i));\n }\n return strBuf.join(\"\");\n}\n\nfunction escapeString(str) {\n // replace \"(\", \")\", \"\\n\", \"\\r\" and \"\\\"\n // by \"\\(\", \"\\)\", \"\\\\n\", \"\\\\r\" and \"\\\\\"\n // in order to write it in a PDF file.\n return str.replace(/([()\\\\\\n\\r])/g, match => {\n if (match === \"\\n\") {\n return \"\\\\n\";\n } else if (match === \"\\r\") {\n return \"\\\\r\";\n }\n return `\\\\${match}`;\n });\n}\n\nfunction isAscii(str) {\n return /^[\\x00-\\x7F]*$/.test(str);\n}\n\nfunction stringToUTF16BEString(str) {\n const buf = [\"\\xFE\\xFF\"];\n for (let i = 0, ii = str.length; i < ii; i++) {\n const char = str.charCodeAt(i);\n buf.push(\n String.fromCharCode((char >> 8) & 0xff),\n String.fromCharCode(char & 0xff)\n );\n }\n return buf.join(\"\");\n}\n\nfunction stringToUTF8String(str) {\n return decodeURIComponent(escape(str));\n}\n\nfunction utf8StringToString(str) {\n return unescape(encodeURIComponent(str));\n}\n\nfunction isArrayBuffer(v) {\n return typeof v === \"object\" && v !== null && v.byteLength !== undefined;\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\n/**\n * Promise Capability object.\n *\n * @typedef {Object} PromiseCapability\n * @property {Promise<any>} promise - A Promise object.\n * @property {boolean} settled - If the Promise has been fulfilled/rejected.\n * @property {function} resolve - Fulfills the Promise.\n * @property {function} reject - Rejects the Promise.\n */\n\n/**\n * Creates a promise capability object.\n * @alias createPromiseCapability\n *\n * @returns {PromiseCapability}\n */\nfunction createPromiseCapability() {\n const capability = Object.create(null);\n let isSettled = false;\n\n Object.defineProperty(capability, \"settled\", {\n get() {\n return isSettled;\n },\n });\n capability.promise = new Promise(function (resolve, reject) {\n capability.resolve = function (data) {\n isSettled = true;\n resolve(data);\n };\n capability.reject = function (reason) {\n isSettled = true;\n reject(reason);\n };\n });\n return capability;\n}\n\nexport {\n AbortException,\n AnnotationActionEventType,\n AnnotationBorderStyleType,\n AnnotationFieldFlag,\n AnnotationFlag,\n AnnotationMarkedState,\n AnnotationMode,\n AnnotationReplyType,\n AnnotationReviewState,\n AnnotationStateModelType,\n AnnotationType,\n arrayByteLength,\n arraysToBytes,\n assert,\n BaseException,\n bytesToString,\n CMapCompressionType,\n createPromiseCapability,\n createValidAbsoluteUrl,\n DocumentActionEventType,\n escapeString,\n FeatureTest,\n FONT_IDENTITY_MATRIX,\n FontType,\n FormatError,\n getModificationDate,\n getVerbosityLevel,\n IDENTITY_MATRIX,\n ImageKind,\n info,\n InvalidPDFException,\n isArrayBuffer,\n isArrayEqual,\n isAscii,\n MissingPDFException,\n objectFromMap,\n objectSize,\n OPS,\n PageActionEventType,\n PasswordException,\n PasswordResponses,\n PermissionFlag,\n RenderingIntentFlag,\n setVerbosityLevel,\n shadow,\n StreamType,\n string32,\n stringToBytes,\n stringToPDFString,\n stringToUTF16BEString,\n stringToUTF8String,\n TextRenderingMode,\n UnexpectedResponseException,\n UnknownErrorException,\n unreachable,\n UNSUPPORTED_FEATURES,\n utf8StringToString,\n Util,\n VerbosityLevel,\n warn,\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/* globals __non_webpack_require__ */\n\nimport { isNodeJS } from \"./is_node.js\";\n\n// Skip compatibility checks for modern builds and if we already ran the module.\nif (\n (typeof PDFJSDev === \"undefined\" || !PDFJSDev.test(\"SKIP_BABEL\")) &&\n !globalThis._pdfjsCompatibilityChecked\n) {\n globalThis._pdfjsCompatibilityChecked = true;\n\n // Support: Node.js\n (function checkNodeBtoa() {\n if (globalThis.btoa || !isNodeJS) {\n return;\n }\n globalThis.btoa = function (chars) {\n // eslint-disable-next-line no-undef\n return Buffer.from(chars, \"binary\").toString(\"base64\");\n };\n })();\n\n // Support: Node.js\n (function checkNodeAtob() {\n if (globalThis.atob || !isNodeJS) {\n return;\n }\n globalThis.atob = function (input) {\n // eslint-disable-next-line no-undef\n return Buffer.from(input, \"base64\").toString(\"binary\");\n };\n })();\n\n // Support: Node.js\n (function checkDOMMatrix() {\n if (globalThis.DOMMatrix || !isNodeJS) {\n return;\n }\n globalThis.DOMMatrix = __non_webpack_require__(\n \"dommatrix/dist/dommatrix.js\"\n );\n })();\n\n // Provides support for *recent* additions to the Promise specification,\n // however basic Promise support is assumed to be available natively.\n // Support: Firefox<71, Chrome<76, Safari<13, Node.js<12.9.0\n (function checkPromise() {\n if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"IMAGE_DECODERS\")) {\n // The current image decoders are synchronous, hence `Promise` shouldn't\n // need to be polyfilled for the IMAGE_DECODERS build target.\n return;\n }\n if (globalThis.Promise.allSettled) {\n return;\n }\n globalThis.Promise = require(\"core-js/es/promise/index.js\");\n })();\n\n // Support: Node.js\n (function checkReadableStream() {\n if (globalThis.ReadableStream || !isNodeJS) {\n return;\n }\n globalThis.ReadableStream = __non_webpack_require__(\n \"web-streams-polyfill/dist/ponyfill.js\"\n ).ReadableStream;\n })();\n\n // Support: Firefox<94, Chrome<98, Safari<15.4, Node.js<17.0.0\n (function checkStructuredClone() {\n if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"IMAGE_DECODERS\")) {\n // The current image decoders are synchronous, hence `structuredClone`\n // shouldn't need to be polyfilled for the IMAGE_DECODERS build target.\n return;\n }\n if (globalThis.structuredClone) {\n return;\n }\n require(\"core-js/web/structured-clone.js\");\n })();\n}\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/* 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\nexport { isNodeJS };\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 createPromiseCapability,\n getVerbosityLevel,\n info,\n InvalidPDFException,\n isArrayBuffer,\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 deprecated,\n DOMCanvasFactory,\n DOMCMapReaderFactory,\n DOMStandardFontDataFactory,\n isDataScheme,\n loadScript,\n PageViewport,\n RenderingCancelledException,\n StatTimer,\n} from \"./display_utils.js\";\nimport { FontFaceObject, FontLoader } from \"./font_loader.js\";\nimport { AnnotationStorage } from \"./annotation_storage.js\";\nimport { CanvasGraphics } from \"./canvas.js\";\nimport { GlobalWorkerOptions } from \"./worker_options.js\";\nimport { isNodeJS } from \"../shared/is_node.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 { XfaText } from \"./xfa_text.js\";\n\nconst DEFAULT_RANGE_CHUNK_SIZE = 65536; // 2^16 = 65536\nconst RENDERING_CANCELLED_TIMEOUT = 100; // ms\n\nlet DefaultCanvasFactory = DOMCanvasFactory;\nlet DefaultCMapReaderFactory = DOMCMapReaderFactory;\nlet DefaultStandardFontDataFactory = DOMStandardFontDataFactory;\n\nif (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"GENERIC\") && isNodeJS) {\n const {\n NodeCanvasFactory,\n NodeCMapReaderFactory,\n NodeStandardFontDataFactory,\n } = require(\"./node_utils.js\");\n\n DefaultCanvasFactory = NodeCanvasFactory;\n DefaultCMapReaderFactory = NodeCMapReaderFactory;\n DefaultStandardFontDataFactory = NodeStandardFontDataFactory;\n}\n\n/**\n * @typedef {function} IPDFStreamFactory\n * @param {DocumentInitParameters} params - The document initialization\n * parameters. The \"url\" key is always present.\n * @returns {Promise} A promise, which is resolved with an instance of\n * {IPDFStream}.\n * @ignore\n */\n\n/**\n * @type {IPDFStreamFactory}\n * @private\n */\nlet createPDFNetworkStream;\n\n/**\n * Sets the function that instantiates an {IPDFStream} as an alternative PDF\n * data transport.\n *\n * @param {IPDFStreamFactory} pdfNetworkStreamFactory - The factory function\n * that takes document initialization parameters (including a \"url\") and\n * returns a promise which is resolved with an instance of {IPDFStream}.\n * @ignore\n */\nfunction setPDFNetworkStreamFactory(pdfNetworkStreamFactory) {\n createPDFNetworkStream = pdfNetworkStreamFactory;\n}\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|Array<number>|string} [data] - Binary PDF data. Use\n * typed arrays (Uint8Array) to improve the memory usage. If PDF data is\n * BASE64-encoded, use `atob()` to convert it to a binary string first.\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 {TypedArray} [initialData] - A typed array with the first portion\n * or all of the pdf data. Used by the extension since some data is already\n * loaded before the switch to range requests.\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.\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 font rendering, and\n * when parsing PDF functions. The default value is `true`.\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 */\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|PDFDataRangeTransport|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 const task = new PDFDocumentLoadingTask();\n\n let source;\n if (typeof src === \"string\" || src instanceof URL) {\n source = { url: src };\n } else if (isArrayBuffer(src)) {\n source = { data: src };\n } else if (src instanceof PDFDataRangeTransport) {\n source = { range: src };\n } else {\n if (typeof src !== \"object\") {\n throw new Error(\n \"Invalid parameter in getDocument, \" +\n \"need either string, URL, Uint8Array, or parameter object.\"\n );\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 source = src;\n }\n const params = Object.create(null);\n let rangeTransport = null,\n worker = null;\n\n for (const key in source) {\n const value = source[key];\n\n switch (key) {\n case \"url\":\n if (typeof window !== \"undefined\") {\n try {\n // The full path is required in the 'url' field.\n params[key] = new URL(value, window.location).href;\n continue;\n } catch (ex) {\n warn(`Cannot create valid URL: \"${ex}\".`);\n }\n } else if (typeof value === \"string\" || value instanceof URL) {\n params[key] = value.toString(); // Support Node.js environments.\n continue;\n }\n throw new Error(\n \"Invalid PDF url data: \" +\n \"either string or URL-object is expected in the url property.\"\n );\n case \"range\":\n rangeTransport = value;\n continue;\n case \"worker\":\n worker = value;\n continue;\n case \"data\":\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 value instanceof Buffer // eslint-disable-line no-undef\n ) {\n params[key] = new Uint8Array(value);\n } else if (value instanceof Uint8Array) {\n break; // Use the data as-is when it's already a Uint8Array.\n } else if (typeof value === \"string\") {\n params[key] = stringToBytes(value);\n } else if (\n typeof value === \"object\" &&\n value !== null &&\n !isNaN(value.length)\n ) {\n params[key] = new Uint8Array(value);\n } else if (isArrayBuffer(value)) {\n params[key] = new Uint8Array(value);\n } else {\n throw new Error(\n \"Invalid PDF binary data: either typed array, \" +\n \"string, or array-like object is expected in the data property.\"\n );\n }\n continue;\n }\n params[key] = value;\n }\n\n params.CMapReaderFactory =\n params.CMapReaderFactory || DefaultCMapReaderFactory;\n params.StandardFontDataFactory =\n params.StandardFontDataFactory || DefaultStandardFontDataFactory;\n params.ignoreErrors = params.stopAtErrors !== true;\n params.fontExtraProperties = params.fontExtraProperties === true;\n params.pdfBug = params.pdfBug === true;\n params.enableXfa = params.enableXfa === true;\n\n if (!Number.isInteger(params.rangeChunkSize) || params.rangeChunkSize < 1) {\n params.rangeChunkSize = DEFAULT_RANGE_CHUNK_SIZE;\n }\n if (\n typeof params.docBaseUrl !== \"string\" ||\n isDataScheme(params.docBaseUrl)\n ) {\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 params.docBaseUrl = null;\n }\n if (!Number.isInteger(params.maxImageSize) || params.maxImageSize < -1) {\n params.maxImageSize = -1;\n }\n if (typeof params.cMapUrl !== \"string\") {\n params.cMapUrl = null;\n }\n if (typeof params.standardFontDataUrl !== \"string\") {\n params.standardFontDataUrl = null;\n }\n if (typeof params.useWorkerFetch !== \"boolean\") {\n params.useWorkerFetch =\n params.CMapReaderFactory === DOMCMapReaderFactory &&\n params.StandardFontDataFactory === DOMStandardFontDataFactory;\n }\n if (typeof params.isEvalSupported !== \"boolean\") {\n params.isEvalSupported = true;\n }\n if (typeof params.disableFontFace !== \"boolean\") {\n params.disableFontFace = isNodeJS;\n }\n if (typeof params.useSystemFonts !== \"boolean\") {\n params.useSystemFonts = !isNodeJS && !params.disableFontFace;\n }\n if (\n typeof params.ownerDocument !== \"object\" ||\n params.ownerDocument === null\n ) {\n params.ownerDocument = globalThis.document;\n }\n\n if (typeof params.disableRange !== \"boolean\") {\n params.disableRange = false;\n }\n if (typeof params.disableStream !== \"boolean\") {\n params.disableStream = false;\n }\n if (typeof params.disableAutoFetch !== \"boolean\") {\n params.disableAutoFetch = false;\n }\n\n // Set the main-thread verbosity level.\n setVerbosityLevel(params.verbosity);\n\n if (!worker) {\n const workerParams = {\n verbosity: params.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 const docId = task.docId;\n worker.promise\n .then(function () {\n if (task.destroyed) {\n throw new Error(\"Loading aborted\");\n }\n\n const workerIdPromise = _fetchDocument(\n worker,\n params,\n rangeTransport,\n docId\n );\n const networkStreamPromise = new Promise(function (resolve) {\n let networkStream;\n if (rangeTransport) {\n networkStream = new PDFDataTransportStream(\n {\n length: params.length,\n initialData: params.initialData,\n progressiveDone: params.progressiveDone,\n contentDispositionFilename: params.contentDispositionFilename,\n disableRange: params.disableRange,\n disableStream: params.disableStream,\n },\n rangeTransport\n );\n } else if (!params.data) {\n networkStream = createPDFNetworkStream({\n url: params.url,\n length: params.length,\n httpHeaders: params.httpHeaders,\n withCredentials: params.withCredentials,\n rangeChunkSize: params.rangeChunkSize,\n disableRange: params.disableRange,\n disableStream: params.disableStream,\n });\n }\n resolve(networkStream);\n });\n\n return Promise.all([workerIdPromise, networkStreamPromise]).then(\n function ([workerId, networkStream]) {\n if (task.destroyed) {\n throw new Error(\"Loading aborted\");\n }\n\n const messageHandler = new MessageHandler(\n docId,\n workerId,\n worker.port\n );\n const transport = new WorkerTransport(\n messageHandler,\n task,\n networkStream,\n params\n );\n task._transport = transport;\n messageHandler.send(\"Ready\", null);\n }\n );\n })\n .catch(task._capability.reject);\n\n return task;\n}\n\n/**\n * Starts fetching of specified PDF document/data.\n *\n * @param {PDFWorker} worker\n * @param {Object} source\n * @param {PDFDataRangeTransport} pdfDataRangeTransport\n * @param {string} docId - Unique document ID, used in `MessageHandler`.\n * @returns {Promise<string>} A promise that is resolved when the worker ID of\n * the `MessageHandler` is known.\n * @private\n */\nasync function _fetchDocument(worker, source, pdfDataRangeTransport, docId) {\n if (worker.destroyed) {\n throw new Error(\"Worker was destroyed\");\n }\n\n if (pdfDataRangeTransport) {\n source.length = pdfDataRangeTransport.length;\n source.initialData = pdfDataRangeTransport.initialData;\n source.progressiveDone = pdfDataRangeTransport.progressiveDone;\n source.contentDispositionFilename =\n pdfDataRangeTransport.contentDispositionFilename;\n }\n const workerId = await worker.messageHandler.sendWithPromise(\n \"GetDocRequest\",\n {\n docId,\n apiVersion:\n typeof PDFJSDev !== \"undefined\" && !PDFJSDev.test(\"TESTING\")\n ? PDFJSDev.eval(\"BUNDLE_VERSION\")\n : null,\n // Only send the required properties, and *not* the entire object.\n source: {\n data: source.data,\n url: source.url,\n password: source.password,\n disableAutoFetch: source.disableAutoFetch,\n rangeChunkSize: source.rangeChunkSize,\n length: source.length,\n },\n maxImageSize: source.maxImageSize,\n disableFontFace: source.disableFontFace,\n docBaseUrl: source.docBaseUrl,\n ignoreErrors: source.ignoreErrors,\n isEvalSupported: source.isEvalSupported,\n fontExtraProperties: source.fontExtraProperties,\n enableXfa: source.enableXfa,\n useSystemFonts: source.useSystemFonts,\n cMapUrl: source.useWorkerFetch ? source.cMapUrl : null,\n standardFontDataUrl: source.useWorkerFetch\n ? source.standardFontDataUrl\n : null,\n }\n );\n\n if (worker.destroyed) {\n throw new Error(\"Worker was destroyed\");\n }\n return workerId;\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 = createPromiseCapability();\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 * Callback for when an unsupported feature is used in the PDF document.\n * The callback receives an {@link UNSUPPORTED_FEATURES} argument.\n * @type {function}\n */\n this.onUnsupportedFeature = null;\n }\n\n /**\n * Promise for document loading task completion.\n * @type {Promise<PDFDocumentProxy>}\n */\n get promise() {\n return this._capability.promise;\n }\n\n /**\n * Abort all network requests and destroy the worker.\n * @returns {Promise<void>} A promise that is resolved when destruction is\n * completed.\n */\n async destroy() {\n this.destroyed = true;\n await this._transport?.destroy();\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 */\nclass PDFDataRangeTransport {\n /**\n * @param {number} length\n * @param {Uint8Array} 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 = createPromiseCapability();\n }\n\n addRangeListener(listener) {\n this._rangeListeners.push(listener);\n }\n\n addProgressListener(listener) {\n this._progressListeners.push(listener);\n }\n\n addProgressiveReadListener(listener) {\n this._progressiveReadListeners.push(listener);\n }\n\n addProgressiveDoneListener(listener) {\n this._progressiveDoneListeners.push(listener);\n }\n\n onDataRange(begin, chunk) {\n for (const listener of this._rangeListeners) {\n listener(begin, chunk);\n }\n }\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 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 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(\"GENERIC\")) {\n Object.defineProperty(this, \"fingerprint\", {\n get() {\n deprecated(\n \"`PDFDocumentProxy.fingerprint`, \" +\n \"please use `PDFDocumentProxy.fingerprints` instead.\"\n );\n return this.fingerprints[0];\n },\n });\n\n Object.defineProperty(this, \"getStats\", {\n value: async () => {\n deprecated(\n \"`PDFDocumentProxy.getStats`, \" +\n \"please use the `PDFDocumentProxy.stats`-getter instead.\"\n );\n return this.stats || { streamTypes: {}, fontTypes: {} };\n },\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 {number} Total number of pages in the PDF file.\n */\n get numPages() {\n return this._pdfInfo.numPages;\n }\n\n /**\n * @type {Array<string, string|null>} 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 * @typedef {Object} PDFDocumentStats\n * @property {Object<string, boolean>} streamTypes - Used stream types in the\n * document (an item is set to true if specific stream ID was used in the\n * document).\n * @property {Object<string, boolean>} fontTypes - Used font types in the\n * document (an item is set to true if specific font ID was used in the\n * document).\n */\n\n /**\n * @type {PDFDocumentStats | null} The current statistics about document\n * structures, or `null` when no statistics exists.\n */\n get stats() {\n return this._transport.stats;\n }\n\n /**\n * @type {boolean} True if only XFA form.\n */\n get isPureXfa() {\n return !!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<PDFPageProxy>} 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<number>} 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<Object<string, Array<any>>>} 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<Array<any> | 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<Array<string> | 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<string>} 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<string>} 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<Object | null>} 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<any | null>} 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<any>} 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<Array<string> | null>} A promise that is resolved with\n * an {Array} of all the JavaScript strings in the name tree, or `null`\n * if no JavaScript exists.\n */\n getJavaScript() {\n return this._transport.getJavaScript();\n }\n\n /**\n * @returns {Promise<Object | null>} A promise that is resolved with\n * an {Object} with the JavaScript actions:\n * - from the name tree (like getJavaScript);\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<any> | 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<OutlineNode>} items\n */\n\n /**\n * @returns {Promise<Array<OutlineNode>>} 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 * @returns {Promise<OptionalContentConfig>} 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() {\n return this._transport.getOptionalContentConfig();\n }\n\n /**\n * @returns {Promise<Array<number> | 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<MarkInfo | null>} 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<TypedArray>} A promise that is resolved with a\n * {TypedArray} that has the raw data from the PDF.\n */\n getData() {\n return this._transport.getData();\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 * @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<Uint8Array>} A promise that is resolved with a\n * {Uint8Array} containing the full data of the saved document.\n */\n saveDocument() {\n if (\n (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"GENERIC\")) &&\n this._transport.annotationStorage.size <= 0\n ) {\n deprecated(\n \"saveDocument called while `annotationStorage` is empty, \" +\n \"please use the getData-method instead.\"\n );\n }\n return this._transport.saveDocument();\n }\n\n /**\n * @returns {Promise<Object<string, Array<Object>> | 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<boolean>} 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<Array<string> | null>} A promise that is resolved with an\n * {Array<string>} 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} disableCombineTextItems - Do not attempt to combine\n * same line {@link TextItem}'s. The default value is `false`.\n * @property {boolean} [includeMarkedContent] - When true include marked\n * content items in the items array of TextContent. The default is `false`.\n */\n\n/**\n * Page text content.\n *\n * @typedef {Object} TextContent\n * @property {Array<TextItem | TextMarkedContent>} items - Array of\n * {@link TextItem} and {@link TextMarkedContent} objects. TextMarkedContent\n * items are included when includeMarkedContent is true.\n * @property {Object<string, TextStyle>} styles - {@link TextStyle} objects,\n * indexed by font name.\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<any>} 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 {Object} canvasContext - A 2D context of a DOM 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<any>} [transform] - Additional transform, applied just\n * before viewport transform.\n * @property {Object} [imageLayer] - An object that has `beginLayout`,\n * `endLayout` and `appendImage` functions.\n * @property {Object} [canvasFactory] - The factory instance that will be used\n * when creating canvases. The default value is {new DOMCanvasFactory()}.\n * @property {Object | string} [background] - Background to use for the canvas.\n * Any valid `canvas.fillStyle` can be used: a `DOMString` parsed as CSS\n * <color> 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<OptionalContentConfig>} [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<string, HTMLCanvasElement>} [annotationCanvasMap] - Map some\n * annotation ids with canvases used to render them.\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 */\n\n/**\n * Structure tree node. The root node will have a role \"Root\".\n *\n * @typedef {Object} StructTreeNode\n * @property {Array<StructTreeNode | StructTreeContent>} 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<number>} fnArray - Array containing the operator functions.\n * @property {Array<any>} 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 constructor(pageIndex, pageInfo, transport, ownerDocument, pdfBug = false) {\n this._pageIndex = pageIndex;\n this._pageInfo = pageInfo;\n this._ownerDocument = ownerDocument;\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._bitmaps = new Set();\n\n this.cleanupAfterRender = false;\n this.pendingCleanup = false;\n this._intentStates = new Map();\n this._annotationPromises = 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<number>} 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<Array<any>>} A promise that is resolved with an\n * {Array} of the annotation objects.\n */\n getAnnotations({ intent = \"display\" } = {}) {\n const intentArgs = this._transport.getRenderingIntent(intent);\n\n let promise = this._annotationPromises.get(intentArgs.cacheKey);\n if (!promise) {\n promise = this._transport.getAnnotations(\n this._pageIndex,\n intentArgs.renderingIntent\n );\n this._annotationPromises.set(intentArgs.cacheKey, promise);\n\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"GENERIC\")) {\n promise = promise.then(annotations => {\n for (const annotation of annotations) {\n if (annotation.titleObj !== undefined) {\n Object.defineProperty(annotation, \"title\", {\n get() {\n deprecated(\n \"`title`-property on annotation, please use `titleObj` instead.\"\n );\n return annotation.titleObj.str;\n },\n });\n }\n if (annotation.contentsObj !== undefined) {\n Object.defineProperty(annotation, \"contents\", {\n get() {\n deprecated(\n \"`contents`-property on annotation, please use `contentsObj` instead.\"\n );\n return annotation.contentsObj.str;\n },\n });\n }\n }\n return annotations;\n });\n }\n }\n return promise;\n }\n\n /**\n * @returns {Promise<Object>} A promise that is resolved with an\n * {Object} with JS actions.\n */\n getJSActions() {\n return (this._jsActionsPromise ||= this._transport.getPageJSActions(\n this._pageIndex\n ));\n }\n\n /**\n * @returns {Promise<Object | null>} 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 imageLayer = null,\n canvasFactory = null,\n background = null,\n optionalContentConfigPromise = null,\n annotationCanvasMap = null,\n pageColors = null,\n }) {\n if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"GENERIC\")) {\n if (arguments[0]?.renderInteractiveForms !== undefined) {\n deprecated(\n \"render no longer accepts the `renderInteractiveForms`-option, \" +\n \"please use the `annotationMode`-option instead.\"\n );\n if (\n arguments[0].renderInteractiveForms === true &&\n annotationMode === AnnotationMode.ENABLE\n ) {\n annotationMode = AnnotationMode.ENABLE_FORMS;\n }\n }\n if (arguments[0]?.includeAnnotationStorage !== undefined) {\n deprecated(\n \"render no longer accepts the `includeAnnotationStorage`-option, \" +\n \"please use the `annotationMode`-option instead.\"\n );\n if (\n arguments[0].includeAnnotationStorage === true &&\n annotationMode === AnnotationMode.ENABLE\n ) {\n annotationMode = AnnotationMode.ENABLE_STORAGE;\n }\n }\n }\n\n if (this._stats) {\n this._stats.time(\"Overall\");\n }\n\n const intentArgs = this._transport.getRenderingIntent(\n intent,\n annotationMode\n );\n // If there was a pending destroy, cancel it so no cleanup happens during\n // this call to render.\n this.pendingCleanup = false;\n\n if (!optionalContentConfigPromise) {\n optionalContentConfigPromise = this._transport.getOptionalContentConfig();\n }\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\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 canvasFactoryInstance =\n canvasFactory ||\n new DefaultCanvasFactory({ ownerDocument: this._ownerDocument });\n const intentPrint = !!(\n intentArgs.renderingIntent & RenderingIntentFlag.PRINT\n );\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 = createPromiseCapability();\n intentState.operatorList = {\n fnArray: [],\n argsArray: [],\n lastChunk: false,\n };\n\n if (this._stats) {\n this._stats.time(\"Page Request\");\n }\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 once rendering has finished (regardless of cleanupAfterRender).\n if (this.cleanupAfterRender || intentPrint) {\n this.pendingCleanup = true;\n }\n this._tryCleanup();\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 if (this._stats) {\n this._stats.timeEnd(\"Rendering\");\n this._stats.timeEnd(\"Overall\");\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 imageLayer,\n background,\n },\n objs: this.objs,\n commonObjs: this.commonObjs,\n annotationCanvasMap,\n operatorList: intentState.operatorList,\n pageIndex: this._pageIndex,\n canvasFactory: canvasFactoryInstance,\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.pendingCleanup) {\n complete();\n return;\n }\n if (this._stats) {\n this._stats.time(\"Rendering\");\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<PDFOperatorList>} 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 } = {}) {\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 /* 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 = createPromiseCapability();\n (intentState.renderTasks ||= new Set()).add(opListTask);\n intentState.operatorList = {\n fnArray: [],\n argsArray: [],\n lastChunk: false,\n };\n\n if (this._stats) {\n this._stats.time(\"Page Request\");\n }\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 disableCombineTextItems = false,\n includeMarkedContent = false,\n } = {}) {\n const TEXT_CONTENT_CHUNK_SIZE = 100;\n\n return this._transport.messageHandler.sendWithStream(\n \"GetTextContent\",\n {\n pageIndex: this._pageIndex,\n combineTextItems: disableCombineTextItems !== true,\n includeMarkedContent: includeMarkedContent === 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<TextContent>} 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 => {\n return XfaText.textContent(xfa);\n });\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 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 };\n pump();\n });\n }\n\n /**\n * @returns {Promise<StructTreeNode>} 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._structTreePromise ||= this._transport.getStructTree(\n this._pageIndex\n ));\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 for (const bitmap of this._bitmaps) {\n bitmap.close();\n }\n this._bitmaps.clear();\n this._annotationPromises.clear();\n this._jsActionsPromise = null;\n this._structTreePromise = null;\n this.pendingCleanup = false;\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 return this._tryCleanup(resetStats);\n }\n\n /**\n * Attempts to clean up if rendering is in a state where that's possible.\n * @private\n */\n _tryCleanup(resetStats = false) {\n if (!this.pendingCleanup) {\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\n this._intentStates.clear();\n this.objs.clear();\n this._annotationPromises.clear();\n this._jsActionsPromise = null;\n this._structTreePromise = null;\n if (resetStats && this._stats) {\n this._stats = new StatTimer();\n }\n for (const bitmap of this._bitmaps) {\n bitmap.close();\n }\n this._bitmaps.clear();\n this.pendingCleanup = false;\n return true;\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 if (this._stats) {\n this._stats.timeEnd(\"Page Request\");\n }\n // TODO Refactor RenderPageRequest to separate rendering\n // and operator list logic\n if (intentState.displayReadyCapability) {\n intentState.displayReadyCapability.resolve(transparency);\n }\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\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();\n }\n }\n\n /**\n * @private\n */\n _pumpOperatorList({ renderingIntent, cacheKey }) {\n if (\n typeof PDFJSDev === \"undefined\" ||\n PDFJSDev.test(\"!PRODUCTION || TESTING\")\n ) {\n assert(\n Number.isInteger(renderingIntent) && renderingIntent > 0,\n '_pumpOperatorList: Expected valid \"renderingIntent\" argument.'\n );\n }\n\n const readableStream = this._transport.messageHandler.sendWithStream(\n \"GetOperatorList\",\n {\n pageIndex: this._pageIndex,\n intent: renderingIntent,\n cacheKey,\n annotationStorage:\n renderingIntent & RenderingIntentFlag.ANNOTATIONS_STORAGE\n ? this._transport.annotationStorage.serializable\n : null,\n }\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();\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 (\n typeof PDFJSDev === \"undefined\" ||\n PDFJSDev.test(\"!PRODUCTION || TESTING\")\n ) {\n assert(\n reason instanceof Error,\n '_abortOperatorList: Expected valid \"reason\" argument.'\n );\n }\n\n if (!intentState.streamReader) {\n return;\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 intentState.streamReaderCancelTimeout = setTimeout(() => {\n this._abortOperatorList({ intentState, reason, force: true });\n intentState.streamReaderCancelTimeout = null;\n }, RENDERING_CANCELLED_TIMEOUT);\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 {Object} Returns page stats, if enabled; returns `null` otherwise.\n */\n get stats() {\n return this._stats;\n }\n}\n\nclass LoopbackPort {\n constructor() {\n this._listeners = [];\n this._deferred = Promise.resolve();\n }\n\n postMessage(obj, transfers) {\n const event = {\n data: structuredClone(obj, transfers),\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.push(listener);\n }\n\n removeEventListener(name, listener) {\n const i = this._listeners.indexOf(listener);\n this._listeners.splice(i, 1);\n }\n\n terminate() {\n this._listeners.length = 0;\n }\n}\n\n/**\n * @typedef {Object} PDFWorkerParameters\n * @property {string} [name] - The name of the worker.\n * @property {Object} [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 fallbackWorkerSrc: null,\n fakeWorkerId: 0,\n};\nif (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"GENERIC\")) {\n // eslint-disable-next-line no-undef\n if (isNodeJS && typeof __non_webpack_require__ === \"function\") {\n // Workers aren't supported in Node.js, force-disabling them there.\n PDFWorkerUtil.isWorkerDisabled = true;\n\n PDFWorkerUtil.fallbackWorkerSrc = PDFJSDev.test(\"LIB\")\n ? \"../pdf.worker.js\"\n : \"./pdf.worker.js\";\n } else if (typeof document === \"object\") {\n const pdfjsFilePath = document?.currentScript?.src;\n if (pdfjsFilePath) {\n PDFWorkerUtil.fallbackWorkerSrc = pdfjsFilePath.replace(\n /(\\.(?:min\\.)?js)(\\?.*)?$/i,\n \".worker$1$2\"\n );\n }\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 (e) {\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 = `importScripts(\"${url}\");`;\n return URL.createObjectURL(new Blob([wrapper]));\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 = new WeakMap();\n\n constructor({\n name = null,\n port = null,\n verbosity = getVerbosityLevel(),\n } = {}) {\n if (port && PDFWorker.#workerPorts.has(port)) {\n throw new Error(\"Cannot use more than one PDFWorker per port.\");\n }\n\n this.name = name;\n this.destroyed = false;\n this.verbosity = verbosity;\n\n this._readyCapability = createPromiseCapability();\n this._port = null;\n this._webWorker = null;\n this._messageHandler = null;\n\n if (port) {\n PDFWorker.#workerPorts.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<void>}\n */\n get promise() {\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 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 }\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 typeof Worker !== \"undefined\" &&\n !PDFWorkerUtil.isWorkerDisabled &&\n !PDFWorker._mainThreadWorkerMessageHandler\n ) {\n let workerSrc = PDFWorker.workerSrc;\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 // Some versions of FF can't create a worker on localhost, see:\n // https://bugzilla.mozilla.org/show_bug.cgi?id=683280\n const worker = new Worker(workerSrc);\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 (e) {\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 (e) {\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 (!params?.port) {\n throw new Error(\"PDFWorker.fromPort - invalid method signature.\");\n }\n if (this.#workerPorts.has(params.port)) {\n return this.#workerPorts.get(params.port);\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 if (PDFWorkerUtil.fallbackWorkerSrc !== null) {\n if (!isNodeJS) {\n deprecated('No \"GlobalWorkerOptions.workerSrc\" specified.');\n }\n return PDFWorkerUtil.fallbackWorkerSrc;\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 (ex) {\n return null;\n }\n }\n\n // Loads worker code into the main-thread.\n static get _setupFakeWorkerGlobal() {\n const loader = async () => {\n const mainWorkerMessageHandler = this._mainThreadWorkerMessageHandler;\n\n if (mainWorkerMessageHandler) {\n // The worker was already loaded using e.g. a `<script>` tag.\n return mainWorkerMessageHandler;\n }\n if (typeof PDFJSDev === \"undefined\" || !PDFJSDev.test(\"PRODUCTION\")) {\n const worker = await import(\"pdfjs/core/worker.js\");\n return worker.WorkerMessageHandler;\n }\n if (\n PDFJSDev.test(\"GENERIC\") &&\n isNodeJS &&\n // eslint-disable-next-line no-undef\n typeof __non_webpack_require__ === \"function\"\n ) {\n // Since bundlers, such as Webpack, cannot be told to leave `require`\n // statements alone we are thus forced to jump through hoops in order\n // to prevent `Critical dependency: ...` warnings in third-party\n // deployments of the built `pdf.js`/`pdf.worker.js` files; see\n // https://github.com/webpack/webpack/issues/8826\n //\n // The following hack is based on the assumption that code running in\n // Node.js won't ever be affected by e.g. Content Security Policies that\n // prevent the use of `eval`. If that ever occurs, we should revert this\n // to a normal `__non_webpack_require__` statement and simply document\n // the Webpack warnings instead (telling users to ignore them).\n //\n // eslint-disable-next-line no-eval\n const worker = eval(\"require\")(this.workerSrc);\n return worker.WorkerMessageHandler;\n }\n await loadScript(this.workerSrc);\n return window.pdfjsWorker.WorkerMessageHandler;\n };\n\n return shadow(this, \"_setupFakeWorkerGlobal\", loader());\n }\n}\nif (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"GENERIC\")) {\n PDFWorker.getWorkerSrc = function () {\n deprecated(\n \"`PDFWorker.getWorkerSrc()`, please use `PDFWorker.workerSrc` instead.\"\n );\n return this.workerSrc;\n };\n}\n\n/**\n * For internal use only.\n * @ignore\n */\nclass WorkerTransport {\n #docStats = null;\n\n #pageCache = new Map();\n\n #pagePromises = new Map();\n\n #metadataPromise = null;\n\n constructor(messageHandler, loadingTask, networkStream, params) {\n this.messageHandler = messageHandler;\n this.loadingTask = loadingTask;\n this.commonObjs = new PDFObjects();\n this.fontLoader = new FontLoader({\n docId: loadingTask.docId,\n onUnsupportedFeature: this._onUnsupportedFeature.bind(this),\n ownerDocument: params.ownerDocument,\n styleElement: params.styleElement,\n });\n this._params = params;\n\n if (!params.useWorkerFetch) {\n this.CMapReaderFactory = new params.CMapReaderFactory({\n baseUrl: params.cMapUrl,\n isCompressed: params.cMapPacked,\n });\n this.StandardFontDataFactory = new params.StandardFontDataFactory({\n baseUrl: params.standardFontDataUrl,\n });\n }\n\n this.destroyed = false;\n this.destroyCapability = null;\n this._passwordCapability = null;\n\n this._networkStream = networkStream;\n this._fullReader = null;\n this._lastProgress = null;\n this.downloadInfoCapability = createPromiseCapability();\n\n this.setupMessageHandler();\n }\n\n get annotationStorage() {\n return shadow(this, \"annotationStorage\", new AnnotationStorage());\n }\n\n get stats() {\n return this.#docStats;\n }\n\n getRenderingIntent(\n intent,\n annotationMode = AnnotationMode.ENABLE,\n isOpList = false\n ) {\n let renderingIntent = RenderingIntentFlag.DISPLAY; // Default value.\n let annotationHash = \"\";\n\n switch (intent) {\n case \"any\":\n renderingIntent = RenderingIntentFlag.ANY;\n break;\n case \"display\":\n break;\n case \"print\":\n renderingIntent = RenderingIntentFlag.PRINT;\n break;\n default:\n warn(`getRenderingIntent - invalid intent: ${intent}`);\n }\n\n switch (annotationMode) {\n case AnnotationMode.DISABLE:\n renderingIntent += RenderingIntentFlag.ANNOTATIONS_DISABLE;\n break;\n case AnnotationMode.ENABLE:\n break;\n case AnnotationMode.ENABLE_FORMS:\n renderingIntent += RenderingIntentFlag.ANNOTATIONS_FORMS;\n break;\n case AnnotationMode.ENABLE_STORAGE:\n renderingIntent += RenderingIntentFlag.ANNOTATIONS_STORAGE;\n\n annotationHash = this.annotationStorage.hash;\n break;\n default:\n warn(`getRenderingIntent - invalid annotationMode: ${annotationMode}`);\n }\n\n if (isOpList) {\n renderingIntent += RenderingIntentFlag.OPLIST;\n }\n\n return {\n renderingIntent,\n cacheKey: `${renderingIntent}_${annotationHash}`,\n };\n }\n\n destroy() {\n if (this.destroyCapability) {\n return this.destroyCapability.promise;\n }\n\n this.destroyed = true;\n this.destroyCapability = createPromiseCapability();\n\n if (this._passwordCapability) {\n this._passwordCapability.reject(\n new Error(\"Worker was destroyed during onPassword callback\")\n );\n }\n\n const waitOn = [];\n // We need to wait for all renderings to be completed, e.g.\n // timeout/rAF can take a long time.\n for (const page of this.#pageCache.values()) {\n waitOn.push(page._destroy());\n }\n this.#pageCache.clear();\n this.#pagePromises.clear();\n // Allow `AnnotationStorage`-related clean-up when destroying the document.\n if (this.hasOwnProperty(\"annotationStorage\")) {\n this.annotationStorage.resetModified();\n }\n // We also need to wait for the worker to finish its long running tasks.\n const terminated = this.messageHandler.sendWithPromise(\"Terminate\", null);\n waitOn.push(terminated);\n\n Promise.all(waitOn).then(() => {\n this.commonObjs.clear();\n this.fontLoader.clear();\n this.#metadataPromise = null;\n this._getFieldObjectsPromise = null;\n this._hasJSActionsPromise = null;\n\n if (this._networkStream) {\n this._networkStream.cancelAllRequests(\n new AbortException(\"Worker was terminated.\")\n );\n }\n\n if (this.messageHandler) {\n this.messageHandler.destroy();\n this.messageHandler = null;\n }\n this.destroyCapability.resolve();\n }, this.destroyCapability.reject);\n return this.destroyCapability.promise;\n }\n\n setupMessageHandler() {\n const { messageHandler, loadingTask } = this;\n\n messageHandler.on(\"GetReader\", (data, sink) => {\n assert(\n this._networkStream,\n \"GetReader - no `IPDFStream` instance available.\"\n );\n this._fullReader = this._networkStream.getFullReader();\n this._fullReader.onProgress = evt => {\n this._lastProgress = {\n loaded: evt.loaded,\n total: evt.total,\n };\n };\n sink.onPull = () => {\n this._fullReader\n .read()\n .then(function ({ value, done }) {\n if (done) {\n sink.close();\n return;\n }\n assert(\n isArrayBuffer(value),\n \"GetReader - expected an ArrayBuffer.\"\n );\n // Enqueue data chunk into sink, and transfer it\n // to other side as `Transferable` object.\n sink.enqueue(new Uint8Array(value), 1, [value]);\n })\n .catch(reason => {\n sink.error(reason);\n });\n };\n\n sink.onCancel = reason => {\n this._fullReader.cancel(reason);\n\n sink.ready.catch(readyReason => {\n if (this.destroyed) {\n return; // Ignore any pending requests if the worker was terminated.\n }\n throw readyReason;\n });\n };\n });\n\n messageHandler.on(\"ReaderHeadersReady\", data => {\n const headersCapability = createPromiseCapability();\n const fullReader = this._fullReader;\n fullReader.headersReady.then(() => {\n // If stream or range are disabled, it's our only way to report\n // loading progress.\n if (!fullReader.isStreamingSupported || !fullReader.isRangeSupported) {\n if (this._lastProgress) {\n loadingTask.onProgress?.(this._lastProgress);\n }\n fullReader.onProgress = evt => {\n loadingTask.onProgress?.({\n loaded: evt.loaded,\n total: evt.total,\n });\n };\n }\n\n headersCapability.resolve({\n isStreamingSupported: fullReader.isStreamingSupported,\n isRangeSupported: fullReader.isRangeSupported,\n contentLength: fullReader.contentLength,\n });\n }, headersCapability.reject);\n\n return headersCapability.promise;\n });\n\n messageHandler.on(\"GetRangeReader\", (data, sink) => {\n assert(\n this._networkStream,\n \"GetRangeReader - no `IPDFStream` instance available.\"\n );\n const rangeReader = this._networkStream.getRangeReader(\n data.begin,\n data.end\n );\n\n // When streaming is enabled, it's possible that the data requested here\n // has already been fetched via the `_fullRequestReader` implementation.\n // However, given that the PDF data is loaded asynchronously on the\n // main-thread and then sent via `postMessage` to the worker-thread,\n // it may not have been available during parsing (hence the attempt to\n // use range requests here).\n //\n // To avoid wasting time and resources here, we'll thus *not* dispatch\n // range requests if the data was already loaded but has not been sent to\n // the worker-thread yet (which will happen via the `_fullRequestReader`).\n if (!rangeReader) {\n sink.close();\n return;\n }\n\n sink.onPull = () => {\n rangeReader\n .read()\n .then(function ({ value, done }) {\n if (done) {\n sink.close();\n return;\n }\n assert(\n isArrayBuffer(value),\n \"GetRangeReader - expected an ArrayBuffer.\"\n );\n sink.enqueue(new Uint8Array(value), 1, [value]);\n })\n .catch(reason => {\n sink.error(reason);\n });\n };\n\n sink.onCancel = reason => {\n rangeReader.cancel(reason);\n\n sink.ready.catch(readyReason => {\n if (this.destroyed) {\n return; // Ignore any pending requests if the worker was terminated.\n }\n throw readyReason;\n });\n };\n });\n\n messageHandler.on(\"GetDoc\", ({ pdfInfo }) => {\n this._numPages = pdfInfo.numPages;\n this._htmlForXfa = pdfInfo.htmlForXfa;\n delete pdfInfo.htmlForXfa;\n loadingTask._capability.resolve(new PDFDocumentProxy(pdfInfo, this));\n });\n\n messageHandler.on(\"DocException\", function (ex) {\n let reason;\n switch (ex.name) {\n case \"PasswordException\":\n reason = new PasswordException(ex.message, ex.code);\n break;\n case \"InvalidPDFException\":\n reason = new InvalidPDFException(ex.message);\n break;\n case \"MissingPDFException\":\n reason = new MissingPDFException(ex.message);\n break;\n case \"UnexpectedResponseException\":\n reason = new UnexpectedResponseException(ex.message, ex.status);\n break;\n case \"UnknownErrorException\":\n reason = new UnknownErrorException(ex.message, ex.details);\n break;\n default:\n unreachable(\"DocException - expected a valid Error.\");\n }\n loadingTask._capability.reject(reason);\n });\n\n messageHandler.on(\"PasswordRequest\", exception => {\n this._passwordCapability = createPromiseCapability();\n\n if (loadingTask.onPassword) {\n const updatePassword = password => {\n if (password instanceof Error) {\n this._passwordCapability.reject(password);\n } else {\n this._passwordCapability.resolve({ password });\n }\n };\n try {\n loadingTask.onPassword(updatePassword, exception.code);\n } catch (ex) {\n this._passwordCapability.reject(ex);\n }\n } else {\n this._passwordCapability.reject(\n new PasswordException(exception.message, exception.code)\n );\n }\n return this._passwordCapability.promise;\n });\n\n messageHandler.on(\"DataLoaded\", data => {\n // For consistency: Ensure that progress is always reported when the\n // entire PDF file has been loaded, regardless of how it was fetched.\n loadingTask.onProgress?.({\n loaded: data.length,\n total: data.length,\n });\n\n this.downloadInfoCapability.resolve(data);\n });\n\n messageHandler.on(\"StartRenderPage\", data => {\n if (this.destroyed) {\n return; // Ignore any pending requests if the worker was terminated.\n }\n\n const page = this.#pageCache.get(data.pageIndex);\n page._startRenderPage(data.transparency, data.cacheKey);\n });\n\n messageHandler.on(\"commonobj\", ([id, type, exportedData]) => {\n if (this.destroyed) {\n return; // Ignore any pending requests if the worker was terminated.\n }\n\n if (this.commonObjs.has(id)) {\n return;\n }\n\n switch (type) {\n case \"Font\":\n const params = this._params;\n\n if (\"error\" in exportedData) {\n const exportedError = exportedData.error;\n warn(`Error during font loading: ${exportedError}`);\n this.commonObjs.resolve(id, exportedError);\n break;\n }\n\n let fontRegistry = null;\n if (params.pdfBug && globalThis.FontInspector?.enabled) {\n fontRegistry = {\n registerFont(font, url) {\n globalThis.FontInspector.fontAdded(font, url);\n },\n };\n }\n const font = new FontFaceObject(exportedData, {\n isEvalSupported: params.isEvalSupported,\n disableFontFace: params.disableFontFace,\n ignoreErrors: params.ignoreErrors,\n onUnsupportedFeature: this._onUnsupportedFeature.bind(this),\n fontRegistry,\n });\n\n this.fontLoader\n .bind(font)\n .catch(reason => {\n return messageHandler.sendWithPromise(\"FontFallback\", { id });\n })\n .finally(() => {\n if (!params.fontExtraProperties && font.data) {\n // Immediately release the `font.data` property once the font\n // has been attached to the DOM, since it's no longer needed,\n // rather than waiting for a `PDFDocumentProxy.cleanup` call.\n // Since `font.data` could be very large, e.g. in some cases\n // multiple megabytes, this will help reduce memory usage.\n font.data = null;\n }\n this.commonObjs.resolve(id, font);\n });\n break;\n case \"FontPath\":\n case \"Image\":\n this.commonObjs.resolve(id, exportedData);\n break;\n default:\n throw new Error(`Got unknown common object type ${type}`);\n }\n });\n\n messageHandler.on(\"obj\", ([id, pageIndex, type, imageData]) => {\n if (this.destroyed) {\n // Ignore any pending requests if the worker was terminated.\n return;\n }\n\n const pageProxy = this.#pageCache.get(pageIndex);\n if (pageProxy.objs.has(id)) {\n return;\n }\n\n switch (type) {\n case \"Image\":\n pageProxy.objs.resolve(id, imageData);\n\n // Heuristic that will allow us not to store large data.\n const MAX_IMAGE_SIZE_TO_STORE = 8000000;\n if (imageData) {\n let length;\n if (imageData.bitmap) {\n const { bitmap, width, height } = imageData;\n length = width * height * 4;\n pageProxy._bitmaps.add(bitmap);\n } else {\n length = imageData.data?.length || 0;\n }\n\n if (length > MAX_IMAGE_SIZE_TO_STORE) {\n pageProxy.cleanupAfterRender = true;\n }\n }\n break;\n case \"Pattern\":\n pageProxy.objs.resolve(id, imageData);\n break;\n default:\n throw new Error(`Got unknown object type ${type}`);\n }\n });\n\n messageHandler.on(\"DocProgress\", data => {\n if (this.destroyed) {\n return; // Ignore any pending requests if the worker was terminated.\n }\n loadingTask.onProgress?.({\n loaded: data.loaded,\n total: data.total,\n });\n });\n\n messageHandler.on(\"DocStats\", data => {\n if (this.destroyed) {\n return; // Ignore any pending requests if the worker was terminated.\n }\n // Ensure that a `PDFDocumentProxy.stats` call-site cannot accidentally\n // modify this internal data.\n this.#docStats = Object.freeze({\n streamTypes: Object.freeze(data.streamTypes),\n fontTypes: Object.freeze(data.fontTypes),\n });\n });\n\n messageHandler.on(\n \"UnsupportedFeature\",\n this._onUnsupportedFeature.bind(this)\n );\n\n messageHandler.on(\"FetchBuiltInCMap\", data => {\n if (this.destroyed) {\n return Promise.reject(new Error(\"Worker was destroyed.\"));\n }\n if (!this.CMapReaderFactory) {\n return Promise.reject(\n new Error(\n \"CMapReaderFactory not initialized, see the `useWorkerFetch` parameter.\"\n )\n );\n }\n return this.CMapReaderFactory.fetch(data);\n });\n\n messageHandler.on(\"FetchStandardFontData\", data => {\n if (this.destroyed) {\n return Promise.reject(new Error(\"Worker was destroyed.\"));\n }\n if (!this.StandardFontDataFactory) {\n return Promise.reject(\n new Error(\n \"StandardFontDataFactory not initialized, see the `useWorkerFetch` parameter.\"\n )\n );\n }\n return this.StandardFontDataFactory.fetch(data);\n });\n }\n\n _onUnsupportedFeature({ featureId }) {\n if (this.destroyed) {\n return; // Ignore any pending requests if the worker was terminated.\n }\n this.loadingTask.onUnsupportedFeature?.(featureId);\n }\n\n getData() {\n return this.messageHandler.sendWithPromise(\"GetData\", null);\n }\n\n getPage(pageNumber) {\n if (\n !Number.isInteger(pageNumber) ||\n pageNumber <= 0 ||\n pageNumber > this._numPages\n ) {\n return Promise.reject(new Error(\"Invalid page request.\"));\n }\n\n const pageIndex = pageNumber - 1,\n cachedPromise = this.#pagePromises.get(pageIndex);\n if (cachedPromise) {\n return cachedPromise;\n }\n const promise = this.messageHandler\n .sendWithPromise(\"GetPage\", {\n pageIndex,\n })\n .then(pageInfo => {\n if (this.destroyed) {\n throw new Error(\"Transport destroyed\");\n }\n const page = new PDFPageProxy(\n pageIndex,\n pageInfo,\n this,\n this._params.ownerDocument,\n this._params.pdfBug\n );\n this.#pageCache.set(pageIndex, page);\n return page;\n });\n this.#pagePromises.set(pageIndex, promise);\n return promise;\n }\n\n getPageIndex(ref) {\n if (\n typeof ref !== \"object\" ||\n ref === null ||\n !Number.isInteger(ref.num) ||\n ref.num < 0 ||\n !Number.isInteger(ref.gen) ||\n ref.gen < 0\n ) {\n return Promise.reject(new Error(\"Invalid pageIndex request.\"));\n }\n return this.messageHandler.sendWithPromise(\"GetPageIndex\", {\n num: ref.num,\n gen: ref.gen,\n });\n }\n\n getAnnotations(pageIndex, intent) {\n return this.messageHandler.sendWithPromise(\"GetAnnotations\", {\n pageIndex,\n intent,\n });\n }\n\n saveDocument() {\n return this.messageHandler\n .sendWithPromise(\"SaveDocument\", {\n isPureXfa: !!this._htmlForXfa,\n numPages: this._numPages,\n annotationStorage: this.annotationStorage.serializable,\n filename: this._fullReader?.filename ?? null,\n })\n .finally(() => {\n this.annotationStorage.resetModified();\n });\n }\n\n getFieldObjects() {\n return (this._getFieldObjectsPromise ||=\n this.messageHandler.sendWithPromise(\"GetFieldObjects\", null));\n }\n\n hasJSActions() {\n return (this._hasJSActionsPromise ||= this.messageHandler.sendWithPromise(\n \"HasJSActions\",\n null\n ));\n }\n\n getCalculationOrderIds() {\n return this.messageHandler.sendWithPromise(\"GetCalculationOrderIds\", null);\n }\n\n getDestinations() {\n return this.messageHandler.sendWithPromise(\"GetDestinations\", null);\n }\n\n getDestination(id) {\n if (typeof id !== \"string\") {\n return Promise.reject(new Error(\"Invalid destination request.\"));\n }\n return this.messageHandler.sendWithPromise(\"GetDestination\", {\n id,\n });\n }\n\n getPageLabels() {\n return this.messageHandler.sendWithPromise(\"GetPageLabels\", null);\n }\n\n getPageLayout() {\n return this.messageHandler.sendWithPromise(\"GetPageLayout\", null);\n }\n\n getPageMode() {\n return this.messageHandler.sendWithPromise(\"GetPageMode\", null);\n }\n\n getViewerPreferences() {\n return this.messageHandler.sendWithPromise(\"GetViewerPreferences\", null);\n }\n\n getOpenAction() {\n return this.messageHandler.sendWithPromise(\"GetOpenAction\", null);\n }\n\n getAttachments() {\n return this.messageHandler.sendWithPromise(\"GetAttachments\", null);\n }\n\n getJavaScript() {\n return this.messageHandler.sendWithPromise(\"GetJavaScript\", null);\n }\n\n getDocJSActions() {\n return this.messageHandler.sendWithPromise(\"GetDocJSActions\", null);\n }\n\n getPageJSActions(pageIndex) {\n return this.messageHandler.sendWithPromise(\"GetPageJSActions\", {\n pageIndex,\n });\n }\n\n getStructTree(pageIndex) {\n return this.messageHandler.sendWithPromise(\"GetStructTree\", {\n pageIndex,\n });\n }\n\n getOutline() {\n return this.messageHandler.sendWithPromise(\"GetOutline\", null);\n }\n\n getOptionalContentConfig() {\n return this.messageHandler\n .sendWithPromise(\"GetOptionalContentConfig\", null)\n .then(results => {\n return new OptionalContentConfig(results);\n });\n }\n\n getPermissions() {\n return this.messageHandler.sendWithPromise(\"GetPermissions\", null);\n }\n\n getMetadata() {\n return (this.#metadataPromise ||= this.messageHandler\n .sendWithPromise(\"GetMetadata\", null)\n .then(results => {\n return {\n info: results[0],\n metadata: results[1] ? new Metadata(results[1]) : null,\n contentDispositionFilename: this._fullReader?.filename ?? null,\n contentLength: this._fullReader?.contentLength ?? null,\n };\n }));\n }\n\n getMarkInfo() {\n return this.messageHandler.sendWithPromise(\"GetMarkInfo\", null);\n }\n\n async startCleanup(keepLoadedFonts = false) {\n await this.messageHandler.sendWithPromise(\"Cleanup\", null);\n\n if (this.destroyed) {\n return; // No need to manually clean-up when destruction has started.\n }\n for (const page of this.#pageCache.values()) {\n const cleanupSuccessful = page.cleanup();\n\n if (!cleanupSuccessful) {\n throw new Error(\n `startCleanup: Page ${page.pageNumber} is currently rendering.`\n );\n }\n }\n this.commonObjs.clear();\n if (!keepLoadedFonts) {\n this.fontLoader.clear();\n }\n this.#metadataPromise = null;\n this._getFieldObjectsPromise = null;\n this._hasJSActionsPromise = null;\n }\n\n get loadingParams() {\n const params = this._params;\n return shadow(this, \"loadingParams\", {\n disableAutoFetch: params.disableAutoFetch,\n enableXfa: params.enableXfa,\n });\n }\n}\n\n/**\n * A PDF document and page is built of many objects. E.g. there are objects for\n * fonts, images, rendering code, etc. These objects may get processed inside of\n * a worker. This class implements some basic methods to manage these objects.\n */\nclass PDFObjects {\n #objs = Object.create(null);\n\n /**\n * Ensures there is an object defined for `objId`.\n *\n * @param {string} objId\n * @returns {Object}\n */\n #ensureObj(objId) {\n const obj = this.#objs[objId];\n if (obj) {\n return obj;\n }\n return (this.#objs[objId] = {\n capability: createPromiseCapability(),\n data: null,\n });\n }\n\n /**\n * If called *without* callback, this returns the data of `objId` but the\n * object needs to be resolved. If it isn't, this method throws.\n *\n * If called *with* a callback, the callback is called with the data of the\n * object once the object is resolved. That means, if you call this method\n * and the object is already resolved, the callback gets called right away.\n *\n * @param {string} objId\n * @param {function} [callback]\n * @returns {any}\n */\n get(objId, callback = null) {\n // If there is a callback, then the get can be async and the object is\n // not required to be resolved right now.\n if (callback) {\n const obj = this.#ensureObj(objId);\n obj.capability.promise.then(() => callback(obj.data));\n return null;\n }\n // If there isn't a callback, the user expects to get the resolved data\n // directly.\n const obj = this.#objs[objId];\n // If there isn't an object yet or the object isn't resolved, then the\n // data isn't ready yet!\n if (!obj?.capability.settled) {\n throw new Error(`Requesting object that isn't resolved yet ${objId}.`);\n }\n return obj.data;\n }\n\n /**\n * @param {string} objId\n * @returns {boolean}\n */\n has(objId) {\n const obj = this.#objs[objId];\n return obj?.capability.settled || false;\n }\n\n /**\n * Resolves the object `objId` with optional `data`.\n *\n * @param {string} objId\n * @param {any} [data]\n */\n resolve(objId, data = null) {\n const obj = this.#ensureObj(objId);\n obj.data = data;\n obj.capability.resolve();\n }\n\n clear() {\n this.#objs = Object.create(null);\n }\n}\n\n/**\n * Allows controlling of the rendering tasks.\n */\nclass RenderTask {\n constructor(internalRenderTask) {\n this._internalRenderTask = internalRenderTask;\n\n /**\n * Callback for incremental rendering -- a function that will be called\n * each time the rendering is paused. To continue rendering call the\n * function that is the first argument to the callback.\n * @type {function}\n */\n this.onContinue = null;\n }\n\n /**\n * Promise for rendering task completion.\n * @type {Promise<void>}\n */\n get promise() {\n return this._internalRenderTask.capability.promise;\n }\n\n /**\n * Cancels the rendering task. If the task is currently rendering it will\n * not be cancelled until graphics pauses with a timeout. The promise that\n * this object extends will be rejected when cancelled.\n */\n cancel() {\n this._internalRenderTask.cancel();\n }\n}\n\n/**\n * For internal use only.\n * @ignore\n */\nclass InternalRenderTask {\n static #canvasInUse = new WeakSet();\n\n constructor({\n callback,\n params,\n objs,\n commonObjs,\n annotationCanvasMap,\n operatorList,\n pageIndex,\n canvasFactory,\n useRequestAnimationFrame = false,\n pdfBug = false,\n pageColors = null,\n }) {\n this.callback = callback;\n this.params = params;\n this.objs = objs;\n this.commonObjs = commonObjs;\n this.annotationCanvasMap = annotationCanvasMap;\n this.operatorListIdx = null;\n this.operatorList = operatorList;\n this._pageIndex = pageIndex;\n this.canvasFactory = canvasFactory;\n this._pdfBug = pdfBug;\n this.pageColors = pageColors;\n\n this.running = false;\n this.graphicsReadyCallback = null;\n this.graphicsReady = false;\n this._useRequestAnimationFrame =\n useRequestAnimationFrame === true && typeof window !== \"undefined\";\n this.cancelled = false;\n this.capability = createPromiseCapability();\n this.task = new RenderTask(this);\n // caching this-bound methods\n this._cancelBound = this.cancel.bind(this);\n this._continueBound = this._continue.bind(this);\n this._scheduleNextBound = this._scheduleNext.bind(this);\n this._nextBound = this._next.bind(this);\n this._canvas = params.canvasContext.canvas;\n }\n\n get completed() {\n return this.capability.promise.catch(function () {\n // Ignoring errors, since we only want to know when rendering is\n // no longer pending.\n });\n }\n\n initializeGraphics({ transparency = false, optionalContentConfig }) {\n if (this.cancelled) {\n return;\n }\n if (this._canvas) {\n if (InternalRenderTask.#canvasInUse.has(this._canvas)) {\n throw new Error(\n \"Cannot use the same canvas during multiple render() operations. \" +\n \"Use different canvas or ensure previous operations were \" +\n \"cancelled or completed.\"\n );\n }\n InternalRenderTask.#canvasInUse.add(this._canvas);\n }\n\n if (this._pdfBug && globalThis.StepperManager?.enabled) {\n this.stepper = globalThis.StepperManager.create(this._pageIndex);\n this.stepper.init(this.operatorList);\n this.stepper.nextBreakPoint = this.stepper.getNextBreakPoint();\n }\n const { canvasContext, viewport, transform, imageLayer, background } =\n this.params;\n\n this.gfx = new CanvasGraphics(\n canvasContext,\n this.commonObjs,\n this.objs,\n this.canvasFactory,\n imageLayer,\n optionalContentConfig,\n this.annotationCanvasMap,\n this.pageColors\n );\n this.gfx.beginDrawing({\n transform,\n viewport,\n transparency,\n background,\n });\n this.operatorListIdx = 0;\n this.graphicsReady = true;\n if (this.graphicsReadyCallback) {\n this.graphicsReadyCallback();\n }\n }\n\n cancel(error = null) {\n this.running = false;\n this.cancelled = true;\n if (this.gfx) {\n this.gfx.endDrawing();\n }\n if (this._canvas) {\n InternalRenderTask.#canvasInUse.delete(this._canvas);\n }\n this.callback(\n error ||\n new RenderingCancelledException(\n `Rendering cancelled, page ${this._pageIndex + 1}`,\n \"canvas\"\n )\n );\n }\n\n operatorListChanged() {\n if (!this.graphicsReady) {\n if (!this.graphicsReadyCallback) {\n this.graphicsReadyCallback = this._continueBound;\n }\n return;\n }\n\n if (this.stepper) {\n this.stepper.updateOperatorList(this.operatorList);\n }\n\n if (this.running) {\n return;\n }\n this._continue();\n }\n\n _continue() {\n this.running = true;\n if (this.cancelled) {\n return;\n }\n if (this.task.onContinue) {\n this.task.onContinue(this._scheduleNextBound);\n } else {\n this._scheduleNext();\n }\n }\n\n _scheduleNext() {\n if (this._useRequestAnimationFrame) {\n window.requestAnimationFrame(() => {\n this._nextBound().catch(this._cancelBound);\n });\n } else {\n Promise.resolve().then(this._nextBound).catch(this._cancelBound);\n }\n }\n\n async _next() {\n if (this.cancelled) {\n return;\n }\n this.operatorListIdx = this.gfx.executeOperatorList(\n this.operatorList,\n this.operatorListIdx,\n this._continueBound,\n this.stepper\n );\n if (this.operatorListIdx === this.operatorList.argsArray.length) {\n this.running = false;\n if (this.operatorList.lastChunk) {\n this.gfx.endDrawing();\n if (this._canvas) {\n InternalRenderTask.#canvasInUse.delete(this._canvas);\n }\n this.callback();\n }\n }\n }\n}\n\n/** @type {string} */\nconst version =\n typeof PDFJSDev !== \"undefined\" ? PDFJSDev.eval(\"BUNDLE_VERSION\") : null;\n/** @type {string} */\nconst build =\n typeof PDFJSDev !== \"undefined\" ? PDFJSDev.eval(\"BUNDLE_BUILD\") : null;\n\nexport {\n build,\n DefaultCanvasFactory,\n DefaultCMapReaderFactory,\n DefaultStandardFontDataFactory,\n getDocument,\n LoopbackPort,\n PDFDataRangeTransport,\n PDFDocumentLoadingTask,\n PDFDocumentProxy,\n PDFPageProxy,\n PDFWorker,\n PDFWorkerUtil,\n RenderTask,\n setPDFNetworkStreamFactory,\n version,\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 BaseStandardFontDataFactory,\n BaseSVGFactory,\n} from \"./base_factory.js\";\nimport { BaseException, stringToBytes, Util, warn } 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\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, asTypedArray = false) {\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 return asTypedArray\n ? new Uint8Array(await response.arrayBuffer())\n : stringToBytes(await 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, /* asTypedArray = */ true);\n\n if (asTypedArray) {\n request.responseType = \"arraybuffer\";\n }\n request.onreadystatechange = () => {\n if (request.readyState !== XMLHttpRequest.DONE) {\n return;\n }\n if (request.status === 200 || request.status === 0) {\n let data;\n if (asTypedArray && request.response) {\n data = new Uint8Array(request.response);\n } else if (!asTypedArray && request.responseText) {\n data = stringToBytes(request.responseText);\n }\n if (data) {\n resolve(data);\n return;\n }\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(url, /* asTypedArray = */ this.isCompressed).then(data => {\n return { cMapData: data, compressionType };\n });\n }\n}\n\nclass DOMStandardFontDataFactory extends BaseStandardFontDataFactory {\n /**\n * @ignore\n */\n _fetchData(url) {\n return fetchData(url, /* asTypedArray = */ true);\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<number>} 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 = Math.abs(viewBox[3] - viewBox[1]) * scale;\n height = Math.abs(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 = Math.abs(viewBox[2] - viewBox[0]) * scale;\n height = Math.abs(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 * 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 {Object} Object containing `x` and `y` properties 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 {Object} Object containing `x` and `y` properties 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, type) {\n super(msg, \"RenderingCancelledException\");\n this.type = type;\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 const anchor = url.indexOf(\"#\");\n const query = url.indexOf(\"?\");\n const end = Math.min(\n anchor > 0 ? anchor : url.length,\n query > 0 ? query : url.length\n );\n return url.substring(url.lastIndexOf(\"/\", end) + 1, end);\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 (ex) {\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 constructor() {\n this.started = Object.create(null);\n this.times = [];\n }\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 time of this.times) {\n const name = time.name;\n if (name.length > longest) {\n longest = name.length;\n }\n }\n for (const time of this.times) {\n const duration = time.end - time.start;\n outBuf.push(`${time.name.padEnd(longest)} ${duration}ms\\n`);\n }\n return outBuf.join(\"\");\n }\n}\n\nfunction isValidFetchUrl(url, baseUrl) {\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 (ex) {\n return false; // `new URL()` will throw on incorrect data.\n }\n}\n\n/**\n * @param {string} src\n * @param {boolean} [removeScriptElement]\n * @returns {Promise<void>}\n */\nfunction loadScript(src, removeScriptElement = false) {\n return new Promise((resolve, reject) => {\n const script = document.createElement(\"script\");\n script.src = src;\n\n script.onload = function (evt) {\n if (removeScriptElement) {\n script.remove();\n }\n resolve(evt);\n };\n script.onerror = function () {\n reject(new Error(`Cannot load script at: ${script.src}`));\n };\n (document.head || document.documentElement).appendChild(script);\n });\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 if (!pdfDateStringRegex) {\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\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\nexport {\n deprecated,\n DOMCanvasFactory,\n DOMCMapReaderFactory,\n DOMStandardFontDataFactory,\n DOMSVGFactory,\n getFilenameFromUrl,\n getPdfFilenameFromUrl,\n getXfaPageViewport,\n isDataScheme,\n isPdfFile,\n isValidFetchUrl,\n loadScript,\n PageViewport,\n PDFDateString,\n PixelsPerInch,\n RenderingCancelledException,\n StatTimer,\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 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 = false }) {\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) {\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 svg.setAttribute(\"width\", `${width}px`);\n svg.setAttribute(\"height\", `${height}px`);\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 BaseStandardFontDataFactory,\n BaseSVGFactory,\n};\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 FeatureTest,\n shadow,\n string32,\n unreachable,\n UNSUPPORTED_FEATURES,\n warn,\n} from \"../shared/util.js\";\n\nclass BaseFontLoader {\n constructor({\n docId,\n onUnsupportedFeature,\n ownerDocument = globalThis.document,\n // For testing only.\n styleElement = null,\n }) {\n if (this.constructor === BaseFontLoader) {\n unreachable(\"Cannot initialize BaseFontLoader.\");\n }\n this.docId = docId;\n this._onUnsupportedFeature = onUnsupportedFeature;\n this._document = ownerDocument;\n\n this.nativeFontFaces = [];\n this.styleElement =\n typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"!PRODUCTION || TESTING\")\n ? styleElement\n : null;\n }\n\n addNativeFontFace(nativeFontFace) {\n this.nativeFontFaces.push(nativeFontFace);\n this._document.fonts.add(nativeFontFace);\n }\n\n insertRule(rule) {\n let styleElement = this.styleElement;\n if (!styleElement) {\n styleElement = this.styleElement = this._document.createElement(\"style\");\n styleElement.id = `PDFJS_FONT_STYLE_TAG_${this.docId}`;\n this._document.documentElement\n .getElementsByTagName(\"head\")[0]\n .appendChild(styleElement);\n }\n const styleSheet = 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.length = 0;\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 bind(font) {\n // Add the font to the DOM only once; skip if the font is already loaded.\n if (font.attached || font.missingFile) {\n return;\n }\n font.attached = true;\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 this._onUnsupportedFeature({\n featureId: UNSUPPORTED_FEATURES.errorFontLoadNative,\n });\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 await new Promise(resolve => {\n const request = this._queueLoadingCallback(resolve);\n this._prepareFontLoadEvent([rule], [font], request);\n });\n // The font was, asynchronously, loaded.\n }\n }\n\n _queueLoadingCallback(callback) {\n unreachable(\"Abstract method `_queueLoadingCallback`.\");\n }\n\n get isFontLoadingAPISupported() {\n const hasFonts = !!this._document?.fonts;\n if (\n typeof PDFJSDev === \"undefined\" ||\n PDFJSDev.test(\"!PRODUCTION || TESTING\")\n ) {\n return shadow(\n this,\n \"isFontLoadingAPISupported\",\n hasFonts && !this.styleElement\n );\n }\n return shadow(this, \"isFontLoadingAPISupported\", hasFonts);\n }\n\n // eslint-disable-next-line getter-return\n get isSyncFontLoadingSupported() {\n unreachable(\"Abstract method `isSyncFontLoadingSupported`.\");\n }\n\n // eslint-disable-next-line getter-return\n get _loadTestFont() {\n unreachable(\"Abstract method `_loadTestFont`.\");\n }\n\n _prepareFontLoadEvent(rules, fontsToLoad, request) {\n unreachable(\"Abstract method `_prepareFontLoadEvent`.\");\n }\n}\n\nlet FontLoader;\nif (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) {\n FontLoader = class MozcentralFontLoader extends BaseFontLoader {\n get isSyncFontLoadingSupported() {\n return shadow(this, \"isSyncFontLoadingSupported\", true);\n }\n };\n} else {\n // PDFJSDev.test('CHROME || GENERIC')\n\n FontLoader = class GenericFontLoader extends BaseFontLoader {\n constructor(params) {\n super(params);\n this.loadingContext = {\n requests: [],\n nextRequestId: 0,\n };\n this.loadTestFontId = 0;\n }\n\n get isSyncFontLoadingSupported() {\n let supported = false;\n if (typeof PDFJSDev === \"undefined\" || !PDFJSDev.test(\"CHROME\")) {\n if (typeof navigator === \"undefined\") {\n // Node.js - we can pretend that sync font loading is supported.\n supported = true;\n } else {\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 const m = /Mozilla\\/5.0.*?rv:(\\d+).*? Gecko/.exec(\n navigator.userAgent\n );\n if (m?.[1] >= 14) {\n supported = true;\n }\n // TODO - other browsers...\n }\n }\n return shadow(this, \"isSyncFontLoadingSupported\", supported);\n }\n\n _queueLoadingCallback(callback) {\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 (context.requests.length > 0 && context.requests[0].done) {\n const otherRequest = context.requests.shift();\n setTimeout(otherRequest.callback, 0);\n }\n }\n\n const context = this.loadingContext;\n const request = {\n id: `pdfjs-font-loading-${context.nextRequestId++}`,\n done: false,\n complete: completeRequest,\n callback,\n };\n context.requests.push(request);\n return request;\n }\n\n get _loadTestFont() {\n const getLoadTestFont = function () {\n // This is a CFF font with 1 glyph for '.' that fills its entire width\n // and height.\n return atob(\n \"T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQA\" +\n \"FQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAA\" +\n \"ALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgA\" +\n \"AAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1\" +\n \"AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD\" +\n \"6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACM\" +\n \"AooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4D\" +\n \"IP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAA\" +\n \"AAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUA\" +\n \"AQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgAB\" +\n \"AAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABY\" +\n \"AAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAA\" +\n \"AC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\" +\n \"AAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\" +\n \"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\" +\n \"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\" +\n \"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\" +\n \"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAA\" +\n \"AAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQAC\" +\n \"AQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3\" +\n \"Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTj\" +\n \"FQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA==\"\n );\n };\n return shadow(this, \"_loadTestFont\", getLoadTestFont());\n }\n\n _prepareFontLoadEvent(rules, fonts, request) {\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 called++;\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 =\n (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 names = [];\n for (const font of fonts) {\n names.push(font.loadedName);\n }\n names.push(loadTestFontId);\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 names) {\n const span = this._document.createElement(\"span\");\n span.textContent = \"Hi\";\n span.style.fontFamily = name;\n div.appendChild(span);\n }\n this._document.body.appendChild(div);\n\n isFontReady(loadTestFontId, () => {\n div.remove();\n request.complete();\n });\n /** Hack end */\n }\n };\n} // End of PDFJSDev.test('CHROME || GENERIC')\n\nclass FontFaceObject {\n constructor(\n translatedData,\n {\n isEvalSupported = true,\n disableFontFace = false,\n ignoreErrors = false,\n onUnsupportedFeature,\n fontRegistry = null,\n }\n ) {\n this.compiledGlyphs = Object.create(null);\n // importing translated data\n for (const i in translatedData) {\n this[i] = translatedData[i];\n }\n this.isEvalSupported = isEvalSupported !== false;\n this.disableFontFace = disableFontFace === true;\n this.ignoreErrors = ignoreErrors === true;\n this._onUnsupportedFeature = onUnsupportedFeature;\n this.fontRegistry = fontRegistry;\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 if (this.fontRegistry) {\n this.fontRegistry.registerFont(this);\n }\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 if (this.fontRegistry) {\n this.fontRegistry.registerFont(this, url);\n }\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 if (!this.ignoreErrors) {\n throw ex;\n }\n this._onUnsupportedFeature({\n featureId: UNSUPPORTED_FEATURES.errorFontGetPath,\n });\n warn(`getPathGenerator - ignoring character: \"${ex}\".`);\n\n return (this.compiledGlyphs[character] = function (c, size) {\n // No-op function, to allow rendering to continue.\n });\n }\n\n // If we can, compile cmds into JS for MAXIMUM SPEED...\n if (this.isEvalSupported && FeatureTest.isEvalSupported) {\n const jsBuf = [];\n for (const current of cmds) {\n const args = current.args !== undefined ? current.args.join(\",\") : \"\";\n jsBuf.push(\"c.\", current.cmd, \"(\", args, \");\\n\");\n }\n // eslint-disable-next-line no-new-func\n return (this.compiledGlyphs[character] = new Function(\n \"c\",\n \"size\",\n jsBuf.join(\"\")\n ));\n }\n // ... but fall back on using Function.prototype.apply() if we're\n // blocked from using eval() for whatever reason (like CSP policies).\n return (this.compiledGlyphs[character] = function (c, size) {\n for (const current of cmds) {\n if (current.cmd === \"scale\") {\n current.args = [size, -size];\n }\n c[current.cmd].apply(c, current.args);\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 { MurmurHash3_64 } from \"../shared/murmurhash3.js\";\nimport { objectFromMap } from \"../shared/util.js\";\n\n/**\n * Key/value storage for annotation data in forms.\n */\nclass AnnotationStorage {\n constructor() {\n this._storage = new Map();\n this._modified = false;\n\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 }\n\n /**\n * Get the value for a given key if it exists, or return the default value.\n *\n * @public\n * @memberof AnnotationStorage\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 *\n * @public\n * @memberof AnnotationStorage\n * @param {string} key\n * @returns {Object}\n */\n getRawValue(key) {\n return this._storage.get(key);\n }\n\n /**\n * Set the value for a given key\n *\n * @public\n * @memberof AnnotationStorage\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\n getAll() {\n return this._storage.size > 0 ? objectFromMap(this._storage) : null;\n }\n\n get size() {\n return this._storage.size;\n }\n\n /**\n * @private\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 * PLEASE NOTE: Only intended for usage within the API itself.\n * @ignore\n */\n get serializable() {\n return this._storage.size > 0 ? this._storage : null;\n }\n\n /**\n * PLEASE NOTE: Only intended for usage within the API itself.\n * @ignore\n */\n get hash() {\n const hash = new MurmurHash3_64();\n\n for (const [key, value] of this._storage) {\n hash.update(`${key}:${JSON.stringify(value)}`);\n }\n return hash.hexdigest();\n }\n}\n\nexport { AnnotationStorage };\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\nimport { isArrayBuffer } from \"./util.js\";\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 (isArrayBuffer(input)) {\n data = input.slice();\n length = data.byteLength;\n } else {\n throw new Error(\n \"Wrong data format in MurmurHash3_64_update. \" +\n \"Input must be a string or array.\"\n );\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 const hex1 = (h1 >>> 0).toString(16),\n hex2 = (h2 >>> 0).toString(16);\n return hex1.padStart(8, \"0\") + hex2.padStart(8, \"0\");\n }\n}\n\nexport { MurmurHash3_64 };\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 OPS,\n shadow,\n TextRenderingMode,\n unreachable,\n Util,\n warn,\n} from \"../shared/util.js\";\nimport {\n getShadingPattern,\n PathType,\n TilingPattern,\n} from \"./pattern_helper.js\";\nimport { applyMaskImageData } from \"../shared/image_utils.js\";\nimport { isNodeJS } from \"../shared/is_node.js\";\nimport { PixelsPerInch } from \"./display_utils.js\";\n\n// <canvas> 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;\nconst MAX_GROUP_SIZE = 4096;\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\nconst COMPILE_TYPE3_GLYPHS = true;\nconst MAX_SIZE_TO_COMPILE = 1000;\n\nconst FULL_CHUNK_HEIGHT = 16;\n\n// Because of https://bugs.chromium.org/p/chromium/issues/detail?id=1170396\n// some curves aren't rendered correctly.\n// Multiplying lineWidth by this factor should help to have \"correct\"\n// rendering with no artifacts.\n// Once the bug is fixed upstream, we can remove this constant and its use.\nconst LINEWIDTH_SCALE_FACTOR = 1.000001;\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\nfunction addContextCurrentTransform(ctx) {\n if (ctx._transformStack) {\n // Reset the transform stack.\n ctx._transformStack = [];\n }\n // If the context doesn't expose a `mozCurrentTransform`, add a JS based one.\n if (ctx.mozCurrentTransform) {\n return;\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\n ctx._transformMatrix = ctx._transformMatrix || [1, 0, 0, 1, 0, 0];\n ctx._transformStack = [];\n\n try {\n // The call to getOwnPropertyDescriptor throws an exception in Node.js:\n // \"TypeError: Method lineWidth called on incompatible receiver\n // #<CanvasRenderingContext2D>\".\n const desc = Object.getOwnPropertyDescriptor(\n Object.getPrototypeOf(ctx),\n \"lineWidth\"\n );\n\n ctx._setLineWidth = desc.set;\n ctx._getLineWidth = desc.get;\n\n Object.defineProperty(ctx, \"lineWidth\", {\n set: function setLineWidth(width) {\n this._setLineWidth(width * LINEWIDTH_SCALE_FACTOR);\n },\n get: function getLineWidth() {\n return this._getLineWidth();\n },\n });\n } catch (_) {}\n\n Object.defineProperty(ctx, \"mozCurrentTransform\", {\n get: function getCurrentTransform() {\n return this._transformMatrix;\n },\n });\n\n Object.defineProperty(ctx, \"mozCurrentTransformInverse\", {\n get: function getCurrentTransformInverse() {\n // Calculation done using WolframAlpha:\n // http://www.wolframalpha.com/input/?\n // i=Inverse+{{a%2C+c%2C+e}%2C+{b%2C+d%2C+f}%2C+{0%2C+0%2C+1}}\n\n const [a, b, c, d, e, f] = this._transformMatrix;\n const ad_bc = a * d - b * c;\n const bc_ad = b * c - a * d;\n\n return [\n d / ad_bc,\n b / bc_ad,\n c / bc_ad,\n a / ad_bc,\n (d * e - c * f) / bc_ad,\n (b * e - a * f) / ad_bc,\n ];\n },\n });\n\n ctx.save = function ctxSave() {\n const old = this._transformMatrix;\n this._transformStack.push(old);\n this._transformMatrix = old.slice(0, 6);\n\n this._originalSave();\n };\n\n ctx.restore = function ctxRestore() {\n if (this._transformStack.length === 0) {\n warn(\"Tried to restore a ctx when the stack was already empty.\");\n }\n const prev = this._transformStack.pop();\n if (prev) {\n this._transformMatrix = prev;\n this._originalRestore();\n }\n };\n\n ctx.translate = function ctxTranslate(x, y) {\n const m = this._transformMatrix;\n m[4] = m[0] * x + m[2] * y + m[4];\n m[5] = m[1] * x + m[3] * y + m[5];\n\n this._originalTranslate(x, y);\n };\n\n ctx.scale = function ctxScale(x, y) {\n const m = this._transformMatrix;\n m[0] *= x;\n m[1] *= x;\n m[2] *= y;\n m[3] *= y;\n\n this._originalScale(x, y);\n };\n\n ctx.transform = function ctxTransform(a, b, c, d, e, f) {\n const m = this._transformMatrix;\n this._transformMatrix = [\n m[0] * a + m[2] * b,\n m[1] * a + m[3] * b,\n m[0] * c + m[2] * d,\n m[1] * c + m[3] * d,\n m[0] * e + m[2] * f + m[4],\n m[1] * e + m[3] * f + m[5],\n ];\n\n ctx._originalTransform(a, b, c, d, e, f);\n };\n\n ctx.setTransform = function ctxSetTransform(a, b, c, d, e, f) {\n this._transformMatrix = [a, b, c, d, e, f];\n\n ctx._originalSetTransform(a, b, c, d, e, f);\n };\n\n ctx.resetTransform = function ctxResetTransform() {\n this._transformMatrix = [1, 0, 0, 1, 0, 0];\n\n ctx._originalResetTransform();\n };\n\n ctx.rotate = function ctxRotate(angle) {\n const cosValue = Math.cos(angle);\n const sinValue = Math.sin(angle);\n\n const m = this._transformMatrix;\n this._transformMatrix = [\n m[0] * cosValue + m[2] * sinValue,\n m[1] * cosValue + m[3] * sinValue,\n m[0] * -sinValue + m[2] * cosValue,\n m[1] * -sinValue + m[3] * cosValue,\n m[4],\n m[5],\n ];\n\n this._originalRotate(angle);\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, trackTransform) {\n let canvasEntry;\n if (this.cache[id] !== undefined) {\n canvasEntry = this.cache[id];\n this.canvasFactory.reset(canvasEntry, width, height);\n // reset canvas transform for emulated mozCurrentTransform, if needed\n canvasEntry.context.setTransform(1, 0, 0, 1, 0, 0);\n } else {\n canvasEntry = this.canvasFactory.create(width, height);\n this.cache[id] = canvasEntry;\n }\n if (trackTransform) {\n addContextCurrentTransform(canvasEntry.context);\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] = ctx.mozCurrentTransform;\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 (\n !COMPILE_TYPE3_GLYPHS ||\n width > MAX_SIZE_TO_COMPILE ||\n height > MAX_SIZE_TO_COMPILE\n ) {\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 let path, outlines, coords;\n if (!isNodeJS) {\n path = new Path2D();\n } else {\n outlines = [];\n }\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\n if (path) {\n path.moveTo(p % width1, i);\n } else {\n coords = [p % width1, i];\n }\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\n if (path) {\n path.lineTo(p % width1, (p / width1) | 0);\n } else {\n coords.push(p % width1, (p / width1) | 0);\n }\n\n if (!points[p]) {\n --count;\n }\n } while (p0 !== p);\n\n if (!path) {\n outlines.push(coords);\n }\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 if (path) {\n c.fill(path);\n } else {\n c.beginPath();\n for (const o of outlines) {\n c.moveTo(o[0], o[1]);\n for (let l = 2, ll = o.length; l < ll; l += 2) {\n c.lineTo(o[l], o[l + 1]);\n }\n }\n c.fill();\n }\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 = null;\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 this.minX = Math.min(this.minX, p1[0], p2[0]);\n this.minY = Math.min(this.minY, p1[1], p2[1]);\n this.maxX = Math.max(this.maxX, p1[0], p2[0]);\n this.maxY = Math.max(this.maxY, p1[1], p2[1]);\n }\n\n updateScalingPathMinMax(transform, minMax) {\n Util.scaleMinMax(transform, minMax);\n this.minX = Math.min(this.minX, minMax[0]);\n this.maxX = Math.max(this.maxX, minMax[1]);\n this.minY = Math.min(this.minY, 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);\n if (minMax) {\n minMax[0] = Math.min(minMax[0], box[0], box[2]);\n minMax[1] = Math.max(minMax[1], box[0], box[2]);\n minMax[2] = Math.min(minMax[2], box[1], box[3]);\n minMax[3] = Math.max(minMax[3], box[1], box[3]);\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, transferMaps = null) {\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 let transferMapRed, transferMapGreen, transferMapBlue, transferMapGray;\n if (transferMaps) {\n switch (transferMaps.length) {\n case 1:\n transferMapRed = transferMaps[0];\n transferMapGreen = transferMaps[0];\n transferMapBlue = transferMaps[0];\n transferMapGray = transferMaps[0];\n break;\n case 4:\n transferMapRed = transferMaps[0];\n transferMapGreen = transferMaps[1];\n transferMapBlue = transferMaps[2];\n transferMapGray = transferMaps[3];\n break;\n }\n }\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 let white = 0xffffffff;\n let black = FeatureTest.isLittleEndian ? 0xff000000 : 0x000000ff;\n\n if (transferMapGray) {\n if (transferMapGray[0] === 0xff && transferMapGray[0xff] === 0) {\n [white, black] = [black, white];\n }\n }\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 const hasTransferMaps = !!(\n transferMapRed ||\n transferMapGreen ||\n transferMapBlue\n );\n\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 if (hasTransferMaps) {\n for (let k = 0; k < elemsInThisChunk; k += 4) {\n if (transferMapRed) {\n dest[k + 0] = transferMapRed[dest[k + 0]];\n }\n if (transferMapGreen) {\n dest[k + 1] = transferMapGreen[dest[k + 1]];\n }\n if (transferMapBlue) {\n dest[k + 2] = transferMapBlue[dest[k + 2]];\n }\n }\n }\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 if (hasTransferMaps) {\n for (let k = 0; k < elemsInThisChunk; k += 4) {\n if (transferMapRed) {\n dest[k + 0] = transferMapRed[dest[k + 0]];\n }\n if (transferMapGreen) {\n dest[k + 1] = transferMapGreen[dest[k + 1]];\n }\n if (transferMapBlue) {\n dest[k + 2] = transferMapBlue[dest[k + 2]];\n }\n }\n }\n\n ctx.putImageData(chunkImgData, 0, j);\n }\n } else if (imgData.kind === ImageKind.RGB_24BPP) {\n // RGB, 24-bits per pixel.\n const hasTransferMaps = !!(\n transferMapRed ||\n transferMapGreen ||\n transferMapBlue\n );\n\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 if (hasTransferMaps) {\n for (let k = 0; k < destPos; k += 4) {\n if (transferMapRed) {\n dest[k + 0] = transferMapRed[dest[k + 0]];\n }\n if (transferMapGreen) {\n dest[k + 1] = transferMapGreen[dest[k + 1]];\n }\n if (transferMapBlue) {\n dest[k + 2] = transferMapBlue[dest[k + 2]];\n }\n }\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 } = applyMaskImageData({\n src,\n srcPos,\n dest,\n width,\n height: thisChunkHeight,\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 ];\n for (let i = 0, ii = properties.length; i < ii; i++) {\n const property = properties[i];\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, foregroundColor) {\n ctx.strokeStyle = ctx.fillStyle = foregroundColor || \"#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}\n\nfunction composeSMaskBackdrop(bytes, r0, g0, b0) {\n const length = bytes.length;\n for (let i = 3; i < length; i += 4) {\n const alpha = bytes[i];\n if (alpha === 0) {\n bytes[i - 3] = r0;\n bytes[i - 2] = g0;\n bytes[i - 1] = b0;\n } else if (alpha < 255) {\n const alpha_ = 255 - alpha;\n bytes[i - 3] = (bytes[i - 3] * alpha + r0 * alpha_) >> 8;\n bytes[i - 2] = (bytes[i - 2] * alpha + g0 * alpha_) >> 8;\n bytes[i - 1] = (bytes[i - 1] * alpha + b0 * alpha_) >> 8;\n }\n }\n}\n\nfunction composeSMaskAlpha(maskData, layerData, transferMap) {\n const length = maskData.length;\n const scale = 1 / 255;\n for (let i = 3; i < length; i += 4) {\n const alpha = transferMap ? transferMap[maskData[i]] : maskData[i];\n layerData[i] = (layerData[i] * alpha * scale) | 0;\n }\n}\n\nfunction composeSMaskLuminosity(maskData, layerData, transferMap) {\n const length = maskData.length;\n for (let i = 3; i < length; i += 4) {\n const y =\n maskData[i - 3] * 77 + // * 0.3 / 255 * 0x10000\n maskData[i - 2] * 152 + // * 0.59 ....\n maskData[i - 1] * 28; // * 0.11 ....\n layerData[i] = transferMap\n ? (layerData[i] * transferMap[y >> 8]) >> 8\n : (layerData[i] * y) >> 16;\n }\n}\n\nfunction 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 const hasBackdrop = !!backdrop;\n const r0 = hasBackdrop ? backdrop[0] : 0;\n const g0 = hasBackdrop ? backdrop[1] : 0;\n const b0 = hasBackdrop ? backdrop[2] : 0;\n\n let composeFn;\n if (subtype === \"Luminosity\") {\n composeFn = composeSMaskLuminosity;\n } else {\n composeFn = composeSMaskAlpha;\n }\n\n // processing image in chunks to save memory\n const PIXELS_TO_PROCESS = 1048576;\n const chunkSize = Math.min(height, Math.ceil(PIXELS_TO_PROCESS / width));\n for (let row = 0; row < height; row += chunkSize) {\n const chunkHeight = Math.min(chunkSize, height - row);\n const maskData = maskCtx.getImageData(\n layerOffsetX - maskOffsetX,\n row + (layerOffsetY - maskOffsetY),\n width,\n chunkHeight\n );\n const layerData = layerCtx.getImageData(\n layerOffsetX,\n row + layerOffsetY,\n width,\n chunkHeight\n );\n\n if (hasBackdrop) {\n composeSMaskBackdrop(maskData.data, r0, g0, b0);\n }\n composeFn(maskData.data, layerData.data, transferMap);\n\n layerCtx.putImageData(layerData, layerOffsetX, row + layerOffsetY);\n }\n}\n\nfunction 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 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\nfunction getImageSmoothingEnabled(transform, interpolate) {\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 if (interpolate !== undefined) {\n // If the value is explicitly set use it.\n return interpolate;\n } else if (scale[0] <= actualScale || scale[1] <= actualScale) {\n // Smooth when downscaling.\n return true;\n }\n // Don't smooth when upscaling.\n return false;\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 imageLayer,\n optionalContentConfig,\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.imageLayer = imageLayer;\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 = [];\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.backgroundColor = pageColors?.background || null;\n this.foregroundColor = pageColors?.foreground || null;\n if (canvasCtx) {\n // NOTE: if mozCurrentTransform is polyfilled, then the current state of\n // the transformation must already be set in canvasCtx._transformMatrix.\n addContextCurrentTransform(canvasCtx);\n }\n this._cachedScaleForStroking = null;\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 const defaultBackgroundColor = background || \"#ffffff\";\n this.ctx.save();\n\n if (this.foregroundColor && this.backgroundColor) {\n // Get the #RRGGBB value of the color. If it's a name (e.g. CanvasText)\n // then it'll be converted to its rgb value.\n this.ctx.fillStyle = this.foregroundColor;\n const fg = (this.foregroundColor = this.ctx.fillStyle);\n this.ctx.fillStyle = this.backgroundColor;\n const bg = (this.backgroundColor = this.ctx.fillStyle);\n let isValidDefaultBg = true;\n let defaultBg = defaultBackgroundColor;\n\n if (typeof PDFJSDev === \"undefined\" || !PDFJSDev.test(\"MOZCENTRAL\")) {\n this.ctx.fillStyle = defaultBackgroundColor;\n defaultBg = this.ctx.fillStyle;\n isValidDefaultBg =\n typeof defaultBg === \"string\" && /^#[0-9A-Fa-f]{6}$/.test(defaultBg);\n }\n\n if (\n (fg === \"#000000\" && bg === \"#ffffff\") ||\n fg === bg ||\n !isValidDefaultBg\n ) {\n // Ignore the `pageColors`-option when:\n // - The computed background/foreground colors have their default\n // values, i.e. white/black.\n // - The computed background/foreground colors are identical,\n // since that'd render the `canvas` mostly blank.\n // - The `background`-option has a value that's incompatible with\n // the `pageColors`-values.\n //\n this.foregroundColor = this.backgroundColor = null;\n } else {\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 cB = parseInt(defaultBg.slice(1), 16);\n const rB = (cB && 0xff0000) >> 16;\n const gB = (cB && 0x00ff00) >> 8;\n const bB = cB && 0x0000ff;\n const newComp = x => {\n x /= 255;\n return x <= 0.03928 ? x / 12.92 : ((x + 0.055) / 1.055) ** 2.4;\n };\n const lumB = Math.round(\n 0.2126 * newComp(rB) + 0.7152 * newComp(gB) + 0.0722 * newComp(bB)\n );\n this.selectColor = (r, g, b) => {\n const lumC =\n 0.2126 * newComp(r) + 0.7152 * newComp(g) + 0.0722 * newComp(b);\n return Math.round(lumC) === lumB ? bg : fg;\n };\n }\n }\n\n this.ctx.fillStyle = this.backgroundColor || defaultBackgroundColor;\n this.ctx.fillRect(0, 0, width, height);\n this.ctx.restore();\n\n if (transparency) {\n const transparentCanvas = this.cachedCanvases.getCanvas(\n \"transparent\",\n width,\n height,\n /* trackTransform */ true\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.apply(this.ctx, this.compositeCtx.mozCurrentTransform);\n }\n\n this.ctx.save();\n resetCtxToDefault(this.ctx, this.foregroundColor);\n if (transform) {\n this.ctx.transform.apply(this.ctx, transform);\n this.outputScaleX = transform[0];\n this.outputScaleY = transform[0];\n }\n this.ctx.transform.apply(this.ctx, viewport.transform);\n this.viewportScale = viewport.scale;\n\n this.baseTransform = this.ctx.mozCurrentTransform.slice();\n\n if (this.imageLayer) {\n this.imageLayer.beginLayout();\n }\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 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 endDrawing() {\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 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\n if (this.imageLayer) {\n this.imageLayer.endLayout();\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 newWidth = Math.ceil(paintWidth / 2);\n widthScale /= paintWidth / newWidth;\n }\n if (heightScale > 2 && paintHeight > 1) {\n newHeight = Math.ceil(paintHeight / 2);\n heightScale /= paintHeight / newHeight;\n }\n tmpCanvas = this.cachedCanvases.getCanvas(\n tmpCanvasId,\n newWidth,\n newHeight,\n /* trackTransform */ false\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 = ctx.mozCurrentTransform;\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.\n // TODO: handle the case of a pattern fill if it's possible.\n const withoutTranslation = currentTransform.slice(0, 4);\n cacheKey = JSON.stringify(\n isPatternFill ? withoutTranslation : [withoutTranslation, 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(\n \"maskCanvas\",\n width,\n height,\n /* trackTransform */ false\n );\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 cord1 = Util.applyTransform([0, 0], maskToCanvas);\n const cord2 = Util.applyTransform([width, height], maskToCanvas);\n const rect = Util.normalizeRect([cord1[0], cord1[1], cord2[0], cord2[1]]);\n const drawnWidth = Math.round(rect[2] - rect[0]) || 1;\n const drawnHeight = Math.round(rect[3] - rect[1]) || 1;\n const fillCanvas = this.cachedCanvases.getCanvas(\n \"fillCanvas\",\n drawnWidth,\n drawnHeight,\n /* trackTransform */ true\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 = Math.min(cord1[0], cord2[0]);\n const offsetY = Math.min(cord1[1], cord2[1]);\n fillCtx.translate(-offsetX, -offsetY);\n fillCtx.transform.apply(fillCtx, maskToCanvas);\n\n if (!scaled) {\n // Pre-scale if needed to improve image smoothing.\n scaled = this._scaleImage(\n maskCanvas.canvas,\n fillCtx.mozCurrentTransformInverse\n );\n scaled = scaled.img;\n if (cache && isPatternFill) {\n cache.set(cacheKey, scaled);\n }\n }\n\n fillCtx.imageSmoothingEnabled = getImageSmoothingEnabled(\n fillCtx.mozCurrentTransform,\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(fillCtx.mozCurrentTransformInverse, [\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 = null;\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 (let i = 0, ii = states.length; i < ii; i++) {\n const state = states[i];\n const key = state[0];\n const value = state[1];\n\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 = state[1];\n break;\n case \"ca\":\n this.current.fillAlpha = state[1];\n this.ctx.globalAlpha = state[1];\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.current.transferMaps = value;\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 /* trackTransform */ true\n );\n this.suspendedCtx = this.ctx;\n this.ctx = scratchCanvas.context;\n const ctx = this.ctx;\n ctx.setTransform.apply(ctx, this.suspendedCtx.mozCurrentTransform);\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 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 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 = null;\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 = null;\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 = ctx.mozCurrentTransform;\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) {\n consumePath = typeof consumePath !== \"undefined\" ? 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 ctx.mozCurrentTransformInverse,\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) {\n consumePath = typeof consumePath !== \"undefined\" ? 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 ctx.mozCurrentTransformInverse,\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 (let i = 0; i < paths.length; i++) {\n const path = paths[i];\n ctx.setTransform.apply(ctx, 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\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 const typeface = `\"${name}\", ${fontObj.fallbackName}`;\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.apply(ctx, 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 || (this.pendingTextPaths = []);\n paths.push({\n transform: ctx.mozCurrentTransform,\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 /* trackTransform */ false\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.apply(ctx, 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 ctx.mozCurrentTransformInverse,\n PathType.FILL\n );\n patternTransform = ctx.mozCurrentTransform;\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 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 let charWidth;\n if (vertical) {\n charWidth = width * widthAdvanceScale - spacing * fontDirection;\n } else {\n charWidth = width * widthAdvanceScale + spacing * fontDirection;\n }\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 = null;\n this._cachedGetSinglePixelWidth = null;\n\n ctx.save();\n ctx.transform.apply(ctx, 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.apply(ctx, 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 // TODO According to the spec we're also suppose to ignore any operators\n // that set color or include images while processing this type3 font.\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 =\n this.baseTransform || this.ctx.mozCurrentTransform.slice();\n const canvasGraphicsFactory = {\n createCanvasGraphics: ctx => {\n return new CanvasGraphics(\n ctx,\n this.commonObjs,\n this.objs,\n this.canvasFactory\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 = this.selectColor?.(r, g, b) || 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 = this.selectColor?.(r, g, b) || 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.objs.get(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 ctx.mozCurrentTransformInverse,\n PathType.SHADING\n );\n\n const inv = ctx.mozCurrentTransformInverse;\n if (inv) {\n const canvas = ctx.canvas;\n const width = canvas.width;\n const height = canvas.height;\n\n const bl = Util.applyTransform([0, 0], inv);\n const br = Util.applyTransform([0, height], inv);\n const ul = Util.applyTransform([width, 0], inv);\n const ur = Util.applyTransform([width, height], inv);\n\n const x0 = Math.min(bl[0], br[0], ul[0], ur[0]);\n const y0 = Math.min(bl[1], br[1], ul[1], ur[1]);\n const x1 = Math.max(bl[0], br[0], ul[0], ur[0]);\n const y1 = Math.max(bl[1], br[1], ul[1], ur[1]);\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 (Array.isArray(matrix) && matrix.length === 6) {\n this.transform.apply(this, matrix);\n }\n\n this.baseTransform = this.ctx.mozCurrentTransform;\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(this.ctx.mozCurrentTransform, 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 = currentCtx.mozCurrentTransform;\n if (group.matrix) {\n currentCtx.transform.apply(currentCtx, 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 currentCtx.mozCurrentTransform\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 let drawnWidth = Math.max(Math.ceil(bounds[2]) - offsetX, 1);\n let drawnHeight = Math.max(Math.ceil(bounds[3]) - offsetY, 1);\n let scaleX = 1,\n scaleY = 1;\n if (drawnWidth > MAX_GROUP_SIZE) {\n scaleX = drawnWidth / MAX_GROUP_SIZE;\n drawnWidth = MAX_GROUP_SIZE;\n }\n if (drawnHeight > MAX_GROUP_SIZE) {\n scaleY = drawnHeight / MAX_GROUP_SIZE;\n drawnHeight = MAX_GROUP_SIZE;\n }\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 /* trackTransform */ true\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.scale(1 / scaleX, 1 / scaleY);\n groupCtx.translate(-offsetX, -offsetY);\n groupCtx.transform.apply(groupCtx, 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 scaleX,\n scaleY,\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.scale(scaleX, scaleY);\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 = this.ctx.mozCurrentTransform;\n this.restore();\n this.ctx.save();\n this.ctx.setTransform.apply(this.ctx, 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 beginAnnotations() {\n this.save();\n if (this.baseTransform) {\n this.ctx.setTransform.apply(this.ctx, this.baseTransform);\n }\n }\n\n endAnnotations() {\n this.restore();\n }\n\n beginAnnotation(id, rect, transform, matrix, hasOwnCanvas) {\n this.save();\n\n if (Array.isArray(rect) && rect.length === 4) {\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 this.ctx.mozCurrentTransform\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 const viewportScaleFactorStr = `var(--zoom-factor) * ${PixelsPerInch.PDF_TO_CSS_UNITS}`;\n canvas.style.width = `calc(${width}px * ${viewportScaleFactorStr})`;\n canvas.style.height = `calc(${height}px * ${viewportScaleFactorStr})`;\n this.annotationCanvasMap.set(id, canvas);\n this.annotationCanvas.savedCtx = this.ctx;\n this.ctx = context;\n this.ctx.setTransform(scaleX, 0, 0, -scaleY, 0, height * scaleY);\n addContextCurrentTransform(this.ctx);\n\n resetCtxToDefault(this.ctx, this.foregroundColor);\n } else {\n resetCtxToDefault(this.ctx, this.foregroundColor);\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.apply(this, transform);\n this.transform.apply(this, matrix);\n }\n\n endAnnotation() {\n if (this.annotationCanvas) {\n this.ctx = this.annotationCanvas.savedCtx;\n delete this.annotationCanvas.savedCtx;\n delete this.annotationCanvas;\n }\n this.restore();\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 = ctx.mozCurrentTransform;\n ctx.transform(scaleX, skewX, skewY, scaleY, 0, 0);\n const mask = this._createMaskCanvas(img);\n\n ctx.setTransform(1, 0, 0, 1, 0, 0);\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 for (let i = 0, ii = images.length; i < ii; i++) {\n const image = images[i];\n const width = image.width,\n height = image.height;\n\n const maskCanvas = this.cachedCanvases.getCanvas(\n \"maskCanvas\",\n width,\n height,\n /* trackTransform */ false\n );\n const maskCtx = maskCanvas.context;\n maskCtx.save();\n\n putBinaryImageMask(maskCtx, image);\n\n maskCtx.globalCompositeOperation = \"source-in\";\n\n maskCtx.fillStyle = isPatternFill\n ? fillColor.getPattern(\n maskCtx,\n this,\n ctx.mozCurrentTransformInverse,\n PathType.FILL\n )\n : fillColor;\n maskCtx.fillRect(0, 0, width, height);\n\n maskCtx.restore();\n\n ctx.save();\n ctx.transform.apply(ctx, image.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 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 // scale the image to the unit square\n ctx.scale(1 / width, -1 / height);\n\n let imgToPaint;\n // typeof check is needed due to node.js support, see issue #8489\n if (\n (typeof HTMLElement === \"function\" && imgData instanceof HTMLElement) ||\n !imgData.data\n ) {\n imgToPaint = imgData;\n } else {\n const tmpCanvas = this.cachedCanvases.getCanvas(\n \"inlineImage\",\n width,\n height,\n /* trackTransform */ false\n );\n const tmpCtx = tmpCanvas.context;\n putBinaryImageData(tmpCtx, imgData, this.current.transferMaps);\n imgToPaint = tmpCanvas.canvas;\n }\n\n const scaled = this._scaleImage(imgToPaint, ctx.mozCurrentTransformInverse);\n ctx.imageSmoothingEnabled = getImageSmoothingEnabled(\n ctx.mozCurrentTransform,\n imgData.interpolate\n );\n\n const [rWidth, rHeight] = 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\n if (this.imageLayer) {\n const position = this.getCanvasPosition(0, -height);\n this.imageLayer.appendImage({\n imgData,\n left: position[0],\n top: position[1],\n width: rWidth,\n height: rHeight,\n });\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 const w = imgData.width;\n const h = imgData.height;\n\n const tmpCanvas = this.cachedCanvases.getCanvas(\n \"inlineImage\",\n w,\n h,\n /* trackTransform */ false\n );\n const tmpCtx = tmpCanvas.context;\n putBinaryImageData(tmpCtx, imgData, this.current.transferMaps);\n\n for (let i = 0, ii = map.length; i < ii; i++) {\n const entry = map[i];\n ctx.save();\n ctx.transform.apply(ctx, entry.transform);\n ctx.scale(1, -1);\n drawImageAtIntegerCoords(\n ctx,\n tmpCanvas.canvas,\n entry.x,\n entry.y,\n entry.w,\n entry.h,\n 0,\n -1,\n 1,\n 1\n );\n if (this.imageLayer) {\n const position = this.getCanvasPosition(entry.x, entry.y);\n this.imageLayer.appendImage({\n imgData,\n left: position[0],\n top: position[1],\n width: w,\n height: h,\n });\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 = this.ctx.mozCurrentTransform;\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) {\n const { lineWidth } = this.current;\n const m = this.ctx.mozCurrentTransform;\n let scaleX, scaleY;\n\n if (m[1] === 0 && m[2] === 0) {\n // Fast path\n const normX = Math.abs(m[0]);\n const normY = Math.abs(m[3]);\n 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(m[0] * m[3] - m[2] * m[1]);\n const normX = Math.hypot(m[0], m[1]);\n const normY = Math.hypot(m[2], m[3]);\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 = [scaleX, 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 let savedMatrix, savedDashes, savedDashOffset;\n if (saveRestore) {\n savedMatrix = ctx.mozCurrentTransform.slice();\n savedDashes = ctx.getLineDash().slice();\n savedDashOffset = ctx.lineDashOffset;\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 const scale = Math.max(scaleX, scaleY);\n ctx.setLineDash(ctx.getLineDash().map(x => x / scale));\n ctx.lineDashOffset /= scale;\n\n ctx.stroke();\n\n if (saveRestore) {\n ctx.setTransform(...savedMatrix);\n ctx.setLineDash(savedDashes);\n ctx.lineDashOffset = savedDashOffset;\n }\n }\n\n getCanvasPosition(x, y) {\n const transform = this.ctx.mozCurrentTransform;\n return [\n transform[0] * x + transform[2] * y + transform[4],\n transform[1] * x + transform[3] * y + transform[5],\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 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 {\n FormatError,\n info,\n shadow,\n unreachable,\n Util,\n warn,\n} from \"../shared/util.js\";\nimport { isNodeJS } from \"../shared/is_node.js\";\n\nconst PathType = {\n FILL: \"Fill\",\n STROKE: \"Stroke\",\n SHADING: \"Shading\",\n};\n\nfunction applyBoundingBox(ctx, bbox) {\n if (!bbox || isNodeJS) {\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 ctx.mozCurrentTransform\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.apply(tmpCtx, owner.baseTransform);\n if (this.matrix) {\n tmpCtx.transform.apply(tmpCtx, 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 try {\n pattern.setTransform(domMatrix);\n } catch (ex) {\n // Avoid rendering breaking completely in Firefox 78 ESR,\n // and in Node.js (see issue 13724).\n warn(`RadialAxialShadingPattern.getPattern: \"${ex?.message}\".`);\n }\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 let k;\n if (y < y1) {\n k = 0;\n } else {\n k = (y1 - y) / (y1 - y2);\n }\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(ctx.mozCurrentTransform);\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.apply(ctx, owner.baseTransform);\n if (this.matrix) {\n ctx.transform.apply(ctx, 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 get MAX_PATTERN_SIZE() {\n return shadow(this, \"MAX_PATTERN_SIZE\", 3000);\n }\n\n constructor(IR, color, ctx, canvasGraphicsFactory, baseTransform) {\n this.operatorList = IR[2];\n this.matrix = IR[3] || [1, 0, 0, 1, 0, 0];\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 = graphics.ctx.mozCurrentTransform.slice();\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(graphics.ctx.mozCurrentTransform, [\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 try {\n pattern.setTransform(domMatrix);\n } catch (ex) {\n // Avoid rendering breaking completely in Firefox 78 ESR,\n // and in Node.js (see issue 13724).\n warn(`TilingPattern.getPattern: \"${ex?.message}\".`);\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 } from \"./util.js\";\n\nfunction applyMaskImageData({\n src,\n srcPos = 0,\n dest,\n destPos = 0,\n width,\n height,\n inverseDecode = false,\n}) {\n const opaque = FeatureTest.isLittleEndian ? 0xff000000 : 0x000000ff;\n const [zeroMapping, oneMapping] = !inverseDecode ? [opaque, 0] : [0, opaque];\n const widthInSource = width >> 3;\n const widthRemainder = width & 7;\n const srcLength = src.length;\n dest = new Uint32Array(dest.buffer);\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\n return { srcPos, destPos };\n}\n\nexport { applyMaskImageData };\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\n/**\n * @typedef {Object} GlobalWorkerOptionsType\n * @property {Worker | null} workerPort - Defines global port for worker\n * process. Overrides the `workerSrc` option.\n * @property {string} workerSrc - A string containing the path and filename\n * of the worker file.\n *\n * NOTE: The `workerSrc` option should always be set, in order to prevent any\n * issues when using the PDF.js library.\n */\n\n/** @type {GlobalWorkerOptionsType} */\nconst GlobalWorkerOptions = Object.create(null);\n\nGlobalWorkerOptions.workerPort =\n GlobalWorkerOptions.workerPort === undefined\n ? null\n : GlobalWorkerOptions.workerPort;\n\nGlobalWorkerOptions.workerSrc =\n GlobalWorkerOptions.workerSrc === undefined\n ? \"\"\n : GlobalWorkerOptions.workerSrc;\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 createPromiseCapability,\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 (\n typeof PDFJSDev === \"undefined\" ||\n PDFJSDev.test(\"!PRODUCTION || TESTING\")\n ) {\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 = createPromiseCapability();\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 = createPromiseCapability();\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 = createPromiseCapability();\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 = createPromiseCapability();\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 /**\n * @private\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 = createPromiseCapability();\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: createPromiseCapability(),\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 /**\n * @private\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 && 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(\n streamSink.onCancel && streamSink.onCancel(wrapReason(data.reason))\n );\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 /**\n * @private\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 && streamController.startCall.promise,\n streamController.pullCall && streamController.pullCall.promise,\n streamController.cancelCall && 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 */\nimport { objectFromMap, warn } from \"../shared/util.js\";\n\nclass OptionalContentGroup {\n constructor(name, intent) {\n this.visible = true;\n this.name = name;\n this.intent = intent;\n }\n}\n\nclass OptionalContentConfig {\n constructor(data) {\n this.name = null;\n this.creator = null;\n this._order = null;\n this._groups = new Map();\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(group.name, group.intent)\n );\n }\n\n if (data.baseState === \"OFF\") {\n for (const group of this._groups) {\n group.visible = false;\n }\n }\n\n for (const on of data.on) {\n this._groups.get(on).visible = true;\n }\n\n for (const off of data.off) {\n this._groups.get(off).visible = false;\n }\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 warn(\"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 if (!this._groups.has(id)) {\n warn(`Optional content group not found: ${id}`);\n return;\n }\n this._groups.get(id).visible = !!visible;\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 Array.from(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\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\nimport { assert, createPromiseCapability } from \"../shared/util.js\";\nimport { isPdfFile } from \"./display_utils.js\";\n\n/** @implements {IPDFStream} */\nclass PDFDataTransportStream {\n constructor(params, pdfDataRangeTransport) {\n assert(\n pdfDataRangeTransport,\n 'PDFDataTransportStream - missing required \"pdfDataRangeTransport\" argument.'\n );\n\n this._queuedChunks = [];\n this._progressiveDone = params.progressiveDone || false;\n this._contentDispositionFilename =\n params.contentDispositionFilename || null;\n\n const initialData = params.initialData;\n if (initialData?.length > 0) {\n const buffer = new Uint8Array(initialData).buffer;\n this._queuedChunks.push(buffer);\n }\n\n this._pdfDataRangeTransport = pdfDataRangeTransport;\n this._isStreamingSupported = !params.disableStream;\n this._isRangeSupported = !params.disableRange;\n this._contentLength = params.length;\n\n this._fullRequestReader = null;\n this._rangeReaders = [];\n\n this._pdfDataRangeTransport.addRangeListener((begin, chunk) => {\n this._onReceiveData({ begin, chunk });\n });\n\n this._pdfDataRangeTransport.addProgressListener((loaded, total) => {\n this._onProgress({ loaded, total });\n });\n\n this._pdfDataRangeTransport.addProgressiveReadListener(chunk => {\n this._onReceiveData({ chunk });\n });\n\n this._pdfDataRangeTransport.addProgressiveDoneListener(() => {\n this._onProgressiveDone();\n });\n\n this._pdfDataRangeTransport.transportReady();\n }\n\n _onReceiveData(args) {\n const buffer = new Uint8Array(args.chunk).buffer;\n if (args.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 !== args.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 const firstReader = this._rangeReaders[0];\n if (firstReader?.onProgress) {\n firstReader.onProgress({ loaded: evt.loaded });\n }\n } else {\n const fullReader = this._fullRequestReader;\n if (fullReader?.onProgress) {\n fullReader.onProgress({ loaded: evt.loaded, total: evt.total });\n }\n }\n }\n\n _onProgressiveDone() {\n if (this._fullRequestReader) {\n this._fullRequestReader.progressiveDone();\n }\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 if (this._fullRequestReader) {\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 = createPromiseCapability();\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 = createPromiseCapability();\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 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\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 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/* globals __non_webpack_require__ */\n\nimport {\n BaseCanvasFactory,\n BaseCMapReaderFactory,\n BaseStandardFontDataFactory,\n} from \"./base_factory.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\nconst fetchData = function (url) {\n return new Promise((resolve, reject) => {\n const fs = __non_webpack_require__(\"fs\");\n fs.readFile(url, (error, data) => {\n if (error || !data) {\n reject(new Error(error));\n return;\n }\n resolve(new Uint8Array(data));\n });\n });\n};\n\nclass NodeCanvasFactory extends BaseCanvasFactory {\n /**\n * @ignore\n */\n _createCanvas(width, height) {\n const Canvas = __non_webpack_require__(\"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 => {\n return { cMapData: data, compressionType };\n });\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 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\n/** @typedef {import(\"./api\").PDFPageProxy} PDFPageProxy */\n/** @typedef {import(\"./display_utils\").PageViewport} PageViewport */\n/** @typedef {import(\"./interfaces\").IDownloadManager} IDownloadManager */\n/** @typedef {import(\"../../web/interfaces\").IPDFLinkService} IPDFLinkService */\n\nimport {\n AnnotationBorderStyleType,\n AnnotationType,\n assert,\n shadow,\n unreachable,\n Util,\n warn,\n} from \"../shared/util.js\";\nimport {\n DOMSVGFactory,\n getFilenameFromUrl,\n PDFDateString,\n} from \"./display_utils.js\";\nimport { AnnotationStorage } from \"./annotation_storage.js\";\nimport { ColorConverters } from \"../shared/scripting_utils.js\";\nimport { XfaLayer } from \"./xfa_layer.js\";\n\nconst DEFAULT_TAB_INDEX = 1000;\nconst GetElementsByNameSet = new WeakSet();\n\nfunction getRectDims(rect) {\n return {\n width: rect[2] - rect[0],\n height: rect[3] - rect[1],\n };\n}\n\n/**\n * @typedef {Object} AnnotationElementParameters\n * @property {Object} data\n * @property {HTMLDivElement} layer\n * @property {PDFPageProxy} page\n * @property {PageViewport} viewport\n * @property {IPDFLinkService} linkService\n * @property {IDownloadManager} downloadManager\n * @property {AnnotationStorage} [annotationStorage]\n * @property {string} [imageResourcesPath] - Path for image resources, mainly\n * for annotation icons. Include trailing slash.\n * @property {boolean} renderForms\n * @property {Object} svgFactory\n * @property {boolean} [enableScripting]\n * @property {boolean} [hasJSActions]\n * @property {Object} [fieldObjects]\n * @property {Object} [mouseState]\n */\n\nclass AnnotationElementFactory {\n /**\n * @param {AnnotationElementParameters} parameters\n * @returns {AnnotationElement}\n */\n static create(parameters) {\n const subtype = parameters.data.annotationType;\n\n switch (subtype) {\n case AnnotationType.LINK:\n return new LinkAnnotationElement(parameters);\n\n case AnnotationType.TEXT:\n return new TextAnnotationElement(parameters);\n\n case AnnotationType.WIDGET:\n const fieldType = parameters.data.fieldType;\n\n switch (fieldType) {\n case \"Tx\":\n return new TextWidgetAnnotationElement(parameters);\n case \"Btn\":\n if (parameters.data.radioButton) {\n return new RadioButtonWidgetAnnotationElement(parameters);\n } else if (parameters.data.checkBox) {\n return new CheckboxWidgetAnnotationElement(parameters);\n }\n return new PushButtonWidgetAnnotationElement(parameters);\n case \"Ch\":\n return new ChoiceWidgetAnnotationElement(parameters);\n }\n return new WidgetAnnotationElement(parameters);\n\n case AnnotationType.POPUP:\n return new PopupAnnotationElement(parameters);\n\n case AnnotationType.FREETEXT:\n return new FreeTextAnnotationElement(parameters);\n\n case AnnotationType.LINE:\n return new LineAnnotationElement(parameters);\n\n case AnnotationType.SQUARE:\n return new SquareAnnotationElement(parameters);\n\n case AnnotationType.CIRCLE:\n return new CircleAnnotationElement(parameters);\n\n case AnnotationType.POLYLINE:\n return new PolylineAnnotationElement(parameters);\n\n case AnnotationType.CARET:\n return new CaretAnnotationElement(parameters);\n\n case AnnotationType.INK:\n return new InkAnnotationElement(parameters);\n\n case AnnotationType.POLYGON:\n return new PolygonAnnotationElement(parameters);\n\n case AnnotationType.HIGHLIGHT:\n return new HighlightAnnotationElement(parameters);\n\n case AnnotationType.UNDERLINE:\n return new UnderlineAnnotationElement(parameters);\n\n case AnnotationType.SQUIGGLY:\n return new SquigglyAnnotationElement(parameters);\n\n case AnnotationType.STRIKEOUT:\n return new StrikeOutAnnotationElement(parameters);\n\n case AnnotationType.STAMP:\n return new StampAnnotationElement(parameters);\n\n case AnnotationType.FILEATTACHMENT:\n return new FileAttachmentAnnotationElement(parameters);\n\n default:\n return new AnnotationElement(parameters);\n }\n }\n}\n\nclass AnnotationElement {\n constructor(\n parameters,\n {\n isRenderable = false,\n ignoreBorder = false,\n createQuadrilaterals = false,\n } = {}\n ) {\n this.isRenderable = isRenderable;\n this.data = parameters.data;\n this.layer = parameters.layer;\n this.page = parameters.page;\n this.viewport = parameters.viewport;\n this.linkService = parameters.linkService;\n this.downloadManager = parameters.downloadManager;\n this.imageResourcesPath = parameters.imageResourcesPath;\n this.renderForms = parameters.renderForms;\n this.svgFactory = parameters.svgFactory;\n this.annotationStorage = parameters.annotationStorage;\n this.enableScripting = parameters.enableScripting;\n this.hasJSActions = parameters.hasJSActions;\n this._fieldObjects = parameters.fieldObjects;\n this._mouseState = parameters.mouseState;\n\n if (isRenderable) {\n this.container = this._createContainer(ignoreBorder);\n }\n if (createQuadrilaterals) {\n this.quadrilaterals = this._createQuadrilaterals(ignoreBorder);\n }\n }\n\n /**\n * Create an empty container for the annotation's HTML element.\n *\n * @private\n * @param {boolean} ignoreBorder\n * @memberof AnnotationElement\n * @returns {HTMLSectionElement}\n */\n _createContainer(ignoreBorder = false) {\n const data = this.data,\n page = this.page,\n viewport = this.viewport;\n const container = document.createElement(\"section\");\n let { width, height } = getRectDims(data.rect);\n\n container.setAttribute(\"data-annotation-id\", data.id);\n\n // Do *not* modify `data.rect`, since that will corrupt the annotation\n // position on subsequent calls to `_createContainer` (see issue 6804).\n const rect = Util.normalizeRect([\n data.rect[0],\n page.view[3] - data.rect[1] + page.view[1],\n data.rect[2],\n page.view[3] - data.rect[3] + page.view[1],\n ]);\n\n if (data.hasOwnCanvas) {\n const transform = viewport.transform.slice();\n const [scaleX, scaleY] = Util.singularValueDecompose2dScale(transform);\n width = Math.ceil(width * scaleX);\n height = Math.ceil(height * scaleY);\n rect[0] *= scaleX;\n rect[1] *= scaleY;\n // Reset the scale part of the transform matrix (which must be diagonal\n // or anti-diagonal) in order to avoid to rescale the canvas.\n // The canvas for the annotation is correctly scaled when it is drawn\n // (see `beginAnnotation` in canvas.js).\n for (let i = 0; i < 4; i++) {\n transform[i] = Math.sign(transform[i]);\n }\n container.style.transform = `matrix(${transform.join(\",\")})`;\n } else {\n container.style.transform = `matrix(${viewport.transform.join(\",\")})`;\n }\n\n container.style.transformOrigin = `${-rect[0]}px ${-rect[1]}px`;\n\n if (!ignoreBorder && data.borderStyle.width > 0) {\n container.style.borderWidth = `${data.borderStyle.width}px`;\n if (data.borderStyle.style !== AnnotationBorderStyleType.UNDERLINE) {\n // Underline styles only have a bottom border, so we do not need\n // to adjust for all borders. This yields a similar result as\n // Adobe Acrobat/Reader.\n width -= 2 * data.borderStyle.width;\n height -= 2 * data.borderStyle.width;\n }\n\n const horizontalRadius = data.borderStyle.horizontalCornerRadius;\n const verticalRadius = data.borderStyle.verticalCornerRadius;\n if (horizontalRadius > 0 || verticalRadius > 0) {\n const radius = `${horizontalRadius}px / ${verticalRadius}px`;\n container.style.borderRadius = radius;\n }\n\n switch (data.borderStyle.style) {\n case AnnotationBorderStyleType.SOLID:\n container.style.borderStyle = \"solid\";\n break;\n\n case AnnotationBorderStyleType.DASHED:\n container.style.borderStyle = \"dashed\";\n break;\n\n case AnnotationBorderStyleType.BEVELED:\n warn(\"Unimplemented border style: beveled\");\n break;\n\n case AnnotationBorderStyleType.INSET:\n warn(\"Unimplemented border style: inset\");\n break;\n\n case AnnotationBorderStyleType.UNDERLINE:\n container.style.borderBottomStyle = \"solid\";\n break;\n\n default:\n break;\n }\n\n const borderColor = data.borderColor || data.color || null;\n if (borderColor) {\n container.style.borderColor = Util.makeHexColor(\n data.color[0] | 0,\n data.color[1] | 0,\n data.color[2] | 0\n );\n } else {\n // Transparent (invisible) border, so do not draw it at all.\n container.style.borderWidth = 0;\n }\n }\n\n container.style.left = `${rect[0]}px`;\n container.style.top = `${rect[1]}px`;\n\n if (data.hasOwnCanvas) {\n container.style.width = container.style.height = \"auto\";\n } else {\n container.style.width = `${width}px`;\n container.style.height = `${height}px`;\n }\n return container;\n }\n\n get _commonActions() {\n const setColor = (jsName, styleName, event) => {\n const color = event.detail[jsName];\n event.target.style[styleName] = ColorConverters[`${color[0]}_HTML`](\n color.slice(1)\n );\n };\n\n return shadow(this, \"_commonActions\", {\n display: event => {\n const hidden = event.detail.display % 2 === 1;\n event.target.style.visibility = hidden ? \"hidden\" : \"visible\";\n this.annotationStorage.setValue(this.data.id, {\n hidden,\n print: event.detail.display === 0 || event.detail.display === 3,\n });\n },\n print: event => {\n this.annotationStorage.setValue(this.data.id, {\n print: event.detail.print,\n });\n },\n hidden: event => {\n event.target.style.visibility = event.detail.hidden\n ? \"hidden\"\n : \"visible\";\n this.annotationStorage.setValue(this.data.id, {\n hidden: event.detail.hidden,\n });\n },\n focus: event => {\n setTimeout(() => event.target.focus({ preventScroll: false }), 0);\n },\n userName: event => {\n // tooltip\n event.target.title = event.detail.userName;\n },\n readonly: event => {\n if (event.detail.readonly) {\n event.target.setAttribute(\"readonly\", \"\");\n } else {\n event.target.removeAttribute(\"readonly\");\n }\n },\n required: event => {\n if (event.detail.required) {\n event.target.setAttribute(\"required\", \"\");\n } else {\n event.target.removeAttribute(\"required\");\n }\n },\n bgColor: event => {\n setColor(\"bgColor\", \"backgroundColor\", event);\n },\n fillColor: event => {\n setColor(\"fillColor\", \"backgroundColor\", event);\n },\n fgColor: event => {\n setColor(\"fgColor\", \"color\", event);\n },\n textColor: event => {\n setColor(\"textColor\", \"color\", event);\n },\n borderColor: event => {\n setColor(\"borderColor\", \"borderColor\", event);\n },\n strokeColor: event => {\n setColor(\"strokeColor\", \"borderColor\", event);\n },\n });\n }\n\n _dispatchEventFromSandbox(actions, jsEvent) {\n const commonActions = this._commonActions;\n for (const name of Object.keys(jsEvent.detail)) {\n const action = actions[name] || commonActions[name];\n if (action) {\n action(jsEvent);\n }\n }\n }\n\n _setDefaultPropertiesFromJS(element) {\n if (!this.enableScripting) {\n return;\n }\n\n // Some properties may have been updated thanks to JS.\n const storedData = this.annotationStorage.getRawValue(this.data.id);\n if (!storedData) {\n return;\n }\n\n const commonActions = this._commonActions;\n for (const [actionName, detail] of Object.entries(storedData)) {\n const action = commonActions[actionName];\n if (action) {\n action({ detail, target: element });\n // The action has been consumed: no need to keep it.\n delete storedData[actionName];\n }\n }\n }\n\n /**\n * Create quadrilaterals from the annotation's quadpoints.\n *\n * @private\n * @param {boolean} ignoreBorder\n * @memberof AnnotationElement\n * @returns {Array<HTMLSectionElement>}\n */\n _createQuadrilaterals(ignoreBorder = false) {\n if (!this.data.quadPoints) {\n return null;\n }\n\n const quadrilaterals = [];\n const savedRect = this.data.rect;\n for (const quadPoint of this.data.quadPoints) {\n this.data.rect = [\n quadPoint[2].x,\n quadPoint[2].y,\n quadPoint[1].x,\n quadPoint[1].y,\n ];\n quadrilaterals.push(this._createContainer(ignoreBorder));\n }\n this.data.rect = savedRect;\n return quadrilaterals;\n }\n\n /**\n * Create a popup for the annotation's HTML element. This is used for\n * annotations that do not have a Popup entry in the dictionary, but\n * are of a type that works with popups (such as Highlight annotations).\n *\n * @private\n * @param {HTMLDivElement|HTMLImageElement|null} trigger\n * @param {Object} data\n * @memberof AnnotationElement\n */\n _createPopup(trigger, data) {\n let container = this.container;\n if (this.quadrilaterals) {\n trigger = trigger || this.quadrilaterals;\n container = this.quadrilaterals[0];\n }\n\n // If no trigger element is specified, create it.\n if (!trigger) {\n trigger = document.createElement(\"div\");\n trigger.style.height = container.style.height;\n trigger.style.width = container.style.width;\n container.appendChild(trigger);\n }\n\n const popupElement = new PopupElement({\n container,\n trigger,\n color: data.color,\n titleObj: data.titleObj,\n modificationDate: data.modificationDate,\n contentsObj: data.contentsObj,\n richText: data.richText,\n hideWrapper: true,\n });\n const popup = popupElement.render();\n\n // Position the popup next to the annotation's container.\n popup.style.left = container.style.width;\n\n container.appendChild(popup);\n }\n\n /**\n * Render the quadrilaterals of the annotation.\n *\n * @private\n * @param {string} className\n * @memberof AnnotationElement\n * @returns {Array<HTMLSectionElement>}\n */\n _renderQuadrilaterals(className) {\n if (\n typeof PDFJSDev === \"undefined\" ||\n PDFJSDev.test(\"!PRODUCTION || TESTING\")\n ) {\n assert(this.quadrilaterals, \"Missing quadrilaterals during rendering\");\n }\n\n for (const quadrilateral of this.quadrilaterals) {\n quadrilateral.className = className;\n }\n return this.quadrilaterals;\n }\n\n /**\n * Render the annotation's HTML element(s).\n *\n * @public\n * @memberof AnnotationElement\n * @returns {HTMLSectionElement|Array<HTMLSectionElement>}\n */\n render() {\n unreachable(\"Abstract method `AnnotationElement.render` called\");\n }\n\n /**\n * @private\n * @returns {Array}\n */\n _getElementsByName(name, skipId = null) {\n const fields = [];\n\n if (this._fieldObjects) {\n const fieldObj = this._fieldObjects[name];\n if (fieldObj) {\n for (const { page, id, exportValues } of fieldObj) {\n if (page === -1) {\n continue;\n }\n if (id === skipId) {\n continue;\n }\n const exportValue =\n typeof exportValues === \"string\" ? exportValues : null;\n\n const domElement = document.getElementById(id);\n if (domElement && !GetElementsByNameSet.has(domElement)) {\n warn(`_getElementsByName - element not allowed: ${id}`);\n continue;\n }\n fields.push({ id, exportValue, domElement });\n }\n }\n return fields;\n }\n // Fallback to a regular DOM lookup, to ensure that the standalone\n // viewer components won't break.\n for (const domElement of document.getElementsByName(name)) {\n const { id, exportValue } = domElement;\n if (id === skipId) {\n continue;\n }\n if (!GetElementsByNameSet.has(domElement)) {\n continue;\n }\n fields.push({ id, exportValue, domElement });\n }\n return fields;\n }\n\n static get platform() {\n const platform = typeof navigator !== \"undefined\" ? navigator.platform : \"\";\n\n return shadow(this, \"platform\", {\n isWin: platform.includes(\"Win\"),\n isMac: platform.includes(\"Mac\"),\n });\n }\n}\n\nclass LinkAnnotationElement extends AnnotationElement {\n constructor(parameters, options = null) {\n const isRenderable = !!(\n parameters.data.url ||\n parameters.data.dest ||\n parameters.data.action ||\n parameters.data.isTooltipOnly ||\n parameters.data.resetForm ||\n (parameters.data.actions &&\n (parameters.data.actions.Action ||\n parameters.data.actions[\"Mouse Up\"] ||\n parameters.data.actions[\"Mouse Down\"]))\n );\n super(parameters, {\n isRenderable,\n ignoreBorder: !!options?.ignoreBorder,\n createQuadrilaterals: true,\n });\n }\n\n render() {\n const { data, linkService } = this;\n const link = document.createElement(\"a\");\n\n if (data.url) {\n linkService.addLinkAttributes(link, data.url, data.newWindow);\n } else if (data.action) {\n this._bindNamedAction(link, data.action);\n } else if (data.dest) {\n this._bindLink(link, data.dest);\n } else {\n let hasClickAction = false;\n if (\n data.actions &&\n (data.actions.Action ||\n data.actions[\"Mouse Up\"] ||\n data.actions[\"Mouse Down\"]) &&\n this.enableScripting &&\n this.hasJSActions\n ) {\n hasClickAction = true;\n this._bindJSAction(link, data);\n }\n\n if (data.resetForm) {\n this._bindResetFormAction(link, data.resetForm);\n } else if (!hasClickAction) {\n this._bindLink(link, \"\");\n }\n }\n\n if (this.quadrilaterals) {\n return this._renderQuadrilaterals(\"linkAnnotation\").map(\n (quadrilateral, index) => {\n const linkElement = index === 0 ? link : link.cloneNode();\n quadrilateral.appendChild(linkElement);\n return quadrilateral;\n }\n );\n }\n\n this.container.className = \"linkAnnotation\";\n this.container.appendChild(link);\n return this.container;\n }\n\n /**\n * Bind internal links to the link element.\n *\n * @private\n * @param {Object} link\n * @param {Object} destination\n * @memberof LinkAnnotationElement\n */\n _bindLink(link, destination) {\n link.href = this.linkService.getDestinationHash(destination);\n link.onclick = () => {\n if (destination) {\n this.linkService.goToDestination(destination);\n }\n return false;\n };\n if (destination || destination === /* isTooltipOnly = */ \"\") {\n link.className = \"internalLink\";\n }\n }\n\n /**\n * Bind named actions to the link element.\n *\n * @private\n * @param {Object} link\n * @param {Object} action\n * @memberof LinkAnnotationElement\n */\n _bindNamedAction(link, action) {\n link.href = this.linkService.getAnchorUrl(\"\");\n link.onclick = () => {\n this.linkService.executeNamedAction(action);\n return false;\n };\n link.className = \"internalLink\";\n }\n\n /**\n * Bind JS actions to the link element.\n *\n * @private\n * @param {Object} link\n * @param {Object} data\n * @memberof LinkAnnotationElement\n */\n _bindJSAction(link, data) {\n link.href = this.linkService.getAnchorUrl(\"\");\n const map = new Map([\n [\"Action\", \"onclick\"],\n [\"Mouse Up\", \"onmouseup\"],\n [\"Mouse Down\", \"onmousedown\"],\n ]);\n for (const name of Object.keys(data.actions)) {\n const jsName = map.get(name);\n if (!jsName) {\n continue;\n }\n link[jsName] = () => {\n this.linkService.eventBus?.dispatch(\"dispatcheventinsandbox\", {\n source: this,\n detail: {\n id: data.id,\n name,\n },\n });\n return false;\n };\n }\n\n if (!link.onclick) {\n link.onclick = () => false;\n }\n link.className = \"internalLink\";\n }\n\n _bindResetFormAction(link, resetForm) {\n const otherClickAction = link.onclick;\n if (!otherClickAction) {\n link.href = this.linkService.getAnchorUrl(\"\");\n }\n link.className = \"internalLink\";\n\n if (!this._fieldObjects) {\n warn(\n `_bindResetFormAction - \"resetForm\" action not supported, ` +\n \"ensure that the `fieldObjects` parameter is provided.\"\n );\n if (!otherClickAction) {\n link.onclick = () => false;\n }\n return;\n }\n\n link.onclick = () => {\n if (otherClickAction) {\n otherClickAction();\n }\n\n const {\n fields: resetFormFields,\n refs: resetFormRefs,\n include,\n } = resetForm;\n\n const allFields = [];\n if (resetFormFields.length !== 0 || resetFormRefs.length !== 0) {\n const fieldIds = new Set(resetFormRefs);\n for (const fieldName of resetFormFields) {\n const fields = this._fieldObjects[fieldName] || [];\n for (const { id } of fields) {\n fieldIds.add(id);\n }\n }\n for (const fields of Object.values(this._fieldObjects)) {\n for (const field of fields) {\n if (fieldIds.has(field.id) === include) {\n allFields.push(field);\n }\n }\n }\n } else {\n for (const fields of Object.values(this._fieldObjects)) {\n allFields.push(...fields);\n }\n }\n\n const storage = this.annotationStorage;\n const allIds = [];\n for (const field of allFields) {\n const { id } = field;\n allIds.push(id);\n switch (field.type) {\n case \"text\": {\n const value = field.defaultValue || \"\";\n storage.setValue(id, { value });\n break;\n }\n case \"checkbox\":\n case \"radiobutton\": {\n const value = field.defaultValue === field.exportValues;\n storage.setValue(id, { value });\n break;\n }\n case \"combobox\":\n case \"listbox\": {\n const value = field.defaultValue || \"\";\n storage.setValue(id, { value });\n break;\n }\n default:\n continue;\n }\n const domElement = document.getElementById(id);\n if (!domElement || !GetElementsByNameSet.has(domElement)) {\n continue;\n }\n domElement.dispatchEvent(new Event(\"resetform\"));\n }\n\n if (this.enableScripting) {\n // Update the values in the sandbox.\n this.linkService.eventBus?.dispatch(\"dispatcheventinsandbox\", {\n source: this,\n detail: {\n id: \"app\",\n ids: allIds,\n name: \"ResetForm\",\n },\n });\n }\n\n return false;\n };\n }\n}\n\nclass TextAnnotationElement extends AnnotationElement {\n constructor(parameters) {\n const isRenderable = !!(\n parameters.data.hasPopup ||\n parameters.data.titleObj?.str ||\n parameters.data.contentsObj?.str ||\n parameters.data.richText?.str\n );\n super(parameters, { isRenderable });\n }\n\n render() {\n this.container.className = \"textAnnotation\";\n\n const image = document.createElement(\"img\");\n image.style.height = this.container.style.height;\n image.style.width = this.container.style.width;\n image.src =\n this.imageResourcesPath +\n \"annotation-\" +\n this.data.name.toLowerCase() +\n \".svg\";\n image.alt = \"[{{type}} Annotation]\";\n image.dataset.l10nId = \"text_annotation_type\";\n image.dataset.l10nArgs = JSON.stringify({ type: this.data.name });\n\n if (!this.data.hasPopup) {\n this._createPopup(image, this.data);\n }\n\n this.container.appendChild(image);\n return this.container;\n }\n}\n\nclass WidgetAnnotationElement extends AnnotationElement {\n render() {\n // Show only the container for unsupported field types.\n if (this.data.alternativeText) {\n this.container.title = this.data.alternativeText;\n }\n\n return this.container;\n }\n\n _getKeyModifier(event) {\n const { isWin, isMac } = AnnotationElement.platform;\n return (isWin && event.ctrlKey) || (isMac && event.metaKey);\n }\n\n _setEventListener(element, baseName, eventName, valueGetter) {\n if (baseName.includes(\"mouse\")) {\n // Mouse events\n element.addEventListener(baseName, event => {\n this.linkService.eventBus?.dispatch(\"dispatcheventinsandbox\", {\n source: this,\n detail: {\n id: this.data.id,\n name: eventName,\n value: valueGetter(event),\n shift: event.shiftKey,\n modifier: this._getKeyModifier(event),\n },\n });\n });\n } else {\n // Non mouse event\n element.addEventListener(baseName, event => {\n this.linkService.eventBus?.dispatch(\"dispatcheventinsandbox\", {\n source: this,\n detail: {\n id: this.data.id,\n name: eventName,\n value: valueGetter(event),\n },\n });\n });\n }\n }\n\n _setEventListeners(element, names, getter) {\n for (const [baseName, eventName] of names) {\n if (eventName === \"Action\" || this.data.actions?.[eventName]) {\n this._setEventListener(element, baseName, eventName, getter);\n }\n }\n }\n\n _setBackgroundColor(element) {\n const color = this.data.backgroundColor || null;\n element.style.backgroundColor =\n color === null\n ? \"transparent\"\n : Util.makeHexColor(color[0], color[1], color[2]);\n }\n}\n\nclass TextWidgetAnnotationElement extends WidgetAnnotationElement {\n constructor(parameters) {\n const isRenderable =\n parameters.renderForms ||\n (!parameters.data.hasAppearance && !!parameters.data.fieldValue);\n super(parameters, { isRenderable });\n }\n\n setPropertyOnSiblings(base, key, value, keyInStorage) {\n const storage = this.annotationStorage;\n for (const element of this._getElementsByName(\n base.name,\n /* skipId = */ base.id\n )) {\n if (element.domElement) {\n element.domElement[key] = value;\n }\n storage.setValue(element.id, { [keyInStorage]: value });\n }\n }\n\n render() {\n const storage = this.annotationStorage;\n const id = this.data.id;\n\n this.container.className = \"textWidgetAnnotation\";\n\n let element = null;\n if (this.renderForms) {\n // NOTE: We cannot set the values using `element.value` below, since it\n // prevents the AnnotationLayer rasterizer in `test/driver.js`\n // from parsing the elements correctly for the reference tests.\n const storedData = storage.getValue(id, {\n value: this.data.fieldValue,\n });\n const textContent = storedData.formattedValue || storedData.value || \"\";\n const elementData = {\n userValue: null,\n formattedValue: null,\n valueOnFocus: \"\",\n };\n\n if (this.data.multiLine) {\n element = document.createElement(\"textarea\");\n element.textContent = textContent;\n } else {\n element = document.createElement(\"input\");\n element.type = \"text\";\n element.setAttribute(\"value\", textContent);\n }\n GetElementsByNameSet.add(element);\n element.disabled = this.data.readOnly;\n element.name = this.data.fieldName;\n element.tabIndex = DEFAULT_TAB_INDEX;\n\n elementData.userValue = textContent;\n element.setAttribute(\"id\", id);\n\n element.addEventListener(\"input\", event => {\n storage.setValue(id, { value: event.target.value });\n this.setPropertyOnSiblings(\n element,\n \"value\",\n event.target.value,\n \"value\"\n );\n });\n\n element.addEventListener(\"resetform\", event => {\n const defaultValue = this.data.defaultFieldValue ?? \"\";\n element.value = elementData.userValue = defaultValue;\n elementData.formattedValue = null;\n });\n\n let blurListener = event => {\n const { formattedValue } = elementData;\n if (formattedValue !== null && formattedValue !== undefined) {\n event.target.value = formattedValue;\n }\n // Reset the cursor position to the start of the field (issue 12359).\n event.target.scrollLeft = 0;\n };\n\n if (this.enableScripting && this.hasJSActions) {\n element.addEventListener(\"focus\", event => {\n if (elementData.userValue) {\n event.target.value = elementData.userValue;\n }\n elementData.valueOnFocus = event.target.value;\n });\n\n element.addEventListener(\"updatefromsandbox\", jsEvent => {\n const actions = {\n value(event) {\n elementData.userValue = event.detail.value ?? \"\";\n storage.setValue(id, { value: elementData.userValue.toString() });\n event.target.value = elementData.userValue;\n },\n formattedValue(event) {\n const { formattedValue } = event.detail;\n elementData.formattedValue = formattedValue;\n if (\n formattedValue !== null &&\n formattedValue !== undefined &&\n event.target !== document.activeElement\n ) {\n // Input hasn't the focus so display formatted string\n event.target.value = formattedValue;\n }\n storage.setValue(id, {\n formattedValue,\n });\n },\n selRange(event) {\n event.target.setSelectionRange(...event.detail.selRange);\n },\n };\n this._dispatchEventFromSandbox(actions, jsEvent);\n });\n\n // Even if the field hasn't any actions\n // leaving it can still trigger some actions with Calculate\n element.addEventListener(\"keydown\", event => {\n // if the key is one of Escape, Enter or Tab\n // then the data are committed\n let commitKey = -1;\n if (event.key === \"Escape\") {\n commitKey = 0;\n } else if (event.key === \"Enter\") {\n commitKey = 2;\n } else if (event.key === \"Tab\") {\n commitKey = 3;\n }\n if (commitKey === -1) {\n return;\n }\n const { value } = event.target;\n if (elementData.valueOnFocus === value) {\n return;\n }\n // Save the entered value\n elementData.userValue = value;\n this.linkService.eventBus?.dispatch(\"dispatcheventinsandbox\", {\n source: this,\n detail: {\n id,\n name: \"Keystroke\",\n value,\n willCommit: true,\n commitKey,\n selStart: event.target.selectionStart,\n selEnd: event.target.selectionEnd,\n },\n });\n });\n const _blurListener = blurListener;\n blurListener = null;\n element.addEventListener(\"blur\", event => {\n const { value } = event.target;\n elementData.userValue = value;\n if (this._mouseState.isDown && elementData.valueOnFocus !== value) {\n // Focus out using the mouse: data are committed\n this.linkService.eventBus?.dispatch(\"dispatcheventinsandbox\", {\n source: this,\n detail: {\n id,\n name: \"Keystroke\",\n value,\n willCommit: true,\n commitKey: 1,\n selStart: event.target.selectionStart,\n selEnd: event.target.selectionEnd,\n },\n });\n }\n _blurListener(event);\n });\n\n if (this.data.actions?.Keystroke) {\n element.addEventListener(\"beforeinput\", event => {\n const { data, target } = event;\n const { value, selectionStart, selectionEnd } = target;\n\n let selStart = selectionStart,\n selEnd = selectionEnd;\n\n switch (event.inputType) {\n // https://rawgit.com/w3c/input-events/v1/index.html#interface-InputEvent-Attributes\n case \"deleteWordBackward\": {\n const match = value\n .substring(0, selectionStart)\n .match(/\\w*[^\\w]*$/);\n if (match) {\n selStart -= match[0].length;\n }\n break;\n }\n case \"deleteWordForward\": {\n const match = value\n .substring(selectionStart)\n .match(/^[^\\w]*\\w*/);\n if (match) {\n selEnd += match[0].length;\n }\n break;\n }\n case \"deleteContentBackward\":\n if (selectionStart === selectionEnd) {\n selStart -= 1;\n }\n break;\n case \"deleteContentForward\":\n if (selectionStart === selectionEnd) {\n selEnd += 1;\n }\n break;\n }\n\n // We handle the event ourselves.\n event.preventDefault();\n this.linkService.eventBus?.dispatch(\"dispatcheventinsandbox\", {\n source: this,\n detail: {\n id,\n name: \"Keystroke\",\n value,\n change: data || \"\",\n willCommit: false,\n selStart,\n selEnd,\n },\n });\n });\n }\n\n this._setEventListeners(\n element,\n [\n [\"focus\", \"Focus\"],\n [\"blur\", \"Blur\"],\n [\"mousedown\", \"Mouse Down\"],\n [\"mouseenter\", \"Mouse Enter\"],\n [\"mouseleave\", \"Mouse Exit\"],\n [\"mouseup\", \"Mouse Up\"],\n ],\n event => event.target.value\n );\n }\n\n if (blurListener) {\n element.addEventListener(\"blur\", blurListener);\n }\n\n if (this.data.maxLen !== null) {\n element.maxLength = this.data.maxLen;\n }\n\n if (this.data.comb) {\n const fieldWidth = this.data.rect[2] - this.data.rect[0];\n const combWidth = fieldWidth / this.data.maxLen;\n\n element.classList.add(\"comb\");\n element.style.letterSpacing = `calc(${combWidth}px - 1ch)`;\n }\n } else {\n element = document.createElement(\"div\");\n element.textContent = this.data.fieldValue;\n element.style.verticalAlign = \"middle\";\n element.style.display = \"table-cell\";\n }\n\n this._setTextStyle(element);\n this._setBackgroundColor(element);\n this._setDefaultPropertiesFromJS(element);\n\n this.container.appendChild(element);\n return this.container;\n }\n\n /**\n * Apply text styles to the text in the element.\n *\n * @private\n * @param {HTMLDivElement} element\n * @memberof TextWidgetAnnotationElement\n */\n _setTextStyle(element) {\n const TEXT_ALIGNMENT = [\"left\", \"center\", \"right\"];\n const { fontSize, fontColor } = this.data.defaultAppearanceData;\n const style = element.style;\n\n // TODO: If the font-size is zero, calculate it based on the height and\n // width of the element.\n // Not setting `style.fontSize` will use the default font-size for now.\n if (fontSize) {\n style.fontSize = `${fontSize}px`;\n }\n\n style.color = Util.makeHexColor(fontColor[0], fontColor[1], fontColor[2]);\n\n if (this.data.textAlignment !== null) {\n style.textAlign = TEXT_ALIGNMENT[this.data.textAlignment];\n }\n }\n}\n\nclass CheckboxWidgetAnnotationElement extends WidgetAnnotationElement {\n constructor(parameters) {\n super(parameters, { isRenderable: parameters.renderForms });\n }\n\n render() {\n const storage = this.annotationStorage;\n const data = this.data;\n const id = data.id;\n let value = storage.getValue(id, {\n value: data.exportValue === data.fieldValue,\n }).value;\n if (typeof value === \"string\") {\n // The value has been changed through js and set in annotationStorage.\n value = value !== \"Off\";\n storage.setValue(id, { value });\n }\n\n this.container.className = \"buttonWidgetAnnotation checkBox\";\n\n const element = document.createElement(\"input\");\n GetElementsByNameSet.add(element);\n element.disabled = data.readOnly;\n element.type = \"checkbox\";\n element.name = data.fieldName;\n if (value) {\n element.setAttribute(\"checked\", true);\n }\n element.setAttribute(\"id\", id);\n element.setAttribute(\"exportValue\", data.exportValue);\n element.tabIndex = DEFAULT_TAB_INDEX;\n\n element.addEventListener(\"change\", event => {\n const { name, checked } = event.target;\n for (const checkbox of this._getElementsByName(name, /* skipId = */ id)) {\n const curChecked = checked && checkbox.exportValue === data.exportValue;\n if (checkbox.domElement) {\n checkbox.domElement.checked = curChecked;\n }\n storage.setValue(checkbox.id, { value: curChecked });\n }\n storage.setValue(id, { value: checked });\n });\n\n element.addEventListener(\"resetform\", event => {\n const defaultValue = data.defaultFieldValue || \"Off\";\n event.target.checked = defaultValue === data.exportValue;\n });\n\n if (this.enableScripting && this.hasJSActions) {\n element.addEventListener(\"updatefromsandbox\", jsEvent => {\n const actions = {\n value(event) {\n event.target.checked = event.detail.value !== \"Off\";\n storage.setValue(id, { value: event.target.checked });\n },\n };\n this._dispatchEventFromSandbox(actions, jsEvent);\n });\n\n this._setEventListeners(\n element,\n [\n [\"change\", \"Validate\"],\n [\"change\", \"Action\"],\n [\"focus\", \"Focus\"],\n [\"blur\", \"Blur\"],\n [\"mousedown\", \"Mouse Down\"],\n [\"mouseenter\", \"Mouse Enter\"],\n [\"mouseleave\", \"Mouse Exit\"],\n [\"mouseup\", \"Mouse Up\"],\n ],\n event => event.target.checked\n );\n }\n\n this._setBackgroundColor(element);\n this._setDefaultPropertiesFromJS(element);\n\n this.container.appendChild(element);\n return this.container;\n }\n}\n\nclass RadioButtonWidgetAnnotationElement extends WidgetAnnotationElement {\n constructor(parameters) {\n super(parameters, { isRenderable: parameters.renderForms });\n }\n\n render() {\n this.container.className = \"buttonWidgetAnnotation radioButton\";\n const storage = this.annotationStorage;\n const data = this.data;\n const id = data.id;\n let value = storage.getValue(id, {\n value: data.fieldValue === data.buttonValue,\n }).value;\n if (typeof value === \"string\") {\n // The value has been changed through js and set in annotationStorage.\n value = value !== data.buttonValue;\n storage.setValue(id, { value });\n }\n\n const element = document.createElement(\"input\");\n GetElementsByNameSet.add(element);\n element.disabled = data.readOnly;\n element.type = \"radio\";\n element.name = data.fieldName;\n if (value) {\n element.setAttribute(\"checked\", true);\n }\n element.setAttribute(\"id\", id);\n element.tabIndex = DEFAULT_TAB_INDEX;\n\n element.addEventListener(\"change\", event => {\n const { name, checked } = event.target;\n for (const radio of this._getElementsByName(name, /* skipId = */ id)) {\n storage.setValue(radio.id, { value: false });\n }\n storage.setValue(id, { value: checked });\n });\n\n element.addEventListener(\"resetform\", event => {\n const defaultValue = data.defaultFieldValue;\n event.target.checked =\n defaultValue !== null &&\n defaultValue !== undefined &&\n defaultValue === data.buttonValue;\n });\n\n if (this.enableScripting && this.hasJSActions) {\n const pdfButtonValue = data.buttonValue;\n element.addEventListener(\"updatefromsandbox\", jsEvent => {\n const actions = {\n value: event => {\n const checked = pdfButtonValue === event.detail.value;\n for (const radio of this._getElementsByName(event.target.name)) {\n const curChecked = checked && radio.id === id;\n if (radio.domElement) {\n radio.domElement.checked = curChecked;\n }\n storage.setValue(radio.id, { value: curChecked });\n }\n },\n };\n this._dispatchEventFromSandbox(actions, jsEvent);\n });\n\n this._setEventListeners(\n element,\n [\n [\"change\", \"Validate\"],\n [\"change\", \"Action\"],\n [\"focus\", \"Focus\"],\n [\"blur\", \"Blur\"],\n [\"mousedown\", \"Mouse Down\"],\n [\"mouseenter\", \"Mouse Enter\"],\n [\"mouseleave\", \"Mouse Exit\"],\n [\"mouseup\", \"Mouse Up\"],\n ],\n event => event.target.checked\n );\n }\n\n this._setBackgroundColor(element);\n this._setDefaultPropertiesFromJS(element);\n\n this.container.appendChild(element);\n return this.container;\n }\n}\n\nclass PushButtonWidgetAnnotationElement extends LinkAnnotationElement {\n constructor(parameters) {\n super(parameters, { ignoreBorder: parameters.data.hasAppearance });\n }\n\n render() {\n // The rendering and functionality of a push button widget annotation is\n // equal to that of a link annotation, but may have more functionality, such\n // as performing actions on form fields (resetting, submitting, et cetera).\n const container = super.render();\n container.className = \"buttonWidgetAnnotation pushButton\";\n\n if (this.data.alternativeText) {\n container.title = this.data.alternativeText;\n }\n\n this._setDefaultPropertiesFromJS(container);\n\n return container;\n }\n}\n\nclass ChoiceWidgetAnnotationElement extends WidgetAnnotationElement {\n constructor(parameters) {\n super(parameters, { isRenderable: parameters.renderForms });\n }\n\n render() {\n this.container.className = \"choiceWidgetAnnotation\";\n const storage = this.annotationStorage;\n const id = this.data.id;\n\n const storedData = storage.getValue(id, {\n value: this.data.fieldValue,\n });\n\n let { fontSize } = this.data.defaultAppearanceData;\n if (!fontSize) {\n fontSize = 9;\n }\n const fontSizeStyle = `calc(${fontSize}px * var(--zoom-factor))`;\n\n const selectElement = document.createElement(\"select\");\n GetElementsByNameSet.add(selectElement);\n selectElement.disabled = this.data.readOnly;\n selectElement.name = this.data.fieldName;\n selectElement.setAttribute(\"id\", id);\n selectElement.tabIndex = DEFAULT_TAB_INDEX;\n\n selectElement.style.fontSize = `${fontSize}px`;\n\n if (!this.data.combo) {\n // List boxes have a size and (optionally) multiple selection.\n selectElement.size = this.data.options.length;\n if (this.data.multiSelect) {\n selectElement.multiple = true;\n }\n }\n\n selectElement.addEventListener(\"resetform\", event => {\n const defaultValue = this.data.defaultFieldValue;\n for (const option of selectElement.options) {\n option.selected = option.value === defaultValue;\n }\n });\n\n // Insert the options into the choice field.\n for (const option of this.data.options) {\n const optionElement = document.createElement(\"option\");\n optionElement.textContent = option.displayValue;\n optionElement.value = option.exportValue;\n if (this.data.combo) {\n optionElement.style.fontSize = fontSizeStyle;\n }\n if (storedData.value.includes(option.exportValue)) {\n optionElement.setAttribute(\"selected\", true);\n }\n selectElement.appendChild(optionElement);\n }\n\n const getValue = (event, isExport) => {\n const name = isExport ? \"value\" : \"textContent\";\n const options = event.target.options;\n if (!event.target.multiple) {\n return options.selectedIndex === -1\n ? null\n : options[options.selectedIndex][name];\n }\n return Array.prototype.filter\n .call(options, option => option.selected)\n .map(option => option[name]);\n };\n\n const getItems = event => {\n const options = event.target.options;\n return Array.prototype.map.call(options, option => {\n return { displayValue: option.textContent, exportValue: option.value };\n });\n };\n\n if (this.enableScripting && this.hasJSActions) {\n selectElement.addEventListener(\"updatefromsandbox\", jsEvent => {\n const actions = {\n value(event) {\n const value = event.detail.value;\n const values = new Set(Array.isArray(value) ? value : [value]);\n for (const option of selectElement.options) {\n option.selected = values.has(option.value);\n }\n storage.setValue(id, {\n value: getValue(event, /* isExport */ true),\n });\n },\n multipleSelection(event) {\n selectElement.multiple = true;\n },\n remove(event) {\n const options = selectElement.options;\n const index = event.detail.remove;\n options[index].selected = false;\n selectElement.remove(index);\n if (options.length > 0) {\n const i = Array.prototype.findIndex.call(\n options,\n option => option.selected\n );\n if (i === -1) {\n options[0].selected = true;\n }\n }\n storage.setValue(id, {\n value: getValue(event, /* isExport */ true),\n items: getItems(event),\n });\n },\n clear(event) {\n while (selectElement.length !== 0) {\n selectElement.remove(0);\n }\n storage.setValue(id, { value: null, items: [] });\n },\n insert(event) {\n const { index, displayValue, exportValue } = event.detail.insert;\n const optionElement = document.createElement(\"option\");\n optionElement.textContent = displayValue;\n optionElement.value = exportValue;\n selectElement.insertBefore(\n optionElement,\n selectElement.children[index]\n );\n storage.setValue(id, {\n value: getValue(event, /* isExport */ true),\n items: getItems(event),\n });\n },\n items(event) {\n const { items } = event.detail;\n while (selectElement.length !== 0) {\n selectElement.remove(0);\n }\n for (const item of items) {\n const { displayValue, exportValue } = item;\n const optionElement = document.createElement(\"option\");\n optionElement.textContent = displayValue;\n optionElement.value = exportValue;\n selectElement.appendChild(optionElement);\n }\n if (selectElement.options.length > 0) {\n selectElement.options[0].selected = true;\n }\n storage.setValue(id, {\n value: getValue(event, /* isExport */ true),\n items: getItems(event),\n });\n },\n indices(event) {\n const indices = new Set(event.detail.indices);\n for (const option of event.target.options) {\n option.selected = indices.has(option.index);\n }\n storage.setValue(id, {\n value: getValue(event, /* isExport */ true),\n });\n },\n editable(event) {\n event.target.disabled = !event.detail.editable;\n },\n };\n this._dispatchEventFromSandbox(actions, jsEvent);\n });\n\n selectElement.addEventListener(\"input\", event => {\n const exportValue = getValue(event, /* isExport */ true);\n const value = getValue(event, /* isExport */ false);\n storage.setValue(id, { value: exportValue });\n\n this.linkService.eventBus?.dispatch(\"dispatcheventinsandbox\", {\n source: this,\n detail: {\n id,\n name: \"Keystroke\",\n value,\n changeEx: exportValue,\n willCommit: true,\n commitKey: 1,\n keyDown: false,\n },\n });\n });\n\n this._setEventListeners(\n selectElement,\n [\n [\"focus\", \"Focus\"],\n [\"blur\", \"Blur\"],\n [\"mousedown\", \"Mouse Down\"],\n [\"mouseenter\", \"Mouse Enter\"],\n [\"mouseleave\", \"Mouse Exit\"],\n [\"mouseup\", \"Mouse Up\"],\n [\"input\", \"Action\"],\n ],\n event => event.target.checked\n );\n } else {\n selectElement.addEventListener(\"input\", function (event) {\n storage.setValue(id, { value: getValue(event, /* isExport */ true) });\n });\n }\n\n this._setBackgroundColor(selectElement);\n this._setDefaultPropertiesFromJS(selectElement);\n\n this.container.appendChild(selectElement);\n return this.container;\n }\n}\n\nclass PopupAnnotationElement extends AnnotationElement {\n constructor(parameters) {\n const isRenderable = !!(\n parameters.data.titleObj?.str ||\n parameters.data.contentsObj?.str ||\n parameters.data.richText?.str\n );\n super(parameters, { isRenderable });\n }\n\n render() {\n // Do not render popup annotations for parent elements with these types as\n // they create the popups themselves (because of custom trigger divs).\n const IGNORE_TYPES = [\n \"Line\",\n \"Square\",\n \"Circle\",\n \"PolyLine\",\n \"Polygon\",\n \"Ink\",\n ];\n\n this.container.className = \"popupAnnotation\";\n\n if (IGNORE_TYPES.includes(this.data.parentType)) {\n return this.container;\n }\n\n const selector = `[data-annotation-id=\"${this.data.parentId}\"]`;\n const parentElements = this.layer.querySelectorAll(selector);\n if (parentElements.length === 0) {\n return this.container;\n }\n\n const popup = new PopupElement({\n container: this.container,\n trigger: Array.from(parentElements),\n color: this.data.color,\n titleObj: this.data.titleObj,\n modificationDate: this.data.modificationDate,\n contentsObj: this.data.contentsObj,\n richText: this.data.richText,\n });\n\n // Position the popup next to the parent annotation's container.\n // PDF viewers ignore a popup annotation's rectangle.\n const page = this.page;\n const rect = Util.normalizeRect([\n this.data.parentRect[0],\n page.view[3] - this.data.parentRect[1] + page.view[1],\n this.data.parentRect[2],\n page.view[3] - this.data.parentRect[3] + page.view[1],\n ]);\n const popupLeft =\n rect[0] + this.data.parentRect[2] - this.data.parentRect[0];\n const popupTop = rect[1];\n\n this.container.style.transformOrigin = `${-popupLeft}px ${-popupTop}px`;\n this.container.style.left = `${popupLeft}px`;\n this.container.style.top = `${popupTop}px`;\n\n this.container.appendChild(popup.render());\n return this.container;\n }\n}\n\nclass PopupElement {\n constructor(parameters) {\n this.container = parameters.container;\n this.trigger = parameters.trigger;\n this.color = parameters.color;\n this.titleObj = parameters.titleObj;\n this.modificationDate = parameters.modificationDate;\n this.contentsObj = parameters.contentsObj;\n this.richText = parameters.richText;\n this.hideWrapper = parameters.hideWrapper || false;\n\n this.pinned = false;\n }\n\n render() {\n const BACKGROUND_ENLIGHT = 0.7;\n\n const wrapper = document.createElement(\"div\");\n wrapper.className = \"popupWrapper\";\n\n // For Popup annotations we hide the entire section because it contains\n // only the popup. However, for Text annotations without a separate Popup\n // annotation, we cannot hide the entire container as the image would\n // disappear too. In that special case, hiding the wrapper suffices.\n this.hideElement = this.hideWrapper ? wrapper : this.container;\n this.hideElement.hidden = true;\n\n const popup = document.createElement(\"div\");\n popup.className = \"popup\";\n\n const color = this.color;\n if (color) {\n // Enlighten the color.\n const r = BACKGROUND_ENLIGHT * (255 - color[0]) + color[0];\n const g = BACKGROUND_ENLIGHT * (255 - color[1]) + color[1];\n const b = BACKGROUND_ENLIGHT * (255 - color[2]) + color[2];\n popup.style.backgroundColor = Util.makeHexColor(r | 0, g | 0, b | 0);\n }\n\n const title = document.createElement(\"h1\");\n title.dir = this.titleObj.dir;\n title.textContent = this.titleObj.str;\n popup.appendChild(title);\n\n // The modification date is shown in the popup instead of the creation\n // date if it is available and can be parsed correctly, which is\n // consistent with other viewers such as Adobe Acrobat.\n const dateObject = PDFDateString.toDateObject(this.modificationDate);\n if (dateObject) {\n const modificationDate = document.createElement(\"span\");\n modificationDate.className = \"popupDate\";\n modificationDate.textContent = \"{{date}}, {{time}}\";\n modificationDate.dataset.l10nId = \"annotation_date_string\";\n modificationDate.dataset.l10nArgs = JSON.stringify({\n date: dateObject.toLocaleDateString(),\n time: dateObject.toLocaleTimeString(),\n });\n popup.appendChild(modificationDate);\n }\n\n if (\n this.richText?.str &&\n (!this.contentsObj?.str || this.contentsObj.str === this.richText.str)\n ) {\n XfaLayer.render({\n xfaHtml: this.richText.html,\n intent: \"richText\",\n div: popup,\n });\n popup.lastChild.className = \"richText popupContent\";\n } else {\n const contents = this._formatContents(this.contentsObj);\n popup.appendChild(contents);\n }\n\n if (!Array.isArray(this.trigger)) {\n this.trigger = [this.trigger];\n }\n\n // Attach the event listeners to the trigger element.\n for (const element of this.trigger) {\n element.addEventListener(\"click\", this._toggle.bind(this));\n element.addEventListener(\"mouseover\", this._show.bind(this, false));\n element.addEventListener(\"mouseout\", this._hide.bind(this, false));\n }\n popup.addEventListener(\"click\", this._hide.bind(this, true));\n\n wrapper.appendChild(popup);\n return wrapper;\n }\n\n /**\n * Format the contents of the popup by adding newlines where necessary.\n *\n * @private\n * @param {Object<string, string>} contentsObj\n * @memberof PopupElement\n * @returns {HTMLParagraphElement}\n */\n _formatContents({ str, dir }) {\n const p = document.createElement(\"p\");\n p.className = \"popupContent\";\n p.dir = dir;\n const lines = str.split(/(?:\\r\\n?|\\n)/);\n for (let i = 0, ii = lines.length; i < ii; ++i) {\n const line = lines[i];\n p.appendChild(document.createTextNode(line));\n if (i < ii - 1) {\n p.appendChild(document.createElement(\"br\"));\n }\n }\n return p;\n }\n\n /**\n * Toggle the visibility of the popup.\n *\n * @private\n * @memberof PopupElement\n */\n _toggle() {\n if (this.pinned) {\n this._hide(true);\n } else {\n this._show(true);\n }\n }\n\n /**\n * Show the popup.\n *\n * @private\n * @param {boolean} pin\n * @memberof PopupElement\n */\n _show(pin = false) {\n if (pin) {\n this.pinned = true;\n }\n if (this.hideElement.hidden) {\n this.hideElement.hidden = false;\n this.container.style.zIndex += 1;\n }\n }\n\n /**\n * Hide the popup.\n *\n * @private\n * @param {boolean} unpin\n * @memberof PopupElement\n */\n _hide(unpin = true) {\n if (unpin) {\n this.pinned = false;\n }\n if (!this.hideElement.hidden && !this.pinned) {\n this.hideElement.hidden = true;\n this.container.style.zIndex -= 1;\n }\n }\n}\n\nclass FreeTextAnnotationElement extends AnnotationElement {\n constructor(parameters) {\n const isRenderable = !!(\n parameters.data.hasPopup ||\n parameters.data.titleObj?.str ||\n parameters.data.contentsObj?.str ||\n parameters.data.richText?.str\n );\n super(parameters, { isRenderable, ignoreBorder: true });\n }\n\n render() {\n this.container.className = \"freeTextAnnotation\";\n\n if (!this.data.hasPopup) {\n this._createPopup(null, this.data);\n }\n return this.container;\n }\n}\n\nclass LineAnnotationElement extends AnnotationElement {\n constructor(parameters) {\n const isRenderable = !!(\n parameters.data.hasPopup ||\n parameters.data.titleObj?.str ||\n parameters.data.contentsObj?.str ||\n parameters.data.richText?.str\n );\n super(parameters, { isRenderable, ignoreBorder: true });\n }\n\n render() {\n this.container.className = \"lineAnnotation\";\n\n // Create an invisible line with the same starting and ending coordinates\n // that acts as the trigger for the popup. Only the line itself should\n // trigger the popup, not the entire container.\n const data = this.data;\n const { width, height } = getRectDims(data.rect);\n const svg = this.svgFactory.create(width, height);\n\n // PDF coordinates are calculated from a bottom left origin, so transform\n // the line coordinates to a top left origin for the SVG element.\n const line = this.svgFactory.createElement(\"svg:line\");\n line.setAttribute(\"x1\", data.rect[2] - data.lineCoordinates[0]);\n line.setAttribute(\"y1\", data.rect[3] - data.lineCoordinates[1]);\n line.setAttribute(\"x2\", data.rect[2] - data.lineCoordinates[2]);\n line.setAttribute(\"y2\", data.rect[3] - data.lineCoordinates[3]);\n // Ensure that the 'stroke-width' is always non-zero, since otherwise it\n // won't be possible to open/close the popup (note e.g. issue 11122).\n line.setAttribute(\"stroke-width\", data.borderStyle.width || 1);\n line.setAttribute(\"stroke\", \"transparent\");\n line.setAttribute(\"fill\", \"transparent\");\n\n svg.appendChild(line);\n this.container.append(svg);\n\n // Create the popup ourselves so that we can bind it to the line instead\n // of to the entire container (which is the default).\n this._createPopup(line, data);\n\n return this.container;\n }\n}\n\nclass SquareAnnotationElement extends AnnotationElement {\n constructor(parameters) {\n const isRenderable = !!(\n parameters.data.hasPopup ||\n parameters.data.titleObj?.str ||\n parameters.data.contentsObj?.str ||\n parameters.data.richText?.str\n );\n super(parameters, { isRenderable, ignoreBorder: true });\n }\n\n render() {\n this.container.className = \"squareAnnotation\";\n\n // Create an invisible square with the same rectangle that acts as the\n // trigger for the popup. Only the square itself should trigger the\n // popup, not the entire container.\n const data = this.data;\n const { width, height } = getRectDims(data.rect);\n const svg = this.svgFactory.create(width, height);\n\n // The browser draws half of the borders inside the square and half of\n // the borders outside the square by default. This behavior cannot be\n // changed programmatically, so correct for that here.\n const borderWidth = data.borderStyle.width;\n const square = this.svgFactory.createElement(\"svg:rect\");\n square.setAttribute(\"x\", borderWidth / 2);\n square.setAttribute(\"y\", borderWidth / 2);\n square.setAttribute(\"width\", width - borderWidth);\n square.setAttribute(\"height\", height - borderWidth);\n // Ensure that the 'stroke-width' is always non-zero, since otherwise it\n // won't be possible to open/close the popup (note e.g. issue 11122).\n square.setAttribute(\"stroke-width\", borderWidth || 1);\n square.setAttribute(\"stroke\", \"transparent\");\n square.setAttribute(\"fill\", \"transparent\");\n\n svg.appendChild(square);\n this.container.append(svg);\n\n // Create the popup ourselves so that we can bind it to the square instead\n // of to the entire container (which is the default).\n this._createPopup(square, data);\n\n return this.container;\n }\n}\n\nclass CircleAnnotationElement extends AnnotationElement {\n constructor(parameters) {\n const isRenderable = !!(\n parameters.data.hasPopup ||\n parameters.data.titleObj?.str ||\n parameters.data.contentsObj?.str ||\n parameters.data.richText?.str\n );\n super(parameters, { isRenderable, ignoreBorder: true });\n }\n\n render() {\n this.container.className = \"circleAnnotation\";\n\n // Create an invisible circle with the same ellipse that acts as the\n // trigger for the popup. Only the circle itself should trigger the\n // popup, not the entire container.\n const data = this.data;\n const { width, height } = getRectDims(data.rect);\n const svg = this.svgFactory.create(width, height);\n\n // The browser draws half of the borders inside the circle and half of\n // the borders outside the circle by default. This behavior cannot be\n // changed programmatically, so correct for that here.\n const borderWidth = data.borderStyle.width;\n const circle = this.svgFactory.createElement(\"svg:ellipse\");\n circle.setAttribute(\"cx\", width / 2);\n circle.setAttribute(\"cy\", height / 2);\n circle.setAttribute(\"rx\", width / 2 - borderWidth / 2);\n circle.setAttribute(\"ry\", height / 2 - borderWidth / 2);\n // Ensure that the 'stroke-width' is always non-zero, since otherwise it\n // won't be possible to open/close the popup (note e.g. issue 11122).\n circle.setAttribute(\"stroke-width\", borderWidth || 1);\n circle.setAttribute(\"stroke\", \"transparent\");\n circle.setAttribute(\"fill\", \"transparent\");\n\n svg.appendChild(circle);\n this.container.append(svg);\n\n // Create the popup ourselves so that we can bind it to the circle instead\n // of to the entire container (which is the default).\n this._createPopup(circle, data);\n\n return this.container;\n }\n}\n\nclass PolylineAnnotationElement extends AnnotationElement {\n constructor(parameters) {\n const isRenderable = !!(\n parameters.data.hasPopup ||\n parameters.data.titleObj?.str ||\n parameters.data.contentsObj?.str ||\n parameters.data.richText?.str\n );\n super(parameters, { isRenderable, ignoreBorder: true });\n\n this.containerClassName = \"polylineAnnotation\";\n this.svgElementName = \"svg:polyline\";\n }\n\n render() {\n this.container.className = this.containerClassName;\n\n // Create an invisible polyline with the same points that acts as the\n // trigger for the popup. Only the polyline itself should trigger the\n // popup, not the entire container.\n const data = this.data;\n const { width, height } = getRectDims(data.rect);\n const svg = this.svgFactory.create(width, height);\n\n // Convert the vertices array to a single points string that the SVG\n // polyline element expects (\"x1,y1 x2,y2 ...\"). PDF coordinates are\n // calculated from a bottom left origin, so transform the polyline\n // coordinates to a top left origin for the SVG element.\n let points = [];\n for (const coordinate of data.vertices) {\n const x = coordinate.x - data.rect[0];\n const y = data.rect[3] - coordinate.y;\n points.push(x + \",\" + y);\n }\n points = points.join(\" \");\n\n const polyline = this.svgFactory.createElement(this.svgElementName);\n polyline.setAttribute(\"points\", points);\n // Ensure that the 'stroke-width' is always non-zero, since otherwise it\n // won't be possible to open/close the popup (note e.g. issue 11122).\n polyline.setAttribute(\"stroke-width\", data.borderStyle.width || 1);\n polyline.setAttribute(\"stroke\", \"transparent\");\n polyline.setAttribute(\"fill\", \"transparent\");\n\n svg.appendChild(polyline);\n this.container.append(svg);\n\n // Create the popup ourselves so that we can bind it to the polyline\n // instead of to the entire container (which is the default).\n this._createPopup(polyline, data);\n\n return this.container;\n }\n}\n\nclass PolygonAnnotationElement extends PolylineAnnotationElement {\n constructor(parameters) {\n // Polygons are specific forms of polylines, so reuse their logic.\n super(parameters);\n\n this.containerClassName = \"polygonAnnotation\";\n this.svgElementName = \"svg:polygon\";\n }\n}\n\nclass CaretAnnotationElement extends AnnotationElement {\n constructor(parameters) {\n const isRenderable = !!(\n parameters.data.hasPopup ||\n parameters.data.titleObj?.str ||\n parameters.data.contentsObj?.str ||\n parameters.data.richText?.str\n );\n super(parameters, { isRenderable, ignoreBorder: true });\n }\n\n render() {\n this.container.className = \"caretAnnotation\";\n\n if (!this.data.hasPopup) {\n this._createPopup(null, this.data);\n }\n return this.container;\n }\n}\n\nclass InkAnnotationElement extends AnnotationElement {\n constructor(parameters) {\n const isRenderable = !!(\n parameters.data.hasPopup ||\n parameters.data.titleObj?.str ||\n parameters.data.contentsObj?.str ||\n parameters.data.richText?.str\n );\n super(parameters, { isRenderable, ignoreBorder: true });\n\n this.containerClassName = \"inkAnnotation\";\n\n // Use the polyline SVG element since it allows us to use coordinates\n // directly and to draw both straight lines and curves.\n this.svgElementName = \"svg:polyline\";\n }\n\n render() {\n this.container.className = this.containerClassName;\n\n // Create an invisible polyline with the same points that acts as the\n // trigger for the popup.\n const data = this.data;\n const { width, height } = getRectDims(data.rect);\n const svg = this.svgFactory.create(width, height);\n\n for (const inkList of data.inkLists) {\n // Convert the ink list to a single points string that the SVG\n // polyline element expects (\"x1,y1 x2,y2 ...\"). PDF coordinates are\n // calculated from a bottom left origin, so transform the polyline\n // coordinates to a top left origin for the SVG element.\n let points = [];\n for (const coordinate of inkList) {\n const x = coordinate.x - data.rect[0];\n const y = data.rect[3] - coordinate.y;\n points.push(`${x},${y}`);\n }\n points = points.join(\" \");\n\n const polyline = this.svgFactory.createElement(this.svgElementName);\n polyline.setAttribute(\"points\", points);\n // Ensure that the 'stroke-width' is always non-zero, since otherwise it\n // won't be possible to open/close the popup (note e.g. issue 11122).\n polyline.setAttribute(\"stroke-width\", data.borderStyle.width || 1);\n polyline.setAttribute(\"stroke\", \"transparent\");\n polyline.setAttribute(\"fill\", \"transparent\");\n\n // Create the popup ourselves so that we can bind it to the polyline\n // instead of to the entire container (which is the default).\n this._createPopup(polyline, data);\n\n svg.appendChild(polyline);\n }\n\n this.container.append(svg);\n return this.container;\n }\n}\n\nclass HighlightAnnotationElement extends AnnotationElement {\n constructor(parameters) {\n const isRenderable = !!(\n parameters.data.hasPopup ||\n parameters.data.titleObj?.str ||\n parameters.data.contentsObj?.str ||\n parameters.data.richText?.str\n );\n super(parameters, {\n isRenderable,\n ignoreBorder: true,\n createQuadrilaterals: true,\n });\n }\n\n render() {\n if (!this.data.hasPopup) {\n this._createPopup(null, this.data);\n }\n\n if (this.quadrilaterals) {\n return this._renderQuadrilaterals(\"highlightAnnotation\");\n }\n\n this.container.className = \"highlightAnnotation\";\n return this.container;\n }\n}\n\nclass UnderlineAnnotationElement extends AnnotationElement {\n constructor(parameters) {\n const isRenderable = !!(\n parameters.data.hasPopup ||\n parameters.data.titleObj?.str ||\n parameters.data.contentsObj?.str ||\n parameters.data.richText?.str\n );\n super(parameters, {\n isRenderable,\n ignoreBorder: true,\n createQuadrilaterals: true,\n });\n }\n\n render() {\n if (!this.data.hasPopup) {\n this._createPopup(null, this.data);\n }\n\n if (this.quadrilaterals) {\n return this._renderQuadrilaterals(\"underlineAnnotation\");\n }\n\n this.container.className = \"underlineAnnotation\";\n return this.container;\n }\n}\n\nclass SquigglyAnnotationElement extends AnnotationElement {\n constructor(parameters) {\n const isRenderable = !!(\n parameters.data.hasPopup ||\n parameters.data.titleObj?.str ||\n parameters.data.contentsObj?.str ||\n parameters.data.richText?.str\n );\n super(parameters, {\n isRenderable,\n ignoreBorder: true,\n createQuadrilaterals: true,\n });\n }\n\n render() {\n if (!this.data.hasPopup) {\n this._createPopup(null, this.data);\n }\n\n if (this.quadrilaterals) {\n return this._renderQuadrilaterals(\"squigglyAnnotation\");\n }\n\n this.container.className = \"squigglyAnnotation\";\n return this.container;\n }\n}\n\nclass StrikeOutAnnotationElement extends AnnotationElement {\n constructor(parameters) {\n const isRenderable = !!(\n parameters.data.hasPopup ||\n parameters.data.titleObj?.str ||\n parameters.data.contentsObj?.str ||\n parameters.data.richText?.str\n );\n super(parameters, {\n isRenderable,\n ignoreBorder: true,\n createQuadrilaterals: true,\n });\n }\n\n render() {\n if (!this.data.hasPopup) {\n this._createPopup(null, this.data);\n }\n\n if (this.quadrilaterals) {\n return this._renderQuadrilaterals(\"strikeoutAnnotation\");\n }\n\n this.container.className = \"strikeoutAnnotation\";\n return this.container;\n }\n}\n\nclass StampAnnotationElement extends AnnotationElement {\n constructor(parameters) {\n const isRenderable = !!(\n parameters.data.hasPopup ||\n parameters.data.titleObj?.str ||\n parameters.data.contentsObj?.str ||\n parameters.data.richText?.str\n );\n super(parameters, { isRenderable, ignoreBorder: true });\n }\n\n render() {\n this.container.className = \"stampAnnotation\";\n\n if (!this.data.hasPopup) {\n this._createPopup(null, this.data);\n }\n return this.container;\n }\n}\n\nclass FileAttachmentAnnotationElement extends AnnotationElement {\n constructor(parameters) {\n super(parameters, { isRenderable: true });\n\n const { filename, content } = this.data.file;\n this.filename = getFilenameFromUrl(filename);\n this.content = content;\n\n this.linkService.eventBus?.dispatch(\"fileattachmentannotation\", {\n source: this,\n filename,\n content,\n });\n }\n\n render() {\n this.container.className = \"fileAttachmentAnnotation\";\n\n const trigger = document.createElement(\"div\");\n trigger.style.height = this.container.style.height;\n trigger.style.width = this.container.style.width;\n trigger.addEventListener(\"dblclick\", this._download.bind(this));\n\n if (\n !this.data.hasPopup &&\n (this.data.titleObj?.str ||\n this.data.contentsObj?.str ||\n this.data.richText)\n ) {\n this._createPopup(trigger, this.data);\n }\n\n this.container.appendChild(trigger);\n return this.container;\n }\n\n /**\n * Download the file attachment associated with this annotation.\n *\n * @private\n * @memberof FileAttachmentAnnotationElement\n */\n _download() {\n this.downloadManager?.openOrDownloadData(\n this.container,\n this.content,\n this.filename\n );\n }\n}\n\n/**\n * @typedef {Object} AnnotationLayerParameters\n * @property {PageViewport} viewport\n * @property {HTMLDivElement} div\n * @property {Array} annotations\n * @property {PDFPageProxy} page\n * @property {IPDFLinkService} linkService\n * @property {IDownloadManager} downloadManager\n * @property {string} [imageResourcesPath] - Path for image resources, mainly\n * for annotation icons. Include trailing slash.\n * @property {boolean} renderForms\n * @property {boolean} [enableScripting] - Enable embedded script execution.\n * @property {boolean} [hasJSActions] - Some fields have JS actions.\n * The default value is `false`.\n * @property {Map<string, HTMLCanvasElement>} [annotationCanvasMap]\n */\n\nclass AnnotationLayer {\n /**\n * Render a new annotation layer with all annotation elements.\n *\n * @public\n * @param {AnnotationLayerParameters} parameters\n * @memberof AnnotationLayer\n */\n static render(parameters) {\n const sortedAnnotations = [],\n popupAnnotations = [];\n // Ensure that Popup annotations are handled last, since they're dependant\n // upon the parent annotation having already been rendered (please refer to\n // the `PopupAnnotationElement.render` method); fixes issue 11362.\n for (const data of parameters.annotations) {\n if (!data) {\n continue;\n }\n const { width, height } = getRectDims(data.rect);\n if (width <= 0 || height <= 0) {\n continue;\n }\n if (data.annotationType === AnnotationType.POPUP) {\n popupAnnotations.push(data);\n continue;\n }\n sortedAnnotations.push(data);\n }\n if (popupAnnotations.length) {\n sortedAnnotations.push(...popupAnnotations);\n }\n\n const div = parameters.div;\n\n for (const data of sortedAnnotations) {\n const element = AnnotationElementFactory.create({\n data,\n layer: div,\n page: parameters.page,\n viewport: parameters.viewport,\n linkService: parameters.linkService,\n downloadManager: parameters.downloadManager,\n imageResourcesPath: parameters.imageResourcesPath || \"\",\n renderForms: parameters.renderForms !== false,\n svgFactory: new DOMSVGFactory(),\n annotationStorage:\n parameters.annotationStorage || new AnnotationStorage(),\n enableScripting: parameters.enableScripting,\n hasJSActions: parameters.hasJSActions,\n fieldObjects: parameters.fieldObjects,\n mouseState: parameters.mouseState || { isDown: false },\n });\n if (element.isRenderable) {\n const rendered = element.render();\n if (data.hidden) {\n rendered.style.visibility = \"hidden\";\n }\n if (Array.isArray(rendered)) {\n for (const renderedElement of rendered) {\n div.appendChild(renderedElement);\n }\n } else {\n if (element instanceof PopupAnnotationElement) {\n // Popup annotation elements should not be on top of other\n // annotation elements to prevent interfering with mouse events.\n div.prepend(rendered);\n } else {\n div.appendChild(rendered);\n }\n }\n }\n }\n\n this.#setAnnotationCanvasMap(div, parameters.annotationCanvasMap);\n }\n\n /**\n * Update the annotation elements on existing annotation layer.\n *\n * @public\n * @param {AnnotationLayerParameters} parameters\n * @memberof AnnotationLayer\n */\n static update(parameters) {\n const { page, viewport, annotations, annotationCanvasMap, div } =\n parameters;\n const transform = viewport.transform;\n const matrix = `matrix(${transform.join(\",\")})`;\n\n let scale, ownMatrix;\n for (const data of annotations) {\n const elements = div.querySelectorAll(\n `[data-annotation-id=\"${data.id}\"]`\n );\n if (elements) {\n for (const element of elements) {\n if (data.hasOwnCanvas) {\n const rect = Util.normalizeRect([\n data.rect[0],\n page.view[3] - data.rect[1] + page.view[1],\n data.rect[2],\n page.view[3] - data.rect[3] + page.view[1],\n ]);\n\n if (!ownMatrix) {\n // When an annotation has its own canvas, then\n // the scale has been already applied to the canvas,\n // so we musn't scale it twice.\n scale = Math.abs(transform[0] || transform[1]);\n const ownTransform = transform.slice();\n for (let i = 0; i < 4; i++) {\n ownTransform[i] = Math.sign(ownTransform[i]);\n }\n ownMatrix = `matrix(${ownTransform.join(\",\")})`;\n }\n\n const left = rect[0] * scale;\n const top = rect[1] * scale;\n element.style.left = `${left}px`;\n element.style.top = `${top}px`;\n element.style.transformOrigin = `${-left}px ${-top}px`;\n element.style.transform = ownMatrix;\n } else {\n element.style.transform = matrix;\n }\n }\n }\n }\n\n this.#setAnnotationCanvasMap(div, annotationCanvasMap);\n div.hidden = false;\n }\n\n static #setAnnotationCanvasMap(div, annotationCanvasMap) {\n if (!annotationCanvasMap) {\n return;\n }\n for (const [id, canvas] of annotationCanvasMap) {\n const element = div.querySelector(`[data-annotation-id=\"${id}\"]`);\n if (!element) {\n continue;\n }\n\n const { firstChild } = element;\n if (firstChild.nodeName === \"CANVAS\") {\n element.replaceChild(canvas, firstChild);\n } else {\n element.insertBefore(canvas, firstChild);\n }\n }\n annotationCanvasMap.clear();\n }\n}\n\nexport { AnnotationLayer };\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\n/**\n * PLEASE NOTE: This file is currently imported in both the `../display/` and\n * `../scripting_api/` folders, hence be EXTREMELY careful about\n * introducing any dependencies here since that can lead to an\n * unexpected/unnecessary size increase of the *built* files.\n */\n\nfunction makeColorComp(n) {\n return Math.floor(Math.max(0, Math.min(1, n)) * 255)\n .toString(16)\n .padStart(2, \"0\");\n}\n\n// PDF specifications section 10.3\nclass ColorConverters {\n static CMYK_G([c, y, m, k]) {\n return [\"G\", 1 - Math.min(1, 0.3 * c + 0.59 * m + 0.11 * y + k)];\n }\n\n static G_CMYK([g]) {\n return [\"CMYK\", 0, 0, 0, 1 - g];\n }\n\n static G_RGB([g]) {\n return [\"RGB\", g, g, g];\n }\n\n static G_HTML([g]) {\n const G = makeColorComp(g);\n return `#${G}${G}${G}`;\n }\n\n static RGB_G([r, g, b]) {\n return [\"G\", 0.3 * r + 0.59 * g + 0.11 * b];\n }\n\n static RGB_HTML([r, g, b]) {\n const R = makeColorComp(r);\n const G = makeColorComp(g);\n const B = makeColorComp(b);\n return `#${R}${G}${B}`;\n }\n\n static T_HTML() {\n return \"#00000000\";\n }\n\n static CMYK_RGB([c, y, m, k]) {\n return [\n \"RGB\",\n 1 - Math.min(1, c + k),\n 1 - Math.min(1, m + k),\n 1 - Math.min(1, y + k),\n ];\n }\n\n static CMYK_HTML(components) {\n return this.RGB_HTML(this.CMYK_RGB(components));\n }\n\n static RGB_CMYK([r, g, b]) {\n const c = 1 - r;\n const m = 1 - g;\n const y = 1 - b;\n const k = Math.min(c, m, y);\n return [\"CMYK\", c, m, y, k];\n }\n}\n\nexport { ColorConverters };\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(\"./display_utils\").PageViewport} PageViewport */\n/** @typedef {import(\"../../web/interfaces\").IPDFLinkService} IPDFLinkService */\n\nimport { XfaText } from \"./xfa_text.js\";\n\n/**\n * @typedef {Object} XfaLayerParameters\n * @property {PageViewport} viewport\n * @property {HTMLDivElement} div\n * @property {Object} xfaHtml\n * @property {AnnotationStorage} [annotationStorage]\n * @property {IPDFLinkService} linkService\n * @property {string} [intent] - (default value is 'display').\n */\n\nclass XfaLayer {\n static setupStorage(html, id, element, storage, intent) {\n const storedData = storage.getValue(id, { value: null });\n switch (element.name) {\n case \"textarea\":\n if (storedData.value !== null) {\n html.textContent = storedData.value;\n }\n if (intent === \"print\") {\n break;\n }\n html.addEventListener(\"input\", event => {\n storage.setValue(id, { value: event.target.value });\n });\n break;\n case \"input\":\n if (\n element.attributes.type === \"radio\" ||\n element.attributes.type === \"checkbox\"\n ) {\n if (storedData.value === element.attributes.xfaOn) {\n html.setAttribute(\"checked\", true);\n } else if (storedData.value === element.attributes.xfaOff) {\n // The checked attribute may have been set when opening the file,\n // unset through the UI and we're here because of printing.\n html.removeAttribute(\"checked\");\n }\n if (intent === \"print\") {\n break;\n }\n html.addEventListener(\"change\", event => {\n storage.setValue(id, {\n value: event.target.checked\n ? event.target.getAttribute(\"xfaOn\")\n : event.target.getAttribute(\"xfaOff\"),\n });\n });\n } else {\n if (storedData.value !== null) {\n html.setAttribute(\"value\", storedData.value);\n }\n if (intent === \"print\") {\n break;\n }\n html.addEventListener(\"input\", event => {\n storage.setValue(id, { value: event.target.value });\n });\n }\n break;\n case \"select\":\n if (storedData.value !== null) {\n for (const option of element.children) {\n if (option.attributes.value === storedData.value) {\n option.attributes.selected = true;\n }\n }\n }\n html.addEventListener(\"input\", event => {\n const options = event.target.options;\n const value =\n options.selectedIndex === -1\n ? \"\"\n : options[options.selectedIndex].value;\n storage.setValue(id, { value });\n });\n break;\n }\n }\n\n static setAttributes({ html, element, storage = null, intent, linkService }) {\n const { attributes } = element;\n const isHTMLAnchorElement = html instanceof HTMLAnchorElement;\n\n if (attributes.type === \"radio\") {\n // Avoid to have a radio group when printing with the same as one\n // already displayed.\n attributes.name = `${attributes.name}-${intent}`;\n }\n for (const [key, value] of Object.entries(attributes)) {\n // We don't need to add dataId in the html object but it can\n // be useful to know its value when writing printing tests:\n // in this case, don't skip dataId to have its value.\n if (value === null || value === undefined || key === \"dataId\") {\n continue;\n }\n\n if (key !== \"style\") {\n if (key === \"textContent\") {\n html.textContent = value;\n } else if (key === \"class\") {\n if (value.length) {\n html.setAttribute(key, value.join(\" \"));\n }\n } else {\n if (isHTMLAnchorElement && (key === \"href\" || key === \"newWindow\")) {\n continue; // Handled below.\n }\n html.setAttribute(key, value);\n }\n } else {\n Object.assign(html.style, value);\n }\n }\n\n if (isHTMLAnchorElement) {\n linkService.addLinkAttributes(\n html,\n attributes.href,\n attributes.newWindow\n );\n }\n\n // Set the value after the others to be sure overwrite\n // any other values.\n if (storage && attributes.dataId) {\n this.setupStorage(html, attributes.dataId, element, storage);\n }\n }\n\n /**\n * Render the XFA layer.\n *\n * @param {XfaLayerParameters} parameters\n */\n static render(parameters) {\n const storage = parameters.annotationStorage;\n const linkService = parameters.linkService;\n const root = parameters.xfaHtml;\n const intent = parameters.intent || \"display\";\n const rootHtml = document.createElement(root.name);\n if (root.attributes) {\n this.setAttributes({\n html: rootHtml,\n element: root,\n intent,\n linkService,\n });\n }\n const stack = [[root, -1, rootHtml]];\n\n const rootDiv = parameters.div;\n rootDiv.appendChild(rootHtml);\n\n if (parameters.viewport) {\n const transform = `matrix(${parameters.viewport.transform.join(\",\")})`;\n rootDiv.style.transform = transform;\n }\n\n // Set defaults.\n if (intent !== \"richText\") {\n rootDiv.setAttribute(\"class\", \"xfaLayer xfaFont\");\n }\n\n // Text nodes used for the text highlighter.\n const textDivs = [];\n\n while (stack.length > 0) {\n const [parent, i, html] = stack[stack.length - 1];\n if (i + 1 === parent.children.length) {\n stack.pop();\n continue;\n }\n\n const child = parent.children[++stack[stack.length - 1][1]];\n if (child === null) {\n continue;\n }\n\n const { name } = child;\n if (name === \"#text\") {\n const node = document.createTextNode(child.value);\n textDivs.push(node);\n html.appendChild(node);\n continue;\n }\n\n let childHtml;\n if (child?.attributes?.xmlns) {\n childHtml = document.createElementNS(child.attributes.xmlns, name);\n } else {\n childHtml = document.createElement(name);\n }\n\n html.appendChild(childHtml);\n if (child.attributes) {\n this.setAttributes({\n html: childHtml,\n element: child,\n storage,\n intent,\n linkService,\n });\n }\n\n if (child.children && child.children.length > 0) {\n stack.push([child, -1, childHtml]);\n } else if (child.value) {\n const node = document.createTextNode(child.value);\n if (XfaText.shouldBuildText(name)) {\n textDivs.push(node);\n }\n childHtml.appendChild(node);\n }\n }\n\n /**\n * TODO: re-enable that stuff once we've JS implementation.\n * See https://bugzilla.mozilla.org/show_bug.cgi?id=1719465.\n *\n * for (const el of rootDiv.querySelectorAll(\n * \".xfaDisabled input, .xfaDisabled textarea\"\n * )) {\n * el.setAttribute(\"disabled\", true);\n * }\n * for (const el of rootDiv.querySelectorAll(\n * \".xfaReadOnly input, .xfaReadOnly textarea\"\n * )) {\n * el.setAttribute(\"readOnly\", true);\n * }\n */\n\n for (const el of rootDiv.querySelectorAll(\n \".xfaNonInteractive input, .xfaNonInteractive textarea\"\n )) {\n el.setAttribute(\"readOnly\", true);\n }\n\n return {\n textDivs,\n };\n }\n\n /**\n * Update the XFA layer.\n *\n * @param {XfaLayerParameters} parameters\n */\n static update(parameters) {\n const transform = `matrix(${parameters.viewport.transform.join(\",\")})`;\n parameters.div.style.transform = transform;\n parameters.div.hidden = false;\n }\n}\n\nexport { XfaLayer };\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 AbortException,\n createPromiseCapability,\n Util,\n} from \"../shared/util.js\";\n\n/**\n * Text layer render parameters.\n *\n * @typedef {Object} TextLayerRenderParameters\n * @property {import(\"./api\").TextContent} [textContent] - Text content to\n * render (the object is returned by the page's `getTextContent` method).\n * @property {ReadableStream} [textContentStream] - Text content stream to\n * render (the stream is returned by the page's `streamTextContent` method).\n * @property {DocumentFragment} container - The DOM node that will contain the\n * text runs.\n * @property {import(\"./display_utils\").PageViewport} viewport - The target\n * viewport to properly layout the text runs.\n * @property {Array<HTMLElement>} [textDivs] - HTML elements that correspond to\n * the text items of the textContent input.\n * This is output and shall initially be set to an empty array.\n * @property {Array<string>} [textContentItemsStr] - Strings that correspond to\n * the `str` property of the text items of the textContent input.\n * This is output and shall initially be set to an empty array.\n * @property {number} [timeout] - Delay in milliseconds before rendering of the\n * text runs occurs.\n * @property {boolean} [enhanceTextSelection] - Whether to turn on the text\n * selection enhancement.\n */\n\nconst MAX_TEXT_DIVS_TO_RENDER = 100000;\nconst DEFAULT_FONT_SIZE = 30;\nconst DEFAULT_FONT_ASCENT = 0.8;\nconst ascentCache = new Map();\nconst AllWhitespaceRegexp = /^\\s+$/g;\n\nfunction getAscent(fontFamily, ctx) {\n const cachedAscent = ascentCache.get(fontFamily);\n if (cachedAscent) {\n return cachedAscent;\n }\n\n ctx.save();\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 ctx.restore();\n const ratio = ascent / (ascent + descent);\n ascentCache.set(fontFamily, ratio);\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.restore();\n\n if (ascent) {\n const ratio = ascent / (ascent + descent);\n ascentCache.set(fontFamily, ratio);\n return ratio;\n }\n\n ascentCache.set(fontFamily, DEFAULT_FONT_ASCENT);\n return DEFAULT_FONT_ASCENT;\n}\n\nfunction appendText(task, geom, styles, ctx) {\n // Initialize all used properties to keep the caches monomorphic.\n const textDiv = document.createElement(\"span\");\n const textDivProperties = task._enhanceTextSelection\n ? {\n angle: 0,\n canvasWidth: 0,\n hasText: geom.str !== \"\",\n hasEOL: geom.hasEOL,\n originalTransform: null,\n paddingBottom: 0,\n paddingLeft: 0,\n paddingRight: 0,\n paddingTop: 0,\n scale: 1,\n }\n : {\n angle: 0,\n canvasWidth: 0,\n hasText: geom.str !== \"\",\n hasEOL: geom.hasEOL,\n };\n\n task._textDivs.push(textDiv);\n\n const tx = Util.transform(task._viewport.transform, geom.transform);\n let angle = Math.atan2(tx[1], tx[0]);\n const style = styles[geom.fontName];\n if (style.vertical) {\n angle += Math.PI / 2;\n }\n const fontHeight = Math.hypot(tx[2], tx[3]);\n const fontAscent = fontHeight * getAscent(style.fontFamily, ctx);\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 // 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 textDiv.style.left = `${left}px`;\n textDiv.style.top = `${top}px`;\n textDiv.style.fontSize = `${fontHeight}px`;\n textDiv.style.fontFamily = style.fontFamily;\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 (task._fontInspectorEnabled) {\n textDiv.dataset.fontName = 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 (\n geom.str.length > 1 ||\n (task._enhanceTextSelection && AllWhitespaceRegexp.test(geom.str))\n ) {\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 if (style.vertical) {\n textDivProperties.canvasWidth = geom.height * task._viewport.scale;\n } else {\n textDivProperties.canvasWidth = geom.width * task._viewport.scale;\n }\n }\n task._textDivProperties.set(textDiv, textDivProperties);\n if (task._textContentStream) {\n task._layoutText(textDiv);\n }\n\n if (task._enhanceTextSelection && textDivProperties.hasText) {\n let angleCos = 1,\n angleSin = 0;\n if (angle !== 0) {\n angleCos = Math.cos(angle);\n angleSin = Math.sin(angle);\n }\n const divWidth =\n (style.vertical ? geom.height : geom.width) * task._viewport.scale;\n const divHeight = fontHeight;\n\n let m, b;\n if (angle !== 0) {\n m = [angleCos, angleSin, -angleSin, angleCos, left, top];\n b = Util.getAxialAlignedBoundingBox([0, 0, divWidth, divHeight], m);\n } else {\n b = [left, top, left + divWidth, top + divHeight];\n }\n\n task._bounds.push({\n left: b[0],\n top: b[1],\n right: b[2],\n bottom: b[3],\n div: textDiv,\n size: [divWidth, divHeight],\n m,\n });\n }\n}\n\nfunction render(task) {\n if (task._canceled) {\n return;\n }\n const textDivs = task._textDivs;\n const capability = task._capability;\n const textDivsLength = textDivs.length;\n\n // No point in rendering many divs as it would make the browser\n // unusable even after the divs are rendered.\n if (textDivsLength > MAX_TEXT_DIVS_TO_RENDER) {\n task._renderingDone = true;\n capability.resolve();\n return;\n }\n\n if (!task._textContentStream) {\n for (let i = 0; i < textDivsLength; i++) {\n task._layoutText(textDivs[i]);\n }\n }\n\n task._renderingDone = true;\n capability.resolve();\n}\n\nfunction findPositiveMin(ts, offset, count) {\n let result = 0;\n for (let i = 0; i < count; i++) {\n const t = ts[offset++];\n if (t > 0) {\n result = result ? Math.min(t, result) : t;\n }\n }\n return result;\n}\n\nfunction expand(task) {\n const bounds = task._bounds;\n const viewport = task._viewport;\n\n const expanded = expandBounds(viewport.width, viewport.height, bounds);\n for (let i = 0; i < expanded.length; i++) {\n const div = bounds[i].div;\n const divProperties = task._textDivProperties.get(div);\n if (divProperties.angle === 0) {\n divProperties.paddingLeft = bounds[i].left - expanded[i].left;\n divProperties.paddingTop = bounds[i].top - expanded[i].top;\n divProperties.paddingRight = expanded[i].right - bounds[i].right;\n divProperties.paddingBottom = expanded[i].bottom - bounds[i].bottom;\n task._textDivProperties.set(div, divProperties);\n continue;\n }\n // Box is rotated -- trying to find padding so rotated div will not\n // exceed its expanded bounds.\n const e = expanded[i],\n b = bounds[i];\n const m = b.m,\n c = m[0],\n s = m[1];\n // Finding intersections with expanded box.\n const points = [[0, 0], [0, b.size[1]], [b.size[0], 0], b.size];\n const ts = new Float64Array(64);\n for (let j = 0, jj = points.length; j < jj; j++) {\n const t = Util.applyTransform(points[j], m);\n ts[j + 0] = c && (e.left - t[0]) / c;\n ts[j + 4] = s && (e.top - t[1]) / s;\n ts[j + 8] = c && (e.right - t[0]) / c;\n ts[j + 12] = s && (e.bottom - t[1]) / s;\n\n ts[j + 16] = s && (e.left - t[0]) / -s;\n ts[j + 20] = c && (e.top - t[1]) / c;\n ts[j + 24] = s && (e.right - t[0]) / -s;\n ts[j + 28] = c && (e.bottom - t[1]) / c;\n\n ts[j + 32] = c && (e.left - t[0]) / -c;\n ts[j + 36] = s && (e.top - t[1]) / -s;\n ts[j + 40] = c && (e.right - t[0]) / -c;\n ts[j + 44] = s && (e.bottom - t[1]) / -s;\n\n ts[j + 48] = s && (e.left - t[0]) / s;\n ts[j + 52] = c && (e.top - t[1]) / -c;\n ts[j + 56] = s && (e.right - t[0]) / s;\n ts[j + 60] = c && (e.bottom - t[1]) / -c;\n }\n // Not based on math, but to simplify calculations, using cos and sin\n // absolute values to not exceed the box (it can but insignificantly).\n const boxScale = 1 + Math.min(Math.abs(c), Math.abs(s));\n divProperties.paddingLeft = findPositiveMin(ts, 32, 16) / boxScale;\n divProperties.paddingTop = findPositiveMin(ts, 48, 16) / boxScale;\n divProperties.paddingRight = findPositiveMin(ts, 0, 16) / boxScale;\n divProperties.paddingBottom = findPositiveMin(ts, 16, 16) / boxScale;\n task._textDivProperties.set(div, divProperties);\n }\n}\n\nfunction expandBounds(width, height, boxes) {\n const bounds = boxes.map(function (box, i) {\n return {\n x1: box.left,\n y1: box.top,\n x2: box.right,\n y2: box.bottom,\n index: i,\n x1New: undefined,\n x2New: undefined,\n };\n });\n expandBoundsLTR(width, bounds);\n\n const expanded = new Array(boxes.length);\n for (const b of bounds) {\n const i = b.index;\n expanded[i] = {\n left: b.x1New,\n top: 0,\n right: b.x2New,\n bottom: 0,\n };\n }\n\n // Rotating on 90 degrees and extending extended boxes. Reusing the bounds\n // array and objects.\n boxes.map(function (box, i) {\n const e = expanded[i],\n b = bounds[i];\n b.x1 = box.top;\n b.y1 = width - e.right;\n b.x2 = box.bottom;\n b.y2 = width - e.left;\n b.index = i;\n b.x1New = undefined;\n b.x2New = undefined;\n });\n expandBoundsLTR(height, bounds);\n\n for (const b of bounds) {\n const i = b.index;\n expanded[i].top = b.x1New;\n expanded[i].bottom = b.x2New;\n }\n return expanded;\n}\n\nfunction expandBoundsLTR(width, bounds) {\n // Sorting by x1 coordinate and walk by the bounds in the same order.\n bounds.sort(function (a, b) {\n return a.x1 - b.x1 || a.index - b.index;\n });\n\n // First we see on the horizon is a fake boundary.\n const fakeBoundary = {\n x1: -Infinity,\n y1: -Infinity,\n x2: 0,\n y2: Infinity,\n index: -1,\n x1New: 0,\n x2New: 0,\n };\n const horizon = [\n {\n start: -Infinity,\n end: Infinity,\n boundary: fakeBoundary,\n },\n ];\n\n for (const boundary of bounds) {\n // Searching for the affected part of horizon.\n // TODO red-black tree or simple binary search\n let i = 0;\n while (i < horizon.length && horizon[i].end <= boundary.y1) {\n i++;\n }\n let j = horizon.length - 1;\n while (j >= 0 && horizon[j].start >= boundary.y2) {\n j--;\n }\n\n let horizonPart, affectedBoundary;\n let q,\n k,\n maxXNew = -Infinity;\n for (q = i; q <= j; q++) {\n horizonPart = horizon[q];\n affectedBoundary = horizonPart.boundary;\n let xNew;\n if (affectedBoundary.x2 > boundary.x1) {\n // In the middle of the previous element, new x shall be at the\n // boundary start. Extending if further if the affected boundary\n // placed on top of the current one.\n xNew =\n affectedBoundary.index > boundary.index\n ? affectedBoundary.x1New\n : boundary.x1;\n } else if (affectedBoundary.x2New === undefined) {\n // We have some space in between, new x in middle will be a fair\n // choice.\n xNew = (affectedBoundary.x2 + boundary.x1) / 2;\n } else {\n // Affected boundary has x2new set, using it as new x.\n xNew = affectedBoundary.x2New;\n }\n if (xNew > maxXNew) {\n maxXNew = xNew;\n }\n }\n\n // Set new x1 for current boundary.\n boundary.x1New = maxXNew;\n\n // Adjusts new x2 for the affected boundaries.\n for (q = i; q <= j; q++) {\n horizonPart = horizon[q];\n affectedBoundary = horizonPart.boundary;\n if (affectedBoundary.x2New === undefined) {\n // Was not set yet, choosing new x if possible.\n if (affectedBoundary.x2 > boundary.x1) {\n // Current and affected boundaries intersect. If affected boundary\n // is placed on top of the current, shrinking the affected.\n if (affectedBoundary.index > boundary.index) {\n affectedBoundary.x2New = affectedBoundary.x2;\n }\n } else {\n affectedBoundary.x2New = maxXNew;\n }\n } else if (affectedBoundary.x2New > maxXNew) {\n // Affected boundary is touching new x, pushing it back.\n affectedBoundary.x2New = Math.max(maxXNew, affectedBoundary.x2);\n }\n }\n\n // Fixing the horizon.\n const changedHorizon = [];\n let lastBoundary = null;\n for (q = i; q <= j; q++) {\n horizonPart = horizon[q];\n affectedBoundary = horizonPart.boundary;\n // Checking which boundary will be visible.\n const useBoundary =\n affectedBoundary.x2 > boundary.x2 ? affectedBoundary : boundary;\n if (lastBoundary === useBoundary) {\n // Merging with previous.\n changedHorizon[changedHorizon.length - 1].end = horizonPart.end;\n } else {\n changedHorizon.push({\n start: horizonPart.start,\n end: horizonPart.end,\n boundary: useBoundary,\n });\n lastBoundary = useBoundary;\n }\n }\n if (horizon[i].start < boundary.y1) {\n changedHorizon[0].start = boundary.y1;\n changedHorizon.unshift({\n start: horizon[i].start,\n end: boundary.y1,\n boundary: horizon[i].boundary,\n });\n }\n if (boundary.y2 < horizon[j].end) {\n changedHorizon[changedHorizon.length - 1].end = boundary.y2;\n changedHorizon.push({\n start: boundary.y2,\n end: horizon[j].end,\n boundary: horizon[j].boundary,\n });\n }\n\n // Set x2 new of boundary that is no longer visible (see overlapping case\n // above).\n // TODO more efficient, e.g. via reference counting.\n for (q = i; q <= j; q++) {\n horizonPart = horizon[q];\n affectedBoundary = horizonPart.boundary;\n if (affectedBoundary.x2New !== undefined) {\n continue;\n }\n let used = false;\n for (\n k = i - 1;\n !used && k >= 0 && horizon[k].start >= affectedBoundary.y1;\n k--\n ) {\n used = horizon[k].boundary === affectedBoundary;\n }\n for (\n k = j + 1;\n !used && k < horizon.length && horizon[k].end <= affectedBoundary.y2;\n k++\n ) {\n used = horizon[k].boundary === affectedBoundary;\n }\n for (k = 0; !used && k < changedHorizon.length; k++) {\n used = changedHorizon[k].boundary === affectedBoundary;\n }\n if (!used) {\n affectedBoundary.x2New = maxXNew;\n }\n }\n\n Array.prototype.splice.apply(\n horizon,\n [i, j - i + 1].concat(changedHorizon)\n );\n }\n\n // Set new x2 for all unset boundaries.\n for (const horizonPart of horizon) {\n const affectedBoundary = horizonPart.boundary;\n if (affectedBoundary.x2New === undefined) {\n affectedBoundary.x2New = Math.max(width, affectedBoundary.x2);\n }\n }\n}\n\nclass TextLayerRenderTask {\n constructor({\n textContent,\n textContentStream,\n container,\n viewport,\n textDivs,\n textContentItemsStr,\n enhanceTextSelection,\n }) {\n this._textContent = textContent;\n this._textContentStream = textContentStream;\n this._container = container;\n this._document = container.ownerDocument;\n this._viewport = viewport;\n this._textDivs = textDivs || [];\n this._textContentItemsStr = textContentItemsStr || [];\n this._enhanceTextSelection = !!enhanceTextSelection;\n this._fontInspectorEnabled = !!globalThis.FontInspector?.enabled;\n\n this._reader = null;\n this._layoutTextLastFontSize = null;\n this._layoutTextLastFontFamily = null;\n this._layoutTextCtx = null;\n this._textDivProperties = new WeakMap();\n this._renderingDone = false;\n this._canceled = false;\n this._capability = createPromiseCapability();\n this._renderTimer = null;\n this._bounds = [];\n\n // Always clean-up the temporary canvas once rendering is no longer pending.\n this._capability.promise\n .finally(() => {\n if (!this._enhanceTextSelection) {\n // The `textDiv` properties are no longer needed.\n this._textDivProperties = null;\n }\n\n if (this._layoutTextCtx) {\n // Zeroing the width and height cause Firefox to release graphics\n // resources immediately, which can greatly reduce memory consumption.\n this._layoutTextCtx.canvas.width = 0;\n this._layoutTextCtx.canvas.height = 0;\n this._layoutTextCtx = null;\n }\n })\n .catch(() => {\n // Avoid \"Uncaught promise\" messages in the console.\n });\n }\n\n /**\n * Promise for textLayer rendering task completion.\n * @type {Promise<void>}\n */\n get promise() {\n return this._capability.promise;\n }\n\n /**\n * Cancel rendering of the textLayer.\n */\n cancel() {\n this._canceled = true;\n if (this._reader) {\n this._reader\n .cancel(new AbortException(\"TextLayer task cancelled.\"))\n .catch(() => {\n // Avoid \"Uncaught promise\" messages in the console.\n });\n this._reader = null;\n }\n if (this._renderTimer !== null) {\n clearTimeout(this._renderTimer);\n this._renderTimer = null;\n }\n this._capability.reject(new Error(\"TextLayer task cancelled.\"));\n }\n\n /**\n * @private\n */\n _processItems(items, styleCache) {\n for (let i = 0, len = items.length; i < len; i++) {\n if (items[i].str === undefined) {\n if (\n items[i].type === \"beginMarkedContentProps\" ||\n items[i].type === \"beginMarkedContent\"\n ) {\n const parent = this._container;\n this._container = document.createElement(\"span\");\n this._container.classList.add(\"markedContent\");\n if (items[i].id !== null) {\n this._container.setAttribute(\"id\", `${items[i].id}`);\n }\n parent.appendChild(this._container);\n } else if (items[i].type === \"endMarkedContent\") {\n this._container = this._container.parentNode;\n }\n continue;\n }\n this._textContentItemsStr.push(items[i].str);\n appendText(this, items[i], styleCache, this._layoutTextCtx);\n }\n }\n\n /**\n * @private\n */\n _layoutText(textDiv) {\n const textDivProperties = this._textDivProperties.get(textDiv);\n\n let transform = \"\";\n if (textDivProperties.canvasWidth !== 0 && textDivProperties.hasText) {\n const { fontSize, fontFamily } = textDiv.style;\n\n // Only build font string and set to context if different from last.\n if (\n fontSize !== this._layoutTextLastFontSize ||\n fontFamily !== this._layoutTextLastFontFamily\n ) {\n this._layoutTextCtx.font = `${fontSize} ${fontFamily}`;\n this._layoutTextLastFontSize = fontSize;\n this._layoutTextLastFontFamily = fontFamily;\n }\n // Only measure the width for multi-char text divs, see `appendText`.\n const { width } = this._layoutTextCtx.measureText(textDiv.textContent);\n\n if (width > 0) {\n const scale = textDivProperties.canvasWidth / width;\n if (this._enhanceTextSelection) {\n textDivProperties.scale = scale;\n }\n transform = `scaleX(${scale})`;\n }\n }\n if (textDivProperties.angle !== 0) {\n transform = `rotate(${textDivProperties.angle}deg) ${transform}`;\n }\n if (transform.length > 0) {\n if (this._enhanceTextSelection) {\n textDivProperties.originalTransform = transform;\n }\n textDiv.style.transform = transform;\n }\n\n if (textDivProperties.hasText) {\n this._container.appendChild(textDiv);\n }\n if (textDivProperties.hasEOL) {\n const br = document.createElement(\"br\");\n br.setAttribute(\"role\", \"presentation\");\n this._container.appendChild(br);\n }\n }\n\n /**\n * @private\n */\n _render(timeout = 0) {\n const capability = createPromiseCapability();\n let styleCache = Object.create(null);\n\n // The temporary canvas is used to measure text length in the DOM.\n const canvas = this._document.createElement(\"canvas\");\n canvas.height = canvas.width = DEFAULT_FONT_SIZE;\n\n this._layoutTextCtx = canvas.getContext(\"2d\", { alpha: false });\n\n if (this._textContent) {\n const textItems = this._textContent.items;\n const textStyles = this._textContent.styles;\n this._processItems(textItems, textStyles);\n capability.resolve();\n } else if (this._textContentStream) {\n const pump = () => {\n this._reader.read().then(({ value, done }) => {\n if (done) {\n capability.resolve();\n return;\n }\n\n Object.assign(styleCache, value.styles);\n this._processItems(value.items, styleCache);\n pump();\n }, capability.reject);\n };\n\n this._reader = this._textContentStream.getReader();\n pump();\n } else {\n throw new Error(\n 'Neither \"textContent\" nor \"textContentStream\" parameters specified.'\n );\n }\n\n capability.promise.then(() => {\n styleCache = null;\n if (!timeout) {\n // Render right away\n render(this);\n } else {\n // Schedule\n this._renderTimer = setTimeout(() => {\n render(this);\n this._renderTimer = null;\n }, timeout);\n }\n }, this._capability.reject);\n }\n\n /**\n * @param {boolean} [expandDivs]\n */\n expandTextDivs(expandDivs = false) {\n if (!this._enhanceTextSelection || !this._renderingDone) {\n return;\n }\n if (this._bounds !== null) {\n expand(this);\n this._bounds = null;\n }\n const transformBuf = [],\n paddingBuf = [];\n\n for (let i = 0, ii = this._textDivs.length; i < ii; i++) {\n const div = this._textDivs[i];\n const divProps = this._textDivProperties.get(div);\n\n if (!divProps.hasText) {\n continue;\n }\n if (expandDivs) {\n transformBuf.length = 0;\n paddingBuf.length = 0;\n\n if (divProps.originalTransform) {\n transformBuf.push(divProps.originalTransform);\n }\n if (divProps.paddingTop > 0) {\n paddingBuf.push(`${divProps.paddingTop}px`);\n transformBuf.push(`translateY(${-divProps.paddingTop}px)`);\n } else {\n paddingBuf.push(0);\n }\n if (divProps.paddingRight > 0) {\n paddingBuf.push(`${divProps.paddingRight / divProps.scale}px`);\n } else {\n paddingBuf.push(0);\n }\n if (divProps.paddingBottom > 0) {\n paddingBuf.push(`${divProps.paddingBottom}px`);\n } else {\n paddingBuf.push(0);\n }\n if (divProps.paddingLeft > 0) {\n paddingBuf.push(`${divProps.paddingLeft / divProps.scale}px`);\n transformBuf.push(\n `translateX(${-divProps.paddingLeft / divProps.scale}px)`\n );\n } else {\n paddingBuf.push(0);\n }\n\n div.style.padding = paddingBuf.join(\" \");\n if (transformBuf.length) {\n div.style.transform = transformBuf.join(\" \");\n }\n } else {\n div.style.padding = null;\n div.style.transform = divProps.originalTransform;\n }\n }\n }\n}\n\n/**\n * @param {TextLayerRenderParameters} renderParameters\n * @returns {TextLayerRenderTask}\n */\nfunction renderTextLayer(renderParameters) {\n const task = new TextLayerRenderTask({\n textContent: renderParameters.textContent,\n textContentStream: renderParameters.textContentStream,\n container: renderParameters.container,\n viewport: renderParameters.viewport,\n textDivs: renderParameters.textDivs,\n textContentItemsStr: renderParameters.textContentItemsStr,\n enhanceTextSelection: renderParameters.enhanceTextSelection,\n });\n task._render(renderParameters.timeout);\n return task;\n}\n\nexport { renderTextLayer };\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/* globals __non_webpack_require__ */\n\nimport {\n FONT_IDENTITY_MATRIX,\n IDENTITY_MATRIX,\n ImageKind,\n OPS,\n TextRenderingMode,\n unreachable,\n Util,\n warn,\n} from \"../shared/util.js\";\nimport { DOMSVGFactory } from \"./display_utils.js\";\nimport { isNodeJS } from \"../shared/is_node.js\";\n\n/** @type {any} */\nlet SVGGraphics = class {\n constructor() {\n unreachable(\"Not implemented: SVGGraphics\");\n }\n};\n\nif (\n typeof PDFJSDev === \"undefined\" ||\n PDFJSDev.test(\"!PRODUCTION || GENERIC\")\n) {\n const SVG_DEFAULTS = {\n fontStyle: \"normal\",\n fontWeight: \"normal\",\n fillColor: \"#000000\",\n };\n const XML_NS = \"http://www.w3.org/XML/1998/namespace\";\n const XLINK_NS = \"http://www.w3.org/1999/xlink\";\n const LINE_CAP_STYLES = [\"butt\", \"round\", \"square\"];\n const LINE_JOIN_STYLES = [\"miter\", \"round\", \"bevel\"];\n\n const createObjectURL = function (\n data,\n contentType = \"\",\n forceDataSchema = false\n ) {\n if (\n URL.createObjectURL &&\n typeof Blob !== \"undefined\" &&\n !forceDataSchema\n ) {\n return URL.createObjectURL(new Blob([data], { type: contentType }));\n }\n // Blob/createObjectURL is not available, falling back to data schema.\n const digits =\n \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\";\n\n let buffer = `data:${contentType};base64,`;\n for (let i = 0, ii = data.length; i < ii; i += 3) {\n const b1 = data[i] & 0xff;\n const b2 = data[i + 1] & 0xff;\n const b3 = data[i + 2] & 0xff;\n const d1 = b1 >> 2,\n d2 = ((b1 & 3) << 4) | (b2 >> 4);\n const d3 = i + 1 < ii ? ((b2 & 0xf) << 2) | (b3 >> 6) : 64;\n const d4 = i + 2 < ii ? b3 & 0x3f : 64;\n buffer += digits[d1] + digits[d2] + digits[d3] + digits[d4];\n }\n return buffer;\n };\n\n const convertImgDataToPng = (function () {\n const PNG_HEADER = new Uint8Array([\n 0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a,\n ]);\n const CHUNK_WRAPPER_SIZE = 12;\n\n const crcTable = new Int32Array(256);\n for (let i = 0; i < 256; i++) {\n let c = i;\n for (let h = 0; h < 8; h++) {\n if (c & 1) {\n c = 0xedb88320 ^ ((c >> 1) & 0x7fffffff);\n } else {\n c = (c >> 1) & 0x7fffffff;\n }\n }\n crcTable[i] = c;\n }\n\n function crc32(data, start, end) {\n let crc = -1;\n for (let i = start; i < end; i++) {\n const a = (crc ^ data[i]) & 0xff;\n const b = crcTable[a];\n crc = (crc >>> 8) ^ b;\n }\n return crc ^ -1;\n }\n\n function writePngChunk(type, body, data, offset) {\n let p = offset;\n const len = body.length;\n\n data[p] = (len >> 24) & 0xff;\n data[p + 1] = (len >> 16) & 0xff;\n data[p + 2] = (len >> 8) & 0xff;\n data[p + 3] = len & 0xff;\n p += 4;\n\n data[p] = type.charCodeAt(0) & 0xff;\n data[p + 1] = type.charCodeAt(1) & 0xff;\n data[p + 2] = type.charCodeAt(2) & 0xff;\n data[p + 3] = type.charCodeAt(3) & 0xff;\n p += 4;\n\n data.set(body, p);\n p += body.length;\n\n const crc = crc32(data, offset + 4, p);\n data[p] = (crc >> 24) & 0xff;\n data[p + 1] = (crc >> 16) & 0xff;\n data[p + 2] = (crc >> 8) & 0xff;\n data[p + 3] = crc & 0xff;\n }\n\n function adler32(data, start, end) {\n let a = 1;\n let b = 0;\n for (let i = start; i < end; ++i) {\n a = (a + (data[i] & 0xff)) % 65521;\n b = (b + a) % 65521;\n }\n return (b << 16) | a;\n }\n\n /**\n * @param {Uint8Array} literals The input data.\n * @returns {Uint8Array} The DEFLATE-compressed data stream in zlib format.\n * This is the required format for compressed streams in the PNG format:\n * http://www.libpng.org/pub/png/spec/1.2/PNG-Compression.html\n */\n function deflateSync(literals) {\n if (!isNodeJS) {\n // zlib is certainly not available outside of Node.js. We can either use\n // the pako library for client-side DEFLATE compression, or use the\n // canvas API of the browser to obtain a more optimal PNG file.\n return deflateSyncUncompressed(literals);\n }\n try {\n // NOTE: This implementation is far from perfect, but already way better\n // than not applying any compression.\n //\n // A better algorithm will try to choose a good predictor/filter and\n // then choose a suitable zlib compression strategy (e.g. 3,Z_RLE).\n //\n // Node v0.11.12 zlib.deflateSync is introduced (and returns a Buffer).\n // Node v3.0.0 Buffer inherits from Uint8Array.\n // Node v8.0.0 zlib.deflateSync accepts Uint8Array as input.\n let input;\n // eslint-disable-next-line no-undef\n if (parseInt(process.versions.node) >= 8) {\n input = literals;\n } else {\n // eslint-disable-next-line no-undef\n input = Buffer.from(literals);\n }\n const output = __non_webpack_require__(\"zlib\").deflateSync(input, {\n level: 9,\n });\n return output instanceof Uint8Array ? output : new Uint8Array(output);\n } catch (e) {\n warn(\n \"Not compressing PNG because zlib.deflateSync is unavailable: \" + e\n );\n }\n\n return deflateSyncUncompressed(literals);\n }\n\n // An implementation of DEFLATE with compression level 0 (Z_NO_COMPRESSION).\n function deflateSyncUncompressed(literals) {\n let len = literals.length;\n const maxBlockLength = 0xffff;\n\n const deflateBlocks = Math.ceil(len / maxBlockLength);\n const idat = new Uint8Array(2 + len + deflateBlocks * 5 + 4);\n let pi = 0;\n idat[pi++] = 0x78; // compression method and flags\n idat[pi++] = 0x9c; // flags\n\n let pos = 0;\n while (len > maxBlockLength) {\n // writing non-final DEFLATE blocks type 0 and length of 65535\n idat[pi++] = 0x00;\n idat[pi++] = 0xff;\n idat[pi++] = 0xff;\n idat[pi++] = 0x00;\n idat[pi++] = 0x00;\n idat.set(literals.subarray(pos, pos + maxBlockLength), pi);\n pi += maxBlockLength;\n pos += maxBlockLength;\n len -= maxBlockLength;\n }\n\n // writing non-final DEFLATE blocks type 0\n idat[pi++] = 0x01;\n idat[pi++] = len & 0xff;\n idat[pi++] = (len >> 8) & 0xff;\n idat[pi++] = ~len & 0xffff & 0xff;\n idat[pi++] = ((~len & 0xffff) >> 8) & 0xff;\n idat.set(literals.subarray(pos), pi);\n pi += literals.length - pos;\n\n const adler = adler32(literals, 0, literals.length); // checksum\n idat[pi++] = (adler >> 24) & 0xff;\n idat[pi++] = (adler >> 16) & 0xff;\n idat[pi++] = (adler >> 8) & 0xff;\n idat[pi++] = adler & 0xff;\n return idat;\n }\n\n function encode(imgData, kind, forceDataSchema, isMask) {\n const width = imgData.width;\n const height = imgData.height;\n let bitDepth, colorType, lineSize;\n const bytes = imgData.data;\n\n switch (kind) {\n case ImageKind.GRAYSCALE_1BPP:\n colorType = 0;\n bitDepth = 1;\n lineSize = (width + 7) >> 3;\n break;\n case ImageKind.RGB_24BPP:\n colorType = 2;\n bitDepth = 8;\n lineSize = width * 3;\n break;\n case ImageKind.RGBA_32BPP:\n colorType = 6;\n bitDepth = 8;\n lineSize = width * 4;\n break;\n default:\n throw new Error(\"invalid format\");\n }\n\n // prefix every row with predictor 0\n const literals = new Uint8Array((1 + lineSize) * height);\n let offsetLiterals = 0,\n offsetBytes = 0;\n for (let y = 0; y < height; ++y) {\n literals[offsetLiterals++] = 0; // no prediction\n literals.set(\n bytes.subarray(offsetBytes, offsetBytes + lineSize),\n offsetLiterals\n );\n offsetBytes += lineSize;\n offsetLiterals += lineSize;\n }\n\n if (kind === ImageKind.GRAYSCALE_1BPP && isMask) {\n // inverting for image masks\n offsetLiterals = 0;\n for (let y = 0; y < height; y++) {\n offsetLiterals++; // skipping predictor\n for (let i = 0; i < lineSize; i++) {\n literals[offsetLiterals++] ^= 0xff;\n }\n }\n }\n\n const ihdr = new Uint8Array([\n (width >> 24) & 0xff,\n (width >> 16) & 0xff,\n (width >> 8) & 0xff,\n width & 0xff,\n (height >> 24) & 0xff,\n (height >> 16) & 0xff,\n (height >> 8) & 0xff,\n height & 0xff,\n bitDepth, // bit depth\n colorType, // color type\n 0x00, // compression method\n 0x00, // filter method\n 0x00, // interlace method\n ]);\n const idat = deflateSync(literals);\n\n // PNG consists of: header, IHDR+data, IDAT+data, and IEND.\n const pngLength =\n PNG_HEADER.length + CHUNK_WRAPPER_SIZE * 3 + ihdr.length + idat.length;\n const data = new Uint8Array(pngLength);\n let offset = 0;\n data.set(PNG_HEADER, offset);\n offset += PNG_HEADER.length;\n writePngChunk(\"IHDR\", ihdr, data, offset);\n offset += CHUNK_WRAPPER_SIZE + ihdr.length;\n writePngChunk(\"IDATA\", idat, data, offset);\n offset += CHUNK_WRAPPER_SIZE + idat.length;\n writePngChunk(\"IEND\", new Uint8Array(0), data, offset);\n\n return createObjectURL(data, \"image/png\", forceDataSchema);\n }\n\n // eslint-disable-next-line no-shadow\n return function convertImgDataToPng(imgData, forceDataSchema, isMask) {\n const kind =\n imgData.kind === undefined ? ImageKind.GRAYSCALE_1BPP : imgData.kind;\n return encode(imgData, kind, forceDataSchema, isMask);\n };\n })();\n\n class SVGExtraState {\n constructor() {\n this.fontSizeScale = 1;\n this.fontWeight = SVG_DEFAULTS.fontWeight;\n this.fontSize = 0;\n\n this.textMatrix = IDENTITY_MATRIX;\n this.fontMatrix = FONT_IDENTITY_MATRIX;\n this.leading = 0;\n this.textRenderingMode = TextRenderingMode.FILL;\n this.textMatrixScale = 1;\n\n // Current point (in user coordinates)\n this.x = 0;\n this.y = 0;\n\n // Start of text line (in text coordinates)\n this.lineX = 0;\n this.lineY = 0;\n\n // Character and word spacing\n this.charSpacing = 0;\n this.wordSpacing = 0;\n this.textHScale = 1;\n this.textRise = 0;\n\n // Default foreground and background colors\n this.fillColor = SVG_DEFAULTS.fillColor;\n this.strokeColor = \"#000000\";\n\n this.fillAlpha = 1;\n this.strokeAlpha = 1;\n this.lineWidth = 1;\n this.lineJoin = \"\";\n this.lineCap = \"\";\n this.miterLimit = 0;\n\n this.dashArray = [];\n this.dashPhase = 0;\n\n this.dependencies = [];\n\n // Clipping\n this.activeClipUrl = null;\n this.clipGroup = null;\n\n this.maskId = \"\";\n }\n\n clone() {\n return Object.create(this);\n }\n\n setCurrentPoint(x, y) {\n this.x = x;\n this.y = y;\n }\n }\n\n // eslint-disable-next-line no-inner-declarations\n function opListToTree(opList) {\n let opTree = [];\n const tmp = [];\n\n for (const opListElement of opList) {\n if (opListElement.fn === \"save\") {\n opTree.push({ fnId: 92, fn: \"group\", items: [] });\n tmp.push(opTree);\n opTree = opTree[opTree.length - 1].items;\n continue;\n }\n\n if (opListElement.fn === \"restore\") {\n opTree = tmp.pop();\n } else {\n opTree.push(opListElement);\n }\n }\n return opTree;\n }\n\n /**\n * Format a float number as a string.\n *\n * @param value {number} - The float number to format.\n * @returns {string}\n */\n // eslint-disable-next-line no-inner-declarations\n function pf(value) {\n if (Number.isInteger(value)) {\n return value.toString();\n }\n const s = value.toFixed(10);\n let i = s.length - 1;\n if (s[i] !== \"0\") {\n return s;\n }\n\n // Remove trailing zeros.\n do {\n i--;\n } while (s[i] === \"0\");\n return s.substring(0, s[i] === \".\" ? i : i + 1);\n }\n\n /**\n * Format a transform matrix as a string. The standard rotation, scale and\n * translation matrices are replaced by their shorter forms, and for\n * identity matrices an empty string is returned to save memory.\n *\n * @param m {Array} - The transform matrix to format.\n * @returns {string}\n */\n // eslint-disable-next-line no-inner-declarations\n function pm(m) {\n if (m[4] === 0 && m[5] === 0) {\n if (m[1] === 0 && m[2] === 0) {\n if (m[0] === 1 && m[3] === 1) {\n return \"\";\n }\n return `scale(${pf(m[0])} ${pf(m[3])})`;\n }\n if (m[0] === m[3] && m[1] === -m[2]) {\n const a = (Math.acos(m[0]) * 180) / Math.PI;\n return `rotate(${pf(a)})`;\n }\n } else {\n if (m[0] === 1 && m[1] === 0 && m[2] === 0 && m[3] === 1) {\n return `translate(${pf(m[4])} ${pf(m[5])})`;\n }\n }\n return (\n `matrix(${pf(m[0])} ${pf(m[1])} ${pf(m[2])} ${pf(m[3])} ${pf(m[4])} ` +\n `${pf(m[5])})`\n );\n }\n\n // The counts below are relevant for all pages, so they have to be global\n // instead of being members of `SVGGraphics` (which is recreated for\n // each page).\n let clipCount = 0;\n let maskCount = 0;\n let shadingCount = 0;\n\n SVGGraphics = class {\n constructor(commonObjs, objs, forceDataSchema = false) {\n this.svgFactory = new DOMSVGFactory();\n\n this.current = new SVGExtraState();\n this.transformMatrix = IDENTITY_MATRIX; // Graphics state matrix\n this.transformStack = [];\n this.extraStack = [];\n this.commonObjs = commonObjs;\n this.objs = objs;\n this.pendingClip = null;\n this.pendingEOFill = false;\n\n this.embedFonts = false;\n this.embeddedFonts = Object.create(null);\n this.cssStyle = null;\n this.forceDataSchema = !!forceDataSchema;\n\n // In `src/shared/util.js` the operator names are mapped to IDs.\n // The list below represents the reverse of that, i.e., it maps IDs\n // to operator names.\n this._operatorIdMapping = [];\n for (const op in OPS) {\n this._operatorIdMapping[OPS[op]] = op;\n }\n }\n\n save() {\n this.transformStack.push(this.transformMatrix);\n const old = this.current;\n this.extraStack.push(old);\n this.current = old.clone();\n }\n\n restore() {\n this.transformMatrix = this.transformStack.pop();\n this.current = this.extraStack.pop();\n this.pendingClip = null;\n this.tgrp = null;\n }\n\n group(items) {\n this.save();\n this.executeOpTree(items);\n this.restore();\n }\n\n loadDependencies(operatorList) {\n const fnArray = operatorList.fnArray;\n const argsArray = operatorList.argsArray;\n\n for (let i = 0, ii = fnArray.length; i < ii; i++) {\n if (fnArray[i] !== OPS.dependency) {\n continue;\n }\n\n for (const obj of argsArray[i]) {\n const objsPool = obj.startsWith(\"g_\") ? this.commonObjs : this.objs;\n const promise = new Promise(resolve => {\n objsPool.get(obj, resolve);\n });\n this.current.dependencies.push(promise);\n }\n }\n return Promise.all(this.current.dependencies);\n }\n\n transform(a, b, c, d, e, f) {\n const transformMatrix = [a, b, c, d, e, f];\n this.transformMatrix = Util.transform(\n this.transformMatrix,\n transformMatrix\n );\n this.tgrp = null;\n }\n\n getSVG(operatorList, viewport) {\n this.viewport = viewport;\n\n const svgElement = this._initialize(viewport);\n return this.loadDependencies(operatorList).then(() => {\n this.transformMatrix = IDENTITY_MATRIX;\n this.executeOpTree(this.convertOpList(operatorList));\n return svgElement;\n });\n }\n\n convertOpList(operatorList) {\n const operatorIdMapping = this._operatorIdMapping;\n const argsArray = operatorList.argsArray;\n const fnArray = operatorList.fnArray;\n const opList = [];\n for (let i = 0, ii = fnArray.length; i < ii; i++) {\n const fnId = fnArray[i];\n opList.push({\n fnId,\n fn: operatorIdMapping[fnId],\n args: argsArray[i],\n });\n }\n return opListToTree(opList);\n }\n\n executeOpTree(opTree) {\n for (const opTreeElement of opTree) {\n const fn = opTreeElement.fn;\n const fnId = opTreeElement.fnId;\n const args = opTreeElement.args;\n\n switch (fnId | 0) {\n case OPS.beginText:\n this.beginText();\n break;\n case OPS.dependency:\n // Handled in `loadDependencies`, so no warning should be shown.\n break;\n case OPS.setLeading:\n this.setLeading(args);\n break;\n case OPS.setLeadingMoveText:\n this.setLeadingMoveText(args[0], args[1]);\n break;\n case OPS.setFont:\n this.setFont(args);\n break;\n case OPS.showText:\n this.showText(args[0]);\n break;\n case OPS.showSpacedText:\n this.showText(args[0]);\n break;\n case OPS.endText:\n this.endText();\n break;\n case OPS.moveText:\n this.moveText(args[0], args[1]);\n break;\n case OPS.setCharSpacing:\n this.setCharSpacing(args[0]);\n break;\n case OPS.setWordSpacing:\n this.setWordSpacing(args[0]);\n break;\n case OPS.setHScale:\n this.setHScale(args[0]);\n break;\n case OPS.setTextMatrix:\n this.setTextMatrix(\n args[0],\n args[1],\n args[2],\n args[3],\n args[4],\n args[5]\n );\n break;\n case OPS.setTextRise:\n this.setTextRise(args[0]);\n break;\n case OPS.setTextRenderingMode:\n this.setTextRenderingMode(args[0]);\n break;\n case OPS.setLineWidth:\n this.setLineWidth(args[0]);\n break;\n case OPS.setLineJoin:\n this.setLineJoin(args[0]);\n break;\n case OPS.setLineCap:\n this.setLineCap(args[0]);\n break;\n case OPS.setMiterLimit:\n this.setMiterLimit(args[0]);\n break;\n case OPS.setFillRGBColor:\n this.setFillRGBColor(args[0], args[1], args[2]);\n break;\n case OPS.setStrokeRGBColor:\n this.setStrokeRGBColor(args[0], args[1], args[2]);\n break;\n case OPS.setStrokeColorN:\n this.setStrokeColorN(args);\n break;\n case OPS.setFillColorN:\n this.setFillColorN(args);\n break;\n case OPS.shadingFill:\n this.shadingFill(args[0]);\n break;\n case OPS.setDash:\n this.setDash(args[0], args[1]);\n break;\n case OPS.setRenderingIntent:\n this.setRenderingIntent(args[0]);\n break;\n case OPS.setFlatness:\n this.setFlatness(args[0]);\n break;\n case OPS.setGState:\n this.setGState(args[0]);\n break;\n case OPS.fill:\n this.fill();\n break;\n case OPS.eoFill:\n this.eoFill();\n break;\n case OPS.stroke:\n this.stroke();\n break;\n case OPS.fillStroke:\n this.fillStroke();\n break;\n case OPS.eoFillStroke:\n this.eoFillStroke();\n break;\n case OPS.clip:\n this.clip(\"nonzero\");\n break;\n case OPS.eoClip:\n this.clip(\"evenodd\");\n break;\n case OPS.paintSolidColorImageMask:\n this.paintSolidColorImageMask();\n break;\n case OPS.paintImageXObject:\n this.paintImageXObject(args[0]);\n break;\n case OPS.paintInlineImageXObject:\n this.paintInlineImageXObject(args[0]);\n break;\n case OPS.paintImageMaskXObject:\n this.paintImageMaskXObject(args[0]);\n break;\n case OPS.paintFormXObjectBegin:\n this.paintFormXObjectBegin(args[0], args[1]);\n break;\n case OPS.paintFormXObjectEnd:\n this.paintFormXObjectEnd();\n break;\n case OPS.closePath:\n this.closePath();\n break;\n case OPS.closeStroke:\n this.closeStroke();\n break;\n case OPS.closeFillStroke:\n this.closeFillStroke();\n break;\n case OPS.closeEOFillStroke:\n this.closeEOFillStroke();\n break;\n case OPS.nextLine:\n this.nextLine();\n break;\n case OPS.transform:\n this.transform(\n args[0],\n args[1],\n args[2],\n args[3],\n args[4],\n args[5]\n );\n break;\n case OPS.constructPath:\n this.constructPath(args[0], args[1]);\n break;\n case OPS.endPath:\n this.endPath();\n break;\n case 92:\n this.group(opTreeElement.items);\n break;\n default:\n warn(`Unimplemented operator ${fn}`);\n break;\n }\n }\n }\n\n setWordSpacing(wordSpacing) {\n this.current.wordSpacing = wordSpacing;\n }\n\n setCharSpacing(charSpacing) {\n this.current.charSpacing = charSpacing;\n }\n\n nextLine() {\n this.moveText(0, this.current.leading);\n }\n\n setTextMatrix(a, b, c, d, e, f) {\n const current = this.current;\n current.textMatrix = current.lineMatrix = [a, b, c, d, e, f];\n current.textMatrixScale = Math.hypot(a, b);\n\n current.x = current.lineX = 0;\n current.y = current.lineY = 0;\n\n current.xcoords = [];\n current.ycoords = [];\n current.tspan = this.svgFactory.createElement(\"svg:tspan\");\n current.tspan.setAttributeNS(null, \"font-family\", current.fontFamily);\n current.tspan.setAttributeNS(\n null,\n \"font-size\",\n `${pf(current.fontSize)}px`\n );\n current.tspan.setAttributeNS(null, \"y\", pf(-current.y));\n\n current.txtElement = this.svgFactory.createElement(\"svg:text\");\n current.txtElement.appendChild(current.tspan);\n }\n\n beginText() {\n const current = this.current;\n current.x = current.lineX = 0;\n current.y = current.lineY = 0;\n current.textMatrix = IDENTITY_MATRIX;\n current.lineMatrix = IDENTITY_MATRIX;\n current.textMatrixScale = 1;\n current.tspan = this.svgFactory.createElement(\"svg:tspan\");\n current.txtElement = this.svgFactory.createElement(\"svg:text\");\n current.txtgrp = this.svgFactory.createElement(\"svg:g\");\n current.xcoords = [];\n current.ycoords = [];\n }\n\n moveText(x, y) {\n const current = this.current;\n current.x = current.lineX += x;\n current.y = current.lineY += y;\n\n current.xcoords = [];\n current.ycoords = [];\n current.tspan = this.svgFactory.createElement(\"svg:tspan\");\n current.tspan.setAttributeNS(null, \"font-family\", current.fontFamily);\n current.tspan.setAttributeNS(\n null,\n \"font-size\",\n `${pf(current.fontSize)}px`\n );\n current.tspan.setAttributeNS(null, \"y\", pf(-current.y));\n }\n\n showText(glyphs) {\n const current = this.current;\n const font = current.font;\n const fontSize = current.fontSize;\n if (fontSize === 0) {\n return;\n }\n\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 vertical = font.vertical;\n const spacingDir = vertical ? 1 : -1;\n const defaultVMetrics = font.defaultVMetrics;\n const widthAdvanceScale = fontSize * current.fontMatrix[0];\n\n let x = 0;\n for (const glyph of glyphs) {\n if (glyph === null) {\n // Word break\n x += fontDirection * wordSpacing;\n continue;\n } else if (typeof glyph === \"number\") {\n x += (spacingDir * glyph * fontSize) / 1000;\n continue;\n }\n\n const spacing = (glyph.isSpace ? wordSpacing : 0) + charSpacing;\n const character = glyph.fontChar;\n let scaledX, scaledY;\n let width = glyph.width;\n if (vertical) {\n let vx;\n const vmetric = glyph.vmetric || defaultVMetrics;\n vx = glyph.vmetric ? vmetric[1] : width * 0.5;\n vx = -vx * 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 (glyph.isInFont || font.missingFile) {\n current.xcoords.push(current.x + scaledX);\n if (vertical) {\n current.ycoords.push(-current.y + scaledY);\n }\n current.tspan.textContent += character;\n } else {\n // TODO: To assist with text selection, we should replace the missing\n // character with a space character if charWidth is not zero.\n // But we cannot just do \"character = ' '\", because the ' ' character\n // might actually map to a different glyph.\n }\n\n let charWidth;\n if (vertical) {\n charWidth = width * widthAdvanceScale - spacing * fontDirection;\n } else {\n charWidth = width * widthAdvanceScale + spacing * fontDirection;\n }\n\n x += charWidth;\n }\n current.tspan.setAttributeNS(\n null,\n \"x\",\n current.xcoords.map(pf).join(\" \")\n );\n if (vertical) {\n current.tspan.setAttributeNS(\n null,\n \"y\",\n current.ycoords.map(pf).join(\" \")\n );\n } else {\n current.tspan.setAttributeNS(null, \"y\", pf(-current.y));\n }\n\n if (vertical) {\n current.y -= x;\n } else {\n current.x += x * textHScale;\n }\n\n current.tspan.setAttributeNS(null, \"font-family\", current.fontFamily);\n current.tspan.setAttributeNS(\n null,\n \"font-size\",\n `${pf(current.fontSize)}px`\n );\n if (current.fontStyle !== SVG_DEFAULTS.fontStyle) {\n current.tspan.setAttributeNS(null, \"font-style\", current.fontStyle);\n }\n if (current.fontWeight !== SVG_DEFAULTS.fontWeight) {\n current.tspan.setAttributeNS(null, \"font-weight\", current.fontWeight);\n }\n\n const fillStrokeMode =\n current.textRenderingMode & TextRenderingMode.FILL_STROKE_MASK;\n if (\n fillStrokeMode === TextRenderingMode.FILL ||\n fillStrokeMode === TextRenderingMode.FILL_STROKE\n ) {\n if (current.fillColor !== SVG_DEFAULTS.fillColor) {\n current.tspan.setAttributeNS(null, \"fill\", current.fillColor);\n }\n if (current.fillAlpha < 1) {\n current.tspan.setAttributeNS(null, \"fill-opacity\", current.fillAlpha);\n }\n } else if (current.textRenderingMode === TextRenderingMode.ADD_TO_PATH) {\n // Workaround for Firefox: We must set fill=\"transparent\" because\n // fill=\"none\" would generate an empty clipping path.\n current.tspan.setAttributeNS(null, \"fill\", \"transparent\");\n } else {\n current.tspan.setAttributeNS(null, \"fill\", \"none\");\n }\n\n if (\n fillStrokeMode === TextRenderingMode.STROKE ||\n fillStrokeMode === TextRenderingMode.FILL_STROKE\n ) {\n const lineWidthScale = 1 / (current.textMatrixScale || 1);\n this._setStrokeAttributes(current.tspan, lineWidthScale);\n }\n\n // Include the text rise in the text matrix since the `pm` function\n // creates the SVG element's `translate` entry (work on a copy to avoid\n // altering the original text matrix).\n let textMatrix = current.textMatrix;\n if (current.textRise !== 0) {\n textMatrix = textMatrix.slice();\n textMatrix[5] += current.textRise;\n }\n\n current.txtElement.setAttributeNS(\n null,\n \"transform\",\n `${pm(textMatrix)} scale(${pf(textHScale)}, -1)`\n );\n current.txtElement.setAttributeNS(XML_NS, \"xml:space\", \"preserve\");\n current.txtElement.appendChild(current.tspan);\n current.txtgrp.appendChild(current.txtElement);\n\n this._ensureTransformGroup().appendChild(current.txtElement);\n }\n\n setLeadingMoveText(x, y) {\n this.setLeading(-y);\n this.moveText(x, y);\n }\n\n addFontStyle(fontObj) {\n if (!fontObj.data) {\n throw new Error(\n \"addFontStyle: No font data available, \" +\n 'ensure that the \"fontExtraProperties\" API parameter is set.'\n );\n }\n if (!this.cssStyle) {\n this.cssStyle = this.svgFactory.createElement(\"svg:style\");\n this.cssStyle.setAttributeNS(null, \"type\", \"text/css\");\n this.defs.appendChild(this.cssStyle);\n }\n\n const url = createObjectURL(\n fontObj.data,\n fontObj.mimetype,\n this.forceDataSchema\n );\n this.cssStyle.textContent +=\n `@font-face { font-family: \"${fontObj.loadedName}\";` +\n ` src: url(${url}); }\\n`;\n }\n\n setFont(details) {\n const current = this.current;\n const fontObj = this.commonObjs.get(details[0]);\n let size = details[1];\n current.font = fontObj;\n\n if (\n this.embedFonts &&\n !fontObj.missingFile &&\n !this.embeddedFonts[fontObj.loadedName]\n ) {\n this.addFontStyle(fontObj);\n this.embeddedFonts[fontObj.loadedName] = fontObj;\n }\n current.fontMatrix = fontObj.fontMatrix || FONT_IDENTITY_MATRIX;\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 if (size < 0) {\n size = -size;\n current.fontDirection = -1;\n } else {\n current.fontDirection = 1;\n }\n current.fontSize = size;\n current.fontFamily = fontObj.loadedName;\n current.fontWeight = bold;\n current.fontStyle = italic;\n\n current.tspan = this.svgFactory.createElement(\"svg:tspan\");\n current.tspan.setAttributeNS(null, \"y\", pf(-current.y));\n current.xcoords = [];\n current.ycoords = [];\n }\n\n endText() {\n const current = this.current;\n if (\n current.textRenderingMode & TextRenderingMode.ADD_TO_PATH_FLAG &&\n current.txtElement?.hasChildNodes()\n ) {\n // If no glyphs are shown (i.e. no child nodes), no clipping occurs.\n current.element = current.txtElement;\n this.clip(\"nonzero\");\n this.endPath();\n }\n }\n\n // Path properties\n setLineWidth(width) {\n if (width > 0) {\n this.current.lineWidth = width;\n }\n }\n\n setLineCap(style) {\n this.current.lineCap = LINE_CAP_STYLES[style];\n }\n\n setLineJoin(style) {\n this.current.lineJoin = LINE_JOIN_STYLES[style];\n }\n\n setMiterLimit(limit) {\n this.current.miterLimit = limit;\n }\n\n setStrokeAlpha(strokeAlpha) {\n this.current.strokeAlpha = strokeAlpha;\n }\n\n setStrokeRGBColor(r, g, b) {\n this.current.strokeColor = Util.makeHexColor(r, g, b);\n }\n\n setFillAlpha(fillAlpha) {\n this.current.fillAlpha = fillAlpha;\n }\n\n setFillRGBColor(r, g, b) {\n this.current.fillColor = Util.makeHexColor(r, g, b);\n this.current.tspan = this.svgFactory.createElement(\"svg:tspan\");\n this.current.xcoords = [];\n this.current.ycoords = [];\n }\n\n setStrokeColorN(args) {\n this.current.strokeColor = this._makeColorN_Pattern(args);\n }\n\n setFillColorN(args) {\n this.current.fillColor = this._makeColorN_Pattern(args);\n }\n\n shadingFill(args) {\n const width = this.viewport.width;\n const height = this.viewport.height;\n const inv = Util.inverseTransform(this.transformMatrix);\n const bl = Util.applyTransform([0, 0], inv);\n const br = Util.applyTransform([0, height], inv);\n const ul = Util.applyTransform([width, 0], inv);\n const ur = Util.applyTransform([width, height], inv);\n const x0 = Math.min(bl[0], br[0], ul[0], ur[0]);\n const y0 = Math.min(bl[1], br[1], ul[1], ur[1]);\n const x1 = Math.max(bl[0], br[0], ul[0], ur[0]);\n const y1 = Math.max(bl[1], br[1], ul[1], ur[1]);\n\n const rect = this.svgFactory.createElement(\"svg:rect\");\n rect.setAttributeNS(null, \"x\", x0);\n rect.setAttributeNS(null, \"y\", y0);\n rect.setAttributeNS(null, \"width\", x1 - x0);\n rect.setAttributeNS(null, \"height\", y1 - y0);\n rect.setAttributeNS(null, \"fill\", this._makeShadingPattern(args));\n if (this.current.fillAlpha < 1) {\n rect.setAttributeNS(null, \"fill-opacity\", this.current.fillAlpha);\n }\n this._ensureTransformGroup().appendChild(rect);\n }\n\n /**\n * @private\n */\n _makeColorN_Pattern(args) {\n if (args[0] === \"TilingPattern\") {\n return this._makeTilingPattern(args);\n }\n return this._makeShadingPattern(args);\n }\n\n /**\n * @private\n */\n _makeTilingPattern(args) {\n const color = args[1];\n const operatorList = args[2];\n const matrix = args[3] || IDENTITY_MATRIX;\n const [x0, y0, x1, y1] = args[4];\n const xstep = args[5];\n const ystep = args[6];\n const paintType = args[7];\n\n const tilingId = `shading${shadingCount++}`;\n const [tx0, ty0, tx1, ty1] = Util.normalizeRect([\n ...Util.applyTransform([x0, y0], matrix),\n ...Util.applyTransform([x1, y1], matrix),\n ]);\n const [xscale, yscale] = Util.singularValueDecompose2dScale(matrix);\n const txstep = xstep * xscale;\n const tystep = ystep * yscale;\n\n const tiling = this.svgFactory.createElement(\"svg:pattern\");\n tiling.setAttributeNS(null, \"id\", tilingId);\n tiling.setAttributeNS(null, \"patternUnits\", \"userSpaceOnUse\");\n tiling.setAttributeNS(null, \"width\", txstep);\n tiling.setAttributeNS(null, \"height\", tystep);\n tiling.setAttributeNS(null, \"x\", `${tx0}`);\n tiling.setAttributeNS(null, \"y\", `${ty0}`);\n\n // Save current state.\n const svg = this.svg;\n const transformMatrix = this.transformMatrix;\n const fillColor = this.current.fillColor;\n const strokeColor = this.current.strokeColor;\n\n const bbox = this.svgFactory.create(tx1 - tx0, ty1 - ty0);\n this.svg = bbox;\n this.transformMatrix = matrix;\n if (paintType === 2) {\n const cssColor = Util.makeHexColor(...color);\n this.current.fillColor = cssColor;\n this.current.strokeColor = cssColor;\n }\n this.executeOpTree(this.convertOpList(operatorList));\n\n // Restore saved state.\n this.svg = svg;\n this.transformMatrix = transformMatrix;\n this.current.fillColor = fillColor;\n this.current.strokeColor = strokeColor;\n\n tiling.appendChild(bbox.childNodes[0]);\n this.defs.appendChild(tiling);\n return `url(#${tilingId})`;\n }\n\n /**\n * @private\n */\n _makeShadingPattern(args) {\n if (typeof args === \"string\") {\n args = this.objs.get(args);\n }\n switch (args[0]) {\n case \"RadialAxial\":\n const shadingId = `shading${shadingCount++}`;\n const colorStops = args[3];\n let gradient;\n\n switch (args[1]) {\n case \"axial\":\n const point0 = args[4];\n const point1 = args[5];\n gradient = this.svgFactory.createElement(\"svg:linearGradient\");\n gradient.setAttributeNS(null, \"id\", shadingId);\n gradient.setAttributeNS(null, \"gradientUnits\", \"userSpaceOnUse\");\n gradient.setAttributeNS(null, \"x1\", point0[0]);\n gradient.setAttributeNS(null, \"y1\", point0[1]);\n gradient.setAttributeNS(null, \"x2\", point1[0]);\n gradient.setAttributeNS(null, \"y2\", point1[1]);\n break;\n case \"radial\":\n const focalPoint = args[4];\n const circlePoint = args[5];\n const focalRadius = args[6];\n const circleRadius = args[7];\n gradient = this.svgFactory.createElement(\"svg:radialGradient\");\n gradient.setAttributeNS(null, \"id\", shadingId);\n gradient.setAttributeNS(null, \"gradientUnits\", \"userSpaceOnUse\");\n gradient.setAttributeNS(null, \"cx\", circlePoint[0]);\n gradient.setAttributeNS(null, \"cy\", circlePoint[1]);\n gradient.setAttributeNS(null, \"r\", circleRadius);\n gradient.setAttributeNS(null, \"fx\", focalPoint[0]);\n gradient.setAttributeNS(null, \"fy\", focalPoint[1]);\n gradient.setAttributeNS(null, \"fr\", focalRadius);\n break;\n default:\n throw new Error(`Unknown RadialAxial type: ${args[1]}`);\n }\n for (const colorStop of colorStops) {\n const stop = this.svgFactory.createElement(\"svg:stop\");\n stop.setAttributeNS(null, \"offset\", colorStop[0]);\n stop.setAttributeNS(null, \"stop-color\", colorStop[1]);\n gradient.appendChild(stop);\n }\n this.defs.appendChild(gradient);\n return `url(#${shadingId})`;\n case \"Mesh\":\n warn(\"Unimplemented pattern Mesh\");\n return null;\n case \"Dummy\":\n return \"hotpink\";\n default:\n throw new Error(`Unknown IR type: ${args[0]}`);\n }\n }\n\n setDash(dashArray, dashPhase) {\n this.current.dashArray = dashArray;\n this.current.dashPhase = dashPhase;\n }\n\n constructPath(ops, args) {\n const current = this.current;\n let x = current.x,\n y = current.y;\n let d = [];\n let j = 0;\n\n for (const op of ops) {\n switch (op | 0) {\n case OPS.rectangle:\n x = args[j++];\n y = args[j++];\n const width = args[j++];\n const height = args[j++];\n const xw = x + width;\n const yh = y + height;\n d.push(\n \"M\",\n pf(x),\n pf(y),\n \"L\",\n pf(xw),\n pf(y),\n \"L\",\n pf(xw),\n pf(yh),\n \"L\",\n pf(x),\n pf(yh),\n \"Z\"\n );\n break;\n case OPS.moveTo:\n x = args[j++];\n y = args[j++];\n d.push(\"M\", pf(x), pf(y));\n break;\n case OPS.lineTo:\n x = args[j++];\n y = args[j++];\n d.push(\"L\", pf(x), pf(y));\n break;\n case OPS.curveTo:\n x = args[j + 4];\n y = args[j + 5];\n d.push(\n \"C\",\n pf(args[j]),\n pf(args[j + 1]),\n pf(args[j + 2]),\n pf(args[j + 3]),\n pf(x),\n pf(y)\n );\n j += 6;\n break;\n case OPS.curveTo2:\n d.push(\n \"C\",\n pf(x),\n pf(y),\n pf(args[j]),\n pf(args[j + 1]),\n pf(args[j + 2]),\n pf(args[j + 3])\n );\n x = args[j + 2];\n y = args[j + 3];\n j += 4;\n break;\n case OPS.curveTo3:\n x = args[j + 2];\n y = args[j + 3];\n d.push(\n \"C\",\n pf(args[j]),\n pf(args[j + 1]),\n pf(x),\n pf(y),\n pf(x),\n pf(y)\n );\n j += 4;\n break;\n case OPS.closePath:\n d.push(\"Z\");\n break;\n }\n }\n\n d = d.join(\" \");\n\n if (\n current.path &&\n ops.length > 0 &&\n ops[0] !== OPS.rectangle &&\n ops[0] !== OPS.moveTo\n ) {\n // If a path does not start with an OPS.rectangle or OPS.moveTo, it has\n // probably been divided into two OPS.constructPath operators by\n // OperatorList. Append the commands to the previous path element.\n d = current.path.getAttributeNS(null, \"d\") + d;\n } else {\n current.path = this.svgFactory.createElement(\"svg:path\");\n this._ensureTransformGroup().appendChild(current.path);\n }\n\n current.path.setAttributeNS(null, \"d\", d);\n current.path.setAttributeNS(null, \"fill\", \"none\");\n\n // Saving a reference in current.element so that it can be addressed\n // in 'fill' and 'stroke'\n current.element = current.path;\n current.setCurrentPoint(x, y);\n }\n\n endPath() {\n const current = this.current;\n\n // Painting operators end a path.\n current.path = null;\n\n if (!this.pendingClip) {\n return;\n }\n if (!current.element) {\n this.pendingClip = null;\n return;\n }\n\n // Add the current path to a clipping path.\n const clipId = `clippath${clipCount++}`;\n const clipPath = this.svgFactory.createElement(\"svg:clipPath\");\n clipPath.setAttributeNS(null, \"id\", clipId);\n clipPath.setAttributeNS(null, \"transform\", pm(this.transformMatrix));\n\n // A deep clone is needed when text is used as a clipping path.\n const clipElement = current.element.cloneNode(true);\n if (this.pendingClip === \"evenodd\") {\n clipElement.setAttributeNS(null, \"clip-rule\", \"evenodd\");\n } else {\n clipElement.setAttributeNS(null, \"clip-rule\", \"nonzero\");\n }\n this.pendingClip = null;\n clipPath.appendChild(clipElement);\n this.defs.appendChild(clipPath);\n\n if (current.activeClipUrl) {\n // The previous clipping group content can go out of order -- resetting\n // cached clipGroups.\n current.clipGroup = null;\n for (const prev of this.extraStack) {\n prev.clipGroup = null;\n }\n // Intersect with the previous clipping path.\n clipPath.setAttributeNS(null, \"clip-path\", current.activeClipUrl);\n }\n current.activeClipUrl = `url(#${clipId})`;\n\n this.tgrp = null;\n }\n\n clip(type) {\n this.pendingClip = type;\n }\n\n closePath() {\n const current = this.current;\n if (current.path) {\n const d = `${current.path.getAttributeNS(null, \"d\")}Z`;\n current.path.setAttributeNS(null, \"d\", d);\n }\n }\n\n setLeading(leading) {\n this.current.leading = -leading;\n }\n\n setTextRise(textRise) {\n this.current.textRise = textRise;\n }\n\n setTextRenderingMode(textRenderingMode) {\n this.current.textRenderingMode = textRenderingMode;\n }\n\n setHScale(scale) {\n this.current.textHScale = scale / 100;\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);\n break;\n case \"CA\":\n this.setStrokeAlpha(value);\n break;\n case \"ca\":\n this.setFillAlpha(value);\n break;\n default:\n warn(`Unimplemented graphic state operator ${key}`);\n break;\n }\n }\n }\n\n fill() {\n const current = this.current;\n if (current.element) {\n current.element.setAttributeNS(null, \"fill\", current.fillColor);\n current.element.setAttributeNS(null, \"fill-opacity\", current.fillAlpha);\n this.endPath();\n }\n }\n\n stroke() {\n const current = this.current;\n if (current.element) {\n this._setStrokeAttributes(current.element);\n current.element.setAttributeNS(null, \"fill\", \"none\");\n this.endPath();\n }\n }\n\n /**\n * @private\n */\n _setStrokeAttributes(element, lineWidthScale = 1) {\n const current = this.current;\n let dashArray = current.dashArray;\n if (lineWidthScale !== 1 && dashArray.length > 0) {\n dashArray = dashArray.map(function (value) {\n return lineWidthScale * value;\n });\n }\n element.setAttributeNS(null, \"stroke\", current.strokeColor);\n element.setAttributeNS(null, \"stroke-opacity\", current.strokeAlpha);\n element.setAttributeNS(null, \"stroke-miterlimit\", pf(current.miterLimit));\n element.setAttributeNS(null, \"stroke-linecap\", current.lineCap);\n element.setAttributeNS(null, \"stroke-linejoin\", current.lineJoin);\n element.setAttributeNS(\n null,\n \"stroke-width\",\n pf(lineWidthScale * current.lineWidth) + \"px\"\n );\n element.setAttributeNS(\n null,\n \"stroke-dasharray\",\n dashArray.map(pf).join(\" \")\n );\n element.setAttributeNS(\n null,\n \"stroke-dashoffset\",\n pf(lineWidthScale * current.dashPhase) + \"px\"\n );\n }\n\n eoFill() {\n if (this.current.element) {\n this.current.element.setAttributeNS(null, \"fill-rule\", \"evenodd\");\n }\n this.fill();\n }\n\n fillStroke() {\n // Order is important since stroke wants fill to be none.\n // First stroke, then if fill needed, it will be overwritten.\n this.stroke();\n this.fill();\n }\n\n eoFillStroke() {\n if (this.current.element) {\n this.current.element.setAttributeNS(null, \"fill-rule\", \"evenodd\");\n }\n this.fillStroke();\n }\n\n closeStroke() {\n this.closePath();\n this.stroke();\n }\n\n closeFillStroke() {\n this.closePath();\n this.fillStroke();\n }\n\n closeEOFillStroke() {\n this.closePath();\n this.eoFillStroke();\n }\n\n paintSolidColorImageMask() {\n const rect = this.svgFactory.createElement(\"svg:rect\");\n rect.setAttributeNS(null, \"x\", \"0\");\n rect.setAttributeNS(null, \"y\", \"0\");\n rect.setAttributeNS(null, \"width\", \"1px\");\n rect.setAttributeNS(null, \"height\", \"1px\");\n rect.setAttributeNS(null, \"fill\", this.current.fillColor);\n\n this._ensureTransformGroup().appendChild(rect);\n }\n\n paintImageXObject(objId) {\n const imgData = objId.startsWith(\"g_\")\n ? this.commonObjs.get(objId)\n : this.objs.get(objId);\n if (!imgData) {\n warn(`Dependent image with object ID ${objId} is not ready yet`);\n return;\n }\n this.paintInlineImageXObject(imgData);\n }\n\n paintInlineImageXObject(imgData, mask) {\n const width = imgData.width;\n const height = imgData.height;\n\n const imgSrc = convertImgDataToPng(imgData, this.forceDataSchema, !!mask);\n const cliprect = this.svgFactory.createElement(\"svg:rect\");\n cliprect.setAttributeNS(null, \"x\", \"0\");\n cliprect.setAttributeNS(null, \"y\", \"0\");\n cliprect.setAttributeNS(null, \"width\", pf(width));\n cliprect.setAttributeNS(null, \"height\", pf(height));\n this.current.element = cliprect;\n this.clip(\"nonzero\");\n\n const imgEl = this.svgFactory.createElement(\"svg:image\");\n imgEl.setAttributeNS(XLINK_NS, \"xlink:href\", imgSrc);\n imgEl.setAttributeNS(null, \"x\", \"0\");\n imgEl.setAttributeNS(null, \"y\", pf(-height));\n imgEl.setAttributeNS(null, \"width\", pf(width) + \"px\");\n imgEl.setAttributeNS(null, \"height\", pf(height) + \"px\");\n imgEl.setAttributeNS(\n null,\n \"transform\",\n `scale(${pf(1 / width)} ${pf(-1 / height)})`\n );\n if (mask) {\n mask.appendChild(imgEl);\n } else {\n this._ensureTransformGroup().appendChild(imgEl);\n }\n }\n\n paintImageMaskXObject(imgData) {\n const current = this.current;\n const width = imgData.width;\n const height = imgData.height;\n const fillColor = current.fillColor;\n\n current.maskId = `mask${maskCount++}`;\n const mask = this.svgFactory.createElement(\"svg:mask\");\n mask.setAttributeNS(null, \"id\", current.maskId);\n\n const rect = this.svgFactory.createElement(\"svg:rect\");\n rect.setAttributeNS(null, \"x\", \"0\");\n rect.setAttributeNS(null, \"y\", \"0\");\n rect.setAttributeNS(null, \"width\", pf(width));\n rect.setAttributeNS(null, \"height\", pf(height));\n rect.setAttributeNS(null, \"fill\", fillColor);\n rect.setAttributeNS(null, \"mask\", `url(#${current.maskId})`);\n\n this.defs.appendChild(mask);\n this._ensureTransformGroup().appendChild(rect);\n\n this.paintInlineImageXObject(imgData, mask);\n }\n\n paintFormXObjectBegin(matrix, bbox) {\n if (Array.isArray(matrix) && matrix.length === 6) {\n this.transform(\n matrix[0],\n matrix[1],\n matrix[2],\n matrix[3],\n matrix[4],\n matrix[5]\n );\n }\n\n if (bbox) {\n const width = bbox[2] - bbox[0];\n const height = bbox[3] - bbox[1];\n\n const cliprect = this.svgFactory.createElement(\"svg:rect\");\n cliprect.setAttributeNS(null, \"x\", bbox[0]);\n cliprect.setAttributeNS(null, \"y\", bbox[1]);\n cliprect.setAttributeNS(null, \"width\", pf(width));\n cliprect.setAttributeNS(null, \"height\", pf(height));\n this.current.element = cliprect;\n this.clip(\"nonzero\");\n this.endPath();\n }\n }\n\n paintFormXObjectEnd() {}\n\n /**\n * @private\n */\n _initialize(viewport) {\n const svg = this.svgFactory.create(viewport.width, viewport.height);\n\n // Create the definitions element.\n const definitions = this.svgFactory.createElement(\"svg:defs\");\n svg.appendChild(definitions);\n this.defs = definitions;\n\n // Create the root group element, which acts a container for all other\n // groups and applies the viewport transform.\n const rootGroup = this.svgFactory.createElement(\"svg:g\");\n rootGroup.setAttributeNS(null, \"transform\", pm(viewport.transform));\n svg.appendChild(rootGroup);\n\n // For the construction of the SVG image we are only interested in the\n // root group, so we expose it as the entry point of the SVG image for\n // the other code in this class.\n this.svg = rootGroup;\n\n return svg;\n }\n\n /**\n * @private\n */\n _ensureClipGroup() {\n if (!this.current.clipGroup) {\n const clipGroup = this.svgFactory.createElement(\"svg:g\");\n clipGroup.setAttributeNS(null, \"clip-path\", this.current.activeClipUrl);\n this.svg.appendChild(clipGroup);\n this.current.clipGroup = clipGroup;\n }\n return this.current.clipGroup;\n }\n\n /**\n * @private\n */\n _ensureTransformGroup() {\n if (!this.tgrp) {\n this.tgrp = this.svgFactory.createElement(\"svg:g\");\n this.tgrp.setAttributeNS(null, \"transform\", pm(this.transformMatrix));\n if (this.current.activeClipUrl) {\n this._ensureClipGroup().appendChild(this.tgrp);\n } else {\n this.svg.appendChild(this.tgrp);\n }\n }\n return this.tgrp;\n }\n };\n}\n\nexport { SVGGraphics };\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/* globals __non_webpack_require__ */\n\nimport {\n AbortException,\n assert,\n createPromiseCapability,\n MissingPDFException,\n} from \"../shared/util.js\";\nimport {\n extractFilenameFromHeader,\n validateRangeRequestCapabilities,\n} from \"./network_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 fs = __non_webpack_require__(\"fs\");\nconst http = __non_webpack_require__(\"http\");\nconst https = __non_webpack_require__(\"https\");\nconst url = __non_webpack_require__(\"url\");\n\nconst fileUriRegex = /^file:\\/\\/\\/[a-zA-Z]:\\//;\n\nfunction parseUrl(sourceUrl) {\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 if (this._fullRequestReader) {\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 = createPromiseCapability();\n this._headersCapability = createPromiseCapability();\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 = createPromiseCapability();\n return this.read();\n }\n this._loaded += chunk.length;\n if (this.onProgress) {\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 = createPromiseCapability();\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 = createPromiseCapability();\n return this.read();\n }\n this._loaded += chunk.length;\n if (this.onProgress) {\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 const getResponseHeader = name => {\n // Make sure that headers name are in lower case, as mentioned\n // here: https://nodejs.org/api/http.html#http_message_headers.\n return 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 this._request = http.request(\n createRequestOptions(this._url, stream.httpHeaders),\n handleResponse\n );\n } else {\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 (typeof 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 this._request = http.request(\n createRequestOptions(this._url, this._httpHeaders),\n handleResponse\n );\n } else {\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 fs.lstat(path, (error, stat) => {\n if (error) {\n if (error.code === \"ENOENT\") {\n error = new MissingPDFException(`Missing PDF \"${path}\".`);\n }\n this._storedError = error;\n this._headersCapability.reject(error);\n return;\n }\n // Setting right content length.\n this._contentLength = stat.size;\n\n this._setReadableStream(fs.createReadStream(path));\n this._headersCapability.resolve();\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 this._setReadableStream(fs.createReadStream(path, { start, end: end - 1 }));\n }\n}\n\nexport { PDFNodeStream };\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 (\n typeof PDFJSDev === \"undefined\" ||\n PDFJSDev.test(\"!PRODUCTION || TESTING\")\n ) {\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 (ex) {}\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 (e) {\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].replace(/\\\\(.)/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.replace(\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.replace(/_/g, \" \");\n text = text.replace(/=([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 (e) {}\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 {\n assert,\n createPromiseCapability,\n stringToBytes,\n} 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 const array = stringToBytes(data);\n return array.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 this.getXhr =\n args.getXhr ||\n function NetworkManager_getXhr() {\n return new XMLHttpRequest();\n };\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 = this.getXhr();\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 (typeof 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 = createPromiseCapability();\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 => {\n return 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 = createPromiseCapability();\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 = createPromiseCapability();\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 {\n AbortException,\n assert,\n createPromiseCapability,\n} 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 (typeof value === \"undefined\") {\n continue;\n }\n headers.append(property, value);\n }\n return headers;\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 if (this._fullRequestReader) {\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 = createPromiseCapability();\n this._disableRange = source.disableRange || false;\n this._rangeChunkSize = source.rangeChunkSize;\n if (!this._rangeChunkSize && !this._disableRange) {\n this._disableRange = true;\n }\n\n if (typeof AbortController !== \"undefined\") {\n this._abortController = new AbortController();\n }\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 => {\n return 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 if (this.onProgress) {\n this.onProgress({\n loaded: this._loaded,\n total: this._contentLength,\n });\n }\n const buffer = new Uint8Array(value).buffer;\n return { value: buffer, done: false };\n }\n\n cancel(reason) {\n if (this._reader) {\n this._reader.cancel(reason);\n }\n if (this._abortController) {\n this._abortController.abort();\n }\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 = createPromiseCapability();\n this._isStreamingSupported = !source.disableStream;\n\n if (typeof AbortController !== \"undefined\") {\n this._abortController = new AbortController();\n }\n\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 if (this.onProgress) {\n this.onProgress({ loaded: this._loaded });\n }\n const buffer = new Uint8Array(value).buffer;\n return { value: buffer, done: false };\n }\n\n cancel(reason) {\n if (this._reader) {\n this._reader.cancel(reason);\n }\n if (this._abortController) {\n this._abortController.abort();\n }\n }\n}\n\nexport { PDFFetchStream };\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __w_pdfjs_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __w_pdfjs_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\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// eslint-disable-next-line max-len\n/** @typedef {import(\"./display/api\").PDFDocumentLoadingTask} PDFDocumentLoadingTask */\n/** @typedef {import(\"./display/api\").PDFDocumentProxy} PDFDocumentProxy */\n/** @typedef {import(\"./display/api\").PDFPageProxy} PDFPageProxy */\n/** @typedef {import(\"./display/api\").RenderTask} RenderTask */\n/** @typedef {import(\"./display/display_utils\").PageViewport} PageViewport */\n\nimport {\n AnnotationMode,\n CMapCompressionType,\n createPromiseCapability,\n createValidAbsoluteUrl,\n InvalidPDFException,\n MissingPDFException,\n OPS,\n PasswordResponses,\n PermissionFlag,\n shadow,\n UnexpectedResponseException,\n UNSUPPORTED_FEATURES,\n Util,\n VerbosityLevel,\n} from \"./shared/util.js\";\nimport {\n build,\n getDocument,\n LoopbackPort,\n PDFDataRangeTransport,\n PDFWorker,\n setPDFNetworkStreamFactory,\n version,\n} from \"./display/api.js\";\nimport {\n getFilenameFromUrl,\n getPdfFilenameFromUrl,\n getXfaPageViewport,\n isPdfFile,\n isValidFetchUrl,\n loadScript,\n PDFDateString,\n PixelsPerInch,\n RenderingCancelledException,\n} from \"./display/display_utils.js\";\nimport { AnnotationLayer } from \"./display/annotation_layer.js\";\nimport { GlobalWorkerOptions } from \"./display/worker_options.js\";\nimport { isNodeJS } from \"./shared/is_node.js\";\nimport { renderTextLayer } from \"./display/text_layer.js\";\nimport { SVGGraphics } from \"./display/svg.js\";\nimport { XfaLayer } from \"./display/xfa_layer.js\";\n\n/* eslint-disable-next-line no-unused-vars */\nconst pdfjsVersion =\n typeof PDFJSDev !== \"undefined\" ? PDFJSDev.eval(\"BUNDLE_VERSION\") : void 0;\n/* eslint-disable-next-line no-unused-vars */\nconst pdfjsBuild =\n typeof PDFJSDev !== \"undefined\" ? PDFJSDev.eval(\"BUNDLE_BUILD\") : void 0;\n\nif (typeof PDFJSDev === \"undefined\" || !PDFJSDev.test(\"PRODUCTION\")) {\n const streamsPromise = Promise.all([\n import(\"pdfjs/display/network.js\"),\n import(\"pdfjs/display/fetch_stream.js\"),\n ]);\n\n setPDFNetworkStreamFactory(async params => {\n const [{ PDFNetworkStream }, { PDFFetchStream }] = await streamsPromise;\n if (isValidFetchUrl(params.url)) {\n return new PDFFetchStream(params);\n }\n return new PDFNetworkStream(params);\n });\n} else if (PDFJSDev.test(\"GENERIC || CHROME\")) {\n if (PDFJSDev.test(\"GENERIC\") && isNodeJS) {\n const { PDFNodeStream } = require(\"./display/node_stream.js\");\n\n setPDFNetworkStreamFactory(params => {\n return new PDFNodeStream(params);\n });\n } else {\n const { PDFNetworkStream } = require(\"./display/network.js\");\n const { PDFFetchStream } = require(\"./display/fetch_stream.js\");\n\n setPDFNetworkStreamFactory(params => {\n if (isValidFetchUrl(params.url)) {\n return new PDFFetchStream(params);\n }\n return new PDFNetworkStream(params);\n });\n }\n}\n\nexport {\n AnnotationLayer,\n AnnotationMode,\n build,\n CMapCompressionType,\n createPromiseCapability,\n createValidAbsoluteUrl,\n getDocument,\n getFilenameFromUrl,\n getPdfFilenameFromUrl,\n getXfaPageViewport,\n GlobalWorkerOptions,\n InvalidPDFException,\n isPdfFile,\n loadScript,\n LoopbackPort,\n MissingPDFException,\n OPS,\n PasswordResponses,\n PDFDataRangeTransport,\n PDFDateString,\n PDFWorker,\n PermissionFlag,\n PixelsPerInch,\n RenderingCancelledException,\n renderTextLayer,\n shadow,\n SVGGraphics,\n UnexpectedResponseException,\n UNSUPPORTED_FEATURES,\n Util,\n VerbosityLevel,\n version,\n XfaLayer,\n};\n"],"names":["IDENTITY_MATRIX","FONT_IDENTITY_MATRIX","RenderingIntentFlag","ANY","DISPLAY","PRINT","ANNOTATIONS_FORMS","ANNOTATIONS_STORAGE","ANNOTATIONS_DISABLE","OPLIST","AnnotationMode","DISABLE","ENABLE","ENABLE_FORMS","ENABLE_STORAGE","PermissionFlag","MODIFY_CONTENTS","COPY","MODIFY_ANNOTATIONS","FILL_INTERACTIVE_FORMS","COPY_FOR_ACCESSIBILITY","ASSEMBLE","PRINT_HIGH_QUALITY","TextRenderingMode","FILL","STROKE","FILL_STROKE","INVISIBLE","FILL_ADD_TO_PATH","STROKE_ADD_TO_PATH","FILL_STROKE_ADD_TO_PATH","ADD_TO_PATH","FILL_STROKE_MASK","ADD_TO_PATH_FLAG","ImageKind","GRAYSCALE_1BPP","RGB_24BPP","RGBA_32BPP","AnnotationType","TEXT","LINK","FREETEXT","LINE","SQUARE","CIRCLE","POLYGON","POLYLINE","HIGHLIGHT","UNDERLINE","SQUIGGLY","STRIKEOUT","STAMP","CARET","INK","POPUP","FILEATTACHMENT","SOUND","MOVIE","WIDGET","SCREEN","PRINTERMARK","TRAPNET","WATERMARK","THREED","REDACT","AnnotationStateModelType","MARKED","REVIEW","AnnotationMarkedState","UNMARKED","AnnotationReviewState","ACCEPTED","REJECTED","CANCELLED","COMPLETED","NONE","AnnotationReplyType","GROUP","REPLY","AnnotationFlag","HIDDEN","NOZOOM","NOROTATE","NOVIEW","READONLY","LOCKED","TOGGLENOVIEW","LOCKEDCONTENTS","AnnotationFieldFlag","REQUIRED","NOEXPORT","MULTILINE","PASSWORD","NOTOGGLETOOFF","RADIO","PUSHBUTTON","COMBO","EDIT","SORT","FILESELECT","MULTISELECT","DONOTSPELLCHECK","DONOTSCROLL","COMB","RICHTEXT","RADIOSINUNISON","COMMITONSELCHANGE","AnnotationBorderStyleType","SOLID","DASHED","BEVELED","INSET","AnnotationActionEventType","E","X","D","U","Fo","Bl","PO","PC","PV","PI","K","F","V","C","DocumentActionEventType","WC","WS","DS","WP","DP","PageActionEventType","O","StreamType","UNKNOWN","FLATE","LZW","DCT","JPX","JBIG","A85","AHX","CCF","RLX","FontType","TYPE1","TYPE1STANDARD","TYPE1C","CIDFONTTYPE0","CIDFONTTYPE0C","TRUETYPE","CIDFONTTYPE2","TYPE3","OPENTYPE","TYPE0","MMTYPE1","VerbosityLevel","ERRORS","WARNINGS","INFOS","CMapCompressionType","BINARY","STREAM","OPS","dependency","setLineWidth","setLineCap","setLineJoin","setMiterLimit","setDash","setRenderingIntent","setFlatness","setGState","save","restore","transform","moveTo","lineTo","curveTo","curveTo2","curveTo3","closePath","rectangle","stroke","closeStroke","fill","eoFill","fillStroke","eoFillStroke","closeFillStroke","closeEOFillStroke","endPath","clip","eoClip","beginText","endText","setCharSpacing","setWordSpacing","setHScale","setLeading","setFont","setTextRenderingMode","setTextRise","moveText","setLeadingMoveText","setTextMatrix","nextLine","showText","showSpacedText","nextLineShowText","nextLineSetSpacingShowText","setCharWidth","setCharWidthAndBounds","setStrokeColorSpace","setFillColorSpace","setStrokeColor","setStrokeColorN","setFillColor","setFillColorN","setStrokeGray","setFillGray","setStrokeRGBColor","setFillRGBColor","setStrokeCMYKColor","setFillCMYKColor","shadingFill","beginInlineImage","beginImageData","endInlineImage","paintXObject","markPoint","markPointProps","beginMarkedContent","beginMarkedContentProps","endMarkedContent","beginCompat","endCompat","paintFormXObjectBegin","paintFormXObjectEnd","beginGroup","endGroup","beginAnnotations","endAnnotations","beginAnnotation","endAnnotation","paintJpegXObject","paintImageMaskXObject","paintImageMaskXObjectGroup","paintImageXObject","paintInlineImageXObject","paintInlineImageXObjectGroup","paintImageXObjectRepeat","paintImageMaskXObjectRepeat","paintSolidColorImageMask","constructPath","UNSUPPORTED_FEATURES","unknown","forms","javaScript","signatures","smask","shadingPattern","font","errorTilingPattern","errorExtGState","errorXObject","errorFontLoadType3","errorFontState","errorFontMissing","errorFontTranslate","errorColorSpace","errorOperatorList","errorFontToUnicode","errorFontLoadNative","errorFontBuildPath","errorFontGetPath","errorMarkedContent","errorContentSubStream","PasswordResponses","NEED_PASSWORD","INCORRECT_PASSWORD","verbosity","setVerbosityLevel","level","Number","isInteger","getVerbosityLevel","info","msg","console","log","warn","unreachable","Error","assert","cond","_isValidProtocol","url","protocol","createValidAbsoluteUrl","baseUrl","options","addDefaultProtocol","startsWith","dots","match","length","tryConvertEncoding","stringToUTF8String","ex","absoluteUrl","URL","shadow","obj","prop","value","Object","defineProperty","enumerable","configurable","writable","BaseException","BaseExceptionClosure","message","name","constructor","prototype","PasswordException","code","UnknownErrorException","details","InvalidPDFException","MissingPDFException","UnexpectedResponseException","status","FormatError","AbortException","bytesToString","bytes","undefined","MAX_ARGUMENT_COUNT","String","fromCharCode","apply","strBuf","i","chunkEnd","Math","min","chunk","subarray","push","join","stringToBytes","str","Uint8Array","charCodeAt","arrayByteLength","arr","byteLength","arraysToBytes","resultLength","pos","data","item","itemLength","set","string32","objectSize","keys","objectFromMap","map","create","key","isLittleEndian","buffer8","view32","Uint32Array","buffer","isEvalSupported","Function","e","FeatureTest","isOffscreenCanvasSupported","OffscreenCanvas","hexNumbers","Array","n","toString","padStart","Util","makeHexColor","r","g","b","scaleMinMax","minMax","temp","m1","m2","applyTransform","p","m","xt","yt","applyInverseTransform","d","getAxialAlignedBoundingBox","p1","p2","slice","p3","p4","max","inverseTransform","apply3dTransform","v","singularValueDecompose2dScale","transpose","a","c","first","second","sqrt","sx","sy","normalizeRect","rect","intersect","rect1","rect2","xLow","xHigh","yLow","yHigh","bezierBoundingBox","x0","y0","x1","y1","x2","y2","x3","y3","tvalues","bounds","t","t1","t2","b2ac","sqrtb2ac","abs","j","mt","jlen","PDFStringTranslateTable","stringToPDFString","encoding","decoder","TextDecoder","fatal","decode","ii","charAt","escapeString","replace","isAscii","test","stringToUTF16BEString","buf","char","decodeURIComponent","escape","utf8StringToString","unescape","encodeURIComponent","isArrayBuffer","isArrayEqual","arr1","arr2","getModificationDate","date","Date","getUTCFullYear","getUTCMonth","getUTCDate","getUTCHours","getUTCMinutes","getUTCSeconds","createPromiseCapability","capability","isSettled","get","promise","Promise","resolve","reject","reason","isNodeJS","process","versions","nw","electron","type","DEFAULT_RANGE_CHUNK_SIZE","RENDERING_CANCELLED_TIMEOUT","DefaultCanvasFactory","DOMCanvasFactory","DefaultCMapReaderFactory","DOMCMapReaderFactory","DefaultStandardFontDataFactory","DOMStandardFontDataFactory","NodeCanvasFactory","NodeCMapReaderFactory","NodeStandardFontDataFactory","require","createPDFNetworkStream","setPDFNetworkStreamFactory","pdfNetworkStreamFactory","getDocument","src","task","PDFDocumentLoadingTask","source","PDFDataRangeTransport","range","params","rangeTransport","worker","window","location","href","Buffer","isNaN","CMapReaderFactory","StandardFontDataFactory","ignoreErrors","stopAtErrors","fontExtraProperties","pdfBug","enableXfa","rangeChunkSize","docBaseUrl","isDataScheme","maxImageSize","cMapUrl","standardFontDataUrl","useWorkerFetch","disableFontFace","useSystemFonts","ownerDocument","globalThis","document","disableRange","disableStream","disableAutoFetch","workerParams","port","GlobalWorkerOptions","workerPort","PDFWorker","fromPort","_worker","docId","then","destroyed","workerIdPromise","_fetchDocument","networkStreamPromise","networkStream","PDFDataTransportStream","initialData","progressiveDone","contentDispositionFilename","httpHeaders","withCredentials","all","workerId","messageHandler","MessageHandler","transport","WorkerTransport","_transport","send","catch","_capability","pdfDataRangeTransport","sendWithPromise","apiVersion","password","onPassword","onProgress","onUnsupportedFeature","destroy","_rangeListeners","_progressListeners","_progressiveReadListeners","_progressiveDoneListeners","_readyCapability","addRangeListener","listener","addProgressListener","addProgressiveReadListener","addProgressiveDoneListener","onDataRange","begin","onDataProgress","loaded","total","onDataProgressiveRead","onDataProgressiveDone","transportReady","requestDataRange","end","abort","PDFDocumentProxy","pdfInfo","_pdfInfo","deprecated","fingerprints","stats","streamTypes","fontTypes","annotationStorage","numPages","isPureXfa","_htmlForXfa","allXfaHtml","getPage","pageNumber","getPageIndex","ref","getDestinations","getDestination","id","getPageLabels","getPageLayout","getPageMode","getViewerPreferences","getOpenAction","getAttachments","getJavaScript","getJSActions","getDocJSActions","getOutline","getOptionalContentConfig","getPermissions","getMetadata","getMarkInfo","getData","getDownloadInfo","downloadInfoCapability","cleanup","keepLoadedFonts","startCleanup","loadingTask","loadingParams","saveDocument","size","getFieldObjects","hasJSActions","getCalculationOrderIds","PDFPageProxy","pageIndex","pageInfo","_pageIndex","_pageInfo","_ownerDocument","_stats","StatTimer","_pdfBug","commonObjs","objs","PDFObjects","_bitmaps","Set","cleanupAfterRender","pendingCleanup","_intentStates","Map","_annotationPromises","rotate","userUnit","view","getViewport","scale","rotation","offsetX","offsetY","dontFlip","PageViewport","viewBox","getAnnotations","intent","intentArgs","getRenderingIntent","cacheKey","renderingIntent","annotations","annotation","titleObj","contentsObj","_jsActionsPromise","getPageJSActions","getXfa","children","render","canvasContext","viewport","annotationMode","imageLayer","canvasFactory","background","optionalContentConfigPromise","annotationCanvasMap","pageColors","arguments","renderInteractiveForms","includeAnnotationStorage","time","intentState","streamReaderCancelTimeout","clearTimeout","canvasFactoryInstance","intentPrint","displayReadyCapability","operatorList","fnArray","argsArray","lastChunk","_pumpOperatorList","complete","error","renderTasks","delete","internalRenderTask","_tryCleanup","_abortOperatorList","timeEnd","InternalRenderTask","callback","useRequestAnimationFrame","add","renderTask","transparency","optionalContentConfig","initializeGraphics","operatorListChanged","getOperatorList","opListReadCapability","opListTask","streamTextContent","disableCombineTextItems","includeMarkedContent","TEXT_CONTENT_CHUNK_SIZE","sendWithStream","combineTextItems","highWaterMark","textContent","items","getTextContent","xfa","XfaText","readableStream","pump","reader","read","done","assign","styles","getReader","getStructTree","_structTreePromise","_destroy","waitOn","values","force","completed","cancel","clear","bitmap","close","resetStats","_startRenderPage","_renderPageChunk","operatorListChunk","serializable","streamReader","RenderingCancelledException","setTimeout","curCacheKey","curIntentState","LoopbackPort","_listeners","_deferred","postMessage","transfers","event","structuredClone","call","addEventListener","removeEventListener","indexOf","splice","terminate","PDFWorkerUtil","isWorkerDisabled","fallbackWorkerSrc","fakeWorkerId","__non_webpack_require__","pdfjsFilePath","currentScript","isSameOrigin","otherUrl","base","origin","other","createCDNWrapper","wrapper","createObjectURL","Blob","workerPorts","WeakMap","has","_port","_webWorker","_messageHandler","_initializeFromPort","_initialize","on","Worker","_mainThreadWorkerMessageHandler","workerSrc","terminateEarly","onWorkerError","_setupFakeWorker","sendTest","testObj","_setupFakeWorkerGlobal","WorkerMessageHandler","workerHandler","setup","pdfjsWorker","loader","mainWorkerMessageHandler","eval","loadScript","getWorkerSrc","docStats","pageCache","pagePromises","metadataPromise","fontLoader","FontLoader","_onUnsupportedFeature","bind","styleElement","_params","isCompressed","cMapPacked","destroyCapability","_passwordCapability","_networkStream","_fullReader","_lastProgress","setupMessageHandler","AnnotationStorage","isOpList","annotationHash","hash","page","hasOwnProperty","resetModified","terminated","_getFieldObjectsPromise","_hasJSActionsPromise","cancelAllRequests","sink","getFullReader","evt","onPull","enqueue","onCancel","ready","readyReason","headersCapability","fullReader","headersReady","isStreamingSupported","isRangeSupported","contentLength","rangeReader","getRangeReader","_numPages","htmlForXfa","exception","updatePassword","exportedData","exportedError","fontRegistry","FontInspector","enabled","registerFont","fontAdded","FontFaceObject","finally","imageData","pageProxy","MAX_IMAGE_SIZE_TO_STORE","width","height","freeze","fetch","featureId","cachedPromise","num","gen","filename","results","OptionalContentConfig","metadata","Metadata","cleanupSuccessful","ensureObj","objId","settled","RenderTask","_internalRenderTask","onContinue","canvasInUse","WeakSet","operatorListIdx","running","graphicsReadyCallback","graphicsReady","_useRequestAnimationFrame","cancelled","_cancelBound","_continueBound","_continue","_scheduleNextBound","_scheduleNext","_nextBound","_next","_canvas","canvas","StepperManager","stepper","init","nextBreakPoint","getNextBreakPoint","gfx","CanvasGraphics","beginDrawing","endDrawing","updateOperatorList","requestAnimationFrame","executeOperatorList","version","build","SVG_NS","PixelsPerInch","CSS","PDF","PDF_TO_CSS_UNITS","BaseCanvasFactory","_document","_createCanvas","createElement","fetchData","asTypedArray","isValidFetchUrl","baseURI","response","ok","statusText","arrayBuffer","text","request","XMLHttpRequest","open","responseType","onreadystatechange","readyState","DONE","responseText","BaseCMapReaderFactory","_fetchData","compressionType","cMapData","BaseStandardFontDataFactory","DOMSVGFactory","BaseSVGFactory","_createSVG","createElementNS","centerX","centerY","rotateA","rotateB","rotateC","rotateD","offsetCanvasX","offsetCanvasY","clone","convertToViewportPoint","x","y","convertToViewportRectangle","topLeft","bottomRight","convertToPdfPoint","trim","substring","toLowerCase","isPdfFile","getFilenameFromUrl","anchor","query","lastIndexOf","getPdfFilenameFromUrl","defaultFilename","reURI","reFilename","splitURI","exec","suggestedFilename","includes","started","times","now","start","outBuf","longest","duration","padEnd","removeScriptElement","script","onload","remove","onerror","head","documentElement","appendChild","pdfDateStringRegex","PDFDateString","toDateObject","input","RegExp","matches","year","parseInt","month","day","hour","minute","universalTimeRelation","offsetHour","offsetMinute","UTC","getXfaPageViewport","xfaPage","attributes","style","context","getContext","reset","canvasAndContext","svg","setAttribute","BaseFontLoader","nativeFontFaces","addNativeFontFace","nativeFontFace","fonts","insertRule","rule","getElementsByTagName","styleSheet","sheet","cssRules","attached","missingFile","isFontLoadingAPISupported","createNativeFontFace","family","createFontFaceRule","isSyncFontLoadingSupported","_queueLoadingCallback","_prepareFontLoadEvent","hasFonts","_loadTestFont","rules","fontsToLoad","GenericFontLoader","loadingContext","requests","nextRequestId","loadTestFontId","supported","navigator","userAgent","completeRequest","otherRequest","shift","getLoadTestFont","atob","int32","offset","spliceString","s","insert","chunk1","chunk2","ctx","called","isFontReady","fillText","getImageData","COMMENT_OFFSET","CFF_CHECKSUM_OFFSET","XXXX_VALUE","checksum","btoa","names","loadedName","div","visibility","position","top","left","span","fontFamily","body","translatedData","compiledGlyphs","cssFontInfo","FontFace","css","weight","fontWeight","italicAngle","mimetype","getPathGenerator","character","cmds","jsBuf","current","args","cmd","_storage","_modified","onSetModified","onResetModified","getValue","defaultValue","getRawValue","setValue","modified","entry","val","entries","_setModified","getAll","MurmurHash3_64","update","JSON","stringify","hexdigest","SEED","MASK_HIGH","MASK_LOW","seed","h1","h2","blockCounts","tailLength","dataUint32","k1","k2","C1","C2","C1_LOW","C2_LOW","hex1","hex2","MIN_FONT_SIZE","MAX_FONT_SIZE","MAX_GROUP_SIZE","EXECUTION_TIME","EXECUTION_STEPS","COMPILE_TYPE3_GLYPHS","MAX_SIZE_TO_COMPILE","FULL_CHUNK_HEIGHT","LINEWIDTH_SCALE_FACTOR","mirrorContextOperations","destCtx","_removeMirroring","__originalSave","__originalRestore","__originalRotate","__originalScale","__originalTranslate","translate","__originalTransform","__originalSetTransform","setTransform","__originalResetTransform","resetTransform","__originalClip","__originalMoveTo","__originalLineTo","__originalBezierCurveTo","bezierCurveTo","__originalRect","__originalClosePath","__originalBeginPath","beginPath","ctxSave","ctxRestore","ctxTranslate","ctxScale","ctxTransform","f","ctxSetTransform","ctxResetTransform","ctxRotate","angle","cp1x","cp1y","cp2x","cp2y","addContextCurrentTransform","_transformStack","mozCurrentTransform","_originalSave","_originalRestore","_originalRotate","_originalScale","_originalTranslate","_originalTransform","_originalSetTransform","_originalResetTransform","_transformMatrix","desc","getOwnPropertyDescriptor","getPrototypeOf","_setLineWidth","_getLineWidth","getLineWidth","_","getCurrentTransform","getCurrentTransformInverse","ad_bc","bc_ad","old","prev","pop","cosValue","cos","sinValue","sin","CachedCanvases","cache","getCanvas","trackTransform","canvasEntry","drawImageAtIntegerCoords","srcImg","srcX","srcY","srcW","srcH","destX","destY","destW","destH","tx","ty","tlX","rTlX","round","tlY","rTlY","brX","rWidth","brY","rHeight","sign","drawImage","scaleX","hypot","scaleY","compileType3Glyph","imgData","POINT_TO_PROCESS_LIMIT","POINT_TYPES","width1","points","j0","lineSize","elem","mask","count","sum","steps","Int32Array","path","outlines","coords","Path2D","p0","step","pp","drawOutline","o","l","ll","CanvasExtraState","alphaIsShape","fontSize","fontSizeScale","textMatrix","textMatrixScale","fontMatrix","leading","lineX","lineY","charSpacing","wordSpacing","textHScale","textRenderingMode","textRise","fillColor","strokeColor","patternFill","fillAlpha","strokeAlpha","lineWidth","activeSMask","transferMaps","startNewPathAndClipBox","clipBox","setCurrentPoint","updatePathMinMax","minX","minY","maxX","maxY","updateRectMinMax","updateScalingPathMinMax","updateCurvePathMinMax","box","getPathBoundingBox","pathType","PathType","xStrokePad","yStrokePad","updateClipFromPath","isEmptyClip","Infinity","getClippedPathBoundingBox","putBinaryImageData","ImageData","putImageData","partialChunkHeight","fullChunks","totalChunks","chunkImgData","createImageData","srcPos","destPos","dest","thisChunkHeight","elemsInThisChunk","transferMapRed","transferMapGreen","transferMapBlue","transferMapGray","kind","srcLength","dest32","dest32DataLength","fullSrcDiff","white","black","srcDiff","k","kEnd","kEndUnrolled","srcByte","hasTransferMaps","putBinaryImageMask","applyMaskImageData","copyCtxState","sourceCtx","properties","property","setLineDash","getLineDash","lineDashOffset","resetCtxToDefault","foregroundColor","strokeStyle","fillStyle","fillRule","globalAlpha","lineCap","lineJoin","miterLimit","globalCompositeOperation","composeSMaskBackdrop","r0","g0","b0","alpha","alpha_","composeSMaskAlpha","maskData","layerData","transferMap","composeSMaskLuminosity","genericComposeSMask","maskCtx","layerCtx","subtype","backdrop","layerOffsetX","layerOffsetY","maskOffsetX","maskOffsetY","hasBackdrop","composeFn","PIXELS_TO_PROCESS","chunkSize","ceil","row","chunkHeight","composeSMask","layerBox","layerWidth","layerHeight","getImageSmoothingEnabled","interpolate","fround","actualScale","devicePixelRatio","LINE_CAP_STYLES","LINE_JOIN_STYLES","NORMAL_CLIP","EO_CLIP","canvasCtx","stateStack","pendingClip","pendingEOFill","res","xobjs","groupStack","processingType3","baseTransform","baseTransformStack","groupLevel","smaskStack","smaskCounter","tempSMask","suspendedCtx","contentVisible","markedContentStack","cachedCanvases","cachedPatterns","viewportScale","outputScaleX","outputScaleY","backgroundColor","foreground","_cachedScaleForStroking","_cachedGetSinglePixelWidth","_cachedBitmapsMap","getObject","fallback","defaultBackgroundColor","fg","bg","isValidDefaultBg","defaultBg","cB","rB","gB","bB","newComp","lumB","selectColor","lumC","fillRect","transparentCanvas","compositeCtx","beginLayout","executionStartIdx","continueCallback","argsArrayLen","chunkOperations","endTime","fnId","breakIt","depObjId","objsPool","inSMaskMode","HTMLCanvasElement","endLayout","_scaleImage","img","widthScale","heightScale","paintWidth","paintHeight","tmpCanvasId","tmpCanvas","tmpCtx","newWidth","newHeight","clearRect","_createMaskCanvas","isPatternFill","currentTransform","scaled","maskCanvas","mainKey","withoutTranslation","cachedImage","maskToCanvas","cord1","cord2","drawnWidth","drawnHeight","fillCanvas","fillCtx","mozCurrentTransformInverse","imageSmoothingEnabled","inverse","getPattern","limit","dashArray","dashPhase","flatness","states","state","checkSMaskState","beginSMaskMode","endSMaskMode","cacheId","scratchCanvas","compose","dirtyBox","floor","ops","startX","startY","isScalingMatrix","minMaxForBezier","xw","yh","consumePath","rescaleAndStroke","needRestore","paths","pendingTextPaths","addToPath","spacing","fontRefName","fontObj","fontDirection","isType3Font","bold","italic","typeface","fallbackName","browserFontSize","mode","rise","paintChar","patternTransform","fillStrokeMode","isAddToPathSet","strokeText","isFontSubpixelAAEnabled","glyphs","showType3Text","glyphsLength","vertical","spacingDir","defaultVMetrics","widthAdvanceScale","simpleFillText","pattern","getSinglePixelWidth","glyph","restoreNeeded","isSpace","fontChar","accent","scaledX","scaledY","vmetric","vx","vy","remeasure","measuredWidth","measureText","characterScaleX","isInFont","scaledAccentX","scaledAccentY","charWidth","isTextInvisible","spacingLength","charProcOperatorList","operatorListId","transformed","xWidth","yWidth","llx","lly","urx","ury","getColorN_Pattern","IR","color","canvasGraphicsFactory","createCanvasGraphics","TilingPattern","_getPattern","matrix","getShadingPattern","SHADING","inv","bl","br","ul","ur","bbox","isArray","group","currentCtx","isolated","knockout","canvasBounds","groupCtx","startTransformInverse","currentMtx","hasOwnCanvas","canvasWidth","canvasHeight","annotationCanvas","viewportScaleFactorStr","savedCtx","compiled","skewX","skewY","positions","trans","images","image","w","h","imgToPaint","HTMLElement","getCanvasPosition","appendImage","tag","visible","isVisible","isContentVisible","isEmpty","absDet","normX","normY","getScaleForStroking","scaledXLineWidth","scaledYLineWidth","baseArea","saveRestore","savedMatrix","savedDashes","savedDashOffset","op","applyBoundingBox","region","BaseShadingPattern","RadialAxialShadingPattern","_type","_bbox","_colorStops","_p0","_p1","_r0","_r1","_createGradient","grad","createLinearGradient","createRadialGradient","colorStop","addColorStop","owner","ownerBBox","createPattern","domMatrix","DOMMatrix","drawTriangle","c1","c2","c3","colors","rowSize","tmp","c1r","c1g","c1b","c2r","c2g","c2b","c3r","c3g","c3b","xa","car","cag","cab","xb","cbr","cbg","cbb","x1_","x2_","drawFigure","figure","ps","cs","verticesPerRow","rows","cols","q","MeshShadingPattern","_coords","_colors","_figures","_bounds","_background","_createMeshCanvas","combinedScale","EXPECTED_SCALE","MAX_PATTERN_SIZE","BORDER_SIZE","boundsWidth","boundsHeight","paddedWidth","paddedHeight","matrixScale","temporaryPatternCanvas","DummyShadingPattern","PaintType","COLORED","UNCOLORED","xstep","ystep","paintType","tilingType","createPatternCanvas","curMatrixScale","dimx","getSizeAndScale","dimy","graphics","setFillAndStrokeStyleToContext","adjustedX0","adjustedY0","adjustedX1","adjustedY1","clipBbox","realOutputSize","maxSize","bboxWidth","bboxHeight","cssColor","inverseDecode","opaque","zeroMapping","oneMapping","widthInSource","widthRemainder","CallbackKind","DATA","ERROR","StreamKind","CANCEL","CANCEL_COMPLETE","CLOSE","ENQUEUE","PULL","PULL_COMPLETE","START_COMPLETE","wrapReason","sourceName","targetName","comObj","callbackId","streamId","streamSinks","streamControllers","callbackCapabilities","actionHandler","_onComObjOnMessage","stream","_processStreamMessage","action","cbSourceName","cbTargetName","result","_createStreamSink","actionName","handler","ah","queueingStrategy","ReadableStream","controller","startCapability","startCall","pullCall","cancelCall","isClosed","desiredSize","pull","pullCapability","cancelCapability","self","streamSink","isCancelled","lastDesiredSize","sinkCapability","success","streamController","_deleteStreamController","allSettled","metadataMap","parsedData","rawData","getRaw","OptionalContentGroup","creator","_order","_groups","order","groups","baseState","off","_evaluateVisibilityExpression","array","operator","element","expression","policy","ids","setVisibility","getOrder","from","getGroups","getGroup","_queuedChunks","_progressiveDone","_contentDispositionFilename","_pdfDataRangeTransport","_isStreamingSupported","_isRangeSupported","_contentLength","_fullRequestReader","_rangeReaders","_onReceiveData","_onProgress","_onProgressiveDone","_enqueue","found","some","_begin","_progressiveDataLength","_loaded","firstReader","_removeRangeReader","queuedChunks","PDFDataTransportStreamReader","PDFDataTransportStreamRangeReader","_stream","_done","_filename","_requests","_headersReady","requestCapability","_end","_queuedChunk","requestsCapability","output","walk","node","shouldBuildText","child","fs","readFile","Canvas","createCanvas","DEFAULT_TAB_INDEX","GetElementsByNameSet","getRectDims","AnnotationElementFactory","parameters","annotationType","LinkAnnotationElement","TextAnnotationElement","fieldType","TextWidgetAnnotationElement","radioButton","RadioButtonWidgetAnnotationElement","checkBox","CheckboxWidgetAnnotationElement","PushButtonWidgetAnnotationElement","ChoiceWidgetAnnotationElement","WidgetAnnotationElement","PopupAnnotationElement","FreeTextAnnotationElement","LineAnnotationElement","SquareAnnotationElement","CircleAnnotationElement","PolylineAnnotationElement","CaretAnnotationElement","InkAnnotationElement","PolygonAnnotationElement","HighlightAnnotationElement","UnderlineAnnotationElement","SquigglyAnnotationElement","StrikeOutAnnotationElement","StampAnnotationElement","FileAttachmentAnnotationElement","AnnotationElement","isRenderable","ignoreBorder","createQuadrilaterals","layer","linkService","downloadManager","imageResourcesPath","renderForms","svgFactory","enableScripting","_fieldObjects","fieldObjects","_mouseState","mouseState","container","_createContainer","quadrilaterals","_createQuadrilaterals","transformOrigin","borderStyle","borderWidth","horizontalRadius","horizontalCornerRadius","verticalRadius","verticalCornerRadius","radius","borderRadius","borderBottomStyle","borderColor","_commonActions","setColor","jsName","styleName","detail","target","ColorConverters","display","hidden","print","focus","preventScroll","userName","title","readonly","removeAttribute","required","bgColor","fgColor","textColor","_dispatchEventFromSandbox","actions","jsEvent","commonActions","_setDefaultPropertiesFromJS","storedData","quadPoints","savedRect","quadPoint","_createPopup","trigger","popupElement","PopupElement","modificationDate","richText","hideWrapper","popup","_renderQuadrilaterals","className","quadrilateral","_getElementsByName","skipId","fields","fieldObj","exportValues","exportValue","domElement","getElementById","getElementsByName","platform","isWin","isMac","isTooltipOnly","resetForm","Action","link","addLinkAttributes","newWindow","_bindNamedAction","_bindLink","hasClickAction","_bindJSAction","_bindResetFormAction","index","linkElement","cloneNode","destination","getDestinationHash","onclick","goToDestination","getAnchorUrl","executeNamedAction","eventBus","dispatch","otherClickAction","resetFormFields","refs","resetFormRefs","include","allFields","fieldIds","fieldName","field","storage","allIds","dispatchEvent","Event","hasPopup","alt","dataset","l10nId","l10nArgs","alternativeText","_getKeyModifier","ctrlKey","metaKey","_setEventListener","baseName","eventName","valueGetter","shiftKey","modifier","_setEventListeners","getter","_setBackgroundColor","hasAppearance","fieldValue","setPropertyOnSiblings","keyInStorage","formattedValue","elementData","userValue","valueOnFocus","multiLine","disabled","readOnly","tabIndex","defaultFieldValue","blurListener","scrollLeft","activeElement","selRange","setSelectionRange","commitKey","willCommit","selStart","selectionStart","selEnd","selectionEnd","_blurListener","isDown","Keystroke","inputType","preventDefault","change","maxLen","maxLength","comb","fieldWidth","combWidth","classList","letterSpacing","verticalAlign","_setTextStyle","TEXT_ALIGNMENT","fontColor","defaultAppearanceData","textAlignment","textAlign","checked","checkbox","curChecked","buttonValue","radio","pdfButtonValue","fontSizeStyle","selectElement","combo","multiSelect","multiple","option","selected","optionElement","displayValue","isExport","selectedIndex","filter","getItems","multipleSelection","findIndex","insertBefore","indices","editable","changeEx","keyDown","IGNORE_TYPES","parentType","selector","parentId","parentElements","querySelectorAll","parentRect","popupLeft","popupTop","pinned","BACKGROUND_ENLIGHT","hideElement","dir","dateObject","toLocaleDateString","toLocaleTimeString","XfaLayer","xfaHtml","html","lastChild","contents","_formatContents","_toggle","_show","_hide","lines","split","line","createTextNode","pin","zIndex","unpin","lineCoordinates","append","square","circle","containerClassName","svgElementName","coordinate","vertices","polyline","inkList","inkLists","content","file","_download","openOrDownloadData","AnnotationLayer","sortedAnnotations","popupAnnotations","rendered","renderedElement","prepend","setAnnotationCanvasMap","ownMatrix","elements","ownTransform","querySelector","firstChild","nodeName","replaceChild","makeColorComp","CMYK_G","G_CMYK","G_RGB","G_HTML","G","RGB_G","RGB_HTML","R","B","T_HTML","CMYK_RGB","CMYK_HTML","components","RGB_CMYK","setupStorage","xfaOn","xfaOff","getAttribute","setAttributes","isHTMLAnchorElement","HTMLAnchorElement","dataId","root","rootHtml","stack","rootDiv","textDivs","parent","childHtml","xmlns","el","MAX_TEXT_DIVS_TO_RENDER","DEFAULT_FONT_SIZE","DEFAULT_FONT_ASCENT","ascentCache","AllWhitespaceRegexp","getAscent","cachedAscent","metrics","ascent","fontBoundingBoxAscent","descent","fontBoundingBoxDescent","ratio","pixels","appendText","geom","textDiv","textDivProperties","_enhanceTextSelection","hasText","hasEOL","originalTransform","paddingBottom","paddingLeft","paddingRight","paddingTop","_textDivs","_viewport","atan2","fontName","fontHeight","fontAscent","_fontInspectorEnabled","shouldScaleText","absScaleX","absScaleY","_textDivProperties","_textContentStream","_layoutText","angleCos","angleSin","divWidth","divHeight","right","bottom","_canceled","textDivsLength","_renderingDone","findPositiveMin","ts","expand","expanded","expandBounds","divProperties","Float64Array","jj","boxScale","boxes","x1New","x2New","expandBoundsLTR","sort","fakeBoundary","horizon","boundary","horizonPart","affectedBoundary","maxXNew","xNew","changedHorizon","lastBoundary","useBoundary","unshift","used","concat","TextLayerRenderTask","textContentStream","textContentItemsStr","enhanceTextSelection","_textContent","_container","_textContentItemsStr","_reader","_layoutTextLastFontSize","_layoutTextLastFontFamily","_layoutTextCtx","_renderTimer","_processItems","styleCache","len","parentNode","_render","timeout","textItems","textStyles","expandTextDivs","expandDivs","transformBuf","paddingBuf","divProps","padding","renderTextLayer","renderParameters","SVGGraphics","SVG_DEFAULTS","fontStyle","XML_NS","XLINK_NS","contentType","forceDataSchema","digits","b1","b2","b3","d1","d2","d3","d4","convertImgDataToPng","PNG_HEADER","CHUNK_WRAPPER_SIZE","crcTable","crc32","crc","writePngChunk","adler32","deflateSync","literals","deflateSyncUncompressed","maxBlockLength","deflateBlocks","idat","pi","adler","encode","isMask","bitDepth","colorType","offsetLiterals","offsetBytes","ihdr","pngLength","SVGExtraState","dependencies","activeClipUrl","clipGroup","maskId","opListToTree","opList","opTree","opListElement","fn","pf","toFixed","pm","acos","clipCount","maskCount","shadingCount","transformMatrix","transformStack","extraStack","embedFonts","embeddedFonts","cssStyle","_operatorIdMapping","tgrp","executeOpTree","loadDependencies","getSVG","svgElement","convertOpList","operatorIdMapping","opTreeElement","lineMatrix","xcoords","ycoords","tspan","setAttributeNS","txtElement","txtgrp","lineWidthScale","_setStrokeAttributes","_ensureTransformGroup","addFontStyle","defs","hasChildNodes","setStrokeAlpha","setFillAlpha","_makeColorN_Pattern","_makeShadingPattern","_makeTilingPattern","tilingId","tx0","ty0","tx1","ty1","xscale","yscale","txstep","tystep","tiling","childNodes","shadingId","colorStops","gradient","point0","point1","focalPoint","circlePoint","focalRadius","circleRadius","stop","getAttributeNS","clipId","clipPath","clipElement","imgSrc","cliprect","imgEl","definitions","rootGroup","_ensureClipGroup","http","https","fileUriRegex","parseUrl","sourceUrl","parsedUrl","parse","host","PDFNodeStream","isHttp","isFsUrl","_rangeRequestReaders","PDFNodeStreamFsFullReader","PDFNodeStreamFullReader","PDFNodeStreamFsRangeReader","PDFNodeStreamRangeReader","BaseFullReader","_url","_storedError","_disableRange","_rangeChunkSize","_readableStream","_readCapability","_headersCapability","_error","_setReadableStream","BaseRangeReader","createRequestOptions","headers","auth","hostname","method","handleResponse","statusCode","getResponseHeader","allowRangeRequests","suggestedLength","validateRangeRequestCapabilities","extractFilenameFromHeader","_request","_httpHeaders","Range","lstat","stat","createReadStream","returnValues","contentEncoding","contentDisposition","getFilenameFromContentDispositionHeader","createResponseStatusError","validateResponseStatus","needsEncodingFixup","toParamRegExp","rfc2616unquote","rfc5987decode","rfc2047decode","fixupEncoding","rfc2231getparam","attributePattern","flags","textdecode","contentDispositionStr","iter","quot","part","parts","quotindex","extvalue","encodingend","langvalue","charset","hex","OK_RESPONSE","PARTIAL_CONTENT_RESPONSE","getArrayBuffer","xhr","NetworkManager","getXhr","NetworkManager_getXhr","currXhrId","pendingRequests","requestRange","listeners","requestFull","xhrId","pendingRequest","setRequestHeader","expectedStatus","onError","onStateChange","onprogress","onHeadersReceived","onDone","xhrStatus","ok_response_on_range_request","rangeHeader","getRequestXhr","isPendingRequest","abortRequest","PDFNetworkStream","_source","_manager","_onRangeRequestReaderClosed","PDFNetworkStreamFullRequestReader","PDFNetworkStreamRangeRequestReader","onClosed","manager","_onHeadersReceived","_onDone","_onError","_fullRequestId","_headersReceivedCapability","_cachedChunks","fullRequestXhrId","fullRequestXhr","lengthComputable","_requestId","_close","createFetchOptions","abortController","signal","credentials","redirect","createHeaders","Headers","PDFFetchStream","PDFFetchStreamReader","PDFFetchStreamRangeReader","_withCredentials","AbortController","_abortController","_headers","pdfjsVersion","pdfjsBuild"],"sourceRoot":""} |