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ye,aAAa;EACbuD,2BAA2B;EAC3B1R,iBAAiB;EACjBgX,kBAAkB;EAClBrY,MAAM;EACNkjH,kBAAkB;EAClB1tG,SAAS;EACT8E,uBAAuB;EACvBsgE,SAAS;EACTp7C,YAAY;EACZ9/B,aAAa;EACbsF,IAAI;EACJzN,cAAc;EACdm4F,OAAO;EACP2E,QAAQA,EAAAA,QAAAA;AACV,CAAC","sources":["webpack://pdf.js/webpack/bootstrap","webpack://pdf.js/webpack/runtime/define property getters","webpack://pdf.js/webpack/runtime/hasOwnProperty shorthand","webpack://pdf.js/./src/shared/util.js","webpack://pdf.js/./src/display/display_utils.js","webpack://pdf.js/./src/display/editor/toolbar.js","webpack://pdf.js/./src/display/editor/tools.js","webpack://pdf.js/./src/display/editor/alt_text.js","webpack://pdf.js/./src/display/editor/comment.js","webpack://pdf.js/./src/display/touch_manager.js","webpack://pdf.js/./src/display/editor/editor.js","webpack://pdf.js/./src/shared/murmurhash3.js","webpack://pdf.js/./src/display/annotation_storage.js","webpack://pdf.js/./src/display/font_loader.js","webpack://pdf.js/./src/display/api_utils.js","webpack://pdf.js/./src/shared/message_handler.js","webpack://pdf.js/./src/display/canvas_factory.js","webpack://pdf.js/./src/display/cmap_reader_factory.js","webpack://pdf.js/./src/display/filter_factory.js","webpack://pdf.js/./src/display/standard_fontdata_factory.js","webpack://pdf.js/./src/display/wasm_factory.js","webpack://pdf.js/./src/display/node_utils.js","webpack://pdf.js/./src/display/canvas_dependency_tracker.js","webpack://pdf.js/./src/display/pattern_helper.js","webpack://pdf.js/./src/shared/image_utils.js","webpack://pdf.js/./src/display/canvas.js","webpack://pdf.js/./src/display/worker_options.js","webpack://pdf.js/./src/display/metadata.js","webpack://pdf.js/./src/display/optional_content_config.js","webpack://pdf.js/./src/display/transport_stream.js","webpack://pdf.js/./src/display/content_disposition.js","webpack://pdf.js/./src/display/network_utils.js","webpack://pdf.js/./src/display/fetch_stream.js","webpack://pdf.js/./src/display/network.js","webpack://pdf.js/./src/display/node_stream.js","webpack://pdf.js/./src/display/pdf_objects.js","webpack://pdf.js/./src/display/text_layer.js","webpack://pdf.js/./src/display/xfa_text.js","webpack://pdf.js/./src/display/api.js","webpack://pdf.js/./src/display/editor/color_picker.js","webpack://pdf.js/./src/shared/scripting_utils.js","webpack://pdf.js/./src/display/svg_factory.js","webpack://pdf.js/./src/display/xfa_layer.js","webpack://pdf.js/./src/display/annotation_layer.js","webpack://pdf.js/./src/display/editor/freetext.js","webpack://pdf.js/./src/display/editor/drawers/outline.js","webpack://pdf.js/./src/display/editor/drawers/freedraw.js","webpack://pdf.js/./src/display/editor/drawers/highlight.js","webpack://pdf.js/./src/display/editor/highlight.js","webpack://pdf.js/./src/display/editor/draw.js","webpack://pdf.js/./src/display/editor/drawers/inkdraw.js","webpack://pdf.js/./src/display/editor/ink.js","webpack://pdf.js/./src/display/editor/drawers/contour.js","webpack://pdf.js/./src/display/editor/drawers/signaturedraw.js","webpack://pdf.js/./src/display/editor/signature.js","webpack://pdf.js/./src/display/editor/stamp.js","webpack://pdf.js/./src/display/editor/annotation_editor_layer.js","webpack://pdf.js/./src/display/draw_layer.js","webpack://pdf.js/./src/pdf.js"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","/* Copyright 2012 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/* globals process */\n\n// NW.js / Electron is a browser context, but copies some Node.js objects; see\n// http://docs.nwjs.io/en/latest/For%20Users/Advanced/JavaScript%20Contexts%20in%20NW.js/#access-nodejs-and-nwjs-api-in-browser-context\n// https://www.electronjs.org/docs/api/process#processversionselectron-readonly\n// https://www.electronjs.org/docs/api/process#processtype-readonly\nconst isNodeJS =\n (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"GENERIC\")) &&\n typeof process === \"object\" &&\n process + \"\" === \"[object process]\" &&\n !process.versions.nw &&\n !(process.versions.electron && process.type && process.type !== \"browser\");\n\nconst FONT_IDENTITY_MATRIX = [0.001, 0, 0, 0.001, 0, 0];\n\n// Represent the percentage of the height of a single-line field over\n// the font size. Acrobat seems to use this value.\nconst LINE_FACTOR = 1.35;\nconst LINE_DESCENT_FACTOR = 0.35;\nconst BASELINE_FACTOR = LINE_DESCENT_FACTOR / LINE_FACTOR;\n\n/**\n * Refer to the `WorkerTransport.getRenderingIntent`-method in the API, to see\n * how these flags are being used:\n * - ANY, DISPLAY, and PRINT are the normal rendering intents, note the\n * `PDFPageProxy.{render, getOperatorList, getAnnotations}`-methods.\n * - SAVE is used, on the worker-thread, when saving modified annotations.\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 * - IS_EDITING is used when editing is active in the viewer.\n * - OPLIST is used with the `PDFPageProxy.getOperatorList`-method, note the\n * `OperatorList`-constructor (on the worker-thread).\n */\nconst RenderingIntentFlag = {\n ANY: 0x01,\n DISPLAY: 0x02,\n PRINT: 0x04,\n SAVE: 0x08,\n ANNOTATIONS_FORMS: 0x10,\n ANNOTATIONS_STORAGE: 0x20,\n ANNOTATIONS_DISABLE: 0x40,\n IS_EDITING: 0x80,\n OPLIST: 0x100,\n};\n\nconst AnnotationMode = {\n DISABLE: 0,\n ENABLE: 1,\n ENABLE_FORMS: 2,\n ENABLE_STORAGE: 3,\n};\n\nconst AnnotationEditorPrefix = \"pdfjs_internal_editor_\";\n\nconst AnnotationEditorType = {\n DISABLE: -1,\n NONE: 0,\n FREETEXT: 3,\n HIGHLIGHT: 9,\n STAMP: 13,\n INK: 15,\n POPUP: 16,\n SIGNATURE: 101,\n COMMENT: 102,\n};\n\nconst AnnotationEditorParamsType = {\n RESIZE: 1,\n CREATE: 2,\n FREETEXT_SIZE: 11,\n FREETEXT_COLOR: 12,\n FREETEXT_OPACITY: 13,\n INK_COLOR: 21,\n INK_THICKNESS: 22,\n INK_OPACITY: 23,\n HIGHLIGHT_COLOR: 31,\n HIGHLIGHT_THICKNESS: 32,\n HIGHLIGHT_FREE: 33,\n HIGHLIGHT_SHOW_ALL: 34,\n DRAW_STEP: 41,\n};\n\n// Permission flags from Table 22, Section 7.6.3.2 of the PDF specification.\nconst PermissionFlag = {\n PRINT: 0x04,\n MODIFY_CONTENTS: 0x08,\n COPY: 0x10,\n MODIFY_ANNOTATIONS: 0x20,\n FILL_INTERACTIVE_FORMS: 0x100,\n COPY_FOR_ACCESSIBILITY: 0x200,\n ASSEMBLE: 0x400,\n PRINT_HIGH_QUALITY: 0x800,\n};\n\nconst TextRenderingMode = {\n FILL: 0,\n STROKE: 1,\n FILL_STROKE: 2,\n INVISIBLE: 3,\n FILL_ADD_TO_PATH: 4,\n STROKE_ADD_TO_PATH: 5,\n FILL_STROKE_ADD_TO_PATH: 6,\n ADD_TO_PATH: 7,\n FILL_STROKE_MASK: 3,\n ADD_TO_PATH_FLAG: 4,\n};\n\nconst ImageKind = {\n GRAYSCALE_1BPP: 1,\n RGB_24BPP: 2,\n RGBA_32BPP: 3,\n};\n\nconst AnnotationType = {\n TEXT: 1,\n LINK: 2,\n FREETEXT: 3,\n LINE: 4,\n SQUARE: 5,\n CIRCLE: 6,\n POLYGON: 7,\n POLYLINE: 8,\n HIGHLIGHT: 9,\n UNDERLINE: 10,\n SQUIGGLY: 11,\n STRIKEOUT: 12,\n STAMP: 13,\n CARET: 14,\n INK: 15,\n POPUP: 16,\n FILEATTACHMENT: 17,\n SOUND: 18,\n MOVIE: 19,\n WIDGET: 20,\n SCREEN: 21,\n PRINTERMARK: 22,\n TRAPNET: 23,\n WATERMARK: 24,\n THREED: 25,\n REDACT: 26,\n};\n\nconst AnnotationReplyType = {\n GROUP: \"Group\",\n REPLY: \"R\",\n};\n\nconst AnnotationFlag = {\n INVISIBLE: 0x01,\n HIDDEN: 0x02,\n PRINT: 0x04,\n NOZOOM: 0x08,\n NOROTATE: 0x10,\n NOVIEW: 0x20,\n READONLY: 0x40,\n LOCKED: 0x80,\n TOGGLENOVIEW: 0x100,\n LOCKEDCONTENTS: 0x200,\n};\n\nconst AnnotationFieldFlag = {\n READONLY: 0x0000001,\n REQUIRED: 0x0000002,\n NOEXPORT: 0x0000004,\n MULTILINE: 0x0001000,\n PASSWORD: 0x0002000,\n NOTOGGLETOOFF: 0x0004000,\n RADIO: 0x0008000,\n PUSHBUTTON: 0x0010000,\n COMBO: 0x0020000,\n EDIT: 0x0040000,\n SORT: 0x0080000,\n FILESELECT: 0x0100000,\n MULTISELECT: 0x0200000,\n DONOTSPELLCHECK: 0x0400000,\n DONOTSCROLL: 0x0800000,\n COMB: 0x1000000,\n RICHTEXT: 0x2000000,\n RADIOSINUNISON: 0x2000000,\n COMMITONSELCHANGE: 0x4000000,\n};\n\nconst AnnotationBorderStyleType = {\n SOLID: 1,\n DASHED: 2,\n BEVELED: 3,\n INSET: 4,\n UNDERLINE: 5,\n};\n\nconst AnnotationActionEventType = {\n E: \"Mouse Enter\",\n X: \"Mouse Exit\",\n D: \"Mouse Down\",\n U: \"Mouse Up\",\n Fo: \"Focus\",\n Bl: \"Blur\",\n PO: \"PageOpen\",\n PC: \"PageClose\",\n PV: \"PageVisible\",\n PI: \"PageInvisible\",\n K: \"Keystroke\",\n F: \"Format\",\n V: \"Validate\",\n C: \"Calculate\",\n};\n\nconst DocumentActionEventType = {\n WC: \"WillClose\",\n WS: \"WillSave\",\n DS: \"DidSave\",\n WP: \"WillPrint\",\n DP: \"DidPrint\",\n};\n\nconst PageActionEventType = {\n O: \"PageOpen\",\n C: \"PageClose\",\n};\n\nconst VerbosityLevel = {\n ERRORS: 0,\n WARNINGS: 1,\n INFOS: 5,\n};\n\n// All the possible operations for an operator list.\nconst OPS = {\n // Intentionally start from 1 so it is easy to spot bad operators that will be\n // 0's.\n // PLEASE NOTE: We purposely keep any removed operators commented out, since\n // re-numbering the list would risk breaking third-party users.\n dependency: 1,\n setLineWidth: 2,\n setLineCap: 3,\n setLineJoin: 4,\n setMiterLimit: 5,\n setDash: 6,\n setRenderingIntent: 7,\n setFlatness: 8,\n setGState: 9,\n save: 10,\n restore: 11,\n transform: 12,\n moveTo: 13,\n lineTo: 14,\n curveTo: 15,\n curveTo2: 16,\n curveTo3: 17,\n closePath: 18,\n rectangle: 19,\n stroke: 20,\n closeStroke: 21,\n fill: 22,\n eoFill: 23,\n fillStroke: 24,\n eoFillStroke: 25,\n closeFillStroke: 26,\n closeEOFillStroke: 27,\n endPath: 28,\n clip: 29,\n eoClip: 30,\n beginText: 31,\n endText: 32,\n setCharSpacing: 33,\n setWordSpacing: 34,\n setHScale: 35,\n setLeading: 36,\n setFont: 37,\n setTextRenderingMode: 38,\n setTextRise: 39,\n moveText: 40,\n setLeadingMoveText: 41,\n setTextMatrix: 42,\n nextLine: 43,\n showText: 44,\n showSpacedText: 45,\n nextLineShowText: 46,\n nextLineSetSpacingShowText: 47,\n setCharWidth: 48,\n setCharWidthAndBounds: 49,\n setStrokeColorSpace: 50,\n setFillColorSpace: 51,\n setStrokeColor: 52,\n setStrokeColorN: 53,\n setFillColor: 54,\n setFillColorN: 55,\n setStrokeGray: 56,\n setFillGray: 57,\n setStrokeRGBColor: 58,\n setFillRGBColor: 59,\n setStrokeCMYKColor: 60,\n setFillCMYKColor: 61,\n shadingFill: 62,\n beginInlineImage: 63,\n beginImageData: 64,\n endInlineImage: 65,\n paintXObject: 66,\n markPoint: 67,\n markPointProps: 68,\n beginMarkedContent: 69,\n beginMarkedContentProps: 70,\n endMarkedContent: 71,\n beginCompat: 72,\n endCompat: 73,\n paintFormXObjectBegin: 74,\n paintFormXObjectEnd: 75,\n beginGroup: 76,\n endGroup: 77,\n // beginAnnotations: 78,\n // endAnnotations: 79,\n beginAnnotation: 80,\n endAnnotation: 81,\n // paintJpegXObject: 82,\n paintImageMaskXObject: 83,\n paintImageMaskXObjectGroup: 84,\n paintImageXObject: 85,\n paintInlineImageXObject: 86,\n paintInlineImageXObjectGroup: 87,\n paintImageXObjectRepeat: 88,\n paintImageMaskXObjectRepeat: 89,\n paintSolidColorImageMask: 90,\n constructPath: 91,\n setStrokeTransparent: 92,\n setFillTransparent: 93,\n rawFillPath: 94,\n};\n\n// In order to have a switch statement that is fast (i.e. which use a jump\n// table), we need to have the OPS in a contiguous range.\nconst DrawOPS = {\n moveTo: 0,\n lineTo: 1,\n curveTo: 2,\n closePath: 3,\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 // eslint-disable-next-line no-console\n console.log(`Info: ${msg}`);\n }\n}\n\n// Non-fatal warnings.\nfunction warn(msg) {\n if (verbosity >= VerbosityLevel.WARNINGS) {\n // eslint-disable-next-line no-console\n console.log(`Warning: ${msg}`);\n }\n}\n\nfunction unreachable(msg) {\n throw new Error(msg);\n}\n\nfunction assert(cond, msg) {\n if (!cond) {\n unreachable(msg);\n }\n}\n\n// Checks if URLs use one of the allowed protocols, e.g. to avoid XSS.\nfunction _isValidProtocol(url) {\n switch (url?.protocol) {\n case \"http:\":\n case \"https:\":\n case \"ftp:\":\n case \"mailto:\":\n case \"tel:\":\n return true;\n default:\n return false;\n }\n}\n\n/**\n * Attempts to create a valid absolute URL.\n *\n * @param {URL|string} url - An absolute, or relative, URL.\n * @param {URL|string} [baseUrl] - An absolute URL.\n * @param {Object} [options]\n * @returns Either a valid {URL}, or `null` otherwise.\n */\nfunction createValidAbsoluteUrl(url, baseUrl = null, options = null) {\n if (!url) {\n return null;\n }\n if (options && typeof url === \"string\") {\n // Let URLs beginning with \"www.\" default to using the \"http://\" protocol.\n if (options.addDefaultProtocol && url.startsWith(\"www.\")) {\n const dots = url.match(/\\./g);\n // Avoid accidentally matching a *relative* URL pointing to a file named\n // e.g. \"www.pdf\" or similar.\n if (dots?.length >= 2) {\n url = `http://${url}`;\n }\n }\n\n // According to ISO 32000-1:2008, section 12.6.4.7, URIs should be encoded\n // in 7-bit ASCII. Some bad PDFs use UTF-8 encoding; see bug 1122280.\n if (options.tryConvertEncoding) {\n try {\n url = stringToUTF8String(url);\n } catch {}\n }\n }\n\n const absoluteUrl = baseUrl ? URL.parse(url, baseUrl) : URL.parse(url);\n return _isValidProtocol(absoluteUrl) ? absoluteUrl : null;\n}\n\n/**\n * Remove, or replace, the hash property of the URL.\n *\n * @param {URL|string} url - The absolute, or relative, URL.\n * @param {string} hash - The hash property (use an empty string to remove it).\n * @param {boolean} [allowRel] - Allow relative URLs.\n * @returns {string} The resulting URL string.\n */\nfunction updateUrlHash(url, hash, allowRel = false) {\n const res = URL.parse(url);\n if (res) {\n res.hash = hash;\n return res.href;\n }\n // Support well-formed relative URLs, necessary for `web/app.js` in GENERIC\n // builds, by optionally falling back to string parsing.\n if (allowRel && createValidAbsoluteUrl(url, \"http://example.com\")) {\n return url.split(\"#\", 1)[0] + `${hash ? `#${hash}` : \"\"}`;\n }\n return \"\";\n}\n\nfunction shadow(obj, prop, value, nonSerializable = false) {\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) {\n assert(\n prop in obj,\n `shadow: Property \"${prop && prop.toString()}\" not found in object.`\n );\n }\n Object.defineProperty(obj, prop, {\n value,\n enumerable: !nonSerializable,\n configurable: true,\n writable: false,\n });\n return value;\n}\n\n/**\n * @type {any}\n */\nconst BaseException = (function BaseExceptionClosure() {\n // eslint-disable-next-line no-shadow\n function BaseException(message, name) {\n if (\n (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) &&\n this.constructor === BaseException\n ) {\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 ResponseException extends BaseException {\n constructor(msg, status, missing) {\n super(msg, \"ResponseException\");\n this.status = status;\n this.missing = missing;\n }\n}\n\n/**\n * Error caused during parsing PDF data.\n */\nclass FormatError extends BaseException {\n constructor(msg) {\n super(msg, \"FormatError\");\n }\n}\n\n/**\n * Error used to indicate task cancellation.\n */\nclass AbortException extends BaseException {\n constructor(msg) {\n super(msg, \"AbortException\");\n }\n}\n\nfunction bytesToString(bytes) {\n if (typeof bytes !== \"object\" || bytes?.length === undefined) {\n unreachable(\"Invalid argument for bytesToString\");\n }\n const length = bytes.length;\n const MAX_ARGUMENT_COUNT = 8192;\n if (length < MAX_ARGUMENT_COUNT) {\n return String.fromCharCode.apply(null, bytes);\n }\n const strBuf = [];\n for (let i = 0; i < length; i += MAX_ARGUMENT_COUNT) {\n const chunkEnd = Math.min(i + MAX_ARGUMENT_COUNT, length);\n const chunk = bytes.subarray(i, chunkEnd);\n strBuf.push(String.fromCharCode.apply(null, chunk));\n }\n return strBuf.join(\"\");\n}\n\nfunction stringToBytes(str) {\n if (typeof str !== \"string\") {\n unreachable(\"Invalid argument for stringToBytes\");\n }\n const length = str.length;\n const bytes = new Uint8Array(length);\n for (let i = 0; i < length; ++i) {\n bytes[i] = str.charCodeAt(i) & 0xff;\n }\n return bytes;\n}\n\nfunction string32(value) {\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) {\n assert(\n typeof value === \"number\" && Math.abs(value) < 2 ** 32,\n `string32: Unexpected input \"${value}\".`\n );\n }\n return String.fromCharCode(\n (value >> 24) & 0xff,\n (value >> 16) & 0xff,\n (value >> 8) & 0xff,\n value & 0xff\n );\n}\n\nfunction objectSize(obj) {\n return Object.keys(obj).length;\n}\n\n// Checks the endianness of the platform.\nfunction isLittleEndian() {\n const buffer8 = new Uint8Array(4);\n buffer8[0] = 1;\n const view32 = new Uint32Array(buffer8.buffer, 0, 1);\n return view32[0] === 1;\n}\n\n// Checks if it's possible to eval JS expressions.\nfunction isEvalSupported() {\n try {\n new Function(\"\"); // eslint-disable-line no-new, no-new-func\n return true;\n } catch {\n return false;\n }\n}\n\nclass FeatureTest {\n static get isLittleEndian() {\n return shadow(this, \"isLittleEndian\", isLittleEndian());\n }\n\n static get isEvalSupported() {\n return shadow(this, \"isEvalSupported\", isEvalSupported());\n }\n\n static get isOffscreenCanvasSupported() {\n return shadow(\n this,\n \"isOffscreenCanvasSupported\",\n typeof OffscreenCanvas !== \"undefined\"\n );\n }\n\n static get isImageDecoderSupported() {\n return shadow(\n this,\n \"isImageDecoderSupported\",\n typeof ImageDecoder !== \"undefined\"\n );\n }\n\n static get platform() {\n const { platform, userAgent } = navigator;\n\n return shadow(this, \"platform\", {\n isAndroid: userAgent.includes(\"Android\"),\n isLinux: platform.includes(\"Linux\"),\n isMac: platform.includes(\"Mac\"),\n isWindows: platform.includes(\"Win\"),\n isFirefox:\n (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) ||\n userAgent.includes(\"Firefox\"),\n });\n }\n\n static get isCSSRoundSupported() {\n return shadow(\n this,\n \"isCSSRoundSupported\",\n globalThis.CSS?.supports?.(\"width: round(1.5px, 1px)\")\n );\n }\n}\n\nconst hexNumbers = Array.from(Array(256).keys(), n =>\n n.toString(16).padStart(2, \"0\")\n);\n\nclass Util {\n static makeHexColor(r, g, b) {\n return `#${hexNumbers[r]}${hexNumbers[g]}${hexNumbers[b]}`;\n }\n\n static domMatrixToTransform(dm) {\n return [dm.a, dm.b, dm.c, dm.d, dm.e, dm.f];\n }\n\n // Apply a scaling matrix to some min/max values.\n // If a scaling factor is negative then min and max must be\n // swapped.\n static scaleMinMax(transform, minMax) {\n let temp;\n if (transform[0]) {\n if (transform[0] < 0) {\n temp = minMax[0];\n minMax[0] = minMax[2];\n minMax[2] = temp;\n }\n minMax[0] *= transform[0];\n minMax[2] *= transform[0];\n\n if (transform[3] < 0) {\n temp = minMax[1];\n minMax[1] = minMax[3];\n minMax[3] = temp;\n }\n minMax[1] *= transform[3];\n minMax[3] *= transform[3];\n } else {\n temp = minMax[0];\n minMax[0] = minMax[1];\n minMax[1] = temp;\n temp = minMax[2];\n minMax[2] = minMax[3];\n minMax[3] = temp;\n\n if (transform[1] < 0) {\n temp = minMax[1];\n minMax[1] = minMax[3];\n minMax[3] = temp;\n }\n minMax[1] *= transform[1];\n minMax[3] *= transform[1];\n\n if (transform[2] < 0) {\n temp = minMax[0];\n minMax[0] = minMax[2];\n minMax[2] = temp;\n }\n minMax[0] *= transform[2];\n minMax[2] *= transform[2];\n }\n minMax[0] += transform[4];\n minMax[1] += transform[5];\n minMax[2] += transform[4];\n minMax[3] += transform[5];\n }\n\n // Concatenates two transformation matrices together and returns the result.\n static transform(m1, m2) {\n return [\n m1[0] * m2[0] + m1[2] * m2[1],\n m1[1] * m2[0] + m1[3] * m2[1],\n m1[0] * m2[2] + m1[2] * m2[3],\n m1[1] * m2[2] + m1[3] * m2[3],\n m1[0] * m2[4] + m1[2] * m2[5] + m1[4],\n m1[1] * m2[4] + m1[3] * m2[5] + m1[5],\n ];\n }\n\n // Multiplies m (an array-based transform) by md (a DOMMatrix transform).\n static multiplyByDOMMatrix(m, md) {\n return [\n m[0] * md.a + m[2] * md.b,\n m[1] * md.a + m[3] * md.b,\n m[0] * md.c + m[2] * md.d,\n m[1] * md.c + m[3] * md.d,\n m[0] * md.e + m[2] * md.f + m[4],\n m[1] * md.e + m[3] * md.f + m[5],\n ];\n }\n\n // For 2d affine transforms\n static applyTransform(p, m, pos = 0) {\n const p0 = p[pos];\n const p1 = p[pos + 1];\n p[pos] = p0 * m[0] + p1 * m[2] + m[4];\n p[pos + 1] = p0 * m[1] + p1 * m[3] + m[5];\n }\n\n static applyTransformToBezier(p, transform, pos = 0) {\n const m0 = transform[0];\n const m1 = transform[1];\n const m2 = transform[2];\n const m3 = transform[3];\n const m4 = transform[4];\n const m5 = transform[5];\n for (let i = 0; i < 6; i += 2) {\n const pI = p[pos + i];\n const pI1 = p[pos + i + 1];\n p[pos + i] = pI * m0 + pI1 * m2 + m4;\n p[pos + i + 1] = pI * m1 + pI1 * m3 + m5;\n }\n }\n\n static applyInverseTransform(p, m) {\n const p0 = p[0];\n const p1 = p[1];\n const d = m[0] * m[3] - m[1] * m[2];\n p[0] = (p0 * m[3] - p1 * m[2] + m[2] * m[5] - m[4] * m[3]) / d;\n p[1] = (-p0 * m[1] + p1 * m[0] + m[4] * m[1] - m[5] * m[0]) / d;\n }\n\n // Applies the transform to the rectangle and finds the minimum axially\n // aligned bounding box.\n static axialAlignedBoundingBox(rect, transform, output) {\n const m0 = transform[0];\n const m1 = transform[1];\n const m2 = transform[2];\n const m3 = transform[3];\n const m4 = transform[4];\n const m5 = transform[5];\n const r0 = rect[0];\n const r1 = rect[1];\n const r2 = rect[2];\n const r3 = rect[3];\n\n let a0 = m0 * r0 + m4;\n let a2 = a0;\n let a1 = m0 * r2 + m4;\n let a3 = a1;\n let b0 = m3 * r1 + m5;\n let b2 = b0;\n let b1 = m3 * r3 + m5;\n let b3 = b1;\n\n if (m1 !== 0 || m2 !== 0) {\n // Non-scaling matrix: shouldn't be frequent.\n const m1r0 = m1 * r0;\n const m1r2 = m1 * r2;\n const m2r1 = m2 * r1;\n const m2r3 = m2 * r3;\n a0 += m2r1;\n a3 += m2r1;\n a1 += m2r3;\n a2 += m2r3;\n b0 += m1r0;\n b3 += m1r0;\n b1 += m1r2;\n b2 += m1r2;\n }\n\n output[0] = Math.min(output[0], a0, a1, a2, a3);\n output[1] = Math.min(output[1], b0, b1, b2, b3);\n output[2] = Math.max(output[2], a0, a1, a2, a3);\n output[3] = Math.max(output[3], b0, b1, b2, b3);\n }\n\n static inverseTransform(m) {\n const d = m[0] * m[3] - m[1] * m[2];\n return [\n m[3] / d,\n -m[1] / d,\n -m[2] / d,\n m[0] / d,\n (m[2] * m[5] - m[4] * m[3]) / d,\n (m[4] * m[1] - m[5] * m[0]) / d,\n ];\n }\n\n // This calculation uses Singular Value Decomposition.\n // The SVD can be represented with formula A = USV. We are interested in the\n // matrix S here because it represents the scale values.\n static singularValueDecompose2dScale(matrix, output) {\n const m0 = matrix[0];\n const m1 = matrix[1];\n const m2 = matrix[2];\n const m3 = matrix[3];\n // Multiply matrix m with its transpose.\n const a = m0 ** 2 + m1 ** 2;\n const b = m0 * m2 + m1 * m3;\n const c = m2 ** 2 + m3 ** 2;\n\n // Solve the second degree polynomial to get roots.\n const first = (a + c) / 2;\n const second = Math.sqrt(first ** 2 - (a * c - b ** 2));\n output[0] = Math.sqrt(first + second || 1);\n output[1] = Math.sqrt(first - second || 1);\n }\n\n // Normalize rectangle rect=[x1, y1, x2, y2] so that (x1,y1) < (x2,y2)\n // For coordinate systems whose origin lies in the bottom-left, this\n // means normalization to (BL,TR) ordering. For systems with origin in the\n // top-left, this means (TL,BR) ordering.\n static normalizeRect(rect) {\n const r = rect.slice(0); // clone rect\n if (rect[0] > rect[2]) {\n r[0] = rect[2];\n r[2] = rect[0];\n }\n if (rect[1] > rect[3]) {\n r[1] = rect[3];\n r[3] = rect[1];\n }\n return r;\n }\n\n // Returns a rectangle [x1, y1, x2, y2] corresponding to the\n // intersection of rect1 and rect2. If no intersection, returns 'null'\n // The rectangle coordinates of rect1, rect2 should be [x1, y1, x2, y2]\n static intersect(rect1, rect2) {\n const xLow = Math.max(\n Math.min(rect1[0], rect1[2]),\n Math.min(rect2[0], rect2[2])\n );\n const xHigh = Math.min(\n Math.max(rect1[0], rect1[2]),\n Math.max(rect2[0], rect2[2])\n );\n if (xLow > xHigh) {\n return null;\n }\n const yLow = Math.max(\n Math.min(rect1[1], rect1[3]),\n Math.min(rect2[1], rect2[3])\n );\n const yHigh = Math.min(\n Math.max(rect1[1], rect1[3]),\n Math.max(rect2[1], rect2[3])\n );\n if (yLow > yHigh) {\n return null;\n }\n\n return [xLow, yLow, xHigh, yHigh];\n }\n\n static pointBoundingBox(x, y, minMax) {\n minMax[0] = Math.min(minMax[0], x);\n minMax[1] = Math.min(minMax[1], y);\n minMax[2] = Math.max(minMax[2], x);\n minMax[3] = Math.max(minMax[3], y);\n }\n\n static rectBoundingBox(x0, y0, x1, y1, minMax) {\n minMax[0] = Math.min(minMax[0], x0, x1);\n minMax[1] = Math.min(minMax[1], y0, y1);\n minMax[2] = Math.max(minMax[2], x0, x1);\n minMax[3] = Math.max(minMax[3], y0, y1);\n }\n\n static #getExtremumOnCurve(x0, x1, x2, x3, y0, y1, y2, y3, t, minMax) {\n if (t <= 0 || t >= 1) {\n return;\n }\n const mt = 1 - t;\n const tt = t * t;\n const ttt = tt * t;\n const x = mt * (mt * (mt * x0 + 3 * t * x1) + 3 * tt * x2) + ttt * x3;\n const y = mt * (mt * (mt * y0 + 3 * t * y1) + 3 * tt * y2) + ttt * y3;\n minMax[0] = Math.min(minMax[0], x);\n minMax[1] = Math.min(minMax[1], y);\n minMax[2] = Math.max(minMax[2], x);\n minMax[3] = Math.max(minMax[3], y);\n }\n\n static #getExtremum(x0, x1, x2, x3, y0, y1, y2, y3, a, b, c, minMax) {\n if (Math.abs(a) < 1e-12) {\n if (Math.abs(b) >= 1e-12) {\n this.#getExtremumOnCurve(\n x0,\n x1,\n x2,\n x3,\n y0,\n y1,\n y2,\n y3,\n -c / b,\n minMax\n );\n }\n return;\n }\n\n const delta = b ** 2 - 4 * c * a;\n if (delta < 0) {\n return;\n }\n const sqrtDelta = Math.sqrt(delta);\n const a2 = 2 * a;\n this.#getExtremumOnCurve(\n x0,\n x1,\n x2,\n x3,\n y0,\n y1,\n y2,\n y3,\n (-b + sqrtDelta) / a2,\n minMax\n );\n this.#getExtremumOnCurve(\n x0,\n x1,\n x2,\n x3,\n y0,\n y1,\n y2,\n y3,\n (-b - sqrtDelta) / a2,\n minMax\n );\n }\n\n // From https://github.com/adobe-webplatform/Snap.svg/blob/b365287722a72526000ac4bfcf0ce4cac2faa015/src/path.js#L852\n static bezierBoundingBox(x0, y0, x1, y1, x2, y2, x3, y3, minMax) {\n minMax[0] = Math.min(minMax[0], x0, x3);\n minMax[1] = Math.min(minMax[1], y0, y3);\n minMax[2] = Math.max(minMax[2], x0, x3);\n minMax[3] = Math.max(minMax[3], y0, y3);\n\n this.#getExtremum(\n x0,\n x1,\n x2,\n x3,\n y0,\n y1,\n y2,\n y3,\n 3 * (-x0 + 3 * (x1 - x2) + x3),\n 6 * (x0 - 2 * x1 + x2),\n 3 * (x1 - x0),\n minMax\n );\n this.#getExtremum(\n x0,\n x1,\n x2,\n x3,\n y0,\n y1,\n y2,\n y3,\n 3 * (-y0 + 3 * (y1 - y2) + y3),\n 6 * (y0 - 2 * y1 + y2),\n 3 * (y1 - y0),\n minMax\n );\n }\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, keepEscapeSequence = false) {\n // See section 7.9.2.2 Text String Type.\n // The string can contain some language codes bracketed with 0x1b,\n // so we must remove them.\n if (str[0] >= \"\\xEF\") {\n let encoding;\n if (str[0] === \"\\xFE\" && str[1] === \"\\xFF\") {\n encoding = \"utf-16be\";\n if (str.length % 2 === 1) {\n str = str.slice(0, -1);\n }\n } else if (str[0] === \"\\xFF\" && str[1] === \"\\xFE\") {\n encoding = \"utf-16le\";\n if (str.length % 2 === 1) {\n str = str.slice(0, -1);\n }\n } else if (str[0] === \"\\xEF\" && str[1] === \"\\xBB\" && str[2] === \"\\xBF\") {\n encoding = \"utf-8\";\n }\n\n if (encoding) {\n try {\n const decoder = new TextDecoder(encoding, { fatal: true });\n const buffer = stringToBytes(str);\n const decoded = decoder.decode(buffer);\n if (keepEscapeSequence || !decoded.includes(\"\\x1b\")) {\n return decoded;\n }\n return decoded.replaceAll(/\\x1b[^\\x1b]*(?:\\x1b|$)/g, \"\");\n } catch (ex) {\n warn(`stringToPDFString: \"${ex}\".`);\n }\n }\n }\n // ISO Latin 1\n const strBuf = [];\n for (let i = 0, ii = str.length; i < ii; i++) {\n const charCode = str.charCodeAt(i);\n if (!keepEscapeSequence && charCode === 0x1b) {\n // eslint-disable-next-line no-empty\n while (++i < ii && str.charCodeAt(i) !== 0x1b) {}\n continue;\n }\n const code = PDFStringTranslateTable[charCode];\n strBuf.push(code ? String.fromCharCode(code) : str.charAt(i));\n }\n return strBuf.join(\"\");\n}\n\nfunction stringToUTF8String(str) {\n return decodeURIComponent(escape(str));\n}\n\nfunction utf8StringToString(str) {\n return unescape(encodeURIComponent(str));\n}\n\nfunction isArrayEqual(arr1, arr2) {\n if (arr1.length !== arr2.length) {\n return false;\n }\n for (let i = 0, ii = arr1.length; i < ii; i++) {\n if (arr1[i] !== arr2[i]) {\n return false;\n }\n }\n return true;\n}\n\nfunction getModificationDate(date = new Date()) {\n if (!(date instanceof Date)) {\n date = new Date(date);\n }\n const buffer = [\n date.getUTCFullYear().toString(),\n (date.getUTCMonth() + 1).toString().padStart(2, \"0\"),\n date.getUTCDate().toString().padStart(2, \"0\"),\n date.getUTCHours().toString().padStart(2, \"0\"),\n date.getUTCMinutes().toString().padStart(2, \"0\"),\n date.getUTCSeconds().toString().padStart(2, \"0\"),\n ];\n\n return buffer.join(\"\");\n}\n\nlet NormalizeRegex = null;\nlet NormalizationMap = null;\nfunction normalizeUnicode(str) {\n if (!NormalizeRegex) {\n // In order to generate the following regex:\n // - create a PDF containing all the chars in the range 0000-FFFF with\n // a NFKC which is different of the char.\n // - copy and paste all those chars and get the ones where NFKC is\n // required.\n // It appears that most the chars here contain some ligatures.\n NormalizeRegex =\n /([\\u00a0\\u00b5\\u037e\\u0eb3\\u2000-\\u200a\\u202f\\u2126\\ufb00-\\ufb04\\ufb06\\ufb20-\\ufb36\\ufb38-\\ufb3c\\ufb3e\\ufb40-\\ufb41\\ufb43-\\ufb44\\ufb46-\\ufba1\\ufba4-\\ufba9\\ufbae-\\ufbb1\\ufbd3-\\ufbdc\\ufbde-\\ufbe7\\ufbea-\\ufbf8\\ufbfc-\\ufbfd\\ufc00-\\ufc5d\\ufc64-\\ufcf1\\ufcf5-\\ufd3d\\ufd88\\ufdf4\\ufdfa-\\ufdfb\\ufe71\\ufe77\\ufe79\\ufe7b\\ufe7d]+)|(\\ufb05+)/gu;\n NormalizationMap = new Map([[\"ſt\", \"ſt\"]]);\n }\n return str.replaceAll(NormalizeRegex, (_, p1, p2) =>\n p1 ? p1.normalize(\"NFKC\") : NormalizationMap.get(p2)\n );\n}\n\nfunction getUuid() {\n if (\n (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) ||\n typeof crypto.randomUUID === \"function\"\n ) {\n return crypto.randomUUID();\n }\n const buf = new Uint8Array(32);\n crypto.getRandomValues(buf);\n return bytesToString(buf);\n}\n\nconst AnnotationPrefix = \"pdfjs_internal_id_\";\n\nfunction _isValidExplicitDest(validRef, validName, dest) {\n if (!Array.isArray(dest) || dest.length < 2) {\n return false;\n }\n const [page, zoom, ...args] = dest;\n if (!validRef(page) && !Number.isInteger(page)) {\n return false;\n }\n if (!validName(zoom)) {\n return false;\n }\n const argsLen = args.length;\n let allowNull = true;\n switch (zoom.name) {\n case \"XYZ\":\n if (argsLen < 2 || argsLen > 3) {\n return false;\n }\n break;\n case \"Fit\":\n case \"FitB\":\n return argsLen === 0;\n case \"FitH\":\n case \"FitBH\":\n case \"FitV\":\n case \"FitBV\":\n if (argsLen > 1) {\n return false;\n }\n break;\n case \"FitR\":\n if (argsLen !== 4) {\n return false;\n }\n allowNull = false;\n break;\n default:\n return false;\n }\n for (const arg of args) {\n if (typeof arg === \"number\" || (allowNull && arg === null)) {\n continue;\n }\n return false;\n }\n return true;\n}\n\n// TODO: Replace all occurrences of this function with `Math.clamp` once\n// https://github.com/tc39/proposal-math-clamp/ is generally available.\nfunction MathClamp(v, min, max) {\n return Math.min(Math.max(v, min), max);\n}\n\n// TODO: Remove this once `Uint8Array.prototype.toHex` is generally available.\nfunction toHexUtil(arr) {\n if (Uint8Array.prototype.toHex) {\n return arr.toHex();\n }\n return Array.from(arr, num => hexNumbers[num]).join(\"\");\n}\n\n// TODO: Remove this once `Uint8Array.prototype.toBase64` is generally\n// available.\nfunction toBase64Util(arr) {\n if (Uint8Array.prototype.toBase64) {\n return arr.toBase64();\n }\n return btoa(bytesToString(arr));\n}\n\n// TODO: Remove this once `Uint8Array.fromBase64` is generally available.\nfunction fromBase64Util(str) {\n if (Uint8Array.fromBase64) {\n return Uint8Array.fromBase64(str);\n }\n return stringToBytes(atob(str));\n}\n\n// TODO: Remove this once https://bugzilla.mozilla.org/show_bug.cgi?id=1928493\n// is fixed.\nif (\n (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"SKIP_BABEL\")) &&\n typeof Promise.try !== \"function\"\n) {\n Promise.try = function (fn, ...args) {\n return new Promise(resolve => {\n resolve(fn(...args));\n });\n };\n}\n\n// TODO: Remove this once the `javascript.options.experimental.math_sumprecise`\n// preference is removed from Firefox.\nif (typeof Math.sumPrecise !== \"function\") {\n // Note that this isn't a \"proper\" polyfill, but since we're only using it to\n // replace `Array.prototype.reduce()` invocations it should be fine.\n Math.sumPrecise = function (numbers) {\n return numbers.reduce((a, b) => a + b, 0);\n };\n}\n\nif (\n typeof PDFJSDev !== \"undefined\" &&\n !PDFJSDev.test(\"SKIP_BABEL\") &&\n typeof AbortSignal.any !== \"function\"\n) {\n AbortSignal.any = function (iterable) {\n const ac = new AbortController();\n const { signal } = ac;\n\n // Return immediately if any of the signals are already aborted.\n for (const s of iterable) {\n if (s.aborted) {\n ac.abort(s.reason);\n return signal;\n }\n }\n // Register \"abort\" listeners for all signals.\n for (const s of iterable) {\n s.addEventListener(\n \"abort\",\n () => {\n ac.abort(s.reason);\n },\n { signal } // Automatically remove the listener.\n );\n }\n\n return signal;\n };\n}\n\nexport {\n _isValidExplicitDest,\n AbortException,\n AnnotationActionEventType,\n AnnotationBorderStyleType,\n AnnotationEditorParamsType,\n AnnotationEditorPrefix,\n AnnotationEditorType,\n AnnotationFieldFlag,\n AnnotationFlag,\n AnnotationMode,\n AnnotationPrefix,\n AnnotationReplyType,\n AnnotationType,\n assert,\n BaseException,\n BASELINE_FACTOR,\n bytesToString,\n createValidAbsoluteUrl,\n DocumentActionEventType,\n DrawOPS,\n FeatureTest,\n FONT_IDENTITY_MATRIX,\n FormatError,\n fromBase64Util,\n getModificationDate,\n getUuid,\n getVerbosityLevel,\n hexNumbers,\n ImageKind,\n info,\n InvalidPDFException,\n isArrayEqual,\n isNodeJS,\n LINE_DESCENT_FACTOR,\n LINE_FACTOR,\n MathClamp,\n normalizeUnicode,\n objectSize,\n OPS,\n PageActionEventType,\n PasswordException,\n PasswordResponses,\n PermissionFlag,\n RenderingIntentFlag,\n ResponseException,\n setVerbosityLevel,\n shadow,\n string32,\n stringToBytes,\n stringToPDFString,\n stringToUTF8String,\n TextRenderingMode,\n toBase64Util,\n toHexUtil,\n UnknownErrorException,\n unreachable,\n updateUrlHash,\n utf8StringToString,\n Util,\n VerbosityLevel,\n warn,\n};\n","/* Copyright 2015 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n BaseException,\n FeatureTest,\n shadow,\n Util,\n warn,\n} from \"../shared/util.js\";\n\nconst SVG_NS = \"http://www.w3.org/2000/svg\";\n\nclass PixelsPerInch {\n static CSS = 96.0;\n\n static PDF = 72.0;\n\n static PDF_TO_CSS_UNITS = this.CSS / this.PDF;\n}\n\nasync function fetchData(url, type = \"text\") {\n if (\n (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) ||\n isValidFetchUrl(url, document.baseURI)\n ) {\n const response = await fetch(url);\n if (!response.ok) {\n throw new Error(response.statusText);\n }\n switch (type) {\n case \"arraybuffer\":\n return response.arrayBuffer();\n case \"blob\":\n return response.blob();\n case \"json\":\n return response.json();\n }\n return response.text();\n }\n\n // The Fetch API is not supported.\n return new Promise((resolve, reject) => {\n const request = new XMLHttpRequest();\n request.open(\"GET\", url, /* async = */ true);\n request.responseType = type;\n\n request.onreadystatechange = () => {\n if (request.readyState !== XMLHttpRequest.DONE) {\n return;\n }\n if (request.status === 200 || request.status === 0) {\n switch (type) {\n case \"arraybuffer\":\n case \"blob\":\n case \"json\":\n resolve(request.response);\n return;\n }\n resolve(request.responseText);\n return;\n }\n reject(new Error(request.statusText));\n };\n\n request.send(null);\n });\n}\n\n/**\n * @typedef {Object} PageViewportParameters\n * @property {Array<number>} viewBox - The xMin, yMin, xMax and\n * yMax coordinates.\n * @property {number} userUnit - The size of units.\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 userUnit,\n scale,\n rotation,\n offsetX = 0,\n offsetY = 0,\n dontFlip = false,\n }) {\n this.viewBox = viewBox;\n this.userUnit = userUnit;\n this.scale = scale;\n this.rotation = rotation;\n this.offsetX = offsetX;\n this.offsetY = offsetY;\n\n scale *= userUnit; // Take the userUnit into account.\n\n // creating transform to convert pdf coordinate system to the normal\n // canvas like coordinates taking in account scale and rotation\n const centerX = (viewBox[2] + viewBox[0]) / 2;\n const centerY = (viewBox[3] + viewBox[1]) / 2;\n let rotateA, rotateB, rotateC, rotateD;\n // Normalize the rotation, by clamping it to the [0, 360) range.\n rotation %= 360;\n if (rotation < 0) {\n rotation += 360;\n }\n switch (rotation) {\n case 180:\n rotateA = -1;\n rotateB = 0;\n rotateC = 0;\n rotateD = 1;\n break;\n case 90:\n rotateA = 0;\n rotateB = 1;\n rotateC = 1;\n rotateD = 0;\n break;\n case 270:\n rotateA = 0;\n rotateB = -1;\n rotateC = -1;\n rotateD = 0;\n break;\n case 0:\n rotateA = 1;\n rotateB = 0;\n rotateC = 0;\n rotateD = -1;\n break;\n default:\n throw new Error(\n \"PageViewport: Invalid rotation, must be a multiple of 90 degrees.\"\n );\n }\n\n if (dontFlip) {\n rotateC = -rotateC;\n rotateD = -rotateD;\n }\n\n let offsetCanvasX, offsetCanvasY;\n let width, height;\n if (rotateA === 0) {\n offsetCanvasX = Math.abs(centerY - viewBox[1]) * scale + offsetX;\n offsetCanvasY = Math.abs(centerX - viewBox[0]) * scale + offsetY;\n width = (viewBox[3] - viewBox[1]) * scale;\n height = (viewBox[2] - viewBox[0]) * scale;\n } else {\n offsetCanvasX = Math.abs(centerX - viewBox[0]) * scale + offsetX;\n offsetCanvasY = Math.abs(centerY - viewBox[1]) * scale + offsetY;\n width = (viewBox[2] - viewBox[0]) * scale;\n height = (viewBox[3] - viewBox[1]) * scale;\n }\n // creating transform for the following operations:\n // translate(-centerX, -centerY), rotate and flip vertically,\n // scale, and translate(offsetCanvasX, offsetCanvasY)\n this.transform = [\n rotateA * scale,\n rotateB * scale,\n rotateC * scale,\n rotateD * scale,\n offsetCanvasX - rotateA * scale * centerX - rotateC * scale * centerY,\n offsetCanvasY - rotateB * scale * centerX - rotateD * scale * centerY,\n ];\n\n this.width = width;\n this.height = height;\n }\n\n /**\n * The original, un-scaled, viewport dimensions.\n * @type {Object}\n */\n get rawDims() {\n const dims = this.viewBox;\n\n return shadow(this, \"rawDims\", {\n pageWidth: dims[2] - dims[0],\n pageHeight: dims[3] - dims[1],\n pageX: dims[0],\n pageY: dims[1],\n });\n }\n\n /**\n * Clones viewport, with optional additional properties.\n * @param {PageViewportCloneParameters} [params]\n * @returns {PageViewport} Cloned viewport.\n */\n clone({\n scale = this.scale,\n rotation = this.rotation,\n offsetX = this.offsetX,\n offsetY = this.offsetY,\n dontFlip = false,\n } = {}) {\n return new PageViewport({\n viewBox: this.viewBox.slice(),\n userUnit: this.userUnit,\n scale,\n rotation,\n offsetX,\n offsetY,\n dontFlip,\n });\n }\n\n /**\n * Converts PDF point to the viewport coordinates. For examples, useful for\n * converting PDF location into canvas pixel coordinates.\n * @param {number} x - The x-coordinate.\n * @param {number} y - The y-coordinate.\n * @returns {Array} Array containing `x`- and `y`-coordinates of the\n * point in the viewport coordinate space.\n * @see {@link convertToPdfPoint}\n * @see {@link convertToViewportRectangle}\n */\n convertToViewportPoint(x, y) {\n const p = [x, y];\n Util.applyTransform(p, this.transform);\n return p;\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 = [rect[0], rect[1]];\n Util.applyTransform(topLeft, this.transform);\n const bottomRight = [rect[2], rect[3]];\n Util.applyTransform(bottomRight, this.transform);\n return [topLeft[0], topLeft[1], bottomRight[0], bottomRight[1]];\n }\n\n /**\n * Converts viewport coordinates to the PDF location. For examples, useful\n * for converting canvas pixel location into PDF one.\n * @param {number} x - The x-coordinate.\n * @param {number} y - The y-coordinate.\n * @returns {Array} Array containing `x`- and `y`-coordinates of the\n * point in the PDF coordinate space.\n * @see {@link convertToViewportPoint}\n */\n convertToPdfPoint(x, y) {\n const p = [x, y];\n Util.applyInverseTransform(p, this.transform);\n return p;\n }\n}\n\nclass RenderingCancelledException extends BaseException {\n constructor(msg, extraDelay = 0) {\n super(msg, \"RenderingCancelledException\");\n this.extraDelay = extraDelay;\n }\n}\n\nfunction isDataScheme(url) {\n const ii = url.length;\n let i = 0;\n while (i < ii && url[i].trim() === \"\") {\n i++;\n }\n return url.substring(i, i + 5).toLowerCase() === \"data:\";\n}\n\nfunction isPdfFile(filename) {\n return typeof filename === \"string\" && /\\.pdf$/i.test(filename);\n}\n\n/**\n * Gets the filename from a given URL.\n * @param {string} url\n * @returns {string}\n */\nfunction getFilenameFromUrl(url) {\n [url] = url.split(/[#?]/, 1);\n return url.substring(url.lastIndexOf(\"/\") + 1);\n}\n\n/**\n * Returns the filename or guessed filename from the url (see issue 3455).\n * @param {string} url - The original PDF location.\n * @param {string} defaultFilename - The value returned if the filename is\n * unknown, or the protocol is unsupported.\n * @returns {string} Guessed PDF filename.\n */\nfunction getPdfFilenameFromUrl(url, defaultFilename = \"document.pdf\") {\n if (typeof url !== \"string\") {\n return defaultFilename;\n }\n if (isDataScheme(url)) {\n warn('getPdfFilenameFromUrl: ignore \"data:\"-URL for performance reasons.');\n return defaultFilename;\n }\n\n const getURL = urlString => {\n try {\n return new URL(urlString);\n } catch {\n try {\n return new URL(decodeURIComponent(urlString));\n } catch {\n try {\n // Attempt to parse the URL using the document's base URI.\n return new URL(urlString, \"https://foo.bar\");\n } catch {\n try {\n return new URL(decodeURIComponent(urlString), \"https://foo.bar\");\n } catch {\n return null;\n }\n }\n }\n }\n };\n\n const newURL = getURL(url);\n if (!newURL) {\n // If the URL is invalid, return the default filename.\n return defaultFilename;\n }\n\n const decode = name => {\n try {\n let decoded = decodeURIComponent(name);\n if (decoded.includes(\"/\")) {\n decoded = decoded.split(\"/\").at(-1);\n if (decoded.test(/^\\.pdf$/i)) {\n return decoded;\n }\n return name;\n }\n return decoded;\n } catch {\n return name;\n }\n };\n\n const pdfRegex = /\\.pdf$/i;\n const filename = newURL.pathname.split(\"/\").at(-1);\n if (pdfRegex.test(filename)) {\n return decode(filename);\n }\n\n if (newURL.searchParams.size > 0) {\n const values = Array.from(newURL.searchParams.values()).reverse();\n for (const value of values) {\n if (pdfRegex.test(value)) {\n // If any of the search parameters ends with \".pdf\", return it.\n return decode(value);\n }\n }\n const keys = Array.from(newURL.searchParams.keys()).reverse();\n for (const key of keys) {\n if (pdfRegex.test(key)) {\n // If any of the search parameter keys ends with \".pdf\", return it.\n return decode(key);\n }\n }\n }\n\n if (newURL.hash) {\n const reFilename = /[^/?#=]+\\.pdf\\b(?!.*\\.pdf\\b)/i;\n const hashFilename = reFilename.exec(newURL.hash);\n if (hashFilename) {\n return decode(hashFilename[0]);\n }\n }\n\n return defaultFilename;\n}\n\nclass StatTimer {\n started = Object.create(null);\n\n times = [];\n\n time(name) {\n if (name in this.started) {\n warn(`Timer is already running for ${name}`);\n }\n this.started[name] = Date.now();\n }\n\n timeEnd(name) {\n if (!(name in this.started)) {\n warn(`Timer has not been started for ${name}`);\n }\n this.times.push({\n name,\n start: this.started[name],\n end: Date.now(),\n });\n // Remove timer from started so it can be called again.\n delete this.started[name];\n }\n\n toString() {\n // Find the longest name for padding purposes.\n const outBuf = [];\n let longest = 0;\n for (const { name } of this.times) {\n longest = Math.max(name.length, longest);\n }\n for (const { name, start, end } of this.times) {\n outBuf.push(`${name.padEnd(longest)} ${end - start}ms\\n`);\n }\n return outBuf.join(\"\");\n }\n}\n\nfunction isValidFetchUrl(url, baseUrl) {\n if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) {\n throw new Error(\"Not implemented: isValidFetchUrl\");\n }\n const res = baseUrl ? URL.parse(url, baseUrl) : URL.parse(url);\n // The Fetch API only supports the http/https protocols, and not file/ftp.\n return res?.protocol === \"http:\" || res?.protocol === \"https:\";\n}\n\n/**\n * Event handler to suppress context menu.\n */\nfunction noContextMenu(e) {\n e.preventDefault();\n}\n\nfunction stopEvent(e) {\n e.preventDefault();\n e.stopPropagation();\n}\n\n// Deprecated API function -- display regardless of the `verbosity` setting.\nfunction deprecated(details) {\n // eslint-disable-next-line no-console\n console.log(\"Deprecated API usage: \" + details);\n}\n\nclass PDFDateString {\n static #regex;\n\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 instanceof Date) {\n return input;\n }\n if (!input || typeof input !== \"string\") {\n return null;\n }\n\n // Lazily initialize the regular expression.\n this.#regex ||= new RegExp(\n \"^D:\" + // Prefix (required)\n \"(\\\\d{4})\" + // Year (required)\n \"(\\\\d{2})?\" + // Month (optional)\n \"(\\\\d{2})?\" + // Day (optional)\n \"(\\\\d{2})?\" + // Hour (optional)\n \"(\\\\d{2})?\" + // Minute (optional)\n \"(\\\\d{2})?\" + // Second (optional)\n \"([Z|+|-])?\" + // Universal time relation (optional)\n \"(\\\\d{2})?\" + // Offset hour (optional)\n \"'?\" + // Splitting apostrophe (optional)\n \"(\\\\d{2})?\" + // Offset minute (optional)\n \"'?\" // Trailing apostrophe (optional)\n );\n\n // Optional fields that don't satisfy the requirements from the regular\n // expression (such as incorrect digit counts or numbers that are out of\n // range) will fall back the defaults from the specification.\n const matches = this.#regex.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 userUnit: 1,\n scale,\n rotation,\n });\n}\n\nfunction getRGB(color) {\n if (color.startsWith(\"#\")) {\n const colorRGB = parseInt(color.slice(1), 16);\n return [\n (colorRGB & 0xff0000) >> 16,\n (colorRGB & 0x00ff00) >> 8,\n colorRGB & 0x0000ff,\n ];\n }\n\n if (color.startsWith(\"rgb(\")) {\n // getComputedStyle(...).color returns a `rgb(R, G, B)` color.\n return color\n .slice(/* \"rgb(\".length */ 4, -1) // Strip out \"rgb(\" and \")\".\n .split(\",\")\n .map(x => parseInt(x));\n }\n\n if (color.startsWith(\"rgba(\")) {\n return color\n .slice(/* \"rgba(\".length */ 5, -1) // Strip out \"rgba(\" and \")\".\n .split(\",\")\n .map(x => parseInt(x))\n .slice(0, 3);\n }\n\n warn(`Not a valid color format: \"${color}\"`);\n return [0, 0, 0];\n}\n\nfunction getColorValues(colors) {\n const span = document.createElement(\"span\");\n span.style.visibility = \"hidden\";\n // NOTE: The following does *not* affect `forced-colors: active` mode.\n span.style.colorScheme = \"only light\";\n document.body.append(span);\n for (const name of colors.keys()) {\n span.style.color = name;\n const computedColor = window.getComputedStyle(span).color;\n colors.set(name, getRGB(computedColor));\n }\n span.remove();\n}\n\nfunction getCurrentTransform(ctx) {\n const { a, b, c, d, e, f } = ctx.getTransform();\n return [a, b, c, d, e, f];\n}\n\nfunction getCurrentTransformInverse(ctx) {\n const { a, b, c, d, e, f } = ctx.getTransform().invertSelf();\n return [a, b, c, d, e, f];\n}\n\n/**\n * @param {HTMLDivElement} div\n * @param {PageViewport} viewport\n * @param {boolean} mustFlip\n * @param {boolean} mustRotate\n */\nfunction setLayerDimensions(\n div,\n viewport,\n mustFlip = false,\n mustRotate = true\n) {\n if (viewport instanceof PageViewport) {\n const { pageWidth, pageHeight } = viewport.rawDims;\n const { style } = div;\n const useRound = FeatureTest.isCSSRoundSupported;\n\n const w = `var(--total-scale-factor) * ${pageWidth}px`,\n h = `var(--total-scale-factor) * ${pageHeight}px`;\n const widthStr = useRound\n ? `round(down, ${w}, var(--scale-round-x))`\n : `calc(${w})`,\n heightStr = useRound\n ? `round(down, ${h}, var(--scale-round-y))`\n : `calc(${h})`;\n\n if (!mustFlip || viewport.rotation % 180 === 0) {\n style.width = widthStr;\n style.height = heightStr;\n } else {\n style.width = heightStr;\n style.height = widthStr;\n }\n }\n\n if (mustRotate) {\n div.setAttribute(\"data-main-rotation\", viewport.rotation);\n }\n}\n\n/**\n * Scale factors for the canvas, necessary with HiDPI displays.\n */\nclass OutputScale {\n constructor() {\n const { pixelRatio } = OutputScale;\n\n /**\n * @type {number} Horizontal scale.\n */\n this.sx = pixelRatio;\n\n /**\n * @type {number} Vertical scale.\n */\n this.sy = pixelRatio;\n }\n\n /**\n * @type {boolean} Returns `true` when scaling is required, `false` otherwise.\n */\n get scaled() {\n return this.sx !== 1 || this.sy !== 1;\n }\n\n /**\n * @type {boolean} Returns `true` when scaling is symmetric,\n * `false` otherwise.\n */\n get symmetric() {\n return this.sx === this.sy;\n }\n\n /**\n * @returns {boolean} Returns `true` if scaling was limited,\n * `false` otherwise.\n */\n limitCanvas(width, height, maxPixels, maxDim, capAreaFactor = -1) {\n let maxAreaScale = Infinity,\n maxWidthScale = Infinity,\n maxHeightScale = Infinity;\n\n maxPixels = OutputScale.capPixels(maxPixels, capAreaFactor);\n if (maxPixels > 0) {\n maxAreaScale = Math.sqrt(maxPixels / (width * height));\n }\n if (maxDim !== -1) {\n maxWidthScale = maxDim / width;\n maxHeightScale = maxDim / height;\n }\n const maxScale = Math.min(maxAreaScale, maxWidthScale, maxHeightScale);\n\n if (this.sx > maxScale || this.sy > maxScale) {\n this.sx = maxScale;\n this.sy = maxScale;\n return true;\n }\n return false;\n }\n\n static get pixelRatio() {\n return globalThis.devicePixelRatio || 1;\n }\n\n static capPixels(maxPixels, capAreaFactor) {\n if (capAreaFactor >= 0) {\n const winPixels = Math.ceil(\n (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"TESTING\")\n ? window.innerWidth * window.innerHeight\n : window.screen.availWidth * window.screen.availHeight) *\n this.pixelRatio ** 2 *\n (1 + capAreaFactor / 100)\n );\n return maxPixels > 0 ? Math.min(maxPixels, winPixels) : winPixels;\n }\n return maxPixels;\n }\n}\n\n// See https://developer.mozilla.org/en-US/docs/Web/Media/Formats/Image_types\n// to know which types are supported by the browser.\nconst SupportedImageMimeTypes = [\n \"image/apng\",\n \"image/avif\",\n \"image/bmp\",\n \"image/gif\",\n \"image/jpeg\",\n \"image/png\",\n \"image/svg+xml\",\n \"image/webp\",\n \"image/x-icon\",\n];\n\nexport {\n deprecated,\n fetchData,\n getColorValues,\n getCurrentTransform,\n getCurrentTransformInverse,\n getFilenameFromUrl,\n getPdfFilenameFromUrl,\n getRGB,\n getXfaPageViewport,\n isDataScheme,\n isPdfFile,\n isValidFetchUrl,\n noContextMenu,\n OutputScale,\n PageViewport,\n PDFDateString,\n PixelsPerInch,\n RenderingCancelledException,\n setLayerDimensions,\n StatTimer,\n stopEvent,\n SupportedImageMimeTypes,\n SVG_NS,\n};\n","/* Copyright 2023 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { noContextMenu, stopEvent } from \"../display_utils.js\";\n\nclass EditorToolbar {\n #toolbar = null;\n\n #colorPicker = null;\n\n #editor;\n\n #buttons = null;\n\n #altText = null;\n\n #comment = null;\n\n #signatureDescriptionButton = null;\n\n static #l10nRemove = null;\n\n constructor(editor) {\n this.#editor = editor;\n\n EditorToolbar.#l10nRemove ||= Object.freeze({\n freetext: \"pdfjs-editor-remove-freetext-button\",\n highlight: \"pdfjs-editor-remove-highlight-button\",\n ink: \"pdfjs-editor-remove-ink-button\",\n stamp: \"pdfjs-editor-remove-stamp-button\",\n signature: \"pdfjs-editor-remove-signature-button\",\n });\n }\n\n render() {\n const editToolbar = (this.#toolbar = document.createElement(\"div\"));\n editToolbar.classList.add(\"editToolbar\", \"hidden\");\n editToolbar.setAttribute(\"role\", \"toolbar\");\n\n const signal = this.#editor._uiManager._signal;\n if (signal instanceof AbortSignal && !signal.aborted) {\n editToolbar.addEventListener(\"contextmenu\", noContextMenu, { signal });\n editToolbar.addEventListener(\"pointerdown\", EditorToolbar.#pointerDown, {\n signal,\n });\n }\n\n const buttons = (this.#buttons = document.createElement(\"div\"));\n buttons.className = \"buttons\";\n editToolbar.append(buttons);\n\n const position = this.#editor.toolbarPosition;\n if (position) {\n const { style } = editToolbar;\n const x =\n this.#editor._uiManager.direction === \"ltr\"\n ? 1 - position[0]\n : position[0];\n style.insetInlineEnd = `${100 * x}%`;\n style.top = `calc(${\n 100 * position[1]\n }% + var(--editor-toolbar-vert-offset))`;\n }\n\n return editToolbar;\n }\n\n get div() {\n return this.#toolbar;\n }\n\n static #pointerDown(e) {\n e.stopPropagation();\n }\n\n #focusIn(e) {\n this.#editor._focusEventsAllowed = false;\n stopEvent(e);\n }\n\n #focusOut(e) {\n this.#editor._focusEventsAllowed = true;\n stopEvent(e);\n }\n\n #addListenersToElement(element) {\n // If we're clicking on a button with the keyboard or with\n // the mouse, we don't want to trigger any focus events on\n // the editor.\n const signal = this.#editor._uiManager._signal;\n if (!(signal instanceof AbortSignal) || signal.aborted) {\n return false;\n }\n element.addEventListener(\"focusin\", this.#focusIn.bind(this), {\n capture: true,\n signal,\n });\n element.addEventListener(\"focusout\", this.#focusOut.bind(this), {\n capture: true,\n signal,\n });\n element.addEventListener(\"contextmenu\", noContextMenu, { signal });\n return true;\n }\n\n hide() {\n this.#toolbar.classList.add(\"hidden\");\n this.#colorPicker?.hideDropdown();\n }\n\n show() {\n this.#toolbar.classList.remove(\"hidden\");\n this.#altText?.shown();\n this.#comment?.shown();\n }\n\n addDeleteButton() {\n const { editorType, _uiManager } = this.#editor;\n\n const button = document.createElement(\"button\");\n button.classList.add(\"basic\", \"deleteButton\");\n button.tabIndex = 0;\n button.setAttribute(\"data-l10n-id\", EditorToolbar.#l10nRemove[editorType]);\n if (this.#addListenersToElement(button)) {\n button.addEventListener(\n \"click\",\n e => {\n _uiManager.delete();\n },\n { signal: _uiManager._signal }\n );\n }\n this.#buttons.append(button);\n }\n\n get #divider() {\n const divider = document.createElement(\"div\");\n divider.className = \"divider\";\n return divider;\n }\n\n async addAltText(altText) {\n const button = await altText.render();\n this.#addListenersToElement(button);\n this.#buttons.append(button, this.#divider);\n this.#altText = altText;\n }\n\n addComment(comment) {\n if (this.#comment) {\n return;\n }\n const button = comment.render();\n if (!button) {\n return;\n }\n this.#addListenersToElement(button);\n this.#buttons.append(button, this.#divider);\n this.#comment = comment;\n comment.toolbar = this;\n }\n\n addColorPicker(colorPicker) {\n if (this.#colorPicker) {\n return;\n }\n this.#colorPicker = colorPicker;\n const button = colorPicker.renderButton();\n this.#addListenersToElement(button);\n this.#buttons.append(button, this.#divider);\n }\n\n async addEditSignatureButton(signatureManager) {\n const button = (this.#signatureDescriptionButton =\n await signatureManager.renderEditButton(this.#editor));\n this.#addListenersToElement(button);\n this.#buttons.append(button, this.#divider);\n }\n\n async addButton(name, tool) {\n switch (name) {\n case \"colorPicker\":\n this.addColorPicker(tool);\n break;\n case \"altText\":\n await this.addAltText(tool);\n break;\n case \"editSignature\":\n await this.addEditSignatureButton(tool);\n break;\n case \"delete\":\n this.addDeleteButton();\n break;\n case \"comment\":\n this.addComment(tool);\n break;\n }\n }\n\n updateEditSignatureButton(description) {\n if (this.#signatureDescriptionButton) {\n this.#signatureDescriptionButton.title = description;\n }\n }\n\n remove() {\n this.#toolbar.remove();\n this.#colorPicker?.destroy();\n this.#colorPicker = null;\n }\n}\n\nclass FloatingToolbar {\n #buttons = null;\n\n #toolbar = null;\n\n #uiManager;\n\n constructor(uiManager) {\n this.#uiManager = uiManager;\n }\n\n #render() {\n const editToolbar = (this.#toolbar = document.createElement(\"div\"));\n editToolbar.className = \"editToolbar\";\n editToolbar.setAttribute(\"role\", \"toolbar\");\n\n const signal = this.#uiManager._signal;\n if (signal instanceof AbortSignal && !signal.aborted) {\n editToolbar.addEventListener(\"contextmenu\", noContextMenu, {\n signal,\n });\n }\n\n const buttons = (this.#buttons = document.createElement(\"div\"));\n buttons.className = \"buttons\";\n editToolbar.append(buttons);\n\n if (this.#uiManager.hasCommentManager()) {\n this.#makeButton(\n \"commentButton\",\n `pdfjs-comment-floating-button`,\n \"pdfjs-comment-floating-button-label\",\n () => {\n this.#uiManager.commentSelection(\"floating_button\");\n }\n );\n }\n\n this.#makeButton(\n \"highlightButton\",\n `pdfjs-highlight-floating-button1`,\n \"pdfjs-highlight-floating-button-label\",\n () => {\n this.#uiManager.highlightSelection(\"floating_button\");\n }\n );\n\n return editToolbar;\n }\n\n #getLastPoint(boxes, isLTR) {\n let lastY = 0;\n let lastX = 0;\n for (const box of boxes) {\n const y = box.y + box.height;\n if (y < lastY) {\n continue;\n }\n const x = box.x + (isLTR ? box.width : 0);\n if (y > lastY) {\n lastX = x;\n lastY = y;\n continue;\n }\n if (isLTR) {\n if (x > lastX) {\n lastX = x;\n }\n } else if (x < lastX) {\n lastX = x;\n }\n }\n return [isLTR ? 1 - lastX : lastX, lastY];\n }\n\n show(parent, boxes, isLTR) {\n const [x, y] = this.#getLastPoint(boxes, isLTR);\n const { style } = (this.#toolbar ||= this.#render());\n parent.append(this.#toolbar);\n style.insetInlineEnd = `${100 * x}%`;\n style.top = `calc(${100 * y}% + var(--editor-toolbar-vert-offset))`;\n }\n\n hide() {\n this.#toolbar.remove();\n }\n\n #makeButton(buttonClass, l10nId, labelL10nId, clickHandler) {\n const button = document.createElement(\"button\");\n button.classList.add(\"basic\", buttonClass);\n button.tabIndex = 0;\n button.setAttribute(\"data-l10n-id\", l10nId);\n const span = document.createElement(\"span\");\n button.append(span);\n span.className = \"visuallyHidden\";\n span.setAttribute(\"data-l10n-id\", labelL10nId);\n const signal = this.#uiManager._signal;\n if (signal instanceof AbortSignal && !signal.aborted) {\n button.addEventListener(\"contextmenu\", noContextMenu, { signal });\n button.addEventListener(\"click\", clickHandler, { signal });\n }\n this.#buttons.append(button);\n }\n}\n\nexport { EditorToolbar, FloatingToolbar };\n","/* Copyright 2022 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/** @typedef {import(\"./editor.js\").AnnotationEditor} AnnotationEditor */\n// eslint-disable-next-line max-len\n/** @typedef {import(\"./annotation_editor_layer.js\").AnnotationEditorLayer} AnnotationEditorLayer */\n\nimport {\n AnnotationEditorParamsType,\n AnnotationEditorPrefix,\n AnnotationEditorType,\n FeatureTest,\n getUuid,\n shadow,\n Util,\n warn,\n} from \"../../shared/util.js\";\nimport {\n fetchData,\n getColorValues,\n getRGB,\n PixelsPerInch,\n stopEvent,\n} from \"../display_utils.js\";\nimport { FloatingToolbar } from \"./toolbar.js\";\n\nfunction bindEvents(obj, element, names) {\n for (const name of names) {\n element.addEventListener(name, obj[name].bind(obj));\n }\n}\n\n/**\n * Class to create some unique ids for the different editors.\n */\nclass IdManager {\n #id = 0;\n\n constructor() {\n if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"TESTING\")) {\n Object.defineProperty(this, \"reset\", {\n value: () => (this.#id = 0),\n });\n }\n }\n\n /**\n * Get a unique id.\n * @returns {string}\n */\n get id() {\n return `${AnnotationEditorPrefix}${this.#id++}`;\n }\n}\n\n/**\n * Class to manage the images used by the editors.\n * The main idea is to try to minimize the memory used by the images.\n * The images are cached and reused when possible\n * We use a refCounter to know when an image is not used anymore but we need to\n * be able to restore an image after a remove+undo, so we keep a file reference\n * or an url one.\n */\nclass ImageManager {\n #baseId = getUuid();\n\n #id = 0;\n\n #cache = null;\n\n static get _isSVGFittingCanvas() {\n // By default, Firefox doesn't rescale without preserving the aspect ratio\n // when drawing an SVG image on a canvas, see https://bugzilla.mozilla.org/1547776.\n // The \"workaround\" is to append \"svgView(preserveAspectRatio(none))\" to the\n // url, but according to comment #15, it seems that it leads to unexpected\n // behavior in Safari.\n const svg = `data:image/svg+xml;charset=UTF-8,<svg viewBox=\"0 0 1 1\" width=\"1\" height=\"1\" xmlns=\"http://www.w3.org/2000/svg\"><rect width=\"1\" height=\"1\" style=\"fill:red;\"/></svg>`;\n const canvas = new OffscreenCanvas(1, 3);\n const ctx = canvas.getContext(\"2d\", { willReadFrequently: true });\n const image = new Image();\n image.src = svg;\n const promise = image.decode().then(() => {\n ctx.drawImage(image, 0, 0, 1, 1, 0, 0, 1, 3);\n return new Uint32Array(ctx.getImageData(0, 0, 1, 1).data.buffer)[0] === 0;\n });\n\n return shadow(this, \"_isSVGFittingCanvas\", promise);\n }\n\n async #get(key, rawData) {\n this.#cache ||= new Map();\n let data = this.#cache.get(key);\n if (data === null) {\n // We already tried to load the image but it failed.\n return null;\n }\n if (data?.bitmap) {\n data.refCounter += 1;\n return data;\n }\n try {\n data ||= {\n bitmap: null,\n id: `image_${this.#baseId}_${this.#id++}`,\n refCounter: 0,\n isSvg: false,\n };\n let image;\n if (typeof rawData === \"string\") {\n data.url = rawData;\n image = await fetchData(rawData, \"blob\");\n } else if (rawData instanceof File) {\n image = data.file = rawData;\n } else if (rawData instanceof Blob) {\n image = rawData;\n }\n\n if (image.type === \"image/svg+xml\") {\n // Unfortunately, createImageBitmap doesn't work with SVG images.\n // (see https://bugzilla.mozilla.org/1841972).\n const mustRemoveAspectRatioPromise = ImageManager._isSVGFittingCanvas;\n const fileReader = new FileReader();\n const imageElement = new Image();\n const imagePromise = new Promise((resolve, reject) => {\n imageElement.onload = () => {\n data.bitmap = imageElement;\n data.isSvg = true;\n resolve();\n };\n fileReader.onload = async () => {\n const url = (data.svgUrl = fileReader.result);\n // We need to set the preserveAspectRatio to none in order to let\n // the image fits the canvas when resizing.\n imageElement.src = (await mustRemoveAspectRatioPromise)\n ? `${url}#svgView(preserveAspectRatio(none))`\n : url;\n };\n imageElement.onerror = fileReader.onerror = reject;\n });\n fileReader.readAsDataURL(image);\n await imagePromise;\n } else {\n data.bitmap = await createImageBitmap(image);\n }\n data.refCounter = 1;\n } catch (e) {\n warn(e);\n data = null;\n }\n this.#cache.set(key, data);\n if (data) {\n this.#cache.set(data.id, data);\n }\n return data;\n }\n\n async getFromFile(file) {\n const { lastModified, name, size, type } = file;\n return this.#get(`${lastModified}_${name}_${size}_${type}`, file);\n }\n\n async getFromUrl(url) {\n return this.#get(url, url);\n }\n\n async getFromBlob(id, blobPromise) {\n const blob = await blobPromise;\n return this.#get(id, blob);\n }\n\n async getFromId(id) {\n this.#cache ||= new Map();\n const data = this.#cache.get(id);\n if (!data) {\n return null;\n }\n if (data.bitmap) {\n data.refCounter += 1;\n return data;\n }\n\n if (data.file) {\n return this.getFromFile(data.file);\n }\n if (data.blobPromise) {\n const { blobPromise } = data;\n delete data.blobPromise;\n return this.getFromBlob(data.id, blobPromise);\n }\n return this.getFromUrl(data.url);\n }\n\n getFromCanvas(id, canvas) {\n this.#cache ||= new Map();\n let data = this.#cache.get(id);\n if (data?.bitmap) {\n data.refCounter += 1;\n return data;\n }\n const offscreen = new OffscreenCanvas(canvas.width, canvas.height);\n const ctx = offscreen.getContext(\"2d\");\n ctx.drawImage(canvas, 0, 0);\n data = {\n bitmap: offscreen.transferToImageBitmap(),\n id: `image_${this.#baseId}_${this.#id++}`,\n refCounter: 1,\n isSvg: false,\n };\n this.#cache.set(id, data);\n this.#cache.set(data.id, data);\n return data;\n }\n\n getSvgUrl(id) {\n const data = this.#cache.get(id);\n if (!data?.isSvg) {\n return null;\n }\n return data.svgUrl;\n }\n\n deleteId(id) {\n this.#cache ||= new Map();\n const data = this.#cache.get(id);\n if (!data) {\n return;\n }\n data.refCounter -= 1;\n if (data.refCounter !== 0) {\n return;\n }\n const { bitmap } = data;\n if (!data.url && !data.file) {\n // The image has no way to be restored (ctrl+z) so we must fix that.\n const canvas = new OffscreenCanvas(bitmap.width, bitmap.height);\n const ctx = canvas.getContext(\"bitmaprenderer\");\n ctx.transferFromImageBitmap(bitmap);\n data.blobPromise = canvas.convertToBlob();\n }\n\n bitmap.close?.();\n data.bitmap = null;\n }\n\n // We can use the id only if it belongs this manager.\n // We must take care of having the right manager because we can copy/paste\n // some images from other documents, hence it'd be a pity to use an id from an\n // other manager.\n isValidId(id) {\n return id.startsWith(`image_${this.#baseId}_`);\n }\n}\n\n/**\n * Class to handle undo/redo.\n * Commands are just saved in a buffer.\n * If we hit some memory issues we could likely use a circular buffer.\n * It has to be used as a singleton.\n */\nclass CommandManager {\n #commands = [];\n\n #locked = false;\n\n #maxSize;\n\n #position = -1;\n\n constructor(maxSize = 128) {\n this.#maxSize = maxSize;\n }\n\n /**\n * @typedef {Object} addOptions\n * @property {function} cmd\n * @property {function} undo\n * @property {function} [post]\n * @property {boolean} mustExec\n * @property {number} type\n * @property {boolean} overwriteIfSameType\n * @property {boolean} keepUndo\n */\n\n /**\n * Add a new couple of commands to be used in case of redo/undo.\n * @param {addOptions} options\n */\n add({\n cmd,\n undo,\n post,\n mustExec,\n type = NaN,\n overwriteIfSameType = false,\n keepUndo = false,\n }) {\n if (mustExec) {\n cmd();\n }\n\n if (this.#locked) {\n return;\n }\n\n const save = { cmd, undo, post, type };\n if (this.#position === -1) {\n if (this.#commands.length > 0) {\n // All the commands have been undone and then a new one is added\n // hence we clear the queue.\n this.#commands.length = 0;\n }\n this.#position = 0;\n this.#commands.push(save);\n return;\n }\n\n if (overwriteIfSameType && this.#commands[this.#position].type === type) {\n // For example when we change a color we don't want to\n // be able to undo all the steps, hence we only want to\n // keep the last undoable action in this sequence of actions.\n if (keepUndo) {\n save.undo = this.#commands[this.#position].undo;\n }\n this.#commands[this.#position] = save;\n return;\n }\n\n const next = this.#position + 1;\n if (next === this.#maxSize) {\n this.#commands.splice(0, 1);\n } else {\n this.#position = next;\n if (next < this.#commands.length) {\n this.#commands.splice(next);\n }\n }\n\n this.#commands.push(save);\n }\n\n /**\n * Undo the last command.\n */\n undo() {\n if (this.#position === -1) {\n // Nothing to undo.\n return;\n }\n\n // Avoid to insert something during the undo execution.\n this.#locked = true;\n const { undo, post } = this.#commands[this.#position];\n undo();\n post?.();\n this.#locked = false;\n\n this.#position -= 1;\n }\n\n /**\n * Redo the last command.\n */\n redo() {\n if (this.#position < this.#commands.length - 1) {\n this.#position += 1;\n\n // Avoid to insert something during the redo execution.\n this.#locked = true;\n const { cmd, post } = this.#commands[this.#position];\n cmd();\n post?.();\n this.#locked = false;\n }\n }\n\n /**\n * Check if there is something to undo.\n * @returns {boolean}\n */\n hasSomethingToUndo() {\n return this.#position !== -1;\n }\n\n /**\n * Check if there is something to redo.\n * @returns {boolean}\n */\n hasSomethingToRedo() {\n return this.#position < this.#commands.length - 1;\n }\n\n cleanType(type) {\n if (this.#position === -1) {\n return;\n }\n for (let i = this.#position; i >= 0; i--) {\n if (this.#commands[i].type !== type) {\n this.#commands.splice(i + 1, this.#position - i);\n this.#position = i;\n return;\n }\n }\n this.#commands.length = 0;\n this.#position = -1;\n }\n\n destroy() {\n this.#commands = null;\n }\n}\n\n/**\n * Class to handle the different keyboards shortcuts we can have on mac or\n * non-mac OSes.\n */\nclass KeyboardManager {\n /**\n * Create a new keyboard manager class.\n * @param {Array<Array>} callbacks - an array containing an array of shortcuts\n * and a callback to call.\n * A shortcut is a string like `ctrl+c` or `mac+ctrl+c` for mac OS.\n */\n constructor(callbacks) {\n this.buffer = [];\n this.callbacks = new Map();\n this.allKeys = new Set();\n\n const { isMac } = FeatureTest.platform;\n for (const [keys, callback, options = {}] of callbacks) {\n for (const key of keys) {\n const isMacKey = key.startsWith(\"mac+\");\n if (isMac && isMacKey) {\n this.callbacks.set(key.slice(4), { callback, options });\n this.allKeys.add(key.split(\"+\").at(-1));\n } else if (!isMac && !isMacKey) {\n this.callbacks.set(key, { callback, options });\n this.allKeys.add(key.split(\"+\").at(-1));\n }\n }\n }\n }\n\n /**\n * Serialize an event into a string in order to match a\n * potential key for a callback.\n * @param {KeyboardEvent} event\n * @returns {string}\n */\n #serialize(event) {\n if (event.altKey) {\n this.buffer.push(\"alt\");\n }\n if (event.ctrlKey) {\n this.buffer.push(\"ctrl\");\n }\n if (event.metaKey) {\n this.buffer.push(\"meta\");\n }\n if (event.shiftKey) {\n this.buffer.push(\"shift\");\n }\n this.buffer.push(event.key);\n const str = this.buffer.join(\"+\");\n this.buffer.length = 0;\n\n return str;\n }\n\n /**\n * Execute a callback, if any, for a given keyboard event.\n * The self is used as `this` in the callback.\n * @param {Object} self\n * @param {KeyboardEvent} event\n * @returns\n */\n exec(self, event) {\n if (!this.allKeys.has(event.key)) {\n return;\n }\n const info = this.callbacks.get(this.#serialize(event));\n if (!info) {\n return;\n }\n const {\n callback,\n options: { bubbles = false, args = [], checker = null },\n } = info;\n\n if (checker && !checker(self, event)) {\n return;\n }\n callback.bind(self, ...args, event)();\n\n // For example, ctrl+s in a FreeText must be handled by the viewer, hence\n // the event must bubble.\n if (!bubbles) {\n stopEvent(event);\n }\n }\n}\n\nclass ColorManager {\n static _colorsMapping = new Map([\n [\"CanvasText\", [0, 0, 0]],\n [\"Canvas\", [255, 255, 255]],\n ]);\n\n get _colors() {\n if (\n typeof PDFJSDev !== \"undefined\" &&\n PDFJSDev.test(\"LIB\") &&\n typeof document === \"undefined\"\n ) {\n return shadow(this, \"_colors\", ColorManager._colorsMapping);\n }\n\n const colors = new Map([\n [\"CanvasText\", null],\n [\"Canvas\", null],\n ]);\n getColorValues(colors);\n return shadow(this, \"_colors\", colors);\n }\n\n /**\n * In High Contrast Mode, the color on the screen is not always the\n * real color used in the pdf.\n * For example in some cases white can appear to be black but when saving\n * we want to have white.\n * @param {string} color\n * @returns {Array<number>}\n */\n convert(color) {\n const rgb = getRGB(color);\n if (!window.matchMedia(\"(forced-colors: active)\").matches) {\n return rgb;\n }\n\n for (const [name, RGB] of this._colors) {\n if (RGB.every((x, i) => x === rgb[i])) {\n return ColorManager._colorsMapping.get(name);\n }\n }\n return rgb;\n }\n\n /**\n * An input element must have its color value as a hex string\n * and not as color name.\n * So this function converts a name into an hex string.\n * @param {string} name\n * @returns {string}\n */\n getHexCode(name) {\n const rgb = this._colors.get(name);\n if (!rgb) {\n return name;\n }\n return Util.makeHexColor(...rgb);\n }\n}\n\n/**\n * A pdf has several pages and each of them when it will rendered\n * will have an AnnotationEditorLayer which will contain the some\n * new Annotations associated to an editor in order to modify them.\n *\n * This class is used to manage all the different layers, editors and\n * some action like copy/paste, undo/redo, ...\n */\nclass AnnotationEditorUIManager {\n #abortController = new AbortController();\n\n #activeEditor = null;\n\n #allEditableAnnotations = null;\n\n #allEditors = new Map();\n\n #allLayers = new Map();\n\n #altTextManager = null;\n\n #annotationStorage = null;\n\n #changedExistingAnnotations = null;\n\n #commandManager = new CommandManager();\n\n #commentManager = null;\n\n #copyPasteAC = null;\n\n #currentDrawingSession = null;\n\n #currentPageIndex = 0;\n\n #deletedAnnotationsElementIds = new Set();\n\n #draggingEditors = null;\n\n #editorTypes = null;\n\n #editorsToRescale = new Set();\n\n _editorUndoBar = null;\n\n #enableHighlightFloatingButton = false;\n\n #enableUpdatedAddImage = false;\n\n #enableNewAltTextWhenAddingImage = false;\n\n #filterFactory = null;\n\n #focusMainContainerTimeoutId = null;\n\n #focusManagerAC = null;\n\n #highlightColors = null;\n\n #highlightWhenShiftUp = false;\n\n #floatingToolbar = null;\n\n #idManager = new IdManager();\n\n #isEnabled = false;\n\n #isPointerDown = false;\n\n #isWaiting = false;\n\n #keyboardManagerAC = null;\n\n #lastActiveElement = null;\n\n #mainHighlightColorPicker = null;\n\n #missingCanvases = null;\n\n #mlManager = null;\n\n #mode = AnnotationEditorType.NONE;\n\n #selectedEditors = new Set();\n\n #selectedTextNode = null;\n\n #signatureManager = null;\n\n #pageColors = null;\n\n #showAllStates = null;\n\n #pdfDocument = null;\n\n #previousStates = {\n isEditing: false,\n isEmpty: true,\n hasSomethingToUndo: false,\n hasSomethingToRedo: false,\n hasSelectedEditor: false,\n hasSelectedText: false,\n };\n\n #translation = [0, 0];\n\n #translationTimeoutId = null;\n\n #container = null;\n\n #viewer = null;\n\n #viewerAlert = null;\n\n #updateModeCapability = null;\n\n static TRANSLATE_SMALL = 1; // page units.\n\n static TRANSLATE_BIG = 10; // page units.\n\n static get _keyboardManager() {\n const proto = AnnotationEditorUIManager.prototype;\n\n /**\n * If the focused element is an input, we don't want to handle the arrow.\n * For example, sliders can be controlled with the arrow keys.\n */\n const arrowChecker = self =>\n self.#container.contains(document.activeElement) &&\n document.activeElement.tagName !== \"BUTTON\" &&\n self.hasSomethingToControl();\n\n const textInputChecker = (_self, { target: el }) => {\n if (el instanceof HTMLInputElement) {\n const { type } = el;\n return type !== \"text\" && type !== \"number\";\n }\n return true;\n };\n\n const small = this.TRANSLATE_SMALL;\n const big = this.TRANSLATE_BIG;\n\n return shadow(\n this,\n \"_keyboardManager\",\n new KeyboardManager([\n [\n [\"ctrl+a\", \"mac+meta+a\"],\n proto.selectAll,\n { checker: textInputChecker },\n ],\n [[\"ctrl+z\", \"mac+meta+z\"], proto.undo, { checker: textInputChecker }],\n [\n // On mac, depending of the OS version, the event.key is either \"z\" or\n // \"Z\" when the user presses \"meta+shift+z\".\n [\n \"ctrl+y\",\n \"ctrl+shift+z\",\n \"mac+meta+shift+z\",\n \"ctrl+shift+Z\",\n \"mac+meta+shift+Z\",\n ],\n proto.redo,\n { checker: textInputChecker },\n ],\n [\n [\n \"Backspace\",\n \"alt+Backspace\",\n \"ctrl+Backspace\",\n \"shift+Backspace\",\n \"mac+Backspace\",\n \"mac+alt+Backspace\",\n \"mac+ctrl+Backspace\",\n \"Delete\",\n \"ctrl+Delete\",\n \"shift+Delete\",\n \"mac+Delete\",\n ],\n proto.delete,\n { checker: textInputChecker },\n ],\n [\n [\"Enter\", \"mac+Enter\"],\n proto.addNewEditorFromKeyboard,\n {\n // Those shortcuts can be used in the toolbar for some other actions\n // like zooming, hence we need to check if the container has the\n // focus.\n checker: (self, { target: el }) =>\n !(el instanceof HTMLButtonElement) &&\n self.#container.contains(el) &&\n !self.isEnterHandled,\n },\n ],\n [\n [\" \", \"mac+ \"],\n proto.addNewEditorFromKeyboard,\n {\n // Those shortcuts can be used in the toolbar for some other actions\n // like zooming, hence we need to check if the container has the\n // focus.\n checker: (self, { target: el }) =>\n !(el instanceof HTMLButtonElement) &&\n self.#container.contains(document.activeElement),\n },\n ],\n [[\"Escape\", \"mac+Escape\"], proto.unselectAll],\n [\n [\"ArrowLeft\", \"mac+ArrowLeft\"],\n proto.translateSelectedEditors,\n { args: [-small, 0], checker: arrowChecker },\n ],\n [\n [\"ctrl+ArrowLeft\", \"mac+shift+ArrowLeft\"],\n proto.translateSelectedEditors,\n { args: [-big, 0], checker: arrowChecker },\n ],\n [\n [\"ArrowRight\", \"mac+ArrowRight\"],\n proto.translateSelectedEditors,\n { args: [small, 0], checker: arrowChecker },\n ],\n [\n [\"ctrl+ArrowRight\", \"mac+shift+ArrowRight\"],\n proto.translateSelectedEditors,\n { args: [big, 0], checker: arrowChecker },\n ],\n [\n [\"ArrowUp\", \"mac+ArrowUp\"],\n proto.translateSelectedEditors,\n { args: [0, -small], checker: arrowChecker },\n ],\n [\n [\"ctrl+ArrowUp\", \"mac+shift+ArrowUp\"],\n proto.translateSelectedEditors,\n { args: [0, -big], checker: arrowChecker },\n ],\n [\n [\"ArrowDown\", \"mac+ArrowDown\"],\n proto.translateSelectedEditors,\n { args: [0, small], checker: arrowChecker },\n ],\n [\n [\"ctrl+ArrowDown\", \"mac+shift+ArrowDown\"],\n proto.translateSelectedEditors,\n { args: [0, big], checker: arrowChecker },\n ],\n ])\n );\n }\n\n constructor(\n container,\n viewer,\n viewerAlert,\n altTextManager,\n commentManager,\n signatureManager,\n eventBus,\n pdfDocument,\n pageColors,\n highlightColors,\n enableHighlightFloatingButton,\n enableUpdatedAddImage,\n enableNewAltTextWhenAddingImage,\n mlManager,\n editorUndoBar,\n supportsPinchToZoom\n ) {\n const signal = (this._signal = this.#abortController.signal);\n this.#container = container;\n this.#viewer = viewer;\n this.#viewerAlert = viewerAlert;\n this.#altTextManager = altTextManager;\n this.#commentManager = commentManager;\n this.#signatureManager = signatureManager;\n this.#pdfDocument = pdfDocument;\n this._eventBus = eventBus;\n eventBus._on(\"editingaction\", this.onEditingAction.bind(this), { signal });\n eventBus._on(\"pagechanging\", this.onPageChanging.bind(this), { signal });\n eventBus._on(\"scalechanging\", this.onScaleChanging.bind(this), { signal });\n eventBus._on(\"rotationchanging\", this.onRotationChanging.bind(this), {\n signal,\n });\n eventBus._on(\"setpreference\", this.onSetPreference.bind(this), { signal });\n eventBus._on(\n \"switchannotationeditorparams\",\n evt => this.updateParams(evt.type, evt.value),\n { signal }\n );\n window.addEventListener(\n \"pointerdown\",\n () => {\n this.#isPointerDown = true;\n },\n { capture: true, signal }\n );\n window.addEventListener(\n \"pointerup\",\n () => {\n this.#isPointerDown = false;\n },\n { capture: true, signal }\n );\n this.#addSelectionListener();\n this.#addDragAndDropListeners();\n this.#addKeyboardManager();\n this.#annotationStorage = pdfDocument.annotationStorage;\n this.#filterFactory = pdfDocument.filterFactory;\n this.#pageColors = pageColors;\n this.#highlightColors = highlightColors || null;\n this.#enableHighlightFloatingButton = enableHighlightFloatingButton;\n this.#enableUpdatedAddImage = enableUpdatedAddImage;\n this.#enableNewAltTextWhenAddingImage = enableNewAltTextWhenAddingImage;\n this.#mlManager = mlManager || null;\n this.viewParameters = {\n realScale: PixelsPerInch.PDF_TO_CSS_UNITS,\n rotation: 0,\n };\n this.isShiftKeyDown = false;\n this._editorUndoBar = editorUndoBar || null;\n this._supportsPinchToZoom = supportsPinchToZoom !== false;\n\n if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"TESTING\")) {\n Object.defineProperty(this, \"reset\", {\n value: () => {\n this.selectAll();\n this.delete();\n this.#idManager.reset();\n },\n });\n }\n }\n\n destroy() {\n this.#updateModeCapability?.resolve();\n this.#updateModeCapability = null;\n\n this.#abortController?.abort();\n this.#abortController = null;\n this._signal = null;\n\n for (const layer of this.#allLayers.values()) {\n layer.destroy();\n }\n this.#allLayers.clear();\n this.#allEditors.clear();\n this.#editorsToRescale.clear();\n this.#missingCanvases?.clear();\n this.#activeEditor = null;\n this.#selectedEditors.clear();\n this.#commandManager.destroy();\n this.#altTextManager?.destroy();\n this.#commentManager?.destroy();\n this.#signatureManager?.destroy();\n this.#floatingToolbar?.hide();\n this.#floatingToolbar = null;\n this.#mainHighlightColorPicker?.destroy();\n this.#mainHighlightColorPicker = null;\n this.#allEditableAnnotations = null;\n if (this.#focusMainContainerTimeoutId) {\n clearTimeout(this.#focusMainContainerTimeoutId);\n this.#focusMainContainerTimeoutId = null;\n }\n if (this.#translationTimeoutId) {\n clearTimeout(this.#translationTimeoutId);\n this.#translationTimeoutId = null;\n }\n this._editorUndoBar?.destroy();\n this.#pdfDocument = null;\n }\n\n combinedSignal(ac) {\n return AbortSignal.any([this._signal, ac.signal]);\n }\n\n get mlManager() {\n return this.#mlManager;\n }\n\n get useNewAltTextFlow() {\n return this.#enableUpdatedAddImage;\n }\n\n get useNewAltTextWhenAddingImage() {\n return this.#enableNewAltTextWhenAddingImage;\n }\n\n get hcmFilter() {\n return shadow(\n this,\n \"hcmFilter\",\n this.#pageColors\n ? this.#filterFactory.addHCMFilter(\n this.#pageColors.foreground,\n this.#pageColors.background\n )\n : \"none\"\n );\n }\n\n get direction() {\n return shadow(\n this,\n \"direction\",\n getComputedStyle(this.#container).direction\n );\n }\n\n get _highlightColors() {\n return shadow(\n this,\n \"_highlightColors\",\n this.#highlightColors\n ? new Map(\n this.#highlightColors.split(\",\").map(pair => {\n pair = pair.split(\"=\").map(x => x.trim());\n pair[1] = pair[1].toUpperCase();\n return pair;\n })\n )\n : null\n );\n }\n\n get highlightColors() {\n const { _highlightColors } = this;\n if (!_highlightColors) {\n return shadow(this, \"highlightColors\", null);\n }\n const map = new Map();\n const hasHCM = !!this.#pageColors;\n for (const [name, color] of _highlightColors) {\n const isNameForHCM = name.endsWith(\"_HCM\");\n if (hasHCM && isNameForHCM) {\n map.set(name.replace(\"_HCM\", \"\"), color);\n continue;\n }\n if (!hasHCM && !isNameForHCM) {\n map.set(name, color);\n }\n }\n return shadow(this, \"highlightColors\", map);\n }\n\n get highlightColorNames() {\n return shadow(\n this,\n \"highlightColorNames\",\n this.highlightColors\n ? new Map(Array.from(this.highlightColors, e => e.reverse()))\n : null\n );\n }\n\n getNonHCMColor(color) {\n if (!this._highlightColors) {\n return color;\n }\n const colorName = this.highlightColorNames.get(color);\n return this._highlightColors.get(colorName) || color;\n }\n\n getNonHCMColorName(color) {\n return this.highlightColorNames.get(color) || color;\n }\n\n /**\n * Set the current drawing session.\n * @param {AnnotationEditorLayer} layer\n */\n setCurrentDrawingSession(layer) {\n if (layer) {\n this.unselectAll();\n this.disableUserSelect(true);\n } else {\n this.disableUserSelect(false);\n }\n this.#currentDrawingSession = layer;\n }\n\n setMainHighlightColorPicker(colorPicker) {\n this.#mainHighlightColorPicker = colorPicker;\n }\n\n editAltText(editor, firstTime = false) {\n this.#altTextManager?.editAltText(this, editor, firstTime);\n }\n\n hasCommentManager() {\n return !!this.#commentManager;\n }\n\n editComment(editor, position) {\n this.#commentManager?.open(this, editor, position);\n }\n\n getSignature(editor) {\n this.#signatureManager?.getSignature({ uiManager: this, editor });\n }\n\n get signatureManager() {\n return this.#signatureManager;\n }\n\n switchToMode(mode, callback) {\n // Switching to a mode can be asynchronous.\n this._eventBus.on(\"annotationeditormodechanged\", callback, {\n once: true,\n signal: this._signal,\n });\n this._eventBus.dispatch(\"showannotationeditorui\", {\n source: this,\n mode,\n });\n }\n\n setPreference(name, value) {\n this._eventBus.dispatch(\"setpreference\", {\n source: this,\n name,\n value,\n });\n }\n\n onSetPreference({ name, value }) {\n switch (name) {\n case \"enableNewAltTextWhenAddingImage\":\n this.#enableNewAltTextWhenAddingImage = value;\n break;\n }\n }\n\n onPageChanging({ pageNumber }) {\n this.#currentPageIndex = pageNumber - 1;\n }\n\n focusMainContainer() {\n this.#container.focus();\n }\n\n findParent(x, y) {\n for (const layer of this.#allLayers.values()) {\n const {\n x: layerX,\n y: layerY,\n width,\n height,\n } = layer.div.getBoundingClientRect();\n if (\n x >= layerX &&\n x <= layerX + width &&\n y >= layerY &&\n y <= layerY + height\n ) {\n return layer;\n }\n }\n return null;\n }\n\n disableUserSelect(value = false) {\n this.#viewer.classList.toggle(\"noUserSelect\", value);\n }\n\n addShouldRescale(editor) {\n this.#editorsToRescale.add(editor);\n }\n\n removeShouldRescale(editor) {\n this.#editorsToRescale.delete(editor);\n }\n\n onScaleChanging({ scale }) {\n this.commitOrRemove();\n this.viewParameters.realScale = scale * PixelsPerInch.PDF_TO_CSS_UNITS;\n for (const editor of this.#editorsToRescale) {\n editor.onScaleChanging();\n }\n this.#currentDrawingSession?.onScaleChanging();\n }\n\n onRotationChanging({ pagesRotation }) {\n this.commitOrRemove();\n this.viewParameters.rotation = pagesRotation;\n }\n\n #getAnchorElementForSelection({ anchorNode }) {\n return anchorNode.nodeType === Node.TEXT_NODE\n ? anchorNode.parentElement\n : anchorNode;\n }\n\n #getLayerForTextLayer(textLayer) {\n const { currentLayer } = this;\n if (currentLayer.hasTextLayer(textLayer)) {\n return currentLayer;\n }\n for (const layer of this.#allLayers.values()) {\n if (layer.hasTextLayer(textLayer)) {\n return layer;\n }\n }\n return null;\n }\n\n highlightSelection(methodOfCreation = \"\", comment = false) {\n const selection = document.getSelection();\n if (!selection || selection.isCollapsed) {\n return;\n }\n const { anchorNode, anchorOffset, focusNode, focusOffset } = selection;\n const text = selection.toString();\n const anchorElement = this.#getAnchorElementForSelection(selection);\n const textLayer = anchorElement.closest(\".textLayer\");\n const boxes = this.getSelectionBoxes(textLayer);\n if (!boxes) {\n return;\n }\n selection.empty();\n\n const layer = this.#getLayerForTextLayer(textLayer);\n const isNoneMode = this.#mode === AnnotationEditorType.NONE;\n const callback = () => {\n const editor = layer?.createAndAddNewEditor({ x: 0, y: 0 }, false, {\n methodOfCreation,\n boxes,\n anchorNode,\n anchorOffset,\n focusNode,\n focusOffset,\n text,\n });\n if (isNoneMode) {\n this.showAllEditors(\"highlight\", true, /* updateButton = */ true);\n }\n if (comment) {\n editor?.editComment();\n }\n };\n if (isNoneMode) {\n this.switchToMode(AnnotationEditorType.HIGHLIGHT, callback);\n return;\n }\n callback();\n }\n\n commentSelection(methodOfCreation = \"\") {\n this.highlightSelection(methodOfCreation, /* comment */ true);\n }\n\n #displayFloatingToolbar() {\n const selection = document.getSelection();\n if (!selection || selection.isCollapsed) {\n return;\n }\n const anchorElement = this.#getAnchorElementForSelection(selection);\n const textLayer = anchorElement.closest(\".textLayer\");\n const boxes = this.getSelectionBoxes(textLayer);\n if (!boxes) {\n return;\n }\n this.#floatingToolbar ||= new FloatingToolbar(this);\n this.#floatingToolbar.show(textLayer, boxes, this.direction === \"ltr\");\n }\n\n /**\n * Add an editor in the annotation storage.\n * @param {AnnotationEditor} editor\n */\n addToAnnotationStorage(editor) {\n if (\n !editor.isEmpty() &&\n this.#annotationStorage &&\n !this.#annotationStorage.has(editor.id)\n ) {\n this.#annotationStorage.setValue(editor.id, editor);\n }\n }\n\n a11yAlert(messageId, args = null) {\n const viewerAlert = this.#viewerAlert;\n if (!viewerAlert) {\n return;\n }\n viewerAlert.setAttribute(\"data-l10n-id\", messageId);\n if (args) {\n viewerAlert.setAttribute(\"data-l10n-args\", JSON.stringify(args));\n } else {\n viewerAlert.removeAttribute(\"data-l10n-args\");\n }\n }\n\n #selectionChange() {\n const selection = document.getSelection();\n if (!selection || selection.isCollapsed) {\n if (this.#selectedTextNode) {\n this.#floatingToolbar?.hide();\n this.#selectedTextNode = null;\n this.#dispatchUpdateStates({\n hasSelectedText: false,\n });\n }\n return;\n }\n const { anchorNode } = selection;\n if (anchorNode === this.#selectedTextNode) {\n return;\n }\n\n const anchorElement = this.#getAnchorElementForSelection(selection);\n const textLayer = anchorElement.closest(\".textLayer\");\n if (!textLayer) {\n if (this.#selectedTextNode) {\n this.#floatingToolbar?.hide();\n this.#selectedTextNode = null;\n this.#dispatchUpdateStates({\n hasSelectedText: false,\n });\n }\n return;\n }\n\n this.#floatingToolbar?.hide();\n this.#selectedTextNode = anchorNode;\n this.#dispatchUpdateStates({\n hasSelectedText: true,\n });\n\n if (\n this.#mode !== AnnotationEditorType.HIGHLIGHT &&\n this.#mode !== AnnotationEditorType.NONE\n ) {\n return;\n }\n\n if (this.#mode === AnnotationEditorType.HIGHLIGHT) {\n this.showAllEditors(\"highlight\", true, /* updateButton = */ true);\n }\n\n this.#highlightWhenShiftUp = this.isShiftKeyDown;\n if (!this.isShiftKeyDown) {\n const activeLayer =\n this.#mode === AnnotationEditorType.HIGHLIGHT\n ? this.#getLayerForTextLayer(textLayer)\n : null;\n activeLayer?.toggleDrawing();\n\n if (this.#isPointerDown) {\n const ac = new AbortController();\n const signal = this.combinedSignal(ac);\n\n const pointerup = e => {\n if (e.type === \"pointerup\" && e.button !== 0) {\n // Do nothing on right click.\n return;\n }\n ac.abort();\n activeLayer?.toggleDrawing(true);\n if (e.type === \"pointerup\") {\n this.#onSelectEnd(\"main_toolbar\");\n }\n };\n window.addEventListener(\"pointerup\", pointerup, { signal });\n window.addEventListener(\"blur\", pointerup, { signal });\n } else {\n // Here neither the shift key nor the pointer is down and we've\n // something in the selection: we can be in the case where the user is\n // using a screen reader (see bug 1976597).\n activeLayer?.toggleDrawing(true);\n this.#onSelectEnd(\"main_toolbar\");\n }\n }\n }\n\n #onSelectEnd(methodOfCreation = \"\") {\n if (this.#mode === AnnotationEditorType.HIGHLIGHT) {\n this.highlightSelection(methodOfCreation);\n } else if (this.#enableHighlightFloatingButton) {\n this.#displayFloatingToolbar();\n }\n }\n\n #addSelectionListener() {\n document.addEventListener(\n \"selectionchange\",\n this.#selectionChange.bind(this),\n { signal: this._signal }\n );\n }\n\n #addFocusManager() {\n if (this.#focusManagerAC) {\n return;\n }\n this.#focusManagerAC = new AbortController();\n const signal = this.combinedSignal(this.#focusManagerAC);\n\n window.addEventListener(\"focus\", this.focus.bind(this), { signal });\n window.addEventListener(\"blur\", this.blur.bind(this), { signal });\n }\n\n #removeFocusManager() {\n this.#focusManagerAC?.abort();\n this.#focusManagerAC = null;\n }\n\n blur() {\n this.isShiftKeyDown = false;\n if (this.#highlightWhenShiftUp) {\n this.#highlightWhenShiftUp = false;\n this.#onSelectEnd(\"main_toolbar\");\n }\n if (!this.hasSelection) {\n return;\n }\n // When several editors are selected and the window loses focus, we want to\n // keep the last active element in order to be able to focus it again when\n // the window gets the focus back but we don't want to trigger any focus\n // callbacks else only one editor will be selected.\n const { activeElement } = document;\n for (const editor of this.#selectedEditors) {\n if (editor.div.contains(activeElement)) {\n this.#lastActiveElement = [editor, activeElement];\n editor._focusEventsAllowed = false;\n break;\n }\n }\n }\n\n focus() {\n if (!this.#lastActiveElement) {\n return;\n }\n const [lastEditor, lastActiveElement] = this.#lastActiveElement;\n this.#lastActiveElement = null;\n lastActiveElement.addEventListener(\n \"focusin\",\n () => {\n lastEditor._focusEventsAllowed = true;\n },\n { once: true, signal: this._signal }\n );\n lastActiveElement.focus();\n }\n\n #addKeyboardManager() {\n if (this.#keyboardManagerAC) {\n return;\n }\n this.#keyboardManagerAC = new AbortController();\n const signal = this.combinedSignal(this.#keyboardManagerAC);\n\n // The keyboard events are caught at the container level in order to be able\n // to execute some callbacks even if the current page doesn't have focus.\n window.addEventListener(\"keydown\", this.keydown.bind(this), { signal });\n window.addEventListener(\"keyup\", this.keyup.bind(this), { signal });\n }\n\n #removeKeyboardManager() {\n this.#keyboardManagerAC?.abort();\n this.#keyboardManagerAC = null;\n }\n\n #addCopyPasteListeners() {\n if (this.#copyPasteAC) {\n return;\n }\n this.#copyPasteAC = new AbortController();\n const signal = this.combinedSignal(this.#copyPasteAC);\n\n document.addEventListener(\"copy\", this.copy.bind(this), { signal });\n document.addEventListener(\"cut\", this.cut.bind(this), { signal });\n document.addEventListener(\"paste\", this.paste.bind(this), { signal });\n }\n\n #removeCopyPasteListeners() {\n this.#copyPasteAC?.abort();\n this.#copyPasteAC = null;\n }\n\n #addDragAndDropListeners() {\n const signal = this._signal;\n document.addEventListener(\"dragover\", this.dragOver.bind(this), { signal });\n document.addEventListener(\"drop\", this.drop.bind(this), { signal });\n }\n\n addEditListeners() {\n this.#addKeyboardManager();\n this.#addCopyPasteListeners();\n }\n\n removeEditListeners() {\n this.#removeKeyboardManager();\n this.#removeCopyPasteListeners();\n }\n\n dragOver(event) {\n for (const { type } of event.dataTransfer.items) {\n for (const editorType of this.#editorTypes) {\n if (editorType.isHandlingMimeForPasting(type)) {\n event.dataTransfer.dropEffect = \"copy\";\n event.preventDefault();\n return;\n }\n }\n }\n }\n\n /**\n * Drop callback.\n * @param {DragEvent} event\n */\n drop(event) {\n for (const item of event.dataTransfer.items) {\n for (const editorType of this.#editorTypes) {\n if (editorType.isHandlingMimeForPasting(item.type)) {\n editorType.paste(item, this.currentLayer);\n event.preventDefault();\n return;\n }\n }\n }\n }\n\n /**\n * Copy callback.\n * @param {ClipboardEvent} event\n */\n copy(event) {\n event.preventDefault();\n\n // An editor is being edited so just commit it.\n this.#activeEditor?.commitOrRemove();\n\n if (!this.hasSelection) {\n return;\n }\n\n const editors = [];\n for (const editor of this.#selectedEditors) {\n const serialized = editor.serialize(/* isForCopying = */ true);\n if (serialized) {\n editors.push(serialized);\n }\n }\n if (editors.length === 0) {\n return;\n }\n\n event.clipboardData.setData(\"application/pdfjs\", JSON.stringify(editors));\n }\n\n /**\n * Cut callback.\n * @param {ClipboardEvent} event\n */\n cut(event) {\n this.copy(event);\n this.delete();\n }\n\n /**\n * Paste callback.\n * @param {ClipboardEvent} event\n */\n async paste(event) {\n event.preventDefault();\n const { clipboardData } = event;\n for (const item of clipboardData.items) {\n for (const editorType of this.#editorTypes) {\n if (editorType.isHandlingMimeForPasting(item.type)) {\n editorType.paste(item, this.currentLayer);\n return;\n }\n }\n }\n\n let data = clipboardData.getData(\"application/pdfjs\");\n if (!data) {\n return;\n }\n\n try {\n data = JSON.parse(data);\n } catch (ex) {\n warn(`paste: \"${ex.message}\".`);\n return;\n }\n\n if (!Array.isArray(data)) {\n return;\n }\n\n this.unselectAll();\n const layer = this.currentLayer;\n\n try {\n const newEditors = [];\n for (const editor of data) {\n const deserializedEditor = await layer.deserialize(editor);\n if (!deserializedEditor) {\n return;\n }\n newEditors.push(deserializedEditor);\n }\n\n const cmd = () => {\n for (const editor of newEditors) {\n this.#addEditorToLayer(editor);\n }\n this.#selectEditors(newEditors);\n };\n const undo = () => {\n for (const editor of newEditors) {\n editor.remove();\n }\n };\n this.addCommands({ cmd, undo, mustExec: true });\n } catch (ex) {\n warn(`paste: \"${ex.message}\".`);\n }\n }\n\n /**\n * Keydown callback.\n * @param {KeyboardEvent} event\n */\n keydown(event) {\n if (!this.isShiftKeyDown && event.key === \"Shift\") {\n this.isShiftKeyDown = true;\n }\n if (\n this.#mode !== AnnotationEditorType.NONE &&\n !this.isEditorHandlingKeyboard\n ) {\n AnnotationEditorUIManager._keyboardManager.exec(this, event);\n }\n }\n\n /**\n * Keyup callback.\n * @param {KeyboardEvent} event\n */\n keyup(event) {\n if (this.isShiftKeyDown && event.key === \"Shift\") {\n this.isShiftKeyDown = false;\n if (this.#highlightWhenShiftUp) {\n this.#highlightWhenShiftUp = false;\n this.#onSelectEnd(\"main_toolbar\");\n }\n }\n }\n\n /**\n * Execute an action for a given name.\n * For example, the user can click on the \"Undo\" entry in the context menu\n * and it'll trigger the undo action.\n */\n onEditingAction({ name }) {\n switch (name) {\n case \"undo\":\n case \"redo\":\n case \"delete\":\n case \"selectAll\":\n this[name]();\n break;\n case \"highlightSelection\":\n this.highlightSelection(\"context_menu\");\n break;\n case \"commentSelection\":\n this.commentSelection(\"context_menu\");\n break;\n }\n }\n\n /**\n * Update the different possible states of this manager, e.g. is there\n * something to undo, redo, ...\n * @param {Object} details\n */\n #dispatchUpdateStates(details) {\n const hasChanged = Object.entries(details).some(\n ([key, value]) => this.#previousStates[key] !== value\n );\n\n if (hasChanged) {\n this._eventBus.dispatch(\"annotationeditorstateschanged\", {\n source: this,\n details: Object.assign(this.#previousStates, details),\n });\n // We could listen on our own event but it sounds like a bit weird and\n // it's a way to simpler to handle that stuff here instead of having to\n // add something in every place where an editor can be unselected.\n if (\n this.#mode === AnnotationEditorType.HIGHLIGHT &&\n details.hasSelectedEditor === false\n ) {\n this.#dispatchUpdateUI([\n [AnnotationEditorParamsType.HIGHLIGHT_FREE, true],\n ]);\n }\n }\n }\n\n #dispatchUpdateUI(details) {\n this._eventBus.dispatch(\"annotationeditorparamschanged\", {\n source: this,\n details,\n });\n }\n\n /**\n * Set the editing state.\n * It can be useful to temporarily disable it when the user is editing a\n * FreeText annotation.\n * @param {boolean} isEditing\n */\n setEditingState(isEditing) {\n if (isEditing) {\n this.#addFocusManager();\n this.#addCopyPasteListeners();\n this.#dispatchUpdateStates({\n isEditing: this.#mode !== AnnotationEditorType.NONE,\n isEmpty: this.#isEmpty(),\n hasSomethingToUndo: this.#commandManager.hasSomethingToUndo(),\n hasSomethingToRedo: this.#commandManager.hasSomethingToRedo(),\n hasSelectedEditor: false,\n });\n } else {\n this.#removeFocusManager();\n this.#removeCopyPasteListeners();\n this.#dispatchUpdateStates({\n isEditing: false,\n });\n this.disableUserSelect(false);\n }\n }\n\n registerEditorTypes(types) {\n if (this.#editorTypes) {\n return;\n }\n this.#editorTypes = types;\n for (const editorType of this.#editorTypes) {\n this.#dispatchUpdateUI(editorType.defaultPropertiesToUpdate);\n }\n }\n\n /**\n * Get an id.\n * @returns {string}\n */\n getId() {\n return this.#idManager.id;\n }\n\n get currentLayer() {\n return this.#allLayers.get(this.#currentPageIndex);\n }\n\n getLayer(pageIndex) {\n return this.#allLayers.get(pageIndex);\n }\n\n get currentPageIndex() {\n return this.#currentPageIndex;\n }\n\n /**\n * Add a new layer for a page which will contains the editors.\n * @param {AnnotationEditorLayer} layer\n */\n addLayer(layer) {\n this.#allLayers.set(layer.pageIndex, layer);\n if (this.#isEnabled) {\n layer.enable();\n } else {\n layer.disable();\n }\n }\n\n /**\n * Remove a layer.\n * @param {AnnotationEditorLayer} layer\n */\n removeLayer(layer) {\n this.#allLayers.delete(layer.pageIndex);\n }\n\n /**\n * Change the editor mode (None, FreeText, Ink, ...)\n * @param {number} mode\n * @param {string|null} editId\n * @param {boolean} [isFromKeyboard] - true if the mode change is due to a\n * keyboard action.\n * @param {boolean} [mustEnterInEditMode] - true if the editor must enter in\n * edit mode.\n * @param {boolean} [editComment] - true if the mode change is due to a\n * comment edit.\n */\n async updateMode(\n mode,\n editId = null,\n isFromKeyboard = false,\n mustEnterInEditMode = false,\n editComment = false\n ) {\n if (this.#mode === mode) {\n return;\n }\n\n if (this.#updateModeCapability) {\n await this.#updateModeCapability.promise;\n if (!this.#updateModeCapability) {\n // This ui manager has been destroyed.\n return;\n }\n }\n\n this.#updateModeCapability = Promise.withResolvers();\n this.#currentDrawingSession?.commitOrRemove();\n\n if (this.#mode === AnnotationEditorType.POPUP) {\n this.#commentManager?.hideSidebar();\n }\n\n this.#mode = mode;\n if (mode === AnnotationEditorType.NONE) {\n this.setEditingState(false);\n this.#disableAll();\n\n this._editorUndoBar?.hide();\n\n this.#updateModeCapability.resolve();\n return;\n }\n\n if (mode === AnnotationEditorType.SIGNATURE) {\n await this.#signatureManager?.loadSignatures();\n }\n if (mode === AnnotationEditorType.POPUP) {\n this.#allEditableAnnotations ||=\n await this.#pdfDocument.getAnnotationsByType(\n new Set(this.#editorTypes.map(editorClass => editorClass._editorType))\n );\n this.#commentManager?.showSidebar(this.#allEditableAnnotations);\n }\n\n this.setEditingState(true);\n await this.#enableAll();\n this.unselectAll();\n for (const layer of this.#allLayers.values()) {\n layer.updateMode(mode);\n }\n if (!editId) {\n if (isFromKeyboard) {\n this.addNewEditorFromKeyboard();\n }\n\n this.#updateModeCapability.resolve();\n return;\n }\n\n for (const editor of this.#allEditors.values()) {\n if (editor.annotationElementId === editId || editor.id === editId) {\n this.setSelected(editor);\n if (editComment) {\n editor.editComment();\n } else if (mustEnterInEditMode) {\n editor.enterInEditMode();\n }\n } else {\n editor.unselect();\n }\n }\n\n this.#updateModeCapability.resolve();\n }\n\n addNewEditorFromKeyboard() {\n if (this.currentLayer.canCreateNewEmptyEditor()) {\n this.currentLayer.addNewEditor();\n }\n }\n\n /**\n * Update the toolbar if it's required to reflect the tool currently used.\n * @param {Object} options\n * @param {number} mode\n * @returns {undefined}\n */\n updateToolbar(options) {\n if (options.mode === this.#mode) {\n return;\n }\n this._eventBus.dispatch(\"switchannotationeditormode\", {\n source: this,\n ...options,\n });\n }\n\n /**\n * Update a parameter in the current editor or globally.\n * @param {number} type\n * @param {*} value\n */\n updateParams(type, value) {\n if (!this.#editorTypes) {\n return;\n }\n\n switch (type) {\n case AnnotationEditorParamsType.CREATE:\n this.currentLayer.addNewEditor(value);\n return;\n case AnnotationEditorParamsType.HIGHLIGHT_SHOW_ALL:\n this._eventBus.dispatch(\"reporttelemetry\", {\n source: this,\n details: {\n type: \"editing\",\n data: {\n type: \"highlight\",\n action: \"toggle_visibility\",\n },\n },\n });\n (this.#showAllStates ||= new Map()).set(type, value);\n this.showAllEditors(\"highlight\", value);\n break;\n }\n\n if (this.hasSelection) {\n for (const editor of this.#selectedEditors) {\n editor.updateParams(type, value);\n }\n } else {\n for (const editorType of this.#editorTypes) {\n editorType.updateDefaultParams(type, value);\n }\n }\n }\n\n showAllEditors(type, visible, updateButton = false) {\n for (const editor of this.#allEditors.values()) {\n if (editor.editorType === type) {\n editor.show(visible);\n }\n }\n const state =\n this.#showAllStates?.get(AnnotationEditorParamsType.HIGHLIGHT_SHOW_ALL) ??\n true;\n if (state !== visible) {\n this.#dispatchUpdateUI([\n [AnnotationEditorParamsType.HIGHLIGHT_SHOW_ALL, visible],\n ]);\n }\n }\n\n enableWaiting(mustWait = false) {\n if (this.#isWaiting === mustWait) {\n return;\n }\n this.#isWaiting = mustWait;\n for (const layer of this.#allLayers.values()) {\n if (mustWait) {\n layer.disableClick();\n } else {\n layer.enableClick();\n }\n layer.div.classList.toggle(\"waiting\", mustWait);\n }\n }\n\n /**\n * Enable all the layers.\n */\n async #enableAll() {\n if (!this.#isEnabled) {\n this.#isEnabled = true;\n const promises = [];\n for (const layer of this.#allLayers.values()) {\n promises.push(layer.enable());\n }\n await Promise.all(promises);\n for (const editor of this.#allEditors.values()) {\n editor.enable();\n }\n }\n }\n\n /**\n * Disable all the layers.\n */\n #disableAll() {\n this.unselectAll();\n if (this.#isEnabled) {\n this.#isEnabled = false;\n for (const layer of this.#allLayers.values()) {\n layer.disable();\n }\n for (const editor of this.#allEditors.values()) {\n editor.disable();\n }\n }\n }\n\n /**\n * Get all the editors belonging to a given page.\n * @param {number} pageIndex\n * @returns {Array<AnnotationEditor>}\n */\n getEditors(pageIndex) {\n const editors = [];\n for (const editor of this.#allEditors.values()) {\n if (editor.pageIndex === pageIndex) {\n editors.push(editor);\n }\n }\n return editors;\n }\n\n /**\n * Get an editor with the given id.\n * @param {string} id\n * @returns {AnnotationEditor}\n */\n getEditor(id) {\n return this.#allEditors.get(id);\n }\n\n /**\n * Add a new editor.\n * @param {AnnotationEditor} editor\n */\n addEditor(editor) {\n this.#allEditors.set(editor.id, editor);\n }\n\n /**\n * Remove an editor.\n * @param {AnnotationEditor} editor\n */\n removeEditor(editor) {\n if (editor.div.contains(document.activeElement)) {\n if (this.#focusMainContainerTimeoutId) {\n clearTimeout(this.#focusMainContainerTimeoutId);\n }\n this.#focusMainContainerTimeoutId = setTimeout(() => {\n // When the div is removed from DOM the focus can move on the\n // document.body, so we need to move it back to the main container.\n this.focusMainContainer();\n this.#focusMainContainerTimeoutId = null;\n }, 0);\n }\n this.#allEditors.delete(editor.id);\n if (editor.annotationElementId) {\n this.#missingCanvases?.delete(editor.annotationElementId);\n }\n this.unselect(editor);\n if (\n !editor.annotationElementId ||\n !this.#deletedAnnotationsElementIds.has(editor.annotationElementId)\n ) {\n this.#annotationStorage?.remove(editor.id);\n }\n }\n\n /**\n * The annotation element with the given id has been deleted.\n * @param {AnnotationEditor} editor\n */\n addDeletedAnnotationElement(editor) {\n this.#deletedAnnotationsElementIds.add(editor.annotationElementId);\n this.addChangedExistingAnnotation(editor);\n editor.deleted = true;\n }\n\n /**\n * Check if the annotation element with the given id has been deleted.\n * @param {string} annotationElementId\n * @returns {boolean}\n */\n isDeletedAnnotationElement(annotationElementId) {\n return this.#deletedAnnotationsElementIds.has(annotationElementId);\n }\n\n /**\n * The annotation element with the given id have been restored.\n * @param {AnnotationEditor} editor\n */\n removeDeletedAnnotationElement(editor) {\n this.#deletedAnnotationsElementIds.delete(editor.annotationElementId);\n this.removeChangedExistingAnnotation(editor);\n editor.deleted = false;\n }\n\n /**\n * Add an editor to the layer it belongs to or add it to the global map.\n * @param {AnnotationEditor} editor\n */\n #addEditorToLayer(editor) {\n const layer = this.#allLayers.get(editor.pageIndex);\n if (layer) {\n layer.addOrRebuild(editor);\n } else {\n this.addEditor(editor);\n this.addToAnnotationStorage(editor);\n }\n }\n\n /**\n * Set the given editor as the active one.\n * @param {AnnotationEditor} editor\n */\n setActiveEditor(editor) {\n if (this.#activeEditor === editor) {\n return;\n }\n\n this.#activeEditor = editor;\n if (editor) {\n this.#dispatchUpdateUI(editor.propertiesToUpdate);\n }\n }\n\n get #lastSelectedEditor() {\n let ed = null;\n for (ed of this.#selectedEditors) {\n // Iterate to get the last element.\n }\n return ed;\n }\n\n /**\n * Update the UI of the active editor.\n * @param {AnnotationEditor} editor\n */\n updateUI(editor) {\n if (this.#lastSelectedEditor === editor) {\n this.#dispatchUpdateUI(editor.propertiesToUpdate);\n }\n }\n\n updateUIForDefaultProperties(editorType) {\n this.#dispatchUpdateUI(editorType.defaultPropertiesToUpdate);\n }\n\n /**\n * Add or remove an editor the current selection.\n * @param {AnnotationEditor} editor\n */\n toggleSelected(editor) {\n if (this.#selectedEditors.has(editor)) {\n this.#selectedEditors.delete(editor);\n editor.unselect();\n this.#dispatchUpdateStates({\n hasSelectedEditor: this.hasSelection,\n });\n return;\n }\n this.#selectedEditors.add(editor);\n editor.select();\n this.#dispatchUpdateUI(editor.propertiesToUpdate);\n this.#dispatchUpdateStates({\n hasSelectedEditor: true,\n });\n }\n\n /**\n * Set the last selected editor.\n * @param {AnnotationEditor} editor\n */\n setSelected(editor) {\n this.updateToolbar({\n mode: editor.mode,\n editId: editor.id,\n });\n\n this.#currentDrawingSession?.commitOrRemove();\n for (const ed of this.#selectedEditors) {\n if (ed !== editor) {\n ed.unselect();\n }\n }\n this.#selectedEditors.clear();\n\n this.#selectedEditors.add(editor);\n editor.select();\n this.#dispatchUpdateUI(editor.propertiesToUpdate);\n this.#dispatchUpdateStates({\n hasSelectedEditor: true,\n });\n }\n\n /**\n * Check if the editor is selected.\n * @param {AnnotationEditor} editor\n */\n isSelected(editor) {\n return this.#selectedEditors.has(editor);\n }\n\n get firstSelectedEditor() {\n return this.#selectedEditors.values().next().value;\n }\n\n /**\n * Unselect an editor.\n * @param {AnnotationEditor} editor\n */\n unselect(editor) {\n editor.unselect();\n this.#selectedEditors.delete(editor);\n this.#dispatchUpdateStates({\n hasSelectedEditor: this.hasSelection,\n });\n }\n\n get hasSelection() {\n return this.#selectedEditors.size !== 0;\n }\n\n get isEnterHandled() {\n return (\n this.#selectedEditors.size === 1 &&\n this.firstSelectedEditor.isEnterHandled\n );\n }\n\n /**\n * Undo the last command.\n */\n undo() {\n this.#commandManager.undo();\n this.#dispatchUpdateStates({\n hasSomethingToUndo: this.#commandManager.hasSomethingToUndo(),\n hasSomethingToRedo: true,\n isEmpty: this.#isEmpty(),\n });\n this._editorUndoBar?.hide();\n }\n\n /**\n * Redo the last undoed command.\n */\n redo() {\n this.#commandManager.redo();\n this.#dispatchUpdateStates({\n hasSomethingToUndo: true,\n hasSomethingToRedo: this.#commandManager.hasSomethingToRedo(),\n isEmpty: this.#isEmpty(),\n });\n }\n\n /**\n * Add a command to execute (cmd) and another one to undo it.\n * @param {Object} params\n */\n addCommands(params) {\n this.#commandManager.add(params);\n this.#dispatchUpdateStates({\n hasSomethingToUndo: true,\n hasSomethingToRedo: false,\n isEmpty: this.#isEmpty(),\n });\n }\n\n cleanUndoStack(type) {\n this.#commandManager.cleanType(type);\n }\n\n #isEmpty() {\n if (this.#allEditors.size === 0) {\n return true;\n }\n\n if (this.#allEditors.size === 1) {\n for (const editor of this.#allEditors.values()) {\n return editor.isEmpty();\n }\n }\n\n return false;\n }\n\n /**\n * Delete the current editor or all.\n */\n delete() {\n this.commitOrRemove();\n const drawingEditor = this.currentLayer?.endDrawingSession(\n /* isAborted = */ true\n );\n if (!this.hasSelection && !drawingEditor) {\n return;\n }\n\n const editors = drawingEditor\n ? [drawingEditor]\n : [...this.#selectedEditors];\n const cmd = () => {\n this._editorUndoBar?.show(\n undo,\n editors.length === 1 ? editors[0].editorType : editors.length\n );\n for (const editor of editors) {\n editor.remove();\n }\n };\n const undo = () => {\n for (const editor of editors) {\n this.#addEditorToLayer(editor);\n }\n };\n\n this.addCommands({ cmd, undo, mustExec: true });\n }\n\n commitOrRemove() {\n // An editor is being edited so just commit it.\n this.#activeEditor?.commitOrRemove();\n }\n\n hasSomethingToControl() {\n return this.#activeEditor || this.hasSelection;\n }\n\n /**\n * Select the editors.\n * @param {Array<AnnotationEditor>} editors\n */\n #selectEditors(editors) {\n for (const editor of this.#selectedEditors) {\n editor.unselect();\n }\n this.#selectedEditors.clear();\n for (const editor of editors) {\n if (editor.isEmpty()) {\n continue;\n }\n this.#selectedEditors.add(editor);\n editor.select();\n }\n this.#dispatchUpdateStates({ hasSelectedEditor: this.hasSelection });\n }\n\n /**\n * Select all the editors.\n */\n selectAll() {\n for (const editor of this.#selectedEditors) {\n editor.commit();\n }\n this.#selectEditors(this.#allEditors.values());\n }\n\n /**\n * Unselect all the selected editors.\n */\n unselectAll() {\n if (this.#activeEditor) {\n // An editor is being edited so just commit it.\n this.#activeEditor.commitOrRemove();\n if (this.#mode !== AnnotationEditorType.NONE) {\n // If the mode is NONE, we want to really unselect the editor, hence we\n // mustn't return here.\n return;\n }\n }\n\n if (this.#currentDrawingSession?.commitOrRemove()) {\n return;\n }\n\n if (!this.hasSelection) {\n return;\n }\n for (const editor of this.#selectedEditors) {\n editor.unselect();\n }\n this.#selectedEditors.clear();\n this.#dispatchUpdateStates({\n hasSelectedEditor: false,\n });\n }\n\n translateSelectedEditors(x, y, noCommit = false) {\n if (!noCommit) {\n this.commitOrRemove();\n }\n if (!this.hasSelection) {\n return;\n }\n\n this.#translation[0] += x;\n this.#translation[1] += y;\n const [totalX, totalY] = this.#translation;\n const editors = [...this.#selectedEditors];\n\n // We don't want to have an undo/redo for each translation so we wait a bit\n // before adding the command to the command manager.\n const TIME_TO_WAIT = 1000;\n\n if (this.#translationTimeoutId) {\n clearTimeout(this.#translationTimeoutId);\n }\n\n this.#translationTimeoutId = setTimeout(() => {\n this.#translationTimeoutId = null;\n this.#translation[0] = this.#translation[1] = 0;\n\n this.addCommands({\n cmd: () => {\n for (const editor of editors) {\n if (this.#allEditors.has(editor.id)) {\n editor.translateInPage(totalX, totalY);\n editor.translationDone();\n }\n }\n },\n undo: () => {\n for (const editor of editors) {\n if (this.#allEditors.has(editor.id)) {\n editor.translateInPage(-totalX, -totalY);\n editor.translationDone();\n }\n }\n },\n mustExec: false,\n });\n }, TIME_TO_WAIT);\n\n for (const editor of editors) {\n editor.translateInPage(x, y);\n editor.translationDone();\n }\n }\n\n /**\n * Set up the drag session for moving the selected editors.\n */\n setUpDragSession() {\n // Note: don't use any references to the editor's parent which can be null\n // if the editor belongs to a destroyed page.\n if (!this.hasSelection) {\n return;\n }\n // Avoid to have spurious text selection in the text layer when dragging.\n this.disableUserSelect(true);\n this.#draggingEditors = new Map();\n for (const editor of this.#selectedEditors) {\n this.#draggingEditors.set(editor, {\n savedX: editor.x,\n savedY: editor.y,\n savedPageIndex: editor.pageIndex,\n newX: 0,\n newY: 0,\n newPageIndex: -1,\n });\n }\n }\n\n /**\n * Ends the drag session.\n * @returns {boolean} true if at least one editor has been moved.\n */\n endDragSession() {\n if (!this.#draggingEditors) {\n return false;\n }\n this.disableUserSelect(false);\n const map = this.#draggingEditors;\n this.#draggingEditors = null;\n let mustBeAddedInUndoStack = false;\n\n for (const [{ x, y, pageIndex }, value] of map) {\n value.newX = x;\n value.newY = y;\n value.newPageIndex = pageIndex;\n mustBeAddedInUndoStack ||=\n x !== value.savedX ||\n y !== value.savedY ||\n pageIndex !== value.savedPageIndex;\n }\n\n if (!mustBeAddedInUndoStack) {\n return false;\n }\n\n const move = (editor, x, y, pageIndex) => {\n if (this.#allEditors.has(editor.id)) {\n // The editor can be undone/redone on a page which is not visible (and\n // which potentially has no annotation editor layer), hence we need to\n // use the pageIndex instead of the parent.\n const parent = this.#allLayers.get(pageIndex);\n if (parent) {\n editor._setParentAndPosition(parent, x, y);\n } else {\n editor.pageIndex = pageIndex;\n editor.x = x;\n editor.y = y;\n }\n }\n };\n\n this.addCommands({\n cmd: () => {\n for (const [editor, { newX, newY, newPageIndex }] of map) {\n move(editor, newX, newY, newPageIndex);\n }\n },\n undo: () => {\n for (const [editor, { savedX, savedY, savedPageIndex }] of map) {\n move(editor, savedX, savedY, savedPageIndex);\n }\n },\n mustExec: true,\n });\n\n return true;\n }\n\n /**\n * Drag the set of selected editors.\n * @param {number} tx\n * @param {number} ty\n */\n dragSelectedEditors(tx, ty) {\n if (!this.#draggingEditors) {\n return;\n }\n for (const editor of this.#draggingEditors.keys()) {\n editor.drag(tx, ty);\n }\n }\n\n /**\n * Rebuild the editor (usually on undo/redo actions) on a potentially\n * non-rendered page.\n * @param {AnnotationEditor} editor\n */\n rebuild(editor) {\n if (editor.parent === null) {\n const parent = this.getLayer(editor.pageIndex);\n if (parent) {\n parent.changeParent(editor);\n parent.addOrRebuild(editor);\n } else {\n this.addEditor(editor);\n this.addToAnnotationStorage(editor);\n editor.rebuild();\n }\n } else {\n editor.parent.addOrRebuild(editor);\n }\n }\n\n get isEditorHandlingKeyboard() {\n return (\n this.getActive()?.shouldGetKeyboardEvents() ||\n (this.#selectedEditors.size === 1 &&\n this.firstSelectedEditor.shouldGetKeyboardEvents())\n );\n }\n\n /**\n * Is the current editor the one passed as argument?\n * @param {AnnotationEditor} editor\n * @returns\n */\n isActive(editor) {\n return this.#activeEditor === editor;\n }\n\n /**\n * Get the current active editor.\n * @returns {AnnotationEditor|null}\n */\n getActive() {\n return this.#activeEditor;\n }\n\n /**\n * Get the current editor mode.\n * @returns {number}\n */\n getMode() {\n return this.#mode;\n }\n\n get imageManager() {\n return shadow(this, \"imageManager\", new ImageManager());\n }\n\n getSelectionBoxes(textLayer) {\n if (!textLayer) {\n return null;\n }\n const selection = document.getSelection();\n for (let i = 0, ii = selection.rangeCount; i < ii; i++) {\n if (\n !textLayer.contains(selection.getRangeAt(i).commonAncestorContainer)\n ) {\n return null;\n }\n }\n\n const {\n x: layerX,\n y: layerY,\n width: parentWidth,\n height: parentHeight,\n } = textLayer.getBoundingClientRect();\n\n // We must rotate the boxes because we want to have them in the non-rotated\n // page coordinates.\n let rotator;\n switch (textLayer.getAttribute(\"data-main-rotation\")) {\n case \"90\":\n rotator = (x, y, w, h) => ({\n x: (y - layerY) / parentHeight,\n y: 1 - (x + w - layerX) / parentWidth,\n width: h / parentHeight,\n height: w / parentWidth,\n });\n break;\n case \"180\":\n rotator = (x, y, w, h) => ({\n x: 1 - (x + w - layerX) / parentWidth,\n y: 1 - (y + h - layerY) / parentHeight,\n width: w / parentWidth,\n height: h / parentHeight,\n });\n break;\n case \"270\":\n rotator = (x, y, w, h) => ({\n x: 1 - (y + h - layerY) / parentHeight,\n y: (x - layerX) / parentWidth,\n width: h / parentHeight,\n height: w / parentWidth,\n });\n break;\n default:\n rotator = (x, y, w, h) => ({\n x: (x - layerX) / parentWidth,\n y: (y - layerY) / parentHeight,\n width: w / parentWidth,\n height: h / parentHeight,\n });\n break;\n }\n\n const boxes = [];\n for (let i = 0, ii = selection.rangeCount; i < ii; i++) {\n const range = selection.getRangeAt(i);\n if (range.collapsed) {\n continue;\n }\n for (const { x, y, width, height } of range.getClientRects()) {\n if (width === 0 || height === 0) {\n continue;\n }\n boxes.push(rotator(x, y, width, height));\n }\n }\n return boxes.length === 0 ? null : boxes;\n }\n\n addChangedExistingAnnotation({ annotationElementId, id }) {\n (this.#changedExistingAnnotations ||= new Map()).set(\n annotationElementId,\n id\n );\n }\n\n removeChangedExistingAnnotation({ annotationElementId }) {\n this.#changedExistingAnnotations?.delete(annotationElementId);\n }\n\n renderAnnotationElement(annotation) {\n const editorId = this.#changedExistingAnnotations?.get(annotation.data.id);\n if (!editorId) {\n return;\n }\n const editor = this.#annotationStorage.getRawValue(editorId);\n if (!editor) {\n return;\n }\n if (this.#mode === AnnotationEditorType.NONE && !editor.hasBeenModified) {\n return;\n }\n editor.renderAnnotationElement(annotation);\n }\n\n setMissingCanvas(annotationId, annotationElementId, canvas) {\n const editor = this.#missingCanvases?.get(annotationId);\n if (!editor) {\n return;\n }\n editor.setCanvas(annotationElementId, canvas);\n this.#missingCanvases.delete(annotationId);\n }\n\n addMissingCanvas(annotationId, editor) {\n (this.#missingCanvases ||= new Map()).set(annotationId, editor);\n }\n}\n\nexport {\n AnnotationEditorUIManager,\n bindEvents,\n ColorManager,\n CommandManager,\n KeyboardManager,\n};\n","/* Copyright 2023 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { noContextMenu } from \"../display_utils.js\";\n\nclass AltText {\n #altText = null;\n\n #altTextDecorative = false;\n\n #altTextButton = null;\n\n #altTextButtonLabel = null;\n\n #altTextTooltip = null;\n\n #altTextTooltipTimeout = null;\n\n #altTextWasFromKeyBoard = false;\n\n #badge = null;\n\n #editor = null;\n\n #guessedText = null;\n\n #textWithDisclaimer = null;\n\n #useNewAltTextFlow = false;\n\n static #l10nNewButton = null;\n\n static _l10n = null;\n\n constructor(editor) {\n this.#editor = editor;\n this.#useNewAltTextFlow = editor._uiManager.useNewAltTextFlow;\n\n AltText.#l10nNewButton ||= Object.freeze({\n added: \"pdfjs-editor-new-alt-text-added-button\",\n \"added-label\": \"pdfjs-editor-new-alt-text-added-button-label\",\n missing: \"pdfjs-editor-new-alt-text-missing-button\",\n \"missing-label\": \"pdfjs-editor-new-alt-text-missing-button-label\",\n review: \"pdfjs-editor-new-alt-text-to-review-button\",\n \"review-label\": \"pdfjs-editor-new-alt-text-to-review-button-label\",\n });\n }\n\n static initialize(l10n) {\n AltText._l10n ??= l10n;\n }\n\n async render() {\n const altText = (this.#altTextButton = document.createElement(\"button\"));\n altText.className = \"altText\";\n altText.tabIndex = \"0\";\n\n const label = (this.#altTextButtonLabel = document.createElement(\"span\"));\n altText.append(label);\n\n if (this.#useNewAltTextFlow) {\n altText.classList.add(\"new\");\n altText.setAttribute(\"data-l10n-id\", AltText.#l10nNewButton.missing);\n label.setAttribute(\n \"data-l10n-id\",\n AltText.#l10nNewButton[\"missing-label\"]\n );\n } else {\n altText.setAttribute(\"data-l10n-id\", \"pdfjs-editor-alt-text-button\");\n label.setAttribute(\"data-l10n-id\", \"pdfjs-editor-alt-text-button-label\");\n }\n\n const signal = this.#editor._uiManager._signal;\n altText.addEventListener(\"contextmenu\", noContextMenu, { signal });\n altText.addEventListener(\"pointerdown\", event => event.stopPropagation(), {\n signal,\n });\n\n const onClick = event => {\n event.preventDefault();\n this.#editor._uiManager.editAltText(this.#editor);\n if (this.#useNewAltTextFlow) {\n this.#editor._reportTelemetry({\n action: \"pdfjs.image.alt_text.image_status_label_clicked\",\n data: { label: this.#label },\n });\n }\n };\n altText.addEventListener(\"click\", onClick, { capture: true, signal });\n altText.addEventListener(\n \"keydown\",\n event => {\n if (event.target === altText && event.key === \"Enter\") {\n this.#altTextWasFromKeyBoard = true;\n onClick(event);\n }\n },\n { signal }\n );\n await this.#setState();\n\n return altText;\n }\n\n get #label() {\n return (\n (this.#altText && \"added\") ||\n (this.#altText === null && this.guessedText && \"review\") ||\n \"missing\"\n );\n }\n\n finish() {\n if (!this.#altTextButton) {\n return;\n }\n this.#altTextButton.focus({ focusVisible: this.#altTextWasFromKeyBoard });\n this.#altTextWasFromKeyBoard = false;\n }\n\n isEmpty() {\n if (this.#useNewAltTextFlow) {\n return this.#altText === null;\n }\n return !this.#altText && !this.#altTextDecorative;\n }\n\n hasData() {\n if (this.#useNewAltTextFlow) {\n return this.#altText !== null || !!this.#guessedText;\n }\n return this.isEmpty();\n }\n\n get guessedText() {\n return this.#guessedText;\n }\n\n async setGuessedText(guessedText) {\n if (this.#altText !== null) {\n // The user provided their own alt text, so we don't want to overwrite it.\n return;\n }\n this.#guessedText = guessedText;\n this.#textWithDisclaimer = await AltText._l10n.get(\n \"pdfjs-editor-new-alt-text-generated-alt-text-with-disclaimer\",\n { generatedAltText: guessedText }\n );\n this.#setState();\n }\n\n toggleAltTextBadge(visibility = false) {\n if (!this.#useNewAltTextFlow || this.#altText) {\n this.#badge?.remove();\n this.#badge = null;\n return;\n }\n if (!this.#badge) {\n const badge = (this.#badge = document.createElement(\"div\"));\n badge.className = \"noAltTextBadge\";\n this.#editor.div.append(badge);\n }\n this.#badge.classList.toggle(\"hidden\", !visibility);\n }\n\n serialize(isForCopying) {\n let altText = this.#altText;\n if (!isForCopying && this.#guessedText === altText) {\n altText = this.#textWithDisclaimer;\n }\n return {\n altText,\n decorative: this.#altTextDecorative,\n guessedText: this.#guessedText,\n textWithDisclaimer: this.#textWithDisclaimer,\n };\n }\n\n get data() {\n return {\n altText: this.#altText,\n decorative: this.#altTextDecorative,\n };\n }\n\n /**\n * Set the alt text data.\n */\n set data({\n altText,\n decorative,\n guessedText,\n textWithDisclaimer,\n cancel = false,\n }) {\n if (guessedText) {\n this.#guessedText = guessedText;\n this.#textWithDisclaimer = textWithDisclaimer;\n }\n if (this.#altText === altText && this.#altTextDecorative === decorative) {\n return;\n }\n if (!cancel) {\n this.#altText = altText;\n this.#altTextDecorative = decorative;\n }\n this.#setState();\n }\n\n toggle(enabled = false) {\n if (!this.#altTextButton) {\n return;\n }\n if (!enabled && this.#altTextTooltipTimeout) {\n clearTimeout(this.#altTextTooltipTimeout);\n this.#altTextTooltipTimeout = null;\n }\n this.#altTextButton.disabled = !enabled;\n }\n\n shown() {\n this.#editor._reportTelemetry({\n action: \"pdfjs.image.alt_text.image_status_label_displayed\",\n data: { label: this.#label },\n });\n }\n\n destroy() {\n this.#altTextButton?.remove();\n this.#altTextButton = null;\n this.#altTextButtonLabel = null;\n this.#altTextTooltip = null;\n this.#badge?.remove();\n this.#badge = null;\n }\n\n async #setState() {\n const button = this.#altTextButton;\n if (!button) {\n return;\n }\n\n if (this.#useNewAltTextFlow) {\n button.classList.toggle(\"done\", !!this.#altText);\n button.setAttribute(\"data-l10n-id\", AltText.#l10nNewButton[this.#label]);\n\n this.#altTextButtonLabel?.setAttribute(\n \"data-l10n-id\",\n AltText.#l10nNewButton[`${this.#label}-label`]\n );\n if (!this.#altText) {\n this.#altTextTooltip?.remove();\n return;\n }\n } else {\n if (!this.#altText && !this.#altTextDecorative) {\n button.classList.remove(\"done\");\n this.#altTextTooltip?.remove();\n return;\n }\n button.classList.add(\"done\");\n button.setAttribute(\"data-l10n-id\", \"pdfjs-editor-alt-text-edit-button\");\n }\n\n let tooltip = this.#altTextTooltip;\n if (!tooltip) {\n this.#altTextTooltip = tooltip = document.createElement(\"span\");\n tooltip.className = \"tooltip\";\n tooltip.setAttribute(\"role\", \"tooltip\");\n tooltip.id = `alt-text-tooltip-${this.#editor.id}`;\n\n const DELAY_TO_SHOW_TOOLTIP = 100;\n const signal = this.#editor._uiManager._signal;\n signal.addEventListener(\n \"abort\",\n () => {\n clearTimeout(this.#altTextTooltipTimeout);\n this.#altTextTooltipTimeout = null;\n },\n { once: true }\n );\n button.addEventListener(\n \"mouseenter\",\n () => {\n this.#altTextTooltipTimeout = setTimeout(() => {\n this.#altTextTooltipTimeout = null;\n this.#altTextTooltip.classList.add(\"show\");\n this.#editor._reportTelemetry({\n action: \"alt_text_tooltip\",\n });\n }, DELAY_TO_SHOW_TOOLTIP);\n },\n { signal }\n );\n button.addEventListener(\n \"mouseleave\",\n () => {\n if (this.#altTextTooltipTimeout) {\n clearTimeout(this.#altTextTooltipTimeout);\n this.#altTextTooltipTimeout = null;\n }\n this.#altTextTooltip?.classList.remove(\"show\");\n },\n { signal }\n );\n }\n if (this.#altTextDecorative) {\n tooltip.setAttribute(\n \"data-l10n-id\",\n \"pdfjs-editor-alt-text-decorative-tooltip\"\n );\n } else {\n tooltip.removeAttribute(\"data-l10n-id\");\n tooltip.textContent = this.#altText;\n }\n\n if (!tooltip.parentNode) {\n button.append(tooltip);\n }\n\n const element = this.#editor.getElementForAltText();\n element?.setAttribute(\"aria-describedby\", tooltip.id);\n }\n}\n\nexport { AltText };\n","/* Copyright 2025 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { noContextMenu } from \"../display_utils.js\";\n\nclass Comment {\n #commentButton = null;\n\n #commentWasFromKeyBoard = false;\n\n #editor = null;\n\n #initialText = null;\n\n #text = null;\n\n #date = null;\n\n #deleted = false;\n\n constructor(editor) {\n this.#editor = editor;\n this.toolbar = null;\n }\n\n render() {\n if (!this.#editor._uiManager.hasCommentManager()) {\n return null;\n }\n\n const comment = (this.#commentButton = document.createElement(\"button\"));\n comment.className = \"comment\";\n comment.tabIndex = \"0\";\n comment.setAttribute(\"data-l10n-id\", \"pdfjs-editor-edit-comment-button\");\n\n const signal = this.#editor._uiManager._signal;\n if (!(signal instanceof AbortSignal) || signal.aborted) {\n return comment;\n }\n\n comment.addEventListener(\"contextmenu\", noContextMenu, { signal });\n comment.addEventListener(\"pointerdown\", event => event.stopPropagation(), {\n signal,\n });\n\n const onClick = event => {\n event.preventDefault();\n this.edit();\n };\n comment.addEventListener(\"click\", onClick, { capture: true, signal });\n comment.addEventListener(\n \"keydown\",\n event => {\n if (event.target === comment && event.key === \"Enter\") {\n this.#commentWasFromKeyBoard = true;\n onClick(event);\n }\n },\n { signal }\n );\n\n return comment;\n }\n\n edit() {\n const { bottom, left, right } = this.#editor.getClientDimensions();\n const position = { top: bottom };\n if (this.#editor._uiManager.direction === \"ltr\") {\n position.right = right;\n } else {\n position.left = left;\n }\n this.#editor._uiManager.editComment(this.#editor, position);\n }\n\n finish() {\n if (!this.#commentButton) {\n return;\n }\n this.#commentButton.focus({ focusVisible: this.#commentWasFromKeyBoard });\n this.#commentWasFromKeyBoard = false;\n }\n\n isDeleted() {\n return this.#deleted || this.#text === \"\";\n }\n\n hasBeenEdited() {\n return this.isDeleted() || this.#text !== this.#initialText;\n }\n\n serialize() {\n return this.data;\n }\n\n get data() {\n return {\n text: this.#text,\n date: this.#date,\n deleted: this.#deleted,\n };\n }\n\n /**\n * Set the comment data.\n */\n set data(text) {\n if (text === null) {\n this.#text = \"\";\n this.#deleted = true;\n return;\n }\n this.#text = text;\n this.#date = new Date();\n this.#deleted = false;\n }\n\n setInitialText(text) {\n this.#initialText = text;\n this.data = text;\n }\n\n toggle(enabled = false) {\n if (!this.#commentButton) {\n return;\n }\n this.#commentButton.disabled = !enabled;\n }\n\n shown() {}\n\n destroy() {\n this.#commentButton?.remove();\n this.#commentButton = null;\n this.#text = \"\";\n this.#date = null;\n this.#editor = null;\n this.#commentWasFromKeyBoard = false;\n this.#deleted = false;\n }\n}\n\nexport { Comment };\n","/* Copyright 2024 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 { OutputScale, stopEvent } from \"./display_utils.js\";\n\nclass TouchManager {\n #container;\n\n #isPinching = false;\n\n #isPinchingStopped = null;\n\n #isPinchingDisabled;\n\n #onPinchStart;\n\n #onPinching;\n\n #onPinchEnd;\n\n #pointerDownAC = null;\n\n #signal;\n\n #touchInfo = null;\n\n #touchManagerAC;\n\n #touchMoveAC = null;\n\n constructor({\n container,\n isPinchingDisabled = null,\n isPinchingStopped = null,\n onPinchStart = null,\n onPinching = null,\n onPinchEnd = null,\n signal,\n }) {\n this.#container = container;\n this.#isPinchingStopped = isPinchingStopped;\n this.#isPinchingDisabled = isPinchingDisabled;\n this.#onPinchStart = onPinchStart;\n this.#onPinching = onPinching;\n this.#onPinchEnd = onPinchEnd;\n this.#touchManagerAC = new AbortController();\n this.#signal = AbortSignal.any([signal, this.#touchManagerAC.signal]);\n\n container.addEventListener(\"touchstart\", this.#onTouchStart.bind(this), {\n passive: false,\n signal: this.#signal,\n });\n }\n\n /**\n * NOTE: Don't shadow this value since `devicePixelRatio` may change if the\n * window resolution changes, e.g. if the viewer is moved to another monitor.\n */\n get MIN_TOUCH_DISTANCE_TO_PINCH() {\n // The 35 is coming from:\n // https://searchfox.org/mozilla-central/source/gfx/layers/apz/src/GestureEventListener.cpp#36\n //\n // The properties TouchEvent::screenX/Y are in screen CSS pixels:\n // https://developer.mozilla.org/en-US/docs/Web/API/Touch/screenX#examples\n // MIN_TOUCH_DISTANCE_TO_PINCH is in CSS pixels.\n return 35 / OutputScale.pixelRatio;\n }\n\n #onTouchStart(evt) {\n if (this.#isPinchingDisabled?.()) {\n return;\n }\n\n if (evt.touches.length === 1) {\n if (this.#pointerDownAC) {\n return;\n }\n const pointerDownAC = (this.#pointerDownAC = new AbortController());\n const signal = AbortSignal.any([this.#signal, pointerDownAC.signal]);\n const container = this.#container;\n\n // We want to have the events at the capture phase to make sure we can\n // cancel them.\n const opts = { capture: true, signal, passive: false };\n const cancelPointerDown = e => {\n if (e.pointerType === \"touch\") {\n this.#pointerDownAC?.abort();\n this.#pointerDownAC = null;\n }\n };\n container.addEventListener(\n \"pointerdown\",\n e => {\n if (e.pointerType === \"touch\") {\n // This is the second finger so we don't want it select something\n // or whatever.\n stopEvent(e);\n cancelPointerDown(e);\n }\n },\n opts\n );\n container.addEventListener(\"pointerup\", cancelPointerDown, opts);\n container.addEventListener(\"pointercancel\", cancelPointerDown, opts);\n return;\n }\n\n if (!this.#touchMoveAC) {\n this.#touchMoveAC = new AbortController();\n const signal = AbortSignal.any([this.#signal, this.#touchMoveAC.signal]);\n const container = this.#container;\n\n const opt = { signal, capture: false, passive: false };\n container.addEventListener(\n \"touchmove\",\n this.#onTouchMove.bind(this),\n opt\n );\n const onTouchEnd = this.#onTouchEnd.bind(this);\n container.addEventListener(\"touchend\", onTouchEnd, opt);\n container.addEventListener(\"touchcancel\", onTouchEnd, opt);\n\n opt.capture = true;\n container.addEventListener(\"pointerdown\", stopEvent, opt);\n container.addEventListener(\"pointermove\", stopEvent, opt);\n container.addEventListener(\"pointercancel\", stopEvent, opt);\n container.addEventListener(\"pointerup\", stopEvent, opt);\n this.#onPinchStart?.();\n }\n\n stopEvent(evt);\n\n if (evt.touches.length !== 2 || this.#isPinchingStopped?.()) {\n this.#touchInfo = null;\n return;\n }\n\n let [touch0, touch1] = evt.touches;\n if (touch0.identifier > touch1.identifier) {\n [touch0, touch1] = [touch1, touch0];\n }\n this.#touchInfo = {\n touch0X: touch0.screenX,\n touch0Y: touch0.screenY,\n touch1X: touch1.screenX,\n touch1Y: touch1.screenY,\n };\n }\n\n #onTouchMove(evt) {\n if (!this.#touchInfo || evt.touches.length !== 2) {\n return;\n }\n\n stopEvent(evt);\n\n let [touch0, touch1] = evt.touches;\n if (touch0.identifier > touch1.identifier) {\n [touch0, touch1] = [touch1, touch0];\n }\n const { screenX: screen0X, screenY: screen0Y } = touch0;\n const { screenX: screen1X, screenY: screen1Y } = touch1;\n const touchInfo = this.#touchInfo;\n const {\n touch0X: pTouch0X,\n touch0Y: pTouch0Y,\n touch1X: pTouch1X,\n touch1Y: pTouch1Y,\n } = touchInfo;\n\n const prevGapX = pTouch1X - pTouch0X;\n const prevGapY = pTouch1Y - pTouch0Y;\n const currGapX = screen1X - screen0X;\n const currGapY = screen1Y - screen0Y;\n\n const distance = Math.hypot(currGapX, currGapY) || 1;\n const pDistance = Math.hypot(prevGapX, prevGapY) || 1;\n if (\n !this.#isPinching &&\n Math.abs(pDistance - distance) <= TouchManager.MIN_TOUCH_DISTANCE_TO_PINCH\n ) {\n return;\n }\n\n touchInfo.touch0X = screen0X;\n touchInfo.touch0Y = screen0Y;\n touchInfo.touch1X = screen1X;\n touchInfo.touch1Y = screen1Y;\n\n if (!this.#isPinching) {\n // Start pinching.\n this.#isPinching = true;\n\n // We return here else the first pinch is a bit too much\n return;\n }\n\n const origin = [(screen0X + screen1X) / 2, (screen0Y + screen1Y) / 2];\n this.#onPinching?.(origin, pDistance, distance);\n }\n\n #onTouchEnd(evt) {\n if (evt.touches.length >= 2) {\n return;\n }\n // #touchMoveAC shouldn't be null but it seems that irl it can (see #19793).\n if (this.#touchMoveAC) {\n this.#touchMoveAC.abort();\n this.#touchMoveAC = null;\n this.#onPinchEnd?.();\n }\n\n if (!this.#touchInfo) {\n return;\n }\n stopEvent(evt);\n this.#touchInfo = null;\n this.#isPinching = false;\n }\n\n destroy() {\n this.#touchManagerAC?.abort();\n this.#touchManagerAC = null;\n this.#pointerDownAC?.abort();\n this.#pointerDownAC = null;\n }\n}\n\nexport { TouchManager };\n","/* Copyright 2022 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// eslint-disable-next-line max-len\n/** @typedef {import(\"./annotation_editor_layer.js\").AnnotationEditorLayer} AnnotationEditorLayer */\n\nimport {\n AnnotationEditorUIManager,\n bindEvents,\n ColorManager,\n KeyboardManager,\n} from \"./tools.js\";\nimport {\n FeatureTest,\n MathClamp,\n shadow,\n unreachable,\n} from \"../../shared/util.js\";\nimport { noContextMenu, stopEvent } from \"../display_utils.js\";\nimport { AltText } from \"./alt_text.js\";\nimport { Comment } from \"./comment.js\";\nimport { EditorToolbar } from \"./toolbar.js\";\nimport { TouchManager } from \"../touch_manager.js\";\n\n/**\n * @typedef {Object} AnnotationEditorParameters\n * @property {AnnotationEditorUIManager} uiManager - the global manager\n * @property {AnnotationEditorLayer} parent - the layer containing this editor\n * @property {string} id - editor id\n * @property {number} x - x-coordinate\n * @property {number} y - y-coordinate\n */\n\n/**\n * Base class for editors.\n */\nclass AnnotationEditor {\n #accessibilityData = null;\n\n #allResizerDivs = null;\n\n #altText = null;\n\n #comment = null;\n\n #disabled = false;\n\n #dragPointerId = null;\n\n #dragPointerType = \"\";\n\n #keepAspectRatio = false;\n\n #resizersDiv = null;\n\n #lastPointerCoords = null;\n\n #savedDimensions = null;\n\n #focusAC = null;\n\n #focusedResizerName = \"\";\n\n #hasBeenClicked = false;\n\n #initialRect = null;\n\n #isEditing = false;\n\n #isInEditMode = false;\n\n #isResizerEnabledForKeyboard = false;\n\n #moveInDOMTimeout = null;\n\n #prevDragX = 0;\n\n #prevDragY = 0;\n\n #telemetryTimeouts = null;\n\n #touchManager = null;\n\n isSelected = false;\n\n _isCopy = false;\n\n _editToolbar = null;\n\n _initialOptions = Object.create(null);\n\n _initialData = null;\n\n _isVisible = true;\n\n _uiManager = null;\n\n _focusEventsAllowed = true;\n\n static _l10n = null;\n\n static _l10nResizer = null;\n\n #isDraggable = false;\n\n #zIndex = AnnotationEditor._zIndex++;\n\n static _borderLineWidth = -1;\n\n static _colorManager = new ColorManager();\n\n static _zIndex = 1;\n\n // Time to wait (in ms) before sending the telemetry data.\n // We wait a bit to avoid sending too many requests when changing something\n // like the thickness of a line.\n static _telemetryTimeout = 1000;\n\n static get _resizerKeyboardManager() {\n const resize = AnnotationEditor.prototype._resizeWithKeyboard;\n const small = AnnotationEditorUIManager.TRANSLATE_SMALL;\n const big = AnnotationEditorUIManager.TRANSLATE_BIG;\n\n return shadow(\n this,\n \"_resizerKeyboardManager\",\n new KeyboardManager([\n [[\"ArrowLeft\", \"mac+ArrowLeft\"], resize, { args: [-small, 0] }],\n [\n [\"ctrl+ArrowLeft\", \"mac+shift+ArrowLeft\"],\n resize,\n { args: [-big, 0] },\n ],\n [[\"ArrowRight\", \"mac+ArrowRight\"], resize, { args: [small, 0] }],\n [\n [\"ctrl+ArrowRight\", \"mac+shift+ArrowRight\"],\n resize,\n { args: [big, 0] },\n ],\n [[\"ArrowUp\", \"mac+ArrowUp\"], resize, { args: [0, -small] }],\n [[\"ctrl+ArrowUp\", \"mac+shift+ArrowUp\"], resize, { args: [0, -big] }],\n [[\"ArrowDown\", \"mac+ArrowDown\"], resize, { args: [0, small] }],\n [[\"ctrl+ArrowDown\", \"mac+shift+ArrowDown\"], resize, { args: [0, big] }],\n [\n [\"Escape\", \"mac+Escape\"],\n AnnotationEditor.prototype._stopResizingWithKeyboard,\n ],\n ])\n );\n }\n\n /**\n * @param {AnnotationEditorParameters} parameters\n */\n constructor(parameters) {\n if (\n (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) &&\n this.constructor === AnnotationEditor\n ) {\n unreachable(\"Cannot initialize AnnotationEditor.\");\n }\n\n this.parent = parameters.parent;\n this.id = parameters.id;\n this.width = this.height = null;\n this.pageIndex = parameters.parent.pageIndex;\n this.name = parameters.name;\n this.div = null;\n this._uiManager = parameters.uiManager;\n this.annotationElementId = null;\n this._willKeepAspectRatio = false;\n this._initialOptions.isCentered = parameters.isCentered;\n this._structTreeParentId = null;\n this.annotationElementId = parameters.annotationElementId || null;\n\n const {\n rotation,\n rawDims: { pageWidth, pageHeight, pageX, pageY },\n } = this.parent.viewport;\n\n this.rotation = rotation;\n this.pageRotation =\n (360 + rotation - this._uiManager.viewParameters.rotation) % 360;\n this.pageDimensions = [pageWidth, pageHeight];\n this.pageTranslation = [pageX, pageY];\n\n const [width, height] = this.parentDimensions;\n this.x = parameters.x / width;\n this.y = parameters.y / height;\n\n this.isAttachedToDOM = false;\n this.deleted = false;\n }\n\n get editorType() {\n return Object.getPrototypeOf(this).constructor._type;\n }\n\n get mode() {\n return Object.getPrototypeOf(this).constructor._editorType;\n }\n\n static get isDrawer() {\n return false;\n }\n\n static get _defaultLineColor() {\n return shadow(\n this,\n \"_defaultLineColor\",\n this._colorManager.getHexCode(\"CanvasText\")\n );\n }\n\n static deleteAnnotationElement(editor) {\n const fakeEditor = new FakeEditor({\n id: editor.parent.getNextId(),\n parent: editor.parent,\n uiManager: editor._uiManager,\n });\n fakeEditor.annotationElementId = editor.annotationElementId;\n fakeEditor.deleted = true;\n fakeEditor._uiManager.addToAnnotationStorage(fakeEditor);\n }\n\n /**\n * Initialize the l10n stuff for this type of editor.\n * @param {Object} l10n\n */\n static initialize(l10n, _uiManager) {\n AnnotationEditor._l10n ??= l10n;\n\n AnnotationEditor._l10nResizer ||= Object.freeze({\n topLeft: \"pdfjs-editor-resizer-top-left\",\n topMiddle: \"pdfjs-editor-resizer-top-middle\",\n topRight: \"pdfjs-editor-resizer-top-right\",\n middleRight: \"pdfjs-editor-resizer-middle-right\",\n bottomRight: \"pdfjs-editor-resizer-bottom-right\",\n bottomMiddle: \"pdfjs-editor-resizer-bottom-middle\",\n bottomLeft: \"pdfjs-editor-resizer-bottom-left\",\n middleLeft: \"pdfjs-editor-resizer-middle-left\",\n });\n\n if (AnnotationEditor._borderLineWidth !== -1) {\n return;\n }\n const style = getComputedStyle(document.documentElement);\n AnnotationEditor._borderLineWidth =\n parseFloat(style.getPropertyValue(\"--outline-width\")) || 0;\n }\n\n /**\n * Update the default parameters for this type of editor.\n * @param {number} _type\n * @param {*} _value\n */\n static updateDefaultParams(_type, _value) {}\n\n /**\n * Get the default properties to set in the UI for this type of editor.\n * @returns {Array}\n */\n static get defaultPropertiesToUpdate() {\n return [];\n }\n\n /**\n * Check if this kind of editor is able to handle the given mime type for\n * pasting.\n * @param {string} mime\n * @returns {boolean}\n */\n static isHandlingMimeForPasting(mime) {\n return false;\n }\n\n /**\n * Extract the data from the clipboard item and delegate the creation of the\n * editor to the parent.\n * @param {DataTransferItem} item\n * @param {AnnotationEditorLayer} parent\n */\n static paste(item, parent) {\n unreachable(\"Not implemented\");\n }\n\n /**\n * Get the properties to update in the UI for this editor.\n * @returns {Array}\n */\n get propertiesToUpdate() {\n return [];\n }\n\n get _isDraggable() {\n return this.#isDraggable;\n }\n\n set _isDraggable(value) {\n this.#isDraggable = value;\n this.div?.classList.toggle(\"draggable\", value);\n }\n\n /**\n * @returns {boolean} true if the editor handles the Enter key itself.\n */\n get isEnterHandled() {\n return true;\n }\n\n center() {\n const [pageWidth, pageHeight] = this.pageDimensions;\n switch (this.parentRotation) {\n case 90:\n this.x -= (this.height * pageHeight) / (pageWidth * 2);\n this.y += (this.width * pageWidth) / (pageHeight * 2);\n break;\n case 180:\n this.x += this.width / 2;\n this.y += this.height / 2;\n break;\n case 270:\n this.x += (this.height * pageHeight) / (pageWidth * 2);\n this.y -= (this.width * pageWidth) / (pageHeight * 2);\n break;\n default:\n this.x -= this.width / 2;\n this.y -= this.height / 2;\n break;\n }\n this.fixAndSetPosition();\n }\n\n /**\n * Add some commands into the CommandManager (undo/redo stuff).\n * @param {Object} params\n */\n addCommands(params) {\n this._uiManager.addCommands(params);\n }\n\n get currentLayer() {\n return this._uiManager.currentLayer;\n }\n\n /**\n * This editor will be behind the others.\n */\n setInBackground() {\n this.div.style.zIndex = 0;\n }\n\n /**\n * This editor will be in the foreground.\n */\n setInForeground() {\n this.div.style.zIndex = this.#zIndex;\n }\n\n setParent(parent) {\n if (parent !== null) {\n this.pageIndex = parent.pageIndex;\n this.pageDimensions = parent.pageDimensions;\n } else {\n // The editor is being removed from the DOM, so we need to stop resizing.\n this.#stopResizing();\n }\n this.parent = parent;\n }\n\n /**\n * onfocus callback.\n */\n focusin(event) {\n if (!this._focusEventsAllowed) {\n return;\n }\n if (!this.#hasBeenClicked) {\n this.parent.setSelected(this);\n } else {\n this.#hasBeenClicked = false;\n }\n }\n\n /**\n * onblur callback.\n * @param {FocusEvent} event\n */\n focusout(event) {\n if (!this._focusEventsAllowed) {\n return;\n }\n\n if (!this.isAttachedToDOM) {\n return;\n }\n\n // In case of focusout, the relatedTarget is the element which\n // is grabbing the focus.\n // So if the related target is an element under the div for this\n // editor, then the editor isn't unactive.\n const target = event.relatedTarget;\n if (target?.closest(`#${this.id}`)) {\n return;\n }\n\n event.preventDefault();\n\n if (!this.parent?.isMultipleSelection) {\n this.commitOrRemove();\n }\n }\n\n commitOrRemove() {\n if (this.isEmpty()) {\n this.remove();\n } else {\n this.commit();\n }\n }\n\n /**\n * Commit the data contained in this editor.\n */\n commit() {\n if (!this.isInEditMode()) {\n return;\n }\n this.addToAnnotationStorage();\n }\n\n addToAnnotationStorage() {\n this._uiManager.addToAnnotationStorage(this);\n }\n\n /**\n * Set the editor position within its parent.\n * @param {number} x\n * @param {number} y\n * @param {number} tx - x-translation in screen coordinates.\n * @param {number} ty - y-translation in screen coordinates.\n */\n setAt(x, y, tx, ty) {\n const [width, height] = this.parentDimensions;\n [tx, ty] = this.screenToPageTranslation(tx, ty);\n\n this.x = (x + tx) / width;\n this.y = (y + ty) / height;\n\n this.fixAndSetPosition();\n }\n\n _moveAfterPaste(baseX, baseY) {\n const [parentWidth, parentHeight] = this.parentDimensions;\n this.setAt(\n baseX * parentWidth,\n baseY * parentHeight,\n this.width * parentWidth,\n this.height * parentHeight\n );\n this._onTranslated();\n }\n\n #translate([width, height], x, y) {\n [x, y] = this.screenToPageTranslation(x, y);\n\n this.x += x / width;\n this.y += y / height;\n\n this._onTranslating(this.x, this.y);\n\n this.fixAndSetPosition();\n }\n\n /**\n * Translate the editor position within its parent.\n * @param {number} x - x-translation in screen coordinates.\n * @param {number} y - y-translation in screen coordinates.\n */\n translate(x, y) {\n // We don't change the initial position because the move here hasn't been\n // done by the user.\n this.#translate(this.parentDimensions, x, y);\n }\n\n /**\n * Translate the editor position within its page and adjust the scroll\n * in order to have the editor in the view.\n * @param {number} x - x-translation in page coordinates.\n * @param {number} y - y-translation in page coordinates.\n */\n translateInPage(x, y) {\n this.#initialRect ||= [this.x, this.y, this.width, this.height];\n this.#translate(this.pageDimensions, x, y);\n this.div.scrollIntoView({ block: \"nearest\" });\n }\n\n translationDone() {\n this._onTranslated(this.x, this.y);\n }\n\n drag(tx, ty) {\n this.#initialRect ||= [this.x, this.y, this.width, this.height];\n const {\n div,\n parentDimensions: [parentWidth, parentHeight],\n } = this;\n this.x += tx / parentWidth;\n this.y += ty / parentHeight;\n if (this.parent && (this.x < 0 || this.x > 1 || this.y < 0 || this.y > 1)) {\n // It's possible to not have a parent: for example, when the user is\n // dragging all the selected editors but this one on a page which has been\n // destroyed.\n // It's why we need to check for it. In such a situation, it isn't really\n // a problem to not find a new parent: it's something which is related to\n // what the user is seeing, hence it depends on how pages are layed out.\n\n // The element will be outside of its parent so change the parent.\n const { x, y } = this.div.getBoundingClientRect();\n if (this.parent.findNewParent(this, x, y)) {\n this.x -= Math.floor(this.x);\n this.y -= Math.floor(this.y);\n }\n }\n\n // The editor can be moved wherever the user wants, so we don't need to fix\n // the position: it'll be done when the user will release the mouse button.\n\n let { x, y } = this;\n const [bx, by] = this.getBaseTranslation();\n x += bx;\n y += by;\n\n const { style } = div;\n style.left = `${(100 * x).toFixed(2)}%`;\n style.top = `${(100 * y).toFixed(2)}%`;\n\n this._onTranslating(x, y);\n\n div.scrollIntoView({ block: \"nearest\" });\n }\n\n /**\n * Called when the editor is being translated.\n * @param {number} x - in page coordinates.\n * @param {number} y - in page coordinates.\n */\n _onTranslating(x, y) {}\n\n /**\n * Called when the editor has been translated.\n * @param {number} x - in page coordinates.\n * @param {number} y - in page coordinates.\n */\n _onTranslated(x, y) {}\n\n get _hasBeenMoved() {\n return (\n !!this.#initialRect &&\n (this.#initialRect[0] !== this.x || this.#initialRect[1] !== this.y)\n );\n }\n\n get _hasBeenResized() {\n return (\n !!this.#initialRect &&\n (this.#initialRect[2] !== this.width ||\n this.#initialRect[3] !== this.height)\n );\n }\n\n /**\n * Get the translation to take into account the editor border.\n * The CSS engine positions the element by taking the border into account so\n * we must apply the opposite translation to have the editor in the right\n * position.\n * @returns {Array<number>}\n */\n getBaseTranslation() {\n const [parentWidth, parentHeight] = this.parentDimensions;\n const { _borderLineWidth } = AnnotationEditor;\n const x = _borderLineWidth / parentWidth;\n const y = _borderLineWidth / parentHeight;\n switch (this.rotation) {\n case 90:\n return [-x, y];\n case 180:\n return [x, y];\n case 270:\n return [x, -y];\n default:\n return [-x, -y];\n }\n }\n\n /**\n * @returns {boolean} true if position must be fixed (i.e. make the x and y\n * living in the page).\n */\n get _mustFixPosition() {\n return true;\n }\n\n /**\n * Fix the position of the editor in order to keep it inside its parent page.\n * @param {number} [rotation] - the rotation of the page.\n */\n fixAndSetPosition(rotation = this.rotation) {\n const {\n div: { style },\n pageDimensions: [pageWidth, pageHeight],\n } = this;\n let { x, y, width, height } = this;\n width *= pageWidth;\n height *= pageHeight;\n x *= pageWidth;\n y *= pageHeight;\n\n if (this._mustFixPosition) {\n switch (rotation) {\n case 0:\n x = MathClamp(x, 0, pageWidth - width);\n y = MathClamp(y, 0, pageHeight - height);\n break;\n case 90:\n x = MathClamp(x, 0, pageWidth - height);\n y = MathClamp(y, width, pageHeight);\n break;\n case 180:\n x = MathClamp(x, width, pageWidth);\n y = MathClamp(y, height, pageHeight);\n break;\n case 270:\n x = MathClamp(x, height, pageWidth);\n y = MathClamp(y, 0, pageHeight - width);\n break;\n }\n }\n\n this.x = x /= pageWidth;\n this.y = y /= pageHeight;\n\n const [bx, by] = this.getBaseTranslation();\n x += bx;\n y += by;\n\n style.left = `${(100 * x).toFixed(2)}%`;\n style.top = `${(100 * y).toFixed(2)}%`;\n\n this.moveInDOM();\n }\n\n static #rotatePoint(x, y, angle) {\n switch (angle) {\n case 90:\n return [y, -x];\n case 180:\n return [-x, -y];\n case 270:\n return [-y, x];\n default:\n return [x, y];\n }\n }\n\n /**\n * Convert a screen translation into a page one.\n * @param {number} x\n * @param {number} y\n */\n screenToPageTranslation(x, y) {\n return AnnotationEditor.#rotatePoint(x, y, this.parentRotation);\n }\n\n /**\n * Convert a page translation into a screen one.\n * @param {number} x\n * @param {number} y\n */\n pageTranslationToScreen(x, y) {\n return AnnotationEditor.#rotatePoint(x, y, 360 - this.parentRotation);\n }\n\n #getRotationMatrix(rotation) {\n switch (rotation) {\n case 90: {\n const [pageWidth, pageHeight] = this.pageDimensions;\n return [0, -pageWidth / pageHeight, pageHeight / pageWidth, 0];\n }\n case 180:\n return [-1, 0, 0, -1];\n case 270: {\n const [pageWidth, pageHeight] = this.pageDimensions;\n return [0, pageWidth / pageHeight, -pageHeight / pageWidth, 0];\n }\n default:\n return [1, 0, 0, 1];\n }\n }\n\n get parentScale() {\n return this._uiManager.viewParameters.realScale;\n }\n\n get parentRotation() {\n return (this._uiManager.viewParameters.rotation + this.pageRotation) % 360;\n }\n\n get parentDimensions() {\n const {\n parentScale,\n pageDimensions: [pageWidth, pageHeight],\n } = this;\n return [pageWidth * parentScale, pageHeight * parentScale];\n }\n\n /**\n * Set the dimensions of this editor.\n * @param {number} width\n * @param {number} height\n */\n setDims(width, height) {\n const [parentWidth, parentHeight] = this.parentDimensions;\n const { style } = this.div;\n style.width = `${((100 * width) / parentWidth).toFixed(2)}%`;\n if (!this.#keepAspectRatio) {\n style.height = `${((100 * height) / parentHeight).toFixed(2)}%`;\n }\n }\n\n fixDims() {\n const { style } = this.div;\n const { height, width } = style;\n const widthPercent = width.endsWith(\"%\");\n const heightPercent = !this.#keepAspectRatio && height.endsWith(\"%\");\n if (widthPercent && heightPercent) {\n return;\n }\n\n const [parentWidth, parentHeight] = this.parentDimensions;\n if (!widthPercent) {\n style.width = `${((100 * parseFloat(width)) / parentWidth).toFixed(2)}%`;\n }\n if (!this.#keepAspectRatio && !heightPercent) {\n style.height = `${((100 * parseFloat(height)) / parentHeight).toFixed(2)}%`;\n }\n }\n\n /**\n * Get the translation used to position this editor when it's created.\n * @returns {Array<number>}\n */\n getInitialTranslation() {\n return [0, 0];\n }\n\n #createResizers() {\n if (this.#resizersDiv) {\n return;\n }\n this.#resizersDiv = document.createElement(\"div\");\n this.#resizersDiv.classList.add(\"resizers\");\n // When the resizers are used with the keyboard, they're focusable, hence\n // we want to have them in this order (top left, top middle, top right, ...)\n // in the DOM to have the focus order correct.\n const classes = this._willKeepAspectRatio\n ? [\"topLeft\", \"topRight\", \"bottomRight\", \"bottomLeft\"]\n : [\n \"topLeft\",\n \"topMiddle\",\n \"topRight\",\n \"middleRight\",\n \"bottomRight\",\n \"bottomMiddle\",\n \"bottomLeft\",\n \"middleLeft\",\n ];\n const signal = this._uiManager._signal;\n for (const name of classes) {\n const div = document.createElement(\"div\");\n this.#resizersDiv.append(div);\n div.classList.add(\"resizer\", name);\n div.setAttribute(\"data-resizer-name\", name);\n div.addEventListener(\n \"pointerdown\",\n this.#resizerPointerdown.bind(this, name),\n { signal }\n );\n div.addEventListener(\"contextmenu\", noContextMenu, { signal });\n div.tabIndex = -1;\n }\n this.div.prepend(this.#resizersDiv);\n }\n\n #resizerPointerdown(name, event) {\n event.preventDefault();\n const { isMac } = FeatureTest.platform;\n if (event.button !== 0 || (event.ctrlKey && isMac)) {\n return;\n }\n\n this.#altText?.toggle(false);\n\n const savedDraggable = this._isDraggable;\n this._isDraggable = false;\n this.#lastPointerCoords = [event.screenX, event.screenY];\n\n const ac = new AbortController();\n const signal = this._uiManager.combinedSignal(ac);\n\n this.parent.togglePointerEvents(false);\n window.addEventListener(\n \"pointermove\",\n this.#resizerPointermove.bind(this, name),\n { passive: true, capture: true, signal }\n );\n window.addEventListener(\n \"touchmove\",\n stopEvent /* Prevent the page from scrolling */,\n { passive: false, signal }\n );\n window.addEventListener(\"contextmenu\", noContextMenu, { signal });\n this.#savedDimensions = {\n savedX: this.x,\n savedY: this.y,\n savedWidth: this.width,\n savedHeight: this.height,\n };\n const savedParentCursor = this.parent.div.style.cursor;\n const savedCursor = this.div.style.cursor;\n this.div.style.cursor = this.parent.div.style.cursor =\n window.getComputedStyle(event.target).cursor;\n\n const pointerUpCallback = () => {\n ac.abort();\n this.parent.togglePointerEvents(true);\n this.#altText?.toggle(true);\n this._isDraggable = savedDraggable;\n this.parent.div.style.cursor = savedParentCursor;\n this.div.style.cursor = savedCursor;\n\n this.#addResizeToUndoStack();\n };\n window.addEventListener(\"pointerup\", pointerUpCallback, { signal });\n // If the user switches to another window (with alt+tab), then we end the\n // resize session.\n window.addEventListener(\"blur\", pointerUpCallback, { signal });\n }\n\n #resize(x, y, width, height) {\n this.width = width;\n this.height = height;\n this.x = x;\n this.y = y;\n const [parentWidth, parentHeight] = this.parentDimensions;\n this.setDims(parentWidth * width, parentHeight * height);\n this.fixAndSetPosition();\n this._onResized();\n }\n\n /**\n * Called when the editor has been resized.\n */\n _onResized() {}\n\n #addResizeToUndoStack() {\n if (!this.#savedDimensions) {\n return;\n }\n const { savedX, savedY, savedWidth, savedHeight } = this.#savedDimensions;\n this.#savedDimensions = null;\n\n const newX = this.x;\n const newY = this.y;\n const newWidth = this.width;\n const newHeight = this.height;\n if (\n newX === savedX &&\n newY === savedY &&\n newWidth === savedWidth &&\n newHeight === savedHeight\n ) {\n return;\n }\n\n this.addCommands({\n cmd: this.#resize.bind(this, newX, newY, newWidth, newHeight),\n undo: this.#resize.bind(this, savedX, savedY, savedWidth, savedHeight),\n mustExec: true,\n });\n }\n\n static _round(x) {\n // 10000 because we multiply by 100 and use toFixed(2) in fixAndSetPosition.\n // Without rounding, the positions of the corners other than the top left\n // one can be slightly wrong.\n return Math.round(x * 10000) / 10000;\n }\n\n #resizerPointermove(name, event) {\n const [parentWidth, parentHeight] = this.parentDimensions;\n const savedX = this.x;\n const savedY = this.y;\n const savedWidth = this.width;\n const savedHeight = this.height;\n const minWidth = AnnotationEditor.MIN_SIZE / parentWidth;\n const minHeight = AnnotationEditor.MIN_SIZE / parentHeight;\n\n const rotationMatrix = this.#getRotationMatrix(this.rotation);\n const transf = (x, y) => [\n rotationMatrix[0] * x + rotationMatrix[2] * y,\n rotationMatrix[1] * x + rotationMatrix[3] * y,\n ];\n const invRotationMatrix = this.#getRotationMatrix(360 - this.rotation);\n const invTransf = (x, y) => [\n invRotationMatrix[0] * x + invRotationMatrix[2] * y,\n invRotationMatrix[1] * x + invRotationMatrix[3] * y,\n ];\n let getPoint;\n let getOpposite;\n let isDiagonal = false;\n let isHorizontal = false;\n\n switch (name) {\n case \"topLeft\":\n isDiagonal = true;\n getPoint = (w, h) => [0, 0];\n getOpposite = (w, h) => [w, h];\n break;\n case \"topMiddle\":\n getPoint = (w, h) => [w / 2, 0];\n getOpposite = (w, h) => [w / 2, h];\n break;\n case \"topRight\":\n isDiagonal = true;\n getPoint = (w, h) => [w, 0];\n getOpposite = (w, h) => [0, h];\n break;\n case \"middleRight\":\n isHorizontal = true;\n getPoint = (w, h) => [w, h / 2];\n getOpposite = (w, h) => [0, h / 2];\n break;\n case \"bottomRight\":\n isDiagonal = true;\n getPoint = (w, h) => [w, h];\n getOpposite = (w, h) => [0, 0];\n break;\n case \"bottomMiddle\":\n getPoint = (w, h) => [w / 2, h];\n getOpposite = (w, h) => [w / 2, 0];\n break;\n case \"bottomLeft\":\n isDiagonal = true;\n getPoint = (w, h) => [0, h];\n getOpposite = (w, h) => [w, 0];\n break;\n case \"middleLeft\":\n isHorizontal = true;\n getPoint = (w, h) => [0, h / 2];\n getOpposite = (w, h) => [w, h / 2];\n break;\n }\n\n const point = getPoint(savedWidth, savedHeight);\n const oppositePoint = getOpposite(savedWidth, savedHeight);\n let transfOppositePoint = transf(...oppositePoint);\n const oppositeX = AnnotationEditor._round(savedX + transfOppositePoint[0]);\n const oppositeY = AnnotationEditor._round(savedY + transfOppositePoint[1]);\n let ratioX = 1;\n let ratioY = 1;\n\n let deltaX, deltaY;\n\n if (!event.fromKeyboard) {\n // We can't use event.movementX/Y because they're not reliable:\n // https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/movementX\n // (it was buggy on a laptop with a touch screen).\n const { screenX, screenY } = event;\n const [lastScreenX, lastScreenY] = this.#lastPointerCoords;\n [deltaX, deltaY] = this.screenToPageTranslation(\n screenX - lastScreenX,\n screenY - lastScreenY\n );\n this.#lastPointerCoords[0] = screenX;\n this.#lastPointerCoords[1] = screenY;\n } else {\n ({ deltaX, deltaY } = event);\n }\n [deltaX, deltaY] = invTransf(deltaX / parentWidth, deltaY / parentHeight);\n\n if (isDiagonal) {\n const oldDiag = Math.hypot(savedWidth, savedHeight);\n ratioX = ratioY = Math.max(\n Math.min(\n Math.hypot(\n oppositePoint[0] - point[0] - deltaX,\n oppositePoint[1] - point[1] - deltaY\n ) / oldDiag,\n // Avoid the editor to be larger than the page.\n 1 / savedWidth,\n 1 / savedHeight\n ),\n // Avoid the editor to be smaller than the minimum size.\n minWidth / savedWidth,\n minHeight / savedHeight\n );\n } else if (isHorizontal) {\n ratioX =\n MathClamp(Math.abs(oppositePoint[0] - point[0] - deltaX), minWidth, 1) /\n savedWidth;\n } else {\n ratioY =\n MathClamp(\n Math.abs(oppositePoint[1] - point[1] - deltaY),\n minHeight,\n 1\n ) / savedHeight;\n }\n\n const newWidth = AnnotationEditor._round(savedWidth * ratioX);\n const newHeight = AnnotationEditor._round(savedHeight * ratioY);\n transfOppositePoint = transf(...getOpposite(newWidth, newHeight));\n const newX = oppositeX - transfOppositePoint[0];\n const newY = oppositeY - transfOppositePoint[1];\n\n this.#initialRect ||= [this.x, this.y, this.width, this.height];\n this.width = newWidth;\n this.height = newHeight;\n this.x = newX;\n this.y = newY;\n\n this.setDims(parentWidth * newWidth, parentHeight * newHeight);\n this.fixAndSetPosition();\n\n this._onResizing();\n }\n\n /**\n * Called when the editor is being resized.\n */\n _onResizing() {}\n\n /**\n * Called when the alt text dialog is closed.\n */\n altTextFinish() {\n this.#altText?.finish();\n }\n\n /**\n * Get the toolbar buttons for this editor.\n * @returns {Array<Array<string|object|null>>|null}\n */\n get toolbarButtons() {\n return null;\n }\n\n /**\n * Add a toolbar for this editor.\n * @returns {Promise<EditorToolbar|null>}\n */\n async addEditToolbar() {\n if (this._editToolbar || this.#isInEditMode) {\n return this._editToolbar;\n }\n this._editToolbar = new EditorToolbar(this);\n this.div.append(this._editToolbar.render());\n const { toolbarButtons } = this;\n if (toolbarButtons) {\n for (const [name, tool] of toolbarButtons) {\n await this._editToolbar.addButton(name, tool);\n }\n }\n this._editToolbar.addButton(\"comment\", this.addCommentButton());\n this._editToolbar.addButton(\"delete\");\n\n return this._editToolbar;\n }\n\n removeEditToolbar() {\n if (!this._editToolbar) {\n return;\n }\n this._editToolbar.remove();\n this._editToolbar = null;\n\n // We destroy the alt text but we don't null it because we want to be able\n // to restore it in case the user undoes the deletion.\n this.#altText?.destroy();\n }\n\n addContainer(container) {\n const editToolbarDiv = this._editToolbar?.div;\n if (editToolbarDiv) {\n editToolbarDiv.before(container);\n } else {\n this.div.append(container);\n }\n }\n\n getClientDimensions() {\n return this.div.getBoundingClientRect();\n }\n\n /**\n * Create the alt text for this editor.\n * @returns {object}\n */\n createAltText() {\n if (!this.#altText) {\n AltText.initialize(AnnotationEditor._l10n);\n this.#altText = new AltText(this);\n if (this.#accessibilityData) {\n this.#altText.data = this.#accessibilityData;\n this.#accessibilityData = null;\n }\n }\n return this.#altText;\n }\n\n get altTextData() {\n return this.#altText?.data;\n }\n\n /**\n * Set the alt text data.\n */\n set altTextData(data) {\n if (!this.#altText) {\n return;\n }\n this.#altText.data = data;\n }\n\n get guessedAltText() {\n return this.#altText?.guessedText;\n }\n\n async setGuessedAltText(text) {\n await this.#altText?.setGuessedText(text);\n }\n\n serializeAltText(isForCopying) {\n return this.#altText?.serialize(isForCopying);\n }\n\n hasAltText() {\n return !!this.#altText && !this.#altText.isEmpty();\n }\n\n hasAltTextData() {\n return this.#altText?.hasData() ?? false;\n }\n\n addCommentButton() {\n if (this.#comment) {\n return this.#comment;\n }\n return (this.#comment = new Comment(this));\n }\n\n get commentColor() {\n return null;\n }\n\n get comment() {\n const comment = this.#comment;\n return {\n text: comment.data.text,\n date: comment.data.date,\n deleted: comment.isDeleted(),\n color: this.commentColor,\n };\n }\n\n set comment(text) {\n if (!this.#comment) {\n this.#comment = new Comment(this);\n }\n this.#comment.data = text;\n }\n\n setCommentData(text) {\n if (!this.#comment) {\n this.#comment = new Comment(this);\n }\n this.#comment.setInitialText(text);\n }\n\n get hasEditedComment() {\n return this.#comment?.hasBeenEdited();\n }\n\n async editComment() {\n if (!this.#comment) {\n this.#comment = new Comment(this);\n }\n this.#comment.edit();\n }\n\n addComment(serialized) {\n if (this.hasEditedComment) {\n const DEFAULT_POPUP_WIDTH = 180;\n const DEFAULT_POPUP_HEIGHT = 100;\n const [, , , trY] = serialized.rect;\n const [pageWidth] = this.pageDimensions;\n const [pageX] = this.pageTranslation;\n const blX = pageX + pageWidth + 1;\n const blY = trY - DEFAULT_POPUP_HEIGHT;\n const trX = blX + DEFAULT_POPUP_WIDTH;\n serialized.popup = {\n contents: this.comment.text,\n deleted: this.comment.deleted,\n rect: [blX, blY, trX, trY],\n };\n }\n }\n\n /**\n * Render this editor in a div.\n * @returns {HTMLDivElement | null}\n */\n render() {\n const div = (this.div = document.createElement(\"div\"));\n div.setAttribute(\"data-editor-rotation\", (360 - this.rotation) % 360);\n div.className = this.name;\n div.setAttribute(\"id\", this.id);\n div.tabIndex = this.#disabled ? -1 : 0;\n div.setAttribute(\"role\", \"application\");\n if (this.defaultL10nId) {\n div.setAttribute(\"data-l10n-id\", this.defaultL10nId);\n }\n if (!this._isVisible) {\n div.classList.add(\"hidden\");\n }\n\n this.setInForeground();\n this.#addFocusListeners();\n\n const [parentWidth, parentHeight] = this.parentDimensions;\n if (this.parentRotation % 180 !== 0) {\n div.style.maxWidth = `${((100 * parentHeight) / parentWidth).toFixed(\n 2\n )}%`;\n div.style.maxHeight = `${((100 * parentWidth) / parentHeight).toFixed(\n 2\n )}%`;\n }\n\n const [tx, ty] = this.getInitialTranslation();\n this.translate(tx, ty);\n\n bindEvents(this, div, [\"keydown\", \"pointerdown\", \"dblclick\"]);\n\n if (this.isResizable && this._uiManager._supportsPinchToZoom) {\n this.#touchManager ||= new TouchManager({\n container: div,\n isPinchingDisabled: () => !this.isSelected,\n onPinchStart: this.#touchPinchStartCallback.bind(this),\n onPinching: this.#touchPinchCallback.bind(this),\n onPinchEnd: this.#touchPinchEndCallback.bind(this),\n signal: this._uiManager._signal,\n });\n }\n\n this._uiManager._editorUndoBar?.hide();\n\n return div;\n }\n\n #touchPinchStartCallback() {\n this.#savedDimensions = {\n savedX: this.x,\n savedY: this.y,\n savedWidth: this.width,\n savedHeight: this.height,\n };\n this.#altText?.toggle(false);\n this.parent.togglePointerEvents(false);\n }\n\n #touchPinchCallback(_origin, prevDistance, distance) {\n // Slightly slow down the zooming because the editor could be small and the\n // user could have difficulties to rescale it as they want.\n const slowDownFactor = 0.7;\n let factor =\n slowDownFactor * (distance / prevDistance) + 1 - slowDownFactor;\n if (factor === 1) {\n return;\n }\n\n const rotationMatrix = this.#getRotationMatrix(this.rotation);\n const transf = (x, y) => [\n rotationMatrix[0] * x + rotationMatrix[2] * y,\n rotationMatrix[1] * x + rotationMatrix[3] * y,\n ];\n\n // The center of the editor is the fixed point.\n const [parentWidth, parentHeight] = this.parentDimensions;\n const savedX = this.x;\n const savedY = this.y;\n const savedWidth = this.width;\n const savedHeight = this.height;\n\n const minWidth = AnnotationEditor.MIN_SIZE / parentWidth;\n const minHeight = AnnotationEditor.MIN_SIZE / parentHeight;\n factor = Math.max(\n Math.min(factor, 1 / savedWidth, 1 / savedHeight),\n minWidth / savedWidth,\n minHeight / savedHeight\n );\n const newWidth = AnnotationEditor._round(savedWidth * factor);\n const newHeight = AnnotationEditor._round(savedHeight * factor);\n if (newWidth === savedWidth && newHeight === savedHeight) {\n return;\n }\n\n this.#initialRect ||= [savedX, savedY, savedWidth, savedHeight];\n const transfCenterPoint = transf(savedWidth / 2, savedHeight / 2);\n const centerX = AnnotationEditor._round(savedX + transfCenterPoint[0]);\n const centerY = AnnotationEditor._round(savedY + transfCenterPoint[1]);\n const newTransfCenterPoint = transf(newWidth / 2, newHeight / 2);\n\n this.x = centerX - newTransfCenterPoint[0];\n this.y = centerY - newTransfCenterPoint[1];\n this.width = newWidth;\n this.height = newHeight;\n\n this.setDims(parentWidth * newWidth, parentHeight * newHeight);\n this.fixAndSetPosition();\n\n this._onResizing();\n }\n\n #touchPinchEndCallback() {\n this.#altText?.toggle(true);\n this.parent.togglePointerEvents(true);\n this.#addResizeToUndoStack();\n }\n\n /**\n * Onpointerdown callback.\n * @param {PointerEvent} event\n */\n pointerdown(event) {\n const { isMac } = FeatureTest.platform;\n if (event.button !== 0 || (event.ctrlKey && isMac)) {\n // Avoid to focus this editor because of a non-left click.\n event.preventDefault();\n return;\n }\n this.#hasBeenClicked = true;\n\n if (this._isDraggable) {\n this.#setUpDragSession(event);\n return;\n }\n\n this.#selectOnPointerEvent(event);\n }\n\n #selectOnPointerEvent(event) {\n const { isMac } = FeatureTest.platform;\n if (\n (event.ctrlKey && !isMac) ||\n event.shiftKey ||\n (event.metaKey && isMac)\n ) {\n this.parent.toggleSelected(this);\n } else {\n this.parent.setSelected(this);\n }\n }\n\n #setUpDragSession(event) {\n const { isSelected } = this;\n this._uiManager.setUpDragSession();\n let hasDraggingStarted = false;\n\n const ac = new AbortController();\n const signal = this._uiManager.combinedSignal(ac);\n const opts = { capture: true, passive: false, signal };\n const cancelDrag = e => {\n ac.abort();\n\n this.#dragPointerId = null;\n this.#hasBeenClicked = false;\n if (!this._uiManager.endDragSession()) {\n this.#selectOnPointerEvent(e);\n }\n if (hasDraggingStarted) {\n this._onStopDragging();\n }\n };\n\n if (isSelected) {\n this.#prevDragX = event.clientX;\n this.#prevDragY = event.clientY;\n this.#dragPointerId = event.pointerId;\n this.#dragPointerType = event.pointerType;\n window.addEventListener(\n \"pointermove\",\n e => {\n if (!hasDraggingStarted) {\n hasDraggingStarted = true;\n this._onStartDragging();\n }\n const { clientX: x, clientY: y, pointerId } = e;\n if (pointerId !== this.#dragPointerId) {\n stopEvent(e);\n return;\n }\n const [tx, ty] = this.screenToPageTranslation(\n x - this.#prevDragX,\n y - this.#prevDragY\n );\n this.#prevDragX = x;\n this.#prevDragY = y;\n this._uiManager.dragSelectedEditors(tx, ty);\n },\n opts\n );\n window.addEventListener(\n \"touchmove\",\n stopEvent /* Prevent the page from scrolling */,\n opts\n );\n window.addEventListener(\n \"pointerdown\",\n // If the user drags with one finger and then clicks with another.\n e => {\n if (e.pointerType === this.#dragPointerType) {\n // We've a pinch to zoom session.\n // We cannot have two primaries at the same time.\n // It's possible to be in this state with Firefox and Gnome when\n // trying to drag with three fingers (see bug 1933716).\n if (this.#touchManager || e.isPrimary) {\n cancelDrag(e);\n }\n }\n stopEvent(e);\n },\n opts\n );\n }\n\n const pointerUpCallback = e => {\n if (!this.#dragPointerId || this.#dragPointerId === e.pointerId) {\n cancelDrag(e);\n return;\n }\n stopEvent(e);\n };\n window.addEventListener(\"pointerup\", pointerUpCallback, { signal });\n // If the user is using alt+tab during the dragging session, the pointerup\n // event could be not fired, but a blur event is fired so we can use it in\n // order to interrupt the dragging session.\n window.addEventListener(\"blur\", pointerUpCallback, { signal });\n }\n\n _onStartDragging() {}\n\n _onStopDragging() {}\n\n moveInDOM() {\n // Moving the editor in the DOM can be expensive, so we wait a bit before.\n // It's important to not block the UI (for example when changing the font\n // size in a FreeText).\n if (this.#moveInDOMTimeout) {\n clearTimeout(this.#moveInDOMTimeout);\n }\n this.#moveInDOMTimeout = setTimeout(() => {\n this.#moveInDOMTimeout = null;\n this.parent?.moveEditorInDOM(this);\n if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"TESTING\")) {\n this._uiManager._eventBus.dispatch(\"editormovedindom\", {\n source: this,\n });\n }\n }, 0);\n }\n\n _setParentAndPosition(parent, x, y) {\n parent.changeParent(this);\n this.x = x;\n this.y = y;\n this.fixAndSetPosition();\n this._onTranslated();\n }\n\n /**\n * Convert the current rect into a page one.\n * @param {number} tx - x-translation in screen coordinates.\n * @param {number} ty - y-translation in screen coordinates.\n * @param {number} [rotation] - the rotation of the page.\n */\n getRect(tx, ty, rotation = this.rotation) {\n const scale = this.parentScale;\n const [pageWidth, pageHeight] = this.pageDimensions;\n const [pageX, pageY] = this.pageTranslation;\n const shiftX = tx / scale;\n const shiftY = ty / scale;\n const x = this.x * pageWidth;\n const y = this.y * pageHeight;\n const width = this.width * pageWidth;\n const height = this.height * pageHeight;\n\n switch (rotation) {\n case 0:\n return [\n x + shiftX + pageX,\n pageHeight - y - shiftY - height + pageY,\n x + shiftX + width + pageX,\n pageHeight - y - shiftY + pageY,\n ];\n case 90:\n return [\n x + shiftY + pageX,\n pageHeight - y + shiftX + pageY,\n x + shiftY + height + pageX,\n pageHeight - y + shiftX + width + pageY,\n ];\n case 180:\n return [\n x - shiftX - width + pageX,\n pageHeight - y + shiftY + pageY,\n x - shiftX + pageX,\n pageHeight - y + shiftY + height + pageY,\n ];\n case 270:\n return [\n x - shiftY - height + pageX,\n pageHeight - y - shiftX - width + pageY,\n x - shiftY + pageX,\n pageHeight - y - shiftX + pageY,\n ];\n default:\n throw new Error(\"Invalid rotation\");\n }\n }\n\n getRectInCurrentCoords(rect, pageHeight) {\n const [x1, y1, x2, y2] = rect;\n\n const width = x2 - x1;\n const height = y2 - y1;\n\n switch (this.rotation) {\n case 0:\n return [x1, pageHeight - y2, width, height];\n case 90:\n return [x1, pageHeight - y1, height, width];\n case 180:\n return [x2, pageHeight - y1, width, height];\n case 270:\n return [x2, pageHeight - y2, height, width];\n default:\n throw new Error(\"Invalid rotation\");\n }\n }\n\n /**\n * Get the rect in page coordinates without any translation.\n * It's used when serializing the editor.\n * @returns {Array<number>}\n */\n getPDFRect() {\n return this.getRect(0, 0);\n }\n\n /**\n * Executed once this editor has been rendered.\n * @param {boolean} focus - true if the editor should be focused.\n */\n onceAdded(focus) {}\n\n /**\n * Check if the editor contains something.\n * @returns {boolean}\n */\n isEmpty() {\n return false;\n }\n\n /**\n * Enable edit mode.\n * @returns {boolean} - true if the edit mode has been enabled.\n */\n enableEditMode() {\n if (this.isInEditMode()) {\n return false;\n }\n this.parent.setEditingState(false);\n this.#isInEditMode = true;\n\n return true;\n }\n\n /**\n * Disable edit mode.\n * @returns {boolean} - true if the edit mode has been disabled.\n */\n disableEditMode() {\n if (!this.isInEditMode()) {\n return false;\n }\n this.parent.setEditingState(true);\n this.#isInEditMode = false;\n\n return true;\n }\n\n /**\n * Check if the editor is edited.\n * @returns {boolean}\n */\n isInEditMode() {\n return this.#isInEditMode;\n }\n\n /**\n * If it returns true, then this editor handles the keyboard\n * events itself.\n * @returns {boolean}\n */\n shouldGetKeyboardEvents() {\n return this.#isResizerEnabledForKeyboard;\n }\n\n /**\n * Check if this editor needs to be rebuilt or not.\n * @returns {boolean}\n */\n needsToBeRebuilt() {\n return this.div && !this.isAttachedToDOM;\n }\n\n get isOnScreen() {\n const { top, left, bottom, right } = this.getClientDimensions();\n const { innerHeight, innerWidth } = window;\n return left < innerWidth && right > 0 && top < innerHeight && bottom > 0;\n }\n\n #addFocusListeners() {\n if (this.#focusAC || !this.div) {\n return;\n }\n this.#focusAC = new AbortController();\n const signal = this._uiManager.combinedSignal(this.#focusAC);\n\n this.div.addEventListener(\"focusin\", this.focusin.bind(this), { signal });\n this.div.addEventListener(\"focusout\", this.focusout.bind(this), { signal });\n }\n\n /**\n * Rebuild the editor in case it has been removed on undo.\n *\n * To implement in subclasses.\n */\n rebuild() {\n this.#addFocusListeners();\n }\n\n /**\n * Rotate the editor when the page is rotated.\n * @param {number} angle\n */\n rotate(_angle) {}\n\n /**\n * Resize the editor when the page is resized.\n */\n resize() {}\n\n /**\n * Serialize the editor when it has been deleted.\n * @returns {Object}\n */\n serializeDeleted() {\n return {\n id: this.annotationElementId,\n deleted: true,\n pageIndex: this.pageIndex,\n popupRef: this._initialData?.popupRef || \"\",\n };\n }\n\n /**\n * Serialize the editor.\n * The result of the serialization will be used to construct a\n * new annotation to add to the pdf document.\n *\n * To implement in subclasses.\n * @param {boolean} [isForCopying]\n * @param {Object | null} [context]\n * @returns {Object | null}\n */\n serialize(isForCopying = false, context = null) {\n unreachable(\"An editor must be serializable\");\n }\n\n /**\n * Deserialize the editor.\n * The result of the deserialization is a new editor.\n *\n * @param {Object} data\n * @param {AnnotationEditorLayer} parent\n * @param {AnnotationEditorUIManager} uiManager\n * @returns {Promise<AnnotationEditor | null>}\n */\n static async deserialize(data, parent, uiManager) {\n const editor = new this.prototype.constructor({\n parent,\n id: parent.getNextId(),\n uiManager,\n annotationElementId: data.annotationElementId,\n });\n editor.rotation = data.rotation;\n editor.#accessibilityData = data.accessibilityData;\n editor._isCopy = data.isCopy || false;\n\n const [pageWidth, pageHeight] = editor.pageDimensions;\n const [x, y, width, height] = editor.getRectInCurrentCoords(\n data.rect,\n pageHeight\n );\n\n editor.x = x / pageWidth;\n editor.y = y / pageHeight;\n editor.width = width / pageWidth;\n editor.height = height / pageHeight;\n\n return editor;\n }\n\n /**\n * Check if an existing annotation associated with this editor has been\n * modified.\n * @returns {boolean}\n */\n get hasBeenModified() {\n return (\n !!this.annotationElementId && (this.deleted || this.serialize() !== null)\n );\n }\n\n /**\n * Remove this editor.\n * It's used on ctrl+backspace action.\n */\n remove() {\n this.#focusAC?.abort();\n this.#focusAC = null;\n\n if (!this.isEmpty()) {\n // The editor is removed but it can be back at some point thanks to\n // undo/redo so we must commit it before.\n this.commit();\n }\n if (this.parent) {\n this.parent.remove(this);\n } else {\n this._uiManager.removeEditor(this);\n }\n\n if (this.#moveInDOMTimeout) {\n clearTimeout(this.#moveInDOMTimeout);\n this.#moveInDOMTimeout = null;\n }\n this.#stopResizing();\n this.removeEditToolbar();\n if (this.#telemetryTimeouts) {\n for (const timeout of this.#telemetryTimeouts.values()) {\n clearTimeout(timeout);\n }\n this.#telemetryTimeouts = null;\n }\n this.parent = null;\n this.#touchManager?.destroy();\n this.#touchManager = null;\n }\n\n /**\n * @returns {boolean} true if this editor can be resized.\n */\n get isResizable() {\n return false;\n }\n\n /**\n * Add the resizers to this editor.\n */\n makeResizable() {\n if (this.isResizable) {\n this.#createResizers();\n this.#resizersDiv.classList.remove(\"hidden\");\n }\n }\n\n get toolbarPosition() {\n return null;\n }\n\n /**\n * onkeydown callback.\n * @param {KeyboardEvent} event\n */\n keydown(event) {\n if (\n !this.isResizable ||\n event.target !== this.div ||\n event.key !== \"Enter\"\n ) {\n return;\n }\n this._uiManager.setSelected(this);\n this.#savedDimensions = {\n savedX: this.x,\n savedY: this.y,\n savedWidth: this.width,\n savedHeight: this.height,\n };\n const children = this.#resizersDiv.children;\n if (!this.#allResizerDivs) {\n this.#allResizerDivs = Array.from(children);\n const boundResizerKeydown = this.#resizerKeydown.bind(this);\n const boundResizerBlur = this.#resizerBlur.bind(this);\n const signal = this._uiManager._signal;\n for (const div of this.#allResizerDivs) {\n const name = div.getAttribute(\"data-resizer-name\");\n div.setAttribute(\"role\", \"spinbutton\");\n div.addEventListener(\"keydown\", boundResizerKeydown, { signal });\n div.addEventListener(\"blur\", boundResizerBlur, { signal });\n div.addEventListener(\"focus\", this.#resizerFocus.bind(this, name), {\n signal,\n });\n div.setAttribute(\"data-l10n-id\", AnnotationEditor._l10nResizer[name]);\n }\n }\n\n // We want to have the resizers in the visual order, so we move the first\n // (top-left) to the right place.\n const first = this.#allResizerDivs[0];\n let firstPosition = 0;\n for (const div of children) {\n if (div === first) {\n break;\n }\n firstPosition++;\n }\n const nextFirstPosition =\n (((360 - this.rotation + this.parentRotation) % 360) / 90) *\n (this.#allResizerDivs.length / 4);\n\n if (nextFirstPosition !== firstPosition) {\n // We need to reorder the resizers in the DOM in order to have the focus\n // on the top-left one.\n if (nextFirstPosition < firstPosition) {\n for (let i = 0; i < firstPosition - nextFirstPosition; i++) {\n this.#resizersDiv.append(this.#resizersDiv.firstChild);\n }\n } else if (nextFirstPosition > firstPosition) {\n for (let i = 0; i < nextFirstPosition - firstPosition; i++) {\n this.#resizersDiv.firstChild.before(this.#resizersDiv.lastChild);\n }\n }\n\n let i = 0;\n for (const child of children) {\n const div = this.#allResizerDivs[i++];\n const name = div.getAttribute(\"data-resizer-name\");\n child.setAttribute(\"data-l10n-id\", AnnotationEditor._l10nResizer[name]);\n }\n }\n\n this.#setResizerTabIndex(0);\n this.#isResizerEnabledForKeyboard = true;\n this.#resizersDiv.firstChild.focus({ focusVisible: true });\n event.preventDefault();\n event.stopImmediatePropagation();\n }\n\n #resizerKeydown(event) {\n AnnotationEditor._resizerKeyboardManager.exec(this, event);\n }\n\n #resizerBlur(event) {\n if (\n this.#isResizerEnabledForKeyboard &&\n event.relatedTarget?.parentNode !== this.#resizersDiv\n ) {\n this.#stopResizing();\n }\n }\n\n #resizerFocus(name) {\n this.#focusedResizerName = this.#isResizerEnabledForKeyboard ? name : \"\";\n }\n\n #setResizerTabIndex(value) {\n if (!this.#allResizerDivs) {\n return;\n }\n for (const div of this.#allResizerDivs) {\n div.tabIndex = value;\n }\n }\n\n _resizeWithKeyboard(x, y) {\n if (!this.#isResizerEnabledForKeyboard) {\n return;\n }\n this.#resizerPointermove(this.#focusedResizerName, {\n deltaX: x,\n deltaY: y,\n fromKeyboard: true,\n });\n }\n\n #stopResizing() {\n this.#isResizerEnabledForKeyboard = false;\n this.#setResizerTabIndex(-1);\n this.#addResizeToUndoStack();\n }\n\n _stopResizingWithKeyboard() {\n this.#stopResizing();\n this.div.focus();\n }\n\n /**\n * Select this editor.\n */\n select() {\n if (this.isSelected && this._editToolbar) {\n return;\n }\n this.isSelected = true;\n this.makeResizable();\n this.div?.classList.add(\"selectedEditor\");\n if (!this._editToolbar) {\n this.addEditToolbar().then(() => {\n if (this.div?.classList.contains(\"selectedEditor\")) {\n // The editor can have been unselected while we were waiting for the\n // edit toolbar to be created, hence we want to be sure that this\n // editor is still selected.\n this._editToolbar?.show();\n }\n });\n return;\n }\n this._editToolbar?.show();\n this.#altText?.toggleAltTextBadge(false);\n }\n\n /**\n * Unselect this editor.\n */\n unselect() {\n if (!this.isSelected) {\n return;\n }\n this.isSelected = false;\n this.#resizersDiv?.classList.add(\"hidden\");\n this.div?.classList.remove(\"selectedEditor\");\n if (this.div?.contains(document.activeElement)) {\n // Don't use this.div.blur() because we don't know where the focus will\n // go.\n this._uiManager.currentLayer.div.focus({\n preventScroll: true,\n });\n }\n this._editToolbar?.hide();\n this.#altText?.toggleAltTextBadge(true);\n }\n\n /**\n * Update some parameters which have been changed through the UI.\n * @param {number} type\n * @param {*} value\n */\n updateParams(type, value) {}\n\n /**\n * When the user disables the editing mode some editors can change some of\n * their properties.\n */\n disableEditing() {}\n\n /**\n * When the user enables the editing mode some editors can change some of\n * their properties.\n */\n enableEditing() {}\n\n /**\n * Check if the content of this editor can be changed.\n * For example, a FreeText editor can be changed (the user can change the\n * text), but a Stamp editor cannot.\n * @returns {boolean}\n */\n get canChangeContent() {\n return false;\n }\n\n /**\n * The editor is about to be edited.\n */\n enterInEditMode() {\n if (!this.canChangeContent) {\n return;\n }\n this.enableEditMode();\n this.div.focus();\n }\n\n /**\n * ondblclick callback.\n * @param {MouseEvent} event\n */\n dblclick(event) {\n this.enterInEditMode();\n this.parent.updateToolbar({\n mode: this.constructor._editorType,\n editId: this.id,\n });\n }\n\n /**\n * @returns {HTMLElement | null} the element requiring an alt text.\n */\n getElementForAltText() {\n return this.div;\n }\n\n /**\n * Get the div which really contains the displayed content.\n * @returns {HTMLDivElement | undefined}\n */\n get contentDiv() {\n return this.div;\n }\n\n /**\n * If true then the editor is currently edited.\n * @type {boolean}\n */\n get isEditing() {\n return this.#isEditing;\n }\n\n /**\n * When set to true, it means that this editor is currently edited.\n * @param {boolean} value\n */\n set isEditing(value) {\n this.#isEditing = value;\n if (!this.parent) {\n return;\n }\n if (value) {\n this.parent.setSelected(this);\n this.parent.setActiveEditor(this);\n } else {\n this.parent.setActiveEditor(null);\n }\n }\n\n /**\n * Set the aspect ratio to use when resizing.\n * @param {number} width\n * @param {number} height\n */\n setAspectRatio(width, height) {\n this.#keepAspectRatio = true;\n const aspectRatio = width / height;\n const { style } = this.div;\n style.aspectRatio = aspectRatio;\n style.height = \"auto\";\n }\n\n static get MIN_SIZE() {\n return 16;\n }\n\n static canCreateNewEmptyEditor() {\n return true;\n }\n\n /**\n * Get the data to report to the telemetry when the editor is added.\n * @returns {Object}\n */\n get telemetryInitialData() {\n return { action: \"added\" };\n }\n\n /**\n * The telemetry data to use when saving/printing.\n * @returns {Object|null}\n */\n get telemetryFinalData() {\n return null;\n }\n\n _reportTelemetry(data, mustWait = false) {\n if (mustWait) {\n this.#telemetryTimeouts ||= new Map();\n const { action } = data;\n let timeout = this.#telemetryTimeouts.get(action);\n if (timeout) {\n clearTimeout(timeout);\n }\n timeout = setTimeout(() => {\n this._reportTelemetry(data);\n this.#telemetryTimeouts.delete(action);\n if (this.#telemetryTimeouts.size === 0) {\n this.#telemetryTimeouts = null;\n }\n }, AnnotationEditor._telemetryTimeout);\n this.#telemetryTimeouts.set(action, timeout);\n return;\n }\n data.type ||= this.editorType;\n this._uiManager._eventBus.dispatch(\"reporttelemetry\", {\n source: this,\n details: {\n type: \"editing\",\n data,\n },\n });\n }\n\n /**\n * Show or hide this editor.\n * @param {boolean|undefined} visible\n */\n show(visible = this._isVisible) {\n this.div.classList.toggle(\"hidden\", !visible);\n this._isVisible = visible;\n }\n\n enable() {\n if (this.div) {\n this.div.tabIndex = 0;\n }\n this.#disabled = false;\n }\n\n disable() {\n if (this.div) {\n this.div.tabIndex = -1;\n }\n this.#disabled = true;\n }\n\n /**\n * Render an annotation in the annotation layer.\n * @param {Object} annotation\n * @returns {HTMLElement|null}\n */\n renderAnnotationElement(annotation) {\n if (this.deleted) {\n annotation.hide();\n return null;\n }\n let content = annotation.container.querySelector(\".annotationContent\");\n if (!content) {\n content = document.createElement(\"div\");\n content.classList.add(\"annotationContent\", this.editorType);\n annotation.container.prepend(content);\n } else if (content.nodeName === \"CANVAS\") {\n const canvas = content;\n content = document.createElement(\"div\");\n content.classList.add(\"annotationContent\", this.editorType);\n canvas.before(content);\n }\n\n return content;\n }\n\n resetAnnotationElement(annotation) {\n const { firstChild } = annotation.container;\n if (\n firstChild?.nodeName === \"DIV\" &&\n firstChild.classList.contains(\"annotationContent\")\n ) {\n firstChild.remove();\n }\n }\n}\n\n// This class is used to fake an editor which has been deleted.\nclass FakeEditor extends AnnotationEditor {\n constructor(params) {\n super(params);\n this.annotationElementId = params.annotationElementId;\n this.deleted = true;\n }\n\n serialize() {\n return this.serializeDeleted();\n }\n}\n\nexport { AnnotationEditor };\n","/* Copyright 2014 Opera Software ASA\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n *\n * Based on https://code.google.com/p/smhasher/wiki/MurmurHash3.\n * Hashes roughly 100 KB per millisecond on i7 3.4 GHz.\n */\n\nconst SEED = 0xc3d2e1f0;\n// Workaround for missing math precision in JS.\nconst MASK_HIGH = 0xffff0000;\nconst MASK_LOW = 0xffff;\n\nclass MurmurHash3_64 {\n constructor(seed) {\n this.h1 = seed ? seed & 0xffffffff : SEED;\n this.h2 = seed ? seed & 0xffffffff : SEED;\n }\n\n update(input) {\n let data, length;\n if (typeof input === \"string\") {\n data = new Uint8Array(input.length * 2);\n length = 0;\n for (let i = 0, ii = input.length; i < ii; i++) {\n const code = input.charCodeAt(i);\n if (code <= 0xff) {\n data[length++] = code;\n } else {\n data[length++] = code >>> 8;\n data[length++] = code & 0xff;\n }\n }\n } else if (ArrayBuffer.isView(input)) {\n data = input.slice();\n length = data.byteLength;\n } else {\n throw new Error(\"Invalid data format, must be a string or TypedArray.\");\n }\n\n const blockCounts = length >> 2;\n const tailLength = length - blockCounts * 4;\n // We don't care about endianness here.\n const dataUint32 = new Uint32Array(data.buffer, 0, blockCounts);\n let k1 = 0,\n k2 = 0;\n let h1 = this.h1,\n h2 = this.h2;\n const C1 = 0xcc9e2d51,\n C2 = 0x1b873593;\n const C1_LOW = C1 & MASK_LOW,\n C2_LOW = C2 & MASK_LOW;\n\n for (let i = 0; i < blockCounts; i++) {\n if (i & 1) {\n k1 = dataUint32[i];\n k1 = ((k1 * C1) & MASK_HIGH) | ((k1 * C1_LOW) & MASK_LOW);\n k1 = (k1 << 15) | (k1 >>> 17);\n k1 = ((k1 * C2) & MASK_HIGH) | ((k1 * C2_LOW) & MASK_LOW);\n h1 ^= k1;\n h1 = (h1 << 13) | (h1 >>> 19);\n h1 = h1 * 5 + 0xe6546b64;\n } else {\n k2 = dataUint32[i];\n k2 = ((k2 * C1) & MASK_HIGH) | ((k2 * C1_LOW) & MASK_LOW);\n k2 = (k2 << 15) | (k2 >>> 17);\n k2 = ((k2 * C2) & MASK_HIGH) | ((k2 * C2_LOW) & MASK_LOW);\n h2 ^= k2;\n h2 = (h2 << 13) | (h2 >>> 19);\n h2 = h2 * 5 + 0xe6546b64;\n }\n }\n\n k1 = 0;\n\n switch (tailLength) {\n case 3:\n k1 ^= data[blockCounts * 4 + 2] << 16;\n /* falls through */\n case 2:\n k1 ^= data[blockCounts * 4 + 1] << 8;\n /* falls through */\n case 1:\n k1 ^= data[blockCounts * 4];\n /* falls through */\n\n k1 = ((k1 * C1) & MASK_HIGH) | ((k1 * C1_LOW) & MASK_LOW);\n k1 = (k1 << 15) | (k1 >>> 17);\n k1 = ((k1 * C2) & MASK_HIGH) | ((k1 * C2_LOW) & MASK_LOW);\n if (blockCounts & 1) {\n h1 ^= k1;\n } else {\n h2 ^= k1;\n }\n }\n\n this.h1 = h1;\n this.h2 = h2;\n }\n\n hexdigest() {\n let h1 = this.h1,\n h2 = this.h2;\n\n h1 ^= h2 >>> 1;\n h1 = ((h1 * 0xed558ccd) & MASK_HIGH) | ((h1 * 0x8ccd) & MASK_LOW);\n h2 =\n ((h2 * 0xff51afd7) & MASK_HIGH) |\n (((((h2 << 16) | (h1 >>> 16)) * 0xafd7ed55) & MASK_HIGH) >>> 16);\n h1 ^= h2 >>> 1;\n h1 = ((h1 * 0x1a85ec53) & MASK_HIGH) | ((h1 * 0xec53) & MASK_LOW);\n h2 =\n ((h2 * 0xc4ceb9fe) & MASK_HIGH) |\n (((((h2 << 16) | (h1 >>> 16)) * 0xb9fe1a85) & MASK_HIGH) >>> 16);\n h1 ^= h2 >>> 1;\n\n return (\n (h1 >>> 0).toString(16).padStart(8, \"0\") +\n (h2 >>> 0).toString(16).padStart(8, \"0\")\n );\n }\n}\n\nexport { MurmurHash3_64 };\n","/* Copyright 2020 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { shadow, unreachable } from \"../shared/util.js\";\nimport { AnnotationEditor } from \"./editor/editor.js\";\nimport { MurmurHash3_64 } from \"../shared/murmurhash3.js\";\n\nconst SerializableEmpty = Object.freeze({\n map: null,\n hash: \"\",\n transfer: undefined,\n});\n\n/**\n * Key/value storage for annotation data in forms.\n */\nclass AnnotationStorage {\n #modified = false;\n\n #modifiedIds = null;\n\n #storage = new Map();\n\n constructor() {\n // Callbacks to signal when the modification state is set or reset.\n // This is used by the viewer to only bind on `beforeunload` if forms\n // are actually edited to prevent doing so unconditionally since that\n // can have undesirable effects.\n this.onSetModified = null;\n this.onResetModified = null;\n this.onAnnotationEditor = null;\n\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) {\n // For testing purposes.\n Object.defineProperty(this, \"_setValues\", {\n value: obj => {\n for (const [key, val] of Object.entries(obj)) {\n this.setValue(key, val);\n }\n },\n });\n }\n }\n\n /**\n * Get the value for a given key if it exists, or return the default value.\n * @param {string} key\n * @param {Object} defaultValue\n * @returns {Object}\n */\n getValue(key, defaultValue) {\n const value = this.#storage.get(key);\n if (value === undefined) {\n return defaultValue;\n }\n\n return Object.assign(defaultValue, value);\n }\n\n /**\n * Get the value for a given key.\n * @param {string} key\n * @returns {Object}\n */\n getRawValue(key) {\n return this.#storage.get(key);\n }\n\n /**\n * Remove a value from the storage.\n * @param {string} key\n */\n remove(key) {\n this.#storage.delete(key);\n\n if (this.#storage.size === 0) {\n this.resetModified();\n }\n\n if (typeof this.onAnnotationEditor === \"function\") {\n for (const value of this.#storage.values()) {\n if (value instanceof AnnotationEditor) {\n return;\n }\n }\n this.onAnnotationEditor(null);\n }\n }\n\n /**\n * Set the value for a given key\n * @param {string} key\n * @param {Object} value\n */\n setValue(key, value) {\n const obj = this.#storage.get(key);\n let modified = false;\n if (obj !== undefined) {\n for (const [entry, val] of Object.entries(value)) {\n if (obj[entry] !== val) {\n modified = true;\n obj[entry] = val;\n }\n }\n } else {\n modified = true;\n this.#storage.set(key, value);\n }\n if (modified) {\n this.#setModified();\n }\n\n if (\n value instanceof AnnotationEditor &&\n typeof this.onAnnotationEditor === \"function\"\n ) {\n this.onAnnotationEditor(value.constructor._type);\n }\n }\n\n /**\n * Check if the storage contains the given key.\n * @param {string} key\n * @returns {boolean}\n */\n has(key) {\n return this.#storage.has(key);\n }\n\n get size() {\n return this.#storage.size;\n }\n\n #setModified() {\n if (!this.#modified) {\n this.#modified = true;\n if (typeof this.onSetModified === \"function\") {\n this.onSetModified();\n }\n }\n }\n\n resetModified() {\n if (this.#modified) {\n this.#modified = false;\n if (typeof this.onResetModified === \"function\") {\n this.onResetModified();\n }\n }\n }\n\n /**\n * @returns {PrintAnnotationStorage}\n */\n get print() {\n return new PrintAnnotationStorage(this);\n }\n\n /**\n * PLEASE NOTE: Only intended for usage within the API itself.\n * @ignore\n */\n get serializable() {\n if (this.#storage.size === 0) {\n return SerializableEmpty;\n }\n const map = new Map(),\n hash = new MurmurHash3_64(),\n transfer = [];\n const context = Object.create(null);\n let hasBitmap = false;\n\n for (const [key, val] of this.#storage) {\n const serialized =\n val instanceof AnnotationEditor\n ? val.serialize(/* isForCopying = */ false, context)\n : val;\n if (serialized) {\n map.set(key, serialized);\n\n hash.update(`${key}:${JSON.stringify(serialized)}`);\n hasBitmap ||= !!serialized.bitmap;\n }\n }\n\n if (hasBitmap) {\n // We must transfer the bitmap data separately, since it can be changed\n // during serialization with SVG images.\n for (const value of map.values()) {\n if (value.bitmap) {\n transfer.push(value.bitmap);\n }\n }\n }\n\n return map.size > 0\n ? { map, hash: hash.hexdigest(), transfer }\n : SerializableEmpty;\n }\n\n get editorStats() {\n let stats = null;\n const typeToEditor = new Map();\n for (const value of this.#storage.values()) {\n if (!(value instanceof AnnotationEditor)) {\n continue;\n }\n const editorStats = value.telemetryFinalData;\n if (!editorStats) {\n continue;\n }\n const { type } = editorStats;\n if (!typeToEditor.has(type)) {\n typeToEditor.set(type, Object.getPrototypeOf(value).constructor);\n }\n stats ||= Object.create(null);\n const map = (stats[type] ||= new Map());\n for (const [key, val] of Object.entries(editorStats)) {\n if (key === \"type\") {\n continue;\n }\n let counters = map.get(key);\n if (!counters) {\n counters = new Map();\n map.set(key, counters);\n }\n const count = counters.get(val) ?? 0;\n counters.set(val, count + 1);\n }\n }\n for (const [type, editor] of typeToEditor) {\n stats[type] = editor.computeTelemetryFinalData(stats[type]);\n }\n return stats;\n }\n\n resetModifiedIds() {\n this.#modifiedIds = null;\n }\n\n /**\n * @returns {{ids: Set<string>, hash: string}}\n */\n get modifiedIds() {\n if (this.#modifiedIds) {\n return this.#modifiedIds;\n }\n const ids = [];\n for (const value of this.#storage.values()) {\n if (\n !(value instanceof AnnotationEditor) ||\n !value.annotationElementId ||\n !value.serialize()\n ) {\n continue;\n }\n ids.push(value.annotationElementId);\n }\n return (this.#modifiedIds = {\n ids: new Set(ids),\n hash: ids.join(\",\"),\n });\n }\n\n [Symbol.iterator]() {\n return this.#storage.entries();\n }\n}\n\n/**\n * A special `AnnotationStorage` for use during printing, where the serializable\n * data is *frozen* upon initialization, to prevent scripting from modifying its\n * contents. (Necessary since printing is triggered synchronously in browsers.)\n */\nclass PrintAnnotationStorage extends AnnotationStorage {\n #serializable;\n\n constructor(parent) {\n super();\n const { map, hash, transfer } = parent.serializable;\n // Create a *copy* of the data, since Objects are passed by reference in JS.\n const clone = structuredClone(map, transfer ? { transfer } : null);\n\n this.#serializable = { map: clone, hash, transfer };\n }\n\n /**\n * @returns {PrintAnnotationStorage}\n */\n // eslint-disable-next-line getter-return\n get print() {\n unreachable(\"Should not call PrintAnnotationStorage.print\");\n }\n\n /**\n * PLEASE NOTE: Only intended for usage within the API itself.\n * @ignore\n */\n get serializable() {\n return this.#serializable;\n }\n\n get modifiedIds() {\n return shadow(this, \"modifiedIds\", {\n ids: new Set(),\n hash: \"\",\n });\n }\n}\n\nexport { AnnotationStorage, PrintAnnotationStorage, SerializableEmpty };\n","/* Copyright 2012 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n assert,\n FeatureTest,\n isNodeJS,\n shadow,\n string32,\n toBase64Util,\n unreachable,\n warn,\n} from \"../shared/util.js\";\n\nclass FontLoader {\n #systemFonts = new Set();\n\n constructor({\n ownerDocument = globalThis.document,\n styleElement = null, // For testing only.\n }) {\n this._document = ownerDocument;\n\n this.nativeFontFaces = new Set();\n this.styleElement =\n typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")\n ? styleElement\n : null;\n\n if (typeof PDFJSDev === \"undefined\" || !PDFJSDev.test(\"MOZCENTRAL\")) {\n this.loadingRequests = [];\n this.loadTestFontId = 0;\n }\n }\n\n addNativeFontFace(nativeFontFace) {\n this.nativeFontFaces.add(nativeFontFace);\n this._document.fonts.add(nativeFontFace);\n }\n\n removeNativeFontFace(nativeFontFace) {\n this.nativeFontFaces.delete(nativeFontFace);\n this._document.fonts.delete(nativeFontFace);\n }\n\n insertRule(rule) {\n if (!this.styleElement) {\n this.styleElement = this._document.createElement(\"style\");\n this._document.documentElement\n .getElementsByTagName(\"head\")[0]\n .append(this.styleElement);\n }\n const styleSheet = this.styleElement.sheet;\n styleSheet.insertRule(rule, styleSheet.cssRules.length);\n }\n\n clear() {\n for (const nativeFontFace of this.nativeFontFaces) {\n this._document.fonts.delete(nativeFontFace);\n }\n this.nativeFontFaces.clear();\n this.#systemFonts.clear();\n\n if (this.styleElement) {\n // Note: ChildNode.remove doesn't throw if the parentNode is undefined.\n this.styleElement.remove();\n this.styleElement = null;\n }\n }\n\n async loadSystemFont({\n systemFontInfo: info,\n disableFontFace,\n _inspectFont,\n }) {\n if (!info || this.#systemFonts.has(info.loadedName)) {\n return;\n }\n assert(\n !disableFontFace,\n \"loadSystemFont shouldn't be called when `disableFontFace` is set.\"\n );\n\n if (this.isFontLoadingAPISupported) {\n const { loadedName, src, style } = info;\n const fontFace = new FontFace(loadedName, src, style);\n this.addNativeFontFace(fontFace);\n try {\n await fontFace.load();\n this.#systemFonts.add(loadedName);\n _inspectFont?.(info);\n } catch {\n warn(\n `Cannot load system font: ${info.baseFontName}, installing it could help to improve PDF rendering.`\n );\n\n this.removeNativeFontFace(fontFace);\n }\n return;\n }\n\n unreachable(\n \"Not implemented: loadSystemFont without the Font Loading API.\"\n );\n }\n\n async bind(font) {\n // Add the font to the DOM only once; skip if the font is already loaded.\n if (font.attached || (font.missingFile && !font.systemFontInfo)) {\n return;\n }\n font.attached = true;\n\n if (font.systemFontInfo) {\n await this.loadSystemFont(font);\n return;\n }\n\n if (this.isFontLoadingAPISupported) {\n const nativeFontFace = font.createNativeFontFace();\n if (nativeFontFace) {\n this.addNativeFontFace(nativeFontFace);\n try {\n await nativeFontFace.loaded;\n } catch (ex) {\n warn(`Failed to load font '${nativeFontFace.family}': '${ex}'.`);\n\n // When font loading failed, fall back to the built-in font renderer.\n font.disableFontFace = true;\n throw ex;\n }\n }\n return; // The font was, asynchronously, loaded.\n }\n\n // !this.isFontLoadingAPISupported\n const rule = font.createFontFaceRule();\n if (rule) {\n this.insertRule(rule);\n\n if (this.isSyncFontLoadingSupported) {\n return; // The font was, synchronously, loaded.\n }\n if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) {\n throw new Error(\"Not implemented: async font loading\");\n }\n await new Promise(resolve => {\n const request = this._queueLoadingCallback(resolve);\n this._prepareFontLoadEvent(font, request);\n });\n // The font was, asynchronously, loaded.\n }\n }\n\n get isFontLoadingAPISupported() {\n const hasFonts = !!this._document?.fonts;\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) {\n return shadow(\n this,\n \"isFontLoadingAPISupported\",\n hasFonts && !this.styleElement\n );\n }\n return shadow(this, \"isFontLoadingAPISupported\", hasFonts);\n }\n\n get isSyncFontLoadingSupported() {\n if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) {\n return shadow(this, \"isSyncFontLoadingSupported\", true);\n }\n\n // Node.js - we can pretend that sync font loading is supported.\n // Firefox, from version 14, supports synchronous font loading.\n return shadow(\n this,\n \"isSyncFontLoadingSupported\",\n (typeof PDFJSDev === \"undefined\" || !PDFJSDev.test(\"CHROME\")) &&\n (isNodeJS || FeatureTest.platform.isFirefox)\n );\n }\n\n _queueLoadingCallback(callback) {\n if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) {\n throw new Error(\"Not implemented: _queueLoadingCallback\");\n }\n\n function completeRequest() {\n assert(!request.done, \"completeRequest() cannot be called twice.\");\n request.done = true;\n\n // Sending all completed requests in order of how they were queued.\n while (loadingRequests.length > 0 && loadingRequests[0].done) {\n const otherRequest = loadingRequests.shift();\n setTimeout(otherRequest.callback, 0);\n }\n }\n\n const { loadingRequests } = this;\n const request = {\n done: false,\n complete: completeRequest,\n callback,\n };\n loadingRequests.push(request);\n return request;\n }\n\n get _loadTestFont() {\n if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) {\n throw new Error(\"Not implemented: _loadTestFont\");\n }\n\n // This is a CFF font with 1 glyph for '.' that fills its entire width\n // and height.\n const testFont = atob(\n \"T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQA\" +\n \"FQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAA\" +\n \"ALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgA\" +\n \"AAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1\" +\n \"AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD\" +\n \"6AAAAAAD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FhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3\" +\n \"Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTj\" +\n \"FQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA==\"\n );\n return shadow(this, \"_loadTestFont\", testFont);\n }\n\n _prepareFontLoadEvent(font, request) {\n if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) {\n throw new Error(\"Not implemented: _prepareFontLoadEvent\");\n }\n\n /** Hack begin */\n // There's currently no event when a font has finished downloading so the\n // following code is a dirty hack to 'guess' when a font is ready.\n // It's assumed fonts are loaded in order, so add a known test font after\n // the desired fonts and then test for the loading of that test font.\n\n function int32(data, offset) {\n return (\n (data.charCodeAt(offset) << 24) |\n (data.charCodeAt(offset + 1) << 16) |\n (data.charCodeAt(offset + 2) << 8) |\n (data.charCodeAt(offset + 3) & 0xff)\n );\n }\n function spliceString(s, offset, remove, insert) {\n const chunk1 = s.substring(0, offset);\n const chunk2 = s.substring(offset + remove);\n return chunk1 + insert + chunk2;\n }\n let i, ii;\n\n // The temporary canvas is used to determine if fonts are loaded.\n const canvas = this._document.createElement(\"canvas\");\n canvas.width = 1;\n canvas.height = 1;\n const ctx = canvas.getContext(\"2d\");\n\n let called = 0;\n function isFontReady(name, callback) {\n // With setTimeout clamping this gives the font ~100ms to load.\n if (++called > 30) {\n warn(\"Load test font never loaded.\");\n callback();\n return;\n }\n ctx.font = \"30px \" + name;\n ctx.fillText(\".\", 0, 20);\n const imageData = ctx.getImageData(0, 0, 1, 1);\n if (imageData.data[3] > 0) {\n callback();\n return;\n }\n setTimeout(isFontReady.bind(null, name, callback));\n }\n\n const loadTestFontId = `lt${Date.now()}${this.loadTestFontId++}`;\n // Chromium seems to cache fonts based on a hash of the actual font data,\n // so the font must be modified for each load test else it will appear to\n // be loaded already.\n // TODO: This could maybe be made faster by avoiding the btoa of the full\n // font by splitting it in chunks before hand and padding the font id.\n let data = this._loadTestFont;\n const COMMENT_OFFSET = 976; // has to be on 4 byte boundary (for checksum)\n data = spliceString(\n data,\n COMMENT_OFFSET,\n loadTestFontId.length,\n loadTestFontId\n );\n // CFF checksum is important for IE, adjusting it\n const CFF_CHECKSUM_OFFSET = 16;\n const XXXX_VALUE = 0x58585858; // the \"comment\" filled with 'X'\n let checksum = int32(data, CFF_CHECKSUM_OFFSET);\n for (i = 0, ii = loadTestFontId.length - 3; i < ii; i += 4) {\n checksum = (checksum - XXXX_VALUE + int32(loadTestFontId, i)) | 0;\n }\n if (i < loadTestFontId.length) {\n // align to 4 bytes boundary\n checksum = (checksum - XXXX_VALUE + int32(loadTestFontId + \"XXX\", i)) | 0;\n }\n data = spliceString(data, CFF_CHECKSUM_OFFSET, 4, string32(checksum));\n\n const url = `url(data:font/opentype;base64,${btoa(data)});`;\n const rule = `@font-face {font-family:\"${loadTestFontId}\";src:${url}}`;\n this.insertRule(rule);\n\n const div = this._document.createElement(\"div\");\n div.style.visibility = \"hidden\";\n div.style.width = div.style.height = \"10px\";\n div.style.position = \"absolute\";\n div.style.top = div.style.left = \"0px\";\n\n for (const name of [font.loadedName, loadTestFontId]) {\n const span = this._document.createElement(\"span\");\n span.textContent = \"Hi\";\n span.style.fontFamily = name;\n div.append(span);\n }\n this._document.body.append(div);\n\n isFontReady(loadTestFontId, () => {\n div.remove();\n request.complete();\n });\n /** Hack end */\n }\n}\n\nclass FontFaceObject {\n constructor(translatedData, inspectFont = null) {\n this.compiledGlyphs = Object.create(null);\n // importing translated data\n for (const i in translatedData) {\n this[i] = translatedData[i];\n }\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) {\n if (typeof this.disableFontFace !== \"boolean\") {\n unreachable(\"disableFontFace must be available.\");\n }\n if (typeof this.fontExtraProperties !== \"boolean\") {\n unreachable(\"fontExtraProperties must be available.\");\n }\n }\n this._inspectFont = inspectFont;\n }\n\n createNativeFontFace() {\n if (!this.data || this.disableFontFace) {\n return null;\n }\n let nativeFontFace;\n if (!this.cssFontInfo) {\n nativeFontFace = new FontFace(this.loadedName, this.data, {});\n } else {\n const css = {\n weight: this.cssFontInfo.fontWeight,\n };\n if (this.cssFontInfo.italicAngle) {\n css.style = `oblique ${this.cssFontInfo.italicAngle}deg`;\n }\n nativeFontFace = new FontFace(\n this.cssFontInfo.fontFamily,\n this.data,\n css\n );\n }\n\n this._inspectFont?.(this);\n return nativeFontFace;\n }\n\n createFontFaceRule() {\n if (!this.data || this.disableFontFace) {\n return null;\n }\n // Add the @font-face rule to the document.\n const url = `url(data:${this.mimetype};base64,${toBase64Util(this.data)});`;\n let rule;\n if (!this.cssFontInfo) {\n rule = `@font-face {font-family:\"${this.loadedName}\";src:${url}}`;\n } else {\n let css = `font-weight: ${this.cssFontInfo.fontWeight};`;\n if (this.cssFontInfo.italicAngle) {\n css += `font-style: oblique ${this.cssFontInfo.italicAngle}deg;`;\n }\n rule = `@font-face {font-family:\"${this.cssFontInfo.fontFamily}\";${css}src:${url}}`;\n }\n\n this._inspectFont?.(this, url);\n return rule;\n }\n\n getPathGenerator(objs, character) {\n if (this.compiledGlyphs[character] !== undefined) {\n return this.compiledGlyphs[character];\n }\n\n const objId = this.loadedName + \"_path_\" + character;\n let cmds;\n try {\n cmds = objs.get(objId);\n } catch (ex) {\n warn(`getPathGenerator - ignoring character: \"${ex}\".`);\n }\n const path = new Path2D(cmds || \"\");\n\n if (!this.fontExtraProperties) {\n // Remove the raw path-string, since we don't need it anymore.\n objs.delete(objId);\n }\n return (this.compiledGlyphs[character] = path);\n }\n}\n\nexport { FontFaceObject, FontLoader };\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 _isValidExplicitDest,\n isNodeJS,\n stringToBytes,\n warn,\n} from \"../shared/util.js\";\n\nfunction getUrlProp(val) {\n if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) {\n return null; // The 'url' is unused with `PDFDataRangeTransport`.\n }\n if (val instanceof URL) {\n return val.href;\n }\n if (typeof val === \"string\") {\n if (\n typeof PDFJSDev !== \"undefined\" &&\n PDFJSDev.test(\"GENERIC\") &&\n isNodeJS\n ) {\n return val; // Use the url as-is in Node.js environments.\n }\n\n // The full path is required in the 'url' field.\n const url = URL.parse(val, window.location);\n if (url) {\n return url.href;\n }\n }\n throw new Error(\n \"Invalid PDF url data: \" +\n \"either string or URL-object is expected in the url property.\"\n );\n}\n\nfunction getDataProp(val) {\n // Converting string or array-like data to Uint8Array.\n if (\n typeof PDFJSDev !== \"undefined\" &&\n PDFJSDev.test(\"GENERIC\") &&\n isNodeJS &&\n typeof Buffer !== \"undefined\" && // eslint-disable-line no-undef\n val instanceof Buffer // eslint-disable-line no-undef\n ) {\n throw new Error(\n \"Please provide binary data as `Uint8Array`, rather than `Buffer`.\"\n );\n }\n if (val instanceof Uint8Array && val.byteLength === val.buffer.byteLength) {\n // Use the data as-is when it's already a Uint8Array that completely\n // \"utilizes\" its underlying ArrayBuffer, to prevent any possible\n // issues when transferring it to the worker-thread.\n return val;\n }\n if (typeof val === \"string\") {\n return stringToBytes(val);\n }\n if (\n val instanceof ArrayBuffer ||\n ArrayBuffer.isView(val) ||\n (typeof val === \"object\" && !isNaN(val?.length))\n ) {\n return new Uint8Array(val);\n }\n throw new Error(\n \"Invalid PDF binary data: either TypedArray, \" +\n \"string, or array-like object is expected in the data property.\"\n );\n}\n\nfunction getFactoryUrlProp(val) {\n if (typeof val !== \"string\") {\n return null;\n }\n if (val.endsWith(\"/\")) {\n return val;\n }\n throw new Error(`Invalid factory url: \"${val}\" must include trailing slash.`);\n}\n\nconst isRefProxy = v =>\n typeof v === \"object\" &&\n Number.isInteger(v?.num) &&\n v.num >= 0 &&\n Number.isInteger(v?.gen) &&\n v.gen >= 0;\n\nconst isNameProxy = v => typeof v === \"object\" && typeof v?.name === \"string\";\n\nconst isValidExplicitDest = _isValidExplicitDest.bind(\n null,\n /* validRef = */ isRefProxy,\n /* validName = */ isNameProxy\n);\n\nclass LoopbackPort {\n #listeners = new Map();\n\n #deferred = Promise.resolve();\n\n postMessage(obj, transfer) {\n const event = {\n data: structuredClone(obj, transfer ? { transfer } : null),\n };\n\n this.#deferred.then(() => {\n for (const [listener] of this.#listeners) {\n listener.call(this, event);\n }\n });\n }\n\n addEventListener(name, listener, options = null) {\n let rmAbort = null;\n if (options?.signal instanceof AbortSignal) {\n const { signal } = options;\n if (signal.aborted) {\n warn(\"LoopbackPort - cannot use an `aborted` signal.\");\n return;\n }\n const onAbort = () => this.removeEventListener(name, listener);\n rmAbort = () => signal.removeEventListener(\"abort\", onAbort);\n\n signal.addEventListener(\"abort\", onAbort);\n }\n this.#listeners.set(listener, rmAbort);\n }\n\n removeEventListener(name, listener) {\n const rmAbort = this.#listeners.get(listener);\n rmAbort?.();\n\n this.#listeners.delete(listener);\n }\n\n terminate() {\n for (const [, rmAbort] of this.#listeners) {\n rmAbort?.();\n }\n this.#listeners.clear();\n }\n}\n\nexport {\n getDataProp,\n getFactoryUrlProp,\n getUrlProp,\n isNameProxy,\n isRefProxy,\n isValidExplicitDest,\n LoopbackPort,\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\nimport {\n AbortException,\n assert,\n InvalidPDFException,\n PasswordException,\n ResponseException,\n UnknownErrorException,\n unreachable,\n} from \"./util.js\";\n\nconst CallbackKind = {\n DATA: 1,\n ERROR: 2,\n};\n\nconst StreamKind = {\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 onFn() {}\n\nfunction wrapReason(ex) {\n if (\n ex instanceof AbortException ||\n ex instanceof InvalidPDFException ||\n ex instanceof PasswordException ||\n ex instanceof ResponseException ||\n ex instanceof UnknownErrorException\n ) {\n // Avoid re-creating the exception when its type is already correct.\n return ex;\n }\n\n if (!(ex instanceof Error || (typeof ex === \"object\" && ex !== null))) {\n unreachable(\n 'wrapReason: Expected \"reason\" to be a (possibly cloned) Error.'\n );\n }\n switch (ex.name) {\n case \"AbortException\":\n return new AbortException(ex.message);\n case \"InvalidPDFException\":\n return new InvalidPDFException(ex.message);\n case \"PasswordException\":\n return new PasswordException(ex.message, ex.code);\n case \"ResponseException\":\n return new ResponseException(ex.message, ex.status, ex.missing);\n case \"UnknownErrorException\":\n return new UnknownErrorException(ex.message, ex.details);\n }\n return new UnknownErrorException(ex.message, ex.toString());\n}\n\nclass MessageHandler {\n #messageAC = new AbortController();\n\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 comObj.addEventListener(\"message\", this.#onMessage.bind(this), {\n signal: this.#messageAC.signal,\n });\n }\n\n #onMessage({ 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 sourceName = this.sourceName,\n targetName = data.sourceName,\n comObj = this.comObj;\n\n Promise.try(action, data.data).then(\n function (result) {\n comObj.postMessage({\n sourceName,\n targetName,\n callback: CallbackKind.DATA,\n callbackId: data.callbackId,\n data: result,\n });\n },\n function (reason) {\n comObj.postMessage({\n sourceName,\n targetName,\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\n on(actionName, handler) {\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) {\n assert(\n typeof handler === \"function\",\n 'MessageHandler.on: Expected \"handler\" to be a function.'\n );\n }\n const ah = this.actionHandler;\n if (ah[actionName]) {\n throw new Error(`There is already an actionName called \"${actionName}\"`);\n }\n ah[actionName] = handler;\n }\n\n /**\n * Sends a message to the comObj to invoke the action with the supplied data.\n * @param {string} actionName - Action to call.\n * @param {JSON} data - JSON data to send.\n * @param {Array} [transfers] - List of transfers/ArrayBuffers.\n */\n send(actionName, data, transfers) {\n this.comObj.postMessage(\n {\n sourceName: this.sourceName,\n targetName: this.targetName,\n action: actionName,\n data,\n },\n transfers\n );\n }\n\n /**\n * Sends a message to the comObj to invoke the action with the supplied data.\n * Expects that the other side will callback with the response.\n * @param {string} actionName - Action to call.\n * @param {JSON} data - JSON data to send.\n * @param {Array} [transfers] - List of transfers/ArrayBuffers.\n * @returns {Promise} Promise to be resolved with response data.\n */\n sendWithPromise(actionName, data, transfers) {\n const callbackId = this.callbackId++;\n const capability = Promise.withResolvers();\n this.callbackCapabilities[callbackId] = capability;\n try {\n this.comObj.postMessage(\n {\n sourceName: this.sourceName,\n targetName: this.targetName,\n action: actionName,\n callbackId,\n data,\n },\n transfers\n );\n } catch (ex) {\n capability.reject(ex);\n }\n return capability.promise;\n }\n\n /**\n * Sends a message to the comObj to invoke the action with the supplied data.\n * Expect that the other side will callback to signal 'start_complete'.\n * @param {string} actionName - Action to call.\n * @param {JSON} data - JSON data to send.\n * @param {Object} queueingStrategy - Strategy to signal backpressure based on\n * internal queue.\n * @param {Array} [transfers] - List of transfers/ArrayBuffers.\n * @returns {ReadableStream} ReadableStream to read data in chunks.\n */\n sendWithStream(actionName, data, queueingStrategy, transfers) {\n const streamId = this.streamId++,\n sourceName = this.sourceName,\n targetName = this.targetName,\n comObj = this.comObj;\n\n return new ReadableStream(\n {\n start: controller => {\n const startCapability = Promise.withResolvers();\n this.streamControllers[streamId] = {\n controller,\n startCall: startCapability,\n pullCall: null,\n cancelCall: null,\n isClosed: false,\n };\n comObj.postMessage(\n {\n sourceName,\n targetName,\n action: actionName,\n streamId,\n data,\n desiredSize: controller.desiredSize,\n },\n transfers\n );\n // Return Promise for Async process, to signal success/failure.\n return startCapability.promise;\n },\n\n pull: controller => {\n const pullCapability = Promise.withResolvers();\n this.streamControllers[streamId].pullCall = pullCapability;\n comObj.postMessage({\n sourceName,\n targetName,\n stream: StreamKind.PULL,\n streamId,\n desiredSize: controller.desiredSize,\n });\n // Returning Promise will not call \"pull\"\n // again until current pull is resolved.\n return pullCapability.promise;\n },\n\n cancel: reason => {\n assert(reason instanceof Error, \"cancel must have a valid reason\");\n const cancelCapability = Promise.withResolvers();\n this.streamControllers[streamId].cancelCall = cancelCapability;\n this.streamControllers[streamId].isClosed = true;\n comObj.postMessage({\n sourceName,\n targetName,\n stream: StreamKind.CANCEL,\n streamId,\n reason: wrapReason(reason),\n });\n // Return Promise to signal success or failure.\n return cancelCapability.promise;\n },\n },\n queueingStrategy\n );\n }\n\n #createStreamSink(data) {\n const streamId = data.streamId,\n sourceName = this.sourceName,\n targetName = data.sourceName,\n comObj = this.comObj;\n const self = this,\n action = this.actionHandler[data.action];\n\n const streamSink = {\n enqueue(chunk, size = 1, transfers) {\n if (this.isCancelled) {\n return;\n }\n const lastDesiredSize = this.desiredSize;\n this.desiredSize -= size;\n // Enqueue decreases the desiredSize property of sink,\n // so when it changes from positive to negative,\n // set ready as unresolved promise.\n if (lastDesiredSize > 0 && this.desiredSize <= 0) {\n this.sinkCapability = Promise.withResolvers();\n this.ready = this.sinkCapability.promise;\n }\n comObj.postMessage(\n {\n sourceName,\n targetName,\n stream: StreamKind.ENQUEUE,\n streamId,\n chunk,\n },\n transfers\n );\n },\n\n close() {\n if (this.isCancelled) {\n return;\n }\n this.isCancelled = true;\n comObj.postMessage({\n sourceName,\n targetName,\n stream: StreamKind.CLOSE,\n streamId,\n });\n delete self.streamSinks[streamId];\n },\n\n error(reason) {\n assert(reason instanceof Error, \"error must have a valid reason\");\n if (this.isCancelled) {\n return;\n }\n this.isCancelled = true;\n comObj.postMessage({\n sourceName,\n targetName,\n stream: StreamKind.ERROR,\n streamId,\n reason: wrapReason(reason),\n });\n },\n\n sinkCapability: Promise.withResolvers(),\n onPull: null,\n onCancel: null,\n isCancelled: false,\n desiredSize: data.desiredSize,\n ready: null,\n };\n\n streamSink.sinkCapability.resolve();\n streamSink.ready = streamSink.sinkCapability.promise;\n this.streamSinks[streamId] = streamSink;\n\n Promise.try(action, data.data, streamSink).then(\n function () {\n comObj.postMessage({\n sourceName,\n targetName,\n stream: StreamKind.START_COMPLETE,\n streamId,\n success: true,\n });\n },\n function (reason) {\n comObj.postMessage({\n sourceName,\n targetName,\n stream: StreamKind.START_COMPLETE,\n streamId,\n reason: wrapReason(reason),\n });\n }\n );\n }\n\n #processStreamMessage(data) {\n const streamId = data.streamId,\n sourceName = this.sourceName,\n targetName = data.sourceName,\n comObj = this.comObj;\n const streamController = this.streamControllers[streamId],\n streamSink = this.streamSinks[streamId];\n\n switch (data.stream) {\n case StreamKind.START_COMPLETE:\n if (data.success) {\n streamController.startCall.resolve();\n } else {\n streamController.startCall.reject(wrapReason(data.reason));\n }\n break;\n case StreamKind.PULL_COMPLETE:\n if (data.success) {\n streamController.pullCall.resolve();\n } else {\n streamController.pullCall.reject(wrapReason(data.reason));\n }\n break;\n case StreamKind.PULL:\n // Ignore any pull after close is called.\n if (!streamSink) {\n comObj.postMessage({\n sourceName,\n targetName,\n stream: StreamKind.PULL_COMPLETE,\n streamId,\n success: true,\n });\n break;\n }\n // Pull increases the desiredSize property of sink, so when it changes\n // from negative to positive, set ready property as resolved promise.\n if (streamSink.desiredSize <= 0 && data.desiredSize > 0) {\n streamSink.sinkCapability.resolve();\n }\n // Reset desiredSize property of sink on every pull.\n streamSink.desiredSize = data.desiredSize;\n\n Promise.try(streamSink.onPull || onFn).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 const dataReason = wrapReason(data.reason);\n\n Promise.try(streamSink.onCancel || onFn, dataReason).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(dataReason);\n streamSink.isCancelled = true;\n delete this.streamSinks[streamId];\n break;\n default:\n throw new Error(\"Unexpected stream case\");\n }\n }\n\n async #deleteStreamController(streamController, streamId) {\n // Delete the `streamController` only when the start, pull, and cancel\n // capabilities have settled, to prevent `TypeError`s.\n await Promise.allSettled([\n streamController.startCall?.promise,\n streamController.pullCall?.promise,\n streamController.cancelCall?.promise,\n ]);\n delete this.streamControllers[streamId];\n }\n\n destroy() {\n this.#messageAC?.abort();\n this.#messageAC = null;\n }\n}\n\nexport { MessageHandler, wrapReason };\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 { unreachable } from \"../shared/util.js\";\n\nclass BaseCanvasFactory {\n #enableHWA = false;\n\n constructor({ enableHWA = false }) {\n if (\n (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) &&\n this.constructor === BaseCanvasFactory\n ) {\n unreachable(\"Cannot initialize BaseCanvasFactory.\");\n }\n this.#enableHWA = enableHWA;\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 willReadFrequently: !this.#enableHWA,\n }),\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 DOMCanvasFactory extends BaseCanvasFactory {\n constructor({ ownerDocument = globalThis.document, enableHWA = false }) {\n super({ enableHWA });\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\nexport { BaseCanvasFactory, DOMCanvasFactory };\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 { stringToBytes, unreachable } from \"../shared/util.js\";\nimport { fetchData } from \"./display_utils.js\";\n\nclass BaseCMapReaderFactory {\n constructor({ baseUrl = null, isCompressed = true }) {\n if (\n (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) &&\n this.constructor === BaseCMapReaderFactory\n ) {\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 \"Ensure that 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\n return this._fetch(url)\n .then(cMapData => ({ cMapData, isCompressed: this.isCompressed }))\n .catch(reason => {\n throw new Error(\n `Unable to load ${this.isCompressed ? \"binary \" : \"\"}CMap at: ${url}`\n );\n });\n }\n\n /**\n * @ignore\n * @returns {Promise<Uint8Array>}\n */\n async _fetch(url) {\n unreachable(\"Abstract method `_fetch` called.\");\n }\n}\n\nclass DOMCMapReaderFactory extends BaseCMapReaderFactory {\n /**\n * @ignore\n */\n async _fetch(url) {\n const data = await fetchData(\n url,\n /* type = */ this.isCompressed ? \"arraybuffer\" : \"text\"\n );\n return data instanceof ArrayBuffer\n ? new Uint8Array(data)\n : stringToBytes(data);\n }\n}\n\nexport { BaseCMapReaderFactory, DOMCMapReaderFactory };\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 { getRGB, isDataScheme, SVG_NS } from \"./display_utils.js\";\nimport { unreachable, updateUrlHash, Util, warn } from \"../shared/util.js\";\n\nclass BaseFilterFactory {\n constructor() {\n if (\n (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) &&\n this.constructor === BaseFilterFactory\n ) {\n unreachable(\"Cannot initialize BaseFilterFactory.\");\n }\n }\n\n addFilter(maps) {\n return \"none\";\n }\n\n addHCMFilter(fgColor, bgColor) {\n return \"none\";\n }\n\n addAlphaFilter(map) {\n return \"none\";\n }\n\n addLuminosityFilter(map) {\n return \"none\";\n }\n\n addHighlightHCMFilter(filterName, fgColor, bgColor, newFgColor, newBgColor) {\n return \"none\";\n }\n\n destroy(keepHCM = false) {}\n}\n\n/**\n * FilterFactory aims to create some SVG filters we can use when drawing an\n * image (or whatever) on a canvas.\n * Filters aren't applied with ctx.putImageData because it just overwrites the\n * underlying pixels.\n * With these filters, it's possible for example to apply some transfer maps on\n * an image without the need to apply them on the pixel arrays: the renderer\n * does the magic for us.\n */\nclass DOMFilterFactory extends BaseFilterFactory {\n #baseUrl;\n\n #_cache;\n\n #_defs;\n\n #docId;\n\n #document;\n\n #_hcmCache;\n\n #id = 0;\n\n constructor({ docId, ownerDocument = globalThis.document }) {\n super();\n this.#docId = docId;\n this.#document = ownerDocument;\n }\n\n get #cache() {\n return (this.#_cache ||= new Map());\n }\n\n get #hcmCache() {\n return (this.#_hcmCache ||= new Map());\n }\n\n get #defs() {\n if (!this.#_defs) {\n const div = this.#document.createElement(\"div\");\n const { style } = div;\n style.visibility = \"hidden\";\n style.contain = \"strict\";\n style.width = style.height = 0;\n style.position = \"absolute\";\n style.top = style.left = 0;\n style.zIndex = -1;\n\n const svg = this.#document.createElementNS(SVG_NS, \"svg\");\n svg.setAttribute(\"width\", 0);\n svg.setAttribute(\"height\", 0);\n this.#_defs = this.#document.createElementNS(SVG_NS, \"defs\");\n div.append(svg);\n svg.append(this.#_defs);\n this.#document.body.append(div);\n }\n return this.#_defs;\n }\n\n #createTables(maps) {\n if (maps.length === 1) {\n const mapR = maps[0];\n const buffer = new Array(256);\n for (let i = 0; i < 256; i++) {\n buffer[i] = mapR[i] / 255;\n }\n\n const table = buffer.join(\",\");\n return [table, table, table];\n }\n\n const [mapR, mapG, mapB] = maps;\n const bufferR = new Array(256);\n const bufferG = new Array(256);\n const bufferB = new Array(256);\n for (let i = 0; i < 256; i++) {\n bufferR[i] = mapR[i] / 255;\n bufferG[i] = mapG[i] / 255;\n bufferB[i] = mapB[i] / 255;\n }\n return [bufferR.join(\",\"), bufferG.join(\",\"), bufferB.join(\",\")];\n }\n\n #createUrl(id) {\n if (this.#baseUrl === undefined) {\n // Unless a `<base>`-element is present a relative URL should work.\n this.#baseUrl = \"\";\n\n const url = this.#document.URL;\n if (url !== this.#document.baseURI) {\n if (isDataScheme(url)) {\n warn('#createUrl: ignore \"data:\"-URL for performance reasons.');\n } else {\n this.#baseUrl = updateUrlHash(url, \"\");\n }\n }\n }\n return `url(${this.#baseUrl}#${id})`;\n }\n\n addFilter(maps) {\n if (!maps) {\n return \"none\";\n }\n\n // When a page is zoomed the page is re-drawn but the maps are likely\n // the same.\n let value = this.#cache.get(maps);\n if (value) {\n return value;\n }\n\n const [tableR, tableG, tableB] = this.#createTables(maps);\n const key = maps.length === 1 ? tableR : `${tableR}${tableG}${tableB}`;\n\n value = this.#cache.get(key);\n if (value) {\n this.#cache.set(maps, value);\n return value;\n }\n\n // We create a SVG filter: feComponentTransferElement\n // https://www.w3.org/TR/SVG11/filters.html#feComponentTransferElement\n\n const id = `g_${this.#docId}_transfer_map_${this.#id++}`;\n const url = this.#createUrl(id);\n this.#cache.set(maps, url);\n this.#cache.set(key, url);\n\n const filter = this.#createFilter(id);\n this.#addTransferMapConversion(tableR, tableG, tableB, filter);\n\n return url;\n }\n\n addHCMFilter(fgColor, bgColor) {\n const key = `${fgColor}-${bgColor}`;\n const filterName = \"base\";\n let info = this.#hcmCache.get(filterName);\n if (info?.key === key) {\n return info.url;\n }\n\n if (info) {\n info.filter?.remove();\n info.key = key;\n info.url = \"none\";\n info.filter = null;\n } else {\n info = {\n key,\n url: \"none\",\n filter: null,\n };\n this.#hcmCache.set(filterName, info);\n }\n\n if (!fgColor || !bgColor) {\n return info.url;\n }\n\n const fgRGB = this.#getRGB(fgColor);\n fgColor = Util.makeHexColor(...fgRGB);\n const bgRGB = this.#getRGB(bgColor);\n bgColor = Util.makeHexColor(...bgRGB);\n this.#defs.style.color = \"\";\n\n if (\n (fgColor === \"#000000\" && bgColor === \"#ffffff\") ||\n fgColor === bgColor\n ) {\n return info.url;\n }\n\n // https://developer.mozilla.org/en-US/docs/Web/Accessibility/Understanding_Colors_and_Luminance\n //\n // Relative luminance:\n // https://www.w3.org/TR/WCAG20/#relativeluminancedef\n //\n // We compute the rounded luminance of the default background color.\n // Then for every color in the pdf, if its rounded luminance is the\n // same as the background one then it's replaced by the new\n // background color else by the foreground one.\n const map = new Array(256);\n for (let i = 0; i <= 255; i++) {\n const x = i / 255;\n map[i] = x <= 0.03928 ? x / 12.92 : ((x + 0.055) / 1.055) ** 2.4;\n }\n const table = map.join(\",\");\n\n const id = `g_${this.#docId}_hcm_filter`;\n const filter = (info.filter = this.#createFilter(id));\n this.#addTransferMapConversion(table, table, table, filter);\n this.#addGrayConversion(filter);\n\n const getSteps = (c, n) => {\n const start = fgRGB[c] / 255;\n const end = bgRGB[c] / 255;\n const arr = new Array(n + 1);\n for (let i = 0; i <= n; i++) {\n arr[i] = start + (i / n) * (end - start);\n }\n return arr.join(\",\");\n };\n this.#addTransferMapConversion(\n getSteps(0, 5),\n getSteps(1, 5),\n getSteps(2, 5),\n filter\n );\n\n info.url = this.#createUrl(id);\n return info.url;\n }\n\n addAlphaFilter(map) {\n // When a page is zoomed the page is re-drawn but the maps are likely\n // the same.\n let value = this.#cache.get(map);\n if (value) {\n return value;\n }\n\n const [tableA] = this.#createTables([map]);\n const key = `alpha_${tableA}`;\n\n value = this.#cache.get(key);\n if (value) {\n this.#cache.set(map, value);\n return value;\n }\n\n const id = `g_${this.#docId}_alpha_map_${this.#id++}`;\n const url = this.#createUrl(id);\n this.#cache.set(map, url);\n this.#cache.set(key, url);\n\n const filter = this.#createFilter(id);\n this.#addTransferMapAlphaConversion(tableA, filter);\n\n return url;\n }\n\n addLuminosityFilter(map) {\n // When a page is zoomed the page is re-drawn but the maps are likely\n // the same.\n let value = this.#cache.get(map || \"luminosity\");\n if (value) {\n return value;\n }\n\n let tableA, key;\n if (map) {\n [tableA] = this.#createTables([map]);\n key = `luminosity_${tableA}`;\n } else {\n key = \"luminosity\";\n }\n\n value = this.#cache.get(key);\n if (value) {\n this.#cache.set(map, value);\n return value;\n }\n\n const id = `g_${this.#docId}_luminosity_map_${this.#id++}`;\n const url = this.#createUrl(id);\n this.#cache.set(map, url);\n this.#cache.set(key, url);\n\n const filter = this.#createFilter(id);\n this.#addLuminosityConversion(filter);\n if (map) {\n this.#addTransferMapAlphaConversion(tableA, filter);\n }\n\n return url;\n }\n\n addHighlightHCMFilter(filterName, fgColor, bgColor, newFgColor, newBgColor) {\n const key = `${fgColor}-${bgColor}-${newFgColor}-${newBgColor}`;\n let info = this.#hcmCache.get(filterName);\n if (info?.key === key) {\n return info.url;\n }\n\n if (info) {\n info.filter?.remove();\n info.key = key;\n info.url = \"none\";\n info.filter = null;\n } else {\n info = {\n key,\n url: \"none\",\n filter: null,\n };\n this.#hcmCache.set(filterName, info);\n }\n\n if (!fgColor || !bgColor) {\n return info.url;\n }\n\n const [fgRGB, bgRGB] = [fgColor, bgColor].map(this.#getRGB.bind(this));\n let fgGray = Math.round(\n 0.2126 * fgRGB[0] + 0.7152 * fgRGB[1] + 0.0722 * fgRGB[2]\n );\n let bgGray = Math.round(\n 0.2126 * bgRGB[0] + 0.7152 * bgRGB[1] + 0.0722 * bgRGB[2]\n );\n let [newFgRGB, newBgRGB] = [newFgColor, newBgColor].map(\n this.#getRGB.bind(this)\n );\n if (bgGray < fgGray) {\n [fgGray, bgGray, newFgRGB, newBgRGB] = [\n bgGray,\n fgGray,\n newBgRGB,\n newFgRGB,\n ];\n }\n this.#defs.style.color = \"\";\n\n // Now we can create the filters to highlight some canvas parts.\n // The colors in the pdf will almost be Canvas and CanvasText, hence we\n // want to filter them to finally get Highlight and HighlightText.\n // Since we're in HCM the background color and the foreground color should\n // be really different when converted to grayscale (if they're not then it\n // means that we've a poor contrast). Once the canvas colors are converted\n // to grayscale we can easily map them on their new colors.\n // The grayscale step is important because if we've something like:\n // fgColor = #FF....\n // bgColor = #FF....\n // then we are enable to map the red component on the new red components\n // which can be different.\n\n const getSteps = (fg, bg, n) => {\n const arr = new Array(256);\n const step = (bgGray - fgGray) / n;\n const newStart = fg / 255;\n const newStep = (bg - fg) / (255 * n);\n let prev = 0;\n for (let i = 0; i <= n; i++) {\n const k = Math.round(fgGray + i * step);\n const value = newStart + i * newStep;\n for (let j = prev; j <= k; j++) {\n arr[j] = value;\n }\n prev = k + 1;\n }\n for (let i = prev; i < 256; i++) {\n arr[i] = arr[prev - 1];\n }\n return arr.join(\",\");\n };\n\n const id = `g_${this.#docId}_hcm_${filterName}_filter`;\n const filter = (info.filter = this.#createFilter(id));\n\n this.#addGrayConversion(filter);\n this.#addTransferMapConversion(\n getSteps(newFgRGB[0], newBgRGB[0], 5),\n getSteps(newFgRGB[1], newBgRGB[1], 5),\n getSteps(newFgRGB[2], newBgRGB[2], 5),\n filter\n );\n\n info.url = this.#createUrl(id);\n return info.url;\n }\n\n destroy(keepHCM = false) {\n if (keepHCM && this.#_hcmCache?.size) {\n return;\n }\n this.#_defs?.parentNode.parentNode.remove();\n this.#_defs = null;\n\n this.#_cache?.clear();\n this.#_cache = null;\n\n this.#_hcmCache?.clear();\n this.#_hcmCache = null;\n\n this.#id = 0;\n }\n\n #addLuminosityConversion(filter) {\n const feColorMatrix = this.#document.createElementNS(\n SVG_NS,\n \"feColorMatrix\"\n );\n feColorMatrix.setAttribute(\"type\", \"matrix\");\n feColorMatrix.setAttribute(\n \"values\",\n \"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.3 0.59 0.11 0 0\"\n );\n filter.append(feColorMatrix);\n }\n\n #addGrayConversion(filter) {\n const feColorMatrix = this.#document.createElementNS(\n SVG_NS,\n \"feColorMatrix\"\n );\n feColorMatrix.setAttribute(\"type\", \"matrix\");\n feColorMatrix.setAttribute(\n \"values\",\n \"0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0 0 0 1 0\"\n );\n filter.append(feColorMatrix);\n }\n\n #createFilter(id) {\n const filter = this.#document.createElementNS(SVG_NS, \"filter\");\n filter.setAttribute(\"color-interpolation-filters\", \"sRGB\");\n filter.setAttribute(\"id\", id);\n this.#defs.append(filter);\n\n return filter;\n }\n\n #appendFeFunc(feComponentTransfer, func, table) {\n const feFunc = this.#document.createElementNS(SVG_NS, func);\n feFunc.setAttribute(\"type\", \"discrete\");\n feFunc.setAttribute(\"tableValues\", table);\n feComponentTransfer.append(feFunc);\n }\n\n #addTransferMapConversion(rTable, gTable, bTable, filter) {\n const feComponentTransfer = this.#document.createElementNS(\n SVG_NS,\n \"feComponentTransfer\"\n );\n filter.append(feComponentTransfer);\n this.#appendFeFunc(feComponentTransfer, \"feFuncR\", rTable);\n this.#appendFeFunc(feComponentTransfer, \"feFuncG\", gTable);\n this.#appendFeFunc(feComponentTransfer, \"feFuncB\", bTable);\n }\n\n #addTransferMapAlphaConversion(aTable, filter) {\n const feComponentTransfer = this.#document.createElementNS(\n SVG_NS,\n \"feComponentTransfer\"\n );\n filter.append(feComponentTransfer);\n this.#appendFeFunc(feComponentTransfer, \"feFuncA\", aTable);\n }\n\n #getRGB(color) {\n this.#defs.style.color = color;\n return getRGB(getComputedStyle(this.#defs).getPropertyValue(\"color\"));\n }\n}\n\nexport { BaseFilterFactory, DOMFilterFactory };\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 { fetchData } from \"./display_utils.js\";\nimport { unreachable } from \"../shared/util.js\";\n\nclass BaseStandardFontDataFactory {\n constructor({ baseUrl = null }) {\n if (\n (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) &&\n this.constructor === BaseStandardFontDataFactory\n ) {\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 \"Ensure that 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._fetch(url).catch(reason => {\n throw new Error(`Unable to load font data at: ${url}`);\n });\n }\n\n /**\n * @ignore\n * @returns {Promise<Uint8Array>}\n */\n async _fetch(url) {\n unreachable(\"Abstract method `_fetch` called.\");\n }\n}\n\nclass DOMStandardFontDataFactory extends BaseStandardFontDataFactory {\n /**\n * @ignore\n */\n async _fetch(url) {\n const data = await fetchData(url, /* type = */ \"arraybuffer\");\n return new Uint8Array(data);\n }\n}\n\nexport { BaseStandardFontDataFactory, DOMStandardFontDataFactory };\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 { fetchData } from \"./display_utils.js\";\nimport { unreachable } from \"../shared/util.js\";\n\nclass BaseWasmFactory {\n constructor({ baseUrl = null }) {\n if (\n (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) &&\n this.constructor === BaseWasmFactory\n ) {\n unreachable(\"Cannot initialize BaseWasmFactory.\");\n }\n this.baseUrl = baseUrl;\n }\n\n async fetch({ filename }) {\n if (!this.baseUrl) {\n throw new Error(\"Ensure that the `wasmUrl` API parameter is provided.\");\n }\n if (!filename) {\n throw new Error(\"Wasm filename must be specified.\");\n }\n const url = `${this.baseUrl}${filename}`;\n\n return this._fetch(url).catch(reason => {\n throw new Error(`Unable to load wasm data at: ${url}`);\n });\n }\n\n /**\n * @ignore\n * @returns {Promise<Uint8Array>}\n */\n async _fetch(url) {\n unreachable(\"Abstract method `_fetch` called.\");\n }\n}\n\nclass DOMWasmFactory extends BaseWasmFactory {\n /**\n * @ignore\n */\n async _fetch(url) {\n const data = await fetchData(url, /* type = */ \"arraybuffer\");\n return new Uint8Array(data);\n }\n}\n\nexport { BaseWasmFactory, DOMWasmFactory };\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 process */\n\nimport { isNodeJS, warn } from \"../shared/util.js\";\nimport { BaseCanvasFactory } from \"./canvas_factory.js\";\nimport { BaseCMapReaderFactory } from \"./cmap_reader_factory.js\";\nimport { BaseFilterFactory } from \"./filter_factory.js\";\nimport { BaseStandardFontDataFactory } from \"./standard_fontdata_factory.js\";\nimport { BaseWasmFactory } from \"./wasm_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\nif (isNodeJS) {\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"SKIP_BABEL\")) {\n warn(\"Please use the `legacy` build in Node.js environments.\");\n } else {\n let canvas;\n try {\n const require = process\n .getBuiltinModule(\"module\")\n .createRequire(import.meta.url);\n\n try {\n canvas = require(\"@napi-rs/canvas\");\n } catch (ex) {\n warn(`Cannot load \"@napi-rs/canvas\" package: \"${ex}\".`);\n }\n } catch (ex) {\n warn(`Cannot access the \\`require\\` function: \"${ex}\".`);\n }\n\n if (!globalThis.DOMMatrix) {\n if (canvas?.DOMMatrix) {\n globalThis.DOMMatrix = canvas.DOMMatrix;\n } else {\n warn(\"Cannot polyfill `DOMMatrix`, rendering may be broken.\");\n }\n }\n if (!globalThis.ImageData) {\n if (canvas?.ImageData) {\n globalThis.ImageData = canvas.ImageData;\n } else {\n warn(\"Cannot polyfill `ImageData`, rendering may be broken.\");\n }\n }\n if (!globalThis.Path2D) {\n if (canvas?.Path2D) {\n globalThis.Path2D = canvas.Path2D;\n } else {\n warn(\"Cannot polyfill `Path2D`, rendering may be broken.\");\n }\n }\n if (!globalThis.navigator?.language) {\n globalThis.navigator = {\n language: \"en-US\",\n platform: \"\",\n userAgent: \"\",\n };\n }\n }\n}\n\nasync function fetchData(url) {\n const fs = process.getBuiltinModule(\"fs\");\n const data = await fs.promises.readFile(url);\n return new Uint8Array(data);\n}\n\nclass NodeFilterFactory extends BaseFilterFactory {}\n\nclass NodeCanvasFactory extends BaseCanvasFactory {\n /**\n * @ignore\n */\n _createCanvas(width, height) {\n const require = process\n .getBuiltinModule(\"module\")\n .createRequire(import.meta.url);\n const canvas = require(\"@napi-rs/canvas\");\n return canvas.createCanvas(width, height);\n }\n}\n\nclass NodeCMapReaderFactory extends BaseCMapReaderFactory {\n /**\n * @ignore\n */\n async _fetch(url) {\n return fetchData(url);\n }\n}\n\nclass NodeStandardFontDataFactory extends BaseStandardFontDataFactory {\n /**\n * @ignore\n */\n async _fetch(url) {\n return fetchData(url);\n }\n}\n\nclass NodeWasmFactory extends BaseWasmFactory {\n /**\n * @ignore\n */\n async _fetch(url) {\n return fetchData(url);\n }\n}\n\nexport {\n fetchData,\n NodeCanvasFactory,\n NodeCMapReaderFactory,\n NodeFilterFactory,\n NodeStandardFontDataFactory,\n NodeWasmFactory,\n};\n","import { Util } from \"../shared/util.js\";\n\nconst FORCED_DEPENDENCY_LABEL = \"__forcedDependency\";\n\n/**\n * @typedef {\"lineWidth\" | \"lineCap\" | \"lineJoin\" | \"miterLimit\" | \"dash\" |\n * \"strokeAlpha\" | \"fillColor\" | \"fillAlpha\" | \"globalCompositeOperation\" |\n * \"path\" | \"filter\"} SimpleDependency\n */\n\n/**\n * @typedef {\"transform\" | \"moveText\" | \"sameLineText\"} IncrementalDependency\n */\n\n/**\n * @typedef {IncrementalDependency |\n * typeof FORCED_DEPENDENCY_LABEL} InternalIncrementalDependency\n */\nclass CanvasDependencyTracker {\n /** @type {Record<SimpleDependency, number>} */\n #simple = { __proto__: null };\n\n /** @type {Record<InternalIncrementalDependency , number[]>} */\n #incremental = {\n __proto__: null,\n transform: [],\n moveText: [],\n sameLineText: [],\n [FORCED_DEPENDENCY_LABEL]: [],\n };\n\n #namedDependencies = new Map();\n\n #savesStack = [];\n\n #markedContentStack = [];\n\n #baseTransformStack = [[1, 0, 0, 1, 0, 0]];\n\n #clipBox = [-Infinity, -Infinity, Infinity, Infinity];\n\n // Float32Array<minX, minY, maxX, maxY>\n #pendingBBox = new Float64Array([Infinity, Infinity, -Infinity, -Infinity]);\n\n #pendingBBoxIdx = -1;\n\n #pendingDependencies = new Set();\n\n #operations = new Map();\n\n #fontBBoxTrustworthy = new Map();\n\n #canvasWidth;\n\n #canvasHeight;\n\n constructor(canvas) {\n this.#canvasWidth = canvas.width;\n this.#canvasHeight = canvas.height;\n }\n\n save(opIdx) {\n this.#simple = { __proto__: this.#simple };\n this.#incremental = {\n __proto__: this.#incremental,\n transform: { __proto__: this.#incremental.transform },\n moveText: { __proto__: this.#incremental.moveText },\n sameLineText: { __proto__: this.#incremental.sameLineText },\n [FORCED_DEPENDENCY_LABEL]: {\n __proto__: this.#incremental[FORCED_DEPENDENCY_LABEL],\n },\n };\n this.#clipBox = { __proto__: this.#clipBox };\n this.#savesStack.push([opIdx, null]);\n\n return this;\n }\n\n restore(opIdx) {\n const previous = Object.getPrototypeOf(this.#simple);\n if (previous === null) {\n // Sometimes we call more .restore() than .save(), for\n // example when using CanvasGraphics' #restoreInitialState()\n return this;\n }\n this.#simple = previous;\n this.#incremental = Object.getPrototypeOf(this.#incremental);\n this.#clipBox = Object.getPrototypeOf(this.#clipBox);\n\n const lastPair = this.#savesStack.pop();\n if (lastPair !== undefined) {\n lastPair[1] = opIdx;\n }\n\n return this;\n }\n\n /**\n * @param {number} idx\n */\n recordOpenMarker(idx) {\n this.#savesStack.push([idx, null]);\n return this;\n }\n\n getOpenMarker() {\n if (this.#savesStack.length === 0) {\n return null;\n }\n return this.#savesStack.at(-1)[0];\n }\n\n recordCloseMarker(idx) {\n const lastPair = this.#savesStack.pop();\n if (lastPair !== undefined) {\n lastPair[1] = idx;\n }\n return this;\n }\n\n // Marked content needs a separate stack from save/restore, because they\n // form two independent trees.\n beginMarkedContent(opIdx) {\n this.#markedContentStack.push([opIdx, null]);\n return this;\n }\n\n endMarkedContent(opIdx) {\n const lastPair = this.#markedContentStack.pop();\n if (lastPair !== undefined) {\n lastPair[1] = opIdx;\n }\n return this;\n }\n\n pushBaseTransform(ctx) {\n this.#baseTransformStack.push(\n Util.multiplyByDOMMatrix(\n this.#baseTransformStack.at(-1),\n ctx.getTransform()\n )\n );\n return this;\n }\n\n popBaseTransform() {\n if (this.#baseTransformStack.length > 1) {\n this.#baseTransformStack.pop();\n }\n return this;\n }\n\n /**\n * @param {SimpleDependency} name\n * @param {number} idx\n */\n recordSimpleData(name, idx) {\n this.#simple[name] = idx;\n return this;\n }\n\n /**\n * @param {IncrementalDependency} name\n * @param {number} idx\n */\n recordIncrementalData(name, idx) {\n this.#incremental[name].push(idx);\n return this;\n }\n\n /**\n * @param {IncrementalDependency} name\n * @param {number} idx\n */\n resetIncrementalData(name, idx) {\n this.#incremental[name].length = 0;\n return this;\n }\n\n recordNamedData(name, idx) {\n this.#namedDependencies.set(name, idx);\n return this;\n }\n\n // All next operations, until the next .restore(), will depend on this\n recordFutureForcedDependency(name, idx) {\n this.recordIncrementalData(FORCED_DEPENDENCY_LABEL, idx);\n return this;\n }\n\n // All next operations, until the next .restore(), will depend on all\n // the already recorded data with the given names.\n inheritSimpleDataAsFutureForcedDependencies(names) {\n for (const name of names) {\n if (name in this.#simple) {\n this.recordFutureForcedDependency(name, this.#simple[name]);\n }\n }\n return this;\n }\n\n inheritPendingDependenciesAsFutureForcedDependencies() {\n for (const dep of this.#pendingDependencies) {\n this.recordFutureForcedDependency(FORCED_DEPENDENCY_LABEL, dep);\n }\n return this;\n }\n\n resetBBox(idx) {\n this.#pendingBBoxIdx = idx;\n this.#pendingBBox[0] = Infinity;\n this.#pendingBBox[1] = Infinity;\n this.#pendingBBox[2] = -Infinity;\n this.#pendingBBox[3] = -Infinity;\n return this;\n }\n\n get hasPendingBBox() {\n return this.#pendingBBoxIdx !== -1;\n }\n\n recordClipBox(idx, ctx, minX, maxX, minY, maxY) {\n const transform = Util.multiplyByDOMMatrix(\n this.#baseTransformStack.at(-1),\n ctx.getTransform()\n );\n const clipBox = [Infinity, Infinity, -Infinity, -Infinity];\n Util.axialAlignedBoundingBox([minX, minY, maxX, maxY], transform, clipBox);\n const intersection = Util.intersect(this.#clipBox, clipBox);\n if (intersection) {\n this.#clipBox[0] = intersection[0];\n this.#clipBox[1] = intersection[1];\n this.#clipBox[2] = intersection[2];\n this.#clipBox[3] = intersection[3];\n } else {\n this.#clipBox[0] = this.#clipBox[1] = Infinity;\n this.#clipBox[2] = this.#clipBox[3] = -Infinity;\n }\n return this;\n }\n\n recordBBox(idx, ctx, minX, maxX, minY, maxY) {\n const clipBox = this.#clipBox;\n if (clipBox[0] === Infinity) {\n return this;\n }\n\n const transform = Util.multiplyByDOMMatrix(\n this.#baseTransformStack.at(-1),\n ctx.getTransform()\n );\n if (clipBox[0] === -Infinity) {\n Util.axialAlignedBoundingBox(\n [minX, minY, maxX, maxY],\n transform,\n this.#pendingBBox\n );\n return this;\n }\n\n const bbox = [Infinity, Infinity, -Infinity, -Infinity];\n Util.axialAlignedBoundingBox([minX, minY, maxX, maxY], transform, bbox);\n this.#pendingBBox[0] = Math.min(\n this.#pendingBBox[0],\n Math.max(bbox[0], clipBox[0])\n );\n this.#pendingBBox[1] = Math.min(\n this.#pendingBBox[1],\n Math.max(bbox[1], clipBox[1])\n );\n this.#pendingBBox[2] = Math.max(\n this.#pendingBBox[2],\n Math.min(bbox[2], clipBox[2])\n );\n this.#pendingBBox[3] = Math.max(\n this.#pendingBBox[3],\n Math.min(bbox[3], clipBox[3])\n );\n return this;\n }\n\n recordCharacterBBox(idx, ctx, font, scale = 1, x = 0, y = 0, getMeasure) {\n const fontBBox = font.bbox;\n let isBBoxTrustworthy;\n let computedBBox;\n\n if (fontBBox) {\n isBBoxTrustworthy =\n // Only use the bounding box defined by the font if it\n // has a non-empty area.\n fontBBox[2] !== fontBBox[0] &&\n fontBBox[3] !== fontBBox[1] &&\n this.#fontBBoxTrustworthy.get(font);\n\n if (isBBoxTrustworthy !== false) {\n computedBBox = [0, 0, 0, 0];\n Util.axialAlignedBoundingBox(fontBBox, font.fontMatrix, computedBBox);\n if (scale !== 1 || x !== 0 || y !== 0) {\n Util.scaleMinMax([scale, 0, 0, -scale, x, y], computedBBox);\n }\n\n if (isBBoxTrustworthy) {\n return this.recordBBox(\n idx,\n ctx,\n computedBBox[0],\n computedBBox[2],\n computedBBox[1],\n computedBBox[3]\n );\n }\n }\n }\n\n if (!getMeasure) {\n // We have no way of telling how big this character actually is, record\n // a full page bounding box.\n return this.recordFullPageBBox(idx);\n }\n\n const measure = getMeasure();\n\n if (fontBBox && computedBBox && isBBoxTrustworthy === undefined) {\n // If it's the first time we can compare the font bbox with the actual\n // bbox measured when drawing it, check if the one recorded in the font\n // is large enough to cover the actual bbox. If it is, we assume that the\n // font is well-formed and we can use the declared bbox without having to\n // measure it again for every character.\n isBBoxTrustworthy =\n computedBBox[0] <= x - measure.actualBoundingBoxLeft &&\n computedBBox[2] >= x + measure.actualBoundingBoxRight &&\n computedBBox[1] <= y - measure.actualBoundingBoxAscent &&\n computedBBox[3] >= y + measure.actualBoundingBoxDescent;\n this.#fontBBoxTrustworthy.set(font, isBBoxTrustworthy);\n if (isBBoxTrustworthy) {\n return this.recordBBox(\n idx,\n ctx,\n computedBBox[0],\n computedBBox[2],\n computedBBox[1],\n computedBBox[3]\n );\n }\n }\n\n // The font has no bbox or it is not trustworthy, so we need to\n // return the bounding box based on .measureText().\n return this.recordBBox(\n idx,\n ctx,\n x - measure.actualBoundingBoxLeft,\n x + measure.actualBoundingBoxRight,\n y - measure.actualBoundingBoxAscent,\n y + measure.actualBoundingBoxDescent\n );\n }\n\n recordFullPageBBox(idx) {\n this.#pendingBBox[0] = Math.max(0, this.#clipBox[0]);\n this.#pendingBBox[1] = Math.max(0, this.#clipBox[1]);\n this.#pendingBBox[2] = Math.min(this.#canvasWidth, this.#clipBox[2]);\n this.#pendingBBox[3] = Math.min(this.#canvasHeight, this.#clipBox[3]);\n\n return this;\n }\n\n getSimpleIndex(dependencyName) {\n return this.#simple[dependencyName];\n }\n\n recordDependencies(idx, dependencyNames) {\n const pendingDependencies = this.#pendingDependencies;\n const simple = this.#simple;\n const incremental = this.#incremental;\n for (const name of dependencyNames) {\n if (name in this.#simple) {\n pendingDependencies.add(simple[name]);\n } else if (name in incremental) {\n incremental[name].forEach(pendingDependencies.add, pendingDependencies);\n }\n }\n\n return this;\n }\n\n copyDependenciesFromIncrementalOperation(idx, name) {\n const operations = this.#operations;\n const pendingDependencies = this.#pendingDependencies;\n for (const depIdx of this.#incremental[name]) {\n operations\n .get(depIdx)\n .dependencies.forEach(\n pendingDependencies.add,\n pendingDependencies.add(depIdx)\n );\n }\n return this;\n }\n\n recordNamedDependency(idx, name) {\n if (this.#namedDependencies.has(name)) {\n this.#pendingDependencies.add(this.#namedDependencies.get(name));\n }\n\n return this;\n }\n\n /**\n * @param {number} idx\n */\n recordOperation(idx, preserveBbox = false) {\n this.recordDependencies(idx, [FORCED_DEPENDENCY_LABEL]);\n const dependencies = new Set(this.#pendingDependencies);\n const pairs = this.#savesStack.concat(this.#markedContentStack);\n const bbox =\n this.#pendingBBoxIdx === idx\n ? {\n minX: this.#pendingBBox[0],\n minY: this.#pendingBBox[1],\n maxX: this.#pendingBBox[2],\n maxY: this.#pendingBBox[3],\n }\n : null;\n this.#operations.set(idx, { bbox, pairs, dependencies });\n if (!preserveBbox) {\n this.#pendingBBoxIdx = -1;\n }\n this.#pendingDependencies.clear();\n\n return this;\n }\n\n bboxToClipBoxDropOperation(idx) {\n if (this.#pendingBBoxIdx !== -1) {\n this.#pendingBBoxIdx = -1;\n\n this.#clipBox[0] = Math.max(this.#clipBox[0], this.#pendingBBox[0]);\n this.#clipBox[1] = Math.max(this.#clipBox[1], this.#pendingBBox[1]);\n this.#clipBox[2] = Math.min(this.#clipBox[2], this.#pendingBBox[2]);\n this.#clipBox[3] = Math.min(this.#clipBox[3], this.#pendingBBox[3]);\n }\n this.#pendingDependencies.clear();\n return this;\n }\n\n _takePendingDependencies() {\n const pendingDependencies = this.#pendingDependencies;\n this.#pendingDependencies = new Set();\n return pendingDependencies;\n }\n\n _extractOperation(idx) {\n const operation = this.#operations.get(idx);\n this.#operations.delete(idx);\n return operation;\n }\n\n _pushPendingDependencies(dependencies) {\n for (const dep of dependencies) {\n this.#pendingDependencies.add(dep);\n }\n }\n\n take() {\n this.#fontBBoxTrustworthy.clear();\n return Array.from(\n this.#operations,\n ([idx, { bbox, pairs, dependencies }]) => {\n pairs.forEach(pair => pair.forEach(dependencies.add, dependencies));\n dependencies.delete(idx);\n return {\n minX: (bbox?.minX ?? 0) / this.#canvasWidth,\n maxX: (bbox?.maxX ?? this.#canvasWidth) / this.#canvasWidth,\n minY: (bbox?.minY ?? 0) / this.#canvasHeight,\n maxY: (bbox?.maxY ?? this.#canvasHeight) / this.#canvasHeight,\n dependencies: Array.from(dependencies).sort((a, b) => a - b),\n idx,\n };\n }\n );\n }\n}\n\n/**\n * Used to track dependencies of nested operations list, that\n * should actually all map to the index of the operation that\n * contains the nested list.\n *\n * @implements {CanvasDependencyTracker}\n */\nclass CanvasNestedDependencyTracker {\n /** @type {CanvasDependencyTracker} */\n #dependencyTracker;\n\n /** @type {number} */\n #opIdx;\n\n #nestingLevel = 0;\n\n #outerDependencies;\n\n #savesLevel = 0;\n\n constructor(dependencyTracker, opIdx) {\n if (dependencyTracker instanceof CanvasNestedDependencyTracker) {\n // The goal of CanvasNestedDependencyTracker is to collapse all operations\n // into a single one. If we are already in a\n // CanvasNestedDependencyTracker, that is already happening.\n return dependencyTracker;\n }\n\n this.#dependencyTracker = dependencyTracker;\n this.#outerDependencies = dependencyTracker._takePendingDependencies();\n this.#opIdx = opIdx;\n }\n\n save(opIdx) {\n this.#savesLevel++;\n this.#dependencyTracker.save(this.#opIdx);\n return this;\n }\n\n restore(opIdx) {\n if (this.#savesLevel > 0) {\n this.#dependencyTracker.restore(this.#opIdx);\n this.#savesLevel--;\n }\n return this;\n }\n\n recordOpenMarker(idx) {\n this.#nestingLevel++;\n return this;\n }\n\n getOpenMarker() {\n return this.#nestingLevel > 0\n ? this.#opIdx\n : this.#dependencyTracker.getOpenMarker();\n }\n\n recordCloseMarker(idx) {\n this.#nestingLevel--;\n return this;\n }\n\n beginMarkedContent(opIdx) {\n return this;\n }\n\n endMarkedContent(opIdx) {\n return this;\n }\n\n pushBaseTransform(ctx) {\n this.#dependencyTracker.pushBaseTransform(ctx);\n return this;\n }\n\n popBaseTransform() {\n this.#dependencyTracker.popBaseTransform();\n return this;\n }\n\n /**\n * @param {SimpleDependency} name\n * @param {number} idx\n */\n recordSimpleData(name, idx) {\n this.#dependencyTracker.recordSimpleData(name, this.#opIdx);\n return this;\n }\n\n /**\n * @param {IncrementalDependency} name\n * @param {number} idx\n */\n recordIncrementalData(name, idx) {\n this.#dependencyTracker.recordIncrementalData(name, this.#opIdx);\n return this;\n }\n\n /**\n * @param {IncrementalDependency} name\n * @param {number} idx\n */\n resetIncrementalData(name, idx) {\n this.#dependencyTracker.resetIncrementalData(name, this.#opIdx);\n return this;\n }\n\n recordNamedData(name, idx) {\n // Nested dependencies are not visible to the outside.\n return this;\n }\n\n // All next operations, until the next .restore(), will depend on this\n recordFutureForcedDependency(name, idx) {\n this.#dependencyTracker.recordFutureForcedDependency(name, this.#opIdx);\n return this;\n }\n\n // All next operations, until the next .restore(), will depend on all\n // the already recorded data with the given names.\n inheritSimpleDataAsFutureForcedDependencies(names) {\n this.#dependencyTracker.inheritSimpleDataAsFutureForcedDependencies(names);\n return this;\n }\n\n inheritPendingDependenciesAsFutureForcedDependencies() {\n this.#dependencyTracker.inheritPendingDependenciesAsFutureForcedDependencies();\n return this;\n }\n\n resetBBox(idx) {\n if (!this.#dependencyTracker.hasPendingBBox) {\n this.#dependencyTracker.resetBBox(this.#opIdx);\n }\n return this;\n }\n\n get hasPendingBBox() {\n return this.#dependencyTracker.hasPendingBBox;\n }\n\n recordClipBox(idx, ctx, minX, maxX, minY, maxY) {\n this.#dependencyTracker.recordClipBox(\n this.#opIdx,\n ctx,\n minX,\n maxX,\n minY,\n maxY\n );\n return this;\n }\n\n recordBBox(idx, ctx, minX, maxX, minY, maxY) {\n this.#dependencyTracker.recordBBox(\n this.#opIdx,\n ctx,\n minX,\n maxX,\n minY,\n maxY\n );\n return this;\n }\n\n recordCharacterBBox(idx, ctx, font, scale, x, y, getMeasure) {\n this.#dependencyTracker.recordCharacterBBox(\n this.#opIdx,\n ctx,\n font,\n scale,\n x,\n y,\n getMeasure\n );\n return this;\n }\n\n recordFullPageBBox(idx) {\n this.#dependencyTracker.recordFullPageBBox(this.#opIdx);\n return this;\n }\n\n getSimpleIndex(dependencyName) {\n return this.#dependencyTracker.getSimpleIndex(dependencyName);\n }\n\n recordDependencies(idx, dependencyNames) {\n this.#dependencyTracker.recordDependencies(this.#opIdx, dependencyNames);\n return this;\n }\n\n copyDependenciesFromIncrementalOperation(idx, name) {\n this.#dependencyTracker.copyDependenciesFromIncrementalOperation(\n this.#opIdx,\n name\n );\n return this;\n }\n\n recordNamedDependency(idx, name) {\n this.#dependencyTracker.recordNamedDependency(this.#opIdx, name);\n return this;\n }\n\n /**\n * @param {number} idx\n * @param {SimpleDependency[]} dependencyNames\n */\n recordOperation(idx) {\n this.#dependencyTracker.recordOperation(this.#opIdx, true);\n const operation = this.#dependencyTracker._extractOperation(this.#opIdx);\n for (const depIdx of operation.dependencies) {\n this.#outerDependencies.add(depIdx);\n }\n this.#outerDependencies.delete(this.#opIdx);\n this.#outerDependencies.delete(null);\n return this;\n }\n\n bboxToClipBoxDropOperation(idx) {\n this.#dependencyTracker.bboxToClipBoxDropOperation(this.#opIdx);\n return this;\n }\n\n recordNestedDependencies() {\n this.#dependencyTracker._pushPendingDependencies(this.#outerDependencies);\n }\n\n take() {\n throw new Error(\"Unreachable\");\n }\n}\n\n/** @satisfies {Record<string, SimpleDependency | IncrementalDependency>} */\nconst Dependencies = {\n stroke: [\n \"path\",\n \"transform\",\n \"filter\",\n \"strokeColor\",\n \"strokeAlpha\",\n \"lineWidth\",\n \"lineCap\",\n \"lineJoin\",\n \"miterLimit\",\n \"dash\",\n ],\n fill: [\n \"path\",\n \"transform\",\n \"filter\",\n \"fillColor\",\n \"fillAlpha\",\n \"globalCompositeOperation\",\n \"SMask\",\n ],\n imageXObject: [\n \"transform\",\n \"SMask\",\n \"filter\",\n \"fillAlpha\",\n \"strokeAlpha\",\n \"globalCompositeOperation\",\n ],\n rawFillPath: [\"filter\", \"fillColor\", \"fillAlpha\"],\n showText: [\n \"transform\",\n \"leading\",\n \"charSpacing\",\n \"wordSpacing\",\n \"hScale\",\n \"textRise\",\n \"moveText\",\n \"textMatrix\",\n \"font\",\n \"filter\",\n \"fillColor\",\n \"textRenderingMode\",\n \"SMask\",\n \"fillAlpha\",\n \"strokeAlpha\",\n \"globalCompositeOperation\",\n // TODO: More\n ],\n transform: [\"transform\"],\n transformAndFill: [\"transform\", \"fillColor\"],\n};\n\nexport { CanvasDependencyTracker, CanvasNestedDependencyTracker, Dependencies };\n","/* Copyright 2014 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { FormatError, info, unreachable, Util } from \"../shared/util.js\";\nimport { getCurrentTransform } from \"./display_utils.js\";\n\nconst PathType = {\n FILL: \"Fill\",\n STROKE: \"Stroke\",\n SHADING: \"Shading\",\n};\n\nfunction applyBoundingBox(ctx, bbox) {\n if (!bbox) {\n return;\n }\n const width = bbox[2] - bbox[0];\n const height = bbox[3] - bbox[1];\n const region = new Path2D();\n region.rect(bbox[0], bbox[1], width, height);\n ctx.clip(region);\n}\n\nclass BaseShadingPattern {\n constructor() {\n if (\n (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) &&\n this.constructor === BaseShadingPattern\n ) {\n unreachable(\"Cannot initialize BaseShadingPattern.\");\n }\n }\n\n isModifyingCurrentTransform() {\n return false;\n }\n\n getPattern() {\n unreachable(\"Abstract method `getPattern` called.\");\n }\n}\n\nclass RadialAxialShadingPattern extends BaseShadingPattern {\n constructor(IR) {\n super();\n this._type = IR[1];\n this._bbox = IR[2];\n this._colorStops = IR[3];\n this._p0 = IR[4];\n this._p1 = IR[5];\n this._r0 = IR[6];\n this._r1 = IR[7];\n this.matrix = null;\n }\n\n _createGradient(ctx) {\n let grad;\n if (this._type === \"axial\") {\n grad = ctx.createLinearGradient(\n this._p0[0],\n this._p0[1],\n this._p1[0],\n this._p1[1]\n );\n } else if (this._type === \"radial\") {\n grad = ctx.createRadialGradient(\n this._p0[0],\n this._p0[1],\n this._r0,\n this._p1[0],\n this._p1[1],\n this._r1\n );\n }\n\n for (const colorStop of this._colorStops) {\n grad.addColorStop(colorStop[0], colorStop[1]);\n }\n return grad;\n }\n\n getPattern(ctx, owner, inverse, pathType) {\n let pattern;\n if (pathType === PathType.STROKE || pathType === PathType.FILL) {\n const ownerBBox = owner.current.getClippedPathBoundingBox(\n pathType,\n getCurrentTransform(ctx)\n ) || [0, 0, 0, 0];\n // Create a canvas that is only as big as the current path. This doesn't\n // allow us to cache the pattern, but it generally creates much smaller\n // canvases and saves memory use. See bug 1722807 for an example.\n const width = Math.ceil(ownerBBox[2] - ownerBBox[0]) || 1;\n const height = Math.ceil(ownerBBox[3] - ownerBBox[1]) || 1;\n\n const tmpCanvas = owner.cachedCanvases.getCanvas(\n \"pattern\",\n width,\n height\n );\n\n const tmpCtx = tmpCanvas.context;\n tmpCtx.clearRect(0, 0, tmpCtx.canvas.width, tmpCtx.canvas.height);\n tmpCtx.beginPath();\n tmpCtx.rect(0, 0, tmpCtx.canvas.width, tmpCtx.canvas.height);\n // Non shading fill patterns are positioned relative to the base transform\n // (usually the page's initial transform), but we may have created a\n // smaller canvas based on the path, so we must account for the shift.\n tmpCtx.translate(-ownerBBox[0], -ownerBBox[1]);\n inverse = Util.transform(inverse, [\n 1,\n 0,\n 0,\n 1,\n ownerBBox[0],\n ownerBBox[1],\n ]);\n\n tmpCtx.transform(...owner.baseTransform);\n if (this.matrix) {\n tmpCtx.transform(...this.matrix);\n }\n applyBoundingBox(tmpCtx, this._bbox);\n\n tmpCtx.fillStyle = this._createGradient(tmpCtx);\n tmpCtx.fill();\n\n pattern = ctx.createPattern(tmpCanvas.canvas, \"no-repeat\");\n const domMatrix = new DOMMatrix(inverse);\n pattern.setTransform(domMatrix);\n } else {\n // Shading fills are applied relative to the current matrix which is also\n // how canvas gradients work, so there's no need to do anything special\n // here.\n applyBoundingBox(ctx, this._bbox);\n pattern = this._createGradient(ctx);\n }\n return pattern;\n }\n}\n\nfunction drawTriangle(data, context, p1, p2, p3, c1, c2, c3) {\n // Very basic Gouraud-shaded triangle rasterization algorithm.\n const coords = context.coords,\n colors = context.colors;\n const bytes = data.data,\n rowSize = data.width * 4;\n let tmp;\n if (coords[p1 + 1] > coords[p2 + 1]) {\n tmp = p1;\n p1 = p2;\n p2 = tmp;\n tmp = c1;\n c1 = c2;\n c2 = tmp;\n }\n if (coords[p2 + 1] > coords[p3 + 1]) {\n tmp = p2;\n p2 = p3;\n p3 = tmp;\n tmp = c2;\n c2 = c3;\n c3 = tmp;\n }\n if (coords[p1 + 1] > coords[p2 + 1]) {\n tmp = p1;\n p1 = p2;\n p2 = tmp;\n tmp = c1;\n c1 = c2;\n c2 = tmp;\n }\n const x1 = (coords[p1] + context.offsetX) * context.scaleX;\n const y1 = (coords[p1 + 1] + context.offsetY) * context.scaleY;\n const x2 = (coords[p2] + context.offsetX) * context.scaleX;\n const y2 = (coords[p2 + 1] + context.offsetY) * context.scaleY;\n const x3 = (coords[p3] + context.offsetX) * context.scaleX;\n const y3 = (coords[p3 + 1] + context.offsetY) * context.scaleY;\n if (y1 >= y3) {\n return;\n }\n const c1r = colors[c1],\n c1g = colors[c1 + 1],\n c1b = colors[c1 + 2];\n const c2r = colors[c2],\n c2g = colors[c2 + 1],\n c2b = colors[c2 + 2];\n const c3r = colors[c3],\n c3g = colors[c3 + 1],\n c3b = colors[c3 + 2];\n\n const minY = Math.round(y1),\n maxY = Math.round(y3);\n let xa, car, cag, cab;\n let xb, cbr, cbg, cbb;\n for (let y = minY; y <= maxY; y++) {\n if (y < y2) {\n const k = y < y1 ? 0 : (y1 - y) / (y1 - y2);\n xa = x1 - (x1 - x2) * k;\n car = c1r - (c1r - c2r) * k;\n cag = c1g - (c1g - c2g) * k;\n cab = c1b - (c1b - c2b) * k;\n } else {\n let k;\n if (y > y3) {\n k = 1;\n } else if (y2 === y3) {\n k = 0;\n } else {\n k = (y2 - y) / (y2 - y3);\n }\n xa = x2 - (x2 - x3) * k;\n car = c2r - (c2r - c3r) * k;\n cag = c2g - (c2g - c3g) * k;\n cab = c2b - (c2b - c3b) * k;\n }\n\n let k;\n if (y < y1) {\n k = 0;\n } else if (y > y3) {\n k = 1;\n } else {\n k = (y1 - y) / (y1 - y3);\n }\n xb = x1 - (x1 - x3) * k;\n cbr = c1r - (c1r - c3r) * k;\n cbg = c1g - (c1g - c3g) * k;\n cbb = c1b - (c1b - c3b) * k;\n const x1_ = Math.round(Math.min(xa, xb));\n const x2_ = Math.round(Math.max(xa, xb));\n let j = rowSize * y + x1_ * 4;\n for (let x = x1_; x <= x2_; x++) {\n k = (xa - x) / (xa - xb);\n if (k < 0) {\n k = 0;\n } else if (k > 1) {\n k = 1;\n }\n bytes[j++] = (car - (car - cbr) * k) | 0;\n bytes[j++] = (cag - (cag - cbg) * k) | 0;\n bytes[j++] = (cab - (cab - cbb) * k) | 0;\n bytes[j++] = 255;\n }\n }\n}\n\nfunction drawFigure(data, figure, context) {\n const ps = figure.coords;\n const cs = figure.colors;\n let i, ii;\n switch (figure.type) {\n case \"lattice\":\n const verticesPerRow = figure.verticesPerRow;\n const rows = Math.floor(ps.length / verticesPerRow) - 1;\n const cols = verticesPerRow - 1;\n for (i = 0; i < rows; i++) {\n let q = i * verticesPerRow;\n for (let j = 0; j < cols; j++, q++) {\n drawTriangle(\n data,\n context,\n ps[q],\n ps[q + 1],\n ps[q + verticesPerRow],\n cs[q],\n cs[q + 1],\n cs[q + verticesPerRow]\n );\n drawTriangle(\n data,\n context,\n ps[q + verticesPerRow + 1],\n ps[q + 1],\n ps[q + verticesPerRow],\n cs[q + verticesPerRow + 1],\n cs[q + 1],\n cs[q + verticesPerRow]\n );\n }\n }\n break;\n case \"triangles\":\n for (i = 0, ii = ps.length; i < ii; i += 3) {\n drawTriangle(\n data,\n context,\n ps[i],\n ps[i + 1],\n ps[i + 2],\n cs[i],\n cs[i + 1],\n cs[i + 2]\n );\n }\n break;\n default:\n throw new Error(\"illegal figure\");\n }\n}\n\nclass MeshShadingPattern extends BaseShadingPattern {\n constructor(IR) {\n super();\n this._coords = IR[2];\n this._colors = IR[3];\n this._figures = IR[4];\n this._bounds = IR[5];\n this._bbox = IR[6];\n this._background = IR[7];\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 );\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 isModifyingCurrentTransform() {\n return true;\n }\n\n getPattern(ctx, owner, inverse, pathType) {\n applyBoundingBox(ctx, this._bbox);\n const scale = new Float32Array(2);\n if (pathType === PathType.SHADING) {\n Util.singularValueDecompose2dScale(getCurrentTransform(ctx), scale);\n } else if (this.matrix) {\n // Obtain scale from matrix and current transformation matrix.\n Util.singularValueDecompose2dScale(this.matrix, scale);\n const [matrixScaleX, matrixScaleY] = scale;\n Util.singularValueDecompose2dScale(owner.baseTransform, scale);\n scale[0] *= matrixScaleX;\n scale[1] *= matrixScaleY;\n } else {\n Util.singularValueDecompose2dScale(owner.baseTransform, scale);\n }\n\n // Rasterizing on the main thread since sending/queue large canvases\n // might cause OOM.\n const temporaryPatternCanvas = this._createMeshCanvas(\n scale,\n pathType === PathType.SHADING ? null : this._background,\n owner.cachedCanvases\n );\n\n if (pathType !== PathType.SHADING) {\n ctx.setTransform(...owner.baseTransform);\n if (this.matrix) {\n ctx.transform(...this.matrix);\n }\n }\n\n ctx.translate(\n temporaryPatternCanvas.offsetX,\n temporaryPatternCanvas.offsetY\n );\n ctx.scale(temporaryPatternCanvas.scaleX, temporaryPatternCanvas.scaleY);\n\n return ctx.createPattern(temporaryPatternCanvas.canvas, \"no-repeat\");\n }\n}\n\nclass DummyShadingPattern extends BaseShadingPattern {\n getPattern() {\n return \"hotpink\";\n }\n}\n\nfunction getShadingPattern(IR) {\n switch (IR[0]) {\n case \"RadialAxial\":\n return new RadialAxialShadingPattern(IR);\n case \"Mesh\":\n return new MeshShadingPattern(IR);\n case \"Dummy\":\n return new DummyShadingPattern();\n }\n throw new Error(`Unknown IR type: ${IR[0]}`);\n}\n\nconst PaintType = {\n COLORED: 1,\n UNCOLORED: 2,\n};\n\nclass TilingPattern {\n // 10in @ 300dpi shall be enough.\n static MAX_PATTERN_SIZE = 3000;\n\n constructor(IR, ctx, canvasGraphicsFactory, baseTransform) {\n this.color = IR[1];\n this.operatorList = IR[2];\n this.matrix = IR[3];\n this.bbox = IR[4];\n this.xstep = IR[5];\n this.ystep = IR[6];\n this.paintType = IR[7];\n this.tilingType = IR[8];\n this.ctx = ctx;\n this.canvasGraphicsFactory = canvasGraphicsFactory;\n this.baseTransform = baseTransform;\n }\n\n createPatternCanvas(owner) {\n const {\n bbox,\n operatorList,\n paintType,\n tilingType,\n color,\n canvasGraphicsFactory,\n } = this;\n let { xstep, ystep } = this;\n xstep = Math.abs(xstep);\n ystep = Math.abs(ystep);\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\n const x0 = bbox[0],\n y0 = bbox[1],\n x1 = bbox[2],\n y1 = bbox[3];\n const width = x1 - x0;\n const height = y1 - y0;\n\n // Obtain scale from matrix and current transformation matrix.\n const scale = new Float32Array(2);\n Util.singularValueDecompose2dScale(this.matrix, scale);\n const [matrixScaleX, matrixScaleY] = scale;\n Util.singularValueDecompose2dScale(this.baseTransform, scale);\n const combinedScaleX = matrixScaleX * scale[0];\n const combinedScaleY = matrixScaleY * scale[1];\n\n let canvasWidth = width,\n canvasHeight = height,\n redrawHorizontally = false,\n redrawVertically = false;\n\n const xScaledStep = Math.ceil(xstep * combinedScaleX);\n const yScaledStep = Math.ceil(ystep * combinedScaleY);\n const xScaledWidth = Math.ceil(width * combinedScaleX);\n const yScaledHeight = Math.ceil(height * combinedScaleY);\n\n if (xScaledStep >= xScaledWidth) {\n canvasWidth = xstep;\n } else {\n redrawHorizontally = true;\n }\n if (yScaledStep >= yScaledHeight) {\n canvasHeight = ystep;\n } else {\n redrawVertically = true;\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 canvasWidth,\n this.ctx.canvas.width,\n combinedScaleX\n );\n const dimy = this.getSizeAndScale(\n canvasHeight,\n this.ctx.canvas.height,\n combinedScaleY\n );\n\n const tmpCanvas = owner.cachedCanvases.getCanvas(\n \"pattern\",\n dimx.size,\n dimy.size\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 tmpCtx.translate(-dimx.scale * x0, -dimy.scale * y0);\n graphics.transform(\n // We pass 0 as the 'opIdx' argument, but the value is irrelevant.\n // We know that we are in a 'CanvasNestedDependencyTracker' that captures\n // all the sub-operations needed to create this pattern canvas and uses\n // the top-level operation index as their index.\n 0,\n dimx.scale,\n 0,\n 0,\n dimy.scale,\n 0,\n 0\n );\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 graphics.dependencyTracker?.save();\n\n this.clipBbox(graphics, x0, y0, x1, y1);\n\n graphics.baseTransform = getCurrentTransform(graphics.ctx);\n\n graphics.executeOperatorList(operatorList);\n\n graphics.endDrawing();\n\n graphics.dependencyTracker?.restore().recordNestedDependencies?.();\n tmpCtx.restore();\n\n if (redrawHorizontally || redrawVertically) {\n // The tile is overlapping itself, so we create a new tile with\n // dimensions xstep * ystep.\n // Then we draw the overlapping parts of the original tile on the new\n // tile.\n // Just as a side note, the code here works correctly even if we don't\n // have to redraw the tile horizontally or vertically. In that case, the\n // original tile is drawn on the new tile only once, but it's useless.\n const image = tmpCanvas.canvas;\n if (redrawHorizontally) {\n canvasWidth = xstep;\n }\n if (redrawVertically) {\n canvasHeight = ystep;\n }\n\n const dimx2 = this.getSizeAndScale(\n canvasWidth,\n this.ctx.canvas.width,\n combinedScaleX\n );\n const dimy2 = this.getSizeAndScale(\n canvasHeight,\n this.ctx.canvas.height,\n combinedScaleY\n );\n\n const xSize = dimx2.size;\n const ySize = dimy2.size;\n const tmpCanvas2 = owner.cachedCanvases.getCanvas(\n \"pattern-workaround\",\n xSize,\n ySize\n );\n const tmpCtx2 = tmpCanvas2.context;\n const ii = redrawHorizontally ? Math.floor(width / xstep) : 0;\n const jj = redrawVertically ? Math.floor(height / ystep) : 0;\n\n // Draw the overlapping parts of the original tile on the new tile.\n for (let i = 0; i <= ii; i++) {\n for (let j = 0; j <= jj; j++) {\n tmpCtx2.drawImage(\n image,\n xSize * i,\n ySize * j,\n xSize,\n ySize,\n 0,\n 0,\n xSize,\n ySize\n );\n }\n }\n return {\n canvas: tmpCanvas2.canvas,\n scaleX: dimx2.scale,\n scaleY: dimy2.scale,\n offsetX: x0,\n offsetY: y0,\n };\n }\n\n return {\n canvas: tmpCanvas.canvas,\n scaleX: dimx.scale,\n scaleY: dimy.scale,\n offsetX: x0,\n offsetY: y0,\n };\n }\n\n getSizeAndScale(step, realOutputSize, scale) {\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 Util.axialAlignedBoundingBox(\n [x0, y0, x1, y1],\n getCurrentTransform(graphics.ctx),\n graphics.current.minMax\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 { fillStyle, strokeStyle } = this.ctx;\n context.fillStyle = current.fillColor = fillStyle;\n context.strokeStyle = current.strokeColor = strokeStyle;\n break;\n case PaintType.UNCOLORED:\n context.fillStyle = context.strokeStyle = color;\n // Set color needed by image masks (fixes issues 3226 and 8741).\n current.fillColor = current.strokeColor = color;\n break;\n default:\n throw new FormatError(`Unsupported paint type: ${paintType}`);\n }\n }\n\n isModifyingCurrentTransform() {\n return false;\n }\n\n getPattern(ctx, owner, inverse, pathType) {\n // PDF spec 8.7.2 NOTE 1: pattern's matrix is relative to initial matrix.\n let matrix = inverse;\n if (pathType !== PathType.SHADING) {\n matrix = Util.transform(matrix, owner.baseTransform);\n if (this.matrix) {\n matrix = Util.transform(matrix, this.matrix);\n }\n }\n\n const temporaryPatternCanvas = this.createPatternCanvas(owner);\n\n let domMatrix = new DOMMatrix(matrix);\n // Rescale and so that the ctx.createPattern call generates a pattern with\n // the desired size.\n domMatrix = domMatrix.translate(\n temporaryPatternCanvas.offsetX,\n temporaryPatternCanvas.offsetY\n );\n domMatrix = domMatrix.scale(\n 1 / temporaryPatternCanvas.scaleX,\n 1 / temporaryPatternCanvas.scaleY\n );\n\n const pattern = ctx.createPattern(temporaryPatternCanvas.canvas, \"repeat\");\n pattern.setTransform(domMatrix);\n\n return pattern;\n }\n}\n\nexport { getShadingPattern, PathType, TilingPattern };\n","/* Copyright 2022 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { FeatureTest, ImageKind } from \"./util.js\";\n\nfunction convertToRGBA(params) {\n switch (params.kind) {\n case ImageKind.GRAYSCALE_1BPP:\n return convertBlackAndWhiteToRGBA(params);\n case ImageKind.RGB_24BPP:\n return convertRGBToRGBA(params);\n }\n\n return null;\n}\n\nfunction convertBlackAndWhiteToRGBA({\n src,\n srcPos = 0,\n dest,\n width,\n height,\n nonBlackColor = 0xffffffff,\n inverseDecode = false,\n}) {\n const black = FeatureTest.isLittleEndian ? 0xff000000 : 0x000000ff;\n const [zeroMapping, oneMapping] = inverseDecode\n ? [nonBlackColor, black]\n : [black, nonBlackColor];\n const widthInSource = width >> 3;\n const widthRemainder = width & 7;\n const srcLength = src.length;\n dest = new Uint32Array(dest.buffer);\n let destPos = 0;\n\n for (let i = 0; i < height; i++) {\n for (const max = srcPos + widthInSource; srcPos < max; srcPos++) {\n const elem = srcPos < srcLength ? src[srcPos] : 255;\n dest[destPos++] = elem & 0b10000000 ? oneMapping : zeroMapping;\n dest[destPos++] = elem & 0b1000000 ? oneMapping : zeroMapping;\n dest[destPos++] = elem & 0b100000 ? oneMapping : zeroMapping;\n dest[destPos++] = elem & 0b10000 ? oneMapping : zeroMapping;\n dest[destPos++] = elem & 0b1000 ? oneMapping : zeroMapping;\n dest[destPos++] = elem & 0b100 ? oneMapping : zeroMapping;\n dest[destPos++] = elem & 0b10 ? oneMapping : zeroMapping;\n dest[destPos++] = elem & 0b1 ? oneMapping : zeroMapping;\n }\n if (widthRemainder === 0) {\n continue;\n }\n const elem = srcPos < srcLength ? src[srcPos++] : 255;\n for (let j = 0; j < widthRemainder; j++) {\n dest[destPos++] = elem & (1 << (7 - j)) ? oneMapping : zeroMapping;\n }\n }\n return { srcPos, destPos };\n}\n\nfunction convertRGBToRGBA({\n src,\n srcPos = 0,\n dest,\n destPos = 0,\n width,\n height,\n}) {\n let i = 0;\n const len = width * height * 3;\n const len32 = len >> 2;\n const src32 = new Uint32Array(src.buffer, srcPos, len32);\n\n if (FeatureTest.isLittleEndian) {\n // It's a way faster to do the shuffle manually instead of working\n // component by component with some Uint8 arrays.\n for (; i < len32 - 2; i += 3, destPos += 4) {\n const s1 = src32[i]; // R2B1G1R1\n const s2 = src32[i + 1]; // G3R3B2G2\n const s3 = src32[i + 2]; // B4G4R4B3\n\n dest[destPos] = s1 | 0xff000000;\n dest[destPos + 1] = (s1 >>> 24) | (s2 << 8) | 0xff000000;\n dest[destPos + 2] = (s2 >>> 16) | (s3 << 16) | 0xff000000;\n dest[destPos + 3] = (s3 >>> 8) | 0xff000000;\n }\n\n for (let j = i * 4, jj = srcPos + len; j < jj; j += 3) {\n dest[destPos++] =\n src[j] | (src[j + 1] << 8) | (src[j + 2] << 16) | 0xff000000;\n }\n } else {\n for (; i < len32 - 2; i += 3, destPos += 4) {\n const s1 = src32[i]; // R1G1B1R2\n const s2 = src32[i + 1]; // G2B2R3G3\n const s3 = src32[i + 2]; // B3R4G4B4\n\n dest[destPos] = s1 | 0xff;\n dest[destPos + 1] = (s1 << 24) | (s2 >>> 8) | 0xff;\n dest[destPos + 2] = (s2 << 16) | (s3 >>> 16) | 0xff;\n dest[destPos + 3] = (s3 << 8) | 0xff;\n }\n\n for (let j = i * 4, jj = srcPos + len; j < jj; j += 3) {\n dest[destPos++] =\n (src[j] << 24) | (src[j + 1] << 16) | (src[j + 2] << 8) | 0xff;\n }\n }\n\n return { srcPos: srcPos + len, destPos };\n}\n\nfunction grayToRGBA(src, dest) {\n if (FeatureTest.isLittleEndian) {\n for (let i = 0, ii = src.length; i < ii; i++) {\n dest[i] = (src[i] * 0x10101) | 0xff000000;\n }\n } else {\n for (let i = 0, ii = src.length; i < ii; i++) {\n dest[i] = (src[i] * 0x1010100) | 0x000000ff;\n }\n }\n}\n\nexport { convertBlackAndWhiteToRGBA, convertToRGBA, grayToRGBA };\n","/* Copyright 2012 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n CanvasNestedDependencyTracker,\n Dependencies,\n} from \"./canvas_dependency_tracker.js\";\nimport {\n DrawOPS,\n FeatureTest,\n FONT_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 getCurrentTransform,\n getCurrentTransformInverse,\n OutputScale,\n PixelsPerInch,\n} from \"./display_utils.js\";\nimport {\n getShadingPattern,\n PathType,\n TilingPattern,\n} from \"./pattern_helper.js\";\nimport { convertBlackAndWhiteToRGBA } from \"../shared/image_utils.js\";\n\n// <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;\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 FULL_CHUNK_HEIGHT = 16;\n\n// Only used in rescaleAndStroke. The goal is to avoid\n// creating a new DOMMatrix object each time we need it.\nconst SCALE_MATRIX = new DOMMatrix();\n\n// Used to get some coordinates.\nconst XY = new Float32Array(2);\n\n// Initial rectangle values for the minMax array.\nconst MIN_MAX_INIT = new Float32Array([\n Infinity,\n Infinity,\n -Infinity,\n -Infinity,\n]);\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 () {\n destCtx.save();\n this.__originalSave();\n };\n\n ctx.restore = function () {\n destCtx.restore();\n this.__originalRestore();\n };\n\n ctx.translate = function (x, y) {\n destCtx.translate(x, y);\n this.__originalTranslate(x, y);\n };\n\n ctx.scale = function (x, y) {\n destCtx.scale(x, y);\n this.__originalScale(x, y);\n };\n\n ctx.transform = function (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 (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 () {\n destCtx.resetTransform();\n this.__originalResetTransform();\n };\n\n ctx.rotate = function (angle) {\n destCtx.rotate(angle);\n this.__originalRotate(angle);\n };\n\n ctx.clip = function (rule) {\n destCtx.clip(rule);\n this.__originalClip(rule);\n };\n\n ctx.moveTo = function (x, y) {\n destCtx.moveTo(x, y);\n this.__originalMoveTo(x, y);\n };\n\n ctx.lineTo = function (x, y) {\n destCtx.lineTo(x, y);\n this.__originalLineTo(x, y);\n };\n\n ctx.bezierCurveTo = function (cp1x, cp1y, cp2x, cp2y, x, y) {\n destCtx.bezierCurveTo(cp1x, cp1y, cp2x, cp2y, x, y);\n this.__originalBezierCurveTo(cp1x, cp1y, cp2x, cp2y, x, y);\n };\n\n ctx.rect = function (x, y, width, height) {\n destCtx.rect(x, y, width, height);\n this.__originalRect(x, y, width, height);\n };\n\n ctx.closePath = function () {\n destCtx.closePath();\n this.__originalClosePath();\n };\n\n ctx.beginPath = function () {\n destCtx.beginPath();\n this.__originalBeginPath();\n };\n}\n\nclass CachedCanvases {\n constructor(canvasFactory) {\n this.canvasFactory = canvasFactory;\n this.cache = Object.create(null);\n }\n\n getCanvas(id, width, height) {\n let canvasEntry;\n if (this.cache[id] !== undefined) {\n canvasEntry = this.cache[id];\n this.canvasFactory.reset(canvasEntry, width, height);\n } else {\n canvasEntry = this.canvasFactory.create(width, height);\n this.cache[id] = canvasEntry;\n }\n return canvasEntry;\n }\n\n delete(id) {\n delete this.cache[id];\n }\n\n clear() {\n for (const id in this.cache) {\n const canvasEntry = this.cache[id];\n this.canvasFactory.destroy(canvasEntry);\n delete this.cache[id];\n }\n }\n}\n\nfunction drawImageAtIntegerCoords(\n ctx,\n srcImg,\n srcX,\n srcY,\n srcW,\n srcH,\n destX,\n destY,\n destW,\n destH\n) {\n const [a, b, c, d, tx, ty] = getCurrentTransform(ctx);\n if (b === 0 && c === 0) {\n // top-left corner is at (X, Y) and\n // bottom-right one is at (X + width, Y + height).\n\n // If leftX is 4.321 then it's rounded to 4.\n // If width is 10.432 then it's rounded to 11 because\n // rightX = leftX + width = 14.753 which is rounded to 15\n // so after rounding the total width is 11 (15 - 4).\n // It's why we can't just floor/ceil uniformly, it just depends\n // on the values we've.\n\n const tlX = destX * a + tx;\n const rTlX = Math.round(tlX);\n const tlY = destY * d + ty;\n const rTlY = Math.round(tlY);\n const brX = (destX + destW) * a + tx;\n\n // Some pdf contains images with 1x1 images so in case of 0-width after\n // scaling we must fallback on 1 to be sure there is something.\n const rWidth = Math.abs(Math.round(brX) - rTlX) || 1;\n const brY = (destY + destH) * d + ty;\n const rHeight = Math.abs(Math.round(brY) - rTlY) || 1;\n\n // We must apply a transformation in order to apply it on the image itself.\n // For example if a == 1 && d == -1, it means that the image itself is\n // mirrored w.r.t. the x-axis.\n ctx.setTransform(Math.sign(a), 0, 0, Math.sign(d), rTlX, rTlY);\n ctx.drawImage(srcImg, srcX, srcY, srcW, srcH, 0, 0, rWidth, rHeight);\n ctx.setTransform(a, b, c, d, tx, ty);\n\n return [rWidth, rHeight];\n }\n\n if (a === 0 && d === 0) {\n // This path is taken in issue9462.pdf (page 3).\n const tlX = destY * c + tx;\n const rTlX = Math.round(tlX);\n const tlY = destX * b + ty;\n const rTlY = Math.round(tlY);\n const brX = (destY + destH) * c + tx;\n const rWidth = Math.abs(Math.round(brX) - rTlX) || 1;\n const brY = (destX + destW) * b + ty;\n const rHeight = Math.abs(Math.round(brY) - rTlY) || 1;\n\n ctx.setTransform(0, Math.sign(b), Math.sign(c), 0, rTlX, rTlY);\n ctx.drawImage(srcImg, srcX, srcY, srcW, srcH, 0, 0, rHeight, rWidth);\n ctx.setTransform(a, b, c, d, tx, ty);\n\n return [rHeight, rWidth];\n }\n\n // Not a scale matrix so let the render handle the case without rounding.\n ctx.drawImage(srcImg, srcX, srcY, srcW, srcH, destX, destY, destW, destH);\n\n const scaleX = Math.hypot(a, b);\n const scaleY = Math.hypot(c, d);\n return [scaleX * destW, scaleY * destH];\n}\n\nclass CanvasExtraState {\n // Are soft masks and alpha values shapes or opacities?\n alphaIsShape = false;\n\n fontSize = 0;\n\n fontSizeScale = 1;\n\n textMatrix = null;\n\n textMatrixScale = 1;\n\n fontMatrix = FONT_IDENTITY_MATRIX;\n\n leading = 0;\n\n // Current point (in user coordinates)\n x = 0;\n\n y = 0;\n\n // Start of text line (in text coordinates)\n lineX = 0;\n\n lineY = 0;\n\n // Character and word spacing\n charSpacing = 0;\n\n wordSpacing = 0;\n\n textHScale = 1;\n\n textRenderingMode = TextRenderingMode.FILL;\n\n textRise = 0;\n\n // Default fore and background colors\n fillColor = \"#000000\";\n\n strokeColor = \"#000000\";\n\n patternFill = false;\n\n patternStroke = false;\n\n // Note: fill alpha applies to all non-stroking operations\n fillAlpha = 1;\n\n strokeAlpha = 1;\n\n lineWidth = 1;\n\n activeSMask = null;\n\n transferMaps = \"none\";\n\n constructor(width, height, preInit) {\n preInit?.(this);\n\n this.clipBox = new Float32Array([0, 0, width, height]);\n this.minMax = MIN_MAX_INIT.slice();\n }\n\n clone() {\n const clone = Object.create(this);\n clone.clipBox = this.clipBox.slice();\n clone.minMax = this.minMax.slice();\n return clone;\n }\n\n getPathBoundingBox(pathType = PathType.FILL, transform = null) {\n const box = this.minMax.slice();\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 Util.singularValueDecompose2dScale(transform, XY);\n const xStrokePad = (XY[0] * this.lineWidth) / 2;\n const yStrokePad = (XY[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.minMax[0] === Infinity;\n }\n\n startNewPathAndClipBox(box) {\n this.clipBox.set(box, 0);\n this.minMax.set(MIN_MAX_INIT, 0);\n }\n\n getClippedPathBoundingBox(pathType = PathType.FILL, transform = null) {\n return Util.intersect(\n this.clipBox,\n this.getPathBoundingBox(pathType, transform)\n );\n }\n}\n\nfunction putBinaryImageData(ctx, imgData) {\n if (imgData instanceof ImageData) {\n ctx.putImageData(imgData, 0, 0);\n return;\n }\n\n // Put the image data to the canvas in chunks, rather than putting the\n // whole image at once. This saves JS memory, because the ImageData object\n // is smaller. It also possibly saves C++ memory within the implementation\n // of putImageData(). (E.g. in Firefox we make two short-lived copies of\n // the data passed to putImageData()). |n| shouldn't be too small, however,\n // because too many putImageData() calls will slow things down.\n //\n // Note: as written, if the last chunk is partial, the putImageData() call\n // will (conceptually) put pixels past the bounds of the canvas. But\n // that's ok; any such pixels are ignored.\n\n const height = imgData.height,\n width = imgData.width;\n const partialChunkHeight = height % FULL_CHUNK_HEIGHT;\n const fullChunks = (height - partialChunkHeight) / FULL_CHUNK_HEIGHT;\n const totalChunks = partialChunkHeight === 0 ? fullChunks : fullChunks + 1;\n\n const chunkImgData = ctx.createImageData(width, FULL_CHUNK_HEIGHT);\n let srcPos = 0,\n destPos;\n const src = imgData.data;\n const dest = chunkImgData.data;\n let i, j, thisChunkHeight, elemsInThisChunk;\n\n // There are multiple forms in which the pixel data can be passed, and\n // imgData.kind tells us which one this is.\n if (imgData.kind === ImageKind.GRAYSCALE_1BPP) {\n // Grayscale, 1 bit per pixel (i.e. black-and-white).\n const srcLength = src.byteLength;\n const dest32 = new Uint32Array(dest.buffer, 0, dest.byteLength >> 2);\n const dest32DataLength = dest32.length;\n const fullSrcDiff = (width + 7) >> 3;\n const white = 0xffffffff;\n const black = FeatureTest.isLittleEndian ? 0xff000000 : 0x000000ff;\n\n for (i = 0; i < totalChunks; i++) {\n thisChunkHeight = i < fullChunks ? FULL_CHUNK_HEIGHT : partialChunkHeight;\n destPos = 0;\n for (j = 0; j < thisChunkHeight; j++) {\n const srcDiff = srcLength - srcPos;\n let k = 0;\n const kEnd = srcDiff > fullSrcDiff ? width : srcDiff * 8 - 7;\n const kEndUnrolled = kEnd & ~7;\n let mask = 0;\n let srcByte = 0;\n for (; k < kEndUnrolled; k += 8) {\n srcByte = src[srcPos++];\n dest32[destPos++] = srcByte & 128 ? white : black;\n dest32[destPos++] = srcByte & 64 ? white : black;\n dest32[destPos++] = srcByte & 32 ? white : black;\n dest32[destPos++] = srcByte & 16 ? white : black;\n dest32[destPos++] = srcByte & 8 ? white : black;\n dest32[destPos++] = srcByte & 4 ? white : black;\n dest32[destPos++] = srcByte & 2 ? white : black;\n dest32[destPos++] = srcByte & 1 ? white : black;\n }\n for (; k < kEnd; k++) {\n if (mask === 0) {\n srcByte = src[srcPos++];\n mask = 128;\n }\n\n dest32[destPos++] = srcByte & mask ? white : black;\n mask >>= 1;\n }\n }\n // We ran out of input. Make all remaining pixels transparent.\n while (destPos < dest32DataLength) {\n dest32[destPos++] = 0;\n }\n\n ctx.putImageData(chunkImgData, 0, i * FULL_CHUNK_HEIGHT);\n }\n } else if (imgData.kind === ImageKind.RGBA_32BPP) {\n // RGBA, 32-bits per pixel.\n j = 0;\n elemsInThisChunk = width * FULL_CHUNK_HEIGHT * 4;\n for (i = 0; i < fullChunks; i++) {\n dest.set(src.subarray(srcPos, srcPos + elemsInThisChunk));\n srcPos += elemsInThisChunk;\n\n ctx.putImageData(chunkImgData, 0, j);\n j += FULL_CHUNK_HEIGHT;\n }\n if (i < totalChunks) {\n elemsInThisChunk = width * partialChunkHeight * 4;\n dest.set(src.subarray(srcPos, srcPos + elemsInThisChunk));\n\n ctx.putImageData(chunkImgData, 0, j);\n }\n } else if (imgData.kind === ImageKind.RGB_24BPP) {\n // RGB, 24-bits per pixel.\n thisChunkHeight = FULL_CHUNK_HEIGHT;\n elemsInThisChunk = width * thisChunkHeight;\n for (i = 0; i < totalChunks; i++) {\n if (i >= fullChunks) {\n thisChunkHeight = partialChunkHeight;\n elemsInThisChunk = width * thisChunkHeight;\n }\n\n destPos = 0;\n for (j = elemsInThisChunk; j--; ) {\n dest[destPos++] = src[srcPos++];\n dest[destPos++] = src[srcPos++];\n dest[destPos++] = src[srcPos++];\n dest[destPos++] = 255;\n }\n\n ctx.putImageData(chunkImgData, 0, i * FULL_CHUNK_HEIGHT);\n }\n } else {\n throw new Error(`bad image kind: ${imgData.kind}`);\n }\n}\n\nfunction putBinaryImageMask(ctx, imgData) {\n if (imgData.bitmap) {\n // The bitmap has been created in the worker.\n ctx.drawImage(imgData.bitmap, 0, 0);\n return;\n }\n\n // Slow path: OffscreenCanvas isn't available in the worker.\n const height = imgData.height,\n width = imgData.width;\n const partialChunkHeight = height % FULL_CHUNK_HEIGHT;\n const fullChunks = (height - partialChunkHeight) / FULL_CHUNK_HEIGHT;\n const totalChunks = partialChunkHeight === 0 ? fullChunks : fullChunks + 1;\n\n const chunkImgData = ctx.createImageData(width, FULL_CHUNK_HEIGHT);\n let srcPos = 0;\n const src = imgData.data;\n const dest = chunkImgData.data;\n\n for (let i = 0; i < totalChunks; i++) {\n const thisChunkHeight =\n i < fullChunks ? FULL_CHUNK_HEIGHT : partialChunkHeight;\n\n // Expand the mask so it can be used by the canvas. Any required\n // inversion has already been handled.\n\n ({ srcPos } = convertBlackAndWhiteToRGBA({\n src,\n srcPos,\n dest,\n width,\n height: thisChunkHeight,\n nonBlackColor: 0,\n }));\n\n ctx.putImageData(chunkImgData, 0, i * FULL_CHUNK_HEIGHT);\n }\n}\n\nfunction copyCtxState(sourceCtx, destCtx) {\n const properties = [\n \"strokeStyle\",\n \"fillStyle\",\n \"fillRule\",\n \"globalAlpha\",\n \"lineWidth\",\n \"lineCap\",\n \"lineJoin\",\n \"miterLimit\",\n \"globalCompositeOperation\",\n \"font\",\n \"filter\",\n ];\n for (const property of properties) {\n if (sourceCtx[property] !== undefined) {\n destCtx[property] = sourceCtx[property];\n }\n }\n if (sourceCtx.setLineDash !== undefined) {\n destCtx.setLineDash(sourceCtx.getLineDash());\n destCtx.lineDashOffset = sourceCtx.lineDashOffset;\n }\n}\n\nfunction resetCtxToDefault(ctx) {\n ctx.strokeStyle = ctx.fillStyle = \"#000000\";\n ctx.fillRule = \"nonzero\";\n ctx.globalAlpha = 1;\n ctx.lineWidth = 1;\n ctx.lineCap = \"butt\";\n ctx.lineJoin = \"miter\";\n ctx.miterLimit = 10;\n ctx.globalCompositeOperation = \"source-over\";\n ctx.font = \"10px sans-serif\";\n if (ctx.setLineDash !== undefined) {\n ctx.setLineDash([]);\n ctx.lineDashOffset = 0;\n }\n const { filter } = ctx;\n if (filter !== \"none\" && filter !== \"\") {\n ctx.filter = \"none\";\n }\n}\n\nfunction getImageSmoothingEnabled(transform, interpolate) {\n // In section 8.9.5.3 of the PDF spec, it's mentioned that the interpolate\n // flag should be used when the image is upscaled.\n // In Firefox, smoothing is always used when downscaling images (bug 1360415).\n\n if (interpolate) {\n return true;\n }\n\n Util.singularValueDecompose2dScale(transform, XY);\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 const actualScale = Math.fround(\n OutputScale.pixelRatio * PixelsPerInch.PDF_TO_CSS_UNITS\n );\n // `XY` is a Float32Array.\n return XY[0] <= actualScale && XY[1] <= actualScale;\n}\n\nconst LINE_CAP_STYLES = [\"butt\", \"round\", \"square\"];\nconst LINE_JOIN_STYLES = [\"miter\", \"round\", \"bevel\"];\nconst NORMAL_CLIP = {};\nconst EO_CLIP = {};\n\nclass CanvasGraphics {\n constructor(\n canvasCtx,\n commonObjs,\n objs,\n canvasFactory,\n filterFactory,\n { optionalContentConfig, markedContentStack = null },\n annotationCanvasMap,\n pageColors,\n dependencyTracker\n ) {\n this.ctx = canvasCtx;\n this.current = new CanvasExtraState(\n this.ctx.canvas.width,\n this.ctx.canvas.height\n );\n this.stateStack = [];\n this.pendingClip = null;\n this.pendingEOFill = false;\n this.res = null;\n this.xobjs = null;\n this.commonObjs = commonObjs;\n this.objs = objs;\n this.canvasFactory = canvasFactory;\n this.filterFactory = filterFactory;\n this.groupStack = [];\n // Patterns are painted relative to the initial page/form transform, see\n // PDF spec 8.7.2 NOTE 1.\n this.baseTransform = null;\n this.baseTransformStack = [];\n this.groupLevel = 0;\n this.smaskStack = [];\n this.smaskCounter = 0;\n this.tempSMask = null;\n this.suspendedCtx = null;\n this.contentVisible = true;\n this.markedContentStack = markedContentStack || [];\n this.optionalContentConfig = optionalContentConfig;\n this.cachedCanvases = new CachedCanvases(this.canvasFactory);\n this.cachedPatterns = new Map();\n this.annotationCanvasMap = annotationCanvasMap;\n this.viewportScale = 1;\n this.outputScaleX = 1;\n this.outputScaleY = 1;\n this.pageColors = pageColors;\n\n this._cachedScaleForStroking = [-1, 0];\n this._cachedGetSinglePixelWidth = null;\n this._cachedBitmapsMap = new Map();\n\n this.dependencyTracker = dependencyTracker ?? null;\n }\n\n getObject(opIdx, data, fallback = null) {\n if (typeof data === \"string\") {\n this.dependencyTracker?.recordNamedDependency(opIdx, data);\n return data.startsWith(\"g_\")\n ? this.commonObjs.get(data)\n : this.objs.get(data);\n }\n return fallback;\n }\n\n beginDrawing({\n transform,\n viewport,\n transparency = false,\n background = null,\n }) {\n // For pdfs that use blend modes we have to clear the canvas else certain\n // blend modes can look wrong since we'd be blending with a white\n // backdrop. The problem with a transparent backdrop though is we then\n // don't get sub pixel anti aliasing on text, creating temporary\n // transparent canvas when we have blend modes.\n const width = this.ctx.canvas.width;\n const height = this.ctx.canvas.height;\n\n const savedFillStyle = this.ctx.fillStyle;\n this.ctx.fillStyle = background || \"#ffffff\";\n this.ctx.fillRect(0, 0, width, height);\n this.ctx.fillStyle = savedFillStyle;\n\n if (transparency) {\n const transparentCanvas = this.cachedCanvases.getCanvas(\n \"transparent\",\n width,\n height\n );\n this.compositeCtx = this.ctx;\n this.transparentCanvas = transparentCanvas.canvas;\n this.ctx = transparentCanvas.context;\n this.ctx.save();\n // The transform can be applied before rendering, transferring it to\n // the new canvas.\n this.ctx.transform(...getCurrentTransform(this.compositeCtx));\n }\n\n this.ctx.save();\n resetCtxToDefault(this.ctx);\n if (transform) {\n this.ctx.transform(...transform);\n this.outputScaleX = transform[0];\n this.outputScaleY = transform[0];\n }\n this.ctx.transform(...viewport.transform);\n this.viewportScale = viewport.scale;\n\n this.baseTransform = getCurrentTransform(this.ctx);\n }\n\n executeOperatorList(\n operatorList,\n executionStartIdx,\n continueCallback,\n stepper,\n filteredOperationIndexes\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, fnArgs;\n\n while (true) {\n if (stepper !== undefined && i === stepper.nextBreakPoint) {\n stepper.breakIt(i, continueCallback);\n return i;\n }\n\n if (!filteredOperationIndexes || filteredOperationIndexes.has(i)) {\n fnId = fnArray[i];\n // TODO: There is a `undefined` coming from somewhere.\n fnArgs = argsArray[i] ?? null;\n\n if (fnId !== OPS.dependency) {\n if (fnArgs === null) {\n this[fnId](i);\n } else {\n this[fnId](i, ...fnArgs);\n }\n } else {\n for (const depObjId of fnArgs) {\n this.dependencyTracker?.recordNamedData(depObjId, 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\n i++;\n\n // If the entire operatorList was executed, stop as were done.\n if (i === argsArrayLen) {\n return i;\n }\n\n // If the execution took longer then a certain amount of time and\n // `continueCallback` is specified, interrupt the execution.\n if (chunkOperations && ++steps > EXECUTION_STEPS) {\n if (Date.now() > endTime) {\n continueCallback();\n return i;\n }\n steps = 0;\n }\n\n // If the operatorList isn't executed completely yet OR the execution\n // time was short enough, do another execution round.\n }\n }\n\n #restoreInitialState() {\n // Finishing all opened operations such as SMask group painting.\n while (this.stateStack.length || this.inSMaskMode) {\n this.restore();\n }\n\n this.current.activeSMask = null;\n this.ctx.restore();\n\n if (this.transparentCanvas) {\n this.ctx = this.compositeCtx;\n this.ctx.save();\n this.ctx.setTransform(1, 0, 0, 1, 0, 0); // Avoid apply transform twice\n this.ctx.drawImage(this.transparentCanvas, 0, 0);\n this.ctx.restore();\n this.transparentCanvas = null;\n }\n }\n\n endDrawing() {\n this.#restoreInitialState();\n\n this.cachedCanvases.clear();\n this.cachedPatterns.clear();\n\n for (const cache of this._cachedBitmapsMap.values()) {\n for (const canvas of cache.values()) {\n if (\n typeof HTMLCanvasElement !== \"undefined\" &&\n canvas instanceof HTMLCanvasElement\n ) {\n canvas.width = canvas.height = 0;\n }\n }\n cache.clear();\n }\n this._cachedBitmapsMap.clear();\n this.#drawFilter();\n }\n\n #drawFilter() {\n if (this.pageColors) {\n const hcmFilterId = this.filterFactory.addHCMFilter(\n this.pageColors.foreground,\n this.pageColors.background\n );\n if (hcmFilterId !== \"none\") {\n const savedFilter = this.ctx.filter;\n this.ctx.filter = hcmFilterId;\n this.ctx.drawImage(this.ctx.canvas, 0, 0);\n this.ctx.filter = savedFilter;\n }\n }\n }\n\n _scaleImage(img, inverseTransform) {\n // Vertical or horizontal scaling shall not be more than 2 to not lose the\n // pixels during drawImage operation, painting on the temporary canvas(es)\n // that are twice smaller in size.\n\n // displayWidth and displayHeight are used for VideoFrame.\n const width = img.width ?? img.displayWidth;\n const height = img.height ?? img.displayHeight;\n let widthScale = Math.max(\n Math.hypot(inverseTransform[0], inverseTransform[1]),\n 1\n );\n let heightScale = Math.max(\n Math.hypot(inverseTransform[2], inverseTransform[3]),\n 1\n );\n\n let paintWidth = width,\n paintHeight = height;\n let tmpCanvasId = \"prescale1\";\n let tmpCanvas, tmpCtx;\n while (\n (widthScale > 2 && paintWidth > 1) ||\n (heightScale > 2 && paintHeight > 1)\n ) {\n let newWidth = paintWidth,\n newHeight = paintHeight;\n if (widthScale > 2 && paintWidth > 1) {\n // See bug 1820511 (Windows specific bug).\n // TODO: once the above bug is fixed we could revert to:\n // newWidth = Math.ceil(paintWidth / 2);\n newWidth =\n paintWidth >= 16384\n ? Math.floor(paintWidth / 2) - 1 || 1\n : Math.ceil(paintWidth / 2);\n widthScale /= paintWidth / newWidth;\n }\n if (heightScale > 2 && paintHeight > 1) {\n // TODO: see the comment above.\n newHeight =\n paintHeight >= 16384\n ? Math.floor(paintHeight / 2) - 1 || 1\n : Math.ceil(paintHeight) / 2;\n heightScale /= paintHeight / newHeight;\n }\n tmpCanvas = this.cachedCanvases.getCanvas(\n tmpCanvasId,\n newWidth,\n newHeight\n );\n tmpCtx = tmpCanvas.context;\n tmpCtx.clearRect(0, 0, newWidth, newHeight);\n tmpCtx.drawImage(\n img,\n 0,\n 0,\n paintWidth,\n paintHeight,\n 0,\n 0,\n newWidth,\n newHeight\n );\n img = tmpCanvas.canvas;\n paintWidth = newWidth;\n paintHeight = newHeight;\n tmpCanvasId = tmpCanvasId === \"prescale1\" ? \"prescale2\" : \"prescale1\";\n }\n return {\n img,\n paintWidth,\n paintHeight,\n };\n }\n\n _createMaskCanvas(opIdx, img) {\n const ctx = this.ctx;\n const { width, height } = img;\n const fillColor = this.current.fillColor;\n const isPatternFill = this.current.patternFill;\n const currentTransform = getCurrentTransform(ctx);\n\n let cache, cacheKey, scaled, maskCanvas;\n if ((img.bitmap || img.data) && img.count > 1) {\n const mainKey = img.bitmap || img.data.buffer;\n // We're reusing the same image several times, so we can cache it.\n // In case we've a pattern fill we just keep the scaled version of\n // the image.\n // Only the scaling part matters, the translation part is just used\n // to compute offsets (but not when filling patterns see #15573).\n // TODO: handle the case of a pattern fill if it's possible.\n cacheKey = JSON.stringify(\n isPatternFill\n ? currentTransform\n : [currentTransform.slice(0, 4), fillColor]\n );\n\n cache = this._cachedBitmapsMap.get(mainKey);\n if (!cache) {\n cache = new Map();\n this._cachedBitmapsMap.set(mainKey, cache);\n }\n const cachedImage = cache.get(cacheKey);\n if (cachedImage && !isPatternFill) {\n const offsetX = Math.round(\n Math.min(currentTransform[0], currentTransform[2]) +\n currentTransform[4]\n );\n const offsetY = Math.round(\n Math.min(currentTransform[1], currentTransform[3]) +\n currentTransform[5]\n );\n\n this.dependencyTracker?.recordDependencies(\n opIdx,\n Dependencies.transformAndFill\n );\n return {\n canvas: cachedImage,\n offsetX,\n offsetY,\n };\n }\n scaled = cachedImage;\n }\n\n if (!scaled) {\n maskCanvas = this.cachedCanvases.getCanvas(\"maskCanvas\", width, height);\n putBinaryImageMask(maskCanvas.context, img);\n }\n\n // Create the mask canvas at the size it will be drawn at and also set\n // its transform to match the current transform so if there are any\n // patterns applied they will be applied relative to the correct\n // transform.\n\n let maskToCanvas = Util.transform(currentTransform, [\n 1 / width,\n 0,\n 0,\n -1 / height,\n 0,\n 0,\n ]);\n maskToCanvas = Util.transform(maskToCanvas, [1, 0, 0, 1, 0, -height]);\n const minMax = MIN_MAX_INIT.slice();\n Util.axialAlignedBoundingBox([0, 0, width, height], maskToCanvas, minMax);\n const [minX, minY, maxX, maxY] = minMax;\n const drawnWidth = Math.round(maxX - minX) || 1;\n const drawnHeight = Math.round(maxY - minY) || 1;\n const fillCanvas = this.cachedCanvases.getCanvas(\n \"fillCanvas\",\n drawnWidth,\n drawnHeight\n );\n const fillCtx = fillCanvas.context;\n\n // The offset will be the top-left coordinate mask.\n // If objToCanvas is [a,b,c,d,e,f] then:\n // - offsetX = min(a, c) + e\n // - offsetY = min(b, d) + f\n const offsetX = minX;\n const offsetY = minY;\n fillCtx.translate(-offsetX, -offsetY);\n fillCtx.transform(...maskToCanvas);\n\n if (!scaled) {\n // Pre-scale if needed to improve image smoothing.\n scaled = this._scaleImage(\n maskCanvas.canvas,\n getCurrentTransformInverse(fillCtx)\n );\n scaled = scaled.img;\n if (cache && isPatternFill) {\n cache.set(cacheKey, scaled);\n }\n }\n\n fillCtx.imageSmoothingEnabled = getImageSmoothingEnabled(\n getCurrentTransform(fillCtx),\n img.interpolate\n );\n\n drawImageAtIntegerCoords(\n fillCtx,\n scaled,\n 0,\n 0,\n scaled.width,\n scaled.height,\n 0,\n 0,\n width,\n height\n );\n fillCtx.globalCompositeOperation = \"source-in\";\n\n const inverse = Util.transform(getCurrentTransformInverse(fillCtx), [\n 1,\n 0,\n 0,\n 1,\n -offsetX,\n -offsetY,\n ]);\n fillCtx.fillStyle = isPatternFill\n ? fillColor.getPattern(ctx, this, inverse, PathType.FILL)\n : fillColor;\n\n fillCtx.fillRect(0, 0, width, height);\n\n if (cache && !isPatternFill) {\n // The fill canvas is put in the cache associated to the mask image\n // so we must remove from the cached canvas: it mustn't be used again.\n this.cachedCanvases.delete(\"fillCanvas\");\n cache.set(cacheKey, fillCanvas.canvas);\n }\n\n this.dependencyTracker?.recordDependencies(\n opIdx,\n Dependencies.transformAndFill\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(opIdx, width) {\n this.dependencyTracker?.recordSimpleData(\"lineWidth\", opIdx);\n if (width !== this.current.lineWidth) {\n this._cachedScaleForStroking[0] = -1;\n }\n this.current.lineWidth = width;\n this.ctx.lineWidth = width;\n }\n\n setLineCap(opIdx, style) {\n this.dependencyTracker?.recordSimpleData(\"lineCap\", opIdx);\n this.ctx.lineCap = LINE_CAP_STYLES[style];\n }\n\n setLineJoin(opIdx, style) {\n this.dependencyTracker?.recordSimpleData(\"lineJoin\", opIdx);\n this.ctx.lineJoin = LINE_JOIN_STYLES[style];\n }\n\n setMiterLimit(opIdx, limit) {\n this.dependencyTracker?.recordSimpleData(\"miterLimit\", opIdx);\n this.ctx.miterLimit = limit;\n }\n\n setDash(opIdx, dashArray, dashPhase) {\n this.dependencyTracker?.recordSimpleData(\"dash\", opIdx);\n const ctx = this.ctx;\n if (ctx.setLineDash !== undefined) {\n ctx.setLineDash(dashArray);\n ctx.lineDashOffset = dashPhase;\n }\n }\n\n setRenderingIntent(opIdx, intent) {\n // This operation is ignored since we haven't found a use case for it yet.\n }\n\n setFlatness(opIdx, flatness) {\n // This operation is ignored since we haven't found a use case for it yet.\n }\n\n setGState(opIdx, states) {\n for (const [key, value] of states) {\n switch (key) {\n case \"LW\":\n this.setLineWidth(opIdx, value);\n break;\n case \"LC\":\n this.setLineCap(opIdx, value);\n break;\n case \"LJ\":\n this.setLineJoin(opIdx, value);\n break;\n case \"ML\":\n this.setMiterLimit(opIdx, value);\n break;\n case \"D\":\n this.setDash(opIdx, value[0], value[1]);\n break;\n case \"RI\":\n this.setRenderingIntent(opIdx, value);\n break;\n case \"FL\":\n this.setFlatness(opIdx, value);\n break;\n case \"Font\":\n this.setFont(opIdx, value[0], value[1]);\n break;\n case \"CA\":\n this.dependencyTracker?.recordSimpleData(\"strokeAlpha\", opIdx);\n this.current.strokeAlpha = value;\n break;\n case \"ca\":\n this.dependencyTracker?.recordSimpleData(\"fillAlpha\", opIdx);\n this.ctx.globalAlpha = this.current.fillAlpha = value;\n break;\n case \"BM\":\n this.dependencyTracker?.recordSimpleData(\n \"globalCompositeOperation\",\n opIdx\n );\n this.ctx.globalCompositeOperation = value;\n break;\n case \"SMask\":\n this.dependencyTracker?.recordSimpleData(\"SMask\", opIdx);\n this.current.activeSMask = value ? this.tempSMask : null;\n this.tempSMask = null;\n this.checkSMaskState();\n break;\n case \"TR\":\n this.dependencyTracker?.recordSimpleData(\"filter\", opIdx);\n this.ctx.filter = this.current.transferMaps =\n this.filterFactory.addFilter(value);\n break;\n }\n }\n }\n\n get inSMaskMode() {\n return !!this.suspendedCtx;\n }\n\n checkSMaskState() {\n const inSMaskMode = this.inSMaskMode;\n if (this.current.activeSMask && !inSMaskMode) {\n this.beginSMaskMode();\n } else if (!this.current.activeSMask && inSMaskMode) {\n this.endSMaskMode();\n }\n // Else, the state is okay and nothing needs to be done.\n }\n\n /**\n * Soft mask mode takes the current main drawing canvas and replaces it with\n * a temporary canvas. Any drawing operations that happen on the temporary\n * canvas need to be composed with the main canvas that was suspended (see\n * `compose()`). The temporary canvas also duplicates many of its operations\n * on the suspended canvas to keep them in sync, so that when the soft mask\n * mode ends any clipping paths or transformations will still be active and in\n * the right order on the canvas' graphics state stack.\n */\n beginSMaskMode(opIdx) {\n if (this.inSMaskMode) {\n throw new Error(\"beginSMaskMode called while already in smask mode\");\n }\n const drawnWidth = this.ctx.canvas.width;\n const drawnHeight = this.ctx.canvas.height;\n const cacheId = \"smaskGroupAt\" + this.groupLevel;\n const scratchCanvas = this.cachedCanvases.getCanvas(\n cacheId,\n drawnWidth,\n drawnHeight\n );\n this.suspendedCtx = this.ctx;\n const ctx = (this.ctx = scratchCanvas.context);\n ctx.setTransform(this.suspendedCtx.getTransform());\n copyCtxState(this.suspendedCtx, ctx);\n mirrorContextOperations(ctx, this.suspendedCtx);\n\n this.setGState(opIdx, [[\"BM\", \"source-over\"]]);\n }\n\n endSMaskMode() {\n if (!this.inSMaskMode) {\n throw new Error(\"endSMaskMode called while not in smask mode\");\n }\n // The soft mask is done, now restore the suspended canvas as the main\n // drawing canvas.\n this.ctx._removeMirroring();\n copyCtxState(this.ctx, this.suspendedCtx);\n this.ctx = this.suspendedCtx;\n\n this.suspendedCtx = null;\n }\n\n compose(dirtyBox) {\n if (!this.current.activeSMask) {\n return;\n }\n\n if (!dirtyBox) {\n dirtyBox = [0, 0, this.ctx.canvas.width, this.ctx.canvas.height];\n } else {\n dirtyBox[0] = Math.floor(dirtyBox[0]);\n dirtyBox[1] = Math.floor(dirtyBox[1]);\n dirtyBox[2] = Math.ceil(dirtyBox[2]);\n dirtyBox[3] = Math.ceil(dirtyBox[3]);\n }\n const smask = this.current.activeSMask;\n const suspendedCtx = this.suspendedCtx;\n\n this.composeSMask(suspendedCtx, smask, this.ctx, dirtyBox);\n // Whatever was drawn has been moved to the suspended canvas, now clear it\n // out of the current canvas.\n this.ctx.save();\n this.ctx.setTransform(1, 0, 0, 1, 0, 0);\n this.ctx.clearRect(0, 0, this.ctx.canvas.width, this.ctx.canvas.height);\n this.ctx.restore();\n }\n\n composeSMask(ctx, smask, layerCtx, layerBox) {\n const layerOffsetX = layerBox[0];\n const layerOffsetY = layerBox[1];\n const layerWidth = layerBox[2] - layerOffsetX;\n const layerHeight = layerBox[3] - layerOffsetY;\n if (layerWidth === 0 || layerHeight === 0) {\n return;\n }\n this.genericComposeSMask(\n smask.context,\n layerCtx,\n layerWidth,\n layerHeight,\n smask.subtype,\n smask.backdrop,\n smask.transferMap,\n layerOffsetX,\n layerOffsetY,\n smask.offsetX,\n smask.offsetY\n );\n ctx.save();\n ctx.globalAlpha = 1;\n ctx.globalCompositeOperation = \"source-over\";\n ctx.setTransform(1, 0, 0, 1, 0, 0);\n ctx.drawImage(layerCtx.canvas, 0, 0);\n ctx.restore();\n }\n\n genericComposeSMask(\n maskCtx,\n layerCtx,\n width,\n height,\n subtype,\n backdrop,\n transferMap,\n layerOffsetX,\n layerOffsetY,\n maskOffsetX,\n maskOffsetY\n ) {\n let maskCanvas = maskCtx.canvas;\n let maskX = layerOffsetX - maskOffsetX;\n let maskY = layerOffsetY - maskOffsetY;\n\n if (backdrop) {\n if (\n maskX < 0 ||\n maskY < 0 ||\n maskX + width > maskCanvas.width ||\n maskY + height > maskCanvas.height\n ) {\n const canvas = this.cachedCanvases.getCanvas(\n \"maskExtension\",\n width,\n height\n );\n const ctx = canvas.context;\n ctx.drawImage(maskCanvas, -maskX, -maskY);\n ctx.globalCompositeOperation = \"destination-atop\";\n ctx.fillStyle = backdrop;\n ctx.fillRect(0, 0, width, height);\n ctx.globalCompositeOperation = \"source-over\";\n\n maskCanvas = canvas.canvas;\n maskX = maskY = 0;\n } else {\n maskCtx.save();\n maskCtx.globalAlpha = 1;\n maskCtx.setTransform(1, 0, 0, 1, 0, 0);\n const clip = new Path2D();\n clip.rect(maskX, maskY, width, height);\n maskCtx.clip(clip);\n maskCtx.globalCompositeOperation = \"destination-atop\";\n maskCtx.fillStyle = backdrop;\n maskCtx.fillRect(maskX, maskY, width, height);\n maskCtx.restore();\n }\n }\n\n layerCtx.save();\n layerCtx.globalAlpha = 1;\n layerCtx.setTransform(1, 0, 0, 1, 0, 0);\n\n if (subtype === \"Alpha\" && transferMap) {\n layerCtx.filter = this.filterFactory.addAlphaFilter(transferMap);\n } else if (subtype === \"Luminosity\") {\n layerCtx.filter = this.filterFactory.addLuminosityFilter(transferMap);\n }\n\n const clip = new Path2D();\n clip.rect(layerOffsetX, layerOffsetY, width, height);\n layerCtx.clip(clip);\n layerCtx.globalCompositeOperation = \"destination-in\";\n layerCtx.drawImage(\n maskCanvas,\n maskX,\n maskY,\n width,\n height,\n layerOffsetX,\n layerOffsetY,\n width,\n height\n );\n layerCtx.restore();\n }\n\n save(opIdx) {\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 }\n this.ctx.save();\n const old = this.current;\n this.stateStack.push(old);\n this.current = old.clone();\n this.dependencyTracker?.save(opIdx);\n }\n\n restore(opIdx) {\n this.dependencyTracker?.restore(opIdx);\n\n if (this.stateStack.length === 0) {\n if (this.inSMaskMode) {\n this.endSMaskMode();\n }\n return;\n }\n\n this.current = this.stateStack.pop();\n this.ctx.restore();\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 copyCtxState(this.suspendedCtx, this.ctx);\n }\n this.checkSMaskState();\n\n // Ensure that the clipping path is reset (fixes issue6413.pdf).\n this.pendingClip = null;\n\n this._cachedScaleForStroking[0] = -1;\n this._cachedGetSinglePixelWidth = null;\n }\n\n transform(opIdx, a, b, c, d, e, f) {\n this.dependencyTracker?.recordIncrementalData(\"transform\", opIdx);\n this.ctx.transform(a, b, c, d, e, f);\n\n this._cachedScaleForStroking[0] = -1;\n this._cachedGetSinglePixelWidth = null;\n }\n\n // Path\n constructPath(opIdx, op, data, minMax) {\n let [path] = data;\n if (!minMax) {\n // The path is empty, so no need to update the current minMax.\n path ||= data[0] = new Path2D();\n this[op](opIdx, path);\n return;\n }\n\n if (this.dependencyTracker !== null) {\n const outerExtraSize = op === OPS.stroke ? this.current.lineWidth / 2 : 0;\n this.dependencyTracker\n .resetBBox(opIdx)\n .recordBBox(\n opIdx,\n this.ctx,\n minMax[0] - outerExtraSize,\n minMax[2] + outerExtraSize,\n minMax[1] - outerExtraSize,\n minMax[3] + outerExtraSize\n )\n .recordDependencies(opIdx, [\"transform\"]);\n }\n\n if (!(path instanceof Path2D)) {\n // Using a SVG string is slightly slower than using the following loop.\n const path2d = (data[0] = new Path2D());\n for (let i = 0, ii = path.length; i < ii; ) {\n switch (path[i++]) {\n case DrawOPS.moveTo:\n path2d.moveTo(path[i++], path[i++]);\n break;\n case DrawOPS.lineTo:\n path2d.lineTo(path[i++], path[i++]);\n break;\n case DrawOPS.curveTo:\n path2d.bezierCurveTo(\n path[i++],\n path[i++],\n path[i++],\n path[i++],\n path[i++],\n path[i++]\n );\n break;\n case DrawOPS.closePath:\n path2d.closePath();\n break;\n default:\n warn(`Unrecognized drawing path operator: ${path[i - 1]}`);\n break;\n }\n }\n path = path2d;\n }\n Util.axialAlignedBoundingBox(\n minMax,\n getCurrentTransform(this.ctx),\n this.current.minMax\n );\n this[op](opIdx, path);\n\n this._pathStartIdx = opIdx;\n }\n\n closePath(opIdx) {\n this.ctx.closePath();\n }\n\n stroke(opIdx, path, 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 const baseTransform = strokeColor.isModifyingCurrentTransform()\n ? ctx.getTransform()\n : null;\n ctx.save();\n ctx.strokeStyle = strokeColor.getPattern(\n ctx,\n this,\n getCurrentTransformInverse(ctx),\n PathType.STROKE\n );\n if (baseTransform) {\n const newPath = new Path2D();\n newPath.addPath(\n path,\n ctx.getTransform().invertSelf().multiplySelf(baseTransform)\n );\n path = newPath;\n }\n this.rescaleAndStroke(path, /* saveRestore */ false);\n ctx.restore();\n } else {\n this.rescaleAndStroke(path, /* saveRestore */ true);\n }\n }\n\n this.dependencyTracker?.recordDependencies(opIdx, Dependencies.stroke);\n\n if (consumePath) {\n this.consumePath(\n opIdx,\n path,\n this.current.getClippedPathBoundingBox(\n PathType.STROKE,\n getCurrentTransform(this.ctx)\n )\n );\n }\n\n // Restore the global alpha to the fill alpha\n ctx.globalAlpha = this.current.fillAlpha;\n }\n\n closeStroke(opIdx, path) {\n this.stroke(opIdx, path);\n }\n\n fill(opIdx, path, 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 const baseTransform = fillColor.isModifyingCurrentTransform()\n ? ctx.getTransform()\n : null;\n this.dependencyTracker?.save(opIdx);\n ctx.save();\n ctx.fillStyle = fillColor.getPattern(\n ctx,\n this,\n getCurrentTransformInverse(ctx),\n PathType.FILL\n );\n if (baseTransform) {\n const newPath = new Path2D();\n newPath.addPath(\n path,\n ctx.getTransform().invertSelf().multiplySelf(baseTransform)\n );\n path = newPath;\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(path, \"evenodd\");\n this.pendingEOFill = false;\n } else {\n ctx.fill(path);\n }\n }\n\n this.dependencyTracker?.recordDependencies(opIdx, Dependencies.fill);\n\n if (needRestore) {\n ctx.restore();\n this.dependencyTracker?.restore(opIdx);\n }\n if (consumePath) {\n this.consumePath(opIdx, path, intersect);\n }\n }\n\n eoFill(opIdx, path) {\n this.pendingEOFill = true;\n this.fill(opIdx, path);\n }\n\n fillStroke(opIdx, path) {\n this.fill(opIdx, path, false);\n this.stroke(opIdx, path, false);\n\n this.consumePath(opIdx, path);\n }\n\n eoFillStroke(opIdx, path) {\n this.pendingEOFill = true;\n this.fillStroke(opIdx, path);\n }\n\n closeFillStroke(opIdx, path) {\n this.fillStroke(opIdx, path);\n }\n\n closeEOFillStroke(opIdx, path) {\n this.pendingEOFill = true;\n this.fillStroke(opIdx, path);\n }\n\n endPath(opIdx, path) {\n this.consumePath(opIdx, path);\n }\n\n rawFillPath(opIdx, path) {\n this.ctx.fill(path);\n this.dependencyTracker\n ?.recordDependencies(opIdx, Dependencies.rawFillPath)\n .recordOperation(opIdx);\n }\n\n // Clipping\n clip(opIdx) {\n this.dependencyTracker?.recordFutureForcedDependency(\"clipMode\", opIdx);\n this.pendingClip = NORMAL_CLIP;\n }\n\n eoClip(opIdx) {\n this.dependencyTracker?.recordFutureForcedDependency(\"clipMode\", opIdx);\n this.pendingClip = EO_CLIP;\n }\n\n // Text\n beginText(opIdx) {\n this.current.textMatrix = null;\n this.current.textMatrixScale = 1;\n this.current.x = this.current.lineX = 0;\n this.current.y = this.current.lineY = 0;\n\n this.dependencyTracker\n ?.recordOpenMarker(opIdx)\n .resetIncrementalData(\"sameLineText\")\n .resetIncrementalData(\"moveText\", opIdx);\n }\n\n endText(opIdx) {\n const paths = this.pendingTextPaths;\n const ctx = this.ctx;\n\n if (this.dependencyTracker) {\n const { dependencyTracker } = this;\n if (paths !== undefined) {\n dependencyTracker\n .recordFutureForcedDependency(\n \"textClip\",\n dependencyTracker.getOpenMarker()\n )\n .recordFutureForcedDependency(\"textClip\", opIdx);\n }\n dependencyTracker.recordCloseMarker(opIdx);\n }\n\n if (paths !== undefined) {\n const newPath = new Path2D();\n const invTransf = ctx.getTransform().invertSelf();\n for (const { transform, x, y, fontSize, path } of paths) {\n if (!path) {\n continue; // Skip empty paths.\n }\n newPath.addPath(\n path,\n new DOMMatrix(transform)\n .preMultiplySelf(invTransf)\n .translate(x, y)\n .scale(fontSize, -fontSize)\n );\n }\n\n ctx.clip(newPath);\n }\n delete this.pendingTextPaths;\n }\n\n setCharSpacing(opIdx, spacing) {\n this.dependencyTracker?.recordSimpleData(\"charSpacing\", opIdx);\n this.current.charSpacing = spacing;\n }\n\n setWordSpacing(opIdx, spacing) {\n this.dependencyTracker?.recordSimpleData(\"wordSpacing\", opIdx);\n this.current.wordSpacing = spacing;\n }\n\n setHScale(opIdx, scale) {\n this.dependencyTracker?.recordSimpleData(\"hScale\", opIdx);\n this.current.textHScale = scale / 100;\n }\n\n setLeading(opIdx, leading) {\n this.dependencyTracker?.recordSimpleData(\"leading\", opIdx);\n this.current.leading = -leading;\n }\n\n setFont(opIdx, fontRefName, size) {\n this.dependencyTracker\n ?.recordSimpleData(\"font\", opIdx)\n .recordNamedDependency(opIdx, fontRefName);\n const fontObj = this.commonObjs.get(fontRefName);\n const current = this.current;\n\n if (!fontObj) {\n throw new Error(`Can't find font for ${fontRefName}`);\n }\n current.fontMatrix = fontObj.fontMatrix || FONT_IDENTITY_MATRIX;\n\n // A valid matrix needs all main diagonal elements to be non-zero\n // This also ensures we bypass FF bugzilla bug #719844.\n if (current.fontMatrix[0] === 0 || current.fontMatrix[3] === 0) {\n warn(\"Invalid font matrix for font \" + fontRefName);\n }\n\n // The spec for Tf (setFont) says that 'size' specifies the font 'scale',\n // and in some docs this can be negative (inverted x-y axes).\n if (size < 0) {\n size = -size;\n current.fontDirection = -1;\n } else {\n current.fontDirection = 1;\n }\n\n this.current.font = fontObj;\n this.current.fontSize = size;\n\n if (fontObj.isType3Font) {\n return; // we don't need ctx.font for Type3 fonts\n }\n\n const name = fontObj.loadedName || \"sans-serif\";\n const typeface =\n fontObj.systemFontInfo?.css || `\"${name}\", ${fontObj.fallbackName}`;\n\n let bold = \"normal\";\n if (fontObj.black) {\n bold = \"900\";\n } else if (fontObj.bold) {\n bold = \"bold\";\n }\n const italic = fontObj.italic ? \"italic\" : \"normal\";\n\n // Some font backends cannot handle fonts below certain size.\n // Keeping the font at minimal size and using the fontSizeScale to change\n // the current transformation matrix before the fillText/strokeText.\n // See https://bugzilla.mozilla.org/show_bug.cgi?id=726227\n let browserFontSize = size;\n if (size < MIN_FONT_SIZE) {\n browserFontSize = MIN_FONT_SIZE;\n } else if (size > MAX_FONT_SIZE) {\n browserFontSize = MAX_FONT_SIZE;\n }\n this.current.fontSizeScale = size / browserFontSize;\n\n this.ctx.font = `${italic} ${bold} ${browserFontSize}px ${typeface}`;\n }\n\n setTextRenderingMode(opIdx, mode) {\n this.dependencyTracker?.recordSimpleData(\"textRenderingMode\", opIdx);\n this.current.textRenderingMode = mode;\n }\n\n setTextRise(opIdx, rise) {\n this.dependencyTracker?.recordSimpleData(\"textRise\", opIdx);\n this.current.textRise = rise;\n }\n\n moveText(opIdx, x, y) {\n this.dependencyTracker\n ?.resetIncrementalData(\"sameLineText\")\n .recordIncrementalData(\"moveText\", opIdx);\n this.current.x = this.current.lineX += x;\n this.current.y = this.current.lineY += y;\n }\n\n setLeadingMoveText(opIdx, x, y) {\n this.setLeading(opIdx, -y);\n this.moveText(opIdx, x, y);\n }\n\n setTextMatrix(opIdx, matrix) {\n this.dependencyTracker?.recordSimpleData(\"textMatrix\", opIdx);\n const { current } = this;\n current.textMatrix = matrix;\n current.textMatrixScale = Math.hypot(matrix[0], matrix[1]);\n\n current.x = current.lineX = 0;\n current.y = current.lineY = 0;\n }\n\n nextLine(opIdx) {\n this.moveText(opIdx, 0, this.current.leading);\n\n this.dependencyTracker?.recordIncrementalData(\n \"moveText\",\n // 'leading' affects 'nextLine' operations. Rather than dealing\n // with transitive dependencies, just mark everything that depends on\n // the 'moveText' operation as depending on the 'leading' value.\n this.dependencyTracker.getSimpleIndex(\"leading\") ?? opIdx\n );\n }\n\n #getScaledPath(path, currentTransform, transform) {\n const newPath = new Path2D();\n newPath.addPath(\n path,\n new DOMMatrix(transform).invertSelf().multiplySelf(currentTransform)\n );\n return newPath;\n }\n\n paintChar(\n opIdx,\n character,\n x,\n y,\n patternFillTransform,\n patternStrokeTransform\n ) {\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 const patternStroke = current.patternStroke && !font.missingFile;\n\n let path;\n if (\n (font.disableFontFace ||\n isAddToPathSet ||\n patternFill ||\n patternStroke) &&\n !font.missingFile\n ) {\n path = font.getPathGenerator(this.commonObjs, character);\n }\n\n if (path && (font.disableFontFace || patternFill || patternStroke)) {\n ctx.save();\n ctx.translate(x, y);\n ctx.scale(fontSize, -fontSize);\n\n this.dependencyTracker?.recordCharacterBBox(opIdx, ctx, font);\n\n let currentTransform;\n if (\n fillStrokeMode === TextRenderingMode.FILL ||\n fillStrokeMode === TextRenderingMode.FILL_STROKE\n ) {\n if (patternFillTransform) {\n currentTransform = ctx.getTransform();\n ctx.setTransform(...patternFillTransform);\n const scaledPath = this.#getScaledPath(\n path,\n currentTransform,\n patternFillTransform\n );\n ctx.fill(scaledPath);\n } else {\n ctx.fill(path);\n }\n }\n if (\n fillStrokeMode === TextRenderingMode.STROKE ||\n fillStrokeMode === TextRenderingMode.FILL_STROKE\n ) {\n if (patternStrokeTransform) {\n currentTransform ||= ctx.getTransform();\n ctx.setTransform(...patternStrokeTransform);\n const { a, b, c, d } = currentTransform;\n const invPatternTransform = Util.inverseTransform(\n patternStrokeTransform\n );\n const transf = Util.transform(\n [a, b, c, d, 0, 0],\n invPatternTransform\n );\n Util.singularValueDecompose2dScale(transf, XY);\n\n // Cancel the pattern scaling of the line width.\n // If sx and sy are different, unfortunately we can't do anything and\n // we'll have a rendering bug.\n ctx.lineWidth *= Math.max(XY[0], XY[1]) / fontSize;\n ctx.stroke(\n this.#getScaledPath(path, currentTransform, patternStrokeTransform)\n );\n } else {\n ctx.lineWidth /= fontSize;\n ctx.stroke(path);\n }\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 this.dependencyTracker?.recordCharacterBBox(\n opIdx,\n ctx,\n font,\n fontSize,\n x,\n y,\n () => ctx.measureText(character)\n );\n }\n if (\n fillStrokeMode === TextRenderingMode.STROKE ||\n fillStrokeMode === TextRenderingMode.FILL_STROKE\n ) {\n if (this.dependencyTracker) {\n this.dependencyTracker\n ?.recordCharacterBBox(opIdx, ctx, font, fontSize, x, y, () =>\n ctx.measureText(character)\n )\n .recordDependencies(opIdx, Dependencies.stroke);\n }\n ctx.strokeText(character, x, y);\n }\n }\n\n if (isAddToPathSet) {\n const paths = (this.pendingTextPaths ||= []);\n paths.push({\n transform: getCurrentTransform(ctx),\n x,\n y,\n fontSize,\n path,\n });\n this.dependencyTracker?.recordCharacterBBox(\n opIdx,\n ctx,\n font,\n fontSize,\n x,\n y\n );\n }\n }\n\n get isFontSubpixelAAEnabled() {\n // Checks if anti-aliasing is enabled when scaled text is painted.\n // On Windows GDI scaled fonts looks bad.\n const { context: ctx } = this.cachedCanvases.getCanvas(\n \"isFontSubpixelAAEnabled\",\n 10,\n 10\n );\n ctx.scale(1.5, 1);\n ctx.fillText(\"I\", 0, 10);\n const data = ctx.getImageData(0, 0, 10, 10).data;\n let enabled = false;\n for (let i = 3; i < data.length; i += 4) {\n if (data[i] > 0 && data[i] < 255) {\n enabled = true;\n break;\n }\n }\n return shadow(this, \"isFontSubpixelAAEnabled\", enabled);\n }\n\n showText(opIdx, glyphs) {\n if (this.dependencyTracker) {\n this.dependencyTracker\n .recordDependencies(opIdx, Dependencies.showText)\n .copyDependenciesFromIncrementalOperation(opIdx, \"sameLineText\")\n .resetBBox(opIdx);\n if (this.current.textRenderingMode & TextRenderingMode.ADD_TO_PATH_FLAG) {\n this.dependencyTracker\n .recordFutureForcedDependency(\"textClip\", opIdx)\n .inheritPendingDependenciesAsFutureForcedDependencies();\n }\n }\n\n const current = this.current;\n const font = current.font;\n if (font.isType3Font) {\n this.showType3Text(opIdx, glyphs);\n this.dependencyTracker\n ?.recordOperation(opIdx)\n .recordIncrementalData(\"sameLineText\", opIdx);\n return undefined;\n }\n\n const fontSize = current.fontSize;\n if (fontSize === 0) {\n this.dependencyTracker?.recordOperation(opIdx);\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 if (current.textMatrix) {\n ctx.transform(...current.textMatrix);\n }\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 patternFillTransform, patternStrokeTransform;\n if (current.patternFill) {\n ctx.save();\n const pattern = current.fillColor.getPattern(\n ctx,\n this,\n getCurrentTransformInverse(ctx),\n PathType.FILL\n );\n patternFillTransform = getCurrentTransform(ctx);\n ctx.restore();\n ctx.fillStyle = pattern;\n }\n\n if (current.patternStroke) {\n ctx.save();\n const pattern = current.strokeColor.getPattern(\n ctx,\n this,\n getCurrentTransformInverse(ctx),\n PathType.STROKE\n );\n patternStrokeTransform = getCurrentTransform(ctx);\n ctx.restore();\n ctx.strokeStyle = pattern;\n }\n\n let lineWidth = current.lineWidth;\n const scale = current.textMatrixScale;\n if (scale === 0 || lineWidth === 0) {\n const fillStrokeMode =\n current.textRenderingMode & TextRenderingMode.FILL_STROKE_MASK;\n if (\n fillStrokeMode === TextRenderingMode.STROKE ||\n fillStrokeMode === TextRenderingMode.FILL_STROKE\n ) {\n lineWidth = this.getSinglePixelWidth();\n }\n } else {\n lineWidth /= scale;\n }\n\n if (fontSizeScale !== 1.0) {\n ctx.scale(fontSizeScale, fontSizeScale);\n lineWidth /= fontSizeScale;\n }\n\n ctx.lineWidth = lineWidth;\n\n if (font.isInvalidPDFjsFont) {\n const chars = [];\n let width = 0;\n for (const glyph of glyphs) {\n chars.push(glyph.unicode);\n width += glyph.width;\n }\n const joinedChars = chars.join(\"\");\n ctx.fillText(joinedChars, 0, 0);\n if (this.dependencyTracker !== null) {\n const measure = ctx.measureText(joinedChars);\n this.dependencyTracker\n .recordBBox(\n opIdx,\n this.ctx,\n -measure.actualBoundingBoxLeft,\n measure.actualBoundingBoxRight,\n -measure.actualBoundingBoxAscent,\n measure.actualBoundingBoxDescent\n )\n .recordOperation(opIdx)\n .recordIncrementalData(\"sameLineText\", opIdx);\n }\n current.x += width * widthAdvanceScale * textHScale;\n ctx.restore();\n this.compose();\n return undefined;\n }\n\n let x = 0,\n i;\n for (i = 0; i < glyphsLength; ++i) {\n const glyph = glyphs[i];\n if (typeof glyph === \"number\") {\n x += (spacingDir * glyph * fontSize) / 1000;\n continue;\n }\n\n let restoreNeeded = false;\n const spacing = (glyph.isSpace ? wordSpacing : 0) + charSpacing;\n const character = glyph.fontChar;\n const accent = glyph.accent;\n let scaledX, scaledY;\n let width = glyph.width;\n if (vertical) {\n const vmetric = glyph.vmetric || defaultVMetrics;\n const vx =\n -(glyph.vmetric ? vmetric[1] : width * 0.5) * widthAdvanceScale;\n const vy = vmetric[2] * widthAdvanceScale;\n\n width = vmetric ? -vmetric[0] : width;\n scaledX = vx / fontSizeScale;\n scaledY = (x + vy) / fontSizeScale;\n } else {\n scaledX = x / fontSizeScale;\n scaledY = 0;\n }\n\n let measure;\n\n if (font.remeasure && width > 0) {\n measure = ctx.measureText(character);\n\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 ((measure.width * 1000) / fontSize) * 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\n this.dependencyTracker?.recordCharacterBBox(\n opIdx,\n ctx,\n // If we already measured the character, force usage of that\n measure ? { bbox: null } : font,\n fontSize / fontSizeScale,\n scaledX,\n scaledY,\n () => measure ?? ctx.measureText(character)\n );\n } else {\n this.paintChar(\n opIdx,\n character,\n scaledX,\n scaledY,\n patternFillTransform,\n patternStrokeTransform\n );\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 opIdx,\n accent.fontChar,\n scaledAccentX,\n scaledAccentY,\n patternFillTransform,\n patternStrokeTransform\n );\n }\n }\n }\n\n const charWidth = vertical\n ? width * widthAdvanceScale - spacing * fontDirection\n : width * widthAdvanceScale + spacing * fontDirection;\n x += charWidth;\n\n if (restoreNeeded) {\n ctx.restore();\n }\n }\n if (vertical) {\n current.y -= x;\n } else {\n current.x += x * textHScale;\n }\n ctx.restore();\n this.compose();\n\n this.dependencyTracker\n ?.recordOperation(opIdx)\n .recordIncrementalData(\"sameLineText\", opIdx);\n return undefined;\n }\n\n showType3Text(opIdx, glyphs) {\n // Type3 fonts - each glyph is a \"mini-PDF\"\n const ctx = this.ctx;\n const current = this.current;\n const font = current.font;\n const fontSize = current.fontSize;\n const fontDirection = current.fontDirection;\n const spacingDir = font.vertical ? 1 : -1;\n const charSpacing = current.charSpacing;\n const wordSpacing = current.wordSpacing;\n const textHScale = current.textHScale * fontDirection;\n const fontMatrix = current.fontMatrix || FONT_IDENTITY_MATRIX;\n const glyphsLength = glyphs.length;\n const isTextInvisible =\n current.textRenderingMode === TextRenderingMode.INVISIBLE;\n let i, glyph, width, spacingLength;\n\n if (isTextInvisible || fontSize === 0) {\n return;\n }\n this._cachedScaleForStroking[0] = -1;\n this._cachedGetSinglePixelWidth = null;\n\n ctx.save();\n if (current.textMatrix) {\n ctx.transform(...current.textMatrix);\n }\n ctx.translate(current.x, current.y + current.textRise);\n\n ctx.scale(textHScale, fontDirection);\n\n // Type3 fonts have their own operator list. Avoid mixing it up with the\n // dependency tracker of the main operator list.\n const dependencyTracker = this.dependencyTracker;\n this.dependencyTracker = dependencyTracker\n ? new CanvasNestedDependencyTracker(dependencyTracker, opIdx)\n : null;\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 } else if (this.contentVisible) {\n this.save();\n ctx.scale(fontSize, fontSize);\n ctx.transform(...fontMatrix);\n this.executeOperatorList(operatorList);\n this.restore();\n }\n\n const p = [glyph.width, 0];\n Util.applyTransform(p, fontMatrix);\n width = p[0] * fontSize + spacing;\n\n ctx.translate(width, 0);\n current.x += width * textHScale;\n }\n ctx.restore();\n if (dependencyTracker) {\n this.dependencyTracker.recordNestedDependencies();\n this.dependencyTracker = dependencyTracker;\n }\n }\n\n // Type3 fonts\n setCharWidth(opIdx, 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(opIdx, xWidth, yWidth, llx, lly, urx, ury) {\n const clip = new Path2D();\n clip.rect(llx, lly, urx - llx, ury - lly);\n this.ctx.clip(clip);\n this.dependencyTracker\n ?.recordBBox(opIdx, this.ctx, llx, urx, lly, ury)\n .recordClipBox(opIdx, this.ctx, llx, urx, lly, ury);\n this.endPath(opIdx);\n }\n\n // Color\n getColorN_Pattern(opIdx, IR) {\n let pattern;\n if (IR[0] === \"TilingPattern\") {\n const baseTransform = this.baseTransform || getCurrentTransform(this.ctx);\n const canvasGraphicsFactory = {\n createCanvasGraphics: ctx =>\n new CanvasGraphics(\n ctx,\n this.commonObjs,\n this.objs,\n this.canvasFactory,\n this.filterFactory,\n {\n optionalContentConfig: this.optionalContentConfig,\n markedContentStack: this.markedContentStack,\n },\n undefined,\n undefined,\n this.dependencyTracker\n ? new CanvasNestedDependencyTracker(this.dependencyTracker, opIdx)\n : null\n ),\n };\n pattern = new TilingPattern(\n IR,\n this.ctx,\n canvasGraphicsFactory,\n baseTransform\n );\n } else {\n pattern = this._getPattern(opIdx, IR[1], IR[2]);\n }\n return pattern;\n }\n\n setStrokeColorN(opIdx, ...args) {\n this.dependencyTracker?.recordSimpleData(\"strokeColor\", opIdx);\n this.current.strokeColor = this.getColorN_Pattern(opIdx, args);\n this.current.patternStroke = true;\n }\n\n setFillColorN(opIdx, ...args) {\n this.dependencyTracker?.recordSimpleData(\"fillColor\", opIdx);\n this.current.fillColor = this.getColorN_Pattern(opIdx, args);\n this.current.patternFill = true;\n }\n\n setStrokeRGBColor(opIdx, color) {\n this.dependencyTracker?.recordSimpleData(\"strokeColor\", opIdx);\n this.ctx.strokeStyle = this.current.strokeColor = color;\n this.current.patternStroke = false;\n }\n\n setStrokeTransparent(opIdx) {\n this.dependencyTracker?.recordSimpleData(\"strokeColor\", opIdx);\n this.ctx.strokeStyle = this.current.strokeColor = \"transparent\";\n this.current.patternStroke = false;\n }\n\n setFillRGBColor(opIdx, color) {\n this.dependencyTracker?.recordSimpleData(\"fillColor\", opIdx);\n this.ctx.fillStyle = this.current.fillColor = color;\n this.current.patternFill = false;\n }\n\n setFillTransparent(opIdx) {\n this.dependencyTracker?.recordSimpleData(\"fillColor\", opIdx);\n this.ctx.fillStyle = this.current.fillColor = \"transparent\";\n this.current.patternFill = false;\n }\n\n _getPattern(opIdx, objId, matrix = null) {\n let pattern;\n if (this.cachedPatterns.has(objId)) {\n pattern = this.cachedPatterns.get(objId);\n } else {\n pattern = getShadingPattern(this.getObject(opIdx, objId));\n this.cachedPatterns.set(objId, pattern);\n }\n if (matrix) {\n pattern.matrix = matrix;\n }\n return pattern;\n }\n\n shadingFill(opIdx, objId) {\n if (!this.contentVisible) {\n return;\n }\n const ctx = this.ctx;\n\n this.save(opIdx);\n const pattern = this._getPattern(opIdx, objId);\n ctx.fillStyle = pattern.getPattern(\n ctx,\n this,\n getCurrentTransformInverse(ctx),\n PathType.SHADING\n );\n\n const inv = getCurrentTransformInverse(ctx);\n if (inv) {\n const { width, height } = ctx.canvas;\n const minMax = MIN_MAX_INIT.slice();\n Util.axialAlignedBoundingBox([0, 0, width, height], inv, minMax);\n const [x0, y0, x1, y1] = minMax;\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.dependencyTracker\n ?.resetBBox(opIdx)\n // TODO: Track proper bbox\n .recordFullPageBBox(opIdx)\n .recordDependencies(opIdx, Dependencies.transform)\n .recordDependencies(opIdx, Dependencies.fill)\n .recordOperation(opIdx);\n\n this.compose(this.current.getClippedPathBoundingBox());\n this.restore(opIdx);\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(opIdx, matrix, bbox) {\n if (!this.contentVisible) {\n return;\n }\n this.save(opIdx);\n this.baseTransformStack.push(this.baseTransform);\n\n if (matrix) {\n this.transform(opIdx, ...matrix);\n }\n this.baseTransform = getCurrentTransform(this.ctx);\n\n if (bbox) {\n Util.axialAlignedBoundingBox(\n bbox,\n this.baseTransform,\n this.current.minMax\n );\n const [x0, y0, x1, y1] = bbox;\n const clip = new Path2D();\n clip.rect(x0, y0, x1 - x0, y1 - y0);\n this.ctx.clip(clip);\n this.dependencyTracker?.recordClipBox(opIdx, this.ctx, x0, x1, y0, y1);\n this.endPath(opIdx);\n }\n }\n\n paintFormXObjectEnd(opIdx) {\n if (!this.contentVisible) {\n return;\n }\n this.restore(opIdx);\n this.baseTransform = this.baseTransformStack.pop();\n }\n\n beginGroup(opIdx, group) {\n if (!this.contentVisible) {\n return;\n }\n\n this.save(opIdx);\n // If there's an active soft mask we don't want it enabled for the group, so\n // clear it out. The mask and suspended canvas will be restored in endGroup.\n if (this.inSMaskMode) {\n this.endSMaskMode();\n this.current.activeSMask = null;\n }\n\n const currentCtx = this.ctx;\n // TODO non-isolated groups - according to Rik at adobe non-isolated\n // group results aren't usually that different and they even have tools\n // that ignore this setting. Notes from Rik on implementing:\n // - When you encounter an transparency group, create a new canvas with\n // the dimensions of the bbox\n // - copy the content from the previous canvas to the new canvas\n // - draw as usual\n // - remove the backdrop alpha:\n // alphaNew = 1 - (1 - alpha)/(1 - alphaBackdrop) with 'alpha' the alpha\n // value of your transparency group and 'alphaBackdrop' the alpha of the\n // backdrop\n // - remove background color:\n // colorNew = color - alphaNew *colorBackdrop /(1 - alphaNew)\n if (!group.isolated) {\n info(\"TODO: Support non-isolated groups.\");\n }\n\n // TODO knockout - supposedly possible with the clever use of compositing\n // modes.\n if (group.knockout) {\n warn(\"Knockout groups not supported.\");\n }\n\n const currentTransform = getCurrentTransform(currentCtx);\n if (group.matrix) {\n currentCtx.transform(...group.matrix);\n }\n if (!group.bbox) {\n throw new Error(\"Bounding box is required.\");\n }\n\n // Based on the current transform figure out how big the bounding box\n // will actually be.\n let bounds = MIN_MAX_INIT.slice();\n Util.axialAlignedBoundingBox(\n group.bbox,\n getCurrentTransform(currentCtx),\n bounds\n );\n\n // Clip the bounding box to the current canvas.\n const canvasBounds = [\n 0,\n 0,\n currentCtx.canvas.width,\n currentCtx.canvas.height,\n ];\n bounds = Util.intersect(bounds, canvasBounds) || [0, 0, 0, 0];\n // Use ceil in case we're between sizes so we don't create canvas that is\n // too small and make the canvas at least 1x1 pixels.\n const offsetX = Math.floor(bounds[0]);\n const offsetY = Math.floor(bounds[1]);\n const drawnWidth = Math.max(Math.ceil(bounds[2]) - offsetX, 1);\n const drawnHeight = Math.max(Math.ceil(bounds[3]) - offsetY, 1);\n\n this.current.startNewPathAndClipBox([0, 0, drawnWidth, drawnHeight]);\n\n let cacheId = \"groupAt\" + this.groupLevel;\n if (group.smask) {\n // Using two cache entries is case if masks are used one after another.\n cacheId += \"_smask_\" + (this.smaskCounter++ % 2);\n }\n const scratchCanvas = this.cachedCanvases.getCanvas(\n cacheId,\n drawnWidth,\n drawnHeight\n );\n const groupCtx = scratchCanvas.context;\n\n // Since we created a new canvas that is just the size of the bounding box\n // we have to translate the group ctx.\n groupCtx.translate(-offsetX, -offsetY);\n groupCtx.transform(...currentTransform);\n\n // Apply the bbox to the group context.\n let clip = new Path2D();\n const [x0, y0, x1, y1] = group.bbox;\n clip.rect(x0, y0, x1 - x0, y1 - y0);\n if (group.matrix) {\n const path = new Path2D();\n path.addPath(clip, new DOMMatrix(group.matrix));\n clip = path;\n }\n groupCtx.clip(clip);\n\n if (group.smask) {\n // Saving state and cached mask to be used in setGState.\n this.smaskStack.push({\n canvas: scratchCanvas.canvas,\n context: groupCtx,\n offsetX,\n offsetY,\n subtype: group.smask.subtype,\n backdrop: group.smask.backdrop,\n transferMap: group.smask.transferMap || null,\n startTransformInverse: null, // used during suspend operation\n });\n }\n if (\n !group.smask ||\n // When this is not an SMask group, we only need to update the current\n // transform if recording operations bboxes, so they the bboxes have the\n // correct transform applied.\n this.dependencyTracker\n ) {\n // Setup the current ctx so when the group is popped we draw it at the\n // right location.\n currentCtx.setTransform(1, 0, 0, 1, 0, 0);\n currentCtx.translate(offsetX, offsetY);\n currentCtx.save();\n }\n // The transparency group inherits all off the current graphics state\n // except the blend mode, soft mask, and alpha constants.\n copyCtxState(currentCtx, groupCtx);\n this.ctx = groupCtx;\n this.dependencyTracker\n ?.inheritSimpleDataAsFutureForcedDependencies([\n \"fillAlpha\",\n \"strokeAlpha\",\n \"globalCompositeOperation\",\n ])\n .pushBaseTransform(currentCtx);\n this.setGState(opIdx, [\n [\"BM\", \"source-over\"],\n [\"ca\", 1],\n [\"CA\", 1],\n ]);\n this.groupStack.push(currentCtx);\n this.groupLevel++;\n }\n\n endGroup(opIdx, 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 this.dependencyTracker?.popBaseTransform();\n\n if (group.smask) {\n this.tempSMask = this.smaskStack.pop();\n this.restore(opIdx);\n if (this.dependencyTracker) {\n this.ctx.restore();\n }\n } else {\n this.ctx.restore();\n const currentMtx = getCurrentTransform(this.ctx);\n this.restore(opIdx);\n this.ctx.save();\n this.ctx.setTransform(...currentMtx);\n const dirtyBox = MIN_MAX_INIT.slice();\n Util.axialAlignedBoundingBox(\n [0, 0, groupCtx.canvas.width, groupCtx.canvas.height],\n currentMtx,\n dirtyBox\n );\n this.ctx.drawImage(groupCtx.canvas, 0, 0);\n this.ctx.restore();\n this.compose(dirtyBox);\n }\n }\n\n beginAnnotation(opIdx, id, rect, transform, matrix, hasOwnCanvas) {\n // The annotations are drawn just after the page content.\n // The page content drawing can potentially have set a transform,\n // a clipping path, whatever...\n // So in order to have something clean, we restore the initial state.\n this.#restoreInitialState();\n resetCtxToDefault(this.ctx);\n\n this.ctx.save();\n this.save(opIdx);\n\n if (this.baseTransform) {\n this.ctx.setTransform(...this.baseTransform);\n }\n\n if (rect) {\n const width = rect[2] - rect[0];\n const height = rect[3] - rect[1];\n\n if (hasOwnCanvas && this.annotationCanvasMap) {\n transform = transform.slice();\n transform[4] -= rect[0];\n transform[5] -= rect[1];\n\n rect = rect.slice();\n rect[0] = rect[1] = 0;\n rect[2] = width;\n rect[3] = height;\n\n Util.singularValueDecompose2dScale(getCurrentTransform(this.ctx), XY);\n const { viewportScale } = this;\n const canvasWidth = Math.ceil(\n width * this.outputScaleX * viewportScale\n );\n const canvasHeight = Math.ceil(\n height * this.outputScaleY * viewportScale\n );\n\n this.annotationCanvas = this.canvasFactory.create(\n canvasWidth,\n canvasHeight\n );\n const { canvas, context } = this.annotationCanvas;\n this.annotationCanvasMap.set(id, canvas);\n this.annotationCanvas.savedCtx = this.ctx;\n this.ctx = context;\n this.ctx.save();\n this.ctx.setTransform(XY[0], 0, 0, -XY[1], 0, height * XY[1]);\n\n resetCtxToDefault(this.ctx);\n } else {\n resetCtxToDefault(this.ctx);\n\n // Consume a potential path before clipping.\n this.endPath(opIdx);\n\n const clip = new Path2D();\n clip.rect(rect[0], rect[1], width, height);\n this.ctx.clip(clip);\n }\n }\n\n this.current = new CanvasExtraState(\n this.ctx.canvas.width,\n this.ctx.canvas.height\n );\n\n this.transform(opIdx, ...transform);\n this.transform(opIdx, ...matrix);\n }\n\n endAnnotation(opIdx) {\n if (this.annotationCanvas) {\n this.ctx.restore();\n this.#drawFilter();\n\n this.ctx = this.annotationCanvas.savedCtx;\n delete this.annotationCanvas.savedCtx;\n delete this.annotationCanvas;\n }\n }\n\n paintImageMaskXObject(opIdx, img) {\n if (!this.contentVisible) {\n return;\n }\n\n const count = img.count;\n img = this.getObject(opIdx, img.data, img);\n img.count = count;\n\n const ctx = this.ctx;\n const mask = this._createMaskCanvas(opIdx, 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 this.dependencyTracker\n ?.resetBBox(opIdx)\n .recordBBox(\n opIdx,\n this.ctx,\n mask.offsetX,\n mask.offsetX + maskCanvas.width,\n mask.offsetY,\n mask.offsetY + maskCanvas.height\n )\n .recordOperation(opIdx);\n ctx.restore();\n this.compose();\n }\n\n paintImageMaskXObjectRepeat(\n opIdx,\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(opIdx, img.data, img);\n\n const ctx = this.ctx;\n ctx.save();\n const currentTransform = getCurrentTransform(ctx);\n ctx.transform(scaleX, skewX, skewY, scaleY, 0, 0);\n const mask = this._createMaskCanvas(opIdx, img);\n\n ctx.setTransform(\n 1,\n 0,\n 0,\n 1,\n mask.offsetX - currentTransform[4],\n mask.offsetY - currentTransform[5]\n );\n this.dependencyTracker?.resetBBox(opIdx);\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 // Here we want to apply the transform at the origin,\n // hence no additional computation is necessary.\n ctx.drawImage(mask.canvas, trans[4], trans[5]);\n this.dependencyTracker?.recordBBox(\n opIdx,\n this.ctx,\n trans[4],\n trans[4] + mask.canvas.width,\n trans[5],\n trans[5] + mask.canvas.height\n );\n }\n ctx.restore();\n this.compose();\n\n this.dependencyTracker?.recordOperation(opIdx);\n }\n\n paintImageMaskXObjectGroup(opIdx, images) {\n if (!this.contentVisible) {\n return;\n }\n const ctx = this.ctx;\n\n const fillColor = this.current.fillColor;\n const isPatternFill = this.current.patternFill;\n\n this.dependencyTracker\n ?.resetBBox(opIdx)\n .recordDependencies(opIdx, Dependencies.transformAndFill);\n\n for (const image of images) {\n const { data, width, height, transform } = image;\n\n const maskCanvas = this.cachedCanvases.getCanvas(\n \"maskCanvas\",\n width,\n height\n );\n const maskCtx = maskCanvas.context;\n maskCtx.save();\n\n const img = this.getObject(opIdx, data, image);\n putBinaryImageMask(maskCtx, img);\n\n maskCtx.globalCompositeOperation = \"source-in\";\n\n maskCtx.fillStyle = isPatternFill\n ? fillColor.getPattern(\n maskCtx,\n this,\n getCurrentTransformInverse(ctx),\n PathType.FILL\n )\n : fillColor;\n maskCtx.fillRect(0, 0, width, height);\n\n maskCtx.restore();\n\n ctx.save();\n ctx.transform(...transform);\n ctx.scale(1, -1);\n drawImageAtIntegerCoords(\n ctx,\n maskCanvas.canvas,\n 0,\n 0,\n width,\n height,\n 0,\n -1,\n 1,\n 1\n );\n\n this.dependencyTracker?.recordBBox(opIdx, ctx, 0, width, 0, height);\n ctx.restore();\n }\n this.compose();\n this.dependencyTracker?.recordOperation(opIdx);\n }\n\n paintImageXObject(opIdx, objId) {\n if (!this.contentVisible) {\n return;\n }\n const imgData = this.getObject(opIdx, objId);\n if (!imgData) {\n warn(\"Dependent image isn't ready yet\");\n return;\n }\n\n this.paintInlineImageXObject(opIdx, imgData);\n }\n\n paintImageXObjectRepeat(opIdx, objId, scaleX, scaleY, positions) {\n if (!this.contentVisible) {\n return;\n }\n const imgData = this.getObject(opIdx, 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(opIdx, imgData, map);\n }\n\n applyTransferMapsToCanvas(ctx) {\n if (this.current.transferMaps !== \"none\") {\n ctx.filter = this.current.transferMaps;\n ctx.drawImage(ctx.canvas, 0, 0);\n ctx.filter = \"none\";\n }\n return ctx.canvas;\n }\n\n applyTransferMapsToBitmap(imgData) {\n if (this.current.transferMaps === \"none\") {\n return imgData.bitmap;\n }\n const { bitmap, width, height } = imgData;\n const tmpCanvas = this.cachedCanvases.getCanvas(\n \"inlineImage\",\n width,\n height\n );\n const tmpCtx = tmpCanvas.context;\n tmpCtx.filter = this.current.transferMaps;\n tmpCtx.drawImage(bitmap, 0, 0);\n tmpCtx.filter = \"none\";\n\n return tmpCanvas.canvas;\n }\n\n paintInlineImageXObject(opIdx, 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(opIdx);\n\n // The filter, if any, will be applied in applyTransferMapsToBitmap.\n // It must be applied to the image before rescaling else some artifacts\n // could appear.\n // The final restore will reset it to its value.\n const { filter } = ctx;\n if (filter !== \"none\" && filter !== \"\") {\n ctx.filter = \"none\";\n }\n\n // scale the image to the unit square\n ctx.scale(1 / width, -1 / height);\n\n let imgToPaint;\n if (imgData.bitmap) {\n imgToPaint = this.applyTransferMapsToBitmap(imgData);\n } else if (\n (typeof HTMLElement === \"function\" && imgData instanceof HTMLElement) ||\n !imgData.data\n ) {\n // typeof check is needed due to node.js support, see issue #8489\n imgToPaint = imgData;\n } else {\n const tmpCanvas = this.cachedCanvases.getCanvas(\n \"inlineImage\",\n width,\n height\n );\n const tmpCtx = tmpCanvas.context;\n putBinaryImageData(tmpCtx, imgData);\n imgToPaint = this.applyTransferMapsToCanvas(tmpCtx);\n }\n\n const scaled = this._scaleImage(\n imgToPaint,\n getCurrentTransformInverse(ctx)\n );\n ctx.imageSmoothingEnabled = getImageSmoothingEnabled(\n getCurrentTransform(ctx),\n imgData.interpolate\n );\n\n this.dependencyTracker\n ?.resetBBox(opIdx)\n .recordBBox(opIdx, ctx, 0, width, -height, 0)\n .recordDependencies(opIdx, Dependencies.imageXObject)\n .recordOperation(opIdx);\n\n drawImageAtIntegerCoords(\n ctx,\n scaled.img,\n 0,\n 0,\n scaled.paintWidth,\n scaled.paintHeight,\n 0,\n -height,\n width,\n height\n );\n this.compose();\n this.restore(opIdx);\n }\n\n paintInlineImageXObjectGroup(opIdx, imgData, map) {\n if (!this.contentVisible) {\n return;\n }\n const ctx = this.ctx;\n let imgToPaint;\n if (imgData.bitmap) {\n imgToPaint = imgData.bitmap;\n } else {\n const w = imgData.width;\n const h = imgData.height;\n\n const tmpCanvas = this.cachedCanvases.getCanvas(\"inlineImage\", w, h);\n const tmpCtx = tmpCanvas.context;\n putBinaryImageData(tmpCtx, imgData);\n imgToPaint = this.applyTransferMapsToCanvas(tmpCtx);\n }\n\n this.dependencyTracker?.resetBBox(opIdx);\n\n for (const entry of map) {\n ctx.save();\n ctx.transform(...entry.transform);\n ctx.scale(1, -1);\n drawImageAtIntegerCoords(\n ctx,\n imgToPaint,\n entry.x,\n entry.y,\n entry.w,\n entry.h,\n 0,\n -1,\n 1,\n 1\n );\n this.dependencyTracker?.recordBBox(opIdx, ctx, 0, 1, -1, 0);\n ctx.restore();\n }\n this.dependencyTracker?.recordOperation(opIdx);\n this.compose();\n }\n\n paintSolidColorImageMask(opIdx) {\n if (!this.contentVisible) {\n return;\n }\n this.dependencyTracker\n ?.resetBBox(opIdx)\n .recordBBox(opIdx, this.ctx, 0, 1, 0, 1)\n .recordDependencies(opIdx, Dependencies.fill)\n .recordOperation(opIdx);\n this.ctx.fillRect(0, 0, 1, 1);\n this.compose();\n }\n\n // Marked content\n\n markPoint(opIdx, tag) {\n // TODO Marked content.\n }\n\n markPointProps(opIdx, tag, properties) {\n // TODO Marked content.\n }\n\n beginMarkedContent(opIdx, tag) {\n this.dependencyTracker?.beginMarkedContent(opIdx);\n this.markedContentStack.push({\n visible: true,\n });\n }\n\n beginMarkedContentProps(opIdx, tag, properties) {\n this.dependencyTracker?.beginMarkedContent(opIdx);\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(opIdx) {\n this.dependencyTracker?.endMarkedContent(opIdx);\n this.markedContentStack.pop();\n this.contentVisible = this.isContentVisible();\n }\n\n // Compatibility\n\n beginCompat(opIdx) {\n // TODO ignore undefined operators (should we do that anyway?)\n }\n\n endCompat(opIdx) {\n // TODO stop ignoring undefined operators\n }\n\n // Helper functions\n\n consumePath(opIdx, path, 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(path, \"evenodd\");\n } else {\n ctx.clip(path);\n }\n }\n this.pendingClip = null;\n this.dependencyTracker\n ?.bboxToClipBoxDropOperation(opIdx)\n .recordFutureForcedDependency(\"clipPath\", opIdx);\n } else {\n this.dependencyTracker?.recordOperation(opIdx);\n }\n\n this.current.startNewPathAndClipBox(this.current.clipBox);\n }\n\n getSinglePixelWidth() {\n if (!this._cachedGetSinglePixelWidth) {\n const m = getCurrentTransform(this.ctx);\n if (m[1] === 0 && m[2] === 0) {\n // Fast path\n this._cachedGetSinglePixelWidth =\n 1 / Math.min(Math.abs(m[0]), Math.abs(m[3]));\n } else {\n const absDet = Math.abs(m[0] * m[3] - m[2] * m[1]);\n const normX = Math.hypot(m[0], m[2]);\n const normY = Math.hypot(m[1], m[3]);\n this._cachedGetSinglePixelWidth = Math.max(normX, normY) / absDet;\n }\n }\n return this._cachedGetSinglePixelWidth;\n }\n\n getScaleForStroking() {\n // A pixel has thicknessX = thicknessY = 1;\n // A transformed pixel is a parallelogram and the thicknesses\n // corresponds to the heights.\n // The goal of this function is to rescale before setting the\n // lineWidth in order to have both thicknesses greater or equal\n // to 1 after transform.\n if (this._cachedScaleForStroking[0] === -1) {\n const { lineWidth } = this.current;\n const { a, b, c, d } = this.ctx.getTransform();\n let scaleX, scaleY;\n\n if (b === 0 && c === 0) {\n // Fast path\n const normX = Math.abs(a);\n const normY = Math.abs(d);\n if (normX === normY) {\n if (lineWidth === 0) {\n scaleX = scaleY = 1 / normX;\n } else {\n const scaledLineWidth = normX * lineWidth;\n scaleX = scaleY = scaledLineWidth < 1 ? 1 / scaledLineWidth : 1;\n }\n } else if (lineWidth === 0) {\n scaleX = 1 / normX;\n scaleY = 1 / normY;\n } else {\n const scaledXLineWidth = normX * lineWidth;\n const scaledYLineWidth = normY * lineWidth;\n scaleX = scaledXLineWidth < 1 ? 1 / scaledXLineWidth : 1;\n scaleY = scaledYLineWidth < 1 ? 1 / scaledYLineWidth : 1;\n }\n } else {\n // A pixel (base (x, y)) is transformed by M into a parallelogram:\n // - its area is |det(M)|;\n // - heightY (orthogonal to Mx) has a length: |det(M)| / norm(Mx);\n // - heightX (orthogonal to My) has a length: |det(M)| / norm(My).\n // heightX and heightY are the thicknesses of the transformed pixel\n // and they must be both greater or equal to 1.\n const absDet = Math.abs(a * d - b * c);\n const normX = Math.hypot(a, b);\n const normY = Math.hypot(c, d);\n if (lineWidth === 0) {\n scaleX = normY / absDet;\n scaleY = normX / absDet;\n } else {\n const baseArea = lineWidth * absDet;\n scaleX = normY > baseArea ? normY / baseArea : 1;\n scaleY = normX > baseArea ? normX / baseArea : 1;\n }\n }\n this._cachedScaleForStroking[0] = scaleX;\n this._cachedScaleForStroking[1] = scaleY;\n }\n return this._cachedScaleForStroking;\n }\n\n // Rescale before stroking in order to have a final lineWidth\n // with both thicknesses greater or equal to 1.\n rescaleAndStroke(path, saveRestore) {\n const {\n ctx,\n current: { lineWidth },\n } = this;\n const [scaleX, scaleY] = this.getScaleForStroking();\n\n if (scaleX === scaleY) {\n ctx.lineWidth = (lineWidth || 1) * scaleX;\n ctx.stroke(path);\n return;\n }\n\n const dashes = ctx.getLineDash();\n if (saveRestore) {\n ctx.save();\n }\n\n ctx.scale(scaleX, scaleY);\n SCALE_MATRIX.a = 1 / scaleX;\n SCALE_MATRIX.d = 1 / scaleY;\n const newPath = new Path2D();\n newPath.addPath(path, SCALE_MATRIX);\n\n // How the dashed line is rendered depends on the current transform...\n // so we added a rescale to handle too thin lines and consequently\n // the way the line is dashed will be modified.\n // If scaleX === scaleY, the dashed lines will be rendered correctly\n // else we'll have some bugs (but only with too thin lines).\n // Here we take the max... why not taking the min... or something else.\n // Anyway, as said it's buggy when scaleX !== scaleY.\n if (dashes.length > 0) {\n const scale = Math.max(scaleX, scaleY);\n ctx.setLineDash(dashes.map(x => x / scale));\n ctx.lineDashOffset /= scale;\n }\n\n ctx.lineWidth = lineWidth || 1;\n ctx.stroke(newPath);\n\n if (saveRestore) {\n ctx.restore();\n }\n }\n\n isContentVisible() {\n for (let i = this.markedContentStack.length - 1; i >= 0; i--) {\n if (!this.markedContentStack[i].visible) {\n return false;\n }\n }\n return true;\n }\n}\n\nfor (const op in OPS) {\n if (CanvasGraphics.prototype[op] !== undefined) {\n CanvasGraphics.prototype[OPS[op]] = CanvasGraphics.prototype[op];\n }\n}\n\nexport { CanvasGraphics };\n","/* Copyright 2018 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nclass GlobalWorkerOptions {\n static #port = null;\n\n static #src = \"\";\n\n /**\n * @type {Worker | null}\n */\n static get workerPort() {\n return this.#port;\n }\n\n /**\n * @param {Worker | null} workerPort - Defines global port for worker process.\n * Overrides the `workerSrc` option.\n */\n static set workerPort(val) {\n if (\n !(typeof Worker !== \"undefined\" && val instanceof Worker) &&\n val !== null\n ) {\n throw new Error(\"Invalid `workerPort` type.\");\n }\n this.#port = val;\n }\n\n /**\n * @type {string}\n */\n static get workerSrc() {\n return this.#src;\n }\n\n /**\n * @param {string} workerSrc - A string containing the path and filename of\n * the worker file.\n *\n * NOTE: The `workerSrc` option should always be set, in order to prevent\n * any issues when using the PDF.js library.\n */\n static set workerSrc(val) {\n if (typeof val !== \"string\") {\n throw new Error(\"Invalid `workerSrc` type.\");\n }\n this.#src = val;\n }\n}\n\nexport { GlobalWorkerOptions };\n","/* Copyright 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\nclass Metadata {\n #map;\n\n #data;\n\n constructor({ parsedData, rawData }) {\n this.#map = parsedData;\n this.#data = rawData;\n }\n\n getRaw() {\n return this.#data;\n }\n\n get(name) {\n return this.#map.get(name) ?? null;\n }\n\n [Symbol.iterator]() {\n return this.#map.entries();\n }\n}\n\nexport { Metadata };\n","/* Copyright 2020 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n info,\n RenderingIntentFlag,\n unreachable,\n warn,\n} from \"../shared/util.js\";\nimport { MurmurHash3_64 } from \"../shared/murmurhash3.js\";\n\nconst INTERNAL = Symbol(\"INTERNAL\");\n\nclass OptionalContentGroup {\n #isDisplay = false;\n\n #isPrint = false;\n\n #userSet = false;\n\n #visible = true;\n\n constructor(renderingIntent, { name, intent, usage, rbGroups }) {\n this.#isDisplay = !!(renderingIntent & RenderingIntentFlag.DISPLAY);\n this.#isPrint = !!(renderingIntent & RenderingIntentFlag.PRINT);\n\n this.name = name;\n this.intent = intent;\n this.usage = usage;\n this.rbGroups = rbGroups;\n }\n\n /**\n * @type {boolean}\n */\n get visible() {\n if (this.#userSet) {\n return this.#visible;\n }\n if (!this.#visible) {\n return false;\n }\n const { print, view } = this.usage;\n\n if (this.#isDisplay) {\n return view?.viewState !== \"OFF\";\n } else if (this.#isPrint) {\n return print?.printState !== \"OFF\";\n }\n return true;\n }\n\n /**\n * @ignore\n */\n _setVisible(internal, visible, userSet = false) {\n if (internal !== INTERNAL) {\n unreachable(\"Internal method `_setVisible` called.\");\n }\n this.#userSet = userSet;\n this.#visible = visible;\n }\n}\n\nclass OptionalContentConfig {\n #cachedGetHash = null;\n\n #groups = new Map();\n\n #initialHash = null;\n\n #order = null;\n\n constructor(data, renderingIntent = RenderingIntentFlag.DISPLAY) {\n this.renderingIntent = renderingIntent;\n\n this.name = null;\n this.creator = null;\n\n if (data === null) {\n return;\n }\n this.name = data.name;\n this.creator = data.creator;\n this.#order = data.order;\n for (const group of data.groups) {\n this.#groups.set(\n group.id,\n new OptionalContentGroup(renderingIntent, group)\n );\n }\n\n if (data.baseState === \"OFF\") {\n for (const group of this.#groups.values()) {\n group._setVisible(INTERNAL, false);\n }\n }\n\n for (const on of data.on) {\n this.#groups.get(on)._setVisible(INTERNAL, true);\n }\n\n for (const off of data.off) {\n this.#groups.get(off)._setVisible(INTERNAL, false);\n }\n\n // The following code must always run *last* in the constructor.\n this.#initialHash = this.getHash();\n }\n\n #evaluateVisibilityExpression(array) {\n const length = array.length;\n if (length < 2) {\n return true;\n }\n const operator = array[0];\n for (let i = 1; i < length; i++) {\n const element = array[i];\n let state;\n if (Array.isArray(element)) {\n state = this.#evaluateVisibilityExpression(element);\n } else if (this.#groups.has(element)) {\n state = this.#groups.get(element).visible;\n } else {\n warn(`Optional content group not found: ${element}`);\n return true;\n }\n switch (operator) {\n case \"And\":\n if (!state) {\n return false;\n }\n break;\n case \"Or\":\n if (state) {\n return true;\n }\n break;\n case \"Not\":\n return !state;\n default:\n return true;\n }\n }\n return operator === \"And\";\n }\n\n isVisible(group) {\n if (this.#groups.size === 0) {\n return true;\n }\n if (!group) {\n info(\"Optional content group not defined.\");\n return true;\n }\n if (group.type === \"OCG\") {\n if (!this.#groups.has(group.id)) {\n warn(`Optional content group not found: ${group.id}`);\n return true;\n }\n return this.#groups.get(group.id).visible;\n } else if (group.type === \"OCMD\") {\n // Per the spec, the expression should be preferred if available.\n if (group.expression) {\n return this.#evaluateVisibilityExpression(group.expression);\n }\n if (!group.policy || group.policy === \"AnyOn\") {\n // Default\n for (const id of group.ids) {\n if (!this.#groups.has(id)) {\n warn(`Optional content group not found: ${id}`);\n return true;\n }\n if (this.#groups.get(id).visible) {\n return true;\n }\n }\n return false;\n } else if (group.policy === \"AllOn\") {\n for (const id of group.ids) {\n if (!this.#groups.has(id)) {\n warn(`Optional content group not found: ${id}`);\n return true;\n }\n if (!this.#groups.get(id).visible) {\n return false;\n }\n }\n return true;\n } else if (group.policy === \"AnyOff\") {\n for (const id of group.ids) {\n if (!this.#groups.has(id)) {\n warn(`Optional content group not found: ${id}`);\n return true;\n }\n if (!this.#groups.get(id).visible) {\n return true;\n }\n }\n return false;\n } else if (group.policy === \"AllOff\") {\n for (const id of group.ids) {\n if (!this.#groups.has(id)) {\n warn(`Optional content group not found: ${id}`);\n return true;\n }\n if (this.#groups.get(id).visible) {\n return false;\n }\n }\n return true;\n }\n warn(`Unknown optional content policy ${group.policy}.`);\n return true;\n }\n warn(`Unknown group type ${group.type}.`);\n return true;\n }\n\n setVisibility(id, visible = true, preserveRB = true) {\n const group = this.#groups.get(id);\n if (!group) {\n warn(`Optional content group not found: ${id}`);\n return;\n }\n\n // If the visibility is about to be set to `true` and the group belongs to\n // any radiobutton groups, hide all other OCGs in these radiobutton groups,\n // provided that radiobutton state relationships are to be preserved.\n if (preserveRB && visible && group.rbGroups.length) {\n for (const rbGroup of group.rbGroups) {\n for (const otherId of rbGroup) {\n if (otherId !== id) {\n this.#groups.get(otherId)?._setVisible(INTERNAL, false, true);\n }\n }\n }\n }\n\n group._setVisible(INTERNAL, !!visible, /* userSet = */ true);\n\n this.#cachedGetHash = null;\n }\n\n setOCGState({ state, preserveRB }) {\n let operator;\n\n for (const elem of state) {\n switch (elem) {\n case \"ON\":\n case \"OFF\":\n case \"Toggle\":\n operator = elem;\n continue;\n }\n\n const group = this.#groups.get(elem);\n if (!group) {\n continue;\n }\n switch (operator) {\n case \"ON\":\n this.setVisibility(elem, true, preserveRB);\n break;\n case \"OFF\":\n this.setVisibility(elem, false, preserveRB);\n break;\n case \"Toggle\":\n this.setVisibility(elem, !group.visible, preserveRB);\n break;\n }\n }\n\n this.#cachedGetHash = null;\n }\n\n get hasInitialVisibility() {\n return this.#initialHash === null || this.getHash() === this.#initialHash;\n }\n\n getOrder() {\n if (!this.#groups.size) {\n return null;\n }\n if (this.#order) {\n return this.#order.slice();\n }\n return [...this.#groups.keys()];\n }\n\n getGroup(id) {\n return this.#groups.get(id) || null;\n }\n\n getHash() {\n if (this.#cachedGetHash !== null) {\n return this.#cachedGetHash;\n }\n const hash = new MurmurHash3_64();\n\n for (const [id, group] of this.#groups) {\n hash.update(`${id}:${group.visible}`);\n }\n return (this.#cachedGetHash = hash.hexdigest());\n }\n\n [Symbol.iterator]() {\n return this.#groups.entries();\n }\n}\n\nexport { OptionalContentConfig };\n","/* Copyright 2012 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/** @typedef {import(\"../interfaces\").IPDFStream} IPDFStream */\n/** @typedef {import(\"../interfaces\").IPDFStreamReader} IPDFStreamReader */\n// eslint-disable-next-line max-len\n/** @typedef {import(\"../interfaces\").IPDFStreamRangeReader} IPDFStreamRangeReader */\n\nimport { assert } from \"../shared/util.js\";\nimport { isPdfFile } from \"./display_utils.js\";\n\n/** @implements {IPDFStream} */\nclass PDFDataTransportStream {\n constructor(\n pdfDataRangeTransport,\n { disableRange = false, disableStream = false }\n ) {\n assert(\n pdfDataRangeTransport,\n 'PDFDataTransportStream - missing required \"pdfDataRangeTransport\" argument.'\n );\n const { length, initialData, progressiveDone, contentDispositionFilename } =\n pdfDataRangeTransport;\n\n this._queuedChunks = [];\n this._progressiveDone = progressiveDone;\n this._contentDispositionFilename = contentDispositionFilename;\n\n if (initialData?.length > 0) {\n // Prevent any possible issues by only transferring a Uint8Array that\n // completely \"utilizes\" its underlying ArrayBuffer.\n const buffer =\n initialData instanceof Uint8Array &&\n initialData.byteLength === initialData.buffer.byteLength\n ? initialData.buffer\n : new Uint8Array(initialData).buffer;\n this._queuedChunks.push(buffer);\n }\n\n this._pdfDataRangeTransport = pdfDataRangeTransport;\n this._isStreamingSupported = !disableStream;\n this._isRangeSupported = !disableRange;\n this._contentLength = length;\n\n this._fullRequestReader = null;\n this._rangeReaders = [];\n\n pdfDataRangeTransport.addRangeListener((begin, chunk) => {\n this._onReceiveData({ begin, chunk });\n });\n\n pdfDataRangeTransport.addProgressListener((loaded, total) => {\n this._onProgress({ loaded, total });\n });\n\n pdfDataRangeTransport.addProgressiveReadListener(chunk => {\n this._onReceiveData({ chunk });\n });\n\n pdfDataRangeTransport.addProgressiveDoneListener(() => {\n this._onProgressiveDone();\n });\n\n pdfDataRangeTransport.transportReady();\n }\n\n _onReceiveData({ begin, chunk }) {\n // Prevent any possible issues by only transferring a Uint8Array that\n // completely \"utilizes\" its underlying ArrayBuffer.\n const buffer =\n chunk instanceof Uint8Array &&\n chunk.byteLength === chunk.buffer.byteLength\n ? chunk.buffer\n : new Uint8Array(chunk).buffer;\n\n if (begin === undefined) {\n if (this._fullRequestReader) {\n this._fullRequestReader._enqueue(buffer);\n } else {\n this._queuedChunks.push(buffer);\n }\n } else {\n const found = this._rangeReaders.some(function (rangeReader) {\n if (rangeReader._begin !== begin) {\n return false;\n }\n rangeReader._enqueue(buffer);\n return true;\n });\n assert(\n found,\n \"_onReceiveData - no `PDFDataTransportStreamRangeReader` instance found.\"\n );\n }\n }\n\n get _progressiveDataLength() {\n return this._fullRequestReader?._loaded ?? 0;\n }\n\n _onProgress(evt) {\n if (evt.total === undefined) {\n // Reporting to first range reader, if it exists.\n this._rangeReaders[0]?.onProgress?.({ loaded: evt.loaded });\n } else {\n this._fullRequestReader?.onProgress?.({\n loaded: evt.loaded,\n total: evt.total,\n });\n }\n }\n\n _onProgressiveDone() {\n this._fullRequestReader?.progressiveDone();\n this._progressiveDone = true;\n }\n\n _removeRangeReader(reader) {\n const i = this._rangeReaders.indexOf(reader);\n if (i >= 0) {\n this._rangeReaders.splice(i, 1);\n }\n }\n\n getFullReader() {\n assert(\n !this._fullRequestReader,\n \"PDFDataTransportStream.getFullReader can only be called once.\"\n );\n const queuedChunks = this._queuedChunks;\n this._queuedChunks = null;\n return new PDFDataTransportStreamReader(\n this,\n queuedChunks,\n this._progressiveDone,\n this._contentDispositionFilename\n );\n }\n\n getRangeReader(begin, end) {\n if (end <= this._progressiveDataLength) {\n return null;\n }\n const reader = new PDFDataTransportStreamRangeReader(this, begin, end);\n this._pdfDataRangeTransport.requestDataRange(begin, end);\n this._rangeReaders.push(reader);\n return reader;\n }\n\n cancelAllRequests(reason) {\n this._fullRequestReader?.cancel(reason);\n\n for (const reader of this._rangeReaders.slice(0)) {\n reader.cancel(reason);\n }\n this._pdfDataRangeTransport.abort();\n }\n}\n\n/** @implements {IPDFStreamReader} */\nclass PDFDataTransportStreamReader {\n constructor(\n stream,\n queuedChunks,\n progressiveDone = false,\n contentDispositionFilename = null\n ) {\n this._stream = stream;\n this._done = progressiveDone || false;\n this._filename = isPdfFile(contentDispositionFilename)\n ? contentDispositionFilename\n : null;\n this._queuedChunks = queuedChunks || [];\n this._loaded = 0;\n for (const chunk of this._queuedChunks) {\n this._loaded += chunk.byteLength;\n }\n this._requests = [];\n this._headersReady = Promise.resolve();\n stream._fullRequestReader = this;\n\n this.onProgress = null;\n }\n\n _enqueue(chunk) {\n if (this._done) {\n return; // Ignore new data.\n }\n if (this._requests.length > 0) {\n const requestCapability = this._requests.shift();\n requestCapability.resolve({ value: chunk, done: false });\n } else {\n this._queuedChunks.push(chunk);\n }\n this._loaded += chunk.byteLength;\n }\n\n get headersReady() {\n return this._headersReady;\n }\n\n get filename() {\n return this._filename;\n }\n\n get isRangeSupported() {\n return this._stream._isRangeSupported;\n }\n\n get isStreamingSupported() {\n return this._stream._isStreamingSupported;\n }\n\n get contentLength() {\n return this._stream._contentLength;\n }\n\n async read() {\n if (this._queuedChunks.length > 0) {\n const chunk = this._queuedChunks.shift();\n return { value: chunk, done: false };\n }\n if (this._done) {\n return { value: undefined, done: true };\n }\n const requestCapability = Promise.withResolvers();\n this._requests.push(requestCapability);\n return requestCapability.promise;\n }\n\n cancel(reason) {\n this._done = true;\n for (const requestCapability of this._requests) {\n requestCapability.resolve({ value: undefined, done: true });\n }\n this._requests.length = 0;\n }\n\n progressiveDone() {\n if (this._done) {\n return;\n }\n this._done = true;\n }\n}\n\n/** @implements {IPDFStreamRangeReader} */\nclass PDFDataTransportStreamRangeReader {\n constructor(stream, begin, end) {\n this._stream = stream;\n this._begin = begin;\n this._end = end;\n this._queuedChunk = null;\n this._requests = [];\n this._done = false;\n\n this.onProgress = null;\n }\n\n _enqueue(chunk) {\n if (this._done) {\n return; // ignore new data\n }\n if (this._requests.length === 0) {\n this._queuedChunk = chunk;\n } else {\n const requestsCapability = this._requests.shift();\n requestsCapability.resolve({ value: chunk, done: false });\n for (const requestCapability of this._requests) {\n requestCapability.resolve({ value: undefined, done: true });\n }\n this._requests.length = 0;\n }\n this._done = true;\n this._stream._removeRangeReader(this);\n }\n\n get isStreamingSupported() {\n return false;\n }\n\n async read() {\n if (this._queuedChunk) {\n const chunk = this._queuedChunk;\n this._queuedChunk = null;\n return { value: chunk, done: false };\n }\n if (this._done) {\n return { value: undefined, done: true };\n }\n const requestCapability = Promise.withResolvers();\n this._requests.push(requestCapability);\n return requestCapability.promise;\n }\n\n cancel(reason) {\n this._done = true;\n for (const requestCapability of this._requests) {\n requestCapability.resolve({ value: undefined, done: true });\n }\n this._requests.length = 0;\n this._stream._removeRangeReader(this);\n }\n}\n\nexport { PDFDataTransportStream };\n","/* Copyright 2017 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { stringToBytes } from \"../shared/util.js\";\n\n// This getFilenameFromContentDispositionHeader function is adapted from\n// https://github.com/Rob--W/open-in-browser/blob/7e2e35a38b8b4e981b11da7b2f01df0149049e92/extension/content-disposition.js\n// with the following changes:\n// - Modified to conform to PDF.js's coding style.\n// - Move return to the end of the function to prevent Babel from dropping the\n// function declarations.\n\n/**\n * Extract file name from the Content-Disposition HTTP response header.\n *\n * @param {string} contentDisposition\n * @returns {string} Filename, if found in the Content-Disposition header.\n */\nfunction getFilenameFromContentDispositionHeader(contentDisposition) {\n let needsEncodingFixup = true;\n\n // filename*=ext-value (\"ext-value\" from RFC 5987, referenced by RFC 6266).\n let tmp = toParamRegExp(\"filename\\\\*\", \"i\").exec(contentDisposition);\n if (tmp) {\n tmp = tmp[1];\n let filename = rfc2616unquote(tmp);\n filename = unescape(filename);\n filename = rfc5987decode(filename);\n filename = rfc2047decode(filename);\n return fixupEncoding(filename);\n }\n\n // Continuations (RFC 2231 section 3, referenced by RFC 5987 section 3.1).\n // filename*n*=part\n // filename*n=part\n tmp = rfc2231getparam(contentDisposition);\n if (tmp) {\n // RFC 2047, section\n const filename = rfc2047decode(tmp);\n return fixupEncoding(filename);\n }\n\n // filename=value (RFC 5987, section 4.1).\n tmp = toParamRegExp(\"filename\", \"i\").exec(contentDisposition);\n if (tmp) {\n tmp = tmp[1];\n let filename = rfc2616unquote(tmp);\n filename = rfc2047decode(filename);\n return fixupEncoding(filename);\n }\n\n // After this line there are only function declarations. We cannot put\n // \"return\" here for readability because babel would then drop the function\n // declarations...\n function toParamRegExp(attributePattern, flags) {\n return new RegExp(\n \"(?:^|;)\\\\s*\" +\n attributePattern +\n \"\\\\s*=\\\\s*\" +\n // Captures: value = token | quoted-string\n // (RFC 2616, section 3.6 and referenced by RFC 6266 4.1)\n \"(\" +\n '[^\";\\\\s][^;\\\\s]*' +\n \"|\" +\n '\"(?:[^\"\\\\\\\\]|\\\\\\\\\"?)+\"?' +\n \")\",\n flags\n );\n }\n function textdecode(encoding, value) {\n if (encoding) {\n if (!/^[\\x00-\\xFF]+$/.test(value)) {\n return value;\n }\n try {\n const decoder = new TextDecoder(encoding, { fatal: true });\n const buffer = stringToBytes(value);\n value = decoder.decode(buffer);\n needsEncodingFixup = false;\n } catch {\n // TextDecoder constructor threw - unrecognized encoding.\n }\n }\n return value;\n }\n function fixupEncoding(value) {\n if (needsEncodingFixup && /[\\x80-\\xff]/.test(value)) {\n // Maybe multi-byte UTF-8.\n value = textdecode(\"utf-8\", value);\n if (needsEncodingFixup) {\n // Try iso-8859-1 encoding.\n value = textdecode(\"iso-8859-1\", value);\n }\n }\n return value;\n }\n function rfc2231getparam(contentDispositionStr) {\n const matches = [];\n let match;\n // Iterate over all filename*n= and filename*n*= with n being an integer\n // of at least zero. Any non-zero number must not start with '0'.\n const iter = toParamRegExp(\"filename\\\\*((?!0\\\\d)\\\\d+)(\\\\*?)\", \"ig\");\n while ((match = iter.exec(contentDispositionStr)) !== null) {\n let [, n, quot, part] = match; // eslint-disable-line prefer-const\n n = parseInt(n, 10);\n if (n in matches) {\n // Ignore anything after the invalid second filename*0.\n if (n === 0) {\n break;\n }\n continue;\n }\n matches[n] = [quot, part];\n }\n const parts = [];\n for (let n = 0; n < matches.length; ++n) {\n if (!(n in matches)) {\n // Numbers must be consecutive. Truncate when there is a hole.\n break;\n }\n let [quot, part] = matches[n]; // eslint-disable-line prefer-const\n part = rfc2616unquote(part);\n if (quot) {\n part = unescape(part);\n if (n === 0) {\n part = rfc5987decode(part);\n }\n }\n parts.push(part);\n }\n return parts.join(\"\");\n }\n function rfc2616unquote(value) {\n if (value.startsWith('\"')) {\n const parts = value.slice(1).split('\\\\\"');\n // Find the first unescaped \" and terminate there.\n for (let i = 0; i < parts.length; ++i) {\n const quotindex = parts[i].indexOf('\"');\n if (quotindex !== -1) {\n parts[i] = parts[i].slice(0, quotindex);\n parts.length = i + 1; // Truncates and stop the iteration.\n }\n parts[i] = parts[i].replaceAll(/\\\\(.)/g, \"$1\");\n }\n value = parts.join('\"');\n }\n return value;\n }\n function rfc5987decode(extvalue) {\n // Decodes \"ext-value\" from RFC 5987.\n const encodingend = extvalue.indexOf(\"'\");\n if (encodingend === -1) {\n // Some servers send \"filename*=\" without encoding 'language' prefix,\n // e.g. in https://github.com/Rob--W/open-in-browser/issues/26\n // Let's accept the value like Firefox (57) (Chrome 62 rejects it).\n return extvalue;\n }\n const encoding = extvalue.slice(0, encodingend);\n const langvalue = extvalue.slice(encodingend + 1);\n // Ignore language (RFC 5987 section 3.2.1, and RFC 6266 section 4.1 ).\n const value = langvalue.replace(/^[^']*'/, \"\");\n return textdecode(encoding, value);\n }\n function rfc2047decode(value) {\n // RFC 2047-decode the result. Firefox tried to drop support for it, but\n // backed out because some servers use it - https://bugzil.la/875615\n // Firefox's condition for decoding is here: https://searchfox.org/mozilla-central/rev/4a590a5a15e35d88a3b23dd6ac3c471cf85b04a8/netwerk/mime/nsMIMEHeaderParamImpl.cpp#742-748\n\n // We are more strict and only recognize RFC 2047-encoding if the value\n // starts with \"=?\", since then it is likely that the full value is\n // RFC 2047-encoded.\n\n // Firefox also decodes words even where RFC 2047 section 5 states:\n // \"An 'encoded-word' MUST NOT appear within a 'quoted-string'.\"\n if (!value.startsWith(\"=?\") || /[\\x00-\\x19\\x80-\\xff]/.test(value)) {\n return value;\n }\n // RFC 2047, section 2.4\n // encoded-word = \"=?\" charset \"?\" encoding \"?\" encoded-text \"?=\"\n // charset = token (but let's restrict to characters that denote a\n // possibly valid encoding).\n // encoding = q or b\n // encoded-text = any printable ASCII character other than ? or space.\n // ... but Firefox permits ? and space.\n return value.replaceAll(\n /=\\?([\\w-]*)\\?([QqBb])\\?((?:[^?]|\\?(?!=))*)\\?=/g,\n function (matches, charset, encoding, text) {\n if (encoding === \"q\" || encoding === \"Q\") {\n // RFC 2047 section 4.2.\n text = text.replaceAll(\"_\", \" \");\n text = text.replaceAll(/=([0-9a-fA-F]{2})/g, function (match, hex) {\n return String.fromCharCode(parseInt(hex, 16));\n });\n return textdecode(charset, text);\n } // else encoding is b or B - base64 (RFC 2047 section 4.1)\n try {\n text = atob(text);\n } catch {}\n return textdecode(charset, text);\n }\n );\n }\n\n return \"\";\n}\n\nexport { getFilenameFromContentDispositionHeader };\n","/* Copyright 2012 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { assert, ResponseException } from \"../shared/util.js\";\nimport { getFilenameFromContentDispositionHeader } from \"./content_disposition.js\";\nimport { isPdfFile } from \"./display_utils.js\";\n\nfunction createHeaders(isHttp, httpHeaders) {\n const headers = new Headers();\n\n if (!isHttp || !httpHeaders || typeof httpHeaders !== \"object\") {\n return headers;\n }\n for (const key in httpHeaders) {\n const val = httpHeaders[key];\n if (val !== undefined) {\n headers.append(key, val);\n }\n }\n return headers;\n}\n\nfunction getResponseOrigin(url) {\n // Notably, null is distinct from \"null\" string (e.g. from file:-URLs).\n return URL.parse(url)?.origin ?? null;\n}\n\nfunction validateRangeRequestCapabilities({\n responseHeaders,\n isHttp,\n rangeChunkSize,\n disableRange,\n}) {\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) {\n assert(\n Number.isInteger(rangeChunkSize) && rangeChunkSize > 0,\n \"rangeChunkSize must be an integer larger than zero.\"\n );\n }\n const returnValues = {\n allowRangeRequests: false,\n suggestedLength: undefined,\n };\n\n const length = parseInt(responseHeaders.get(\"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 (responseHeaders.get(\"Accept-Ranges\") !== \"bytes\") {\n return returnValues;\n }\n\n const contentEncoding = responseHeaders.get(\"Content-Encoding\") || \"identity\";\n if (contentEncoding !== \"identity\") {\n return returnValues;\n }\n\n returnValues.allowRangeRequests = true;\n return returnValues;\n}\n\nfunction extractFilenameFromHeader(responseHeaders) {\n const contentDisposition = responseHeaders.get(\"Content-Disposition\");\n if (contentDisposition) {\n let filename = getFilenameFromContentDispositionHeader(contentDisposition);\n if (filename.includes(\"%\")) {\n try {\n filename = decodeURIComponent(filename);\n } catch {}\n }\n if (isPdfFile(filename)) {\n return filename;\n }\n }\n return null;\n}\n\nfunction createResponseError(status, url) {\n return new ResponseException(\n `Unexpected server response (${status}) while retrieving PDF \"${url}\".`,\n status,\n /* missing = */ status === 404 || (status === 0 && url.startsWith(\"file:\"))\n );\n}\n\nfunction validateResponseStatus(status) {\n return status === 200 || status === 206;\n}\n\nexport {\n createHeaders,\n createResponseError,\n extractFilenameFromHeader,\n getResponseOrigin,\n validateRangeRequestCapabilities,\n validateResponseStatus,\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 { AbortException, assert, warn } from \"../shared/util.js\";\nimport {\n createHeaders,\n createResponseError,\n extractFilenameFromHeader,\n getResponseOrigin,\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 getArrayBuffer(val) {\n if (val instanceof Uint8Array) {\n return val.buffer;\n }\n if (val instanceof ArrayBuffer) {\n return val;\n }\n warn(`getArrayBuffer - unexpected data format: ${val}`);\n return new Uint8Array(val).buffer;\n}\n\n/** @implements {IPDFStream} */\nclass PDFFetchStream {\n _responseOrigin = null;\n\n constructor(source) {\n this.source = source;\n this.isHttp = /^https?:/i.test(source.url);\n this.headers = createHeaders(this.isHttp, source.httpHeaders);\n\n this._fullRequestReader = null;\n this._rangeRequestReaders = [];\n }\n\n get _progressiveDataLength() {\n return this._fullRequestReader?._loaded ?? 0;\n }\n\n getFullReader() {\n assert(\n !this._fullRequestReader,\n \"PDFFetchStream.getFullReader can only be called once.\"\n );\n this._fullRequestReader = new PDFFetchStreamReader(this);\n return this._fullRequestReader;\n }\n\n getRangeReader(begin, end) {\n if (end <= this._progressiveDataLength) {\n return null;\n }\n const reader = new PDFFetchStreamRangeReader(this, begin, end);\n this._rangeRequestReaders.push(reader);\n return reader;\n }\n\n cancelAllRequests(reason) {\n this._fullRequestReader?.cancel(reason);\n\n for (const reader of this._rangeRequestReaders.slice(0)) {\n reader.cancel(reason);\n }\n }\n}\n\n/** @implements {IPDFStreamReader} */\nclass PDFFetchStreamReader {\n constructor(stream) {\n this._stream = stream;\n this._reader = null;\n this._loaded = 0;\n this._filename = null;\n const source = stream.source;\n this._withCredentials = source.withCredentials || false;\n this._contentLength = source.length;\n this._headersCapability = Promise.withResolvers();\n this._disableRange = source.disableRange || false;\n this._rangeChunkSize = source.rangeChunkSize;\n if (!this._rangeChunkSize && !this._disableRange) {\n this._disableRange = true;\n }\n\n this._abortController = new AbortController();\n this._isStreamingSupported = !source.disableStream;\n this._isRangeSupported = !source.disableRange;\n // Always create a copy of the headers.\n const headers = new Headers(stream.headers);\n\n const url = source.url;\n fetch(\n url,\n createFetchOptions(headers, this._withCredentials, this._abortController)\n )\n .then(response => {\n stream._responseOrigin = getResponseOrigin(response.url);\n\n if (!validateResponseStatus(response.status)) {\n throw createResponseError(response.status, url);\n }\n this._reader = response.body.getReader();\n this._headersCapability.resolve();\n\n const responseHeaders = response.headers;\n\n const { allowRangeRequests, suggestedLength } =\n validateRangeRequestCapabilities({\n responseHeaders,\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(responseHeaders);\n\n // We need to stop reading when range is supported and streaming is\n // disabled.\n if (!this._isStreamingSupported && this._isRangeSupported) {\n this.cancel(new AbortException(\"Streaming is disabled.\"));\n }\n })\n .catch(this._headersCapability.reject);\n\n this.onProgress = null;\n }\n\n get headersReady() {\n return this._headersCapability.promise;\n }\n\n get filename() {\n return this._filename;\n }\n\n get contentLength() {\n return this._contentLength;\n }\n\n get isRangeSupported() {\n return this._isRangeSupported;\n }\n\n get isStreamingSupported() {\n return this._isStreamingSupported;\n }\n\n async read() {\n await this._headersCapability.promise;\n const { value, done } = await this._reader.read();\n if (done) {\n return { value, done };\n }\n this._loaded += value.byteLength;\n this.onProgress?.({\n loaded: this._loaded,\n total: this._contentLength,\n });\n\n return { value: getArrayBuffer(value), done: false };\n }\n\n cancel(reason) {\n this._reader?.cancel(reason);\n this._abortController.abort();\n }\n}\n\n/** @implements {IPDFStreamRangeReader} */\nclass PDFFetchStreamRangeReader {\n constructor(stream, begin, end) {\n this._stream = stream;\n this._reader = null;\n this._loaded = 0;\n const source = stream.source;\n this._withCredentials = source.withCredentials || false;\n this._readCapability = Promise.withResolvers();\n this._isStreamingSupported = !source.disableStream;\n\n this._abortController = new AbortController();\n // Always create a copy of the headers.\n const headers = new Headers(stream.headers);\n headers.append(\"Range\", `bytes=${begin}-${end - 1}`);\n\n const url = source.url;\n fetch(\n url,\n createFetchOptions(headers, this._withCredentials, this._abortController)\n )\n .then(response => {\n const responseOrigin = getResponseOrigin(response.url);\n\n if (responseOrigin !== stream._responseOrigin) {\n throw new Error(\n `Expected range response-origin \"${responseOrigin}\" to match \"${stream._responseOrigin}\".`\n );\n }\n if (!validateResponseStatus(response.status)) {\n throw createResponseError(response.status, url);\n }\n this._readCapability.resolve();\n this._reader = response.body.getReader();\n })\n .catch(this._readCapability.reject);\n\n this.onProgress = null;\n }\n\n get isStreamingSupported() {\n return this._isStreamingSupported;\n }\n\n async read() {\n await this._readCapability.promise;\n const { value, done } = await this._reader.read();\n if (done) {\n return { value, done };\n }\n this._loaded += value.byteLength;\n this.onProgress?.({ loaded: this._loaded });\n\n return { value: getArrayBuffer(value), done: false };\n }\n\n cancel(reason) {\n this._reader?.cancel(reason);\n this._abortController.abort();\n }\n}\n\nexport { PDFFetchStream };\n","/* Copyright 2012 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { assert, stringToBytes, warn } from \"../shared/util.js\";\nimport {\n createHeaders,\n createResponseError,\n extractFilenameFromHeader,\n getResponseOrigin,\n validateRangeRequestCapabilities,\n} from \"./network_utils.js\";\n\nif (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) {\n throw new Error(\n 'Module \"./network.js\" shall not be used with MOZCENTRAL builds.'\n );\n}\n\nconst OK_RESPONSE = 200;\nconst PARTIAL_CONTENT_RESPONSE = 206;\n\nfunction getArrayBuffer(xhr) {\n const data = xhr.response;\n if (typeof data !== \"string\") {\n return data;\n }\n return stringToBytes(data).buffer;\n}\n\nclass NetworkManager {\n _responseOrigin = null;\n\n constructor({ url, httpHeaders, withCredentials }) {\n this.url = url;\n this.isHttp = /^https?:/i.test(url);\n this.headers = createHeaders(this.isHttp, httpHeaders);\n this.withCredentials = withCredentials || false;\n\n this.currXhrId = 0;\n this.pendingRequests = Object.create(null);\n }\n\n request(args) {\n const xhr = new XMLHttpRequest();\n const xhrId = this.currXhrId++;\n const pendingRequest = (this.pendingRequests[xhrId] = { xhr });\n\n xhr.open(\"GET\", this.url);\n xhr.withCredentials = this.withCredentials;\n for (const [key, val] of this.headers) {\n xhr.setRequestHeader(key, val);\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 assert(args.onError, \"Expected `onError` callback to be provided.\");\n xhr.onerror = () => {\n args.onError(xhr.status);\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 if (matches) {\n pendingRequest.onDone({\n begin: parseInt(matches[1], 10),\n chunk,\n });\n } else {\n warn(`Missing or invalid \"Content-Range\" header.`);\n pendingRequest.onError(0);\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);\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 this._url = source.url;\n this._fullRequestId = manager.request({\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._headersCapability = Promise.withResolvers();\n this._disableRange = source.disableRange || false;\n this._contentLength = source.length; // Optional\n this._rangeChunkSize = source.rangeChunkSize;\n if (!this._rangeChunkSize && !this._disableRange) {\n this._disableRange = true;\n }\n\n this._isStreamingSupported = false;\n this._isRangeSupported = false;\n\n this._cachedChunks = [];\n this._requests = [];\n this._done = false;\n this._storedError = undefined;\n this._filename = null;\n\n this.onProgress = null;\n }\n\n _onHeadersReceived() {\n const fullRequestXhrId = this._fullRequestId;\n const fullRequestXhr = this._manager.getRequestXhr(fullRequestXhrId);\n\n this._manager._responseOrigin = getResponseOrigin(\n fullRequestXhr.responseURL\n );\n\n const rawResponseHeaders = fullRequestXhr.getAllResponseHeaders();\n const responseHeaders = new Headers(\n rawResponseHeaders\n ? rawResponseHeaders\n .trimStart()\n .replace(/[^\\S ]+$/, \"\") // Not `trimEnd`, to keep regular spaces.\n .split(/[\\r\\n]+/)\n .map(x => {\n const [key, ...val] = x.split(\": \");\n return [key, val.join(\": \")];\n })\n : []\n );\n\n const { allowRangeRequests, suggestedLength } =\n validateRangeRequestCapabilities({\n responseHeaders,\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(responseHeaders);\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._headersCapability.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 = createResponseError(status, this._url);\n this._headersCapability.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._headersCapability.promise;\n }\n\n async read() {\n await this._headersCapability.promise;\n\n if (this._storedError) {\n throw this._storedError;\n }\n if (this._cachedChunks.length > 0) {\n const chunk = this._cachedChunks.shift();\n return { value: chunk, done: false };\n }\n if (this._done) {\n return { value: undefined, done: true };\n }\n const requestCapability = Promise.withResolvers();\n this._requests.push(requestCapability);\n return requestCapability.promise;\n }\n\n cancel(reason) {\n this._done = true;\n this._headersCapability.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 this._url = manager.url;\n this._requestId = manager.request({\n begin,\n end,\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._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 _onHeadersReceived() {\n const responseOrigin = getResponseOrigin(\n this._manager.getRequestXhr(this._requestId)?.responseURL\n );\n\n if (responseOrigin !== this._manager._responseOrigin) {\n this._storedError = new Error(\n `Expected range response-origin \"${responseOrigin}\" to match \"${this._manager._responseOrigin}\".`\n );\n this._onError(0);\n }\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 ??= createResponseError(status, this._url);\n for (const requestCapability of this._requests) {\n requestCapability.reject(this._storedError);\n }\n this._requests.length = 0;\n this._queuedChunk = null;\n }\n\n _onProgress(evt) {\n if (!this.isStreamingSupported) {\n this.onProgress?.({ loaded: evt.loaded });\n }\n }\n\n get isStreamingSupported() {\n return false;\n }\n\n async read() {\n if (this._storedError) {\n throw this._storedError;\n }\n if (this._queuedChunk !== null) {\n const chunk = this._queuedChunk;\n this._queuedChunk = null;\n return { value: chunk, done: false };\n }\n if (this._done) {\n return { value: undefined, done: true };\n }\n const requestCapability = Promise.withResolvers();\n this._requests.push(requestCapability);\n return requestCapability.promise;\n }\n\n cancel(reason) {\n this._done = true;\n for (const requestCapability of this._requests) {\n requestCapability.resolve({ value: undefined, done: true });\n }\n this._requests.length = 0;\n if (this._manager.isPendingRequest(this._requestId)) {\n this._manager.abortRequest(this._requestId);\n }\n this._close();\n }\n}\n\nexport { PDFNetworkStream };\n","/* Copyright 2012 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/* globals process */\n\nimport { AbortException, assert } from \"../shared/util.js\";\nimport { createResponseError } 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 urlRegex = /^[a-z][a-z0-9\\-+.]+:/i;\n\nfunction parseUrlOrPath(sourceUrl) {\n if (urlRegex.test(sourceUrl)) {\n return new URL(sourceUrl);\n }\n const url = process.getBuiltinModule(\"url\");\n return new URL(url.pathToFileURL(sourceUrl));\n}\n\nclass PDFNodeStream {\n constructor(source) {\n this.source = source;\n this.url = parseUrlOrPath(source.url);\n assert(\n this.url.protocol === \"file:\",\n \"PDFNodeStream only supports file:// URLs.\"\n );\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 = new PDFNodeStreamFsFullReader(this);\n return this._fullRequestReader;\n }\n\n getRangeReader(start, end) {\n if (end <= this._progressiveDataLength) {\n return null;\n }\n const rangeReader = new PDFNodeStreamFsRangeReader(this, start, end);\n this._rangeRequestReaders.push(rangeReader);\n return rangeReader;\n }\n\n cancelAllRequests(reason) {\n this._fullRequestReader?.cancel(reason);\n\n for (const reader of this._rangeRequestReaders.slice(0)) {\n reader.cancel(reason);\n }\n }\n}\n\nclass PDFNodeStreamFsFullReader {\n constructor(stream) {\n this._url = stream.url;\n this._done = false;\n this._storedError = null;\n this.onProgress = null;\n const source = stream.source;\n this._contentLength = source.length; // optional\n this._loaded = 0;\n this._filename = null;\n\n this._disableRange = source.disableRange || false;\n this._rangeChunkSize = source.rangeChunkSize;\n if (!this._rangeChunkSize && !this._disableRange) {\n this._disableRange = true;\n }\n\n this._isStreamingSupported = !source.disableStream;\n this._isRangeSupported = !source.disableRange;\n\n this._readableStream = null;\n this._readCapability = Promise.withResolvers();\n this._headersCapability = Promise.withResolvers();\n\n const fs = process.getBuiltinModule(\"fs\");\n fs.promises.lstat(this._url).then(\n stat => {\n // Setting right content length.\n this._contentLength = stat.size;\n\n this._setReadableStream(fs.createReadStream(this._url));\n this._headersCapability.resolve();\n },\n error => {\n if (error.code === \"ENOENT\") {\n error = createResponseError(/* status = */ 0, this._url.href);\n }\n this._storedError = error;\n this._headersCapability.reject(error);\n }\n );\n }\n\n get headersReady() {\n return this._headersCapability.promise;\n }\n\n get filename() {\n return this._filename;\n }\n\n get contentLength() {\n return this._contentLength;\n }\n\n get isRangeSupported() {\n return this._isRangeSupported;\n }\n\n get isStreamingSupported() {\n return this._isStreamingSupported;\n }\n\n async read() {\n await this._readCapability.promise;\n if (this._done) {\n return { value: undefined, done: true };\n }\n if (this._storedError) {\n throw this._storedError;\n }\n\n const chunk = this._readableStream.read();\n if (chunk === null) {\n this._readCapability = Promise.withResolvers();\n return this.read();\n }\n this._loaded += chunk.length;\n this.onProgress?.({\n loaded: this._loaded,\n total: this._contentLength,\n });\n\n // Ensure that `read()` method returns ArrayBuffer.\n const buffer = new Uint8Array(chunk).buffer;\n return { value: buffer, done: false };\n }\n\n cancel(reason) {\n // Call `this._error()` method when cancel is called\n // before _readableStream is set.\n if (!this._readableStream) {\n this._error(reason);\n return;\n }\n this._readableStream.destroy(reason);\n }\n\n _error(reason) {\n this._storedError = reason;\n this._readCapability.resolve();\n }\n\n _setReadableStream(readableStream) {\n this._readableStream = readableStream;\n readableStream.on(\"readable\", () => {\n this._readCapability.resolve();\n });\n\n readableStream.on(\"end\", () => {\n // Destroy readable to minimize resource usage.\n readableStream.destroy();\n this._done = true;\n this._readCapability.resolve();\n });\n\n readableStream.on(\"error\", reason => {\n this._error(reason);\n });\n\n // We need to stop reading when range is supported and streaming is\n // disabled.\n if (!this._isStreamingSupported && this._isRangeSupported) {\n this._error(new AbortException(\"streaming is disabled\"));\n }\n\n // Destroy ReadableStream if already in errored state.\n if (this._storedError) {\n this._readableStream.destroy(this._storedError);\n }\n }\n}\n\nclass PDFNodeStreamFsRangeReader {\n constructor(stream, start, end) {\n this._url = stream.url;\n this._done = false;\n this._storedError = null;\n this.onProgress = null;\n this._loaded = 0;\n this._readableStream = null;\n this._readCapability = Promise.withResolvers();\n const source = stream.source;\n this._isStreamingSupported = !source.disableStream;\n\n const fs = process.getBuiltinModule(\"fs\");\n this._setReadableStream(\n fs.createReadStream(this._url, { start, end: end - 1 })\n );\n }\n\n get isStreamingSupported() {\n return this._isStreamingSupported;\n }\n\n async read() {\n await this._readCapability.promise;\n if (this._done) {\n return { value: undefined, done: true };\n }\n if (this._storedError) {\n throw this._storedError;\n }\n\n const chunk = this._readableStream.read();\n if (chunk === null) {\n this._readCapability = Promise.withResolvers();\n return this.read();\n }\n this._loaded += chunk.length;\n this.onProgress?.({ loaded: this._loaded });\n\n // Ensure that `read()` method returns ArrayBuffer.\n const buffer = new Uint8Array(chunk).buffer;\n return { value: buffer, done: false };\n }\n\n cancel(reason) {\n // Call `this._error()` method when cancel is called\n // before _readableStream is set.\n if (!this._readableStream) {\n this._error(reason);\n return;\n }\n this._readableStream.destroy(reason);\n }\n\n _error(reason) {\n this._storedError = reason;\n this._readCapability.resolve();\n }\n\n _setReadableStream(readableStream) {\n this._readableStream = readableStream;\n readableStream.on(\"readable\", () => {\n this._readCapability.resolve();\n });\n\n readableStream.on(\"end\", () => {\n // Destroy readableStream to minimize resource usage.\n readableStream.destroy();\n this._done = true;\n this._readCapability.resolve();\n });\n\n readableStream.on(\"error\", reason => {\n this._error(reason);\n });\n\n // Destroy readableStream if already in errored state.\n if (this._storedError) {\n this._readableStream.destroy(this._storedError);\n }\n }\n}\n\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\nconst INITIAL_DATA = Symbol(\"INITIAL_DATA\");\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 return (this.#objs[objId] ||= {\n ...Promise.withResolvers(),\n data: INITIAL_DATA,\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.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 || obj.data === INITIAL_DATA) {\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 && obj.data !== INITIAL_DATA;\n }\n\n /**\n * @param {string} objId\n * @returns {boolean}\n */\n delete(objId) {\n const obj = this.#objs[objId];\n if (!obj || obj.data === INITIAL_DATA) {\n // Only allow removing the object *after* it's been resolved.\n return false;\n }\n delete this.#objs[objId];\n return true;\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.resolve();\n }\n\n clear() {\n for (const objId in this.#objs) {\n const { data } = this.#objs[objId];\n data?.bitmap?.close(); // Release any `ImageBitmap` data.\n }\n this.#objs = Object.create(null);\n }\n\n *[Symbol.iterator]() {\n for (const objId in this.#objs) {\n const { data } = this.#objs[objId];\n\n if (data === INITIAL_DATA) {\n continue;\n }\n yield [objId, data];\n }\n }\n}\n\nexport { PDFObjects };\n","/* Copyright 2015 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/** @typedef {import(\"./display_utils\").PageViewport} PageViewport */\n/** @typedef {import(\"./api\").TextContent} TextContent */\n\nimport {\n AbortException,\n FeatureTest,\n shadow,\n Util,\n warn,\n} from \"../shared/util.js\";\nimport { OutputScale, setLayerDimensions } from \"./display_utils.js\";\n\n/**\n * @typedef {Object} TextLayerParameters\n * @property {ReadableStream | TextContent} textContentSource - Text content to\n * render, i.e. the value returned by the page's `streamTextContent` or\n * `getTextContent` method.\n * @property {HTMLElement} container - The DOM node that will contain the text\n * runs.\n * @property {PageViewport} viewport - The target viewport to properly layout\n * the text runs.\n */\n\n/**\n * @typedef {Object} TextLayerUpdateParameters\n * @property {PageViewport} viewport - The target viewport to properly layout\n * the text runs.\n * @property {function} [onBefore] - Callback invoked before the textLayer is\n * updated in the DOM.\n */\n\nconst MAX_TEXT_DIVS_TO_RENDER = 100000;\nconst DEFAULT_FONT_SIZE = 30;\n\nclass TextLayer {\n #capability = Promise.withResolvers();\n\n #container = null;\n\n #disableProcessItems = false;\n\n #fontInspectorEnabled = !!globalThis.FontInspector?.enabled;\n\n #lang = null;\n\n #layoutTextParams = null;\n\n #pageHeight = 0;\n\n #pageWidth = 0;\n\n #reader = null;\n\n #rootContainer = null;\n\n #rotation = 0;\n\n #scale = 0;\n\n #styleCache = Object.create(null);\n\n #textContentItemsStr = [];\n\n #textContentSource = null;\n\n #textDivs = [];\n\n #textDivProperties = new WeakMap();\n\n #transform = null;\n\n static #ascentCache = new Map();\n\n static #canvasContexts = new Map();\n\n static #canvasCtxFonts = new WeakMap();\n\n static #minFontSize = null;\n\n static #pendingTextLayers = new Set();\n\n /**\n * @param {TextLayerParameters} options\n */\n constructor({ textContentSource, container, viewport }) {\n if (textContentSource instanceof ReadableStream) {\n this.#textContentSource = textContentSource;\n } else if (\n (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"GENERIC\")) &&\n typeof textContentSource === \"object\"\n ) {\n this.#textContentSource = new ReadableStream({\n start(controller) {\n controller.enqueue(textContentSource);\n controller.close();\n },\n });\n } else {\n throw new Error('No \"textContentSource\" parameter specified.');\n }\n this.#container = this.#rootContainer = container;\n\n this.#scale = viewport.scale * OutputScale.pixelRatio;\n this.#rotation = viewport.rotation;\n this.#layoutTextParams = {\n div: null,\n properties: null,\n ctx: null,\n };\n const { pageWidth, pageHeight, pageX, pageY } = viewport.rawDims;\n this.#transform = [1, 0, 0, -1, -pageX, pageY + pageHeight];\n this.#pageWidth = pageWidth;\n this.#pageHeight = pageHeight;\n\n TextLayer.#ensureMinFontSizeComputed();\n\n setLayerDimensions(container, viewport);\n\n // Always clean-up the temporary canvas once rendering is no longer pending.\n this.#capability.promise\n .finally(() => {\n TextLayer.#pendingTextLayers.delete(this);\n this.#layoutTextParams = null;\n this.#styleCache = null;\n })\n .catch(() => {\n // Avoid \"Uncaught promise\" messages in the console.\n });\n\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) {\n // For testing purposes.\n Object.defineProperty(this, \"pageWidth\", {\n get() {\n return this.#pageWidth;\n },\n });\n Object.defineProperty(this, \"pageHeight\", {\n get() {\n return this.#pageHeight;\n },\n });\n }\n }\n\n static get fontFamilyMap() {\n const { isWindows, isFirefox } = FeatureTest.platform;\n return shadow(\n this,\n \"fontFamilyMap\",\n new Map([\n [\n \"sans-serif\",\n `${isWindows && isFirefox ? \"Calibri, \" : \"\"}sans-serif`,\n ],\n [\n \"monospace\",\n `${isWindows && isFirefox ? \"Lucida Console, \" : \"\"}monospace`,\n ],\n ])\n );\n }\n\n /**\n * Render the textLayer.\n * @returns {Promise}\n */\n render() {\n const pump = () => {\n this.#reader.read().then(({ value, done }) => {\n if (done) {\n this.#capability.resolve();\n return;\n }\n this.#lang ??= value.lang;\n Object.assign(this.#styleCache, value.styles);\n this.#processItems(value.items);\n pump();\n }, this.#capability.reject);\n };\n this.#reader = this.#textContentSource.getReader();\n TextLayer.#pendingTextLayers.add(this);\n pump();\n\n return this.#capability.promise;\n }\n\n /**\n * Update a previously rendered textLayer, if necessary.\n * @param {TextLayerUpdateParameters} options\n * @returns {undefined}\n */\n update({ viewport, onBefore = null }) {\n const scale = viewport.scale * OutputScale.pixelRatio;\n const rotation = viewport.rotation;\n\n if (rotation !== this.#rotation) {\n onBefore?.();\n this.#rotation = rotation;\n setLayerDimensions(this.#rootContainer, { rotation });\n }\n\n if (scale !== this.#scale) {\n onBefore?.();\n this.#scale = scale;\n const params = {\n div: null,\n properties: null,\n ctx: TextLayer.#getCtx(this.#lang),\n };\n for (const div of this.#textDivs) {\n params.properties = this.#textDivProperties.get(div);\n params.div = div;\n this.#layout(params);\n }\n }\n }\n\n /**\n * Cancel rendering of the textLayer.\n * @returns {undefined}\n */\n cancel() {\n const abortEx = new AbortException(\"TextLayer task cancelled.\");\n\n this.#reader?.cancel(abortEx).catch(() => {\n // Avoid \"Uncaught promise\" messages in the console.\n });\n this.#reader = null;\n\n this.#capability.reject(abortEx);\n }\n\n /**\n * @type {Array<HTMLElement>} HTML elements that correspond to the text items\n * of the textContent input.\n * This is output and will initially be set to an empty array.\n */\n get textDivs() {\n return this.#textDivs;\n }\n\n /**\n * @type {Array<string>} Strings that correspond to the `str` property of\n * the text items of the textContent input.\n * This is output and will initially be set to an empty array\n */\n get textContentItemsStr() {\n return this.#textContentItemsStr;\n }\n\n #processItems(items) {\n if (this.#disableProcessItems) {\n return;\n }\n this.#layoutTextParams.ctx ??= TextLayer.#getCtx(this.#lang);\n\n const textDivs = this.#textDivs,\n textContentItemsStr = this.#textContentItemsStr;\n\n for (const item of items) {\n // No point in rendering many divs as it would make the browser\n // unusable even after the divs are rendered.\n if (textDivs.length > MAX_TEXT_DIVS_TO_RENDER) {\n warn(\"Ignoring additional textDivs for performance reasons.\");\n\n this.#disableProcessItems = true; // Avoid multiple warnings for one page.\n return;\n }\n\n if (item.str === undefined) {\n if (\n item.type === \"beginMarkedContentProps\" ||\n item.type === \"beginMarkedContent\"\n ) {\n const parent = this.#container;\n this.#container = document.createElement(\"span\");\n this.#container.classList.add(\"markedContent\");\n if (item.id) {\n this.#container.setAttribute(\"id\", `${item.id}`);\n }\n parent.append(this.#container);\n } else if (item.type === \"endMarkedContent\") {\n this.#container = this.#container.parentNode;\n }\n continue;\n }\n textContentItemsStr.push(item.str);\n this.#appendText(item);\n }\n }\n\n #appendText(geom) {\n // Initialize all used properties to keep the caches monomorphic.\n const textDiv = document.createElement(\"span\");\n const textDivProperties = {\n angle: 0,\n canvasWidth: 0,\n hasText: geom.str !== \"\",\n hasEOL: geom.hasEOL,\n fontSize: 0,\n };\n this.#textDivs.push(textDiv);\n\n const tx = Util.transform(this.#transform, geom.transform);\n let angle = Math.atan2(tx[1], tx[0]);\n const style = this.#styleCache[geom.fontName];\n if (style.vertical) {\n angle += Math.PI / 2;\n }\n\n let fontFamily =\n (this.#fontInspectorEnabled && style.fontSubstitution) ||\n style.fontFamily;\n\n // Workaround for bug 1922063.\n fontFamily = TextLayer.fontFamilyMap.get(fontFamily) || fontFamily;\n const fontHeight = Math.hypot(tx[2], tx[3]);\n const fontAscent =\n fontHeight * TextLayer.#getAscent(fontFamily, style, this.#lang);\n\n let left, top;\n if (angle === 0) {\n left = tx[4];\n top = tx[5] - fontAscent;\n } else {\n left = tx[4] + fontAscent * Math.sin(angle);\n top = tx[5] - fontAscent * Math.cos(angle);\n }\n\n const scaleFactorStr = \"calc(var(--total-scale-factor) *\";\n const divStyle = textDiv.style;\n // Setting the style properties individually, rather than all at once,\n // should be OK since the `textDiv` isn't appended to the document yet.\n if (this.#container === this.#rootContainer) {\n divStyle.left = `${((100 * left) / this.#pageWidth).toFixed(2)}%`;\n divStyle.top = `${((100 * top) / this.#pageHeight).toFixed(2)}%`;\n } else {\n // We're in a marked content span, hence we can't use percents.\n divStyle.left = `${scaleFactorStr}${left.toFixed(2)}px)`;\n divStyle.top = `${scaleFactorStr}${top.toFixed(2)}px)`;\n }\n // We multiply the font size by #minFontSize, and then #layout will\n // scale the element by 1/#minFontSize. This allows us to effectively\n // ignore the minimum font size enforced by the browser, so that the text\n // layer <span>s can always match the size of the text in the canvas.\n divStyle.fontSize = `${scaleFactorStr}${(TextLayer.#minFontSize * fontHeight).toFixed(2)}px)`;\n divStyle.fontFamily = fontFamily;\n\n textDivProperties.fontSize = fontHeight;\n\n // Keeps screen readers from pausing on every new text span.\n textDiv.setAttribute(\"role\", \"presentation\");\n\n textDiv.textContent = geom.str;\n // geom.dir may be 'ttb' for vertical texts.\n textDiv.dir = geom.dir;\n\n // `fontName` is only used by the FontInspector, and we only use `dataset`\n // here to make the font name available in the debugger.\n if (this.#fontInspectorEnabled) {\n textDiv.dataset.fontName =\n style.fontSubstitutionLoadedName || geom.fontName;\n }\n if (angle !== 0) {\n textDivProperties.angle = angle * (180 / Math.PI);\n }\n // We don't bother scaling single-char text divs, because it has very\n // little effect on text highlighting. This makes scrolling on docs with\n // lots of such divs a lot faster.\n let shouldScaleText = false;\n if (geom.str.length > 1) {\n shouldScaleText = true;\n } else if (geom.str !== \" \" && geom.transform[0] !== geom.transform[3]) {\n const absScaleX = Math.abs(geom.transform[0]),\n absScaleY = Math.abs(geom.transform[3]);\n // When the horizontal/vertical scaling differs significantly, also scale\n // even single-char text to improve highlighting (fixes issue11713.pdf).\n if (\n absScaleX !== absScaleY &&\n Math.max(absScaleX, absScaleY) / Math.min(absScaleX, absScaleY) > 1.5\n ) {\n shouldScaleText = true;\n }\n }\n if (shouldScaleText) {\n textDivProperties.canvasWidth = style.vertical ? geom.height : geom.width;\n }\n this.#textDivProperties.set(textDiv, textDivProperties);\n\n // Finally, layout and append the text to the DOM.\n this.#layoutTextParams.div = textDiv;\n this.#layoutTextParams.properties = textDivProperties;\n this.#layout(this.#layoutTextParams);\n\n if (textDivProperties.hasText) {\n this.#container.append(textDiv);\n }\n if (textDivProperties.hasEOL) {\n const br = document.createElement(\"br\");\n br.setAttribute(\"role\", \"presentation\");\n this.#container.append(br);\n }\n }\n\n #layout(params) {\n const { div, properties, ctx } = params;\n const { style } = div;\n\n let transform = \"\";\n if (TextLayer.#minFontSize > 1) {\n transform = `scale(${1 / TextLayer.#minFontSize})`;\n }\n\n if (properties.canvasWidth !== 0 && properties.hasText) {\n const { fontFamily } = style;\n const { canvasWidth, fontSize } = properties;\n\n TextLayer.#ensureCtxFont(ctx, fontSize * this.#scale, fontFamily);\n // Only measure the width for multi-char text divs, see `appendText`.\n const { width } = ctx.measureText(div.textContent);\n\n if (width > 0) {\n transform = `scaleX(${(canvasWidth * this.#scale) / width}) ${transform}`;\n }\n }\n if (properties.angle !== 0) {\n transform = `rotate(${properties.angle}deg) ${transform}`;\n }\n if (transform.length > 0) {\n style.transform = transform;\n }\n }\n\n /**\n * Clean-up global textLayer data.\n * @returns {undefined}\n */\n static cleanup() {\n if (this.#pendingTextLayers.size > 0) {\n return;\n }\n this.#ascentCache.clear();\n\n for (const { canvas } of this.#canvasContexts.values()) {\n canvas.remove();\n }\n this.#canvasContexts.clear();\n }\n\n static #getCtx(lang = null) {\n let ctx = this.#canvasContexts.get((lang ||= \"\"));\n if (!ctx) {\n // We don't use an OffscreenCanvas here because we use serif/sans serif\n // fonts with it and they depends on the locale.\n // In Firefox, the <html> element get a lang attribute that depends on\n // what Fluent returns for the locale and the OffscreenCanvas uses\n // the OS locale.\n // Those two locales can be different and consequently the used fonts will\n // be different (see bug 1869001).\n // Ideally, we should use in the text layer the fonts we've in the pdf (or\n // their replacements when they aren't embedded) and then we can use an\n // OffscreenCanvas.\n const canvas = document.createElement(\"canvas\");\n canvas.className = \"hiddenCanvasElement\";\n canvas.lang = lang;\n document.body.append(canvas);\n ctx = canvas.getContext(\"2d\", {\n alpha: false,\n willReadFrequently: true,\n });\n this.#canvasContexts.set(lang, ctx);\n\n // Also, initialize state for the `#ensureCtxFont` method.\n this.#canvasCtxFonts.set(ctx, { size: 0, family: \"\" });\n }\n return ctx;\n }\n\n static #ensureCtxFont(ctx, size, family) {\n const cached = this.#canvasCtxFonts.get(ctx);\n if (size === cached.size && family === cached.family) {\n return; // The font is already set.\n }\n ctx.font = `${size}px ${family}`;\n cached.size = size;\n cached.family = family;\n }\n\n /**\n * Compute the minimum font size enforced by the browser.\n */\n static #ensureMinFontSizeComputed() {\n if (this.#minFontSize !== null) {\n return;\n }\n const div = document.createElement(\"div\");\n div.style.opacity = 0;\n div.style.lineHeight = 1;\n div.style.fontSize = \"1px\";\n div.style.position = \"absolute\";\n div.textContent = \"X\";\n document.body.append(div);\n // In `display:block` elements contain a single line of text,\n // the height matches the line height (which, when set to 1,\n // matches the actual font size).\n this.#minFontSize = div.getBoundingClientRect().height;\n div.remove();\n }\n\n static #getAscent(fontFamily, style, lang) {\n const cachedAscent = this.#ascentCache.get(fontFamily);\n if (cachedAscent) {\n return cachedAscent;\n }\n const ctx = this.#getCtx(lang);\n\n ctx.canvas.width = ctx.canvas.height = DEFAULT_FONT_SIZE;\n this.#ensureCtxFont(ctx, DEFAULT_FONT_SIZE, fontFamily);\n const metrics = ctx.measureText(\"\");\n\n const ascent = metrics.fontBoundingBoxAscent;\n const descent = Math.abs(metrics.fontBoundingBoxDescent);\n\n ctx.canvas.width = ctx.canvas.height = 0;\n let ratio = 0.8; // DEFAULT_FONT_ASCENT\n\n if (ascent) {\n ratio = ascent / (ascent + descent);\n } else {\n if (\n (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) ||\n FeatureTest.platform.isFirefox\n ) {\n warn(\n \"Enable the `dom.textMetrics.fontBoundingBox.enabled` preference \" +\n \"in `about:config` to improve TextLayer rendering.\"\n );\n }\n if (style.ascent) {\n ratio = style.ascent;\n } else if (style.descent) {\n ratio = 1 + style.descent;\n }\n }\n\n this.#ascentCache.set(fontFamily, ratio);\n return ratio;\n }\n}\n\nexport { TextLayer };\n","/* Copyright 2021 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/** @typedef {import(\"./api\").TextContent} TextContent */\n\nclass XfaText {\n /**\n * Walk an XFA tree and create an array of text nodes that is compatible\n * with a regular PDFs TextContent. Currently, only TextItem.str is supported,\n * all other fields and styles haven't been implemented.\n *\n * @param {Object} xfa - An XFA fake DOM object.\n *\n * @returns {TextContent}\n */\n static textContent(xfa) {\n const items = [];\n const output = {\n items,\n styles: Object.create(null),\n };\n function walk(node) {\n if (!node) {\n return;\n }\n let str = null;\n const name = node.name;\n if (name === \"#text\") {\n str = node.value;\n } else if (!XfaText.shouldBuildText(name)) {\n return;\n } else if (node?.attributes?.textContent) {\n str = node.attributes.textContent;\n } else if (node.value) {\n str = node.value;\n }\n if (str !== null) {\n items.push({\n str,\n });\n }\n if (!node.children) {\n return;\n }\n for (const child of node.children) {\n walk(child);\n }\n }\n walk(xfa);\n return output;\n }\n\n /**\n * @param {string} name - DOM node name. (lower case)\n *\n * @returns {boolean} true if the DOM node should have a corresponding text\n * node.\n */\n static shouldBuildText(name) {\n return !(\n name === \"textarea\" ||\n name === \"input\" ||\n name === \"option\" ||\n name === \"select\"\n );\n }\n}\n\nexport { XfaText };\n","/* Copyright 2012 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * @module pdfjsLib\n */\n\nimport {\n AbortException,\n AnnotationMode,\n assert,\n FeatureTest,\n getVerbosityLevel,\n info,\n isNodeJS,\n RenderingIntentFlag,\n setVerbosityLevel,\n shadow,\n unreachable,\n warn,\n} from \"../shared/util.js\";\nimport {\n AnnotationStorage,\n PrintAnnotationStorage,\n SerializableEmpty,\n} from \"./annotation_storage.js\";\nimport {\n deprecated,\n isDataScheme,\n isValidFetchUrl,\n PageViewport,\n RenderingCancelledException,\n StatTimer,\n} from \"./display_utils.js\";\nimport { FontFaceObject, FontLoader } from \"./font_loader.js\";\nimport {\n getDataProp,\n getFactoryUrlProp,\n getUrlProp,\n isRefProxy,\n LoopbackPort,\n} from \"./api_utils.js\";\nimport { MessageHandler, wrapReason } from \"../shared/message_handler.js\";\nimport {\n NodeCanvasFactory,\n NodeCMapReaderFactory,\n NodeFilterFactory,\n NodeStandardFontDataFactory,\n NodeWasmFactory,\n} from \"display-node_utils\";\nimport { CanvasDependencyTracker } from \"./canvas_dependency_tracker.js\";\nimport { CanvasGraphics } from \"./canvas.js\";\nimport { DOMCanvasFactory } from \"./canvas_factory.js\";\nimport { DOMCMapReaderFactory } from \"display-cmap_reader_factory\";\nimport { DOMFilterFactory } from \"./filter_factory.js\";\nimport { DOMStandardFontDataFactory } from \"display-standard_fontdata_factory\";\nimport { DOMWasmFactory } from \"display-wasm_factory\";\nimport { GlobalWorkerOptions } from \"./worker_options.js\";\nimport { Metadata } from \"./metadata.js\";\nimport { OptionalContentConfig } from \"./optional_content_config.js\";\nimport { PDFDataTransportStream } from \"./transport_stream.js\";\nimport { PDFFetchStream } from \"display-fetch_stream\";\nimport { PDFNetworkStream } from \"display-network\";\nimport { PDFNodeStream } from \"display-node_stream\";\nimport { PDFObjects } from \"./pdf_objects.js\";\nimport { TextLayer } from \"./text_layer.js\";\nimport { XfaText } from \"./xfa_text.js\";\n\nconst RENDERING_CANCELLED_TIMEOUT = 100; // ms\n\n/**\n * @typedef { Int8Array | Uint8Array | Uint8ClampedArray |\n * Int16Array | Uint16Array |\n * Int32Array | Uint32Array | Float32Array |\n * Float64Array\n * } TypedArray\n */\n\n/**\n * @typedef {Object} RefProxy\n * @property {number} num\n * @property {number} gen\n */\n\n/**\n * Document initialization / loading parameters object.\n *\n * @typedef {Object} DocumentInitParameters\n * @property {string | URL} [url] - The URL of the PDF.\n * @property {TypedArray | ArrayBuffer | Array<number> | string} [data] -\n * Binary PDF data.\n * Use TypedArrays (Uint8Array) to improve the memory usage. If PDF data is\n * BASE64-encoded, use `atob()` to convert it to a binary string first.\n *\n * NOTE: If TypedArrays are used they will generally be transferred to the\n * worker-thread. This will help reduce main-thread memory usage, however\n * it will take ownership of the TypedArrays.\n * @property {Object} [httpHeaders] - Basic authentication headers.\n * @property {boolean} [withCredentials] - Indicates whether or not\n * cross-site Access-Control requests should be made using credentials such\n * as cookies or authorization headers. The default is `false`.\n * @property {string} [password] - For decrypting password-protected PDFs.\n * @property {number} [length] - The PDF file length. It's used for progress\n * reports and range requests operations.\n * @property {PDFDataRangeTransport} [range] - Allows for using a custom range\n * transport implementation.\n * @property {number} [rangeChunkSize] - Specify maximum number of bytes fetched\n * per range request. The default value is 65536 (= 2^16).\n * @property {PDFWorker} [worker] - The worker that will be used for loading and\n * parsing the PDF data.\n * @property {number} [verbosity] - Controls the logging level; the constants\n * from {@link VerbosityLevel} should be used.\n * @property {string} [docBaseUrl] - The base URL of the document, used when\n * attempting to recover valid absolute URLs for annotations, and outline\n * items, that (incorrectly) only specify relative URLs.\n * @property {string} [cMapUrl] - The URL where the predefined Adobe CMaps are\n * located. Include the trailing slash.\n * @property {boolean} [cMapPacked] - Specifies if the Adobe CMaps are binary\n * packed or not. The default value is `true`.\n * @property {Object} [CMapReaderFactory] - The factory that will be used when\n * reading built-in CMap files.\n * The default value is {DOMCMapReaderFactory}.\n * @property {string} [iccUrl] - The URL where the predefined ICC profiles are\n * located. Include the trailing slash.\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.\n * The default value is {DOMStandardFontDataFactory}.\n * @property {string} [wasmUrl] - The URL where the wasm files are located.\n * Include the trailing slash.\n * @property {Object} [WasmFactory] - The factory that will be used\n * when reading the wasm files.\n * The default value is {DOMWasmFactory}.\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`, `StandardFontDataFactory`, and `WasmFactory`\n * options are ignored.\n * The default value is `true` in web environments and `false` in Node.js.\n * @property {boolean} [useWasm] - Attempt to use WebAssembly in order to\n * improve e.g. image decoding performance.\n * The default value is `true`.\n * @property {boolean} [stopAtErrors] - Reject certain promises, e.g.\n * `getOperatorList`, `getTextContent`, and `RenderTask`, when the associated\n * PDF data cannot be successfully parsed, instead of attempting to recover\n * whatever possible of the data. The default value is `false`.\n * @property {number} [maxImageSize] - The maximum allowed image size in total\n * pixels, i.e. width * height. Images above this value will not be rendered.\n * Use -1 for no limit, which is also the default value.\n * @property {boolean} [isEvalSupported] - Determines if we can evaluate strings\n * as JavaScript. Primarily used to improve performance of PDF functions.\n * The default value is `true`.\n * @property {boolean} [isOffscreenCanvasSupported] - Determines if we can use\n * `OffscreenCanvas` in the worker. Primarily used to improve performance of\n * image conversion/rendering.\n * The default value is `true` in web environments and `false` in Node.js.\n * @property {boolean} [isImageDecoderSupported] - Determines if we can use\n * `ImageDecoder` in the worker. Primarily used to improve performance of\n * image conversion/rendering.\n * The default value is `true` in web environments and `false` in Node.js.\n *\n * NOTE: Also temporarily disabled in Chromium browsers, until we no longer\n * support the affected browser versions, because of various bugs:\n *\n * - Crashes when using the BMP decoder with huge images, e.g. issue6741.pdf;\n * see https://issues.chromium.org/issues/374807001\n *\n * - Broken images when using the JPEG decoder with images that have custom\n * colour profiles, e.g. GitHub discussion 19030;\n * see https://issues.chromium.org/issues/378869810\n *\n * @property {number} [canvasMaxAreaInBytes] - The integer value is used to\n * know when an image must be resized (uses `OffscreenCanvas` in the worker).\n * If it's -1 then a possibly slow algorithm is used to guess the max value.\n * @property {boolean} [disableFontFace] - By default fonts are converted to\n * OpenType fonts and loaded via the Font Loading API or `@font-face` rules.\n * If disabled, fonts will be rendered using a built-in font renderer that\n * constructs the glyphs with primitive path commands.\n * The default value is `false` in web environments and `true` in Node.js.\n * @property {boolean} [fontExtraProperties] - Include additional properties,\n * which are unused during rendering of PDF documents, when exporting the\n * parsed font data from the worker-thread. This may be useful for debugging\n * purposes (and backwards compatibility), but note that it will lead to\n * increased memory usage. The default value is `false`.\n * @property {boolean} [enableXfa] - Render Xfa forms if any.\n * The default value is `false`.\n * @property {HTMLDocument} [ownerDocument] - Specify an explicit document\n * context to create elements with and to load resources, such as fonts,\n * into. Defaults to the current document.\n * @property {boolean} [disableRange] - Disable range request loading of PDF\n * files. When enabled, and if the server supports partial content requests,\n * then the PDF will be fetched in chunks. The default value is `false`.\n * @property {boolean} [disableStream] - Disable streaming of PDF file data.\n * By default PDF.js attempts to load PDF files in chunks. The default value\n * is `false`.\n * @property {boolean} [disableAutoFetch] - Disable pre-fetching of PDF file\n * data. When range requests are enabled PDF.js will automatically keep\n * fetching more data even if it isn't needed to display the current page.\n * The default value is `false`.\n *\n * NOTE: It is also necessary to disable streaming, see above, in order for\n * disabling of pre-fetching to work correctly.\n * @property {boolean} [pdfBug] - Enables special hooks for debugging PDF.js\n * (see `web/debugger.js`). The default value is `false`.\n * @property {Object} [CanvasFactory] - The factory that will be used when\n * creating canvases. The default value is {DOMCanvasFactory}.\n * @property {Object} [FilterFactory] - The factory that will be used to\n * create SVG filters when rendering some images on the main canvas.\n * The default value is {DOMFilterFactory}.\n * @property {boolean} [enableHWA] - Enables hardware acceleration for\n * rendering. 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 | ArrayBuffer | DocumentInitParameters}\n * src - Can be a URL where a PDF file is located, a typed array (Uint8Array)\n * already populated with data, or a parameter object.\n * @returns {PDFDocumentLoadingTask}\n */\nfunction getDocument(src = {}) {\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"GENERIC\")) {\n if (typeof src === \"string\" || src instanceof URL) {\n src = { url: src };\n } else if (src instanceof ArrayBuffer || ArrayBuffer.isView(src)) {\n src = { data: src };\n }\n }\n const task = new PDFDocumentLoadingTask();\n const { docId } = task;\n\n const url = src.url ? getUrlProp(src.url) : null;\n const data = src.data ? getDataProp(src.data) : null;\n const httpHeaders = src.httpHeaders || null;\n const withCredentials = src.withCredentials === true;\n const password = src.password ?? null;\n const rangeTransport =\n src.range instanceof PDFDataRangeTransport ? src.range : null;\n const rangeChunkSize =\n Number.isInteger(src.rangeChunkSize) && src.rangeChunkSize > 0\n ? src.rangeChunkSize\n : 2 ** 16;\n let worker = src.worker instanceof PDFWorker ? src.worker : null;\n const verbosity = src.verbosity;\n // Ignore \"data:\"-URLs, since they can't be used to recover valid absolute\n // URLs anyway. We want to avoid sending them to the worker-thread, since\n // they contain the *entire* PDF document and can thus be arbitrarily long.\n const docBaseUrl =\n typeof src.docBaseUrl === \"string\" && !isDataScheme(src.docBaseUrl)\n ? src.docBaseUrl\n : null;\n const cMapUrl = getFactoryUrlProp(src.cMapUrl);\n const cMapPacked = src.cMapPacked !== false;\n const CMapReaderFactory =\n src.CMapReaderFactory ||\n (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"GENERIC\") && isNodeJS\n ? NodeCMapReaderFactory\n : DOMCMapReaderFactory);\n const iccUrl = getFactoryUrlProp(src.iccUrl);\n const standardFontDataUrl = getFactoryUrlProp(src.standardFontDataUrl);\n const StandardFontDataFactory =\n src.StandardFontDataFactory ||\n (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"GENERIC\") && isNodeJS\n ? NodeStandardFontDataFactory\n : DOMStandardFontDataFactory);\n const wasmUrl = getFactoryUrlProp(src.wasmUrl);\n const WasmFactory =\n src.WasmFactory ||\n (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"GENERIC\") && isNodeJS\n ? NodeWasmFactory\n : DOMWasmFactory);\n const ignoreErrors = src.stopAtErrors !== true;\n const maxImageSize =\n Number.isInteger(src.maxImageSize) && src.maxImageSize > -1\n ? src.maxImageSize\n : -1;\n const isEvalSupported = src.isEvalSupported !== false;\n const isOffscreenCanvasSupported =\n typeof src.isOffscreenCanvasSupported === \"boolean\"\n ? src.isOffscreenCanvasSupported\n : !isNodeJS;\n const isImageDecoderSupported =\n // eslint-disable-next-line no-nested-ternary\n typeof src.isImageDecoderSupported === \"boolean\"\n ? src.isImageDecoderSupported\n : // eslint-disable-next-line no-nested-ternary\n typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")\n ? true\n : typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"CHROME\")\n ? false\n : !isNodeJS && (FeatureTest.platform.isFirefox || !globalThis.chrome);\n const canvasMaxAreaInBytes = Number.isInteger(src.canvasMaxAreaInBytes)\n ? src.canvasMaxAreaInBytes\n : -1;\n const disableFontFace =\n typeof src.disableFontFace === \"boolean\" ? src.disableFontFace : isNodeJS;\n const fontExtraProperties = src.fontExtraProperties === true;\n const enableXfa = src.enableXfa === true;\n const ownerDocument = src.ownerDocument || globalThis.document;\n const disableRange = src.disableRange === true;\n const disableStream = src.disableStream === true;\n const disableAutoFetch = src.disableAutoFetch === true;\n const pdfBug = src.pdfBug === true;\n const CanvasFactory =\n src.CanvasFactory ||\n (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"GENERIC\") && isNodeJS\n ? NodeCanvasFactory\n : DOMCanvasFactory);\n const FilterFactory =\n src.FilterFactory ||\n (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"GENERIC\") && isNodeJS\n ? NodeFilterFactory\n : DOMFilterFactory);\n const enableHWA = src.enableHWA === true;\n const useWasm = src.useWasm !== false;\n\n // Parameters whose default values depend on other parameters.\n const length = rangeTransport ? rangeTransport.length : (src.length ?? NaN);\n const useSystemFonts =\n typeof src.useSystemFonts === \"boolean\"\n ? src.useSystemFonts\n : !isNodeJS && !disableFontFace;\n const useWorkerFetch =\n typeof src.useWorkerFetch === \"boolean\"\n ? src.useWorkerFetch\n : (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) ||\n !!(\n CMapReaderFactory === DOMCMapReaderFactory &&\n StandardFontDataFactory === DOMStandardFontDataFactory &&\n WasmFactory === DOMWasmFactory &&\n cMapUrl &&\n standardFontDataUrl &&\n wasmUrl &&\n isValidFetchUrl(cMapUrl, document.baseURI) &&\n isValidFetchUrl(standardFontDataUrl, document.baseURI) &&\n isValidFetchUrl(wasmUrl, document.baseURI)\n );\n\n // Parameters only intended for development/testing purposes.\n const styleElement =\n typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")\n ? src.styleElement\n : null;\n\n // Set the main-thread verbosity level.\n setVerbosityLevel(verbosity);\n\n // Ensure that the various factories can be initialized, when necessary,\n // since the user may provide *custom* ones.\n const transportFactory = {\n canvasFactory: new CanvasFactory({ ownerDocument, enableHWA }),\n filterFactory: new FilterFactory({ docId, ownerDocument }),\n cMapReaderFactory:\n (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) ||\n useWorkerFetch\n ? null\n : new CMapReaderFactory({ baseUrl: cMapUrl, isCompressed: cMapPacked }),\n standardFontDataFactory:\n (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) ||\n useWorkerFetch\n ? null\n : new StandardFontDataFactory({ baseUrl: standardFontDataUrl }),\n wasmFactory:\n (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) ||\n useWorkerFetch\n ? null\n : new WasmFactory({ baseUrl: wasmUrl }),\n };\n\n if (!worker) {\n // Worker was not provided -- creating and owning our own. If message port\n // is specified in global worker options, using it.\n worker = PDFWorker.create({\n verbosity,\n port: GlobalWorkerOptions.workerPort,\n });\n task._worker = worker;\n }\n\n const docParams = {\n docId,\n apiVersion:\n typeof PDFJSDev !== \"undefined\" && !PDFJSDev.test(\"TESTING\")\n ? PDFJSDev.eval(\"BUNDLE_VERSION\")\n : null,\n data,\n password,\n disableAutoFetch,\n rangeChunkSize,\n length,\n docBaseUrl,\n enableXfa,\n evaluatorOptions: {\n maxImageSize,\n disableFontFace,\n ignoreErrors,\n isEvalSupported,\n isOffscreenCanvasSupported,\n isImageDecoderSupported,\n canvasMaxAreaInBytes,\n fontExtraProperties,\n useSystemFonts,\n useWasm,\n useWorkerFetch,\n cMapUrl,\n iccUrl,\n standardFontDataUrl,\n wasmUrl,\n },\n };\n const transportParams = {\n ownerDocument,\n pdfBug,\n styleElement,\n loadingParams: {\n disableAutoFetch,\n enableXfa,\n },\n };\n\n worker.promise\n .then(function () {\n if (task.destroyed) {\n throw new Error(\"Loading aborted\");\n }\n if (worker.destroyed) {\n throw new Error(\"Worker was destroyed\");\n }\n\n const workerIdPromise = worker.messageHandler.sendWithPromise(\n \"GetDocRequest\",\n docParams,\n data ? [data.buffer] : null\n );\n\n let networkStream;\n if (rangeTransport) {\n networkStream = new PDFDataTransportStream(rangeTransport, {\n disableRange,\n disableStream,\n });\n } else if (!data) {\n if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) {\n throw new Error(\"Not implemented: NetworkStream\");\n }\n if (!url) {\n throw new Error(\"getDocument - no `url` parameter provided.\");\n }\n // eslint-disable-next-line no-nested-ternary\n const NetworkStream = isValidFetchUrl(url)\n ? PDFFetchStream\n : typeof PDFJSDev !== \"undefined\" &&\n PDFJSDev.test(\"GENERIC\") &&\n isNodeJS\n ? PDFNodeStream\n : PDFNetworkStream;\n\n networkStream = new NetworkStream({\n url,\n length,\n httpHeaders,\n withCredentials,\n rangeChunkSize,\n disableRange,\n disableStream,\n });\n }\n\n return workerIdPromise.then(workerId => {\n if (task.destroyed) {\n throw new Error(\"Loading aborted\");\n }\n if (worker.destroyed) {\n throw new Error(\"Worker was destroyed\");\n }\n\n const messageHandler = new MessageHandler(docId, workerId, worker.port);\n const transport = new WorkerTransport(\n messageHandler,\n task,\n networkStream,\n transportParams,\n transportFactory,\n enableHWA\n );\n task._transport = transport;\n messageHandler.send(\"Ready\", null);\n });\n })\n .catch(task._capability.reject);\n\n return task;\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 /**\n * @private\n */\n _capability = Promise.withResolvers();\n\n /**\n * @private\n */\n _transport = null;\n\n /**\n * @private\n */\n _worker = null;\n\n /**\n * Unique identifier for the document loading task.\n * @type {string}\n */\n docId = `d${PDFDocumentLoadingTask.#docId++}`;\n\n /**\n * Whether the loading task is destroyed or not.\n * @type {boolean}\n */\n 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 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 onProgress = null;\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\n try {\n if (this._worker?.port) {\n this._worker._pendingDestroy = true;\n }\n await this._transport?.destroy();\n } catch (ex) {\n if (this._worker?.port) {\n delete this._worker._pendingDestroy;\n }\n throw ex;\n }\n this._transport = null;\n\n this._worker?.destroy();\n this._worker = null;\n }\n\n /**\n * Attempt to fetch the raw data of the PDF document, when e.g.\n * - An exception was thrown during document initialization.\n * - An `onPassword` callback is delaying initialization.\n * @returns {Promise<Uint8Array>}\n */\n async getData() {\n return this._transport.getData();\n }\n}\n\n/**\n * Abstract class to support range requests file loading.\n *\n * NOTE: The TypedArrays passed to the constructor and relevant methods below\n * will generally be transferred to the worker-thread. This will help reduce\n * main-thread memory usage, however it will take ownership of the TypedArrays.\n */\nclass PDFDataRangeTransport {\n #capability = Promise.withResolvers();\n\n #progressiveDoneListeners = [];\n\n #progressiveReadListeners = [];\n\n #progressListeners = [];\n\n #rangeListeners = [];\n\n /**\n * @param {number} length\n * @param {Uint8Array|null} initialData\n * @param {boolean} [progressiveDone]\n * @param {string} [contentDispositionFilename]\n */\n constructor(\n length,\n initialData,\n progressiveDone = false,\n contentDispositionFilename = null\n ) {\n this.length = length;\n this.initialData = initialData;\n this.progressiveDone = progressiveDone;\n this.contentDispositionFilename = contentDispositionFilename;\n }\n\n /**\n * @param {function} listener\n */\n addRangeListener(listener) {\n this.#rangeListeners.push(listener);\n }\n\n /**\n * @param {function} listener\n */\n addProgressListener(listener) {\n this.#progressListeners.push(listener);\n }\n\n /**\n * @param {function} listener\n */\n addProgressiveReadListener(listener) {\n this.#progressiveReadListeners.push(listener);\n }\n\n /**\n * @param {function} listener\n */\n addProgressiveDoneListener(listener) {\n this.#progressiveDoneListeners.push(listener);\n }\n\n /**\n * @param {number} begin\n * @param {Uint8Array|null} chunk\n */\n onDataRange(begin, chunk) {\n for (const listener of this.#rangeListeners) {\n listener(begin, chunk);\n }\n }\n\n /**\n * @param {number} loaded\n * @param {number|undefined} total\n */\n onDataProgress(loaded, total) {\n this.#capability.promise.then(() => {\n for (const listener of this.#progressListeners) {\n listener(loaded, total);\n }\n });\n }\n\n /**\n * @param {Uint8Array|null} chunk\n */\n onDataProgressiveRead(chunk) {\n this.#capability.promise.then(() => {\n for (const listener of this.#progressiveReadListeners) {\n listener(chunk);\n }\n });\n }\n\n onDataProgressiveDone() {\n this.#capability.promise.then(() => {\n for (const listener of this.#progressiveDoneListeners) {\n listener();\n }\n });\n }\n\n transportReady() {\n this.#capability.resolve();\n }\n\n /**\n * @param {number} begin\n * @param {number} end\n */\n requestDataRange(begin, end) {\n unreachable(\"Abstract method PDFDataRangeTransport.requestDataRange\");\n }\n\n abort() {}\n}\n\n/**\n * Proxy to a `PDFDocument` in the worker thread.\n */\nclass PDFDocumentProxy {\n constructor(pdfInfo, transport) {\n this._pdfInfo = pdfInfo;\n this._transport = transport;\n\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) {\n // For testing purposes.\n Object.defineProperty(this, \"getNetworkStreamName\", {\n value: () => this._transport.getNetworkStreamName(),\n });\n Object.defineProperty(this, \"getXFADatasets\", {\n value: () => this._transport.getXFADatasets(),\n });\n Object.defineProperty(this, \"getXRefPrevValue\", {\n value: () => this._transport.getXRefPrevValue(),\n });\n Object.defineProperty(this, \"getStartXRefPos\", {\n value: () => this._transport.getStartXRefPos(),\n });\n Object.defineProperty(this, \"getAnnotArray\", {\n value: pageIndex => this._transport.getAnnotArray(pageIndex),\n });\n }\n }\n\n /**\n * @type {AnnotationStorage} Storage for annotation data in forms.\n */\n get annotationStorage() {\n return this._transport.annotationStorage;\n }\n\n /**\n * @type {Object} The canvas factory instance.\n */\n get canvasFactory() {\n return this._transport.canvasFactory;\n }\n\n /**\n * @type {Object} The filter factory instance.\n */\n get filterFactory() {\n return this._transport.filterFactory;\n }\n\n /**\n * @type {number} Total number of pages in the PDF file.\n */\n get numPages() {\n return this._pdfInfo.numPages;\n }\n\n /**\n * @type {Array<string | null>} A (not guaranteed to be) unique ID to identify\n * the PDF document.\n * NOTE: The first element will always be defined for all PDF documents,\n * whereas the second element is only defined for *modified* PDF documents.\n */\n get fingerprints() {\n return this._pdfInfo.fingerprints;\n }\n\n /**\n * @type {boolean} True if only XFA form.\n */\n get isPureXfa() {\n return shadow(this, \"isPureXfa\", !!this._transport._htmlForXfa);\n }\n\n /**\n * NOTE: This is (mostly) intended to support printing of XFA forms.\n *\n * @type {Object | null} An object representing a HTML tree structure\n * to render the XFA, or `null` when no XFA form exists.\n */\n get allXfaHtml() {\n return this._transport._htmlForXfa;\n }\n\n /**\n * @param {number} pageNumber - The page number to get. The first page is 1.\n * @returns {Promise<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 * @param {Set<number>} types - The annotation types to retrieve.\n * @param {Set<number>} pageIndexesToSkip\n * @returns {Promise<Array<Object>>} A promise that is resolved with a list of\n * annotations data.\n */\n getAnnotationsByType(types, pageIndexesToSkip) {\n return this._transport.getAnnotationsByType(types, pageIndexesToSkip);\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.\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 * @typedef {Object} GetOptionalContentConfigParameters\n * @property {string} [intent] - Determines the optional content groups that\n * are visible by default; valid values are:\n * - 'display' (viewable groups).\n * - 'print' (printable groups).\n * - 'any' (all groups).\n * The default value is 'display'.\n */\n\n /**\n * @param {GetOptionalContentConfigParameters} [params] - Optional content\n * config parameters.\n * @returns {Promise<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({ intent = \"display\" } = {}) {\n const { renderingIntent } = this._transport.getRenderingIntent(intent);\n\n return this._transport.getOptionalContentConfig(renderingIntent);\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<Uint8Array>} A promise that is resolved with a\n * {Uint8Array} containing the raw data of the PDF document.\n */\n getData() {\n return this._transport.getData();\n }\n\n /**\n * @returns {Promise<Uint8Array>} A promise that is resolved with a\n * {Uint8Array} containing the full data of the saved document.\n */\n saveDocument() {\n return this._transport.saveDocument();\n }\n\n /**\n * @returns {Promise<{ length: number }>} A promise that is resolved when the\n * document's data is loaded. It is resolved with an {Object} that contains\n * the `length` property that indicates size of the PDF data in bytes.\n */\n getDownloadInfo() {\n return this._transport.downloadInfoCapability.promise;\n }\n\n /**\n * Cleans up resources allocated by the document on both the main and worker\n * threads.\n *\n * NOTE: Do not, under any circumstances, call this method when rendering is\n * currently ongoing since that may lead to rendering errors.\n *\n * @param {boolean} [keepLoadedFonts] - Let fonts remain attached to the DOM.\n * NOTE: This will increase persistent memory usage, hence don't use this\n * option unless absolutely necessary. The default value is `false`.\n * @returns {Promise} A promise that is resolved when clean-up has finished.\n */\n cleanup(keepLoadedFonts = false) {\n return this._transport.startCleanup(keepLoadedFonts || this.isPureXfa);\n }\n\n /**\n * Destroys the current document instance and terminates the worker.\n */\n destroy() {\n return this.loadingTask.destroy();\n }\n\n /**\n * @param {RefProxy} ref - The page reference.\n * @returns {number | null} The page number, if it's cached.\n */\n cachedPageNumber(ref) {\n return this._transport.cachedPageNumber(ref);\n }\n\n /**\n * @type {DocumentInitParameters} A subset of the current\n * {DocumentInitParameters}, which are needed in the viewer.\n */\n get loadingParams() {\n return this._transport.loadingParams;\n }\n\n /**\n * @type {PDFDocumentLoadingTask} The loadingTask for the current document.\n */\n get loadingTask() {\n return this._transport.loadingTask;\n }\n\n /**\n * @returns {Promise<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} [includeMarkedContent] - When true include marked\n * content items in the items array of TextContent. The default is `false`.\n * @property {boolean} [disableNormalization] - When true the text is *not*\n * normalized in the worker-thread. The default is `false`.\n */\n\n/**\n * Page text content.\n *\n * @typedef {Object} TextContent\n * @property {Array<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 * @property {string | null} lang - The document /Lang attribute.\n */\n\n/**\n * Page text content part.\n *\n * @typedef {Object} TextItem\n * @property {string} str - Text content.\n * @property {string} dir - Text direction: 'ttb', 'ltr' or 'rtl'.\n * @property {Array<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 {HTMLCanvasElement|null} canvas - A DOM Canvas object. The default\n * value is the canvas associated with the `canvasContext` parameter if no\n * value is provided explicitly.\n * @property {PageViewport} viewport - Rendering viewport obtained by calling\n * the `PDFPageProxy.getViewport` method.\n * @property {CanvasRenderingContext2D} [canvasContext] - 2D context of a DOM\n * Canvas object for backwards compatibility; it is recommended to use the\n * `canvas` parameter instead.\n * If the context must absolutely be used to render the page, the canvas must\n * be null.\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 {CanvasGradient | CanvasPattern | string} [background] - Background\n * to use for the canvas.\n * Any valid `canvas.fillStyle` can be used: a `DOMString` parsed as CSS\n * <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 * @property {PrintAnnotationStorage} [printAnnotationStorage]\n * @property {boolean} [isEditing] - Render the page in editing mode.\n * @property {boolean} [recordOperations] - Record the dependencies and bounding\n * boxes of all PDF operations that render onto the canvas.\n * @property {Set<number>} [filteredOperationIndexes] - If provided, only run\n * the PDF operations that are included in this set.\n */\n\n/**\n * Page getOperatorList parameters.\n *\n * @typedef {Object} GetOperatorListParameters\n * @property {string} [intent] - Rendering intent, can be 'display', 'print',\n * or 'any'. The default value is 'display'.\n * @property {number} [annotationMode] Controls which annotations are included\n * in the operatorList, for annotations with appearance-data; the values from\n * {@link AnnotationMode} should be used. The following values are supported:\n * - `AnnotationMode.DISABLE`, which disables all annotations.\n * - `AnnotationMode.ENABLE`, which includes all possible annotations (thus\n * it also depends on the `intent`-option, see above).\n * - `AnnotationMode.ENABLE_FORMS`, which excludes annotations that contain\n * interactive form elements (those will be rendered in the display layer).\n * - `AnnotationMode.ENABLE_STORAGE`, which includes all possible annotations\n * (as above) but where interactive form elements are updated with data\n * from the {@link AnnotationStorage}-instance; useful e.g. for printing.\n * The default value is `AnnotationMode.ENABLE`.\n * @property {PrintAnnotationStorage} [printAnnotationStorage]\n * @property {boolean} [isEditing] - Render the page in editing mode.\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 #pendingCleanup = false;\n\n constructor(pageIndex, pageInfo, transport, pdfBug = false) {\n this._pageIndex = pageIndex;\n this._pageInfo = pageInfo;\n this._transport = transport;\n this._stats = pdfBug ? new StatTimer() : null;\n this._pdfBug = pdfBug;\n /** @type {PDFObjects} */\n this.commonObjs = transport.commonObjs;\n this.objs = new PDFObjects();\n\n this._intentStates = new Map();\n this.destroyed = false;\n this.recordedGroups = null;\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 userUnit: this.userUnit,\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 { renderingIntent } = this._transport.getRenderingIntent(intent);\n\n return this._transport.getAnnotations(this._pageIndex, renderingIntent);\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._transport.getPageJSActions(this._pageIndex);\n }\n\n /**\n * @type {Object} The filter factory instance.\n */\n get filterFactory() {\n return this._transport.filterFactory;\n }\n\n /**\n * @type {boolean} True if only XFA form.\n */\n get isPureXfa() {\n return shadow(this, \"isPureXfa\", !!this._transport._htmlForXfa);\n }\n\n /**\n * @returns {Promise<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 canvas = canvasContext.canvas,\n viewport,\n intent = \"display\",\n annotationMode = AnnotationMode.ENABLE,\n transform = null,\n background = null,\n optionalContentConfigPromise = null,\n annotationCanvasMap = null,\n pageColors = null,\n printAnnotationStorage = null,\n isEditing = false,\n recordOperations = false,\n filteredOperationIndexes = null,\n }) {\n this._stats?.time(\"Overall\");\n\n const intentArgs = this._transport.getRenderingIntent(\n intent,\n annotationMode,\n printAnnotationStorage,\n isEditing\n );\n const { renderingIntent, cacheKey } = intentArgs;\n // If there was a pending destroy, cancel it so no cleanup happens during\n // this call to render.\n this.#pendingCleanup = false;\n\n optionalContentConfigPromise ||=\n this._transport.getOptionalContentConfig(renderingIntent);\n\n let intentState = this._intentStates.get(cacheKey);\n if (!intentState) {\n intentState = Object.create(null);\n this._intentStates.set(cacheKey, intentState);\n }\n\n // Ensure that a pending `streamReader` cancel timeout is always aborted.\n if (intentState.streamReaderCancelTimeout) {\n clearTimeout(intentState.streamReaderCancelTimeout);\n intentState.streamReaderCancelTimeout = null;\n }\n\n const intentPrint = !!(renderingIntent & RenderingIntentFlag.PRINT);\n\n // If there's no displayReadyCapability yet, then the operatorList\n // was never requested before. Make the request and create the promise.\n if (!intentState.displayReadyCapability) {\n intentState.displayReadyCapability = Promise.withResolvers();\n intentState.operatorList = {\n fnArray: [],\n argsArray: [],\n lastChunk: false,\n separateAnnots: null,\n };\n\n this._stats?.time(\"Page Request\");\n this._pumpOperatorList(intentArgs);\n }\n\n const shouldRecordOperations =\n !this.recordedGroups &&\n (recordOperations ||\n (this._pdfBug && globalThis.StepperManager?.enabled));\n\n const complete = error => {\n intentState.renderTasks.delete(internalRenderTask);\n\n if (shouldRecordOperations) {\n const recordedGroups = internalRenderTask.gfx?.dependencyTracker.take();\n if (recordedGroups) {\n internalRenderTask.stepper?.setOperatorGroups(recordedGroups);\n if (recordOperations) {\n this.recordedGroups = recordedGroups;\n }\n } else if (recordOperations) {\n this.recordedGroups = [];\n }\n }\n\n // Attempt to reduce memory usage during *printing*, by always running\n // cleanup immediately once rendering has finished.\n if (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\n if (this._stats) {\n this._stats.timeEnd(\"Rendering\");\n this._stats.timeEnd(\"Overall\");\n\n if (globalThis.Stats?.enabled) {\n globalThis.Stats.add(this.pageNumber, this._stats);\n }\n }\n };\n\n const internalRenderTask = new InternalRenderTask({\n callback: complete,\n // Only include the required properties, and *not* the entire object.\n params: {\n canvas,\n canvasContext,\n dependencyTracker: shouldRecordOperations\n ? new CanvasDependencyTracker(canvas)\n : null,\n viewport,\n transform,\n background,\n },\n objs: this.objs,\n commonObjs: this.commonObjs,\n annotationCanvasMap,\n operatorList: intentState.operatorList,\n pageIndex: this._pageIndex,\n canvasFactory: this._transport.canvasFactory,\n filterFactory: this._transport.filterFactory,\n useRequestAnimationFrame: !intentPrint,\n pdfBug: this._pdfBug,\n pageColors,\n enableHWA: this._transport.enableHWA,\n filteredOperationIndexes,\n });\n\n (intentState.renderTasks ||= new Set()).add(internalRenderTask);\n const renderTask = internalRenderTask.task;\n\n Promise.all([\n intentState.displayReadyCapability.promise,\n optionalContentConfigPromise,\n ])\n .then(([transparency, optionalContentConfig]) => {\n if (this.destroyed) {\n complete();\n return;\n }\n this._stats?.time(\"Rendering\");\n\n if (!(optionalContentConfig.renderingIntent & renderingIntent)) {\n throw new Error(\n \"Must use the same `intent`-argument when calling the `PDFPageProxy.render` \" +\n \"and `PDFDocumentProxy.getOptionalContentConfig` methods.\"\n );\n }\n internalRenderTask.initializeGraphics({\n transparency,\n optionalContentConfig,\n });\n internalRenderTask.operatorListChanged();\n })\n .catch(complete);\n\n return renderTask;\n }\n\n /**\n * @param {GetOperatorListParameters} params - Page getOperatorList\n * parameters.\n * @returns {Promise<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 printAnnotationStorage = null,\n isEditing = false,\n } = {}) {\n if (typeof PDFJSDev !== \"undefined\" && !PDFJSDev.test(\"GENERIC\")) {\n throw new Error(\"Not implemented: getOperatorList\");\n }\n function operatorListChanged() {\n if (intentState.operatorList.lastChunk) {\n intentState.opListReadCapability.resolve(intentState.operatorList);\n\n intentState.renderTasks.delete(opListTask);\n }\n }\n\n const intentArgs = this._transport.getRenderingIntent(\n intent,\n annotationMode,\n printAnnotationStorage,\n isEditing,\n /* isOpList = */ true\n );\n let intentState = this._intentStates.get(intentArgs.cacheKey);\n if (!intentState) {\n intentState = Object.create(null);\n this._intentStates.set(intentArgs.cacheKey, intentState);\n }\n let opListTask;\n\n if (!intentState.opListReadCapability) {\n opListTask = Object.create(null);\n opListTask.operatorListChanged = operatorListChanged;\n intentState.opListReadCapability = Promise.withResolvers();\n (intentState.renderTasks ||= new Set()).add(opListTask);\n intentState.operatorList = {\n fnArray: [],\n argsArray: [],\n lastChunk: false,\n separateAnnots: null,\n };\n\n this._stats?.time(\"Page Request\");\n this._pumpOperatorList(intentArgs);\n }\n return intentState.opListReadCapability.promise;\n }\n\n /**\n * NOTE: All occurrences of whitespace will be replaced by\n * standard spaces (0x20).\n *\n * @param {getTextContentParameters} params - getTextContent parameters.\n * @returns {ReadableStream} Stream for reading text content chunks.\n */\n streamTextContent({\n includeMarkedContent = false,\n disableNormalization = false,\n } = {}) {\n const TEXT_CONTENT_CHUNK_SIZE = 100;\n\n return this._transport.messageHandler.sendWithStream(\n \"GetTextContent\",\n {\n pageIndex: this._pageIndex,\n includeMarkedContent: includeMarkedContent === true,\n disableNormalization: disableNormalization === true,\n },\n {\n highWaterMark: TEXT_CONTENT_CHUNK_SIZE,\n size(textContent) {\n return textContent.items.length;\n },\n }\n );\n }\n\n /**\n * NOTE: All occurrences of whitespace will be replaced by\n * standard spaces (0x20).\n *\n * @param {getTextContentParameters} params - getTextContent parameters.\n * @returns {Promise<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 => XfaText.textContent(xfa));\n }\n const readableStream = this.streamTextContent(params);\n\n return new Promise(function (resolve, reject) {\n function pump() {\n reader.read().then(function ({ value, done }) {\n if (done) {\n resolve(textContent);\n return;\n }\n textContent.lang ??= value.lang;\n Object.assign(textContent.styles, value.styles);\n textContent.items.push(...value.items);\n pump();\n }, reject);\n }\n\n const reader = readableStream.getReader();\n const textContent = {\n items: [],\n styles: Object.create(null),\n lang: null,\n };\n pump();\n });\n }\n\n /**\n * @returns {Promise<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._transport.getStructTree(this._pageIndex);\n }\n\n /**\n * Destroys the page object.\n * @private\n */\n _destroy() {\n this.destroyed = true;\n\n const waitOn = [];\n for (const intentState of this._intentStates.values()) {\n this._abortOperatorList({\n intentState,\n reason: new Error(\"Page was destroyed.\"),\n force: true,\n });\n\n if (intentState.opListReadCapability) {\n // Avoid errors below, since the renderTasks are just stubs.\n continue;\n }\n for (const internalRenderTask of intentState.renderTasks) {\n waitOn.push(internalRenderTask.completed);\n internalRenderTask.cancel();\n }\n }\n this.objs.clear();\n this.#pendingCleanup = false;\n\n return Promise.all(waitOn);\n }\n\n /**\n * Cleans up resources allocated by the page.\n *\n * @param {boolean} [resetStats] - Reset page stats, if enabled.\n * The default value is `false`.\n * @returns {boolean} Indicates if clean-up was successfully run.\n */\n cleanup(resetStats = false) {\n this.#pendingCleanup = true;\n const success = this.#tryCleanup();\n\n if (resetStats && success) {\n this._stats &&= new StatTimer();\n }\n return success;\n }\n\n /**\n * Attempts to clean up if rendering is in a state where that's possible.\n * @returns {boolean} Indicates if clean-up was successfully run.\n */\n #tryCleanup() {\n if (!this.#pendingCleanup || this.destroyed) {\n return false;\n }\n for (const { renderTasks, operatorList } of this._intentStates.values()) {\n if (renderTasks.size > 0 || !operatorList.lastChunk) {\n return false;\n }\n }\n this._intentStates.clear();\n this.objs.clear();\n this.#pendingCleanup = false;\n return true;\n }\n\n /**\n * @private\n */\n _startRenderPage(transparency, cacheKey) {\n const intentState = this._intentStates.get(cacheKey);\n if (!intentState) {\n return; // Rendering was cancelled.\n }\n this._stats?.timeEnd(\"Page Request\");\n\n // TODO Refactor RenderPageRequest to separate rendering\n // and operator list logic\n intentState.displayReadyCapability?.resolve(transparency);\n }\n\n /**\n * @private\n */\n _renderPageChunk(operatorListChunk, intentState) {\n // Add the new chunk to the current operator list.\n for (let i = 0, ii = operatorListChunk.length; i < ii; i++) {\n intentState.operatorList.fnArray.push(operatorListChunk.fnArray[i]);\n intentState.operatorList.argsArray.push(operatorListChunk.argsArray[i]);\n }\n intentState.operatorList.lastChunk = operatorListChunk.lastChunk;\n intentState.operatorList.separateAnnots = operatorListChunk.separateAnnots;\n\n // Notify all the rendering tasks there are more operators to be consumed.\n for (const internalRenderTask of intentState.renderTasks) {\n internalRenderTask.operatorListChanged();\n }\n\n if (operatorListChunk.lastChunk) {\n this.#tryCleanup();\n }\n }\n\n /**\n * @private\n */\n _pumpOperatorList({\n renderingIntent,\n cacheKey,\n annotationStorageSerializable,\n modifiedIds,\n }) {\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) {\n assert(\n Number.isInteger(renderingIntent) && renderingIntent > 0,\n '_pumpOperatorList: Expected valid \"renderingIntent\" argument.'\n );\n }\n const { map, transfer } = annotationStorageSerializable;\n\n const readableStream = this._transport.messageHandler.sendWithStream(\n \"GetOperatorList\",\n {\n pageIndex: this._pageIndex,\n intent: renderingIntent,\n cacheKey,\n annotationStorage: map,\n modifiedIds,\n },\n transfer\n );\n const reader = readableStream.getReader();\n\n const intentState = this._intentStates.get(cacheKey);\n intentState.streamReader = reader;\n\n const pump = () => {\n reader.read().then(\n ({ value, done }) => {\n if (done) {\n intentState.streamReader = null;\n return;\n }\n if (this._transport.destroyed) {\n return; // Ignore any pending requests if the worker was terminated.\n }\n this._renderPageChunk(value, intentState);\n pump();\n },\n reason => {\n intentState.streamReader = null;\n\n if (this._transport.destroyed) {\n return; // Ignore any pending requests if the worker was terminated.\n }\n if (intentState.operatorList) {\n // Mark operator list as complete.\n intentState.operatorList.lastChunk = true;\n\n for (const internalRenderTask of intentState.renderTasks) {\n internalRenderTask.operatorListChanged();\n }\n this.#tryCleanup();\n }\n\n if (intentState.displayReadyCapability) {\n intentState.displayReadyCapability.reject(reason);\n } else if (intentState.opListReadCapability) {\n intentState.opListReadCapability.reject(reason);\n } else {\n throw reason;\n }\n }\n );\n };\n pump();\n }\n\n /**\n * @private\n */\n _abortOperatorList({ intentState, reason, force = false }) {\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) {\n assert(\n reason instanceof Error,\n '_abortOperatorList: Expected valid \"reason\" argument.'\n );\n }\n\n if (!intentState.streamReader) {\n return;\n }\n // Ensure that a pending `streamReader` cancel timeout is always aborted.\n if (intentState.streamReaderCancelTimeout) {\n clearTimeout(intentState.streamReaderCancelTimeout);\n intentState.streamReaderCancelTimeout = null;\n }\n\n if (!force) {\n // Ensure that an Error occurring in *only* one `InternalRenderTask`, e.g.\n // multiple render() calls on the same canvas, won't break all rendering.\n if (intentState.renderTasks.size > 0) {\n return;\n }\n // Don't immediately abort parsing on the worker-thread when rendering is\n // cancelled, since that will unnecessarily delay re-rendering when (for\n // partially parsed pages) e.g. zooming/rotation occurs in the viewer.\n if (reason instanceof RenderingCancelledException) {\n let delay = RENDERING_CANCELLED_TIMEOUT;\n if (reason.extraDelay > 0 && reason.extraDelay < /* ms = */ 1000) {\n // Above, we prevent the total delay from becoming arbitrarily large.\n delay += reason.extraDelay;\n }\n\n intentState.streamReaderCancelTimeout = setTimeout(() => {\n intentState.streamReaderCancelTimeout = null;\n this._abortOperatorList({ intentState, reason, force: true });\n }, delay);\n return;\n }\n }\n intentState.streamReader\n .cancel(new AbortException(reason.message))\n .catch(() => {\n // Avoid \"Uncaught promise\" messages in the console.\n });\n intentState.streamReader = null;\n\n if (this._transport.destroyed) {\n return; // Ignore any pending requests if the worker was terminated.\n }\n // Remove the current `intentState`, since a cancelled `getOperatorList`\n // call on the worker-thread cannot be re-started...\n for (const [curCacheKey, curIntentState] of this._intentStates) {\n if (curIntentState === intentState) {\n this._intentStates.delete(curCacheKey);\n break;\n }\n }\n // ... and force clean-up to ensure that any old state is always removed.\n this.cleanup();\n }\n\n /**\n * @type {StatTimer | null} Returns page stats, if enabled; returns `null`\n * otherwise.\n */\n get stats() {\n return this._stats;\n }\n}\n\n/**\n * @typedef {Object} PDFWorkerParameters\n * @property {string} [name] - The name of the worker.\n * @property {Worker} [port] - The `workerPort` object.\n * @property {number} [verbosity] - Controls the logging level;\n * the constants from {@link VerbosityLevel} should be used.\n */\n\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 #capability = Promise.withResolvers();\n\n #messageHandler = null;\n\n #port = null;\n\n #webWorker = null;\n\n static #fakeWorkerId = 0;\n\n static #isWorkerDisabled = false;\n\n static #workerPorts = new WeakMap();\n\n static {\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"GENERIC\")) {\n if (isNodeJS) {\n // Workers aren't supported in Node.js, force-disabling them there.\n this.#isWorkerDisabled = true;\n\n GlobalWorkerOptions.workerSrc ||= PDFJSDev.test(\"LIB\")\n ? \"../pdf.worker.js\"\n : \"./pdf.worker.mjs\";\n }\n\n // Check if URLs have the same origin. For non-HTTP based URLs, returns\n // false.\n this._isSameOrigin = (baseUrl, otherUrl) => {\n const base = URL.parse(baseUrl);\n if (!base?.origin || base.origin === \"null\") {\n return false; // non-HTTP url\n }\n const other = new URL(otherUrl, base);\n return base.origin === other.origin;\n };\n\n this._createCDNWrapper = 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\n // not exist or fail for some reason -- our Worker creation will fail\n // anyway.\n const wrapper = `await import(\"${url}\");`;\n return URL.createObjectURL(\n new Blob([wrapper], { type: \"text/javascript\" })\n );\n };\n\n this.fromPort = params => {\n deprecated(\n \"`PDFWorker.fromPort` - please use `PDFWorker.create` instead.\"\n );\n if (!params?.port) {\n throw new Error(\"PDFWorker.fromPort - invalid method signature.\");\n }\n return this.create(params);\n };\n }\n\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) {\n this._resetGlobalState = () => {\n this.#isWorkerDisabled = false;\n delete globalThis.pdfjsWorker;\n };\n }\n }\n\n constructor({\n name = null,\n port = null,\n verbosity = getVerbosityLevel(),\n } = {}) {\n this.name = name;\n this.destroyed = false;\n this.verbosity = verbosity;\n\n if (port) {\n if (PDFWorker.#workerPorts.has(port)) {\n throw new Error(\"Cannot use more than one PDFWorker per port.\");\n }\n PDFWorker.#workerPorts.set(port, this);\n this.#initializeFromPort(port);\n } else {\n this.#initialize();\n }\n\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) {\n // For testing purposes.\n Object.defineProperty(this, \"_webWorker\", {\n get() {\n return this.#webWorker;\n },\n });\n }\n }\n\n /**\n * Promise for worker initialization completion.\n * @type {Promise<void>}\n */\n get promise() {\n return this.#capability.promise;\n }\n\n #resolve() {\n this.#capability.resolve();\n // Send global setting, e.g. verbosity level.\n this.#messageHandler.send(\"configure\", {\n verbosity: this.verbosity,\n });\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\", () => {\n // Ignoring \"ready\" event -- MessageHandler should already be initialized\n // and ready to accept messages.\n });\n this.#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.\n if (\n PDFWorker.#isWorkerDisabled ||\n PDFWorker.#mainThreadWorkerMessageHandler\n ) {\n this.#setupFakeWorker();\n return;\n }\n let { workerSrc } = PDFWorker;\n\n try {\n // Wraps workerSrc path into blob URL, if the former does not belong\n // to the same origin.\n if (\n typeof PDFJSDev !== \"undefined\" &&\n PDFJSDev.test(\"GENERIC\") &&\n !PDFWorker._isSameOrigin(window.location, workerSrc)\n ) {\n workerSrc = PDFWorker._createCDNWrapper(\n new URL(workerSrc, window.location).href\n );\n }\n\n const worker = new Worker(workerSrc, { type: \"module\" });\n const messageHandler = new MessageHandler(\"main\", \"worker\", worker);\n const terminateEarly = () => {\n ac.abort();\n messageHandler.destroy();\n worker.terminate();\n if (this.destroyed) {\n this.#capability.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 ac = new AbortController();\n worker.addEventListener(\n \"error\",\n () => {\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 { signal: ac.signal }\n );\n\n messageHandler.on(\"test\", data => {\n ac.abort();\n if (this.destroyed || !data) {\n terminateEarly();\n return;\n }\n this.#messageHandler = messageHandler;\n this.#port = worker;\n this.#webWorker = worker;\n\n this.#resolve();\n });\n\n messageHandler.on(\"ready\", data => {\n ac.abort();\n if (this.destroyed) {\n terminateEarly();\n return;\n }\n try {\n sendTest();\n } catch {\n // We need fallback to a faked worker.\n this.#setupFakeWorker();\n }\n });\n\n const sendTest = () => {\n const testObj = new Uint8Array();\n // Ensure that we can use `postMessage` transfers.\n messageHandler.send(\"test\", testObj, [testObj.buffer]);\n };\n\n // It might take time for the worker to initialize. We will try to send\n // the \"test\" message immediately, and once the \"ready\" message arrives.\n // The worker shall process only the first received \"test\" message.\n sendTest();\n return;\n } catch {\n info(\"The worker has been disabled.\");\n }\n // Either workers are not supported or have thrown an exception.\n // Thus, we fallback to a faked worker.\n this.#setupFakeWorker();\n }\n\n #setupFakeWorker() {\n if (!PDFWorker.#isWorkerDisabled) {\n warn(\"Setting up fake worker.\");\n PDFWorker.#isWorkerDisabled = true;\n }\n\n PDFWorker._setupFakeWorkerGlobal\n .then(WorkerMessageHandler => {\n if (this.destroyed) {\n this.#capability.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${PDFWorker.#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 this.#messageHandler = new MessageHandler(id, id + \"_worker\", port);\n this.#resolve();\n })\n .catch(reason => {\n this.#capability.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\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\n this.#messageHandler?.destroy();\n this.#messageHandler = null;\n }\n\n /**\n * @param {PDFWorkerParameters} params - The worker initialization parameters.\n * @returns {PDFWorker}\n */\n static create(params) {\n const cachedPort = this.#workerPorts.get(params?.port);\n if (cachedPort) {\n if (cachedPort._pendingDestroy) {\n throw new Error(\n \"PDFWorker.create - the worker is being destroyed.\\n\" +\n \"Please remember to await `PDFDocumentLoadingTask.destroy()`-calls.\"\n );\n }\n return cachedPort;\n }\n return new PDFWorker(params);\n }\n\n /**\n * The current `workerSrc`, when it exists.\n * @type {string}\n */\n static get workerSrc() {\n if (GlobalWorkerOptions.workerSrc) {\n return GlobalWorkerOptions.workerSrc;\n }\n throw new Error('No \"GlobalWorkerOptions.workerSrc\" specified.');\n }\n\n static get #mainThreadWorkerMessageHandler() {\n try {\n return globalThis.pdfjsWorker?.WorkerMessageHandler || null;\n } catch {\n return null;\n }\n }\n\n // Loads worker code into the main-thread.\n static get _setupFakeWorkerGlobal() {\n const loader = async () => {\n if (this.#mainThreadWorkerMessageHandler) {\n // The worker was already loaded using e.g. a `<script>` tag.\n return this.#mainThreadWorkerMessageHandler;\n }\n const worker =\n typeof PDFJSDev === \"undefined\"\n ? await import(\"pdfjs/pdf.worker.js\")\n : await __raw_import__(this.workerSrc);\n return worker.WorkerMessageHandler;\n };\n\n return shadow(this, \"_setupFakeWorkerGlobal\", loader());\n }\n}\n\n/**\n * For internal use only.\n * @ignore\n */\nclass WorkerTransport {\n #methodPromises = new Map();\n\n #pageCache = new Map();\n\n #pagePromises = new Map();\n\n #pageRefCache = new Map();\n\n #passwordCapability = null;\n\n constructor(\n messageHandler,\n loadingTask,\n networkStream,\n params,\n factory,\n enableHWA\n ) {\n this.messageHandler = messageHandler;\n this.loadingTask = loadingTask;\n this.commonObjs = new PDFObjects();\n this.fontLoader = new FontLoader({\n ownerDocument: params.ownerDocument,\n styleElement: params.styleElement,\n });\n this.loadingParams = params.loadingParams;\n this._params = params;\n\n this.canvasFactory = factory.canvasFactory;\n this.filterFactory = factory.filterFactory;\n this.cMapReaderFactory = factory.cMapReaderFactory;\n this.standardFontDataFactory = factory.standardFontDataFactory;\n this.wasmFactory = factory.wasmFactory;\n\n this.destroyed = false;\n this.destroyCapability = null;\n\n this._networkStream = networkStream;\n this._fullReader = null;\n this._lastProgress = null;\n this.downloadInfoCapability = Promise.withResolvers();\n this.enableHWA = enableHWA;\n\n this.setupMessageHandler();\n\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) {\n // For testing purposes.\n Object.defineProperty(this, \"getNetworkStreamName\", {\n value: () => networkStream?.constructor?.name || null,\n });\n Object.defineProperty(this, \"getXFADatasets\", {\n value: () =>\n this.messageHandler.sendWithPromise(\"GetXFADatasets\", null),\n });\n Object.defineProperty(this, \"getXRefPrevValue\", {\n value: () =>\n this.messageHandler.sendWithPromise(\"GetXRefPrevValue\", null),\n });\n Object.defineProperty(this, \"getStartXRefPos\", {\n value: () =>\n this.messageHandler.sendWithPromise(\"GetStartXRefPos\", null),\n });\n Object.defineProperty(this, \"getAnnotArray\", {\n value: pageIndex =>\n this.messageHandler.sendWithPromise(\"GetAnnotArray\", { pageIndex }),\n });\n }\n }\n\n #cacheSimpleMethod(name, data = null) {\n const cachedPromise = this.#methodPromises.get(name);\n if (cachedPromise) {\n return cachedPromise;\n }\n const promise = this.messageHandler.sendWithPromise(name, data);\n\n this.#methodPromises.set(name, promise);\n return promise;\n }\n\n get annotationStorage() {\n return shadow(this, \"annotationStorage\", new AnnotationStorage());\n }\n\n getRenderingIntent(\n intent,\n annotationMode = AnnotationMode.ENABLE,\n printAnnotationStorage = null,\n isEditing = false,\n isOpList = false\n ) {\n let renderingIntent = RenderingIntentFlag.DISPLAY; // Default value.\n let annotationStorageSerializable = SerializableEmpty;\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 const annotationStorage =\n renderingIntent & RenderingIntentFlag.PRINT &&\n printAnnotationStorage instanceof PrintAnnotationStorage\n ? printAnnotationStorage\n : this.annotationStorage;\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 annotationStorageSerializable = annotationStorage.serializable;\n break;\n default:\n warn(`getRenderingIntent - invalid annotationMode: ${annotationMode}`);\n }\n\n if (isEditing) {\n renderingIntent += RenderingIntentFlag.IS_EDITING;\n }\n if (isOpList) {\n renderingIntent += RenderingIntentFlag.OPLIST;\n }\n\n const { ids: modifiedIds, hash: modifiedIdsHash } =\n annotationStorage.modifiedIds;\n\n const cacheKeyBuf = [\n renderingIntent,\n annotationStorageSerializable.hash,\n modifiedIdsHash,\n ];\n\n return {\n renderingIntent,\n cacheKey: cacheKeyBuf.join(\"_\"),\n annotationStorageSerializable,\n modifiedIds,\n };\n }\n\n destroy() {\n if (this.destroyCapability) {\n return this.destroyCapability.promise;\n }\n\n this.destroyed = true;\n this.destroyCapability = Promise.withResolvers();\n\n this.#passwordCapability?.reject(\n new Error(\"Worker was destroyed during onPassword callback\")\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 this.#pageRefCache.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.#methodPromises.clear();\n this.filterFactory.destroy();\n TextLayer.cleanup();\n\n this._networkStream?.cancelAllRequests(\n new AbortException(\"Worker was terminated.\")\n );\n\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 value instanceof ArrayBuffer,\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\", async data => {\n await this._fullReader.headersReady;\n\n const { isStreamingSupported, isRangeSupported, contentLength } =\n this._fullReader;\n\n // If stream or range are disabled, it's our only way to report\n // loading progress.\n if (!isStreamingSupported || !isRangeSupported) {\n if (this._lastProgress) {\n loadingTask.onProgress?.(this._lastProgress);\n }\n this._fullReader.onProgress = evt => {\n loadingTask.onProgress?.({\n loaded: evt.loaded,\n total: evt.total,\n });\n };\n }\n\n return { isStreamingSupported, isRangeSupported, contentLength };\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 value instanceof ArrayBuffer,\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\", ex => {\n loadingTask._capability.reject(wrapReason(ex));\n });\n\n messageHandler.on(\"PasswordRequest\", ex => {\n this.#passwordCapability = Promise.withResolvers();\n\n try {\n if (!loadingTask.onPassword) {\n throw wrapReason(ex);\n }\n\n const updatePassword = password => {\n if (password instanceof Error) {\n this.#passwordCapability.reject(password);\n } else {\n this.#passwordCapability.resolve({ password });\n }\n };\n loadingTask.onPassword(updatePassword, ex.code);\n } catch (err) {\n this.#passwordCapability.reject(err);\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 null; // Ignore any pending requests if the worker was terminated.\n }\n\n if (this.commonObjs.has(id)) {\n return null;\n }\n\n switch (type) {\n case \"Font\":\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 const inspectFont =\n this._params.pdfBug && globalThis.FontInspector?.enabled\n ? (font, url) => globalThis.FontInspector.fontAdded(font, url)\n : null;\n const font = new FontFaceObject(exportedData, inspectFont);\n\n this.fontLoader\n .bind(font)\n .catch(() => messageHandler.sendWithPromise(\"FontFallback\", { id }))\n .finally(() => {\n if (!font.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 \"CopyLocalImage\":\n const { imageRef } = exportedData;\n assert(imageRef, \"The imageRef must be defined.\");\n\n for (const pageProxy of this.#pageCache.values()) {\n for (const [, data] of pageProxy.objs) {\n if (data?.ref !== imageRef) {\n continue;\n }\n if (!data.dataLen) {\n return null;\n }\n this.commonObjs.resolve(id, structuredClone(data));\n return data.dataLen;\n }\n }\n break;\n case \"FontPath\":\n case \"Image\":\n case \"Pattern\":\n this.commonObjs.resolve(id, exportedData);\n break;\n default:\n throw new Error(`Got unknown common object type ${type}`);\n }\n\n return null;\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 // Don't store data *after* cleanup has successfully run, see bug 1854145.\n if (pageProxy._intentStates.size === 0) {\n imageData?.bitmap?.close(); // Release any `ImageBitmap` data.\n return;\n }\n\n switch (type) {\n case \"Image\":\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(\"FetchBinaryData\", async data => {\n if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) {\n throw new Error(\"Not implemented: FetchBinaryData\");\n }\n if (this.destroyed) {\n throw new Error(\"Worker was destroyed.\");\n }\n const factory = this[data.type];\n\n if (!factory) {\n throw new Error(\n `${data.type} not initialized, see the \\`useWorkerFetch\\` parameter.`\n );\n }\n return factory.fetch(data);\n });\n }\n\n getData() {\n return this.messageHandler.sendWithPromise(\"GetData\", null);\n }\n\n saveDocument() {\n if (this.annotationStorage.size <= 0) {\n warn(\n \"saveDocument called while `annotationStorage` is empty, \" +\n \"please use the getData-method instead.\"\n );\n }\n const { map, transfer } = this.annotationStorage.serializable;\n\n return this.messageHandler\n .sendWithPromise(\n \"SaveDocument\",\n {\n isPureXfa: !!this._htmlForXfa,\n numPages: this._numPages,\n annotationStorage: map,\n filename: this._fullReader?.filename ?? null,\n },\n transfer\n )\n .finally(() => {\n this.annotationStorage.resetModified();\n });\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 if (pageInfo.refStr) {\n this.#pageRefCache.set(pageInfo.refStr, pageNumber);\n }\n\n const page = new PDFPageProxy(\n pageIndex,\n pageInfo,\n this,\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 (!isRefProxy(ref)) {\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 getFieldObjects() {\n return this.#cacheSimpleMethod(\"GetFieldObjects\");\n }\n\n hasJSActions() {\n return this.#cacheSimpleMethod(\"HasJSActions\");\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 getAnnotationsByType(types, pageIndexesToSkip) {\n return this.messageHandler.sendWithPromise(\"GetAnnotationsByType\", {\n types,\n pageIndexesToSkip,\n });\n }\n\n getDocJSActions() {\n return this.#cacheSimpleMethod(\"GetDocJSActions\");\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(renderingIntent) {\n return this.#cacheSimpleMethod(\"GetOptionalContentConfig\").then(\n data => new OptionalContentConfig(data, renderingIntent)\n );\n }\n\n getPermissions() {\n return this.messageHandler.sendWithPromise(\"GetPermissions\", null);\n }\n\n getMetadata() {\n const name = \"GetMetadata\",\n cachedPromise = this.#methodPromises.get(name);\n if (cachedPromise) {\n return cachedPromise;\n }\n const promise = this.messageHandler\n .sendWithPromise(name, null)\n .then(results => ({\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 this.#methodPromises.set(name, promise);\n return promise;\n }\n\n getMarkInfo() {\n return this.messageHandler.sendWithPromise(\"GetMarkInfo\", null);\n }\n\n async startCleanup(keepLoadedFonts = false) {\n if (this.destroyed) {\n return; // No need to manually clean-up when destruction has started.\n }\n await this.messageHandler.sendWithPromise(\"Cleanup\", null);\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.#methodPromises.clear();\n this.filterFactory.destroy(/* keepHCM = */ true);\n TextLayer.cleanup();\n }\n\n cachedPageNumber(ref) {\n if (!isRefProxy(ref)) {\n return null;\n }\n const refStr = ref.gen === 0 ? `${ref.num}R` : `${ref.num}R${ref.gen}`;\n return this.#pageRefCache.get(refStr) ?? null;\n }\n}\n\n/**\n * Allows controlling of the rendering tasks.\n */\nclass RenderTask {\n #internalRenderTask = null;\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 onContinue = null;\n\n /**\n * A function that will be synchronously called when the rendering tasks\n * finishes with an error (either because of an actual error, or because the\n * rendering is cancelled).\n *\n * @type {function}\n * @param {Error} error\n */\n onError = null;\n\n constructor(internalRenderTask) {\n this.#internalRenderTask = internalRenderTask;\n\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) {\n // For testing purposes.\n Object.defineProperty(this, \"getOperatorList\", {\n value: () => this.#internalRenderTask.operatorList,\n });\n }\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 * @param {number} [extraDelay]\n */\n cancel(extraDelay = 0) {\n this.#internalRenderTask.cancel(/* error = */ null, extraDelay);\n }\n\n /**\n * Whether form fields are rendered separately from the main operatorList.\n * @type {boolean}\n */\n get separateAnnots() {\n const { separateAnnots } = this.#internalRenderTask.operatorList;\n if (!separateAnnots) {\n return false;\n }\n const { annotationCanvasMap } = this.#internalRenderTask;\n return (\n separateAnnots.form ||\n (separateAnnots.canvas && annotationCanvasMap?.size > 0)\n );\n }\n}\n\n/**\n * For internal use only.\n * @ignore\n */\nclass InternalRenderTask {\n #rAF = null;\n\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 filterFactory,\n useRequestAnimationFrame = false,\n pdfBug = false,\n pageColors = null,\n enableHWA = false,\n filteredOperationIndexes = 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.filterFactory = filterFactory;\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 = Promise.withResolvers();\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.canvas;\n this._canvasContext = params.canvas ? null : params.canvasContext;\n this._enableHWA = enableHWA;\n this._dependencyTracker = params.dependencyTracker;\n this._filteredOperationIndexes = filteredOperationIndexes;\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 { viewport, transform, background, dependencyTracker } = this.params;\n\n // When printing in Firefox, we get a specific context in mozPrintCallback\n // which cannot be created from the canvas itself.\n const canvasContext =\n this._canvasContext ||\n this._canvas.getContext(\"2d\", {\n alpha: false,\n willReadFrequently: !this._enableHWA,\n });\n\n this.gfx = new CanvasGraphics(\n canvasContext,\n this.commonObjs,\n this.objs,\n this.canvasFactory,\n this.filterFactory,\n { optionalContentConfig },\n this.annotationCanvasMap,\n this.pageColors,\n dependencyTracker\n );\n this.gfx.beginDrawing({\n transform,\n viewport,\n transparency,\n background,\n });\n this.operatorListIdx = 0;\n this.graphicsReady = true;\n this.graphicsReadyCallback?.();\n }\n\n cancel(error = null, extraDelay = 0) {\n this.running = false;\n this.cancelled = true;\n this.gfx?.endDrawing();\n if (this.#rAF) {\n window.cancelAnimationFrame(this.#rAF);\n this.#rAF = null;\n }\n InternalRenderTask.#canvasInUse.delete(this._canvas);\n\n error ||= new RenderingCancelledException(\n `Rendering cancelled, page ${this._pageIndex + 1}`,\n extraDelay\n );\n this.callback(error);\n\n this.task.onError?.(error);\n }\n\n operatorListChanged() {\n if (!this.graphicsReady) {\n this.graphicsReadyCallback ||= this._continueBound;\n return;\n }\n this.stepper?.updateOperatorList(this.operatorList);\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 this.#rAF = window.requestAnimationFrame(() => {\n this.#rAF = null;\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 this._filteredOperationIndexes\n );\n if (this.operatorListIdx === this.operatorList.argsArray.length) {\n this.running = false;\n if (this.operatorList.lastChunk) {\n this.gfx.endDrawing();\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 getDocument,\n PDFDataRangeTransport,\n PDFDocumentLoadingTask,\n PDFDocumentProxy,\n PDFPageProxy,\n PDFWorker,\n RenderTask,\n version,\n};\n","/* Copyright 2023 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { AnnotationEditorParamsType, shadow } from \"../../shared/util.js\";\nimport { KeyboardManager } from \"./tools.js\";\nimport { noContextMenu } from \"../display_utils.js\";\n\n/**\n * ColorPicker class provides a color picker for the annotation editor.\n * It displays a dropdown with some predefined colors and allows the user\n * to select a color for the annotation.\n */\nclass ColorPicker {\n #button = null;\n\n #buttonSwatch = null;\n\n #defaultColor;\n\n #dropdown = null;\n\n #dropdownWasFromKeyboard = false;\n\n #isMainColorPicker = false;\n\n #editor = null;\n\n #eventBus;\n\n #openDropdownAC = null;\n\n #uiManager = null;\n\n static #l10nColor = null;\n\n static get _keyboardManager() {\n return shadow(\n this,\n \"_keyboardManager\",\n new KeyboardManager([\n [\n [\"Escape\", \"mac+Escape\"],\n ColorPicker.prototype._hideDropdownFromKeyboard,\n ],\n [[\" \", \"mac+ \"], ColorPicker.prototype._colorSelectFromKeyboard],\n [\n [\"ArrowDown\", \"ArrowRight\", \"mac+ArrowDown\", \"mac+ArrowRight\"],\n ColorPicker.prototype._moveToNext,\n ],\n [\n [\"ArrowUp\", \"ArrowLeft\", \"mac+ArrowUp\", \"mac+ArrowLeft\"],\n ColorPicker.prototype._moveToPrevious,\n ],\n [[\"Home\", \"mac+Home\"], ColorPicker.prototype._moveToBeginning],\n [[\"End\", \"mac+End\"], ColorPicker.prototype._moveToEnd],\n ])\n );\n }\n\n constructor({ editor = null, uiManager = null }) {\n if (editor) {\n this.#isMainColorPicker = false;\n this.#editor = editor;\n } else {\n this.#isMainColorPicker = true;\n }\n this.#uiManager = editor?._uiManager || uiManager;\n this.#eventBus = this.#uiManager._eventBus;\n this.#defaultColor =\n editor?.color?.toUpperCase() ||\n this.#uiManager?.highlightColors.values().next().value ||\n \"#FFFF98\";\n\n ColorPicker.#l10nColor ||= Object.freeze({\n blue: \"pdfjs-editor-colorpicker-blue\",\n green: \"pdfjs-editor-colorpicker-green\",\n pink: \"pdfjs-editor-colorpicker-pink\",\n red: \"pdfjs-editor-colorpicker-red\",\n yellow: \"pdfjs-editor-colorpicker-yellow\",\n });\n }\n\n renderButton() {\n const button = (this.#button = document.createElement(\"button\"));\n button.className = \"colorPicker\";\n button.tabIndex = \"0\";\n button.setAttribute(\"data-l10n-id\", \"pdfjs-editor-colorpicker-button\");\n button.ariaHasPopup = \"true\";\n if (this.#editor) {\n button.ariaControls = `${this.#editor.id}_colorpicker_dropdown`;\n }\n const signal = this.#uiManager._signal;\n button.addEventListener(\"click\", this.#openDropdown.bind(this), { signal });\n button.addEventListener(\"keydown\", this.#keyDown.bind(this), { signal });\n const swatch = (this.#buttonSwatch = document.createElement(\"span\"));\n swatch.className = \"swatch\";\n swatch.ariaHidden = \"true\";\n swatch.style.backgroundColor = this.#defaultColor;\n button.append(swatch);\n return button;\n }\n\n renderMainDropdown() {\n const dropdown = (this.#dropdown = this.#getDropdownRoot());\n dropdown.ariaOrientation = \"horizontal\";\n dropdown.ariaLabelledBy = \"highlightColorPickerLabel\";\n\n return dropdown;\n }\n\n #getDropdownRoot() {\n const div = document.createElement(\"div\");\n const signal = this.#uiManager._signal;\n div.addEventListener(\"contextmenu\", noContextMenu, { signal });\n div.className = \"dropdown\";\n div.role = \"listbox\";\n div.ariaMultiSelectable = \"false\";\n div.ariaOrientation = \"vertical\";\n div.setAttribute(\"data-l10n-id\", \"pdfjs-editor-colorpicker-dropdown\");\n if (this.#editor) {\n div.id = `${this.#editor.id}_colorpicker_dropdown`;\n }\n for (const [name, color] of this.#uiManager.highlightColors) {\n const button = document.createElement(\"button\");\n button.tabIndex = \"0\";\n button.role = \"option\";\n button.setAttribute(\"data-color\", color);\n button.title = name;\n button.setAttribute(\"data-l10n-id\", ColorPicker.#l10nColor[name]);\n const swatch = document.createElement(\"span\");\n button.append(swatch);\n swatch.className = \"swatch\";\n swatch.style.backgroundColor = color;\n button.ariaSelected = color === this.#defaultColor;\n button.addEventListener(\"click\", this.#colorSelect.bind(this, color), {\n signal,\n });\n div.append(button);\n }\n\n div.addEventListener(\"keydown\", this.#keyDown.bind(this), { signal });\n\n return div;\n }\n\n #colorSelect(color, event) {\n event.stopPropagation();\n this.#eventBus.dispatch(\"switchannotationeditorparams\", {\n source: this,\n type: AnnotationEditorParamsType.HIGHLIGHT_COLOR,\n value: color,\n });\n this.updateColor(color);\n }\n\n _colorSelectFromKeyboard(event) {\n if (event.target === this.#button) {\n this.#openDropdown(event);\n return;\n }\n const color = event.target.getAttribute(\"data-color\");\n if (!color) {\n return;\n }\n this.#colorSelect(color, event);\n }\n\n _moveToNext(event) {\n if (!this.#isDropdownVisible) {\n this.#openDropdown(event);\n return;\n }\n if (event.target === this.#button) {\n this.#dropdown.firstChild?.focus();\n return;\n }\n event.target.nextSibling?.focus();\n }\n\n _moveToPrevious(event) {\n if (\n event.target === this.#dropdown?.firstChild ||\n event.target === this.#button\n ) {\n if (this.#isDropdownVisible) {\n this._hideDropdownFromKeyboard();\n }\n return;\n }\n if (!this.#isDropdownVisible) {\n this.#openDropdown(event);\n }\n event.target.previousSibling?.focus();\n }\n\n _moveToBeginning(event) {\n if (!this.#isDropdownVisible) {\n this.#openDropdown(event);\n return;\n }\n this.#dropdown.firstChild?.focus();\n }\n\n _moveToEnd(event) {\n if (!this.#isDropdownVisible) {\n this.#openDropdown(event);\n return;\n }\n this.#dropdown.lastChild?.focus();\n }\n\n #keyDown(event) {\n ColorPicker._keyboardManager.exec(this, event);\n }\n\n #openDropdown(event) {\n if (this.#isDropdownVisible) {\n this.hideDropdown();\n return;\n }\n this.#dropdownWasFromKeyboard = event.detail === 0;\n\n if (!this.#openDropdownAC) {\n this.#openDropdownAC = new AbortController();\n\n window.addEventListener(\"pointerdown\", this.#pointerDown.bind(this), {\n signal: this.#uiManager.combinedSignal(this.#openDropdownAC),\n });\n }\n this.#button.ariaExpanded = \"true\";\n if (this.#dropdown) {\n this.#dropdown.classList.remove(\"hidden\");\n return;\n }\n const root = (this.#dropdown = this.#getDropdownRoot());\n this.#button.append(root);\n }\n\n #pointerDown(event) {\n if (this.#dropdown?.contains(event.target)) {\n return;\n }\n this.hideDropdown();\n }\n\n hideDropdown() {\n this.#dropdown?.classList.add(\"hidden\");\n this.#button.ariaExpanded = \"false\";\n this.#openDropdownAC?.abort();\n this.#openDropdownAC = null;\n }\n\n get #isDropdownVisible() {\n return this.#dropdown && !this.#dropdown.classList.contains(\"hidden\");\n }\n\n _hideDropdownFromKeyboard() {\n if (this.#isMainColorPicker) {\n return;\n }\n if (!this.#isDropdownVisible) {\n // The user pressed Escape with no dropdown visible, so we must\n // unselect it.\n this.#editor?.unselect();\n return;\n }\n this.hideDropdown();\n this.#button.focus({\n preventScroll: true,\n focusVisible: this.#dropdownWasFromKeyboard,\n });\n }\n\n updateColor(color) {\n if (this.#buttonSwatch) {\n this.#buttonSwatch.style.backgroundColor = color;\n }\n if (!this.#dropdown) {\n return;\n }\n\n const i = this.#uiManager.highlightColors.values();\n for (const child of this.#dropdown.children) {\n child.ariaSelected = i.next().value === color.toUpperCase();\n }\n }\n\n destroy() {\n this.#button?.remove();\n this.#button = null;\n this.#buttonSwatch = null;\n this.#dropdown?.remove();\n this.#dropdown = null;\n }\n}\n\n/**\n * BasicColorPicker class provides a simple color picker.\n * It displays an input element (with type=\"color\") that allows the user\n * to select a color for the annotation.\n */\nclass BasicColorPicker {\n #input = null;\n\n #editor = null;\n\n #uiManager = null;\n\n static #l10nColor = null;\n\n constructor(editor) {\n this.#editor = editor;\n this.#uiManager = editor._uiManager;\n\n BasicColorPicker.#l10nColor ||= Object.freeze({\n freetext: \"pdfjs-editor-color-picker-free-text-input\",\n ink: \"pdfjs-editor-color-picker-ink-input\",\n });\n }\n\n renderButton() {\n if (this.#input) {\n return this.#input;\n }\n const { editorType, colorType, colorValue } = this.#editor;\n const input = (this.#input = document.createElement(\"input\"));\n input.type = \"color\";\n input.value = colorValue || \"#000000\";\n input.className = \"basicColorPicker\";\n input.tabIndex = 0;\n input.setAttribute(\"data-l10n-id\", BasicColorPicker.#l10nColor[editorType]);\n input.addEventListener(\n \"input\",\n () => {\n this.#uiManager.updateParams(colorType, input.value);\n },\n { signal: this.#uiManager._signal }\n );\n return input;\n }\n\n update(value) {\n if (!this.#input) {\n return;\n }\n this.#input.value = value;\n }\n\n destroy() {\n this.#input?.remove();\n this.#input = null;\n }\n\n hideDropdown() {}\n}\n\nexport { BasicColorPicker, ColorPicker };\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\nfunction scaleAndClamp(x) {\n return Math.max(0, Math.min(255, 255 * x));\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_rgb([g]) {\n g = scaleAndClamp(g);\n return [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_rgb(color) {\n return color.map(scaleAndClamp);\n }\n\n static RGB_HTML(color) {\n return `#${color.map(makeColorComp).join(\"\")}`;\n }\n\n static T_HTML() {\n return \"#00000000\";\n }\n\n static T_rgb() {\n return [null];\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_rgb([c, y, m, k]) {\n return [\n scaleAndClamp(1 - Math.min(1, c + k)),\n scaleAndClamp(1 - Math.min(1, m + k)),\n scaleAndClamp(1 - Math.min(1, y + k)),\n ];\n }\n\n static CMYK_HTML(components) {\n const rgb = this.CMYK_RGB(components).slice(1);\n return this.RGB_HTML(rgb);\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\nconst DateFormats = [\n \"m/d\",\n \"m/d/yy\",\n \"mm/dd/yy\",\n \"mm/yy\",\n \"d-mmm\",\n \"d-mmm-yy\",\n \"dd-mmm-yy\",\n \"yy-mm-dd\",\n \"mmm-yy\",\n \"mmmm-yy\",\n \"mmm d, yyyy\",\n \"mmmm d, yyyy\",\n \"m/d/yy h:MM tt\",\n \"m/d/yy HH:MM\",\n];\nconst TimeFormats = [\"HH:MM\", \"h:MM tt\", \"HH:MM:ss\", \"h:MM:ss tt\"];\n\nexport { ColorConverters, DateFormats, TimeFormats };\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 { SVG_NS } from \"./display_utils.js\";\nimport { unreachable } from \"../shared/util.js\";\n\nclass BaseSVGFactory {\n constructor() {\n if (\n (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) &&\n this.constructor === BaseSVGFactory\n ) {\n unreachable(\"Cannot initialize BaseSVGFactory.\");\n }\n }\n\n create(width, height, skipDimensions = false) {\n if (width <= 0 || height <= 0) {\n throw new Error(\"Invalid SVG dimensions\");\n }\n const svg = this._createSVG(\"svg:svg\");\n svg.setAttribute(\"version\", \"1.1\");\n\n if (!skipDimensions) {\n svg.setAttribute(\"width\", `${width}px`);\n svg.setAttribute(\"height\", `${height}px`);\n }\n\n svg.setAttribute(\"preserveAspectRatio\", \"none\");\n svg.setAttribute(\"viewBox\", `0 0 ${width} ${height}`);\n\n return svg;\n }\n\n createElement(type) {\n if (typeof type !== \"string\") {\n throw new Error(\"Invalid SVG element type\");\n }\n return this._createSVG(type);\n }\n\n /**\n * @ignore\n */\n _createSVG(type) {\n unreachable(\"Abstract method `_createSVG` called.\");\n }\n}\n\nclass DOMSVGFactory extends BaseSVGFactory {\n /**\n * @ignore\n */\n _createSVG(type) {\n return document.createElementNS(SVG_NS, type);\n }\n}\n\nexport { BaseSVGFactory, DOMSVGFactory };\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// eslint-disable-next-line max-len\n/** @typedef {import(\"./annotation_storage\").AnnotationStorage} AnnotationStorage */\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 html.setAttribute(\"value\", storedData.value);\n for (const option of element.children) {\n if (option.attributes.value === storedData.value) {\n option.attributes.selected = true;\n } else if (option.attributes.hasOwnProperty(\"selected\")) {\n delete option.attributes.selected;\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 if (value === null || value === undefined) {\n continue;\n }\n\n switch (key) {\n case \"class\":\n if (value.length) {\n html.setAttribute(key, value.join(\" \"));\n }\n break;\n case \"dataId\":\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 break;\n case \"id\":\n html.setAttribute(\"data-element-id\", value);\n break;\n case \"style\":\n Object.assign(html.style, value);\n break;\n case \"textContent\":\n html.textContent = value;\n break;\n default:\n if (!isHTMLAnchorElement || (key !== \"href\" && key !== \"newWindow\")) {\n html.setAttribute(key, value);\n }\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 to overwrite 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\n const isNotForRichText = intent !== \"richText\";\n const rootDiv = parameters.div;\n rootDiv.append(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 (isNotForRichText) {\n rootDiv.setAttribute(\"class\", \"xfaLayer xfaFont\");\n }\n\n // Text nodes used for the text highlighter.\n const textDivs = [];\n\n // In the rich text context, it's possible to just have a text node without\n // a root element, so we handle this case here (see issue 17215).\n if (root.children.length === 0) {\n if (root.value) {\n const node = document.createTextNode(root.value);\n rootHtml.append(node);\n if (isNotForRichText && XfaText.shouldBuildText(root.name)) {\n textDivs.push(node);\n }\n }\n return { textDivs };\n }\n\n const stack = [[root, -1, rootHtml]];\n\n while (stack.length > 0) {\n const [parent, i, html] = stack.at(-1);\n if (i + 1 === parent.children.length) {\n stack.pop();\n continue;\n }\n\n const child = parent.children[++stack.at(-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.append(node);\n continue;\n }\n\n const childHtml = child?.attributes?.xmlns\n ? document.createElementNS(child.attributes.xmlns, name)\n : document.createElement(name);\n\n html.append(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?.length > 0) {\n stack.push([child, -1, childHtml]);\n } else if (child.value) {\n const node = document.createTextNode(child.value);\n if (isNotForRichText && XfaText.shouldBuildText(name)) {\n textDivs.push(node);\n }\n childHtml.append(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 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// eslint-disable-next-line max-len\n/** @typedef {import(\"../../web/text_accessibility.js\").TextAccessibilityManager} TextAccessibilityManager */\n// eslint-disable-next-line max-len\n/** @typedef {import(\"../../web/interfaces\").IDownloadManager} IDownloadManager */\n/** @typedef {import(\"../../web/interfaces\").IPDFLinkService} IPDFLinkService */\n// eslint-disable-next-line max-len\n/** @typedef {import(\"../src/display/editor/tools.js\").AnnotationEditorUIManager} AnnotationEditorUIManager */\n// eslint-disable-next-line max-len\n/** @typedef {import(\"../../web/struct_tree_layer_builder.js\").StructTreeLayerBuilder} StructTreeLayerBuilder */\n\nimport {\n AnnotationBorderStyleType,\n AnnotationEditorType,\n AnnotationPrefix,\n AnnotationType,\n FeatureTest,\n LINE_FACTOR,\n shadow,\n unreachable,\n Util,\n warn,\n} from \"../shared/util.js\";\nimport { PDFDateString, setLayerDimensions } from \"./display_utils.js\";\nimport { AnnotationStorage } from \"./annotation_storage.js\";\nimport { ColorConverters } from \"../shared/scripting_utils.js\";\nimport { DOMSVGFactory } from \"./svg_factory.js\";\nimport { XfaLayer } from \"./xfa_layer.js\";\n\nconst DEFAULT_FONT_SIZE = 9;\nconst GetElementsByNameSet = new WeakSet();\nconst TIMEZONE_OFFSET = new Date().getTimezoneOffset() * 60 * 1000;\n\n/**\n * @typedef {Object} AnnotationElementParameters\n * @property {Object} data\n * @property {HTMLDivElement} layer\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 */\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 case \"Sig\":\n return new SignatureWidgetAnnotationElement(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 #updates = null;\n\n #hasBorder = false;\n\n #popupElement = null;\n\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.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.enableComment = parameters.enableComment;\n this.enableScripting = parameters.enableScripting;\n this.hasJSActions = parameters.hasJSActions;\n this._fieldObjects = parameters.fieldObjects;\n this.parent = parameters.parent;\n\n if (isRenderable) {\n this.container = this._createContainer(ignoreBorder);\n }\n if (createQuadrilaterals) {\n this._createQuadrilaterals();\n }\n }\n\n static _hasPopupData({ contentsObj, richText }) {\n return !!(contentsObj?.str || richText?.str);\n }\n\n get _isEditable() {\n return this.data.isEditable;\n }\n\n get hasPopupData() {\n return AnnotationElement._hasPopupData(this.data);\n }\n\n get hasCommentButton() {\n return this.enableComment && this._isEditable && this.hasPopupElement;\n }\n\n get commentButtonPosition() {\n const { quadPoints, rect } = this.data;\n let maxX = -Infinity;\n let maxY = -Infinity;\n if (quadPoints?.length >= 8) {\n for (let i = 0; i < quadPoints.length; i += 8) {\n if (quadPoints[i + 1] > maxY) {\n maxY = quadPoints[i + 1];\n maxX = quadPoints[i + 2];\n } else if (quadPoints[i + 1] === maxY) {\n maxX = Math.max(maxX, quadPoints[i + 2]);\n }\n }\n return [maxX, maxY];\n }\n if (rect) {\n return [rect[2], rect[3]];\n }\n return null;\n }\n\n get commentButtonColor() {\n if (!this.data.color) {\n return null;\n }\n const [r, g, b] = this.data.color;\n const opacity = this.data.opacity ?? 1;\n const oppositeOpacity = 255 * (1 - opacity);\n\n return this.#changeLightness(\n Math.min(r + oppositeOpacity, 255),\n Math.min(g + oppositeOpacity, 255),\n Math.min(b + oppositeOpacity, 255)\n );\n }\n\n #changeLightness(r, g, b) {\n r /= 255;\n g /= 255;\n b /= 255;\n\n const max = Math.max(r, g, b);\n const min = Math.min(r, g, b);\n const l = (max + min) / 2;\n const newL = (((1 + Math.sqrt(l)) / 2) * 100).toFixed(2);\n\n if (max === min) {\n // gray\n return `hsl(0, 0%, ${newL}%)`;\n }\n\n const d = max - min;\n\n // hue (branch on max only; avoids mod)\n let h;\n if (max === r) {\n h = (g - b) / d + (g < b ? 6 : 0);\n } else if (max === g) {\n h = (b - r) / d + 2;\n } else {\n // max === b\n h = (r - g) / d + 4;\n }\n h = (h * 60).toFixed(2);\n const s = ((d / (1 - Math.abs(2 * l - 1))) * 100).toFixed(2);\n\n return `hsl(${h}, ${s}%, ${newL}%)`;\n }\n\n _normalizePoint(point) {\n const {\n page: { view },\n viewport: {\n rawDims: { pageWidth, pageHeight, pageX, pageY },\n },\n } = this.parent;\n point[1] = view[3] - point[1] + view[1];\n point[0] = (100 * (point[0] - pageX)) / pageWidth;\n point[1] = (100 * (point[1] - pageY)) / pageHeight;\n return point;\n }\n\n updateEdited(params) {\n if (!this.container) {\n return;\n }\n\n if (params.rect) {\n this.#updates ||= {\n rect: this.data.rect.slice(0),\n };\n }\n\n const { rect, popup: newPopup } = params;\n\n if (rect) {\n this.#setRectEdited(rect);\n }\n\n let popup = this.#popupElement?.popup || this.popup;\n if (!popup && newPopup?.text) {\n this._createPopup(newPopup);\n popup = this.#popupElement.popup;\n }\n if (!popup) {\n return;\n }\n popup.updateEdited(params);\n if (newPopup?.deleted) {\n popup.remove();\n this.#popupElement = null;\n this.popup = null;\n }\n }\n\n resetEdited() {\n if (!this.#updates) {\n return;\n }\n this.#setRectEdited(this.#updates.rect);\n this.#popupElement?.popup.resetEdited();\n this.#updates = null;\n }\n\n #setRectEdited(rect) {\n const {\n container: { style },\n data: { rect: currentRect, rotation },\n parent: {\n viewport: {\n rawDims: { pageWidth, pageHeight, pageX, pageY },\n },\n },\n } = this;\n currentRect?.splice(0, 4, ...rect);\n style.left = `${(100 * (rect[0] - pageX)) / pageWidth}%`;\n style.top = `${(100 * (pageHeight - rect[3] + pageY)) / pageHeight}%`;\n if (rotation === 0) {\n style.width = `${(100 * /* width = */ (rect[2] - rect[0])) / pageWidth}%`;\n style.height = `${(100 * /* height = */ (rect[3] - rect[1])) / pageHeight}%`;\n } else {\n this.setRotation(rotation);\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 {HTMLElement} A section element.\n */\n _createContainer(ignoreBorder) {\n const {\n data,\n parent: { page, viewport },\n } = this;\n\n const container = document.createElement(\"section\");\n container.setAttribute(\"data-annotation-id\", data.id);\n if (\n !(this instanceof WidgetAnnotationElement) &&\n !(this instanceof LinkAnnotationElement)\n ) {\n container.tabIndex = 0;\n }\n const { style } = container;\n\n // The accessibility manager will move the annotation in the DOM in\n // order to match the visual ordering.\n // But if an annotation is above an other one, then we must draw it\n // after the other one whatever the order is in the DOM, hence the\n // use of the z-index.\n style.zIndex = this.parent.zIndex;\n // Keep zIndex + 1 for stuff we want to add on top of this annotation.\n this.parent.zIndex += 2;\n\n if (data.alternativeText) {\n container.title = data.alternativeText;\n }\n\n if (data.noRotate) {\n container.classList.add(\"norotate\");\n }\n\n if (!data.rect || this instanceof PopupAnnotationElement) {\n const { rotation } = data;\n if (!data.hasOwnCanvas && rotation !== 0) {\n this.setRotation(rotation, container);\n }\n return container;\n }\n const { width, height } = this;\n\n if (!ignoreBorder && data.borderStyle.width > 0) {\n style.borderWidth = `${data.borderStyle.width}px`;\n\n const horizontalRadius = data.borderStyle.horizontalCornerRadius;\n const verticalRadius = data.borderStyle.verticalCornerRadius;\n if (horizontalRadius > 0 || verticalRadius > 0) {\n const radius = `calc(${horizontalRadius}px * var(--total-scale-factor)) / calc(${verticalRadius}px * var(--total-scale-factor))`;\n style.borderRadius = radius;\n } else if (this instanceof RadioButtonWidgetAnnotationElement) {\n const radius = `calc(${width}px * var(--total-scale-factor)) / calc(${height}px * var(--total-scale-factor))`;\n style.borderRadius = radius;\n }\n\n switch (data.borderStyle.style) {\n case AnnotationBorderStyleType.SOLID:\n style.borderStyle = \"solid\";\n break;\n\n case AnnotationBorderStyleType.DASHED:\n 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 style.borderBottomStyle = \"solid\";\n break;\n\n default:\n break;\n }\n\n const borderColor = data.borderColor || null;\n if (borderColor) {\n this.#hasBorder = true;\n style.borderColor = Util.makeHexColor(\n borderColor[0] | 0,\n borderColor[1] | 0,\n borderColor[2] | 0\n );\n } else {\n // Transparent (invisible) border, so do not draw it at all.\n style.borderWidth = 0;\n }\n }\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 const { pageWidth, pageHeight, pageX, pageY } = viewport.rawDims;\n\n style.left = `${(100 * (rect[0] - pageX)) / pageWidth}%`;\n style.top = `${(100 * (rect[1] - pageY)) / pageHeight}%`;\n\n const { rotation } = data;\n if (data.hasOwnCanvas || rotation === 0) {\n style.width = `${(100 * width) / pageWidth}%`;\n style.height = `${(100 * height) / pageHeight}%`;\n } else {\n this.setRotation(rotation, container);\n }\n\n return container;\n }\n\n setRotation(angle, container = this.container) {\n if (!this.data.rect) {\n return;\n }\n const { pageWidth, pageHeight } = this.parent.viewport.rawDims;\n let { width, height } = this;\n\n if (angle % 180 !== 0) {\n [width, height] = [height, width];\n }\n container.style.width = `${(100 * width) / pageWidth}%`;\n container.style.height = `${(100 * height) / pageHeight}%`;\n\n container.setAttribute(\"data-main-rotation\", (360 - angle) % 360);\n }\n\n get _commonActions() {\n const setColor = (jsName, styleName, event) => {\n const color = event.detail[jsName];\n const colorType = color[0];\n const colorArray = color.slice(1);\n event.target.style[styleName] =\n ColorConverters[`${colorType}_HTML`](colorArray);\n this.annotationStorage.setValue(this.data.id, {\n [styleName]: ColorConverters[`${colorType}_rgb`](colorArray),\n });\n };\n\n return shadow(this, \"_commonActions\", {\n display: event => {\n const { display } = event.detail;\n // See scripting/constants.js for the values of `Display`.\n // 0 = visible, 1 = hidden, 2 = noPrint and 3 = noView.\n const hidden = display % 2 === 1;\n this.container.style.visibility = hidden ? \"hidden\" : \"visible\";\n this.annotationStorage.setValue(this.data.id, {\n noView: hidden,\n noPrint: display === 1 || display === 2,\n });\n },\n print: event => {\n this.annotationStorage.setValue(this.data.id, {\n noPrint: !event.detail.print,\n });\n },\n hidden: event => {\n const { hidden } = event.detail;\n this.container.style.visibility = hidden ? \"hidden\" : \"visible\";\n this.annotationStorage.setValue(this.data.id, {\n noPrint: hidden,\n noView: 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 event.target.disabled = event.detail.readonly;\n },\n required: event => {\n this._setRequired(event.target, event.detail.required);\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 rotation: event => {\n const angle = event.detail.rotation;\n this.setRotation(angle);\n this.annotationStorage.setValue(this.data.id, {\n rotation: angle,\n });\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 action?.(jsEvent);\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 const eventProxy = {\n detail: {\n [actionName]: detail,\n },\n target: element,\n };\n action(eventProxy);\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 * @memberof AnnotationElement\n */\n _createQuadrilaterals() {\n if (!this.container) {\n return;\n }\n const { quadPoints } = this.data;\n if (!quadPoints) {\n return;\n }\n\n const [rectBlX, rectBlY, rectTrX, rectTrY] = this.data.rect.map(x =>\n Math.fround(x)\n );\n\n if (quadPoints.length === 8) {\n const [trX, trY, blX, blY] = quadPoints.subarray(2, 6);\n if (\n rectTrX === trX &&\n rectTrY === trY &&\n rectBlX === blX &&\n rectBlY === blY\n ) {\n // The quadpoints cover the whole annotation rectangle, so no need to\n // create a quadrilateral.\n return;\n }\n }\n\n const { style } = this.container;\n let svgBuffer;\n if (this.#hasBorder) {\n const { borderColor, borderWidth } = style;\n style.borderWidth = 0;\n svgBuffer = [\n \"url('data:image/svg+xml;utf8,\",\n `<svg xmlns=\"http://www.w3.org/2000/svg\"`,\n ` preserveAspectRatio=\"none\" viewBox=\"0 0 1 1\">`,\n `<g fill=\"transparent\" stroke=\"${borderColor}\" stroke-width=\"${borderWidth}\">`,\n ];\n this.container.classList.add(\"hasBorder\");\n }\n\n if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"TESTING\")) {\n this.container.classList.add(\"hasClipPath\");\n }\n\n const width = rectTrX - rectBlX;\n const height = rectTrY - rectBlY;\n\n const { svgFactory } = this;\n const svg = svgFactory.createElement(\"svg\");\n svg.classList.add(\"quadrilateralsContainer\");\n svg.setAttribute(\"width\", 0);\n svg.setAttribute(\"height\", 0);\n svg.role = \"none\";\n const defs = svgFactory.createElement(\"defs\");\n svg.append(defs);\n const clipPath = svgFactory.createElement(\"clipPath\");\n const id = `clippath_${this.data.id}`;\n clipPath.setAttribute(\"id\", id);\n clipPath.setAttribute(\"clipPathUnits\", \"objectBoundingBox\");\n defs.append(clipPath);\n\n for (let i = 2, ii = quadPoints.length; i < ii; i += 8) {\n const trX = quadPoints[i];\n const trY = quadPoints[i + 1];\n const blX = quadPoints[i + 2];\n const blY = quadPoints[i + 3];\n const rect = svgFactory.createElement(\"rect\");\n const x = (blX - rectBlX) / width;\n const y = (rectTrY - trY) / height;\n const rectWidth = (trX - blX) / width;\n const rectHeight = (trY - blY) / height;\n rect.setAttribute(\"x\", x);\n rect.setAttribute(\"y\", y);\n rect.setAttribute(\"width\", rectWidth);\n rect.setAttribute(\"height\", rectHeight);\n clipPath.append(rect);\n svgBuffer?.push(\n `<rect vector-effect=\"non-scaling-stroke\" x=\"${x}\" y=\"${y}\" width=\"${rectWidth}\" height=\"${rectHeight}\"/>`\n );\n }\n\n if (this.#hasBorder) {\n svgBuffer.push(`</g></svg>')`);\n style.backgroundImage = svgBuffer.join(\"\");\n }\n\n this.container.append(svg);\n this.container.style.clipPath = `url(#${id})`;\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 * @param {Object} [popupData] - The data for the popup, if any.\n *\n * @private\n * @memberof AnnotationElement\n */\n _createPopup(popupData = null) {\n const { data } = this;\n\n let contentsObj, modificationDate;\n if (popupData) {\n contentsObj = {\n str: popupData.text,\n };\n modificationDate = popupData.date;\n } else {\n contentsObj = data.contentsObj;\n modificationDate = data.modificationDate;\n }\n const popup = (this.#popupElement = new PopupAnnotationElement({\n data: {\n color: data.color,\n titleObj: data.titleObj,\n modificationDate,\n contentsObj,\n richText: data.richText,\n parentRect: data.rect,\n borderStyle: 0,\n id: `popup_${data.id}`,\n rotation: data.rotation,\n noRotate: true,\n },\n linkService: this.linkService,\n parent: this.parent,\n elements: [this],\n }));\n this.parent.div.append(popup.render());\n }\n\n get hasPopupElement() {\n return !!(this.#popupElement || this.popup || this.data.popupRef);\n }\n\n /**\n * Render the annotation's HTML element(s).\n *\n * @public\n * @memberof AnnotationElement\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.querySelector(\n `[data-element-id=\"${id}\"]`\n );\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 { exportValue } = domElement;\n const id = domElement.getAttribute(\"data-element-id\");\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 show() {\n if (this.container) {\n this.container.hidden = false;\n }\n this.popup?.maybeShow();\n }\n\n hide() {\n if (this.container) {\n this.container.hidden = true;\n }\n this.popup?.forceHide();\n }\n\n /**\n * Get the HTML element(s) which can trigger a popup when clicked or hovered.\n *\n * @public\n * @memberof AnnotationElement\n * @returns {Array<HTMLElement>|HTMLElement} An array of elements or an\n * element.\n */\n getElementsToTriggerPopup() {\n return this.container;\n }\n\n addHighlightArea() {\n const triggers = this.getElementsToTriggerPopup();\n if (Array.isArray(triggers)) {\n for (const element of triggers) {\n element.classList.add(\"highlightArea\");\n }\n } else {\n triggers.classList.add(\"highlightArea\");\n }\n }\n\n _editOnDoubleClick() {\n if (!this._isEditable) {\n return;\n }\n const {\n annotationEditorType: mode,\n data: { id: editId },\n } = this;\n this.container.addEventListener(\"dblclick\", () => {\n this.linkService.eventBus?.dispatch(\"switchannotationeditormode\", {\n source: this,\n mode,\n editId,\n mustEnterInEditMode: true,\n });\n });\n }\n\n get width() {\n return this.data.rect[2] - this.data.rect[0];\n }\n\n get height() {\n return this.data.rect[3] - this.data.rect[1];\n }\n}\n\nclass LinkAnnotationElement extends AnnotationElement {\n constructor(parameters, options = null) {\n super(parameters, {\n isRenderable: true,\n ignoreBorder: !!options?.ignoreBorder,\n createQuadrilaterals: true,\n });\n this.isTooltipOnly = parameters.data.isTooltipOnly;\n }\n\n render() {\n const { data, linkService } = this;\n const link = document.createElement(\"a\");\n link.setAttribute(\"data-element-id\", data.id);\n let isBound = false;\n\n if (data.url) {\n linkService.addLinkAttributes(link, data.url, data.newWindow);\n isBound = true;\n } else if (data.action) {\n this._bindNamedAction(link, data.action, data.overlaidText);\n isBound = true;\n } else if (data.attachment) {\n this.#bindAttachment(\n link,\n data.attachment,\n data.overlaidText,\n data.attachmentDest\n );\n isBound = true;\n } else if (data.setOCGState) {\n this.#bindSetOCGState(link, data.setOCGState, data.overlaidText);\n isBound = true;\n } else if (data.dest) {\n this._bindLink(link, data.dest, data.overlaidText);\n isBound = true;\n } else {\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 this._bindJSAction(link, data);\n isBound = true;\n }\n\n if (data.resetForm) {\n this._bindResetFormAction(link, data.resetForm);\n isBound = true;\n } else if (this.isTooltipOnly && !isBound) {\n this._bindLink(link, \"\");\n isBound = true;\n }\n }\n\n this.container.classList.add(\"linkAnnotation\");\n if (isBound) {\n this.container.append(link);\n }\n\n return this.container;\n }\n\n #setInternalLink() {\n this.container.setAttribute(\"data-internal-link\", \"\");\n }\n\n /**\n * Bind internal links to the link element.\n *\n * @private\n * @param {Object} link\n * @param {Object} destination\n * @param {string} [overlaidText]\n * @memberof LinkAnnotationElement\n */\n _bindLink(link, destination, overlaidText = \"\") {\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 this.#setInternalLink();\n }\n if (overlaidText) {\n link.title = overlaidText;\n }\n }\n\n /**\n * Bind named actions to the link element.\n *\n * @private\n * @param {Object} link\n * @param {Object} action\n * @param {string} [overlaidText]\n * @memberof LinkAnnotationElement\n */\n _bindNamedAction(link, action, overlaidText = \"\") {\n link.href = this.linkService.getAnchorUrl(\"\");\n link.onclick = () => {\n this.linkService.executeNamedAction(action);\n return false;\n };\n if (overlaidText) {\n link.title = overlaidText;\n }\n this.#setInternalLink();\n }\n\n /**\n * Bind attachments to the link element.\n * @param {Object} link\n * @param {Object} attachment\n * @param {string} [overlaidText]\n * @param {string} [dest]\n */\n #bindAttachment(link, attachment, overlaidText = \"\", dest = null) {\n link.href = this.linkService.getAnchorUrl(\"\");\n if (attachment.description) {\n link.title = attachment.description;\n } else if (overlaidText) {\n link.title = overlaidText;\n }\n link.onclick = () => {\n this.downloadManager?.openOrDownloadData(\n attachment.content,\n attachment.filename,\n dest\n );\n return false;\n };\n this.#setInternalLink();\n }\n\n /**\n * Bind SetOCGState actions to the link element.\n * @param {Object} link\n * @param {Object} action\n * @param {string} [overlaidText]\n */\n #bindSetOCGState(link, action, overlaidText = \"\") {\n link.href = this.linkService.getAnchorUrl(\"\");\n link.onclick = () => {\n this.linkService.executeSetOCGState(action);\n return false;\n };\n if (overlaidText) {\n link.title = overlaidText;\n }\n this.#setInternalLink();\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 if (data.overlaidText) {\n link.title = data.overlaidText;\n }\n\n if (!link.onclick) {\n link.onclick = () => false;\n }\n this.#setInternalLink();\n }\n\n _bindResetFormAction(link, resetForm) {\n const otherClickAction = link.onclick;\n if (!otherClickAction) {\n link.href = this.linkService.getAnchorUrl(\"\");\n }\n this.#setInternalLink();\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 otherClickAction?.();\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\n const domElement = document.querySelector(`[data-element-id=\"${id}\"]`);\n if (!domElement) {\n continue;\n } else if (!GetElementsByNameSet.has(domElement)) {\n warn(`_bindResetFormAction - element not allowed: ${id}`);\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 super(parameters, { isRenderable: true });\n }\n\n render() {\n this.container.classList.add(\"textAnnotation\");\n\n const image = document.createElement(\"img\");\n image.src =\n this.imageResourcesPath +\n \"annotation-\" +\n this.data.name.toLowerCase() +\n \".svg\";\n image.setAttribute(\"data-l10n-id\", \"pdfjs-text-annotation-type\");\n image.setAttribute(\n \"data-l10n-args\",\n JSON.stringify({ type: this.data.name })\n );\n\n if (!this.data.popupRef && this.hasPopupData) {\n this._createPopup();\n }\n\n this.container.append(image);\n return this.container;\n }\n}\n\nclass WidgetAnnotationElement extends AnnotationElement {\n render() {\n // Show only the container for unsupported field types.\n return this.container;\n }\n\n showElementAndHideCanvas(element) {\n if (this.data.hasOwnCanvas) {\n if (element.previousSibling?.nodeName === \"CANVAS\") {\n element.previousSibling.hidden = true;\n }\n element.hidden = false;\n }\n }\n\n _getKeyModifier(event) {\n return FeatureTest.platform.isMac ? event.metaKey : event.ctrlKey;\n }\n\n _setEventListener(element, elementData, 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 events\n element.addEventListener(baseName, event => {\n if (baseName === \"blur\") {\n if (!elementData.focused || !event.relatedTarget) {\n return;\n }\n elementData.focused = false;\n } else if (baseName === \"focus\") {\n if (elementData.focused) {\n return;\n }\n elementData.focused = true;\n }\n\n if (!valueGetter) {\n return;\n }\n\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, elementData, names, getter) {\n for (const [baseName, eventName] of names) {\n if (eventName === \"Action\" || this.data.actions?.[eventName]) {\n if (eventName === \"Focus\" || eventName === \"Blur\") {\n elementData ||= { focused: false };\n }\n this._setEventListener(\n element,\n elementData,\n baseName,\n eventName,\n getter\n );\n if (eventName === \"Focus\" && !this.data.actions?.Blur) {\n // Ensure that elementData will have the correct value.\n this._setEventListener(element, elementData, \"blur\", \"Blur\", null);\n } else if (eventName === \"Blur\" && !this.data.actions?.Focus) {\n this._setEventListener(element, elementData, \"focus\", \"Focus\", null);\n }\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 /**\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 { fontColor } = this.data.defaultAppearanceData;\n const fontSize =\n this.data.defaultAppearanceData.fontSize || DEFAULT_FONT_SIZE;\n\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\n // We don't use the font, as specified in the PDF document, for the <input>\n // element. Hence using the original `fontSize` could look bad, which is why\n // it's instead based on the field height.\n // If the height is \"big\" then it could lead to a too big font size\n // so in this case use the one we've in the pdf (hence the min).\n let computedFontSize;\n const BORDER_SIZE = 2;\n const roundToOneDecimal = x => Math.round(10 * x) / 10;\n if (this.data.multiLine) {\n const height = Math.abs(\n this.data.rect[3] - this.data.rect[1] - BORDER_SIZE\n );\n const numberOfLines = Math.round(height / (LINE_FACTOR * fontSize)) || 1;\n const lineHeight = height / numberOfLines;\n computedFontSize = Math.min(\n fontSize,\n roundToOneDecimal(lineHeight / LINE_FACTOR)\n );\n } else {\n const height = Math.abs(\n this.data.rect[3] - this.data.rect[1] - BORDER_SIZE\n );\n computedFontSize = Math.min(\n fontSize,\n roundToOneDecimal(height / LINE_FACTOR)\n );\n }\n style.fontSize = `calc(${computedFontSize}px * var(--total-scale-factor))`;\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 _setRequired(element, isRequired) {\n if (isRequired) {\n element.setAttribute(\"required\", true);\n } else {\n element.removeAttribute(\"required\");\n }\n element.setAttribute(\"aria-required\", isRequired);\n }\n}\n\nclass TextWidgetAnnotationElement extends WidgetAnnotationElement {\n constructor(parameters) {\n const isRenderable =\n parameters.renderForms ||\n parameters.data.hasOwnCanvas ||\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.classList.add(\"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 let textContent = storedData.value || \"\";\n const maxLen = storage.getValue(id, {\n charLimit: this.data.maxLen,\n }).charLimit;\n if (maxLen && textContent.length > maxLen) {\n textContent = textContent.slice(0, maxLen);\n }\n\n let fieldFormattedValues =\n storedData.formattedValue || this.data.textContent?.join(\"\\n\") || null;\n if (fieldFormattedValues && this.data.comb) {\n fieldFormattedValues = fieldFormattedValues.replaceAll(/\\s+/g, \"\");\n }\n\n const elementData = {\n userValue: textContent,\n formattedValue: fieldFormattedValues,\n lastCommittedValue: null,\n commitKey: 1,\n focused: false,\n };\n\n if (this.data.multiLine) {\n element = document.createElement(\"textarea\");\n element.textContent = fieldFormattedValues ?? textContent;\n if (this.data.doNotScroll) {\n element.style.overflowY = \"hidden\";\n }\n } else {\n element = document.createElement(\"input\");\n element.type = this.data.password ? \"password\" : \"text\";\n element.setAttribute(\"value\", fieldFormattedValues ?? textContent);\n if (this.data.doNotScroll) {\n element.style.overflowX = \"hidden\";\n }\n }\n if (this.data.hasOwnCanvas) {\n element.hidden = true;\n }\n GetElementsByNameSet.add(element);\n element.setAttribute(\"data-element-id\", id);\n\n element.disabled = this.data.readOnly;\n element.name = this.data.fieldName;\n element.tabIndex = 0;\n const { datetimeFormat, datetimeType, timeStep } = this.data;\n const hasDateOrTime = !!datetimeType && this.enableScripting;\n if (datetimeFormat) {\n element.title = datetimeFormat;\n }\n\n this._setRequired(element, this.data.required);\n\n if (maxLen) {\n element.maxLength = maxLen;\n }\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 elementData.formattedValue = null;\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.focused) {\n return;\n }\n const { target } = event;\n if (hasDateOrTime) {\n target.type = datetimeType;\n if (timeStep) {\n target.step = timeStep;\n }\n }\n\n if (elementData.userValue) {\n const value = elementData.userValue;\n if (hasDateOrTime) {\n if (datetimeType === \"time\") {\n const date = new Date(value);\n const parts = [\n date.getHours(),\n date.getMinutes(),\n date.getSeconds(),\n ];\n target.value = parts\n .map(v => v.toString().padStart(2, \"0\"))\n .join(\":\");\n } else {\n target.value = new Date(value - TIMEZONE_OFFSET)\n .toISOString()\n .split(datetimeType === \"date\" ? \"T\" : \".\", 1)[0];\n }\n } else {\n target.value = value;\n }\n }\n elementData.lastCommittedValue = target.value;\n elementData.commitKey = 1;\n if (!this.data.actions?.Focus) {\n elementData.focused = true;\n }\n });\n\n element.addEventListener(\"updatefromsandbox\", jsEvent => {\n this.showElementAndHideCanvas(jsEvent.target);\n const actions = {\n value(event) {\n elementData.userValue = event.detail.value ?? \"\";\n if (!hasDateOrTime) {\n storage.setValue(id, {\n value: elementData.userValue.toString(),\n });\n }\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 const data = {\n formattedValue,\n };\n if (hasDateOrTime) {\n // If the field is a date or time, we store the formatted value\n // in the `value` property, so that it can be used by the\n // `Keystroke` action.\n data.value = formattedValue;\n }\n storage.setValue(id, data);\n },\n selRange(event) {\n event.target.setSelectionRange(...event.detail.selRange);\n },\n charLimit: event => {\n const { charLimit } = event.detail;\n const { target } = event;\n if (charLimit === 0) {\n target.removeAttribute(\"maxLength\");\n return;\n }\n\n target.setAttribute(\"maxLength\", charLimit);\n let value = elementData.userValue;\n if (!value || value.length <= charLimit) {\n return;\n }\n value = value.slice(0, charLimit);\n target.value = elementData.userValue = value;\n storage.setValue(id, { value });\n\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: target.selectionStart,\n selEnd: target.selectionEnd,\n },\n });\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 elementData.commitKey = 1;\n // If the key is one of Escape, Enter then the data are committed.\n // If we've a Tab then data will be committed on blur.\n let commitKey = -1;\n if (event.key === \"Escape\") {\n commitKey = 0;\n } else if (event.key === \"Enter\" && !this.data.multiLine) {\n // When we've a multiline field, \"Enter\" key is a key as the other\n // hence we don't commit the data (Acrobat behaves the same way)\n // (see issue #15627).\n commitKey = 2;\n } else if (event.key === \"Tab\") {\n elementData.commitKey = 3;\n }\n if (commitKey === -1) {\n return;\n }\n const { value } = event.target;\n if (elementData.lastCommittedValue === value) {\n return;\n }\n elementData.lastCommittedValue = value;\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 if (!elementData.focused || !event.relatedTarget) {\n return;\n }\n if (!this.data.actions?.Blur) {\n elementData.focused = false;\n }\n const { target } = event;\n let { value } = target;\n if (hasDateOrTime) {\n if (value && datetimeType === \"time\") {\n const parts = value.split(\":\").map(v => parseInt(v, 10));\n value = new Date(\n 2000,\n 0,\n 1,\n parts[0],\n parts[1],\n parts[2] || 0\n ).valueOf();\n target.step = \"\";\n } else {\n value = new Date(value).valueOf();\n }\n target.type = \"text\";\n }\n elementData.userValue = value;\n if (elementData.lastCommittedValue !== value) {\n this.linkService.eventBus?.dispatch(\"dispatcheventinsandbox\", {\n source: this,\n detail: {\n id,\n name: \"Keystroke\",\n value,\n willCommit: true,\n commitKey: elementData.commitKey,\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 elementData.lastCommittedValue = null;\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 elementData,\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.comb) {\n const fieldWidth = this.data.rect[2] - this.data.rect[0];\n const combWidth = fieldWidth / maxLen;\n\n element.classList.add(\"comb\");\n element.style.letterSpacing = `calc(${combWidth}px * var(--total-scale-factor) - 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 if (this.data.hasOwnCanvas) {\n element.hidden = true;\n }\n }\n\n this._setTextStyle(element);\n this._setBackgroundColor(element);\n this._setDefaultPropertiesFromJS(element);\n\n this.container.append(element);\n return this.container;\n }\n}\n\nclass SignatureWidgetAnnotationElement extends WidgetAnnotationElement {\n constructor(parameters) {\n super(parameters, { isRenderable: !!parameters.data.hasOwnCanvas });\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.classList.add(\"buttonWidgetAnnotation\", \"checkBox\");\n\n const element = document.createElement(\"input\");\n GetElementsByNameSet.add(element);\n element.setAttribute(\"data-element-id\", id);\n\n element.disabled = data.readOnly;\n this._setRequired(element, this.data.required);\n element.type = \"checkbox\";\n element.name = data.fieldName;\n if (value) {\n element.setAttribute(\"checked\", true);\n }\n element.setAttribute(\"exportValue\", data.exportValue);\n element.tabIndex = 0;\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 null,\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.append(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.classList.add(\"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 if (value) {\n // It's possible that multiple radio buttons are checked.\n // So if this one is checked we just reset the other ones.\n // (see bug 1864136). Then when the other ones will be rendered they will\n // unchecked (because of their value in the storage).\n // Consequently, the first checked radio button will be the only checked\n // one.\n for (const radio of this._getElementsByName(\n data.fieldName,\n /* skipId = */ id\n )) {\n storage.setValue(radio.id, { value: false });\n }\n }\n\n const element = document.createElement(\"input\");\n GetElementsByNameSet.add(element);\n element.setAttribute(\"data-element-id\", id);\n\n element.disabled = data.readOnly;\n this._setRequired(element, this.data.required);\n element.type = \"radio\";\n element.name = data.fieldName;\n if (value) {\n element.setAttribute(\"checked\", true);\n }\n element.tabIndex = 0;\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 null,\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.append(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.classList.add(\"buttonWidgetAnnotation\", \"pushButton\");\n\n const linkElement = container.lastChild;\n if (this.enableScripting && this.hasJSActions && linkElement) {\n this._setDefaultPropertiesFromJS(linkElement);\n\n linkElement.addEventListener(\"updatefromsandbox\", jsEvent => {\n this._dispatchEventFromSandbox({}, jsEvent);\n });\n }\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.classList.add(\"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 const selectElement = document.createElement(\"select\");\n GetElementsByNameSet.add(selectElement);\n selectElement.setAttribute(\"data-element-id\", id);\n\n selectElement.disabled = this.data.readOnly;\n this._setRequired(selectElement, this.data.required);\n selectElement.name = this.data.fieldName;\n selectElement.tabIndex = 0;\n\n let addAnEmptyEntry = this.data.combo && this.data.options.length > 0;\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 (storedData.value.includes(option.exportValue)) {\n optionElement.setAttribute(\"selected\", true);\n addAnEmptyEntry = false;\n }\n selectElement.append(optionElement);\n }\n\n let removeEmptyEntry = null;\n if (addAnEmptyEntry) {\n const noneOptionElement = document.createElement(\"option\");\n noneOptionElement.value = \" \";\n noneOptionElement.setAttribute(\"hidden\", true);\n noneOptionElement.setAttribute(\"selected\", true);\n selectElement.prepend(noneOptionElement);\n\n removeEmptyEntry = () => {\n noneOptionElement.remove();\n selectElement.removeEventListener(\"input\", removeEmptyEntry);\n removeEmptyEntry = null;\n };\n selectElement.addEventListener(\"input\", removeEmptyEntry);\n }\n\n const getValue = isExport => {\n const name = isExport ? \"value\" : \"textContent\";\n const { options, multiple } = selectElement;\n if (!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 let selectedValues = getValue(/* isExport */ false);\n\n const getItems = event => {\n const options = event.target.options;\n return Array.prototype.map.call(options, option => ({\n displayValue: option.textContent,\n exportValue: option.value,\n }));\n };\n\n if (this.enableScripting && this.hasJSActions) {\n selectElement.addEventListener(\"updatefromsandbox\", jsEvent => {\n const actions = {\n value(event) {\n removeEmptyEntry?.();\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(/* isExport */ true),\n });\n selectedValues = getValue(/* isExport */ false);\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(/* isExport */ true),\n items: getItems(event),\n });\n selectedValues = getValue(/* isExport */ false);\n },\n clear(event) {\n while (selectElement.length !== 0) {\n selectElement.remove(0);\n }\n storage.setValue(id, { value: null, items: [] });\n selectedValues = getValue(/* isExport */ false);\n },\n insert(event) {\n const { index, displayValue, exportValue } = event.detail.insert;\n const selectChild = selectElement.children[index];\n const optionElement = document.createElement(\"option\");\n optionElement.textContent = displayValue;\n optionElement.value = exportValue;\n\n if (selectChild) {\n selectChild.before(optionElement);\n } else {\n selectElement.append(optionElement);\n }\n storage.setValue(id, {\n value: getValue(/* isExport */ true),\n items: getItems(event),\n });\n selectedValues = getValue(/* isExport */ false);\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.append(optionElement);\n }\n if (selectElement.options.length > 0) {\n selectElement.options[0].selected = true;\n }\n storage.setValue(id, {\n value: getValue(/* isExport */ true),\n items: getItems(event),\n });\n selectedValues = getValue(/* isExport */ false);\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(/* isExport */ true),\n });\n selectedValues = getValue(/* isExport */ false);\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(/* isExport */ true);\n const change = getValue(/* isExport */ false);\n storage.setValue(id, { value: exportValue });\n\n event.preventDefault();\n\n this.linkService.eventBus?.dispatch(\"dispatcheventinsandbox\", {\n source: this,\n detail: {\n id,\n name: \"Keystroke\",\n value: selectedValues,\n change,\n changeEx: exportValue,\n willCommit: false,\n commitKey: 1,\n keyDown: false,\n },\n });\n });\n\n this._setEventListeners(\n selectElement,\n null,\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 [\"input\", \"Validate\"],\n ],\n event => event.target.value\n );\n } else {\n selectElement.addEventListener(\"input\", function (event) {\n storage.setValue(id, { value: getValue(/* isExport */ true) });\n });\n }\n\n if (this.data.combo) {\n this._setTextStyle(selectElement);\n } else {\n // Just use the default font size...\n // it's a bit hard to guess what is a good size.\n }\n this._setBackgroundColor(selectElement);\n this._setDefaultPropertiesFromJS(selectElement);\n\n this.container.append(selectElement);\n return this.container;\n }\n}\n\nclass PopupAnnotationElement extends AnnotationElement {\n constructor(parameters) {\n const { data, elements } = parameters;\n super(parameters, { isRenderable: AnnotationElement._hasPopupData(data) });\n this.elements = elements;\n this.popup = null;\n }\n\n render() {\n const { container } = this;\n container.classList.add(\"popupAnnotation\");\n container.role = \"comment\";\n\n const popup = (this.popup = new PopupElement({\n container: this.container,\n color: this.data.color,\n titleObj: this.data.titleObj,\n modificationDate: this.data.modificationDate || this.data.creationDate,\n contentsObj: this.data.contentsObj,\n richText: this.data.richText,\n rect: this.data.rect,\n parentRect: this.data.parentRect || null,\n parent: this.parent,\n elements: this.elements,\n open: this.data.open,\n eventBus: this.linkService.eventBus,\n }));\n\n const elementIds = [];\n for (const element of this.elements) {\n element.popup = popup;\n element.container.ariaHasPopup = \"dialog\";\n elementIds.push(element.data.id);\n element.addHighlightArea();\n }\n\n this.container.setAttribute(\n \"aria-controls\",\n elementIds.map(id => `${AnnotationPrefix}${id}`).join(\",\")\n );\n\n return this.container;\n }\n}\n\nclass PopupElement {\n #boundKeyDown = this.#keyDown.bind(this);\n\n #boundHide = this.#hide.bind(this);\n\n #boundShow = this.#show.bind(this);\n\n #boundToggle = this.#toggle.bind(this);\n\n #color = null;\n\n #container = null;\n\n #contentsObj = null;\n\n #dateObj = null;\n\n #elements = null;\n\n #eventBus = null;\n\n #parent = null;\n\n #parentRect = null;\n\n #pinned = false;\n\n #popup = null;\n\n #popupAbortController = null;\n\n #position = null;\n\n #commentButton = null;\n\n #commentButtonPosition = null;\n\n #commentButtonColor = null;\n\n #rect = null;\n\n #richText = null;\n\n #titleObj = null;\n\n #updates = null;\n\n #wasVisible = false;\n\n constructor({\n container,\n color,\n elements,\n titleObj,\n modificationDate,\n contentsObj,\n richText,\n parent,\n rect,\n parentRect,\n open,\n eventBus = null,\n }) {\n this.#container = container;\n this.#titleObj = titleObj;\n this.#contentsObj = contentsObj;\n this.#richText = richText;\n this.#parent = parent;\n this.#color = color;\n this.#rect = rect;\n this.#parentRect = parentRect;\n this.#elements = elements;\n this.#eventBus = eventBus;\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 this.#dateObj = PDFDateString.toDateObject(modificationDate);\n\n this.trigger = elements.flatMap(e => e.getElementsToTriggerPopup());\n this.#addEventListeners();\n\n this.#container.hidden = true;\n if (open) {\n this.#toggle();\n }\n\n if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"TESTING\")) {\n // Since the popup is lazily created, we need to ensure that it'll be\n // created and displayed during reference tests.\n this.#parent.popupShow.push(async () => {\n if (this.#container.hidden) {\n this.#show();\n }\n });\n }\n }\n\n #addEventListeners() {\n if (this.#popupAbortController) {\n return;\n }\n this.#popupAbortController = new AbortController();\n const { signal } = this.#popupAbortController;\n\n // Attach the event listeners to the trigger element.\n for (const element of this.trigger) {\n element.addEventListener(\"click\", this.#boundToggle, { signal });\n element.addEventListener(\"mouseenter\", this.#boundShow, { signal });\n element.addEventListener(\"mouseleave\", this.#boundHide, { signal });\n element.classList.add(\"popupTriggerArea\");\n }\n\n // Attach the event listener to toggle the popup with the keyboard.\n for (const element of this.#elements) {\n element.container?.addEventListener(\"keydown\", this.#boundKeyDown, {\n signal,\n });\n }\n\n this.#renderCommentButton();\n }\n\n #setCommentButtonPosition() {\n const element = this.#elements.find(e => e.hasCommentButton);\n if (!element) {\n return;\n }\n this.#commentButtonPosition = element._normalizePoint(\n element.commentButtonPosition\n );\n this.#commentButtonColor = element.commentButtonColor;\n }\n\n #renderCommentButton() {\n if (this.#commentButton) {\n return;\n }\n\n if (!this.#commentButtonPosition) {\n this.#setCommentButtonPosition();\n }\n\n if (!this.#commentButtonPosition) {\n return;\n }\n\n const button = (this.#commentButton = document.createElement(\"button\"));\n button.className = \"annotationCommentButton\";\n const parentContainer = this.#elements[0].container;\n button.style.zIndex = parentContainer.style.zIndex + 1;\n button.tabIndex = 0;\n\n const { signal } = this.#popupAbortController;\n button.addEventListener(\"hover\", this.#boundToggle, { signal });\n button.addEventListener(\"keydown\", this.#boundKeyDown, { signal });\n button.addEventListener(\n \"click\",\n () => {\n const [\n {\n data: { id: editId },\n annotationEditorType: mode,\n },\n ] = this.#elements;\n this.#eventBus?.dispatch(\"switchannotationeditormode\", {\n source: this,\n editId,\n mode,\n editComment: true,\n });\n },\n { signal }\n );\n const { style } = button;\n style.left = `calc(${this.#commentButtonPosition[0]}%)`;\n style.top = `calc(${this.#commentButtonPosition[1]}% - var(--comment-button-dim))`;\n if (this.#commentButtonColor) {\n style.backgroundColor = this.#commentButtonColor;\n }\n parentContainer.after(button);\n }\n\n render() {\n if (this.#popup) {\n return;\n }\n\n const popup = (this.#popup = document.createElement(\"div\"));\n popup.className = \"popup\";\n\n if (this.#color) {\n const baseColor = (popup.style.outlineColor = Util.makeHexColor(\n ...this.#color\n ));\n popup.style.backgroundColor = `color-mix(in srgb, ${baseColor} 30%, white)`;\n }\n\n const header = document.createElement(\"span\");\n header.className = \"header\";\n if (this.#titleObj?.str) {\n const title = document.createElement(\"span\");\n title.className = \"title\";\n header.append(title);\n ({ dir: title.dir, str: title.textContent } = this.#titleObj);\n }\n popup.append(header);\n\n if (this.#dateObj) {\n const modificationDate = document.createElement(\"time\");\n modificationDate.className = \"popupDate\";\n modificationDate.setAttribute(\n \"data-l10n-id\",\n \"pdfjs-annotation-date-time-string\"\n );\n modificationDate.setAttribute(\n \"data-l10n-args\",\n JSON.stringify({ dateObj: this.#dateObj.valueOf() })\n );\n modificationDate.dateTime = this.#dateObj.toISOString();\n header.append(modificationDate);\n }\n\n const html = this.#html;\n if (html) {\n XfaLayer.render({\n xfaHtml: html,\n intent: \"richText\",\n div: popup,\n });\n popup.lastChild.classList.add(\"richText\", \"popupContent\");\n } else {\n const contents = this._formatContents(this.#contentsObj);\n popup.append(contents);\n }\n this.#container.append(popup);\n }\n\n get #html() {\n const richText = this.#richText;\n const contentsObj = this.#contentsObj;\n if (\n richText?.str &&\n (!contentsObj?.str || contentsObj.str === richText.str)\n ) {\n return this.#richText.html || null;\n }\n return null;\n }\n\n get #fontSize() {\n return this.#html?.attributes?.style?.fontSize || 0;\n }\n\n get #fontColor() {\n return this.#html?.attributes?.style?.color || null;\n }\n\n #makePopupContent(text) {\n const popupLines = [];\n const popupContent = {\n str: text,\n html: {\n name: \"div\",\n attributes: {\n dir: \"auto\",\n },\n children: [\n {\n name: \"p\",\n children: popupLines,\n },\n ],\n },\n };\n const lineAttributes = {\n style: {\n color: this.#fontColor,\n fontSize: this.#fontSize\n ? `calc(${this.#fontSize}px * var(--total-scale-factor))`\n : \"\",\n },\n };\n for (const line of text.split(\"\\n\")) {\n popupLines.push({\n name: \"span\",\n value: line,\n attributes: lineAttributes,\n });\n }\n return popupContent;\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.classList.add(\"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.append(document.createTextNode(line));\n if (i < ii - 1) {\n p.append(document.createElement(\"br\"));\n }\n }\n return p;\n }\n\n #keyDown(event) {\n if (event.altKey || event.shiftKey || event.ctrlKey || event.metaKey) {\n return;\n }\n\n if (event.key === \"Enter\" || (event.key === \"Escape\" && this.#pinned)) {\n this.#toggle();\n }\n }\n\n updateEdited({ rect, popup, deleted }) {\n if (deleted || popup?.deleted) {\n this.remove();\n return;\n }\n this.#addEventListeners();\n this.#updates ||= {\n contentsObj: this.#contentsObj,\n richText: this.#richText,\n };\n if (rect) {\n this.#position = null;\n }\n if (popup) {\n this.#richText = this.#makePopupContent(popup.text);\n this.#dateObj = PDFDateString.toDateObject(popup.date);\n this.#contentsObj = null;\n }\n this.#popup?.remove();\n this.#popup = null;\n }\n\n resetEdited() {\n if (!this.#updates) {\n return;\n }\n ({ contentsObj: this.#contentsObj, richText: this.#richText } =\n this.#updates);\n this.#updates = null;\n this.#popup?.remove();\n this.#popup = null;\n this.#position = null;\n }\n\n remove() {\n this.#popupAbortController?.abort();\n this.#popupAbortController = null;\n this.#popup?.remove();\n this.#popup = null;\n this.#wasVisible = false;\n this.#pinned = false;\n for (const element of this.trigger) {\n element.classList.remove(\"popupTriggerArea\");\n }\n }\n\n #setPosition() {\n if (this.#position !== null) {\n return;\n }\n const {\n page: { view },\n viewport: {\n rawDims: { pageWidth, pageHeight, pageX, pageY },\n },\n } = this.#parent;\n\n let useParentRect = !!this.#parentRect;\n let rect = useParentRect ? this.#parentRect : this.#rect;\n for (const element of this.#elements) {\n if (!rect || Util.intersect(element.data.rect, rect) !== null) {\n rect = element.data.rect;\n useParentRect = true;\n break;\n }\n }\n\n const normalizedRect = Util.normalizeRect([\n rect[0],\n view[3] - rect[1] + view[1],\n rect[2],\n view[3] - rect[3] + view[1],\n ]);\n\n const HORIZONTAL_SPACE_AFTER_ANNOTATION = 5;\n const parentWidth = useParentRect\n ? rect[2] - rect[0] + HORIZONTAL_SPACE_AFTER_ANNOTATION\n : 0;\n const popupLeft = normalizedRect[0] + parentWidth;\n const popupTop = normalizedRect[1];\n this.#position = [\n (100 * (popupLeft - pageX)) / pageWidth,\n (100 * (popupTop - pageY)) / pageHeight,\n ];\n\n const { style } = this.#container;\n style.left = `${this.#position[0]}%`;\n style.top = `${this.#position[1]}%`;\n }\n\n /**\n * Toggle the visibility of the popup.\n */\n #toggle() {\n this.#pinned = !this.#pinned;\n if (this.#pinned) {\n this.#show();\n this.#container.addEventListener(\"click\", this.#boundToggle);\n this.#container.addEventListener(\"keydown\", this.#boundKeyDown);\n } else {\n this.#hide();\n this.#container.removeEventListener(\"click\", this.#boundToggle);\n this.#container.removeEventListener(\"keydown\", this.#boundKeyDown);\n }\n }\n\n /**\n * Show the popup.\n */\n #show() {\n if (!this.#popup) {\n this.render();\n }\n if (!this.isVisible) {\n this.#setPosition();\n this.#container.hidden = false;\n this.#container.style.zIndex =\n parseInt(this.#container.style.zIndex) + 1000;\n } else if (this.#pinned) {\n this.#container.classList.add(\"focused\");\n }\n }\n\n /**\n * Hide the popup.\n */\n #hide() {\n this.#container.classList.remove(\"focused\");\n if (this.#pinned || !this.isVisible) {\n return;\n }\n this.#container.hidden = true;\n this.#container.style.zIndex =\n parseInt(this.#container.style.zIndex) - 1000;\n }\n\n forceHide() {\n this.#wasVisible = this.isVisible;\n if (!this.#wasVisible) {\n return;\n }\n this.#container.hidden = true;\n }\n\n maybeShow() {\n this.#addEventListeners();\n if (!this.#wasVisible) {\n return;\n }\n if (!this.#popup) {\n this.#show();\n }\n this.#wasVisible = false;\n this.#container.hidden = false;\n }\n\n get isVisible() {\n return this.#container.hidden === false;\n }\n}\n\nclass FreeTextAnnotationElement extends AnnotationElement {\n constructor(parameters) {\n super(parameters, { isRenderable: true, ignoreBorder: true });\n this.textContent = parameters.data.textContent;\n this.textPosition = parameters.data.textPosition;\n this.annotationEditorType = AnnotationEditorType.FREETEXT;\n }\n\n render() {\n this.container.classList.add(\"freeTextAnnotation\");\n\n if (this.textContent) {\n const content = document.createElement(\"div\");\n content.classList.add(\"annotationTextContent\");\n content.setAttribute(\"role\", \"comment\");\n for (const line of this.textContent) {\n const lineSpan = document.createElement(\"span\");\n lineSpan.textContent = line;\n content.append(lineSpan);\n }\n this.container.append(content);\n }\n\n if (!this.data.popupRef && this.hasPopupData) {\n this._createPopup();\n }\n\n this._editOnDoubleClick();\n\n return this.container;\n }\n}\n\nclass LineAnnotationElement extends AnnotationElement {\n #line = null;\n\n constructor(parameters) {\n super(parameters, { isRenderable: true, ignoreBorder: true });\n }\n\n render() {\n this.container.classList.add(\"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, width, height } = this;\n const svg = this.svgFactory.create(\n width,\n height,\n /* skipDimensions = */ true\n );\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.#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.append(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 if (!data.popupRef && this.hasPopupData) {\n this._createPopup();\n }\n\n return this.container;\n }\n\n getElementsToTriggerPopup() {\n return this.#line;\n }\n\n addHighlightArea() {\n this.container.classList.add(\"highlightArea\");\n }\n}\n\nclass SquareAnnotationElement extends AnnotationElement {\n #square = null;\n\n constructor(parameters) {\n super(parameters, { isRenderable: true, ignoreBorder: true });\n }\n\n render() {\n this.container.classList.add(\"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, width, height } = this;\n const svg = this.svgFactory.create(\n width,\n height,\n /* skipDimensions = */ true\n );\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.#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.append(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 if (!data.popupRef && this.hasPopupData) {\n this._createPopup();\n }\n\n return this.container;\n }\n\n getElementsToTriggerPopup() {\n return this.#square;\n }\n\n addHighlightArea() {\n this.container.classList.add(\"highlightArea\");\n }\n}\n\nclass CircleAnnotationElement extends AnnotationElement {\n #circle = null;\n\n constructor(parameters) {\n super(parameters, { isRenderable: true, ignoreBorder: true });\n }\n\n render() {\n this.container.classList.add(\"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, width, height } = this;\n const svg = this.svgFactory.create(\n width,\n height,\n /* skipDimensions = */ true\n );\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.#circle =\n 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.append(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 if (!data.popupRef && this.hasPopupData) {\n this._createPopup();\n }\n\n return this.container;\n }\n\n getElementsToTriggerPopup() {\n return this.#circle;\n }\n\n addHighlightArea() {\n this.container.classList.add(\"highlightArea\");\n }\n}\n\nclass PolylineAnnotationElement extends AnnotationElement {\n #polyline = null;\n\n constructor(parameters) {\n super(parameters, { isRenderable: true, ignoreBorder: true });\n\n this.containerClassName = \"polylineAnnotation\";\n this.svgElementName = \"svg:polyline\";\n }\n\n render() {\n this.container.classList.add(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 {\n data: { rect, vertices, borderStyle, popupRef },\n width,\n height,\n } = this;\n if (!vertices) {\n return this.container;\n }\n const svg = this.svgFactory.create(\n width,\n height,\n /* skipDimensions = */ true\n );\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 (let i = 0, ii = vertices.length; i < ii; i += 2) {\n const x = vertices[i] - rect[0];\n const y = rect[3] - vertices[i + 1];\n points.push(`${x},${y}`);\n }\n points = points.join(\" \");\n\n const polyline = (this.#polyline = this.svgFactory.createElement(\n this.svgElementName\n ));\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\", borderStyle.width || 1);\n polyline.setAttribute(\"stroke\", \"transparent\");\n polyline.setAttribute(\"fill\", \"transparent\");\n\n svg.append(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 if (!popupRef && this.hasPopupData) {\n this._createPopup();\n }\n\n return this.container;\n }\n\n getElementsToTriggerPopup() {\n return this.#polyline;\n }\n\n addHighlightArea() {\n this.container.classList.add(\"highlightArea\");\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 super(parameters, { isRenderable: true, ignoreBorder: true });\n }\n\n render() {\n this.container.classList.add(\"caretAnnotation\");\n\n if (!this.data.popupRef && this.hasPopupData) {\n this._createPopup();\n }\n return this.container;\n }\n}\n\nclass InkAnnotationElement extends AnnotationElement {\n #polylinesGroupElement = null;\n\n #polylines = [];\n\n constructor(parameters) {\n super(parameters, { isRenderable: true, 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 this.annotationEditorType =\n this.data.it === \"InkHighlight\"\n ? AnnotationEditorType.HIGHLIGHT\n : AnnotationEditorType.INK;\n }\n\n #getTransform(rotation, rect) {\n // PDF coordinates are calculated from a bottom left origin, so\n // transform the polyline coordinates to a top left origin for the\n // SVG element.\n switch (rotation) {\n case 90:\n return {\n transform: `rotate(90) translate(${-rect[0]},${rect[1]}) scale(1,-1)`,\n width: rect[3] - rect[1],\n height: rect[2] - rect[0],\n };\n case 180:\n return {\n transform: `rotate(180) translate(${-rect[2]},${rect[1]}) scale(1,-1)`,\n width: rect[2] - rect[0],\n height: rect[3] - rect[1],\n };\n case 270:\n return {\n transform: `rotate(270) translate(${-rect[2]},${rect[3]}) scale(1,-1)`,\n width: rect[3] - rect[1],\n height: rect[2] - rect[0],\n };\n default:\n return {\n transform: `translate(${-rect[0]},${rect[3]}) scale(1,-1)`,\n width: rect[2] - rect[0],\n height: rect[3] - rect[1],\n };\n }\n }\n\n render() {\n this.container.classList.add(this.containerClassName);\n\n // Create an invisible polyline with the same points that acts as the\n // trigger for the popup.\n const {\n data: { rect, rotation, inkLists, borderStyle, popupRef },\n } = this;\n const { transform, width, height } = this.#getTransform(rotation, rect);\n\n const svg = this.svgFactory.create(\n width,\n height,\n /* skipDimensions = */ true\n );\n const g = (this.#polylinesGroupElement =\n this.svgFactory.createElement(\"svg:g\"));\n svg.append(g);\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 g.setAttribute(\"stroke-width\", borderStyle.width || 1);\n g.setAttribute(\"stroke-linecap\", \"round\");\n g.setAttribute(\"stroke-linejoin\", \"round\");\n g.setAttribute(\"stroke-miterlimit\", 10);\n g.setAttribute(\"stroke\", \"transparent\");\n g.setAttribute(\"fill\", \"transparent\");\n g.setAttribute(\"transform\", transform);\n\n for (let i = 0, ii = inkLists.length; i < ii; i++) {\n const polyline = this.svgFactory.createElement(this.svgElementName);\n this.#polylines.push(polyline);\n polyline.setAttribute(\"points\", inkLists[i].join(\",\"));\n g.append(polyline);\n }\n\n if (!popupRef && this.hasPopupData) {\n this._createPopup();\n }\n\n this.container.append(svg);\n this._editOnDoubleClick();\n\n return this.container;\n }\n\n updateEdited(params) {\n super.updateEdited(params);\n const { thickness, points, rect } = params;\n const g = this.#polylinesGroupElement;\n if (thickness >= 0) {\n g.setAttribute(\"stroke-width\", thickness || 1);\n }\n if (points) {\n for (let i = 0, ii = this.#polylines.length; i < ii; i++) {\n this.#polylines[i].setAttribute(\"points\", points[i].join(\",\"));\n }\n }\n if (rect) {\n const { transform, width, height } = this.#getTransform(\n this.data.rotation,\n rect\n );\n const root = g.parentElement;\n root.setAttribute(\"viewBox\", `0 0 ${width} ${height}`);\n g.setAttribute(\"transform\", transform);\n }\n }\n\n getElementsToTriggerPopup() {\n return this.#polylines;\n }\n\n addHighlightArea() {\n this.container.classList.add(\"highlightArea\");\n }\n\n get commentButtonPosition() {\n const { inkLists, rect } = this.data;\n if (inkLists?.length >= 1) {\n let maxX = -Infinity;\n let maxY = -Infinity;\n for (const inkList of inkLists) {\n for (let i = 0, ii = inkList.length; i < ii; i += 2) {\n if (inkList[i + 1] > maxY) {\n maxY = inkList[i + 1];\n maxX = inkList[i];\n } else if (inkList[i + 1] === maxY) {\n maxX = Math.max(maxX, inkList[i]);\n }\n }\n }\n if (maxX !== Infinity) {\n return [maxX, maxY];\n }\n }\n if (rect) {\n return [rect[2], rect[3]];\n }\n return null;\n }\n}\n\nclass HighlightAnnotationElement extends AnnotationElement {\n constructor(parameters) {\n super(parameters, {\n isRenderable: true,\n ignoreBorder: true,\n createQuadrilaterals: true,\n });\n this.annotationEditorType = AnnotationEditorType.HIGHLIGHT;\n }\n\n render() {\n const {\n data: { overlaidText, popupRef },\n } = this;\n if (!popupRef && this.hasPopupData) {\n this._createPopup();\n }\n\n this.container.classList.add(\"highlightAnnotation\");\n this._editOnDoubleClick();\n\n if (overlaidText) {\n const mark = document.createElement(\"mark\");\n mark.classList.add(\"overlaidText\");\n mark.textContent = overlaidText;\n this.container.append(mark);\n }\n\n return this.container;\n }\n}\n\nclass UnderlineAnnotationElement extends AnnotationElement {\n constructor(parameters) {\n super(parameters, {\n isRenderable: true,\n ignoreBorder: true,\n createQuadrilaterals: true,\n });\n }\n\n render() {\n const {\n data: { overlaidText, popupRef },\n } = this;\n if (!popupRef && this.hasPopupData) {\n this._createPopup();\n }\n\n this.container.classList.add(\"underlineAnnotation\");\n\n if (overlaidText) {\n const underline = document.createElement(\"u\");\n underline.classList.add(\"overlaidText\");\n underline.textContent = overlaidText;\n this.container.append(underline);\n }\n\n return this.container;\n }\n}\n\nclass SquigglyAnnotationElement extends AnnotationElement {\n constructor(parameters) {\n super(parameters, {\n isRenderable: true,\n ignoreBorder: true,\n createQuadrilaterals: true,\n });\n }\n\n render() {\n const {\n data: { overlaidText, popupRef },\n } = this;\n if (!popupRef && this.hasPopupData) {\n this._createPopup();\n }\n\n this.container.classList.add(\"squigglyAnnotation\");\n\n if (overlaidText) {\n const underline = document.createElement(\"u\");\n underline.classList.add(\"overlaidText\");\n underline.textContent = overlaidText;\n this.container.append(underline);\n }\n\n return this.container;\n }\n}\n\nclass StrikeOutAnnotationElement extends AnnotationElement {\n constructor(parameters) {\n super(parameters, {\n isRenderable: true,\n ignoreBorder: true,\n createQuadrilaterals: true,\n });\n }\n\n render() {\n const {\n data: { overlaidText, popupRef },\n } = this;\n if (!popupRef && this.hasPopupData) {\n this._createPopup();\n }\n\n this.container.classList.add(\"strikeoutAnnotation\");\n\n if (overlaidText) {\n const strikeout = document.createElement(\"s\");\n strikeout.classList.add(\"overlaidText\");\n strikeout.textContent = overlaidText;\n this.container.append(strikeout);\n }\n\n return this.container;\n }\n}\n\nclass StampAnnotationElement extends AnnotationElement {\n constructor(parameters) {\n super(parameters, { isRenderable: true, ignoreBorder: true });\n this.annotationEditorType = AnnotationEditorType.STAMP;\n }\n\n render() {\n this.container.classList.add(\"stampAnnotation\");\n this.container.setAttribute(\"role\", \"img\");\n\n if (!this.data.popupRef && this.hasPopupData) {\n this._createPopup();\n }\n this._editOnDoubleClick();\n\n return this.container;\n }\n}\n\nclass FileAttachmentAnnotationElement extends AnnotationElement {\n #trigger = null;\n\n constructor(parameters) {\n super(parameters, { isRenderable: true });\n\n const { file } = this.data;\n this.filename = file.filename;\n this.content = file.content;\n\n this.linkService.eventBus?.dispatch(\"fileattachmentannotation\", {\n source: this,\n ...file,\n });\n }\n\n render() {\n this.container.classList.add(\"fileAttachmentAnnotation\");\n\n const { container, data } = this;\n let trigger;\n if (data.hasAppearance || data.fillAlpha === 0) {\n trigger = document.createElement(\"div\");\n } else {\n // Unfortunately it seems that it's not clearly specified exactly what\n // names are actually valid, since Table 184 contains:\n // Conforming readers shall provide predefined icon appearances for at\n // least the following standard names: GraphPushPin, PaperclipTag.\n // Additional names may be supported as well. Default value: PushPin.\n trigger = document.createElement(\"img\");\n trigger.src = `${this.imageResourcesPath}annotation-${\n /paperclip/i.test(data.name) ? \"paperclip\" : \"pushpin\"\n }.svg`;\n\n if (data.fillAlpha && data.fillAlpha < 1) {\n trigger.style = `filter: opacity(${Math.round(\n data.fillAlpha * 100\n )}%);`;\n\n if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"TESTING\")) {\n this.container.classList.add(\"hasFillAlpha\");\n }\n }\n }\n trigger.addEventListener(\"dblclick\", this.#download.bind(this));\n this.#trigger = trigger;\n\n const { isMac } = FeatureTest.platform;\n container.addEventListener(\"keydown\", evt => {\n if (evt.key === \"Enter\" && (isMac ? evt.metaKey : evt.ctrlKey)) {\n this.#download();\n }\n });\n\n if (!data.popupRef && this.hasPopupData) {\n this._createPopup();\n } else {\n trigger.classList.add(\"popupTriggerArea\");\n }\n\n container.append(trigger);\n return container;\n }\n\n getElementsToTriggerPopup() {\n return this.#trigger;\n }\n\n addHighlightArea() {\n this.container.classList.add(\"highlightArea\");\n }\n\n /**\n * Download the file attachment associated with this annotation.\n */\n #download() {\n this.downloadManager?.openOrDownloadData(this.content, this.filename);\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 {AnnotationStorage} [annotationStorage]\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 {Object<string, Array<Object>> | null} [fieldObjects]\n * @property {Map<string, HTMLCanvasElement>} [annotationCanvasMap]\n * @property {TextAccessibilityManager} [accessibilityManager]\n * @property {AnnotationEditorUIManager} [annotationEditorUIManager]\n * @property {StructTreeLayerBuilder} [structTreeLayer]\n */\n\n/**\n * Manage the layer containing all the annotations.\n */\nclass AnnotationLayer {\n #accessibilityManager = null;\n\n #annotationCanvasMap = null;\n\n #editableAnnotations = new Map();\n\n #structTreeLayer = null;\n\n constructor({\n div,\n accessibilityManager,\n annotationCanvasMap,\n annotationEditorUIManager,\n page,\n viewport,\n structTreeLayer,\n }) {\n this.div = div;\n this.#accessibilityManager = accessibilityManager;\n this.#annotationCanvasMap = annotationCanvasMap;\n this.#structTreeLayer = structTreeLayer || null;\n this.page = page;\n this.viewport = viewport;\n this.zIndex = 0;\n this._annotationEditorUIManager = annotationEditorUIManager;\n\n if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"TESTING\")) {\n // For testing purposes.\n Object.defineProperty(this, \"showPopups\", {\n value: async () => {\n for (const show of this.popupShow) {\n await show();\n }\n },\n });\n this.popupShow = [];\n }\n }\n\n hasEditableAnnotations() {\n return this.#editableAnnotations.size > 0;\n }\n\n async #appendElement(element, id, popupElements) {\n const contentElement = element.firstChild || element;\n const annotationId = (contentElement.id = `${AnnotationPrefix}${id}`);\n const ariaAttributes =\n await this.#structTreeLayer?.getAriaAttributes(annotationId);\n if (ariaAttributes) {\n for (const [key, value] of ariaAttributes) {\n contentElement.setAttribute(key, value);\n }\n }\n\n if (popupElements) {\n // Set the popup just after the first element associated with the popup.\n popupElements.at(-1).container.after(element);\n } else {\n this.div.append(element);\n this.#accessibilityManager?.moveElementInDOM(\n this.div,\n element,\n contentElement,\n /* isRemovable = */ false\n );\n }\n }\n\n /**\n * Render a new annotation layer with all annotation elements.\n *\n * @param {AnnotationLayerParameters} params\n * @memberof AnnotationLayer\n */\n async render(params) {\n const { annotations } = params;\n const layer = this.div;\n setLayerDimensions(layer, this.viewport);\n\n const popupToElements = new Map();\n const elementParams = {\n data: null,\n layer,\n linkService: params.linkService,\n downloadManager: params.downloadManager,\n imageResourcesPath: params.imageResourcesPath || \"\",\n renderForms: params.renderForms !== false,\n svgFactory: new DOMSVGFactory(),\n annotationStorage: params.annotationStorage || new AnnotationStorage(),\n enableComment: params.enableComment === true,\n enableScripting: params.enableScripting === true,\n hasJSActions: params.hasJSActions,\n fieldObjects: params.fieldObjects,\n parent: this,\n elements: null,\n };\n\n for (const data of annotations) {\n if (data.noHTML) {\n continue;\n }\n const isPopupAnnotation = data.annotationType === AnnotationType.POPUP;\n if (!isPopupAnnotation) {\n if (data.rect[2] === data.rect[0] || data.rect[3] === data.rect[1]) {\n continue; // Ignore empty annotations.\n }\n } else {\n const elements = popupToElements.get(data.id);\n if (!elements) {\n // Ignore popup annotations without a corresponding annotation.\n continue;\n }\n elementParams.elements = elements;\n }\n elementParams.data = data;\n const element = AnnotationElementFactory.create(elementParams);\n\n if (!element.isRenderable) {\n continue;\n }\n\n if (!isPopupAnnotation && data.popupRef) {\n const elements = popupToElements.get(data.popupRef);\n if (!elements) {\n popupToElements.set(data.popupRef, [element]);\n } else {\n elements.push(element);\n }\n }\n\n const rendered = element.render();\n if (data.hidden) {\n rendered.style.visibility = \"hidden\";\n }\n await this.#appendElement(rendered, data.id, elementParams.elements);\n\n if (element._isEditable) {\n this.#editableAnnotations.set(element.data.id, element);\n this._annotationEditorUIManager?.renderAnnotationElement(element);\n }\n }\n\n this.#setAnnotationCanvasMap();\n }\n\n /**\n * Add link annotations to the annotation layer.\n *\n * @param {Array<Object>} annotations\n * @param {IPDFLinkService} linkService\n * @memberof AnnotationLayer\n */\n async addLinkAnnotations(annotations, linkService) {\n const elementParams = {\n data: null,\n layer: this.div,\n linkService,\n svgFactory: new DOMSVGFactory(),\n parent: this,\n };\n for (const data of annotations) {\n data.borderStyle ||= AnnotationLayer._defaultBorderStyle;\n\n elementParams.data = data;\n const element = AnnotationElementFactory.create(elementParams);\n\n if (!element.isRenderable) {\n continue;\n }\n const rendered = element.render();\n await this.#appendElement(rendered, data.id, null);\n }\n }\n\n /**\n * Update the annotation elements on existing annotation layer.\n *\n * @param {AnnotationLayerParameters} viewport\n * @memberof AnnotationLayer\n */\n update({ viewport }) {\n const layer = this.div;\n this.viewport = viewport;\n setLayerDimensions(layer, { rotation: viewport.rotation });\n\n this.#setAnnotationCanvasMap();\n layer.hidden = false;\n }\n\n #setAnnotationCanvasMap() {\n if (!this.#annotationCanvasMap) {\n return;\n }\n const layer = this.div;\n for (const [id, canvas] of this.#annotationCanvasMap) {\n const element = layer.querySelector(`[data-annotation-id=\"${id}\"]`);\n if (!element) {\n continue;\n }\n\n canvas.className = \"annotationContent\";\n const { firstChild } = element;\n if (!firstChild) {\n element.append(canvas);\n } else if (firstChild.nodeName === \"CANVAS\") {\n firstChild.replaceWith(canvas);\n } else if (!firstChild.classList.contains(\"annotationContent\")) {\n firstChild.before(canvas);\n } else {\n firstChild.after(canvas);\n }\n\n const editableAnnotation = this.#editableAnnotations.get(id);\n if (!editableAnnotation) {\n continue;\n }\n if (editableAnnotation._hasNoCanvas) {\n // The canvas wasn't available when the annotation was created.\n this._annotationEditorUIManager?.setMissingCanvas(\n id,\n element.id,\n canvas\n );\n editableAnnotation._hasNoCanvas = false;\n } else {\n editableAnnotation.canvas = canvas;\n }\n }\n this.#annotationCanvasMap.clear();\n }\n\n getEditableAnnotations() {\n return Array.from(this.#editableAnnotations.values());\n }\n\n getEditableAnnotation(id) {\n return this.#editableAnnotations.get(id);\n }\n\n /**\n * @private\n */\n static get _defaultBorderStyle() {\n return shadow(\n this,\n \"_defaultBorderStyle\",\n Object.freeze({\n width: 1,\n rawWidth: 1,\n style: AnnotationBorderStyleType.SOLID,\n dashArray: [3],\n horizontalCornerRadius: 0,\n verticalCornerRadius: 0,\n })\n );\n }\n}\n\nexport {\n AnnotationLayer,\n FreeTextAnnotationElement,\n HighlightAnnotationElement,\n InkAnnotationElement,\n StampAnnotationElement,\n};\n","/* Copyright 2022 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// eslint-disable-next-line max-len\n/** @typedef {import(\"./annotation_editor_layer.js\").AnnotationEditorLayer} AnnotationEditorLayer */\n\nimport {\n AnnotationEditorParamsType,\n AnnotationEditorType,\n assert,\n LINE_FACTOR,\n shadow,\n Util,\n} from \"../../shared/util.js\";\nimport { AnnotationEditorUIManager, KeyboardManager } from \"./tools.js\";\nimport { AnnotationEditor } from \"./editor.js\";\nimport { BasicColorPicker } from \"./color_picker.js\";\nimport { FreeTextAnnotationElement } from \"../annotation_layer.js\";\n\nconst EOL_PATTERN = /\\r\\n?|\\n/g;\n\n/**\n * Basic text editor in order to create a FreeTex annotation.\n */\nclass FreeTextEditor extends AnnotationEditor {\n #color;\n\n #content = \"\";\n\n #editorDivId = `${this.id}-editor`;\n\n #editModeAC = null;\n\n #fontSize;\n\n _colorPicker = null;\n\n static _freeTextDefaultContent = \"\";\n\n static _internalPadding = 0;\n\n static _defaultColor = null;\n\n static _defaultFontSize = 10;\n\n static get _keyboardManager() {\n const proto = FreeTextEditor.prototype;\n\n const arrowChecker = self => self.isEmpty();\n\n const small = AnnotationEditorUIManager.TRANSLATE_SMALL;\n const big = AnnotationEditorUIManager.TRANSLATE_BIG;\n\n return shadow(\n this,\n \"_keyboardManager\",\n new KeyboardManager([\n [\n // Commit the text in case the user use ctrl+s to save the document.\n // The event must bubble in order to be caught by the viewer.\n // See bug 1831574.\n [\"ctrl+s\", \"mac+meta+s\", \"ctrl+p\", \"mac+meta+p\"],\n proto.commitOrRemove,\n { bubbles: true },\n ],\n [\n [\"ctrl+Enter\", \"mac+meta+Enter\", \"Escape\", \"mac+Escape\"],\n proto.commitOrRemove,\n ],\n [\n [\"ArrowLeft\", \"mac+ArrowLeft\"],\n proto._translateEmpty,\n { args: [-small, 0], checker: arrowChecker },\n ],\n [\n [\"ctrl+ArrowLeft\", \"mac+shift+ArrowLeft\"],\n proto._translateEmpty,\n { args: [-big, 0], checker: arrowChecker },\n ],\n [\n [\"ArrowRight\", \"mac+ArrowRight\"],\n proto._translateEmpty,\n { args: [small, 0], checker: arrowChecker },\n ],\n [\n [\"ctrl+ArrowRight\", \"mac+shift+ArrowRight\"],\n proto._translateEmpty,\n { args: [big, 0], checker: arrowChecker },\n ],\n [\n [\"ArrowUp\", \"mac+ArrowUp\"],\n proto._translateEmpty,\n { args: [0, -small], checker: arrowChecker },\n ],\n [\n [\"ctrl+ArrowUp\", \"mac+shift+ArrowUp\"],\n proto._translateEmpty,\n { args: [0, -big], checker: arrowChecker },\n ],\n [\n [\"ArrowDown\", \"mac+ArrowDown\"],\n proto._translateEmpty,\n { args: [0, small], checker: arrowChecker },\n ],\n [\n [\"ctrl+ArrowDown\", \"mac+shift+ArrowDown\"],\n proto._translateEmpty,\n { args: [0, big], checker: arrowChecker },\n ],\n ])\n );\n }\n\n static _type = \"freetext\";\n\n static _editorType = AnnotationEditorType.FREETEXT;\n\n constructor(params) {\n super({ ...params, name: \"freeTextEditor\" });\n this.#color =\n params.color ||\n FreeTextEditor._defaultColor ||\n AnnotationEditor._defaultLineColor;\n this.#fontSize = params.fontSize || FreeTextEditor._defaultFontSize;\n if (!this.annotationElementId) {\n this._uiManager.a11yAlert(\"pdfjs-editor-freetext-added-alert\");\n }\n }\n\n /** @inheritdoc */\n static initialize(l10n, uiManager) {\n AnnotationEditor.initialize(l10n, uiManager);\n const style = getComputedStyle(document.documentElement);\n\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) {\n const lineHeight = parseFloat(\n style.getPropertyValue(\"--freetext-line-height\")\n );\n assert(\n lineHeight === LINE_FACTOR,\n \"Update the CSS variable to agree with the constant.\"\n );\n }\n\n this._internalPadding = parseFloat(\n style.getPropertyValue(\"--freetext-padding\")\n );\n }\n\n /** @inheritdoc */\n static updateDefaultParams(type, value) {\n switch (type) {\n case AnnotationEditorParamsType.FREETEXT_SIZE:\n FreeTextEditor._defaultFontSize = value;\n break;\n case AnnotationEditorParamsType.FREETEXT_COLOR:\n FreeTextEditor._defaultColor = value;\n break;\n }\n }\n\n /** @inheritdoc */\n updateParams(type, value) {\n switch (type) {\n case AnnotationEditorParamsType.FREETEXT_SIZE:\n this.#updateFontSize(value);\n break;\n case AnnotationEditorParamsType.FREETEXT_COLOR:\n this.#updateColor(value);\n break;\n }\n }\n\n /** @inheritdoc */\n static get defaultPropertiesToUpdate() {\n return [\n [\n AnnotationEditorParamsType.FREETEXT_SIZE,\n FreeTextEditor._defaultFontSize,\n ],\n [\n AnnotationEditorParamsType.FREETEXT_COLOR,\n FreeTextEditor._defaultColor || AnnotationEditor._defaultLineColor,\n ],\n ];\n }\n\n /** @inheritdoc */\n get propertiesToUpdate() {\n return [\n [AnnotationEditorParamsType.FREETEXT_SIZE, this.#fontSize],\n [AnnotationEditorParamsType.FREETEXT_COLOR, this.#color],\n ];\n }\n\n /** @inheritdoc */\n get toolbarButtons() {\n this._colorPicker ||= new BasicColorPicker(this);\n return [[\"colorPicker\", this._colorPicker]];\n }\n\n get colorType() {\n return AnnotationEditorParamsType.FREETEXT_COLOR;\n }\n\n get colorValue() {\n return this.#color;\n }\n\n /**\n * Update the font size and make this action as undoable.\n * @param {number} fontSize\n */\n #updateFontSize(fontSize) {\n const setFontsize = size => {\n this.editorDiv.style.fontSize = `calc(${size}px * var(--total-scale-factor))`;\n this.translate(0, -(size - this.#fontSize) * this.parentScale);\n this.#fontSize = size;\n this.#setEditorDimensions();\n };\n const savedFontsize = this.#fontSize;\n this.addCommands({\n cmd: setFontsize.bind(this, fontSize),\n undo: setFontsize.bind(this, savedFontsize),\n post: this._uiManager.updateUI.bind(this._uiManager, this),\n mustExec: true,\n type: AnnotationEditorParamsType.FREETEXT_SIZE,\n overwriteIfSameType: true,\n keepUndo: true,\n });\n }\n\n /**\n * Update the color and make this action undoable.\n * @param {string} color\n */\n #updateColor(color) {\n const setColor = col => {\n this.#color = this.editorDiv.style.color = col;\n this._colorPicker?.update(col);\n };\n const savedColor = this.#color;\n this.addCommands({\n cmd: setColor.bind(this, color),\n undo: setColor.bind(this, savedColor),\n post: this._uiManager.updateUI.bind(this._uiManager, this),\n mustExec: true,\n type: AnnotationEditorParamsType.FREETEXT_COLOR,\n overwriteIfSameType: true,\n keepUndo: true,\n });\n }\n\n /**\n * Helper to translate the editor with the keyboard when it's empty.\n * @param {number} x in page units.\n * @param {number} y in page units.\n */\n _translateEmpty(x, y) {\n this._uiManager.translateSelectedEditors(x, y, /* noCommit = */ true);\n }\n\n /** @inheritdoc */\n getInitialTranslation() {\n // The start of the base line is where the user clicked.\n const scale = this.parentScale;\n return [\n -FreeTextEditor._internalPadding * scale,\n -(FreeTextEditor._internalPadding + this.#fontSize) * scale,\n ];\n }\n\n /** @inheritdoc */\n rebuild() {\n if (!this.parent) {\n return;\n }\n super.rebuild();\n if (this.div === null) {\n return;\n }\n\n if (!this.isAttachedToDOM) {\n // At some point this editor was removed and we're rebuilting it,\n // hence we must add it to its parent.\n this.parent.add(this);\n }\n }\n\n /** @inheritdoc */\n enableEditMode() {\n if (!super.enableEditMode()) {\n return false;\n }\n\n this.overlayDiv.classList.remove(\"enabled\");\n this.editorDiv.contentEditable = true;\n this._isDraggable = false;\n this.div.removeAttribute(\"aria-activedescendant\");\n\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) {\n assert(\n !this.#editModeAC,\n \"No `this.#editModeAC` AbortController should exist.\"\n );\n }\n this.#editModeAC = new AbortController();\n const signal = this._uiManager.combinedSignal(this.#editModeAC);\n\n this.editorDiv.addEventListener(\n \"keydown\",\n this.editorDivKeydown.bind(this),\n { signal }\n );\n this.editorDiv.addEventListener(\"focus\", this.editorDivFocus.bind(this), {\n signal,\n });\n this.editorDiv.addEventListener(\"blur\", this.editorDivBlur.bind(this), {\n signal,\n });\n this.editorDiv.addEventListener(\"input\", this.editorDivInput.bind(this), {\n signal,\n });\n this.editorDiv.addEventListener(\"paste\", this.editorDivPaste.bind(this), {\n signal,\n });\n\n return true;\n }\n\n /** @inheritdoc */\n disableEditMode() {\n if (!super.disableEditMode()) {\n return false;\n }\n\n this.overlayDiv.classList.add(\"enabled\");\n this.editorDiv.contentEditable = false;\n this.div.setAttribute(\"aria-activedescendant\", this.#editorDivId);\n this._isDraggable = true;\n\n this.#editModeAC?.abort();\n this.#editModeAC = null;\n\n // On Chrome, the focus is given to <body> when contentEditable is set to\n // false, hence we focus the div.\n this.div.focus({\n preventScroll: true /* See issue #15744 */,\n });\n\n // In case the blur callback hasn't been called.\n this.isEditing = false;\n this.parent.div.classList.add(\"freetextEditing\");\n\n return true;\n }\n\n /** @inheritdoc */\n focusin(event) {\n if (!this._focusEventsAllowed) {\n return;\n }\n super.focusin(event);\n if (event.target !== this.editorDiv) {\n this.editorDiv.focus();\n }\n }\n\n /** @inheritdoc */\n onceAdded(focus) {\n if (this.width) {\n // The editor was created in using ctrl+c.\n return;\n }\n this.enableEditMode();\n if (focus) {\n this.editorDiv.focus();\n }\n if (this._initialOptions?.isCentered) {\n this.center();\n }\n this._initialOptions = null;\n }\n\n /** @inheritdoc */\n isEmpty() {\n return !this.editorDiv || this.editorDiv.innerText.trim() === \"\";\n }\n\n /** @inheritdoc */\n remove() {\n this.isEditing = false;\n if (this.parent) {\n this.parent.setEditingState(true);\n this.parent.div.classList.add(\"freetextEditing\");\n }\n super.remove();\n }\n\n /**\n * Extract the text from this editor.\n * @returns {string}\n */\n #extractText() {\n // We don't use innerText because there are some bugs with line breaks.\n const buffer = [];\n this.editorDiv.normalize();\n let prevChild = null;\n for (const child of this.editorDiv.childNodes) {\n if (prevChild?.nodeType === Node.TEXT_NODE && child.nodeName === \"BR\") {\n // It can happen if the user uses shift+enter to add a new line.\n // If we don't skip it, we'll end up with an extra line (one for the\n // text and one for the br element).\n continue;\n }\n buffer.push(FreeTextEditor.#getNodeContent(child));\n prevChild = child;\n }\n return buffer.join(\"\\n\");\n }\n\n #setEditorDimensions() {\n const [parentWidth, parentHeight] = this.parentDimensions;\n\n let rect;\n if (this.isAttachedToDOM) {\n rect = this.div.getBoundingClientRect();\n } else {\n // This editor isn't on screen but we need to get its dimensions, so\n // we just insert it in the DOM, get its bounding box and then remove it.\n const { currentLayer, div } = this;\n const savedDisplay = div.style.display;\n const savedVisibility = div.classList.contains(\"hidden\");\n div.classList.remove(\"hidden\");\n div.style.display = \"hidden\";\n currentLayer.div.append(this.div);\n rect = div.getBoundingClientRect();\n div.remove();\n div.style.display = savedDisplay;\n div.classList.toggle(\"hidden\", savedVisibility);\n }\n\n // The dimensions are relative to the rotation of the page, hence we need to\n // take that into account (see issue #16636).\n if (this.rotation % 180 === this.parentRotation % 180) {\n this.width = rect.width / parentWidth;\n this.height = rect.height / parentHeight;\n } else {\n this.width = rect.height / parentWidth;\n this.height = rect.width / parentHeight;\n }\n this.fixAndSetPosition();\n }\n\n /**\n * Commit the content we have in this editor.\n * @returns {undefined}\n */\n commit() {\n if (!this.isInEditMode()) {\n return;\n }\n\n super.commit();\n this.disableEditMode();\n const savedText = this.#content;\n const newText = (this.#content = this.#extractText().trimEnd());\n if (savedText === newText) {\n return;\n }\n\n const setText = text => {\n this.#content = text;\n if (!text) {\n this.remove();\n return;\n }\n this.#setContent();\n this._uiManager.rebuild(this);\n this.#setEditorDimensions();\n };\n this.addCommands({\n cmd: () => {\n setText(newText);\n },\n undo: () => {\n setText(savedText);\n },\n mustExec: false,\n });\n this.#setEditorDimensions();\n }\n\n /** @inheritdoc */\n shouldGetKeyboardEvents() {\n return this.isInEditMode();\n }\n\n /** @inheritdoc */\n enterInEditMode() {\n this.enableEditMode();\n this.editorDiv.focus();\n }\n\n /** @inheritdoc */\n keydown(event) {\n if (event.target === this.div && event.key === \"Enter\") {\n this.enterInEditMode();\n // Avoid to add an unwanted new line.\n event.preventDefault();\n }\n }\n\n editorDivKeydown(event) {\n FreeTextEditor._keyboardManager.exec(this, event);\n }\n\n editorDivFocus(event) {\n this.isEditing = true;\n }\n\n editorDivBlur(event) {\n this.isEditing = false;\n }\n\n editorDivInput(event) {\n this.parent.div.classList.toggle(\"freetextEditing\", this.isEmpty());\n }\n\n /** @inheritdoc */\n disableEditing() {\n this.editorDiv.setAttribute(\"role\", \"comment\");\n this.editorDiv.removeAttribute(\"aria-multiline\");\n }\n\n /** @inheritdoc */\n enableEditing() {\n this.editorDiv.setAttribute(\"role\", \"textbox\");\n this.editorDiv.setAttribute(\"aria-multiline\", true);\n }\n\n /** @inheritdoc */\n get canChangeContent() {\n return true;\n }\n\n /** @inheritdoc */\n render() {\n if (this.div) {\n return this.div;\n }\n\n let baseX, baseY;\n if (this._isCopy || this.annotationElementId) {\n baseX = this.x;\n baseY = this.y;\n }\n\n super.render();\n this.editorDiv = document.createElement(\"div\");\n this.editorDiv.className = \"internal\";\n\n this.editorDiv.setAttribute(\"id\", this.#editorDivId);\n this.editorDiv.setAttribute(\"data-l10n-id\", \"pdfjs-free-text2\");\n this.editorDiv.setAttribute(\"data-l10n-attrs\", \"default-content\");\n this.enableEditing();\n\n this.editorDiv.contentEditable = true;\n\n const { style } = this.editorDiv;\n style.fontSize = `calc(${this.#fontSize}px * var(--total-scale-factor))`;\n style.color = this.#color;\n\n this.div.append(this.editorDiv);\n\n this.overlayDiv = document.createElement(\"div\");\n this.overlayDiv.classList.add(\"overlay\", \"enabled\");\n this.div.append(this.overlayDiv);\n\n if (this._isCopy || this.annotationElementId) {\n // This editor was created in using copy (ctrl+c).\n const [parentWidth, parentHeight] = this.parentDimensions;\n if (this.annotationElementId) {\n // This stuff is hard to test: if something is changed here, please\n // test with the following PDF file:\n // - freetexts.pdf\n // - rotated_freetexts.pdf\n // Only small variations between the original annotation and its editor\n // are allowed.\n\n // position is the position of the first glyph in the annotation\n // and it's relative to its container.\n const { position } = this._initialData;\n let [tx, ty] = this.getInitialTranslation();\n [tx, ty] = this.pageTranslationToScreen(tx, ty);\n const [pageWidth, pageHeight] = this.pageDimensions;\n const [pageX, pageY] = this.pageTranslation;\n let posX, posY;\n switch (this.rotation) {\n case 0:\n posX = baseX + (position[0] - pageX) / pageWidth;\n posY = baseY + this.height - (position[1] - pageY) / pageHeight;\n break;\n case 90:\n posX = baseX + (position[0] - pageX) / pageWidth;\n posY = baseY - (position[1] - pageY) / pageHeight;\n [tx, ty] = [ty, -tx];\n break;\n case 180:\n posX = baseX - this.width + (position[0] - pageX) / pageWidth;\n posY = baseY - (position[1] - pageY) / pageHeight;\n [tx, ty] = [-tx, -ty];\n break;\n case 270:\n posX =\n baseX +\n (position[0] - pageX - this.height * pageHeight) / pageWidth;\n posY =\n baseY +\n (position[1] - pageY - this.width * pageWidth) / pageHeight;\n [tx, ty] = [-ty, tx];\n break;\n }\n this.setAt(posX * parentWidth, posY * parentHeight, tx, ty);\n } else {\n this._moveAfterPaste(baseX, baseY);\n }\n\n this.#setContent();\n this._isDraggable = true;\n this.editorDiv.contentEditable = false;\n } else {\n this._isDraggable = false;\n this.editorDiv.contentEditable = true;\n }\n\n if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"TESTING\")) {\n this.div.setAttribute(\"annotation-id\", this.annotationElementId);\n }\n\n return this.div;\n }\n\n static #getNodeContent(node) {\n return (\n node.nodeType === Node.TEXT_NODE ? node.nodeValue : node.innerText\n ).replaceAll(EOL_PATTERN, \"\");\n }\n\n editorDivPaste(event) {\n const clipboardData = event.clipboardData || window.clipboardData;\n const { types } = clipboardData;\n if (types.length === 1 && types[0] === \"text/plain\") {\n return;\n }\n\n event.preventDefault();\n const paste = FreeTextEditor.#deserializeContent(\n clipboardData.getData(\"text\") || \"\"\n ).replaceAll(EOL_PATTERN, \"\\n\");\n if (!paste) {\n return;\n }\n const selection = window.getSelection();\n if (!selection.rangeCount) {\n return;\n }\n this.editorDiv.normalize();\n selection.deleteFromDocument();\n const range = selection.getRangeAt(0);\n if (!paste.includes(\"\\n\")) {\n range.insertNode(document.createTextNode(paste));\n this.editorDiv.normalize();\n selection.collapseToStart();\n return;\n }\n\n // Collect the text before and after the caret.\n const { startContainer, startOffset } = range;\n const bufferBefore = [];\n const bufferAfter = [];\n if (startContainer.nodeType === Node.TEXT_NODE) {\n const parent = startContainer.parentElement;\n bufferAfter.push(\n startContainer.nodeValue.slice(startOffset).replaceAll(EOL_PATTERN, \"\")\n );\n if (parent !== this.editorDiv) {\n let buffer = bufferBefore;\n for (const child of this.editorDiv.childNodes) {\n if (child === parent) {\n buffer = bufferAfter;\n continue;\n }\n buffer.push(FreeTextEditor.#getNodeContent(child));\n }\n }\n bufferBefore.push(\n startContainer.nodeValue\n .slice(0, startOffset)\n .replaceAll(EOL_PATTERN, \"\")\n );\n } else if (startContainer === this.editorDiv) {\n let buffer = bufferBefore;\n let i = 0;\n for (const child of this.editorDiv.childNodes) {\n if (i++ === startOffset) {\n buffer = bufferAfter;\n }\n buffer.push(FreeTextEditor.#getNodeContent(child));\n }\n }\n this.#content = `${bufferBefore.join(\"\\n\")}${paste}${bufferAfter.join(\"\\n\")}`;\n this.#setContent();\n\n // Set the caret at the right position.\n const newRange = new Range();\n let beforeLength = Math.sumPrecise(bufferBefore.map(line => line.length));\n for (const { firstChild } of this.editorDiv.childNodes) {\n // Each child is either a div with a text node or a br element.\n if (firstChild.nodeType === Node.TEXT_NODE) {\n const length = firstChild.nodeValue.length;\n if (beforeLength <= length) {\n newRange.setStart(firstChild, beforeLength);\n newRange.setEnd(firstChild, beforeLength);\n break;\n }\n beforeLength -= length;\n }\n }\n selection.removeAllRanges();\n selection.addRange(newRange);\n }\n\n #setContent() {\n this.editorDiv.replaceChildren();\n if (!this.#content) {\n return;\n }\n for (const line of this.#content.split(\"\\n\")) {\n const div = document.createElement(\"div\");\n div.append(\n line ? document.createTextNode(line) : document.createElement(\"br\")\n );\n this.editorDiv.append(div);\n }\n }\n\n #serializeContent() {\n return this.#content.replaceAll(\"\\xa0\", \" \");\n }\n\n static #deserializeContent(content) {\n return content.replaceAll(\" \", \"\\xa0\");\n }\n\n /** @inheritdoc */\n get contentDiv() {\n return this.editorDiv;\n }\n\n /** @inheritdoc */\n getPDFRect() {\n const padding = FreeTextEditor._internalPadding * this.parentScale;\n return this.getRect(padding, padding);\n }\n\n /** @inheritdoc */\n static async deserialize(data, parent, uiManager) {\n let initialData = null;\n if (data instanceof FreeTextAnnotationElement) {\n const {\n data: {\n defaultAppearanceData: { fontSize, fontColor },\n rect,\n rotation,\n id,\n popupRef,\n contentsObj,\n },\n textContent,\n textPosition,\n parent: {\n page: { pageNumber },\n },\n } = data;\n // textContent is supposed to be an array of strings containing each line\n // of text. However, it can be null or empty.\n if (!textContent || textContent.length === 0) {\n // Empty annotation.\n return null;\n }\n initialData = data = {\n annotationType: AnnotationEditorType.FREETEXT,\n color: Array.from(fontColor),\n fontSize,\n value: textContent.join(\"\\n\"),\n position: textPosition,\n pageIndex: pageNumber - 1,\n rect: rect.slice(0),\n rotation,\n annotationElementId: id,\n id,\n deleted: false,\n popupRef,\n comment: contentsObj?.str || null,\n };\n }\n const editor = await super.deserialize(data, parent, uiManager);\n editor.#fontSize = data.fontSize;\n editor.#color = Util.makeHexColor(...data.color);\n editor.#content = FreeTextEditor.#deserializeContent(data.value);\n editor._initialData = initialData;\n if (data.comment) {\n editor.setCommentData(data.comment);\n }\n\n return editor;\n }\n\n /** @inheritdoc */\n serialize(isForCopying = false) {\n if (this.isEmpty()) {\n return null;\n }\n\n if (this.deleted) {\n return this.serializeDeleted();\n }\n\n const rect = this.getPDFRect();\n const color = AnnotationEditor._colorManager.convert(\n this.isAttachedToDOM\n ? getComputedStyle(this.editorDiv).color\n : this.#color\n );\n\n const serialized = {\n annotationType: AnnotationEditorType.FREETEXT,\n color,\n fontSize: this.#fontSize,\n value: this.#serializeContent(),\n pageIndex: this.pageIndex,\n rect,\n rotation: this.rotation,\n structTreeParentId: this._structTreeParentId,\n };\n this.addComment(serialized);\n\n if (isForCopying) {\n // Don't add the id when copying because the pasted editor mustn't be\n // linked to an existing annotation.\n serialized.isCopy = true;\n return serialized;\n }\n\n if (this.annotationElementId && !this.#hasElementChanged(serialized)) {\n return null;\n }\n\n serialized.id = this.annotationElementId;\n\n return serialized;\n }\n\n #hasElementChanged(serialized) {\n const { value, fontSize, color, pageIndex } = this._initialData;\n\n return (\n this.hasEditedComment ||\n this._hasBeenMoved ||\n serialized.value !== value ||\n serialized.fontSize !== fontSize ||\n serialized.color.some((c, i) => c !== color[i]) ||\n serialized.pageIndex !== pageIndex\n );\n }\n\n /** @inheritdoc */\n renderAnnotationElement(annotation) {\n const content = super.renderAnnotationElement(annotation);\n if (!content) {\n return null;\n }\n const { style } = content;\n style.fontSize = `calc(${this.#fontSize}px * var(--total-scale-factor))`;\n style.color = this.#color;\n\n content.replaceChildren();\n for (const line of this.#content.split(\"\\n\")) {\n const div = document.createElement(\"div\");\n div.append(\n line ? document.createTextNode(line) : document.createElement(\"br\")\n );\n content.append(div);\n }\n\n const params = {\n rect: this.getPDFRect(),\n };\n params.popup = this.hasEditedComment\n ? this.comment\n : { text: this.#content };\n annotation.updateEdited(params);\n\n return content;\n }\n\n resetAnnotationElement(annotation) {\n super.resetAnnotationElement(annotation);\n annotation.resetEdited();\n }\n}\n\nexport { FreeTextEditor };\n","/* Copyright 2023 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { unreachable } from \"../../../shared/util.js\";\n\nclass Outline {\n static PRECISION = 1e-4;\n\n /**\n * @returns {string} The SVG path of the outline.\n */\n toSVGPath() {\n unreachable(\"Abstract method `toSVGPath` must be implemented.\");\n }\n\n /**\n * @type {Object|null} The bounding box of the outline.\n */\n // eslint-disable-next-line getter-return\n get box() {\n unreachable(\"Abstract getter `box` must be implemented.\");\n }\n\n serialize(_bbox, _rotation) {\n unreachable(\"Abstract method `serialize` must be implemented.\");\n }\n\n static _rescale(src, tx, ty, sx, sy, dest) {\n dest ||= new Float32Array(src.length);\n for (let i = 0, ii = src.length; i < ii; i += 2) {\n dest[i] = tx + src[i] * sx;\n dest[i + 1] = ty + src[i + 1] * sy;\n }\n return dest;\n }\n\n static _rescaleAndSwap(src, tx, ty, sx, sy, dest) {\n dest ||= new Float32Array(src.length);\n for (let i = 0, ii = src.length; i < ii; i += 2) {\n dest[i] = tx + src[i + 1] * sx;\n dest[i + 1] = ty + src[i] * sy;\n }\n return dest;\n }\n\n static _translate(src, tx, ty, dest) {\n dest ||= new Float32Array(src.length);\n for (let i = 0, ii = src.length; i < ii; i += 2) {\n dest[i] = tx + src[i];\n dest[i + 1] = ty + src[i + 1];\n }\n return dest;\n }\n\n static svgRound(x) {\n // 0.1234 will be 1234 and this way we economize 2 bytes per number.\n // Of course, it makes sense only when the viewBox is [0 0 10000 10000].\n // And it helps to avoid bugs like:\n // https://bugzilla.mozilla.org/show_bug.cgi?id=1929340\n return Math.round(x * 10000);\n }\n\n static _normalizePoint(x, y, parentWidth, parentHeight, rotation) {\n switch (rotation) {\n case 90:\n return [1 - y / parentWidth, x / parentHeight];\n case 180:\n return [1 - x / parentWidth, 1 - y / parentHeight];\n case 270:\n return [y / parentWidth, 1 - x / parentHeight];\n default:\n return [x / parentWidth, y / parentHeight];\n }\n }\n\n static _normalizePagePoint(x, y, rotation) {\n switch (rotation) {\n case 90:\n return [1 - y, x];\n case 180:\n return [1 - x, 1 - y];\n case 270:\n return [y, 1 - x];\n default:\n return [x, y];\n }\n }\n\n static createBezierPoints(x1, y1, x2, y2, x3, y3) {\n return [\n (x1 + 5 * x2) / 6,\n (y1 + 5 * y2) / 6,\n (5 * x2 + x3) / 6,\n (5 * y2 + y3) / 6,\n (x2 + x3) / 2,\n (y2 + y3) / 2,\n ];\n }\n}\n\nexport { Outline };\n","/* Copyright 2024 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 { Outline } from \"./outline.js\";\nimport { Util } from \"../../../shared/util.js\";\n\nclass FreeDrawOutliner {\n #box;\n\n #bottom = [];\n\n #innerMargin;\n\n #isLTR;\n\n #top = [];\n\n // The first 6 elements are the last 3 points of the top part of the outline.\n // The next 6 elements are the last 3 points of the line.\n // The next 6 elements are the last 3 points of the bottom part of the\n // outline.\n // We track the last 3 points in order to be able to:\n // - compute the normal of the line,\n // - compute the control points of the quadratic Bézier curve.\n #last = new Float32Array(18);\n\n #lastX;\n\n #lastY;\n\n #min;\n\n #min_dist;\n\n #scaleFactor;\n\n #thickness;\n\n #points = [];\n\n static #MIN_DIST = 8;\n\n static #MIN_DIFF = 2;\n\n static #MIN = FreeDrawOutliner.#MIN_DIST + FreeDrawOutliner.#MIN_DIFF;\n\n constructor({ x, y }, box, scaleFactor, thickness, isLTR, innerMargin = 0) {\n this.#box = box;\n this.#thickness = thickness * scaleFactor;\n this.#isLTR = isLTR;\n this.#last.set([NaN, NaN, NaN, NaN, x, y], 6);\n this.#innerMargin = innerMargin;\n this.#min_dist = FreeDrawOutliner.#MIN_DIST * scaleFactor;\n this.#min = FreeDrawOutliner.#MIN * scaleFactor;\n this.#scaleFactor = scaleFactor;\n this.#points.push(x, y);\n }\n\n isEmpty() {\n // When we add a second point then this.#last.slice(6) will be something\n // like [NaN, NaN, firstX, firstY, secondX, secondY,...] so having a NaN\n // at index 8 means that we've only one point.\n return isNaN(this.#last[8]);\n }\n\n #getLastCoords() {\n const lastTop = this.#last.subarray(4, 6);\n const lastBottom = this.#last.subarray(16, 18);\n const [x, y, width, height] = this.#box;\n\n return [\n (this.#lastX + (lastTop[0] - lastBottom[0]) / 2 - x) / width,\n (this.#lastY + (lastTop[1] - lastBottom[1]) / 2 - y) / height,\n (this.#lastX + (lastBottom[0] - lastTop[0]) / 2 - x) / width,\n (this.#lastY + (lastBottom[1] - lastTop[1]) / 2 - y) / height,\n ];\n }\n\n add({ x, y }) {\n this.#lastX = x;\n this.#lastY = y;\n const [layerX, layerY, layerWidth, layerHeight] = this.#box;\n let [x1, y1, x2, y2] = this.#last.subarray(8, 12);\n const diffX = x - x2;\n const diffY = y - y2;\n const d = Math.hypot(diffX, diffY);\n if (d < this.#min) {\n // The idea is to avoid garbage points around the last point.\n // When the points are too close, it just leads to bad normal vectors and\n // control points.\n return false;\n }\n const diffD = d - this.#min_dist;\n const K = diffD / d;\n const shiftX = K * diffX;\n const shiftY = K * diffY;\n\n // We update the last 3 points of the line.\n let x0 = x1;\n let y0 = y1;\n x1 = x2;\n y1 = y2;\n x2 += shiftX;\n y2 += shiftY;\n\n // We keep track of the points in order to be able to compute the focus\n // outline.\n this.#points?.push(x, y);\n\n // Create the normal unit vector.\n // |(shiftX, shiftY)| = |K| * |(diffX, diffY)| = |K| * d = diffD.\n const nX = -shiftY / diffD;\n const nY = shiftX / diffD;\n const thX = nX * this.#thickness;\n const thY = nY * this.#thickness;\n this.#last.set(this.#last.subarray(2, 8), 0);\n this.#last.set([x2 + thX, y2 + thY], 4);\n this.#last.set(this.#last.subarray(14, 18), 12);\n this.#last.set([x2 - thX, y2 - thY], 16);\n\n if (isNaN(this.#last[6])) {\n if (this.#top.length === 0) {\n this.#last.set([x1 + thX, y1 + thY], 2);\n this.#top.push(\n NaN,\n NaN,\n NaN,\n NaN,\n (x1 + thX - layerX) / layerWidth,\n (y1 + thY - layerY) / layerHeight\n );\n this.#last.set([x1 - thX, y1 - thY], 14);\n this.#bottom.push(\n NaN,\n NaN,\n NaN,\n NaN,\n (x1 - thX - layerX) / layerWidth,\n (y1 - thY - layerY) / layerHeight\n );\n }\n this.#last.set([x0, y0, x1, y1, x2, y2], 6);\n return !this.isEmpty();\n }\n\n this.#last.set([x0, y0, x1, y1, x2, y2], 6);\n\n const angle = Math.abs(\n Math.atan2(y0 - y1, x0 - x1) - Math.atan2(shiftY, shiftX)\n );\n if (angle < Math.PI / 2) {\n // In order to avoid some possible artifacts, we're going to use the a\n // straight line instead of a quadratic Bézier curve.\n [x1, y1, x2, y2] = this.#last.subarray(2, 6);\n this.#top.push(\n NaN,\n NaN,\n NaN,\n NaN,\n ((x1 + x2) / 2 - layerX) / layerWidth,\n ((y1 + y2) / 2 - layerY) / layerHeight\n );\n [x1, y1, x0, y0] = this.#last.subarray(14, 18);\n this.#bottom.push(\n NaN,\n NaN,\n NaN,\n NaN,\n ((x0 + x1) / 2 - layerX) / layerWidth,\n ((y0 + y1) / 2 - layerY) / layerHeight\n );\n return true;\n }\n\n // Control points and the final point for the quadratic Bézier curve.\n [x0, y0, x1, y1, x2, y2] = this.#last.subarray(0, 6);\n this.#top.push(\n ((x0 + 5 * x1) / 6 - layerX) / layerWidth,\n ((y0 + 5 * y1) / 6 - layerY) / layerHeight,\n ((5 * x1 + x2) / 6 - layerX) / layerWidth,\n ((5 * y1 + y2) / 6 - layerY) / layerHeight,\n ((x1 + x2) / 2 - layerX) / layerWidth,\n ((y1 + y2) / 2 - layerY) / layerHeight\n );\n [x2, y2, x1, y1, x0, y0] = this.#last.subarray(12, 18);\n this.#bottom.push(\n ((x0 + 5 * x1) / 6 - layerX) / layerWidth,\n ((y0 + 5 * y1) / 6 - layerY) / layerHeight,\n ((5 * x1 + x2) / 6 - layerX) / layerWidth,\n ((5 * y1 + y2) / 6 - layerY) / layerHeight,\n ((x1 + x2) / 2 - layerX) / layerWidth,\n ((y1 + y2) / 2 - layerY) / layerHeight\n );\n return true;\n }\n\n toSVGPath() {\n if (this.isEmpty()) {\n // We've only one point.\n return \"\";\n }\n const top = this.#top;\n const bottom = this.#bottom;\n\n if (isNaN(this.#last[6]) && !this.isEmpty()) {\n // We've only two points.\n return this.#toSVGPathTwoPoints();\n }\n\n const buffer = [];\n buffer.push(`M${top[4]} ${top[5]}`);\n for (let i = 6; i < top.length; i += 6) {\n if (isNaN(top[i])) {\n buffer.push(`L${top[i + 4]} ${top[i + 5]}`);\n } else {\n buffer.push(\n `C${top[i]} ${top[i + 1]} ${top[i + 2]} ${top[i + 3]} ${top[i + 4]} ${\n top[i + 5]\n }`\n );\n }\n }\n\n this.#toSVGPathEnd(buffer);\n\n for (let i = bottom.length - 6; i >= 6; i -= 6) {\n if (isNaN(bottom[i])) {\n buffer.push(`L${bottom[i + 4]} ${bottom[i + 5]}`);\n } else {\n buffer.push(\n `C${bottom[i]} ${bottom[i + 1]} ${bottom[i + 2]} ${bottom[i + 3]} ${\n bottom[i + 4]\n } ${bottom[i + 5]}`\n );\n }\n }\n\n this.#toSVGPathStart(buffer);\n\n return buffer.join(\" \");\n }\n\n #toSVGPathTwoPoints() {\n const [x, y, width, height] = this.#box;\n const [lastTopX, lastTopY, lastBottomX, lastBottomY] =\n this.#getLastCoords();\n\n return `M${(this.#last[2] - x) / width} ${\n (this.#last[3] - y) / height\n } L${(this.#last[4] - x) / width} ${(this.#last[5] - y) / height} L${lastTopX} ${lastTopY} L${lastBottomX} ${lastBottomY} L${\n (this.#last[16] - x) / width\n } ${(this.#last[17] - y) / height} L${(this.#last[14] - x) / width} ${\n (this.#last[15] - y) / height\n } Z`;\n }\n\n #toSVGPathStart(buffer) {\n const bottom = this.#bottom;\n buffer.push(`L${bottom[4]} ${bottom[5]} Z`);\n }\n\n #toSVGPathEnd(buffer) {\n const [x, y, width, height] = this.#box;\n const lastTop = this.#last.subarray(4, 6);\n const lastBottom = this.#last.subarray(16, 18);\n const [lastTopX, lastTopY, lastBottomX, lastBottomY] =\n this.#getLastCoords();\n\n buffer.push(\n `L${(lastTop[0] - x) / width} ${(lastTop[1] - y) / height} L${lastTopX} ${lastTopY} L${lastBottomX} ${lastBottomY} L${\n (lastBottom[0] - x) / width\n } ${(lastBottom[1] - y) / height}`\n );\n }\n\n newFreeDrawOutline(outline, points, box, scaleFactor, innerMargin, isLTR) {\n return new FreeDrawOutline(\n outline,\n points,\n box,\n scaleFactor,\n innerMargin,\n isLTR\n );\n }\n\n getOutlines() {\n const top = this.#top;\n const bottom = this.#bottom;\n const last = this.#last;\n const [layerX, layerY, layerWidth, layerHeight] = this.#box;\n\n const points = new Float32Array((this.#points?.length ?? 0) + 2);\n for (let i = 0, ii = points.length - 2; i < ii; i += 2) {\n points[i] = (this.#points[i] - layerX) / layerWidth;\n points[i + 1] = (this.#points[i + 1] - layerY) / layerHeight;\n }\n points[points.length - 2] = (this.#lastX - layerX) / layerWidth;\n points[points.length - 1] = (this.#lastY - layerY) / layerHeight;\n\n if (isNaN(last[6]) && !this.isEmpty()) {\n // We've only two points.\n return this.#getOutlineTwoPoints(points);\n }\n\n const outline = new Float32Array(\n this.#top.length + 24 + this.#bottom.length\n );\n let N = top.length;\n for (let i = 0; i < N; i += 2) {\n if (isNaN(top[i])) {\n outline[i] = outline[i + 1] = NaN;\n continue;\n }\n outline[i] = top[i];\n outline[i + 1] = top[i + 1];\n }\n\n N = this.#getOutlineEnd(outline, N);\n\n for (let i = bottom.length - 6; i >= 6; i -= 6) {\n for (let j = 0; j < 6; j += 2) {\n if (isNaN(bottom[i + j])) {\n outline[N] = outline[N + 1] = NaN;\n N += 2;\n continue;\n }\n outline[N] = bottom[i + j];\n outline[N + 1] = bottom[i + j + 1];\n N += 2;\n }\n }\n\n this.#getOutlineStart(outline, N);\n\n return this.newFreeDrawOutline(\n outline,\n points,\n this.#box,\n this.#scaleFactor,\n this.#innerMargin,\n this.#isLTR\n );\n }\n\n #getOutlineTwoPoints(points) {\n const last = this.#last;\n const [layerX, layerY, layerWidth, layerHeight] = this.#box;\n const [lastTopX, lastTopY, lastBottomX, lastBottomY] =\n this.#getLastCoords();\n const outline = new Float32Array(36);\n outline.set(\n [\n NaN,\n NaN,\n NaN,\n NaN,\n (last[2] - layerX) / layerWidth,\n (last[3] - layerY) / layerHeight,\n NaN,\n NaN,\n NaN,\n NaN,\n (last[4] - layerX) / layerWidth,\n (last[5] - layerY) / layerHeight,\n NaN,\n NaN,\n NaN,\n NaN,\n lastTopX,\n lastTopY,\n NaN,\n NaN,\n NaN,\n NaN,\n lastBottomX,\n lastBottomY,\n NaN,\n NaN,\n NaN,\n NaN,\n (last[16] - layerX) / layerWidth,\n (last[17] - layerY) / layerHeight,\n NaN,\n NaN,\n NaN,\n NaN,\n (last[14] - layerX) / layerWidth,\n (last[15] - layerY) / layerHeight,\n ],\n 0\n );\n return this.newFreeDrawOutline(\n outline,\n points,\n this.#box,\n this.#scaleFactor,\n this.#innerMargin,\n this.#isLTR\n );\n }\n\n #getOutlineStart(outline, pos) {\n const bottom = this.#bottom;\n outline.set([NaN, NaN, NaN, NaN, bottom[4], bottom[5]], pos);\n return (pos += 6);\n }\n\n #getOutlineEnd(outline, pos) {\n const lastTop = this.#last.subarray(4, 6);\n const lastBottom = this.#last.subarray(16, 18);\n const [layerX, layerY, layerWidth, layerHeight] = this.#box;\n const [lastTopX, lastTopY, lastBottomX, lastBottomY] =\n this.#getLastCoords();\n outline.set(\n [\n NaN,\n NaN,\n NaN,\n NaN,\n (lastTop[0] - layerX) / layerWidth,\n (lastTop[1] - layerY) / layerHeight,\n NaN,\n NaN,\n NaN,\n NaN,\n lastTopX,\n lastTopY,\n NaN,\n NaN,\n NaN,\n NaN,\n lastBottomX,\n lastBottomY,\n NaN,\n NaN,\n NaN,\n NaN,\n (lastBottom[0] - layerX) / layerWidth,\n (lastBottom[1] - layerY) / layerHeight,\n ],\n pos\n );\n return (pos += 24);\n }\n}\n\nclass FreeDrawOutline extends Outline {\n #box;\n\n #bbox = new Float32Array(4);\n\n #innerMargin;\n\n #isLTR;\n\n #points;\n\n #scaleFactor;\n\n #outline;\n\n constructor(outline, points, box, scaleFactor, innerMargin, isLTR) {\n super();\n this.#outline = outline;\n this.#points = points;\n this.#box = box;\n this.#scaleFactor = scaleFactor;\n this.#innerMargin = innerMargin;\n this.#isLTR = isLTR;\n this.lastPoint = [NaN, NaN];\n this.#computeMinMax(isLTR);\n\n const [x, y, width, height] = this.#bbox;\n for (let i = 0, ii = outline.length; i < ii; i += 2) {\n outline[i] = (outline[i] - x) / width;\n outline[i + 1] = (outline[i + 1] - y) / height;\n }\n for (let i = 0, ii = points.length; i < ii; i += 2) {\n points[i] = (points[i] - x) / width;\n points[i + 1] = (points[i + 1] - y) / height;\n }\n }\n\n toSVGPath() {\n const buffer = [`M${this.#outline[4]} ${this.#outline[5]}`];\n for (let i = 6, ii = this.#outline.length; i < ii; i += 6) {\n if (isNaN(this.#outline[i])) {\n buffer.push(`L${this.#outline[i + 4]} ${this.#outline[i + 5]}`);\n continue;\n }\n buffer.push(\n `C${this.#outline[i]} ${this.#outline[i + 1]} ${this.#outline[i + 2]} ${\n this.#outline[i + 3]\n } ${this.#outline[i + 4]} ${this.#outline[i + 5]}`\n );\n }\n buffer.push(\"Z\");\n return buffer.join(\" \");\n }\n\n serialize([blX, blY, trX, trY], rotation) {\n const width = trX - blX;\n const height = trY - blY;\n let outline;\n let points;\n switch (rotation) {\n case 0:\n outline = Outline._rescale(this.#outline, blX, trY, width, -height);\n points = Outline._rescale(this.#points, blX, trY, width, -height);\n break;\n case 90:\n outline = Outline._rescaleAndSwap(\n this.#outline,\n blX,\n blY,\n width,\n height\n );\n points = Outline._rescaleAndSwap(this.#points, blX, blY, width, height);\n break;\n case 180:\n outline = Outline._rescale(this.#outline, trX, blY, -width, height);\n points = Outline._rescale(this.#points, trX, blY, -width, height);\n break;\n case 270:\n outline = Outline._rescaleAndSwap(\n this.#outline,\n trX,\n trY,\n -width,\n -height\n );\n points = Outline._rescaleAndSwap(\n this.#points,\n trX,\n trY,\n -width,\n -height\n );\n break;\n }\n return { outline: Array.from(outline), points: [Array.from(points)] };\n }\n\n #computeMinMax(isLTR) {\n const outline = this.#outline;\n let lastX = outline[4];\n let lastY = outline[5];\n const minMax = [lastX, lastY, lastX, lastY];\n let lastPointX = lastX;\n let lastPointY = lastY;\n const ltrCallback = isLTR ? Math.max : Math.min;\n\n for (let i = 6, ii = outline.length; i < ii; i += 6) {\n const x = outline[i + 4],\n y = outline[i + 5];\n\n if (isNaN(outline[i])) {\n Util.pointBoundingBox(x, y, minMax);\n\n if (lastPointY < y) {\n lastPointX = x;\n lastPointY = y;\n } else if (lastPointY === y) {\n lastPointX = ltrCallback(lastPointX, x);\n }\n } else {\n const bbox = [Infinity, Infinity, -Infinity, -Infinity];\n Util.bezierBoundingBox(lastX, lastY, ...outline.slice(i, i + 6), bbox);\n\n Util.rectBoundingBox(...bbox, minMax);\n\n if (lastPointY < bbox[3]) {\n lastPointX = bbox[2];\n lastPointY = bbox[3];\n } else if (lastPointY === bbox[3]) {\n lastPointX = ltrCallback(lastPointX, bbox[2]);\n }\n }\n lastX = x;\n lastY = y;\n }\n\n const bbox = this.#bbox;\n bbox[0] = minMax[0] - this.#innerMargin;\n bbox[1] = minMax[1] - this.#innerMargin;\n bbox[2] = minMax[2] - minMax[0] + 2 * this.#innerMargin;\n bbox[3] = minMax[3] - minMax[1] + 2 * this.#innerMargin;\n this.lastPoint = [lastPointX, lastPointY];\n }\n\n get box() {\n return this.#bbox;\n }\n\n newOutliner(point, box, scaleFactor, thickness, isLTR, innerMargin = 0) {\n return new FreeDrawOutliner(\n point,\n box,\n scaleFactor,\n thickness,\n isLTR,\n innerMargin\n );\n }\n\n getNewOutline(thickness, innerMargin) {\n // Build the outline of the highlight to use as the focus outline.\n const [x, y, width, height] = this.#bbox;\n const [layerX, layerY, layerWidth, layerHeight] = this.#box;\n const sx = width * layerWidth;\n const sy = height * layerHeight;\n const tx = x * layerWidth + layerX;\n const ty = y * layerHeight + layerY;\n const outliner = this.newOutliner(\n {\n x: this.#points[0] * sx + tx,\n y: this.#points[1] * sy + ty,\n },\n this.#box,\n this.#scaleFactor,\n thickness,\n this.#isLTR,\n innerMargin ?? this.#innerMargin\n );\n for (let i = 2; i < this.#points.length; i += 2) {\n outliner.add({\n x: this.#points[i] * sx + tx,\n y: this.#points[i + 1] * sy + ty,\n });\n }\n return outliner.getOutlines();\n }\n}\n\nexport { FreeDrawOutline, FreeDrawOutliner };\n","/* Copyright 2023 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { FreeDrawOutline, FreeDrawOutliner } from \"./freedraw.js\";\nimport { Outline } from \"./outline.js\";\nimport { Util } from \"../../../shared/util.js\";\n\nclass HighlightOutliner {\n #box;\n\n #lastPoint;\n\n #verticalEdges = [];\n\n #intervals = [];\n\n /**\n * Construct an outliner.\n * @param {Array<Object>} boxes - An array of axis-aligned rectangles.\n * @param {number} borderWidth - The width of the border of the boxes, it\n * allows to make the boxes bigger (or smaller).\n * @param {number} innerMargin - The margin between the boxes and the\n * outlines. It's important to not have a null innerMargin when we want to\n * draw the outline else the stroked outline could be clipped because of its\n * width.\n * @param {boolean} isLTR - true if we're in LTR mode. It's used to determine\n * the last point of the boxes.\n */\n constructor(boxes, borderWidth = 0, innerMargin = 0, isLTR = true) {\n const minMax = [Infinity, Infinity, -Infinity, -Infinity];\n\n // We round the coordinates to slightly reduce the number of edges in the\n // final outlines.\n const NUMBER_OF_DIGITS = 4;\n const EPSILON = 10 ** -NUMBER_OF_DIGITS;\n\n // The coordinates of the boxes are in the page coordinate system.\n for (const { x, y, width, height } of boxes) {\n const x1 = Math.floor((x - borderWidth) / EPSILON) * EPSILON;\n const x2 = Math.ceil((x + width + borderWidth) / EPSILON) * EPSILON;\n const y1 = Math.floor((y - borderWidth) / EPSILON) * EPSILON;\n const y2 = Math.ceil((y + height + borderWidth) / EPSILON) * EPSILON;\n const left = [x1, y1, y2, true];\n const right = [x2, y1, y2, false];\n this.#verticalEdges.push(left, right);\n\n Util.rectBoundingBox(x1, y1, x2, y2, minMax);\n }\n\n const bboxWidth = minMax[2] - minMax[0] + 2 * innerMargin;\n const bboxHeight = minMax[3] - minMax[1] + 2 * innerMargin;\n const shiftedMinX = minMax[0] - innerMargin;\n const shiftedMinY = minMax[1] - innerMargin;\n const lastEdge = this.#verticalEdges.at(isLTR ? -1 : -2);\n const lastPoint = [lastEdge[0], lastEdge[2]];\n\n // Convert the coordinates of the edges into box coordinates.\n for (const edge of this.#verticalEdges) {\n const [x, y1, y2] = edge;\n edge[0] = (x - shiftedMinX) / bboxWidth;\n edge[1] = (y1 - shiftedMinY) / bboxHeight;\n edge[2] = (y2 - shiftedMinY) / bboxHeight;\n }\n\n this.#box = new Float32Array([\n shiftedMinX,\n shiftedMinY,\n bboxWidth,\n bboxHeight,\n ]);\n this.#lastPoint = lastPoint;\n }\n\n getOutlines() {\n // We begin to sort lexicographically the vertical edges by their abscissa,\n // and then by their ordinate.\n this.#verticalEdges.sort(\n (a, b) => a[0] - b[0] || a[1] - b[1] || a[2] - b[2]\n );\n\n // We're now using a sweep line algorithm to find the outlines.\n // We start with the leftmost vertical edge, and we're going to iterate\n // over all the vertical edges from left to right.\n // Each time we encounter a left edge, we're going to insert the interval\n // [y1, y2] in the set of intervals.\n // This set of intervals is used to break the vertical edges into chunks:\n // we only take the part of the vertical edge that isn't in the union of\n // the intervals.\n const outlineVerticalEdges = [];\n for (const edge of this.#verticalEdges) {\n if (edge[3]) {\n // Left edge.\n outlineVerticalEdges.push(...this.#breakEdge(edge));\n this.#insert(edge);\n } else {\n // Right edge.\n this.#remove(edge);\n outlineVerticalEdges.push(...this.#breakEdge(edge));\n }\n }\n return this.#getOutlines(outlineVerticalEdges);\n }\n\n #getOutlines(outlineVerticalEdges) {\n const edges = [];\n const allEdges = new Set();\n\n for (const edge of outlineVerticalEdges) {\n const [x, y1, y2] = edge;\n edges.push([x, y1, edge], [x, y2, edge]);\n }\n\n // We sort lexicographically the vertices of each edge by their ordinate and\n // by their abscissa.\n // Every pair (v_2i, v_{2i + 1}) of vertices defines a horizontal edge.\n // So for every vertical edge, we're going to add the two vertical edges\n // which are connected to it through a horizontal edge.\n edges.sort((a, b) => a[1] - b[1] || a[0] - b[0]);\n for (let i = 0, ii = edges.length; i < ii; i += 2) {\n const edge1 = edges[i][2];\n const edge2 = edges[i + 1][2];\n edge1.push(edge2);\n edge2.push(edge1);\n allEdges.add(edge1);\n allEdges.add(edge2);\n }\n const outlines = [];\n let outline;\n\n while (allEdges.size > 0) {\n const edge = allEdges.values().next().value;\n let [x, y1, y2, edge1, edge2] = edge;\n allEdges.delete(edge);\n let lastPointX = x;\n let lastPointY = y1;\n\n outline = [x, y2];\n outlines.push(outline);\n\n while (true) {\n let e;\n if (allEdges.has(edge1)) {\n e = edge1;\n } else if (allEdges.has(edge2)) {\n e = edge2;\n } else {\n break;\n }\n\n allEdges.delete(e);\n [x, y1, y2, edge1, edge2] = e;\n\n if (lastPointX !== x) {\n outline.push(lastPointX, lastPointY, x, lastPointY === y1 ? y1 : y2);\n lastPointX = x;\n }\n lastPointY = lastPointY === y1 ? y2 : y1;\n }\n outline.push(lastPointX, lastPointY);\n }\n return new HighlightOutline(outlines, this.#box, this.#lastPoint);\n }\n\n #binarySearch(y) {\n const array = this.#intervals;\n let start = 0;\n let end = array.length - 1;\n\n while (start <= end) {\n const middle = (start + end) >> 1;\n const y1 = array[middle][0];\n if (y1 === y) {\n return middle;\n }\n if (y1 < y) {\n start = middle + 1;\n } else {\n end = middle - 1;\n }\n }\n return end + 1;\n }\n\n #insert([, y1, y2]) {\n const index = this.#binarySearch(y1);\n this.#intervals.splice(index, 0, [y1, y2]);\n }\n\n #remove([, y1, y2]) {\n const index = this.#binarySearch(y1);\n for (let i = index; i < this.#intervals.length; i++) {\n const [start, end] = this.#intervals[i];\n if (start !== y1) {\n break;\n }\n if (start === y1 && end === y2) {\n this.#intervals.splice(i, 1);\n return;\n }\n }\n for (let i = index - 1; i >= 0; i--) {\n const [start, end] = this.#intervals[i];\n if (start !== y1) {\n break;\n }\n if (start === y1 && end === y2) {\n this.#intervals.splice(i, 1);\n return;\n }\n }\n }\n\n #breakEdge(edge) {\n const [x, y1, y2] = edge;\n const results = [[x, y1, y2]];\n const index = this.#binarySearch(y2);\n for (let i = 0; i < index; i++) {\n const [start, end] = this.#intervals[i];\n for (let j = 0, jj = results.length; j < jj; j++) {\n const [, y3, y4] = results[j];\n if (end <= y3 || y4 <= start) {\n // There is no intersection between the interval and the edge, hence\n // we keep it as is.\n continue;\n }\n if (y3 >= start) {\n if (y4 > end) {\n results[j][1] = end;\n } else {\n if (jj === 1) {\n return [];\n }\n // The edge is included in the interval, hence we remove it.\n results.splice(j, 1);\n j--;\n jj--;\n }\n continue;\n }\n results[j][2] = start;\n if (y4 > end) {\n results.push([x, end, y4]);\n }\n }\n }\n return results;\n }\n}\n\nclass HighlightOutline extends Outline {\n #box;\n\n #outlines;\n\n constructor(outlines, box, lastPoint) {\n super();\n this.#outlines = outlines;\n this.#box = box;\n this.lastPoint = lastPoint;\n }\n\n toSVGPath() {\n const buffer = [];\n for (const polygon of this.#outlines) {\n let [prevX, prevY] = polygon;\n buffer.push(`M${prevX} ${prevY}`);\n for (let i = 2; i < polygon.length; i += 2) {\n const x = polygon[i];\n const y = polygon[i + 1];\n if (x === prevX) {\n buffer.push(`V${y}`);\n prevY = y;\n } else if (y === prevY) {\n buffer.push(`H${x}`);\n prevX = x;\n }\n }\n buffer.push(\"Z\");\n }\n return buffer.join(\" \");\n }\n\n /**\n * Serialize the outlines into the PDF page coordinate system.\n * @param {Array<number>} _bbox - the bounding box of the annotation.\n * @param {number} _rotation - the rotation of the annotation.\n * @returns {Array<Array<number>>}\n */\n serialize([blX, blY, trX, trY], _rotation) {\n const outlines = [];\n const width = trX - blX;\n const height = trY - blY;\n for (const outline of this.#outlines) {\n const points = new Array(outline.length);\n for (let i = 0; i < outline.length; i += 2) {\n points[i] = blX + outline[i] * width;\n points[i + 1] = trY - outline[i + 1] * height;\n }\n outlines.push(points);\n }\n return outlines;\n }\n\n get box() {\n return this.#box;\n }\n\n get classNamesForOutlining() {\n return [\"highlightOutline\"];\n }\n}\n\nclass FreeHighlightOutliner extends FreeDrawOutliner {\n newFreeDrawOutline(outline, points, box, scaleFactor, innerMargin, isLTR) {\n return new FreeHighlightOutline(\n outline,\n points,\n box,\n scaleFactor,\n innerMargin,\n isLTR\n );\n }\n}\n\nclass FreeHighlightOutline extends FreeDrawOutline {\n newOutliner(point, box, scaleFactor, thickness, isLTR, innerMargin = 0) {\n return new FreeHighlightOutliner(\n point,\n box,\n scaleFactor,\n thickness,\n isLTR,\n innerMargin\n );\n }\n}\n\nexport { FreeHighlightOutliner, HighlightOutliner };\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 {\n AnnotationEditorParamsType,\n AnnotationEditorType,\n shadow,\n Util,\n} from \"../../shared/util.js\";\nimport { bindEvents, KeyboardManager } from \"./tools.js\";\nimport {\n FreeHighlightOutliner,\n HighlightOutliner,\n} from \"./drawers/highlight.js\";\nimport {\n HighlightAnnotationElement,\n InkAnnotationElement,\n} from \"../annotation_layer.js\";\nimport { noContextMenu, stopEvent } from \"../display_utils.js\";\nimport { AnnotationEditor } from \"./editor.js\";\nimport { ColorPicker } from \"./color_picker.js\";\n\n/**\n * Basic draw editor in order to generate an Highlight annotation.\n */\nclass HighlightEditor extends AnnotationEditor {\n #anchorNode = null;\n\n #anchorOffset = 0;\n\n #boxes;\n\n #clipPathId = null;\n\n #colorPicker = null;\n\n #focusOutlines = null;\n\n #focusNode = null;\n\n #focusOffset = 0;\n\n #highlightDiv = null;\n\n #highlightOutlines = null;\n\n #id = null;\n\n #isFreeHighlight = false;\n\n #lastPoint = null;\n\n #opacity;\n\n #outlineId = null;\n\n #text = \"\";\n\n #thickness;\n\n #methodOfCreation = \"\";\n\n static _defaultColor = null;\n\n static _defaultOpacity = 1;\n\n static _defaultThickness = 12;\n\n static _type = \"highlight\";\n\n static _editorType = AnnotationEditorType.HIGHLIGHT;\n\n static _freeHighlightId = -1;\n\n static _freeHighlight = null;\n\n static _freeHighlightClipId = \"\";\n\n static get _keyboardManager() {\n const proto = HighlightEditor.prototype;\n return shadow(\n this,\n \"_keyboardManager\",\n new KeyboardManager([\n [[\"ArrowLeft\", \"mac+ArrowLeft\"], proto._moveCaret, { args: [0] }],\n [[\"ArrowRight\", \"mac+ArrowRight\"], proto._moveCaret, { args: [1] }],\n [[\"ArrowUp\", \"mac+ArrowUp\"], proto._moveCaret, { args: [2] }],\n [[\"ArrowDown\", \"mac+ArrowDown\"], proto._moveCaret, { args: [3] }],\n ])\n );\n }\n\n constructor(params) {\n super({ ...params, name: \"highlightEditor\" });\n this.color = params.color || HighlightEditor._defaultColor;\n this.#thickness = params.thickness || HighlightEditor._defaultThickness;\n this.#opacity = params.opacity || HighlightEditor._defaultOpacity;\n this.#boxes = params.boxes || null;\n this.#methodOfCreation = params.methodOfCreation || \"\";\n this.#text = params.text || \"\";\n this._isDraggable = false;\n this.defaultL10nId = \"pdfjs-editor-highlight-editor\";\n\n if (params.highlightId > -1) {\n this.#isFreeHighlight = true;\n this.#createFreeOutlines(params);\n this.#addToDrawLayer();\n } else if (this.#boxes) {\n this.#anchorNode = params.anchorNode;\n this.#anchorOffset = params.anchorOffset;\n this.#focusNode = params.focusNode;\n this.#focusOffset = params.focusOffset;\n this.#createOutlines();\n this.#addToDrawLayer();\n this.rotate(this.rotation);\n }\n\n if (!this.annotationElementId) {\n this._uiManager.a11yAlert(\"pdfjs-editor-highlight-added-alert\");\n }\n }\n\n /** @inheritdoc */\n get telemetryInitialData() {\n return {\n action: \"added\",\n type: this.#isFreeHighlight ? \"free_highlight\" : \"highlight\",\n color: this._uiManager.getNonHCMColorName(this.color),\n thickness: this.#thickness,\n methodOfCreation: this.#methodOfCreation,\n };\n }\n\n /** @inheritdoc */\n get telemetryFinalData() {\n return {\n type: \"highlight\",\n color: this._uiManager.getNonHCMColorName(this.color),\n };\n }\n\n get commentColor() {\n return this.color;\n }\n\n static computeTelemetryFinalData(data) {\n // We want to know how many colors have been used.\n return { numberOfColors: data.get(\"color\").size };\n }\n\n #createOutlines() {\n const outliner = new HighlightOutliner(\n this.#boxes,\n /* borderWidth = */ 0.001\n );\n this.#highlightOutlines = outliner.getOutlines();\n [this.x, this.y, this.width, this.height] = this.#highlightOutlines.box;\n\n const outlinerForOutline = new HighlightOutliner(\n this.#boxes,\n /* borderWidth = */ 0.0025,\n /* innerMargin = */ 0.001,\n this._uiManager.direction === \"ltr\"\n );\n this.#focusOutlines = outlinerForOutline.getOutlines();\n\n // The last point is in the pages coordinate system.\n const { lastPoint } = this.#focusOutlines;\n this.#lastPoint = [\n (lastPoint[0] - this.x) / this.width,\n (lastPoint[1] - this.y) / this.height,\n ];\n }\n\n #createFreeOutlines({ highlightOutlines, highlightId, clipPathId }) {\n this.#highlightOutlines = highlightOutlines;\n const extraThickness = 1.5;\n this.#focusOutlines = highlightOutlines.getNewOutline(\n /* Slightly bigger than the highlight in order to have a little\n space between the highlight and the outline. */\n this.#thickness / 2 + extraThickness,\n /* innerMargin = */ 0.0025\n );\n\n if (highlightId >= 0) {\n this.#id = highlightId;\n this.#clipPathId = clipPathId;\n // We need to redraw the highlight because we change the coordinates to be\n // in the box coordinate system.\n this.parent.drawLayer.finalizeDraw(highlightId, {\n bbox: highlightOutlines.box,\n path: {\n d: highlightOutlines.toSVGPath(),\n },\n });\n this.#outlineId = this.parent.drawLayer.drawOutline(\n {\n rootClass: {\n highlightOutline: true,\n free: true,\n },\n bbox: this.#focusOutlines.box,\n path: {\n d: this.#focusOutlines.toSVGPath(),\n },\n },\n /* mustRemoveSelfIntersections = */ true\n );\n } else if (this.parent) {\n const angle = this.parent.viewport.rotation;\n this.parent.drawLayer.updateProperties(this.#id, {\n bbox: HighlightEditor.#rotateBbox(\n this.#highlightOutlines.box,\n (angle - this.rotation + 360) % 360\n ),\n path: {\n d: highlightOutlines.toSVGPath(),\n },\n });\n this.parent.drawLayer.updateProperties(this.#outlineId, {\n bbox: HighlightEditor.#rotateBbox(this.#focusOutlines.box, angle),\n path: {\n d: this.#focusOutlines.toSVGPath(),\n },\n });\n }\n const [x, y, width, height] = highlightOutlines.box;\n switch (this.rotation) {\n case 0:\n this.x = x;\n this.y = y;\n this.width = width;\n this.height = height;\n break;\n case 90: {\n const [pageWidth, pageHeight] = this.parentDimensions;\n this.x = y;\n this.y = 1 - x;\n this.width = (width * pageHeight) / pageWidth;\n this.height = (height * pageWidth) / pageHeight;\n break;\n }\n case 180:\n this.x = 1 - x;\n this.y = 1 - y;\n this.width = width;\n this.height = height;\n break;\n case 270: {\n const [pageWidth, pageHeight] = this.parentDimensions;\n this.x = 1 - y;\n this.y = x;\n this.width = (width * pageHeight) / pageWidth;\n this.height = (height * pageWidth) / pageHeight;\n break;\n }\n }\n\n const { lastPoint } = this.#focusOutlines;\n this.#lastPoint = [(lastPoint[0] - x) / width, (lastPoint[1] - y) / height];\n }\n\n /** @inheritdoc */\n static initialize(l10n, uiManager) {\n AnnotationEditor.initialize(l10n, uiManager);\n HighlightEditor._defaultColor ||=\n uiManager.highlightColors?.values().next().value || \"#fff066\";\n }\n\n /** @inheritdoc */\n static updateDefaultParams(type, value) {\n switch (type) {\n case AnnotationEditorParamsType.HIGHLIGHT_COLOR:\n HighlightEditor._defaultColor = value;\n break;\n case AnnotationEditorParamsType.HIGHLIGHT_THICKNESS:\n HighlightEditor._defaultThickness = value;\n break;\n }\n }\n\n /** @inheritdoc */\n translateInPage(x, y) {}\n\n /** @inheritdoc */\n get toolbarPosition() {\n return this.#lastPoint;\n }\n\n /** @inheritdoc */\n updateParams(type, value) {\n switch (type) {\n case AnnotationEditorParamsType.HIGHLIGHT_COLOR:\n this.#updateColor(value);\n break;\n case AnnotationEditorParamsType.HIGHLIGHT_THICKNESS:\n this.#updateThickness(value);\n break;\n }\n }\n\n static get defaultPropertiesToUpdate() {\n return [\n [\n AnnotationEditorParamsType.HIGHLIGHT_COLOR,\n HighlightEditor._defaultColor,\n ],\n [\n AnnotationEditorParamsType.HIGHLIGHT_THICKNESS,\n HighlightEditor._defaultThickness,\n ],\n ];\n }\n\n /** @inheritdoc */\n get propertiesToUpdate() {\n return [\n [\n AnnotationEditorParamsType.HIGHLIGHT_COLOR,\n this.color || HighlightEditor._defaultColor,\n ],\n [\n AnnotationEditorParamsType.HIGHLIGHT_THICKNESS,\n this.#thickness || HighlightEditor._defaultThickness,\n ],\n [AnnotationEditorParamsType.HIGHLIGHT_FREE, this.#isFreeHighlight],\n ];\n }\n\n /**\n * Update the color and make this action undoable.\n * @param {string} color\n */\n #updateColor(color) {\n const setColorAndOpacity = (col, opa) => {\n this.color = col;\n this.#opacity = opa;\n this.parent?.drawLayer.updateProperties(this.#id, {\n root: {\n fill: col,\n \"fill-opacity\": opa,\n },\n });\n this.#colorPicker?.updateColor(col);\n };\n const savedColor = this.color;\n const savedOpacity = this.#opacity;\n this.addCommands({\n cmd: setColorAndOpacity.bind(\n this,\n color,\n HighlightEditor._defaultOpacity\n ),\n undo: setColorAndOpacity.bind(this, savedColor, savedOpacity),\n post: this._uiManager.updateUI.bind(this._uiManager, this),\n mustExec: true,\n type: AnnotationEditorParamsType.HIGHLIGHT_COLOR,\n overwriteIfSameType: true,\n keepUndo: true,\n });\n\n this._reportTelemetry(\n {\n action: \"color_changed\",\n color: this._uiManager.getNonHCMColorName(color),\n },\n /* mustWait = */ true\n );\n }\n\n /**\n * Update the thickness and make this action undoable.\n * @param {number} thickness\n */\n #updateThickness(thickness) {\n const savedThickness = this.#thickness;\n const setThickness = th => {\n this.#thickness = th;\n this.#changeThickness(th);\n };\n this.addCommands({\n cmd: setThickness.bind(this, thickness),\n undo: setThickness.bind(this, savedThickness),\n post: this._uiManager.updateUI.bind(this._uiManager, this),\n mustExec: true,\n type: AnnotationEditorParamsType.INK_THICKNESS,\n overwriteIfSameType: true,\n keepUndo: true,\n });\n this._reportTelemetry(\n { action: \"thickness_changed\", thickness },\n /* mustWait = */ true\n );\n }\n\n /** @inheritdoc */\n get toolbarButtons() {\n if (this._uiManager.highlightColors) {\n const colorPicker = (this.#colorPicker = new ColorPicker({\n editor: this,\n }));\n return [[\"colorPicker\", colorPicker]];\n }\n return super.toolbarButtons;\n }\n\n /** @inheritdoc */\n disableEditing() {\n super.disableEditing();\n this.div.classList.toggle(\"disabled\", true);\n }\n\n /** @inheritdoc */\n enableEditing() {\n super.enableEditing();\n this.div.classList.toggle(\"disabled\", false);\n }\n\n /** @inheritdoc */\n fixAndSetPosition() {\n return super.fixAndSetPosition(this.#getRotation());\n }\n\n /** @inheritdoc */\n getBaseTranslation() {\n // The editor itself doesn't have any CSS border (we're drawing one\n // ourselves in using SVG).\n return [0, 0];\n }\n\n /** @inheritdoc */\n getRect(tx, ty) {\n return super.getRect(tx, ty, this.#getRotation());\n }\n\n /** @inheritdoc */\n onceAdded(focus) {\n if (!this.annotationElementId) {\n this.parent.addUndoableEditor(this);\n }\n if (focus) {\n this.div.focus();\n }\n }\n\n /** @inheritdoc */\n remove() {\n this.#cleanDrawLayer();\n this._reportTelemetry({\n action: \"deleted\",\n });\n super.remove();\n }\n\n /** @inheritdoc */\n rebuild() {\n if (!this.parent) {\n return;\n }\n super.rebuild();\n if (this.div === null) {\n return;\n }\n\n this.#addToDrawLayer();\n\n if (!this.isAttachedToDOM) {\n // At some point this editor was removed and we're rebuilding it,\n // hence we must add it to its parent.\n this.parent.add(this);\n }\n }\n\n setParent(parent) {\n let mustBeSelected = false;\n if (this.parent && !parent) {\n this.#cleanDrawLayer();\n } else if (parent) {\n this.#addToDrawLayer(parent);\n // If mustBeSelected is true it means that this editor was selected\n // when its parent has been destroyed, hence we must select it again.\n mustBeSelected =\n !this.parent && this.div?.classList.contains(\"selectedEditor\");\n }\n super.setParent(parent);\n this.show(this._isVisible);\n if (mustBeSelected) {\n // We select it after the parent has been set.\n this.select();\n }\n }\n\n #changeThickness(thickness) {\n if (!this.#isFreeHighlight) {\n return;\n }\n this.#createFreeOutlines({\n highlightOutlines: this.#highlightOutlines.getNewOutline(thickness / 2),\n });\n this.fixAndSetPosition();\n const [parentWidth, parentHeight] = this.parentDimensions;\n this.setDims(this.width * parentWidth, this.height * parentHeight);\n }\n\n #cleanDrawLayer() {\n if (this.#id === null || !this.parent) {\n return;\n }\n this.parent.drawLayer.remove(this.#id);\n this.#id = null;\n this.parent.drawLayer.remove(this.#outlineId);\n this.#outlineId = null;\n }\n\n #addToDrawLayer(parent = this.parent) {\n if (this.#id !== null) {\n return;\n }\n ({ id: this.#id, clipPathId: this.#clipPathId } = parent.drawLayer.draw(\n {\n bbox: this.#highlightOutlines.box,\n root: {\n viewBox: \"0 0 1 1\",\n fill: this.color,\n \"fill-opacity\": this.#opacity,\n },\n rootClass: {\n highlight: true,\n free: this.#isFreeHighlight,\n },\n path: {\n d: this.#highlightOutlines.toSVGPath(),\n },\n },\n /* isPathUpdatable = */ false,\n /* hasClip = */ true\n ));\n this.#outlineId = parent.drawLayer.drawOutline(\n {\n rootClass: {\n highlightOutline: true,\n free: this.#isFreeHighlight,\n },\n bbox: this.#focusOutlines.box,\n path: {\n d: this.#focusOutlines.toSVGPath(),\n },\n },\n /* mustRemoveSelfIntersections = */ this.#isFreeHighlight\n );\n\n if (this.#highlightDiv) {\n this.#highlightDiv.style.clipPath = this.#clipPathId;\n }\n }\n\n static #rotateBbox([x, y, width, height], angle) {\n switch (angle) {\n case 90:\n return [1 - y - height, x, height, width];\n case 180:\n return [1 - x - width, 1 - y - height, width, height];\n case 270:\n return [y, 1 - x - width, height, width];\n }\n return [x, y, width, height];\n }\n\n /** @inheritdoc */\n rotate(angle) {\n // We need to rotate the svgs because of the coordinates system.\n const { drawLayer } = this.parent;\n let box;\n if (this.#isFreeHighlight) {\n angle = (angle - this.rotation + 360) % 360;\n box = HighlightEditor.#rotateBbox(this.#highlightOutlines.box, angle);\n } else {\n // An highlight annotation is always drawn horizontally.\n box = HighlightEditor.#rotateBbox(\n [this.x, this.y, this.width, this.height],\n angle\n );\n }\n drawLayer.updateProperties(this.#id, {\n bbox: box,\n root: {\n \"data-main-rotation\": angle,\n },\n });\n drawLayer.updateProperties(this.#outlineId, {\n bbox: HighlightEditor.#rotateBbox(this.#focusOutlines.box, angle),\n root: {\n \"data-main-rotation\": angle,\n },\n });\n }\n\n /** @inheritdoc */\n render() {\n if (this.div) {\n return this.div;\n }\n\n const div = super.render();\n if (this.#text) {\n div.setAttribute(\"aria-label\", this.#text);\n div.setAttribute(\"role\", \"mark\");\n }\n if (this.#isFreeHighlight) {\n div.classList.add(\"free\");\n } else {\n this.div.addEventListener(\"keydown\", this.#keydown.bind(this), {\n signal: this._uiManager._signal,\n });\n }\n const highlightDiv = (this.#highlightDiv = document.createElement(\"div\"));\n div.append(highlightDiv);\n highlightDiv.setAttribute(\"aria-hidden\", \"true\");\n highlightDiv.className = \"internal\";\n highlightDiv.style.clipPath = this.#clipPathId;\n const [parentWidth, parentHeight] = this.parentDimensions;\n this.setDims(this.width * parentWidth, this.height * parentHeight);\n\n bindEvents(this, this.#highlightDiv, [\"pointerover\", \"pointerleave\"]);\n this.enableEditing();\n\n return div;\n }\n\n pointerover() {\n if (!this.isSelected) {\n this.parent?.drawLayer.updateProperties(this.#outlineId, {\n rootClass: {\n hovered: true,\n },\n });\n }\n }\n\n pointerleave() {\n if (!this.isSelected) {\n this.parent?.drawLayer.updateProperties(this.#outlineId, {\n rootClass: {\n hovered: false,\n },\n });\n }\n }\n\n #keydown(event) {\n HighlightEditor._keyboardManager.exec(this, event);\n }\n\n _moveCaret(direction) {\n this.parent.unselect(this);\n switch (direction) {\n case 0 /* left */:\n case 2 /* up */:\n this.#setCaret(/* start = */ true);\n break;\n case 1 /* right */:\n case 3 /* down */:\n this.#setCaret(/* start = */ false);\n break;\n }\n }\n\n #setCaret(start) {\n if (!this.#anchorNode) {\n return;\n }\n const selection = window.getSelection();\n if (start) {\n selection.setPosition(this.#anchorNode, this.#anchorOffset);\n } else {\n selection.setPosition(this.#focusNode, this.#focusOffset);\n }\n }\n\n /** @inheritdoc */\n select() {\n super.select();\n if (!this.#outlineId) {\n return;\n }\n this.parent?.drawLayer.updateProperties(this.#outlineId, {\n rootClass: {\n hovered: false,\n selected: true,\n },\n });\n }\n\n /** @inheritdoc */\n unselect() {\n super.unselect();\n if (!this.#outlineId) {\n return;\n }\n this.parent?.drawLayer.updateProperties(this.#outlineId, {\n rootClass: {\n selected: false,\n },\n });\n if (!this.#isFreeHighlight) {\n this.#setCaret(/* start = */ false);\n }\n }\n\n /** @inheritdoc */\n get _mustFixPosition() {\n return !this.#isFreeHighlight;\n }\n\n /** @inheritdoc */\n show(visible = this._isVisible) {\n super.show(visible);\n if (this.parent) {\n this.parent.drawLayer.updateProperties(this.#id, {\n rootClass: {\n hidden: !visible,\n },\n });\n this.parent.drawLayer.updateProperties(this.#outlineId, {\n rootClass: {\n hidden: !visible,\n },\n });\n }\n }\n\n #getRotation() {\n // Highlight annotations are always drawn horizontally but if\n // a free highlight annotation can be rotated.\n return this.#isFreeHighlight ? this.rotation : 0;\n }\n\n #serializeBoxes() {\n if (this.#isFreeHighlight) {\n return null;\n }\n const [pageWidth, pageHeight] = this.pageDimensions;\n const [pageX, pageY] = this.pageTranslation;\n const boxes = this.#boxes;\n const quadPoints = new Float32Array(boxes.length * 8);\n let i = 0;\n for (const { x, y, width, height } of boxes) {\n const sx = x * pageWidth + pageX;\n const sy = (1 - y) * pageHeight + pageY;\n // Serializes the rectangle in the Adobe Acrobat format.\n // The rectangle's coordinates (b = bottom, t = top, L = left, R = right)\n // are ordered as follows: tL, tR, bL, bR (bL origin).\n quadPoints[i] = quadPoints[i + 4] = sx;\n quadPoints[i + 1] = quadPoints[i + 3] = sy;\n quadPoints[i + 2] = quadPoints[i + 6] = sx + width * pageWidth;\n quadPoints[i + 5] = quadPoints[i + 7] = sy - height * pageHeight;\n i += 8;\n }\n return quadPoints;\n }\n\n #serializeOutlines(rect) {\n return this.#highlightOutlines.serialize(rect, this.#getRotation());\n }\n\n static startHighlighting(parent, isLTR, { target: textLayer, x, y }) {\n const {\n x: layerX,\n y: layerY,\n width: parentWidth,\n height: parentHeight,\n } = textLayer.getBoundingClientRect();\n\n const ac = new AbortController();\n const signal = parent.combinedSignal(ac);\n\n const pointerUpCallback = e => {\n ac.abort();\n this.#endHighlight(parent, e);\n };\n window.addEventListener(\"blur\", pointerUpCallback, { signal });\n window.addEventListener(\"pointerup\", pointerUpCallback, { signal });\n window.addEventListener(\n \"pointerdown\",\n stopEvent /* Avoid to have undesired clicks during the drawing. */,\n {\n capture: true,\n passive: false,\n signal,\n }\n );\n window.addEventListener(\"contextmenu\", noContextMenu, { signal });\n\n textLayer.addEventListener(\n \"pointermove\",\n this.#highlightMove.bind(this, parent),\n { signal }\n );\n this._freeHighlight = new FreeHighlightOutliner(\n { x, y },\n [layerX, layerY, parentWidth, parentHeight],\n parent.scale,\n this._defaultThickness / 2,\n isLTR,\n /* innerMargin = */ 0.001\n );\n ({ id: this._freeHighlightId, clipPathId: this._freeHighlightClipId } =\n parent.drawLayer.draw(\n {\n bbox: [0, 0, 1, 1],\n root: {\n viewBox: \"0 0 1 1\",\n fill: this._defaultColor,\n \"fill-opacity\": this._defaultOpacity,\n },\n rootClass: {\n highlight: true,\n free: true,\n },\n path: {\n d: this._freeHighlight.toSVGPath(),\n },\n },\n /* isPathUpdatable = */ true,\n /* hasClip = */ true\n ));\n }\n\n static #highlightMove(parent, event) {\n if (this._freeHighlight.add(event)) {\n // Redraw only if the point has been added.\n parent.drawLayer.updateProperties(this._freeHighlightId, {\n path: {\n d: this._freeHighlight.toSVGPath(),\n },\n });\n }\n }\n\n static #endHighlight(parent, event) {\n if (!this._freeHighlight.isEmpty()) {\n parent.createAndAddNewEditor(event, false, {\n highlightId: this._freeHighlightId,\n highlightOutlines: this._freeHighlight.getOutlines(),\n clipPathId: this._freeHighlightClipId,\n methodOfCreation: \"main_toolbar\",\n });\n } else {\n parent.drawLayer.remove(this._freeHighlightId);\n }\n this._freeHighlightId = -1;\n this._freeHighlight = null;\n this._freeHighlightClipId = \"\";\n }\n\n /** @inheritdoc */\n static async deserialize(data, parent, uiManager) {\n let initialData = null;\n if (data instanceof HighlightAnnotationElement) {\n const {\n data: {\n quadPoints,\n rect,\n rotation,\n id,\n color,\n opacity,\n popupRef,\n contentsObj,\n },\n parent: {\n page: { pageNumber },\n },\n } = data;\n initialData = data = {\n annotationType: AnnotationEditorType.HIGHLIGHT,\n color: Array.from(color),\n opacity,\n quadPoints,\n boxes: null,\n pageIndex: pageNumber - 1,\n rect: rect.slice(0),\n rotation,\n annotationElementId: id,\n id,\n deleted: false,\n popupRef,\n comment: contentsObj?.str || null,\n };\n } else if (data instanceof InkAnnotationElement) {\n const {\n data: {\n inkLists,\n rect,\n rotation,\n id,\n color,\n borderStyle: { rawWidth: thickness },\n popupRef,\n contentsObj,\n },\n parent: {\n page: { pageNumber },\n },\n } = data;\n initialData = data = {\n annotationType: AnnotationEditorType.HIGHLIGHT,\n color: Array.from(color),\n thickness,\n inkLists,\n boxes: null,\n pageIndex: pageNumber - 1,\n rect: rect.slice(0),\n rotation,\n annotationElementId: id,\n id,\n deleted: false,\n popupRef,\n comment: contentsObj?.str || null,\n };\n }\n\n const { color, quadPoints, inkLists, opacity } = data;\n const editor = await super.deserialize(data, parent, uiManager);\n\n editor.color = Util.makeHexColor(...color);\n editor.#opacity = opacity || 1;\n if (inkLists) {\n editor.#thickness = data.thickness;\n }\n editor._initialData = initialData;\n if (data.comment) {\n editor.setCommentData(data.comment);\n }\n\n const [pageWidth, pageHeight] = editor.pageDimensions;\n const [pageX, pageY] = editor.pageTranslation;\n\n if (quadPoints) {\n const boxes = (editor.#boxes = []);\n for (let i = 0; i < quadPoints.length; i += 8) {\n boxes.push({\n x: (quadPoints[i] - pageX) / pageWidth,\n y: 1 - (quadPoints[i + 1] - pageY) / pageHeight,\n width: (quadPoints[i + 2] - quadPoints[i]) / pageWidth,\n height: (quadPoints[i + 1] - quadPoints[i + 5]) / pageHeight,\n });\n }\n editor.#createOutlines();\n editor.#addToDrawLayer();\n editor.rotate(editor.rotation);\n } else if (inkLists) {\n editor.#isFreeHighlight = true;\n const points = inkLists[0];\n const point = {\n x: points[0] - pageX,\n y: pageHeight - (points[1] - pageY),\n };\n const outliner = new FreeHighlightOutliner(\n point,\n [0, 0, pageWidth, pageHeight],\n 1,\n editor.#thickness / 2,\n true,\n 0.001\n );\n for (let i = 0, ii = points.length; i < ii; i += 2) {\n point.x = points[i] - pageX;\n point.y = pageHeight - (points[i + 1] - pageY);\n outliner.add(point);\n }\n const { id, clipPathId } = parent.drawLayer.draw(\n {\n bbox: [0, 0, 1, 1],\n root: {\n viewBox: \"0 0 1 1\",\n fill: editor.color,\n \"fill-opacity\": editor._defaultOpacity,\n },\n rootClass: {\n highlight: true,\n free: true,\n },\n path: {\n d: outliner.toSVGPath(),\n },\n },\n /* isPathUpdatable = */ true,\n /* hasClip = */ true\n );\n editor.#createFreeOutlines({\n highlightOutlines: outliner.getOutlines(),\n highlightId: id,\n clipPathId,\n });\n editor.#addToDrawLayer();\n editor.rotate(editor.parentRotation);\n }\n\n return editor;\n }\n\n /** @inheritdoc */\n serialize(isForCopying = false) {\n // It doesn't make sense to copy/paste a highlight annotation.\n if (this.isEmpty() || isForCopying) {\n return null;\n }\n\n if (this.deleted) {\n return this.serializeDeleted();\n }\n\n const rect = this.getPDFRect();\n const color = AnnotationEditor._colorManager.convert(\n this._uiManager.getNonHCMColor(this.color)\n );\n\n const serialized = {\n annotationType: AnnotationEditorType.HIGHLIGHT,\n color,\n opacity: this.#opacity,\n thickness: this.#thickness,\n quadPoints: this.#serializeBoxes(),\n outlines: this.#serializeOutlines(rect),\n pageIndex: this.pageIndex,\n rect,\n rotation: this.#getRotation(),\n structTreeParentId: this._structTreeParentId,\n };\n this.addComment(serialized);\n\n if (this.annotationElementId && !this.#hasElementChanged(serialized)) {\n return null;\n }\n\n serialized.id = this.annotationElementId;\n return serialized;\n }\n\n #hasElementChanged(serialized) {\n const { color } = this._initialData;\n return (\n this.hasEditedComment || serialized.color.some((c, i) => c !== color[i])\n );\n }\n\n /** @inheritdoc */\n renderAnnotationElement(annotation) {\n if (this.deleted) {\n annotation.hide();\n return null;\n }\n const params = {\n rect: this.getPDFRect(),\n };\n if (this.hasEditedComment) {\n params.popup = this.comment;\n }\n annotation.updateEdited(params);\n\n return null;\n }\n\n static canCreateNewEmptyEditor() {\n return false;\n }\n}\n\nexport { HighlightEditor };\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 { AnnotationEditorParamsType, unreachable } from \"../../shared/util.js\";\nimport { noContextMenu, stopEvent } from \"../display_utils.js\";\nimport { AnnotationEditor } from \"./editor.js\";\n\nclass DrawingOptions {\n #svgProperties = Object.create(null);\n\n updateProperty(name, value) {\n this[name] = value;\n this.updateSVGProperty(name, value);\n }\n\n updateProperties(properties) {\n if (!properties) {\n return;\n }\n for (const [name, value] of Object.entries(properties)) {\n if (!name.startsWith(\"_\")) {\n this.updateProperty(name, value);\n }\n }\n }\n\n updateSVGProperty(name, value) {\n this.#svgProperties[name] = value;\n }\n\n toSVGProperties() {\n const root = this.#svgProperties;\n this.#svgProperties = Object.create(null);\n return { root };\n }\n\n reset() {\n this.#svgProperties = Object.create(null);\n }\n\n updateAll(options = this) {\n this.updateProperties(options);\n }\n\n clone() {\n unreachable(\"Not implemented\");\n }\n}\n\n/**\n * Basic draw editor.\n */\nclass DrawingEditor extends AnnotationEditor {\n #drawOutlines = null;\n\n #mustBeCommitted;\n\n _colorPicker = null;\n\n _drawId = null;\n\n static _currentDrawId = -1;\n\n static _currentParent = null;\n\n static #currentDraw = null;\n\n static #currentDrawingAC = null;\n\n static #currentDrawingOptions = null;\n\n static #currentPointerId = NaN;\n\n static #currentPointerType = null;\n\n static #currentPointerIds = null;\n\n static #currentMoveTimestamp = NaN;\n\n static _INNER_MARGIN = 3;\n\n constructor(params) {\n super(params);\n this.#mustBeCommitted = params.mustBeCommitted || false;\n\n this._addOutlines(params);\n }\n\n _addOutlines(params) {\n if (params.drawOutlines) {\n this.#createDrawOutlines(params);\n this.#addToDrawLayer();\n }\n }\n\n #createDrawOutlines({ drawOutlines, drawId, drawingOptions }) {\n this.#drawOutlines = drawOutlines;\n this._drawingOptions ||= drawingOptions;\n if (!this.annotationElementId) {\n this._uiManager.a11yAlert(`pdfjs-editor-${this.editorType}-added-alert`);\n }\n\n if (drawId >= 0) {\n this._drawId = drawId;\n // We need to redraw the drawing because we changed the coordinates to be\n // in the box coordinate system.\n this.parent.drawLayer.finalizeDraw(\n drawId,\n drawOutlines.defaultProperties\n );\n } else {\n // We create a new drawing.\n this._drawId = this.#createDrawing(drawOutlines, this.parent);\n }\n\n this.#updateBbox(drawOutlines.box);\n }\n\n #createDrawing(drawOutlines, parent) {\n const { id } = parent.drawLayer.draw(\n DrawingEditor._mergeSVGProperties(\n this._drawingOptions.toSVGProperties(),\n drawOutlines.defaultSVGProperties\n ),\n /* isPathUpdatable = */ false,\n /* hasClip = */ false\n );\n return id;\n }\n\n static _mergeSVGProperties(p1, p2) {\n const p1Keys = new Set(Object.keys(p1));\n\n for (const [key, value] of Object.entries(p2)) {\n if (p1Keys.has(key)) {\n Object.assign(p1[key], value);\n } else {\n p1[key] = value;\n }\n }\n return p1;\n }\n\n /**\n * @param {Object} options\n * @return {DrawingOptions} the default options to use for a new editor.\n */\n static getDefaultDrawingOptions(_options) {\n unreachable(\"Not implemented\");\n }\n\n /**\n * @return {Map<AnnotationEditorParamsType, string>} a map between the\n * parameter types and the name of the options.\n */\n // eslint-disable-next-line getter-return\n static get typesMap() {\n unreachable(\"Not implemented\");\n }\n\n static get isDrawer() {\n return true;\n }\n\n /**\n * @returns {boolean} `true` if several drawings can be added to the\n * annotation.\n */\n static get supportMultipleDrawings() {\n return false;\n }\n\n /** @inheritdoc */\n static updateDefaultParams(type, value) {\n const propertyName = this.typesMap.get(type);\n if (propertyName) {\n this._defaultDrawingOptions.updateProperty(propertyName, value);\n }\n if (this._currentParent) {\n DrawingEditor.#currentDraw.updateProperty(propertyName, value);\n this._currentParent.drawLayer.updateProperties(\n this._currentDrawId,\n this._defaultDrawingOptions.toSVGProperties()\n );\n }\n }\n\n /** @inheritdoc */\n updateParams(type, value) {\n const propertyName = this.constructor.typesMap.get(type);\n if (propertyName) {\n this._updateProperty(type, propertyName, value);\n }\n }\n\n /** @inheritdoc */\n static get defaultPropertiesToUpdate() {\n const properties = [];\n const options = this._defaultDrawingOptions;\n for (const [type, name] of this.typesMap) {\n properties.push([type, options[name]]);\n }\n return properties;\n }\n\n /** @inheritdoc */\n get propertiesToUpdate() {\n const properties = [];\n const { _drawingOptions } = this;\n for (const [type, name] of this.constructor.typesMap) {\n properties.push([type, _drawingOptions[name]]);\n }\n return properties;\n }\n\n /**\n * Update a property and make this action undoable.\n * @param {string} color\n */\n _updateProperty(type, name, value) {\n const options = this._drawingOptions;\n const savedValue = options[name];\n const setter = val => {\n options.updateProperty(name, val);\n const bbox = this.#drawOutlines.updateProperty(name, val);\n if (bbox) {\n this.#updateBbox(bbox);\n }\n this.parent?.drawLayer.updateProperties(\n this._drawId,\n options.toSVGProperties()\n );\n if (type === this.colorType) {\n this._colorPicker?.update(val);\n }\n };\n this.addCommands({\n cmd: setter.bind(this, value),\n undo: setter.bind(this, savedValue),\n post: this._uiManager.updateUI.bind(this._uiManager, this),\n mustExec: true,\n type,\n overwriteIfSameType: true,\n keepUndo: true,\n });\n }\n\n /** @inheritdoc */\n _onResizing() {\n this.parent?.drawLayer.updateProperties(\n this._drawId,\n DrawingEditor._mergeSVGProperties(\n this.#drawOutlines.getPathResizingSVGProperties(\n this.#convertToDrawSpace()\n ),\n {\n bbox: this.#rotateBox(),\n }\n )\n );\n }\n\n /** @inheritdoc */\n _onResized() {\n this.parent?.drawLayer.updateProperties(\n this._drawId,\n DrawingEditor._mergeSVGProperties(\n this.#drawOutlines.getPathResizedSVGProperties(\n this.#convertToDrawSpace()\n ),\n {\n bbox: this.#rotateBox(),\n }\n )\n );\n }\n\n /** @inheritdoc */\n _onTranslating(_x, _y) {\n this.parent?.drawLayer.updateProperties(this._drawId, {\n bbox: this.#rotateBox(),\n });\n }\n\n /** @inheritdoc */\n _onTranslated() {\n this.parent?.drawLayer.updateProperties(\n this._drawId,\n DrawingEditor._mergeSVGProperties(\n this.#drawOutlines.getPathTranslatedSVGProperties(\n this.#convertToDrawSpace(),\n this.parentDimensions\n ),\n {\n bbox: this.#rotateBox(),\n }\n )\n );\n }\n\n _onStartDragging() {\n this.parent?.drawLayer.updateProperties(this._drawId, {\n rootClass: {\n moving: true,\n },\n });\n }\n\n _onStopDragging() {\n this.parent?.drawLayer.updateProperties(this._drawId, {\n rootClass: {\n moving: false,\n },\n });\n }\n\n /** @inheritdoc */\n commit() {\n super.commit();\n\n this.disableEditMode();\n this.disableEditing();\n }\n\n /** @inheritdoc */\n disableEditing() {\n super.disableEditing();\n this.div.classList.toggle(\"disabled\", true);\n }\n\n /** @inheritdoc */\n enableEditing() {\n super.enableEditing();\n this.div.classList.toggle(\"disabled\", false);\n }\n\n /** @inheritdoc */\n getBaseTranslation() {\n // The editor itself doesn't have any CSS border (we're drawing one\n // ourselves in using SVG).\n return [0, 0];\n }\n\n /** @inheritdoc */\n get isResizable() {\n return true;\n }\n\n /** @inheritdoc */\n onceAdded(focus) {\n if (!this.annotationElementId) {\n this.parent.addUndoableEditor(this);\n }\n this._isDraggable = true;\n if (this.#mustBeCommitted) {\n this.#mustBeCommitted = false;\n this.commit();\n this.parent.setSelected(this);\n if (focus && this.isOnScreen) {\n this.div.focus();\n }\n }\n }\n\n /** @inheritdoc */\n remove() {\n this.#cleanDrawLayer();\n super.remove();\n }\n\n /** @inheritdoc */\n rebuild() {\n if (!this.parent) {\n return;\n }\n super.rebuild();\n if (this.div === null) {\n return;\n }\n\n this.#addToDrawLayer();\n this.#updateBbox(this.#drawOutlines.box);\n\n if (!this.isAttachedToDOM) {\n // At some point this editor was removed and we're rebuilding it,\n // hence we must add it to its parent.\n this.parent.add(this);\n }\n }\n\n setParent(parent) {\n let mustBeSelected = false;\n if (this.parent && !parent) {\n this._uiManager.removeShouldRescale(this);\n this.#cleanDrawLayer();\n } else if (parent) {\n this._uiManager.addShouldRescale(this);\n this.#addToDrawLayer(parent);\n // If mustBeSelected is true it means that this editor was selected\n // when its parent has been destroyed, hence we must select it again.\n mustBeSelected =\n !this.parent && this.div?.classList.contains(\"selectedEditor\");\n }\n super.setParent(parent);\n if (mustBeSelected) {\n // We select it after the parent has been set.\n this.select();\n }\n }\n\n #cleanDrawLayer() {\n if (this._drawId === null || !this.parent) {\n return;\n }\n this.parent.drawLayer.remove(this._drawId);\n this._drawId = null;\n\n // All the SVG properties must be reset in order to make it possible to\n // undo.\n this._drawingOptions.reset();\n }\n\n #addToDrawLayer(parent = this.parent) {\n if (this._drawId !== null && this.parent === parent) {\n return;\n }\n if (this._drawId !== null) {\n // The parent has changed, we need to move the drawing to the new parent.\n this.parent.drawLayer.updateParent(this._drawId, parent.drawLayer);\n return;\n }\n this._drawingOptions.updateAll();\n this._drawId = this.#createDrawing(this.#drawOutlines, parent);\n }\n\n #convertToParentSpace([x, y, width, height]) {\n const {\n parentDimensions: [pW, pH],\n rotation,\n } = this;\n switch (rotation) {\n case 90:\n return [y, 1 - x, width * (pH / pW), height * (pW / pH)];\n case 180:\n return [1 - x, 1 - y, width, height];\n case 270:\n return [1 - y, x, width * (pH / pW), height * (pW / pH)];\n default:\n return [x, y, width, height];\n }\n }\n\n #convertToDrawSpace() {\n const {\n x,\n y,\n width,\n height,\n parentDimensions: [pW, pH],\n rotation,\n } = this;\n switch (rotation) {\n case 90:\n return [1 - y, x, width * (pW / pH), height * (pH / pW)];\n case 180:\n return [1 - x, 1 - y, width, height];\n case 270:\n return [y, 1 - x, width * (pW / pH), height * (pH / pW)];\n default:\n return [x, y, width, height];\n }\n }\n\n #updateBbox(bbox) {\n [this.x, this.y, this.width, this.height] =\n this.#convertToParentSpace(bbox);\n if (this.div) {\n this.fixAndSetPosition();\n const [parentWidth, parentHeight] = this.parentDimensions;\n this.setDims(this.width * parentWidth, this.height * parentHeight);\n }\n this._onResized();\n }\n\n #rotateBox() {\n // We've to deal with two rotations: the rotation of the annotation and the\n // rotation of the parent page.\n // When the page is rotated, all the layers are just rotated thanks to CSS\n // but there is a notable exception: the canvas wrapper.\n // The canvas wrapper is not rotated but the dimensions are (or not) swapped\n // and the page is redrawn with the rotation applied to the canvas.\n // The drawn layer is under the canvas wrapper and is not rotated so we have\n // to \"manually\" rotate the coordinates.\n //\n // The coordinates (this.x, this.y) correspond to the top-left corner of\n // the editor after it has been rotated in the page coordinate system.\n\n const {\n x,\n y,\n width,\n height,\n rotation,\n parentRotation,\n parentDimensions: [pW, pH],\n } = this;\n switch ((rotation * 4 + parentRotation) / 90) {\n case 1:\n // 0 -> 90\n return [1 - y - height, x, height, width];\n case 2:\n // 0 -> 180\n return [1 - x - width, 1 - y - height, width, height];\n case 3:\n // 0 -> 270\n return [y, 1 - x - width, height, width];\n case 4:\n // 90 -> 0\n return [\n x,\n y - width * (pW / pH),\n height * (pH / pW),\n width * (pW / pH),\n ];\n case 5:\n // 90 -> 90\n return [1 - y, x, width * (pW / pH), height * (pH / pW)];\n case 6:\n // 90 -> 180\n return [\n 1 - x - height * (pH / pW),\n 1 - y,\n height * (pH / pW),\n width * (pW / pH),\n ];\n case 7:\n // 90 -> 270\n return [\n y - width * (pW / pH),\n 1 - x - height * (pH / pW),\n width * (pW / pH),\n height * (pH / pW),\n ];\n case 8:\n // 180 -> 0\n return [x - width, y - height, width, height];\n case 9:\n // 180 -> 90\n return [1 - y, x - width, height, width];\n case 10:\n // 180 -> 180\n return [1 - x, 1 - y, width, height];\n case 11:\n // 180 -> 270\n return [y - height, 1 - x, height, width];\n case 12:\n // 270 -> 0\n return [\n x - height * (pH / pW),\n y,\n height * (pH / pW),\n width * (pW / pH),\n ];\n case 13:\n // 270 -> 90\n return [\n 1 - y - width * (pW / pH),\n x - height * (pH / pW),\n width * (pW / pH),\n height * (pH / pW),\n ];\n case 14:\n // 270 -> 180\n return [\n 1 - x,\n 1 - y - width * (pW / pH),\n height * (pH / pW),\n width * (pW / pH),\n ];\n case 15:\n // 270 -> 270\n return [y, 1 - x, width * (pW / pH), height * (pH / pW)];\n default:\n // 0 -> 0\n return [x, y, width, height];\n }\n }\n\n /** @inheritdoc */\n rotate() {\n if (!this.parent) {\n return;\n }\n this.parent.drawLayer.updateProperties(\n this._drawId,\n DrawingEditor._mergeSVGProperties(\n {\n bbox: this.#rotateBox(),\n },\n this.#drawOutlines.updateRotation(\n (this.parentRotation - this.rotation + 360) % 360\n )\n )\n );\n }\n\n onScaleChanging() {\n if (!this.parent) {\n return;\n }\n this.#updateBbox(\n this.#drawOutlines.updateParentDimensions(\n this.parentDimensions,\n this.parent.scale\n )\n );\n }\n\n static onScaleChangingWhenDrawing() {}\n\n /** @inheritdoc */\n render() {\n if (this.div) {\n return this.div;\n }\n\n let baseX, baseY;\n if (this._isCopy) {\n baseX = this.x;\n baseY = this.y;\n }\n\n const div = super.render();\n div.classList.add(\"draw\");\n\n const drawDiv = document.createElement(\"div\");\n div.append(drawDiv);\n drawDiv.setAttribute(\"aria-hidden\", \"true\");\n drawDiv.className = \"internal\";\n const [parentWidth, parentHeight] = this.parentDimensions;\n this.setDims(this.width * parentWidth, this.height * parentHeight);\n this._uiManager.addShouldRescale(this);\n this.disableEditing();\n\n if (this._isCopy) {\n this._moveAfterPaste(baseX, baseY);\n }\n\n return div;\n }\n\n /**\n * Create a new drawer instance.\n * @param {number} x - The x coordinate of the event.\n * @param {number} y - The y coordinate of the event.\n * @param {number} parentWidth - The parent width.\n * @param {number} parentHeight - The parent height.\n * @param {number} rotation - The parent rotation.\n */\n static createDrawerInstance(_x, _y, _parentWidth, _parentHeight, _rotation) {\n unreachable(\"Not implemented\");\n }\n\n static startDrawing(parent, uiManager, _isLTR, event) {\n // The _currentPointerType is set when the user starts an empty drawing\n // session. If, in the same drawing session, the user starts using a\n // different type of pointer (e.g. a pen and then a finger), we just return.\n //\n // The _currentPointerId and _currentPointerIds are used to keep track of\n // the pointers with a same type (e.g. two fingers). If the user starts to\n // draw with a finger and then uses a second finger, we just stop the\n // current drawing and let the user zoom the document.\n\n const { target, offsetX: x, offsetY: y, pointerId, pointerType } = event;\n if (\n DrawingEditor.#currentPointerType &&\n DrawingEditor.#currentPointerType !== pointerType\n ) {\n return;\n }\n\n const {\n viewport: { rotation },\n } = parent;\n const { width: parentWidth, height: parentHeight } =\n target.getBoundingClientRect();\n\n const ac = (DrawingEditor.#currentDrawingAC = new AbortController());\n const signal = parent.combinedSignal(ac);\n\n DrawingEditor.#currentPointerId ||= pointerId;\n DrawingEditor.#currentPointerType ??= pointerType;\n\n window.addEventListener(\n \"pointerup\",\n e => {\n if (DrawingEditor.#currentPointerId === e.pointerId) {\n this._endDraw(e);\n } else {\n DrawingEditor.#currentPointerIds?.delete(e.pointerId);\n }\n },\n { signal }\n );\n window.addEventListener(\n \"pointercancel\",\n e => {\n if (DrawingEditor.#currentPointerId === e.pointerId) {\n this._currentParent.endDrawingSession();\n } else {\n DrawingEditor.#currentPointerIds?.delete(e.pointerId);\n }\n },\n { signal }\n );\n window.addEventListener(\n \"pointerdown\",\n e => {\n if (DrawingEditor.#currentPointerType !== e.pointerType) {\n // For example, we started with a pen and the user\n // is now using a finger.\n return;\n }\n\n // For example, the user is using a second finger.\n (DrawingEditor.#currentPointerIds ||= new Set()).add(e.pointerId);\n\n // The first finger created a first point and a second finger just\n // started, so we stop the drawing and remove this only point.\n if (DrawingEditor.#currentDraw.isCancellable()) {\n DrawingEditor.#currentDraw.removeLastElement();\n if (DrawingEditor.#currentDraw.isEmpty()) {\n this._currentParent.endDrawingSession(/* isAborted = */ true);\n } else {\n this._endDraw(null);\n }\n }\n },\n {\n capture: true,\n passive: false,\n signal,\n }\n );\n window.addEventListener(\"contextmenu\", noContextMenu, { signal });\n target.addEventListener(\"pointermove\", this._drawMove.bind(this), {\n signal,\n });\n target.addEventListener(\n \"touchmove\",\n e => {\n if (e.timeStamp === DrawingEditor.#currentMoveTimestamp) {\n // This move event is used to draw so we don't want to scroll.\n stopEvent(e);\n }\n },\n { signal }\n );\n parent.toggleDrawing();\n uiManager._editorUndoBar?.hide();\n\n if (DrawingEditor.#currentDraw) {\n parent.drawLayer.updateProperties(\n this._currentDrawId,\n DrawingEditor.#currentDraw.startNew(\n x,\n y,\n parentWidth,\n parentHeight,\n rotation\n )\n );\n return;\n }\n\n uiManager.updateUIForDefaultProperties(this);\n\n DrawingEditor.#currentDraw = this.createDrawerInstance(\n x,\n y,\n parentWidth,\n parentHeight,\n rotation\n );\n DrawingEditor.#currentDrawingOptions = this.getDefaultDrawingOptions();\n this._currentParent = parent;\n\n ({ id: this._currentDrawId } = parent.drawLayer.draw(\n this._mergeSVGProperties(\n DrawingEditor.#currentDrawingOptions.toSVGProperties(),\n DrawingEditor.#currentDraw.defaultSVGProperties\n ),\n /* isPathUpdatable = */ true,\n /* hasClip = */ false\n ));\n }\n\n static _drawMove(event) {\n DrawingEditor.#currentMoveTimestamp = -1;\n if (!DrawingEditor.#currentDraw) {\n return;\n }\n const { offsetX, offsetY, pointerId } = event;\n\n if (DrawingEditor.#currentPointerId !== pointerId) {\n return;\n }\n if (DrawingEditor.#currentPointerIds?.size >= 1) {\n // The user is using multiple fingers and the first one is moving.\n this._endDraw(event);\n return;\n }\n this._currentParent.drawLayer.updateProperties(\n this._currentDrawId,\n DrawingEditor.#currentDraw.add(offsetX, offsetY)\n );\n // We track the timestamp to know if the touchmove event is used to draw.\n DrawingEditor.#currentMoveTimestamp = event.timeStamp;\n stopEvent(event);\n }\n\n static _cleanup(all) {\n if (all) {\n this._currentDrawId = -1;\n this._currentParent = null;\n DrawingEditor.#currentDraw = null;\n DrawingEditor.#currentDrawingOptions = null;\n DrawingEditor.#currentPointerType = null;\n DrawingEditor.#currentMoveTimestamp = NaN;\n }\n\n if (DrawingEditor.#currentDrawingAC) {\n DrawingEditor.#currentDrawingAC.abort();\n DrawingEditor.#currentDrawingAC = null;\n DrawingEditor.#currentPointerId = NaN;\n DrawingEditor.#currentPointerIds = null;\n }\n }\n\n static _endDraw(event) {\n const parent = this._currentParent;\n if (!parent) {\n return;\n }\n\n parent.toggleDrawing(true);\n this._cleanup(false);\n\n if (event?.target === parent.div) {\n parent.drawLayer.updateProperties(\n this._currentDrawId,\n DrawingEditor.#currentDraw.end(event.offsetX, event.offsetY)\n );\n }\n if (this.supportMultipleDrawings) {\n const draw = DrawingEditor.#currentDraw;\n const drawId = this._currentDrawId;\n const lastElement = draw.getLastElement();\n parent.addCommands({\n cmd: () => {\n parent.drawLayer.updateProperties(\n drawId,\n draw.setLastElement(lastElement)\n );\n },\n undo: () => {\n parent.drawLayer.updateProperties(drawId, draw.removeLastElement());\n },\n mustExec: false,\n type: AnnotationEditorParamsType.DRAW_STEP,\n });\n\n return;\n }\n\n this.endDrawing(/* isAborted = */ false);\n }\n\n static endDrawing(isAborted) {\n const parent = this._currentParent;\n if (!parent) {\n return null;\n }\n parent.toggleDrawing(true);\n parent.cleanUndoStack(AnnotationEditorParamsType.DRAW_STEP);\n\n if (!DrawingEditor.#currentDraw.isEmpty()) {\n const {\n pageDimensions: [pageWidth, pageHeight],\n scale,\n } = parent;\n\n const editor = parent.createAndAddNewEditor(\n { offsetX: 0, offsetY: 0 },\n false,\n {\n drawId: this._currentDrawId,\n drawOutlines: DrawingEditor.#currentDraw.getOutlines(\n pageWidth * scale,\n pageHeight * scale,\n scale,\n this._INNER_MARGIN\n ),\n drawingOptions: DrawingEditor.#currentDrawingOptions,\n mustBeCommitted: !isAborted,\n }\n );\n this._cleanup(true);\n return editor;\n }\n\n parent.drawLayer.remove(this._currentDrawId);\n this._cleanup(true);\n return null;\n }\n\n /**\n * Create the drawing options.\n * @param {Object} _data\n */\n createDrawingOptions(_data) {}\n\n /**\n * Deserialize the drawing outlines.\n * @param {number} pageX - The x coordinate of the page.\n * @param {number} pageY - The y coordinate of the page.\n * @param {number} pageWidth - The width of the page.\n * @param {number} pageHeight - The height of the page.\n * @param {number} innerWidth - The inner width.\n * @param {Object} data - The data to deserialize.\n * @returns {Object} The deserialized outlines.\n */\n static deserializeDraw(\n _pageX,\n _pageY,\n _pageWidth,\n _pageHeight,\n _innerWidth,\n _data\n ) {\n unreachable(\"Not implemented\");\n }\n\n /** @inheritdoc */\n static async deserialize(data, parent, uiManager) {\n const {\n rawDims: { pageWidth, pageHeight, pageX, pageY },\n } = parent.viewport;\n const drawOutlines = this.deserializeDraw(\n pageX,\n pageY,\n pageWidth,\n pageHeight,\n this._INNER_MARGIN,\n data\n );\n const editor = await super.deserialize(data, parent, uiManager);\n editor.createDrawingOptions(data);\n editor.#createDrawOutlines({ drawOutlines });\n editor.#addToDrawLayer();\n editor.onScaleChanging();\n editor.rotate();\n\n return editor;\n }\n\n serializeDraw(isForCopying) {\n const [pageX, pageY] = this.pageTranslation;\n const [pageWidth, pageHeight] = this.pageDimensions;\n return this.#drawOutlines.serialize(\n [pageX, pageY, pageWidth, pageHeight],\n isForCopying\n );\n }\n\n /** @inheritdoc */\n renderAnnotationElement(annotation) {\n annotation.updateEdited({\n rect: this.getPDFRect(),\n });\n\n return null;\n }\n\n static canCreateNewEmptyEditor() {\n return false;\n }\n}\n\nexport { DrawingEditor, DrawingOptions };\n","/* Copyright 2024 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 { MathClamp, Util } from \"../../../shared/util.js\";\nimport { Outline } from \"./outline.js\";\n\nclass InkDrawOutliner {\n // The last 3 points of the line.\n #last = new Float64Array(6);\n\n #line;\n\n #lines;\n\n #rotation;\n\n #thickness;\n\n #points;\n\n #lastSVGPath = \"\";\n\n #lastIndex = 0;\n\n #outlines = new InkDrawOutline();\n\n #parentWidth;\n\n #parentHeight;\n\n constructor(x, y, parentWidth, parentHeight, rotation, thickness) {\n this.#parentWidth = parentWidth;\n this.#parentHeight = parentHeight;\n this.#rotation = rotation;\n this.#thickness = thickness;\n\n [x, y] = this.#normalizePoint(x, y);\n\n const line = (this.#line = [NaN, NaN, NaN, NaN, x, y]);\n this.#points = [x, y];\n this.#lines = [{ line, points: this.#points }];\n this.#last.set(line, 0);\n }\n\n updateProperty(name, value) {\n if (name === \"stroke-width\") {\n this.#thickness = value;\n }\n }\n\n #normalizePoint(x, y) {\n return Outline._normalizePoint(\n x,\n y,\n this.#parentWidth,\n this.#parentHeight,\n this.#rotation\n );\n }\n\n isEmpty() {\n return !this.#lines || this.#lines.length === 0;\n }\n\n isCancellable() {\n // The user a second finger after drawing 5 points: it's small enough\n // to not be a real drawing.\n return this.#points.length <= 10;\n }\n\n add(x, y) {\n // The point is in canvas coordinates which means that there is no rotation.\n // It's the same as parent coordinates.\n [x, y] = this.#normalizePoint(x, y);\n const [x1, y1, x2, y2] = this.#last.subarray(2, 6);\n const diffX = x - x2;\n const diffY = y - y2;\n const d = Math.hypot(this.#parentWidth * diffX, this.#parentHeight * diffY);\n if (d <= 2) {\n // The idea is to avoid garbage points around the last point.\n // When the points are too close, it just leads to bad normal vectors and\n // control points.\n return null;\n }\n\n this.#points.push(x, y);\n\n if (isNaN(x1)) {\n // We've only one point.\n this.#last.set([x2, y2, x, y], 2);\n this.#line.push(NaN, NaN, NaN, NaN, x, y);\n return {\n path: {\n d: this.toSVGPath(),\n },\n };\n }\n\n if (isNaN(this.#last[0])) {\n // We've only two points.\n this.#line.splice(6, 6);\n }\n\n this.#last.set([x1, y1, x2, y2, x, y], 0);\n this.#line.push(...Outline.createBezierPoints(x1, y1, x2, y2, x, y));\n\n return {\n path: {\n d: this.toSVGPath(),\n },\n };\n }\n\n end(x, y) {\n const change = this.add(x, y);\n if (change) {\n return change;\n }\n if (this.#points.length === 2) {\n // We've only one point.\n return {\n path: {\n d: this.toSVGPath(),\n },\n };\n }\n return null;\n }\n\n startNew(x, y, parentWidth, parentHeight, rotation) {\n this.#parentWidth = parentWidth;\n this.#parentHeight = parentHeight;\n this.#rotation = rotation;\n\n [x, y] = this.#normalizePoint(x, y);\n\n const line = (this.#line = [NaN, NaN, NaN, NaN, x, y]);\n this.#points = [x, y];\n const last = this.#lines.at(-1);\n if (last) {\n last.line = new Float32Array(last.line);\n last.points = new Float32Array(last.points);\n }\n this.#lines.push({ line, points: this.#points });\n this.#last.set(line, 0);\n this.#lastIndex = 0;\n this.toSVGPath();\n\n return null;\n }\n\n getLastElement() {\n return this.#lines.at(-1);\n }\n\n setLastElement(element) {\n if (!this.#lines) {\n return this.#outlines.setLastElement(element);\n }\n this.#lines.push(element);\n this.#line = element.line;\n this.#points = element.points;\n this.#lastIndex = 0;\n return {\n path: {\n d: this.toSVGPath(),\n },\n };\n }\n\n removeLastElement() {\n if (!this.#lines) {\n return this.#outlines.removeLastElement();\n }\n this.#lines.pop();\n this.#lastSVGPath = \"\";\n for (let i = 0, ii = this.#lines.length; i < ii; i++) {\n const { line, points } = this.#lines[i];\n this.#line = line;\n this.#points = points;\n this.#lastIndex = 0;\n this.toSVGPath();\n }\n\n return {\n path: {\n d: this.#lastSVGPath,\n },\n };\n }\n\n toSVGPath() {\n const firstX = Outline.svgRound(this.#line[4]);\n const firstY = Outline.svgRound(this.#line[5]);\n if (this.#points.length === 2) {\n this.#lastSVGPath = `${this.#lastSVGPath} M ${firstX} ${firstY} Z`;\n return this.#lastSVGPath;\n }\n\n if (this.#points.length <= 6) {\n // We've 2 or 3 points.\n const i = this.#lastSVGPath.lastIndexOf(\"M\");\n this.#lastSVGPath = `${this.#lastSVGPath.slice(0, i)} M ${firstX} ${firstY}`;\n this.#lastIndex = 6;\n }\n\n if (this.#points.length === 4) {\n const secondX = Outline.svgRound(this.#line[10]);\n const secondY = Outline.svgRound(this.#line[11]);\n this.#lastSVGPath = `${this.#lastSVGPath} L ${secondX} ${secondY}`;\n this.#lastIndex = 12;\n return this.#lastSVGPath;\n }\n\n const buffer = [];\n if (this.#lastIndex === 0) {\n buffer.push(`M ${firstX} ${firstY}`);\n this.#lastIndex = 6;\n }\n\n for (let i = this.#lastIndex, ii = this.#line.length; i < ii; i += 6) {\n const [c1x, c1y, c2x, c2y, x, y] = this.#line\n .slice(i, i + 6)\n .map(Outline.svgRound);\n buffer.push(`C${c1x} ${c1y} ${c2x} ${c2y} ${x} ${y}`);\n }\n this.#lastSVGPath += buffer.join(\" \");\n this.#lastIndex = this.#line.length;\n\n return this.#lastSVGPath;\n }\n\n getOutlines(parentWidth, parentHeight, scale, innerMargin) {\n const last = this.#lines.at(-1);\n last.line = new Float32Array(last.line);\n last.points = new Float32Array(last.points);\n\n this.#outlines.build(\n this.#lines,\n parentWidth,\n parentHeight,\n scale,\n this.#rotation,\n this.#thickness,\n innerMargin\n );\n\n // We reset everything: the drawing is done.\n this.#last = null;\n this.#line = null;\n this.#lines = null;\n this.#lastSVGPath = null;\n\n return this.#outlines;\n }\n\n get defaultSVGProperties() {\n return {\n root: {\n viewBox: \"0 0 10000 10000\",\n },\n rootClass: {\n draw: true,\n },\n bbox: [0, 0, 1, 1],\n };\n }\n}\n\nclass InkDrawOutline extends Outline {\n #bbox;\n\n #currentRotation = 0;\n\n #innerMargin;\n\n #lines;\n\n #parentWidth;\n\n #parentHeight;\n\n #parentScale;\n\n #rotation;\n\n #thickness;\n\n build(\n lines,\n parentWidth,\n parentHeight,\n parentScale,\n rotation,\n thickness,\n innerMargin\n ) {\n this.#parentWidth = parentWidth;\n this.#parentHeight = parentHeight;\n this.#parentScale = parentScale;\n this.#rotation = rotation;\n this.#thickness = thickness;\n this.#innerMargin = innerMargin ?? 0;\n this.#lines = lines;\n\n this.#computeBbox();\n }\n\n get thickness() {\n return this.#thickness;\n }\n\n setLastElement(element) {\n this.#lines.push(element);\n return {\n path: {\n d: this.toSVGPath(),\n },\n };\n }\n\n removeLastElement() {\n this.#lines.pop();\n return {\n path: {\n d: this.toSVGPath(),\n },\n };\n }\n\n toSVGPath() {\n const buffer = [];\n for (const { line } of this.#lines) {\n buffer.push(`M${Outline.svgRound(line[4])} ${Outline.svgRound(line[5])}`);\n if (line.length === 6) {\n buffer.push(\"Z\");\n continue;\n }\n if (line.length === 12 && isNaN(line[6])) {\n buffer.push(\n `L${Outline.svgRound(line[10])} ${Outline.svgRound(line[11])}`\n );\n continue;\n }\n for (let i = 6, ii = line.length; i < ii; i += 6) {\n const [c1x, c1y, c2x, c2y, x, y] = line\n .subarray(i, i + 6)\n .map(Outline.svgRound);\n buffer.push(`C${c1x} ${c1y} ${c2x} ${c2y} ${x} ${y}`);\n }\n }\n return buffer.join(\"\");\n }\n\n serialize([pageX, pageY, pageWidth, pageHeight], isForCopying) {\n const serializedLines = [];\n const serializedPoints = [];\n const [x, y, width, height] = this.#getBBoxWithNoMargin();\n let tx, ty, sx, sy, x1, y1, x2, y2, rescaleFn;\n\n switch (this.#rotation) {\n case 0:\n rescaleFn = Outline._rescale;\n tx = pageX;\n ty = pageY + pageHeight;\n sx = pageWidth;\n sy = -pageHeight;\n x1 = pageX + x * pageWidth;\n y1 = pageY + (1 - y - height) * pageHeight;\n x2 = pageX + (x + width) * pageWidth;\n y2 = pageY + (1 - y) * pageHeight;\n break;\n case 90:\n rescaleFn = Outline._rescaleAndSwap;\n tx = pageX;\n ty = pageY;\n sx = pageWidth;\n sy = pageHeight;\n x1 = pageX + y * pageWidth;\n y1 = pageY + x * pageHeight;\n x2 = pageX + (y + height) * pageWidth;\n y2 = pageY + (x + width) * pageHeight;\n break;\n case 180:\n rescaleFn = Outline._rescale;\n tx = pageX + pageWidth;\n ty = pageY;\n sx = -pageWidth;\n sy = pageHeight;\n x1 = pageX + (1 - x - width) * pageWidth;\n y1 = pageY + y * pageHeight;\n x2 = pageX + (1 - x) * pageWidth;\n y2 = pageY + (y + height) * pageHeight;\n break;\n case 270:\n rescaleFn = Outline._rescaleAndSwap;\n tx = pageX + pageWidth;\n ty = pageY + pageHeight;\n sx = -pageWidth;\n sy = -pageHeight;\n x1 = pageX + (1 - y - height) * pageWidth;\n y1 = pageY + (1 - x - width) * pageHeight;\n x2 = pageX + (1 - y) * pageWidth;\n y2 = pageY + (1 - x) * pageHeight;\n break;\n }\n\n for (const { line, points } of this.#lines) {\n serializedLines.push(\n rescaleFn(\n line,\n tx,\n ty,\n sx,\n sy,\n isForCopying ? new Array(line.length) : null\n )\n );\n serializedPoints.push(\n rescaleFn(\n points,\n tx,\n ty,\n sx,\n sy,\n isForCopying ? new Array(points.length) : null\n )\n );\n }\n\n return {\n lines: serializedLines,\n points: serializedPoints,\n rect: [x1, y1, x2, y2],\n };\n }\n\n static deserialize(\n pageX,\n pageY,\n pageWidth,\n pageHeight,\n innerMargin,\n { paths: { lines, points }, rotation, thickness }\n ) {\n const newLines = [];\n let tx, ty, sx, sy, rescaleFn;\n switch (rotation) {\n case 0:\n rescaleFn = Outline._rescale;\n tx = -pageX / pageWidth;\n ty = pageY / pageHeight + 1;\n sx = 1 / pageWidth;\n sy = -1 / pageHeight;\n break;\n case 90:\n rescaleFn = Outline._rescaleAndSwap;\n tx = -pageY / pageHeight;\n ty = -pageX / pageWidth;\n sx = 1 / pageHeight;\n sy = 1 / pageWidth;\n break;\n case 180:\n rescaleFn = Outline._rescale;\n tx = pageX / pageWidth + 1;\n ty = -pageY / pageHeight;\n sx = -1 / pageWidth;\n sy = 1 / pageHeight;\n break;\n case 270:\n rescaleFn = Outline._rescaleAndSwap;\n tx = pageY / pageHeight + 1;\n ty = pageX / pageWidth + 1;\n sx = -1 / pageHeight;\n sy = -1 / pageWidth;\n break;\n }\n\n if (!lines) {\n lines = [];\n for (const point of points) {\n const len = point.length;\n if (len === 2) {\n lines.push(\n new Float32Array([NaN, NaN, NaN, NaN, point[0], point[1]])\n );\n continue;\n }\n if (len === 4) {\n lines.push(\n new Float32Array([\n NaN,\n NaN,\n NaN,\n NaN,\n point[0],\n point[1],\n NaN,\n NaN,\n NaN,\n NaN,\n point[2],\n point[3],\n ])\n );\n continue;\n }\n const line = new Float32Array(3 * (len - 2));\n lines.push(line);\n let [x1, y1, x2, y2] = point.subarray(0, 4);\n line.set([NaN, NaN, NaN, NaN, x1, y1], 0);\n for (let i = 4; i < len; i += 2) {\n const x = point[i];\n const y = point[i + 1];\n line.set(\n Outline.createBezierPoints(x1, y1, x2, y2, x, y),\n (i - 2) * 3\n );\n [x1, y1, x2, y2] = [x2, y2, x, y];\n }\n }\n }\n\n for (let i = 0, ii = lines.length; i < ii; i++) {\n newLines.push({\n line: rescaleFn(\n lines[i].map(x => x ?? NaN),\n tx,\n ty,\n sx,\n sy\n ),\n points: rescaleFn(\n points[i].map(x => x ?? NaN),\n tx,\n ty,\n sx,\n sy\n ),\n });\n }\n\n const outlines = new this.prototype.constructor();\n outlines.build(\n newLines,\n pageWidth,\n pageHeight,\n 1,\n rotation,\n thickness,\n innerMargin\n );\n\n return outlines;\n }\n\n #getMarginComponents(thickness = this.#thickness) {\n const margin = this.#innerMargin + (thickness / 2) * this.#parentScale;\n return this.#rotation % 180 === 0\n ? [margin / this.#parentWidth, margin / this.#parentHeight]\n : [margin / this.#parentHeight, margin / this.#parentWidth];\n }\n\n #getBBoxWithNoMargin() {\n const [x, y, width, height] = this.#bbox;\n const [marginX, marginY] = this.#getMarginComponents(0);\n\n return [\n x + marginX,\n y + marginY,\n width - 2 * marginX,\n height - 2 * marginY,\n ];\n }\n\n #computeBbox() {\n const bbox = (this.#bbox = new Float32Array([\n Infinity,\n Infinity,\n -Infinity,\n -Infinity,\n ]));\n\n for (const { line } of this.#lines) {\n if (line.length <= 12) {\n // We've only one or two points => no bezier curve.\n for (let i = 4, ii = line.length; i < ii; i += 6) {\n Util.pointBoundingBox(line[i], line[i + 1], bbox);\n }\n continue;\n }\n let lastX = line[4],\n lastY = line[5];\n for (let i = 6, ii = line.length; i < ii; i += 6) {\n const [c1x, c1y, c2x, c2y, x, y] = line.subarray(i, i + 6);\n Util.bezierBoundingBox(lastX, lastY, c1x, c1y, c2x, c2y, x, y, bbox);\n lastX = x;\n lastY = y;\n }\n }\n\n const [marginX, marginY] = this.#getMarginComponents();\n bbox[0] = MathClamp(bbox[0] - marginX, 0, 1);\n bbox[1] = MathClamp(bbox[1] - marginY, 0, 1);\n bbox[2] = MathClamp(bbox[2] + marginX, 0, 1);\n bbox[3] = MathClamp(bbox[3] + marginY, 0, 1);\n\n bbox[2] -= bbox[0];\n bbox[3] -= bbox[1];\n }\n\n get box() {\n return this.#bbox;\n }\n\n updateProperty(name, value) {\n if (name === \"stroke-width\") {\n return this.#updateThickness(value);\n }\n return null;\n }\n\n #updateThickness(thickness) {\n const [oldMarginX, oldMarginY] = this.#getMarginComponents();\n this.#thickness = thickness;\n const [newMarginX, newMarginY] = this.#getMarginComponents();\n const [diffMarginX, diffMarginY] = [\n newMarginX - oldMarginX,\n newMarginY - oldMarginY,\n ];\n const bbox = this.#bbox;\n bbox[0] -= diffMarginX;\n bbox[1] -= diffMarginY;\n bbox[2] += 2 * diffMarginX;\n bbox[3] += 2 * diffMarginY;\n\n return bbox;\n }\n\n updateParentDimensions([width, height], scale) {\n const [oldMarginX, oldMarginY] = this.#getMarginComponents();\n this.#parentWidth = width;\n this.#parentHeight = height;\n this.#parentScale = scale;\n const [newMarginX, newMarginY] = this.#getMarginComponents();\n const diffMarginX = newMarginX - oldMarginX;\n const diffMarginY = newMarginY - oldMarginY;\n\n const bbox = this.#bbox;\n bbox[0] -= diffMarginX;\n bbox[1] -= diffMarginY;\n bbox[2] += 2 * diffMarginX;\n bbox[3] += 2 * diffMarginY;\n\n return bbox;\n }\n\n updateRotation(rotation) {\n this.#currentRotation = rotation;\n return {\n path: {\n transform: this.rotationTransform,\n },\n };\n }\n\n get viewBox() {\n return this.#bbox.map(Outline.svgRound).join(\" \");\n }\n\n get defaultProperties() {\n const [x, y] = this.#bbox;\n return {\n root: {\n viewBox: this.viewBox,\n },\n path: {\n \"transform-origin\": `${Outline.svgRound(x)} ${Outline.svgRound(y)}`,\n },\n };\n }\n\n get rotationTransform() {\n const [, , width, height] = this.#bbox;\n let a = 0,\n b = 0,\n c = 0,\n d = 0,\n e = 0,\n f = 0;\n switch (this.#currentRotation) {\n case 90:\n b = height / width;\n c = -width / height;\n e = width;\n break;\n case 180:\n a = -1;\n d = -1;\n e = width;\n f = height;\n break;\n case 270:\n b = -height / width;\n c = width / height;\n f = height;\n break;\n default:\n return \"\";\n }\n return `matrix(${a} ${b} ${c} ${d} ${Outline.svgRound(e)} ${Outline.svgRound(f)})`;\n }\n\n getPathResizingSVGProperties([newX, newY, newWidth, newHeight]) {\n const [marginX, marginY] = this.#getMarginComponents();\n const [x, y, width, height] = this.#bbox;\n\n if (\n Math.abs(width - marginX) <= Outline.PRECISION ||\n Math.abs(height - marginY) <= Outline.PRECISION\n ) {\n // Center the path in the new bounding box.\n const tx = newX + newWidth / 2 - (x + width / 2);\n const ty = newY + newHeight / 2 - (y + height / 2);\n return {\n path: {\n \"transform-origin\": `${Outline.svgRound(newX)} ${Outline.svgRound(newY)}`,\n transform: `${this.rotationTransform} translate(${tx} ${ty})`,\n },\n };\n }\n\n // We compute the following transform:\n // 1. Translate the path to the origin (-marginX, -marginY).\n // 2. Scale the path to the new size:\n // ((newWidth - 2*marginX) / (bbox.width - 2*marginX),\n // (newHeight - 2*marginY) / (bbox.height - 2*marginY)).\n // 3. Translate the path back to its original position\n // (marginX, marginY).\n // 4. Scale the inverse of bbox scaling:\n // (bbox.width / newWidth, bbox.height / newHeight).\n\n const s1x = (newWidth - 2 * marginX) / (width - 2 * marginX);\n const s1y = (newHeight - 2 * marginY) / (height - 2 * marginY);\n const s2x = width / newWidth;\n const s2y = height / newHeight;\n\n return {\n path: {\n \"transform-origin\": `${Outline.svgRound(x)} ${Outline.svgRound(y)}`,\n transform:\n `${this.rotationTransform} scale(${s2x} ${s2y}) ` +\n `translate(${Outline.svgRound(marginX)} ${Outline.svgRound(marginY)}) scale(${s1x} ${s1y}) ` +\n `translate(${Outline.svgRound(-marginX)} ${Outline.svgRound(-marginY)})`,\n },\n };\n }\n\n getPathResizedSVGProperties([newX, newY, newWidth, newHeight]) {\n const [marginX, marginY] = this.#getMarginComponents();\n const bbox = this.#bbox;\n const [x, y, width, height] = bbox;\n\n bbox[0] = newX;\n bbox[1] = newY;\n bbox[2] = newWidth;\n bbox[3] = newHeight;\n\n if (\n Math.abs(width - marginX) <= Outline.PRECISION ||\n Math.abs(height - marginY) <= Outline.PRECISION\n ) {\n // Center the path in the new bounding box.\n const tx = newX + newWidth / 2 - (x + width / 2);\n const ty = newY + newHeight / 2 - (y + height / 2);\n for (const { line, points } of this.#lines) {\n Outline._translate(line, tx, ty, line);\n Outline._translate(points, tx, ty, points);\n }\n return {\n root: {\n viewBox: this.viewBox,\n },\n path: {\n \"transform-origin\": `${Outline.svgRound(newX)} ${Outline.svgRound(newY)}`,\n transform: this.rotationTransform || null,\n d: this.toSVGPath(),\n },\n };\n }\n\n // We compute the following transform:\n // 1. Translate the path to the origin (-(x + marginX), -(y + marginY)).\n // 2. Scale the path to the new size:\n // ((newWidth - 2*marginX) / (bbox.width - 2*marginX),\n // (newHeight - 2*marginY) / (bbox.height - 2*marginY)).\n // 3. Translate the path back to its new position\n // (newX + marginX,y newY + marginY).\n\n const s1x = (newWidth - 2 * marginX) / (width - 2 * marginX);\n const s1y = (newHeight - 2 * marginY) / (height - 2 * marginY);\n const tx = -s1x * (x + marginX) + newX + marginX;\n const ty = -s1y * (y + marginY) + newY + marginY;\n\n if (s1x !== 1 || s1y !== 1 || tx !== 0 || ty !== 0) {\n for (const { line, points } of this.#lines) {\n Outline._rescale(line, tx, ty, s1x, s1y, line);\n Outline._rescale(points, tx, ty, s1x, s1y, points);\n }\n }\n\n return {\n root: {\n viewBox: this.viewBox,\n },\n path: {\n \"transform-origin\": `${Outline.svgRound(newX)} ${Outline.svgRound(newY)}`,\n transform: this.rotationTransform || null,\n d: this.toSVGPath(),\n },\n };\n }\n\n getPathTranslatedSVGProperties([newX, newY], parentDimensions) {\n const [newParentWidth, newParentHeight] = parentDimensions;\n const bbox = this.#bbox;\n const tx = newX - bbox[0];\n const ty = newY - bbox[1];\n\n if (\n this.#parentWidth === newParentWidth &&\n this.#parentHeight === newParentHeight\n ) {\n // We don't change the parent dimensions so it's a simple translation.\n for (const { line, points } of this.#lines) {\n Outline._translate(line, tx, ty, line);\n Outline._translate(points, tx, ty, points);\n }\n } else {\n const sx = this.#parentWidth / newParentWidth;\n const sy = this.#parentHeight / newParentHeight;\n this.#parentWidth = newParentWidth;\n this.#parentHeight = newParentHeight;\n\n for (const { line, points } of this.#lines) {\n Outline._rescale(line, tx, ty, sx, sy, line);\n Outline._rescale(points, tx, ty, sx, sy, points);\n }\n bbox[2] *= sx;\n bbox[3] *= sy;\n }\n bbox[0] = newX;\n bbox[1] = newY;\n\n return {\n root: {\n viewBox: this.viewBox,\n },\n path: {\n d: this.toSVGPath(),\n \"transform-origin\": `${Outline.svgRound(newX)} ${Outline.svgRound(newY)}`,\n },\n };\n }\n\n get defaultSVGProperties() {\n const bbox = this.#bbox;\n return {\n root: {\n viewBox: this.viewBox,\n },\n rootClass: {\n draw: true,\n },\n path: {\n d: this.toSVGPath(),\n \"transform-origin\": `${Outline.svgRound(bbox[0])} ${Outline.svgRound(bbox[1])}`,\n transform: this.rotationTransform || null,\n },\n bbox,\n };\n }\n}\n\nexport { InkDrawOutline, InkDrawOutliner };\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 {\n AnnotationEditorParamsType,\n AnnotationEditorType,\n shadow,\n Util,\n} from \"../../shared/util.js\";\nimport { DrawingEditor, DrawingOptions } from \"./draw.js\";\nimport { InkDrawOutline, InkDrawOutliner } from \"./drawers/inkdraw.js\";\nimport { AnnotationEditor } from \"./editor.js\";\nimport { BasicColorPicker } from \"./color_picker.js\";\nimport { InkAnnotationElement } from \"../annotation_layer.js\";\n\nclass InkDrawingOptions extends DrawingOptions {\n constructor(viewerParameters) {\n super();\n this._viewParameters = viewerParameters;\n\n super.updateProperties({\n fill: \"none\",\n stroke: AnnotationEditor._defaultLineColor,\n \"stroke-opacity\": 1,\n \"stroke-width\": 1,\n \"stroke-linecap\": \"round\",\n \"stroke-linejoin\": \"round\",\n \"stroke-miterlimit\": 10,\n });\n }\n\n updateSVGProperty(name, value) {\n if (name === \"stroke-width\") {\n value ??= this[\"stroke-width\"];\n value *= this._viewParameters.realScale;\n }\n super.updateSVGProperty(name, value);\n }\n\n clone() {\n const clone = new InkDrawingOptions(this._viewParameters);\n clone.updateAll(this);\n return clone;\n }\n}\n\n/**\n * Basic draw editor in order to generate an Ink annotation.\n */\nclass InkEditor extends DrawingEditor {\n static _type = \"ink\";\n\n static _editorType = AnnotationEditorType.INK;\n\n static _defaultDrawingOptions = null;\n\n constructor(params) {\n super({ ...params, name: \"inkEditor\" });\n this._willKeepAspectRatio = true;\n this.defaultL10nId = \"pdfjs-editor-ink-editor\";\n }\n\n /** @inheritdoc */\n static initialize(l10n, uiManager) {\n AnnotationEditor.initialize(l10n, uiManager);\n this._defaultDrawingOptions = new InkDrawingOptions(\n uiManager.viewParameters\n );\n }\n\n /** @inheritdoc */\n static getDefaultDrawingOptions(options) {\n const clone = this._defaultDrawingOptions.clone();\n clone.updateProperties(options);\n return clone;\n }\n\n /** @inheritdoc */\n static get supportMultipleDrawings() {\n return true;\n }\n\n /** @inheritdoc */\n static get typesMap() {\n return shadow(\n this,\n \"typesMap\",\n new Map([\n [AnnotationEditorParamsType.INK_THICKNESS, \"stroke-width\"],\n [AnnotationEditorParamsType.INK_COLOR, \"stroke\"],\n [AnnotationEditorParamsType.INK_OPACITY, \"stroke-opacity\"],\n ])\n );\n }\n\n /** @inheritdoc */\n static createDrawerInstance(x, y, parentWidth, parentHeight, rotation) {\n return new InkDrawOutliner(\n x,\n y,\n parentWidth,\n parentHeight,\n rotation,\n this._defaultDrawingOptions[\"stroke-width\"]\n );\n }\n\n /** @inheritdoc */\n static deserializeDraw(\n pageX,\n pageY,\n pageWidth,\n pageHeight,\n innerMargin,\n data\n ) {\n return InkDrawOutline.deserialize(\n pageX,\n pageY,\n pageWidth,\n pageHeight,\n innerMargin,\n data\n );\n }\n\n /** @inheritdoc */\n static async deserialize(data, parent, uiManager) {\n let initialData = null;\n if (data instanceof InkAnnotationElement) {\n const {\n data: {\n inkLists,\n rect,\n rotation,\n id,\n color,\n opacity,\n borderStyle: { rawWidth: thickness },\n popupRef,\n contentsObj,\n },\n parent: {\n page: { pageNumber },\n },\n } = data;\n initialData = data = {\n annotationType: AnnotationEditorType.INK,\n color: Array.from(color),\n thickness,\n opacity,\n paths: { points: inkLists },\n boxes: null,\n pageIndex: pageNumber - 1,\n rect: rect.slice(0),\n rotation,\n annotationElementId: id,\n id,\n deleted: false,\n popupRef,\n comment: contentsObj?.str || null,\n };\n }\n\n const editor = await super.deserialize(data, parent, uiManager);\n editor._initialData = initialData;\n if (data.comment) {\n editor.setCommentData(data.comment);\n }\n\n return editor;\n }\n\n /** @inheritdoc */\n get toolbarButtons() {\n this._colorPicker ||= new BasicColorPicker(this);\n return [[\"colorPicker\", this._colorPicker]];\n }\n\n get colorType() {\n return AnnotationEditorParamsType.INK_COLOR;\n }\n\n get colorValue() {\n return this._drawingOptions.stroke;\n }\n\n /** @inheritdoc */\n onScaleChanging() {\n if (!this.parent) {\n return;\n }\n super.onScaleChanging();\n const { _drawId, _drawingOptions, parent } = this;\n _drawingOptions.updateSVGProperty(\"stroke-width\");\n parent.drawLayer.updateProperties(\n _drawId,\n _drawingOptions.toSVGProperties()\n );\n }\n\n static onScaleChangingWhenDrawing() {\n const parent = this._currentParent;\n if (!parent) {\n return;\n }\n super.onScaleChangingWhenDrawing();\n this._defaultDrawingOptions.updateSVGProperty(\"stroke-width\");\n parent.drawLayer.updateProperties(\n this._currentDrawId,\n this._defaultDrawingOptions.toSVGProperties()\n );\n }\n\n /** @inheritdoc */\n createDrawingOptions({ color, thickness, opacity }) {\n this._drawingOptions = InkEditor.getDefaultDrawingOptions({\n stroke: Util.makeHexColor(...color),\n \"stroke-width\": thickness,\n \"stroke-opacity\": opacity,\n });\n }\n\n /** @inheritdoc */\n serialize(isForCopying = false) {\n if (this.isEmpty()) {\n return null;\n }\n\n if (this.deleted) {\n return this.serializeDeleted();\n }\n\n const { lines, points, rect } = this.serializeDraw(isForCopying);\n const {\n _drawingOptions: {\n stroke,\n \"stroke-opacity\": opacity,\n \"stroke-width\": thickness,\n },\n } = this;\n const serialized = {\n annotationType: AnnotationEditorType.INK,\n color: AnnotationEditor._colorManager.convert(stroke),\n opacity,\n thickness,\n paths: {\n lines,\n points,\n },\n pageIndex: this.pageIndex,\n rect,\n rotation: this.rotation,\n structTreeParentId: this._structTreeParentId,\n };\n this.addComment(serialized);\n\n if (isForCopying) {\n serialized.isCopy = true;\n return serialized;\n }\n\n if (this.annotationElementId && !this.#hasElementChanged(serialized)) {\n return null;\n }\n\n serialized.id = this.annotationElementId;\n return serialized;\n }\n\n #hasElementChanged(serialized) {\n const { color, thickness, opacity, pageIndex } = this._initialData;\n return (\n this.hasEditedComment ||\n this._hasBeenMoved ||\n this._hasBeenResized ||\n serialized.color.some((c, i) => c !== color[i]) ||\n serialized.thickness !== thickness ||\n serialized.opacity !== opacity ||\n serialized.pageIndex !== pageIndex\n );\n }\n\n /** @inheritdoc */\n renderAnnotationElement(annotation) {\n if (this.deleted) {\n annotation.hide();\n return null;\n }\n const { points, rect } = this.serializeDraw(/* isForCopying = */ false);\n const params = {\n rect,\n thickness: this._drawingOptions[\"stroke-width\"],\n points,\n };\n if (this.hasEditedComment) {\n params.popup = this.comment;\n }\n annotation.updateEdited(params);\n\n return null;\n }\n}\n\nexport { InkDrawingOptions, InkEditor };\n","/* Copyright 2024 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 { InkDrawOutline } from \"./inkdraw.js\";\n\nclass ContourDrawOutline extends InkDrawOutline {\n toSVGPath() {\n let path = super.toSVGPath();\n if (!path.endsWith(\"Z\")) {\n path += \"Z\";\n }\n return path;\n }\n}\n\nexport { ContourDrawOutline };\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 { fromBase64Util, toBase64Util, warn } from \"../../../shared/util.js\";\nimport { ContourDrawOutline } from \"./contour.js\";\nimport { InkDrawOutline } from \"./inkdraw.js\";\nimport { Outline } from \"./outline.js\";\n\nconst BASE_HEADER_LENGTH = 8;\nconst POINTS_PROPERTIES_NUMBER = 3;\n\n/**\n * Basic text editor in order to create a Signature annotation.\n */\nclass SignatureExtractor {\n static #PARAMETERS = {\n maxDim: 512,\n sigmaSFactor: 0.02,\n sigmaR: 25,\n kernelSize: 16,\n };\n\n static #neighborIndexToId(i0, j0, i, j) {\n /*\n The idea is to map the neighbors of a pixel into a unique id.\n 3 2 1\n 4 X 0\n 5 6 7\n */\n\n i -= i0;\n j -= j0;\n\n if (i === 0) {\n return j > 0 ? 0 : 4;\n }\n\n if (i === 1) {\n return j + 6;\n }\n\n return 2 - j;\n }\n\n static #neighborIdToIndex = new Int32Array([\n 0, 1, -1, 1, -1, 0, -1, -1, 0, -1, 1, -1, 1, 0, 1, 1,\n ]);\n\n static #clockwiseNonZero(buf, width, i0, j0, i, j, offset) {\n const id = this.#neighborIndexToId(i0, j0, i, j);\n for (let k = 0; k < 8; k++) {\n const kk = (-k + id - offset + 16) % 8;\n const shiftI = this.#neighborIdToIndex[2 * kk];\n const shiftJ = this.#neighborIdToIndex[2 * kk + 1];\n if (buf[(i0 + shiftI) * width + (j0 + shiftJ)] !== 0) {\n return kk;\n }\n }\n return -1;\n }\n\n static #counterClockwiseNonZero(buf, width, i0, j0, i, j, offset) {\n const id = this.#neighborIndexToId(i0, j0, i, j);\n for (let k = 0; k < 8; k++) {\n const kk = (k + id + offset + 16) % 8;\n const shiftI = this.#neighborIdToIndex[2 * kk];\n const shiftJ = this.#neighborIdToIndex[2 * kk + 1];\n if (buf[(i0 + shiftI) * width + (j0 + shiftJ)] !== 0) {\n return kk;\n }\n }\n return -1;\n }\n\n static #findContours(buf, width, height, threshold) {\n // Based on the Suzuki's algorithm:\n // https://web.archive.org/web/20231213161741/https://www.nevis.columbia.edu/~vgenty/public/suzuki_et_al.pdf\n\n const N = buf.length;\n const types = new Int32Array(N);\n for (let i = 0; i < N; i++) {\n types[i] = buf[i] <= threshold ? 1 : 0;\n }\n\n for (let i = 1; i < height - 1; i++) {\n types[i * width] = types[i * width + width - 1] = 0;\n }\n for (let i = 0; i < width; i++) {\n types[i] = types[width * height - 1 - i] = 0;\n }\n\n let nbd = 1;\n let lnbd;\n const contours = [];\n\n for (let i = 1; i < height - 1; i++) {\n lnbd = 1;\n for (let j = 1; j < width - 1; j++) {\n const ij = i * width + j;\n const pix = types[ij];\n if (pix === 0) {\n continue;\n }\n\n let i2 = i;\n let j2 = j;\n\n if (pix === 1 && types[ij - 1] === 0) {\n // Outer border.\n nbd += 1;\n j2 -= 1;\n } else if (pix >= 1 && types[ij + 1] === 0) {\n // Hole border.\n nbd += 1;\n j2 += 1;\n if (pix > 1) {\n lnbd = pix;\n }\n } else {\n if (pix !== 1) {\n lnbd = Math.abs(pix);\n }\n continue;\n }\n\n const points = [j, i];\n const isHole = j2 === j + 1;\n const contour = {\n isHole,\n points,\n id: nbd,\n parent: 0,\n };\n contours.push(contour);\n\n let contour0;\n for (const c of contours) {\n if (c.id === lnbd) {\n contour0 = c;\n break;\n }\n }\n\n if (!contour0) {\n contour.parent = isHole ? lnbd : 0;\n } else if (contour0.isHole) {\n contour.parent = isHole ? contour0.parent : lnbd;\n } else {\n contour.parent = isHole ? lnbd : contour0.parent;\n }\n\n const k = this.#clockwiseNonZero(types, width, i, j, i2, j2, 0);\n if (k === -1) {\n types[ij] = -nbd;\n if (types[ij] !== 1) {\n lnbd = Math.abs(types[ij]);\n }\n continue;\n }\n\n let shiftI = this.#neighborIdToIndex[2 * k];\n let shiftJ = this.#neighborIdToIndex[2 * k + 1];\n const i1 = i + shiftI;\n const j1 = j + shiftJ;\n i2 = i1;\n j2 = j1;\n let i3 = i;\n let j3 = j;\n\n while (true) {\n const kk = this.#counterClockwiseNonZero(\n types,\n width,\n i3,\n j3,\n i2,\n j2,\n 1\n );\n shiftI = this.#neighborIdToIndex[2 * kk];\n shiftJ = this.#neighborIdToIndex[2 * kk + 1];\n const i4 = i3 + shiftI;\n const j4 = j3 + shiftJ;\n points.push(j4, i4);\n const ij3 = i3 * width + j3;\n if (types[ij3 + 1] === 0) {\n types[ij3] = -nbd;\n } else if (types[ij3] === 1) {\n types[ij3] = nbd;\n }\n\n if (i4 === i && j4 === j && i3 === i1 && j3 === j1) {\n if (types[ij] !== 1) {\n lnbd = Math.abs(types[ij]);\n }\n break;\n } else {\n i2 = i3;\n j2 = j3;\n i3 = i4;\n j3 = j4;\n }\n }\n }\n }\n return contours;\n }\n\n static #douglasPeuckerHelper(points, start, end, output) {\n // Based on the Douglas-Peucker algorithm:\n // https://en.wikipedia.org/wiki/Ramer%E2%80%93Douglas%E2%80%93Peucker_algorithm\n if (end - start <= 4) {\n for (let i = start; i < end - 2; i += 2) {\n output.push(points[i], points[i + 1]);\n }\n return;\n }\n\n const ax = points[start];\n const ay = points[start + 1];\n const abx = points[end - 4] - ax;\n const aby = points[end - 3] - ay;\n const dist = Math.hypot(abx, aby);\n const nabx = abx / dist;\n const naby = aby / dist;\n const aa = nabx * ay - naby * ax;\n\n // Guessing the epsilon value.\n // See \"A novel framework for making dominant point detection methods\n // non-parametric\".\n const m = aby / abx;\n const invS = 1 / dist;\n const phi = Math.atan(m);\n const cosPhi = Math.cos(phi);\n const sinPhi = Math.sin(phi);\n const tmax = invS * (Math.abs(cosPhi) + Math.abs(sinPhi));\n const poly = invS * (1 - tmax + tmax ** 2);\n const partialPhi = Math.max(\n Math.atan(Math.abs(sinPhi + cosPhi) * poly),\n Math.atan(Math.abs(sinPhi - cosPhi) * poly)\n );\n\n let dmax = 0;\n let index = start;\n for (let i = start + 2; i < end - 2; i += 2) {\n const d = Math.abs(aa - nabx * points[i + 1] + naby * points[i]);\n if (d > dmax) {\n index = i;\n dmax = d;\n }\n }\n\n if (dmax > (dist * partialPhi) ** 2) {\n this.#douglasPeuckerHelper(points, start, index + 2, output);\n this.#douglasPeuckerHelper(points, index, end, output);\n } else {\n output.push(ax, ay);\n }\n }\n\n static #douglasPeucker(points) {\n const output = [];\n const len = points.length;\n this.#douglasPeuckerHelper(points, 0, len, output);\n output.push(points[len - 2], points[len - 1]);\n return output.length <= 4 ? null : output;\n }\n\n static #bilateralFilter(buf, width, height, sigmaS, sigmaR, kernelSize) {\n // The bilateral filter is a nonlinear filter that does spatial averaging.\n // Its main interest is to preserve edges while removing noise.\n // See https://en.wikipedia.org/wiki/Bilateral_filter for more details.\n // sigmaS is the standard deviation of the spatial gaussian.\n // sigmaR is the standard deviation of the range (in term of pixel\n // intensity) gaussian.\n\n // Create a gaussian kernel\n const kernel = new Float32Array(kernelSize ** 2);\n const sigmaS2 = -2 * sigmaS ** 2;\n const halfSize = kernelSize >> 1;\n\n for (let i = 0; i < kernelSize; i++) {\n const x = (i - halfSize) ** 2;\n for (let j = 0; j < kernelSize; j++) {\n kernel[i * kernelSize + j] = Math.exp(\n (x + (j - halfSize) ** 2) / sigmaS2\n );\n }\n }\n\n // Create the range values to be used with the distance between pixels.\n // It's a way faster with a lookup table than computing the exponential.\n const rangeValues = new Float32Array(256);\n const sigmaR2 = -2 * sigmaR ** 2;\n for (let i = 0; i < 256; i++) {\n rangeValues[i] = Math.exp(i ** 2 / sigmaR2);\n }\n\n const N = buf.length;\n const out = new Uint8Array(N);\n\n // We compute the histogram here instead of doing it later: it's slightly\n // faster.\n const histogram = new Uint32Array(256);\n for (let i = 0; i < height; i++) {\n for (let j = 0; j < width; j++) {\n const ij = i * width + j;\n const center = buf[ij];\n let sum = 0;\n let norm = 0;\n\n for (let k = 0; k < kernelSize; k++) {\n const y = i + k - halfSize;\n if (y < 0 || y >= height) {\n continue;\n }\n for (let l = 0; l < kernelSize; l++) {\n const x = j + l - halfSize;\n if (x < 0 || x >= width) {\n continue;\n }\n const neighbour = buf[y * width + x];\n const w =\n kernel[k * kernelSize + l] *\n rangeValues[Math.abs(neighbour - center)];\n sum += neighbour * w;\n norm += w;\n }\n }\n\n const pix = (out[ij] = Math.round(sum / norm));\n histogram[pix]++;\n }\n }\n\n return [out, histogram];\n }\n\n static #getHistogram(buf) {\n const histogram = new Uint32Array(256);\n for (const g of buf) {\n histogram[g]++;\n }\n return histogram;\n }\n\n static #toUint8(buf) {\n // We have a RGBA buffer, containing a grayscale image.\n // We want to convert it into a basic G buffer.\n // Also, we want to normalize the values between 0 and 255 in order to\n // increase the contrast.\n const N = buf.length;\n const out = new Uint8ClampedArray(N >> 2);\n let max = -Infinity;\n let min = Infinity;\n for (let i = 0, ii = out.length; i < ii; i++) {\n const pix = (out[i] = buf[i << 2]);\n max = Math.max(max, pix);\n min = Math.min(min, pix);\n }\n const ratio = 255 / (max - min);\n for (let i = 0, ii = out.length; i < ii; i++) {\n out[i] = (out[i] - min) * ratio;\n }\n\n return out;\n }\n\n static #guessThreshold(histogram) {\n // We want to find the threshold that will separate the background from the\n // foreground.\n // We could have used Otsu's method, but unfortunately it doesn't work well\n // when the background has too much shade of greys.\n // So the idea is to find a maximum in the black part of the histogram and\n // figure out the value which will be the first one of the white part.\n\n let i;\n let M = -Infinity;\n let L = -Infinity;\n const min = histogram.findIndex(v => v !== 0);\n let pos = min;\n let spos = min;\n for (i = min; i < 256; i++) {\n const v = histogram[i];\n if (v > M) {\n if (i - pos > L) {\n L = i - pos;\n spos = i - 1;\n }\n M = v;\n pos = i;\n }\n }\n for (i = spos - 1; i >= 0; i--) {\n if (histogram[i] > histogram[i + 1]) {\n break;\n }\n }\n\n return i;\n }\n\n static #getGrayPixels(bitmap) {\n const originalBitmap = bitmap;\n const { width, height } = bitmap;\n const { maxDim } = this.#PARAMETERS;\n let newWidth = width;\n let newHeight = height;\n\n if (width > maxDim || height > maxDim) {\n let prevWidth = width;\n let prevHeight = height;\n\n let steps = Math.log2(Math.max(width, height) / maxDim);\n const isteps = Math.floor(steps);\n steps = steps === isteps ? isteps - 1 : isteps;\n for (let i = 0; i < steps; i++) {\n newWidth = Math.ceil(prevWidth / 2);\n newHeight = Math.ceil(prevHeight / 2);\n\n const offscreen = new OffscreenCanvas(newWidth, newHeight);\n const ctx = offscreen.getContext(\"2d\");\n ctx.drawImage(\n bitmap,\n 0,\n 0,\n prevWidth,\n prevHeight,\n 0,\n 0,\n newWidth,\n newHeight\n );\n prevWidth = newWidth;\n prevHeight = newHeight;\n\n // Release the resources associated with the bitmap.\n if (bitmap !== originalBitmap) {\n bitmap.close();\n }\n bitmap = offscreen.transferToImageBitmap();\n }\n\n const ratio = Math.min(maxDim / newWidth, maxDim / newHeight);\n newWidth = Math.round(newWidth * ratio);\n newHeight = Math.round(newHeight * ratio);\n }\n const offscreen = new OffscreenCanvas(newWidth, newHeight);\n const ctx = offscreen.getContext(\"2d\", { willReadFrequently: true });\n ctx.fillStyle = \"white\";\n ctx.fillRect(0, 0, newWidth, newHeight);\n ctx.filter = \"grayscale(1)\";\n ctx.drawImage(\n bitmap,\n 0,\n 0,\n bitmap.width,\n bitmap.height,\n 0,\n 0,\n newWidth,\n newHeight\n );\n const grayImage = ctx.getImageData(0, 0, newWidth, newHeight).data;\n const uint8Buf = this.#toUint8(grayImage);\n\n return [uint8Buf, newWidth, newHeight];\n }\n\n static extractContoursFromText(\n text,\n { fontFamily, fontStyle, fontWeight },\n pageWidth,\n pageHeight,\n rotation,\n innerMargin\n ) {\n let canvas = new OffscreenCanvas(1, 1);\n let ctx = canvas.getContext(\"2d\", { alpha: false });\n const fontSize = 200;\n const font =\n (ctx.font = `${fontStyle} ${fontWeight} ${fontSize}px ${fontFamily}`);\n const {\n actualBoundingBoxLeft,\n actualBoundingBoxRight,\n actualBoundingBoxAscent,\n actualBoundingBoxDescent,\n fontBoundingBoxAscent,\n fontBoundingBoxDescent,\n width,\n } = ctx.measureText(text);\n\n // We rescale the canvas to make \"sure\" the text fits.\n const SCALE = 1.5;\n const canvasWidth = Math.ceil(\n Math.max(\n Math.abs(actualBoundingBoxLeft) + Math.abs(actualBoundingBoxRight) || 0,\n width\n ) * SCALE\n );\n const canvasHeight = Math.ceil(\n Math.max(\n Math.abs(actualBoundingBoxAscent) +\n Math.abs(actualBoundingBoxDescent) || fontSize,\n Math.abs(fontBoundingBoxAscent) + Math.abs(fontBoundingBoxDescent) ||\n fontSize\n ) * SCALE\n );\n canvas = new OffscreenCanvas(canvasWidth, canvasHeight);\n ctx = canvas.getContext(\"2d\", { alpha: true, willReadFrequently: true });\n ctx.font = font;\n ctx.filter = \"grayscale(1)\";\n ctx.fillStyle = \"white\";\n ctx.fillRect(0, 0, canvasWidth, canvasHeight);\n ctx.fillStyle = \"black\";\n ctx.fillText(\n text,\n (canvasWidth * (SCALE - 1)) / 2,\n (canvasHeight * (3 - SCALE)) / 2\n );\n\n const uint8Buf = this.#toUint8(\n ctx.getImageData(0, 0, canvasWidth, canvasHeight).data\n );\n const histogram = this.#getHistogram(uint8Buf);\n const threshold = this.#guessThreshold(histogram);\n\n const contourList = this.#findContours(\n uint8Buf,\n canvasWidth,\n canvasHeight,\n threshold\n );\n\n return this.processDrawnLines({\n lines: { curves: contourList, width: canvasWidth, height: canvasHeight },\n pageWidth,\n pageHeight,\n rotation,\n innerMargin,\n mustSmooth: true,\n areContours: true,\n });\n }\n\n static process(bitmap, pageWidth, pageHeight, rotation, innerMargin) {\n const [uint8Buf, width, height] = this.#getGrayPixels(bitmap);\n const [buffer, histogram] = this.#bilateralFilter(\n uint8Buf,\n width,\n height,\n Math.hypot(width, height) * this.#PARAMETERS.sigmaSFactor,\n this.#PARAMETERS.sigmaR,\n this.#PARAMETERS.kernelSize\n );\n\n const threshold = this.#guessThreshold(histogram);\n const contourList = this.#findContours(buffer, width, height, threshold);\n\n return this.processDrawnLines({\n lines: { curves: contourList, width, height },\n pageWidth,\n pageHeight,\n rotation,\n innerMargin,\n mustSmooth: true,\n areContours: true,\n });\n }\n\n static processDrawnLines({\n lines,\n pageWidth,\n pageHeight,\n rotation,\n innerMargin,\n mustSmooth,\n areContours,\n }) {\n if (rotation % 180 !== 0) {\n [pageWidth, pageHeight] = [pageHeight, pageWidth];\n }\n\n const { curves, width, height } = lines;\n const thickness = lines.thickness ?? 0;\n const linesAndPoints = [];\n const ratio = Math.min(pageWidth / width, pageHeight / height);\n const xScale = ratio / pageWidth;\n const yScale = ratio / pageHeight;\n const newCurves = [];\n\n for (const { points } of curves) {\n const reducedPoints = mustSmooth ? this.#douglasPeucker(points) : points;\n if (!reducedPoints) {\n continue;\n }\n newCurves.push(reducedPoints);\n\n const len = reducedPoints.length;\n const newPoints = new Float32Array(len);\n const line = new Float32Array(3 * (len === 2 ? 2 : len - 2));\n linesAndPoints.push({ line, points: newPoints });\n\n if (len === 2) {\n newPoints[0] = reducedPoints[0] * xScale;\n newPoints[1] = reducedPoints[1] * yScale;\n line.set([NaN, NaN, NaN, NaN, newPoints[0], newPoints[1]], 0);\n continue;\n }\n\n let [x1, y1, x2, y2] = reducedPoints;\n x1 *= xScale;\n y1 *= yScale;\n x2 *= xScale;\n y2 *= yScale;\n newPoints.set([x1, y1, x2, y2], 0);\n\n line.set([NaN, NaN, NaN, NaN, x1, y1], 0);\n for (let i = 4; i < len; i += 2) {\n const x = (newPoints[i] = reducedPoints[i] * xScale);\n const y = (newPoints[i + 1] = reducedPoints[i + 1] * yScale);\n line.set(Outline.createBezierPoints(x1, y1, x2, y2, x, y), (i - 2) * 3);\n [x1, y1, x2, y2] = [x2, y2, x, y];\n }\n }\n\n if (linesAndPoints.length === 0) {\n return null;\n }\n\n const outline = areContours\n ? new ContourDrawOutline()\n : new InkDrawOutline();\n\n outline.build(\n linesAndPoints,\n pageWidth,\n pageHeight,\n 1,\n rotation,\n areContours ? 0 : thickness,\n innerMargin\n );\n\n return { outline, newCurves, areContours, thickness, width, height };\n }\n\n static async compressSignature({\n outlines,\n areContours,\n thickness,\n width,\n height,\n }) {\n // We create a single array containing all the outlines.\n // The format is the following:\n // - 4 bytes: data length.\n // - 4 bytes: version.\n // - 4 bytes: width.\n // - 4 bytes: height.\n // - 4 bytes: 0 if it's a contour, 1 if it's an ink.\n // - 4 bytes: thickness.\n // - 4 bytes: number of drawings.\n // - 4 bytes: size of the buffer containing the diff of the coordinates.\n // - 4 bytes: number of points in the first drawing.\n // - 4 bytes: x coordinate of the first point.\n // - 4 bytes: y coordinate of the first point.\n // - 4 bytes: number of points in the second drawing.\n // - 4 bytes: x coordinate of the first point.\n // - 4 bytes: y coordinate of the first point.\n // - ...\n // - The buffer containing the diff of the coordinates.\n\n // The coordinates are supposed to be positive integers.\n\n // We also compute the min and max difference between two points.\n // This will help us to determine the type of the buffer (Int8, Int16 or\n // Int32) in order to minimize the amount of data we have.\n let minDiff = Infinity;\n let maxDiff = -Infinity;\n let outlinesLength = 0;\n for (const points of outlines) {\n outlinesLength += points.length;\n for (let i = 2, ii = points.length; i < ii; i++) {\n const dx = points[i] - points[i - 2];\n minDiff = Math.min(minDiff, dx);\n maxDiff = Math.max(maxDiff, dx);\n }\n }\n\n let bufferType;\n if (minDiff >= -128 && maxDiff <= 127) {\n bufferType = Int8Array;\n } else if (minDiff >= -32768 && maxDiff <= 32767) {\n bufferType = Int16Array;\n } else {\n bufferType = Int32Array;\n }\n\n const len = outlines.length;\n const headerLength = BASE_HEADER_LENGTH + POINTS_PROPERTIES_NUMBER * len;\n const header = new Uint32Array(headerLength);\n\n let offset = 0;\n header[offset++] =\n headerLength * Uint32Array.BYTES_PER_ELEMENT +\n (outlinesLength - 2 * len) * bufferType.BYTES_PER_ELEMENT;\n header[offset++] = 0; // Version.\n header[offset++] = width;\n header[offset++] = height;\n header[offset++] = areContours ? 0 : 1;\n header[offset++] = Math.max(0, Math.floor(thickness ?? 0));\n header[offset++] = len;\n header[offset++] = bufferType.BYTES_PER_ELEMENT;\n for (const points of outlines) {\n header[offset++] = points.length - 2;\n header[offset++] = points[0];\n header[offset++] = points[1];\n }\n\n const cs = new CompressionStream(\"deflate-raw\");\n const writer = cs.writable.getWriter();\n await writer.ready;\n\n writer.write(header);\n const BufferCtor = bufferType.prototype.constructor;\n for (const points of outlines) {\n const diffs = new BufferCtor(points.length - 2);\n for (let i = 2, ii = points.length; i < ii; i++) {\n diffs[i - 2] = points[i] - points[i - 2];\n }\n writer.write(diffs);\n }\n\n writer.close();\n\n const buf = await new Response(cs.readable).arrayBuffer();\n const bytes = new Uint8Array(buf);\n\n return toBase64Util(bytes);\n }\n\n static async decompressSignature(signatureData) {\n try {\n const bytes = fromBase64Util(signatureData);\n const { readable, writable } = new DecompressionStream(\"deflate-raw\");\n const writer = writable.getWriter();\n await writer.ready;\n\n // We can't await writer.write() because it'll block until the reader\n // starts which happens few lines below.\n writer\n .write(bytes)\n .then(async () => {\n await writer.ready;\n await writer.close();\n })\n .catch(() => {});\n\n let data = null;\n let offset = 0;\n for await (const chunk of readable) {\n data ||= new Uint8Array(new Uint32Array(chunk.buffer, 0, 4)[0]);\n data.set(chunk, offset);\n offset += chunk.length;\n }\n\n // We take a bit too much data for the header but it's fine.\n const header = new Uint32Array(data.buffer, 0, data.length >> 2);\n const version = header[1];\n if (version !== 0) {\n throw new Error(`Invalid version: ${version}`);\n }\n const width = header[2];\n const height = header[3];\n const areContours = header[4] === 0;\n const thickness = header[5];\n const numberOfDrawings = header[6];\n const bufferType = header[7];\n const outlines = [];\n const diffsOffset =\n (BASE_HEADER_LENGTH + POINTS_PROPERTIES_NUMBER * numberOfDrawings) *\n Uint32Array.BYTES_PER_ELEMENT;\n let diffs;\n\n switch (bufferType) {\n case Int8Array.BYTES_PER_ELEMENT:\n diffs = new Int8Array(data.buffer, diffsOffset);\n break;\n case Int16Array.BYTES_PER_ELEMENT:\n diffs = new Int16Array(data.buffer, diffsOffset);\n break;\n case Int32Array.BYTES_PER_ELEMENT:\n diffs = new Int32Array(data.buffer, diffsOffset);\n break;\n }\n\n offset = 0;\n for (let i = 0; i < numberOfDrawings; i++) {\n const len = header[POINTS_PROPERTIES_NUMBER * i + BASE_HEADER_LENGTH];\n const points = new Float32Array(len + 2);\n outlines.push(points);\n\n for (let j = 0; j < POINTS_PROPERTIES_NUMBER - 1; j++) {\n points[j] =\n header[POINTS_PROPERTIES_NUMBER * i + BASE_HEADER_LENGTH + j + 1];\n }\n for (let j = 0; j < len; j++) {\n points[j + 2] = points[j] + diffs[offset++];\n }\n }\n\n return {\n areContours,\n thickness,\n outlines,\n width,\n height,\n };\n } catch (e) {\n warn(`decompressSignature: ${e}`);\n return null;\n }\n }\n}\n\nexport { SignatureExtractor };\n","/* Copyright 2025 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 { AnnotationEditorType, shadow } from \"../../shared/util.js\";\nimport { DrawingEditor, DrawingOptions } from \"./draw.js\";\nimport { AnnotationEditor } from \"./editor.js\";\nimport { ContourDrawOutline } from \"./drawers/contour.js\";\nimport { InkDrawingOptions } from \"./ink.js\";\nimport { InkDrawOutline } from \"./drawers/inkdraw.js\";\nimport { SignatureExtractor } from \"./drawers/signaturedraw.js\";\n\nclass SignatureOptions extends DrawingOptions {\n constructor() {\n super();\n\n super.updateProperties({\n fill: AnnotationEditor._defaultLineColor,\n \"stroke-width\": 0,\n });\n }\n\n clone() {\n const clone = new SignatureOptions();\n clone.updateAll(this);\n return clone;\n }\n}\n\nclass DrawnSignatureOptions extends InkDrawingOptions {\n constructor(viewerParameters) {\n super(viewerParameters);\n\n super.updateProperties({\n stroke: AnnotationEditor._defaultLineColor,\n \"stroke-width\": 1,\n });\n }\n\n clone() {\n const clone = new DrawnSignatureOptions(this._viewParameters);\n clone.updateAll(this);\n return clone;\n }\n}\n\n/**\n * Basic editor in order to generate an Stamp annotation annotation containing\n * a signature drawing.\n */\nclass SignatureEditor extends DrawingEditor {\n #isExtracted = false;\n\n #description = null;\n\n #signatureData = null;\n\n #signatureUUID = null;\n\n static _type = \"signature\";\n\n static _editorType = AnnotationEditorType.SIGNATURE;\n\n static _defaultDrawingOptions = null;\n\n constructor(params) {\n super({ ...params, mustBeCommitted: true, name: \"signatureEditor\" });\n this._willKeepAspectRatio = true;\n this.#signatureData = params.signatureData || null;\n this.#description = null;\n this.defaultL10nId = \"pdfjs-editor-signature-editor1\";\n }\n\n /** @inheritdoc */\n static initialize(l10n, uiManager) {\n AnnotationEditor.initialize(l10n, uiManager);\n\n this._defaultDrawingOptions = new SignatureOptions();\n this._defaultDrawnSignatureOptions = new DrawnSignatureOptions(\n uiManager.viewParameters\n );\n }\n\n /** @inheritdoc */\n static getDefaultDrawingOptions(options) {\n const clone = this._defaultDrawingOptions.clone();\n clone.updateProperties(options);\n return clone;\n }\n\n /** @inheritdoc */\n static get supportMultipleDrawings() {\n return false;\n }\n\n static get typesMap() {\n return shadow(this, \"typesMap\", new Map());\n }\n\n static get isDrawer() {\n return false;\n }\n\n /** @inheritdoc */\n get telemetryFinalData() {\n return {\n type: \"signature\",\n hasDescription: !!this.#description,\n };\n }\n\n static computeTelemetryFinalData(data) {\n const hasDescriptionStats = data.get(\"hasDescription\");\n return {\n hasAltText: hasDescriptionStats.get(true) ?? 0,\n hasNoAltText: hasDescriptionStats.get(false) ?? 0,\n };\n }\n\n /** @inheritdoc */\n get isResizable() {\n return true;\n }\n\n /** @inheritdoc */\n onScaleChanging() {\n if (this._drawId === null) {\n return;\n }\n super.onScaleChanging();\n }\n\n /** @inheritdoc */\n render() {\n if (this.div) {\n return this.div;\n }\n\n let baseX, baseY;\n const { _isCopy } = this;\n if (_isCopy) {\n // No need to adjust the position when rendering in DrawingEditor.\n this._isCopy = false;\n baseX = this.x;\n baseY = this.y;\n }\n\n super.render();\n\n if (this._drawId === null) {\n if (this.#signatureData) {\n const {\n lines,\n mustSmooth,\n areContours,\n description,\n uuid,\n heightInPage,\n } = this.#signatureData;\n const {\n rawDims: { pageWidth, pageHeight },\n rotation,\n } = this.parent.viewport;\n const outline = SignatureExtractor.processDrawnLines({\n lines,\n pageWidth,\n pageHeight,\n rotation,\n innerMargin: SignatureEditor._INNER_MARGIN,\n mustSmooth,\n areContours,\n });\n this.addSignature(outline, heightInPage, description, uuid);\n } else {\n // Avoid Firefox crashing (with a local build) because the description\n // parameter is missing.\n this.div.setAttribute(\n \"data-l10n-args\",\n JSON.stringify({ description: \"\" })\n );\n this.div.hidden = true;\n this._uiManager.getSignature(this);\n }\n } else {\n this.div.setAttribute(\n \"data-l10n-args\",\n JSON.stringify({ description: this.#description || \"\" })\n );\n }\n\n if (_isCopy) {\n this._isCopy = true;\n this._moveAfterPaste(baseX, baseY);\n }\n\n return this.div;\n }\n\n setUuid(uuid) {\n this.#signatureUUID = uuid;\n this.addEditToolbar();\n }\n\n getUuid() {\n return this.#signatureUUID;\n }\n\n get description() {\n return this.#description;\n }\n\n set description(description) {\n this.#description = description;\n if (!this.div) {\n return;\n }\n this.div.setAttribute(\"data-l10n-args\", JSON.stringify({ description }));\n super.addEditToolbar().then(toolbar => {\n toolbar?.updateEditSignatureButton(description);\n });\n }\n\n getSignaturePreview() {\n const { newCurves, areContours, thickness, width, height } =\n this.#signatureData;\n const maxDim = Math.max(width, height);\n const outlineData = SignatureExtractor.processDrawnLines({\n lines: {\n curves: newCurves.map(points => ({ points })),\n thickness,\n width,\n height,\n },\n pageWidth: maxDim,\n pageHeight: maxDim,\n rotation: 0,\n innerMargin: 0,\n mustSmooth: false,\n areContours,\n });\n return { areContours, outline: outlineData.outline };\n }\n\n /** @inheritdoc */\n get toolbarButtons() {\n if (this._uiManager.signatureManager) {\n return [[\"editSignature\", this._uiManager.signatureManager]];\n }\n return super.toolbarButtons;\n }\n\n addSignature(data, heightInPage, description, uuid) {\n const { x: savedX, y: savedY } = this;\n const { outline } = (this.#signatureData = data);\n this.#isExtracted = outline instanceof ContourDrawOutline;\n this.description = description;\n let drawingOptions;\n if (this.#isExtracted) {\n drawingOptions = SignatureEditor.getDefaultDrawingOptions();\n } else {\n drawingOptions = SignatureEditor._defaultDrawnSignatureOptions.clone();\n drawingOptions.updateProperties({ \"stroke-width\": outline.thickness });\n }\n this._addOutlines({\n drawOutlines: outline,\n drawingOptions,\n });\n const [parentWidth, parentHeight] = this.parentDimensions;\n const [, pageHeight] = this.pageDimensions;\n let newHeight = heightInPage / pageHeight;\n // Ensure the signature doesn't exceed the page height.\n // If the signature is too big, we scale it down to 50% of the page height.\n newHeight = newHeight >= 1 ? 0.5 : newHeight;\n\n this.width *= newHeight / this.height;\n if (this.width >= 1) {\n newHeight *= 0.9 / this.width;\n this.width = 0.9;\n }\n\n this.height = newHeight;\n this.setDims(parentWidth * this.width, parentHeight * this.height);\n this.x = savedX;\n this.y = savedY;\n this.center();\n\n this._onResized();\n this.onScaleChanging();\n this.rotate();\n this._uiManager.addToAnnotationStorage(this);\n this.setUuid(uuid);\n\n this._reportTelemetry({\n action: \"pdfjs.signature.inserted\",\n data: {\n hasBeenSaved: !!uuid,\n hasDescription: !!description,\n },\n });\n\n this.div.hidden = false;\n }\n\n getFromImage(bitmap) {\n const {\n rawDims: { pageWidth, pageHeight },\n rotation,\n } = this.parent.viewport;\n return SignatureExtractor.process(\n bitmap,\n pageWidth,\n pageHeight,\n rotation,\n SignatureEditor._INNER_MARGIN\n );\n }\n\n getFromText(text, fontInfo) {\n const {\n rawDims: { pageWidth, pageHeight },\n rotation,\n } = this.parent.viewport;\n return SignatureExtractor.extractContoursFromText(\n text,\n fontInfo,\n pageWidth,\n pageHeight,\n rotation,\n SignatureEditor._INNER_MARGIN\n );\n }\n\n getDrawnSignature(curves) {\n const {\n rawDims: { pageWidth, pageHeight },\n rotation,\n } = this.parent.viewport;\n return SignatureExtractor.processDrawnLines({\n lines: curves,\n pageWidth,\n pageHeight,\n rotation,\n innerMargin: SignatureEditor._INNER_MARGIN,\n mustSmooth: false,\n areContours: false,\n });\n }\n\n /** @inheritdoc */\n createDrawingOptions({ areContours, thickness }) {\n if (areContours) {\n this._drawingOptions = SignatureEditor.getDefaultDrawingOptions();\n } else {\n this._drawingOptions =\n SignatureEditor._defaultDrawnSignatureOptions.clone();\n this._drawingOptions.updateProperties({ \"stroke-width\": thickness });\n }\n }\n\n /** @inheritdoc */\n serialize(isForCopying = false) {\n if (this.isEmpty()) {\n return null;\n }\n\n const { lines, points, rect } = this.serializeDraw(isForCopying);\n const {\n _drawingOptions: { \"stroke-width\": thickness },\n } = this;\n const serialized = {\n annotationType: AnnotationEditorType.SIGNATURE,\n isSignature: true,\n areContours: this.#isExtracted,\n color: [0, 0, 0],\n thickness: this.#isExtracted ? 0 : thickness,\n pageIndex: this.pageIndex,\n rect,\n rotation: this.rotation,\n structTreeParentId: this._structTreeParentId,\n };\n this.addComment(serialized);\n if (isForCopying) {\n serialized.paths = { lines, points };\n serialized.uuid = this.#signatureUUID;\n serialized.isCopy = true;\n } else {\n serialized.lines = lines;\n }\n if (this.#description) {\n serialized.accessibilityData = { type: \"Figure\", alt: this.#description };\n }\n return serialized;\n }\n\n /** @inheritdoc */\n static deserializeDraw(\n pageX,\n pageY,\n pageWidth,\n pageHeight,\n innerMargin,\n data\n ) {\n if (data.areContours) {\n return ContourDrawOutline.deserialize(\n pageX,\n pageY,\n pageWidth,\n pageHeight,\n innerMargin,\n data\n );\n }\n\n return InkDrawOutline.deserialize(\n pageX,\n pageY,\n pageWidth,\n pageHeight,\n innerMargin,\n data\n );\n }\n\n /** @inheritdoc */\n static async deserialize(data, parent, uiManager) {\n const editor = await super.deserialize(data, parent, uiManager);\n editor.#isExtracted = data.areContours;\n editor.description = data.accessibilityData?.alt || \"\";\n editor.#signatureUUID = data.uuid;\n return editor;\n }\n}\n\nexport { SignatureEditor };\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 { AnnotationEditorType, AnnotationPrefix } from \"../../shared/util.js\";\nimport {\n OutputScale,\n PixelsPerInch,\n SupportedImageMimeTypes,\n} from \"../display_utils.js\";\nimport { AnnotationEditor } from \"./editor.js\";\nimport { StampAnnotationElement } from \"../annotation_layer.js\";\n\n/**\n * Basic text editor in order to create a FreeTex annotation.\n */\nclass StampEditor extends AnnotationEditor {\n #bitmap = null;\n\n #bitmapId = null;\n\n #bitmapPromise = null;\n\n #bitmapUrl = null;\n\n #bitmapFile = null;\n\n #bitmapFileName = \"\";\n\n #canvas = null;\n\n #missingCanvas = false;\n\n #resizeTimeoutId = null;\n\n #isSvg = false;\n\n #hasBeenAddedInUndoStack = false;\n\n static _type = \"stamp\";\n\n static _editorType = AnnotationEditorType.STAMP;\n\n constructor(params) {\n super({ ...params, name: \"stampEditor\" });\n this.#bitmapUrl = params.bitmapUrl;\n this.#bitmapFile = params.bitmapFile;\n this.defaultL10nId = \"pdfjs-editor-stamp-editor\";\n }\n\n /** @inheritdoc */\n static initialize(l10n, uiManager) {\n AnnotationEditor.initialize(l10n, uiManager);\n }\n\n /** @inheritdoc */\n static isHandlingMimeForPasting(mime) {\n return SupportedImageMimeTypes.includes(mime);\n }\n\n /** @inheritdoc */\n static paste(item, parent) {\n parent.pasteEditor(\n { mode: AnnotationEditorType.STAMP },\n { bitmapFile: item.getAsFile() }\n );\n }\n\n /** @inheritdoc */\n altTextFinish() {\n if (this._uiManager.useNewAltTextFlow) {\n this.div.hidden = false;\n }\n super.altTextFinish();\n }\n\n /** @inheritdoc */\n get telemetryFinalData() {\n return {\n type: \"stamp\",\n hasAltText: !!this.altTextData?.altText,\n };\n }\n\n static computeTelemetryFinalData(data) {\n const hasAltTextStats = data.get(\"hasAltText\");\n return {\n hasAltText: hasAltTextStats.get(true) ?? 0,\n hasNoAltText: hasAltTextStats.get(false) ?? 0,\n };\n }\n\n #getBitmapFetched(data, fromId = false) {\n if (!data) {\n this.remove();\n return;\n }\n this.#bitmap = data.bitmap;\n if (!fromId) {\n this.#bitmapId = data.id;\n this.#isSvg = data.isSvg;\n }\n if (data.file) {\n this.#bitmapFileName = data.file.name;\n }\n this.#createCanvas();\n }\n\n #getBitmapDone() {\n this.#bitmapPromise = null;\n this._uiManager.enableWaiting(false);\n if (!this.#canvas) {\n return;\n }\n if (\n this._uiManager.useNewAltTextWhenAddingImage &&\n this._uiManager.useNewAltTextFlow &&\n this.#bitmap\n ) {\n this.addEditToolbar().then(() => {\n this._editToolbar.hide();\n this._uiManager.editAltText(this, /* firstTime = */ true);\n });\n return;\n }\n\n if (\n !this._uiManager.useNewAltTextWhenAddingImage &&\n this._uiManager.useNewAltTextFlow &&\n this.#bitmap\n ) {\n this._reportTelemetry({\n action: \"pdfjs.image.image_added\",\n data: { alt_text_modal: false, alt_text_type: \"empty\" },\n });\n try {\n // The alt-text dialog isn't opened but we still want to guess the alt\n // text.\n this.mlGuessAltText();\n } catch {}\n }\n\n this.div.focus();\n }\n\n async mlGuessAltText(imageData = null, updateAltTextData = true) {\n if (this.hasAltTextData()) {\n return null;\n }\n\n const { mlManager } = this._uiManager;\n if (!mlManager) {\n throw new Error(\"No ML.\");\n }\n if (!(await mlManager.isEnabledFor(\"altText\"))) {\n throw new Error(\"ML isn't enabled for alt text.\");\n }\n const { data, width, height } =\n imageData ||\n this.copyCanvas(null, null, /* createImageData = */ true).imageData;\n const response = await mlManager.guess({\n name: \"altText\",\n request: {\n data,\n width,\n height,\n channels: data.length / (width * height),\n },\n });\n if (!response) {\n throw new Error(\"No response from the AI service.\");\n }\n if (response.error) {\n throw new Error(\"Error from the AI service.\");\n }\n if (response.cancel) {\n return null;\n }\n if (!response.output) {\n throw new Error(\"No valid response from the AI service.\");\n }\n const altText = response.output;\n await this.setGuessedAltText(altText);\n if (updateAltTextData && !this.hasAltTextData()) {\n this.altTextData = { alt: altText, decorative: false };\n }\n return altText;\n }\n\n #getBitmap() {\n if (this.#bitmapId) {\n this._uiManager.enableWaiting(true);\n this._uiManager.imageManager\n .getFromId(this.#bitmapId)\n .then(data => this.#getBitmapFetched(data, /* fromId = */ true))\n .finally(() => this.#getBitmapDone());\n return;\n }\n\n if (this.#bitmapUrl) {\n const url = this.#bitmapUrl;\n this.#bitmapUrl = null;\n this._uiManager.enableWaiting(true);\n this.#bitmapPromise = this._uiManager.imageManager\n .getFromUrl(url)\n .then(data => this.#getBitmapFetched(data))\n .finally(() => this.#getBitmapDone());\n return;\n }\n\n if (this.#bitmapFile) {\n const file = this.#bitmapFile;\n this.#bitmapFile = null;\n this._uiManager.enableWaiting(true);\n this.#bitmapPromise = this._uiManager.imageManager\n .getFromFile(file)\n .then(data => this.#getBitmapFetched(data))\n .finally(() => this.#getBitmapDone());\n return;\n }\n\n const input = document.createElement(\"input\");\n if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"TESTING\")) {\n input.hidden = true;\n input.id = \"stampEditorFileInput\";\n document.body.append(input);\n }\n input.type = \"file\";\n input.accept = SupportedImageMimeTypes.join(\",\");\n const signal = this._uiManager._signal;\n this.#bitmapPromise = new Promise(resolve => {\n input.addEventListener(\n \"change\",\n async () => {\n if (!input.files || input.files.length === 0) {\n this.remove();\n } else {\n this._uiManager.enableWaiting(true);\n const data = await this._uiManager.imageManager.getFromFile(\n input.files[0]\n );\n this._reportTelemetry({\n action: \"pdfjs.image.image_selected\",\n data: { alt_text_modal: this._uiManager.useNewAltTextFlow },\n });\n this.#getBitmapFetched(data);\n }\n if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"TESTING\")) {\n input.remove();\n }\n resolve();\n },\n { signal }\n );\n input.addEventListener(\n \"cancel\",\n () => {\n this.remove();\n resolve();\n },\n { signal }\n );\n }).finally(() => this.#getBitmapDone());\n if (typeof PDFJSDev === \"undefined\" || !PDFJSDev.test(\"TESTING\")) {\n input.click();\n }\n }\n\n /** @inheritdoc */\n remove() {\n if (this.#bitmapId) {\n this.#bitmap = null;\n this._uiManager.imageManager.deleteId(this.#bitmapId);\n this.#canvas?.remove();\n this.#canvas = null;\n if (this.#resizeTimeoutId) {\n clearTimeout(this.#resizeTimeoutId);\n this.#resizeTimeoutId = null;\n }\n }\n super.remove();\n }\n\n /** @inheritdoc */\n rebuild() {\n if (!this.parent) {\n // It's possible to have to rebuild an editor which is not on a visible\n // page.\n if (this.#bitmapId) {\n this.#getBitmap();\n }\n return;\n }\n super.rebuild();\n if (this.div === null) {\n return;\n }\n\n if (this.#bitmapId && this.#canvas === null) {\n this.#getBitmap();\n }\n\n if (!this.isAttachedToDOM) {\n // At some point this editor was removed and we're rebuilting it,\n // hence we must add it to its parent.\n this.parent.add(this);\n }\n }\n\n /** @inheritdoc */\n onceAdded(focus) {\n this._isDraggable = true;\n if (focus) {\n this.div.focus();\n }\n }\n\n /** @inheritdoc */\n isEmpty() {\n return !(\n this.#bitmapPromise ||\n this.#bitmap ||\n this.#bitmapUrl ||\n this.#bitmapFile ||\n this.#bitmapId ||\n this.#missingCanvas\n );\n }\n\n /** @inheritdoc */\n get toolbarButtons() {\n return [[\"altText\", this.createAltText()]];\n }\n\n /** @inheritdoc */\n get isResizable() {\n return true;\n }\n\n /** @inheritdoc */\n render() {\n if (this.div) {\n return this.div;\n }\n\n let baseX, baseY;\n if (this._isCopy) {\n baseX = this.x;\n baseY = this.y;\n }\n\n super.render();\n this.div.hidden = true;\n\n this.createAltText();\n\n if (!this.#missingCanvas) {\n if (this.#bitmap) {\n this.#createCanvas();\n } else {\n this.#getBitmap();\n }\n }\n\n if (this._isCopy) {\n this._moveAfterPaste(baseX, baseY);\n }\n\n this._uiManager.addShouldRescale(this);\n\n return this.div;\n }\n\n setCanvas(annotationElementId, canvas) {\n const { id: bitmapId, bitmap } = this._uiManager.imageManager.getFromCanvas(\n annotationElementId,\n canvas\n );\n canvas.remove();\n if (bitmapId && this._uiManager.imageManager.isValidId(bitmapId)) {\n this.#bitmapId = bitmapId;\n if (bitmap) {\n this.#bitmap = bitmap;\n }\n this.#missingCanvas = false;\n this.#createCanvas();\n }\n }\n\n /** @inheritdoc */\n _onResized() {\n // We used a CSS-zoom during the resizing, but now it's resized we can\n // rescale correctly the bitmap to fit the new dimensions.\n this.onScaleChanging();\n }\n\n onScaleChanging() {\n if (!this.parent) {\n return;\n }\n if (this.#resizeTimeoutId !== null) {\n clearTimeout(this.#resizeTimeoutId);\n }\n // The user's zooming the page, there is no need to redraw the bitmap at\n // each step, hence we wait a bit before redrawing it.\n const TIME_TO_WAIT = 200;\n this.#resizeTimeoutId = setTimeout(() => {\n this.#resizeTimeoutId = null;\n this.#drawBitmap();\n }, TIME_TO_WAIT);\n }\n\n #createCanvas() {\n const { div } = this;\n let { width, height } = this.#bitmap;\n const [pageWidth, pageHeight] = this.pageDimensions;\n const MAX_RATIO = 0.75;\n if (this.width) {\n width = this.width * pageWidth;\n height = this.height * pageHeight;\n } else if (\n width > MAX_RATIO * pageWidth ||\n height > MAX_RATIO * pageHeight\n ) {\n // If the image is too big compared to the page dimensions\n // (more than MAX_RATIO) then we scale it down.\n const factor = Math.min(\n (MAX_RATIO * pageWidth) / width,\n (MAX_RATIO * pageHeight) / height\n );\n width *= factor;\n height *= factor;\n }\n const [parentWidth, parentHeight] = this.parentDimensions;\n this.setDims(\n (width * parentWidth) / pageWidth,\n (height * parentHeight) / pageHeight\n );\n\n this._uiManager.enableWaiting(false);\n const canvas = (this.#canvas = document.createElement(\"canvas\"));\n canvas.setAttribute(\"role\", \"img\");\n this.addContainer(canvas);\n\n this.width = width / pageWidth;\n this.height = height / pageHeight;\n if (this._initialOptions?.isCentered) {\n this.center();\n } else {\n this.fixAndSetPosition();\n }\n this._initialOptions = null;\n\n if (\n !this._uiManager.useNewAltTextWhenAddingImage ||\n !this._uiManager.useNewAltTextFlow ||\n this.annotationElementId\n ) {\n div.hidden = false;\n }\n this.#drawBitmap();\n if (!this.#hasBeenAddedInUndoStack) {\n this.parent.addUndoableEditor(this);\n this.#hasBeenAddedInUndoStack = true;\n }\n\n // There are multiple ways to add an image to the page, so here we just\n // count the number of times an image is added to the page whatever the way\n // is.\n this._reportTelemetry({\n action: \"inserted_image\",\n });\n if (this.#bitmapFileName) {\n this.div.setAttribute(\"aria-description\", this.#bitmapFileName);\n }\n if (!this.annotationElementId) {\n this._uiManager.a11yAlert(\"pdfjs-editor-stamp-added-alert\");\n }\n }\n\n copyCanvas(maxDataDimension, maxPreviewDimension, createImageData = false) {\n if (!maxDataDimension) {\n // TODO: get this value from Firefox\n // (https://bugzilla.mozilla.org/show_bug.cgi?id=1908184)\n // It's the maximum dimension that the AI can handle.\n maxDataDimension = 224;\n }\n\n const { width: bitmapWidth, height: bitmapHeight } = this.#bitmap;\n const outputScale = new OutputScale();\n\n let bitmap = this.#bitmap;\n let width = bitmapWidth,\n height = bitmapHeight;\n let canvas = null;\n\n if (maxPreviewDimension) {\n if (\n bitmapWidth > maxPreviewDimension ||\n bitmapHeight > maxPreviewDimension\n ) {\n const ratio = Math.min(\n maxPreviewDimension / bitmapWidth,\n maxPreviewDimension / bitmapHeight\n );\n width = Math.floor(bitmapWidth * ratio);\n height = Math.floor(bitmapHeight * ratio);\n }\n\n canvas = document.createElement(\"canvas\");\n const scaledWidth = (canvas.width = Math.ceil(width * outputScale.sx));\n const scaledHeight = (canvas.height = Math.ceil(height * outputScale.sy));\n\n if (!this.#isSvg) {\n bitmap = this.#scaleBitmap(scaledWidth, scaledHeight);\n }\n\n const ctx = canvas.getContext(\"2d\");\n ctx.filter = this._uiManager.hcmFilter;\n\n // Add a checkerboard pattern as a background in case the image has some\n // transparency.\n let white = \"white\",\n black = \"#cfcfd8\";\n if (this._uiManager.hcmFilter !== \"none\") {\n black = \"black\";\n } else if (window.matchMedia?.(\"(prefers-color-scheme: dark)\").matches) {\n white = \"#8f8f9d\";\n black = \"#42414d\";\n }\n const boxDim = 15;\n const boxDimWidth = boxDim * outputScale.sx;\n const boxDimHeight = boxDim * outputScale.sy;\n const pattern = new OffscreenCanvas(boxDimWidth * 2, boxDimHeight * 2);\n const patternCtx = pattern.getContext(\"2d\");\n patternCtx.fillStyle = white;\n patternCtx.fillRect(0, 0, boxDimWidth * 2, boxDimHeight * 2);\n patternCtx.fillStyle = black;\n patternCtx.fillRect(0, 0, boxDimWidth, boxDimHeight);\n patternCtx.fillRect(boxDimWidth, boxDimHeight, boxDimWidth, boxDimHeight);\n ctx.fillStyle = ctx.createPattern(pattern, \"repeat\");\n ctx.fillRect(0, 0, scaledWidth, scaledHeight);\n ctx.drawImage(\n bitmap,\n 0,\n 0,\n bitmap.width,\n bitmap.height,\n 0,\n 0,\n scaledWidth,\n scaledHeight\n );\n }\n\n let imageData = null;\n if (createImageData) {\n let dataWidth, dataHeight;\n if (\n outputScale.symmetric &&\n bitmap.width < maxDataDimension &&\n bitmap.height < maxDataDimension\n ) {\n dataWidth = bitmap.width;\n dataHeight = bitmap.height;\n } else {\n bitmap = this.#bitmap;\n if (bitmapWidth > maxDataDimension || bitmapHeight > maxDataDimension) {\n const ratio = Math.min(\n maxDataDimension / bitmapWidth,\n maxDataDimension / bitmapHeight\n );\n dataWidth = Math.floor(bitmapWidth * ratio);\n dataHeight = Math.floor(bitmapHeight * ratio);\n\n if (!this.#isSvg) {\n bitmap = this.#scaleBitmap(dataWidth, dataHeight);\n }\n }\n }\n\n const offscreen = new OffscreenCanvas(dataWidth, dataHeight);\n const offscreenCtx = offscreen.getContext(\"2d\", {\n willReadFrequently: true,\n });\n offscreenCtx.drawImage(\n bitmap,\n 0,\n 0,\n bitmap.width,\n bitmap.height,\n 0,\n 0,\n dataWidth,\n dataHeight\n );\n imageData = {\n width: dataWidth,\n height: dataHeight,\n data: offscreenCtx.getImageData(0, 0, dataWidth, dataHeight).data,\n };\n }\n\n return { canvas, width, height, imageData };\n }\n\n #scaleBitmap(width, height) {\n const { width: bitmapWidth, height: bitmapHeight } = this.#bitmap;\n\n let newWidth = bitmapWidth;\n let newHeight = bitmapHeight;\n let bitmap = this.#bitmap;\n while (newWidth > 2 * width || newHeight > 2 * height) {\n const prevWidth = newWidth;\n const prevHeight = newHeight;\n\n if (newWidth > 2 * width) {\n // See bug 1820511 (Windows specific bug).\n // TODO: once the above bug is fixed we could revert to:\n // newWidth = Math.ceil(newWidth / 2);\n newWidth =\n newWidth >= 16384\n ? Math.floor(newWidth / 2) - 1\n : Math.ceil(newWidth / 2);\n }\n if (newHeight > 2 * height) {\n newHeight =\n newHeight >= 16384\n ? Math.floor(newHeight / 2) - 1\n : Math.ceil(newHeight / 2);\n }\n\n const offscreen = new OffscreenCanvas(newWidth, newHeight);\n const ctx = offscreen.getContext(\"2d\");\n ctx.drawImage(\n bitmap,\n 0,\n 0,\n prevWidth,\n prevHeight,\n 0,\n 0,\n newWidth,\n newHeight\n );\n bitmap = offscreen.transferToImageBitmap();\n }\n\n return bitmap;\n }\n\n #drawBitmap() {\n const [parentWidth, parentHeight] = this.parentDimensions;\n const { width, height } = this;\n const outputScale = new OutputScale();\n const scaledWidth = Math.ceil(width * parentWidth * outputScale.sx);\n const scaledHeight = Math.ceil(height * parentHeight * outputScale.sy);\n const canvas = this.#canvas;\n\n if (\n !canvas ||\n (canvas.width === scaledWidth && canvas.height === scaledHeight)\n ) {\n return;\n }\n\n canvas.width = scaledWidth;\n canvas.height = scaledHeight;\n\n const bitmap = this.#isSvg\n ? this.#bitmap\n : this.#scaleBitmap(scaledWidth, scaledHeight);\n\n const ctx = canvas.getContext(\"2d\");\n ctx.filter = this._uiManager.hcmFilter;\n ctx.drawImage(\n bitmap,\n 0,\n 0,\n bitmap.width,\n bitmap.height,\n 0,\n 0,\n scaledWidth,\n scaledHeight\n );\n }\n\n #serializeBitmap(toUrl) {\n if (toUrl) {\n if (this.#isSvg) {\n const url = this._uiManager.imageManager.getSvgUrl(this.#bitmapId);\n if (url) {\n return url;\n }\n }\n // We convert to a data url because it's sync and the url can live in the\n // clipboard.\n const canvas = document.createElement(\"canvas\");\n ({ width: canvas.width, height: canvas.height } = this.#bitmap);\n const ctx = canvas.getContext(\"2d\");\n ctx.drawImage(this.#bitmap, 0, 0);\n\n return canvas.toDataURL();\n }\n\n if (this.#isSvg) {\n const [pageWidth, pageHeight] = this.pageDimensions;\n // Multiply by PixelsPerInch.PDF_TO_CSS_UNITS in order to increase the\n // image resolution when rasterizing it.\n const width = Math.round(\n this.width * pageWidth * PixelsPerInch.PDF_TO_CSS_UNITS\n );\n const height = Math.round(\n this.height * pageHeight * PixelsPerInch.PDF_TO_CSS_UNITS\n );\n const offscreen = new OffscreenCanvas(width, height);\n const ctx = offscreen.getContext(\"2d\");\n ctx.drawImage(\n this.#bitmap,\n 0,\n 0,\n this.#bitmap.width,\n this.#bitmap.height,\n 0,\n 0,\n width,\n height\n );\n return offscreen.transferToImageBitmap();\n }\n\n return structuredClone(this.#bitmap);\n }\n\n /** @inheritdoc */\n static async deserialize(data, parent, uiManager) {\n let initialData = null;\n let missingCanvas = false;\n if (data instanceof StampAnnotationElement) {\n const {\n data: { rect, rotation, id, structParent, popupRef, contentsObj },\n container,\n parent: {\n page: { pageNumber },\n },\n canvas,\n } = data;\n let bitmapId, bitmap;\n if (canvas) {\n delete data.canvas;\n ({ id: bitmapId, bitmap } = uiManager.imageManager.getFromCanvas(\n container.id,\n canvas\n ));\n canvas.remove();\n } else {\n missingCanvas = true;\n data._hasNoCanvas = true;\n }\n\n // When switching to edit mode, we wait for the structure tree to be\n // ready (see pdf_viewer.js), so it's fine to use getAriaAttributesSync.\n const altText =\n (\n await parent._structTree.getAriaAttributes(`${AnnotationPrefix}${id}`)\n )?.get(\"aria-label\") || \"\";\n\n initialData = data = {\n annotationType: AnnotationEditorType.STAMP,\n bitmapId,\n bitmap,\n pageIndex: pageNumber - 1,\n rect: rect.slice(0),\n rotation,\n annotationElementId: id,\n id,\n deleted: false,\n accessibilityData: {\n decorative: false,\n altText,\n },\n isSvg: false,\n structParent,\n popupRef,\n comment: contentsObj?.str || null,\n };\n }\n const editor = await super.deserialize(data, parent, uiManager);\n const { rect, bitmap, bitmapUrl, bitmapId, isSvg, accessibilityData } =\n data;\n if (missingCanvas) {\n uiManager.addMissingCanvas(data.id, editor);\n editor.#missingCanvas = true;\n } else if (bitmapId && uiManager.imageManager.isValidId(bitmapId)) {\n editor.#bitmapId = bitmapId;\n if (bitmap) {\n editor.#bitmap = bitmap;\n }\n } else {\n editor.#bitmapUrl = bitmapUrl;\n }\n editor.#isSvg = isSvg;\n\n const [parentWidth, parentHeight] = editor.pageDimensions;\n editor.width = (rect[2] - rect[0]) / parentWidth;\n editor.height = (rect[3] - rect[1]) / parentHeight;\n\n if (accessibilityData) {\n editor.altTextData = accessibilityData;\n }\n editor._initialData = initialData;\n if (data.comment) {\n editor.setCommentData(data.comment);\n }\n // No need to be add in the undo stack if the editor is created from an\n // existing one.\n editor.#hasBeenAddedInUndoStack = !!initialData;\n\n return editor;\n }\n\n /** @inheritdoc */\n serialize(isForCopying = false, context = null) {\n if (this.isEmpty()) {\n return null;\n }\n\n if (this.deleted) {\n return this.serializeDeleted();\n }\n\n const serialized = {\n annotationType: AnnotationEditorType.STAMP,\n bitmapId: this.#bitmapId,\n pageIndex: this.pageIndex,\n rect: this.getPDFRect(),\n rotation: this.rotation,\n isSvg: this.#isSvg,\n structTreeParentId: this._structTreeParentId,\n };\n this.addComment(serialized);\n\n if (isForCopying) {\n // We don't know what's the final destination (this pdf or another one)\n // of this annotation and the clipboard doesn't support ImageBitmaps,\n // hence we serialize the bitmap to a data url.\n serialized.bitmapUrl = this.#serializeBitmap(/* toUrl = */ true);\n serialized.accessibilityData = this.serializeAltText(true);\n serialized.isCopy = true;\n return serialized;\n }\n\n const { decorative, altText } = this.serializeAltText(false);\n if (!decorative && altText) {\n serialized.accessibilityData = { type: \"Figure\", alt: altText };\n }\n if (this.annotationElementId) {\n const changes = this.#hasElementChanged(serialized);\n if (changes.isSame) {\n // Nothing has been changed.\n return null;\n }\n if (changes.isSameAltText) {\n delete serialized.accessibilityData;\n } else {\n serialized.accessibilityData.structParent =\n this._initialData.structParent ?? -1;\n }\n }\n serialized.id = this.annotationElementId;\n\n if (context === null) {\n return serialized;\n }\n\n context.stamps ||= new Map();\n const area = this.#isSvg\n ? (serialized.rect[2] - serialized.rect[0]) *\n (serialized.rect[3] - serialized.rect[1])\n : null;\n if (!context.stamps.has(this.#bitmapId)) {\n // We don't want to have multiple copies of the same bitmap in the\n // annotationMap, hence we only add the bitmap the first time we meet it.\n context.stamps.set(this.#bitmapId, { area, serialized });\n serialized.bitmap = this.#serializeBitmap(/* toUrl = */ false);\n } else if (this.#isSvg) {\n // If we have multiple copies of the same svg but with different sizes,\n // then we want to keep the biggest one.\n const prevData = context.stamps.get(this.#bitmapId);\n if (area > prevData.area) {\n prevData.area = area;\n prevData.serialized.bitmap.close();\n prevData.serialized.bitmap = this.#serializeBitmap(/* toUrl = */ false);\n }\n }\n return serialized;\n }\n\n #hasElementChanged(serialized) {\n const {\n pageIndex,\n accessibilityData: { altText },\n } = this._initialData;\n\n const isSamePageIndex = serialized.pageIndex === pageIndex;\n const isSameAltText = (serialized.accessibilityData?.alt || \"\") === altText;\n\n return {\n isSame:\n !this.hasEditedComment &&\n !this._hasBeenMoved &&\n !this._hasBeenResized &&\n isSamePageIndex &&\n isSameAltText,\n isSameAltText,\n };\n }\n\n /** @inheritdoc */\n renderAnnotationElement(annotation) {\n if (this.deleted) {\n annotation.hide();\n return null;\n }\n const params = {\n rect: this.getPDFRect(),\n };\n if (this.hasEditedComment) {\n params.popup = this.comment;\n }\n annotation.updateEdited(params);\n\n return null;\n }\n}\n\nexport { StampEditor };\n","/* Copyright 2022 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// eslint-disable-next-line max-len\n/** @typedef {import(\"./tools.js\").AnnotationEditorUIManager} AnnotationEditorUIManager */\n/** @typedef {import(\"../display_utils.js\").PageViewport} PageViewport */\n// eslint-disable-next-line max-len\n/** @typedef {import(\"../../../web/text_accessibility.js\").TextAccessibilityManager} TextAccessibilityManager */\n/** @typedef {import(\"../../../web/interfaces\").IL10n} IL10n */\n// eslint-disable-next-line max-len\n/** @typedef {import(\"../annotation_layer.js\").AnnotationLayer} AnnotationLayer */\n/** @typedef {import(\"../draw_layer.js\").DrawLayer} DrawLayer */\n// eslint-disable-next-line max-len\n/** @typedef {import(\"../src/display/struct_tree_layer_builder.js\").StructTreeLayerBuilder} StructTreeLayerBuilder */\n\nimport {\n AnnotationEditorPrefix,\n AnnotationEditorType,\n FeatureTest,\n} from \"../../shared/util.js\";\nimport { AnnotationEditor } from \"./editor.js\";\nimport { FreeTextEditor } from \"./freetext.js\";\nimport { HighlightEditor } from \"./highlight.js\";\nimport { InkEditor } from \"./ink.js\";\nimport { setLayerDimensions } from \"../display_utils.js\";\nimport { SignatureEditor } from \"./signature.js\";\nimport { StampEditor } from \"./stamp.js\";\n\n/**\n * @typedef {Object} AnnotationEditorLayerOptions\n * @property {Object} mode\n * @property {HTMLDivElement} div\n * @property {StructTreeLayerBuilder} structTreeLayer\n * @property {AnnotationEditorUIManager} uiManager\n * @property {boolean} enabled\n * @property {TextAccessibilityManager} [accessibilityManager]\n * @property {number} pageIndex\n * @property {IL10n} l10n\n * @property {AnnotationLayer} [annotationLayer]\n * @property {HTMLDivElement} [textLayer]\n * @property {DrawLayer} drawLayer\n * @property {PageViewport} viewport\n */\n\n/**\n * @typedef {Object} RenderEditorLayerOptions\n * @property {PageViewport} viewport\n */\n\n/**\n * Manage all the different editors on a page.\n */\nclass AnnotationEditorLayer {\n #accessibilityManager;\n\n #allowClick = false;\n\n #annotationLayer = null;\n\n #clickAC = null;\n\n #editorFocusTimeoutId = null;\n\n #editors = new Map();\n\n #hadPointerDown = false;\n\n #isDisabling = false;\n\n #isEnabling = false;\n\n #drawingAC = null;\n\n #focusedElement = null;\n\n #textLayer = null;\n\n #textSelectionAC = null;\n\n #textLayerDblClickAC = null;\n\n #lastPointerDownTimestamp = -1;\n\n #uiManager;\n\n static _initialized = false;\n\n static #editorTypes = new Map(\n [\n FreeTextEditor,\n InkEditor,\n StampEditor,\n HighlightEditor,\n SignatureEditor,\n ].map(type => [type._editorType, type])\n );\n\n /**\n * @param {AnnotationEditorLayerOptions} options\n */\n constructor({\n uiManager,\n pageIndex,\n div,\n structTreeLayer,\n accessibilityManager,\n annotationLayer,\n drawLayer,\n textLayer,\n viewport,\n l10n,\n }) {\n const editorTypes = [...AnnotationEditorLayer.#editorTypes.values()];\n if (!AnnotationEditorLayer._initialized) {\n AnnotationEditorLayer._initialized = true;\n for (const editorType of editorTypes) {\n editorType.initialize(l10n, uiManager);\n }\n }\n uiManager.registerEditorTypes(editorTypes);\n\n this.#uiManager = uiManager;\n this.pageIndex = pageIndex;\n this.div = div;\n this.#accessibilityManager = accessibilityManager;\n this.#annotationLayer = annotationLayer;\n this.viewport = viewport;\n this.#textLayer = textLayer;\n this.drawLayer = drawLayer;\n this._structTree = structTreeLayer;\n\n this.#uiManager.addLayer(this);\n }\n\n get isEmpty() {\n return this.#editors.size === 0;\n }\n\n get isInvisible() {\n return (\n this.isEmpty && this.#uiManager.getMode() === AnnotationEditorType.NONE\n );\n }\n\n /**\n * Update the toolbar if it's required to reflect the tool currently used.\n * @param {Object} options\n */\n updateToolbar(options) {\n this.#uiManager.updateToolbar(options);\n }\n\n /**\n * The mode has changed: it must be updated.\n * @param {number} mode\n */\n updateMode(mode = this.#uiManager.getMode()) {\n this.#cleanup();\n switch (mode) {\n case AnnotationEditorType.NONE:\n this.disableTextSelection();\n this.togglePointerEvents(false);\n this.toggleAnnotationLayerPointerEvents(true);\n this.disableClick();\n return;\n case AnnotationEditorType.INK:\n this.disableTextSelection();\n this.togglePointerEvents(true);\n this.enableClick();\n break;\n case AnnotationEditorType.HIGHLIGHT:\n this.enableTextSelection();\n this.togglePointerEvents(false);\n this.disableClick();\n break;\n default:\n this.disableTextSelection();\n this.togglePointerEvents(true);\n this.enableClick();\n }\n\n this.toggleAnnotationLayerPointerEvents(false);\n const { classList } = this.div;\n for (const editorType of AnnotationEditorLayer.#editorTypes.values()) {\n classList.toggle(\n `${editorType._type}Editing`,\n mode === editorType._editorType\n );\n }\n this.div.hidden = false;\n }\n\n hasTextLayer(textLayer) {\n return textLayer === this.#textLayer?.div;\n }\n\n /**\n * Set the editing state.\n * @param {boolean} isEditing\n */\n setEditingState(isEditing) {\n this.#uiManager.setEditingState(isEditing);\n }\n\n /**\n * Add some commands into the CommandManager (undo/redo stuff).\n * @param {Object} params\n */\n addCommands(params) {\n this.#uiManager.addCommands(params);\n }\n\n cleanUndoStack(type) {\n this.#uiManager.cleanUndoStack(type);\n }\n\n toggleDrawing(enabled = false) {\n this.div.classList.toggle(\"drawing\", !enabled);\n }\n\n togglePointerEvents(enabled = false) {\n this.div.classList.toggle(\"disabled\", !enabled);\n }\n\n toggleAnnotationLayerPointerEvents(enabled = false) {\n this.#annotationLayer?.div.classList.toggle(\"disabled\", !enabled);\n }\n\n /**\n * Enable pointer events on the main div in order to enable\n * editor creation.\n */\n async enable() {\n this.#isEnabling = true;\n this.div.tabIndex = 0;\n this.togglePointerEvents(true);\n this.#textLayerDblClickAC?.abort();\n this.#textLayerDblClickAC = null;\n const annotationElementIds = new Set();\n for (const editor of this.#editors.values()) {\n editor.enableEditing();\n editor.show(true);\n if (editor.annotationElementId) {\n this.#uiManager.removeChangedExistingAnnotation(editor);\n annotationElementIds.add(editor.annotationElementId);\n }\n }\n\n if (!this.#annotationLayer) {\n this.#isEnabling = false;\n return;\n }\n\n const editables = this.#annotationLayer.getEditableAnnotations();\n for (const editable of editables) {\n // The element must be hidden whatever its state is.\n editable.hide();\n if (this.#uiManager.isDeletedAnnotationElement(editable.data.id)) {\n continue;\n }\n if (annotationElementIds.has(editable.data.id)) {\n continue;\n }\n const editor = await this.deserialize(editable);\n if (!editor) {\n continue;\n }\n this.addOrRebuild(editor);\n editor.enableEditing();\n }\n this.#isEnabling = false;\n }\n\n /**\n * Disable editor creation.\n */\n disable() {\n this.#isDisabling = true;\n this.div.tabIndex = -1;\n this.togglePointerEvents(false);\n if (this.#textLayer && !this.#textLayerDblClickAC) {\n this.#textLayerDblClickAC = new AbortController();\n const signal = this.#uiManager.combinedSignal(this.#textLayerDblClickAC);\n this.#textLayer.div.addEventListener(\n \"pointerdown\",\n e => {\n // It's the default value in Fenix:\n // https://searchfox.org/mozilla-central/rev/beba5cde846f944c4d709e75cbe499d17af880a4/modules/libpref/init/StaticPrefList.yaml#19064\n // and in Chrome and Windows:\n // https://source.chromium.org/chromium/chromium/src/+/main:ui/events/event_constants.h;drc=f0f5f3ceebb00da9363ccc7a1e2c0f17b6b383ba;l=115\n const DBL_CLICK_THRESHOLD = 500;\n const { clientX, clientY, timeStamp } = e;\n const lastPointerDownTimestamp = this.#lastPointerDownTimestamp;\n if (timeStamp - lastPointerDownTimestamp > DBL_CLICK_THRESHOLD) {\n this.#lastPointerDownTimestamp = timeStamp;\n return;\n }\n this.#lastPointerDownTimestamp = -1;\n const { classList } = this.div;\n classList.toggle(\"getElements\", true);\n const elements = document.elementsFromPoint(clientX, clientY);\n classList.toggle(\"getElements\", false);\n if (!this.div.contains(elements[0])) {\n return;\n }\n let id;\n const regex = new RegExp(`^${AnnotationEditorPrefix}[0-9]+$`);\n for (const element of elements) {\n if (regex.test(element.id)) {\n id = element.id;\n break;\n }\n }\n if (!id) {\n return;\n }\n const editor = this.#editors.get(id);\n if (editor?.annotationElementId === null) {\n e.stopPropagation();\n e.preventDefault();\n editor.dblclick();\n }\n },\n { signal, capture: true }\n );\n }\n const changedAnnotations = new Map();\n const resetAnnotations = new Map();\n for (const editor of this.#editors.values()) {\n editor.disableEditing();\n if (!editor.annotationElementId) {\n continue;\n }\n if (editor.serialize() !== null) {\n changedAnnotations.set(editor.annotationElementId, editor);\n continue;\n } else {\n resetAnnotations.set(editor.annotationElementId, editor);\n }\n this.getEditableAnnotation(editor.annotationElementId)?.show();\n editor.remove();\n }\n\n if (this.#annotationLayer) {\n // Show the annotations that were hidden in enable().\n const editables = this.#annotationLayer.getEditableAnnotations();\n for (const editable of editables) {\n const { id } = editable.data;\n if (this.#uiManager.isDeletedAnnotationElement(id)) {\n editable.updateEdited({ deleted: true });\n continue;\n }\n let editor = resetAnnotations.get(id);\n if (editor) {\n editor.resetAnnotationElement(editable);\n editor.show(false);\n editable.show();\n continue;\n }\n\n editor = changedAnnotations.get(id);\n if (editor) {\n this.#uiManager.addChangedExistingAnnotation(editor);\n if (editor.renderAnnotationElement(editable)) {\n // Content has changed, so we need to hide the editor.\n editor.show(false);\n }\n }\n editable.show();\n }\n }\n\n this.#cleanup();\n if (this.isEmpty) {\n this.div.hidden = true;\n }\n const { classList } = this.div;\n for (const editorType of AnnotationEditorLayer.#editorTypes.values()) {\n classList.remove(`${editorType._type}Editing`);\n }\n this.disableTextSelection();\n this.toggleAnnotationLayerPointerEvents(true);\n\n this.#isDisabling = false;\n }\n\n getEditableAnnotation(id) {\n return this.#annotationLayer?.getEditableAnnotation(id) || null;\n }\n\n /**\n * Set the current editor.\n * @param {AnnotationEditor} editor\n */\n setActiveEditor(editor) {\n const currentActive = this.#uiManager.getActive();\n if (currentActive === editor) {\n return;\n }\n\n this.#uiManager.setActiveEditor(editor);\n }\n\n enableTextSelection() {\n this.div.tabIndex = -1;\n if (this.#textLayer?.div && !this.#textSelectionAC) {\n this.#textSelectionAC = new AbortController();\n const signal = this.#uiManager.combinedSignal(this.#textSelectionAC);\n\n this.#textLayer.div.addEventListener(\n \"pointerdown\",\n this.#textLayerPointerDown.bind(this),\n { signal }\n );\n this.#textLayer.div.classList.add(\"highlighting\");\n }\n }\n\n disableTextSelection() {\n this.div.tabIndex = 0;\n if (this.#textLayer?.div && this.#textSelectionAC) {\n this.#textSelectionAC.abort();\n this.#textSelectionAC = null;\n\n this.#textLayer.div.classList.remove(\"highlighting\");\n }\n }\n\n #textLayerPointerDown(event) {\n // Unselect all the editors in order to let the user select some text\n // without being annoyed by an editor toolbar.\n this.#uiManager.unselectAll();\n const { target } = event;\n if (\n target === this.#textLayer.div ||\n ((target.getAttribute(\"role\") === \"img\" ||\n target.classList.contains(\"endOfContent\")) &&\n this.#textLayer.div.contains(target))\n ) {\n const { isMac } = FeatureTest.platform;\n if (event.button !== 0 || (event.ctrlKey && isMac)) {\n // Do nothing on right click.\n return;\n }\n this.#uiManager.showAllEditors(\n \"highlight\",\n true,\n /* updateButton = */ true\n );\n this.#textLayer.div.classList.add(\"free\");\n this.toggleDrawing();\n HighlightEditor.startHighlighting(\n this,\n this.#uiManager.direction === \"ltr\",\n { target: this.#textLayer.div, x: event.x, y: event.y }\n );\n this.#textLayer.div.addEventListener(\n \"pointerup\",\n () => {\n this.#textLayer.div.classList.remove(\"free\");\n this.toggleDrawing(true);\n },\n { once: true, signal: this.#uiManager._signal }\n );\n event.preventDefault();\n }\n }\n\n enableClick() {\n if (this.#clickAC) {\n return;\n }\n this.#clickAC = new AbortController();\n const signal = this.#uiManager.combinedSignal(this.#clickAC);\n\n this.div.addEventListener(\"pointerdown\", this.pointerdown.bind(this), {\n signal,\n });\n const pointerup = this.pointerup.bind(this);\n this.div.addEventListener(\"pointerup\", pointerup, { signal });\n this.div.addEventListener(\"pointercancel\", pointerup, { signal });\n }\n\n disableClick() {\n this.#clickAC?.abort();\n this.#clickAC = null;\n }\n\n attach(editor) {\n this.#editors.set(editor.id, editor);\n const { annotationElementId } = editor;\n if (\n annotationElementId &&\n this.#uiManager.isDeletedAnnotationElement(annotationElementId)\n ) {\n this.#uiManager.removeDeletedAnnotationElement(editor);\n }\n }\n\n detach(editor) {\n this.#editors.delete(editor.id);\n this.#accessibilityManager?.removePointerInTextLayer(editor.contentDiv);\n\n if (!this.#isDisabling && editor.annotationElementId) {\n this.#uiManager.addDeletedAnnotationElement(editor);\n }\n }\n\n /**\n * Remove an editor.\n * @param {AnnotationEditor} editor\n */\n remove(editor) {\n this.detach(editor);\n this.#uiManager.removeEditor(editor);\n editor.div.remove();\n editor.isAttachedToDOM = false;\n }\n\n /**\n * An editor can have a different parent, for example after having\n * being dragged and dropped from a page to another.\n * @param {AnnotationEditor} editor\n */\n changeParent(editor) {\n if (editor.parent === this) {\n return;\n }\n\n if (editor.parent && editor.annotationElementId) {\n this.#uiManager.addDeletedAnnotationElement(editor.annotationElementId);\n AnnotationEditor.deleteAnnotationElement(editor);\n editor.annotationElementId = null;\n }\n\n this.attach(editor);\n editor.parent?.detach(editor);\n editor.setParent(this);\n if (editor.div && editor.isAttachedToDOM) {\n editor.div.remove();\n this.div.append(editor.div);\n }\n }\n\n /**\n * Add a new editor in the current view.\n * @param {AnnotationEditor} editor\n */\n add(editor) {\n if (editor.parent === this && editor.isAttachedToDOM) {\n return;\n }\n this.changeParent(editor);\n this.#uiManager.addEditor(editor);\n this.attach(editor);\n\n if (!editor.isAttachedToDOM) {\n const div = editor.render();\n this.div.append(div);\n editor.isAttachedToDOM = true;\n }\n\n // The editor will be correctly moved into the DOM (see fixAndSetPosition).\n editor.fixAndSetPosition();\n editor.onceAdded(/* focus = */ !this.#isEnabling);\n this.#uiManager.addToAnnotationStorage(editor);\n editor._reportTelemetry(editor.telemetryInitialData);\n }\n\n moveEditorInDOM(editor) {\n if (!editor.isAttachedToDOM) {\n return;\n }\n\n const { activeElement } = document;\n if (editor.div.contains(activeElement) && !this.#editorFocusTimeoutId) {\n // When the div is moved in the DOM the focus can move somewhere else,\n // so we want to be sure that the focus will stay on the editor but we\n // don't want to call any focus callbacks, hence we disable them and only\n // re-enable them when the editor has the focus.\n editor._focusEventsAllowed = false;\n this.#editorFocusTimeoutId = setTimeout(() => {\n this.#editorFocusTimeoutId = null;\n if (!editor.div.contains(document.activeElement)) {\n editor.div.addEventListener(\n \"focusin\",\n () => {\n editor._focusEventsAllowed = true;\n },\n { once: true, signal: this.#uiManager._signal }\n );\n activeElement.focus();\n } else {\n editor._focusEventsAllowed = true;\n }\n }, 0);\n }\n\n editor._structTreeParentId = this.#accessibilityManager?.moveElementInDOM(\n this.div,\n editor.div,\n editor.contentDiv,\n /* isRemovable = */ true\n );\n }\n\n /**\n * Add or rebuild depending if it has been removed or not.\n * @param {AnnotationEditor} editor\n */\n addOrRebuild(editor) {\n if (editor.needsToBeRebuilt()) {\n editor.parent ||= this;\n editor.rebuild();\n editor.show();\n } else {\n this.add(editor);\n }\n }\n\n /**\n * Add a new editor and make this addition undoable.\n * @param {AnnotationEditor} editor\n */\n addUndoableEditor(editor) {\n const cmd = () => editor._uiManager.rebuild(editor);\n const undo = () => {\n editor.remove();\n };\n\n this.addCommands({ cmd, undo, mustExec: false });\n }\n\n /**\n * Get an id for an editor.\n * @returns {string}\n */\n getNextId() {\n return this.#uiManager.getId();\n }\n\n get #currentEditorType() {\n return AnnotationEditorLayer.#editorTypes.get(this.#uiManager.getMode());\n }\n\n combinedSignal(ac) {\n return this.#uiManager.combinedSignal(ac);\n }\n\n /**\n * Create a new editor\n * @param {Object} params\n * @returns {AnnotationEditor}\n */\n #createNewEditor(params) {\n const editorType = this.#currentEditorType;\n return editorType ? new editorType.prototype.constructor(params) : null;\n }\n\n canCreateNewEmptyEditor() {\n return this.#currentEditorType?.canCreateNewEmptyEditor();\n }\n\n /**\n * Paste some content into a new editor.\n * @param {Object} options\n * @param {Object} params\n */\n async pasteEditor(options, params) {\n this.updateToolbar(options);\n await this.#uiManager.updateMode(options.mode);\n\n const { offsetX, offsetY } = this.#getCenterPoint();\n const id = this.getNextId();\n const editor = this.#createNewEditor({\n parent: this,\n id,\n x: offsetX,\n y: offsetY,\n uiManager: this.#uiManager,\n isCentered: true,\n ...params,\n });\n if (editor) {\n this.add(editor);\n }\n }\n\n /**\n * Create a new editor\n * @param {Object} data\n * @returns {AnnotationEditor | null}\n */\n async deserialize(data) {\n return (\n (await AnnotationEditorLayer.#editorTypes\n .get(data.annotationType ?? data.annotationEditorType)\n ?.deserialize(data, this, this.#uiManager)) || null\n );\n }\n\n /**\n * Create and add a new editor.\n * @param {PointerEvent} event\n * @param {boolean} isCentered\n * @param [Object] data\n * @returns {AnnotationEditor}\n */\n createAndAddNewEditor(event, isCentered, data = {}) {\n const id = this.getNextId();\n const editor = this.#createNewEditor({\n parent: this,\n id,\n x: event.offsetX,\n y: event.offsetY,\n uiManager: this.#uiManager,\n isCentered,\n ...data,\n });\n if (editor) {\n this.add(editor);\n }\n\n return editor;\n }\n\n #getCenterPoint() {\n const { x, y, width, height } = this.div.getBoundingClientRect();\n const tlX = Math.max(0, x);\n const tlY = Math.max(0, y);\n const brX = Math.min(window.innerWidth, x + width);\n const brY = Math.min(window.innerHeight, y + height);\n const centerX = (tlX + brX) / 2 - x;\n const centerY = (tlY + brY) / 2 - y;\n const [offsetX, offsetY] =\n this.viewport.rotation % 180 === 0\n ? [centerX, centerY]\n : [centerY, centerX];\n\n return { offsetX, offsetY };\n }\n\n /**\n * Create and add a new editor.\n */\n addNewEditor(data = {}) {\n this.createAndAddNewEditor(\n this.#getCenterPoint(),\n /* isCentered = */ true,\n data\n );\n }\n\n /**\n * Set the last selected editor.\n * @param {AnnotationEditor} editor\n */\n setSelected(editor) {\n this.#uiManager.setSelected(editor);\n }\n\n /**\n * Add or remove an editor the current selection.\n * @param {AnnotationEditor} editor\n */\n toggleSelected(editor) {\n this.#uiManager.toggleSelected(editor);\n }\n\n /**\n * Unselect an editor.\n * @param {AnnotationEditor} editor\n */\n unselect(editor) {\n this.#uiManager.unselect(editor);\n }\n\n /**\n * Pointerup callback.\n * @param {PointerEvent} event\n */\n pointerup(event) {\n const { isMac } = FeatureTest.platform;\n if (event.button !== 0 || (event.ctrlKey && isMac)) {\n // Don't create an editor on right click.\n return;\n }\n\n if (event.target !== this.div) {\n return;\n }\n\n if (!this.#hadPointerDown) {\n // It can happen when the user starts a drag inside a text editor\n // and then releases the mouse button outside of it. In such a case\n // we don't want to create a new editor, hence we check that a pointerdown\n // occurred on this div previously.\n return;\n }\n this.#hadPointerDown = false;\n\n if (\n this.#currentEditorType?.isDrawer &&\n this.#currentEditorType.supportMultipleDrawings\n ) {\n return;\n }\n\n if (!this.#allowClick) {\n this.#allowClick = true;\n return;\n }\n\n const currentMode = this.#uiManager.getMode();\n if (\n currentMode === AnnotationEditorType.STAMP ||\n currentMode === AnnotationEditorType.SIGNATURE\n ) {\n this.#uiManager.unselectAll();\n return;\n }\n\n this.createAndAddNewEditor(event, /* isCentered = */ false);\n }\n\n /**\n * Pointerdown callback.\n * @param {PointerEvent} event\n */\n pointerdown(event) {\n if (this.#uiManager.getMode() === AnnotationEditorType.HIGHLIGHT) {\n this.enableTextSelection();\n }\n if (this.#hadPointerDown) {\n // It's possible to have a second pointerdown event before a pointerup one\n // when the user puts a finger on a touchscreen and then add a second one\n // to start a pinch-to-zoom gesture.\n // That said, in case it's possible to have two pointerdown events with\n // a mouse, we don't want to create a new editor in such a case either.\n this.#hadPointerDown = false;\n return;\n }\n const { isMac } = FeatureTest.platform;\n if (event.button !== 0 || (event.ctrlKey && isMac)) {\n // Do nothing on right click.\n return;\n }\n\n if (event.target !== this.div) {\n return;\n }\n\n this.#hadPointerDown = true;\n\n if (this.#currentEditorType?.isDrawer) {\n this.startDrawingSession(event);\n return;\n }\n\n const editor = this.#uiManager.getActive();\n this.#allowClick = !editor || editor.isEmpty();\n }\n\n startDrawingSession(event) {\n this.div.focus({\n preventScroll: true,\n });\n if (this.#drawingAC) {\n this.#currentEditorType.startDrawing(this, this.#uiManager, false, event);\n return;\n }\n\n this.#uiManager.setCurrentDrawingSession(this);\n this.#drawingAC = new AbortController();\n const signal = this.#uiManager.combinedSignal(this.#drawingAC);\n this.div.addEventListener(\n \"blur\",\n ({ relatedTarget }) => {\n if (relatedTarget && !this.div.contains(relatedTarget)) {\n this.#focusedElement = null;\n this.commitOrRemove();\n }\n },\n { signal }\n );\n this.#currentEditorType.startDrawing(this, this.#uiManager, false, event);\n }\n\n pause(on) {\n if (on) {\n const { activeElement } = document;\n if (this.div.contains(activeElement)) {\n this.#focusedElement = activeElement;\n }\n return;\n }\n if (this.#focusedElement) {\n setTimeout(() => {\n this.#focusedElement?.focus();\n this.#focusedElement = null;\n }, 0);\n }\n }\n\n endDrawingSession(isAborted = false) {\n if (!this.#drawingAC) {\n return null;\n }\n this.#uiManager.setCurrentDrawingSession(null);\n this.#drawingAC.abort();\n this.#drawingAC = null;\n this.#focusedElement = null;\n return this.#currentEditorType.endDrawing(isAborted);\n }\n\n /**\n *\n * @param {AnnotationEditor} editor\n * @param {number} x\n * @param {number} y\n * @returns\n */\n findNewParent(editor, x, y) {\n const layer = this.#uiManager.findParent(x, y);\n if (layer === null || layer === this) {\n return false;\n }\n layer.changeParent(editor);\n return true;\n }\n\n commitOrRemove() {\n if (this.#drawingAC) {\n this.endDrawingSession();\n return true;\n }\n return false;\n }\n\n onScaleChanging() {\n if (!this.#drawingAC) {\n return;\n }\n this.#currentEditorType.onScaleChangingWhenDrawing(this);\n }\n\n /**\n * Destroy the main editor.\n */\n destroy() {\n this.commitOrRemove();\n if (this.#uiManager.getActive()?.parent === this) {\n // We need to commit the current editor before destroying the layer.\n this.#uiManager.commitOrRemove();\n this.#uiManager.setActiveEditor(null);\n }\n\n if (this.#editorFocusTimeoutId) {\n clearTimeout(this.#editorFocusTimeoutId);\n this.#editorFocusTimeoutId = null;\n }\n\n for (const editor of this.#editors.values()) {\n this.#accessibilityManager?.removePointerInTextLayer(editor.contentDiv);\n editor.setParent(null);\n editor.isAttachedToDOM = false;\n editor.div.remove();\n }\n this.div = null;\n this.#editors.clear();\n this.#uiManager.removeLayer(this);\n }\n\n #cleanup() {\n // When we're cleaning up, some editors are removed but we don't want\n // to add a new one which will induce an addition in this.#editors, hence\n // an infinite loop.\n for (const editor of this.#editors.values()) {\n if (editor.isEmpty()) {\n editor.remove();\n }\n }\n }\n\n /**\n * Render the main editor.\n * @param {RenderEditorLayerOptions} parameters\n */\n render({ viewport }) {\n this.viewport = viewport;\n setLayerDimensions(this.div, viewport);\n for (const editor of this.#uiManager.getEditors(this.pageIndex)) {\n this.add(editor);\n editor.rebuild();\n }\n // We're maybe rendering a layer which was invisible when we started to edit\n // so we must set the different callbacks for it.\n this.updateMode();\n }\n\n /**\n * Update the main editor.\n * @param {RenderEditorLayerOptions} parameters\n */\n update({ viewport }) {\n // Editors have their dimensions/positions in percent so to avoid any\n // issues (see #15582), we must commit the current one before changing\n // the viewport.\n this.#uiManager.commitOrRemove();\n this.#cleanup();\n\n const oldRotation = this.viewport.rotation;\n const rotation = viewport.rotation;\n\n this.viewport = viewport;\n setLayerDimensions(this.div, { rotation });\n if (oldRotation !== rotation) {\n for (const editor of this.#editors.values()) {\n editor.rotate(rotation);\n }\n }\n }\n\n /**\n * Get page dimensions.\n * @returns {Object} dimensions.\n */\n get pageDimensions() {\n const { pageWidth, pageHeight } = this.viewport.rawDims;\n return [pageWidth, pageHeight];\n }\n\n get scale() {\n return this.#uiManager.viewParameters.realScale;\n }\n}\n\nexport { AnnotationEditorLayer };\n","/* Copyright 2023 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { DOMSVGFactory } from \"./svg_factory.js\";\nimport { shadow } from \"../shared/util.js\";\n\n/**\n * Manage the SVGs drawn on top of the page canvas.\n * It's important to have them directly on top of the canvas because we want to\n * be able to use mix-blend-mode for some of them.\n */\nclass DrawLayer {\n #parent = null;\n\n #mapping = new Map();\n\n #toUpdate = new Map();\n\n static #id = 0;\n\n constructor({ pageIndex }) {\n this.pageIndex = pageIndex;\n }\n\n setParent(parent) {\n if (!this.#parent) {\n this.#parent = parent;\n return;\n }\n\n if (this.#parent !== parent) {\n if (this.#mapping.size > 0) {\n for (const root of this.#mapping.values()) {\n root.remove();\n parent.append(root);\n }\n }\n this.#parent = parent;\n }\n }\n\n static get _svgFactory() {\n return shadow(this, \"_svgFactory\", new DOMSVGFactory());\n }\n\n static #setBox(element, [x, y, width, height]) {\n const { style } = element;\n style.top = `${100 * y}%`;\n style.left = `${100 * x}%`;\n style.width = `${100 * width}%`;\n style.height = `${100 * height}%`;\n }\n\n #createSVG() {\n const svg = DrawLayer._svgFactory.create(1, 1, /* skipDimensions = */ true);\n this.#parent.append(svg);\n svg.setAttribute(\"aria-hidden\", true);\n\n return svg;\n }\n\n #createClipPath(defs, pathId) {\n const clipPath = DrawLayer._svgFactory.createElement(\"clipPath\");\n defs.append(clipPath);\n const clipPathId = `clip_${pathId}`;\n clipPath.setAttribute(\"id\", clipPathId);\n clipPath.setAttribute(\"clipPathUnits\", \"objectBoundingBox\");\n const clipPathUse = DrawLayer._svgFactory.createElement(\"use\");\n clipPath.append(clipPathUse);\n clipPathUse.setAttribute(\"href\", `#${pathId}`);\n clipPathUse.classList.add(\"clip\");\n\n return clipPathId;\n }\n\n #updateProperties(element, properties) {\n for (const [key, value] of Object.entries(properties)) {\n if (value === null) {\n element.removeAttribute(key);\n } else {\n element.setAttribute(key, value);\n }\n }\n }\n\n draw(properties, isPathUpdatable = false, hasClip = false) {\n const id = DrawLayer.#id++;\n const root = this.#createSVG();\n\n const defs = DrawLayer._svgFactory.createElement(\"defs\");\n root.append(defs);\n const path = DrawLayer._svgFactory.createElement(\"path\");\n defs.append(path);\n const pathId = `path_p${this.pageIndex}_${id}`;\n path.setAttribute(\"id\", pathId);\n path.setAttribute(\"vector-effect\", \"non-scaling-stroke\");\n\n if (isPathUpdatable) {\n this.#toUpdate.set(id, path);\n }\n\n // Create the clipping path for the editor div.\n const clipPathId = hasClip ? this.#createClipPath(defs, pathId) : null;\n\n const use = DrawLayer._svgFactory.createElement(\"use\");\n root.append(use);\n use.setAttribute(\"href\", `#${pathId}`);\n this.updateProperties(root, properties);\n\n this.#mapping.set(id, root);\n\n return { id, clipPathId: `url(#${clipPathId})` };\n }\n\n drawOutline(properties, mustRemoveSelfIntersections) {\n // We cannot draw the outline directly in the SVG for highlights because\n // it composes with its parent with mix-blend-mode: multiply.\n // But the outline has a different mix-blend-mode, so we need to draw it in\n // its own SVG.\n const id = DrawLayer.#id++;\n const root = this.#createSVG();\n const defs = DrawLayer._svgFactory.createElement(\"defs\");\n root.append(defs);\n const path = DrawLayer._svgFactory.createElement(\"path\");\n defs.append(path);\n const pathId = `path_p${this.pageIndex}_${id}`;\n path.setAttribute(\"id\", pathId);\n path.setAttribute(\"vector-effect\", \"non-scaling-stroke\");\n\n let maskId;\n if (mustRemoveSelfIntersections) {\n const mask = DrawLayer._svgFactory.createElement(\"mask\");\n defs.append(mask);\n maskId = `mask_p${this.pageIndex}_${id}`;\n mask.setAttribute(\"id\", maskId);\n mask.setAttribute(\"maskUnits\", \"objectBoundingBox\");\n const rect = DrawLayer._svgFactory.createElement(\"rect\");\n mask.append(rect);\n rect.setAttribute(\"width\", \"1\");\n rect.setAttribute(\"height\", \"1\");\n rect.setAttribute(\"fill\", \"white\");\n const use = DrawLayer._svgFactory.createElement(\"use\");\n mask.append(use);\n use.setAttribute(\"href\", `#${pathId}`);\n use.setAttribute(\"stroke\", \"none\");\n use.setAttribute(\"fill\", \"black\");\n use.setAttribute(\"fill-rule\", \"nonzero\");\n use.classList.add(\"mask\");\n }\n\n const use1 = DrawLayer._svgFactory.createElement(\"use\");\n root.append(use1);\n use1.setAttribute(\"href\", `#${pathId}`);\n if (maskId) {\n use1.setAttribute(\"mask\", `url(#${maskId})`);\n }\n const use2 = use1.cloneNode();\n root.append(use2);\n use1.classList.add(\"mainOutline\");\n use2.classList.add(\"secondaryOutline\");\n\n this.updateProperties(root, properties);\n\n this.#mapping.set(id, root);\n\n return id;\n }\n\n finalizeDraw(id, properties) {\n this.#toUpdate.delete(id);\n this.updateProperties(id, properties);\n }\n\n updateProperties(elementOrId, properties) {\n if (!properties) {\n return;\n }\n const { root, bbox, rootClass, path } = properties;\n const element =\n typeof elementOrId === \"number\"\n ? this.#mapping.get(elementOrId)\n : elementOrId;\n if (!element) {\n return;\n }\n if (root) {\n this.#updateProperties(element, root);\n }\n if (bbox) {\n DrawLayer.#setBox(element, bbox);\n }\n if (rootClass) {\n const { classList } = element;\n for (const [className, value] of Object.entries(rootClass)) {\n classList.toggle(className, value);\n }\n }\n if (path) {\n const defs = element.firstChild;\n const pathElement = defs.firstChild;\n this.#updateProperties(pathElement, path);\n }\n }\n\n updateParent(id, layer) {\n if (layer === this) {\n return;\n }\n const root = this.#mapping.get(id);\n if (!root) {\n return;\n }\n layer.#parent.append(root);\n this.#mapping.delete(id);\n layer.#mapping.set(id, root);\n }\n\n remove(id) {\n this.#toUpdate.delete(id);\n if (this.#parent === null) {\n return;\n }\n this.#mapping.get(id).remove();\n this.#mapping.delete(id);\n }\n\n destroy() {\n this.#parent = null;\n for (const root of this.#mapping.values()) {\n root.remove();\n }\n this.#mapping.clear();\n this.#toUpdate.clear();\n }\n}\n\nexport { DrawLayer };\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\").OnProgressParameters} OnProgressParameters */\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 AbortException,\n AnnotationEditorParamsType,\n AnnotationEditorType,\n AnnotationMode,\n AnnotationType,\n createValidAbsoluteUrl,\n FeatureTest,\n getUuid,\n ImageKind,\n InvalidPDFException,\n MathClamp,\n normalizeUnicode,\n OPS,\n PasswordResponses,\n PermissionFlag,\n ResponseException,\n shadow,\n updateUrlHash,\n Util,\n VerbosityLevel,\n} from \"./shared/util.js\";\nimport {\n build,\n getDocument,\n PDFDataRangeTransport,\n PDFWorker,\n version,\n} from \"./display/api.js\";\nimport {\n fetchData,\n getFilenameFromUrl,\n getPdfFilenameFromUrl,\n getRGB,\n getXfaPageViewport,\n isDataScheme,\n isPdfFile,\n noContextMenu,\n OutputScale,\n PDFDateString,\n PixelsPerInch,\n RenderingCancelledException,\n setLayerDimensions,\n stopEvent,\n SupportedImageMimeTypes,\n} from \"./display/display_utils.js\";\nimport { AnnotationEditorLayer } from \"./display/editor/annotation_editor_layer.js\";\nimport { AnnotationEditorUIManager } from \"./display/editor/tools.js\";\nimport { AnnotationLayer } from \"./display/annotation_layer.js\";\nimport { ColorPicker } from \"./display/editor/color_picker.js\";\nimport { DOMSVGFactory } from \"./display/svg_factory.js\";\nimport { DrawLayer } from \"./display/draw_layer.js\";\nimport { GlobalWorkerOptions } from \"./display/worker_options.js\";\nimport { HighlightOutliner } from \"./display/editor/drawers/highlight.js\";\nimport { isValidExplicitDest } from \"./display/api_utils.js\";\nimport { SignatureExtractor } from \"./display/editor/drawers/signaturedraw.js\";\nimport { TextLayer } from \"./display/text_layer.js\";\nimport { TouchManager } from \"./display/touch_manager.js\";\nimport { XfaLayer } from \"./display/xfa_layer.js\";\n\nif (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"TESTING || GENERIC\")) {\n globalThis._pdfjsTestingUtils = {\n HighlightOutliner,\n };\n}\n\nglobalThis.pdfjsLib = {\n AbortException,\n AnnotationEditorLayer,\n AnnotationEditorParamsType,\n AnnotationEditorType,\n AnnotationEditorUIManager,\n AnnotationLayer,\n AnnotationMode,\n AnnotationType,\n build,\n ColorPicker,\n createValidAbsoluteUrl,\n DOMSVGFactory,\n DrawLayer,\n FeatureTest,\n fetchData,\n getDocument,\n getFilenameFromUrl,\n getPdfFilenameFromUrl,\n getRGB,\n getUuid,\n getXfaPageViewport,\n GlobalWorkerOptions,\n ImageKind,\n InvalidPDFException,\n isDataScheme,\n isPdfFile,\n isValidExplicitDest,\n MathClamp,\n noContextMenu,\n normalizeUnicode,\n OPS,\n OutputScale,\n PasswordResponses,\n PDFDataRangeTransport,\n PDFDateString,\n PDFWorker,\n PermissionFlag,\n PixelsPerInch,\n RenderingCancelledException,\n ResponseException,\n setLayerDimensions,\n shadow,\n SignatureExtractor,\n stopEvent,\n SupportedImageMimeTypes,\n TextLayer,\n TouchManager,\n updateUrlHash,\n Util,\n VerbosityLevel,\n version,\n XfaLayer,\n};\n\nexport {\n AbortException,\n AnnotationEditorLayer,\n AnnotationEditorParamsType,\n AnnotationEditorType,\n AnnotationEditorUIManager,\n AnnotationLayer,\n AnnotationMode,\n AnnotationType,\n build,\n ColorPicker,\n createValidAbsoluteUrl,\n DOMSVGFactory,\n DrawLayer,\n FeatureTest,\n fetchData,\n getDocument,\n getFilenameFromUrl,\n getPdfFilenameFromUrl,\n getRGB,\n getUuid,\n getXfaPageViewport,\n GlobalWorkerOptions,\n ImageKind,\n InvalidPDFException,\n isDataScheme,\n isPdfFile,\n isValidExplicitDest,\n MathClamp,\n noContextMenu,\n normalizeUnicode,\n OPS,\n OutputScale,\n PasswordResponses,\n PDFDataRangeTransport,\n PDFDateString,\n PDFWorker,\n PermissionFlag,\n PixelsPerInch,\n RenderingCancelledException,\n ResponseException,\n setLayerDimensions,\n shadow,\n SignatureExtractor,\n stopEvent,\n SupportedImageMimeTypes,\n TextLayer,\n TouchManager,\n updateUrlHash,\n Util,\n VerbosityLevel,\n version,\n XfaLayer,\n};\n"],"names":["isNodeJS","process","versions","nw","electron","type","FONT_IDENTITY_MATRIX","LINE_FACTOR","LINE_DESCENT_FACTOR","BASELINE_FACTOR","RenderingIntentFlag","ANY","DISPLAY","PRINT","SAVE","ANNOTATIONS_FORMS","ANNOTATIONS_STORAGE","ANNOTATIONS_DISABLE","IS_EDITING","OPLIST","AnnotationMode","DISABLE","ENABLE","ENABLE_FORMS","ENABLE_STORAGE","AnnotationEditorPrefix","AnnotationEditorType","NONE","FREETEXT","HIGHLIGHT","STAMP","INK","POPUP","SIGNATURE","COMMENT","AnnotationEditorParamsType","RESIZE","CREATE","FREETEXT_SIZE","FREETEXT_COLOR","FREETEXT_OPACITY","INK_COLOR","INK_THICKNESS","INK_OPACITY","HIGHLIGHT_COLOR","HIGHLIGHT_THICKNESS","HIGHLIGHT_FREE","HIGHLIGHT_SHOW_ALL","DRAW_STEP","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","LINE","SQUARE","CIRCLE","POLYGON","POLYLINE","UNDERLINE","SQUIGGLY","STRIKEOUT","CARET","FILEATTACHMENT","SOUND","MOVIE","WIDGET","SCREEN","PRINTERMARK","TRAPNET","WATERMARK","THREED","REDACT","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","VerbosityLevel","ERRORS","WARNINGS","INFOS","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","beginAnnotation","endAnnotation","paintImageMaskXObject","paintImageMaskXObjectGroup","paintImageXObject","paintInlineImageXObject","paintInlineImageXObjectGroup","paintImageXObjectRepeat","paintImageMaskXObjectRepeat","paintSolidColorImageMask","constructPath","setStrokeTransparent","setFillTransparent","rawFillPath","DrawOPS","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","absoluteUrl","URL","parse","updateUrlHash","hash","allowRel","res","href","split","shadow","obj","prop","value","nonSerializable","Object","defineProperty","enumerable","configurable","writable","BaseException","BaseExceptionClosure","message","name","prototype","constructor","PasswordException","code","UnknownErrorException","details","InvalidPDFException","ResponseException","status","missing","FormatError","AbortException","bytesToString","bytes","undefined","MAX_ARGUMENT_COUNT","String","fromCharCode","apply","strBuf","i","chunkEnd","Math","min","chunk","subarray","push","join","stringToBytes","str","Uint8Array","charCodeAt","string32","objectSize","keys","isLittleEndian","buffer8","view32","Uint32Array","buffer","isEvalSupported","Function","FeatureTest","isOffscreenCanvasSupported","OffscreenCanvas","isImageDecoderSupported","ImageDecoder","platform","userAgent","navigator","isAndroid","includes","isLinux","isMac","isWindows","isFirefox","isCSSRoundSupported","globalThis","CSS","supports","hexNumbers","Array","from","n","toString","padStart","Util","makeHexColor","r","g","b","domMatrixToTransform","dm","a","c","d","e","f","scaleMinMax","minMax","temp","m1","m2","multiplyByDOMMatrix","m","md","applyTransform","p","pos","p0","p1","applyTransformToBezier","m0","m3","m4","m5","pI","pI1","applyInverseTransform","axialAlignedBoundingBox","rect","output","r0","r1","r2","r3","a0","a2","a1","a3","b0","b2","b1","b3","m1r0","m1r2","m2r1","m2r3","max","inverseTransform","singularValueDecompose2dScale","matrix","first","second","sqrt","normalizeRect","slice","intersect","rect1","rect2","xLow","xHigh","yLow","yHigh","pointBoundingBox","x","y","rectBoundingBox","x0","y0","x1","y1","getExtremumOnCurve","#getExtremumOnCurve","x2","x3","y2","y3","t","mt","tt","ttt","getExtremum","#getExtremum","abs","delta","sqrtDelta","bezierBoundingBox","PDFStringTranslateTable","stringToPDFString","keepEscapeSequence","encoding","decoder","TextDecoder","fatal","decoded","decode","replaceAll","ex","ii","charCode","charAt","decodeURIComponent","escape","utf8StringToString","unescape","encodeURIComponent","isArrayEqual","arr1","arr2","getModificationDate","date","Date","getUTCFullYear","getUTCMonth","getUTCDate","getUTCHours","getUTCMinutes","getUTCSeconds","NormalizeRegex","NormalizationMap","normalizeUnicode","Map","_","p2","normalize","get","getUuid","crypto","randomUUID","buf","getRandomValues","AnnotationPrefix","_isValidExplicitDest","validRef","validName","dest","isArray","page","zoom","args","argsLen","allowNull","arg","MathClamp","v","toHexUtil","arr","toHex","num","toBase64Util","toBase64","btoa","fromBase64Util","fromBase64","atob","Promise","try","fn","resolve","sumPrecise","numbers","reduce","SVG_NS","PixelsPerInch","PDF","PDF_TO_CSS_UNITS","fetchData","isValidFetchUrl","document","baseURI","response","fetch","ok","statusText","arrayBuffer","blob","json","text","reject","request","XMLHttpRequest","open","responseType","onreadystatechange","readyState","DONE","responseText","send","PageViewport","viewBox","userUnit","scale","rotation","offsetX","offsetY","dontFlip","centerX","centerY","rotateA","rotateB","rotateC","rotateD","offsetCanvasX","offsetCanvasY","width","height","rawDims","dims","pageWidth","pageHeight","pageX","pageY","clone","convertToViewportPoint","convertToViewportRectangle","topLeft","bottomRight","convertToPdfPoint","RenderingCancelledException","extraDelay","isDataScheme","trim","substring","toLowerCase","isPdfFile","filename","test","getFilenameFromUrl","lastIndexOf","getPdfFilenameFromUrl","defaultFilename","getURL","urlString","newURL","at","pdfRegex","pathname","searchParams","size","values","reverse","key","reFilename","hashFilename","exec","StatTimer","started","create","times","time","now","timeEnd","start","end","outBuf","longest","padEnd","noContextMenu","preventDefault","stopEvent","stopPropagation","deprecated","PDFDateString","regex","toDateObject","input","RegExp","matches","year","parseInt","month","day","hour","minute","universalTimeRelation","offsetHour","offsetMinute","UTC","getXfaPageViewport","xfaPage","attributes","style","getRGB","color","colorRGB","map","getColorValues","colors","span","createElement","visibility","colorScheme","body","append","computedColor","window","getComputedStyle","set","remove","getCurrentTransform","ctx","getTransform","getCurrentTransformInverse","invertSelf","setLayerDimensions","div","viewport","mustFlip","mustRotate","useRound","w","h","widthStr","heightStr","setAttribute","OutputScale","pixelRatio","sx","sy","scaled","symmetric","limitCanvas","maxPixels","maxDim","capAreaFactor","maxAreaScale","Infinity","maxWidthScale","maxHeightScale","capPixels","maxScale","devicePixelRatio","winPixels","ceil","screen","availWidth","availHeight","SupportedImageMimeTypes","EditorToolbar","toolbar","colorPicker","editor","buttons","altText","comment","signatureDescriptionButton","l10nRemove","freeze","freetext","highlight","ink","stamp","signature","render","editToolbar","classList","add","signal","_uiManager","_signal","AbortSignal","aborted","addEventListener","pointerDown","className","position","toolbarPosition","direction","insetInlineEnd","top","#pointerDown","focusIn","#focusIn","_focusEventsAllowed","focusOut","#focusOut","addListenersToElement","#addListenersToElement","element","bind","capture","hide","hideDropdown","show","shown","addDeleteButton","editorType","button","tabIndex","delete","divider","#divider","addAltText","addComment","addColorPicker","renderButton","addEditSignatureButton","signatureManager","renderEditButton","addButton","tool","updateEditSignatureButton","description","title","destroy","FloatingToolbar","uiManager","#render","hasCommentManager","makeButton","commentSelection","highlightSelection","getLastPoint","#getLastPoint","boxes","isLTR","lastY","lastX","box","parent","#makeButton","buttonClass","l10nId","labelL10nId","clickHandler","bindEvents","names","IdManager","id","ImageManager","baseId","cache","_isSVGFittingCanvas","svg","canvas","getContext","willReadFrequently","image","Image","src","promise","then","drawImage","getImageData","data","#get","rawData","bitmap","refCounter","isSvg","File","file","Blob","mustRemoveAspectRatioPromise","fileReader","FileReader","imageElement","imagePromise","onload","svgUrl","result","onerror","readAsDataURL","createImageBitmap","getFromFile","lastModified","getFromUrl","getFromBlob","blobPromise","getFromId","getFromCanvas","offscreen","transferToImageBitmap","getSvgUrl","deleteId","transferFromImageBitmap","convertToBlob","close","isValidId","CommandManager","commands","locked","maxSize","cmd","undo","post","mustExec","NaN","overwriteIfSameType","keepUndo","next","splice","redo","hasSomethingToUndo","hasSomethingToRedo","cleanType","KeyboardManager","callbacks","allKeys","Set","callback","isMacKey","serialize","#serialize","event","altKey","ctrlKey","metaKey","shiftKey","self","has","bubbles","checker","ColorManager","_colorsMapping","_colors","convert","rgb","matchMedia","RGB","every","getHexCode","AnnotationEditorUIManager","abortController","AbortController","activeEditor","allEditableAnnotations","allEditors","allLayers","altTextManager","annotationStorage","changedExistingAnnotations","commandManager","commentManager","copyPasteAC","currentDrawingSession","currentPageIndex","deletedAnnotationsElementIds","draggingEditors","editorTypes","editorsToRescale","_editorUndoBar","enableHighlightFloatingButton","enableUpdatedAddImage","enableNewAltTextWhenAddingImage","filterFactory","focusMainContainerTimeoutId","focusManagerAC","highlightColors","highlightWhenShiftUp","floatingToolbar","idManager","isEnabled","isPointerDown","isWaiting","keyboardManagerAC","lastActiveElement","mainHighlightColorPicker","missingCanvases","mlManager","mode","selectedEditors","selectedTextNode","pageColors","showAllStates","pdfDocument","previousStates","isEditing","isEmpty","hasSelectedEditor","hasSelectedText","translation","translationTimeoutId","container","viewer","viewerAlert","updateModeCapability","TRANSLATE_SMALL","TRANSLATE_BIG","_keyboardManager","proto","arrowChecker","contains","activeElement","tagName","hasSomethingToControl","textInputChecker","_self","target","el","HTMLInputElement","small","big","selectAll","addNewEditorFromKeyboard","HTMLButtonElement","isEnterHandled","unselectAll","translateSelectedEditors","eventBus","editorUndoBar","supportsPinchToZoom","_eventBus","_on","onEditingAction","onPageChanging","onScaleChanging","onRotationChanging","onSetPreference","evt","updateParams","addSelectionListener","addDragAndDropListeners","addKeyboardManager","viewParameters","realScale","isShiftKeyDown","_supportsPinchToZoom","abort","layer","clear","clearTimeout","combinedSignal","ac","any","useNewAltTextFlow","useNewAltTextWhenAddingImage","hcmFilter","addHCMFilter","foreground","background","_highlightColors","pair","toUpperCase","hasHCM","isNameForHCM","endsWith","replace","highlightColorNames","getNonHCMColor","colorName","getNonHCMColorName","setCurrentDrawingSession","disableUserSelect","setMainHighlightColorPicker","editAltText","firstTime","editComment","getSignature","switchToMode","on","once","dispatch","source","setPreference","pageNumber","focusMainContainer","focus","findParent","layerX","layerY","getBoundingClientRect","toggle","addShouldRescale","removeShouldRescale","commitOrRemove","pagesRotation","getAnchorElementForSelection","#getAnchorElementForSelection","anchorNode","nodeType","Node","TEXT_NODE","parentElement","getLayerForTextLayer","#getLayerForTextLayer","textLayer","currentLayer","hasTextLayer","methodOfCreation","selection","getSelection","isCollapsed","anchorOffset","focusNode","focusOffset","anchorElement","closest","getSelectionBoxes","empty","isNoneMode","createAndAddNewEditor","showAllEditors","displayFloatingToolbar","#displayFloatingToolbar","addToAnnotationStorage","setValue","a11yAlert","messageId","JSON","stringify","removeAttribute","selectionChange","#selectionChange","dispatchUpdateStates","activeLayer","toggleDrawing","pointerup","onSelectEnd","#onSelectEnd","#addSelectionListener","addFocusManager","#addFocusManager","blur","removeFocusManager","#removeFocusManager","hasSelection","lastEditor","#addKeyboardManager","keydown","keyup","removeKeyboardManager","#removeKeyboardManager","addCopyPasteListeners","#addCopyPasteListeners","copy","cut","paste","removeCopyPasteListeners","#removeCopyPasteListeners","#addDragAndDropListeners","dragOver","drop","addEditListeners","removeEditListeners","dataTransfer","items","isHandlingMimeForPasting","dropEffect","item","editors","serialized","clipboardData","setData","getData","newEditors","deserializedEditor","deserialize","addEditorToLayer","selectEditors","addCommands","isEditorHandlingKeyboard","#dispatchUpdateStates","hasChanged","entries","some","assign","dispatchUpdateUI","#dispatchUpdateUI","setEditingState","registerEditorTypes","types","defaultPropertiesToUpdate","getId","getLayer","pageIndex","addLayer","enable","disable","removeLayer","updateMode","editId","isFromKeyboard","mustEnterInEditMode","withResolvers","hideSidebar","disableAll","loadSignatures","getAnnotationsByType","editorClass","_editorType","showSidebar","enableAll","annotationElementId","setSelected","enterInEditMode","unselect","canCreateNewEmptyEditor","addNewEditor","updateToolbar","action","updateDefaultParams","visible","updateButton","state","enableWaiting","mustWait","disableClick","enableClick","#enableAll","promises","all","#disableAll","getEditors","getEditor","addEditor","removeEditor","setTimeout","addDeletedAnnotationElement","addChangedExistingAnnotation","deleted","isDeletedAnnotationElement","removeDeletedAnnotationElement","removeChangedExistingAnnotation","#addEditorToLayer","addOrRebuild","setActiveEditor","propertiesToUpdate","lastSelectedEditor","#lastSelectedEditor","ed","updateUI","updateUIForDefaultProperties","toggleSelected","select","isSelected","firstSelectedEditor","params","cleanUndoStack","#isEmpty","drawingEditor","endDrawingSession","#selectEditors","commit","noCommit","totalX","totalY","TIME_TO_WAIT","translateInPage","translationDone","setUpDragSession","savedX","savedY","savedPageIndex","newX","newY","newPageIndex","endDragSession","mustBeAddedInUndoStack","move","_setParentAndPosition","dragSelectedEditors","tx","ty","drag","rebuild","changeParent","getActive","shouldGetKeyboardEvents","isActive","getMode","imageManager","rangeCount","getRangeAt","commonAncestorContainer","parentWidth","parentHeight","rotator","getAttribute","range","collapsed","getClientRects","renderAnnotationElement","annotation","editorId","getRawValue","hasBeenModified","setMissingCanvas","annotationId","setCanvas","addMissingCanvas","AltText","altTextDecorative","altTextButton","altTextButtonLabel","altTextTooltip","altTextTooltipTimeout","altTextWasFromKeyBoard","badge","guessedText","textWithDisclaimer","l10nNewButton","_l10n","added","review","initialize","l10n","label","onClick","_reportTelemetry","setState","#label","finish","focusVisible","hasData","setGuessedText","generatedAltText","toggleAltTextBadge","isForCopying","decorative","cancel","enabled","disabled","#setState","tooltip","DELAY_TO_SHOW_TOOLTIP","textContent","parentNode","getElementForAltText","Comment","commentButton","commentWasFromKeyBoard","initialText","edit","bottom","left","right","getClientDimensions","isDeleted","hasBeenEdited","setInitialText","TouchManager","isPinching","isPinchingStopped","isPinchingDisabled","onPinchStart","onPinching","onPinchEnd","pointerDownAC","touchInfo","touchManagerAC","touchMoveAC","onTouchStart","passive","MIN_TOUCH_DISTANCE_TO_PINCH","#onTouchStart","touches","opts","cancelPointerDown","pointerType","opt","onTouchMove","onTouchEnd","touch0","touch1","identifier","touch0X","screenX","touch0Y","screenY","touch1X","touch1Y","#onTouchMove","screen0X","screen0Y","screen1X","screen1Y","pTouch0X","pTouch0Y","pTouch1X","pTouch1Y","prevGapX","prevGapY","currGapX","currGapY","distance","hypot","pDistance","origin","#onTouchEnd","AnnotationEditor","accessibilityData","allResizerDivs","dragPointerId","dragPointerType","keepAspectRatio","resizersDiv","lastPointerCoords","savedDimensions","focusAC","focusedResizerName","hasBeenClicked","initialRect","isInEditMode","isResizerEnabledForKeyboard","moveInDOMTimeout","prevDragX","prevDragY","telemetryTimeouts","touchManager","_isCopy","_editToolbar","_initialOptions","_initialData","_isVisible","_l10nResizer","isDraggable","zIndex","_zIndex","_borderLineWidth","_colorManager","_telemetryTimeout","_resizerKeyboardManager","resize","_resizeWithKeyboard","_stopResizingWithKeyboard","parameters","_willKeepAspectRatio","isCentered","_structTreeParentId","pageRotation","pageDimensions","pageTranslation","parentDimensions","isAttachedToDOM","getPrototypeOf","_type","isDrawer","_defaultLineColor","deleteAnnotationElement","fakeEditor","FakeEditor","getNextId","topMiddle","topRight","middleRight","bottomMiddle","bottomLeft","middleLeft","documentElement","parseFloat","getPropertyValue","_value","mime","_isDraggable","center","parentRotation","fixAndSetPosition","setInBackground","setInForeground","setParent","stopResizing","focusin","focusout","relatedTarget","isMultipleSelection","setAt","screenToPageTranslation","_moveAfterPaste","baseX","baseY","_onTranslated","translate","#translate","_onTranslating","scrollIntoView","block","findNewParent","floor","bx","by","getBaseTranslation","toFixed","_hasBeenMoved","_hasBeenResized","_mustFixPosition","moveInDOM","rotatePoint","#rotatePoint","angle","pageTranslationToScreen","getRotationMatrix","#getRotationMatrix","parentScale","setDims","fixDims","widthPercent","heightPercent","getInitialTranslation","createResizers","#createResizers","classes","resizerPointerdown","prepend","#resizerPointerdown","savedDraggable","togglePointerEvents","resizerPointermove","savedWidth","savedHeight","savedParentCursor","cursor","savedCursor","pointerUpCallback","addResizeToUndoStack","#resize","_onResized","#addResizeToUndoStack","newWidth","newHeight","_round","round","#resizerPointermove","minWidth","MIN_SIZE","minHeight","rotationMatrix","transf","invRotationMatrix","invTransf","getPoint","getOpposite","isDiagonal","isHorizontal","point","oppositePoint","transfOppositePoint","oppositeX","oppositeY","ratioX","ratioY","deltaX","deltaY","fromKeyboard","lastScreenX","lastScreenY","oldDiag","_onResizing","altTextFinish","toolbarButtons","addEditToolbar","addCommentButton","removeEditToolbar","addContainer","editToolbarDiv","before","createAltText","altTextData","guessedAltText","setGuessedAltText","serializeAltText","hasAltText","hasAltTextData","commentColor","setCommentData","hasEditedComment","DEFAULT_POPUP_WIDTH","DEFAULT_POPUP_HEIGHT","trY","blX","blY","trX","popup","contents","defaultL10nId","addFocusListeners","maxWidth","maxHeight","isResizable","touchPinchStartCallback","touchPinchCallback","touchPinchEndCallback","#touchPinchStartCallback","#touchPinchCallback","_origin","prevDistance","slowDownFactor","factor","transfCenterPoint","newTransfCenterPoint","#touchPinchEndCallback","pointerdown","selectOnPointerEvent","#selectOnPointerEvent","#setUpDragSession","hasDraggingStarted","cancelDrag","_onStopDragging","clientX","clientY","pointerId","_onStartDragging","isPrimary","moveEditorInDOM","getRect","shiftX","shiftY","getRectInCurrentCoords","getPDFRect","onceAdded","enableEditMode","disableEditMode","needsToBeRebuilt","isOnScreen","innerHeight","innerWidth","#addFocusListeners","rotate","_angle","serializeDeleted","popupRef","context","isCopy","timeout","makeResizable","children","boundResizerKeydown","resizerKeydown","boundResizerBlur","resizerBlur","resizerFocus","firstPosition","nextFirstPosition","firstChild","lastChild","child","setResizerTabIndex","stopImmediatePropagation","#resizerKeydown","#resizerBlur","#resizerFocus","#setResizerTabIndex","#stopResizing","preventScroll","disableEditing","enableEditing","canChangeContent","dblclick","contentDiv","setAspectRatio","aspectRatio","telemetryInitialData","telemetryFinalData","content","querySelector","nodeName","resetAnnotationElement","SEED","MASK_HIGH","MASK_LOW","MurmurHash3_64","seed","h1","h2","update","ArrayBuffer","isView","byteLength","blockCounts","tailLength","dataUint32","k1","k2","C1","C2","C1_LOW","C2_LOW","hexdigest","SerializableEmpty","transfer","AnnotationStorage","modified","modifiedIds","storage","onSetModified","onResetModified","onAnnotationEditor","getValue","defaultValue","resetModified","entry","val","setModified","#setModified","print","PrintAnnotationStorage","serializable","hasBitmap","editorStats","stats","typeToEditor","counters","count","computeTelemetryFinalData","resetModifiedIds","ids","Symbol","iterator","structuredClone","FontLoader","systemFonts","ownerDocument","styleElement","_document","nativeFontFaces","loadingRequests","loadTestFontId","addNativeFontFace","nativeFontFace","fonts","removeNativeFontFace","insertRule","rule","getElementsByTagName","styleSheet","sheet","cssRules","loadSystemFont","systemFontInfo","disableFontFace","_inspectFont","loadedName","isFontLoadingAPISupported","fontFace","FontFace","load","baseFontName","font","attached","missingFile","createNativeFontFace","loaded","family","createFontFaceRule","isSyncFontLoadingSupported","_queueLoadingCallback","_prepareFontLoadEvent","hasFonts","completeRequest","done","otherRequest","shift","complete","_loadTestFont","testFont","int32","offset","spliceString","s","insert","chunk1","chunk2","called","isFontReady","fillText","imageData","COMMENT_OFFSET","CFF_CHECKSUM_OFFSET","XXXX_VALUE","checksum","fontFamily","FontFaceObject","translatedData","inspectFont","compiledGlyphs","cssFontInfo","css","weight","fontWeight","italicAngle","mimetype","getPathGenerator","objs","character","objId","cmds","path","Path2D","fontExtraProperties","getUrlProp","location","getDataProp","Buffer","isNaN","getFactoryUrlProp","isRefProxy","gen","isNameProxy","isValidExplicitDest","LoopbackPort","listeners","deferred","postMessage","listener","call","rmAbort","onAbort","removeEventListener","terminate","CallbackKind","DATA","ERROR","StreamKind","CANCEL","CANCEL_COMPLETE","CLOSE","ENQUEUE","PULL","PULL_COMPLETE","START_COMPLETE","onFn","wrapReason","MessageHandler","messageAC","sourceName","targetName","comObj","callbackId","streamId","streamSinks","streamControllers","callbackCapabilities","actionHandler","onMessage","#onMessage","stream","processStreamMessage","capability","reason","createStreamSink","actionName","handler","ah","transfers","sendWithPromise","sendWithStream","queueingStrategy","ReadableStream","controller","startCapability","startCall","pullCall","cancelCall","isClosed","desiredSize","pull","pullCapability","cancelCapability","#createStreamSink","streamSink","enqueue","isCancelled","lastDesiredSize","sinkCapability","ready","error","onPull","onCancel","success","#processStreamMessage","streamController","deleteStreamController","dataReason","#deleteStreamController","allSettled","BaseCanvasFactory","enableHWA","_createCanvas","reset","canvasAndContext","DOMCanvasFactory","BaseCMapReaderFactory","isCompressed","_fetch","cMapData","catch","DOMCMapReaderFactory","BaseFilterFactory","addFilter","maps","fgColor","bgColor","addAlphaFilter","addLuminosityFilter","addHighlightHCMFilter","filterName","newFgColor","newBgColor","keepHCM","DOMFilterFactory","_cache","_defs","docId","_hcmCache","#cache","hcmCache","#hcmCache","defs","#defs","contain","createElementNS","createTables","#createTables","mapR","table","mapG","mapB","bufferR","bufferG","bufferB","createUrl","#createUrl","tableR","tableG","tableB","filter","createFilter","addTransferMapConversion","fgRGB","bgRGB","addGrayConversion","getSteps","tableA","addTransferMapAlphaConversion","addLuminosityConversion","fgGray","bgGray","newFgRGB","newBgRGB","fg","bg","step","newStart","newStep","prev","k","j","#addLuminosityConversion","feColorMatrix","#addGrayConversion","#createFilter","appendFeFunc","#appendFeFunc","feComponentTransfer","func","feFunc","#addTransferMapConversion","rTable","gTable","bTable","#addTransferMapAlphaConversion","aTable","#getRGB","BaseStandardFontDataFactory","DOMStandardFontDataFactory","BaseWasmFactory","DOMWasmFactory","fs","getBuiltinModule","readFile","NodeFilterFactory","NodeCanvasFactory","require","createRequire","import","meta","createCanvas","NodeCMapReaderFactory","NodeStandardFontDataFactory","NodeWasmFactory","FORCED_DEPENDENCY_LABEL","CanvasDependencyTracker","simple","__proto__","incremental","sameLineText","namedDependencies","savesStack","markedContentStack","baseTransformStack","clipBox","pendingBBox","Float64Array","pendingBBoxIdx","pendingDependencies","operations","fontBBoxTrustworthy","canvasWidth","canvasHeight","opIdx","previous","lastPair","pop","recordOpenMarker","idx","getOpenMarker","recordCloseMarker","pushBaseTransform","popBaseTransform","recordSimpleData","recordIncrementalData","resetIncrementalData","recordNamedData","recordFutureForcedDependency","inheritSimpleDataAsFutureForcedDependencies","inheritPendingDependenciesAsFutureForcedDependencies","dep","resetBBox","hasPendingBBox","recordClipBox","minX","maxX","minY","maxY","intersection","recordBBox","bbox","recordCharacterBBox","getMeasure","fontBBox","isBBoxTrustworthy","computedBBox","fontMatrix","recordFullPageBBox","measure","actualBoundingBoxLeft","actualBoundingBoxRight","actualBoundingBoxAscent","actualBoundingBoxDescent","getSimpleIndex","dependencyName","recordDependencies","dependencyNames","forEach","copyDependenciesFromIncrementalOperation","depIdx","dependencies","recordNamedDependency","recordOperation","preserveBbox","pairs","concat","bboxToClipBoxDropOperation","_takePendingDependencies","_extractOperation","operation","_pushPendingDependencies","take","sort","CanvasNestedDependencyTracker","dependencyTracker","nestingLevel","outerDependencies","savesLevel","recordNestedDependencies","Dependencies","imageXObject","transformAndFill","PathType","SHADING","applyBoundingBox","region","BaseShadingPattern","isModifyingCurrentTransform","getPattern","RadialAxialShadingPattern","IR","_bbox","_colorStops","_p0","_p1","_r0","_r1","_createGradient","grad","createLinearGradient","createRadialGradient","colorStop","addColorStop","owner","inverse","pathType","pattern","ownerBBox","current","getClippedPathBoundingBox","tmpCanvas","cachedCanvases","getCanvas","tmpCtx","clearRect","beginPath","baseTransform","fillStyle","createPattern","domMatrix","DOMMatrix","setTransform","drawTriangle","p3","c1","c2","c3","coords","rowSize","tmp","scaleX","scaleY","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","_figures","_bounds","_background","_createMeshCanvas","combinedScale","backgroundColor","EXPECTED_SCALE","MAX_PATTERN_SIZE","BORDER_SIZE","boundsWidth","boundsHeight","paddedWidth","paddedHeight","createImageData","putImageData","Float32Array","matrixScaleX","matrixScaleY","temporaryPatternCanvas","DummyShadingPattern","getShadingPattern","PaintType","COLORED","UNCOLORED","TilingPattern","canvasGraphicsFactory","operatorList","xstep","ystep","paintType","tilingType","createPatternCanvas","combinedScaleX","combinedScaleY","redrawHorizontally","redrawVertically","xScaledStep","yScaledStep","xScaledWidth","yScaledHeight","dimx","getSizeAndScale","dimy","graphics","createCanvasGraphics","groupLevel","setFillAndStrokeStyleToContext","clipBbox","executeOperatorList","endDrawing","dimx2","dimy2","xSize","ySize","tmpCanvas2","tmpCtx2","jj","realOutputSize","bboxWidth","bboxHeight","strokeStyle","fillColor","strokeColor","convertToRGBA","kind","convertBlackAndWhiteToRGBA","convertRGBToRGBA","srcPos","nonBlackColor","inverseDecode","black","zeroMapping","oneMapping","widthInSource","widthRemainder","srcLength","destPos","elem","len","len32","src32","s1","s2","s3","grayToRGBA","MIN_FONT_SIZE","MAX_FONT_SIZE","EXECUTION_TIME","EXECUTION_STEPS","FULL_CHUNK_HEIGHT","SCALE_MATRIX","XY","MIN_MAX_INIT","mirrorContextOperations","destCtx","_removeMirroring","__originalSave","__originalRestore","__originalRotate","__originalScale","__originalTranslate","__originalTransform","__originalSetTransform","__originalResetTransform","resetTransform","__originalClip","__originalMoveTo","__originalLineTo","__originalBezierCurveTo","bezierCurveTo","__originalRect","__originalClosePath","__originalBeginPath","cp1x","cp1y","cp2x","cp2y","CachedCanvases","canvasFactory","canvasEntry","drawImageAtIntegerCoords","srcImg","srcX","srcY","srcW","srcH","destX","destY","destW","destH","tlX","rTlX","tlY","rTlY","brX","rWidth","brY","rHeight","sign","CanvasExtraState","alphaIsShape","fontSize","fontSizeScale","textMatrix","textMatrixScale","leading","lineX","lineY","charSpacing","wordSpacing","textHScale","textRenderingMode","textRise","patternFill","patternStroke","fillAlpha","strokeAlpha","lineWidth","activeSMask","transferMaps","preInit","getPathBoundingBox","xStrokePad","yStrokePad","updateClipFromPath","startNewPathAndClipBox","isEmptyClip","putBinaryImageData","imgData","ImageData","partialChunkHeight","fullChunks","totalChunks","chunkImgData","thisChunkHeight","elemsInThisChunk","dest32","dest32DataLength","fullSrcDiff","white","srcDiff","kEnd","kEndUnrolled","mask","srcByte","putBinaryImageMask","copyCtxState","sourceCtx","properties","property","setLineDash","getLineDash","lineDashOffset","resetCtxToDefault","fillRule","globalAlpha","lineCap","lineJoin","miterLimit","globalCompositeOperation","getImageSmoothingEnabled","interpolate","actualScale","fround","LINE_CAP_STYLES","LINE_JOIN_STYLES","NORMAL_CLIP","EO_CLIP","CanvasGraphics","canvasCtx","commonObjs","optionalContentConfig","annotationCanvasMap","stateStack","pendingClip","pendingEOFill","xobjs","groupStack","smaskStack","smaskCounter","tempSMask","suspendedCtx","contentVisible","cachedPatterns","viewportScale","outputScaleX","outputScaleY","_cachedScaleForStroking","_cachedGetSinglePixelWidth","_cachedBitmapsMap","getObject","fallback","beginDrawing","transparency","savedFillStyle","fillRect","transparentCanvas","compositeCtx","executionStartIdx","continueCallback","stepper","filteredOperationIndexes","argsArray","fnArray","argsArrayLen","chunkOperations","endTime","steps","fnId","fnArgs","nextBreakPoint","breakIt","depObjId","objsPool","restoreInitialState","#restoreInitialState","inSMaskMode","HTMLCanvasElement","drawFilter","#drawFilter","hcmFilterId","savedFilter","_scaleImage","img","displayWidth","displayHeight","widthScale","heightScale","paintWidth","paintHeight","tmpCanvasId","_createMaskCanvas","isPatternFill","currentTransform","cacheKey","maskCanvas","mainKey","cachedImage","maskToCanvas","drawnWidth","drawnHeight","fillCanvas","fillCtx","imageSmoothingEnabled","limit","dashArray","dashPhase","intent","flatness","states","checkSMaskState","beginSMaskMode","endSMaskMode","cacheId","scratchCanvas","compose","dirtyBox","smask","composeSMask","layerCtx","layerBox","layerOffsetX","layerOffsetY","layerWidth","layerHeight","genericComposeSMask","subtype","backdrop","transferMap","maskCtx","maskOffsetX","maskOffsetY","maskX","maskY","old","op","outerExtraSize","path2d","_pathStartIdx","consumePath","newPath","addPath","multiplySelf","rescaleAndStroke","needRestore","paths","pendingTextPaths","preMultiplySelf","spacing","fontRefName","fontObj","fontDirection","isType3Font","typeface","fallbackName","bold","italic","browserFontSize","rise","getScaledPath","#getScaledPath","paintChar","patternFillTransform","patternStrokeTransform","fillStrokeMode","isAddToPathSet","scaledPath","invPatternTransform","measureText","strokeText","isFontSubpixelAAEnabled","glyphs","showType3Text","glyphsLength","vertical","spacingDir","defaultVMetrics","widthAdvanceScale","simpleFillText","getSinglePixelWidth","isInvalidPDFjsFont","chars","glyph","unicode","joinedChars","restoreNeeded","isSpace","fontChar","accent","scaledX","scaledY","vmetric","vx","vy","remeasure","measuredWidth","characterScaleX","isInFont","scaledAccentX","scaledAccentY","charWidth","isTextInvisible","spacingLength","charProcOperatorList","operatorListId","xWidth","yWidth","llx","lly","urx","ury","getColorN_Pattern","_getPattern","inv","group","currentCtx","isolated","knockout","bounds","canvasBounds","groupCtx","startTransformInverse","currentMtx","hasOwnCanvas","annotationCanvas","savedCtx","skewX","skewY","positions","trans","images","applyTransferMapsToCanvas","applyTransferMapsToBitmap","imgToPaint","HTMLElement","tag","isVisible","isContentVisible","absDet","normX","normY","getScaleForStroking","scaledLineWidth","scaledXLineWidth","scaledYLineWidth","baseArea","saveRestore","dashes","GlobalWorkerOptions","port","workerPort","Worker","workerSrc","Metadata","parsedData","getRaw","INTERNAL","OptionalContentGroup","isDisplay","isPrint","userSet","renderingIntent","usage","rbGroups","view","viewState","printState","_setVisible","internal","OptionalContentConfig","cachedGetHash","groups","initialHash","order","creator","baseState","off","getHash","evaluateVisibilityExpression","#evaluateVisibilityExpression","array","operator","expression","policy","setVisibility","preserveRB","rbGroup","otherId","setOCGState","hasInitialVisibility","getOrder","getGroup","PDFDataTransportStream","pdfDataRangeTransport","disableRange","disableStream","initialData","progressiveDone","contentDispositionFilename","_queuedChunks","_progressiveDone","_contentDispositionFilename","_pdfDataRangeTransport","_isStreamingSupported","_isRangeSupported","_contentLength","_fullRequestReader","_rangeReaders","addRangeListener","begin","_onReceiveData","addProgressListener","total","_onProgress","addProgressiveReadListener","addProgressiveDoneListener","_onProgressiveDone","transportReady","_enqueue","found","rangeReader","_begin","_progressiveDataLength","_loaded","onProgress","_removeRangeReader","reader","indexOf","getFullReader","queuedChunks","PDFDataTransportStreamReader","getRangeReader","PDFDataTransportStreamRangeReader","requestDataRange","cancelAllRequests","_stream","_done","_filename","_requests","_headersReady","requestCapability","headersReady","isRangeSupported","isStreamingSupported","contentLength","read","_end","_queuedChunk","requestsCapability","getFilenameFromContentDispositionHeader","contentDisposition","needsEncodingFixup","toParamRegExp","rfc2616unquote","rfc5987decode","rfc2047decode","fixupEncoding","rfc2231getparam","attributePattern","flags","textdecode","contentDispositionStr","iter","quot","part","parts","quotindex","extvalue","encodingend","langvalue","charset","hex","createHeaders","isHttp","httpHeaders","headers","Headers","getResponseOrigin","validateRangeRequestCapabilities","responseHeaders","rangeChunkSize","returnValues","allowRangeRequests","suggestedLength","contentEncoding","extractFilenameFromHeader","createResponseError","validateResponseStatus","createFetchOptions","withCredentials","method","credentials","redirect","getArrayBuffer","PDFFetchStream","_responseOrigin","_rangeRequestReaders","PDFFetchStreamReader","PDFFetchStreamRangeReader","_reader","_withCredentials","_headersCapability","_disableRange","_rangeChunkSize","_abortController","getReader","_readCapability","responseOrigin","OK_RESPONSE","PARTIAL_CONTENT_RESPONSE","xhr","NetworkManager","currXhrId","pendingRequests","xhrId","pendingRequest","setRequestHeader","expectedStatus","onError","onStateChange","onprogress","onHeadersReceived","onDone","xhrStatus","ok_response_on_range_request","rangeHeader","getResponseHeader","getRequestXhr","isPendingRequest","abortRequest","PDFNetworkStream","_source","_manager","_onRangeRequestReaderClosed","PDFNetworkStreamFullRequestReader","PDFNetworkStreamRangeRequestReader","onClosed","manager","_url","_fullRequestId","_onHeadersReceived","_onDone","_onError","_cachedChunks","_storedError","fullRequestXhrId","fullRequestXhr","responseURL","rawResponseHeaders","getAllResponseHeaders","trimStart","lengthComputable","_requestId","_close","urlRegex","parseUrlOrPath","sourceUrl","pathToFileURL","PDFNodeStream","PDFNodeStreamFsFullReader","PDFNodeStreamFsRangeReader","_readableStream","lstat","stat","_setReadableStream","createReadStream","_error","readableStream","INITIAL_DATA","PDFObjects","ensureObj","#ensureObj","MAX_TEXT_DIVS_TO_RENDER","DEFAULT_FONT_SIZE","TextLayer","disableProcessItems","fontInspectorEnabled","FontInspector","lang","layoutTextParams","rootContainer","styleCache","textContentItemsStr","textContentSource","textDivs","textDivProperties","WeakMap","ascentCache","canvasContexts","canvasCtxFonts","minFontSize","pendingTextLayers","ensureMinFontSizeComputed","finally","fontFamilyMap","pump","styles","processItems","onBefore","getCtx","layout","abortEx","#processItems","appendText","#appendText","geom","textDiv","hasText","hasEOL","atan2","fontName","fontSubstitution","fontHeight","fontAscent","getAscent","sin","cos","scaleFactorStr","divStyle","dir","dataset","fontSubstitutionLoadedName","shouldScaleText","absScaleX","absScaleY","br","#layout","ensureCtxFont","cleanup","#getCtx","alpha","#ensureCtxFont","cached","#ensureMinFontSizeComputed","opacity","lineHeight","#getAscent","cachedAscent","metrics","ascent","fontBoundingBoxAscent","descent","fontBoundingBoxDescent","ratio","XfaText","xfa","walk","node","shouldBuildText","RENDERING_CANCELLED_TIMEOUT","getDocument","task","PDFDocumentLoadingTask","password","rangeTransport","PDFDataRangeTransport","worker","PDFWorker","docBaseUrl","cMapUrl","cMapPacked","CMapReaderFactory","iccUrl","standardFontDataUrl","StandardFontDataFactory","wasmUrl","WasmFactory","ignoreErrors","stopAtErrors","maxImageSize","chrome","canvasMaxAreaInBytes","enableXfa","disableAutoFetch","pdfBug","CanvasFactory","FilterFactory","useWasm","useSystemFonts","useWorkerFetch","transportFactory","cMapReaderFactory","standardFontDataFactory","wasmFactory","_worker","docParams","apiVersion","evaluatorOptions","transportParams","loadingParams","destroyed","workerIdPromise","messageHandler","networkStream","NetworkStream","workerId","transport","WorkerTransport","_transport","_capability","onPassword","_pendingDestroy","progressiveDoneListeners","progressiveReadListeners","progressListeners","rangeListeners","onDataRange","onDataProgress","onDataProgressiveRead","onDataProgressiveDone","PDFDocumentProxy","pdfInfo","_pdfInfo","numPages","fingerprints","isPureXfa","_htmlForXfa","allXfaHtml","getPage","getPageIndex","ref","getDestinations","getDestination","getPageLabels","getPageLayout","getPageMode","getViewerPreferences","getOpenAction","getAttachments","pageIndexesToSkip","getJSActions","getDocJSActions","getOutline","getOptionalContentConfig","getRenderingIntent","getPermissions","getMetadata","getMarkInfo","saveDocument","getDownloadInfo","downloadInfoCapability","keepLoadedFonts","startCleanup","loadingTask","cachedPageNumber","getFieldObjects","hasJSActions","getCalculationOrderIds","PDFPageProxy","pendingCleanup","pageInfo","_pageIndex","_pageInfo","_stats","_pdfBug","_intentStates","recordedGroups","getViewport","getAnnotations","getPageJSActions","getXfa","canvasContext","annotationMode","optionalContentConfigPromise","printAnnotationStorage","recordOperations","intentArgs","intentState","streamReaderCancelTimeout","intentPrint","displayReadyCapability","lastChunk","separateAnnots","_pumpOperatorList","shouldRecordOperations","StepperManager","renderTasks","internalRenderTask","gfx","setOperatorGroups","tryCleanup","_abortOperatorList","Stats","InternalRenderTask","useRequestAnimationFrame","renderTask","initializeGraphics","operatorListChanged","getOperatorList","opListReadCapability","opListTask","streamTextContent","includeMarkedContent","disableNormalization","TEXT_CONTENT_CHUNK_SIZE","highWaterMark","getTextContent","getStructTree","_destroy","waitOn","force","completed","resetStats","#tryCleanup","_startRenderPage","_renderPageChunk","operatorListChunk","annotationStorageSerializable","streamReader","delay","curCacheKey","curIntentState","webWorker","fakeWorkerId","isWorkerDisabled","workerPorts","_isSameOrigin","otherUrl","base","other","_createCDNWrapper","wrapper","createObjectURL","fromPort","initializeFromPort","#resolve","#initializeFromPort","#initialize","mainThreadWorkerMessageHandler","setupFakeWorker","terminateEarly","sendTest","testObj","#setupFakeWorker","_setupFakeWorkerGlobal","WorkerMessageHandler","workerHandler","setup","cachedPort","#mainThreadWorkerMessageHandler","pdfjsWorker","loader","methodPromises","pageCache","pagePromises","pageRefCache","passwordCapability","factory","fontLoader","_params","destroyCapability","_networkStream","_fullReader","_lastProgress","setupMessageHandler","cacheSimpleMethod","#cacheSimpleMethod","cachedPromise","isOpList","modifiedIdsHash","cacheKeyBuf","hasOwnProperty","terminated","sink","readyReason","_numPages","htmlForXfa","updatePassword","err","exportedData","exportedError","fontAdded","imageRef","pageProxy","dataLen","refStr","results","metadata","cleanupSuccessful","RenderTask","onContinue","form","rAF","canvasInUse","WeakSet","operatorListIdx","running","graphicsReadyCallback","graphicsReady","_useRequestAnimationFrame","cancelled","_cancelBound","_continueBound","_continue","_scheduleNextBound","_scheduleNext","_nextBound","_next","_canvas","_canvasContext","_enableHWA","_dependencyTracker","_filteredOperationIndexes","init","getNextBreakPoint","cancelAnimationFrame","updateOperatorList","requestAnimationFrame","version","build","ColorPicker","buttonSwatch","defaultColor","dropdown","dropdownWasFromKeyboard","isMainColorPicker","openDropdownAC","l10nColor","_hideDropdownFromKeyboard","_colorSelectFromKeyboard","_moveToNext","_moveToPrevious","_moveToBeginning","_moveToEnd","blue","green","pink","red","yellow","ariaHasPopup","ariaControls","openDropdown","keyDown","swatch","ariaHidden","renderMainDropdown","getDropdownRoot","ariaOrientation","ariaLabelledBy","#getDropdownRoot","role","ariaMultiSelectable","ariaSelected","colorSelect","#colorSelect","updateColor","isDropdownVisible","nextSibling","previousSibling","#keyDown","#openDropdown","detail","ariaExpanded","root","#isDropdownVisible","BasicColorPicker","colorType","colorValue","makeColorComp","scaleAndClamp","ColorConverters","CMYK_G","G_CMYK","G_RGB","G_rgb","G_HTML","G","RGB_G","RGB_rgb","RGB_HTML","T_HTML","T_rgb","CMYK_RGB","CMYK_rgb","CMYK_HTML","components","RGB_CMYK","DateFormats","TimeFormats","BaseSVGFactory","skipDimensions","_createSVG","DOMSVGFactory","XfaLayer","setupStorage","html","storedData","xfaOn","xfaOff","checked","option","selected","selectedIndex","setAttributes","linkService","isHTMLAnchorElement","HTMLAnchorElement","addLinkAttributes","newWindow","dataId","xfaHtml","rootHtml","isNotForRichText","rootDiv","createTextNode","stack","childHtml","xmlns","querySelectorAll","hidden","GetElementsByNameSet","TIMEZONE_OFFSET","getTimezoneOffset","AnnotationElementFactory","annotationType","LinkAnnotationElement","TextAnnotationElement","fieldType","TextWidgetAnnotationElement","radioButton","RadioButtonWidgetAnnotationElement","checkBox","CheckboxWidgetAnnotationElement","PushButtonWidgetAnnotationElement","ChoiceWidgetAnnotationElement","SignatureWidgetAnnotationElement","WidgetAnnotationElement","PopupAnnotationElement","FreeTextAnnotationElement","LineAnnotationElement","SquareAnnotationElement","CircleAnnotationElement","PolylineAnnotationElement","CaretAnnotationElement","InkAnnotationElement","PolygonAnnotationElement","HighlightAnnotationElement","UnderlineAnnotationElement","SquigglyAnnotationElement","StrikeOutAnnotationElement","StampAnnotationElement","FileAttachmentAnnotationElement","AnnotationElement","updates","hasBorder","popupElement","isRenderable","ignoreBorder","createQuadrilaterals","downloadManager","imageResourcesPath","renderForms","svgFactory","enableComment","enableScripting","_fieldObjects","fieldObjects","_createContainer","_createQuadrilaterals","_hasPopupData","contentsObj","richText","_isEditable","isEditable","hasPopupData","hasCommentButton","hasPopupElement","commentButtonPosition","quadPoints","commentButtonColor","oppositeOpacity","changeLightness","#changeLightness","l","newL","_normalizePoint","updateEdited","newPopup","setRectEdited","_createPopup","resetEdited","#setRectEdited","currentRect","setRotation","alternativeText","noRotate","borderStyle","borderWidth","horizontalRadius","horizontalCornerRadius","verticalRadius","verticalCornerRadius","radius","borderRadius","borderBottomStyle","borderColor","_commonActions","setColor","jsName","styleName","colorArray","display","noView","noPrint","userName","readonly","required","_setRequired","textColor","_dispatchEventFromSandbox","actions","jsEvent","commonActions","_setDefaultPropertiesFromJS","eventProxy","rectBlX","rectBlY","rectTrX","rectTrY","svgBuffer","clipPath","rectWidth","rectHeight","backgroundImage","popupData","modificationDate","titleObj","parentRect","elements","_getElementsByName","skipId","fields","fieldObj","exportValues","exportValue","domElement","getElementsByName","maybeShow","forceHide","getElementsToTriggerPopup","addHighlightArea","triggers","_editOnDoubleClick","annotationEditorType","isTooltipOnly","link","isBound","_bindNamedAction","overlaidText","attachment","bindAttachment","attachmentDest","bindSetOCGState","_bindLink","Action","_bindJSAction","resetForm","_bindResetFormAction","setInternalLink","#setInternalLink","destination","getDestinationHash","onclick","goToDestination","getAnchorUrl","executeNamedAction","#bindAttachment","openOrDownloadData","#bindSetOCGState","executeSetOCGState","otherClickAction","resetFormFields","refs","resetFormRefs","include","allFields","fieldIds","fieldName","field","allIds","dispatchEvent","Event","showElementAndHideCanvas","_getKeyModifier","_setEventListener","elementData","baseName","eventName","valueGetter","modifier","focused","_setEventListeners","getter","Blur","Focus","_setBackgroundColor","_setTextStyle","TEXT_ALIGNMENT","fontColor","defaultAppearanceData","computedFontSize","roundToOneDecimal","multiLine","numberOfLines","textAlignment","textAlign","isRequired","hasAppearance","fieldValue","setPropertyOnSiblings","keyInStorage","maxLen","charLimit","fieldFormattedValues","formattedValue","comb","userValue","lastCommittedValue","commitKey","doNotScroll","overflowY","overflowX","readOnly","datetimeFormat","datetimeType","timeStep","hasDateOrTime","maxLength","defaultFieldValue","blurListener","scrollLeft","getHours","getMinutes","getSeconds","toISOString","selRange","setSelectionRange","willCommit","selStart","selectionStart","selEnd","selectionEnd","_blurListener","valueOf","Keystroke","inputType","change","fieldWidth","combWidth","letterSpacing","verticalAlign","checkbox","curChecked","buttonValue","radio","pdfButtonValue","linkElement","selectElement","addAnEmptyEntry","combo","multiSelect","multiple","optionElement","displayValue","removeEmptyEntry","noneOptionElement","isExport","selectedValues","getItems","multipleSelection","index","findIndex","selectChild","indices","editable","changeEx","PopupElement","creationDate","elementIds","boundKeyDown","boundHide","boundShow","boundToggle","dateObj","pinned","popupAbortController","wasVisible","trigger","flatMap","addEventListeners","#addEventListeners","renderCommentButton","setCommentButtonPosition","#setCommentButtonPosition","find","#renderCommentButton","parentContainer","after","baseColor","outlineColor","header","dateTime","_formatContents","#html","#fontSize","#fontColor","makePopupContent","#makePopupContent","popupLines","popupContent","lineAttributes","line","lines","setPosition","#setPosition","useParentRect","normalizedRect","HORIZONTAL_SPACE_AFTER_ANNOTATION","popupLeft","popupTop","#toggle","#show","#hide","textPosition","lineSpan","lineCoordinates","square","circle","polyline","containerClassName","svgElementName","vertices","points","polylinesGroupElement","polylines","it","#getTransform","inkLists","thickness","inkList","mark","underline","strikeout","download","#download","AnnotationLayer","accessibilityManager","editableAnnotations","structTreeLayer","annotationEditorUIManager","_annotationEditorUIManager","hasEditableAnnotations","appendElement","#appendElement","popupElements","contentElement","ariaAttributes","getAriaAttributes","moveElementInDOM","annotations","popupToElements","elementParams","noHTML","isPopupAnnotation","rendered","setAnnotationCanvasMap","addLinkAnnotations","_defaultBorderStyle","#setAnnotationCanvasMap","replaceWith","editableAnnotation","_hasNoCanvas","getEditableAnnotations","getEditableAnnotation","rawWidth","EOL_PATTERN","FreeTextEditor","editorDivId","editModeAC","_colorPicker","_freeTextDefaultContent","_internalPadding","_defaultColor","_defaultFontSize","_translateEmpty","updateFontSize","#updateFontSize","setFontsize","editorDiv","setEditorDimensions","savedFontsize","#updateColor","col","savedColor","overlayDiv","contentEditable","editorDivKeydown","editorDivFocus","editorDivBlur","editorDivInput","editorDivPaste","innerText","extractText","#extractText","prevChild","childNodes","getNodeContent","#setEditorDimensions","savedDisplay","savedVisibility","savedText","newText","trimEnd","setText","setContent","posX","posY","#getNodeContent","nodeValue","deserializeContent","deleteFromDocument","insertNode","collapseToStart","startContainer","startOffset","bufferBefore","bufferAfter","newRange","Range","beforeLength","setStart","setEnd","removeAllRanges","addRange","#setContent","replaceChildren","serializeContent","#serializeContent","#deserializeContent","padding","structTreeParentId","hasElementChanged","#hasElementChanged","Outline","PRECISION","toSVGPath","_rotation","_rescale","_rescaleAndSwap","_translate","svgRound","_normalizePagePoint","createBezierPoints","FreeDrawOutliner","innerMargin","last","min_dist","scaleFactor","MIN_DIST","MIN_DIFF","MIN","getLastCoords","#getLastCoords","lastTop","lastBottom","diffX","diffY","diffD","nX","nY","thX","thY","toSVGPathTwoPoints","toSVGPathEnd","toSVGPathStart","#toSVGPathTwoPoints","lastTopX","lastTopY","lastBottomX","lastBottomY","#toSVGPathStart","#toSVGPathEnd","newFreeDrawOutline","outline","FreeDrawOutline","getOutlines","getOutlineTwoPoints","N","getOutlineEnd","getOutlineStart","#getOutlineTwoPoints","#getOutlineStart","#getOutlineEnd","lastPoint","computeMinMax","#computeMinMax","lastPointX","lastPointY","ltrCallback","newOutliner","getNewOutline","outliner","HighlightOutliner","verticalEdges","intervals","NUMBER_OF_DIGITS","EPSILON","shiftedMinX","shiftedMinY","lastEdge","edge","outlineVerticalEdges","breakEdge","#getOutlines","edges","allEdges","edge1","edge2","outlines","HighlightOutline","binarySearch","#binarySearch","middle","#insert","#remove","#breakEdge","y4","polygon","prevX","prevY","classNamesForOutlining","FreeHighlightOutliner","FreeHighlightOutline","HighlightEditor","clipPathId","focusOutlines","highlightDiv","highlightOutlines","isFreeHighlight","outlineId","_defaultOpacity","_defaultThickness","_freeHighlightId","_freeHighlight","_freeHighlightClipId","_moveCaret","highlightId","createFreeOutlines","addToDrawLayer","createOutlines","numberOfColors","#createOutlines","outlinerForOutline","#createFreeOutlines","extraThickness","drawLayer","finalizeDraw","drawOutline","rootClass","highlightOutline","free","updateProperties","rotateBbox","updateThickness","setColorAndOpacity","opa","savedOpacity","#updateThickness","savedThickness","setThickness","th","changeThickness","getRotation","addUndoableEditor","cleanDrawLayer","mustBeSelected","#changeThickness","#cleanDrawLayer","#addToDrawLayer","draw","#rotateBbox","pointerover","hovered","pointerleave","#keydown","setCaret","#setCaret","#getRotation","serializeBoxes","#serializeBoxes","serializeOutlines","#serializeOutlines","startHighlighting","endHighlight","highlightMove","#highlightMove","#endHighlight","DrawingOptions","svgProperties","updateProperty","updateSVGProperty","toSVGProperties","updateAll","DrawingEditor","drawOutlines","mustBeCommitted","_drawId","_currentDrawId","_currentParent","currentDraw","currentDrawingAC","currentDrawingOptions","currentPointerId","currentPointerType","currentPointerIds","currentMoveTimestamp","_INNER_MARGIN","_addOutlines","createDrawOutlines","#createDrawOutlines","drawId","drawingOptions","_drawingOptions","defaultProperties","createDrawing","updateBbox","#createDrawing","_mergeSVGProperties","defaultSVGProperties","p1Keys","getDefaultDrawingOptions","_options","typesMap","supportMultipleDrawings","propertyName","_defaultDrawingOptions","_updateProperty","savedValue","setter","getPathResizingSVGProperties","convertToDrawSpace","rotateBox","getPathResizedSVGProperties","_x","_y","getPathTranslatedSVGProperties","moving","updateParent","convertToParentSpace","#convertToParentSpace","pW","pH","#convertToDrawSpace","#updateBbox","#rotateBox","updateRotation","updateParentDimensions","onScaleChangingWhenDrawing","drawDiv","createDrawerInstance","_parentWidth","_parentHeight","startDrawing","_isLTR","_endDraw","isCancellable","removeLastElement","_drawMove","timeStamp","startNew","_cleanup","lastElement","getLastElement","setLastElement","isAborted","createDrawingOptions","_data","deserializeDraw","_pageX","_pageY","_pageWidth","_pageHeight","_innerWidth","serializeDraw","InkDrawOutliner","lastSVGPath","lastIndex","InkDrawOutline","normalizePoint","#normalizePoint","firstX","firstY","secondX","secondY","c1x","c1y","c2x","c2y","currentRotation","computeBbox","serializedLines","serializedPoints","getBBoxWithNoMargin","rescaleFn","newLines","getMarginComponents","#getMarginComponents","margin","#getBBoxWithNoMargin","marginX","marginY","#computeBbox","oldMarginX","oldMarginY","newMarginX","newMarginY","diffMarginX","diffMarginY","rotationTransform","s1x","s1y","s2x","s2y","newParentWidth","newParentHeight","InkDrawingOptions","viewerParameters","_viewParameters","InkEditor","ContourDrawOutline","BASE_HEADER_LENGTH","POINTS_PROPERTIES_NUMBER","SignatureExtractor","PARAMETERS","sigmaSFactor","sigmaR","kernelSize","neighborIndexToId","#neighborIndexToId","i0","j0","neighborIdToIndex","Int32Array","clockwiseNonZero","#clockwiseNonZero","kk","shiftI","shiftJ","counterClockwiseNonZero","#counterClockwiseNonZero","findContours","#findContours","threshold","nbd","lnbd","contours","ij","pix","i2","j2","isHole","contour","contour0","i1","j1","i3","j3","i4","j4","ij3","douglasPeuckerHelper","#douglasPeuckerHelper","ax","ay","abx","aby","dist","nabx","naby","aa","invS","phi","atan","cosPhi","sinPhi","tmax","poly","partialPhi","dmax","douglasPeucker","#douglasPeucker","bilateralFilter","#bilateralFilter","sigmaS","kernel","sigmaS2","halfSize","exp","rangeValues","sigmaR2","out","histogram","sum","norm","neighbour","getHistogram","#getHistogram","toUint8","#toUint8","Uint8ClampedArray","guessThreshold","#guessThreshold","M","L","spos","getGrayPixels","#getGrayPixels","originalBitmap","prevWidth","prevHeight","log2","isteps","grayImage","uint8Buf","extractContoursFromText","fontStyle","SCALE","contourList","processDrawnLines","curves","mustSmooth","areContours","linesAndPoints","xScale","yScale","newCurves","reducedPoints","newPoints","compressSignature","minDiff","maxDiff","outlinesLength","dx","bufferType","Int8Array","Int16Array","headerLength","BYTES_PER_ELEMENT","CompressionStream","writer","getWriter","write","BufferCtor","diffs","Response","readable","decompressSignature","signatureData","DecompressionStream","numberOfDrawings","diffsOffset","SignatureOptions","DrawnSignatureOptions","SignatureEditor","isExtracted","signatureUUID","_defaultDrawnSignatureOptions","hasDescription","hasDescriptionStats","hasNoAltText","uuid","heightInPage","addSignature","setUuid","getSignaturePreview","outlineData","hasBeenSaved","getFromImage","getFromText","fontInfo","getDrawnSignature","isSignature","alt","StampEditor","bitmapId","bitmapPromise","bitmapUrl","bitmapFile","bitmapFileName","missingCanvas","resizeTimeoutId","hasBeenAddedInUndoStack","pasteEditor","getAsFile","hasAltTextStats","getBitmapFetched","#getBitmapFetched","fromId","getBitmapDone","#getBitmapDone","alt_text_modal","alt_text_type","mlGuessAltText","updateAltTextData","isEnabledFor","copyCanvas","guess","channels","getBitmap","#getBitmap","accept","files","click","drawBitmap","#createCanvas","MAX_RATIO","maxDataDimension","maxPreviewDimension","bitmapWidth","bitmapHeight","outputScale","scaledWidth","scaledHeight","scaleBitmap","boxDim","boxDimWidth","boxDimHeight","patternCtx","dataWidth","dataHeight","offscreenCtx","#scaleBitmap","#drawBitmap","serializeBitmap","#serializeBitmap","toUrl","toDataURL","structParent","_structTree","changes","isSame","isSameAltText","stamps","area","prevData","isSamePageIndex","AnnotationEditorLayer","allowClick","annotationLayer","clickAC","editorFocusTimeoutId","hadPointerDown","isDisabling","isEnabling","drawingAC","focusedElement","textSelectionAC","textLayerDblClickAC","lastPointerDownTimestamp","_initialized","isInvisible","disableTextSelection","toggleAnnotationLayerPointerEvents","enableTextSelection","annotationElementIds","editables","DBL_CLICK_THRESHOLD","elementsFromPoint","changedAnnotations","resetAnnotations","currentActive","textLayerPointerDown","#textLayerPointerDown","attach","detach","removePointerInTextLayer","currentEditorType","#currentEditorType","createNewEditor","#createNewEditor","getCenterPoint","#getCenterPoint","currentMode","startDrawingSession","pause","#cleanup","oldRotation","DrawLayer","mapping","toUpdate","_svgFactory","setBox","#setBox","createSVG","#createSVG","createClipPath","#createClipPath","pathId","clipPathUse","#updateProperties","isPathUpdatable","hasClip","use","mustRemoveSelfIntersections","maskId","use1","use2","cloneNode","elementOrId","pathElement","_pdfjsTestingUtils","pdfjsLib"],"sourceRoot":""} |