From 34504a1bd04172c90accc7cebf4f8816c0b773ed Mon Sep 17 00:00:00 2001 From: Ethan Yoo Date: Wed, 6 Nov 2024 21:15:31 -0500 Subject: [PATCH] Update the PDF.js library used by hugo-embed-pdf-shortcode to 4.8.69-legacy --- layouts/shortcodes/embed-pdf.html | 173 +- static/css/pdfjs.css | 70 + static/js/pdf-js/build/pdf.js | 15792 --- static/js/pdf-js/build/pdf.js.map | 1 - static/js/pdf-js/build/pdf.sandbox.js | 280 - static/js/pdf-js/build/pdf.sandbox.js.map | 1 - static/js/pdf-js/build/pdf.worker.js.map | 1 - .../web/compressed.tracemonkey-pldi-09.pdf | Bin 1016315 -> 0 bytes static/js/pdf-js/web/debugger.css | 113 - static/js/pdf-js/web/debugger.js | 612 - static/js/pdf-js/web/images/loading-dark.svg | 24 - .../images/toolbarButton-editorFreeText.svg | 3 - .../pdf-js/web/locale/ach/viewer.properties | 200 - .../js/pdf-js/web/locale/af/viewer.properties | 177 - .../js/pdf-js/web/locale/an/viewer.properties | 243 - .../js/pdf-js/web/locale/ar/viewer.properties | 247 - .../pdf-js/web/locale/ast/viewer.properties | 207 - .../js/pdf-js/web/locale/az/viewer.properties | 243 - .../js/pdf-js/web/locale/be/viewer.properties | 277 - .../js/pdf-js/web/locale/bg/viewer.properties | 235 - .../js/pdf-js/web/locale/bn/viewer.properties | 239 - .../js/pdf-js/web/locale/bo/viewer.properties | 238 - .../js/pdf-js/web/locale/br/viewer.properties | 247 - .../pdf-js/web/locale/brx/viewer.properties | 205 - .../js/pdf-js/web/locale/bs/viewer.properties | 194 - .../js/pdf-js/web/locale/ca/viewer.properties | 251 - .../pdf-js/web/locale/cak/viewer.properties | 249 - .../pdf-js/web/locale/ckb/viewer.properties | 234 - .../js/pdf-js/web/locale/cs/viewer.properties | 277 - .../js/pdf-js/web/locale/cy/viewer.properties | 277 - .../js/pdf-js/web/locale/da/viewer.properties | 277 - .../js/pdf-js/web/locale/de/viewer.properties | 277 - .../pdf-js/web/locale/dsb/viewer.properties | 274 - .../js/pdf-js/web/locale/el/viewer.properties | 278 - .../pdf-js/web/locale/en-CA/viewer.properties | 274 - .../pdf-js/web/locale/en-GB/viewer.properties | 277 - .../pdf-js/web/locale/en-US/viewer.properties | 252 - .../js/pdf-js/web/locale/eo/viewer.properties | 274 - .../pdf-js/web/locale/es-AR/viewer.properties | 277 - .../pdf-js/web/locale/es-CL/viewer.properties | 277 - .../pdf-js/web/locale/es-ES/viewer.properties | 277 - .../pdf-js/web/locale/es-MX/viewer.properties | 277 - .../js/pdf-js/web/locale/et/viewer.properties | 262 - .../js/pdf-js/web/locale/eu/viewer.properties | 277 - .../js/pdf-js/web/locale/fa/viewer.properties | 216 - .../js/pdf-js/web/locale/ff/viewer.properties | 235 - .../js/pdf-js/web/locale/fi/viewer.properties | 274 - .../js/pdf-js/web/locale/fr/viewer.properties | 277 - .../pdf-js/web/locale/fur/viewer.properties | 277 - .../pdf-js/web/locale/fy-NL/viewer.properties | 277 - .../pdf-js/web/locale/ga-IE/viewer.properties | 202 - .../js/pdf-js/web/locale/gd/viewer.properties | 249 - .../js/pdf-js/web/locale/gl/viewer.properties | 249 - .../js/pdf-js/web/locale/gn/viewer.properties | 279 - .../pdf-js/web/locale/gu-IN/viewer.properties | 235 - .../js/pdf-js/web/locale/he/viewer.properties | 276 - .../pdf-js/web/locale/hi-IN/viewer.properties | 235 - .../js/pdf-js/web/locale/hr/viewer.properties | 267 - .../pdf-js/web/locale/hsb/viewer.properties | 279 - .../js/pdf-js/web/locale/hu/viewer.properties | 277 - .../pdf-js/web/locale/hy-AM/viewer.properties | 239 - .../pdf-js/web/locale/hye/viewer.properties | 252 - .../js/pdf-js/web/locale/ia/viewer.properties | 277 - .../js/pdf-js/web/locale/id/viewer.properties | 277 - .../js/pdf-js/web/locale/is/viewer.properties | 277 - .../js/pdf-js/web/locale/it/viewer.properties | 217 - .../js/pdf-js/web/locale/ja/viewer.properties | 277 - .../js/pdf-js/web/locale/ka/viewer.properties | 277 - .../pdf-js/web/locale/kab/viewer.properties | 274 - .../js/pdf-js/web/locale/kk/viewer.properties | 277 - .../js/pdf-js/web/locale/km/viewer.properties | 210 - .../js/pdf-js/web/locale/kn/viewer.properties | 187 - .../js/pdf-js/web/locale/ko/viewer.properties | 277 - .../pdf-js/web/locale/lij/viewer.properties | 235 - .../js/pdf-js/web/locale/lo/viewer.properties | 145 - static/js/pdf-js/web/locale/locale.properties | 333 - .../js/pdf-js/web/locale/lt/viewer.properties | 260 - .../pdf-js/web/locale/ltg/viewer.properties | 213 - .../js/pdf-js/web/locale/lv/viewer.properties | 235 - .../pdf-js/web/locale/meh/viewer.properties | 111 - .../js/pdf-js/web/locale/mk/viewer.properties | 139 - .../js/pdf-js/web/locale/mr/viewer.properties | 231 - .../js/pdf-js/web/locale/ms/viewer.properties | 235 - .../js/pdf-js/web/locale/my/viewer.properties | 191 - .../pdf-js/web/locale/nb-NO/viewer.properties | 277 - .../pdf-js/web/locale/ne-NP/viewer.properties | 218 - .../js/pdf-js/web/locale/nl/viewer.properties | 277 - .../pdf-js/web/locale/nn-NO/viewer.properties | 277 - .../js/pdf-js/web/locale/oc/viewer.properties | 277 - .../pdf-js/web/locale/pa-IN/viewer.properties | 277 - .../js/pdf-js/web/locale/pl/viewer.properties | 277 - .../pdf-js/web/locale/pt-BR/viewer.properties | 277 - .../pdf-js/web/locale/pt-PT/viewer.properties | 277 - .../js/pdf-js/web/locale/rm/viewer.properties | 277 - .../js/pdf-js/web/locale/ro/viewer.properties | 241 - .../js/pdf-js/web/locale/ru/viewer.properties | 277 - .../pdf-js/web/locale/sat/viewer.properties | 198 - .../js/pdf-js/web/locale/sc/viewer.properties | 261 - .../pdf-js/web/locale/scn/viewer.properties | 101 - .../pdf-js/web/locale/sco/viewer.properties | 249 - .../js/pdf-js/web/locale/si/viewer.properties | 237 - .../js/pdf-js/web/locale/sk/viewer.properties | 277 - .../pdf-js/web/locale/skr/viewer.properties | 277 - .../js/pdf-js/web/locale/sl/viewer.properties | 277 - .../pdf-js/web/locale/son/viewer.properties | 173 - .../js/pdf-js/web/locale/sq/viewer.properties | 271 - .../js/pdf-js/web/locale/sr/viewer.properties | 277 - .../pdf-js/web/locale/sv-SE/viewer.properties | 277 - .../pdf-js/web/locale/szl/viewer.properties | 245 - .../js/pdf-js/web/locale/ta/viewer.properties | 194 - .../js/pdf-js/web/locale/te/viewer.properties | 237 - .../js/pdf-js/web/locale/tg/viewer.properties | 276 - .../js/pdf-js/web/locale/th/viewer.properties | 276 - .../js/pdf-js/web/locale/tl/viewer.properties | 243 - .../js/pdf-js/web/locale/tr/viewer.properties | 276 - .../pdf-js/web/locale/trs/viewer.properties | 206 - .../js/pdf-js/web/locale/uk/viewer.properties | 277 - .../js/pdf-js/web/locale/ur/viewer.properties | 239 - .../js/pdf-js/web/locale/uz/viewer.properties | 163 - .../js/pdf-js/web/locale/vi/viewer.properties | 277 - .../js/pdf-js/web/locale/wo/viewer.properties | 123 - .../js/pdf-js/web/locale/xh/viewer.properties | 177 - .../pdf-js/web/locale/zh-CN/viewer.properties | 277 - .../pdf-js/web/locale/zh-TW/viewer.properties | 277 - .../pdf-js/web/standard_fonts/FoxitSans.pfb | Bin 15025 -> 0 bytes .../web/standard_fonts/FoxitSansBold.pfb | Bin 16344 -> 0 bytes .../standard_fonts/FoxitSansBoldItalic.pfb | Bin 16418 -> 0 bytes .../web/standard_fonts/FoxitSansItalic.pfb | Bin 16339 -> 0 bytes static/js/pdf-js/web/viewer.css | 2692 - static/js/pdf-js/web/viewer.html | 433 - static/js/pdf-js/web/viewer.js | 13912 --- static/js/pdf-js/web/viewer.js.map | 1 - static/js/{pdf-js => pdf.js}/LICENSE | 0 static/js/pdf.js/build/pdf.mjs | 25496 +++++ static/js/pdf.js/build/pdf.mjs.map | 1 + static/js/pdf.js/build/pdf.sandbox.mjs | 3829 + static/js/pdf.js/build/pdf.sandbox.mjs.map | 1 + .../build/pdf.worker.mjs} | 82365 ++++++++-------- static/js/pdf.js/build/pdf.worker.mjs.map | 1 + .../web/cmaps/78-EUC-H.bcmap | Bin .../web/cmaps/78-EUC-V.bcmap | Bin .../{pdf-js => pdf.js}/web/cmaps/78-H.bcmap | Bin .../web/cmaps/78-RKSJ-H.bcmap | Bin .../web/cmaps/78-RKSJ-V.bcmap | Bin .../{pdf-js => pdf.js}/web/cmaps/78-V.bcmap | Bin .../web/cmaps/78ms-RKSJ-H.bcmap | Bin .../web/cmaps/78ms-RKSJ-V.bcmap | Bin .../web/cmaps/83pv-RKSJ-H.bcmap | Bin .../web/cmaps/90ms-RKSJ-H.bcmap | Bin .../web/cmaps/90ms-RKSJ-V.bcmap | Bin .../web/cmaps/90msp-RKSJ-H.bcmap | Bin .../web/cmaps/90msp-RKSJ-V.bcmap | Bin .../web/cmaps/90pv-RKSJ-H.bcmap | Bin .../web/cmaps/90pv-RKSJ-V.bcmap | Bin .../{pdf-js => pdf.js}/web/cmaps/Add-H.bcmap | Bin .../web/cmaps/Add-RKSJ-H.bcmap | Bin .../web/cmaps/Add-RKSJ-V.bcmap | Bin .../{pdf-js => pdf.js}/web/cmaps/Add-V.bcmap | Bin .../web/cmaps/Adobe-CNS1-0.bcmap | Bin .../web/cmaps/Adobe-CNS1-1.bcmap | Bin .../web/cmaps/Adobe-CNS1-2.bcmap | Bin .../web/cmaps/Adobe-CNS1-3.bcmap | Bin .../web/cmaps/Adobe-CNS1-4.bcmap | Bin .../web/cmaps/Adobe-CNS1-5.bcmap | Bin .../web/cmaps/Adobe-CNS1-6.bcmap | Bin .../web/cmaps/Adobe-CNS1-UCS2.bcmap | Bin .../web/cmaps/Adobe-GB1-0.bcmap | Bin .../web/cmaps/Adobe-GB1-1.bcmap | Bin .../web/cmaps/Adobe-GB1-2.bcmap | Bin .../web/cmaps/Adobe-GB1-3.bcmap | Bin .../web/cmaps/Adobe-GB1-4.bcmap | Bin .../web/cmaps/Adobe-GB1-5.bcmap | Bin .../web/cmaps/Adobe-GB1-UCS2.bcmap | Bin .../web/cmaps/Adobe-Japan1-0.bcmap | Bin .../web/cmaps/Adobe-Japan1-1.bcmap | Bin .../web/cmaps/Adobe-Japan1-2.bcmap | Bin .../web/cmaps/Adobe-Japan1-3.bcmap | Bin .../web/cmaps/Adobe-Japan1-4.bcmap | Bin .../web/cmaps/Adobe-Japan1-5.bcmap | Bin .../web/cmaps/Adobe-Japan1-6.bcmap | Bin .../web/cmaps/Adobe-Japan1-UCS2.bcmap | Bin .../web/cmaps/Adobe-Korea1-0.bcmap | Bin .../web/cmaps/Adobe-Korea1-1.bcmap | Bin .../web/cmaps/Adobe-Korea1-2.bcmap | Bin .../web/cmaps/Adobe-Korea1-UCS2.bcmap | Bin .../{pdf-js => pdf.js}/web/cmaps/B5-H.bcmap | Bin .../{pdf-js => pdf.js}/web/cmaps/B5-V.bcmap | Bin .../{pdf-js => pdf.js}/web/cmaps/B5pc-H.bcmap | Bin .../{pdf-js => pdf.js}/web/cmaps/B5pc-V.bcmap | Bin .../web/cmaps/CNS-EUC-H.bcmap | Bin .../web/cmaps/CNS-EUC-V.bcmap | Bin .../{pdf-js => pdf.js}/web/cmaps/CNS1-H.bcmap | Bin .../{pdf-js => pdf.js}/web/cmaps/CNS1-V.bcmap | Bin .../{pdf-js => pdf.js}/web/cmaps/CNS2-H.bcmap | Bin .../{pdf-js => pdf.js}/web/cmaps/CNS2-V.bcmap | 0 .../web/cmaps/ETHK-B5-H.bcmap | Bin .../web/cmaps/ETHK-B5-V.bcmap | Bin .../web/cmaps/ETen-B5-H.bcmap | Bin .../web/cmaps/ETen-B5-V.bcmap | Bin .../web/cmaps/ETenms-B5-H.bcmap | 0 .../web/cmaps/ETenms-B5-V.bcmap | Bin .../{pdf-js => pdf.js}/web/cmaps/EUC-H.bcmap | Bin .../{pdf-js => pdf.js}/web/cmaps/EUC-V.bcmap | Bin .../{pdf-js => pdf.js}/web/cmaps/Ext-H.bcmap | Bin .../web/cmaps/Ext-RKSJ-H.bcmap | Bin .../web/cmaps/Ext-RKSJ-V.bcmap | Bin .../{pdf-js => pdf.js}/web/cmaps/Ext-V.bcmap | Bin .../web/cmaps/GB-EUC-H.bcmap | Bin .../web/cmaps/GB-EUC-V.bcmap | Bin .../{pdf-js => pdf.js}/web/cmaps/GB-H.bcmap | 0 .../{pdf-js => pdf.js}/web/cmaps/GB-V.bcmap | Bin .../web/cmaps/GBK-EUC-H.bcmap | Bin .../web/cmaps/GBK-EUC-V.bcmap | Bin .../web/cmaps/GBK2K-H.bcmap | Bin .../web/cmaps/GBK2K-V.bcmap | Bin .../web/cmaps/GBKp-EUC-H.bcmap | Bin .../web/cmaps/GBKp-EUC-V.bcmap | Bin .../web/cmaps/GBT-EUC-H.bcmap | Bin .../web/cmaps/GBT-EUC-V.bcmap | Bin .../{pdf-js => pdf.js}/web/cmaps/GBT-H.bcmap | Bin .../{pdf-js => pdf.js}/web/cmaps/GBT-V.bcmap | Bin .../web/cmaps/GBTpc-EUC-H.bcmap | Bin .../web/cmaps/GBTpc-EUC-V.bcmap | Bin .../web/cmaps/GBpc-EUC-H.bcmap | Bin .../web/cmaps/GBpc-EUC-V.bcmap | Bin .../js/{pdf-js => pdf.js}/web/cmaps/H.bcmap | Bin .../web/cmaps/HKdla-B5-H.bcmap | Bin .../web/cmaps/HKdla-B5-V.bcmap | Bin .../web/cmaps/HKdlb-B5-H.bcmap | Bin .../web/cmaps/HKdlb-B5-V.bcmap | Bin .../web/cmaps/HKgccs-B5-H.bcmap | Bin .../web/cmaps/HKgccs-B5-V.bcmap | Bin .../web/cmaps/HKm314-B5-H.bcmap | Bin .../web/cmaps/HKm314-B5-V.bcmap | Bin .../web/cmaps/HKm471-B5-H.bcmap | Bin .../web/cmaps/HKm471-B5-V.bcmap | Bin .../web/cmaps/HKscs-B5-H.bcmap | Bin .../web/cmaps/HKscs-B5-V.bcmap | Bin .../web/cmaps/Hankaku.bcmap | Bin .../web/cmaps/Hiragana.bcmap | Bin .../web/cmaps/KSC-EUC-H.bcmap | Bin .../web/cmaps/KSC-EUC-V.bcmap | Bin .../{pdf-js => pdf.js}/web/cmaps/KSC-H.bcmap | Bin .../web/cmaps/KSC-Johab-H.bcmap | Bin .../web/cmaps/KSC-Johab-V.bcmap | Bin .../{pdf-js => pdf.js}/web/cmaps/KSC-V.bcmap | Bin .../web/cmaps/KSCms-UHC-H.bcmap | Bin .../web/cmaps/KSCms-UHC-HW-H.bcmap | Bin .../web/cmaps/KSCms-UHC-HW-V.bcmap | Bin .../web/cmaps/KSCms-UHC-V.bcmap | Bin .../web/cmaps/KSCpc-EUC-H.bcmap | Bin .../web/cmaps/KSCpc-EUC-V.bcmap | Bin .../web/cmaps/Katakana.bcmap | Bin .../js/{pdf-js => pdf.js}/web/cmaps/LICENSE | 0 .../{pdf-js => pdf.js}/web/cmaps/NWP-H.bcmap | Bin .../{pdf-js => pdf.js}/web/cmaps/NWP-V.bcmap | Bin .../{pdf-js => pdf.js}/web/cmaps/RKSJ-H.bcmap | Bin .../{pdf-js => pdf.js}/web/cmaps/RKSJ-V.bcmap | Bin .../{pdf-js => pdf.js}/web/cmaps/Roman.bcmap | Bin .../web/cmaps/UniCNS-UCS2-H.bcmap | Bin .../web/cmaps/UniCNS-UCS2-V.bcmap | Bin .../web/cmaps/UniCNS-UTF16-H.bcmap | Bin .../web/cmaps/UniCNS-UTF16-V.bcmap | Bin .../web/cmaps/UniCNS-UTF32-H.bcmap | Bin .../web/cmaps/UniCNS-UTF32-V.bcmap | Bin .../web/cmaps/UniCNS-UTF8-H.bcmap | Bin .../web/cmaps/UniCNS-UTF8-V.bcmap | Bin .../web/cmaps/UniGB-UCS2-H.bcmap | Bin .../web/cmaps/UniGB-UCS2-V.bcmap | Bin .../web/cmaps/UniGB-UTF16-H.bcmap | Bin .../web/cmaps/UniGB-UTF16-V.bcmap | Bin .../web/cmaps/UniGB-UTF32-H.bcmap | Bin .../web/cmaps/UniGB-UTF32-V.bcmap | Bin .../web/cmaps/UniGB-UTF8-H.bcmap | Bin .../web/cmaps/UniGB-UTF8-V.bcmap | Bin .../web/cmaps/UniJIS-UCS2-H.bcmap | Bin .../web/cmaps/UniJIS-UCS2-HW-H.bcmap | Bin .../web/cmaps/UniJIS-UCS2-HW-V.bcmap | Bin .../web/cmaps/UniJIS-UCS2-V.bcmap | Bin .../web/cmaps/UniJIS-UTF16-H.bcmap | Bin .../web/cmaps/UniJIS-UTF16-V.bcmap | Bin .../web/cmaps/UniJIS-UTF32-H.bcmap | Bin .../web/cmaps/UniJIS-UTF32-V.bcmap | Bin .../web/cmaps/UniJIS-UTF8-H.bcmap | Bin .../web/cmaps/UniJIS-UTF8-V.bcmap | Bin .../web/cmaps/UniJIS2004-UTF16-H.bcmap | Bin .../web/cmaps/UniJIS2004-UTF16-V.bcmap | Bin .../web/cmaps/UniJIS2004-UTF32-H.bcmap | Bin .../web/cmaps/UniJIS2004-UTF32-V.bcmap | Bin .../web/cmaps/UniJIS2004-UTF8-H.bcmap | Bin .../web/cmaps/UniJIS2004-UTF8-V.bcmap | Bin .../web/cmaps/UniJISPro-UCS2-HW-V.bcmap | Bin .../web/cmaps/UniJISPro-UCS2-V.bcmap | Bin .../web/cmaps/UniJISPro-UTF8-V.bcmap | Bin .../web/cmaps/UniJISX0213-UTF32-H.bcmap | Bin .../web/cmaps/UniJISX0213-UTF32-V.bcmap | Bin .../web/cmaps/UniJISX02132004-UTF32-H.bcmap | Bin .../web/cmaps/UniJISX02132004-UTF32-V.bcmap | Bin .../web/cmaps/UniKS-UCS2-H.bcmap | Bin .../web/cmaps/UniKS-UCS2-V.bcmap | Bin .../web/cmaps/UniKS-UTF16-H.bcmap | Bin .../web/cmaps/UniKS-UTF16-V.bcmap | Bin .../web/cmaps/UniKS-UTF32-H.bcmap | Bin .../web/cmaps/UniKS-UTF32-V.bcmap | Bin .../web/cmaps/UniKS-UTF8-H.bcmap | Bin .../web/cmaps/UniKS-UTF8-V.bcmap | Bin .../js/{pdf-js => pdf.js}/web/cmaps/V.bcmap | Bin .../web/cmaps/WP-Symbol.bcmap | Bin static/js/pdf.js/web/images/altText_add.svg | 3 + .../pdf.js/web/images/altText_disclaimer.svg | 3 + static/js/pdf.js/web/images/altText_done.svg | 3 + .../js/pdf.js/web/images/altText_spinner.svg | 30 + .../js/pdf.js/web/images/altText_warning.svg | 3 + .../web/images/annotation-check.svg | 0 .../web/images/annotation-comment.svg | 0 .../web/images/annotation-help.svg | 0 .../web/images/annotation-insert.svg | 0 .../web/images/annotation-key.svg | 0 .../web/images/annotation-newparagraph.svg | 0 .../web/images/annotation-noicon.svg | 0 .../web/images/annotation-note.svg | 0 .../web/images/annotation-paperclip.svg | 0 .../web/images/annotation-paragraph.svg | 0 .../web/images/annotation-pushpin.svg | 0 .../web/images/cursor-editorFreeHighlight.svg | 6 + .../web/images/cursor-editorFreeText.svg | 0 .../web/images/cursor-editorInk.svg | 0 .../web/images/cursor-editorTextHighlight.svg | 8 + .../web/images/editor-toolbar-delete.svg | 5 + .../web/images/findbarButton-next.svg | 0 .../web/images/findbarButton-previous.svg | 0 .../web/images/gv-toolbarButton-download.svg | 3 + .../web/images/loading-icon.gif | Bin .../{pdf-js => pdf.js}/web/images/loading.svg | 0 .../web/images/messageBar_closingButton.svg | 3 + .../pdf.js/web/images/messageBar_warning.svg | 3 + ...ondaryToolbarButton-documentProperties.svg | 0 .../secondaryToolbarButton-firstPage.svg | 0 .../secondaryToolbarButton-handTool.svg | 0 .../secondaryToolbarButton-lastPage.svg | 0 .../secondaryToolbarButton-rotateCcw.svg | 0 .../secondaryToolbarButton-rotateCw.svg | 0 ...econdaryToolbarButton-scrollHorizontal.svg | 0 .../secondaryToolbarButton-scrollPage.svg | 0 .../secondaryToolbarButton-scrollVertical.svg | 0 .../secondaryToolbarButton-scrollWrapped.svg | 0 .../secondaryToolbarButton-selectTool.svg | 0 .../secondaryToolbarButton-spreadEven.svg | 0 .../secondaryToolbarButton-spreadNone.svg | 0 .../secondaryToolbarButton-spreadOdd.svg | 0 .../web/images/toolbarButton-bookmark.svg | 0 .../toolbarButton-currentOutlineItem.svg | 0 .../web/images/toolbarButton-download.svg | 0 .../images/toolbarButton-editorFreeText.svg | 5 + .../images/toolbarButton-editorHighlight.svg | 6 + .../web/images/toolbarButton-editorInk.svg | 0 .../web/images/toolbarButton-editorStamp.svg | 8 + .../web/images/toolbarButton-menuArrow.svg | 0 .../web/images/toolbarButton-openFile.svg | 0 .../web/images/toolbarButton-pageDown.svg | 0 .../web/images/toolbarButton-pageUp.svg | 0 .../images/toolbarButton-presentationMode.svg | 0 .../web/images/toolbarButton-print.svg | 0 .../web/images/toolbarButton-search.svg | 0 .../toolbarButton-secondaryToolbarToggle.svg | 0 .../images/toolbarButton-sidebarToggle.svg | 0 .../images/toolbarButton-viewAttachments.svg | 0 .../web/images/toolbarButton-viewLayers.svg | 0 .../web/images/toolbarButton-viewOutline.svg | 0 .../images/toolbarButton-viewThumbnail.svg | 0 .../web/images/toolbarButton-zoomIn.svg | 0 .../web/images/toolbarButton-zoomOut.svg | 0 .../web/images/treeitem-collapsed.svg | 0 .../web/images/treeitem-expanded.svg | 0 static/js/pdf.js/web/locale/en-CA/viewer.ftl | 481 + static/js/pdf.js/web/locale/en-GB/viewer.ftl | 481 + static/js/pdf.js/web/locale/en-US/viewer.ftl | 505 + static/js/pdf.js/web/locale/locale.json | 1 + .../web/standard_fonts/FoxitDingbats.pfb | Bin .../web/standard_fonts/FoxitFixed.pfb | Bin .../web/standard_fonts/FoxitFixedBold.pfb | Bin .../standard_fonts/FoxitFixedBoldItalic.pfb | Bin .../web/standard_fonts/FoxitFixedItalic.pfb | Bin .../web/standard_fonts/FoxitSerif.pfb | Bin .../web/standard_fonts/FoxitSerifBold.pfb | Bin .../standard_fonts/FoxitSerifBoldItalic.pfb | Bin .../web/standard_fonts/FoxitSerifItalic.pfb | Bin .../web/standard_fonts/FoxitSymbol.pfb | Bin .../web/standard_fonts/LICENSE_FOXIT | 0 .../web/standard_fonts/LICENSE_LIBERATION | 0 .../standard_fonts/LiberationSans-Bold.ttf | Bin .../LiberationSans-BoldItalic.ttf | Bin .../standard_fonts/LiberationSans-Italic.ttf | Bin .../standard_fonts/LiberationSans-Regular.ttf | Bin 394 files changed, 70871 insertions(+), 104174 deletions(-) create mode 100644 static/css/pdfjs.css delete mode 100644 static/js/pdf-js/build/pdf.js delete mode 100644 static/js/pdf-js/build/pdf.js.map delete mode 100644 static/js/pdf-js/build/pdf.sandbox.js delete mode 100644 static/js/pdf-js/build/pdf.sandbox.js.map delete mode 100644 static/js/pdf-js/build/pdf.worker.js.map delete mode 100644 static/js/pdf-js/web/compressed.tracemonkey-pldi-09.pdf delete mode 100644 static/js/pdf-js/web/debugger.css delete mode 100644 static/js/pdf-js/web/debugger.js delete mode 100644 static/js/pdf-js/web/images/loading-dark.svg delete mode 100644 static/js/pdf-js/web/images/toolbarButton-editorFreeText.svg delete mode 100644 static/js/pdf-js/web/locale/ach/viewer.properties delete mode 100644 static/js/pdf-js/web/locale/af/viewer.properties delete mode 100644 static/js/pdf-js/web/locale/an/viewer.properties delete mode 100644 static/js/pdf-js/web/locale/ar/viewer.properties delete mode 100644 static/js/pdf-js/web/locale/ast/viewer.properties delete mode 100644 static/js/pdf-js/web/locale/az/viewer.properties delete mode 100644 static/js/pdf-js/web/locale/be/viewer.properties delete mode 100644 static/js/pdf-js/web/locale/bg/viewer.properties delete mode 100644 static/js/pdf-js/web/locale/bn/viewer.properties delete mode 100644 static/js/pdf-js/web/locale/bo/viewer.properties delete mode 100644 static/js/pdf-js/web/locale/br/viewer.properties delete mode 100644 static/js/pdf-js/web/locale/brx/viewer.properties delete mode 100644 static/js/pdf-js/web/locale/bs/viewer.properties delete mode 100644 static/js/pdf-js/web/locale/ca/viewer.properties delete mode 100644 static/js/pdf-js/web/locale/cak/viewer.properties delete mode 100644 static/js/pdf-js/web/locale/ckb/viewer.properties delete mode 100644 static/js/pdf-js/web/locale/cs/viewer.properties delete mode 100644 static/js/pdf-js/web/locale/cy/viewer.properties delete mode 100644 static/js/pdf-js/web/locale/da/viewer.properties delete mode 100644 static/js/pdf-js/web/locale/de/viewer.properties delete mode 100644 static/js/pdf-js/web/locale/dsb/viewer.properties delete mode 100644 static/js/pdf-js/web/locale/el/viewer.properties delete mode 100644 static/js/pdf-js/web/locale/en-CA/viewer.properties delete mode 100644 static/js/pdf-js/web/locale/en-GB/viewer.properties delete mode 100644 static/js/pdf-js/web/locale/en-US/viewer.properties delete mode 100644 static/js/pdf-js/web/locale/eo/viewer.properties delete mode 100644 static/js/pdf-js/web/locale/es-AR/viewer.properties delete mode 100644 static/js/pdf-js/web/locale/es-CL/viewer.properties delete mode 100644 static/js/pdf-js/web/locale/es-ES/viewer.properties delete mode 100644 static/js/pdf-js/web/locale/es-MX/viewer.properties delete mode 100644 static/js/pdf-js/web/locale/et/viewer.properties delete mode 100644 static/js/pdf-js/web/locale/eu/viewer.properties delete mode 100644 static/js/pdf-js/web/locale/fa/viewer.properties delete mode 100644 static/js/pdf-js/web/locale/ff/viewer.properties delete mode 100644 static/js/pdf-js/web/locale/fi/viewer.properties delete mode 100644 static/js/pdf-js/web/locale/fr/viewer.properties delete mode 100644 static/js/pdf-js/web/locale/fur/viewer.properties delete mode 100644 static/js/pdf-js/web/locale/fy-NL/viewer.properties delete mode 100644 static/js/pdf-js/web/locale/ga-IE/viewer.properties delete mode 100644 static/js/pdf-js/web/locale/gd/viewer.properties delete mode 100644 static/js/pdf-js/web/locale/gl/viewer.properties delete mode 100644 static/js/pdf-js/web/locale/gn/viewer.properties delete mode 100644 static/js/pdf-js/web/locale/gu-IN/viewer.properties delete mode 100644 static/js/pdf-js/web/locale/he/viewer.properties delete mode 100644 static/js/pdf-js/web/locale/hi-IN/viewer.properties delete mode 100644 static/js/pdf-js/web/locale/hr/viewer.properties delete mode 100644 static/js/pdf-js/web/locale/hsb/viewer.properties delete mode 100644 static/js/pdf-js/web/locale/hu/viewer.properties delete mode 100644 static/js/pdf-js/web/locale/hy-AM/viewer.properties delete mode 100644 static/js/pdf-js/web/locale/hye/viewer.properties delete mode 100644 static/js/pdf-js/web/locale/ia/viewer.properties delete mode 100644 static/js/pdf-js/web/locale/id/viewer.properties delete mode 100644 static/js/pdf-js/web/locale/is/viewer.properties delete mode 100644 static/js/pdf-js/web/locale/it/viewer.properties delete mode 100644 static/js/pdf-js/web/locale/ja/viewer.properties delete mode 100644 static/js/pdf-js/web/locale/ka/viewer.properties delete mode 100644 static/js/pdf-js/web/locale/kab/viewer.properties delete mode 100644 static/js/pdf-js/web/locale/kk/viewer.properties delete mode 100644 static/js/pdf-js/web/locale/km/viewer.properties delete mode 100644 static/js/pdf-js/web/locale/kn/viewer.properties delete mode 100644 static/js/pdf-js/web/locale/ko/viewer.properties delete mode 100644 static/js/pdf-js/web/locale/lij/viewer.properties delete mode 100644 static/js/pdf-js/web/locale/lo/viewer.properties delete mode 100644 static/js/pdf-js/web/locale/locale.properties delete mode 100644 static/js/pdf-js/web/locale/lt/viewer.properties delete mode 100644 static/js/pdf-js/web/locale/ltg/viewer.properties delete mode 100644 static/js/pdf-js/web/locale/lv/viewer.properties delete mode 100644 static/js/pdf-js/web/locale/meh/viewer.properties delete mode 100644 static/js/pdf-js/web/locale/mk/viewer.properties delete mode 100644 static/js/pdf-js/web/locale/mr/viewer.properties delete mode 100644 static/js/pdf-js/web/locale/ms/viewer.properties delete mode 100644 static/js/pdf-js/web/locale/my/viewer.properties delete mode 100644 static/js/pdf-js/web/locale/nb-NO/viewer.properties delete mode 100644 static/js/pdf-js/web/locale/ne-NP/viewer.properties delete mode 100644 static/js/pdf-js/web/locale/nl/viewer.properties delete mode 100644 static/js/pdf-js/web/locale/nn-NO/viewer.properties delete mode 100644 static/js/pdf-js/web/locale/oc/viewer.properties delete mode 100644 static/js/pdf-js/web/locale/pa-IN/viewer.properties delete mode 100644 static/js/pdf-js/web/locale/pl/viewer.properties delete mode 100644 static/js/pdf-js/web/locale/pt-BR/viewer.properties delete mode 100644 static/js/pdf-js/web/locale/pt-PT/viewer.properties delete mode 100644 static/js/pdf-js/web/locale/rm/viewer.properties delete mode 100644 static/js/pdf-js/web/locale/ro/viewer.properties delete mode 100644 static/js/pdf-js/web/locale/ru/viewer.properties delete mode 100644 static/js/pdf-js/web/locale/sat/viewer.properties delete mode 100644 static/js/pdf-js/web/locale/sc/viewer.properties delete mode 100644 static/js/pdf-js/web/locale/scn/viewer.properties delete mode 100644 static/js/pdf-js/web/locale/sco/viewer.properties delete mode 100644 static/js/pdf-js/web/locale/si/viewer.properties delete mode 100644 static/js/pdf-js/web/locale/sk/viewer.properties delete mode 100644 static/js/pdf-js/web/locale/skr/viewer.properties delete mode 100644 static/js/pdf-js/web/locale/sl/viewer.properties delete mode 100644 static/js/pdf-js/web/locale/son/viewer.properties delete mode 100644 static/js/pdf-js/web/locale/sq/viewer.properties delete mode 100644 static/js/pdf-js/web/locale/sr/viewer.properties delete mode 100644 static/js/pdf-js/web/locale/sv-SE/viewer.properties delete mode 100644 static/js/pdf-js/web/locale/szl/viewer.properties delete mode 100644 static/js/pdf-js/web/locale/ta/viewer.properties delete mode 100644 static/js/pdf-js/web/locale/te/viewer.properties delete mode 100644 static/js/pdf-js/web/locale/tg/viewer.properties delete mode 100644 static/js/pdf-js/web/locale/th/viewer.properties delete mode 100644 static/js/pdf-js/web/locale/tl/viewer.properties delete mode 100644 static/js/pdf-js/web/locale/tr/viewer.properties delete mode 100644 static/js/pdf-js/web/locale/trs/viewer.properties delete mode 100644 static/js/pdf-js/web/locale/uk/viewer.properties delete mode 100644 static/js/pdf-js/web/locale/ur/viewer.properties delete mode 100644 static/js/pdf-js/web/locale/uz/viewer.properties delete mode 100644 static/js/pdf-js/web/locale/vi/viewer.properties delete mode 100644 static/js/pdf-js/web/locale/wo/viewer.properties delete mode 100644 static/js/pdf-js/web/locale/xh/viewer.properties delete mode 100644 static/js/pdf-js/web/locale/zh-CN/viewer.properties delete mode 100644 static/js/pdf-js/web/locale/zh-TW/viewer.properties delete mode 100644 static/js/pdf-js/web/standard_fonts/FoxitSans.pfb delete mode 100644 static/js/pdf-js/web/standard_fonts/FoxitSansBold.pfb delete mode 100644 static/js/pdf-js/web/standard_fonts/FoxitSansBoldItalic.pfb delete mode 100644 static/js/pdf-js/web/standard_fonts/FoxitSansItalic.pfb delete mode 100644 static/js/pdf-js/web/viewer.css delete mode 100644 static/js/pdf-js/web/viewer.html delete mode 100644 static/js/pdf-js/web/viewer.js delete mode 100644 static/js/pdf-js/web/viewer.js.map rename static/js/{pdf-js => pdf.js}/LICENSE (100%) create mode 100644 static/js/pdf.js/build/pdf.mjs create mode 100644 static/js/pdf.js/build/pdf.mjs.map create mode 100644 static/js/pdf.js/build/pdf.sandbox.mjs create mode 100644 static/js/pdf.js/build/pdf.sandbox.mjs.map rename static/js/{pdf-js/build/pdf.worker.js => pdf.js/build/pdf.worker.mjs} (59%) create mode 100644 static/js/pdf.js/build/pdf.worker.mjs.map rename static/js/{pdf-js => pdf.js}/web/cmaps/78-EUC-H.bcmap (100%) rename static/js/{pdf-js => pdf.js}/web/cmaps/78-EUC-V.bcmap (100%) rename static/js/{pdf-js => pdf.js}/web/cmaps/78-H.bcmap (100%) rename static/js/{pdf-js => pdf.js}/web/cmaps/78-RKSJ-H.bcmap (100%) rename static/js/{pdf-js => pdf.js}/web/cmaps/78-RKSJ-V.bcmap (100%) rename static/js/{pdf-js => pdf.js}/web/cmaps/78-V.bcmap (100%) rename static/js/{pdf-js => pdf.js}/web/cmaps/78ms-RKSJ-H.bcmap (100%) rename static/js/{pdf-js => pdf.js}/web/cmaps/78ms-RKSJ-V.bcmap (100%) rename static/js/{pdf-js => pdf.js}/web/cmaps/83pv-RKSJ-H.bcmap (100%) rename static/js/{pdf-js => pdf.js}/web/cmaps/90ms-RKSJ-H.bcmap (100%) rename static/js/{pdf-js => pdf.js}/web/cmaps/90ms-RKSJ-V.bcmap (100%) rename static/js/{pdf-js => pdf.js}/web/cmaps/90msp-RKSJ-H.bcmap (100%) rename static/js/{pdf-js => pdf.js}/web/cmaps/90msp-RKSJ-V.bcmap (100%) rename static/js/{pdf-js => pdf.js}/web/cmaps/90pv-RKSJ-H.bcmap (100%) rename static/js/{pdf-js => pdf.js}/web/cmaps/90pv-RKSJ-V.bcmap (100%) rename static/js/{pdf-js => pdf.js}/web/cmaps/Add-H.bcmap (100%) rename static/js/{pdf-js => pdf.js}/web/cmaps/Add-RKSJ-H.bcmap (100%) rename static/js/{pdf-js => pdf.js}/web/cmaps/Add-RKSJ-V.bcmap (100%) rename static/js/{pdf-js => pdf.js}/web/cmaps/Add-V.bcmap (100%) rename static/js/{pdf-js => pdf.js}/web/cmaps/Adobe-CNS1-0.bcmap (100%) rename static/js/{pdf-js => pdf.js}/web/cmaps/Adobe-CNS1-1.bcmap (100%) rename static/js/{pdf-js => pdf.js}/web/cmaps/Adobe-CNS1-2.bcmap (100%) rename static/js/{pdf-js => pdf.js}/web/cmaps/Adobe-CNS1-3.bcmap (100%) rename static/js/{pdf-js => pdf.js}/web/cmaps/Adobe-CNS1-4.bcmap (100%) rename static/js/{pdf-js => pdf.js}/web/cmaps/Adobe-CNS1-5.bcmap (100%) rename static/js/{pdf-js => pdf.js}/web/cmaps/Adobe-CNS1-6.bcmap (100%) rename static/js/{pdf-js => pdf.js}/web/cmaps/Adobe-CNS1-UCS2.bcmap (100%) rename static/js/{pdf-js => pdf.js}/web/cmaps/Adobe-GB1-0.bcmap (100%) rename static/js/{pdf-js => pdf.js}/web/cmaps/Adobe-GB1-1.bcmap (100%) rename static/js/{pdf-js => pdf.js}/web/cmaps/Adobe-GB1-2.bcmap (100%) rename static/js/{pdf-js => pdf.js}/web/cmaps/Adobe-GB1-3.bcmap (100%) rename static/js/{pdf-js => pdf.js}/web/cmaps/Adobe-GB1-4.bcmap (100%) rename static/js/{pdf-js => pdf.js}/web/cmaps/Adobe-GB1-5.bcmap (100%) rename static/js/{pdf-js => pdf.js}/web/cmaps/Adobe-GB1-UCS2.bcmap (100%) rename static/js/{pdf-js => pdf.js}/web/cmaps/Adobe-Japan1-0.bcmap (100%) rename static/js/{pdf-js => pdf.js}/web/cmaps/Adobe-Japan1-1.bcmap (100%) rename static/js/{pdf-js => pdf.js}/web/cmaps/Adobe-Japan1-2.bcmap (100%) rename static/js/{pdf-js => pdf.js}/web/cmaps/Adobe-Japan1-3.bcmap (100%) rename static/js/{pdf-js => pdf.js}/web/cmaps/Adobe-Japan1-4.bcmap (100%) rename static/js/{pdf-js => pdf.js}/web/cmaps/Adobe-Japan1-5.bcmap (100%) rename static/js/{pdf-js => pdf.js}/web/cmaps/Adobe-Japan1-6.bcmap (100%) rename static/js/{pdf-js => pdf.js}/web/cmaps/Adobe-Japan1-UCS2.bcmap (100%) rename static/js/{pdf-js => pdf.js}/web/cmaps/Adobe-Korea1-0.bcmap (100%) rename static/js/{pdf-js => pdf.js}/web/cmaps/Adobe-Korea1-1.bcmap (100%) rename static/js/{pdf-js => pdf.js}/web/cmaps/Adobe-Korea1-2.bcmap (100%) rename static/js/{pdf-js => pdf.js}/web/cmaps/Adobe-Korea1-UCS2.bcmap (100%) rename static/js/{pdf-js => pdf.js}/web/cmaps/B5-H.bcmap (100%) rename static/js/{pdf-js => pdf.js}/web/cmaps/B5-V.bcmap (100%) rename static/js/{pdf-js => pdf.js}/web/cmaps/B5pc-H.bcmap (100%) rename static/js/{pdf-js => pdf.js}/web/cmaps/B5pc-V.bcmap (100%) rename static/js/{pdf-js => pdf.js}/web/cmaps/CNS-EUC-H.bcmap (100%) rename static/js/{pdf-js => pdf.js}/web/cmaps/CNS-EUC-V.bcmap (100%) rename static/js/{pdf-js => pdf.js}/web/cmaps/CNS1-H.bcmap (100%) rename static/js/{pdf-js => pdf.js}/web/cmaps/CNS1-V.bcmap (100%) rename static/js/{pdf-js => pdf.js}/web/cmaps/CNS2-H.bcmap (100%) rename static/js/{pdf-js => pdf.js}/web/cmaps/CNS2-V.bcmap (100%) rename static/js/{pdf-js => pdf.js}/web/cmaps/ETHK-B5-H.bcmap (100%) rename static/js/{pdf-js => pdf.js}/web/cmaps/ETHK-B5-V.bcmap (100%) rename static/js/{pdf-js => pdf.js}/web/cmaps/ETen-B5-H.bcmap (100%) rename static/js/{pdf-js => pdf.js}/web/cmaps/ETen-B5-V.bcmap (100%) rename static/js/{pdf-js => pdf.js}/web/cmaps/ETenms-B5-H.bcmap (100%) rename static/js/{pdf-js => pdf.js}/web/cmaps/ETenms-B5-V.bcmap (100%) rename static/js/{pdf-js => pdf.js}/web/cmaps/EUC-H.bcmap (100%) rename static/js/{pdf-js => pdf.js}/web/cmaps/EUC-V.bcmap (100%) rename static/js/{pdf-js => pdf.js}/web/cmaps/Ext-H.bcmap (100%) rename static/js/{pdf-js => pdf.js}/web/cmaps/Ext-RKSJ-H.bcmap (100%) rename static/js/{pdf-js => pdf.js}/web/cmaps/Ext-RKSJ-V.bcmap (100%) rename static/js/{pdf-js => pdf.js}/web/cmaps/Ext-V.bcmap (100%) rename static/js/{pdf-js => pdf.js}/web/cmaps/GB-EUC-H.bcmap (100%) rename static/js/{pdf-js => pdf.js}/web/cmaps/GB-EUC-V.bcmap (100%) rename static/js/{pdf-js => pdf.js}/web/cmaps/GB-H.bcmap (100%) rename static/js/{pdf-js => pdf.js}/web/cmaps/GB-V.bcmap (100%) rename static/js/{pdf-js => pdf.js}/web/cmaps/GBK-EUC-H.bcmap (100%) rename static/js/{pdf-js => pdf.js}/web/cmaps/GBK-EUC-V.bcmap (100%) rename static/js/{pdf-js => pdf.js}/web/cmaps/GBK2K-H.bcmap (100%) rename static/js/{pdf-js => pdf.js}/web/cmaps/GBK2K-V.bcmap (100%) rename static/js/{pdf-js => pdf.js}/web/cmaps/GBKp-EUC-H.bcmap (100%) rename static/js/{pdf-js => pdf.js}/web/cmaps/GBKp-EUC-V.bcmap (100%) rename static/js/{pdf-js => pdf.js}/web/cmaps/GBT-EUC-H.bcmap (100%) rename static/js/{pdf-js => pdf.js}/web/cmaps/GBT-EUC-V.bcmap (100%) rename static/js/{pdf-js => pdf.js}/web/cmaps/GBT-H.bcmap (100%) rename static/js/{pdf-js => pdf.js}/web/cmaps/GBT-V.bcmap (100%) rename static/js/{pdf-js => pdf.js}/web/cmaps/GBTpc-EUC-H.bcmap (100%) rename static/js/{pdf-js => pdf.js}/web/cmaps/GBTpc-EUC-V.bcmap (100%) rename static/js/{pdf-js => pdf.js}/web/cmaps/GBpc-EUC-H.bcmap (100%) rename static/js/{pdf-js => pdf.js}/web/cmaps/GBpc-EUC-V.bcmap (100%) rename static/js/{pdf-js => pdf.js}/web/cmaps/H.bcmap (100%) rename static/js/{pdf-js => pdf.js}/web/cmaps/HKdla-B5-H.bcmap (100%) rename static/js/{pdf-js => pdf.js}/web/cmaps/HKdla-B5-V.bcmap (100%) rename static/js/{pdf-js => pdf.js}/web/cmaps/HKdlb-B5-H.bcmap (100%) rename static/js/{pdf-js => pdf.js}/web/cmaps/HKdlb-B5-V.bcmap (100%) rename static/js/{pdf-js => pdf.js}/web/cmaps/HKgccs-B5-H.bcmap (100%) rename static/js/{pdf-js => pdf.js}/web/cmaps/HKgccs-B5-V.bcmap (100%) rename static/js/{pdf-js => pdf.js}/web/cmaps/HKm314-B5-H.bcmap (100%) rename static/js/{pdf-js => pdf.js}/web/cmaps/HKm314-B5-V.bcmap (100%) rename static/js/{pdf-js => pdf.js}/web/cmaps/HKm471-B5-H.bcmap (100%) rename static/js/{pdf-js => pdf.js}/web/cmaps/HKm471-B5-V.bcmap (100%) rename static/js/{pdf-js => pdf.js}/web/cmaps/HKscs-B5-H.bcmap (100%) rename static/js/{pdf-js => pdf.js}/web/cmaps/HKscs-B5-V.bcmap (100%) rename static/js/{pdf-js => pdf.js}/web/cmaps/Hankaku.bcmap (100%) rename static/js/{pdf-js => pdf.js}/web/cmaps/Hiragana.bcmap (100%) rename static/js/{pdf-js => pdf.js}/web/cmaps/KSC-EUC-H.bcmap (100%) rename static/js/{pdf-js => pdf.js}/web/cmaps/KSC-EUC-V.bcmap (100%) rename static/js/{pdf-js => pdf.js}/web/cmaps/KSC-H.bcmap (100%) rename static/js/{pdf-js => pdf.js}/web/cmaps/KSC-Johab-H.bcmap (100%) rename static/js/{pdf-js => pdf.js}/web/cmaps/KSC-Johab-V.bcmap (100%) rename static/js/{pdf-js => pdf.js}/web/cmaps/KSC-V.bcmap (100%) rename static/js/{pdf-js => pdf.js}/web/cmaps/KSCms-UHC-H.bcmap (100%) rename static/js/{pdf-js => pdf.js}/web/cmaps/KSCms-UHC-HW-H.bcmap (100%) rename static/js/{pdf-js => pdf.js}/web/cmaps/KSCms-UHC-HW-V.bcmap (100%) rename static/js/{pdf-js => pdf.js}/web/cmaps/KSCms-UHC-V.bcmap (100%) rename static/js/{pdf-js => pdf.js}/web/cmaps/KSCpc-EUC-H.bcmap (100%) rename static/js/{pdf-js => pdf.js}/web/cmaps/KSCpc-EUC-V.bcmap (100%) rename static/js/{pdf-js => pdf.js}/web/cmaps/Katakana.bcmap (100%) rename static/js/{pdf-js => pdf.js}/web/cmaps/LICENSE (100%) rename static/js/{pdf-js => pdf.js}/web/cmaps/NWP-H.bcmap (100%) rename static/js/{pdf-js => pdf.js}/web/cmaps/NWP-V.bcmap (100%) rename static/js/{pdf-js => pdf.js}/web/cmaps/RKSJ-H.bcmap (100%) rename static/js/{pdf-js => pdf.js}/web/cmaps/RKSJ-V.bcmap (100%) rename static/js/{pdf-js => pdf.js}/web/cmaps/Roman.bcmap (100%) rename static/js/{pdf-js => pdf.js}/web/cmaps/UniCNS-UCS2-H.bcmap (100%) rename static/js/{pdf-js => pdf.js}/web/cmaps/UniCNS-UCS2-V.bcmap (100%) rename static/js/{pdf-js => pdf.js}/web/cmaps/UniCNS-UTF16-H.bcmap (100%) rename static/js/{pdf-js => pdf.js}/web/cmaps/UniCNS-UTF16-V.bcmap (100%) rename static/js/{pdf-js => pdf.js}/web/cmaps/UniCNS-UTF32-H.bcmap (100%) rename static/js/{pdf-js => pdf.js}/web/cmaps/UniCNS-UTF32-V.bcmap (100%) rename static/js/{pdf-js => pdf.js}/web/cmaps/UniCNS-UTF8-H.bcmap (100%) rename static/js/{pdf-js => pdf.js}/web/cmaps/UniCNS-UTF8-V.bcmap (100%) rename static/js/{pdf-js => pdf.js}/web/cmaps/UniGB-UCS2-H.bcmap (100%) rename static/js/{pdf-js => pdf.js}/web/cmaps/UniGB-UCS2-V.bcmap (100%) rename static/js/{pdf-js => pdf.js}/web/cmaps/UniGB-UTF16-H.bcmap (100%) rename static/js/{pdf-js => pdf.js}/web/cmaps/UniGB-UTF16-V.bcmap (100%) rename static/js/{pdf-js => pdf.js}/web/cmaps/UniGB-UTF32-H.bcmap (100%) rename static/js/{pdf-js => pdf.js}/web/cmaps/UniGB-UTF32-V.bcmap (100%) rename static/js/{pdf-js => pdf.js}/web/cmaps/UniGB-UTF8-H.bcmap (100%) rename static/js/{pdf-js => pdf.js}/web/cmaps/UniGB-UTF8-V.bcmap (100%) rename static/js/{pdf-js => pdf.js}/web/cmaps/UniJIS-UCS2-H.bcmap (100%) rename static/js/{pdf-js => pdf.js}/web/cmaps/UniJIS-UCS2-HW-H.bcmap (100%) rename static/js/{pdf-js => pdf.js}/web/cmaps/UniJIS-UCS2-HW-V.bcmap (100%) rename static/js/{pdf-js => pdf.js}/web/cmaps/UniJIS-UCS2-V.bcmap (100%) rename static/js/{pdf-js => pdf.js}/web/cmaps/UniJIS-UTF16-H.bcmap (100%) rename static/js/{pdf-js => pdf.js}/web/cmaps/UniJIS-UTF16-V.bcmap (100%) rename static/js/{pdf-js => pdf.js}/web/cmaps/UniJIS-UTF32-H.bcmap (100%) rename static/js/{pdf-js => pdf.js}/web/cmaps/UniJIS-UTF32-V.bcmap (100%) rename static/js/{pdf-js => pdf.js}/web/cmaps/UniJIS-UTF8-H.bcmap (100%) rename static/js/{pdf-js => pdf.js}/web/cmaps/UniJIS-UTF8-V.bcmap (100%) rename static/js/{pdf-js => pdf.js}/web/cmaps/UniJIS2004-UTF16-H.bcmap (100%) rename static/js/{pdf-js => pdf.js}/web/cmaps/UniJIS2004-UTF16-V.bcmap (100%) rename static/js/{pdf-js => pdf.js}/web/cmaps/UniJIS2004-UTF32-H.bcmap (100%) rename static/js/{pdf-js => pdf.js}/web/cmaps/UniJIS2004-UTF32-V.bcmap (100%) rename static/js/{pdf-js => pdf.js}/web/cmaps/UniJIS2004-UTF8-H.bcmap (100%) rename static/js/{pdf-js => pdf.js}/web/cmaps/UniJIS2004-UTF8-V.bcmap (100%) rename static/js/{pdf-js => pdf.js}/web/cmaps/UniJISPro-UCS2-HW-V.bcmap (100%) rename static/js/{pdf-js => pdf.js}/web/cmaps/UniJISPro-UCS2-V.bcmap (100%) rename static/js/{pdf-js => pdf.js}/web/cmaps/UniJISPro-UTF8-V.bcmap (100%) rename static/js/{pdf-js => pdf.js}/web/cmaps/UniJISX0213-UTF32-H.bcmap (100%) rename static/js/{pdf-js => pdf.js}/web/cmaps/UniJISX0213-UTF32-V.bcmap (100%) rename static/js/{pdf-js => pdf.js}/web/cmaps/UniJISX02132004-UTF32-H.bcmap (100%) rename static/js/{pdf-js => pdf.js}/web/cmaps/UniJISX02132004-UTF32-V.bcmap (100%) rename static/js/{pdf-js => pdf.js}/web/cmaps/UniKS-UCS2-H.bcmap (100%) rename static/js/{pdf-js => pdf.js}/web/cmaps/UniKS-UCS2-V.bcmap (100%) rename static/js/{pdf-js => pdf.js}/web/cmaps/UniKS-UTF16-H.bcmap (100%) rename static/js/{pdf-js => pdf.js}/web/cmaps/UniKS-UTF16-V.bcmap (100%) rename static/js/{pdf-js => pdf.js}/web/cmaps/UniKS-UTF32-H.bcmap (100%) rename static/js/{pdf-js => pdf.js}/web/cmaps/UniKS-UTF32-V.bcmap (100%) rename static/js/{pdf-js => pdf.js}/web/cmaps/UniKS-UTF8-H.bcmap (100%) rename static/js/{pdf-js => pdf.js}/web/cmaps/UniKS-UTF8-V.bcmap (100%) rename static/js/{pdf-js => pdf.js}/web/cmaps/V.bcmap (100%) rename static/js/{pdf-js => pdf.js}/web/cmaps/WP-Symbol.bcmap (100%) create mode 100644 static/js/pdf.js/web/images/altText_add.svg create mode 100644 static/js/pdf.js/web/images/altText_disclaimer.svg create mode 100644 static/js/pdf.js/web/images/altText_done.svg create mode 100644 static/js/pdf.js/web/images/altText_spinner.svg create mode 100644 static/js/pdf.js/web/images/altText_warning.svg rename static/js/{pdf-js => pdf.js}/web/images/annotation-check.svg (100%) rename static/js/{pdf-js => pdf.js}/web/images/annotation-comment.svg (100%) rename static/js/{pdf-js => pdf.js}/web/images/annotation-help.svg (100%) rename static/js/{pdf-js => pdf.js}/web/images/annotation-insert.svg (100%) rename static/js/{pdf-js => pdf.js}/web/images/annotation-key.svg (100%) rename static/js/{pdf-js => pdf.js}/web/images/annotation-newparagraph.svg (100%) rename static/js/{pdf-js => pdf.js}/web/images/annotation-noicon.svg (100%) rename static/js/{pdf-js => pdf.js}/web/images/annotation-note.svg (100%) rename static/js/{pdf-js => pdf.js}/web/images/annotation-paperclip.svg (100%) rename static/js/{pdf-js => pdf.js}/web/images/annotation-paragraph.svg (100%) rename static/js/{pdf-js => pdf.js}/web/images/annotation-pushpin.svg (100%) create mode 100644 static/js/pdf.js/web/images/cursor-editorFreeHighlight.svg rename static/js/{pdf-js => pdf.js}/web/images/cursor-editorFreeText.svg (100%) rename static/js/{pdf-js => pdf.js}/web/images/cursor-editorInk.svg (100%) create mode 100644 static/js/pdf.js/web/images/cursor-editorTextHighlight.svg create mode 100644 static/js/pdf.js/web/images/editor-toolbar-delete.svg rename static/js/{pdf-js => pdf.js}/web/images/findbarButton-next.svg (100%) rename static/js/{pdf-js => pdf.js}/web/images/findbarButton-previous.svg (100%) create mode 100644 static/js/pdf.js/web/images/gv-toolbarButton-download.svg rename static/js/{pdf-js => pdf.js}/web/images/loading-icon.gif (100%) rename static/js/{pdf-js => pdf.js}/web/images/loading.svg (100%) create mode 100644 static/js/pdf.js/web/images/messageBar_closingButton.svg create mode 100644 static/js/pdf.js/web/images/messageBar_warning.svg rename static/js/{pdf-js => pdf.js}/web/images/secondaryToolbarButton-documentProperties.svg (100%) rename static/js/{pdf-js => pdf.js}/web/images/secondaryToolbarButton-firstPage.svg (100%) rename static/js/{pdf-js => pdf.js}/web/images/secondaryToolbarButton-handTool.svg (100%) rename static/js/{pdf-js => pdf.js}/web/images/secondaryToolbarButton-lastPage.svg (100%) rename static/js/{pdf-js => pdf.js}/web/images/secondaryToolbarButton-rotateCcw.svg (100%) rename static/js/{pdf-js => pdf.js}/web/images/secondaryToolbarButton-rotateCw.svg (100%) rename static/js/{pdf-js => pdf.js}/web/images/secondaryToolbarButton-scrollHorizontal.svg (100%) rename static/js/{pdf-js => pdf.js}/web/images/secondaryToolbarButton-scrollPage.svg (100%) rename static/js/{pdf-js => pdf.js}/web/images/secondaryToolbarButton-scrollVertical.svg (100%) rename static/js/{pdf-js => pdf.js}/web/images/secondaryToolbarButton-scrollWrapped.svg (100%) rename static/js/{pdf-js => pdf.js}/web/images/secondaryToolbarButton-selectTool.svg (100%) rename static/js/{pdf-js => pdf.js}/web/images/secondaryToolbarButton-spreadEven.svg (100%) rename static/js/{pdf-js => pdf.js}/web/images/secondaryToolbarButton-spreadNone.svg (100%) rename static/js/{pdf-js => pdf.js}/web/images/secondaryToolbarButton-spreadOdd.svg (100%) rename static/js/{pdf-js => pdf.js}/web/images/toolbarButton-bookmark.svg (100%) rename static/js/{pdf-js => pdf.js}/web/images/toolbarButton-currentOutlineItem.svg (100%) rename static/js/{pdf-js => pdf.js}/web/images/toolbarButton-download.svg (100%) create mode 100644 static/js/pdf.js/web/images/toolbarButton-editorFreeText.svg create mode 100644 static/js/pdf.js/web/images/toolbarButton-editorHighlight.svg rename static/js/{pdf-js => pdf.js}/web/images/toolbarButton-editorInk.svg (100%) create mode 100644 static/js/pdf.js/web/images/toolbarButton-editorStamp.svg rename static/js/{pdf-js => pdf.js}/web/images/toolbarButton-menuArrow.svg (100%) rename static/js/{pdf-js => pdf.js}/web/images/toolbarButton-openFile.svg (100%) rename static/js/{pdf-js => pdf.js}/web/images/toolbarButton-pageDown.svg (100%) rename static/js/{pdf-js => pdf.js}/web/images/toolbarButton-pageUp.svg (100%) rename static/js/{pdf-js => pdf.js}/web/images/toolbarButton-presentationMode.svg (100%) rename static/js/{pdf-js => pdf.js}/web/images/toolbarButton-print.svg (100%) rename static/js/{pdf-js => pdf.js}/web/images/toolbarButton-search.svg (100%) rename static/js/{pdf-js => pdf.js}/web/images/toolbarButton-secondaryToolbarToggle.svg (100%) rename static/js/{pdf-js => pdf.js}/web/images/toolbarButton-sidebarToggle.svg (100%) rename static/js/{pdf-js => pdf.js}/web/images/toolbarButton-viewAttachments.svg (100%) rename static/js/{pdf-js => pdf.js}/web/images/toolbarButton-viewLayers.svg (100%) rename static/js/{pdf-js => pdf.js}/web/images/toolbarButton-viewOutline.svg (100%) rename static/js/{pdf-js => pdf.js}/web/images/toolbarButton-viewThumbnail.svg (100%) rename static/js/{pdf-js => pdf.js}/web/images/toolbarButton-zoomIn.svg (100%) rename static/js/{pdf-js => pdf.js}/web/images/toolbarButton-zoomOut.svg (100%) rename static/js/{pdf-js => pdf.js}/web/images/treeitem-collapsed.svg (100%) rename static/js/{pdf-js => pdf.js}/web/images/treeitem-expanded.svg (100%) create mode 100644 static/js/pdf.js/web/locale/en-CA/viewer.ftl create mode 100644 static/js/pdf.js/web/locale/en-GB/viewer.ftl create mode 100644 static/js/pdf.js/web/locale/en-US/viewer.ftl create mode 100644 static/js/pdf.js/web/locale/locale.json rename static/js/{pdf-js => pdf.js}/web/standard_fonts/FoxitDingbats.pfb (100%) rename static/js/{pdf-js => pdf.js}/web/standard_fonts/FoxitFixed.pfb (100%) rename static/js/{pdf-js => pdf.js}/web/standard_fonts/FoxitFixedBold.pfb (100%) rename static/js/{pdf-js => pdf.js}/web/standard_fonts/FoxitFixedBoldItalic.pfb (100%) rename static/js/{pdf-js => pdf.js}/web/standard_fonts/FoxitFixedItalic.pfb (100%) rename static/js/{pdf-js => pdf.js}/web/standard_fonts/FoxitSerif.pfb (100%) rename static/js/{pdf-js => pdf.js}/web/standard_fonts/FoxitSerifBold.pfb (100%) rename static/js/{pdf-js => pdf.js}/web/standard_fonts/FoxitSerifBoldItalic.pfb (100%) rename static/js/{pdf-js => pdf.js}/web/standard_fonts/FoxitSerifItalic.pfb (100%) rename static/js/{pdf-js => pdf.js}/web/standard_fonts/FoxitSymbol.pfb (100%) rename static/js/{pdf-js => pdf.js}/web/standard_fonts/LICENSE_FOXIT (100%) rename static/js/{pdf-js => pdf.js}/web/standard_fonts/LICENSE_LIBERATION (100%) rename static/js/{pdf-js => pdf.js}/web/standard_fonts/LiberationSans-Bold.ttf (100%) rename static/js/{pdf-js => pdf.js}/web/standard_fonts/LiberationSans-BoldItalic.ttf (100%) rename static/js/{pdf-js => pdf.js}/web/standard_fonts/LiberationSans-Italic.ttf (100%) rename static/js/{pdf-js => pdf.js}/web/standard_fonts/LiberationSans-Regular.ttf (100%) diff --git a/layouts/shortcodes/embed-pdf.html b/layouts/shortcodes/embed-pdf.html index 1c2ecd6..b1acbf4 100644 --- a/layouts/shortcodes/embed-pdf.html +++ b/layouts/shortcodes/embed-pdf.html @@ -1,122 +1,41 @@ -{{- if not ($.Page.Scratch.Get "embed-pdf-count") -}} - - - - +{{- if not ($.Page.Store.Get "embed-pdf-count") -}} + + {{- end -}} -{{- $.Page.Scratch.Add "embed-pdf-count" 1 -}} +{{- $.Page.Store.Add "embed-pdf-count" 1 -}}
-
-
-
- - +
+
+
+ +
- -     - - / - - [pdf] + +     + + / + + Download the PDF + file
- + })(); + \ No newline at end of file diff --git a/static/css/pdfjs.css b/static/css/pdfjs.css new file mode 100644 index 0000000..878e26a --- /dev/null +++ b/static/css/pdfjs.css @@ -0,0 +1,70 @@ +#embed-pdf-container { + position: relative; + width: 100%; + height: auto; + min-height: 20vh; +} +.pdf-canvas { + border: 1px solid black; + direction: ltr; + width: 100%; + height: auto; + display: none; +} +#the-canvas { + border: 1px solid black; + direction: ltr; + width: 100%; + height: auto; + display: none; +} +.pdf-loadingWrapper { + display: none; + justify-content: center; + align-items: center; + width: 100%; + height: 350px; +} +.pdf-loading { + display: inline-block; + width: 50px; + height: 50px; + border: 3px solid #d2d0d0; + ; + border-radius: 50%; + border-top-color: #383838; + animation: spin 1s ease-in-out infinite; + -webkit-animation: spin 1s ease-in-out infinite; +} +#overlayText { + word-wrap: break-word; + display: grid; + justify-content: end; +} +#overlayText a { + position: relative; + top: 10px; + right: 4px; + color: #000; + margin: auto; + background-color: #eeeeee; + padding: 0.3em 1em; + border: solid 2px; + border-radius: 12px; + border-color: #00000030; + text-decoration: none; +} +#overlayText svg { + height: clamp(1em, 2vw, 1.4em); + width: clamp(1em, 2vw, 1.4em); +} +@keyframes spin { + to { + -webkit-transform: rotate(360deg); + } +} +@-webkit-keyframes spin { + to { + -webkit-transform: rotate(360deg); + } +} \ No newline at end of file diff --git a/static/js/pdf-js/build/pdf.js b/static/js/pdf-js/build/pdf.js deleted file mode 100644 index 212325e..0000000 --- a/static/js/pdf-js/build/pdf.js +++ /dev/null @@ -1,15792 +0,0 @@ -/** - * @licstart The following is the entire license notice for the - * JavaScript code in this page - * - * Copyright 2023 Mozilla Foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * @licend The above is the entire license notice for the - * JavaScript code in this page - */ - -(function webpackUniversalModuleDefinition(root, factory) { - if(typeof exports === 'object' && typeof module === 'object') - module.exports = factory(); - else if(typeof define === 'function' && define.amd) - define("pdfjs-dist/build/pdf", [], factory); - else if(typeof exports === 'object') - exports["pdfjs-dist/build/pdf"] = factory(); - else - root["pdfjs-dist/build/pdf"] = root.pdfjsLib = factory(); -})(globalThis, () => { -return /******/ (() => { // webpackBootstrap -/******/ "use strict"; -/******/ var __webpack_modules__ = ([ -/* 0 */, -/* 1 */ -/***/ ((__unused_webpack_module, exports) => { - - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.VerbosityLevel = exports.Util = exports.UnknownErrorException = exports.UnexpectedResponseException = exports.UNSUPPORTED_FEATURES = exports.TextRenderingMode = exports.RenderingIntentFlag = exports.PermissionFlag = exports.PasswordResponses = exports.PasswordException = exports.PageActionEventType = exports.OPS = exports.MissingPDFException = exports.LINE_FACTOR = exports.LINE_DESCENT_FACTOR = exports.InvalidPDFException = exports.ImageKind = exports.IDENTITY_MATRIX = exports.FormatError = exports.FeatureTest = exports.FONT_IDENTITY_MATRIX = exports.DocumentActionEventType = exports.CMapCompressionType = exports.BaseException = exports.BASELINE_FACTOR = exports.AnnotationType = exports.AnnotationStateModelType = exports.AnnotationReviewState = exports.AnnotationReplyType = exports.AnnotationMode = exports.AnnotationMarkedState = exports.AnnotationFlag = exports.AnnotationFieldFlag = exports.AnnotationEditorType = exports.AnnotationEditorPrefix = exports.AnnotationEditorParamsType = exports.AnnotationBorderStyleType = exports.AnnotationActionEventType = exports.AbortException = void 0; -exports.assert = assert; -exports.bytesToString = bytesToString; -exports.createPromiseCapability = createPromiseCapability; -exports.createValidAbsoluteUrl = createValidAbsoluteUrl; -exports.getModificationDate = getModificationDate; -exports.getVerbosityLevel = getVerbosityLevel; -exports.info = info; -exports.isArrayBuffer = isArrayBuffer; -exports.isArrayEqual = isArrayEqual; -exports.objectFromMap = objectFromMap; -exports.objectSize = objectSize; -exports.setVerbosityLevel = setVerbosityLevel; -exports.shadow = shadow; -exports.string32 = string32; -exports.stringToBytes = stringToBytes; -exports.stringToPDFString = stringToPDFString; -exports.stringToUTF8String = stringToUTF8String; -exports.unreachable = unreachable; -exports.utf8StringToString = utf8StringToString; -exports.warn = warn; -; -const IDENTITY_MATRIX = [1, 0, 0, 1, 0, 0]; -exports.IDENTITY_MATRIX = IDENTITY_MATRIX; -const FONT_IDENTITY_MATRIX = [0.001, 0, 0, 0.001, 0, 0]; -exports.FONT_IDENTITY_MATRIX = FONT_IDENTITY_MATRIX; -const LINE_FACTOR = 1.35; -exports.LINE_FACTOR = LINE_FACTOR; -const LINE_DESCENT_FACTOR = 0.35; -exports.LINE_DESCENT_FACTOR = LINE_DESCENT_FACTOR; -const BASELINE_FACTOR = LINE_DESCENT_FACTOR / LINE_FACTOR; -exports.BASELINE_FACTOR = BASELINE_FACTOR; -const RenderingIntentFlag = { - ANY: 0x01, - DISPLAY: 0x02, - PRINT: 0x04, - SAVE: 0x08, - ANNOTATIONS_FORMS: 0x10, - ANNOTATIONS_STORAGE: 0x20, - ANNOTATIONS_DISABLE: 0x40, - OPLIST: 0x100 -}; -exports.RenderingIntentFlag = RenderingIntentFlag; -const AnnotationMode = { - DISABLE: 0, - ENABLE: 1, - ENABLE_FORMS: 2, - ENABLE_STORAGE: 3 -}; -exports.AnnotationMode = AnnotationMode; -const AnnotationEditorPrefix = "pdfjs_internal_editor_"; -exports.AnnotationEditorPrefix = AnnotationEditorPrefix; -const AnnotationEditorType = { - DISABLE: -1, - NONE: 0, - FREETEXT: 3, - INK: 15 -}; -exports.AnnotationEditorType = AnnotationEditorType; -const AnnotationEditorParamsType = { - FREETEXT_SIZE: 1, - FREETEXT_COLOR: 2, - FREETEXT_OPACITY: 3, - INK_COLOR: 11, - INK_THICKNESS: 12, - INK_OPACITY: 13 -}; -exports.AnnotationEditorParamsType = AnnotationEditorParamsType; -const PermissionFlag = { - PRINT: 0x04, - MODIFY_CONTENTS: 0x08, - COPY: 0x10, - MODIFY_ANNOTATIONS: 0x20, - FILL_INTERACTIVE_FORMS: 0x100, - COPY_FOR_ACCESSIBILITY: 0x200, - ASSEMBLE: 0x400, - PRINT_HIGH_QUALITY: 0x800 -}; -exports.PermissionFlag = PermissionFlag; -const TextRenderingMode = { - FILL: 0, - STROKE: 1, - FILL_STROKE: 2, - INVISIBLE: 3, - FILL_ADD_TO_PATH: 4, - STROKE_ADD_TO_PATH: 5, - FILL_STROKE_ADD_TO_PATH: 6, - ADD_TO_PATH: 7, - FILL_STROKE_MASK: 3, - ADD_TO_PATH_FLAG: 4 -}; -exports.TextRenderingMode = TextRenderingMode; -const ImageKind = { - GRAYSCALE_1BPP: 1, - RGB_24BPP: 2, - RGBA_32BPP: 3 -}; -exports.ImageKind = ImageKind; -const AnnotationType = { - TEXT: 1, - LINK: 2, - FREETEXT: 3, - LINE: 4, - SQUARE: 5, - CIRCLE: 6, - POLYGON: 7, - POLYLINE: 8, - HIGHLIGHT: 9, - UNDERLINE: 10, - SQUIGGLY: 11, - STRIKEOUT: 12, - STAMP: 13, - CARET: 14, - INK: 15, - POPUP: 16, - FILEATTACHMENT: 17, - SOUND: 18, - MOVIE: 19, - WIDGET: 20, - SCREEN: 21, - PRINTERMARK: 22, - TRAPNET: 23, - WATERMARK: 24, - THREED: 25, - REDACT: 26 -}; -exports.AnnotationType = AnnotationType; -const AnnotationStateModelType = { - MARKED: "Marked", - REVIEW: "Review" -}; -exports.AnnotationStateModelType = AnnotationStateModelType; -const AnnotationMarkedState = { - MARKED: "Marked", - UNMARKED: "Unmarked" -}; -exports.AnnotationMarkedState = AnnotationMarkedState; -const AnnotationReviewState = { - ACCEPTED: "Accepted", - REJECTED: "Rejected", - CANCELLED: "Cancelled", - COMPLETED: "Completed", - NONE: "None" -}; -exports.AnnotationReviewState = AnnotationReviewState; -const AnnotationReplyType = { - GROUP: "Group", - REPLY: "R" -}; -exports.AnnotationReplyType = AnnotationReplyType; -const AnnotationFlag = { - INVISIBLE: 0x01, - HIDDEN: 0x02, - PRINT: 0x04, - NOZOOM: 0x08, - NOROTATE: 0x10, - NOVIEW: 0x20, - READONLY: 0x40, - LOCKED: 0x80, - TOGGLENOVIEW: 0x100, - LOCKEDCONTENTS: 0x200 -}; -exports.AnnotationFlag = AnnotationFlag; -const AnnotationFieldFlag = { - READONLY: 0x0000001, - REQUIRED: 0x0000002, - NOEXPORT: 0x0000004, - MULTILINE: 0x0001000, - PASSWORD: 0x0002000, - NOTOGGLETOOFF: 0x0004000, - RADIO: 0x0008000, - PUSHBUTTON: 0x0010000, - COMBO: 0x0020000, - EDIT: 0x0040000, - SORT: 0x0080000, - FILESELECT: 0x0100000, - MULTISELECT: 0x0200000, - DONOTSPELLCHECK: 0x0400000, - DONOTSCROLL: 0x0800000, - COMB: 0x1000000, - RICHTEXT: 0x2000000, - RADIOSINUNISON: 0x2000000, - COMMITONSELCHANGE: 0x4000000 -}; -exports.AnnotationFieldFlag = AnnotationFieldFlag; -const AnnotationBorderStyleType = { - SOLID: 1, - DASHED: 2, - BEVELED: 3, - INSET: 4, - UNDERLINE: 5 -}; -exports.AnnotationBorderStyleType = AnnotationBorderStyleType; -const AnnotationActionEventType = { - E: "Mouse Enter", - X: "Mouse Exit", - D: "Mouse Down", - U: "Mouse Up", - Fo: "Focus", - Bl: "Blur", - PO: "PageOpen", - PC: "PageClose", - PV: "PageVisible", - PI: "PageInvisible", - K: "Keystroke", - F: "Format", - V: "Validate", - C: "Calculate" -}; -exports.AnnotationActionEventType = AnnotationActionEventType; -const DocumentActionEventType = { - WC: "WillClose", - WS: "WillSave", - DS: "DidSave", - WP: "WillPrint", - DP: "DidPrint" -}; -exports.DocumentActionEventType = DocumentActionEventType; -const PageActionEventType = { - O: "PageOpen", - C: "PageClose" -}; -exports.PageActionEventType = PageActionEventType; -const VerbosityLevel = { - ERRORS: 0, - WARNINGS: 1, - INFOS: 5 -}; -exports.VerbosityLevel = VerbosityLevel; -const CMapCompressionType = { - NONE: 0, - BINARY: 1 -}; -exports.CMapCompressionType = CMapCompressionType; -const OPS = { - dependency: 1, - setLineWidth: 2, - setLineCap: 3, - setLineJoin: 4, - setMiterLimit: 5, - setDash: 6, - setRenderingIntent: 7, - setFlatness: 8, - setGState: 9, - save: 10, - restore: 11, - transform: 12, - moveTo: 13, - lineTo: 14, - curveTo: 15, - curveTo2: 16, - curveTo3: 17, - closePath: 18, - rectangle: 19, - stroke: 20, - closeStroke: 21, - fill: 22, - eoFill: 23, - fillStroke: 24, - eoFillStroke: 25, - closeFillStroke: 26, - closeEOFillStroke: 27, - endPath: 28, - clip: 29, - eoClip: 30, - beginText: 31, - endText: 32, - setCharSpacing: 33, - setWordSpacing: 34, - setHScale: 35, - setLeading: 36, - setFont: 37, - setTextRenderingMode: 38, - setTextRise: 39, - moveText: 40, - setLeadingMoveText: 41, - setTextMatrix: 42, - nextLine: 43, - showText: 44, - showSpacedText: 45, - nextLineShowText: 46, - nextLineSetSpacingShowText: 47, - setCharWidth: 48, - setCharWidthAndBounds: 49, - setStrokeColorSpace: 50, - setFillColorSpace: 51, - setStrokeColor: 52, - setStrokeColorN: 53, - setFillColor: 54, - setFillColorN: 55, - setStrokeGray: 56, - setFillGray: 57, - setStrokeRGBColor: 58, - setFillRGBColor: 59, - setStrokeCMYKColor: 60, - setFillCMYKColor: 61, - shadingFill: 62, - beginInlineImage: 63, - beginImageData: 64, - endInlineImage: 65, - paintXObject: 66, - markPoint: 67, - markPointProps: 68, - beginMarkedContent: 69, - beginMarkedContentProps: 70, - endMarkedContent: 71, - beginCompat: 72, - endCompat: 73, - paintFormXObjectBegin: 74, - paintFormXObjectEnd: 75, - beginGroup: 76, - endGroup: 77, - beginAnnotation: 80, - endAnnotation: 81, - paintImageMaskXObject: 83, - paintImageMaskXObjectGroup: 84, - paintImageXObject: 85, - paintInlineImageXObject: 86, - paintInlineImageXObjectGroup: 87, - paintImageXObjectRepeat: 88, - paintImageMaskXObjectRepeat: 89, - paintSolidColorImageMask: 90, - constructPath: 91 -}; -exports.OPS = OPS; -const UNSUPPORTED_FEATURES = { - forms: "forms", - javaScript: "javaScript", - signatures: "signatures", - smask: "smask", - shadingPattern: "shadingPattern", - errorTilingPattern: "errorTilingPattern", - errorExtGState: "errorExtGState", - errorXObject: "errorXObject", - errorFontLoadType3: "errorFontLoadType3", - errorFontState: "errorFontState", - errorFontMissing: "errorFontMissing", - errorFontTranslate: "errorFontTranslate", - errorColorSpace: "errorColorSpace", - errorOperatorList: "errorOperatorList", - errorFontToUnicode: "errorFontToUnicode", - errorFontLoadNative: "errorFontLoadNative", - errorFontBuildPath: "errorFontBuildPath", - errorFontGetPath: "errorFontGetPath", - errorMarkedContent: "errorMarkedContent", - errorContentSubStream: "errorContentSubStream" -}; -exports.UNSUPPORTED_FEATURES = UNSUPPORTED_FEATURES; -const PasswordResponses = { - NEED_PASSWORD: 1, - INCORRECT_PASSWORD: 2 -}; -exports.PasswordResponses = PasswordResponses; -let verbosity = VerbosityLevel.WARNINGS; -function setVerbosityLevel(level) { - if (Number.isInteger(level)) { - verbosity = level; - } -} -function getVerbosityLevel() { - return verbosity; -} -function info(msg) { - if (verbosity >= VerbosityLevel.INFOS) { - console.log(`Info: ${msg}`); - } -} -function warn(msg) { - if (verbosity >= VerbosityLevel.WARNINGS) { - console.log(`Warning: ${msg}`); - } -} -function unreachable(msg) { - throw new Error(msg); -} -function assert(cond, msg) { - if (!cond) { - unreachable(msg); - } -} -function _isValidProtocol(url) { - if (!url) { - return false; - } - switch (url.protocol) { - case "http:": - case "https:": - case "ftp:": - case "mailto:": - case "tel:": - return true; - default: - return false; - } -} -function createValidAbsoluteUrl(url, baseUrl = null, options = null) { - if (!url) { - return null; - } - try { - if (options && typeof url === "string") { - if (options.addDefaultProtocol && url.startsWith("www.")) { - const dots = url.match(/\./g); - if (dots && dots.length >= 2) { - url = `http://${url}`; - } - } - if (options.tryConvertEncoding) { - try { - url = stringToUTF8String(url); - } catch (ex) {} - } - } - const absoluteUrl = baseUrl ? new URL(url, baseUrl) : new URL(url); - if (_isValidProtocol(absoluteUrl)) { - return absoluteUrl; - } - } catch (ex) {} - return null; -} -function shadow(obj, prop, value, nonSerializable = false) { - Object.defineProperty(obj, prop, { - value, - enumerable: !nonSerializable, - configurable: true, - writable: false - }); - return value; -} -const BaseException = function BaseExceptionClosure() { - function BaseException(message, name) { - if (this.constructor === BaseException) { - unreachable("Cannot initialize BaseException."); - } - this.message = message; - this.name = name; - } - BaseException.prototype = new Error(); - BaseException.constructor = BaseException; - return BaseException; -}(); -exports.BaseException = BaseException; -class PasswordException extends BaseException { - constructor(msg, code) { - super(msg, "PasswordException"); - this.code = code; - } -} -exports.PasswordException = PasswordException; -class UnknownErrorException extends BaseException { - constructor(msg, details) { - super(msg, "UnknownErrorException"); - this.details = details; - } -} -exports.UnknownErrorException = UnknownErrorException; -class InvalidPDFException extends BaseException { - constructor(msg) { - super(msg, "InvalidPDFException"); - } -} -exports.InvalidPDFException = InvalidPDFException; -class MissingPDFException extends BaseException { - constructor(msg) { - super(msg, "MissingPDFException"); - } -} -exports.MissingPDFException = MissingPDFException; -class UnexpectedResponseException extends BaseException { - constructor(msg, status) { - super(msg, "UnexpectedResponseException"); - this.status = status; - } -} -exports.UnexpectedResponseException = UnexpectedResponseException; -class FormatError extends BaseException { - constructor(msg) { - super(msg, "FormatError"); - } -} -exports.FormatError = FormatError; -class AbortException extends BaseException { - constructor(msg) { - super(msg, "AbortException"); - } -} -exports.AbortException = AbortException; -function bytesToString(bytes) { - if (typeof bytes !== "object" || bytes === null || bytes.length === undefined) { - unreachable("Invalid argument for bytesToString"); - } - const length = bytes.length; - const MAX_ARGUMENT_COUNT = 8192; - if (length < MAX_ARGUMENT_COUNT) { - return String.fromCharCode.apply(null, bytes); - } - const strBuf = []; - for (let i = 0; i < length; i += MAX_ARGUMENT_COUNT) { - const chunkEnd = Math.min(i + MAX_ARGUMENT_COUNT, length); - const chunk = bytes.subarray(i, chunkEnd); - strBuf.push(String.fromCharCode.apply(null, chunk)); - } - return strBuf.join(""); -} -function stringToBytes(str) { - if (typeof str !== "string") { - unreachable("Invalid argument for stringToBytes"); - } - const length = str.length; - const bytes = new Uint8Array(length); - for (let i = 0; i < length; ++i) { - bytes[i] = str.charCodeAt(i) & 0xff; - } - return bytes; -} -function string32(value) { - return String.fromCharCode(value >> 24 & 0xff, value >> 16 & 0xff, value >> 8 & 0xff, value & 0xff); -} -function objectSize(obj) { - return Object.keys(obj).length; -} -function objectFromMap(map) { - const obj = Object.create(null); - for (const [key, value] of map) { - obj[key] = value; - } - return obj; -} -function isLittleEndian() { - const buffer8 = new Uint8Array(4); - buffer8[0] = 1; - const view32 = new Uint32Array(buffer8.buffer, 0, 1); - return view32[0] === 1; -} -function isEvalSupported() { - try { - new Function(""); - return true; - } catch (e) { - return false; - } -} -class FeatureTest { - static get isLittleEndian() { - return shadow(this, "isLittleEndian", isLittleEndian()); - } - static get isEvalSupported() { - return shadow(this, "isEvalSupported", isEvalSupported()); - } - static get isOffscreenCanvasSupported() { - return shadow(this, "isOffscreenCanvasSupported", typeof OffscreenCanvas !== "undefined"); - } - static get platform() { - if (typeof navigator === "undefined") { - return shadow(this, "platform", { - isWin: false, - isMac: false - }); - } - return shadow(this, "platform", { - isWin: navigator.platform.includes("Win"), - isMac: navigator.platform.includes("Mac") - }); - } -} -exports.FeatureTest = FeatureTest; -const hexNumbers = [...Array(256).keys()].map(n => n.toString(16).padStart(2, "0")); -class Util { - static makeHexColor(r, g, b) { - return `#${hexNumbers[r]}${hexNumbers[g]}${hexNumbers[b]}`; - } - static scaleMinMax(transform, minMax) { - let temp; - if (transform[0]) { - if (transform[0] < 0) { - temp = minMax[0]; - minMax[0] = minMax[1]; - minMax[1] = temp; - } - minMax[0] *= transform[0]; - minMax[1] *= transform[0]; - if (transform[3] < 0) { - temp = minMax[2]; - minMax[2] = minMax[3]; - minMax[3] = temp; - } - minMax[2] *= transform[3]; - minMax[3] *= transform[3]; - } else { - temp = minMax[0]; - minMax[0] = minMax[2]; - minMax[2] = temp; - temp = minMax[1]; - minMax[1] = minMax[3]; - minMax[3] = temp; - if (transform[1] < 0) { - temp = minMax[2]; - minMax[2] = minMax[3]; - minMax[3] = temp; - } - minMax[2] *= transform[1]; - minMax[3] *= transform[1]; - if (transform[2] < 0) { - temp = minMax[0]; - minMax[0] = minMax[1]; - minMax[1] = temp; - } - minMax[0] *= transform[2]; - minMax[1] *= transform[2]; - } - minMax[0] += transform[4]; - minMax[1] += transform[4]; - minMax[2] += transform[5]; - minMax[3] += transform[5]; - } - static transform(m1, m2) { - return [m1[0] * m2[0] + m1[2] * m2[1], m1[1] * m2[0] + m1[3] * m2[1], m1[0] * m2[2] + m1[2] * m2[3], m1[1] * m2[2] + m1[3] * m2[3], m1[0] * m2[4] + m1[2] * m2[5] + m1[4], m1[1] * m2[4] + m1[3] * m2[5] + m1[5]]; - } - static applyTransform(p, m) { - const xt = p[0] * m[0] + p[1] * m[2] + m[4]; - const yt = p[0] * m[1] + p[1] * m[3] + m[5]; - return [xt, yt]; - } - static applyInverseTransform(p, m) { - const d = m[0] * m[3] - m[1] * m[2]; - const xt = (p[0] * m[3] - p[1] * m[2] + m[2] * m[5] - m[4] * m[3]) / d; - const yt = (-p[0] * m[1] + p[1] * m[0] + m[4] * m[1] - m[5] * m[0]) / d; - return [xt, yt]; - } - static getAxialAlignedBoundingBox(r, m) { - const p1 = Util.applyTransform(r, m); - const p2 = Util.applyTransform(r.slice(2, 4), m); - const p3 = Util.applyTransform([r[0], r[3]], m); - const p4 = Util.applyTransform([r[2], r[1]], m); - return [Math.min(p1[0], p2[0], p3[0], p4[0]), Math.min(p1[1], p2[1], p3[1], p4[1]), Math.max(p1[0], p2[0], p3[0], p4[0]), Math.max(p1[1], p2[1], p3[1], p4[1])]; - } - static inverseTransform(m) { - const d = m[0] * m[3] - m[1] * m[2]; - return [m[3] / d, -m[1] / d, -m[2] / d, m[0] / d, (m[2] * m[5] - m[4] * m[3]) / d, (m[4] * m[1] - m[5] * m[0]) / d]; - } - static singularValueDecompose2dScale(m) { - const transpose = [m[0], m[2], m[1], m[3]]; - const a = m[0] * transpose[0] + m[1] * transpose[2]; - const b = m[0] * transpose[1] + m[1] * transpose[3]; - const c = m[2] * transpose[0] + m[3] * transpose[2]; - const d = m[2] * transpose[1] + m[3] * transpose[3]; - const first = (a + d) / 2; - const second = Math.sqrt((a + d) ** 2 - 4 * (a * d - c * b)) / 2; - const sx = first + second || 1; - const sy = first - second || 1; - return [Math.sqrt(sx), Math.sqrt(sy)]; - } - static normalizeRect(rect) { - const r = rect.slice(0); - if (rect[0] > rect[2]) { - r[0] = rect[2]; - r[2] = rect[0]; - } - if (rect[1] > rect[3]) { - r[1] = rect[3]; - r[3] = rect[1]; - } - return r; - } - static intersect(rect1, rect2) { - const xLow = Math.max(Math.min(rect1[0], rect1[2]), Math.min(rect2[0], rect2[2])); - const xHigh = Math.min(Math.max(rect1[0], rect1[2]), Math.max(rect2[0], rect2[2])); - if (xLow > xHigh) { - return null; - } - const yLow = Math.max(Math.min(rect1[1], rect1[3]), Math.min(rect2[1], rect2[3])); - const yHigh = Math.min(Math.max(rect1[1], rect1[3]), Math.max(rect2[1], rect2[3])); - if (yLow > yHigh) { - return null; - } - return [xLow, yLow, xHigh, yHigh]; - } - static bezierBoundingBox(x0, y0, x1, y1, x2, y2, x3, y3) { - const tvalues = [], - bounds = [[], []]; - let a, b, c, t, t1, t2, b2ac, sqrtb2ac; - for (let i = 0; i < 2; ++i) { - if (i === 0) { - b = 6 * x0 - 12 * x1 + 6 * x2; - a = -3 * x0 + 9 * x1 - 9 * x2 + 3 * x3; - c = 3 * x1 - 3 * x0; - } else { - b = 6 * y0 - 12 * y1 + 6 * y2; - a = -3 * y0 + 9 * y1 - 9 * y2 + 3 * y3; - c = 3 * y1 - 3 * y0; - } - if (Math.abs(a) < 1e-12) { - if (Math.abs(b) < 1e-12) { - continue; - } - t = -c / b; - if (0 < t && t < 1) { - tvalues.push(t); - } - continue; - } - b2ac = b * b - 4 * c * a; - sqrtb2ac = Math.sqrt(b2ac); - if (b2ac < 0) { - continue; - } - t1 = (-b + sqrtb2ac) / (2 * a); - if (0 < t1 && t1 < 1) { - tvalues.push(t1); - } - t2 = (-b - sqrtb2ac) / (2 * a); - if (0 < t2 && t2 < 1) { - tvalues.push(t2); - } - } - let j = tvalues.length, - mt; - const jlen = j; - while (j--) { - t = tvalues[j]; - mt = 1 - t; - bounds[0][j] = mt * mt * mt * x0 + 3 * mt * mt * t * x1 + 3 * mt * t * t * x2 + t * t * t * x3; - bounds[1][j] = mt * mt * mt * y0 + 3 * mt * mt * t * y1 + 3 * mt * t * t * y2 + t * t * t * y3; - } - bounds[0][jlen] = x0; - bounds[1][jlen] = y0; - bounds[0][jlen + 1] = x3; - bounds[1][jlen + 1] = y3; - bounds[0].length = bounds[1].length = jlen + 2; - return [Math.min(...bounds[0]), Math.min(...bounds[1]), Math.max(...bounds[0]), Math.max(...bounds[1])]; - } -} -exports.Util = Util; -const PDFStringTranslateTable = [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, 0x2c7, 0x2c6, 0x2d9, 0x2dd, 0x2db, 0x2da, 0x2dc, 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, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x2022, 0x2020, 0x2021, 0x2026, 0x2014, 0x2013, 0x192, 0x2044, 0x2039, 0x203a, 0x2212, 0x2030, 0x201e, 0x201c, 0x201d, 0x2018, 0x2019, 0x201a, 0x2122, 0xfb01, 0xfb02, 0x141, 0x152, 0x160, 0x178, 0x17d, 0x131, 0x142, 0x153, 0x161, 0x17e, 0, 0x20ac]; -function stringToPDFString(str) { - if (str[0] >= "\xEF") { - let encoding; - if (str[0] === "\xFE" && str[1] === "\xFF") { - encoding = "utf-16be"; - } else if (str[0] === "\xFF" && str[1] === "\xFE") { - encoding = "utf-16le"; - } else if (str[0] === "\xEF" && str[1] === "\xBB" && str[2] === "\xBF") { - encoding = "utf-8"; - } - if (encoding) { - try { - const decoder = new TextDecoder(encoding, { - fatal: true - }); - const buffer = stringToBytes(str); - return decoder.decode(buffer); - } catch (ex) { - warn(`stringToPDFString: "${ex}".`); - } - } - } - const strBuf = []; - for (let i = 0, ii = str.length; i < ii; i++) { - const code = PDFStringTranslateTable[str.charCodeAt(i)]; - strBuf.push(code ? String.fromCharCode(code) : str.charAt(i)); - } - return strBuf.join(""); -} -function stringToUTF8String(str) { - return decodeURIComponent(escape(str)); -} -function utf8StringToString(str) { - return unescape(encodeURIComponent(str)); -} -function isArrayBuffer(v) { - return typeof v === "object" && v !== null && v.byteLength !== undefined; -} -function isArrayEqual(arr1, arr2) { - if (arr1.length !== arr2.length) { - return false; - } - for (let i = 0, ii = arr1.length; i < ii; i++) { - if (arr1[i] !== arr2[i]) { - return false; - } - } - return true; -} -function getModificationDate(date = new Date()) { - const buffer = [date.getUTCFullYear().toString(), (date.getUTCMonth() + 1).toString().padStart(2, "0"), date.getUTCDate().toString().padStart(2, "0"), date.getUTCHours().toString().padStart(2, "0"), date.getUTCMinutes().toString().padStart(2, "0"), date.getUTCSeconds().toString().padStart(2, "0")]; - return buffer.join(""); -} -function createPromiseCapability() { - const capability = Object.create(null); - let isSettled = false; - Object.defineProperty(capability, "settled", { - get() { - return isSettled; - } - }); - capability.promise = new Promise(function (resolve, reject) { - capability.resolve = function (data) { - isSettled = true; - resolve(data); - }; - capability.reject = function (reason) { - isSettled = true; - reject(reason); - }; - }); - return capability; -} - -/***/ }), -/* 2 */ -/***/ ((__unused_webpack_module, exports, __w_pdfjs_require__) => { - - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.build = exports.RenderTask = exports.PDFWorkerUtil = exports.PDFWorker = exports.PDFPageProxy = exports.PDFDocumentProxy = exports.PDFDocumentLoadingTask = exports.PDFDataRangeTransport = exports.LoopbackPort = exports.DefaultStandardFontDataFactory = exports.DefaultCanvasFactory = exports.DefaultCMapReaderFactory = void 0; -exports.getDocument = getDocument; -exports.version = void 0; -var _util = __w_pdfjs_require__(1); -var _annotation_storage = __w_pdfjs_require__(3); -var _display_utils = __w_pdfjs_require__(6); -var _font_loader = __w_pdfjs_require__(9); -var _canvas = __w_pdfjs_require__(11); -var _worker_options = __w_pdfjs_require__(14); -var _is_node = __w_pdfjs_require__(10); -var _message_handler = __w_pdfjs_require__(15); -var _metadata = __w_pdfjs_require__(16); -var _optional_content_config = __w_pdfjs_require__(17); -var _transport_stream = __w_pdfjs_require__(18); -var _xfa_text = __w_pdfjs_require__(19); -const DEFAULT_RANGE_CHUNK_SIZE = 65536; -const RENDERING_CANCELLED_TIMEOUT = 100; -let DefaultCanvasFactory = _display_utils.DOMCanvasFactory; -exports.DefaultCanvasFactory = DefaultCanvasFactory; -let DefaultCMapReaderFactory = _display_utils.DOMCMapReaderFactory; -exports.DefaultCMapReaderFactory = DefaultCMapReaderFactory; -let DefaultStandardFontDataFactory = _display_utils.DOMStandardFontDataFactory; -exports.DefaultStandardFontDataFactory = DefaultStandardFontDataFactory; -if (_is_node.isNodeJS) { - const { - NodeCanvasFactory, - NodeCMapReaderFactory, - NodeStandardFontDataFactory - } = __w_pdfjs_require__(20); - exports.DefaultCanvasFactory = DefaultCanvasFactory = NodeCanvasFactory; - exports.DefaultCMapReaderFactory = DefaultCMapReaderFactory = NodeCMapReaderFactory; - exports.DefaultStandardFontDataFactory = DefaultStandardFontDataFactory = NodeStandardFontDataFactory; -} -let createPDFNetworkStream; -{ - if (_is_node.isNodeJS) { - const { - PDFNodeStream - } = __w_pdfjs_require__(21); - createPDFNetworkStream = params => { - return new PDFNodeStream(params); - }; - } else { - const { - PDFNetworkStream - } = __w_pdfjs_require__(24); - const { - PDFFetchStream - } = __w_pdfjs_require__(25); - createPDFNetworkStream = params => { - return (0, _display_utils.isValidFetchUrl)(params.url) ? new PDFFetchStream(params) : new PDFNetworkStream(params); - }; - } -} -function getDocument(src) { - if (typeof src === "string" || src instanceof URL) { - src = { - url: src - }; - } else if ((0, _util.isArrayBuffer)(src)) { - src = { - data: src - }; - } else if (src instanceof PDFDataRangeTransport) { - (0, _display_utils.deprecated)("`PDFDataRangeTransport`-instance, " + "please use a parameter object with `range`-property instead."); - src = { - range: src - }; - } else { - if (typeof src !== "object") { - throw new Error("Invalid parameter in getDocument, " + "need either string, URL, TypedArray, or parameter object."); - } - } - if (!src.url && !src.data && !src.range) { - throw new Error("Invalid parameter object: need either .data, .range or .url"); - } - const task = new PDFDocumentLoadingTask(); - const url = src.url ? getUrlProp(src.url) : null; - const data = src.data ? getDataProp(src.data) : null; - const httpHeaders = src.httpHeaders || null; - const withCredentials = src.withCredentials === true; - const password = src.password ?? null; - const rangeTransport = src.range instanceof PDFDataRangeTransport ? src.range : null; - const rangeChunkSize = Number.isInteger(src.rangeChunkSize) && src.rangeChunkSize > 0 ? src.rangeChunkSize : DEFAULT_RANGE_CHUNK_SIZE; - let worker = src.worker instanceof PDFWorker ? src.worker : null; - const verbosity = src.verbosity; - const docBaseUrl = typeof src.docBaseUrl === "string" && !(0, _display_utils.isDataScheme)(src.docBaseUrl) ? src.docBaseUrl : null; - const cMapUrl = typeof src.cMapUrl === "string" ? src.cMapUrl : null; - const cMapPacked = src.cMapPacked !== false; - const CMapReaderFactory = src.CMapReaderFactory || DefaultCMapReaderFactory; - const standardFontDataUrl = typeof src.standardFontDataUrl === "string" ? src.standardFontDataUrl : null; - const StandardFontDataFactory = src.StandardFontDataFactory || DefaultStandardFontDataFactory; - const ignoreErrors = src.stopAtErrors !== true; - const maxImageSize = Number.isInteger(src.maxImageSize) && src.maxImageSize > -1 ? src.maxImageSize : -1; - const isEvalSupported = src.isEvalSupported !== false; - const isOffscreenCanvasSupported = typeof src.isOffscreenCanvasSupported === "boolean" ? src.isOffscreenCanvasSupported : !_is_node.isNodeJS; - const disableFontFace = typeof src.disableFontFace === "boolean" ? src.disableFontFace : _is_node.isNodeJS; - const fontExtraProperties = src.fontExtraProperties === true; - const enableXfa = src.enableXfa === true; - const ownerDocument = src.ownerDocument || globalThis.document; - const disableRange = src.disableRange === true; - const disableStream = src.disableStream === true; - const disableAutoFetch = src.disableAutoFetch === true; - const pdfBug = src.pdfBug === true; - const length = rangeTransport ? rangeTransport.length : src.length ?? NaN; - const useSystemFonts = typeof src.useSystemFonts === "boolean" ? src.useSystemFonts : !_is_node.isNodeJS && !disableFontFace; - const useWorkerFetch = typeof src.useWorkerFetch === "boolean" ? src.useWorkerFetch : CMapReaderFactory === _display_utils.DOMCMapReaderFactory && StandardFontDataFactory === _display_utils.DOMStandardFontDataFactory && (0, _display_utils.isValidFetchUrl)(cMapUrl, document.baseURI) && (0, _display_utils.isValidFetchUrl)(standardFontDataUrl, document.baseURI); - const styleElement = null; - (0, _util.setVerbosityLevel)(verbosity); - const transportFactory = useWorkerFetch ? null : { - cMapReaderFactory: new CMapReaderFactory({ - baseUrl: cMapUrl, - isCompressed: cMapPacked - }), - standardFontDataFactory: new StandardFontDataFactory({ - baseUrl: standardFontDataUrl - }) - }; - if (!worker) { - const workerParams = { - verbosity, - port: _worker_options.GlobalWorkerOptions.workerPort - }; - worker = workerParams.port ? PDFWorker.fromPort(workerParams) : new PDFWorker(workerParams); - task._worker = worker; - } - const docId = task.docId; - const fetchDocParams = { - docId, - apiVersion: '3.4.120', - data, - password, - disableAutoFetch, - rangeChunkSize, - length, - docBaseUrl, - enableXfa, - evaluatorOptions: { - maxImageSize, - disableFontFace, - ignoreErrors, - isEvalSupported, - isOffscreenCanvasSupported, - fontExtraProperties, - useSystemFonts, - cMapUrl: useWorkerFetch ? cMapUrl : null, - standardFontDataUrl: useWorkerFetch ? standardFontDataUrl : null - } - }; - const transportParams = { - ignoreErrors, - isEvalSupported, - disableFontFace, - fontExtraProperties, - enableXfa, - ownerDocument, - disableAutoFetch, - pdfBug, - styleElement - }; - worker.promise.then(function () { - if (task.destroyed) { - throw new Error("Loading aborted"); - } - const workerIdPromise = _fetchDocument(worker, fetchDocParams); - const networkStreamPromise = new Promise(function (resolve) { - let networkStream; - if (rangeTransport) { - networkStream = new _transport_stream.PDFDataTransportStream({ - length, - initialData: rangeTransport.initialData, - progressiveDone: rangeTransport.progressiveDone, - contentDispositionFilename: rangeTransport.contentDispositionFilename, - disableRange, - disableStream - }, rangeTransport); - } else if (!data) { - networkStream = createPDFNetworkStream({ - url, - length, - httpHeaders, - withCredentials, - rangeChunkSize, - disableRange, - disableStream - }); - } - resolve(networkStream); - }); - return Promise.all([workerIdPromise, networkStreamPromise]).then(function ([workerId, networkStream]) { - if (task.destroyed) { - throw new Error("Loading aborted"); - } - const messageHandler = new _message_handler.MessageHandler(docId, workerId, worker.port); - const transport = new WorkerTransport(messageHandler, task, networkStream, transportParams, transportFactory); - task._transport = transport; - messageHandler.send("Ready", null); - }); - }).catch(task._capability.reject); - return task; -} -async function _fetchDocument(worker, source) { - if (worker.destroyed) { - throw new Error("Worker was destroyed"); - } - const workerId = await worker.messageHandler.sendWithPromise("GetDocRequest", source, source.data ? [source.data.buffer] : null); - if (worker.destroyed) { - throw new Error("Worker was destroyed"); - } - return workerId; -} -function getUrlProp(val) { - if (val instanceof URL) { - return val.href; - } - try { - return new URL(val, window.location).href; - } catch (ex) { - if (_is_node.isNodeJS && typeof val === "string") { - return val; - } - } - throw new Error("Invalid PDF url data: " + "either string or URL-object is expected in the url property."); -} -function getDataProp(val) { - if (_is_node.isNodeJS && typeof Buffer !== "undefined" && val instanceof Buffer) { - (0, _display_utils.deprecated)("Please provide binary data as `Uint8Array`, rather than `Buffer`."); - return new Uint8Array(val); - } - if (val instanceof Uint8Array && val.byteLength === val.buffer.byteLength) { - return val; - } - if (typeof val === "string") { - return (0, _util.stringToBytes)(val); - } - if (typeof val === "object" && !isNaN(val?.length) || (0, _util.isArrayBuffer)(val)) { - return new Uint8Array(val); - } - throw new Error("Invalid PDF binary data: either TypedArray, " + "string, or array-like object is expected in the data property."); -} -class PDFDocumentLoadingTask { - static #docId = 0; - #onUnsupportedFeature = null; - constructor() { - this._capability = (0, _util.createPromiseCapability)(); - this._transport = null; - this._worker = null; - this.docId = `d${PDFDocumentLoadingTask.#docId++}`; - this.destroyed = false; - this.onPassword = null; - this.onProgress = null; - } - get onUnsupportedFeature() { - return this.#onUnsupportedFeature; - } - set onUnsupportedFeature(callback) { - (0, _display_utils.deprecated)("The PDFDocumentLoadingTask onUnsupportedFeature property will be removed in the future."); - this.#onUnsupportedFeature = callback; - } - get promise() { - return this._capability.promise; - } - async destroy() { - this.destroyed = true; - await this._transport?.destroy(); - this._transport = null; - if (this._worker) { - this._worker.destroy(); - this._worker = null; - } - } -} -exports.PDFDocumentLoadingTask = PDFDocumentLoadingTask; -class PDFDataRangeTransport { - constructor(length, initialData, progressiveDone = false, contentDispositionFilename = null) { - this.length = length; - this.initialData = initialData; - this.progressiveDone = progressiveDone; - this.contentDispositionFilename = contentDispositionFilename; - this._rangeListeners = []; - this._progressListeners = []; - this._progressiveReadListeners = []; - this._progressiveDoneListeners = []; - this._readyCapability = (0, _util.createPromiseCapability)(); - } - addRangeListener(listener) { - this._rangeListeners.push(listener); - } - addProgressListener(listener) { - this._progressListeners.push(listener); - } - addProgressiveReadListener(listener) { - this._progressiveReadListeners.push(listener); - } - addProgressiveDoneListener(listener) { - this._progressiveDoneListeners.push(listener); - } - onDataRange(begin, chunk) { - for (const listener of this._rangeListeners) { - listener(begin, chunk); - } - } - onDataProgress(loaded, total) { - this._readyCapability.promise.then(() => { - for (const listener of this._progressListeners) { - listener(loaded, total); - } - }); - } - onDataProgressiveRead(chunk) { - this._readyCapability.promise.then(() => { - for (const listener of this._progressiveReadListeners) { - listener(chunk); - } - }); - } - onDataProgressiveDone() { - this._readyCapability.promise.then(() => { - for (const listener of this._progressiveDoneListeners) { - listener(); - } - }); - } - transportReady() { - this._readyCapability.resolve(); - } - requestDataRange(begin, end) { - (0, _util.unreachable)("Abstract method PDFDataRangeTransport.requestDataRange"); - } - abort() {} -} -exports.PDFDataRangeTransport = PDFDataRangeTransport; -class PDFDocumentProxy { - constructor(pdfInfo, transport) { - this._pdfInfo = pdfInfo; - this._transport = transport; - } - get annotationStorage() { - return this._transport.annotationStorage; - } - get numPages() { - return this._pdfInfo.numPages; - } - get fingerprints() { - return this._pdfInfo.fingerprints; - } - get isPureXfa() { - return (0, _util.shadow)(this, "isPureXfa", !!this._transport._htmlForXfa); - } - get allXfaHtml() { - return this._transport._htmlForXfa; - } - getPage(pageNumber) { - return this._transport.getPage(pageNumber); - } - getPageIndex(ref) { - return this._transport.getPageIndex(ref); - } - getDestinations() { - return this._transport.getDestinations(); - } - getDestination(id) { - return this._transport.getDestination(id); - } - getPageLabels() { - return this._transport.getPageLabels(); - } - getPageLayout() { - return this._transport.getPageLayout(); - } - getPageMode() { - return this._transport.getPageMode(); - } - getViewerPreferences() { - return this._transport.getViewerPreferences(); - } - getOpenAction() { - return this._transport.getOpenAction(); - } - getAttachments() { - return this._transport.getAttachments(); - } - getJavaScript() { - return this._transport.getJavaScript(); - } - getJSActions() { - return this._transport.getDocJSActions(); - } - getOutline() { - return this._transport.getOutline(); - } - getOptionalContentConfig() { - return this._transport.getOptionalContentConfig(); - } - getPermissions() { - return this._transport.getPermissions(); - } - getMetadata() { - return this._transport.getMetadata(); - } - getMarkInfo() { - return this._transport.getMarkInfo(); - } - getData() { - return this._transport.getData(); - } - saveDocument() { - return this._transport.saveDocument(); - } - getDownloadInfo() { - return this._transport.downloadInfoCapability.promise; - } - cleanup(keepLoadedFonts = false) { - return this._transport.startCleanup(keepLoadedFonts || this.isPureXfa); - } - destroy() { - return this.loadingTask.destroy(); - } - get loadingParams() { - return this._transport.loadingParams; - } - get loadingTask() { - return this._transport.loadingTask; - } - getFieldObjects() { - return this._transport.getFieldObjects(); - } - hasJSActions() { - return this._transport.hasJSActions(); - } - getCalculationOrderIds() { - return this._transport.getCalculationOrderIds(); - } -} -exports.PDFDocumentProxy = PDFDocumentProxy; -class PDFPageProxy { - constructor(pageIndex, pageInfo, transport, ownerDocument, pdfBug = false) { - this._pageIndex = pageIndex; - this._pageInfo = pageInfo; - this._ownerDocument = ownerDocument; - this._transport = transport; - this._stats = pdfBug ? new _display_utils.StatTimer() : null; - this._pdfBug = pdfBug; - this.commonObjs = transport.commonObjs; - this.objs = new PDFObjects(); - this.cleanupAfterRender = false; - this.pendingCleanup = false; - this._intentStates = new Map(); - this.destroyed = false; - } - get pageNumber() { - return this._pageIndex + 1; - } - get rotate() { - return this._pageInfo.rotate; - } - get ref() { - return this._pageInfo.ref; - } - get userUnit() { - return this._pageInfo.userUnit; - } - get view() { - return this._pageInfo.view; - } - getViewport({ - scale, - rotation = this.rotate, - offsetX = 0, - offsetY = 0, - dontFlip = false - } = {}) { - return new _display_utils.PageViewport({ - viewBox: this.view, - scale, - rotation, - offsetX, - offsetY, - dontFlip - }); - } - getAnnotations({ - intent = "display" - } = {}) { - const intentArgs = this._transport.getRenderingIntent(intent); - return this._transport.getAnnotations(this._pageIndex, intentArgs.renderingIntent); - } - getJSActions() { - return this._transport.getPageJSActions(this._pageIndex); - } - get isPureXfa() { - return (0, _util.shadow)(this, "isPureXfa", !!this._transport._htmlForXfa); - } - async getXfa() { - return this._transport._htmlForXfa?.children[this._pageIndex] || null; - } - render({ - canvasContext, - viewport, - intent = "display", - annotationMode = _util.AnnotationMode.ENABLE, - transform = null, - canvasFactory = null, - background = null, - optionalContentConfigPromise = null, - annotationCanvasMap = null, - pageColors = null, - printAnnotationStorage = null - }) { - this._stats?.time("Overall"); - const intentArgs = this._transport.getRenderingIntent(intent, annotationMode, printAnnotationStorage); - this.pendingCleanup = false; - if (!optionalContentConfigPromise) { - optionalContentConfigPromise = this._transport.getOptionalContentConfig(); - } - let intentState = this._intentStates.get(intentArgs.cacheKey); - if (!intentState) { - intentState = Object.create(null); - this._intentStates.set(intentArgs.cacheKey, intentState); - } - if (intentState.streamReaderCancelTimeout) { - clearTimeout(intentState.streamReaderCancelTimeout); - intentState.streamReaderCancelTimeout = null; - } - const canvasFactoryInstance = canvasFactory || new DefaultCanvasFactory({ - ownerDocument: this._ownerDocument - }); - const intentPrint = !!(intentArgs.renderingIntent & _util.RenderingIntentFlag.PRINT); - if (!intentState.displayReadyCapability) { - intentState.displayReadyCapability = (0, _util.createPromiseCapability)(); - intentState.operatorList = { - fnArray: [], - argsArray: [], - lastChunk: false, - separateAnnots: null - }; - this._stats?.time("Page Request"); - this._pumpOperatorList(intentArgs); - } - const complete = error => { - intentState.renderTasks.delete(internalRenderTask); - if (this.cleanupAfterRender || intentPrint) { - this.pendingCleanup = true; - } - this._tryCleanup(); - if (error) { - internalRenderTask.capability.reject(error); - this._abortOperatorList({ - intentState, - reason: error instanceof Error ? error : new Error(error) - }); - } else { - internalRenderTask.capability.resolve(); - } - this._stats?.timeEnd("Rendering"); - this._stats?.timeEnd("Overall"); - }; - const internalRenderTask = new InternalRenderTask({ - callback: complete, - params: { - canvasContext, - viewport, - transform, - background - }, - objs: this.objs, - commonObjs: this.commonObjs, - annotationCanvasMap, - operatorList: intentState.operatorList, - pageIndex: this._pageIndex, - canvasFactory: canvasFactoryInstance, - useRequestAnimationFrame: !intentPrint, - pdfBug: this._pdfBug, - pageColors - }); - (intentState.renderTasks ||= new Set()).add(internalRenderTask); - const renderTask = internalRenderTask.task; - Promise.all([intentState.displayReadyCapability.promise, optionalContentConfigPromise]).then(([transparency, optionalContentConfig]) => { - if (this.pendingCleanup) { - complete(); - return; - } - this._stats?.time("Rendering"); - internalRenderTask.initializeGraphics({ - transparency, - optionalContentConfig - }); - internalRenderTask.operatorListChanged(); - }).catch(complete); - return renderTask; - } - getOperatorList({ - intent = "display", - annotationMode = _util.AnnotationMode.ENABLE, - printAnnotationStorage = null - } = {}) { - function operatorListChanged() { - if (intentState.operatorList.lastChunk) { - intentState.opListReadCapability.resolve(intentState.operatorList); - intentState.renderTasks.delete(opListTask); - } - } - const intentArgs = this._transport.getRenderingIntent(intent, annotationMode, printAnnotationStorage, true); - let intentState = this._intentStates.get(intentArgs.cacheKey); - if (!intentState) { - intentState = Object.create(null); - this._intentStates.set(intentArgs.cacheKey, intentState); - } - let opListTask; - if (!intentState.opListReadCapability) { - opListTask = Object.create(null); - opListTask.operatorListChanged = operatorListChanged; - intentState.opListReadCapability = (0, _util.createPromiseCapability)(); - (intentState.renderTasks ||= new Set()).add(opListTask); - intentState.operatorList = { - fnArray: [], - argsArray: [], - lastChunk: false, - separateAnnots: null - }; - this._stats?.time("Page Request"); - this._pumpOperatorList(intentArgs); - } - return intentState.opListReadCapability.promise; - } - streamTextContent({ - disableCombineTextItems = false, - includeMarkedContent = false - } = {}) { - const TEXT_CONTENT_CHUNK_SIZE = 100; - return this._transport.messageHandler.sendWithStream("GetTextContent", { - pageIndex: this._pageIndex, - combineTextItems: disableCombineTextItems !== true, - includeMarkedContent: includeMarkedContent === true - }, { - highWaterMark: TEXT_CONTENT_CHUNK_SIZE, - size(textContent) { - return textContent.items.length; - } - }); - } - getTextContent(params = {}) { - if (this._transport._htmlForXfa) { - return this.getXfa().then(xfa => { - return _xfa_text.XfaText.textContent(xfa); - }); - } - const readableStream = this.streamTextContent(params); - return new Promise(function (resolve, reject) { - function pump() { - reader.read().then(function ({ - value, - done - }) { - if (done) { - resolve(textContent); - return; - } - Object.assign(textContent.styles, value.styles); - textContent.items.push(...value.items); - pump(); - }, reject); - } - const reader = readableStream.getReader(); - const textContent = { - items: [], - styles: Object.create(null) - }; - pump(); - }); - } - getStructTree() { - return this._transport.getStructTree(this._pageIndex); - } - _destroy() { - this.destroyed = true; - const waitOn = []; - for (const intentState of this._intentStates.values()) { - this._abortOperatorList({ - intentState, - reason: new Error("Page was destroyed."), - force: true - }); - if (intentState.opListReadCapability) { - continue; - } - for (const internalRenderTask of intentState.renderTasks) { - waitOn.push(internalRenderTask.completed); - internalRenderTask.cancel(); - } - } - this.objs.clear(); - this.pendingCleanup = false; - return Promise.all(waitOn); - } - cleanup(resetStats = false) { - this.pendingCleanup = true; - return this._tryCleanup(resetStats); - } - _tryCleanup(resetStats = false) { - if (!this.pendingCleanup) { - return false; - } - for (const { - renderTasks, - operatorList - } of this._intentStates.values()) { - if (renderTasks.size > 0 || !operatorList.lastChunk) { - return false; - } - } - this._intentStates.clear(); - this.objs.clear(); - if (resetStats && this._stats) { - this._stats = new _display_utils.StatTimer(); - } - this.pendingCleanup = false; - return true; - } - _startRenderPage(transparency, cacheKey) { - const intentState = this._intentStates.get(cacheKey); - if (!intentState) { - return; - } - this._stats?.timeEnd("Page Request"); - intentState.displayReadyCapability?.resolve(transparency); - } - _renderPageChunk(operatorListChunk, intentState) { - for (let i = 0, ii = operatorListChunk.length; i < ii; i++) { - intentState.operatorList.fnArray.push(operatorListChunk.fnArray[i]); - intentState.operatorList.argsArray.push(operatorListChunk.argsArray[i]); - } - intentState.operatorList.lastChunk = operatorListChunk.lastChunk; - intentState.operatorList.separateAnnots = operatorListChunk.separateAnnots; - for (const internalRenderTask of intentState.renderTasks) { - internalRenderTask.operatorListChanged(); - } - if (operatorListChunk.lastChunk) { - this._tryCleanup(); - } - } - _pumpOperatorList({ - renderingIntent, - cacheKey, - annotationStorageMap - }) { - const readableStream = this._transport.messageHandler.sendWithStream("GetOperatorList", { - pageIndex: this._pageIndex, - intent: renderingIntent, - cacheKey, - annotationStorage: annotationStorageMap - }); - const reader = readableStream.getReader(); - const intentState = this._intentStates.get(cacheKey); - intentState.streamReader = reader; - const pump = () => { - reader.read().then(({ - value, - done - }) => { - if (done) { - intentState.streamReader = null; - return; - } - if (this._transport.destroyed) { - return; - } - this._renderPageChunk(value, intentState); - pump(); - }, reason => { - intentState.streamReader = null; - if (this._transport.destroyed) { - return; - } - if (intentState.operatorList) { - intentState.operatorList.lastChunk = true; - for (const internalRenderTask of intentState.renderTasks) { - internalRenderTask.operatorListChanged(); - } - this._tryCleanup(); - } - if (intentState.displayReadyCapability) { - intentState.displayReadyCapability.reject(reason); - } else if (intentState.opListReadCapability) { - intentState.opListReadCapability.reject(reason); - } else { - throw reason; - } - }); - }; - pump(); - } - _abortOperatorList({ - intentState, - reason, - force = false - }) { - if (!intentState.streamReader) { - return; - } - if (intentState.streamReaderCancelTimeout) { - clearTimeout(intentState.streamReaderCancelTimeout); - intentState.streamReaderCancelTimeout = null; - } - if (!force) { - if (intentState.renderTasks.size > 0) { - return; - } - if (reason instanceof _display_utils.RenderingCancelledException) { - let delay = RENDERING_CANCELLED_TIMEOUT; - if (reason.extraDelay > 0 && reason.extraDelay < 1000) { - delay += reason.extraDelay; - } - intentState.streamReaderCancelTimeout = setTimeout(() => { - intentState.streamReaderCancelTimeout = null; - this._abortOperatorList({ - intentState, - reason, - force: true - }); - }, delay); - return; - } - } - intentState.streamReader.cancel(new _util.AbortException(reason.message)).catch(() => {}); - intentState.streamReader = null; - if (this._transport.destroyed) { - return; - } - for (const [curCacheKey, curIntentState] of this._intentStates) { - if (curIntentState === intentState) { - this._intentStates.delete(curCacheKey); - break; - } - } - this.cleanup(); - } - get stats() { - return this._stats; - } -} -exports.PDFPageProxy = PDFPageProxy; -class LoopbackPort { - #listeners = new Set(); - #deferred = Promise.resolve(); - postMessage(obj, transfers) { - const event = { - data: structuredClone(obj, transfers) - }; - this.#deferred.then(() => { - for (const listener of this.#listeners) { - listener.call(this, event); - } - }); - } - addEventListener(name, listener) { - this.#listeners.add(listener); - } - removeEventListener(name, listener) { - this.#listeners.delete(listener); - } - terminate() { - this.#listeners.clear(); - } -} -exports.LoopbackPort = LoopbackPort; -const PDFWorkerUtil = { - isWorkerDisabled: false, - fallbackWorkerSrc: null, - fakeWorkerId: 0 -}; -exports.PDFWorkerUtil = PDFWorkerUtil; -{ - if (_is_node.isNodeJS && typeof require === "function") { - PDFWorkerUtil.isWorkerDisabled = true; - PDFWorkerUtil.fallbackWorkerSrc = "./pdf.worker.js"; - } else if (typeof document === "object") { - const pdfjsFilePath = document?.currentScript?.src; - if (pdfjsFilePath) { - PDFWorkerUtil.fallbackWorkerSrc = pdfjsFilePath.replace(/(\.(?:min\.)?js)(\?.*)?$/i, ".worker$1$2"); - } - } - PDFWorkerUtil.isSameOrigin = function (baseUrl, otherUrl) { - let base; - try { - base = new URL(baseUrl); - if (!base.origin || base.origin === "null") { - return false; - } - } catch (e) { - return false; - } - const other = new URL(otherUrl, base); - return base.origin === other.origin; - }; - PDFWorkerUtil.createCDNWrapper = function (url) { - const wrapper = `importScripts("${url}");`; - return URL.createObjectURL(new Blob([wrapper])); - }; -} -class PDFWorker { - static #workerPorts = new WeakMap(); - constructor({ - name = null, - port = null, - verbosity = (0, _util.getVerbosityLevel)() - } = {}) { - if (port && PDFWorker.#workerPorts.has(port)) { - throw new Error("Cannot use more than one PDFWorker per port."); - } - this.name = name; - this.destroyed = false; - this.verbosity = verbosity; - this._readyCapability = (0, _util.createPromiseCapability)(); - this._port = null; - this._webWorker = null; - this._messageHandler = null; - if (port) { - PDFWorker.#workerPorts.set(port, this); - this._initializeFromPort(port); - return; - } - this._initialize(); - } - get promise() { - return this._readyCapability.promise; - } - get port() { - return this._port; - } - get messageHandler() { - return this._messageHandler; - } - _initializeFromPort(port) { - this._port = port; - this._messageHandler = new _message_handler.MessageHandler("main", "worker", port); - this._messageHandler.on("ready", function () {}); - this._readyCapability.resolve(); - this._messageHandler.send("configure", { - verbosity: this.verbosity - }); - } - _initialize() { - if (!PDFWorkerUtil.isWorkerDisabled && !PDFWorker._mainThreadWorkerMessageHandler) { - let { - workerSrc - } = PDFWorker; - try { - if (!PDFWorkerUtil.isSameOrigin(window.location.href, workerSrc)) { - workerSrc = PDFWorkerUtil.createCDNWrapper(new URL(workerSrc, window.location).href); - } - const worker = new Worker(workerSrc); - const messageHandler = new _message_handler.MessageHandler("main", "worker", worker); - const terminateEarly = () => { - worker.removeEventListener("error", onWorkerError); - messageHandler.destroy(); - worker.terminate(); - if (this.destroyed) { - this._readyCapability.reject(new Error("Worker was destroyed")); - } else { - this._setupFakeWorker(); - } - }; - const onWorkerError = () => { - if (!this._webWorker) { - terminateEarly(); - } - }; - worker.addEventListener("error", onWorkerError); - messageHandler.on("test", data => { - worker.removeEventListener("error", onWorkerError); - if (this.destroyed) { - terminateEarly(); - return; - } - if (data) { - this._messageHandler = messageHandler; - this._port = worker; - this._webWorker = worker; - this._readyCapability.resolve(); - messageHandler.send("configure", { - verbosity: this.verbosity - }); - } else { - this._setupFakeWorker(); - messageHandler.destroy(); - worker.terminate(); - } - }); - messageHandler.on("ready", data => { - worker.removeEventListener("error", onWorkerError); - if (this.destroyed) { - terminateEarly(); - return; - } - try { - sendTest(); - } catch (e) { - this._setupFakeWorker(); - } - }); - const sendTest = () => { - const testObj = new Uint8Array(); - messageHandler.send("test", testObj, [testObj.buffer]); - }; - sendTest(); - return; - } catch (e) { - (0, _util.info)("The worker has been disabled."); - } - } - this._setupFakeWorker(); - } - _setupFakeWorker() { - if (!PDFWorkerUtil.isWorkerDisabled) { - (0, _util.warn)("Setting up fake worker."); - PDFWorkerUtil.isWorkerDisabled = true; - } - PDFWorker._setupFakeWorkerGlobal.then(WorkerMessageHandler => { - if (this.destroyed) { - this._readyCapability.reject(new Error("Worker was destroyed")); - return; - } - const port = new LoopbackPort(); - this._port = port; - const id = `fake${PDFWorkerUtil.fakeWorkerId++}`; - const workerHandler = new _message_handler.MessageHandler(id + "_worker", id, port); - WorkerMessageHandler.setup(workerHandler, port); - const messageHandler = new _message_handler.MessageHandler(id, id + "_worker", port); - this._messageHandler = messageHandler; - this._readyCapability.resolve(); - messageHandler.send("configure", { - verbosity: this.verbosity - }); - }).catch(reason => { - this._readyCapability.reject(new Error(`Setting up fake worker failed: "${reason.message}".`)); - }); - } - destroy() { - this.destroyed = true; - if (this._webWorker) { - this._webWorker.terminate(); - this._webWorker = null; - } - PDFWorker.#workerPorts.delete(this._port); - this._port = null; - if (this._messageHandler) { - this._messageHandler.destroy(); - this._messageHandler = null; - } - } - static fromPort(params) { - if (!params?.port) { - throw new Error("PDFWorker.fromPort - invalid method signature."); - } - if (this.#workerPorts.has(params.port)) { - return this.#workerPorts.get(params.port); - } - return new PDFWorker(params); - } - static get workerSrc() { - if (_worker_options.GlobalWorkerOptions.workerSrc) { - return _worker_options.GlobalWorkerOptions.workerSrc; - } - if (PDFWorkerUtil.fallbackWorkerSrc !== null) { - if (!_is_node.isNodeJS) { - (0, _display_utils.deprecated)('No "GlobalWorkerOptions.workerSrc" specified.'); - } - return PDFWorkerUtil.fallbackWorkerSrc; - } - throw new Error('No "GlobalWorkerOptions.workerSrc" specified.'); - } - static get _mainThreadWorkerMessageHandler() { - try { - return globalThis.pdfjsWorker?.WorkerMessageHandler || null; - } catch (ex) { - return null; - } - } - static get _setupFakeWorkerGlobal() { - const loader = async () => { - const mainWorkerMessageHandler = this._mainThreadWorkerMessageHandler; - if (mainWorkerMessageHandler) { - return mainWorkerMessageHandler; - } - if (_is_node.isNodeJS && typeof require === "function") { - const worker = eval("require")(this.workerSrc); - return worker.WorkerMessageHandler; - } - await (0, _display_utils.loadScript)(this.workerSrc); - return window.pdfjsWorker.WorkerMessageHandler; - }; - return (0, _util.shadow)(this, "_setupFakeWorkerGlobal", loader()); - } -} -exports.PDFWorker = PDFWorker; -class WorkerTransport { - #methodPromises = new Map(); - #pageCache = new Map(); - #pagePromises = new Map(); - constructor(messageHandler, loadingTask, networkStream, params, factory) { - this.messageHandler = messageHandler; - this.loadingTask = loadingTask; - this.commonObjs = new PDFObjects(); - this.fontLoader = new _font_loader.FontLoader({ - onUnsupportedFeature: this._onUnsupportedFeature.bind(this), - ownerDocument: params.ownerDocument, - styleElement: params.styleElement - }); - this._params = params; - this.cMapReaderFactory = factory?.cMapReaderFactory; - this.standardFontDataFactory = factory?.standardFontDataFactory; - this.destroyed = false; - this.destroyCapability = null; - this._passwordCapability = null; - this._networkStream = networkStream; - this._fullReader = null; - this._lastProgress = null; - this.downloadInfoCapability = (0, _util.createPromiseCapability)(); - this.setupMessageHandler(); - } - #cacheSimpleMethod(name, data = null) { - const cachedPromise = this.#methodPromises.get(name); - if (cachedPromise) { - return cachedPromise; - } - const promise = this.messageHandler.sendWithPromise(name, data); - this.#methodPromises.set(name, promise); - return promise; - } - get annotationStorage() { - return (0, _util.shadow)(this, "annotationStorage", new _annotation_storage.AnnotationStorage()); - } - getRenderingIntent(intent, annotationMode = _util.AnnotationMode.ENABLE, printAnnotationStorage = null, isOpList = false) { - let renderingIntent = _util.RenderingIntentFlag.DISPLAY; - let annotationMap = null; - switch (intent) { - case "any": - renderingIntent = _util.RenderingIntentFlag.ANY; - break; - case "display": - break; - case "print": - renderingIntent = _util.RenderingIntentFlag.PRINT; - break; - default: - (0, _util.warn)(`getRenderingIntent - invalid intent: ${intent}`); - } - switch (annotationMode) { - case _util.AnnotationMode.DISABLE: - renderingIntent += _util.RenderingIntentFlag.ANNOTATIONS_DISABLE; - break; - case _util.AnnotationMode.ENABLE: - break; - case _util.AnnotationMode.ENABLE_FORMS: - renderingIntent += _util.RenderingIntentFlag.ANNOTATIONS_FORMS; - break; - case _util.AnnotationMode.ENABLE_STORAGE: - renderingIntent += _util.RenderingIntentFlag.ANNOTATIONS_STORAGE; - const annotationStorage = renderingIntent & _util.RenderingIntentFlag.PRINT && printAnnotationStorage instanceof _annotation_storage.PrintAnnotationStorage ? printAnnotationStorage : this.annotationStorage; - annotationMap = annotationStorage.serializable; - break; - default: - (0, _util.warn)(`getRenderingIntent - invalid annotationMode: ${annotationMode}`); - } - if (isOpList) { - renderingIntent += _util.RenderingIntentFlag.OPLIST; - } - return { - renderingIntent, - cacheKey: `${renderingIntent}_${_annotation_storage.AnnotationStorage.getHash(annotationMap)}`, - annotationStorageMap: annotationMap - }; - } - destroy() { - if (this.destroyCapability) { - return this.destroyCapability.promise; - } - this.destroyed = true; - this.destroyCapability = (0, _util.createPromiseCapability)(); - if (this._passwordCapability) { - this._passwordCapability.reject(new Error("Worker was destroyed during onPassword callback")); - } - const waitOn = []; - for (const page of this.#pageCache.values()) { - waitOn.push(page._destroy()); - } - this.#pageCache.clear(); - this.#pagePromises.clear(); - if (this.hasOwnProperty("annotationStorage")) { - this.annotationStorage.resetModified(); - } - const terminated = this.messageHandler.sendWithPromise("Terminate", null); - waitOn.push(terminated); - Promise.all(waitOn).then(() => { - this.commonObjs.clear(); - this.fontLoader.clear(); - this.#methodPromises.clear(); - if (this._networkStream) { - this._networkStream.cancelAllRequests(new _util.AbortException("Worker was terminated.")); - } - if (this.messageHandler) { - this.messageHandler.destroy(); - this.messageHandler = null; - } - this.destroyCapability.resolve(); - }, this.destroyCapability.reject); - return this.destroyCapability.promise; - } - setupMessageHandler() { - const { - messageHandler, - loadingTask - } = this; - messageHandler.on("GetReader", (data, sink) => { - (0, _util.assert)(this._networkStream, "GetReader - no `IPDFStream` instance available."); - this._fullReader = this._networkStream.getFullReader(); - this._fullReader.onProgress = evt => { - this._lastProgress = { - loaded: evt.loaded, - total: evt.total - }; - }; - sink.onPull = () => { - this._fullReader.read().then(function ({ - value, - done - }) { - if (done) { - sink.close(); - return; - } - (0, _util.assert)(value instanceof ArrayBuffer, "GetReader - expected an ArrayBuffer."); - sink.enqueue(new Uint8Array(value), 1, [value]); - }).catch(reason => { - sink.error(reason); - }); - }; - sink.onCancel = reason => { - this._fullReader.cancel(reason); - sink.ready.catch(readyReason => { - if (this.destroyed) { - return; - } - throw readyReason; - }); - }; - }); - messageHandler.on("ReaderHeadersReady", data => { - const headersCapability = (0, _util.createPromiseCapability)(); - const fullReader = this._fullReader; - fullReader.headersReady.then(() => { - if (!fullReader.isStreamingSupported || !fullReader.isRangeSupported) { - if (this._lastProgress) { - loadingTask.onProgress?.(this._lastProgress); - } - fullReader.onProgress = evt => { - loadingTask.onProgress?.({ - loaded: evt.loaded, - total: evt.total - }); - }; - } - headersCapability.resolve({ - isStreamingSupported: fullReader.isStreamingSupported, - isRangeSupported: fullReader.isRangeSupported, - contentLength: fullReader.contentLength - }); - }, headersCapability.reject); - return headersCapability.promise; - }); - messageHandler.on("GetRangeReader", (data, sink) => { - (0, _util.assert)(this._networkStream, "GetRangeReader - no `IPDFStream` instance available."); - const rangeReader = this._networkStream.getRangeReader(data.begin, data.end); - if (!rangeReader) { - sink.close(); - return; - } - sink.onPull = () => { - rangeReader.read().then(function ({ - value, - done - }) { - if (done) { - sink.close(); - return; - } - (0, _util.assert)(value instanceof ArrayBuffer, "GetRangeReader - expected an ArrayBuffer."); - sink.enqueue(new Uint8Array(value), 1, [value]); - }).catch(reason => { - sink.error(reason); - }); - }; - sink.onCancel = reason => { - rangeReader.cancel(reason); - sink.ready.catch(readyReason => { - if (this.destroyed) { - return; - } - throw readyReason; - }); - }; - }); - messageHandler.on("GetDoc", ({ - pdfInfo - }) => { - this._numPages = pdfInfo.numPages; - this._htmlForXfa = pdfInfo.htmlForXfa; - delete pdfInfo.htmlForXfa; - loadingTask._capability.resolve(new PDFDocumentProxy(pdfInfo, this)); - }); - messageHandler.on("DocException", function (ex) { - let reason; - switch (ex.name) { - case "PasswordException": - reason = new _util.PasswordException(ex.message, ex.code); - break; - case "InvalidPDFException": - reason = new _util.InvalidPDFException(ex.message); - break; - case "MissingPDFException": - reason = new _util.MissingPDFException(ex.message); - break; - case "UnexpectedResponseException": - reason = new _util.UnexpectedResponseException(ex.message, ex.status); - break; - case "UnknownErrorException": - reason = new _util.UnknownErrorException(ex.message, ex.details); - break; - default: - (0, _util.unreachable)("DocException - expected a valid Error."); - } - loadingTask._capability.reject(reason); - }); - messageHandler.on("PasswordRequest", exception => { - this._passwordCapability = (0, _util.createPromiseCapability)(); - if (loadingTask.onPassword) { - const updatePassword = password => { - if (password instanceof Error) { - this._passwordCapability.reject(password); - } else { - this._passwordCapability.resolve({ - password - }); - } - }; - try { - loadingTask.onPassword(updatePassword, exception.code); - } catch (ex) { - this._passwordCapability.reject(ex); - } - } else { - this._passwordCapability.reject(new _util.PasswordException(exception.message, exception.code)); - } - return this._passwordCapability.promise; - }); - messageHandler.on("DataLoaded", data => { - loadingTask.onProgress?.({ - loaded: data.length, - total: data.length - }); - this.downloadInfoCapability.resolve(data); - }); - messageHandler.on("StartRenderPage", data => { - if (this.destroyed) { - return; - } - const page = this.#pageCache.get(data.pageIndex); - page._startRenderPage(data.transparency, data.cacheKey); - }); - messageHandler.on("commonobj", ([id, type, exportedData]) => { - if (this.destroyed) { - return; - } - if (this.commonObjs.has(id)) { - return; - } - switch (type) { - case "Font": - const params = this._params; - if ("error" in exportedData) { - const exportedError = exportedData.error; - (0, _util.warn)(`Error during font loading: ${exportedError}`); - this.commonObjs.resolve(id, exportedError); - break; - } - let fontRegistry = null; - if (params.pdfBug && globalThis.FontInspector?.enabled) { - fontRegistry = { - registerFont(font, url) { - globalThis.FontInspector.fontAdded(font, url); - } - }; - } - const font = new _font_loader.FontFaceObject(exportedData, { - isEvalSupported: params.isEvalSupported, - disableFontFace: params.disableFontFace, - ignoreErrors: params.ignoreErrors, - onUnsupportedFeature: this._onUnsupportedFeature.bind(this), - fontRegistry - }); - this.fontLoader.bind(font).catch(reason => { - return messageHandler.sendWithPromise("FontFallback", { - id - }); - }).finally(() => { - if (!params.fontExtraProperties && font.data) { - font.data = null; - } - this.commonObjs.resolve(id, font); - }); - break; - case "FontPath": - case "Image": - this.commonObjs.resolve(id, exportedData); - break; - default: - throw new Error(`Got unknown common object type ${type}`); - } - }); - messageHandler.on("obj", ([id, pageIndex, type, imageData]) => { - if (this.destroyed) { - return; - } - const pageProxy = this.#pageCache.get(pageIndex); - if (pageProxy.objs.has(id)) { - return; - } - switch (type) { - case "Image": - pageProxy.objs.resolve(id, imageData); - const MAX_IMAGE_SIZE_TO_STORE = 8000000; - if (imageData) { - let length; - if (imageData.bitmap) { - const { - width, - height - } = imageData; - length = width * height * 4; - } else { - length = imageData.data?.length || 0; - } - if (length > MAX_IMAGE_SIZE_TO_STORE) { - pageProxy.cleanupAfterRender = true; - } - } - break; - case "Pattern": - pageProxy.objs.resolve(id, imageData); - break; - default: - throw new Error(`Got unknown object type ${type}`); - } - }); - messageHandler.on("DocProgress", data => { - if (this.destroyed) { - return; - } - loadingTask.onProgress?.({ - loaded: data.loaded, - total: data.total - }); - }); - messageHandler.on("UnsupportedFeature", this._onUnsupportedFeature.bind(this)); - messageHandler.on("FetchBuiltInCMap", data => { - if (this.destroyed) { - return Promise.reject(new Error("Worker was destroyed.")); - } - if (!this.cMapReaderFactory) { - return Promise.reject(new Error("CMapReaderFactory not initialized, see the `useWorkerFetch` parameter.")); - } - return this.cMapReaderFactory.fetch(data); - }); - messageHandler.on("FetchStandardFontData", data => { - if (this.destroyed) { - return Promise.reject(new Error("Worker was destroyed.")); - } - if (!this.standardFontDataFactory) { - return Promise.reject(new Error("StandardFontDataFactory not initialized, see the `useWorkerFetch` parameter.")); - } - return this.standardFontDataFactory.fetch(data); - }); - } - _onUnsupportedFeature({ - featureId - }) { - if (this.destroyed) { - return; - } - this.loadingTask.onUnsupportedFeature?.(featureId); - } - getData() { - return this.messageHandler.sendWithPromise("GetData", null); - } - saveDocument() { - if (this.annotationStorage.size <= 0) { - (0, _util.warn)("saveDocument called while `annotationStorage` is empty, " + "please use the getData-method instead."); - } - return this.messageHandler.sendWithPromise("SaveDocument", { - isPureXfa: !!this._htmlForXfa, - numPages: this._numPages, - annotationStorage: this.annotationStorage.serializable, - filename: this._fullReader?.filename ?? null - }).finally(() => { - this.annotationStorage.resetModified(); - }); - } - getPage(pageNumber) { - if (!Number.isInteger(pageNumber) || pageNumber <= 0 || pageNumber > this._numPages) { - return Promise.reject(new Error("Invalid page request.")); - } - const pageIndex = pageNumber - 1, - cachedPromise = this.#pagePromises.get(pageIndex); - if (cachedPromise) { - return cachedPromise; - } - const promise = this.messageHandler.sendWithPromise("GetPage", { - pageIndex - }).then(pageInfo => { - if (this.destroyed) { - throw new Error("Transport destroyed"); - } - const page = new PDFPageProxy(pageIndex, pageInfo, this, this._params.ownerDocument, this._params.pdfBug); - this.#pageCache.set(pageIndex, page); - return page; - }); - this.#pagePromises.set(pageIndex, promise); - return promise; - } - getPageIndex(ref) { - if (typeof ref !== "object" || ref === null || !Number.isInteger(ref.num) || ref.num < 0 || !Number.isInteger(ref.gen) || ref.gen < 0) { - return Promise.reject(new Error("Invalid pageIndex request.")); - } - return this.messageHandler.sendWithPromise("GetPageIndex", { - num: ref.num, - gen: ref.gen - }); - } - getAnnotations(pageIndex, intent) { - return this.messageHandler.sendWithPromise("GetAnnotations", { - pageIndex, - intent - }); - } - getFieldObjects() { - return this.#cacheSimpleMethod("GetFieldObjects"); - } - hasJSActions() { - return this.#cacheSimpleMethod("HasJSActions"); - } - getCalculationOrderIds() { - return this.messageHandler.sendWithPromise("GetCalculationOrderIds", null); - } - getDestinations() { - return this.messageHandler.sendWithPromise("GetDestinations", null); - } - getDestination(id) { - if (typeof id !== "string") { - return Promise.reject(new Error("Invalid destination request.")); - } - return this.messageHandler.sendWithPromise("GetDestination", { - id - }); - } - getPageLabels() { - return this.messageHandler.sendWithPromise("GetPageLabels", null); - } - getPageLayout() { - return this.messageHandler.sendWithPromise("GetPageLayout", null); - } - getPageMode() { - return this.messageHandler.sendWithPromise("GetPageMode", null); - } - getViewerPreferences() { - return this.messageHandler.sendWithPromise("GetViewerPreferences", null); - } - getOpenAction() { - return this.messageHandler.sendWithPromise("GetOpenAction", null); - } - getAttachments() { - return this.messageHandler.sendWithPromise("GetAttachments", null); - } - getJavaScript() { - return this.messageHandler.sendWithPromise("GetJavaScript", null); - } - getDocJSActions() { - return this.messageHandler.sendWithPromise("GetDocJSActions", null); - } - getPageJSActions(pageIndex) { - return this.messageHandler.sendWithPromise("GetPageJSActions", { - pageIndex - }); - } - getStructTree(pageIndex) { - return this.messageHandler.sendWithPromise("GetStructTree", { - pageIndex - }); - } - getOutline() { - return this.messageHandler.sendWithPromise("GetOutline", null); - } - getOptionalContentConfig() { - return this.messageHandler.sendWithPromise("GetOptionalContentConfig", null).then(results => { - return new _optional_content_config.OptionalContentConfig(results); - }); - } - getPermissions() { - return this.messageHandler.sendWithPromise("GetPermissions", null); - } - getMetadata() { - const name = "GetMetadata", - cachedPromise = this.#methodPromises.get(name); - if (cachedPromise) { - return cachedPromise; - } - const promise = this.messageHandler.sendWithPromise(name, null).then(results => { - return { - info: results[0], - metadata: results[1] ? new _metadata.Metadata(results[1]) : null, - contentDispositionFilename: this._fullReader?.filename ?? null, - contentLength: this._fullReader?.contentLength ?? null - }; - }); - this.#methodPromises.set(name, promise); - return promise; - } - getMarkInfo() { - return this.messageHandler.sendWithPromise("GetMarkInfo", null); - } - async startCleanup(keepLoadedFonts = false) { - if (this.destroyed) { - return; - } - await this.messageHandler.sendWithPromise("Cleanup", null); - for (const page of this.#pageCache.values()) { - const cleanupSuccessful = page.cleanup(); - if (!cleanupSuccessful) { - throw new Error(`startCleanup: Page ${page.pageNumber} is currently rendering.`); - } - } - this.commonObjs.clear(); - if (!keepLoadedFonts) { - this.fontLoader.clear(); - } - this.#methodPromises.clear(); - } - get loadingParams() { - const { - disableAutoFetch, - enableXfa - } = this._params; - return (0, _util.shadow)(this, "loadingParams", { - disableAutoFetch, - enableXfa - }); - } -} -class PDFObjects { - #objs = Object.create(null); - #ensureObj(objId) { - const obj = this.#objs[objId]; - if (obj) { - return obj; - } - return this.#objs[objId] = { - capability: (0, _util.createPromiseCapability)(), - data: null - }; - } - get(objId, callback = null) { - if (callback) { - const obj = this.#ensureObj(objId); - obj.capability.promise.then(() => callback(obj.data)); - return null; - } - const obj = this.#objs[objId]; - if (!obj?.capability.settled) { - throw new Error(`Requesting object that isn't resolved yet ${objId}.`); - } - return obj.data; - } - has(objId) { - const obj = this.#objs[objId]; - return obj?.capability.settled || false; - } - resolve(objId, data = null) { - const obj = this.#ensureObj(objId); - obj.data = data; - obj.capability.resolve(); - } - clear() { - for (const objId in this.#objs) { - const { - data - } = this.#objs[objId]; - data?.bitmap?.close(); - } - this.#objs = Object.create(null); - } -} -class RenderTask { - #internalRenderTask = null; - constructor(internalRenderTask) { - this.#internalRenderTask = internalRenderTask; - this.onContinue = null; - } - get promise() { - return this.#internalRenderTask.capability.promise; - } - cancel(extraDelay = 0) { - this.#internalRenderTask.cancel(null, extraDelay); - } - get separateAnnots() { - const { - separateAnnots - } = this.#internalRenderTask.operatorList; - if (!separateAnnots) { - return false; - } - const { - annotationCanvasMap - } = this.#internalRenderTask; - return separateAnnots.form || separateAnnots.canvas && annotationCanvasMap?.size > 0; - } -} -exports.RenderTask = RenderTask; -class InternalRenderTask { - static #canvasInUse = new WeakSet(); - constructor({ - callback, - params, - objs, - commonObjs, - annotationCanvasMap, - operatorList, - pageIndex, - canvasFactory, - useRequestAnimationFrame = false, - pdfBug = false, - pageColors = null - }) { - this.callback = callback; - this.params = params; - this.objs = objs; - this.commonObjs = commonObjs; - this.annotationCanvasMap = annotationCanvasMap; - this.operatorListIdx = null; - this.operatorList = operatorList; - this._pageIndex = pageIndex; - this.canvasFactory = canvasFactory; - this._pdfBug = pdfBug; - this.pageColors = pageColors; - this.running = false; - this.graphicsReadyCallback = null; - this.graphicsReady = false; - this._useRequestAnimationFrame = useRequestAnimationFrame === true && typeof window !== "undefined"; - this.cancelled = false; - this.capability = (0, _util.createPromiseCapability)(); - this.task = new RenderTask(this); - this._cancelBound = this.cancel.bind(this); - this._continueBound = this._continue.bind(this); - this._scheduleNextBound = this._scheduleNext.bind(this); - this._nextBound = this._next.bind(this); - this._canvas = params.canvasContext.canvas; - } - get completed() { - return this.capability.promise.catch(function () {}); - } - initializeGraphics({ - transparency = false, - optionalContentConfig - }) { - if (this.cancelled) { - return; - } - if (this._canvas) { - if (InternalRenderTask.#canvasInUse.has(this._canvas)) { - throw new Error("Cannot use the same canvas during multiple render() operations. " + "Use different canvas or ensure previous operations were " + "cancelled or completed."); - } - InternalRenderTask.#canvasInUse.add(this._canvas); - } - if (this._pdfBug && globalThis.StepperManager?.enabled) { - this.stepper = globalThis.StepperManager.create(this._pageIndex); - this.stepper.init(this.operatorList); - this.stepper.nextBreakPoint = this.stepper.getNextBreakPoint(); - } - const { - canvasContext, - viewport, - transform, - background - } = this.params; - this.gfx = new _canvas.CanvasGraphics(canvasContext, this.commonObjs, this.objs, this.canvasFactory, { - optionalContentConfig - }, this.annotationCanvasMap, this.pageColors); - this.gfx.beginDrawing({ - transform, - viewport, - transparency, - background - }); - this.operatorListIdx = 0; - this.graphicsReady = true; - this.graphicsReadyCallback?.(); - } - cancel(error = null, extraDelay = 0) { - this.running = false; - this.cancelled = true; - this.gfx?.endDrawing(); - if (this._canvas) { - InternalRenderTask.#canvasInUse.delete(this._canvas); - } - this.callback(error || new _display_utils.RenderingCancelledException(`Rendering cancelled, page ${this._pageIndex + 1}`, "canvas", extraDelay)); - } - operatorListChanged() { - if (!this.graphicsReady) { - if (!this.graphicsReadyCallback) { - this.graphicsReadyCallback = this._continueBound; - } - return; - } - this.stepper?.updateOperatorList(this.operatorList); - if (this.running) { - return; - } - this._continue(); - } - _continue() { - this.running = true; - if (this.cancelled) { - return; - } - if (this.task.onContinue) { - this.task.onContinue(this._scheduleNextBound); - } else { - this._scheduleNext(); - } - } - _scheduleNext() { - if (this._useRequestAnimationFrame) { - window.requestAnimationFrame(() => { - this._nextBound().catch(this._cancelBound); - }); - } else { - Promise.resolve().then(this._nextBound).catch(this._cancelBound); - } - } - async _next() { - if (this.cancelled) { - return; - } - this.operatorListIdx = this.gfx.executeOperatorList(this.operatorList, this.operatorListIdx, this._continueBound, this.stepper); - if (this.operatorListIdx === this.operatorList.argsArray.length) { - this.running = false; - if (this.operatorList.lastChunk) { - this.gfx.endDrawing(); - if (this._canvas) { - InternalRenderTask.#canvasInUse.delete(this._canvas); - } - this.callback(); - } - } - } -} -const version = '3.4.120'; -exports.version = version; -const build = 'af6414988'; -exports.build = build; - -/***/ }), -/* 3 */ -/***/ ((__unused_webpack_module, exports, __w_pdfjs_require__) => { - - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.PrintAnnotationStorage = exports.AnnotationStorage = void 0; -var _util = __w_pdfjs_require__(1); -var _editor = __w_pdfjs_require__(4); -var _murmurhash = __w_pdfjs_require__(8); -class AnnotationStorage { - #modified = false; - #storage = new Map(); - constructor() { - this.onSetModified = null; - this.onResetModified = null; - this.onAnnotationEditor = null; - } - getValue(key, defaultValue) { - const value = this.#storage.get(key); - if (value === undefined) { - return defaultValue; - } - return Object.assign(defaultValue, value); - } - getRawValue(key) { - return this.#storage.get(key); - } - remove(key) { - this.#storage.delete(key); - if (this.#storage.size === 0) { - this.resetModified(); - } - if (typeof this.onAnnotationEditor === "function") { - for (const value of this.#storage.values()) { - if (value instanceof _editor.AnnotationEditor) { - return; - } - } - this.onAnnotationEditor(null); - } - } - setValue(key, value) { - const obj = this.#storage.get(key); - let modified = false; - if (obj !== undefined) { - for (const [entry, val] of Object.entries(value)) { - if (obj[entry] !== val) { - modified = true; - obj[entry] = val; - } - } - } else { - modified = true; - this.#storage.set(key, value); - } - if (modified) { - this.#setModified(); - } - if (value instanceof _editor.AnnotationEditor && typeof this.onAnnotationEditor === "function") { - this.onAnnotationEditor(value.constructor._type); - } - } - has(key) { - return this.#storage.has(key); - } - getAll() { - return this.#storage.size > 0 ? (0, _util.objectFromMap)(this.#storage) : null; - } - setAll(obj) { - for (const [key, val] of Object.entries(obj)) { - this.setValue(key, val); - } - } - get size() { - return this.#storage.size; - } - #setModified() { - if (!this.#modified) { - this.#modified = true; - if (typeof this.onSetModified === "function") { - this.onSetModified(); - } - } - } - resetModified() { - if (this.#modified) { - this.#modified = false; - if (typeof this.onResetModified === "function") { - this.onResetModified(); - } - } - } - get print() { - return new PrintAnnotationStorage(this); - } - get serializable() { - if (this.#storage.size === 0) { - return null; - } - const clone = new Map(); - for (const [key, val] of this.#storage) { - const serialized = val instanceof _editor.AnnotationEditor ? val.serialize() : val; - if (serialized) { - clone.set(key, serialized); - } - } - return clone; - } - static getHash(map) { - if (!map) { - return ""; - } - const hash = new _murmurhash.MurmurHash3_64(); - for (const [key, val] of map) { - hash.update(`${key}:${JSON.stringify(val)}`); - } - return hash.hexdigest(); - } -} -exports.AnnotationStorage = AnnotationStorage; -class PrintAnnotationStorage extends AnnotationStorage { - #serializable = null; - constructor(parent) { - super(); - this.#serializable = structuredClone(parent.serializable); - } - get print() { - (0, _util.unreachable)("Should not call PrintAnnotationStorage.print"); - } - get serializable() { - return this.#serializable; - } -} -exports.PrintAnnotationStorage = PrintAnnotationStorage; - -/***/ }), -/* 4 */ -/***/ ((__unused_webpack_module, exports, __w_pdfjs_require__) => { - - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.AnnotationEditor = void 0; -var _tools = __w_pdfjs_require__(5); -var _util = __w_pdfjs_require__(1); -class AnnotationEditor { - #boundFocusin = this.focusin.bind(this); - #boundFocusout = this.focusout.bind(this); - #hasBeenSelected = false; - #isEditing = false; - #isInEditMode = false; - _uiManager = null; - #zIndex = AnnotationEditor._zIndex++; - static _colorManager = new _tools.ColorManager(); - static _zIndex = 1; - constructor(parameters) { - if (this.constructor === AnnotationEditor) { - (0, _util.unreachable)("Cannot initialize AnnotationEditor."); - } - this.parent = parameters.parent; - this.id = parameters.id; - this.width = this.height = null; - this.pageIndex = parameters.parent.pageIndex; - this.name = parameters.name; - this.div = null; - this._uiManager = parameters.uiManager; - const { - rotation, - rawDims: { - pageWidth, - pageHeight, - pageX, - pageY - } - } = this.parent.viewport; - this.rotation = rotation; - this.pageDimensions = [pageWidth, pageHeight]; - this.pageTranslation = [pageX, pageY]; - const [width, height] = this.parentDimensions; - this.x = parameters.x / width; - this.y = parameters.y / height; - this.isAttachedToDOM = false; - } - static get _defaultLineColor() { - return (0, _util.shadow)(this, "_defaultLineColor", this._colorManager.getHexCode("CanvasText")); - } - addCommands(params) { - this._uiManager.addCommands(params); - } - get currentLayer() { - return this._uiManager.currentLayer; - } - setInBackground() { - this.div.style.zIndex = 0; - } - setInForeground() { - this.div.style.zIndex = this.#zIndex; - } - setParent(parent) { - if (parent !== null) { - this.pageIndex = parent.pageIndex; - this.pageDimensions = parent.pageDimensions; - } - this.parent = parent; - } - focusin(event) { - if (!this.#hasBeenSelected) { - this.parent.setSelected(this); - } else { - this.#hasBeenSelected = false; - } - } - focusout(event) { - if (!this.isAttachedToDOM) { - return; - } - const target = event.relatedTarget; - if (target?.closest(`#${this.id}`)) { - return; - } - event.preventDefault(); - if (!this.parent?.isMultipleSelection) { - this.commitOrRemove(); - } - } - commitOrRemove() { - if (this.isEmpty()) { - this.remove(); - } else { - this.commit(); - } - } - commit() { - this.addToAnnotationStorage(); - } - addToAnnotationStorage() { - this._uiManager.addToAnnotationStorage(this); - } - dragstart(event) { - const rect = this.parent.div.getBoundingClientRect(); - this.startX = event.clientX - rect.x; - this.startY = event.clientY - rect.y; - event.dataTransfer.setData("text/plain", this.id); - event.dataTransfer.effectAllowed = "move"; - } - setAt(x, y, tx, ty) { - const [width, height] = this.parentDimensions; - [tx, ty] = this.screenToPageTranslation(tx, ty); - this.x = (x + tx) / width; - this.y = (y + ty) / height; - this.div.style.left = `${100 * this.x}%`; - this.div.style.top = `${100 * this.y}%`; - } - translate(x, y) { - const [width, height] = this.parentDimensions; - [x, y] = this.screenToPageTranslation(x, y); - this.x += x / width; - this.y += y / height; - this.div.style.left = `${100 * this.x}%`; - this.div.style.top = `${100 * this.y}%`; - } - screenToPageTranslation(x, y) { - switch (this.parentRotation) { - case 90: - return [y, -x]; - case 180: - return [-x, -y]; - case 270: - return [-y, x]; - default: - return [x, y]; - } - } - get parentScale() { - return this._uiManager.viewParameters.realScale; - } - get parentRotation() { - return this._uiManager.viewParameters.rotation; - } - get parentDimensions() { - const { - realScale - } = this._uiManager.viewParameters; - const [pageWidth, pageHeight] = this.pageDimensions; - return [pageWidth * realScale, pageHeight * realScale]; - } - setDims(width, height) { - const [parentWidth, parentHeight] = this.parentDimensions; - this.div.style.width = `${100 * width / parentWidth}%`; - this.div.style.height = `${100 * height / parentHeight}%`; - } - fixDims() { - const { - style - } = this.div; - const { - height, - width - } = style; - const widthPercent = width.endsWith("%"); - const heightPercent = height.endsWith("%"); - if (widthPercent && heightPercent) { - return; - } - const [parentWidth, parentHeight] = this.parentDimensions; - if (!widthPercent) { - style.width = `${100 * parseFloat(width) / parentWidth}%`; - } - if (!heightPercent) { - style.height = `${100 * parseFloat(height) / parentHeight}%`; - } - } - getInitialTranslation() { - return [0, 0]; - } - render() { - this.div = document.createElement("div"); - this.div.setAttribute("data-editor-rotation", (360 - this.rotation) % 360); - this.div.className = this.name; - this.div.setAttribute("id", this.id); - this.div.setAttribute("tabIndex", 0); - this.setInForeground(); - this.div.addEventListener("focusin", this.#boundFocusin); - this.div.addEventListener("focusout", this.#boundFocusout); - const [tx, ty] = this.getInitialTranslation(); - this.translate(tx, ty); - (0, _tools.bindEvents)(this, this.div, ["dragstart", "pointerdown"]); - return this.div; - } - pointerdown(event) { - const { - isMac - } = _util.FeatureTest.platform; - if (event.button !== 0 || event.ctrlKey && isMac) { - event.preventDefault(); - return; - } - if (event.ctrlKey && !isMac || event.shiftKey || event.metaKey && isMac) { - this.parent.toggleSelected(this); - } else { - this.parent.setSelected(this); - } - this.#hasBeenSelected = true; - } - getRect(tx, ty) { - const scale = this.parentScale; - const [pageWidth, pageHeight] = this.pageDimensions; - const [pageX, pageY] = this.pageTranslation; - const shiftX = tx / scale; - const shiftY = ty / scale; - const x = this.x * pageWidth; - const y = this.y * pageHeight; - const width = this.width * pageWidth; - const height = this.height * pageHeight; - switch (this.rotation) { - case 0: - return [x + shiftX + pageX, pageHeight - y - shiftY - height + pageY, x + shiftX + width + pageX, pageHeight - y - shiftY + pageY]; - case 90: - return [x + shiftY + pageX, pageHeight - y + shiftX + pageY, x + shiftY + height + pageX, pageHeight - y + shiftX + width + pageY]; - case 180: - return [x - shiftX - width + pageX, pageHeight - y + shiftY + pageY, x - shiftX + pageX, pageHeight - y + shiftY + height + pageY]; - case 270: - return [x - shiftY - height + pageX, pageHeight - y - shiftX - width + pageY, x - shiftY + pageX, pageHeight - y - shiftX + pageY]; - default: - throw new Error("Invalid rotation"); - } - } - getRectInCurrentCoords(rect, pageHeight) { - const [x1, y1, x2, y2] = rect; - const width = x2 - x1; - const height = y2 - y1; - switch (this.rotation) { - case 0: - return [x1, pageHeight - y2, width, height]; - case 90: - return [x1, pageHeight - y1, height, width]; - case 180: - return [x2, pageHeight - y1, width, height]; - case 270: - return [x2, pageHeight - y2, height, width]; - default: - throw new Error("Invalid rotation"); - } - } - onceAdded() {} - isEmpty() { - return false; - } - enableEditMode() { - this.#isInEditMode = true; - } - disableEditMode() { - this.#isInEditMode = false; - } - isInEditMode() { - return this.#isInEditMode; - } - shouldGetKeyboardEvents() { - return false; - } - needsToBeRebuilt() { - return this.div && !this.isAttachedToDOM; - } - rebuild() { - this.div?.addEventListener("focusin", this.#boundFocusin); - } - serialize() { - (0, _util.unreachable)("An editor must be serializable"); - } - static deserialize(data, parent, uiManager) { - const editor = new this.prototype.constructor({ - parent, - id: parent.getNextId(), - uiManager - }); - editor.rotation = data.rotation; - const [pageWidth, pageHeight] = editor.pageDimensions; - const [x, y, width, height] = editor.getRectInCurrentCoords(data.rect, pageHeight); - editor.x = x / pageWidth; - editor.y = y / pageHeight; - editor.width = width / pageWidth; - editor.height = height / pageHeight; - return editor; - } - remove() { - this.div.removeEventListener("focusin", this.#boundFocusin); - this.div.removeEventListener("focusout", this.#boundFocusout); - if (!this.isEmpty()) { - this.commit(); - } - this.parent.remove(this); - } - select() { - this.div?.classList.add("selectedEditor"); - } - unselect() { - this.div?.classList.remove("selectedEditor"); - } - updateParams(type, value) {} - disableEditing() {} - enableEditing() {} - get propertiesToUpdate() { - return {}; - } - get contentDiv() { - return this.div; - } - get isEditing() { - return this.#isEditing; - } - set isEditing(value) { - this.#isEditing = value; - if (value) { - this.parent.setSelected(this); - this.parent.setActiveEditor(this); - } else { - this.parent.setActiveEditor(null); - } - } -} -exports.AnnotationEditor = AnnotationEditor; - -/***/ }), -/* 5 */ -/***/ ((__unused_webpack_module, exports, __w_pdfjs_require__) => { - - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.KeyboardManager = exports.CommandManager = exports.ColorManager = exports.AnnotationEditorUIManager = void 0; -exports.bindEvents = bindEvents; -exports.opacityToHex = opacityToHex; -var _util = __w_pdfjs_require__(1); -var _display_utils = __w_pdfjs_require__(6); -function bindEvents(obj, element, names) { - for (const name of names) { - element.addEventListener(name, obj[name].bind(obj)); - } -} -function opacityToHex(opacity) { - return Math.round(Math.min(255, Math.max(1, 255 * opacity))).toString(16).padStart(2, "0"); -} -class IdManager { - #id = 0; - getId() { - return `${_util.AnnotationEditorPrefix}${this.#id++}`; - } -} -class CommandManager { - #commands = []; - #locked = false; - #maxSize; - #position = -1; - constructor(maxSize = 128) { - this.#maxSize = maxSize; - } - add({ - cmd, - undo, - mustExec, - type = NaN, - overwriteIfSameType = false, - keepUndo = false - }) { - if (mustExec) { - cmd(); - } - if (this.#locked) { - return; - } - const save = { - cmd, - undo, - type - }; - if (this.#position === -1) { - if (this.#commands.length > 0) { - this.#commands.length = 0; - } - this.#position = 0; - this.#commands.push(save); - return; - } - if (overwriteIfSameType && this.#commands[this.#position].type === type) { - if (keepUndo) { - save.undo = this.#commands[this.#position].undo; - } - this.#commands[this.#position] = save; - return; - } - const next = this.#position + 1; - if (next === this.#maxSize) { - this.#commands.splice(0, 1); - } else { - this.#position = next; - if (next < this.#commands.length) { - this.#commands.splice(next); - } - } - this.#commands.push(save); - } - undo() { - if (this.#position === -1) { - return; - } - this.#locked = true; - this.#commands[this.#position].undo(); - this.#locked = false; - this.#position -= 1; - } - redo() { - if (this.#position < this.#commands.length - 1) { - this.#position += 1; - this.#locked = true; - this.#commands[this.#position].cmd(); - this.#locked = false; - } - } - hasSomethingToUndo() { - return this.#position !== -1; - } - hasSomethingToRedo() { - return this.#position < this.#commands.length - 1; - } - destroy() { - this.#commands = null; - } -} -exports.CommandManager = CommandManager; -class KeyboardManager { - constructor(callbacks) { - this.buffer = []; - this.callbacks = new Map(); - this.allKeys = new Set(); - const { - isMac - } = _util.FeatureTest.platform; - for (const [keys, callback] of callbacks) { - for (const key of keys) { - const isMacKey = key.startsWith("mac+"); - if (isMac && isMacKey) { - this.callbacks.set(key.slice(4), callback); - this.allKeys.add(key.split("+").at(-1)); - } else if (!isMac && !isMacKey) { - this.callbacks.set(key, callback); - this.allKeys.add(key.split("+").at(-1)); - } - } - } - } - #serialize(event) { - if (event.altKey) { - this.buffer.push("alt"); - } - if (event.ctrlKey) { - this.buffer.push("ctrl"); - } - if (event.metaKey) { - this.buffer.push("meta"); - } - if (event.shiftKey) { - this.buffer.push("shift"); - } - this.buffer.push(event.key); - const str = this.buffer.join("+"); - this.buffer.length = 0; - return str; - } - exec(self, event) { - if (!this.allKeys.has(event.key)) { - return; - } - const callback = this.callbacks.get(this.#serialize(event)); - if (!callback) { - return; - } - callback.bind(self)(); - event.stopPropagation(); - event.preventDefault(); - } -} -exports.KeyboardManager = KeyboardManager; -class ColorManager { - static _colorsMapping = new Map([["CanvasText", [0, 0, 0]], ["Canvas", [255, 255, 255]]]); - get _colors() { - const colors = new Map([["CanvasText", null], ["Canvas", null]]); - (0, _display_utils.getColorValues)(colors); - return (0, _util.shadow)(this, "_colors", colors); - } - convert(color) { - const rgb = (0, _display_utils.getRGB)(color); - if (!window.matchMedia("(forced-colors: active)").matches) { - return rgb; - } - for (const [name, RGB] of this._colors) { - if (RGB.every((x, i) => x === rgb[i])) { - return ColorManager._colorsMapping.get(name); - } - } - return rgb; - } - getHexCode(name) { - const rgb = this._colors.get(name); - if (!rgb) { - return name; - } - return _util.Util.makeHexColor(...rgb); - } -} -exports.ColorManager = ColorManager; -class AnnotationEditorUIManager { - #activeEditor = null; - #allEditors = new Map(); - #allLayers = new Map(); - #annotationStorage = null; - #commandManager = new CommandManager(); - #currentPageIndex = 0; - #editorTypes = null; - #editorsToRescale = new Set(); - #eventBus = null; - #idManager = new IdManager(); - #isEnabled = false; - #mode = _util.AnnotationEditorType.NONE; - #selectedEditors = new Set(); - #boundCopy = this.copy.bind(this); - #boundCut = this.cut.bind(this); - #boundPaste = this.paste.bind(this); - #boundKeydown = this.keydown.bind(this); - #boundOnEditingAction = this.onEditingAction.bind(this); - #boundOnPageChanging = this.onPageChanging.bind(this); - #boundOnScaleChanging = this.onScaleChanging.bind(this); - #boundOnRotationChanging = this.onRotationChanging.bind(this); - #previousStates = { - isEditing: false, - isEmpty: true, - hasSomethingToUndo: false, - hasSomethingToRedo: false, - hasSelectedEditor: false - }; - #container = null; - static _keyboardManager = new KeyboardManager([[["ctrl+a", "mac+meta+a"], AnnotationEditorUIManager.prototype.selectAll], [["ctrl+z", "mac+meta+z"], AnnotationEditorUIManager.prototype.undo], [["ctrl+y", "ctrl+shift+Z", "mac+meta+shift+Z"], AnnotationEditorUIManager.prototype.redo], [["Backspace", "alt+Backspace", "ctrl+Backspace", "shift+Backspace", "mac+Backspace", "mac+alt+Backspace", "mac+ctrl+Backspace", "Delete", "ctrl+Delete", "shift+Delete"], AnnotationEditorUIManager.prototype.delete], [["Escape", "mac+Escape"], AnnotationEditorUIManager.prototype.unselectAll]]); - constructor(container, eventBus, annotationStorage) { - this.#container = container; - this.#eventBus = eventBus; - this.#eventBus._on("editingaction", this.#boundOnEditingAction); - this.#eventBus._on("pagechanging", this.#boundOnPageChanging); - this.#eventBus._on("scalechanging", this.#boundOnScaleChanging); - this.#eventBus._on("rotationchanging", this.#boundOnRotationChanging); - this.#annotationStorage = annotationStorage; - this.viewParameters = { - realScale: _display_utils.PixelsPerInch.PDF_TO_CSS_UNITS, - rotation: 0 - }; - } - destroy() { - this.#removeKeyboardManager(); - this.#eventBus._off("editingaction", this.#boundOnEditingAction); - this.#eventBus._off("pagechanging", this.#boundOnPageChanging); - this.#eventBus._off("scalechanging", this.#boundOnScaleChanging); - this.#eventBus._off("rotationchanging", this.#boundOnRotationChanging); - for (const layer of this.#allLayers.values()) { - layer.destroy(); - } - this.#allLayers.clear(); - this.#allEditors.clear(); - this.#editorsToRescale.clear(); - this.#activeEditor = null; - this.#selectedEditors.clear(); - this.#commandManager.destroy(); - } - onPageChanging({ - pageNumber - }) { - this.#currentPageIndex = pageNumber - 1; - } - focusMainContainer() { - this.#container.focus(); - } - addShouldRescale(editor) { - this.#editorsToRescale.add(editor); - } - removeShouldRescale(editor) { - this.#editorsToRescale.delete(editor); - } - onScaleChanging({ - scale - }) { - this.commitOrRemove(); - this.viewParameters.realScale = scale * _display_utils.PixelsPerInch.PDF_TO_CSS_UNITS; - for (const editor of this.#editorsToRescale) { - editor.onScaleChanging(); - } - } - onRotationChanging({ - pagesRotation - }) { - this.commitOrRemove(); - this.viewParameters.rotation = pagesRotation; - } - addToAnnotationStorage(editor) { - if (!editor.isEmpty() && this.#annotationStorage && !this.#annotationStorage.has(editor.id)) { - this.#annotationStorage.setValue(editor.id, editor); - } - } - #addKeyboardManager() { - this.#container.addEventListener("keydown", this.#boundKeydown); - } - #removeKeyboardManager() { - this.#container.removeEventListener("keydown", this.#boundKeydown); - } - #addCopyPasteListeners() { - document.addEventListener("copy", this.#boundCopy); - document.addEventListener("cut", this.#boundCut); - document.addEventListener("paste", this.#boundPaste); - } - #removeCopyPasteListeners() { - document.removeEventListener("copy", this.#boundCopy); - document.removeEventListener("cut", this.#boundCut); - document.removeEventListener("paste", this.#boundPaste); - } - copy(event) { - event.preventDefault(); - if (this.#activeEditor) { - this.#activeEditor.commitOrRemove(); - } - if (!this.hasSelection) { - return; - } - const editors = []; - for (const editor of this.#selectedEditors) { - if (!editor.isEmpty()) { - editors.push(editor.serialize()); - } - } - if (editors.length === 0) { - return; - } - event.clipboardData.setData("application/pdfjs", JSON.stringify(editors)); - } - cut(event) { - this.copy(event); - this.delete(); - } - paste(event) { - event.preventDefault(); - let data = event.clipboardData.getData("application/pdfjs"); - if (!data) { - return; - } - try { - data = JSON.parse(data); - } catch (ex) { - (0, _util.warn)(`paste: "${ex.message}".`); - return; - } - if (!Array.isArray(data)) { - return; - } - this.unselectAll(); - const layer = this.#allLayers.get(this.#currentPageIndex); - try { - const newEditors = []; - for (const editor of data) { - const deserializedEditor = layer.deserialize(editor); - if (!deserializedEditor) { - return; - } - newEditors.push(deserializedEditor); - } - const cmd = () => { - for (const editor of newEditors) { - this.#addEditorToLayer(editor); - } - this.#selectEditors(newEditors); - }; - const undo = () => { - for (const editor of newEditors) { - editor.remove(); - } - }; - this.addCommands({ - cmd, - undo, - mustExec: true - }); - } catch (ex) { - (0, _util.warn)(`paste: "${ex.message}".`); - } - } - keydown(event) { - if (!this.getActive()?.shouldGetKeyboardEvents()) { - AnnotationEditorUIManager._keyboardManager.exec(this, event); - } - } - onEditingAction(details) { - if (["undo", "redo", "delete", "selectAll"].includes(details.name)) { - this[details.name](); - } - } - #dispatchUpdateStates(details) { - const hasChanged = Object.entries(details).some(([key, value]) => this.#previousStates[key] !== value); - if (hasChanged) { - this.#eventBus.dispatch("annotationeditorstateschanged", { - source: this, - details: Object.assign(this.#previousStates, details) - }); - } - } - #dispatchUpdateUI(details) { - this.#eventBus.dispatch("annotationeditorparamschanged", { - source: this, - details - }); - } - setEditingState(isEditing) { - if (isEditing) { - this.#addKeyboardManager(); - this.#addCopyPasteListeners(); - this.#dispatchUpdateStates({ - isEditing: this.#mode !== _util.AnnotationEditorType.NONE, - isEmpty: this.#isEmpty(), - hasSomethingToUndo: this.#commandManager.hasSomethingToUndo(), - hasSomethingToRedo: this.#commandManager.hasSomethingToRedo(), - hasSelectedEditor: false - }); - } else { - this.#removeKeyboardManager(); - this.#removeCopyPasteListeners(); - this.#dispatchUpdateStates({ - isEditing: false - }); - } - } - registerEditorTypes(types) { - if (this.#editorTypes) { - return; - } - this.#editorTypes = types; - for (const editorType of this.#editorTypes) { - this.#dispatchUpdateUI(editorType.defaultPropertiesToUpdate); - } - } - getId() { - return this.#idManager.getId(); - } - get currentLayer() { - return this.#allLayers.get(this.#currentPageIndex); - } - get currentPageIndex() { - return this.#currentPageIndex; - } - addLayer(layer) { - this.#allLayers.set(layer.pageIndex, layer); - if (this.#isEnabled) { - layer.enable(); - } else { - layer.disable(); - } - } - removeLayer(layer) { - this.#allLayers.delete(layer.pageIndex); - } - updateMode(mode) { - this.#mode = mode; - if (mode === _util.AnnotationEditorType.NONE) { - this.setEditingState(false); - this.#disableAll(); - } else { - this.setEditingState(true); - this.#enableAll(); - for (const layer of this.#allLayers.values()) { - layer.updateMode(mode); - } - } - } - updateToolbar(mode) { - if (mode === this.#mode) { - return; - } - this.#eventBus.dispatch("switchannotationeditormode", { - source: this, - mode - }); - } - updateParams(type, value) { - if (!this.#editorTypes) { - return; - } - for (const editor of this.#selectedEditors) { - editor.updateParams(type, value); - } - for (const editorType of this.#editorTypes) { - editorType.updateDefaultParams(type, value); - } - } - #enableAll() { - if (!this.#isEnabled) { - this.#isEnabled = true; - for (const layer of this.#allLayers.values()) { - layer.enable(); - } - } - } - #disableAll() { - this.unselectAll(); - if (this.#isEnabled) { - this.#isEnabled = false; - for (const layer of this.#allLayers.values()) { - layer.disable(); - } - } - } - getEditors(pageIndex) { - const editors = []; - for (const editor of this.#allEditors.values()) { - if (editor.pageIndex === pageIndex) { - editors.push(editor); - } - } - return editors; - } - getEditor(id) { - return this.#allEditors.get(id); - } - addEditor(editor) { - this.#allEditors.set(editor.id, editor); - } - removeEditor(editor) { - this.#allEditors.delete(editor.id); - this.unselect(editor); - this.#annotationStorage?.remove(editor.id); - } - #addEditorToLayer(editor) { - const layer = this.#allLayers.get(editor.pageIndex); - if (layer) { - layer.addOrRebuild(editor); - } else { - this.addEditor(editor); - } - } - setActiveEditor(editor) { - if (this.#activeEditor === editor) { - return; - } - this.#activeEditor = editor; - if (editor) { - this.#dispatchUpdateUI(editor.propertiesToUpdate); - } - } - toggleSelected(editor) { - if (this.#selectedEditors.has(editor)) { - this.#selectedEditors.delete(editor); - editor.unselect(); - this.#dispatchUpdateStates({ - hasSelectedEditor: this.hasSelection - }); - return; - } - this.#selectedEditors.add(editor); - editor.select(); - this.#dispatchUpdateUI(editor.propertiesToUpdate); - this.#dispatchUpdateStates({ - hasSelectedEditor: true - }); - } - setSelected(editor) { - for (const ed of this.#selectedEditors) { - if (ed !== editor) { - ed.unselect(); - } - } - this.#selectedEditors.clear(); - this.#selectedEditors.add(editor); - editor.select(); - this.#dispatchUpdateUI(editor.propertiesToUpdate); - this.#dispatchUpdateStates({ - hasSelectedEditor: true - }); - } - isSelected(editor) { - return this.#selectedEditors.has(editor); - } - unselect(editor) { - editor.unselect(); - this.#selectedEditors.delete(editor); - this.#dispatchUpdateStates({ - hasSelectedEditor: this.hasSelection - }); - } - get hasSelection() { - return this.#selectedEditors.size !== 0; - } - undo() { - this.#commandManager.undo(); - this.#dispatchUpdateStates({ - hasSomethingToUndo: this.#commandManager.hasSomethingToUndo(), - hasSomethingToRedo: true, - isEmpty: this.#isEmpty() - }); - } - redo() { - this.#commandManager.redo(); - this.#dispatchUpdateStates({ - hasSomethingToUndo: true, - hasSomethingToRedo: this.#commandManager.hasSomethingToRedo(), - isEmpty: this.#isEmpty() - }); - } - addCommands(params) { - this.#commandManager.add(params); - this.#dispatchUpdateStates({ - hasSomethingToUndo: true, - hasSomethingToRedo: false, - isEmpty: this.#isEmpty() - }); - } - #isEmpty() { - if (this.#allEditors.size === 0) { - return true; - } - if (this.#allEditors.size === 1) { - for (const editor of this.#allEditors.values()) { - return editor.isEmpty(); - } - } - return false; - } - delete() { - this.commitOrRemove(); - if (!this.hasSelection) { - return; - } - const editors = [...this.#selectedEditors]; - const cmd = () => { - for (const editor of editors) { - editor.remove(); - } - }; - const undo = () => { - for (const editor of editors) { - this.#addEditorToLayer(editor); - } - }; - this.addCommands({ - cmd, - undo, - mustExec: true - }); - } - commitOrRemove() { - this.#activeEditor?.commitOrRemove(); - } - #selectEditors(editors) { - this.#selectedEditors.clear(); - for (const editor of editors) { - if (editor.isEmpty()) { - continue; - } - this.#selectedEditors.add(editor); - editor.select(); - } - this.#dispatchUpdateStates({ - hasSelectedEditor: true - }); - } - selectAll() { - for (const editor of this.#selectedEditors) { - editor.commit(); - } - this.#selectEditors(this.#allEditors.values()); - } - unselectAll() { - if (this.#activeEditor) { - this.#activeEditor.commitOrRemove(); - return; - } - if (this.#selectedEditors.size === 0) { - return; - } - for (const editor of this.#selectedEditors) { - editor.unselect(); - } - this.#selectedEditors.clear(); - this.#dispatchUpdateStates({ - hasSelectedEditor: false - }); - } - isActive(editor) { - return this.#activeEditor === editor; - } - getActive() { - return this.#activeEditor; - } - getMode() { - return this.#mode; - } -} -exports.AnnotationEditorUIManager = AnnotationEditorUIManager; - -/***/ }), -/* 6 */ -/***/ ((__unused_webpack_module, exports, __w_pdfjs_require__) => { - - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.StatTimer = exports.RenderingCancelledException = exports.PixelsPerInch = exports.PageViewport = exports.PDFDateString = exports.DOMStandardFontDataFactory = exports.DOMSVGFactory = exports.DOMCanvasFactory = exports.DOMCMapReaderFactory = exports.AnnotationPrefix = void 0; -exports.deprecated = deprecated; -exports.getColorValues = getColorValues; -exports.getCurrentTransform = getCurrentTransform; -exports.getCurrentTransformInverse = getCurrentTransformInverse; -exports.getFilenameFromUrl = getFilenameFromUrl; -exports.getPdfFilenameFromUrl = getPdfFilenameFromUrl; -exports.getRGB = getRGB; -exports.getXfaPageViewport = getXfaPageViewport; -exports.isDataScheme = isDataScheme; -exports.isPdfFile = isPdfFile; -exports.isValidFetchUrl = isValidFetchUrl; -exports.loadScript = loadScript; -exports.setLayerDimensions = setLayerDimensions; -var _base_factory = __w_pdfjs_require__(7); -var _util = __w_pdfjs_require__(1); -const SVG_NS = "http://www.w3.org/2000/svg"; -const AnnotationPrefix = "pdfjs_internal_id_"; -exports.AnnotationPrefix = AnnotationPrefix; -class PixelsPerInch { - static CSS = 96.0; - static PDF = 72.0; - static PDF_TO_CSS_UNITS = this.CSS / this.PDF; -} -exports.PixelsPerInch = PixelsPerInch; -class DOMCanvasFactory extends _base_factory.BaseCanvasFactory { - constructor({ - ownerDocument = globalThis.document - } = {}) { - super(); - this._document = ownerDocument; - } - _createCanvas(width, height) { - const canvas = this._document.createElement("canvas"); - canvas.width = width; - canvas.height = height; - return canvas; - } -} -exports.DOMCanvasFactory = DOMCanvasFactory; -async function fetchData(url, asTypedArray = false) { - if (isValidFetchUrl(url, document.baseURI)) { - const response = await fetch(url); - if (!response.ok) { - throw new Error(response.statusText); - } - return asTypedArray ? new Uint8Array(await response.arrayBuffer()) : (0, _util.stringToBytes)(await response.text()); - } - return new Promise((resolve, reject) => { - const request = new XMLHttpRequest(); - request.open("GET", url, true); - if (asTypedArray) { - request.responseType = "arraybuffer"; - } - request.onreadystatechange = () => { - if (request.readyState !== XMLHttpRequest.DONE) { - return; - } - if (request.status === 200 || request.status === 0) { - let data; - if (asTypedArray && request.response) { - data = new Uint8Array(request.response); - } else if (!asTypedArray && request.responseText) { - data = (0, _util.stringToBytes)(request.responseText); - } - if (data) { - resolve(data); - return; - } - } - reject(new Error(request.statusText)); - }; - request.send(null); - }); -} -class DOMCMapReaderFactory extends _base_factory.BaseCMapReaderFactory { - _fetchData(url, compressionType) { - return fetchData(url, this.isCompressed).then(data => { - return { - cMapData: data, - compressionType - }; - }); - } -} -exports.DOMCMapReaderFactory = DOMCMapReaderFactory; -class DOMStandardFontDataFactory extends _base_factory.BaseStandardFontDataFactory { - _fetchData(url) { - return fetchData(url, true); - } -} -exports.DOMStandardFontDataFactory = DOMStandardFontDataFactory; -class DOMSVGFactory extends _base_factory.BaseSVGFactory { - _createSVG(type) { - return document.createElementNS(SVG_NS, type); - } -} -exports.DOMSVGFactory = DOMSVGFactory; -class PageViewport { - constructor({ - viewBox, - scale, - rotation, - offsetX = 0, - offsetY = 0, - dontFlip = false - }) { - this.viewBox = viewBox; - this.scale = scale; - this.rotation = rotation; - this.offsetX = offsetX; - this.offsetY = offsetY; - const centerX = (viewBox[2] + viewBox[0]) / 2; - const centerY = (viewBox[3] + viewBox[1]) / 2; - let rotateA, rotateB, rotateC, rotateD; - rotation %= 360; - if (rotation < 0) { - rotation += 360; - } - switch (rotation) { - case 180: - rotateA = -1; - rotateB = 0; - rotateC = 0; - rotateD = 1; - break; - case 90: - rotateA = 0; - rotateB = 1; - rotateC = 1; - rotateD = 0; - break; - case 270: - rotateA = 0; - rotateB = -1; - rotateC = -1; - rotateD = 0; - break; - case 0: - rotateA = 1; - rotateB = 0; - rotateC = 0; - rotateD = -1; - break; - default: - throw new Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees."); - } - if (dontFlip) { - rotateC = -rotateC; - rotateD = -rotateD; - } - let offsetCanvasX, offsetCanvasY; - let width, height; - if (rotateA === 0) { - offsetCanvasX = Math.abs(centerY - viewBox[1]) * scale + offsetX; - offsetCanvasY = Math.abs(centerX - viewBox[0]) * scale + offsetY; - width = (viewBox[3] - viewBox[1]) * scale; - height = (viewBox[2] - viewBox[0]) * scale; - } else { - offsetCanvasX = Math.abs(centerX - viewBox[0]) * scale + offsetX; - offsetCanvasY = Math.abs(centerY - viewBox[1]) * scale + offsetY; - width = (viewBox[2] - viewBox[0]) * scale; - height = (viewBox[3] - viewBox[1]) * scale; - } - this.transform = [rotateA * scale, rotateB * scale, rotateC * scale, rotateD * scale, offsetCanvasX - rotateA * scale * centerX - rotateC * scale * centerY, offsetCanvasY - rotateB * scale * centerX - rotateD * scale * centerY]; - this.width = width; - this.height = height; - } - get rawDims() { - const { - viewBox - } = this; - return (0, _util.shadow)(this, "rawDims", { - pageWidth: viewBox[2] - viewBox[0], - pageHeight: viewBox[3] - viewBox[1], - pageX: viewBox[0], - pageY: viewBox[1] - }); - } - clone({ - scale = this.scale, - rotation = this.rotation, - offsetX = this.offsetX, - offsetY = this.offsetY, - dontFlip = false - } = {}) { - return new PageViewport({ - viewBox: this.viewBox.slice(), - scale, - rotation, - offsetX, - offsetY, - dontFlip - }); - } - convertToViewportPoint(x, y) { - return _util.Util.applyTransform([x, y], this.transform); - } - convertToViewportRectangle(rect) { - const topLeft = _util.Util.applyTransform([rect[0], rect[1]], this.transform); - const bottomRight = _util.Util.applyTransform([rect[2], rect[3]], this.transform); - return [topLeft[0], topLeft[1], bottomRight[0], bottomRight[1]]; - } - convertToPdfPoint(x, y) { - return _util.Util.applyInverseTransform([x, y], this.transform); - } -} -exports.PageViewport = PageViewport; -class RenderingCancelledException extends _util.BaseException { - constructor(msg, type, extraDelay = 0) { - super(msg, "RenderingCancelledException"); - this.type = type; - this.extraDelay = extraDelay; - } -} -exports.RenderingCancelledException = RenderingCancelledException; -function isDataScheme(url) { - const ii = url.length; - let i = 0; - while (i < ii && url[i].trim() === "") { - i++; - } - return url.substring(i, i + 5).toLowerCase() === "data:"; -} -function isPdfFile(filename) { - return typeof filename === "string" && /\.pdf$/i.test(filename); -} -function getFilenameFromUrl(url, onlyStripPath = false) { - if (!onlyStripPath) { - [url] = url.split(/[#?]/, 1); - } - return url.substring(url.lastIndexOf("/") + 1); -} -function getPdfFilenameFromUrl(url, defaultFilename = "document.pdf") { - if (typeof url !== "string") { - return defaultFilename; - } - if (isDataScheme(url)) { - (0, _util.warn)('getPdfFilenameFromUrl: ignore "data:"-URL for performance reasons.'); - return defaultFilename; - } - const reURI = /^(?:(?:[^:]+:)?\/\/[^/]+)?([^?#]*)(\?[^#]*)?(#.*)?$/; - const reFilename = /[^/?#=]+\.pdf\b(?!.*\.pdf\b)/i; - const splitURI = reURI.exec(url); - let suggestedFilename = reFilename.exec(splitURI[1]) || reFilename.exec(splitURI[2]) || reFilename.exec(splitURI[3]); - if (suggestedFilename) { - suggestedFilename = suggestedFilename[0]; - if (suggestedFilename.includes("%")) { - try { - suggestedFilename = reFilename.exec(decodeURIComponent(suggestedFilename))[0]; - } catch (ex) {} - } - } - return suggestedFilename || defaultFilename; -} -class StatTimer { - started = Object.create(null); - times = []; - time(name) { - if (name in this.started) { - (0, _util.warn)(`Timer is already running for ${name}`); - } - this.started[name] = Date.now(); - } - timeEnd(name) { - if (!(name in this.started)) { - (0, _util.warn)(`Timer has not been started for ${name}`); - } - this.times.push({ - name, - start: this.started[name], - end: Date.now() - }); - delete this.started[name]; - } - toString() { - const outBuf = []; - let longest = 0; - for (const { - name - } of this.times) { - longest = Math.max(name.length, longest); - } - for (const { - name, - start, - end - } of this.times) { - outBuf.push(`${name.padEnd(longest)} ${end - start}ms\n`); - } - return outBuf.join(""); - } -} -exports.StatTimer = StatTimer; -function isValidFetchUrl(url, baseUrl) { - try { - const { - protocol - } = baseUrl ? new URL(url, baseUrl) : new URL(url); - return protocol === "http:" || protocol === "https:"; - } catch (ex) { - return false; - } -} -function loadScript(src, removeScriptElement = false) { - return new Promise((resolve, reject) => { - const script = document.createElement("script"); - script.src = src; - script.onload = function (evt) { - if (removeScriptElement) { - script.remove(); - } - resolve(evt); - }; - script.onerror = function () { - reject(new Error(`Cannot load script at: ${script.src}`)); - }; - (document.head || document.documentElement).append(script); - }); -} -function deprecated(details) { - console.log("Deprecated API usage: " + details); -} -let pdfDateStringRegex; -class PDFDateString { - static toDateObject(input) { - if (!input || typeof input !== "string") { - return null; - } - if (!pdfDateStringRegex) { - pdfDateStringRegex = new RegExp("^D:" + "(\\d{4})" + "(\\d{2})?" + "(\\d{2})?" + "(\\d{2})?" + "(\\d{2})?" + "(\\d{2})?" + "([Z|+|-])?" + "(\\d{2})?" + "'?" + "(\\d{2})?" + "'?"); - } - const matches = pdfDateStringRegex.exec(input); - if (!matches) { - return null; - } - const year = parseInt(matches[1], 10); - let month = parseInt(matches[2], 10); - month = month >= 1 && month <= 12 ? month - 1 : 0; - let day = parseInt(matches[3], 10); - day = day >= 1 && day <= 31 ? day : 1; - let hour = parseInt(matches[4], 10); - hour = hour >= 0 && hour <= 23 ? hour : 0; - let minute = parseInt(matches[5], 10); - minute = minute >= 0 && minute <= 59 ? minute : 0; - let second = parseInt(matches[6], 10); - second = second >= 0 && second <= 59 ? second : 0; - const universalTimeRelation = matches[7] || "Z"; - let offsetHour = parseInt(matches[8], 10); - offsetHour = offsetHour >= 0 && offsetHour <= 23 ? offsetHour : 0; - let offsetMinute = parseInt(matches[9], 10) || 0; - offsetMinute = offsetMinute >= 0 && offsetMinute <= 59 ? offsetMinute : 0; - if (universalTimeRelation === "-") { - hour += offsetHour; - minute += offsetMinute; - } else if (universalTimeRelation === "+") { - hour -= offsetHour; - minute -= offsetMinute; - } - return new Date(Date.UTC(year, month, day, hour, minute, second)); - } -} -exports.PDFDateString = PDFDateString; -function getXfaPageViewport(xfaPage, { - scale = 1, - rotation = 0 -}) { - const { - width, - height - } = xfaPage.attributes.style; - const viewBox = [0, 0, parseInt(width), parseInt(height)]; - return new PageViewport({ - viewBox, - scale, - rotation - }); -} -function getRGB(color) { - if (color.startsWith("#")) { - const colorRGB = parseInt(color.slice(1), 16); - return [(colorRGB & 0xff0000) >> 16, (colorRGB & 0x00ff00) >> 8, colorRGB & 0x0000ff]; - } - if (color.startsWith("rgb(")) { - return color.slice(4, -1).split(",").map(x => parseInt(x)); - } - if (color.startsWith("rgba(")) { - return color.slice(5, -1).split(",").map(x => parseInt(x)).slice(0, 3); - } - (0, _util.warn)(`Not a valid color format: "${color}"`); - return [0, 0, 0]; -} -function getColorValues(colors) { - const span = document.createElement("span"); - span.style.visibility = "hidden"; - document.body.append(span); - for (const name of colors.keys()) { - span.style.color = name; - const computedColor = window.getComputedStyle(span).color; - colors.set(name, getRGB(computedColor)); - } - span.remove(); -} -function getCurrentTransform(ctx) { - const { - a, - b, - c, - d, - e, - f - } = ctx.getTransform(); - return [a, b, c, d, e, f]; -} -function getCurrentTransformInverse(ctx) { - const { - a, - b, - c, - d, - e, - f - } = ctx.getTransform().invertSelf(); - return [a, b, c, d, e, f]; -} -function setLayerDimensions(div, viewport, mustFlip = false, mustRotate = true) { - if (viewport instanceof PageViewport) { - const { - pageWidth, - pageHeight - } = viewport.rawDims; - const { - style - } = div; - const widthStr = `calc(var(--scale-factor) * ${pageWidth}px)`; - const heightStr = `calc(var(--scale-factor) * ${pageHeight}px)`; - if (!mustFlip || viewport.rotation % 180 === 0) { - style.width = widthStr; - style.height = heightStr; - } else { - style.width = heightStr; - style.height = widthStr; - } - } - if (mustRotate) { - div.setAttribute("data-main-rotation", viewport.rotation); - } -} - -/***/ }), -/* 7 */ -/***/ ((__unused_webpack_module, exports, __w_pdfjs_require__) => { - - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.BaseStandardFontDataFactory = exports.BaseSVGFactory = exports.BaseCanvasFactory = exports.BaseCMapReaderFactory = void 0; -var _util = __w_pdfjs_require__(1); -class BaseCanvasFactory { - constructor() { - if (this.constructor === BaseCanvasFactory) { - (0, _util.unreachable)("Cannot initialize BaseCanvasFactory."); - } - } - create(width, height) { - if (width <= 0 || height <= 0) { - throw new Error("Invalid canvas size"); - } - const canvas = this._createCanvas(width, height); - return { - canvas, - context: canvas.getContext("2d") - }; - } - reset(canvasAndContext, width, height) { - if (!canvasAndContext.canvas) { - throw new Error("Canvas is not specified"); - } - if (width <= 0 || height <= 0) { - throw new Error("Invalid canvas size"); - } - canvasAndContext.canvas.width = width; - canvasAndContext.canvas.height = height; - } - destroy(canvasAndContext) { - if (!canvasAndContext.canvas) { - throw new Error("Canvas is not specified"); - } - canvasAndContext.canvas.width = 0; - canvasAndContext.canvas.height = 0; - canvasAndContext.canvas = null; - canvasAndContext.context = null; - } - _createCanvas(width, height) { - (0, _util.unreachable)("Abstract method `_createCanvas` called."); - } -} -exports.BaseCanvasFactory = BaseCanvasFactory; -class BaseCMapReaderFactory { - constructor({ - baseUrl = null, - isCompressed = true - }) { - if (this.constructor === BaseCMapReaderFactory) { - (0, _util.unreachable)("Cannot initialize BaseCMapReaderFactory."); - } - this.baseUrl = baseUrl; - this.isCompressed = isCompressed; - } - async fetch({ - name - }) { - if (!this.baseUrl) { - throw new Error('The CMap "baseUrl" parameter must be specified, ensure that ' + 'the "cMapUrl" and "cMapPacked" API parameters are provided.'); - } - if (!name) { - throw new Error("CMap name must be specified."); - } - const url = this.baseUrl + name + (this.isCompressed ? ".bcmap" : ""); - const compressionType = this.isCompressed ? _util.CMapCompressionType.BINARY : _util.CMapCompressionType.NONE; - return this._fetchData(url, compressionType).catch(reason => { - throw new Error(`Unable to load ${this.isCompressed ? "binary " : ""}CMap at: ${url}`); - }); - } - _fetchData(url, compressionType) { - (0, _util.unreachable)("Abstract method `_fetchData` called."); - } -} -exports.BaseCMapReaderFactory = BaseCMapReaderFactory; -class BaseStandardFontDataFactory { - constructor({ - baseUrl = null - }) { - if (this.constructor === BaseStandardFontDataFactory) { - (0, _util.unreachable)("Cannot initialize BaseStandardFontDataFactory."); - } - this.baseUrl = baseUrl; - } - async fetch({ - filename - }) { - if (!this.baseUrl) { - throw new Error('The standard font "baseUrl" parameter must be specified, ensure that ' + 'the "standardFontDataUrl" API parameter is provided.'); - } - if (!filename) { - throw new Error("Font filename must be specified."); - } - const url = `${this.baseUrl}${filename}`; - return this._fetchData(url).catch(reason => { - throw new Error(`Unable to load font data at: ${url}`); - }); - } - _fetchData(url) { - (0, _util.unreachable)("Abstract method `_fetchData` called."); - } -} -exports.BaseStandardFontDataFactory = BaseStandardFontDataFactory; -class BaseSVGFactory { - constructor() { - if (this.constructor === BaseSVGFactory) { - (0, _util.unreachable)("Cannot initialize BaseSVGFactory."); - } - } - create(width, height, skipDimensions = false) { - if (width <= 0 || height <= 0) { - throw new Error("Invalid SVG dimensions"); - } - const svg = this._createSVG("svg:svg"); - svg.setAttribute("version", "1.1"); - if (!skipDimensions) { - svg.setAttribute("width", `${width}px`); - svg.setAttribute("height", `${height}px`); - } - svg.setAttribute("preserveAspectRatio", "none"); - svg.setAttribute("viewBox", `0 0 ${width} ${height}`); - return svg; - } - createElement(type) { - if (typeof type !== "string") { - throw new Error("Invalid SVG element type"); - } - return this._createSVG(type); - } - _createSVG(type) { - (0, _util.unreachable)("Abstract method `_createSVG` called."); - } -} -exports.BaseSVGFactory = BaseSVGFactory; - -/***/ }), -/* 8 */ -/***/ ((__unused_webpack_module, exports, __w_pdfjs_require__) => { - - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.MurmurHash3_64 = void 0; -var _util = __w_pdfjs_require__(1); -const SEED = 0xc3d2e1f0; -const MASK_HIGH = 0xffff0000; -const MASK_LOW = 0xffff; -class MurmurHash3_64 { - constructor(seed) { - this.h1 = seed ? seed & 0xffffffff : SEED; - this.h2 = seed ? seed & 0xffffffff : SEED; - } - update(input) { - let data, length; - if (typeof input === "string") { - data = new Uint8Array(input.length * 2); - length = 0; - for (let i = 0, ii = input.length; i < ii; i++) { - const code = input.charCodeAt(i); - if (code <= 0xff) { - data[length++] = code; - } else { - data[length++] = code >>> 8; - data[length++] = code & 0xff; - } - } - } else if ((0, _util.isArrayBuffer)(input)) { - data = input.slice(); - length = data.byteLength; - } else { - throw new Error("Wrong data format in MurmurHash3_64_update. " + "Input must be a string or array."); - } - const blockCounts = length >> 2; - const tailLength = length - blockCounts * 4; - const dataUint32 = new Uint32Array(data.buffer, 0, blockCounts); - let k1 = 0, - k2 = 0; - let h1 = this.h1, - h2 = this.h2; - const C1 = 0xcc9e2d51, - C2 = 0x1b873593; - const C1_LOW = C1 & MASK_LOW, - C2_LOW = C2 & MASK_LOW; - for (let i = 0; i < blockCounts; i++) { - if (i & 1) { - k1 = dataUint32[i]; - k1 = k1 * C1 & MASK_HIGH | k1 * C1_LOW & MASK_LOW; - k1 = k1 << 15 | k1 >>> 17; - k1 = k1 * C2 & MASK_HIGH | k1 * C2_LOW & MASK_LOW; - h1 ^= k1; - h1 = h1 << 13 | h1 >>> 19; - h1 = h1 * 5 + 0xe6546b64; - } else { - k2 = dataUint32[i]; - k2 = k2 * C1 & MASK_HIGH | k2 * C1_LOW & MASK_LOW; - k2 = k2 << 15 | k2 >>> 17; - k2 = k2 * C2 & MASK_HIGH | k2 * C2_LOW & MASK_LOW; - h2 ^= k2; - h2 = h2 << 13 | h2 >>> 19; - h2 = h2 * 5 + 0xe6546b64; - } - } - k1 = 0; - switch (tailLength) { - case 3: - k1 ^= data[blockCounts * 4 + 2] << 16; - case 2: - k1 ^= data[blockCounts * 4 + 1] << 8; - case 1: - k1 ^= data[blockCounts * 4]; - k1 = k1 * C1 & MASK_HIGH | k1 * C1_LOW & MASK_LOW; - k1 = k1 << 15 | k1 >>> 17; - k1 = k1 * C2 & MASK_HIGH | k1 * C2_LOW & MASK_LOW; - if (blockCounts & 1) { - h1 ^= k1; - } else { - h2 ^= k1; - } - } - this.h1 = h1; - this.h2 = h2; - } - hexdigest() { - let h1 = this.h1, - h2 = this.h2; - h1 ^= h2 >>> 1; - h1 = h1 * 0xed558ccd & MASK_HIGH | h1 * 0x8ccd & MASK_LOW; - h2 = h2 * 0xff51afd7 & MASK_HIGH | ((h2 << 16 | h1 >>> 16) * 0xafd7ed55 & MASK_HIGH) >>> 16; - h1 ^= h2 >>> 1; - h1 = h1 * 0x1a85ec53 & MASK_HIGH | h1 * 0xec53 & MASK_LOW; - h2 = h2 * 0xc4ceb9fe & MASK_HIGH | ((h2 << 16 | h1 >>> 16) * 0xb9fe1a85 & MASK_HIGH) >>> 16; - h1 ^= h2 >>> 1; - return (h1 >>> 0).toString(16).padStart(8, "0") + (h2 >>> 0).toString(16).padStart(8, "0"); - } -} -exports.MurmurHash3_64 = MurmurHash3_64; - -/***/ }), -/* 9 */ -/***/ ((__unused_webpack_module, exports, __w_pdfjs_require__) => { - - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.FontLoader = exports.FontFaceObject = void 0; -var _util = __w_pdfjs_require__(1); -var _is_node = __w_pdfjs_require__(10); -class FontLoader { - constructor({ - onUnsupportedFeature, - ownerDocument = globalThis.document, - styleElement = null - }) { - this._onUnsupportedFeature = onUnsupportedFeature; - this._document = ownerDocument; - this.nativeFontFaces = []; - this.styleElement = null; - this.loadingRequests = []; - this.loadTestFontId = 0; - } - addNativeFontFace(nativeFontFace) { - this.nativeFontFaces.push(nativeFontFace); - this._document.fonts.add(nativeFontFace); - } - insertRule(rule) { - if (!this.styleElement) { - this.styleElement = this._document.createElement("style"); - this._document.documentElement.getElementsByTagName("head")[0].append(this.styleElement); - } - const styleSheet = this.styleElement.sheet; - styleSheet.insertRule(rule, styleSheet.cssRules.length); - } - clear() { - for (const nativeFontFace of this.nativeFontFaces) { - this._document.fonts.delete(nativeFontFace); - } - this.nativeFontFaces.length = 0; - if (this.styleElement) { - this.styleElement.remove(); - this.styleElement = null; - } - } - async bind(font) { - if (font.attached || font.missingFile) { - return; - } - font.attached = true; - if (this.isFontLoadingAPISupported) { - const nativeFontFace = font.createNativeFontFace(); - if (nativeFontFace) { - this.addNativeFontFace(nativeFontFace); - try { - await nativeFontFace.loaded; - } catch (ex) { - this._onUnsupportedFeature({ - featureId: _util.UNSUPPORTED_FEATURES.errorFontLoadNative - }); - (0, _util.warn)(`Failed to load font '${nativeFontFace.family}': '${ex}'.`); - font.disableFontFace = true; - throw ex; - } - } - return; - } - const rule = font.createFontFaceRule(); - if (rule) { - this.insertRule(rule); - if (this.isSyncFontLoadingSupported) { - return; - } - await new Promise(resolve => { - const request = this._queueLoadingCallback(resolve); - this._prepareFontLoadEvent(font, request); - }); - } - } - get isFontLoadingAPISupported() { - const hasFonts = !!this._document?.fonts; - return (0, _util.shadow)(this, "isFontLoadingAPISupported", hasFonts); - } - get isSyncFontLoadingSupported() { - let supported = false; - if (_is_node.isNodeJS) { - supported = true; - } else if (typeof navigator !== "undefined" && /Mozilla\/5.0.*?rv:\d+.*? Gecko/.test(navigator.userAgent)) { - supported = true; - } - return (0, _util.shadow)(this, "isSyncFontLoadingSupported", supported); - } - _queueLoadingCallback(callback) { - function completeRequest() { - (0, _util.assert)(!request.done, "completeRequest() cannot be called twice."); - request.done = true; - while (loadingRequests.length > 0 && loadingRequests[0].done) { - const otherRequest = loadingRequests.shift(); - setTimeout(otherRequest.callback, 0); - } - } - const { - loadingRequests - } = this; - const request = { - done: false, - complete: completeRequest, - callback - }; - loadingRequests.push(request); - return request; - } - get _loadTestFont() { - const testFont = atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQA" + "FQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAA" + "ALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgA" + "AAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1" + "AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD" + "6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAg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m1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTj" + "FQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA=="); - return (0, _util.shadow)(this, "_loadTestFont", testFont); - } - _prepareFontLoadEvent(font, request) { - function int32(data, offset) { - return data.charCodeAt(offset) << 24 | data.charCodeAt(offset + 1) << 16 | data.charCodeAt(offset + 2) << 8 | data.charCodeAt(offset + 3) & 0xff; - } - function spliceString(s, offset, remove, insert) { - const chunk1 = s.substring(0, offset); - const chunk2 = s.substring(offset + remove); - return chunk1 + insert + chunk2; - } - let i, ii; - const canvas = this._document.createElement("canvas"); - canvas.width = 1; - canvas.height = 1; - const ctx = canvas.getContext("2d"); - let called = 0; - function isFontReady(name, callback) { - if (++called > 30) { - (0, _util.warn)("Load test font never loaded."); - callback(); - return; - } - ctx.font = "30px " + name; - ctx.fillText(".", 0, 20); - const imageData = ctx.getImageData(0, 0, 1, 1); - if (imageData.data[3] > 0) { - callback(); - return; - } - setTimeout(isFontReady.bind(null, name, callback)); - } - const loadTestFontId = `lt${Date.now()}${this.loadTestFontId++}`; - let data = this._loadTestFont; - const COMMENT_OFFSET = 976; - data = spliceString(data, COMMENT_OFFSET, loadTestFontId.length, loadTestFontId); - const CFF_CHECKSUM_OFFSET = 16; - const XXXX_VALUE = 0x58585858; - let checksum = int32(data, CFF_CHECKSUM_OFFSET); - for (i = 0, ii = loadTestFontId.length - 3; i < ii; i += 4) { - checksum = checksum - XXXX_VALUE + int32(loadTestFontId, i) | 0; - } - if (i < loadTestFontId.length) { - checksum = checksum - XXXX_VALUE + int32(loadTestFontId + "XXX", i) | 0; - } - data = spliceString(data, CFF_CHECKSUM_OFFSET, 4, (0, _util.string32)(checksum)); - const url = `url(data:font/opentype;base64,${btoa(data)});`; - const rule = `@font-face {font-family:"${loadTestFontId}";src:${url}}`; - this.insertRule(rule); - const div = this._document.createElement("div"); - div.style.visibility = "hidden"; - div.style.width = div.style.height = "10px"; - div.style.position = "absolute"; - div.style.top = div.style.left = "0px"; - for (const name of [font.loadedName, loadTestFontId]) { - const span = this._document.createElement("span"); - span.textContent = "Hi"; - span.style.fontFamily = name; - div.append(span); - } - this._document.body.append(div); - isFontReady(loadTestFontId, () => { - div.remove(); - request.complete(); - }); - } -} -exports.FontLoader = FontLoader; -class FontFaceObject { - constructor(translatedData, { - isEvalSupported = true, - disableFontFace = false, - ignoreErrors = false, - onUnsupportedFeature, - fontRegistry = null - }) { - this.compiledGlyphs = Object.create(null); - for (const i in translatedData) { - this[i] = translatedData[i]; - } - this.isEvalSupported = isEvalSupported !== false; - this.disableFontFace = disableFontFace === true; - this.ignoreErrors = ignoreErrors === true; - this._onUnsupportedFeature = onUnsupportedFeature; - this.fontRegistry = fontRegistry; - } - createNativeFontFace() { - if (!this.data || this.disableFontFace) { - return null; - } - let nativeFontFace; - if (!this.cssFontInfo) { - nativeFontFace = new FontFace(this.loadedName, this.data, {}); - } else { - const css = { - weight: this.cssFontInfo.fontWeight - }; - if (this.cssFontInfo.italicAngle) { - css.style = `oblique ${this.cssFontInfo.italicAngle}deg`; - } - nativeFontFace = new FontFace(this.cssFontInfo.fontFamily, this.data, css); - } - this.fontRegistry?.registerFont(this); - return nativeFontFace; - } - createFontFaceRule() { - if (!this.data || this.disableFontFace) { - return null; - } - const data = (0, _util.bytesToString)(this.data); - const url = `url(data:${this.mimetype};base64,${btoa(data)});`; - let rule; - if (!this.cssFontInfo) { - rule = `@font-face {font-family:"${this.loadedName}";src:${url}}`; - } else { - let css = `font-weight: ${this.cssFontInfo.fontWeight};`; - if (this.cssFontInfo.italicAngle) { - css += `font-style: oblique ${this.cssFontInfo.italicAngle}deg;`; - } - rule = `@font-face {font-family:"${this.cssFontInfo.fontFamily}";${css}src:${url}}`; - } - this.fontRegistry?.registerFont(this, url); - return rule; - } - getPathGenerator(objs, character) { - if (this.compiledGlyphs[character] !== undefined) { - return this.compiledGlyphs[character]; - } - let cmds; - try { - cmds = objs.get(this.loadedName + "_path_" + character); - } catch (ex) { - if (!this.ignoreErrors) { - throw ex; - } - this._onUnsupportedFeature({ - featureId: _util.UNSUPPORTED_FEATURES.errorFontGetPath - }); - (0, _util.warn)(`getPathGenerator - ignoring character: "${ex}".`); - return this.compiledGlyphs[character] = function (c, size) {}; - } - if (this.isEvalSupported && _util.FeatureTest.isEvalSupported) { - const jsBuf = []; - for (const current of cmds) { - const args = current.args !== undefined ? current.args.join(",") : ""; - jsBuf.push("c.", current.cmd, "(", args, ");\n"); - } - return this.compiledGlyphs[character] = new Function("c", "size", jsBuf.join("")); - } - return this.compiledGlyphs[character] = function (c, size) { - for (const current of cmds) { - if (current.cmd === "scale") { - current.args = [size, -size]; - } - c[current.cmd].apply(c, current.args); - } - }; - } -} -exports.FontFaceObject = FontFaceObject; - -/***/ }), -/* 10 */ -/***/ ((__unused_webpack_module, exports) => { - - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.isNodeJS = void 0; -const isNodeJS = typeof process === "object" && process + "" === "[object process]" && !process.versions.nw && !(process.versions.electron && process.type && process.type !== "browser"); -exports.isNodeJS = isNodeJS; - -/***/ }), -/* 11 */ -/***/ ((__unused_webpack_module, exports, __w_pdfjs_require__) => { - - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.CanvasGraphics = void 0; -var _util = __w_pdfjs_require__(1); -var _display_utils = __w_pdfjs_require__(6); -var _pattern_helper = __w_pdfjs_require__(12); -var _image_utils = __w_pdfjs_require__(13); -const MIN_FONT_SIZE = 16; -const MAX_FONT_SIZE = 100; -const MAX_GROUP_SIZE = 4096; -const EXECUTION_TIME = 15; -const EXECUTION_STEPS = 10; -const MAX_SIZE_TO_COMPILE = 1000; -const FULL_CHUNK_HEIGHT = 16; -function mirrorContextOperations(ctx, destCtx) { - if (ctx._removeMirroring) { - throw new Error("Context is already forwarding operations."); - } - ctx.__originalSave = ctx.save; - ctx.__originalRestore = ctx.restore; - ctx.__originalRotate = ctx.rotate; - ctx.__originalScale = ctx.scale; - ctx.__originalTranslate = ctx.translate; - ctx.__originalTransform = ctx.transform; - ctx.__originalSetTransform = ctx.setTransform; - ctx.__originalResetTransform = ctx.resetTransform; - ctx.__originalClip = ctx.clip; - ctx.__originalMoveTo = ctx.moveTo; - ctx.__originalLineTo = ctx.lineTo; - ctx.__originalBezierCurveTo = ctx.bezierCurveTo; - ctx.__originalRect = ctx.rect; - ctx.__originalClosePath = ctx.closePath; - ctx.__originalBeginPath = ctx.beginPath; - ctx._removeMirroring = () => { - ctx.save = ctx.__originalSave; - ctx.restore = ctx.__originalRestore; - ctx.rotate = ctx.__originalRotate; - ctx.scale = ctx.__originalScale; - ctx.translate = ctx.__originalTranslate; - ctx.transform = ctx.__originalTransform; - ctx.setTransform = ctx.__originalSetTransform; - ctx.resetTransform = ctx.__originalResetTransform; - ctx.clip = ctx.__originalClip; - ctx.moveTo = ctx.__originalMoveTo; - ctx.lineTo = ctx.__originalLineTo; - ctx.bezierCurveTo = ctx.__originalBezierCurveTo; - ctx.rect = ctx.__originalRect; - ctx.closePath = ctx.__originalClosePath; - ctx.beginPath = ctx.__originalBeginPath; - delete ctx._removeMirroring; - }; - ctx.save = function ctxSave() { - destCtx.save(); - this.__originalSave(); - }; - ctx.restore = function ctxRestore() { - destCtx.restore(); - this.__originalRestore(); - }; - ctx.translate = function ctxTranslate(x, y) { - destCtx.translate(x, y); - this.__originalTranslate(x, y); - }; - ctx.scale = function ctxScale(x, y) { - destCtx.scale(x, y); - this.__originalScale(x, y); - }; - ctx.transform = function ctxTransform(a, b, c, d, e, f) { - destCtx.transform(a, b, c, d, e, f); - this.__originalTransform(a, b, c, d, e, f); - }; - ctx.setTransform = function ctxSetTransform(a, b, c, d, e, f) { - destCtx.setTransform(a, b, c, d, e, f); - this.__originalSetTransform(a, b, c, d, e, f); - }; - ctx.resetTransform = function ctxResetTransform() { - destCtx.resetTransform(); - this.__originalResetTransform(); - }; - ctx.rotate = function ctxRotate(angle) { - destCtx.rotate(angle); - this.__originalRotate(angle); - }; - ctx.clip = function ctxRotate(rule) { - destCtx.clip(rule); - this.__originalClip(rule); - }; - ctx.moveTo = function (x, y) { - destCtx.moveTo(x, y); - this.__originalMoveTo(x, y); - }; - ctx.lineTo = function (x, y) { - destCtx.lineTo(x, y); - this.__originalLineTo(x, y); - }; - ctx.bezierCurveTo = function (cp1x, cp1y, cp2x, cp2y, x, y) { - destCtx.bezierCurveTo(cp1x, cp1y, cp2x, cp2y, x, y); - this.__originalBezierCurveTo(cp1x, cp1y, cp2x, cp2y, x, y); - }; - ctx.rect = function (x, y, width, height) { - destCtx.rect(x, y, width, height); - this.__originalRect(x, y, width, height); - }; - ctx.closePath = function () { - destCtx.closePath(); - this.__originalClosePath(); - }; - ctx.beginPath = function () { - destCtx.beginPath(); - this.__originalBeginPath(); - }; -} -class CachedCanvases { - constructor(canvasFactory) { - this.canvasFactory = canvasFactory; - this.cache = Object.create(null); - } - getCanvas(id, width, height) { - let canvasEntry; - if (this.cache[id] !== undefined) { - canvasEntry = this.cache[id]; - this.canvasFactory.reset(canvasEntry, width, height); - } else { - canvasEntry = this.canvasFactory.create(width, height); - this.cache[id] = canvasEntry; - } - return canvasEntry; - } - delete(id) { - delete this.cache[id]; - } - clear() { - for (const id in this.cache) { - const canvasEntry = this.cache[id]; - this.canvasFactory.destroy(canvasEntry); - delete this.cache[id]; - } - } -} -function drawImageAtIntegerCoords(ctx, srcImg, srcX, srcY, srcW, srcH, destX, destY, destW, destH) { - const [a, b, c, d, tx, ty] = (0, _display_utils.getCurrentTransform)(ctx); - if (b === 0 && c === 0) { - const tlX = destX * a + tx; - const rTlX = Math.round(tlX); - const tlY = destY * d + ty; - const rTlY = Math.round(tlY); - const brX = (destX + destW) * a + tx; - const rWidth = Math.abs(Math.round(brX) - rTlX) || 1; - const brY = (destY + destH) * d + ty; - const rHeight = Math.abs(Math.round(brY) - rTlY) || 1; - ctx.setTransform(Math.sign(a), 0, 0, Math.sign(d), rTlX, rTlY); - ctx.drawImage(srcImg, srcX, srcY, srcW, srcH, 0, 0, rWidth, rHeight); - ctx.setTransform(a, b, c, d, tx, ty); - return [rWidth, rHeight]; - } - if (a === 0 && d === 0) { - const tlX = destY * c + tx; - const rTlX = Math.round(tlX); - const tlY = destX * b + ty; - const rTlY = Math.round(tlY); - const brX = (destY + destH) * c + tx; - const rWidth = Math.abs(Math.round(brX) - rTlX) || 1; - const brY = (destX + destW) * b + ty; - const rHeight = Math.abs(Math.round(brY) - rTlY) || 1; - ctx.setTransform(0, Math.sign(b), Math.sign(c), 0, rTlX, rTlY); - ctx.drawImage(srcImg, srcX, srcY, srcW, srcH, 0, 0, rHeight, rWidth); - ctx.setTransform(a, b, c, d, tx, ty); - return [rHeight, rWidth]; - } - ctx.drawImage(srcImg, srcX, srcY, srcW, srcH, destX, destY, destW, destH); - const scaleX = Math.hypot(a, b); - const scaleY = Math.hypot(c, d); - return [scaleX * destW, scaleY * destH]; -} -function compileType3Glyph(imgData) { - const { - width, - height - } = imgData; - if (width > MAX_SIZE_TO_COMPILE || height > MAX_SIZE_TO_COMPILE) { - return null; - } - const POINT_TO_PROCESS_LIMIT = 1000; - const POINT_TYPES = new Uint8Array([0, 2, 4, 0, 1, 0, 5, 4, 8, 10, 0, 8, 0, 2, 1, 0]); - const width1 = width + 1; - let points = new Uint8Array(width1 * (height + 1)); - let i, j, j0; - const lineSize = width + 7 & ~7; - let data = new Uint8Array(lineSize * height), - pos = 0; - for (const elem of imgData.data) { - let mask = 128; - while (mask > 0) { - data[pos++] = elem & mask ? 0 : 255; - mask >>= 1; - } - } - let count = 0; - pos = 0; - if (data[pos] !== 0) { - points[0] = 1; - ++count; - } - for (j = 1; j < width; j++) { - if (data[pos] !== data[pos + 1]) { - points[j] = data[pos] ? 2 : 1; - ++count; - } - pos++; - } - if (data[pos] !== 0) { - points[j] = 2; - ++count; - } - for (i = 1; i < height; i++) { - pos = i * lineSize; - j0 = i * width1; - if (data[pos - lineSize] !== data[pos]) { - points[j0] = data[pos] ? 1 : 8; - ++count; - } - let sum = (data[pos] ? 4 : 0) + (data[pos - lineSize] ? 8 : 0); - for (j = 1; j < width; j++) { - sum = (sum >> 2) + (data[pos + 1] ? 4 : 0) + (data[pos - lineSize + 1] ? 8 : 0); - if (POINT_TYPES[sum]) { - points[j0 + j] = POINT_TYPES[sum]; - ++count; - } - pos++; - } - if (data[pos - lineSize] !== data[pos]) { - points[j0 + j] = data[pos] ? 2 : 4; - ++count; - } - if (count > POINT_TO_PROCESS_LIMIT) { - return null; - } - } - pos = lineSize * (height - 1); - j0 = i * width1; - if (data[pos] !== 0) { - points[j0] = 8; - ++count; - } - for (j = 1; j < width; j++) { - if (data[pos] !== data[pos + 1]) { - points[j0 + j] = data[pos] ? 4 : 8; - ++count; - } - pos++; - } - if (data[pos] !== 0) { - points[j0 + j] = 4; - ++count; - } - if (count > POINT_TO_PROCESS_LIMIT) { - return null; - } - const steps = new Int32Array([0, width1, -1, 0, -width1, 0, 0, 0, 1]); - const path = new Path2D(); - for (i = 0; count && i <= height; i++) { - let p = i * width1; - const end = p + width; - while (p < end && !points[p]) { - p++; - } - if (p === end) { - continue; - } - path.moveTo(p % width1, i); - const p0 = p; - let type = points[p]; - do { - const step = steps[type]; - do { - p += step; - } while (!points[p]); - const pp = points[p]; - if (pp !== 5 && pp !== 10) { - type = pp; - points[p] = 0; - } else { - type = pp & 0x33 * type >> 4; - points[p] &= type >> 2 | type << 2; - } - path.lineTo(p % width1, p / width1 | 0); - if (!points[p]) { - --count; - } - } while (p0 !== p); - --i; - } - data = null; - points = null; - const drawOutline = function (c) { - c.save(); - c.scale(1 / width, -1 / height); - c.translate(0, -height); - c.fill(path); - c.beginPath(); - c.restore(); - }; - return drawOutline; -} -class CanvasExtraState { - constructor(width, height) { - this.alphaIsShape = false; - this.fontSize = 0; - this.fontSizeScale = 1; - this.textMatrix = _util.IDENTITY_MATRIX; - this.textMatrixScale = 1; - this.fontMatrix = _util.FONT_IDENTITY_MATRIX; - this.leading = 0; - this.x = 0; - this.y = 0; - this.lineX = 0; - this.lineY = 0; - this.charSpacing = 0; - this.wordSpacing = 0; - this.textHScale = 1; - this.textRenderingMode = _util.TextRenderingMode.FILL; - this.textRise = 0; - this.fillColor = "#000000"; - this.strokeColor = "#000000"; - this.patternFill = false; - this.fillAlpha = 1; - this.strokeAlpha = 1; - this.lineWidth = 1; - this.activeSMask = null; - this.transferMaps = null; - this.startNewPathAndClipBox([0, 0, width, height]); - } - clone() { - const clone = Object.create(this); - clone.clipBox = this.clipBox.slice(); - return clone; - } - setCurrentPoint(x, y) { - this.x = x; - this.y = y; - } - updatePathMinMax(transform, x, y) { - [x, y] = _util.Util.applyTransform([x, y], transform); - this.minX = Math.min(this.minX, x); - this.minY = Math.min(this.minY, y); - this.maxX = Math.max(this.maxX, x); - this.maxY = Math.max(this.maxY, y); - } - updateRectMinMax(transform, rect) { - const p1 = _util.Util.applyTransform(rect, transform); - const p2 = _util.Util.applyTransform(rect.slice(2), transform); - this.minX = Math.min(this.minX, p1[0], p2[0]); - this.minY = Math.min(this.minY, p1[1], p2[1]); - this.maxX = Math.max(this.maxX, p1[0], p2[0]); - this.maxY = Math.max(this.maxY, p1[1], p2[1]); - } - updateScalingPathMinMax(transform, minMax) { - _util.Util.scaleMinMax(transform, minMax); - this.minX = Math.min(this.minX, minMax[0]); - this.maxX = Math.max(this.maxX, minMax[1]); - this.minY = Math.min(this.minY, minMax[2]); - this.maxY = Math.max(this.maxY, minMax[3]); - } - updateCurvePathMinMax(transform, x0, y0, x1, y1, x2, y2, x3, y3, minMax) { - const box = _util.Util.bezierBoundingBox(x0, y0, x1, y1, x2, y2, x3, y3); - if (minMax) { - minMax[0] = Math.min(minMax[0], box[0], box[2]); - minMax[1] = Math.max(minMax[1], box[0], box[2]); - minMax[2] = Math.min(minMax[2], box[1], box[3]); - minMax[3] = Math.max(minMax[3], box[1], box[3]); - return; - } - this.updateRectMinMax(transform, box); - } - getPathBoundingBox(pathType = _pattern_helper.PathType.FILL, transform = null) { - const box = [this.minX, this.minY, this.maxX, this.maxY]; - if (pathType === _pattern_helper.PathType.STROKE) { - if (!transform) { - (0, _util.unreachable)("Stroke bounding box must include transform."); - } - const scale = _util.Util.singularValueDecompose2dScale(transform); - const xStrokePad = scale[0] * this.lineWidth / 2; - const yStrokePad = scale[1] * this.lineWidth / 2; - box[0] -= xStrokePad; - box[1] -= yStrokePad; - box[2] += xStrokePad; - box[3] += yStrokePad; - } - return box; - } - updateClipFromPath() { - const intersect = _util.Util.intersect(this.clipBox, this.getPathBoundingBox()); - this.startNewPathAndClipBox(intersect || [0, 0, 0, 0]); - } - isEmptyClip() { - return this.minX === Infinity; - } - startNewPathAndClipBox(box) { - this.clipBox = box; - this.minX = Infinity; - this.minY = Infinity; - this.maxX = 0; - this.maxY = 0; - } - getClippedPathBoundingBox(pathType = _pattern_helper.PathType.FILL, transform = null) { - return _util.Util.intersect(this.clipBox, this.getPathBoundingBox(pathType, transform)); - } -} -function putBinaryImageData(ctx, imgData, transferMaps = null) { - if (typeof ImageData !== "undefined" && imgData instanceof ImageData) { - ctx.putImageData(imgData, 0, 0); - return; - } - const height = imgData.height, - width = imgData.width; - const partialChunkHeight = height % FULL_CHUNK_HEIGHT; - const fullChunks = (height - partialChunkHeight) / FULL_CHUNK_HEIGHT; - const totalChunks = partialChunkHeight === 0 ? fullChunks : fullChunks + 1; - const chunkImgData = ctx.createImageData(width, FULL_CHUNK_HEIGHT); - let srcPos = 0, - destPos; - const src = imgData.data; - const dest = chunkImgData.data; - let i, j, thisChunkHeight, elemsInThisChunk; - let transferMapRed, transferMapGreen, transferMapBlue, transferMapGray; - if (transferMaps) { - switch (transferMaps.length) { - case 1: - transferMapRed = transferMaps[0]; - transferMapGreen = transferMaps[0]; - transferMapBlue = transferMaps[0]; - transferMapGray = transferMaps[0]; - break; - case 4: - transferMapRed = transferMaps[0]; - transferMapGreen = transferMaps[1]; - transferMapBlue = transferMaps[2]; - transferMapGray = transferMaps[3]; - break; - } - } - if (imgData.kind === _util.ImageKind.GRAYSCALE_1BPP) { - const srcLength = src.byteLength; - const dest32 = new Uint32Array(dest.buffer, 0, dest.byteLength >> 2); - const dest32DataLength = dest32.length; - const fullSrcDiff = width + 7 >> 3; - let white = 0xffffffff; - let black = _util.FeatureTest.isLittleEndian ? 0xff000000 : 0x000000ff; - if (transferMapGray) { - if (transferMapGray[0] === 0xff && transferMapGray[0xff] === 0) { - [white, black] = [black, white]; - } - } - for (i = 0; i < totalChunks; i++) { - thisChunkHeight = i < fullChunks ? FULL_CHUNK_HEIGHT : partialChunkHeight; - destPos = 0; - for (j = 0; j < thisChunkHeight; j++) { - const srcDiff = srcLength - srcPos; - let k = 0; - const kEnd = srcDiff > fullSrcDiff ? width : srcDiff * 8 - 7; - const kEndUnrolled = kEnd & ~7; - let mask = 0; - let srcByte = 0; - for (; k < kEndUnrolled; k += 8) { - srcByte = src[srcPos++]; - dest32[destPos++] = srcByte & 128 ? white : black; - dest32[destPos++] = srcByte & 64 ? white : black; - dest32[destPos++] = srcByte & 32 ? white : black; - dest32[destPos++] = srcByte & 16 ? white : black; - dest32[destPos++] = srcByte & 8 ? white : black; - dest32[destPos++] = srcByte & 4 ? white : black; - dest32[destPos++] = srcByte & 2 ? white : black; - dest32[destPos++] = srcByte & 1 ? white : black; - } - for (; k < kEnd; k++) { - if (mask === 0) { - srcByte = src[srcPos++]; - mask = 128; - } - dest32[destPos++] = srcByte & mask ? white : black; - mask >>= 1; - } - } - while (destPos < dest32DataLength) { - dest32[destPos++] = 0; - } - ctx.putImageData(chunkImgData, 0, i * FULL_CHUNK_HEIGHT); - } - } else if (imgData.kind === _util.ImageKind.RGBA_32BPP) { - const hasTransferMaps = !!(transferMapRed || transferMapGreen || transferMapBlue); - j = 0; - elemsInThisChunk = width * FULL_CHUNK_HEIGHT * 4; - for (i = 0; i < fullChunks; i++) { - dest.set(src.subarray(srcPos, srcPos + elemsInThisChunk)); - srcPos += elemsInThisChunk; - if (hasTransferMaps) { - for (let k = 0; k < elemsInThisChunk; k += 4) { - if (transferMapRed) { - dest[k + 0] = transferMapRed[dest[k + 0]]; - } - if (transferMapGreen) { - dest[k + 1] = transferMapGreen[dest[k + 1]]; - } - if (transferMapBlue) { - dest[k + 2] = transferMapBlue[dest[k + 2]]; - } - } - } - ctx.putImageData(chunkImgData, 0, j); - j += FULL_CHUNK_HEIGHT; - } - if (i < totalChunks) { - elemsInThisChunk = width * partialChunkHeight * 4; - dest.set(src.subarray(srcPos, srcPos + elemsInThisChunk)); - if (hasTransferMaps) { - for (let k = 0; k < elemsInThisChunk; k += 4) { - if (transferMapRed) { - dest[k + 0] = transferMapRed[dest[k + 0]]; - } - if (transferMapGreen) { - dest[k + 1] = transferMapGreen[dest[k + 1]]; - } - if (transferMapBlue) { - dest[k + 2] = transferMapBlue[dest[k + 2]]; - } - } - } - ctx.putImageData(chunkImgData, 0, j); - } - } else if (imgData.kind === _util.ImageKind.RGB_24BPP) { - const hasTransferMaps = !!(transferMapRed || transferMapGreen || transferMapBlue); - thisChunkHeight = FULL_CHUNK_HEIGHT; - elemsInThisChunk = width * thisChunkHeight; - for (i = 0; i < totalChunks; i++) { - if (i >= fullChunks) { - thisChunkHeight = partialChunkHeight; - elemsInThisChunk = width * thisChunkHeight; - } - destPos = 0; - for (j = elemsInThisChunk; j--;) { - dest[destPos++] = src[srcPos++]; - dest[destPos++] = src[srcPos++]; - dest[destPos++] = src[srcPos++]; - dest[destPos++] = 255; - } - if (hasTransferMaps) { - for (let k = 0; k < destPos; k += 4) { - if (transferMapRed) { - dest[k + 0] = transferMapRed[dest[k + 0]]; - } - if (transferMapGreen) { - dest[k + 1] = transferMapGreen[dest[k + 1]]; - } - if (transferMapBlue) { - dest[k + 2] = transferMapBlue[dest[k + 2]]; - } - } - } - ctx.putImageData(chunkImgData, 0, i * FULL_CHUNK_HEIGHT); - } - } else { - throw new Error(`bad image kind: ${imgData.kind}`); - } -} -function putBinaryImageMask(ctx, imgData) { - if (imgData.bitmap) { - ctx.drawImage(imgData.bitmap, 0, 0); - return; - } - const height = imgData.height, - width = imgData.width; - const partialChunkHeight = height % FULL_CHUNK_HEIGHT; - const fullChunks = (height - partialChunkHeight) / FULL_CHUNK_HEIGHT; - const totalChunks = partialChunkHeight === 0 ? fullChunks : fullChunks + 1; - const chunkImgData = ctx.createImageData(width, FULL_CHUNK_HEIGHT); - let srcPos = 0; - const src = imgData.data; - const dest = chunkImgData.data; - for (let i = 0; i < totalChunks; i++) { - const thisChunkHeight = i < fullChunks ? FULL_CHUNK_HEIGHT : partialChunkHeight; - ({ - srcPos - } = (0, _image_utils.applyMaskImageData)({ - src, - srcPos, - dest, - width, - height: thisChunkHeight - })); - ctx.putImageData(chunkImgData, 0, i * FULL_CHUNK_HEIGHT); - } -} -function copyCtxState(sourceCtx, destCtx) { - const properties = ["strokeStyle", "fillStyle", "fillRule", "globalAlpha", "lineWidth", "lineCap", "lineJoin", "miterLimit", "globalCompositeOperation", "font"]; - for (const property of properties) { - if (sourceCtx[property] !== undefined) { - destCtx[property] = sourceCtx[property]; - } - } - if (sourceCtx.setLineDash !== undefined) { - destCtx.setLineDash(sourceCtx.getLineDash()); - destCtx.lineDashOffset = sourceCtx.lineDashOffset; - } -} -function resetCtxToDefault(ctx, foregroundColor) { - ctx.strokeStyle = ctx.fillStyle = foregroundColor || "#000000"; - ctx.fillRule = "nonzero"; - ctx.globalAlpha = 1; - ctx.lineWidth = 1; - ctx.lineCap = "butt"; - ctx.lineJoin = "miter"; - ctx.miterLimit = 10; - ctx.globalCompositeOperation = "source-over"; - ctx.font = "10px sans-serif"; - if (ctx.setLineDash !== undefined) { - ctx.setLineDash([]); - ctx.lineDashOffset = 0; - } -} -function composeSMaskBackdrop(bytes, r0, g0, b0) { - const length = bytes.length; - for (let i = 3; i < length; i += 4) { - const alpha = bytes[i]; - if (alpha === 0) { - bytes[i - 3] = r0; - bytes[i - 2] = g0; - bytes[i - 1] = b0; - } else if (alpha < 255) { - const alpha_ = 255 - alpha; - bytes[i - 3] = bytes[i - 3] * alpha + r0 * alpha_ >> 8; - bytes[i - 2] = bytes[i - 2] * alpha + g0 * alpha_ >> 8; - bytes[i - 1] = bytes[i - 1] * alpha + b0 * alpha_ >> 8; - } - } -} -function composeSMaskAlpha(maskData, layerData, transferMap) { - const length = maskData.length; - const scale = 1 / 255; - for (let i = 3; i < length; i += 4) { - const alpha = transferMap ? transferMap[maskData[i]] : maskData[i]; - layerData[i] = layerData[i] * alpha * scale | 0; - } -} -function composeSMaskLuminosity(maskData, layerData, transferMap) { - const length = maskData.length; - for (let i = 3; i < length; i += 4) { - const y = maskData[i - 3] * 77 + maskData[i - 2] * 152 + maskData[i - 1] * 28; - layerData[i] = transferMap ? layerData[i] * transferMap[y >> 8] >> 8 : layerData[i] * y >> 16; - } -} -function genericComposeSMask(maskCtx, layerCtx, width, height, subtype, backdrop, transferMap, layerOffsetX, layerOffsetY, maskOffsetX, maskOffsetY) { - const hasBackdrop = !!backdrop; - const r0 = hasBackdrop ? backdrop[0] : 0; - const g0 = hasBackdrop ? backdrop[1] : 0; - const b0 = hasBackdrop ? backdrop[2] : 0; - let composeFn; - if (subtype === "Luminosity") { - composeFn = composeSMaskLuminosity; - } else { - composeFn = composeSMaskAlpha; - } - const PIXELS_TO_PROCESS = 1048576; - const chunkSize = Math.min(height, Math.ceil(PIXELS_TO_PROCESS / width)); - for (let row = 0; row < height; row += chunkSize) { - const chunkHeight = Math.min(chunkSize, height - row); - const maskData = maskCtx.getImageData(layerOffsetX - maskOffsetX, row + (layerOffsetY - maskOffsetY), width, chunkHeight); - const layerData = layerCtx.getImageData(layerOffsetX, row + layerOffsetY, width, chunkHeight); - if (hasBackdrop) { - composeSMaskBackdrop(maskData.data, r0, g0, b0); - } - composeFn(maskData.data, layerData.data, transferMap); - layerCtx.putImageData(layerData, layerOffsetX, row + layerOffsetY); - } -} -function composeSMask(ctx, smask, layerCtx, layerBox) { - const layerOffsetX = layerBox[0]; - const layerOffsetY = layerBox[1]; - const layerWidth = layerBox[2] - layerOffsetX; - const layerHeight = layerBox[3] - layerOffsetY; - if (layerWidth === 0 || layerHeight === 0) { - return; - } - genericComposeSMask(smask.context, layerCtx, layerWidth, layerHeight, smask.subtype, smask.backdrop, smask.transferMap, layerOffsetX, layerOffsetY, smask.offsetX, smask.offsetY); - ctx.save(); - ctx.globalAlpha = 1; - ctx.globalCompositeOperation = "source-over"; - ctx.setTransform(1, 0, 0, 1, 0, 0); - ctx.drawImage(layerCtx.canvas, 0, 0); - ctx.restore(); -} -function getImageSmoothingEnabled(transform, interpolate) { - const scale = _util.Util.singularValueDecompose2dScale(transform); - scale[0] = Math.fround(scale[0]); - scale[1] = Math.fround(scale[1]); - const actualScale = Math.fround((globalThis.devicePixelRatio || 1) * _display_utils.PixelsPerInch.PDF_TO_CSS_UNITS); - if (interpolate !== undefined) { - return interpolate; - } else if (scale[0] <= actualScale || scale[1] <= actualScale) { - return true; - } - return false; -} -const LINE_CAP_STYLES = ["butt", "round", "square"]; -const LINE_JOIN_STYLES = ["miter", "round", "bevel"]; -const NORMAL_CLIP = {}; -const EO_CLIP = {}; -class CanvasGraphics { - constructor(canvasCtx, commonObjs, objs, canvasFactory, { - optionalContentConfig, - markedContentStack = null - }, annotationCanvasMap, pageColors) { - this.ctx = canvasCtx; - this.current = new CanvasExtraState(this.ctx.canvas.width, this.ctx.canvas.height); - this.stateStack = []; - this.pendingClip = null; - this.pendingEOFill = false; - this.res = null; - this.xobjs = null; - this.commonObjs = commonObjs; - this.objs = objs; - this.canvasFactory = canvasFactory; - this.groupStack = []; - this.processingType3 = null; - this.baseTransform = null; - this.baseTransformStack = []; - this.groupLevel = 0; - this.smaskStack = []; - this.smaskCounter = 0; - this.tempSMask = null; - this.suspendedCtx = null; - this.contentVisible = true; - this.markedContentStack = markedContentStack || []; - this.optionalContentConfig = optionalContentConfig; - this.cachedCanvases = new CachedCanvases(this.canvasFactory); - this.cachedPatterns = new Map(); - this.annotationCanvasMap = annotationCanvasMap; - this.viewportScale = 1; - this.outputScaleX = 1; - this.outputScaleY = 1; - this.backgroundColor = pageColors?.background || null; - this.foregroundColor = pageColors?.foreground || null; - this._cachedScaleForStroking = null; - this._cachedGetSinglePixelWidth = null; - this._cachedBitmapsMap = new Map(); - } - getObject(data, fallback = null) { - if (typeof data === "string") { - return data.startsWith("g_") ? this.commonObjs.get(data) : this.objs.get(data); - } - return fallback; - } - beginDrawing({ - transform, - viewport, - transparency = false, - background = null - }) { - const width = this.ctx.canvas.width; - const height = this.ctx.canvas.height; - const defaultBackgroundColor = background || "#ffffff"; - this.ctx.save(); - if (this.foregroundColor && this.backgroundColor) { - this.ctx.fillStyle = this.foregroundColor; - const fg = this.foregroundColor = this.ctx.fillStyle; - this.ctx.fillStyle = this.backgroundColor; - const bg = this.backgroundColor = this.ctx.fillStyle; - let isValidDefaultBg = true; - let defaultBg = defaultBackgroundColor; - this.ctx.fillStyle = defaultBackgroundColor; - defaultBg = this.ctx.fillStyle; - isValidDefaultBg = typeof defaultBg === "string" && /^#[0-9A-Fa-f]{6}$/.test(defaultBg); - if (fg === "#000000" && bg === "#ffffff" || fg === bg || !isValidDefaultBg) { - this.foregroundColor = this.backgroundColor = null; - } else { - const [rB, gB, bB] = (0, _display_utils.getRGB)(defaultBg); - const newComp = x => { - x /= 255; - return x <= 0.03928 ? x / 12.92 : ((x + 0.055) / 1.055) ** 2.4; - }; - const lumB = Math.round(0.2126 * newComp(rB) + 0.7152 * newComp(gB) + 0.0722 * newComp(bB)); - this.selectColor = (r, g, b) => { - const lumC = 0.2126 * newComp(r) + 0.7152 * newComp(g) + 0.0722 * newComp(b); - return Math.round(lumC) === lumB ? bg : fg; - }; - } - } - this.ctx.fillStyle = this.backgroundColor || defaultBackgroundColor; - this.ctx.fillRect(0, 0, width, height); - this.ctx.restore(); - if (transparency) { - const transparentCanvas = this.cachedCanvases.getCanvas("transparent", width, height); - this.compositeCtx = this.ctx; - this.transparentCanvas = transparentCanvas.canvas; - this.ctx = transparentCanvas.context; - this.ctx.save(); - this.ctx.transform(...(0, _display_utils.getCurrentTransform)(this.compositeCtx)); - } - this.ctx.save(); - resetCtxToDefault(this.ctx, this.foregroundColor); - if (transform) { - this.ctx.transform(...transform); - this.outputScaleX = transform[0]; - this.outputScaleY = transform[0]; - } - this.ctx.transform(...viewport.transform); - this.viewportScale = viewport.scale; - this.baseTransform = (0, _display_utils.getCurrentTransform)(this.ctx); - } - executeOperatorList(operatorList, executionStartIdx, continueCallback, stepper) { - const argsArray = operatorList.argsArray; - const fnArray = operatorList.fnArray; - let i = executionStartIdx || 0; - const argsArrayLen = argsArray.length; - if (argsArrayLen === i) { - return i; - } - const chunkOperations = argsArrayLen - i > EXECUTION_STEPS && typeof continueCallback === "function"; - const endTime = chunkOperations ? Date.now() + EXECUTION_TIME : 0; - let steps = 0; - const commonObjs = this.commonObjs; - const objs = this.objs; - let fnId; - while (true) { - if (stepper !== undefined && i === stepper.nextBreakPoint) { - stepper.breakIt(i, continueCallback); - return i; - } - fnId = fnArray[i]; - if (fnId !== _util.OPS.dependency) { - this[fnId].apply(this, argsArray[i]); - } else { - for (const depObjId of argsArray[i]) { - const objsPool = depObjId.startsWith("g_") ? commonObjs : objs; - if (!objsPool.has(depObjId)) { - objsPool.get(depObjId, continueCallback); - return i; - } - } - } - i++; - if (i === argsArrayLen) { - return i; - } - if (chunkOperations && ++steps > EXECUTION_STEPS) { - if (Date.now() > endTime) { - continueCallback(); - return i; - } - steps = 0; - } - } - } - #restoreInitialState() { - while (this.stateStack.length || this.inSMaskMode) { - this.restore(); - } - this.ctx.restore(); - if (this.transparentCanvas) { - this.ctx = this.compositeCtx; - this.ctx.save(); - this.ctx.setTransform(1, 0, 0, 1, 0, 0); - this.ctx.drawImage(this.transparentCanvas, 0, 0); - this.ctx.restore(); - this.transparentCanvas = null; - } - } - endDrawing() { - this.#restoreInitialState(); - this.cachedCanvases.clear(); - this.cachedPatterns.clear(); - for (const cache of this._cachedBitmapsMap.values()) { - for (const canvas of cache.values()) { - if (typeof HTMLCanvasElement !== "undefined" && canvas instanceof HTMLCanvasElement) { - canvas.width = canvas.height = 0; - } - } - cache.clear(); - } - this._cachedBitmapsMap.clear(); - } - _scaleImage(img, inverseTransform) { - const width = img.width; - const height = img.height; - let widthScale = Math.max(Math.hypot(inverseTransform[0], inverseTransform[1]), 1); - let heightScale = Math.max(Math.hypot(inverseTransform[2], inverseTransform[3]), 1); - let paintWidth = width, - paintHeight = height; - let tmpCanvasId = "prescale1"; - let tmpCanvas, tmpCtx; - while (widthScale > 2 && paintWidth > 1 || heightScale > 2 && paintHeight > 1) { - let newWidth = paintWidth, - newHeight = paintHeight; - if (widthScale > 2 && paintWidth > 1) { - newWidth = Math.ceil(paintWidth / 2); - widthScale /= paintWidth / newWidth; - } - if (heightScale > 2 && paintHeight > 1) { - newHeight = Math.ceil(paintHeight / 2); - heightScale /= paintHeight / newHeight; - } - tmpCanvas = this.cachedCanvases.getCanvas(tmpCanvasId, newWidth, newHeight); - tmpCtx = tmpCanvas.context; - tmpCtx.clearRect(0, 0, newWidth, newHeight); - tmpCtx.drawImage(img, 0, 0, paintWidth, paintHeight, 0, 0, newWidth, newHeight); - img = tmpCanvas.canvas; - paintWidth = newWidth; - paintHeight = newHeight; - tmpCanvasId = tmpCanvasId === "prescale1" ? "prescale2" : "prescale1"; - } - return { - img, - paintWidth, - paintHeight - }; - } - _createMaskCanvas(img) { - const ctx = this.ctx; - const { - width, - height - } = img; - const fillColor = this.current.fillColor; - const isPatternFill = this.current.patternFill; - const currentTransform = (0, _display_utils.getCurrentTransform)(ctx); - let cache, cacheKey, scaled, maskCanvas; - if ((img.bitmap || img.data) && img.count > 1) { - const mainKey = img.bitmap || img.data.buffer; - cacheKey = JSON.stringify(isPatternFill ? currentTransform : [currentTransform.slice(0, 4), fillColor]); - cache = this._cachedBitmapsMap.get(mainKey); - if (!cache) { - cache = new Map(); - this._cachedBitmapsMap.set(mainKey, cache); - } - const cachedImage = cache.get(cacheKey); - if (cachedImage && !isPatternFill) { - const offsetX = Math.round(Math.min(currentTransform[0], currentTransform[2]) + currentTransform[4]); - const offsetY = Math.round(Math.min(currentTransform[1], currentTransform[3]) + currentTransform[5]); - return { - canvas: cachedImage, - offsetX, - offsetY - }; - } - scaled = cachedImage; - } - if (!scaled) { - maskCanvas = this.cachedCanvases.getCanvas("maskCanvas", width, height); - putBinaryImageMask(maskCanvas.context, img); - } - let maskToCanvas = _util.Util.transform(currentTransform, [1 / width, 0, 0, -1 / height, 0, 0]); - maskToCanvas = _util.Util.transform(maskToCanvas, [1, 0, 0, 1, 0, -height]); - const cord1 = _util.Util.applyTransform([0, 0], maskToCanvas); - const cord2 = _util.Util.applyTransform([width, height], maskToCanvas); - const rect = _util.Util.normalizeRect([cord1[0], cord1[1], cord2[0], cord2[1]]); - const drawnWidth = Math.round(rect[2] - rect[0]) || 1; - const drawnHeight = Math.round(rect[3] - rect[1]) || 1; - const fillCanvas = this.cachedCanvases.getCanvas("fillCanvas", drawnWidth, drawnHeight); - const fillCtx = fillCanvas.context; - const offsetX = Math.min(cord1[0], cord2[0]); - const offsetY = Math.min(cord1[1], cord2[1]); - fillCtx.translate(-offsetX, -offsetY); - fillCtx.transform(...maskToCanvas); - if (!scaled) { - scaled = this._scaleImage(maskCanvas.canvas, (0, _display_utils.getCurrentTransformInverse)(fillCtx)); - scaled = scaled.img; - if (cache && isPatternFill) { - cache.set(cacheKey, scaled); - } - } - fillCtx.imageSmoothingEnabled = getImageSmoothingEnabled((0, _display_utils.getCurrentTransform)(fillCtx), img.interpolate); - drawImageAtIntegerCoords(fillCtx, scaled, 0, 0, scaled.width, scaled.height, 0, 0, width, height); - fillCtx.globalCompositeOperation = "source-in"; - const inverse = _util.Util.transform((0, _display_utils.getCurrentTransformInverse)(fillCtx), [1, 0, 0, 1, -offsetX, -offsetY]); - fillCtx.fillStyle = isPatternFill ? fillColor.getPattern(ctx, this, inverse, _pattern_helper.PathType.FILL) : fillColor; - fillCtx.fillRect(0, 0, width, height); - if (cache && !isPatternFill) { - this.cachedCanvases.delete("fillCanvas"); - cache.set(cacheKey, fillCanvas.canvas); - } - return { - canvas: fillCanvas.canvas, - offsetX: Math.round(offsetX), - offsetY: Math.round(offsetY) - }; - } - setLineWidth(width) { - if (width !== this.current.lineWidth) { - this._cachedScaleForStroking = null; - } - this.current.lineWidth = width; - this.ctx.lineWidth = width; - } - setLineCap(style) { - this.ctx.lineCap = LINE_CAP_STYLES[style]; - } - setLineJoin(style) { - this.ctx.lineJoin = LINE_JOIN_STYLES[style]; - } - setMiterLimit(limit) { - this.ctx.miterLimit = limit; - } - setDash(dashArray, dashPhase) { - const ctx = this.ctx; - if (ctx.setLineDash !== undefined) { - ctx.setLineDash(dashArray); - ctx.lineDashOffset = dashPhase; - } - } - setRenderingIntent(intent) {} - setFlatness(flatness) {} - setGState(states) { - for (const [key, value] of states) { - switch (key) { - case "LW": - this.setLineWidth(value); - break; - case "LC": - this.setLineCap(value); - break; - case "LJ": - this.setLineJoin(value); - break; - case "ML": - this.setMiterLimit(value); - break; - case "D": - this.setDash(value[0], value[1]); - break; - case "RI": - this.setRenderingIntent(value); - break; - case "FL": - this.setFlatness(value); - break; - case "Font": - this.setFont(value[0], value[1]); - break; - case "CA": - this.current.strokeAlpha = value; - break; - case "ca": - this.current.fillAlpha = value; - this.ctx.globalAlpha = value; - break; - case "BM": - this.ctx.globalCompositeOperation = value; - break; - case "SMask": - this.current.activeSMask = value ? this.tempSMask : null; - this.tempSMask = null; - this.checkSMaskState(); - break; - case "TR": - this.current.transferMaps = value; - } - } - } - get inSMaskMode() { - return !!this.suspendedCtx; - } - checkSMaskState() { - const inSMaskMode = this.inSMaskMode; - if (this.current.activeSMask && !inSMaskMode) { - this.beginSMaskMode(); - } else if (!this.current.activeSMask && inSMaskMode) { - this.endSMaskMode(); - } - } - beginSMaskMode() { - if (this.inSMaskMode) { - throw new Error("beginSMaskMode called while already in smask mode"); - } - const drawnWidth = this.ctx.canvas.width; - const drawnHeight = this.ctx.canvas.height; - const cacheId = "smaskGroupAt" + this.groupLevel; - const scratchCanvas = this.cachedCanvases.getCanvas(cacheId, drawnWidth, drawnHeight); - this.suspendedCtx = this.ctx; - this.ctx = scratchCanvas.context; - const ctx = this.ctx; - ctx.setTransform(...(0, _display_utils.getCurrentTransform)(this.suspendedCtx)); - copyCtxState(this.suspendedCtx, ctx); - mirrorContextOperations(ctx, this.suspendedCtx); - this.setGState([["BM", "source-over"], ["ca", 1], ["CA", 1]]); - } - endSMaskMode() { - if (!this.inSMaskMode) { - throw new Error("endSMaskMode called while not in smask mode"); - } - this.ctx._removeMirroring(); - copyCtxState(this.ctx, this.suspendedCtx); - this.ctx = this.suspendedCtx; - this.suspendedCtx = null; - } - compose(dirtyBox) { - if (!this.current.activeSMask) { - return; - } - if (!dirtyBox) { - dirtyBox = [0, 0, this.ctx.canvas.width, this.ctx.canvas.height]; - } else { - dirtyBox[0] = Math.floor(dirtyBox[0]); - dirtyBox[1] = Math.floor(dirtyBox[1]); - dirtyBox[2] = Math.ceil(dirtyBox[2]); - dirtyBox[3] = Math.ceil(dirtyBox[3]); - } - const smask = this.current.activeSMask; - const suspendedCtx = this.suspendedCtx; - composeSMask(suspendedCtx, smask, this.ctx, dirtyBox); - this.ctx.save(); - this.ctx.setTransform(1, 0, 0, 1, 0, 0); - this.ctx.clearRect(0, 0, this.ctx.canvas.width, this.ctx.canvas.height); - this.ctx.restore(); - } - save() { - if (this.inSMaskMode) { - copyCtxState(this.ctx, this.suspendedCtx); - this.suspendedCtx.save(); - } else { - this.ctx.save(); - } - const old = this.current; - this.stateStack.push(old); - this.current = old.clone(); - } - restore() { - if (this.stateStack.length === 0 && this.inSMaskMode) { - this.endSMaskMode(); - } - if (this.stateStack.length !== 0) { - this.current = this.stateStack.pop(); - if (this.inSMaskMode) { - this.suspendedCtx.restore(); - copyCtxState(this.suspendedCtx, this.ctx); - } else { - this.ctx.restore(); - } - this.checkSMaskState(); - this.pendingClip = null; - this._cachedScaleForStroking = null; - this._cachedGetSinglePixelWidth = null; - } - } - transform(a, b, c, d, e, f) { - this.ctx.transform(a, b, c, d, e, f); - this._cachedScaleForStroking = null; - this._cachedGetSinglePixelWidth = null; - } - constructPath(ops, args, minMax) { - const ctx = this.ctx; - const current = this.current; - let x = current.x, - y = current.y; - let startX, startY; - const currentTransform = (0, _display_utils.getCurrentTransform)(ctx); - const isScalingMatrix = currentTransform[0] === 0 && currentTransform[3] === 0 || currentTransform[1] === 0 && currentTransform[2] === 0; - const minMaxForBezier = isScalingMatrix ? minMax.slice(0) : null; - for (let i = 0, j = 0, ii = ops.length; i < ii; i++) { - switch (ops[i] | 0) { - case _util.OPS.rectangle: - x = args[j++]; - y = args[j++]; - const width = args[j++]; - const height = args[j++]; - const xw = x + width; - const yh = y + height; - ctx.moveTo(x, y); - if (width === 0 || height === 0) { - ctx.lineTo(xw, yh); - } else { - ctx.lineTo(xw, y); - ctx.lineTo(xw, yh); - ctx.lineTo(x, yh); - } - if (!isScalingMatrix) { - current.updateRectMinMax(currentTransform, [x, y, xw, yh]); - } - ctx.closePath(); - break; - case _util.OPS.moveTo: - x = args[j++]; - y = args[j++]; - ctx.moveTo(x, y); - if (!isScalingMatrix) { - current.updatePathMinMax(currentTransform, x, y); - } - break; - case _util.OPS.lineTo: - x = args[j++]; - y = args[j++]; - ctx.lineTo(x, y); - if (!isScalingMatrix) { - current.updatePathMinMax(currentTransform, x, y); - } - break; - case _util.OPS.curveTo: - startX = x; - startY = y; - x = args[j + 4]; - y = args[j + 5]; - ctx.bezierCurveTo(args[j], args[j + 1], args[j + 2], args[j + 3], x, y); - current.updateCurvePathMinMax(currentTransform, startX, startY, args[j], args[j + 1], args[j + 2], args[j + 3], x, y, minMaxForBezier); - j += 6; - break; - case _util.OPS.curveTo2: - startX = x; - startY = y; - ctx.bezierCurveTo(x, y, args[j], args[j + 1], args[j + 2], args[j + 3]); - current.updateCurvePathMinMax(currentTransform, startX, startY, x, y, args[j], args[j + 1], args[j + 2], args[j + 3], minMaxForBezier); - x = args[j + 2]; - y = args[j + 3]; - j += 4; - break; - case _util.OPS.curveTo3: - startX = x; - startY = y; - x = args[j + 2]; - y = args[j + 3]; - ctx.bezierCurveTo(args[j], args[j + 1], x, y, x, y); - current.updateCurvePathMinMax(currentTransform, startX, startY, args[j], args[j + 1], x, y, x, y, minMaxForBezier); - j += 4; - break; - case _util.OPS.closePath: - ctx.closePath(); - break; - } - } - if (isScalingMatrix) { - current.updateScalingPathMinMax(currentTransform, minMaxForBezier); - } - current.setCurrentPoint(x, y); - } - closePath() { - this.ctx.closePath(); - } - stroke(consumePath = true) { - const ctx = this.ctx; - const strokeColor = this.current.strokeColor; - ctx.globalAlpha = this.current.strokeAlpha; - if (this.contentVisible) { - if (typeof strokeColor === "object" && strokeColor?.getPattern) { - ctx.save(); - ctx.strokeStyle = strokeColor.getPattern(ctx, this, (0, _display_utils.getCurrentTransformInverse)(ctx), _pattern_helper.PathType.STROKE); - this.rescaleAndStroke(false); - ctx.restore(); - } else { - this.rescaleAndStroke(true); - } - } - if (consumePath) { - this.consumePath(this.current.getClippedPathBoundingBox()); - } - ctx.globalAlpha = this.current.fillAlpha; - } - closeStroke() { - this.closePath(); - this.stroke(); - } - fill(consumePath = true) { - const ctx = this.ctx; - const fillColor = this.current.fillColor; - const isPatternFill = this.current.patternFill; - let needRestore = false; - if (isPatternFill) { - ctx.save(); - ctx.fillStyle = fillColor.getPattern(ctx, this, (0, _display_utils.getCurrentTransformInverse)(ctx), _pattern_helper.PathType.FILL); - needRestore = true; - } - const intersect = this.current.getClippedPathBoundingBox(); - if (this.contentVisible && intersect !== null) { - if (this.pendingEOFill) { - ctx.fill("evenodd"); - this.pendingEOFill = false; - } else { - ctx.fill(); - } - } - if (needRestore) { - ctx.restore(); - } - if (consumePath) { - this.consumePath(intersect); - } - } - eoFill() { - this.pendingEOFill = true; - this.fill(); - } - fillStroke() { - this.fill(false); - this.stroke(false); - this.consumePath(); - } - eoFillStroke() { - this.pendingEOFill = true; - this.fillStroke(); - } - closeFillStroke() { - this.closePath(); - this.fillStroke(); - } - closeEOFillStroke() { - this.pendingEOFill = true; - this.closePath(); - this.fillStroke(); - } - endPath() { - this.consumePath(); - } - clip() { - this.pendingClip = NORMAL_CLIP; - } - eoClip() { - this.pendingClip = EO_CLIP; - } - beginText() { - this.current.textMatrix = _util.IDENTITY_MATRIX; - this.current.textMatrixScale = 1; - this.current.x = this.current.lineX = 0; - this.current.y = this.current.lineY = 0; - } - endText() { - const paths = this.pendingTextPaths; - const ctx = this.ctx; - if (paths === undefined) { - ctx.beginPath(); - return; - } - ctx.save(); - ctx.beginPath(); - for (const path of paths) { - ctx.setTransform(...path.transform); - ctx.translate(path.x, path.y); - path.addToPath(ctx, path.fontSize); - } - ctx.restore(); - ctx.clip(); - ctx.beginPath(); - delete this.pendingTextPaths; - } - setCharSpacing(spacing) { - this.current.charSpacing = spacing; - } - setWordSpacing(spacing) { - this.current.wordSpacing = spacing; - } - setHScale(scale) { - this.current.textHScale = scale / 100; - } - setLeading(leading) { - this.current.leading = -leading; - } - setFont(fontRefName, size) { - const fontObj = this.commonObjs.get(fontRefName); - const current = this.current; - if (!fontObj) { - throw new Error(`Can't find font for ${fontRefName}`); - } - current.fontMatrix = fontObj.fontMatrix || _util.FONT_IDENTITY_MATRIX; - if (current.fontMatrix[0] === 0 || current.fontMatrix[3] === 0) { - (0, _util.warn)("Invalid font matrix for font " + fontRefName); - } - if (size < 0) { - size = -size; - current.fontDirection = -1; - } else { - current.fontDirection = 1; - } - this.current.font = fontObj; - this.current.fontSize = size; - if (fontObj.isType3Font) { - return; - } - const name = fontObj.loadedName || "sans-serif"; - let bold = "normal"; - if (fontObj.black) { - bold = "900"; - } else if (fontObj.bold) { - bold = "bold"; - } - const italic = fontObj.italic ? "italic" : "normal"; - const typeface = `"${name}", ${fontObj.fallbackName}`; - let browserFontSize = size; - if (size < MIN_FONT_SIZE) { - browserFontSize = MIN_FONT_SIZE; - } else if (size > MAX_FONT_SIZE) { - browserFontSize = MAX_FONT_SIZE; - } - this.current.fontSizeScale = size / browserFontSize; - this.ctx.font = `${italic} ${bold} ${browserFontSize}px ${typeface}`; - } - setTextRenderingMode(mode) { - this.current.textRenderingMode = mode; - } - setTextRise(rise) { - this.current.textRise = rise; - } - moveText(x, y) { - this.current.x = this.current.lineX += x; - this.current.y = this.current.lineY += y; - } - setLeadingMoveText(x, y) { - this.setLeading(-y); - this.moveText(x, y); - } - setTextMatrix(a, b, c, d, e, f) { - this.current.textMatrix = [a, b, c, d, e, f]; - this.current.textMatrixScale = Math.hypot(a, b); - this.current.x = this.current.lineX = 0; - this.current.y = this.current.lineY = 0; - } - nextLine() { - this.moveText(0, this.current.leading); - } - paintChar(character, x, y, patternTransform) { - const ctx = this.ctx; - const current = this.current; - const font = current.font; - const textRenderingMode = current.textRenderingMode; - const fontSize = current.fontSize / current.fontSizeScale; - const fillStrokeMode = textRenderingMode & _util.TextRenderingMode.FILL_STROKE_MASK; - const isAddToPathSet = !!(textRenderingMode & _util.TextRenderingMode.ADD_TO_PATH_FLAG); - const patternFill = current.patternFill && !font.missingFile; - let addToPath; - if (font.disableFontFace || isAddToPathSet || patternFill) { - addToPath = font.getPathGenerator(this.commonObjs, character); - } - if (font.disableFontFace || patternFill) { - ctx.save(); - ctx.translate(x, y); - ctx.beginPath(); - addToPath(ctx, fontSize); - if (patternTransform) { - ctx.setTransform(...patternTransform); - } - if (fillStrokeMode === _util.TextRenderingMode.FILL || fillStrokeMode === _util.TextRenderingMode.FILL_STROKE) { - ctx.fill(); - } - if (fillStrokeMode === _util.TextRenderingMode.STROKE || fillStrokeMode === _util.TextRenderingMode.FILL_STROKE) { - ctx.stroke(); - } - ctx.restore(); - } else { - if (fillStrokeMode === _util.TextRenderingMode.FILL || fillStrokeMode === _util.TextRenderingMode.FILL_STROKE) { - ctx.fillText(character, x, y); - } - if (fillStrokeMode === _util.TextRenderingMode.STROKE || fillStrokeMode === _util.TextRenderingMode.FILL_STROKE) { - ctx.strokeText(character, x, y); - } - } - if (isAddToPathSet) { - const paths = this.pendingTextPaths || (this.pendingTextPaths = []); - paths.push({ - transform: (0, _display_utils.getCurrentTransform)(ctx), - x, - y, - fontSize, - addToPath - }); - } - } - get isFontSubpixelAAEnabled() { - const { - context: ctx - } = this.cachedCanvases.getCanvas("isFontSubpixelAAEnabled", 10, 10); - ctx.scale(1.5, 1); - ctx.fillText("I", 0, 10); - const data = ctx.getImageData(0, 0, 10, 10).data; - let enabled = false; - for (let i = 3; i < data.length; i += 4) { - if (data[i] > 0 && data[i] < 255) { - enabled = true; - break; - } - } - return (0, _util.shadow)(this, "isFontSubpixelAAEnabled", enabled); - } - showText(glyphs) { - const current = this.current; - const font = current.font; - if (font.isType3Font) { - return this.showType3Text(glyphs); - } - const fontSize = current.fontSize; - if (fontSize === 0) { - return undefined; - } - const ctx = this.ctx; - const fontSizeScale = current.fontSizeScale; - const charSpacing = current.charSpacing; - const wordSpacing = current.wordSpacing; - const fontDirection = current.fontDirection; - const textHScale = current.textHScale * fontDirection; - const glyphsLength = glyphs.length; - const vertical = font.vertical; - const spacingDir = vertical ? 1 : -1; - const defaultVMetrics = font.defaultVMetrics; - const widthAdvanceScale = fontSize * current.fontMatrix[0]; - const simpleFillText = current.textRenderingMode === _util.TextRenderingMode.FILL && !font.disableFontFace && !current.patternFill; - ctx.save(); - ctx.transform(...current.textMatrix); - ctx.translate(current.x, current.y + current.textRise); - if (fontDirection > 0) { - ctx.scale(textHScale, -1); - } else { - ctx.scale(textHScale, 1); - } - let patternTransform; - if (current.patternFill) { - ctx.save(); - const pattern = current.fillColor.getPattern(ctx, this, (0, _display_utils.getCurrentTransformInverse)(ctx), _pattern_helper.PathType.FILL); - patternTransform = (0, _display_utils.getCurrentTransform)(ctx); - ctx.restore(); - ctx.fillStyle = pattern; - } - let lineWidth = current.lineWidth; - const scale = current.textMatrixScale; - if (scale === 0 || lineWidth === 0) { - const fillStrokeMode = current.textRenderingMode & _util.TextRenderingMode.FILL_STROKE_MASK; - if (fillStrokeMode === _util.TextRenderingMode.STROKE || fillStrokeMode === _util.TextRenderingMode.FILL_STROKE) { - lineWidth = this.getSinglePixelWidth(); - } - } else { - lineWidth /= scale; - } - if (fontSizeScale !== 1.0) { - ctx.scale(fontSizeScale, fontSizeScale); - lineWidth /= fontSizeScale; - } - ctx.lineWidth = lineWidth; - if (font.isInvalidPDFjsFont) { - const chars = []; - let width = 0; - for (const glyph of glyphs) { - chars.push(glyph.unicode); - width += glyph.width; - } - ctx.fillText(chars.join(""), 0, 0); - current.x += width * widthAdvanceScale * textHScale; - ctx.restore(); - this.compose(); - return undefined; - } - let x = 0, - i; - for (i = 0; i < glyphsLength; ++i) { - const glyph = glyphs[i]; - if (typeof glyph === "number") { - x += spacingDir * glyph * fontSize / 1000; - continue; - } - let restoreNeeded = false; - const spacing = (glyph.isSpace ? wordSpacing : 0) + charSpacing; - const character = glyph.fontChar; - const accent = glyph.accent; - let scaledX, scaledY; - let width = glyph.width; - if (vertical) { - const vmetric = glyph.vmetric || defaultVMetrics; - const vx = -(glyph.vmetric ? vmetric[1] : width * 0.5) * widthAdvanceScale; - const vy = vmetric[2] * widthAdvanceScale; - width = vmetric ? -vmetric[0] : width; - scaledX = vx / fontSizeScale; - scaledY = (x + vy) / fontSizeScale; - } else { - scaledX = x / fontSizeScale; - scaledY = 0; - } - if (font.remeasure && width > 0) { - const measuredWidth = ctx.measureText(character).width * 1000 / fontSize * fontSizeScale; - if (width < measuredWidth && this.isFontSubpixelAAEnabled) { - const characterScaleX = width / measuredWidth; - restoreNeeded = true; - ctx.save(); - ctx.scale(characterScaleX, 1); - scaledX /= characterScaleX; - } else if (width !== measuredWidth) { - scaledX += (width - measuredWidth) / 2000 * fontSize / fontSizeScale; - } - } - if (this.contentVisible && (glyph.isInFont || font.missingFile)) { - if (simpleFillText && !accent) { - ctx.fillText(character, scaledX, scaledY); - } else { - this.paintChar(character, scaledX, scaledY, patternTransform); - if (accent) { - const scaledAccentX = scaledX + fontSize * accent.offset.x / fontSizeScale; - const scaledAccentY = scaledY - fontSize * accent.offset.y / fontSizeScale; - this.paintChar(accent.fontChar, scaledAccentX, scaledAccentY, patternTransform); - } - } - } - let charWidth; - if (vertical) { - charWidth = width * widthAdvanceScale - spacing * fontDirection; - } else { - charWidth = width * widthAdvanceScale + spacing * fontDirection; - } - x += charWidth; - if (restoreNeeded) { - ctx.restore(); - } - } - if (vertical) { - current.y -= x; - } else { - current.x += x * textHScale; - } - ctx.restore(); - this.compose(); - return undefined; - } - showType3Text(glyphs) { - const ctx = this.ctx; - const current = this.current; - const font = current.font; - const fontSize = current.fontSize; - const fontDirection = current.fontDirection; - const spacingDir = font.vertical ? 1 : -1; - const charSpacing = current.charSpacing; - const wordSpacing = current.wordSpacing; - const textHScale = current.textHScale * fontDirection; - const fontMatrix = current.fontMatrix || _util.FONT_IDENTITY_MATRIX; - const glyphsLength = glyphs.length; - const isTextInvisible = current.textRenderingMode === _util.TextRenderingMode.INVISIBLE; - let i, glyph, width, spacingLength; - if (isTextInvisible || fontSize === 0) { - return; - } - this._cachedScaleForStroking = null; - this._cachedGetSinglePixelWidth = null; - ctx.save(); - ctx.transform(...current.textMatrix); - ctx.translate(current.x, current.y); - ctx.scale(textHScale, fontDirection); - for (i = 0; i < glyphsLength; ++i) { - glyph = glyphs[i]; - if (typeof glyph === "number") { - spacingLength = spacingDir * glyph * fontSize / 1000; - this.ctx.translate(spacingLength, 0); - current.x += spacingLength * textHScale; - continue; - } - const spacing = (glyph.isSpace ? wordSpacing : 0) + charSpacing; - const operatorList = font.charProcOperatorList[glyph.operatorListId]; - if (!operatorList) { - (0, _util.warn)(`Type3 character "${glyph.operatorListId}" is not available.`); - continue; - } - if (this.contentVisible) { - this.processingType3 = glyph; - this.save(); - ctx.scale(fontSize, fontSize); - ctx.transform(...fontMatrix); - this.executeOperatorList(operatorList); - this.restore(); - } - const transformed = _util.Util.applyTransform([glyph.width, 0], fontMatrix); - width = transformed[0] * fontSize + spacing; - ctx.translate(width, 0); - current.x += width * textHScale; - } - ctx.restore(); - this.processingType3 = null; - } - setCharWidth(xWidth, yWidth) {} - setCharWidthAndBounds(xWidth, yWidth, llx, lly, urx, ury) { - this.ctx.rect(llx, lly, urx - llx, ury - lly); - this.ctx.clip(); - this.endPath(); - } - getColorN_Pattern(IR) { - let pattern; - if (IR[0] === "TilingPattern") { - const color = IR[1]; - const baseTransform = this.baseTransform || (0, _display_utils.getCurrentTransform)(this.ctx); - const canvasGraphicsFactory = { - createCanvasGraphics: ctx => { - return new CanvasGraphics(ctx, this.commonObjs, this.objs, this.canvasFactory, { - optionalContentConfig: this.optionalContentConfig, - markedContentStack: this.markedContentStack - }); - } - }; - pattern = new _pattern_helper.TilingPattern(IR, color, this.ctx, canvasGraphicsFactory, baseTransform); - } else { - pattern = this._getPattern(IR[1], IR[2]); - } - return pattern; - } - setStrokeColorN() { - this.current.strokeColor = this.getColorN_Pattern(arguments); - } - setFillColorN() { - this.current.fillColor = this.getColorN_Pattern(arguments); - this.current.patternFill = true; - } - setStrokeRGBColor(r, g, b) { - const color = this.selectColor?.(r, g, b) || _util.Util.makeHexColor(r, g, b); - this.ctx.strokeStyle = color; - this.current.strokeColor = color; - } - setFillRGBColor(r, g, b) { - const color = this.selectColor?.(r, g, b) || _util.Util.makeHexColor(r, g, b); - this.ctx.fillStyle = color; - this.current.fillColor = color; - this.current.patternFill = false; - } - _getPattern(objId, matrix = null) { - let pattern; - if (this.cachedPatterns.has(objId)) { - pattern = this.cachedPatterns.get(objId); - } else { - pattern = (0, _pattern_helper.getShadingPattern)(this.objs.get(objId)); - this.cachedPatterns.set(objId, pattern); - } - if (matrix) { - pattern.matrix = matrix; - } - return pattern; - } - shadingFill(objId) { - if (!this.contentVisible) { - return; - } - const ctx = this.ctx; - this.save(); - const pattern = this._getPattern(objId); - ctx.fillStyle = pattern.getPattern(ctx, this, (0, _display_utils.getCurrentTransformInverse)(ctx), _pattern_helper.PathType.SHADING); - const inv = (0, _display_utils.getCurrentTransformInverse)(ctx); - if (inv) { - const canvas = ctx.canvas; - const width = canvas.width; - const height = canvas.height; - const bl = _util.Util.applyTransform([0, 0], inv); - const br = _util.Util.applyTransform([0, height], inv); - const ul = _util.Util.applyTransform([width, 0], inv); - const ur = _util.Util.applyTransform([width, height], inv); - const x0 = Math.min(bl[0], br[0], ul[0], ur[0]); - const y0 = Math.min(bl[1], br[1], ul[1], ur[1]); - const x1 = Math.max(bl[0], br[0], ul[0], ur[0]); - const y1 = Math.max(bl[1], br[1], ul[1], ur[1]); - this.ctx.fillRect(x0, y0, x1 - x0, y1 - y0); - } else { - this.ctx.fillRect(-1e10, -1e10, 2e10, 2e10); - } - this.compose(this.current.getClippedPathBoundingBox()); - this.restore(); - } - beginInlineImage() { - (0, _util.unreachable)("Should not call beginInlineImage"); - } - beginImageData() { - (0, _util.unreachable)("Should not call beginImageData"); - } - paintFormXObjectBegin(matrix, bbox) { - if (!this.contentVisible) { - return; - } - this.save(); - this.baseTransformStack.push(this.baseTransform); - if (Array.isArray(matrix) && matrix.length === 6) { - this.transform(...matrix); - } - this.baseTransform = (0, _display_utils.getCurrentTransform)(this.ctx); - if (bbox) { - const width = bbox[2] - bbox[0]; - const height = bbox[3] - bbox[1]; - this.ctx.rect(bbox[0], bbox[1], width, height); - this.current.updateRectMinMax((0, _display_utils.getCurrentTransform)(this.ctx), bbox); - this.clip(); - this.endPath(); - } - } - paintFormXObjectEnd() { - if (!this.contentVisible) { - return; - } - this.restore(); - this.baseTransform = this.baseTransformStack.pop(); - } - beginGroup(group) { - if (!this.contentVisible) { - return; - } - this.save(); - if (this.inSMaskMode) { - this.endSMaskMode(); - this.current.activeSMask = null; - } - const currentCtx = this.ctx; - if (!group.isolated) { - (0, _util.info)("TODO: Support non-isolated groups."); - } - if (group.knockout) { - (0, _util.warn)("Knockout groups not supported."); - } - const currentTransform = (0, _display_utils.getCurrentTransform)(currentCtx); - if (group.matrix) { - currentCtx.transform(...group.matrix); - } - if (!group.bbox) { - throw new Error("Bounding box is required."); - } - let bounds = _util.Util.getAxialAlignedBoundingBox(group.bbox, (0, _display_utils.getCurrentTransform)(currentCtx)); - const canvasBounds = [0, 0, currentCtx.canvas.width, currentCtx.canvas.height]; - bounds = _util.Util.intersect(bounds, canvasBounds) || [0, 0, 0, 0]; - const offsetX = Math.floor(bounds[0]); - const offsetY = Math.floor(bounds[1]); - let drawnWidth = Math.max(Math.ceil(bounds[2]) - offsetX, 1); - let drawnHeight = Math.max(Math.ceil(bounds[3]) - offsetY, 1); - let scaleX = 1, - scaleY = 1; - if (drawnWidth > MAX_GROUP_SIZE) { - scaleX = drawnWidth / MAX_GROUP_SIZE; - drawnWidth = MAX_GROUP_SIZE; - } - if (drawnHeight > MAX_GROUP_SIZE) { - scaleY = drawnHeight / MAX_GROUP_SIZE; - drawnHeight = MAX_GROUP_SIZE; - } - this.current.startNewPathAndClipBox([0, 0, drawnWidth, drawnHeight]); - let cacheId = "groupAt" + this.groupLevel; - if (group.smask) { - cacheId += "_smask_" + this.smaskCounter++ % 2; - } - const scratchCanvas = this.cachedCanvases.getCanvas(cacheId, drawnWidth, drawnHeight); - const groupCtx = scratchCanvas.context; - groupCtx.scale(1 / scaleX, 1 / scaleY); - groupCtx.translate(-offsetX, -offsetY); - groupCtx.transform(...currentTransform); - if (group.smask) { - this.smaskStack.push({ - canvas: scratchCanvas.canvas, - context: groupCtx, - offsetX, - offsetY, - scaleX, - scaleY, - subtype: group.smask.subtype, - backdrop: group.smask.backdrop, - transferMap: group.smask.transferMap || null, - startTransformInverse: null - }); - } else { - currentCtx.setTransform(1, 0, 0, 1, 0, 0); - currentCtx.translate(offsetX, offsetY); - currentCtx.scale(scaleX, scaleY); - currentCtx.save(); - } - copyCtxState(currentCtx, groupCtx); - this.ctx = groupCtx; - this.setGState([["BM", "source-over"], ["ca", 1], ["CA", 1]]); - this.groupStack.push(currentCtx); - this.groupLevel++; - } - endGroup(group) { - if (!this.contentVisible) { - return; - } - this.groupLevel--; - const groupCtx = this.ctx; - const ctx = this.groupStack.pop(); - this.ctx = ctx; - this.ctx.imageSmoothingEnabled = false; - if (group.smask) { - this.tempSMask = this.smaskStack.pop(); - this.restore(); - } else { - this.ctx.restore(); - const currentMtx = (0, _display_utils.getCurrentTransform)(this.ctx); - this.restore(); - this.ctx.save(); - this.ctx.setTransform(...currentMtx); - const dirtyBox = _util.Util.getAxialAlignedBoundingBox([0, 0, groupCtx.canvas.width, groupCtx.canvas.height], currentMtx); - this.ctx.drawImage(groupCtx.canvas, 0, 0); - this.ctx.restore(); - this.compose(dirtyBox); - } - } - beginAnnotation(id, rect, transform, matrix, hasOwnCanvas) { - this.#restoreInitialState(); - resetCtxToDefault(this.ctx, this.foregroundColor); - this.ctx.save(); - this.save(); - if (this.baseTransform) { - this.ctx.setTransform(...this.baseTransform); - } - if (Array.isArray(rect) && rect.length === 4) { - const width = rect[2] - rect[0]; - const height = rect[3] - rect[1]; - if (hasOwnCanvas && this.annotationCanvasMap) { - transform = transform.slice(); - transform[4] -= rect[0]; - transform[5] -= rect[1]; - rect = rect.slice(); - rect[0] = rect[1] = 0; - rect[2] = width; - rect[3] = height; - const [scaleX, scaleY] = _util.Util.singularValueDecompose2dScale((0, _display_utils.getCurrentTransform)(this.ctx)); - const { - viewportScale - } = this; - const canvasWidth = Math.ceil(width * this.outputScaleX * viewportScale); - const canvasHeight = Math.ceil(height * this.outputScaleY * viewportScale); - this.annotationCanvas = this.canvasFactory.create(canvasWidth, canvasHeight); - const { - canvas, - context - } = this.annotationCanvas; - this.annotationCanvasMap.set(id, canvas); - this.annotationCanvas.savedCtx = this.ctx; - this.ctx = context; - this.ctx.setTransform(scaleX, 0, 0, -scaleY, 0, height * scaleY); - resetCtxToDefault(this.ctx, this.foregroundColor); - } else { - resetCtxToDefault(this.ctx, this.foregroundColor); - this.ctx.rect(rect[0], rect[1], width, height); - this.ctx.clip(); - this.endPath(); - } - } - this.current = new CanvasExtraState(this.ctx.canvas.width, this.ctx.canvas.height); - this.transform(...transform); - this.transform(...matrix); - } - endAnnotation() { - if (this.annotationCanvas) { - this.ctx = this.annotationCanvas.savedCtx; - delete this.annotationCanvas.savedCtx; - delete this.annotationCanvas; - } - } - paintImageMaskXObject(img) { - if (!this.contentVisible) { - return; - } - const count = img.count; - img = this.getObject(img.data, img); - img.count = count; - const ctx = this.ctx; - const glyph = this.processingType3; - if (glyph) { - if (glyph.compiled === undefined) { - glyph.compiled = compileType3Glyph(img); - } - if (glyph.compiled) { - glyph.compiled(ctx); - return; - } - } - const mask = this._createMaskCanvas(img); - const maskCanvas = mask.canvas; - ctx.save(); - ctx.setTransform(1, 0, 0, 1, 0, 0); - ctx.drawImage(maskCanvas, mask.offsetX, mask.offsetY); - ctx.restore(); - this.compose(); - } - paintImageMaskXObjectRepeat(img, scaleX, skewX = 0, skewY = 0, scaleY, positions) { - if (!this.contentVisible) { - return; - } - img = this.getObject(img.data, img); - const ctx = this.ctx; - ctx.save(); - const currentTransform = (0, _display_utils.getCurrentTransform)(ctx); - ctx.transform(scaleX, skewX, skewY, scaleY, 0, 0); - const mask = this._createMaskCanvas(img); - ctx.setTransform(1, 0, 0, 1, mask.offsetX - currentTransform[4], mask.offsetY - currentTransform[5]); - for (let i = 0, ii = positions.length; i < ii; i += 2) { - const trans = _util.Util.transform(currentTransform, [scaleX, skewX, skewY, scaleY, positions[i], positions[i + 1]]); - const [x, y] = _util.Util.applyTransform([0, 0], trans); - ctx.drawImage(mask.canvas, x, y); - } - ctx.restore(); - this.compose(); - } - paintImageMaskXObjectGroup(images) { - if (!this.contentVisible) { - return; - } - const ctx = this.ctx; - const fillColor = this.current.fillColor; - const isPatternFill = this.current.patternFill; - for (const image of images) { - const { - data, - width, - height, - transform - } = image; - const maskCanvas = this.cachedCanvases.getCanvas("maskCanvas", width, height); - const maskCtx = maskCanvas.context; - maskCtx.save(); - const img = this.getObject(data, image); - putBinaryImageMask(maskCtx, img); - maskCtx.globalCompositeOperation = "source-in"; - maskCtx.fillStyle = isPatternFill ? fillColor.getPattern(maskCtx, this, (0, _display_utils.getCurrentTransformInverse)(ctx), _pattern_helper.PathType.FILL) : fillColor; - maskCtx.fillRect(0, 0, width, height); - maskCtx.restore(); - ctx.save(); - ctx.transform(...transform); - ctx.scale(1, -1); - drawImageAtIntegerCoords(ctx, maskCanvas.canvas, 0, 0, width, height, 0, -1, 1, 1); - ctx.restore(); - } - this.compose(); - } - paintImageXObject(objId) { - if (!this.contentVisible) { - return; - } - const imgData = this.getObject(objId); - if (!imgData) { - (0, _util.warn)("Dependent image isn't ready yet"); - return; - } - this.paintInlineImageXObject(imgData); - } - paintImageXObjectRepeat(objId, scaleX, scaleY, positions) { - if (!this.contentVisible) { - return; - } - const imgData = this.getObject(objId); - if (!imgData) { - (0, _util.warn)("Dependent image isn't ready yet"); - return; - } - const width = imgData.width; - const height = imgData.height; - const map = []; - for (let i = 0, ii = positions.length; i < ii; i += 2) { - map.push({ - transform: [scaleX, 0, 0, scaleY, positions[i], positions[i + 1]], - x: 0, - y: 0, - w: width, - h: height - }); - } - this.paintInlineImageXObjectGroup(imgData, map); - } - paintInlineImageXObject(imgData) { - if (!this.contentVisible) { - return; - } - const width = imgData.width; - const height = imgData.height; - const ctx = this.ctx; - this.save(); - ctx.scale(1 / width, -1 / height); - let imgToPaint; - if (typeof HTMLElement === "function" && imgData instanceof HTMLElement || !imgData.data) { - imgToPaint = imgData; - } else { - const tmpCanvas = this.cachedCanvases.getCanvas("inlineImage", width, height); - const tmpCtx = tmpCanvas.context; - putBinaryImageData(tmpCtx, imgData, this.current.transferMaps); - imgToPaint = tmpCanvas.canvas; - } - const scaled = this._scaleImage(imgToPaint, (0, _display_utils.getCurrentTransformInverse)(ctx)); - ctx.imageSmoothingEnabled = getImageSmoothingEnabled((0, _display_utils.getCurrentTransform)(ctx), imgData.interpolate); - drawImageAtIntegerCoords(ctx, scaled.img, 0, 0, scaled.paintWidth, scaled.paintHeight, 0, -height, width, height); - this.compose(); - this.restore(); - } - paintInlineImageXObjectGroup(imgData, map) { - if (!this.contentVisible) { - return; - } - const ctx = this.ctx; - const w = imgData.width; - const h = imgData.height; - const tmpCanvas = this.cachedCanvases.getCanvas("inlineImage", w, h); - const tmpCtx = tmpCanvas.context; - putBinaryImageData(tmpCtx, imgData, this.current.transferMaps); - for (const entry of map) { - ctx.save(); - ctx.transform(...entry.transform); - ctx.scale(1, -1); - drawImageAtIntegerCoords(ctx, tmpCanvas.canvas, entry.x, entry.y, entry.w, entry.h, 0, -1, 1, 1); - ctx.restore(); - } - this.compose(); - } - paintSolidColorImageMask() { - if (!this.contentVisible) { - return; - } - this.ctx.fillRect(0, 0, 1, 1); - this.compose(); - } - markPoint(tag) {} - markPointProps(tag, properties) {} - beginMarkedContent(tag) { - this.markedContentStack.push({ - visible: true - }); - } - beginMarkedContentProps(tag, properties) { - if (tag === "OC") { - this.markedContentStack.push({ - visible: this.optionalContentConfig.isVisible(properties) - }); - } else { - this.markedContentStack.push({ - visible: true - }); - } - this.contentVisible = this.isContentVisible(); - } - endMarkedContent() { - this.markedContentStack.pop(); - this.contentVisible = this.isContentVisible(); - } - beginCompat() {} - endCompat() {} - consumePath(clipBox) { - const isEmpty = this.current.isEmptyClip(); - if (this.pendingClip) { - this.current.updateClipFromPath(); - } - if (!this.pendingClip) { - this.compose(clipBox); - } - const ctx = this.ctx; - if (this.pendingClip) { - if (!isEmpty) { - if (this.pendingClip === EO_CLIP) { - ctx.clip("evenodd"); - } else { - ctx.clip(); - } - } - this.pendingClip = null; - } - this.current.startNewPathAndClipBox(this.current.clipBox); - ctx.beginPath(); - } - getSinglePixelWidth() { - if (!this._cachedGetSinglePixelWidth) { - const m = (0, _display_utils.getCurrentTransform)(this.ctx); - if (m[1] === 0 && m[2] === 0) { - this._cachedGetSinglePixelWidth = 1 / Math.min(Math.abs(m[0]), Math.abs(m[3])); - } else { - const absDet = Math.abs(m[0] * m[3] - m[2] * m[1]); - const normX = Math.hypot(m[0], m[2]); - const normY = Math.hypot(m[1], m[3]); - this._cachedGetSinglePixelWidth = Math.max(normX, normY) / absDet; - } - } - return this._cachedGetSinglePixelWidth; - } - getScaleForStroking() { - if (!this._cachedScaleForStroking) { - const { - lineWidth - } = this.current; - const m = (0, _display_utils.getCurrentTransform)(this.ctx); - let scaleX, scaleY; - if (m[1] === 0 && m[2] === 0) { - const normX = Math.abs(m[0]); - const normY = Math.abs(m[3]); - if (lineWidth === 0) { - scaleX = 1 / normX; - scaleY = 1 / normY; - } else { - const scaledXLineWidth = normX * lineWidth; - const scaledYLineWidth = normY * lineWidth; - scaleX = scaledXLineWidth < 1 ? 1 / scaledXLineWidth : 1; - scaleY = scaledYLineWidth < 1 ? 1 / scaledYLineWidth : 1; - } - } else { - const absDet = Math.abs(m[0] * m[3] - m[2] * m[1]); - const normX = Math.hypot(m[0], m[1]); - const normY = Math.hypot(m[2], m[3]); - if (lineWidth === 0) { - scaleX = normY / absDet; - scaleY = normX / absDet; - } else { - const baseArea = lineWidth * absDet; - scaleX = normY > baseArea ? normY / baseArea : 1; - scaleY = normX > baseArea ? normX / baseArea : 1; - } - } - this._cachedScaleForStroking = [scaleX, scaleY]; - } - return this._cachedScaleForStroking; - } - rescaleAndStroke(saveRestore) { - const { - ctx - } = this; - const { - lineWidth - } = this.current; - const [scaleX, scaleY] = this.getScaleForStroking(); - ctx.lineWidth = lineWidth || 1; - if (scaleX === 1 && scaleY === 1) { - ctx.stroke(); - return; - } - let savedMatrix, savedDashes, savedDashOffset; - if (saveRestore) { - savedMatrix = (0, _display_utils.getCurrentTransform)(ctx); - savedDashes = ctx.getLineDash().slice(); - savedDashOffset = ctx.lineDashOffset; - } - ctx.scale(scaleX, scaleY); - const scale = Math.max(scaleX, scaleY); - ctx.setLineDash(ctx.getLineDash().map(x => x / scale)); - ctx.lineDashOffset /= scale; - ctx.stroke(); - if (saveRestore) { - ctx.setTransform(...savedMatrix); - ctx.setLineDash(savedDashes); - ctx.lineDashOffset = savedDashOffset; - } - } - isContentVisible() { - for (let i = this.markedContentStack.length - 1; i >= 0; i--) { - if (!this.markedContentStack[i].visible) { - return false; - } - } - return true; - } -} -exports.CanvasGraphics = CanvasGraphics; -for (const op in _util.OPS) { - if (CanvasGraphics.prototype[op] !== undefined) { - CanvasGraphics.prototype[_util.OPS[op]] = CanvasGraphics.prototype[op]; - } -} - -/***/ }), -/* 12 */ -/***/ ((__unused_webpack_module, exports, __w_pdfjs_require__) => { - - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.TilingPattern = exports.PathType = void 0; -exports.getShadingPattern = getShadingPattern; -var _util = __w_pdfjs_require__(1); -var _display_utils = __w_pdfjs_require__(6); -const PathType = { - FILL: "Fill", - STROKE: "Stroke", - SHADING: "Shading" -}; -exports.PathType = PathType; -function applyBoundingBox(ctx, bbox) { - if (!bbox) { - return; - } - const width = bbox[2] - bbox[0]; - const height = bbox[3] - bbox[1]; - const region = new Path2D(); - region.rect(bbox[0], bbox[1], width, height); - ctx.clip(region); -} -class BaseShadingPattern { - constructor() { - if (this.constructor === BaseShadingPattern) { - (0, _util.unreachable)("Cannot initialize BaseShadingPattern."); - } - } - getPattern() { - (0, _util.unreachable)("Abstract method `getPattern` called."); - } -} -class RadialAxialShadingPattern extends BaseShadingPattern { - constructor(IR) { - super(); - this._type = IR[1]; - this._bbox = IR[2]; - this._colorStops = IR[3]; - this._p0 = IR[4]; - this._p1 = IR[5]; - this._r0 = IR[6]; - this._r1 = IR[7]; - this.matrix = null; - } - _createGradient(ctx) { - let grad; - if (this._type === "axial") { - grad = ctx.createLinearGradient(this._p0[0], this._p0[1], this._p1[0], this._p1[1]); - } else if (this._type === "radial") { - grad = ctx.createRadialGradient(this._p0[0], this._p0[1], this._r0, this._p1[0], this._p1[1], this._r1); - } - for (const colorStop of this._colorStops) { - grad.addColorStop(colorStop[0], colorStop[1]); - } - return grad; - } - getPattern(ctx, owner, inverse, pathType) { - let pattern; - if (pathType === PathType.STROKE || pathType === PathType.FILL) { - const ownerBBox = owner.current.getClippedPathBoundingBox(pathType, (0, _display_utils.getCurrentTransform)(ctx)) || [0, 0, 0, 0]; - const width = Math.ceil(ownerBBox[2] - ownerBBox[0]) || 1; - const height = Math.ceil(ownerBBox[3] - ownerBBox[1]) || 1; - const tmpCanvas = owner.cachedCanvases.getCanvas("pattern", width, height, true); - const tmpCtx = tmpCanvas.context; - tmpCtx.clearRect(0, 0, tmpCtx.canvas.width, tmpCtx.canvas.height); - tmpCtx.beginPath(); - tmpCtx.rect(0, 0, tmpCtx.canvas.width, tmpCtx.canvas.height); - tmpCtx.translate(-ownerBBox[0], -ownerBBox[1]); - inverse = _util.Util.transform(inverse, [1, 0, 0, 1, ownerBBox[0], ownerBBox[1]]); - tmpCtx.transform(...owner.baseTransform); - if (this.matrix) { - tmpCtx.transform(...this.matrix); - } - applyBoundingBox(tmpCtx, this._bbox); - tmpCtx.fillStyle = this._createGradient(tmpCtx); - tmpCtx.fill(); - pattern = ctx.createPattern(tmpCanvas.canvas, "no-repeat"); - const domMatrix = new DOMMatrix(inverse); - pattern.setTransform(domMatrix); - } else { - applyBoundingBox(ctx, this._bbox); - pattern = this._createGradient(ctx); - } - return pattern; - } -} -function drawTriangle(data, context, p1, p2, p3, c1, c2, c3) { - const coords = context.coords, - colors = context.colors; - const bytes = data.data, - rowSize = data.width * 4; - let tmp; - if (coords[p1 + 1] > coords[p2 + 1]) { - tmp = p1; - p1 = p2; - p2 = tmp; - tmp = c1; - c1 = c2; - c2 = tmp; - } - if (coords[p2 + 1] > coords[p3 + 1]) { - tmp = p2; - p2 = p3; - p3 = tmp; - tmp = c2; - c2 = c3; - c3 = tmp; - } - if (coords[p1 + 1] > coords[p2 + 1]) { - tmp = p1; - p1 = p2; - p2 = tmp; - tmp = c1; - c1 = c2; - c2 = tmp; - } - const x1 = (coords[p1] + context.offsetX) * context.scaleX; - const y1 = (coords[p1 + 1] + context.offsetY) * context.scaleY; - const x2 = (coords[p2] + context.offsetX) * context.scaleX; - const y2 = (coords[p2 + 1] + context.offsetY) * context.scaleY; - const x3 = (coords[p3] + context.offsetX) * context.scaleX; - const y3 = (coords[p3 + 1] + context.offsetY) * context.scaleY; - if (y1 >= y3) { - return; - } - const c1r = colors[c1], - c1g = colors[c1 + 1], - c1b = colors[c1 + 2]; - const c2r = colors[c2], - c2g = colors[c2 + 1], - c2b = colors[c2 + 2]; - const c3r = colors[c3], - c3g = colors[c3 + 1], - c3b = colors[c3 + 2]; - const minY = Math.round(y1), - maxY = Math.round(y3); - let xa, car, cag, cab; - let xb, cbr, cbg, cbb; - for (let y = minY; y <= maxY; y++) { - if (y < y2) { - let k; - if (y < y1) { - k = 0; - } else { - k = (y1 - y) / (y1 - y2); - } - xa = x1 - (x1 - x2) * k; - car = c1r - (c1r - c2r) * k; - cag = c1g - (c1g - c2g) * k; - cab = c1b - (c1b - c2b) * k; - } else { - let k; - if (y > y3) { - k = 1; - } else if (y2 === y3) { - k = 0; - } else { - k = (y2 - y) / (y2 - y3); - } - xa = x2 - (x2 - x3) * k; - car = c2r - (c2r - c3r) * k; - cag = c2g - (c2g - c3g) * k; - cab = c2b - (c2b - c3b) * k; - } - let k; - if (y < y1) { - k = 0; - } else if (y > y3) { - k = 1; - } else { - k = (y1 - y) / (y1 - y3); - } - xb = x1 - (x1 - x3) * k; - cbr = c1r - (c1r - c3r) * k; - cbg = c1g - (c1g - c3g) * k; - cbb = c1b - (c1b - c3b) * k; - const x1_ = Math.round(Math.min(xa, xb)); - const x2_ = Math.round(Math.max(xa, xb)); - let j = rowSize * y + x1_ * 4; - for (let x = x1_; x <= x2_; x++) { - k = (xa - x) / (xa - xb); - if (k < 0) { - k = 0; - } else if (k > 1) { - k = 1; - } - bytes[j++] = car - (car - cbr) * k | 0; - bytes[j++] = cag - (cag - cbg) * k | 0; - bytes[j++] = cab - (cab - cbb) * k | 0; - bytes[j++] = 255; - } - } -} -function drawFigure(data, figure, context) { - const ps = figure.coords; - const cs = figure.colors; - let i, ii; - switch (figure.type) { - case "lattice": - const verticesPerRow = figure.verticesPerRow; - const rows = Math.floor(ps.length / verticesPerRow) - 1; - const cols = verticesPerRow - 1; - for (i = 0; i < rows; i++) { - let q = i * verticesPerRow; - for (let j = 0; j < cols; j++, q++) { - drawTriangle(data, context, ps[q], ps[q + 1], ps[q + verticesPerRow], cs[q], cs[q + 1], cs[q + verticesPerRow]); - drawTriangle(data, context, ps[q + verticesPerRow + 1], ps[q + 1], ps[q + verticesPerRow], cs[q + verticesPerRow + 1], cs[q + 1], cs[q + verticesPerRow]); - } - } - break; - case "triangles": - for (i = 0, ii = ps.length; i < ii; i += 3) { - drawTriangle(data, context, ps[i], ps[i + 1], ps[i + 2], cs[i], cs[i + 1], cs[i + 2]); - } - break; - default: - throw new Error("illegal figure"); - } -} -class MeshShadingPattern extends BaseShadingPattern { - constructor(IR) { - super(); - this._coords = IR[2]; - this._colors = IR[3]; - this._figures = IR[4]; - this._bounds = IR[5]; - this._bbox = IR[7]; - this._background = IR[8]; - this.matrix = null; - } - _createMeshCanvas(combinedScale, backgroundColor, cachedCanvases) { - const EXPECTED_SCALE = 1.1; - const MAX_PATTERN_SIZE = 3000; - const BORDER_SIZE = 2; - const offsetX = Math.floor(this._bounds[0]); - const offsetY = Math.floor(this._bounds[1]); - const boundsWidth = Math.ceil(this._bounds[2]) - offsetX; - const boundsHeight = Math.ceil(this._bounds[3]) - offsetY; - const width = Math.min(Math.ceil(Math.abs(boundsWidth * combinedScale[0] * EXPECTED_SCALE)), MAX_PATTERN_SIZE); - const height = Math.min(Math.ceil(Math.abs(boundsHeight * combinedScale[1] * EXPECTED_SCALE)), MAX_PATTERN_SIZE); - const scaleX = boundsWidth / width; - const scaleY = boundsHeight / height; - const context = { - coords: this._coords, - colors: this._colors, - offsetX: -offsetX, - offsetY: -offsetY, - scaleX: 1 / scaleX, - scaleY: 1 / scaleY - }; - const paddedWidth = width + BORDER_SIZE * 2; - const paddedHeight = height + BORDER_SIZE * 2; - const tmpCanvas = cachedCanvases.getCanvas("mesh", paddedWidth, paddedHeight, false); - const tmpCtx = tmpCanvas.context; - const data = tmpCtx.createImageData(width, height); - if (backgroundColor) { - const bytes = data.data; - for (let i = 0, ii = bytes.length; i < ii; i += 4) { - bytes[i] = backgroundColor[0]; - bytes[i + 1] = backgroundColor[1]; - bytes[i + 2] = backgroundColor[2]; - bytes[i + 3] = 255; - } - } - for (const figure of this._figures) { - drawFigure(data, figure, context); - } - tmpCtx.putImageData(data, BORDER_SIZE, BORDER_SIZE); - const canvas = tmpCanvas.canvas; - return { - canvas, - offsetX: offsetX - BORDER_SIZE * scaleX, - offsetY: offsetY - BORDER_SIZE * scaleY, - scaleX, - scaleY - }; - } - getPattern(ctx, owner, inverse, pathType) { - applyBoundingBox(ctx, this._bbox); - let scale; - if (pathType === PathType.SHADING) { - scale = _util.Util.singularValueDecompose2dScale((0, _display_utils.getCurrentTransform)(ctx)); - } else { - scale = _util.Util.singularValueDecompose2dScale(owner.baseTransform); - if (this.matrix) { - const matrixScale = _util.Util.singularValueDecompose2dScale(this.matrix); - scale = [scale[0] * matrixScale[0], scale[1] * matrixScale[1]]; - } - } - const temporaryPatternCanvas = this._createMeshCanvas(scale, pathType === PathType.SHADING ? null : this._background, owner.cachedCanvases); - if (pathType !== PathType.SHADING) { - ctx.setTransform(...owner.baseTransform); - if (this.matrix) { - ctx.transform(...this.matrix); - } - } - ctx.translate(temporaryPatternCanvas.offsetX, temporaryPatternCanvas.offsetY); - ctx.scale(temporaryPatternCanvas.scaleX, temporaryPatternCanvas.scaleY); - return ctx.createPattern(temporaryPatternCanvas.canvas, "no-repeat"); - } -} -class DummyShadingPattern extends BaseShadingPattern { - getPattern() { - return "hotpink"; - } -} -function getShadingPattern(IR) { - switch (IR[0]) { - case "RadialAxial": - return new RadialAxialShadingPattern(IR); - case "Mesh": - return new MeshShadingPattern(IR); - case "Dummy": - return new DummyShadingPattern(); - } - throw new Error(`Unknown IR type: ${IR[0]}`); -} -const PaintType = { - COLORED: 1, - UNCOLORED: 2 -}; -class TilingPattern { - static get MAX_PATTERN_SIZE() { - return (0, _util.shadow)(this, "MAX_PATTERN_SIZE", 3000); - } - constructor(IR, color, ctx, canvasGraphicsFactory, baseTransform) { - this.operatorList = IR[2]; - this.matrix = IR[3] || [1, 0, 0, 1, 0, 0]; - this.bbox = IR[4]; - this.xstep = IR[5]; - this.ystep = IR[6]; - this.paintType = IR[7]; - this.tilingType = IR[8]; - this.color = color; - this.ctx = ctx; - this.canvasGraphicsFactory = canvasGraphicsFactory; - this.baseTransform = baseTransform; - } - createPatternCanvas(owner) { - const operatorList = this.operatorList; - const bbox = this.bbox; - const xstep = this.xstep; - const ystep = this.ystep; - const paintType = this.paintType; - const tilingType = this.tilingType; - const color = this.color; - const canvasGraphicsFactory = this.canvasGraphicsFactory; - (0, _util.info)("TilingType: " + tilingType); - const x0 = bbox[0], - y0 = bbox[1], - x1 = bbox[2], - y1 = bbox[3]; - const matrixScale = _util.Util.singularValueDecompose2dScale(this.matrix); - const curMatrixScale = _util.Util.singularValueDecompose2dScale(this.baseTransform); - const combinedScale = [matrixScale[0] * curMatrixScale[0], matrixScale[1] * curMatrixScale[1]]; - const dimx = this.getSizeAndScale(xstep, this.ctx.canvas.width, combinedScale[0]); - const dimy = this.getSizeAndScale(ystep, this.ctx.canvas.height, combinedScale[1]); - const tmpCanvas = owner.cachedCanvases.getCanvas("pattern", dimx.size, dimy.size, true); - const tmpCtx = tmpCanvas.context; - const graphics = canvasGraphicsFactory.createCanvasGraphics(tmpCtx); - graphics.groupLevel = owner.groupLevel; - this.setFillAndStrokeStyleToContext(graphics, paintType, color); - let adjustedX0 = x0; - let adjustedY0 = y0; - let adjustedX1 = x1; - let adjustedY1 = y1; - if (x0 < 0) { - adjustedX0 = 0; - adjustedX1 += Math.abs(x0); - } - if (y0 < 0) { - adjustedY0 = 0; - adjustedY1 += Math.abs(y0); - } - tmpCtx.translate(-(dimx.scale * adjustedX0), -(dimy.scale * adjustedY0)); - graphics.transform(dimx.scale, 0, 0, dimy.scale, 0, 0); - tmpCtx.save(); - this.clipBbox(graphics, adjustedX0, adjustedY0, adjustedX1, adjustedY1); - graphics.baseTransform = (0, _display_utils.getCurrentTransform)(graphics.ctx); - graphics.executeOperatorList(operatorList); - graphics.endDrawing(); - return { - canvas: tmpCanvas.canvas, - scaleX: dimx.scale, - scaleY: dimy.scale, - offsetX: adjustedX0, - offsetY: adjustedY0 - }; - } - getSizeAndScale(step, realOutputSize, scale) { - step = Math.abs(step); - const maxSize = Math.max(TilingPattern.MAX_PATTERN_SIZE, realOutputSize); - let size = Math.ceil(step * scale); - if (size >= maxSize) { - size = maxSize; - } else { - scale = size / step; - } - return { - scale, - size - }; - } - clipBbox(graphics, x0, y0, x1, y1) { - const bboxWidth = x1 - x0; - const bboxHeight = y1 - y0; - graphics.ctx.rect(x0, y0, bboxWidth, bboxHeight); - graphics.current.updateRectMinMax((0, _display_utils.getCurrentTransform)(graphics.ctx), [x0, y0, x1, y1]); - graphics.clip(); - graphics.endPath(); - } - setFillAndStrokeStyleToContext(graphics, paintType, color) { - const context = graphics.ctx, - current = graphics.current; - switch (paintType) { - case PaintType.COLORED: - const ctx = this.ctx; - context.fillStyle = ctx.fillStyle; - context.strokeStyle = ctx.strokeStyle; - current.fillColor = ctx.fillStyle; - current.strokeColor = ctx.strokeStyle; - break; - case PaintType.UNCOLORED: - const cssColor = _util.Util.makeHexColor(color[0], color[1], color[2]); - context.fillStyle = cssColor; - context.strokeStyle = cssColor; - current.fillColor = cssColor; - current.strokeColor = cssColor; - break; - default: - throw new _util.FormatError(`Unsupported paint type: ${paintType}`); - } - } - getPattern(ctx, owner, inverse, pathType) { - let matrix = inverse; - if (pathType !== PathType.SHADING) { - matrix = _util.Util.transform(matrix, owner.baseTransform); - if (this.matrix) { - matrix = _util.Util.transform(matrix, this.matrix); - } - } - const temporaryPatternCanvas = this.createPatternCanvas(owner); - let domMatrix = new DOMMatrix(matrix); - domMatrix = domMatrix.translate(temporaryPatternCanvas.offsetX, temporaryPatternCanvas.offsetY); - domMatrix = domMatrix.scale(1 / temporaryPatternCanvas.scaleX, 1 / temporaryPatternCanvas.scaleY); - const pattern = ctx.createPattern(temporaryPatternCanvas.canvas, "repeat"); - pattern.setTransform(domMatrix); - return pattern; - } -} -exports.TilingPattern = TilingPattern; - -/***/ }), -/* 13 */ -/***/ ((__unused_webpack_module, exports, __w_pdfjs_require__) => { - - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.applyMaskImageData = applyMaskImageData; -var _util = __w_pdfjs_require__(1); -function applyMaskImageData({ - src, - srcPos = 0, - dest, - destPos = 0, - width, - height, - inverseDecode = false -}) { - const opaque = _util.FeatureTest.isLittleEndian ? 0xff000000 : 0x000000ff; - const [zeroMapping, oneMapping] = !inverseDecode ? [opaque, 0] : [0, opaque]; - const widthInSource = width >> 3; - const widthRemainder = width & 7; - const srcLength = src.length; - dest = new Uint32Array(dest.buffer); - for (let i = 0; i < height; i++) { - for (const max = srcPos + widthInSource; srcPos < max; srcPos++) { - const elem = srcPos < srcLength ? src[srcPos] : 255; - dest[destPos++] = elem & 0b10000000 ? oneMapping : zeroMapping; - dest[destPos++] = elem & 0b1000000 ? oneMapping : zeroMapping; - dest[destPos++] = elem & 0b100000 ? oneMapping : zeroMapping; - dest[destPos++] = elem & 0b10000 ? oneMapping : zeroMapping; - dest[destPos++] = elem & 0b1000 ? oneMapping : zeroMapping; - dest[destPos++] = elem & 0b100 ? oneMapping : zeroMapping; - dest[destPos++] = elem & 0b10 ? oneMapping : zeroMapping; - dest[destPos++] = elem & 0b1 ? oneMapping : zeroMapping; - } - if (widthRemainder === 0) { - continue; - } - const elem = srcPos < srcLength ? src[srcPos++] : 255; - for (let j = 0; j < widthRemainder; j++) { - dest[destPos++] = elem & 1 << 7 - j ? oneMapping : zeroMapping; - } - } - return { - srcPos, - destPos - }; -} - -/***/ }), -/* 14 */ -/***/ ((__unused_webpack_module, exports) => { - - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.GlobalWorkerOptions = void 0; -const GlobalWorkerOptions = Object.create(null); -exports.GlobalWorkerOptions = GlobalWorkerOptions; -GlobalWorkerOptions.workerPort = null; -GlobalWorkerOptions.workerSrc = ""; - -/***/ }), -/* 15 */ -/***/ ((__unused_webpack_module, exports, __w_pdfjs_require__) => { - - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.MessageHandler = void 0; -var _util = __w_pdfjs_require__(1); -const CallbackKind = { - UNKNOWN: 0, - DATA: 1, - ERROR: 2 -}; -const StreamKind = { - UNKNOWN: 0, - CANCEL: 1, - CANCEL_COMPLETE: 2, - CLOSE: 3, - ENQUEUE: 4, - ERROR: 5, - PULL: 6, - PULL_COMPLETE: 7, - START_COMPLETE: 8 -}; -function wrapReason(reason) { - if (!(reason instanceof Error || typeof reason === "object" && reason !== null)) { - (0, _util.unreachable)('wrapReason: Expected "reason" to be a (possibly cloned) Error.'); - } - switch (reason.name) { - case "AbortException": - return new _util.AbortException(reason.message); - case "MissingPDFException": - return new _util.MissingPDFException(reason.message); - case "PasswordException": - return new _util.PasswordException(reason.message, reason.code); - case "UnexpectedResponseException": - return new _util.UnexpectedResponseException(reason.message, reason.status); - case "UnknownErrorException": - return new _util.UnknownErrorException(reason.message, reason.details); - default: - return new _util.UnknownErrorException(reason.message, reason.toString()); - } -} -class MessageHandler { - constructor(sourceName, targetName, comObj) { - this.sourceName = sourceName; - this.targetName = targetName; - this.comObj = comObj; - this.callbackId = 1; - this.streamId = 1; - this.streamSinks = Object.create(null); - this.streamControllers = Object.create(null); - this.callbackCapabilities = Object.create(null); - this.actionHandler = Object.create(null); - this._onComObjOnMessage = event => { - const data = event.data; - if (data.targetName !== this.sourceName) { - return; - } - if (data.stream) { - this._processStreamMessage(data); - return; - } - if (data.callback) { - const callbackId = data.callbackId; - const capability = this.callbackCapabilities[callbackId]; - if (!capability) { - throw new Error(`Cannot resolve callback ${callbackId}`); - } - delete this.callbackCapabilities[callbackId]; - if (data.callback === CallbackKind.DATA) { - capability.resolve(data.data); - } else if (data.callback === CallbackKind.ERROR) { - capability.reject(wrapReason(data.reason)); - } else { - throw new Error("Unexpected callback case"); - } - return; - } - const action = this.actionHandler[data.action]; - if (!action) { - throw new Error(`Unknown action from worker: ${data.action}`); - } - if (data.callbackId) { - const cbSourceName = this.sourceName; - const cbTargetName = data.sourceName; - new Promise(function (resolve) { - resolve(action(data.data)); - }).then(function (result) { - comObj.postMessage({ - sourceName: cbSourceName, - targetName: cbTargetName, - callback: CallbackKind.DATA, - callbackId: data.callbackId, - data: result - }); - }, function (reason) { - comObj.postMessage({ - sourceName: cbSourceName, - targetName: cbTargetName, - callback: CallbackKind.ERROR, - callbackId: data.callbackId, - reason: wrapReason(reason) - }); - }); - return; - } - if (data.streamId) { - this._createStreamSink(data); - return; - } - action(data.data); - }; - comObj.addEventListener("message", this._onComObjOnMessage); - } - on(actionName, handler) { - const ah = this.actionHandler; - if (ah[actionName]) { - throw new Error(`There is already an actionName called "${actionName}"`); - } - ah[actionName] = handler; - } - send(actionName, data, transfers) { - this.comObj.postMessage({ - sourceName: this.sourceName, - targetName: this.targetName, - action: actionName, - data - }, transfers); - } - sendWithPromise(actionName, data, transfers) { - const callbackId = this.callbackId++; - const capability = (0, _util.createPromiseCapability)(); - this.callbackCapabilities[callbackId] = capability; - try { - this.comObj.postMessage({ - sourceName: this.sourceName, - targetName: this.targetName, - action: actionName, - callbackId, - data - }, transfers); - } catch (ex) { - capability.reject(ex); - } - return capability.promise; - } - sendWithStream(actionName, data, queueingStrategy, transfers) { - const streamId = this.streamId++, - sourceName = this.sourceName, - targetName = this.targetName, - comObj = this.comObj; - return new ReadableStream({ - start: controller => { - const startCapability = (0, _util.createPromiseCapability)(); - this.streamControllers[streamId] = { - controller, - startCall: startCapability, - pullCall: null, - cancelCall: null, - isClosed: false - }; - comObj.postMessage({ - sourceName, - targetName, - action: actionName, - streamId, - data, - desiredSize: controller.desiredSize - }, transfers); - return startCapability.promise; - }, - pull: controller => { - const pullCapability = (0, _util.createPromiseCapability)(); - this.streamControllers[streamId].pullCall = pullCapability; - comObj.postMessage({ - sourceName, - targetName, - stream: StreamKind.PULL, - streamId, - desiredSize: controller.desiredSize - }); - return pullCapability.promise; - }, - cancel: reason => { - (0, _util.assert)(reason instanceof Error, "cancel must have a valid reason"); - const cancelCapability = (0, _util.createPromiseCapability)(); - this.streamControllers[streamId].cancelCall = cancelCapability; - this.streamControllers[streamId].isClosed = true; - comObj.postMessage({ - sourceName, - targetName, - stream: StreamKind.CANCEL, - streamId, - reason: wrapReason(reason) - }); - return cancelCapability.promise; - } - }, queueingStrategy); - } - _createStreamSink(data) { - const streamId = data.streamId, - sourceName = this.sourceName, - targetName = data.sourceName, - comObj = this.comObj; - const self = this, - action = this.actionHandler[data.action]; - const streamSink = { - enqueue(chunk, size = 1, transfers) { - if (this.isCancelled) { - return; - } - const lastDesiredSize = this.desiredSize; - this.desiredSize -= size; - if (lastDesiredSize > 0 && this.desiredSize <= 0) { - this.sinkCapability = (0, _util.createPromiseCapability)(); - this.ready = this.sinkCapability.promise; - } - comObj.postMessage({ - sourceName, - targetName, - stream: StreamKind.ENQUEUE, - streamId, - chunk - }, transfers); - }, - close() { - if (this.isCancelled) { - return; - } - this.isCancelled = true; - comObj.postMessage({ - sourceName, - targetName, - stream: StreamKind.CLOSE, - streamId - }); - delete self.streamSinks[streamId]; - }, - error(reason) { - (0, _util.assert)(reason instanceof Error, "error must have a valid reason"); - if (this.isCancelled) { - return; - } - this.isCancelled = true; - comObj.postMessage({ - sourceName, - targetName, - stream: StreamKind.ERROR, - streamId, - reason: wrapReason(reason) - }); - }, - sinkCapability: (0, _util.createPromiseCapability)(), - onPull: null, - onCancel: null, - isCancelled: false, - desiredSize: data.desiredSize, - ready: null - }; - streamSink.sinkCapability.resolve(); - streamSink.ready = streamSink.sinkCapability.promise; - this.streamSinks[streamId] = streamSink; - new Promise(function (resolve) { - resolve(action(data.data, streamSink)); - }).then(function () { - comObj.postMessage({ - sourceName, - targetName, - stream: StreamKind.START_COMPLETE, - streamId, - success: true - }); - }, function (reason) { - comObj.postMessage({ - sourceName, - targetName, - stream: StreamKind.START_COMPLETE, - streamId, - reason: wrapReason(reason) - }); - }); - } - _processStreamMessage(data) { - const streamId = data.streamId, - sourceName = this.sourceName, - targetName = data.sourceName, - comObj = this.comObj; - const streamController = this.streamControllers[streamId], - streamSink = this.streamSinks[streamId]; - switch (data.stream) { - case StreamKind.START_COMPLETE: - if (data.success) { - streamController.startCall.resolve(); - } else { - streamController.startCall.reject(wrapReason(data.reason)); - } - break; - case StreamKind.PULL_COMPLETE: - if (data.success) { - streamController.pullCall.resolve(); - } else { - streamController.pullCall.reject(wrapReason(data.reason)); - } - break; - case StreamKind.PULL: - if (!streamSink) { - comObj.postMessage({ - sourceName, - targetName, - stream: StreamKind.PULL_COMPLETE, - streamId, - success: true - }); - break; - } - if (streamSink.desiredSize <= 0 && data.desiredSize > 0) { - streamSink.sinkCapability.resolve(); - } - streamSink.desiredSize = data.desiredSize; - new Promise(function (resolve) { - resolve(streamSink.onPull && streamSink.onPull()); - }).then(function () { - comObj.postMessage({ - sourceName, - targetName, - stream: StreamKind.PULL_COMPLETE, - streamId, - success: true - }); - }, function (reason) { - comObj.postMessage({ - sourceName, - targetName, - stream: StreamKind.PULL_COMPLETE, - streamId, - reason: wrapReason(reason) - }); - }); - break; - case StreamKind.ENQUEUE: - (0, _util.assert)(streamController, "enqueue should have stream controller"); - if (streamController.isClosed) { - break; - } - streamController.controller.enqueue(data.chunk); - break; - case StreamKind.CLOSE: - (0, _util.assert)(streamController, "close should have stream controller"); - if (streamController.isClosed) { - break; - } - streamController.isClosed = true; - streamController.controller.close(); - this._deleteStreamController(streamController, streamId); - break; - case StreamKind.ERROR: - (0, _util.assert)(streamController, "error should have stream controller"); - streamController.controller.error(wrapReason(data.reason)); - this._deleteStreamController(streamController, streamId); - break; - case StreamKind.CANCEL_COMPLETE: - if (data.success) { - streamController.cancelCall.resolve(); - } else { - streamController.cancelCall.reject(wrapReason(data.reason)); - } - this._deleteStreamController(streamController, streamId); - break; - case StreamKind.CANCEL: - if (!streamSink) { - break; - } - new Promise(function (resolve) { - resolve(streamSink.onCancel && streamSink.onCancel(wrapReason(data.reason))); - }).then(function () { - comObj.postMessage({ - sourceName, - targetName, - stream: StreamKind.CANCEL_COMPLETE, - streamId, - success: true - }); - }, function (reason) { - comObj.postMessage({ - sourceName, - targetName, - stream: StreamKind.CANCEL_COMPLETE, - streamId, - reason: wrapReason(reason) - }); - }); - streamSink.sinkCapability.reject(wrapReason(data.reason)); - streamSink.isCancelled = true; - delete this.streamSinks[streamId]; - break; - default: - throw new Error("Unexpected stream case"); - } - } - async _deleteStreamController(streamController, streamId) { - await Promise.allSettled([streamController.startCall && streamController.startCall.promise, streamController.pullCall && streamController.pullCall.promise, streamController.cancelCall && streamController.cancelCall.promise]); - delete this.streamControllers[streamId]; - } - destroy() { - this.comObj.removeEventListener("message", this._onComObjOnMessage); - } -} -exports.MessageHandler = MessageHandler; - -/***/ }), -/* 16 */ -/***/ ((__unused_webpack_module, exports, __w_pdfjs_require__) => { - - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.Metadata = void 0; -var _util = __w_pdfjs_require__(1); -class Metadata { - #metadataMap; - #data; - constructor({ - parsedData, - rawData - }) { - this.#metadataMap = parsedData; - this.#data = rawData; - } - getRaw() { - return this.#data; - } - get(name) { - return this.#metadataMap.get(name) ?? null; - } - getAll() { - return (0, _util.objectFromMap)(this.#metadataMap); - } - has(name) { - return this.#metadataMap.has(name); - } -} -exports.Metadata = Metadata; - -/***/ }), -/* 17 */ -/***/ ((__unused_webpack_module, exports, __w_pdfjs_require__) => { - - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.OptionalContentConfig = void 0; -var _util = __w_pdfjs_require__(1); -var _murmurhash = __w_pdfjs_require__(8); -const INTERNAL = Symbol("INTERNAL"); -class OptionalContentGroup { - #visible = true; - constructor(name, intent) { - this.name = name; - this.intent = intent; - } - get visible() { - return this.#visible; - } - _setVisible(internal, visible) { - if (internal !== INTERNAL) { - (0, _util.unreachable)("Internal method `_setVisible` called."); - } - this.#visible = visible; - } -} -class OptionalContentConfig { - #cachedGetHash = null; - #groups = new Map(); - #initialHash = null; - #order = null; - constructor(data) { - this.name = null; - this.creator = null; - if (data === null) { - return; - } - this.name = data.name; - this.creator = data.creator; - this.#order = data.order; - for (const group of data.groups) { - this.#groups.set(group.id, new OptionalContentGroup(group.name, group.intent)); - } - if (data.baseState === "OFF") { - for (const group of this.#groups.values()) { - group._setVisible(INTERNAL, false); - } - } - for (const on of data.on) { - this.#groups.get(on)._setVisible(INTERNAL, true); - } - for (const off of data.off) { - this.#groups.get(off)._setVisible(INTERNAL, false); - } - this.#initialHash = this.getHash(); - } - #evaluateVisibilityExpression(array) { - const length = array.length; - if (length < 2) { - return true; - } - const operator = array[0]; - for (let i = 1; i < length; i++) { - const element = array[i]; - let state; - if (Array.isArray(element)) { - state = this.#evaluateVisibilityExpression(element); - } else if (this.#groups.has(element)) { - state = this.#groups.get(element).visible; - } else { - (0, _util.warn)(`Optional content group not found: ${element}`); - return true; - } - switch (operator) { - case "And": - if (!state) { - return false; - } - break; - case "Or": - if (state) { - return true; - } - break; - case "Not": - return !state; - default: - return true; - } - } - return operator === "And"; - } - isVisible(group) { - if (this.#groups.size === 0) { - return true; - } - if (!group) { - (0, _util.warn)("Optional content group not defined."); - return true; - } - if (group.type === "OCG") { - if (!this.#groups.has(group.id)) { - (0, _util.warn)(`Optional content group not found: ${group.id}`); - return true; - } - return this.#groups.get(group.id).visible; - } else if (group.type === "OCMD") { - if (group.expression) { - return this.#evaluateVisibilityExpression(group.expression); - } - if (!group.policy || group.policy === "AnyOn") { - for (const id of group.ids) { - if (!this.#groups.has(id)) { - (0, _util.warn)(`Optional content group not found: ${id}`); - return true; - } - if (this.#groups.get(id).visible) { - return true; - } - } - return false; - } else if (group.policy === "AllOn") { - for (const id of group.ids) { - if (!this.#groups.has(id)) { - (0, _util.warn)(`Optional content group not found: ${id}`); - return true; - } - if (!this.#groups.get(id).visible) { - return false; - } - } - return true; - } else if (group.policy === "AnyOff") { - for (const id of group.ids) { - if (!this.#groups.has(id)) { - (0, _util.warn)(`Optional content group not found: ${id}`); - return true; - } - if (!this.#groups.get(id).visible) { - return true; - } - } - return false; - } else if (group.policy === "AllOff") { - for (const id of group.ids) { - if (!this.#groups.has(id)) { - (0, _util.warn)(`Optional content group not found: ${id}`); - return true; - } - if (this.#groups.get(id).visible) { - return false; - } - } - return true; - } - (0, _util.warn)(`Unknown optional content policy ${group.policy}.`); - return true; - } - (0, _util.warn)(`Unknown group type ${group.type}.`); - return true; - } - setVisibility(id, visible = true) { - if (!this.#groups.has(id)) { - (0, _util.warn)(`Optional content group not found: ${id}`); - return; - } - this.#groups.get(id)._setVisible(INTERNAL, !!visible); - this.#cachedGetHash = null; - } - get hasInitialVisibility() { - return this.getHash() === this.#initialHash; - } - getOrder() { - if (!this.#groups.size) { - return null; - } - if (this.#order) { - return this.#order.slice(); - } - return [...this.#groups.keys()]; - } - getGroups() { - return this.#groups.size > 0 ? (0, _util.objectFromMap)(this.#groups) : null; - } - getGroup(id) { - return this.#groups.get(id) || null; - } - getHash() { - if (this.#cachedGetHash !== null) { - return this.#cachedGetHash; - } - const hash = new _murmurhash.MurmurHash3_64(); - for (const [id, group] of this.#groups) { - hash.update(`${id}:${group.visible}`); - } - return this.#cachedGetHash = hash.hexdigest(); - } -} -exports.OptionalContentConfig = OptionalContentConfig; - -/***/ }), -/* 18 */ -/***/ ((__unused_webpack_module, exports, __w_pdfjs_require__) => { - - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.PDFDataTransportStream = void 0; -var _util = __w_pdfjs_require__(1); -var _display_utils = __w_pdfjs_require__(6); -class PDFDataTransportStream { - constructor({ - length, - initialData, - progressiveDone = false, - contentDispositionFilename = null, - disableRange = false, - disableStream = false - }, pdfDataRangeTransport) { - (0, _util.assert)(pdfDataRangeTransport, 'PDFDataTransportStream - missing required "pdfDataRangeTransport" argument.'); - this._queuedChunks = []; - this._progressiveDone = progressiveDone; - this._contentDispositionFilename = contentDispositionFilename; - if (initialData?.length > 0) { - const buffer = initialData instanceof Uint8Array && initialData.byteLength === initialData.buffer.byteLength ? initialData.buffer : new Uint8Array(initialData).buffer; - this._queuedChunks.push(buffer); - } - this._pdfDataRangeTransport = pdfDataRangeTransport; - this._isStreamingSupported = !disableStream; - this._isRangeSupported = !disableRange; - this._contentLength = length; - this._fullRequestReader = null; - this._rangeReaders = []; - this._pdfDataRangeTransport.addRangeListener((begin, chunk) => { - this._onReceiveData({ - begin, - chunk - }); - }); - this._pdfDataRangeTransport.addProgressListener((loaded, total) => { - this._onProgress({ - loaded, - total - }); - }); - this._pdfDataRangeTransport.addProgressiveReadListener(chunk => { - this._onReceiveData({ - chunk - }); - }); - this._pdfDataRangeTransport.addProgressiveDoneListener(() => { - this._onProgressiveDone(); - }); - this._pdfDataRangeTransport.transportReady(); - } - _onReceiveData({ - begin, - chunk - }) { - const buffer = chunk instanceof Uint8Array && chunk.byteLength === chunk.buffer.byteLength ? chunk.buffer : new Uint8Array(chunk).buffer; - if (begin === undefined) { - if (this._fullRequestReader) { - this._fullRequestReader._enqueue(buffer); - } else { - this._queuedChunks.push(buffer); - } - } else { - const found = this._rangeReaders.some(function (rangeReader) { - if (rangeReader._begin !== begin) { - return false; - } - rangeReader._enqueue(buffer); - return true; - }); - (0, _util.assert)(found, "_onReceiveData - no `PDFDataTransportStreamRangeReader` instance found."); - } - } - get _progressiveDataLength() { - return this._fullRequestReader?._loaded ?? 0; - } - _onProgress(evt) { - if (evt.total === undefined) { - this._rangeReaders[0]?.onProgress?.({ - loaded: evt.loaded - }); - } else { - this._fullRequestReader?.onProgress?.({ - loaded: evt.loaded, - total: evt.total - }); - } - } - _onProgressiveDone() { - this._fullRequestReader?.progressiveDone(); - this._progressiveDone = true; - } - _removeRangeReader(reader) { - const i = this._rangeReaders.indexOf(reader); - if (i >= 0) { - this._rangeReaders.splice(i, 1); - } - } - getFullReader() { - (0, _util.assert)(!this._fullRequestReader, "PDFDataTransportStream.getFullReader can only be called once."); - const queuedChunks = this._queuedChunks; - this._queuedChunks = null; - return new PDFDataTransportStreamReader(this, queuedChunks, this._progressiveDone, this._contentDispositionFilename); - } - getRangeReader(begin, end) { - if (end <= this._progressiveDataLength) { - return null; - } - const reader = new PDFDataTransportStreamRangeReader(this, begin, end); - this._pdfDataRangeTransport.requestDataRange(begin, end); - this._rangeReaders.push(reader); - return reader; - } - cancelAllRequests(reason) { - this._fullRequestReader?.cancel(reason); - for (const reader of this._rangeReaders.slice(0)) { - reader.cancel(reason); - } - this._pdfDataRangeTransport.abort(); - } -} -exports.PDFDataTransportStream = PDFDataTransportStream; -class PDFDataTransportStreamReader { - constructor(stream, queuedChunks, progressiveDone = false, contentDispositionFilename = null) { - this._stream = stream; - this._done = progressiveDone || false; - this._filename = (0, _display_utils.isPdfFile)(contentDispositionFilename) ? contentDispositionFilename : null; - this._queuedChunks = queuedChunks || []; - this._loaded = 0; - for (const chunk of this._queuedChunks) { - this._loaded += chunk.byteLength; - } - this._requests = []; - this._headersReady = Promise.resolve(); - stream._fullRequestReader = this; - this.onProgress = null; - } - _enqueue(chunk) { - if (this._done) { - return; - } - if (this._requests.length > 0) { - const requestCapability = this._requests.shift(); - requestCapability.resolve({ - value: chunk, - done: false - }); - } else { - this._queuedChunks.push(chunk); - } - this._loaded += chunk.byteLength; - } - get headersReady() { - return this._headersReady; - } - get filename() { - return this._filename; - } - get isRangeSupported() { - return this._stream._isRangeSupported; - } - get isStreamingSupported() { - return this._stream._isStreamingSupported; - } - get contentLength() { - return this._stream._contentLength; - } - async read() { - if (this._queuedChunks.length > 0) { - const chunk = this._queuedChunks.shift(); - return { - value: chunk, - done: false - }; - } - if (this._done) { - return { - value: undefined, - done: true - }; - } - const requestCapability = (0, _util.createPromiseCapability)(); - this._requests.push(requestCapability); - return requestCapability.promise; - } - cancel(reason) { - this._done = true; - for (const requestCapability of this._requests) { - requestCapability.resolve({ - value: undefined, - done: true - }); - } - this._requests.length = 0; - } - progressiveDone() { - if (this._done) { - return; - } - this._done = true; - } -} -class PDFDataTransportStreamRangeReader { - constructor(stream, begin, end) { - this._stream = stream; - this._begin = begin; - this._end = end; - this._queuedChunk = null; - this._requests = []; - this._done = false; - this.onProgress = null; - } - _enqueue(chunk) { - if (this._done) { - return; - } - if (this._requests.length === 0) { - this._queuedChunk = chunk; - } else { - const requestsCapability = this._requests.shift(); - requestsCapability.resolve({ - value: chunk, - done: false - }); - for (const requestCapability of this._requests) { - requestCapability.resolve({ - value: undefined, - done: true - }); - } - this._requests.length = 0; - } - this._done = true; - this._stream._removeRangeReader(this); - } - get isStreamingSupported() { - return false; - } - async read() { - if (this._queuedChunk) { - const chunk = this._queuedChunk; - this._queuedChunk = null; - return { - value: chunk, - done: false - }; - } - if (this._done) { - return { - value: undefined, - done: true - }; - } - const requestCapability = (0, _util.createPromiseCapability)(); - this._requests.push(requestCapability); - return requestCapability.promise; - } - cancel(reason) { - this._done = true; - for (const requestCapability of this._requests) { - requestCapability.resolve({ - value: undefined, - done: true - }); - } - this._requests.length = 0; - this._stream._removeRangeReader(this); - } -} - -/***/ }), -/* 19 */ -/***/ ((__unused_webpack_module, exports) => { - - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.XfaText = void 0; -class XfaText { - static textContent(xfa) { - const items = []; - const output = { - items, - styles: Object.create(null) - }; - function walk(node) { - if (!node) { - return; - } - let str = null; - const name = node.name; - if (name === "#text") { - str = node.value; - } else if (!XfaText.shouldBuildText(name)) { - return; - } else if (node?.attributes?.textContent) { - str = node.attributes.textContent; - } else if (node.value) { - str = node.value; - } - if (str !== null) { - items.push({ - str - }); - } - if (!node.children) { - return; - } - for (const child of node.children) { - walk(child); - } - } - walk(xfa); - return output; - } - static shouldBuildText(name) { - return !(name === "textarea" || name === "input" || name === "option" || name === "select"); - } -} -exports.XfaText = XfaText; - -/***/ }), -/* 20 */ -/***/ ((__unused_webpack_module, exports, __w_pdfjs_require__) => { - - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.NodeStandardFontDataFactory = exports.NodeCanvasFactory = exports.NodeCMapReaderFactory = void 0; -var _base_factory = __w_pdfjs_require__(7); -; -const fetchData = function (url) { - return new Promise((resolve, reject) => { - const fs = require("fs"); - fs.readFile(url, (error, data) => { - if (error || !data) { - reject(new Error(error)); - return; - } - resolve(new Uint8Array(data)); - }); - }); -}; -class NodeCanvasFactory extends _base_factory.BaseCanvasFactory { - _createCanvas(width, height) { - const Canvas = require("canvas"); - return Canvas.createCanvas(width, height); - } -} -exports.NodeCanvasFactory = NodeCanvasFactory; -class NodeCMapReaderFactory extends _base_factory.BaseCMapReaderFactory { - _fetchData(url, compressionType) { - return fetchData(url).then(data => { - return { - cMapData: data, - compressionType - }; - }); - } -} -exports.NodeCMapReaderFactory = NodeCMapReaderFactory; -class NodeStandardFontDataFactory extends _base_factory.BaseStandardFontDataFactory { - _fetchData(url) { - return fetchData(url); - } -} -exports.NodeStandardFontDataFactory = NodeStandardFontDataFactory; - -/***/ }), -/* 21 */ -/***/ ((__unused_webpack_module, exports, __w_pdfjs_require__) => { - - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.PDFNodeStream = void 0; -var _util = __w_pdfjs_require__(1); -var _network_utils = __w_pdfjs_require__(22); -; -const fs = require("fs"); -const http = require("http"); -const https = require("https"); -const url = require("url"); -const fileUriRegex = /^file:\/\/\/[a-zA-Z]:\//; -function parseUrl(sourceUrl) { - const parsedUrl = url.parse(sourceUrl); - if (parsedUrl.protocol === "file:" || parsedUrl.host) { - return parsedUrl; - } - if (/^[a-z]:[/\\]/i.test(sourceUrl)) { - return url.parse(`file:///${sourceUrl}`); - } - if (!parsedUrl.host) { - parsedUrl.protocol = "file:"; - } - return parsedUrl; -} -class PDFNodeStream { - constructor(source) { - this.source = source; - this.url = parseUrl(source.url); - this.isHttp = this.url.protocol === "http:" || this.url.protocol === "https:"; - this.isFsUrl = this.url.protocol === "file:"; - this.httpHeaders = this.isHttp && source.httpHeaders || {}; - this._fullRequestReader = null; - this._rangeRequestReaders = []; - } - get _progressiveDataLength() { - return this._fullRequestReader?._loaded ?? 0; - } - getFullReader() { - (0, _util.assert)(!this._fullRequestReader, "PDFNodeStream.getFullReader can only be called once."); - this._fullRequestReader = this.isFsUrl ? new PDFNodeStreamFsFullReader(this) : new PDFNodeStreamFullReader(this); - return this._fullRequestReader; - } - getRangeReader(start, end) { - if (end <= this._progressiveDataLength) { - return null; - } - const rangeReader = this.isFsUrl ? new PDFNodeStreamFsRangeReader(this, start, end) : new PDFNodeStreamRangeReader(this, start, end); - this._rangeRequestReaders.push(rangeReader); - return rangeReader; - } - cancelAllRequests(reason) { - this._fullRequestReader?.cancel(reason); - for (const reader of this._rangeRequestReaders.slice(0)) { - reader.cancel(reason); - } - } -} -exports.PDFNodeStream = PDFNodeStream; -class BaseFullReader { - constructor(stream) { - this._url = stream.url; - this._done = false; - this._storedError = null; - this.onProgress = null; - const source = stream.source; - this._contentLength = source.length; - this._loaded = 0; - this._filename = null; - this._disableRange = source.disableRange || false; - this._rangeChunkSize = source.rangeChunkSize; - if (!this._rangeChunkSize && !this._disableRange) { - this._disableRange = true; - } - this._isStreamingSupported = !source.disableStream; - this._isRangeSupported = !source.disableRange; - this._readableStream = null; - this._readCapability = (0, _util.createPromiseCapability)(); - this._headersCapability = (0, _util.createPromiseCapability)(); - } - get headersReady() { - return this._headersCapability.promise; - } - get filename() { - return this._filename; - } - get contentLength() { - return this._contentLength; - } - get isRangeSupported() { - return this._isRangeSupported; - } - get isStreamingSupported() { - return this._isStreamingSupported; - } - async read() { - await this._readCapability.promise; - if (this._done) { - return { - value: undefined, - done: true - }; - } - if (this._storedError) { - throw this._storedError; - } - const chunk = this._readableStream.read(); - if (chunk === null) { - this._readCapability = (0, _util.createPromiseCapability)(); - return this.read(); - } - this._loaded += chunk.length; - this.onProgress?.({ - loaded: this._loaded, - total: this._contentLength - }); - const buffer = new Uint8Array(chunk).buffer; - return { - value: buffer, - done: false - }; - } - cancel(reason) { - if (!this._readableStream) { - this._error(reason); - return; - } - this._readableStream.destroy(reason); - } - _error(reason) { - this._storedError = reason; - this._readCapability.resolve(); - } - _setReadableStream(readableStream) { - this._readableStream = readableStream; - readableStream.on("readable", () => { - this._readCapability.resolve(); - }); - readableStream.on("end", () => { - readableStream.destroy(); - this._done = true; - this._readCapability.resolve(); - }); - readableStream.on("error", reason => { - this._error(reason); - }); - if (!this._isStreamingSupported && this._isRangeSupported) { - this._error(new _util.AbortException("streaming is disabled")); - } - if (this._storedError) { - this._readableStream.destroy(this._storedError); - } - } -} -class BaseRangeReader { - constructor(stream) { - this._url = stream.url; - this._done = false; - this._storedError = null; - this.onProgress = null; - this._loaded = 0; - this._readableStream = null; - this._readCapability = (0, _util.createPromiseCapability)(); - const source = stream.source; - this._isStreamingSupported = !source.disableStream; - } - get isStreamingSupported() { - return this._isStreamingSupported; - } - async read() { - await this._readCapability.promise; - if (this._done) { - return { - value: undefined, - done: true - }; - } - if (this._storedError) { - throw this._storedError; - } - const chunk = this._readableStream.read(); - if (chunk === null) { - this._readCapability = (0, _util.createPromiseCapability)(); - return this.read(); - } - this._loaded += chunk.length; - this.onProgress?.({ - loaded: this._loaded - }); - const buffer = new Uint8Array(chunk).buffer; - return { - value: buffer, - done: false - }; - } - cancel(reason) { - if (!this._readableStream) { - this._error(reason); - return; - } - this._readableStream.destroy(reason); - } - _error(reason) { - this._storedError = reason; - this._readCapability.resolve(); - } - _setReadableStream(readableStream) { - this._readableStream = readableStream; - readableStream.on("readable", () => { - this._readCapability.resolve(); - }); - readableStream.on("end", () => { - readableStream.destroy(); - this._done = true; - this._readCapability.resolve(); - }); - readableStream.on("error", reason => { - this._error(reason); - }); - if (this._storedError) { - this._readableStream.destroy(this._storedError); - } - } -} -function createRequestOptions(parsedUrl, headers) { - return { - protocol: parsedUrl.protocol, - auth: parsedUrl.auth, - host: parsedUrl.hostname, - port: parsedUrl.port, - path: parsedUrl.path, - method: "GET", - headers - }; -} -class PDFNodeStreamFullReader extends BaseFullReader { - constructor(stream) { - super(stream); - const handleResponse = response => { - if (response.statusCode === 404) { - const error = new _util.MissingPDFException(`Missing PDF "${this._url}".`); - this._storedError = error; - this._headersCapability.reject(error); - return; - } - this._headersCapability.resolve(); - this._setReadableStream(response); - const getResponseHeader = name => { - return this._readableStream.headers[name.toLowerCase()]; - }; - const { - allowRangeRequests, - suggestedLength - } = (0, _network_utils.validateRangeRequestCapabilities)({ - getResponseHeader, - isHttp: stream.isHttp, - rangeChunkSize: this._rangeChunkSize, - disableRange: this._disableRange - }); - this._isRangeSupported = allowRangeRequests; - this._contentLength = suggestedLength || this._contentLength; - this._filename = (0, _network_utils.extractFilenameFromHeader)(getResponseHeader); - }; - this._request = null; - if (this._url.protocol === "http:") { - this._request = http.request(createRequestOptions(this._url, stream.httpHeaders), handleResponse); - } else { - this._request = https.request(createRequestOptions(this._url, stream.httpHeaders), handleResponse); - } - this._request.on("error", reason => { - this._storedError = reason; - this._headersCapability.reject(reason); - }); - this._request.end(); - } -} -class PDFNodeStreamRangeReader extends BaseRangeReader { - constructor(stream, start, end) { - super(stream); - this._httpHeaders = {}; - for (const property in stream.httpHeaders) { - const value = stream.httpHeaders[property]; - if (value === undefined) { - continue; - } - this._httpHeaders[property] = value; - } - this._httpHeaders.Range = `bytes=${start}-${end - 1}`; - const handleResponse = response => { - if (response.statusCode === 404) { - const error = new _util.MissingPDFException(`Missing PDF "${this._url}".`); - this._storedError = error; - return; - } - this._setReadableStream(response); - }; - this._request = null; - if (this._url.protocol === "http:") { - this._request = http.request(createRequestOptions(this._url, this._httpHeaders), handleResponse); - } else { - this._request = https.request(createRequestOptions(this._url, this._httpHeaders), handleResponse); - } - this._request.on("error", reason => { - this._storedError = reason; - }); - this._request.end(); - } -} -class PDFNodeStreamFsFullReader extends BaseFullReader { - constructor(stream) { - super(stream); - let path = decodeURIComponent(this._url.path); - if (fileUriRegex.test(this._url.href)) { - path = path.replace(/^\//, ""); - } - fs.lstat(path, (error, stat) => { - if (error) { - if (error.code === "ENOENT") { - error = new _util.MissingPDFException(`Missing PDF "${path}".`); - } - this._storedError = error; - this._headersCapability.reject(error); - return; - } - this._contentLength = stat.size; - this._setReadableStream(fs.createReadStream(path)); - this._headersCapability.resolve(); - }); - } -} -class PDFNodeStreamFsRangeReader extends BaseRangeReader { - constructor(stream, start, end) { - super(stream); - let path = decodeURIComponent(this._url.path); - if (fileUriRegex.test(this._url.href)) { - path = path.replace(/^\//, ""); - } - this._setReadableStream(fs.createReadStream(path, { - start, - end: end - 1 - })); - } -} - -/***/ }), -/* 22 */ -/***/ ((__unused_webpack_module, exports, __w_pdfjs_require__) => { - - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.createResponseStatusError = createResponseStatusError; -exports.extractFilenameFromHeader = extractFilenameFromHeader; -exports.validateRangeRequestCapabilities = validateRangeRequestCapabilities; -exports.validateResponseStatus = validateResponseStatus; -var _util = __w_pdfjs_require__(1); -var _content_disposition = __w_pdfjs_require__(23); -var _display_utils = __w_pdfjs_require__(6); -function validateRangeRequestCapabilities({ - getResponseHeader, - isHttp, - rangeChunkSize, - disableRange -}) { - const returnValues = { - allowRangeRequests: false, - suggestedLength: undefined - }; - const length = parseInt(getResponseHeader("Content-Length"), 10); - if (!Number.isInteger(length)) { - return returnValues; - } - returnValues.suggestedLength = length; - if (length <= 2 * rangeChunkSize) { - return returnValues; - } - if (disableRange || !isHttp) { - return returnValues; - } - if (getResponseHeader("Accept-Ranges") !== "bytes") { - return returnValues; - } - const contentEncoding = getResponseHeader("Content-Encoding") || "identity"; - if (contentEncoding !== "identity") { - return returnValues; - } - returnValues.allowRangeRequests = true; - return returnValues; -} -function extractFilenameFromHeader(getResponseHeader) { - const contentDisposition = getResponseHeader("Content-Disposition"); - if (contentDisposition) { - let filename = (0, _content_disposition.getFilenameFromContentDispositionHeader)(contentDisposition); - if (filename.includes("%")) { - try { - filename = decodeURIComponent(filename); - } catch (ex) {} - } - if ((0, _display_utils.isPdfFile)(filename)) { - return filename; - } - } - return null; -} -function createResponseStatusError(status, url) { - if (status === 404 || status === 0 && url.startsWith("file:")) { - return new _util.MissingPDFException('Missing PDF "' + url + '".'); - } - return new _util.UnexpectedResponseException(`Unexpected server response (${status}) while retrieving PDF "${url}".`, status); -} -function validateResponseStatus(status) { - return status === 200 || status === 206; -} - -/***/ }), -/* 23 */ -/***/ ((__unused_webpack_module, exports, __w_pdfjs_require__) => { - - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.getFilenameFromContentDispositionHeader = getFilenameFromContentDispositionHeader; -var _util = __w_pdfjs_require__(1); -function getFilenameFromContentDispositionHeader(contentDisposition) { - let needsEncodingFixup = true; - let tmp = toParamRegExp("filename\\*", "i").exec(contentDisposition); - if (tmp) { - tmp = tmp[1]; - let filename = rfc2616unquote(tmp); - filename = unescape(filename); - filename = rfc5987decode(filename); - filename = rfc2047decode(filename); - return fixupEncoding(filename); - } - tmp = rfc2231getparam(contentDisposition); - if (tmp) { - const filename = rfc2047decode(tmp); - return fixupEncoding(filename); - } - tmp = toParamRegExp("filename", "i").exec(contentDisposition); - if (tmp) { - tmp = tmp[1]; - let filename = rfc2616unquote(tmp); - filename = rfc2047decode(filename); - return fixupEncoding(filename); - } - function toParamRegExp(attributePattern, flags) { - return new RegExp("(?:^|;)\\s*" + attributePattern + "\\s*=\\s*" + "(" + '[^";\\s][^;\\s]*' + "|" + '"(?:[^"\\\\]|\\\\"?)+"?' + ")", flags); - } - function textdecode(encoding, value) { - if (encoding) { - if (!/^[\x00-\xFF]+$/.test(value)) { - return value; - } - try { - const decoder = new TextDecoder(encoding, { - fatal: true - }); - const buffer = (0, _util.stringToBytes)(value); - value = decoder.decode(buffer); - needsEncodingFixup = false; - } catch (e) {} - } - return value; - } - function fixupEncoding(value) { - if (needsEncodingFixup && /[\x80-\xff]/.test(value)) { - value = textdecode("utf-8", value); - if (needsEncodingFixup) { - value = textdecode("iso-8859-1", value); - } - } - return value; - } - function rfc2231getparam(contentDispositionStr) { - const matches = []; - let match; - const iter = toParamRegExp("filename\\*((?!0\\d)\\d+)(\\*?)", "ig"); - while ((match = iter.exec(contentDispositionStr)) !== null) { - let [, n, quot, part] = match; - n = parseInt(n, 10); - if (n in matches) { - if (n === 0) { - break; - } - continue; - } - matches[n] = [quot, part]; - } - const parts = []; - for (let n = 0; n < matches.length; ++n) { - if (!(n in matches)) { - break; - } - let [quot, part] = matches[n]; - part = rfc2616unquote(part); - if (quot) { - part = unescape(part); - if (n === 0) { - part = rfc5987decode(part); - } - } - parts.push(part); - } - return parts.join(""); - } - function rfc2616unquote(value) { - if (value.startsWith('"')) { - const parts = value.slice(1).split('\\"'); - for (let i = 0; i < parts.length; ++i) { - const quotindex = parts[i].indexOf('"'); - if (quotindex !== -1) { - parts[i] = parts[i].slice(0, quotindex); - parts.length = i + 1; - } - parts[i] = parts[i].replace(/\\(.)/g, "$1"); - } - value = parts.join('"'); - } - return value; - } - function rfc5987decode(extvalue) { - const encodingend = extvalue.indexOf("'"); - if (encodingend === -1) { - return extvalue; - } - const encoding = extvalue.slice(0, encodingend); - const langvalue = extvalue.slice(encodingend + 1); - const value = langvalue.replace(/^[^']*'/, ""); - return textdecode(encoding, value); - } - function rfc2047decode(value) { - if (!value.startsWith("=?") || /[\x00-\x19\x80-\xff]/.test(value)) { - return value; - } - return value.replace(/=\?([\w-]*)\?([QqBb])\?((?:[^?]|\?(?!=))*)\?=/g, function (matches, charset, encoding, text) { - if (encoding === "q" || encoding === "Q") { - text = text.replace(/_/g, " "); - text = text.replace(/=([0-9a-fA-F]{2})/g, function (match, hex) { - return String.fromCharCode(parseInt(hex, 16)); - }); - return textdecode(charset, text); - } - try { - text = atob(text); - } catch (e) {} - return textdecode(charset, text); - }); - } - return ""; -} - -/***/ }), -/* 24 */ -/***/ ((__unused_webpack_module, exports, __w_pdfjs_require__) => { - - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.PDFNetworkStream = void 0; -var _util = __w_pdfjs_require__(1); -var _network_utils = __w_pdfjs_require__(22); -; -const OK_RESPONSE = 200; -const PARTIAL_CONTENT_RESPONSE = 206; -function getArrayBuffer(xhr) { - const data = xhr.response; - if (typeof data !== "string") { - return data; - } - return (0, _util.stringToBytes)(data).buffer; -} -class NetworkManager { - constructor(url, args = {}) { - this.url = url; - this.isHttp = /^https?:/i.test(url); - this.httpHeaders = this.isHttp && args.httpHeaders || Object.create(null); - this.withCredentials = args.withCredentials || false; - this.getXhr = args.getXhr || function NetworkManager_getXhr() { - return new XMLHttpRequest(); - }; - this.currXhrId = 0; - this.pendingRequests = Object.create(null); - } - requestRange(begin, end, listeners) { - const args = { - begin, - end - }; - for (const prop in listeners) { - args[prop] = listeners[prop]; - } - return this.request(args); - } - requestFull(listeners) { - return this.request(listeners); - } - request(args) { - const xhr = this.getXhr(); - const xhrId = this.currXhrId++; - const pendingRequest = this.pendingRequests[xhrId] = { - xhr - }; - xhr.open("GET", this.url); - xhr.withCredentials = this.withCredentials; - for (const property in this.httpHeaders) { - const value = this.httpHeaders[property]; - if (value === undefined) { - continue; - } - xhr.setRequestHeader(property, value); - } - if (this.isHttp && "begin" in args && "end" in args) { - xhr.setRequestHeader("Range", `bytes=${args.begin}-${args.end - 1}`); - pendingRequest.expectedStatus = PARTIAL_CONTENT_RESPONSE; - } else { - pendingRequest.expectedStatus = OK_RESPONSE; - } - xhr.responseType = "arraybuffer"; - if (args.onError) { - xhr.onerror = function (evt) { - args.onError(xhr.status); - }; - } - xhr.onreadystatechange = this.onStateChange.bind(this, xhrId); - xhr.onprogress = this.onProgress.bind(this, xhrId); - pendingRequest.onHeadersReceived = args.onHeadersReceived; - pendingRequest.onDone = args.onDone; - pendingRequest.onError = args.onError; - pendingRequest.onProgress = args.onProgress; - xhr.send(null); - return xhrId; - } - onProgress(xhrId, evt) { - const pendingRequest = this.pendingRequests[xhrId]; - if (!pendingRequest) { - return; - } - pendingRequest.onProgress?.(evt); - } - onStateChange(xhrId, evt) { - const pendingRequest = this.pendingRequests[xhrId]; - if (!pendingRequest) { - return; - } - const xhr = pendingRequest.xhr; - if (xhr.readyState >= 2 && pendingRequest.onHeadersReceived) { - pendingRequest.onHeadersReceived(); - delete pendingRequest.onHeadersReceived; - } - if (xhr.readyState !== 4) { - return; - } - if (!(xhrId in this.pendingRequests)) { - return; - } - delete this.pendingRequests[xhrId]; - if (xhr.status === 0 && this.isHttp) { - pendingRequest.onError?.(xhr.status); - return; - } - const xhrStatus = xhr.status || OK_RESPONSE; - const ok_response_on_range_request = xhrStatus === OK_RESPONSE && pendingRequest.expectedStatus === PARTIAL_CONTENT_RESPONSE; - if (!ok_response_on_range_request && xhrStatus !== pendingRequest.expectedStatus) { - pendingRequest.onError?.(xhr.status); - return; - } - const chunk = getArrayBuffer(xhr); - if (xhrStatus === PARTIAL_CONTENT_RESPONSE) { - const rangeHeader = xhr.getResponseHeader("Content-Range"); - const matches = /bytes (\d+)-(\d+)\/(\d+)/.exec(rangeHeader); - pendingRequest.onDone({ - begin: parseInt(matches[1], 10), - chunk - }); - } else if (chunk) { - pendingRequest.onDone({ - begin: 0, - chunk - }); - } else { - pendingRequest.onError?.(xhr.status); - } - } - getRequestXhr(xhrId) { - return this.pendingRequests[xhrId].xhr; - } - isPendingRequest(xhrId) { - return xhrId in this.pendingRequests; - } - abortRequest(xhrId) { - const xhr = this.pendingRequests[xhrId].xhr; - delete this.pendingRequests[xhrId]; - xhr.abort(); - } -} -class PDFNetworkStream { - constructor(source) { - this._source = source; - this._manager = new NetworkManager(source.url, { - httpHeaders: source.httpHeaders, - withCredentials: source.withCredentials - }); - this._rangeChunkSize = source.rangeChunkSize; - this._fullRequestReader = null; - this._rangeRequestReaders = []; - } - _onRangeRequestReaderClosed(reader) { - const i = this._rangeRequestReaders.indexOf(reader); - if (i >= 0) { - this._rangeRequestReaders.splice(i, 1); - } - } - getFullReader() { - (0, _util.assert)(!this._fullRequestReader, "PDFNetworkStream.getFullReader can only be called once."); - this._fullRequestReader = new PDFNetworkStreamFullRequestReader(this._manager, this._source); - return this._fullRequestReader; - } - getRangeReader(begin, end) { - const reader = new PDFNetworkStreamRangeRequestReader(this._manager, begin, end); - reader.onClosed = this._onRangeRequestReaderClosed.bind(this); - this._rangeRequestReaders.push(reader); - return reader; - } - cancelAllRequests(reason) { - this._fullRequestReader?.cancel(reason); - for (const reader of this._rangeRequestReaders.slice(0)) { - reader.cancel(reason); - } - } -} -exports.PDFNetworkStream = PDFNetworkStream; -class PDFNetworkStreamFullRequestReader { - constructor(manager, source) { - this._manager = manager; - const args = { - onHeadersReceived: this._onHeadersReceived.bind(this), - onDone: this._onDone.bind(this), - onError: this._onError.bind(this), - onProgress: this._onProgress.bind(this) - }; - this._url = source.url; - this._fullRequestId = manager.requestFull(args); - this._headersReceivedCapability = (0, _util.createPromiseCapability)(); - this._disableRange = source.disableRange || false; - this._contentLength = source.length; - this._rangeChunkSize = source.rangeChunkSize; - if (!this._rangeChunkSize && !this._disableRange) { - this._disableRange = true; - } - this._isStreamingSupported = false; - this._isRangeSupported = false; - this._cachedChunks = []; - this._requests = []; - this._done = false; - this._storedError = undefined; - this._filename = null; - this.onProgress = null; - } - _onHeadersReceived() { - const fullRequestXhrId = this._fullRequestId; - const fullRequestXhr = this._manager.getRequestXhr(fullRequestXhrId); - const getResponseHeader = name => { - return fullRequestXhr.getResponseHeader(name); - }; - const { - allowRangeRequests, - suggestedLength - } = (0, _network_utils.validateRangeRequestCapabilities)({ - getResponseHeader, - isHttp: this._manager.isHttp, - rangeChunkSize: this._rangeChunkSize, - disableRange: this._disableRange - }); - if (allowRangeRequests) { - this._isRangeSupported = true; - } - this._contentLength = suggestedLength || this._contentLength; - this._filename = (0, _network_utils.extractFilenameFromHeader)(getResponseHeader); - if (this._isRangeSupported) { - this._manager.abortRequest(fullRequestXhrId); - } - this._headersReceivedCapability.resolve(); - } - _onDone(data) { - if (data) { - if (this._requests.length > 0) { - const requestCapability = this._requests.shift(); - requestCapability.resolve({ - value: data.chunk, - done: false - }); - } else { - this._cachedChunks.push(data.chunk); - } - } - this._done = true; - if (this._cachedChunks.length > 0) { - return; - } - for (const requestCapability of this._requests) { - requestCapability.resolve({ - value: undefined, - done: true - }); - } - this._requests.length = 0; - } - _onError(status) { - this._storedError = (0, _network_utils.createResponseStatusError)(status, this._url); - this._headersReceivedCapability.reject(this._storedError); - for (const requestCapability of this._requests) { - requestCapability.reject(this._storedError); - } - this._requests.length = 0; - this._cachedChunks.length = 0; - } - _onProgress(evt) { - this.onProgress?.({ - loaded: evt.loaded, - total: evt.lengthComputable ? evt.total : this._contentLength - }); - } - get filename() { - return this._filename; - } - get isRangeSupported() { - return this._isRangeSupported; - } - get isStreamingSupported() { - return this._isStreamingSupported; - } - get contentLength() { - return this._contentLength; - } - get headersReady() { - return this._headersReceivedCapability.promise; - } - async read() { - if (this._storedError) { - throw this._storedError; - } - if (this._cachedChunks.length > 0) { - const chunk = this._cachedChunks.shift(); - return { - value: chunk, - done: false - }; - } - if (this._done) { - return { - value: undefined, - done: true - }; - } - const requestCapability = (0, _util.createPromiseCapability)(); - this._requests.push(requestCapability); - return requestCapability.promise; - } - cancel(reason) { - this._done = true; - this._headersReceivedCapability.reject(reason); - for (const requestCapability of this._requests) { - requestCapability.resolve({ - value: undefined, - done: true - }); - } - this._requests.length = 0; - if (this._manager.isPendingRequest(this._fullRequestId)) { - this._manager.abortRequest(this._fullRequestId); - } - this._fullRequestReader = null; - } -} -class PDFNetworkStreamRangeRequestReader { - constructor(manager, begin, end) { - this._manager = manager; - const args = { - onDone: this._onDone.bind(this), - onError: this._onError.bind(this), - onProgress: this._onProgress.bind(this) - }; - this._url = manager.url; - this._requestId = manager.requestRange(begin, end, args); - this._requests = []; - this._queuedChunk = null; - this._done = false; - this._storedError = undefined; - this.onProgress = null; - this.onClosed = null; - } - _close() { - this.onClosed?.(this); - } - _onDone(data) { - const chunk = data.chunk; - if (this._requests.length > 0) { - const requestCapability = this._requests.shift(); - requestCapability.resolve({ - value: chunk, - done: false - }); - } else { - this._queuedChunk = chunk; - } - this._done = true; - for (const requestCapability of this._requests) { - requestCapability.resolve({ - value: undefined, - done: true - }); - } - this._requests.length = 0; - this._close(); - } - _onError(status) { - this._storedError = (0, _network_utils.createResponseStatusError)(status, this._url); - for (const requestCapability of this._requests) { - requestCapability.reject(this._storedError); - } - this._requests.length = 0; - this._queuedChunk = null; - } - _onProgress(evt) { - if (!this.isStreamingSupported) { - this.onProgress?.({ - loaded: evt.loaded - }); - } - } - get isStreamingSupported() { - return false; - } - async read() { - if (this._storedError) { - throw this._storedError; - } - if (this._queuedChunk !== null) { - const chunk = this._queuedChunk; - this._queuedChunk = null; - return { - value: chunk, - done: false - }; - } - if (this._done) { - return { - value: undefined, - done: true - }; - } - const requestCapability = (0, _util.createPromiseCapability)(); - this._requests.push(requestCapability); - return requestCapability.promise; - } - cancel(reason) { - this._done = true; - for (const requestCapability of this._requests) { - requestCapability.resolve({ - value: undefined, - done: true - }); - } - this._requests.length = 0; - if (this._manager.isPendingRequest(this._requestId)) { - this._manager.abortRequest(this._requestId); - } - this._close(); - } -} - -/***/ }), -/* 25 */ -/***/ ((__unused_webpack_module, exports, __w_pdfjs_require__) => { - - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.PDFFetchStream = void 0; -var _util = __w_pdfjs_require__(1); -var _network_utils = __w_pdfjs_require__(22); -; -function createFetchOptions(headers, withCredentials, abortController) { - return { - method: "GET", - headers, - signal: abortController.signal, - mode: "cors", - credentials: withCredentials ? "include" : "same-origin", - redirect: "follow" - }; -} -function createHeaders(httpHeaders) { - const headers = new Headers(); - for (const property in httpHeaders) { - const value = httpHeaders[property]; - if (value === undefined) { - continue; - } - headers.append(property, value); - } - return headers; -} -function getArrayBuffer(val) { - if (val instanceof Uint8Array) { - return val.buffer; - } - if (val instanceof ArrayBuffer) { - return val; - } - (0, _util.warn)(`getArrayBuffer - unexpected data format: ${val}`); - return new Uint8Array(val).buffer; -} -class PDFFetchStream { - constructor(source) { - this.source = source; - this.isHttp = /^https?:/i.test(source.url); - this.httpHeaders = this.isHttp && source.httpHeaders || {}; - this._fullRequestReader = null; - this._rangeRequestReaders = []; - } - get _progressiveDataLength() { - return this._fullRequestReader?._loaded ?? 0; - } - getFullReader() { - (0, _util.assert)(!this._fullRequestReader, "PDFFetchStream.getFullReader can only be called once."); - this._fullRequestReader = new PDFFetchStreamReader(this); - return this._fullRequestReader; - } - getRangeReader(begin, end) { - if (end <= this._progressiveDataLength) { - return null; - } - const reader = new PDFFetchStreamRangeReader(this, begin, end); - this._rangeRequestReaders.push(reader); - return reader; - } - cancelAllRequests(reason) { - this._fullRequestReader?.cancel(reason); - for (const reader of this._rangeRequestReaders.slice(0)) { - reader.cancel(reason); - } - } -} -exports.PDFFetchStream = PDFFetchStream; -class PDFFetchStreamReader { - constructor(stream) { - this._stream = stream; - this._reader = null; - this._loaded = 0; - this._filename = null; - const source = stream.source; - this._withCredentials = source.withCredentials || false; - this._contentLength = source.length; - this._headersCapability = (0, _util.createPromiseCapability)(); - this._disableRange = source.disableRange || false; - this._rangeChunkSize = source.rangeChunkSize; - if (!this._rangeChunkSize && !this._disableRange) { - this._disableRange = true; - } - this._abortController = new AbortController(); - this._isStreamingSupported = !source.disableStream; - this._isRangeSupported = !source.disableRange; - this._headers = createHeaders(this._stream.httpHeaders); - const url = source.url; - fetch(url, createFetchOptions(this._headers, this._withCredentials, this._abortController)).then(response => { - if (!(0, _network_utils.validateResponseStatus)(response.status)) { - throw (0, _network_utils.createResponseStatusError)(response.status, url); - } - this._reader = response.body.getReader(); - this._headersCapability.resolve(); - const getResponseHeader = name => { - return response.headers.get(name); - }; - const { - allowRangeRequests, - suggestedLength - } = (0, _network_utils.validateRangeRequestCapabilities)({ - getResponseHeader, - isHttp: this._stream.isHttp, - rangeChunkSize: this._rangeChunkSize, - disableRange: this._disableRange - }); - this._isRangeSupported = allowRangeRequests; - this._contentLength = suggestedLength || this._contentLength; - this._filename = (0, _network_utils.extractFilenameFromHeader)(getResponseHeader); - if (!this._isStreamingSupported && this._isRangeSupported) { - this.cancel(new _util.AbortException("Streaming is disabled.")); - } - }).catch(this._headersCapability.reject); - this.onProgress = null; - } - get headersReady() { - return this._headersCapability.promise; - } - get filename() { - return this._filename; - } - get contentLength() { - return this._contentLength; - } - get isRangeSupported() { - return this._isRangeSupported; - } - get isStreamingSupported() { - return this._isStreamingSupported; - } - async read() { - await this._headersCapability.promise; - const { - value, - done - } = await this._reader.read(); - if (done) { - return { - value, - done - }; - } - this._loaded += value.byteLength; - this.onProgress?.({ - loaded: this._loaded, - total: this._contentLength - }); - return { - value: getArrayBuffer(value), - done: false - }; - } - cancel(reason) { - this._reader?.cancel(reason); - this._abortController.abort(); - } -} -class PDFFetchStreamRangeReader { - constructor(stream, begin, end) { - this._stream = stream; - this._reader = null; - this._loaded = 0; - const source = stream.source; - this._withCredentials = source.withCredentials || false; - this._readCapability = (0, _util.createPromiseCapability)(); - this._isStreamingSupported = !source.disableStream; - this._abortController = new AbortController(); - this._headers = createHeaders(this._stream.httpHeaders); - this._headers.append("Range", `bytes=${begin}-${end - 1}`); - const url = source.url; - fetch(url, createFetchOptions(this._headers, this._withCredentials, this._abortController)).then(response => { - if (!(0, _network_utils.validateResponseStatus)(response.status)) { - throw (0, _network_utils.createResponseStatusError)(response.status, url); - } - this._readCapability.resolve(); - this._reader = response.body.getReader(); - }).catch(this._readCapability.reject); - this.onProgress = null; - } - get isStreamingSupported() { - return this._isStreamingSupported; - } - async read() { - await this._readCapability.promise; - const { - value, - done - } = await this._reader.read(); - if (done) { - return { - value, - done - }; - } - this._loaded += value.byteLength; - this.onProgress?.({ - loaded: this._loaded - }); - return { - value: getArrayBuffer(value), - done: false - }; - } - cancel(reason) { - this._reader?.cancel(reason); - this._abortController.abort(); - } -} - -/***/ }), -/* 26 */ -/***/ ((__unused_webpack_module, exports, __w_pdfjs_require__) => { - - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.TextLayerRenderTask = void 0; -exports.renderTextLayer = renderTextLayer; -exports.updateTextLayer = updateTextLayer; -var _util = __w_pdfjs_require__(1); -var _display_utils = __w_pdfjs_require__(6); -const MAX_TEXT_DIVS_TO_RENDER = 100000; -const DEFAULT_FONT_SIZE = 30; -const DEFAULT_FONT_ASCENT = 0.8; -const ascentCache = new Map(); -function getCtx(size, isOffscreenCanvasSupported) { - let ctx; - if (isOffscreenCanvasSupported && _util.FeatureTest.isOffscreenCanvasSupported) { - ctx = new OffscreenCanvas(size, size).getContext("2d", { - alpha: false - }); - } else { - const canvas = document.createElement("canvas"); - canvas.width = canvas.height = size; - ctx = canvas.getContext("2d", { - alpha: false - }); - } - return ctx; -} -function getAscent(fontFamily, isOffscreenCanvasSupported) { - const cachedAscent = ascentCache.get(fontFamily); - if (cachedAscent) { - return cachedAscent; - } - const ctx = getCtx(DEFAULT_FONT_SIZE, isOffscreenCanvasSupported); - ctx.font = `${DEFAULT_FONT_SIZE}px ${fontFamily}`; - const metrics = ctx.measureText(""); - let ascent = metrics.fontBoundingBoxAscent; - let descent = Math.abs(metrics.fontBoundingBoxDescent); - if (ascent) { - const ratio = ascent / (ascent + descent); - ascentCache.set(fontFamily, ratio); - ctx.canvas.width = ctx.canvas.height = 0; - return ratio; - } - ctx.strokeStyle = "red"; - ctx.clearRect(0, 0, DEFAULT_FONT_SIZE, DEFAULT_FONT_SIZE); - ctx.strokeText("g", 0, 0); - let pixels = ctx.getImageData(0, 0, DEFAULT_FONT_SIZE, DEFAULT_FONT_SIZE).data; - descent = 0; - for (let i = pixels.length - 1 - 3; i >= 0; i -= 4) { - if (pixels[i] > 0) { - descent = Math.ceil(i / 4 / DEFAULT_FONT_SIZE); - break; - } - } - ctx.clearRect(0, 0, DEFAULT_FONT_SIZE, DEFAULT_FONT_SIZE); - ctx.strokeText("A", 0, DEFAULT_FONT_SIZE); - pixels = ctx.getImageData(0, 0, DEFAULT_FONT_SIZE, DEFAULT_FONT_SIZE).data; - ascent = 0; - for (let i = 0, ii = pixels.length; i < ii; i += 4) { - if (pixels[i] > 0) { - ascent = DEFAULT_FONT_SIZE - Math.floor(i / 4 / DEFAULT_FONT_SIZE); - break; - } - } - ctx.canvas.width = ctx.canvas.height = 0; - if (ascent) { - const ratio = ascent / (ascent + descent); - ascentCache.set(fontFamily, ratio); - return ratio; - } - ascentCache.set(fontFamily, DEFAULT_FONT_ASCENT); - return DEFAULT_FONT_ASCENT; -} -function appendText(task, geom, styles) { - const textDiv = document.createElement("span"); - const textDivProperties = { - angle: 0, - canvasWidth: 0, - hasText: geom.str !== "", - hasEOL: geom.hasEOL, - fontSize: 0 - }; - task._textDivs.push(textDiv); - const tx = _util.Util.transform(task._transform, geom.transform); - let angle = Math.atan2(tx[1], tx[0]); - const style = styles[geom.fontName]; - if (style.vertical) { - angle += Math.PI / 2; - } - const fontHeight = Math.hypot(tx[2], tx[3]); - const fontAscent = fontHeight * getAscent(style.fontFamily, task._isOffscreenCanvasSupported); - let left, top; - if (angle === 0) { - left = tx[4]; - top = tx[5] - fontAscent; - } else { - left = tx[4] + fontAscent * Math.sin(angle); - top = tx[5] - fontAscent * Math.cos(angle); - } - const scaleFactorStr = "calc(var(--scale-factor)*"; - const divStyle = textDiv.style; - if (task._container === task._rootContainer) { - divStyle.left = `${(100 * left / task._pageWidth).toFixed(2)}%`; - divStyle.top = `${(100 * top / task._pageHeight).toFixed(2)}%`; - } else { - divStyle.left = `${scaleFactorStr}${left.toFixed(2)}px)`; - divStyle.top = `${scaleFactorStr}${top.toFixed(2)}px)`; - } - divStyle.fontSize = `${scaleFactorStr}${fontHeight.toFixed(2)}px)`; - divStyle.fontFamily = style.fontFamily; - textDivProperties.fontSize = fontHeight; - textDiv.setAttribute("role", "presentation"); - textDiv.textContent = geom.str; - textDiv.dir = geom.dir; - if (task._fontInspectorEnabled) { - textDiv.dataset.fontName = geom.fontName; - } - if (angle !== 0) { - textDivProperties.angle = angle * (180 / Math.PI); - } - let shouldScaleText = false; - if (geom.str.length > 1) { - shouldScaleText = true; - } else if (geom.str !== " " && geom.transform[0] !== geom.transform[3]) { - const absScaleX = Math.abs(geom.transform[0]), - absScaleY = Math.abs(geom.transform[3]); - if (absScaleX !== absScaleY && Math.max(absScaleX, absScaleY) / Math.min(absScaleX, absScaleY) > 1.5) { - shouldScaleText = true; - } - } - if (shouldScaleText) { - textDivProperties.canvasWidth = style.vertical ? geom.height : geom.width; - } - task._textDivProperties.set(textDiv, textDivProperties); - if (task._isReadableStream) { - task._layoutText(textDiv); - } -} -function layout(params) { - const { - div, - scale, - properties, - ctx, - prevFontSize, - prevFontFamily - } = params; - const { - style - } = div; - let transform = ""; - if (properties.canvasWidth !== 0 && properties.hasText) { - const { - fontFamily - } = style; - const { - canvasWidth, - fontSize - } = properties; - if (prevFontSize !== fontSize || prevFontFamily !== fontFamily) { - ctx.font = `${fontSize * scale}px ${fontFamily}`; - params.prevFontSize = fontSize; - params.prevFontFamily = fontFamily; - } - const { - width - } = ctx.measureText(div.textContent); - if (width > 0) { - transform = `scaleX(${canvasWidth * scale / width})`; - } - } - if (properties.angle !== 0) { - transform = `rotate(${properties.angle}deg) ${transform}`; - } - if (transform.length > 0) { - style.transform = transform; - } -} -function render(task) { - if (task._canceled) { - return; - } - const textDivs = task._textDivs; - const capability = task._capability; - const textDivsLength = textDivs.length; - if (textDivsLength > MAX_TEXT_DIVS_TO_RENDER) { - capability.resolve(); - return; - } - if (!task._isReadableStream) { - for (const textDiv of textDivs) { - task._layoutText(textDiv); - } - } - capability.resolve(); -} -class TextLayerRenderTask { - constructor({ - textContentSource, - container, - viewport, - textDivs, - textDivProperties, - textContentItemsStr, - isOffscreenCanvasSupported - }) { - this._textContentSource = textContentSource; - this._isReadableStream = textContentSource instanceof ReadableStream; - this._container = this._rootContainer = container; - this._textDivs = textDivs || []; - this._textContentItemsStr = textContentItemsStr || []; - this._isOffscreenCanvasSupported = isOffscreenCanvasSupported; - this._fontInspectorEnabled = !!globalThis.FontInspector?.enabled; - this._reader = null; - this._textDivProperties = textDivProperties || new WeakMap(); - this._canceled = false; - this._capability = (0, _util.createPromiseCapability)(); - this._layoutTextParams = { - prevFontSize: null, - prevFontFamily: null, - div: null, - scale: viewport.scale * (globalThis.devicePixelRatio || 1), - properties: null, - ctx: getCtx(0, isOffscreenCanvasSupported) - }; - const { - pageWidth, - pageHeight, - pageX, - pageY - } = viewport.rawDims; - this._transform = [1, 0, 0, -1, -pageX, pageY + pageHeight]; - this._pageWidth = pageWidth; - this._pageHeight = pageHeight; - (0, _display_utils.setLayerDimensions)(container, viewport); - this._capability.promise.finally(() => { - this._layoutTextParams = null; - }).catch(() => {}); - } - get promise() { - return this._capability.promise; - } - cancel() { - this._canceled = true; - if (this._reader) { - this._reader.cancel(new _util.AbortException("TextLayer task cancelled.")).catch(() => {}); - this._reader = null; - } - this._capability.reject(new _util.AbortException("TextLayer task cancelled.")); - } - _processItems(items, styleCache) { - for (const item of items) { - if (item.str === undefined) { - if (item.type === "beginMarkedContentProps" || item.type === "beginMarkedContent") { - const parent = this._container; - this._container = document.createElement("span"); - this._container.classList.add("markedContent"); - if (item.id !== null) { - this._container.setAttribute("id", `${item.id}`); - } - parent.append(this._container); - } else if (item.type === "endMarkedContent") { - this._container = this._container.parentNode; - } - continue; - } - this._textContentItemsStr.push(item.str); - appendText(this, item, styleCache); - } - } - _layoutText(textDiv) { - const textDivProperties = this._layoutTextParams.properties = this._textDivProperties.get(textDiv); - this._layoutTextParams.div = textDiv; - layout(this._layoutTextParams); - if (textDivProperties.hasText) { - this._container.append(textDiv); - } - if (textDivProperties.hasEOL) { - const br = document.createElement("br"); - br.setAttribute("role", "presentation"); - this._container.append(br); - } - } - _render() { - const capability = (0, _util.createPromiseCapability)(); - let styleCache = Object.create(null); - if (this._isReadableStream) { - const pump = () => { - this._reader.read().then(({ - value, - done - }) => { - if (done) { - capability.resolve(); - return; - } - Object.assign(styleCache, value.styles); - this._processItems(value.items, styleCache); - pump(); - }, capability.reject); - }; - this._reader = this._textContentSource.getReader(); - pump(); - } else if (this._textContentSource) { - const { - items, - styles - } = this._textContentSource; - this._processItems(items, styles); - capability.resolve(); - } else { - throw new Error('No "textContentSource" parameter specified.'); - } - capability.promise.then(() => { - styleCache = null; - render(this); - }, this._capability.reject); - } -} -exports.TextLayerRenderTask = TextLayerRenderTask; -function renderTextLayer(params) { - if (!params.textContentSource && (params.textContent || params.textContentStream)) { - (0, _display_utils.deprecated)("The TextLayerRender `textContent`/`textContentStream` parameters " + "will be removed in the future, please use `textContentSource` instead."); - params.textContentSource = params.textContent || params.textContentStream; - } - const task = new TextLayerRenderTask(params); - task._render(); - return task; -} -function updateTextLayer({ - container, - viewport, - textDivs, - textDivProperties, - isOffscreenCanvasSupported, - mustRotate = true, - mustRescale = true -}) { - if (mustRotate) { - (0, _display_utils.setLayerDimensions)(container, { - rotation: viewport.rotation - }); - } - if (mustRescale) { - const ctx = getCtx(0, isOffscreenCanvasSupported); - const scale = viewport.scale * (globalThis.devicePixelRatio || 1); - const params = { - prevFontSize: null, - prevFontFamily: null, - div: null, - scale, - properties: null, - ctx - }; - for (const div of textDivs) { - params.properties = textDivProperties.get(div); - params.div = div; - layout(params); - } - } -} - -/***/ }), -/* 27 */ -/***/ ((__unused_webpack_module, exports, __w_pdfjs_require__) => { - - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.AnnotationEditorLayer = void 0; -var _util = __w_pdfjs_require__(1); -var _tools = __w_pdfjs_require__(5); -var _freetext = __w_pdfjs_require__(28); -var _ink = __w_pdfjs_require__(29); -var _display_utils = __w_pdfjs_require__(6); -class AnnotationEditorLayer { - #accessibilityManager; - #allowClick = false; - #boundPointerup = this.pointerup.bind(this); - #boundPointerdown = this.pointerdown.bind(this); - #editors = new Map(); - #hadPointerDown = false; - #isCleaningUp = false; - #uiManager; - static _initialized = false; - constructor(options) { - if (!AnnotationEditorLayer._initialized) { - AnnotationEditorLayer._initialized = true; - _freetext.FreeTextEditor.initialize(options.l10n); - _ink.InkEditor.initialize(options.l10n); - } - options.uiManager.registerEditorTypes([_freetext.FreeTextEditor, _ink.InkEditor]); - this.#uiManager = options.uiManager; - this.pageIndex = options.pageIndex; - this.div = options.div; - this.#accessibilityManager = options.accessibilityManager; - this.#uiManager.addLayer(this); - } - get isEmpty() { - return this.#editors.size === 0; - } - updateToolbar(mode) { - this.#uiManager.updateToolbar(mode); - } - updateMode(mode = this.#uiManager.getMode()) { - this.#cleanup(); - if (mode === _util.AnnotationEditorType.INK) { - this.addInkEditorIfNeeded(false); - this.disableClick(); - } else { - this.enableClick(); - } - this.#uiManager.unselectAll(); - if (mode !== _util.AnnotationEditorType.NONE) { - this.div.classList.toggle("freeTextEditing", mode === _util.AnnotationEditorType.FREETEXT); - this.div.classList.toggle("inkEditing", mode === _util.AnnotationEditorType.INK); - this.div.hidden = false; - } - } - addInkEditorIfNeeded(isCommitting) { - if (!isCommitting && this.#uiManager.getMode() !== _util.AnnotationEditorType.INK) { - return; - } - if (!isCommitting) { - for (const editor of this.#editors.values()) { - if (editor.isEmpty()) { - editor.setInBackground(); - return; - } - } - } - const editor = this.#createAndAddNewEditor({ - offsetX: 0, - offsetY: 0 - }); - editor.setInBackground(); - } - setEditingState(isEditing) { - this.#uiManager.setEditingState(isEditing); - } - addCommands(params) { - this.#uiManager.addCommands(params); - } - enable() { - this.div.style.pointerEvents = "auto"; - for (const editor of this.#editors.values()) { - editor.enableEditing(); - } - } - disable() { - this.div.style.pointerEvents = "none"; - for (const editor of this.#editors.values()) { - editor.disableEditing(); - } - this.#cleanup(); - if (this.isEmpty) { - this.div.hidden = true; - } - } - setActiveEditor(editor) { - const currentActive = this.#uiManager.getActive(); - if (currentActive === editor) { - return; - } - this.#uiManager.setActiveEditor(editor); - } - enableClick() { - this.div.addEventListener("pointerdown", this.#boundPointerdown); - this.div.addEventListener("pointerup", this.#boundPointerup); - } - disableClick() { - this.div.removeEventListener("pointerdown", this.#boundPointerdown); - this.div.removeEventListener("pointerup", this.#boundPointerup); - } - attach(editor) { - this.#editors.set(editor.id, editor); - } - detach(editor) { - this.#editors.delete(editor.id); - this.#accessibilityManager?.removePointerInTextLayer(editor.contentDiv); - } - remove(editor) { - this.#uiManager.removeEditor(editor); - this.detach(editor); - editor.div.style.display = "none"; - setTimeout(() => { - editor.div.style.display = ""; - editor.div.remove(); - editor.isAttachedToDOM = false; - if (document.activeElement === document.body) { - this.#uiManager.focusMainContainer(); - } - }, 0); - if (!this.#isCleaningUp) { - this.addInkEditorIfNeeded(false); - } - } - #changeParent(editor) { - if (editor.parent === this) { - return; - } - this.attach(editor); - editor.parent?.detach(editor); - editor.setParent(this); - if (editor.div && editor.isAttachedToDOM) { - editor.div.remove(); - this.div.append(editor.div); - } - } - add(editor) { - this.#changeParent(editor); - this.#uiManager.addEditor(editor); - this.attach(editor); - if (!editor.isAttachedToDOM) { - const div = editor.render(); - this.div.append(div); - editor.isAttachedToDOM = true; - } - this.moveEditorInDOM(editor); - editor.onceAdded(); - this.#uiManager.addToAnnotationStorage(editor); - } - moveEditorInDOM(editor) { - this.#accessibilityManager?.moveElementInDOM(this.div, editor.div, editor.contentDiv, true); - } - addOrRebuild(editor) { - if (editor.needsToBeRebuilt()) { - editor.rebuild(); - } else { - this.add(editor); - } - } - addANewEditor(editor) { - const cmd = () => { - this.addOrRebuild(editor); - }; - const undo = () => { - editor.remove(); - }; - this.addCommands({ - cmd, - undo, - mustExec: true - }); - } - addUndoableEditor(editor) { - const cmd = () => { - this.addOrRebuild(editor); - }; - const undo = () => { - editor.remove(); - }; - this.addCommands({ - cmd, - undo, - mustExec: false - }); - } - getNextId() { - return this.#uiManager.getId(); - } - #createNewEditor(params) { - switch (this.#uiManager.getMode()) { - case _util.AnnotationEditorType.FREETEXT: - return new _freetext.FreeTextEditor(params); - case _util.AnnotationEditorType.INK: - return new _ink.InkEditor(params); - } - return null; - } - deserialize(data) { - switch (data.annotationType) { - case _util.AnnotationEditorType.FREETEXT: - return _freetext.FreeTextEditor.deserialize(data, this, this.#uiManager); - case _util.AnnotationEditorType.INK: - return _ink.InkEditor.deserialize(data, this, this.#uiManager); - } - return null; - } - #createAndAddNewEditor(event) { - const id = this.getNextId(); - const editor = this.#createNewEditor({ - parent: this, - id, - x: event.offsetX, - y: event.offsetY, - uiManager: this.#uiManager - }); - if (editor) { - this.add(editor); - } - return editor; - } - setSelected(editor) { - this.#uiManager.setSelected(editor); - } - toggleSelected(editor) { - this.#uiManager.toggleSelected(editor); - } - isSelected(editor) { - return this.#uiManager.isSelected(editor); - } - unselect(editor) { - this.#uiManager.unselect(editor); - } - pointerup(event) { - const { - isMac - } = _util.FeatureTest.platform; - if (event.button !== 0 || event.ctrlKey && isMac) { - return; - } - if (event.target !== this.div) { - return; - } - if (!this.#hadPointerDown) { - return; - } - this.#hadPointerDown = false; - if (!this.#allowClick) { - this.#allowClick = true; - return; - } - this.#createAndAddNewEditor(event); - } - pointerdown(event) { - const { - isMac - } = _util.FeatureTest.platform; - if (event.button !== 0 || event.ctrlKey && isMac) { - return; - } - if (event.target !== this.div) { - return; - } - this.#hadPointerDown = true; - const editor = this.#uiManager.getActive(); - this.#allowClick = !editor || editor.isEmpty(); - } - drop(event) { - const id = event.dataTransfer.getData("text/plain"); - const editor = this.#uiManager.getEditor(id); - if (!editor) { - return; - } - event.preventDefault(); - event.dataTransfer.dropEffect = "move"; - this.#changeParent(editor); - const rect = this.div.getBoundingClientRect(); - const endX = event.clientX - rect.x; - const endY = event.clientY - rect.y; - editor.translate(endX - editor.startX, endY - editor.startY); - this.moveEditorInDOM(editor); - editor.div.focus(); - } - dragover(event) { - event.preventDefault(); - } - destroy() { - if (this.#uiManager.getActive()?.parent === this) { - this.#uiManager.setActiveEditor(null); - } - for (const editor of this.#editors.values()) { - this.#accessibilityManager?.removePointerInTextLayer(editor.contentDiv); - editor.setParent(null); - editor.isAttachedToDOM = false; - editor.div.remove(); - } - this.div = null; - this.#editors.clear(); - this.#uiManager.removeLayer(this); - } - #cleanup() { - this.#isCleaningUp = true; - for (const editor of this.#editors.values()) { - if (editor.isEmpty()) { - editor.remove(); - } - } - this.#isCleaningUp = false; - } - render({ - viewport - }) { - this.viewport = viewport; - (0, _display_utils.setLayerDimensions)(this.div, viewport); - (0, _tools.bindEvents)(this, this.div, ["dragover", "drop"]); - for (const editor of this.#uiManager.getEditors(this.pageIndex)) { - this.add(editor); - } - this.updateMode(); - } - update({ - viewport - }) { - this.#uiManager.commitOrRemove(); - this.viewport = viewport; - (0, _display_utils.setLayerDimensions)(this.div, { - rotation: viewport.rotation - }); - this.updateMode(); - } - get pageDimensions() { - const { - pageWidth, - pageHeight - } = this.viewport.rawDims; - return [pageWidth, pageHeight]; - } -} -exports.AnnotationEditorLayer = AnnotationEditorLayer; - -/***/ }), -/* 28 */ -/***/ ((__unused_webpack_module, exports, __w_pdfjs_require__) => { - - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.FreeTextEditor = void 0; -var _util = __w_pdfjs_require__(1); -var _tools = __w_pdfjs_require__(5); -var _editor = __w_pdfjs_require__(4); -class FreeTextEditor extends _editor.AnnotationEditor { - #boundEditorDivBlur = this.editorDivBlur.bind(this); - #boundEditorDivFocus = this.editorDivFocus.bind(this); - #boundEditorDivInput = this.editorDivInput.bind(this); - #boundEditorDivKeydown = this.editorDivKeydown.bind(this); - #color; - #content = ""; - #editorDivId = `${this.id}-editor`; - #hasAlreadyBeenCommitted = false; - #fontSize; - static _freeTextDefaultContent = ""; - static _l10nPromise; - static _internalPadding = 0; - static _defaultColor = null; - static _defaultFontSize = 10; - static _keyboardManager = new _tools.KeyboardManager([[["ctrl+Enter", "mac+meta+Enter", "Escape", "mac+Escape"], FreeTextEditor.prototype.commitOrRemove]]); - static _type = "freetext"; - constructor(params) { - super({ - ...params, - name: "freeTextEditor" - }); - this.#color = params.color || FreeTextEditor._defaultColor || _editor.AnnotationEditor._defaultLineColor; - this.#fontSize = params.fontSize || FreeTextEditor._defaultFontSize; - } - static initialize(l10n) { - this._l10nPromise = new Map(["free_text2_default_content", "editor_free_text2_aria_label"].map(str => [str, l10n.get(str)])); - const style = getComputedStyle(document.documentElement); - this._internalPadding = parseFloat(style.getPropertyValue("--freetext-padding")); - } - static updateDefaultParams(type, value) { - switch (type) { - case _util.AnnotationEditorParamsType.FREETEXT_SIZE: - FreeTextEditor._defaultFontSize = value; - break; - case _util.AnnotationEditorParamsType.FREETEXT_COLOR: - FreeTextEditor._defaultColor = value; - break; - } - } - updateParams(type, value) { - switch (type) { - case _util.AnnotationEditorParamsType.FREETEXT_SIZE: - this.#updateFontSize(value); - break; - case _util.AnnotationEditorParamsType.FREETEXT_COLOR: - this.#updateColor(value); - break; - } - } - static get defaultPropertiesToUpdate() { - return [[_util.AnnotationEditorParamsType.FREETEXT_SIZE, FreeTextEditor._defaultFontSize], [_util.AnnotationEditorParamsType.FREETEXT_COLOR, FreeTextEditor._defaultColor || _editor.AnnotationEditor._defaultLineColor]]; - } - get propertiesToUpdate() { - return [[_util.AnnotationEditorParamsType.FREETEXT_SIZE, this.#fontSize], [_util.AnnotationEditorParamsType.FREETEXT_COLOR, this.#color]]; - } - #updateFontSize(fontSize) { - const setFontsize = size => { - this.editorDiv.style.fontSize = `calc(${size}px * var(--scale-factor))`; - this.translate(0, -(size - this.#fontSize) * this.parentScale); - this.#fontSize = size; - this.#setEditorDimensions(); - }; - const savedFontsize = this.#fontSize; - this.addCommands({ - cmd: () => { - setFontsize(fontSize); - }, - undo: () => { - setFontsize(savedFontsize); - }, - mustExec: true, - type: _util.AnnotationEditorParamsType.FREETEXT_SIZE, - overwriteIfSameType: true, - keepUndo: true - }); - } - #updateColor(color) { - const savedColor = this.#color; - this.addCommands({ - cmd: () => { - this.#color = this.editorDiv.style.color = color; - }, - undo: () => { - this.#color = this.editorDiv.style.color = savedColor; - }, - mustExec: true, - type: _util.AnnotationEditorParamsType.FREETEXT_COLOR, - overwriteIfSameType: true, - keepUndo: true - }); - } - getInitialTranslation() { - const scale = this.parentScale; - return [-FreeTextEditor._internalPadding * scale, -(FreeTextEditor._internalPadding + this.#fontSize) * scale]; - } - rebuild() { - super.rebuild(); - if (this.div === null) { - return; - } - if (!this.isAttachedToDOM) { - this.parent.add(this); - } - } - enableEditMode() { - if (this.isInEditMode()) { - return; - } - this.parent.setEditingState(false); - this.parent.updateToolbar(_util.AnnotationEditorType.FREETEXT); - super.enableEditMode(); - this.overlayDiv.classList.remove("enabled"); - this.editorDiv.contentEditable = true; - this.div.draggable = false; - this.div.removeAttribute("aria-activedescendant"); - this.editorDiv.addEventListener("keydown", this.#boundEditorDivKeydown); - this.editorDiv.addEventListener("focus", this.#boundEditorDivFocus); - this.editorDiv.addEventListener("blur", this.#boundEditorDivBlur); - this.editorDiv.addEventListener("input", this.#boundEditorDivInput); - } - disableEditMode() { - if (!this.isInEditMode()) { - return; - } - this.parent.setEditingState(true); - super.disableEditMode(); - this.overlayDiv.classList.add("enabled"); - this.editorDiv.contentEditable = false; - this.div.setAttribute("aria-activedescendant", this.#editorDivId); - this.div.draggable = true; - this.editorDiv.removeEventListener("keydown", this.#boundEditorDivKeydown); - this.editorDiv.removeEventListener("focus", this.#boundEditorDivFocus); - this.editorDiv.removeEventListener("blur", this.#boundEditorDivBlur); - this.editorDiv.removeEventListener("input", this.#boundEditorDivInput); - this.div.focus({ - preventScroll: true - }); - this.isEditing = false; - this.parent.div.classList.add("freeTextEditing"); - } - focusin(event) { - super.focusin(event); - if (event.target !== this.editorDiv) { - this.editorDiv.focus(); - } - } - onceAdded() { - if (this.width) { - return; - } - this.enableEditMode(); - this.editorDiv.focus(); - } - isEmpty() { - return !this.editorDiv || this.editorDiv.innerText.trim() === ""; - } - remove() { - this.isEditing = false; - this.parent.setEditingState(true); - this.parent.div.classList.add("freeTextEditing"); - super.remove(); - } - #extractText() { - const divs = this.editorDiv.getElementsByTagName("div"); - if (divs.length === 0) { - return this.editorDiv.innerText; - } - const buffer = []; - for (const div of divs) { - buffer.push(div.innerText.replace(/\r\n?|\n/, "")); - } - return buffer.join("\n"); - } - #setEditorDimensions() { - const [parentWidth, parentHeight] = this.parentDimensions; - let rect; - if (this.isAttachedToDOM) { - rect = this.div.getBoundingClientRect(); - } else { - const { - currentLayer, - div - } = this; - const savedDisplay = div.style.display; - div.style.display = "hidden"; - currentLayer.div.append(this.div); - rect = div.getBoundingClientRect(); - div.remove(); - div.style.display = savedDisplay; - } - this.width = rect.width / parentWidth; - this.height = rect.height / parentHeight; - } - commit() { - if (!this.isInEditMode()) { - return; - } - super.commit(); - if (!this.#hasAlreadyBeenCommitted) { - this.#hasAlreadyBeenCommitted = true; - this.parent.addUndoableEditor(this); - } - this.disableEditMode(); - this.#content = this.#extractText().trimEnd(); - this.#setEditorDimensions(); - } - shouldGetKeyboardEvents() { - return this.isInEditMode(); - } - dblclick(event) { - this.enableEditMode(); - this.editorDiv.focus(); - } - keydown(event) { - if (event.target === this.div && event.key === "Enter") { - this.enableEditMode(); - this.editorDiv.focus(); - } - } - editorDivKeydown(event) { - FreeTextEditor._keyboardManager.exec(this, event); - } - editorDivFocus(event) { - this.isEditing = true; - } - editorDivBlur(event) { - this.isEditing = false; - } - editorDivInput(event) { - this.parent.div.classList.toggle("freeTextEditing", this.isEmpty()); - } - disableEditing() { - this.editorDiv.setAttribute("role", "comment"); - this.editorDiv.removeAttribute("aria-multiline"); - } - enableEditing() { - this.editorDiv.setAttribute("role", "textbox"); - this.editorDiv.setAttribute("aria-multiline", true); - } - render() { - if (this.div) { - return this.div; - } - let baseX, baseY; - if (this.width) { - baseX = this.x; - baseY = this.y; - } - super.render(); - this.editorDiv = document.createElement("div"); - this.editorDiv.className = "internal"; - this.editorDiv.setAttribute("id", this.#editorDivId); - this.enableEditing(); - FreeTextEditor._l10nPromise.get("editor_free_text2_aria_label").then(msg => this.editorDiv?.setAttribute("aria-label", msg)); - FreeTextEditor._l10nPromise.get("free_text2_default_content").then(msg => this.editorDiv?.setAttribute("default-content", msg)); - this.editorDiv.contentEditable = true; - const { - style - } = this.editorDiv; - style.fontSize = `calc(${this.#fontSize}px * var(--scale-factor))`; - style.color = this.#color; - this.div.append(this.editorDiv); - this.overlayDiv = document.createElement("div"); - this.overlayDiv.classList.add("overlay", "enabled"); - this.div.append(this.overlayDiv); - (0, _tools.bindEvents)(this, this.div, ["dblclick", "keydown"]); - if (this.width) { - const [parentWidth, parentHeight] = this.parentDimensions; - this.setAt(baseX * parentWidth, baseY * parentHeight, this.width * parentWidth, this.height * parentHeight); - for (const line of this.#content.split("\n")) { - const div = document.createElement("div"); - div.append(line ? document.createTextNode(line) : document.createElement("br")); - this.editorDiv.append(div); - } - this.div.draggable = true; - this.editorDiv.contentEditable = false; - } else { - this.div.draggable = false; - this.editorDiv.contentEditable = true; - } - return this.div; - } - get contentDiv() { - return this.editorDiv; - } - static deserialize(data, parent, uiManager) { - const editor = super.deserialize(data, parent, uiManager); - editor.#fontSize = data.fontSize; - editor.#color = _util.Util.makeHexColor(...data.color); - editor.#content = data.value; - return editor; - } - serialize() { - if (this.isEmpty()) { - return null; - } - const padding = FreeTextEditor._internalPadding * this.parentScale; - const rect = this.getRect(padding, padding); - const color = _editor.AnnotationEditor._colorManager.convert(this.isAttachedToDOM ? getComputedStyle(this.editorDiv).color : this.#color); - return { - annotationType: _util.AnnotationEditorType.FREETEXT, - color, - fontSize: this.#fontSize, - value: this.#content, - pageIndex: this.pageIndex, - rect, - rotation: this.rotation - }; - } -} -exports.FreeTextEditor = FreeTextEditor; - -/***/ }), -/* 29 */ -/***/ ((__unused_webpack_module, exports, __w_pdfjs_require__) => { - - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.InkEditor = void 0; -Object.defineProperty(exports, "fitCurve", ({ - enumerable: true, - get: function () { - return _pdfjsFitCurve.fitCurve; - } -})); -var _util = __w_pdfjs_require__(1); -var _editor = __w_pdfjs_require__(4); -var _pdfjsFitCurve = __w_pdfjs_require__(30); -var _tools = __w_pdfjs_require__(5); -const RESIZER_SIZE = 16; -const TIME_TO_WAIT_BEFORE_FIXING_DIMS = 100; -class InkEditor extends _editor.AnnotationEditor { - #aspectRatio = 0; - #baseHeight = 0; - #baseWidth = 0; - #boundCanvasPointermove = this.canvasPointermove.bind(this); - #boundCanvasPointerleave = this.canvasPointerleave.bind(this); - #boundCanvasPointerup = this.canvasPointerup.bind(this); - #boundCanvasPointerdown = this.canvasPointerdown.bind(this); - #disableEditing = false; - #isCanvasInitialized = false; - #lastPoint = null; - #observer = null; - #realWidth = 0; - #realHeight = 0; - #requestFrameCallback = null; - static _defaultColor = null; - static _defaultOpacity = 1; - static _defaultThickness = 1; - static _l10nPromise; - static _type = "ink"; - constructor(params) { - super({ - ...params, - name: "inkEditor" - }); - this.color = params.color || null; - this.thickness = params.thickness || null; - this.opacity = params.opacity || null; - this.paths = []; - this.bezierPath2D = []; - this.currentPath = []; - this.scaleFactor = 1; - this.translationX = this.translationY = 0; - this.x = 0; - this.y = 0; - } - static initialize(l10n) { - this._l10nPromise = new Map(["editor_ink_canvas_aria_label", "editor_ink2_aria_label"].map(str => [str, l10n.get(str)])); - } - static updateDefaultParams(type, value) { - switch (type) { - case _util.AnnotationEditorParamsType.INK_THICKNESS: - InkEditor._defaultThickness = value; - break; - case _util.AnnotationEditorParamsType.INK_COLOR: - InkEditor._defaultColor = value; - break; - case _util.AnnotationEditorParamsType.INK_OPACITY: - InkEditor._defaultOpacity = value / 100; - break; - } - } - updateParams(type, value) { - switch (type) { - case _util.AnnotationEditorParamsType.INK_THICKNESS: - this.#updateThickness(value); - break; - case _util.AnnotationEditorParamsType.INK_COLOR: - this.#updateColor(value); - break; - case _util.AnnotationEditorParamsType.INK_OPACITY: - this.#updateOpacity(value); - break; - } - } - static get defaultPropertiesToUpdate() { - return [[_util.AnnotationEditorParamsType.INK_THICKNESS, InkEditor._defaultThickness], [_util.AnnotationEditorParamsType.INK_COLOR, InkEditor._defaultColor || _editor.AnnotationEditor._defaultLineColor], [_util.AnnotationEditorParamsType.INK_OPACITY, Math.round(InkEditor._defaultOpacity * 100)]]; - } - get propertiesToUpdate() { - return [[_util.AnnotationEditorParamsType.INK_THICKNESS, this.thickness || InkEditor._defaultThickness], [_util.AnnotationEditorParamsType.INK_COLOR, this.color || InkEditor._defaultColor || _editor.AnnotationEditor._defaultLineColor], [_util.AnnotationEditorParamsType.INK_OPACITY, Math.round(100 * (this.opacity ?? InkEditor._defaultOpacity))]]; - } - #updateThickness(thickness) { - const savedThickness = this.thickness; - this.addCommands({ - cmd: () => { - this.thickness = thickness; - this.#fitToContent(); - }, - undo: () => { - this.thickness = savedThickness; - this.#fitToContent(); - }, - mustExec: true, - type: _util.AnnotationEditorParamsType.INK_THICKNESS, - overwriteIfSameType: true, - keepUndo: true - }); - } - #updateColor(color) { - const savedColor = this.color; - this.addCommands({ - cmd: () => { - this.color = color; - this.#redraw(); - }, - undo: () => { - this.color = savedColor; - this.#redraw(); - }, - mustExec: true, - type: _util.AnnotationEditorParamsType.INK_COLOR, - overwriteIfSameType: true, - keepUndo: true - }); - } - #updateOpacity(opacity) { - opacity /= 100; - const savedOpacity = this.opacity; - this.addCommands({ - cmd: () => { - this.opacity = opacity; - this.#redraw(); - }, - undo: () => { - this.opacity = savedOpacity; - this.#redraw(); - }, - mustExec: true, - type: _util.AnnotationEditorParamsType.INK_OPACITY, - overwriteIfSameType: true, - keepUndo: true - }); - } - rebuild() { - super.rebuild(); - if (this.div === null) { - return; - } - if (!this.canvas) { - this.#createCanvas(); - this.#createObserver(); - } - if (!this.isAttachedToDOM) { - this.parent.add(this); - this.#setCanvasDims(); - } - this.#fitToContent(); - } - remove() { - if (this.canvas === null) { - return; - } - if (!this.isEmpty()) { - this.commit(); - } - this.canvas.width = this.canvas.height = 0; - this.canvas.remove(); - this.canvas = null; - this.#observer.disconnect(); - this.#observer = null; - super.remove(); - } - setParent(parent) { - if (!this.parent && parent) { - this._uiManager.removeShouldRescale(this); - } else if (this.parent && parent === null) { - this._uiManager.addShouldRescale(this); - } - super.setParent(parent); - } - onScaleChanging() { - const [parentWidth, parentHeight] = this.parentDimensions; - const width = this.width * parentWidth; - const height = this.height * parentHeight; - this.setDimensions(width, height); - } - enableEditMode() { - if (this.#disableEditing || this.canvas === null) { - return; - } - super.enableEditMode(); - this.div.draggable = false; - this.canvas.addEventListener("pointerdown", this.#boundCanvasPointerdown); - this.canvas.addEventListener("pointerup", this.#boundCanvasPointerup); - } - disableEditMode() { - if (!this.isInEditMode() || this.canvas === null) { - return; - } - super.disableEditMode(); - this.div.draggable = !this.isEmpty(); - this.div.classList.remove("editing"); - this.canvas.removeEventListener("pointerdown", this.#boundCanvasPointerdown); - this.canvas.removeEventListener("pointerup", this.#boundCanvasPointerup); - } - onceAdded() { - this.div.draggable = !this.isEmpty(); - } - isEmpty() { - return this.paths.length === 0 || this.paths.length === 1 && this.paths[0].length === 0; - } - #getInitialBBox() { - const { - parentRotation, - parentDimensions: [width, height] - } = this; - switch (parentRotation) { - case 90: - return [0, height, height, width]; - case 180: - return [width, height, width, height]; - case 270: - return [width, 0, height, width]; - default: - return [0, 0, width, height]; - } - } - #setStroke() { - const { - ctx, - color, - opacity, - thickness, - parentScale, - scaleFactor - } = this; - ctx.lineWidth = thickness * parentScale / scaleFactor; - ctx.lineCap = "round"; - ctx.lineJoin = "round"; - ctx.miterLimit = 10; - ctx.strokeStyle = `${color}${(0, _tools.opacityToHex)(opacity)}`; - } - #startDrawing(x, y) { - this.isEditing = true; - if (!this.#isCanvasInitialized) { - this.#isCanvasInitialized = true; - this.#setCanvasDims(); - this.thickness ||= InkEditor._defaultThickness; - this.color ||= InkEditor._defaultColor || _editor.AnnotationEditor._defaultLineColor; - this.opacity ??= InkEditor._defaultOpacity; - } - this.currentPath.push([x, y]); - this.#lastPoint = null; - this.#setStroke(); - this.ctx.beginPath(); - this.ctx.moveTo(x, y); - this.#requestFrameCallback = () => { - if (!this.#requestFrameCallback) { - return; - } - if (this.#lastPoint) { - if (this.isEmpty()) { - this.ctx.setTransform(1, 0, 0, 1, 0, 0); - this.ctx.clearRect(0, 0, this.canvas.width, this.canvas.height); - } else { - this.#redraw(); - } - this.ctx.lineTo(...this.#lastPoint); - this.#lastPoint = null; - this.ctx.stroke(); - } - window.requestAnimationFrame(this.#requestFrameCallback); - }; - window.requestAnimationFrame(this.#requestFrameCallback); - } - #draw(x, y) { - const [lastX, lastY] = this.currentPath.at(-1); - if (x === lastX && y === lastY) { - return; - } - this.currentPath.push([x, y]); - this.#lastPoint = [x, y]; - } - #stopDrawing(x, y) { - this.ctx.closePath(); - this.#requestFrameCallback = null; - x = Math.min(Math.max(x, 0), this.canvas.width); - y = Math.min(Math.max(y, 0), this.canvas.height); - const [lastX, lastY] = this.currentPath.at(-1); - if (x !== lastX || y !== lastY) { - this.currentPath.push([x, y]); - } - let bezier; - if (this.currentPath.length !== 1) { - bezier = (0, _pdfjsFitCurve.fitCurve)(this.currentPath, 30, null); - } else { - const xy = [x, y]; - bezier = [[xy, xy.slice(), xy.slice(), xy]]; - } - const path2D = InkEditor.#buildPath2D(bezier); - this.currentPath.length = 0; - const cmd = () => { - this.paths.push(bezier); - this.bezierPath2D.push(path2D); - this.rebuild(); - }; - const undo = () => { - this.paths.pop(); - this.bezierPath2D.pop(); - if (this.paths.length === 0) { - this.remove(); - } else { - if (!this.canvas) { - this.#createCanvas(); - this.#createObserver(); - } - this.#fitToContent(); - } - }; - this.addCommands({ - cmd, - undo, - mustExec: true - }); - } - #redraw() { - if (this.isEmpty()) { - this.#updateTransform(); - return; - } - this.#setStroke(); - const { - canvas, - ctx - } = this; - ctx.setTransform(1, 0, 0, 1, 0, 0); - ctx.clearRect(0, 0, canvas.width, canvas.height); - this.#updateTransform(); - for (const path of this.bezierPath2D) { - ctx.stroke(path); - } - } - commit() { - if (this.#disableEditing) { - return; - } - super.commit(); - this.isEditing = false; - this.disableEditMode(); - this.setInForeground(); - this.#disableEditing = true; - this.div.classList.add("disabled"); - this.#fitToContent(true); - this.parent.addInkEditorIfNeeded(true); - this.parent.moveEditorInDOM(this); - this.div.focus({ - preventScroll: true - }); - } - focusin(event) { - super.focusin(event); - this.enableEditMode(); - } - canvasPointerdown(event) { - if (event.button !== 0 || !this.isInEditMode() || this.#disableEditing) { - return; - } - this.setInForeground(); - if (event.type !== "mouse") { - this.div.focus(); - } - event.stopPropagation(); - this.canvas.addEventListener("pointerleave", this.#boundCanvasPointerleave); - this.canvas.addEventListener("pointermove", this.#boundCanvasPointermove); - this.#startDrawing(event.offsetX, event.offsetY); - } - canvasPointermove(event) { - event.stopPropagation(); - this.#draw(event.offsetX, event.offsetY); - } - canvasPointerup(event) { - if (event.button !== 0) { - return; - } - if (this.isInEditMode() && this.currentPath.length !== 0) { - event.stopPropagation(); - this.#endDrawing(event); - this.setInBackground(); - } - } - canvasPointerleave(event) { - this.#endDrawing(event); - this.setInBackground(); - } - #endDrawing(event) { - this.#stopDrawing(event.offsetX, event.offsetY); - this.canvas.removeEventListener("pointerleave", this.#boundCanvasPointerleave); - this.canvas.removeEventListener("pointermove", this.#boundCanvasPointermove); - this.addToAnnotationStorage(); - } - #createCanvas() { - this.canvas = document.createElement("canvas"); - this.canvas.width = this.canvas.height = 0; - this.canvas.className = "inkEditorCanvas"; - InkEditor._l10nPromise.get("editor_ink_canvas_aria_label").then(msg => this.canvas?.setAttribute("aria-label", msg)); - this.div.append(this.canvas); - this.ctx = this.canvas.getContext("2d"); - } - #createObserver() { - let timeoutId = null; - this.#observer = new ResizeObserver(entries => { - const rect = entries[0].contentRect; - if (rect.width && rect.height) { - if (timeoutId !== null) { - clearTimeout(timeoutId); - } - timeoutId = setTimeout(() => { - this.fixDims(); - timeoutId = null; - }, TIME_TO_WAIT_BEFORE_FIXING_DIMS); - this.setDimensions(rect.width, rect.height); - } - }); - this.#observer.observe(this.div); - } - render() { - if (this.div) { - return this.div; - } - let baseX, baseY; - if (this.width) { - baseX = this.x; - baseY = this.y; - } - super.render(); - InkEditor._l10nPromise.get("editor_ink2_aria_label").then(msg => this.div?.setAttribute("aria-label", msg)); - const [x, y, w, h] = this.#getInitialBBox(); - this.setAt(x, y, 0, 0); - this.setDims(w, h); - this.#createCanvas(); - if (this.width) { - const [parentWidth, parentHeight] = this.parentDimensions; - this.setAt(baseX * parentWidth, baseY * parentHeight, this.width * parentWidth, this.height * parentHeight); - this.#isCanvasInitialized = true; - this.#setCanvasDims(); - this.setDims(this.width * parentWidth, this.height * parentHeight); - this.#redraw(); - this.#setMinDims(); - this.div.classList.add("disabled"); - } else { - this.div.classList.add("editing"); - this.enableEditMode(); - } - this.#createObserver(); - return this.div; - } - #setCanvasDims() { - if (!this.#isCanvasInitialized) { - return; - } - const [parentWidth, parentHeight] = this.parentDimensions; - this.canvas.width = Math.ceil(this.width * parentWidth); - this.canvas.height = Math.ceil(this.height * parentHeight); - this.#updateTransform(); - } - setDimensions(width, height) { - const roundedWidth = Math.round(width); - const roundedHeight = Math.round(height); - if (this.#realWidth === roundedWidth && this.#realHeight === roundedHeight) { - return; - } - this.#realWidth = roundedWidth; - this.#realHeight = roundedHeight; - this.canvas.style.visibility = "hidden"; - if (this.#aspectRatio && Math.abs(this.#aspectRatio - width / height) > 1e-2) { - height = Math.ceil(width / this.#aspectRatio); - this.setDims(width, height); - } - const [parentWidth, parentHeight] = this.parentDimensions; - this.width = width / parentWidth; - this.height = height / parentHeight; - if (this.#disableEditing) { - this.#setScaleFactor(width, height); - } - this.#setCanvasDims(); - this.#redraw(); - this.canvas.style.visibility = "visible"; - } - #setScaleFactor(width, height) { - const padding = this.#getPadding(); - const scaleFactorW = (width - padding) / this.#baseWidth; - const scaleFactorH = (height - padding) / this.#baseHeight; - this.scaleFactor = Math.min(scaleFactorW, scaleFactorH); - } - #updateTransform() { - const padding = this.#getPadding() / 2; - this.ctx.setTransform(this.scaleFactor, 0, 0, this.scaleFactor, this.translationX * this.scaleFactor + padding, this.translationY * this.scaleFactor + padding); - } - static #buildPath2D(bezier) { - const path2D = new Path2D(); - for (let i = 0, ii = bezier.length; i < ii; i++) { - const [first, control1, control2, second] = bezier[i]; - if (i === 0) { - path2D.moveTo(...first); - } - path2D.bezierCurveTo(control1[0], control1[1], control2[0], control2[1], second[0], second[1]); - } - return path2D; - } - #serializePaths(s, tx, ty, h) { - const NUMBER_OF_POINTS_ON_BEZIER_CURVE = 4; - const paths = []; - const padding = this.thickness / 2; - let buffer, points; - for (const bezier of this.paths) { - buffer = []; - points = []; - for (let i = 0, ii = bezier.length; i < ii; i++) { - const [first, control1, control2, second] = bezier[i]; - const p10 = s * (first[0] + tx) + padding; - const p11 = h - s * (first[1] + ty) - padding; - const p20 = s * (control1[0] + tx) + padding; - const p21 = h - s * (control1[1] + ty) - padding; - const p30 = s * (control2[0] + tx) + padding; - const p31 = h - s * (control2[1] + ty) - padding; - const p40 = s * (second[0] + tx) + padding; - const p41 = h - s * (second[1] + ty) - padding; - if (i === 0) { - buffer.push(p10, p11); - points.push(p10, p11); - } - buffer.push(p20, p21, p30, p31, p40, p41); - this.#extractPointsOnBezier(p10, p11, p20, p21, p30, p31, p40, p41, NUMBER_OF_POINTS_ON_BEZIER_CURVE, points); - } - paths.push({ - bezier: buffer, - points - }); - } - return paths; - } - #extractPointsOnBezier(p10, p11, p20, p21, p30, p31, p40, p41, n, points) { - if (this.#isAlmostFlat(p10, p11, p20, p21, p30, p31, p40, p41)) { - points.push(p40, p41); - return; - } - for (let i = 1; i < n - 1; i++) { - const t = i / n; - const mt = 1 - t; - let q10 = t * p10 + mt * p20; - let q11 = t * p11 + mt * p21; - let q20 = t * p20 + mt * p30; - let q21 = t * p21 + mt * p31; - const q30 = t * p30 + mt * p40; - const q31 = t * p31 + mt * p41; - q10 = t * q10 + mt * q20; - q11 = t * q11 + mt * q21; - q20 = t * q20 + mt * q30; - q21 = t * q21 + mt * q31; - q10 = t * q10 + mt * q20; - q11 = t * q11 + mt * q21; - points.push(q10, q11); - } - points.push(p40, p41); - } - #isAlmostFlat(p10, p11, p20, p21, p30, p31, p40, p41) { - const tol = 10; - const ax = (3 * p20 - 2 * p10 - p40) ** 2; - const ay = (3 * p21 - 2 * p11 - p41) ** 2; - const bx = (3 * p30 - p10 - 2 * p40) ** 2; - const by = (3 * p31 - p11 - 2 * p41) ** 2; - return Math.max(ax, bx) + Math.max(ay, by) <= tol; - } - #getBbox() { - let xMin = Infinity; - let xMax = -Infinity; - let yMin = Infinity; - let yMax = -Infinity; - for (const path of this.paths) { - for (const [first, control1, control2, second] of path) { - const bbox = _util.Util.bezierBoundingBox(...first, ...control1, ...control2, ...second); - xMin = Math.min(xMin, bbox[0]); - yMin = Math.min(yMin, bbox[1]); - xMax = Math.max(xMax, bbox[2]); - yMax = Math.max(yMax, bbox[3]); - } - } - return [xMin, yMin, xMax, yMax]; - } - #getPadding() { - return this.#disableEditing ? Math.ceil(this.thickness * this.parentScale) : 0; - } - #fitToContent(firstTime = false) { - if (this.isEmpty()) { - return; - } - if (!this.#disableEditing) { - this.#redraw(); - return; - } - const bbox = this.#getBbox(); - const padding = this.#getPadding(); - this.#baseWidth = Math.max(RESIZER_SIZE, bbox[2] - bbox[0]); - this.#baseHeight = Math.max(RESIZER_SIZE, bbox[3] - bbox[1]); - const width = Math.ceil(padding + this.#baseWidth * this.scaleFactor); - const height = Math.ceil(padding + this.#baseHeight * this.scaleFactor); - const [parentWidth, parentHeight] = this.parentDimensions; - this.width = width / parentWidth; - this.height = height / parentHeight; - this.#aspectRatio = width / height; - this.#setMinDims(); - const prevTranslationX = this.translationX; - const prevTranslationY = this.translationY; - this.translationX = -bbox[0]; - this.translationY = -bbox[1]; - this.#setCanvasDims(); - this.#redraw(); - this.#realWidth = width; - this.#realHeight = height; - this.setDims(width, height); - const unscaledPadding = firstTime ? padding / this.scaleFactor / 2 : 0; - this.translate(prevTranslationX - this.translationX - unscaledPadding, prevTranslationY - this.translationY - unscaledPadding); - } - #setMinDims() { - const { - style - } = this.div; - if (this.#aspectRatio >= 1) { - style.minHeight = `${RESIZER_SIZE}px`; - style.minWidth = `${Math.round(this.#aspectRatio * RESIZER_SIZE)}px`; - } else { - style.minWidth = `${RESIZER_SIZE}px`; - style.minHeight = `${Math.round(RESIZER_SIZE / this.#aspectRatio)}px`; - } - } - static deserialize(data, parent, uiManager) { - const editor = super.deserialize(data, parent, uiManager); - editor.thickness = data.thickness; - editor.color = _util.Util.makeHexColor(...data.color); - editor.opacity = data.opacity; - const [pageWidth, pageHeight] = editor.pageDimensions; - const width = editor.width * pageWidth; - const height = editor.height * pageHeight; - const scaleFactor = editor.parentScale; - const padding = data.thickness / 2; - editor.#aspectRatio = width / height; - editor.#disableEditing = true; - editor.#realWidth = Math.round(width); - editor.#realHeight = Math.round(height); - for (const { - bezier - } of data.paths) { - const path = []; - editor.paths.push(path); - let p0 = scaleFactor * (bezier[0] - padding); - let p1 = scaleFactor * (height - bezier[1] - padding); - for (let i = 2, ii = bezier.length; i < ii; i += 6) { - const p10 = scaleFactor * (bezier[i] - padding); - const p11 = scaleFactor * (height - bezier[i + 1] - padding); - const p20 = scaleFactor * (bezier[i + 2] - padding); - const p21 = scaleFactor * (height - bezier[i + 3] - padding); - const p30 = scaleFactor * (bezier[i + 4] - padding); - const p31 = scaleFactor * (height - bezier[i + 5] - padding); - path.push([[p0, p1], [p10, p11], [p20, p21], [p30, p31]]); - p0 = p30; - p1 = p31; - } - const path2D = this.#buildPath2D(path); - editor.bezierPath2D.push(path2D); - } - const bbox = editor.#getBbox(); - editor.#baseWidth = Math.max(RESIZER_SIZE, bbox[2] - bbox[0]); - editor.#baseHeight = Math.max(RESIZER_SIZE, bbox[3] - bbox[1]); - editor.#setScaleFactor(width, height); - return editor; - } - serialize() { - if (this.isEmpty()) { - return null; - } - const rect = this.getRect(0, 0); - const height = this.rotation % 180 === 0 ? rect[3] - rect[1] : rect[2] - rect[0]; - const color = _editor.AnnotationEditor._colorManager.convert(this.ctx.strokeStyle); - return { - annotationType: _util.AnnotationEditorType.INK, - color, - thickness: this.thickness, - opacity: this.opacity, - paths: this.#serializePaths(this.scaleFactor / this.parentScale, this.translationX, this.translationY, height), - pageIndex: this.pageIndex, - rect, - rotation: this.rotation - }; - } -} -exports.InkEditor = InkEditor; - -/***/ }), -/* 30 */ -/***/ ((__unused_webpack_module, exports, __w_pdfjs_require__) => { - - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.fitCurve = void 0; -const fitCurve = __w_pdfjs_require__(31); -exports.fitCurve = fitCurve; - -/***/ }), -/* 31 */ -/***/ ((module) => { - - - -function fitCurve(points, maxError, progressCallback) { - if (!Array.isArray(points)) { - throw new TypeError("First argument should be an array"); - } - points.forEach(point => { - if (!Array.isArray(point) || point.some(item => typeof item !== 'number') || point.length !== points[0].length) { - throw Error("Each point should be an array of numbers. Each point should have the same amount of numbers."); - } - }); - points = points.filter((point, i) => i === 0 || !point.every((val, j) => val === points[i - 1][j])); - if (points.length < 2) { - return []; - } - const len = points.length; - const leftTangent = createTangent(points[1], points[0]); - const rightTangent = createTangent(points[len - 2], points[len - 1]); - return fitCubic(points, leftTangent, rightTangent, maxError, progressCallback); -} -function fitCubic(points, leftTangent, rightTangent, error, progressCallback) { - const MaxIterations = 20; - var bezCurve, u, uPrime, maxError, prevErr, splitPoint, prevSplit, centerVector, toCenterTangent, fromCenterTangent, beziers, dist, i; - if (points.length === 2) { - dist = maths.vectorLen(maths.subtract(points[0], points[1])) / 3.0; - bezCurve = [points[0], maths.addArrays(points[0], maths.mulItems(leftTangent, dist)), maths.addArrays(points[1], maths.mulItems(rightTangent, dist)), points[1]]; - return [bezCurve]; - } - u = chordLengthParameterize(points); - [bezCurve, maxError, splitPoint] = generateAndReport(points, u, u, leftTangent, rightTangent, progressCallback); - if (maxError === 0 || maxError < error) { - return [bezCurve]; - } - if (maxError < error * error) { - uPrime = u; - prevErr = maxError; - prevSplit = splitPoint; - for (i = 0; i < MaxIterations; i++) { - uPrime = reparameterize(bezCurve, points, uPrime); - [bezCurve, maxError, splitPoint] = generateAndReport(points, u, uPrime, leftTangent, rightTangent, progressCallback); - if (maxError < error) { - return [bezCurve]; - } else if (splitPoint === prevSplit) { - let errChange = maxError / prevErr; - if (errChange > .9999 && errChange < 1.0001) { - break; - } - } - prevErr = maxError; - prevSplit = splitPoint; - } - } - beziers = []; - centerVector = maths.subtract(points[splitPoint - 1], points[splitPoint + 1]); - if (centerVector.every(val => val === 0)) { - centerVector = maths.subtract(points[splitPoint - 1], points[splitPoint]); - [centerVector[0], centerVector[1]] = [-centerVector[1], centerVector[0]]; - } - toCenterTangent = maths.normalize(centerVector); - fromCenterTangent = maths.mulItems(toCenterTangent, -1); - beziers = beziers.concat(fitCubic(points.slice(0, splitPoint + 1), leftTangent, toCenterTangent, error, progressCallback)); - beziers = beziers.concat(fitCubic(points.slice(splitPoint), fromCenterTangent, rightTangent, error, progressCallback)); - return beziers; -} -; -function generateAndReport(points, paramsOrig, paramsPrime, leftTangent, rightTangent, progressCallback) { - var bezCurve, maxError, splitPoint; - bezCurve = generateBezier(points, paramsPrime, leftTangent, rightTangent, progressCallback); - [maxError, splitPoint] = computeMaxError(points, bezCurve, paramsOrig); - if (progressCallback) { - progressCallback({ - bez: bezCurve, - points: points, - params: paramsOrig, - maxErr: maxError, - maxPoint: splitPoint - }); - } - return [bezCurve, maxError, splitPoint]; -} -function generateBezier(points, parameters, leftTangent, rightTangent) { - var bezCurve, - A, - a, - C, - X, - det_C0_C1, - det_C0_X, - det_X_C1, - alpha_l, - alpha_r, - epsilon, - segLength, - i, - len, - tmp, - u, - ux, - firstPoint = points[0], - lastPoint = points[points.length - 1]; - bezCurve = [firstPoint, null, null, lastPoint]; - A = maths.zeros_Xx2x2(parameters.length); - for (i = 0, len = parameters.length; i < len; i++) { - u = parameters[i]; - ux = 1 - u; - a = A[i]; - a[0] = maths.mulItems(leftTangent, 3 * u * (ux * ux)); - a[1] = maths.mulItems(rightTangent, 3 * ux * (u * u)); - } - C = [[0, 0], [0, 0]]; - X = [0, 0]; - for (i = 0, len = points.length; i < len; i++) { - u = parameters[i]; - a = A[i]; - C[0][0] += maths.dot(a[0], a[0]); - C[0][1] += maths.dot(a[0], a[1]); - C[1][0] += maths.dot(a[0], a[1]); - C[1][1] += maths.dot(a[1], a[1]); - tmp = maths.subtract(points[i], bezier.q([firstPoint, firstPoint, lastPoint, lastPoint], u)); - X[0] += maths.dot(a[0], tmp); - X[1] += maths.dot(a[1], tmp); - } - det_C0_C1 = C[0][0] * C[1][1] - C[1][0] * C[0][1]; - det_C0_X = C[0][0] * X[1] - C[1][0] * X[0]; - det_X_C1 = X[0] * C[1][1] - X[1] * C[0][1]; - alpha_l = det_C0_C1 === 0 ? 0 : det_X_C1 / det_C0_C1; - alpha_r = det_C0_C1 === 0 ? 0 : det_C0_X / det_C0_C1; - segLength = maths.vectorLen(maths.subtract(firstPoint, lastPoint)); - epsilon = 1.0e-6 * segLength; - if (alpha_l < epsilon || alpha_r < epsilon) { - bezCurve[1] = maths.addArrays(firstPoint, maths.mulItems(leftTangent, segLength / 3.0)); - bezCurve[2] = maths.addArrays(lastPoint, maths.mulItems(rightTangent, segLength / 3.0)); - } else { - bezCurve[1] = maths.addArrays(firstPoint, maths.mulItems(leftTangent, alpha_l)); - bezCurve[2] = maths.addArrays(lastPoint, maths.mulItems(rightTangent, alpha_r)); - } - return bezCurve; -} -; -function reparameterize(bezier, points, parameters) { - return parameters.map((p, i) => newtonRaphsonRootFind(bezier, points[i], p)); -} -; -function newtonRaphsonRootFind(bez, point, u) { - var d = maths.subtract(bezier.q(bez, u), point), - qprime = bezier.qprime(bez, u), - numerator = maths.mulMatrix(d, qprime), - denominator = maths.sum(maths.squareItems(qprime)) + 2 * maths.mulMatrix(d, bezier.qprimeprime(bez, u)); - if (denominator === 0) { - return u; - } else { - return u - numerator / denominator; - } -} -; -function chordLengthParameterize(points) { - var u = [], - currU, - prevU, - prevP; - points.forEach((p, i) => { - currU = i ? prevU + maths.vectorLen(maths.subtract(p, prevP)) : 0; - u.push(currU); - prevU = currU; - prevP = p; - }); - u = u.map(x => x / prevU); - return u; -} -; -function computeMaxError(points, bez, parameters) { - var dist, maxDist, splitPoint, v, i, count, point, t; - maxDist = 0; - splitPoint = Math.floor(points.length / 2); - const t_distMap = mapTtoRelativeDistances(bez, 10); - for (i = 0, count = points.length; i < count; i++) { - point = points[i]; - t = find_t(bez, parameters[i], t_distMap, 10); - v = maths.subtract(bezier.q(bez, t), point); - dist = v[0] * v[0] + v[1] * v[1]; - if (dist > maxDist) { - maxDist = dist; - splitPoint = i; - } - } - return [maxDist, splitPoint]; -} -; -var mapTtoRelativeDistances = function (bez, B_parts) { - var B_t_curr; - var B_t_dist = [0]; - var B_t_prev = bez[0]; - var sumLen = 0; - for (var i = 1; i <= B_parts; i++) { - B_t_curr = bezier.q(bez, i / B_parts); - sumLen += maths.vectorLen(maths.subtract(B_t_curr, B_t_prev)); - B_t_dist.push(sumLen); - B_t_prev = B_t_curr; - } - B_t_dist = B_t_dist.map(x => x / sumLen); - return B_t_dist; -}; -function find_t(bez, param, t_distMap, B_parts) { - if (param < 0) { - return 0; - } - if (param > 1) { - return 1; - } - var lenMax, lenMin, tMax, tMin, t; - for (var i = 1; i <= B_parts; i++) { - if (param <= t_distMap[i]) { - tMin = (i - 1) / B_parts; - tMax = i / B_parts; - lenMin = t_distMap[i - 1]; - lenMax = t_distMap[i]; - t = (param - lenMin) / (lenMax - lenMin) * (tMax - tMin) + tMin; - break; - } - } - return t; -} -function createTangent(pointA, pointB) { - return maths.normalize(maths.subtract(pointA, pointB)); -} -class maths { - static zeros_Xx2x2(x) { - var zs = []; - while (x--) { - zs.push([0, 0]); - } - return zs; - } - static mulItems(items, multiplier) { - return items.map(x => x * multiplier); - } - static mulMatrix(m1, m2) { - return m1.reduce((sum, x1, i) => sum + x1 * m2[i], 0); - } - static subtract(arr1, arr2) { - return arr1.map((x1, i) => x1 - arr2[i]); - } - static addArrays(arr1, arr2) { - return arr1.map((x1, i) => x1 + arr2[i]); - } - static addItems(items, addition) { - return items.map(x => x + addition); - } - static sum(items) { - return items.reduce((sum, x) => sum + x); - } - static dot(m1, m2) { - return maths.mulMatrix(m1, m2); - } - static vectorLen(v) { - return Math.hypot(...v); - } - static divItems(items, divisor) { - return items.map(x => x / divisor); - } - static squareItems(items) { - return items.map(x => x * x); - } - static normalize(v) { - return this.divItems(v, this.vectorLen(v)); - } -} -class bezier { - static q(ctrlPoly, t) { - var tx = 1.0 - t; - var pA = maths.mulItems(ctrlPoly[0], tx * tx * tx), - pB = maths.mulItems(ctrlPoly[1], 3 * tx * tx * t), - pC = maths.mulItems(ctrlPoly[2], 3 * tx * t * t), - pD = maths.mulItems(ctrlPoly[3], t * t * t); - return maths.addArrays(maths.addArrays(pA, pB), maths.addArrays(pC, pD)); - } - static qprime(ctrlPoly, t) { - var tx = 1.0 - t; - var pA = maths.mulItems(maths.subtract(ctrlPoly[1], ctrlPoly[0]), 3 * tx * tx), - pB = maths.mulItems(maths.subtract(ctrlPoly[2], ctrlPoly[1]), 6 * tx * t), - pC = maths.mulItems(maths.subtract(ctrlPoly[3], ctrlPoly[2]), 3 * t * t); - return maths.addArrays(maths.addArrays(pA, pB), pC); - } - static qprimeprime(ctrlPoly, t) { - return maths.addArrays(maths.mulItems(maths.addArrays(maths.subtract(ctrlPoly[2], maths.mulItems(ctrlPoly[1], 2)), ctrlPoly[0]), 6 * (1.0 - t)), maths.mulItems(maths.addArrays(maths.subtract(ctrlPoly[3], maths.mulItems(ctrlPoly[2], 2)), ctrlPoly[1]), 6 * t)); - } -} -module.exports = fitCurve; -module.exports.fitCubic = fitCubic; -module.exports.createTangent = createTangent; - -/***/ }), -/* 32 */ -/***/ ((__unused_webpack_module, exports, __w_pdfjs_require__) => { - - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.AnnotationLayer = void 0; -var _util = __w_pdfjs_require__(1); -var _display_utils = __w_pdfjs_require__(6); -var _annotation_storage = __w_pdfjs_require__(3); -var _scripting_utils = __w_pdfjs_require__(33); -var _xfa_layer = __w_pdfjs_require__(34); -const DEFAULT_TAB_INDEX = 1000; -const DEFAULT_FONT_SIZE = 9; -const GetElementsByNameSet = new WeakSet(); -function getRectDims(rect) { - return { - width: rect[2] - rect[0], - height: rect[3] - rect[1] - }; -} -class AnnotationElementFactory { - static create(parameters) { - const subtype = parameters.data.annotationType; - switch (subtype) { - case _util.AnnotationType.LINK: - return new LinkAnnotationElement(parameters); - case _util.AnnotationType.TEXT: - return new TextAnnotationElement(parameters); - case _util.AnnotationType.WIDGET: - const fieldType = parameters.data.fieldType; - switch (fieldType) { - case "Tx": - return new TextWidgetAnnotationElement(parameters); - case "Btn": - if (parameters.data.radioButton) { - return new RadioButtonWidgetAnnotationElement(parameters); - } else if (parameters.data.checkBox) { - return new CheckboxWidgetAnnotationElement(parameters); - } - return new PushButtonWidgetAnnotationElement(parameters); - case "Ch": - return new ChoiceWidgetAnnotationElement(parameters); - } - return new WidgetAnnotationElement(parameters); - case _util.AnnotationType.POPUP: - return new PopupAnnotationElement(parameters); - case _util.AnnotationType.FREETEXT: - return new FreeTextAnnotationElement(parameters); - case _util.AnnotationType.LINE: - return new LineAnnotationElement(parameters); - case _util.AnnotationType.SQUARE: - return new SquareAnnotationElement(parameters); - case _util.AnnotationType.CIRCLE: - return new CircleAnnotationElement(parameters); - case _util.AnnotationType.POLYLINE: - return new PolylineAnnotationElement(parameters); - case _util.AnnotationType.CARET: - return new CaretAnnotationElement(parameters); - case _util.AnnotationType.INK: - return new InkAnnotationElement(parameters); - case _util.AnnotationType.POLYGON: - return new PolygonAnnotationElement(parameters); - case _util.AnnotationType.HIGHLIGHT: - return new HighlightAnnotationElement(parameters); - case _util.AnnotationType.UNDERLINE: - return new UnderlineAnnotationElement(parameters); - case _util.AnnotationType.SQUIGGLY: - return new SquigglyAnnotationElement(parameters); - case _util.AnnotationType.STRIKEOUT: - return new StrikeOutAnnotationElement(parameters); - case _util.AnnotationType.STAMP: - return new StampAnnotationElement(parameters); - case _util.AnnotationType.FILEATTACHMENT: - return new FileAttachmentAnnotationElement(parameters); - default: - return new AnnotationElement(parameters); - } - } -} -class AnnotationElement { - constructor(parameters, { - isRenderable = false, - ignoreBorder = false, - createQuadrilaterals = false - } = {}) { - this.isRenderable = isRenderable; - this.data = parameters.data; - this.layer = parameters.layer; - this.page = parameters.page; - this.viewport = parameters.viewport; - this.linkService = parameters.linkService; - this.downloadManager = parameters.downloadManager; - this.imageResourcesPath = parameters.imageResourcesPath; - this.renderForms = parameters.renderForms; - this.svgFactory = parameters.svgFactory; - this.annotationStorage = parameters.annotationStorage; - this.enableScripting = parameters.enableScripting; - this.hasJSActions = parameters.hasJSActions; - this._fieldObjects = parameters.fieldObjects; - if (isRenderable) { - this.container = this._createContainer(ignoreBorder); - } - if (createQuadrilaterals) { - this.quadrilaterals = this._createQuadrilaterals(ignoreBorder); - } - } - _createContainer(ignoreBorder = false) { - const { - data, - page, - viewport - } = this; - const container = document.createElement("section"); - container.setAttribute("data-annotation-id", data.id); - const { - pageWidth, - pageHeight, - pageX, - pageY - } = viewport.rawDims; - const { - width, - height - } = getRectDims(data.rect); - const rect = _util.Util.normalizeRect([data.rect[0], page.view[3] - data.rect[1] + page.view[1], data.rect[2], page.view[3] - data.rect[3] + page.view[1]]); - if (!ignoreBorder && data.borderStyle.width > 0) { - container.style.borderWidth = `${data.borderStyle.width}px`; - const horizontalRadius = data.borderStyle.horizontalCornerRadius; - const verticalRadius = data.borderStyle.verticalCornerRadius; - if (horizontalRadius > 0 || verticalRadius > 0) { - const radius = `calc(${horizontalRadius}px * var(--scale-factor)) / calc(${verticalRadius}px * var(--scale-factor))`; - container.style.borderRadius = radius; - } else if (this instanceof RadioButtonWidgetAnnotationElement) { - const radius = `calc(${width}px * var(--scale-factor)) / calc(${height}px * var(--scale-factor))`; - container.style.borderRadius = radius; - } - switch (data.borderStyle.style) { - case _util.AnnotationBorderStyleType.SOLID: - container.style.borderStyle = "solid"; - break; - case _util.AnnotationBorderStyleType.DASHED: - container.style.borderStyle = "dashed"; - break; - case _util.AnnotationBorderStyleType.BEVELED: - (0, _util.warn)("Unimplemented border style: beveled"); - break; - case _util.AnnotationBorderStyleType.INSET: - (0, _util.warn)("Unimplemented border style: inset"); - break; - case _util.AnnotationBorderStyleType.UNDERLINE: - container.style.borderBottomStyle = "solid"; - break; - default: - break; - } - const borderColor = data.borderColor || null; - if (borderColor) { - container.style.borderColor = _util.Util.makeHexColor(borderColor[0] | 0, borderColor[1] | 0, borderColor[2] | 0); - } else { - container.style.borderWidth = 0; - } - } - container.style.left = `${100 * (rect[0] - pageX) / pageWidth}%`; - container.style.top = `${100 * (rect[1] - pageY) / pageHeight}%`; - const { - rotation - } = data; - if (data.hasOwnCanvas || rotation === 0) { - container.style.width = `${100 * width / pageWidth}%`; - container.style.height = `${100 * height / pageHeight}%`; - } else { - this.setRotation(rotation, container); - } - return container; - } - setRotation(angle, container = this.container) { - const { - pageWidth, - pageHeight - } = this.viewport.rawDims; - const { - width, - height - } = getRectDims(this.data.rect); - let elementWidth, elementHeight; - if (angle % 180 === 0) { - elementWidth = 100 * width / pageWidth; - elementHeight = 100 * height / pageHeight; - } else { - elementWidth = 100 * height / pageWidth; - elementHeight = 100 * width / pageHeight; - } - container.style.width = `${elementWidth}%`; - container.style.height = `${elementHeight}%`; - container.setAttribute("data-main-rotation", (360 - angle) % 360); - } - get _commonActions() { - const setColor = (jsName, styleName, event) => { - const color = event.detail[jsName]; - event.target.style[styleName] = _scripting_utils.ColorConverters[`${color[0]}_HTML`](color.slice(1)); - }; - return (0, _util.shadow)(this, "_commonActions", { - display: event => { - const hidden = event.detail.display % 2 === 1; - this.container.style.visibility = hidden ? "hidden" : "visible"; - this.annotationStorage.setValue(this.data.id, { - hidden, - print: event.detail.display === 0 || event.detail.display === 3 - }); - }, - print: event => { - this.annotationStorage.setValue(this.data.id, { - print: event.detail.print - }); - }, - hidden: event => { - this.container.style.visibility = event.detail.hidden ? "hidden" : "visible"; - this.annotationStorage.setValue(this.data.id, { - hidden: event.detail.hidden - }); - }, - focus: event => { - setTimeout(() => event.target.focus({ - preventScroll: false - }), 0); - }, - userName: event => { - event.target.title = event.detail.userName; - }, - readonly: event => { - if (event.detail.readonly) { - event.target.setAttribute("readonly", ""); - } else { - event.target.removeAttribute("readonly"); - } - }, - required: event => { - this._setRequired(event.target, event.detail.required); - }, - bgColor: event => { - setColor("bgColor", "backgroundColor", event); - }, - fillColor: event => { - setColor("fillColor", "backgroundColor", event); - }, - fgColor: event => { - setColor("fgColor", "color", event); - }, - textColor: event => { - setColor("textColor", "color", event); - }, - borderColor: event => { - setColor("borderColor", "borderColor", event); - }, - strokeColor: event => { - setColor("strokeColor", "borderColor", event); - }, - rotation: event => { - const angle = event.detail.rotation; - this.setRotation(angle); - this.annotationStorage.setValue(this.data.id, { - rotation: angle - }); - } - }); - } - _dispatchEventFromSandbox(actions, jsEvent) { - const commonActions = this._commonActions; - for (const name of Object.keys(jsEvent.detail)) { - const action = actions[name] || commonActions[name]; - action?.(jsEvent); - } - } - _setDefaultPropertiesFromJS(element) { - if (!this.enableScripting) { - return; - } - const storedData = this.annotationStorage.getRawValue(this.data.id); - if (!storedData) { - return; - } - const commonActions = this._commonActions; - for (const [actionName, detail] of Object.entries(storedData)) { - const action = commonActions[actionName]; - if (action) { - const eventProxy = { - detail: { - [actionName]: detail - }, - target: element - }; - action(eventProxy); - delete storedData[actionName]; - } - } - } - _createQuadrilaterals(ignoreBorder = false) { - if (!this.data.quadPoints) { - return null; - } - const quadrilaterals = []; - const savedRect = this.data.rect; - for (const quadPoint of this.data.quadPoints) { - this.data.rect = [quadPoint[2].x, quadPoint[2].y, quadPoint[1].x, quadPoint[1].y]; - quadrilaterals.push(this._createContainer(ignoreBorder)); - } - this.data.rect = savedRect; - return quadrilaterals; - } - _createPopup(trigger, data) { - let container = this.container; - if (this.quadrilaterals) { - trigger = trigger || this.quadrilaterals; - container = this.quadrilaterals[0]; - } - if (!trigger) { - trigger = document.createElement("div"); - trigger.className = "popupTriggerArea"; - container.append(trigger); - } - const popupElement = new PopupElement({ - container, - trigger, - color: data.color, - titleObj: data.titleObj, - modificationDate: data.modificationDate, - contentsObj: data.contentsObj, - richText: data.richText, - hideWrapper: true - }); - const popup = popupElement.render(); - popup.style.left = "100%"; - container.append(popup); - } - _renderQuadrilaterals(className) { - for (const quadrilateral of this.quadrilaterals) { - quadrilateral.className = className; - } - return this.quadrilaterals; - } - render() { - (0, _util.unreachable)("Abstract method `AnnotationElement.render` called"); - } - _getElementsByName(name, skipId = null) { - const fields = []; - if (this._fieldObjects) { - const fieldObj = this._fieldObjects[name]; - if (fieldObj) { - for (const { - page, - id, - exportValues - } of fieldObj) { - if (page === -1) { - continue; - } - if (id === skipId) { - continue; - } - const exportValue = typeof exportValues === "string" ? exportValues : null; - const domElement = document.querySelector(`[data-element-id="${id}"]`); - if (domElement && !GetElementsByNameSet.has(domElement)) { - (0, _util.warn)(`_getElementsByName - element not allowed: ${id}`); - continue; - } - fields.push({ - id, - exportValue, - domElement - }); - } - } - return fields; - } - for (const domElement of document.getElementsByName(name)) { - const { - exportValue - } = domElement; - const id = domElement.getAttribute("data-element-id"); - if (id === skipId) { - continue; - } - if (!GetElementsByNameSet.has(domElement)) { - continue; - } - fields.push({ - id, - exportValue, - domElement - }); - } - return fields; - } -} -class LinkAnnotationElement extends AnnotationElement { - constructor(parameters, options = null) { - super(parameters, { - isRenderable: true, - ignoreBorder: !!options?.ignoreBorder, - createQuadrilaterals: true - }); - this.isTooltipOnly = parameters.data.isTooltipOnly; - } - render() { - const { - data, - linkService - } = this; - const link = document.createElement("a"); - link.setAttribute("data-element-id", data.id); - let isBound = false; - if (data.url) { - linkService.addLinkAttributes(link, data.url, data.newWindow); - isBound = true; - } else if (data.action) { - this._bindNamedAction(link, data.action); - isBound = true; - } else if (data.attachment) { - this._bindAttachment(link, data.attachment); - isBound = true; - } else if (data.setOCGState) { - this.#bindSetOCGState(link, data.setOCGState); - isBound = true; - } else if (data.dest) { - this._bindLink(link, data.dest); - isBound = true; - } else { - if (data.actions && (data.actions.Action || data.actions["Mouse Up"] || data.actions["Mouse Down"]) && this.enableScripting && this.hasJSActions) { - this._bindJSAction(link, data); - isBound = true; - } - if (data.resetForm) { - this._bindResetFormAction(link, data.resetForm); - isBound = true; - } else if (this.isTooltipOnly && !isBound) { - this._bindLink(link, ""); - isBound = true; - } - } - if (this.quadrilaterals) { - return this._renderQuadrilaterals("linkAnnotation").map((quadrilateral, index) => { - const linkElement = index === 0 ? link : link.cloneNode(); - quadrilateral.append(linkElement); - return quadrilateral; - }); - } - this.container.className = "linkAnnotation"; - if (isBound) { - this.container.append(link); - } - return this.container; - } - #setInternalLink() { - this.container.setAttribute("data-internal-link", ""); - } - _bindLink(link, destination) { - link.href = this.linkService.getDestinationHash(destination); - link.onclick = () => { - if (destination) { - this.linkService.goToDestination(destination); - } - return false; - }; - if (destination || destination === "") { - this.#setInternalLink(); - } - } - _bindNamedAction(link, action) { - link.href = this.linkService.getAnchorUrl(""); - link.onclick = () => { - this.linkService.executeNamedAction(action); - return false; - }; - this.#setInternalLink(); - } - _bindAttachment(link, attachment) { - link.href = this.linkService.getAnchorUrl(""); - link.onclick = () => { - this.downloadManager?.openOrDownloadData(this.container, attachment.content, attachment.filename); - return false; - }; - this.#setInternalLink(); - } - #bindSetOCGState(link, action) { - link.href = this.linkService.getAnchorUrl(""); - link.onclick = () => { - this.linkService.executeSetOCGState(action); - return false; - }; - this.#setInternalLink(); - } - _bindJSAction(link, data) { - link.href = this.linkService.getAnchorUrl(""); - const map = new Map([["Action", "onclick"], ["Mouse Up", "onmouseup"], ["Mouse Down", "onmousedown"]]); - for (const name of Object.keys(data.actions)) { - const jsName = map.get(name); - if (!jsName) { - continue; - } - link[jsName] = () => { - this.linkService.eventBus?.dispatch("dispatcheventinsandbox", { - source: this, - detail: { - id: data.id, - name - } - }); - return false; - }; - } - if (!link.onclick) { - link.onclick = () => false; - } - this.#setInternalLink(); - } - _bindResetFormAction(link, resetForm) { - const otherClickAction = link.onclick; - if (!otherClickAction) { - link.href = this.linkService.getAnchorUrl(""); - } - this.#setInternalLink(); - if (!this._fieldObjects) { - (0, _util.warn)(`_bindResetFormAction - "resetForm" action not supported, ` + "ensure that the `fieldObjects` parameter is provided."); - if (!otherClickAction) { - link.onclick = () => false; - } - return; - } - link.onclick = () => { - otherClickAction?.(); - const { - fields: resetFormFields, - refs: resetFormRefs, - include - } = resetForm; - const allFields = []; - if (resetFormFields.length !== 0 || resetFormRefs.length !== 0) { - const fieldIds = new Set(resetFormRefs); - for (const fieldName of resetFormFields) { - const fields = this._fieldObjects[fieldName] || []; - for (const { - id - } of fields) { - fieldIds.add(id); - } - } - for (const fields of Object.values(this._fieldObjects)) { - for (const field of fields) { - if (fieldIds.has(field.id) === include) { - allFields.push(field); - } - } - } - } else { - for (const fields of Object.values(this._fieldObjects)) { - allFields.push(...fields); - } - } - const storage = this.annotationStorage; - const allIds = []; - for (const field of allFields) { - const { - id - } = field; - allIds.push(id); - switch (field.type) { - case "text": - { - const value = field.defaultValue || ""; - storage.setValue(id, { - value - }); - break; - } - case "checkbox": - case "radiobutton": - { - const value = field.defaultValue === field.exportValues; - storage.setValue(id, { - value - }); - break; - } - case "combobox": - case "listbox": - { - const value = field.defaultValue || ""; - storage.setValue(id, { - value - }); - break; - } - default: - continue; - } - const domElement = document.querySelector(`[data-element-id="${id}"]`); - if (!domElement) { - continue; - } else if (!GetElementsByNameSet.has(domElement)) { - (0, _util.warn)(`_bindResetFormAction - element not allowed: ${id}`); - continue; - } - domElement.dispatchEvent(new Event("resetform")); - } - if (this.enableScripting) { - this.linkService.eventBus?.dispatch("dispatcheventinsandbox", { - source: this, - detail: { - id: "app", - ids: allIds, - name: "ResetForm" - } - }); - } - return false; - }; - } -} -class TextAnnotationElement extends AnnotationElement { - constructor(parameters) { - const isRenderable = !!(parameters.data.hasPopup || parameters.data.titleObj?.str || parameters.data.contentsObj?.str || parameters.data.richText?.str); - super(parameters, { - isRenderable - }); - } - render() { - this.container.className = "textAnnotation"; - const image = document.createElement("img"); - image.src = this.imageResourcesPath + "annotation-" + this.data.name.toLowerCase() + ".svg"; - image.alt = "[{{type}} Annotation]"; - image.dataset.l10nId = "text_annotation_type"; - image.dataset.l10nArgs = JSON.stringify({ - type: this.data.name - }); - if (!this.data.hasPopup) { - this._createPopup(image, this.data); - } - this.container.append(image); - return this.container; - } -} -class WidgetAnnotationElement extends AnnotationElement { - render() { - if (this.data.alternativeText) { - this.container.title = this.data.alternativeText; - } - return this.container; - } - _getKeyModifier(event) { - const { - isWin, - isMac - } = _util.FeatureTest.platform; - return isWin && event.ctrlKey || isMac && event.metaKey; - } - _setEventListener(element, baseName, eventName, valueGetter) { - if (baseName.includes("mouse")) { - element.addEventListener(baseName, event => { - this.linkService.eventBus?.dispatch("dispatcheventinsandbox", { - source: this, - detail: { - id: this.data.id, - name: eventName, - value: valueGetter(event), - shift: event.shiftKey, - modifier: this._getKeyModifier(event) - } - }); - }); - } else { - element.addEventListener(baseName, event => { - this.linkService.eventBus?.dispatch("dispatcheventinsandbox", { - source: this, - detail: { - id: this.data.id, - name: eventName, - value: valueGetter(event) - } - }); - }); - } - } - _setEventListeners(element, names, getter) { - for (const [baseName, eventName] of names) { - if (eventName === "Action" || this.data.actions?.[eventName]) { - this._setEventListener(element, baseName, eventName, getter); - } - } - } - _setBackgroundColor(element) { - const color = this.data.backgroundColor || null; - element.style.backgroundColor = color === null ? "transparent" : _util.Util.makeHexColor(color[0], color[1], color[2]); - } - _setTextStyle(element) { - const TEXT_ALIGNMENT = ["left", "center", "right"]; - const { - fontColor - } = this.data.defaultAppearanceData; - const fontSize = this.data.defaultAppearanceData.fontSize || DEFAULT_FONT_SIZE; - const style = element.style; - let computedFontSize; - const BORDER_SIZE = 2; - const roundToOneDecimal = x => Math.round(10 * x) / 10; - if (this.data.multiLine) { - const height = Math.abs(this.data.rect[3] - this.data.rect[1] - BORDER_SIZE); - const numberOfLines = Math.round(height / (_util.LINE_FACTOR * fontSize)) || 1; - const lineHeight = height / numberOfLines; - computedFontSize = Math.min(fontSize, roundToOneDecimal(lineHeight / _util.LINE_FACTOR)); - } else { - const height = Math.abs(this.data.rect[3] - this.data.rect[1] - BORDER_SIZE); - computedFontSize = Math.min(fontSize, roundToOneDecimal(height / _util.LINE_FACTOR)); - } - style.fontSize = `calc(${computedFontSize}px * var(--scale-factor))`; - style.color = _util.Util.makeHexColor(fontColor[0], fontColor[1], fontColor[2]); - if (this.data.textAlignment !== null) { - style.textAlign = TEXT_ALIGNMENT[this.data.textAlignment]; - } - } - _setRequired(element, isRequired) { - if (isRequired) { - element.setAttribute("required", true); - } else { - element.removeAttribute("required"); - } - element.setAttribute("aria-required", isRequired); - } -} -class TextWidgetAnnotationElement extends WidgetAnnotationElement { - constructor(parameters) { - const isRenderable = parameters.renderForms || !parameters.data.hasAppearance && !!parameters.data.fieldValue; - super(parameters, { - isRenderable - }); - } - setPropertyOnSiblings(base, key, value, keyInStorage) { - const storage = this.annotationStorage; - for (const element of this._getElementsByName(base.name, base.id)) { - if (element.domElement) { - element.domElement[key] = value; - } - storage.setValue(element.id, { - [keyInStorage]: value - }); - } - } - render() { - const storage = this.annotationStorage; - const id = this.data.id; - this.container.className = "textWidgetAnnotation"; - let element = null; - if (this.renderForms) { - const storedData = storage.getValue(id, { - value: this.data.fieldValue - }); - let textContent = storedData.formattedValue || storedData.value || ""; - const maxLen = storage.getValue(id, { - charLimit: this.data.maxLen - }).charLimit; - if (maxLen && textContent.length > maxLen) { - textContent = textContent.slice(0, maxLen); - } - const elementData = { - userValue: textContent, - formattedValue: null, - lastCommittedValue: null, - commitKey: 1 - }; - if (this.data.multiLine) { - element = document.createElement("textarea"); - element.textContent = textContent; - if (this.data.doNotScroll) { - element.style.overflowY = "hidden"; - } - } else { - element = document.createElement("input"); - element.type = "text"; - element.setAttribute("value", textContent); - if (this.data.doNotScroll) { - element.style.overflowX = "hidden"; - } - } - GetElementsByNameSet.add(element); - element.setAttribute("data-element-id", id); - element.disabled = this.data.readOnly; - element.name = this.data.fieldName; - element.tabIndex = DEFAULT_TAB_INDEX; - this._setRequired(element, this.data.required); - if (maxLen) { - element.maxLength = maxLen; - } - element.addEventListener("input", event => { - storage.setValue(id, { - value: event.target.value - }); - this.setPropertyOnSiblings(element, "value", event.target.value, "value"); - }); - element.addEventListener("resetform", event => { - const defaultValue = this.data.defaultFieldValue ?? ""; - element.value = elementData.userValue = defaultValue; - elementData.formattedValue = null; - }); - let blurListener = event => { - const { - formattedValue - } = elementData; - if (formattedValue !== null && formattedValue !== undefined) { - event.target.value = formattedValue; - } - event.target.scrollLeft = 0; - }; - if (this.enableScripting && this.hasJSActions) { - element.addEventListener("focus", event => { - const { - target - } = event; - if (elementData.userValue) { - target.value = elementData.userValue; - } - elementData.lastCommittedValue = target.value; - elementData.commitKey = 1; - }); - element.addEventListener("updatefromsandbox", jsEvent => { - const actions = { - value(event) { - elementData.userValue = event.detail.value ?? ""; - storage.setValue(id, { - value: elementData.userValue.toString() - }); - event.target.value = elementData.userValue; - }, - formattedValue(event) { - const { - formattedValue - } = event.detail; - elementData.formattedValue = formattedValue; - if (formattedValue !== null && formattedValue !== undefined && event.target !== document.activeElement) { - event.target.value = formattedValue; - } - storage.setValue(id, { - formattedValue - }); - }, - selRange(event) { - event.target.setSelectionRange(...event.detail.selRange); - }, - charLimit: event => { - const { - charLimit - } = event.detail; - const { - target - } = event; - if (charLimit === 0) { - target.removeAttribute("maxLength"); - return; - } - target.setAttribute("maxLength", charLimit); - let value = elementData.userValue; - if (!value || value.length <= charLimit) { - return; - } - value = value.slice(0, charLimit); - target.value = elementData.userValue = value; - storage.setValue(id, { - value - }); - this.linkService.eventBus?.dispatch("dispatcheventinsandbox", { - source: this, - detail: { - id, - name: "Keystroke", - value, - willCommit: true, - commitKey: 1, - selStart: target.selectionStart, - selEnd: target.selectionEnd - } - }); - } - }; - this._dispatchEventFromSandbox(actions, jsEvent); - }); - element.addEventListener("keydown", event => { - elementData.commitKey = 1; - let commitKey = -1; - if (event.key === "Escape") { - commitKey = 0; - } else if (event.key === "Enter" && !this.data.multiLine) { - commitKey = 2; - } else if (event.key === "Tab") { - elementData.commitKey = 3; - } - if (commitKey === -1) { - return; - } - const { - value - } = event.target; - if (elementData.lastCommittedValue === value) { - return; - } - elementData.lastCommittedValue = value; - elementData.userValue = value; - this.linkService.eventBus?.dispatch("dispatcheventinsandbox", { - source: this, - detail: { - id, - name: "Keystroke", - value, - willCommit: true, - commitKey, - selStart: event.target.selectionStart, - selEnd: event.target.selectionEnd - } - }); - }); - const _blurListener = blurListener; - blurListener = null; - element.addEventListener("blur", event => { - if (!event.relatedTarget) { - return; - } - const { - value - } = event.target; - elementData.userValue = value; - if (elementData.lastCommittedValue !== value) { - this.linkService.eventBus?.dispatch("dispatcheventinsandbox", { - source: this, - detail: { - id, - name: "Keystroke", - value, - willCommit: true, - commitKey: elementData.commitKey, - selStart: event.target.selectionStart, - selEnd: event.target.selectionEnd - } - }); - } - _blurListener(event); - }); - if (this.data.actions?.Keystroke) { - element.addEventListener("beforeinput", event => { - elementData.lastCommittedValue = null; - const { - data, - target - } = event; - const { - value, - selectionStart, - selectionEnd - } = target; - let selStart = selectionStart, - selEnd = selectionEnd; - switch (event.inputType) { - case "deleteWordBackward": - { - const match = value.substring(0, selectionStart).match(/\w*[^\w]*$/); - if (match) { - selStart -= match[0].length; - } - break; - } - case "deleteWordForward": - { - const match = value.substring(selectionStart).match(/^[^\w]*\w*/); - if (match) { - selEnd += match[0].length; - } - break; - } - case "deleteContentBackward": - if (selectionStart === selectionEnd) { - selStart -= 1; - } - break; - case "deleteContentForward": - if (selectionStart === selectionEnd) { - selEnd += 1; - } - break; - } - event.preventDefault(); - this.linkService.eventBus?.dispatch("dispatcheventinsandbox", { - source: this, - detail: { - id, - name: "Keystroke", - value, - change: data || "", - willCommit: false, - selStart, - selEnd - } - }); - }); - } - this._setEventListeners(element, [["focus", "Focus"], ["blur", "Blur"], ["mousedown", "Mouse Down"], ["mouseenter", "Mouse Enter"], ["mouseleave", "Mouse Exit"], ["mouseup", "Mouse Up"]], event => event.target.value); - } - if (blurListener) { - element.addEventListener("blur", blurListener); - } - if (this.data.comb) { - const fieldWidth = this.data.rect[2] - this.data.rect[0]; - const combWidth = fieldWidth / maxLen; - element.classList.add("comb"); - element.style.letterSpacing = `calc(${combWidth}px * var(--scale-factor) - 1ch)`; - } - } else { - element = document.createElement("div"); - element.textContent = this.data.fieldValue; - element.style.verticalAlign = "middle"; - element.style.display = "table-cell"; - } - this._setTextStyle(element); - this._setBackgroundColor(element); - this._setDefaultPropertiesFromJS(element); - this.container.append(element); - return this.container; - } -} -class CheckboxWidgetAnnotationElement extends WidgetAnnotationElement { - constructor(parameters) { - super(parameters, { - isRenderable: parameters.renderForms - }); - } - render() { - const storage = this.annotationStorage; - const data = this.data; - const id = data.id; - let value = storage.getValue(id, { - value: data.exportValue === data.fieldValue - }).value; - if (typeof value === "string") { - value = value !== "Off"; - storage.setValue(id, { - value - }); - } - this.container.className = "buttonWidgetAnnotation checkBox"; - const element = document.createElement("input"); - GetElementsByNameSet.add(element); - element.setAttribute("data-element-id", id); - element.disabled = data.readOnly; - this._setRequired(element, this.data.required); - element.type = "checkbox"; - element.name = data.fieldName; - if (value) { - element.setAttribute("checked", true); - } - element.setAttribute("exportValue", data.exportValue); - element.tabIndex = DEFAULT_TAB_INDEX; - element.addEventListener("change", event => { - const { - name, - checked - } = event.target; - for (const checkbox of this._getElementsByName(name, id)) { - const curChecked = checked && checkbox.exportValue === data.exportValue; - if (checkbox.domElement) { - checkbox.domElement.checked = curChecked; - } - storage.setValue(checkbox.id, { - value: curChecked - }); - } - storage.setValue(id, { - value: checked - }); - }); - element.addEventListener("resetform", event => { - const defaultValue = data.defaultFieldValue || "Off"; - event.target.checked = defaultValue === data.exportValue; - }); - if (this.enableScripting && this.hasJSActions) { - element.addEventListener("updatefromsandbox", jsEvent => { - const actions = { - value(event) { - event.target.checked = event.detail.value !== "Off"; - storage.setValue(id, { - value: event.target.checked - }); - } - }; - this._dispatchEventFromSandbox(actions, jsEvent); - }); - this._setEventListeners(element, [["change", "Validate"], ["change", "Action"], ["focus", "Focus"], ["blur", "Blur"], ["mousedown", "Mouse Down"], ["mouseenter", "Mouse Enter"], ["mouseleave", "Mouse Exit"], ["mouseup", "Mouse Up"]], event => event.target.checked); - } - this._setBackgroundColor(element); - this._setDefaultPropertiesFromJS(element); - this.container.append(element); - return this.container; - } -} -class RadioButtonWidgetAnnotationElement extends WidgetAnnotationElement { - constructor(parameters) { - super(parameters, { - isRenderable: parameters.renderForms - }); - } - render() { - this.container.className = "buttonWidgetAnnotation radioButton"; - const storage = this.annotationStorage; - const data = this.data; - const id = data.id; - let value = storage.getValue(id, { - value: data.fieldValue === data.buttonValue - }).value; - if (typeof value === "string") { - value = value !== data.buttonValue; - storage.setValue(id, { - value - }); - } - const element = document.createElement("input"); - GetElementsByNameSet.add(element); - element.setAttribute("data-element-id", id); - element.disabled = data.readOnly; - this._setRequired(element, this.data.required); - element.type = "radio"; - element.name = data.fieldName; - if (value) { - element.setAttribute("checked", true); - } - element.tabIndex = DEFAULT_TAB_INDEX; - element.addEventListener("change", event => { - const { - name, - checked - } = event.target; - for (const radio of this._getElementsByName(name, id)) { - storage.setValue(radio.id, { - value: false - }); - } - storage.setValue(id, { - value: checked - }); - }); - element.addEventListener("resetform", event => { - const defaultValue = data.defaultFieldValue; - event.target.checked = defaultValue !== null && defaultValue !== undefined && defaultValue === data.buttonValue; - }); - if (this.enableScripting && this.hasJSActions) { - const pdfButtonValue = data.buttonValue; - element.addEventListener("updatefromsandbox", jsEvent => { - const actions = { - value: event => { - const checked = pdfButtonValue === event.detail.value; - for (const radio of this._getElementsByName(event.target.name)) { - const curChecked = checked && radio.id === id; - if (radio.domElement) { - radio.domElement.checked = curChecked; - } - storage.setValue(radio.id, { - value: curChecked - }); - } - } - }; - this._dispatchEventFromSandbox(actions, jsEvent); - }); - this._setEventListeners(element, [["change", "Validate"], ["change", "Action"], ["focus", "Focus"], ["blur", "Blur"], ["mousedown", "Mouse Down"], ["mouseenter", "Mouse Enter"], ["mouseleave", "Mouse Exit"], ["mouseup", "Mouse Up"]], event => event.target.checked); - } - this._setBackgroundColor(element); - this._setDefaultPropertiesFromJS(element); - this.container.append(element); - return this.container; - } -} -class PushButtonWidgetAnnotationElement extends LinkAnnotationElement { - constructor(parameters) { - super(parameters, { - ignoreBorder: parameters.data.hasAppearance - }); - } - render() { - const container = super.render(); - container.className = "buttonWidgetAnnotation pushButton"; - if (this.data.alternativeText) { - container.title = this.data.alternativeText; - } - const linkElement = container.lastChild; - if (this.enableScripting && this.hasJSActions && linkElement) { - this._setDefaultPropertiesFromJS(linkElement); - linkElement.addEventListener("updatefromsandbox", jsEvent => { - this._dispatchEventFromSandbox({}, jsEvent); - }); - } - return container; - } -} -class ChoiceWidgetAnnotationElement extends WidgetAnnotationElement { - constructor(parameters) { - super(parameters, { - isRenderable: parameters.renderForms - }); - } - render() { - this.container.className = "choiceWidgetAnnotation"; - const storage = this.annotationStorage; - const id = this.data.id; - const storedData = storage.getValue(id, { - value: this.data.fieldValue - }); - const selectElement = document.createElement("select"); - GetElementsByNameSet.add(selectElement); - selectElement.setAttribute("data-element-id", id); - selectElement.disabled = this.data.readOnly; - this._setRequired(selectElement, this.data.required); - selectElement.name = this.data.fieldName; - selectElement.tabIndex = DEFAULT_TAB_INDEX; - let addAnEmptyEntry = this.data.combo && this.data.options.length > 0; - if (!this.data.combo) { - selectElement.size = this.data.options.length; - if (this.data.multiSelect) { - selectElement.multiple = true; - } - } - selectElement.addEventListener("resetform", event => { - const defaultValue = this.data.defaultFieldValue; - for (const option of selectElement.options) { - option.selected = option.value === defaultValue; - } - }); - for (const option of this.data.options) { - const optionElement = document.createElement("option"); - optionElement.textContent = option.displayValue; - optionElement.value = option.exportValue; - if (storedData.value.includes(option.exportValue)) { - optionElement.setAttribute("selected", true); - addAnEmptyEntry = false; - } - selectElement.append(optionElement); - } - let removeEmptyEntry = null; - if (addAnEmptyEntry) { - const noneOptionElement = document.createElement("option"); - noneOptionElement.value = " "; - noneOptionElement.setAttribute("hidden", true); - noneOptionElement.setAttribute("selected", true); - selectElement.prepend(noneOptionElement); - removeEmptyEntry = () => { - noneOptionElement.remove(); - selectElement.removeEventListener("input", removeEmptyEntry); - removeEmptyEntry = null; - }; - selectElement.addEventListener("input", removeEmptyEntry); - } - const getValue = isExport => { - const name = isExport ? "value" : "textContent"; - const { - options, - multiple - } = selectElement; - if (!multiple) { - return options.selectedIndex === -1 ? null : options[options.selectedIndex][name]; - } - return Array.prototype.filter.call(options, option => option.selected).map(option => option[name]); - }; - let selectedValues = getValue(false); - const getItems = event => { - const options = event.target.options; - return Array.prototype.map.call(options, option => { - return { - displayValue: option.textContent, - exportValue: option.value - }; - }); - }; - if (this.enableScripting && this.hasJSActions) { - selectElement.addEventListener("updatefromsandbox", jsEvent => { - const actions = { - value(event) { - removeEmptyEntry?.(); - const value = event.detail.value; - const values = new Set(Array.isArray(value) ? value : [value]); - for (const option of selectElement.options) { - option.selected = values.has(option.value); - } - storage.setValue(id, { - value: getValue(true) - }); - selectedValues = getValue(false); - }, - multipleSelection(event) { - selectElement.multiple = true; - }, - remove(event) { - const options = selectElement.options; - const index = event.detail.remove; - options[index].selected = false; - selectElement.remove(index); - if (options.length > 0) { - const i = Array.prototype.findIndex.call(options, option => option.selected); - if (i === -1) { - options[0].selected = true; - } - } - storage.setValue(id, { - value: getValue(true), - items: getItems(event) - }); - selectedValues = getValue(false); - }, - clear(event) { - while (selectElement.length !== 0) { - selectElement.remove(0); - } - storage.setValue(id, { - value: null, - items: [] - }); - selectedValues = getValue(false); - }, - insert(event) { - const { - index, - displayValue, - exportValue - } = event.detail.insert; - const selectChild = selectElement.children[index]; - const optionElement = document.createElement("option"); - optionElement.textContent = displayValue; - optionElement.value = exportValue; - if (selectChild) { - selectChild.before(optionElement); - } else { - selectElement.append(optionElement); - } - storage.setValue(id, { - value: getValue(true), - items: getItems(event) - }); - selectedValues = getValue(false); - }, - items(event) { - const { - items - } = event.detail; - while (selectElement.length !== 0) { - selectElement.remove(0); - } - for (const item of items) { - const { - displayValue, - exportValue - } = item; - const optionElement = document.createElement("option"); - optionElement.textContent = displayValue; - optionElement.value = exportValue; - selectElement.append(optionElement); - } - if (selectElement.options.length > 0) { - selectElement.options[0].selected = true; - } - storage.setValue(id, { - value: getValue(true), - items: getItems(event) - }); - selectedValues = getValue(false); - }, - indices(event) { - const indices = new Set(event.detail.indices); - for (const option of event.target.options) { - option.selected = indices.has(option.index); - } - storage.setValue(id, { - value: getValue(true) - }); - selectedValues = getValue(false); - }, - editable(event) { - event.target.disabled = !event.detail.editable; - } - }; - this._dispatchEventFromSandbox(actions, jsEvent); - }); - selectElement.addEventListener("input", event => { - const exportValue = getValue(true); - storage.setValue(id, { - value: exportValue - }); - event.preventDefault(); - this.linkService.eventBus?.dispatch("dispatcheventinsandbox", { - source: this, - detail: { - id, - name: "Keystroke", - value: selectedValues, - changeEx: exportValue, - willCommit: false, - commitKey: 1, - keyDown: false - } - }); - }); - this._setEventListeners(selectElement, [["focus", "Focus"], ["blur", "Blur"], ["mousedown", "Mouse Down"], ["mouseenter", "Mouse Enter"], ["mouseleave", "Mouse Exit"], ["mouseup", "Mouse Up"], ["input", "Action"], ["input", "Validate"]], event => event.target.value); - } else { - selectElement.addEventListener("input", function (event) { - storage.setValue(id, { - value: getValue(true) - }); - }); - } - if (this.data.combo) { - this._setTextStyle(selectElement); - } else {} - this._setBackgroundColor(selectElement); - this._setDefaultPropertiesFromJS(selectElement); - this.container.append(selectElement); - return this.container; - } -} -class PopupAnnotationElement extends AnnotationElement { - static IGNORE_TYPES = new Set(["Line", "Square", "Circle", "PolyLine", "Polygon", "Ink"]); - constructor(parameters) { - const { - data - } = parameters; - const isRenderable = !PopupAnnotationElement.IGNORE_TYPES.has(data.parentType) && !!(data.titleObj?.str || data.contentsObj?.str || data.richText?.str); - super(parameters, { - isRenderable - }); - } - render() { - this.container.className = "popupAnnotation"; - const parentElements = this.layer.querySelectorAll(`[data-annotation-id="${this.data.parentId}"]`); - if (parentElements.length === 0) { - return this.container; - } - const popup = new PopupElement({ - container: this.container, - trigger: Array.from(parentElements), - color: this.data.color, - titleObj: this.data.titleObj, - modificationDate: this.data.modificationDate, - contentsObj: this.data.contentsObj, - richText: this.data.richText - }); - const page = this.page; - const rect = _util.Util.normalizeRect([this.data.parentRect[0], page.view[3] - this.data.parentRect[1] + page.view[1], this.data.parentRect[2], page.view[3] - this.data.parentRect[3] + page.view[1]]); - const popupLeft = rect[0] + this.data.parentRect[2] - this.data.parentRect[0]; - const popupTop = rect[1]; - const { - pageWidth, - pageHeight, - pageX, - pageY - } = this.viewport.rawDims; - this.container.style.left = `${100 * (popupLeft - pageX) / pageWidth}%`; - this.container.style.top = `${100 * (popupTop - pageY) / pageHeight}%`; - this.container.append(popup.render()); - return this.container; - } -} -class PopupElement { - constructor(parameters) { - this.container = parameters.container; - this.trigger = parameters.trigger; - this.color = parameters.color; - this.titleObj = parameters.titleObj; - this.modificationDate = parameters.modificationDate; - this.contentsObj = parameters.contentsObj; - this.richText = parameters.richText; - this.hideWrapper = parameters.hideWrapper || false; - this.pinned = false; - } - render() { - const BACKGROUND_ENLIGHT = 0.7; - const wrapper = document.createElement("div"); - wrapper.className = "popupWrapper"; - this.hideElement = this.hideWrapper ? wrapper : this.container; - this.hideElement.hidden = true; - const popup = document.createElement("div"); - popup.className = "popup"; - const color = this.color; - if (color) { - const r = BACKGROUND_ENLIGHT * (255 - color[0]) + color[0]; - const g = BACKGROUND_ENLIGHT * (255 - color[1]) + color[1]; - const b = BACKGROUND_ENLIGHT * (255 - color[2]) + color[2]; - popup.style.backgroundColor = _util.Util.makeHexColor(r | 0, g | 0, b | 0); - } - const title = document.createElement("h1"); - title.dir = this.titleObj.dir; - title.textContent = this.titleObj.str; - popup.append(title); - const dateObject = _display_utils.PDFDateString.toDateObject(this.modificationDate); - if (dateObject) { - const modificationDate = document.createElement("span"); - modificationDate.className = "popupDate"; - modificationDate.textContent = "{{date}}, {{time}}"; - modificationDate.dataset.l10nId = "annotation_date_string"; - modificationDate.dataset.l10nArgs = JSON.stringify({ - date: dateObject.toLocaleDateString(), - time: dateObject.toLocaleTimeString() - }); - popup.append(modificationDate); - } - if (this.richText?.str && (!this.contentsObj?.str || this.contentsObj.str === this.richText.str)) { - _xfa_layer.XfaLayer.render({ - xfaHtml: this.richText.html, - intent: "richText", - div: popup - }); - popup.lastChild.className = "richText popupContent"; - } else { - const contents = this._formatContents(this.contentsObj); - popup.append(contents); - } - if (!Array.isArray(this.trigger)) { - this.trigger = [this.trigger]; - } - for (const element of this.trigger) { - element.addEventListener("click", this._toggle.bind(this)); - element.addEventListener("mouseover", this._show.bind(this, false)); - element.addEventListener("mouseout", this._hide.bind(this, false)); - } - popup.addEventListener("click", this._hide.bind(this, true)); - wrapper.append(popup); - return wrapper; - } - _formatContents({ - str, - dir - }) { - const p = document.createElement("p"); - p.className = "popupContent"; - p.dir = dir; - const lines = str.split(/(?:\r\n?|\n)/); - for (let i = 0, ii = lines.length; i < ii; ++i) { - const line = lines[i]; - p.append(document.createTextNode(line)); - if (i < ii - 1) { - p.append(document.createElement("br")); - } - } - return p; - } - _toggle() { - if (this.pinned) { - this._hide(true); - } else { - this._show(true); - } - } - _show(pin = false) { - if (pin) { - this.pinned = true; - } - if (this.hideElement.hidden) { - this.hideElement.hidden = false; - this.container.style.zIndex = parseInt(this.container.style.zIndex) + 1000; - } - } - _hide(unpin = true) { - if (unpin) { - this.pinned = false; - } - if (!this.hideElement.hidden && !this.pinned) { - this.hideElement.hidden = true; - this.container.style.zIndex = parseInt(this.container.style.zIndex) - 1000; - } - } -} -class FreeTextAnnotationElement extends AnnotationElement { - constructor(parameters) { - const isRenderable = !!(parameters.data.hasPopup || parameters.data.titleObj?.str || parameters.data.contentsObj?.str || parameters.data.richText?.str); - super(parameters, { - isRenderable, - ignoreBorder: true - }); - this.textContent = parameters.data.textContent; - } - render() { - this.container.className = "freeTextAnnotation"; - if (this.textContent) { - const content = document.createElement("div"); - content.className = "annotationTextContent"; - content.setAttribute("role", "comment"); - for (const line of this.textContent) { - const lineSpan = document.createElement("span"); - lineSpan.textContent = line; - content.append(lineSpan); - } - this.container.append(content); - } - if (!this.data.hasPopup) { - this._createPopup(null, this.data); - } - return this.container; - } -} -class LineAnnotationElement extends AnnotationElement { - constructor(parameters) { - const isRenderable = !!(parameters.data.hasPopup || parameters.data.titleObj?.str || parameters.data.contentsObj?.str || parameters.data.richText?.str); - super(parameters, { - isRenderable, - ignoreBorder: true - }); - } - render() { - this.container.className = "lineAnnotation"; - const data = this.data; - const { - width, - height - } = getRectDims(data.rect); - const svg = this.svgFactory.create(width, height, true); - const line = this.svgFactory.createElement("svg:line"); - line.setAttribute("x1", data.rect[2] - data.lineCoordinates[0]); - line.setAttribute("y1", data.rect[3] - data.lineCoordinates[1]); - line.setAttribute("x2", data.rect[2] - data.lineCoordinates[2]); - line.setAttribute("y2", data.rect[3] - data.lineCoordinates[3]); - line.setAttribute("stroke-width", data.borderStyle.width || 1); - line.setAttribute("stroke", "transparent"); - line.setAttribute("fill", "transparent"); - svg.append(line); - this.container.append(svg); - this._createPopup(line, data); - return this.container; - } -} -class SquareAnnotationElement extends AnnotationElement { - constructor(parameters) { - const isRenderable = !!(parameters.data.hasPopup || parameters.data.titleObj?.str || parameters.data.contentsObj?.str || parameters.data.richText?.str); - super(parameters, { - isRenderable, - ignoreBorder: true - }); - } - render() { - this.container.className = "squareAnnotation"; - const data = this.data; - const { - width, - height - } = getRectDims(data.rect); - const svg = this.svgFactory.create(width, height, true); - const borderWidth = data.borderStyle.width; - const square = this.svgFactory.createElement("svg:rect"); - square.setAttribute("x", borderWidth / 2); - square.setAttribute("y", borderWidth / 2); - square.setAttribute("width", width - borderWidth); - square.setAttribute("height", height - borderWidth); - square.setAttribute("stroke-width", borderWidth || 1); - square.setAttribute("stroke", "transparent"); - square.setAttribute("fill", "transparent"); - svg.append(square); - this.container.append(svg); - this._createPopup(square, data); - return this.container; - } -} -class CircleAnnotationElement extends AnnotationElement { - constructor(parameters) { - const isRenderable = !!(parameters.data.hasPopup || parameters.data.titleObj?.str || parameters.data.contentsObj?.str || parameters.data.richText?.str); - super(parameters, { - isRenderable, - ignoreBorder: true - }); - } - render() { - this.container.className = "circleAnnotation"; - const data = this.data; - const { - width, - height - } = getRectDims(data.rect); - const svg = this.svgFactory.create(width, height, true); - const borderWidth = data.borderStyle.width; - const circle = this.svgFactory.createElement("svg:ellipse"); - circle.setAttribute("cx", width / 2); - circle.setAttribute("cy", height / 2); - circle.setAttribute("rx", width / 2 - borderWidth / 2); - circle.setAttribute("ry", height / 2 - borderWidth / 2); - circle.setAttribute("stroke-width", borderWidth || 1); - circle.setAttribute("stroke", "transparent"); - circle.setAttribute("fill", "transparent"); - svg.append(circle); - this.container.append(svg); - this._createPopup(circle, data); - return this.container; - } -} -class PolylineAnnotationElement extends AnnotationElement { - constructor(parameters) { - const isRenderable = !!(parameters.data.hasPopup || parameters.data.titleObj?.str || parameters.data.contentsObj?.str || parameters.data.richText?.str); - super(parameters, { - isRenderable, - ignoreBorder: true - }); - this.containerClassName = "polylineAnnotation"; - this.svgElementName = "svg:polyline"; - } - render() { - this.container.className = this.containerClassName; - const data = this.data; - const { - width, - height - } = getRectDims(data.rect); - const svg = this.svgFactory.create(width, height, true); - let points = []; - for (const coordinate of data.vertices) { - const x = coordinate.x - data.rect[0]; - const y = data.rect[3] - coordinate.y; - points.push(x + "," + y); - } - points = points.join(" "); - const polyline = this.svgFactory.createElement(this.svgElementName); - polyline.setAttribute("points", points); - polyline.setAttribute("stroke-width", data.borderStyle.width || 1); - polyline.setAttribute("stroke", "transparent"); - polyline.setAttribute("fill", "transparent"); - svg.append(polyline); - this.container.append(svg); - this._createPopup(polyline, data); - return this.container; - } -} -class PolygonAnnotationElement extends PolylineAnnotationElement { - constructor(parameters) { - super(parameters); - this.containerClassName = "polygonAnnotation"; - this.svgElementName = "svg:polygon"; - } -} -class CaretAnnotationElement extends AnnotationElement { - constructor(parameters) { - const isRenderable = !!(parameters.data.hasPopup || parameters.data.titleObj?.str || parameters.data.contentsObj?.str || parameters.data.richText?.str); - super(parameters, { - isRenderable, - ignoreBorder: true - }); - } - render() { - this.container.className = "caretAnnotation"; - if (!this.data.hasPopup) { - this._createPopup(null, this.data); - } - return this.container; - } -} -class InkAnnotationElement extends AnnotationElement { - constructor(parameters) { - const isRenderable = !!(parameters.data.hasPopup || parameters.data.titleObj?.str || parameters.data.contentsObj?.str || parameters.data.richText?.str); - super(parameters, { - isRenderable, - ignoreBorder: true - }); - this.containerClassName = "inkAnnotation"; - this.svgElementName = "svg:polyline"; - } - render() { - this.container.className = this.containerClassName; - const data = this.data; - const { - width, - height - } = getRectDims(data.rect); - const svg = this.svgFactory.create(width, height, true); - for (const inkList of data.inkLists) { - let points = []; - for (const coordinate of inkList) { - const x = coordinate.x - data.rect[0]; - const y = data.rect[3] - coordinate.y; - points.push(`${x},${y}`); - } - points = points.join(" "); - const polyline = this.svgFactory.createElement(this.svgElementName); - polyline.setAttribute("points", points); - polyline.setAttribute("stroke-width", data.borderStyle.width || 1); - polyline.setAttribute("stroke", "transparent"); - polyline.setAttribute("fill", "transparent"); - this._createPopup(polyline, data); - svg.append(polyline); - } - this.container.append(svg); - return this.container; - } -} -class HighlightAnnotationElement extends AnnotationElement { - constructor(parameters) { - const isRenderable = !!(parameters.data.hasPopup || parameters.data.titleObj?.str || parameters.data.contentsObj?.str || parameters.data.richText?.str); - super(parameters, { - isRenderable, - ignoreBorder: true, - createQuadrilaterals: true - }); - } - render() { - if (!this.data.hasPopup) { - this._createPopup(null, this.data); - } - if (this.quadrilaterals) { - return this._renderQuadrilaterals("highlightAnnotation"); - } - this.container.className = "highlightAnnotation"; - return this.container; - } -} -class UnderlineAnnotationElement extends AnnotationElement { - constructor(parameters) { - const isRenderable = !!(parameters.data.hasPopup || parameters.data.titleObj?.str || parameters.data.contentsObj?.str || parameters.data.richText?.str); - super(parameters, { - isRenderable, - ignoreBorder: true, - createQuadrilaterals: true - }); - } - render() { - if (!this.data.hasPopup) { - this._createPopup(null, this.data); - } - if (this.quadrilaterals) { - return this._renderQuadrilaterals("underlineAnnotation"); - } - this.container.className = "underlineAnnotation"; - return this.container; - } -} -class SquigglyAnnotationElement extends AnnotationElement { - constructor(parameters) { - const isRenderable = !!(parameters.data.hasPopup || parameters.data.titleObj?.str || parameters.data.contentsObj?.str || parameters.data.richText?.str); - super(parameters, { - isRenderable, - ignoreBorder: true, - createQuadrilaterals: true - }); - } - render() { - if (!this.data.hasPopup) { - this._createPopup(null, this.data); - } - if (this.quadrilaterals) { - return this._renderQuadrilaterals("squigglyAnnotation"); - } - this.container.className = "squigglyAnnotation"; - return this.container; - } -} -class StrikeOutAnnotationElement extends AnnotationElement { - constructor(parameters) { - const isRenderable = !!(parameters.data.hasPopup || parameters.data.titleObj?.str || parameters.data.contentsObj?.str || parameters.data.richText?.str); - super(parameters, { - isRenderable, - ignoreBorder: true, - createQuadrilaterals: true - }); - } - render() { - if (!this.data.hasPopup) { - this._createPopup(null, this.data); - } - if (this.quadrilaterals) { - return this._renderQuadrilaterals("strikeoutAnnotation"); - } - this.container.className = "strikeoutAnnotation"; - return this.container; - } -} -class StampAnnotationElement extends AnnotationElement { - constructor(parameters) { - const isRenderable = !!(parameters.data.hasPopup || parameters.data.titleObj?.str || parameters.data.contentsObj?.str || parameters.data.richText?.str); - super(parameters, { - isRenderable, - ignoreBorder: true - }); - } - render() { - this.container.className = "stampAnnotation"; - if (!this.data.hasPopup) { - this._createPopup(null, this.data); - } - return this.container; - } -} -class FileAttachmentAnnotationElement extends AnnotationElement { - constructor(parameters) { - super(parameters, { - isRenderable: true - }); - const { - filename, - content - } = this.data.file; - this.filename = (0, _display_utils.getFilenameFromUrl)(filename, true); - this.content = content; - this.linkService.eventBus?.dispatch("fileattachmentannotation", { - source: this, - filename, - content - }); - } - render() { - this.container.className = "fileAttachmentAnnotation"; - let trigger; - if (this.data.hasAppearance) { - trigger = document.createElement("div"); - } else { - trigger = document.createElement("img"); - trigger.src = `${this.imageResourcesPath}annotation-${/paperclip/i.test(this.data.name) ? "paperclip" : "pushpin"}.svg`; - } - trigger.className = "popupTriggerArea"; - trigger.addEventListener("dblclick", this._download.bind(this)); - if (!this.data.hasPopup && (this.data.titleObj?.str || this.data.contentsObj?.str || this.data.richText)) { - this._createPopup(trigger, this.data); - } - this.container.append(trigger); - return this.container; - } - _download() { - this.downloadManager?.openOrDownloadData(this.container, this.content, this.filename); - } -} -class AnnotationLayer { - static #appendElement(element, id, div, accessibilityManager) { - const contentElement = element.firstChild || element; - contentElement.id = `${_display_utils.AnnotationPrefix}${id}`; - div.append(element); - accessibilityManager?.moveElementInDOM(div, element, contentElement, false); - } - static render(params) { - const { - annotations, - div, - viewport, - accessibilityManager - } = params; - (0, _display_utils.setLayerDimensions)(div, viewport); - const elementParams = { - data: null, - layer: div, - page: params.page, - viewport, - linkService: params.linkService, - downloadManager: params.downloadManager, - imageResourcesPath: params.imageResourcesPath || "", - renderForms: params.renderForms !== false, - svgFactory: new _display_utils.DOMSVGFactory(), - annotationStorage: params.annotationStorage || new _annotation_storage.AnnotationStorage(), - enableScripting: params.enableScripting === true, - hasJSActions: params.hasJSActions, - fieldObjects: params.fieldObjects - }; - let zIndex = 0; - for (const data of annotations) { - if (data.annotationType !== _util.AnnotationType.POPUP) { - const { - width, - height - } = getRectDims(data.rect); - if (width <= 0 || height <= 0) { - continue; - } - } - elementParams.data = data; - const element = AnnotationElementFactory.create(elementParams); - if (!element.isRenderable) { - continue; - } - const rendered = element.render(); - if (data.hidden) { - rendered.style.visibility = "hidden"; - } - if (Array.isArray(rendered)) { - for (const renderedElement of rendered) { - renderedElement.style.zIndex = zIndex++; - AnnotationLayer.#appendElement(renderedElement, data.id, div, accessibilityManager); - } - } else { - rendered.style.zIndex = zIndex++; - if (element instanceof PopupAnnotationElement) { - div.prepend(rendered); - } else { - AnnotationLayer.#appendElement(rendered, data.id, div, accessibilityManager); - } - } - } - this.#setAnnotationCanvasMap(div, params.annotationCanvasMap); - } - static update(params) { - const { - annotationCanvasMap, - div, - viewport - } = params; - (0, _display_utils.setLayerDimensions)(div, { - rotation: viewport.rotation - }); - this.#setAnnotationCanvasMap(div, annotationCanvasMap); - div.hidden = false; - } - static #setAnnotationCanvasMap(div, annotationCanvasMap) { - if (!annotationCanvasMap) { - return; - } - for (const [id, canvas] of annotationCanvasMap) { - const element = div.querySelector(`[data-annotation-id="${id}"]`); - if (!element) { - continue; - } - const { - firstChild - } = element; - if (!firstChild) { - element.append(canvas); - } else if (firstChild.nodeName === "CANVAS") { - firstChild.replaceWith(canvas); - } else { - firstChild.before(canvas); - } - } - annotationCanvasMap.clear(); - } -} -exports.AnnotationLayer = AnnotationLayer; - -/***/ }), -/* 33 */ -/***/ ((__unused_webpack_module, exports) => { - - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.ColorConverters = void 0; -function makeColorComp(n) { - return Math.floor(Math.max(0, Math.min(1, n)) * 255).toString(16).padStart(2, "0"); -} -class ColorConverters { - static CMYK_G([c, y, m, k]) { - return ["G", 1 - Math.min(1, 0.3 * c + 0.59 * m + 0.11 * y + k)]; - } - static G_CMYK([g]) { - return ["CMYK", 0, 0, 0, 1 - g]; - } - static G_RGB([g]) { - return ["RGB", g, g, g]; - } - static G_HTML([g]) { - const G = makeColorComp(g); - return `#${G}${G}${G}`; - } - static RGB_G([r, g, b]) { - return ["G", 0.3 * r + 0.59 * g + 0.11 * b]; - } - static RGB_HTML([r, g, b]) { - const R = makeColorComp(r); - const G = makeColorComp(g); - const B = makeColorComp(b); - return `#${R}${G}${B}`; - } - static T_HTML() { - return "#00000000"; - } - static CMYK_RGB([c, y, m, k]) { - return ["RGB", 1 - Math.min(1, c + k), 1 - Math.min(1, m + k), 1 - Math.min(1, y + k)]; - } - static CMYK_HTML(components) { - const rgb = this.CMYK_RGB(components).slice(1); - return this.RGB_HTML(rgb); - } - static RGB_CMYK([r, g, b]) { - const c = 1 - r; - const m = 1 - g; - const y = 1 - b; - const k = Math.min(c, m, y); - return ["CMYK", c, m, y, k]; - } -} -exports.ColorConverters = ColorConverters; - -/***/ }), -/* 34 */ -/***/ ((__unused_webpack_module, exports, __w_pdfjs_require__) => { - - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.XfaLayer = void 0; -var _xfa_text = __w_pdfjs_require__(19); -class XfaLayer { - static setupStorage(html, id, element, storage, intent) { - const storedData = storage.getValue(id, { - value: null - }); - switch (element.name) { - case "textarea": - if (storedData.value !== null) { - html.textContent = storedData.value; - } - if (intent === "print") { - break; - } - html.addEventListener("input", event => { - storage.setValue(id, { - value: event.target.value - }); - }); - break; - case "input": - if (element.attributes.type === "radio" || element.attributes.type === "checkbox") { - if (storedData.value === element.attributes.xfaOn) { - html.setAttribute("checked", true); - } else if (storedData.value === element.attributes.xfaOff) { - html.removeAttribute("checked"); - } - if (intent === "print") { - break; - } - html.addEventListener("change", event => { - storage.setValue(id, { - value: event.target.checked ? event.target.getAttribute("xfaOn") : event.target.getAttribute("xfaOff") - }); - }); - } else { - if (storedData.value !== null) { - html.setAttribute("value", storedData.value); - } - if (intent === "print") { - break; - } - html.addEventListener("input", event => { - storage.setValue(id, { - value: event.target.value - }); - }); - } - break; - case "select": - if (storedData.value !== null) { - for (const option of element.children) { - if (option.attributes.value === storedData.value) { - option.attributes.selected = true; - } - } - } - html.addEventListener("input", event => { - const options = event.target.options; - const value = options.selectedIndex === -1 ? "" : options[options.selectedIndex].value; - storage.setValue(id, { - value - }); - }); - break; - } - } - static setAttributes({ - html, - element, - storage = null, - intent, - linkService - }) { - const { - attributes - } = element; - const isHTMLAnchorElement = html instanceof HTMLAnchorElement; - if (attributes.type === "radio") { - attributes.name = `${attributes.name}-${intent}`; - } - for (const [key, value] of Object.entries(attributes)) { - if (value === null || value === undefined) { - continue; - } - switch (key) { - case "class": - if (value.length) { - html.setAttribute(key, value.join(" ")); - } - break; - case "dataId": - break; - case "id": - html.setAttribute("data-element-id", value); - break; - case "style": - Object.assign(html.style, value); - break; - case "textContent": - html.textContent = value; - break; - default: - if (!isHTMLAnchorElement || key !== "href" && key !== "newWindow") { - html.setAttribute(key, value); - } - } - } - if (isHTMLAnchorElement) { - linkService.addLinkAttributes(html, attributes.href, attributes.newWindow); - } - if (storage && attributes.dataId) { - this.setupStorage(html, attributes.dataId, element, storage); - } - } - static render(parameters) { - const storage = parameters.annotationStorage; - const linkService = parameters.linkService; - const root = parameters.xfaHtml; - const intent = parameters.intent || "display"; - const rootHtml = document.createElement(root.name); - if (root.attributes) { - this.setAttributes({ - html: rootHtml, - element: root, - intent, - linkService - }); - } - const stack = [[root, -1, rootHtml]]; - const rootDiv = parameters.div; - rootDiv.append(rootHtml); - if (parameters.viewport) { - const transform = `matrix(${parameters.viewport.transform.join(",")})`; - rootDiv.style.transform = transform; - } - if (intent !== "richText") { - rootDiv.setAttribute("class", "xfaLayer xfaFont"); - } - const textDivs = []; - while (stack.length > 0) { - const [parent, i, html] = stack.at(-1); - if (i + 1 === parent.children.length) { - stack.pop(); - continue; - } - const child = parent.children[++stack.at(-1)[1]]; - if (child === null) { - continue; - } - const { - name - } = child; - if (name === "#text") { - const node = document.createTextNode(child.value); - textDivs.push(node); - html.append(node); - continue; - } - let childHtml; - if (child?.attributes?.xmlns) { - childHtml = document.createElementNS(child.attributes.xmlns, name); - } else { - childHtml = document.createElement(name); - } - html.append(childHtml); - if (child.attributes) { - this.setAttributes({ - html: childHtml, - element: child, - storage, - intent, - linkService - }); - } - if (child.children && child.children.length > 0) { - stack.push([child, -1, childHtml]); - } else if (child.value) { - const node = document.createTextNode(child.value); - if (_xfa_text.XfaText.shouldBuildText(name)) { - textDivs.push(node); - } - childHtml.append(node); - } - } - for (const el of rootDiv.querySelectorAll(".xfaNonInteractive input, .xfaNonInteractive textarea")) { - el.setAttribute("readOnly", true); - } - return { - textDivs - }; - } - static update(parameters) { - const transform = `matrix(${parameters.viewport.transform.join(",")})`; - parameters.div.style.transform = transform; - parameters.div.hidden = false; - } -} -exports.XfaLayer = XfaLayer; - -/***/ }), -/* 35 */ -/***/ ((__unused_webpack_module, exports, __w_pdfjs_require__) => { - - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.SVGGraphics = void 0; -var _display_utils = __w_pdfjs_require__(6); -var _util = __w_pdfjs_require__(1); -var _is_node = __w_pdfjs_require__(10); -let SVGGraphics = class { - constructor() { - (0, _util.unreachable)("Not implemented: SVGGraphics"); - } -}; -exports.SVGGraphics = SVGGraphics; -{ - const SVG_DEFAULTS = { - fontStyle: "normal", - fontWeight: "normal", - fillColor: "#000000" - }; - const XML_NS = "http://www.w3.org/XML/1998/namespace"; - const XLINK_NS = "http://www.w3.org/1999/xlink"; - const LINE_CAP_STYLES = ["butt", "round", "square"]; - const LINE_JOIN_STYLES = ["miter", "round", "bevel"]; - const createObjectURL = function (data, contentType = "", forceDataSchema = false) { - if (URL.createObjectURL && typeof Blob !== "undefined" && !forceDataSchema) { - return URL.createObjectURL(new Blob([data], { - type: contentType - })); - } - const digits = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="; - let buffer = `data:${contentType};base64,`; - for (let i = 0, ii = data.length; i < ii; i += 3) { - const b1 = data[i] & 0xff; - const b2 = data[i + 1] & 0xff; - const b3 = data[i + 2] & 0xff; - const d1 = b1 >> 2, - d2 = (b1 & 3) << 4 | b2 >> 4; - const d3 = i + 1 < ii ? (b2 & 0xf) << 2 | b3 >> 6 : 64; - const d4 = i + 2 < ii ? b3 & 0x3f : 64; - buffer += digits[d1] + digits[d2] + digits[d3] + digits[d4]; - } - return buffer; - }; - const convertImgDataToPng = function () { - const PNG_HEADER = new Uint8Array([0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a]); - const CHUNK_WRAPPER_SIZE = 12; - const crcTable = new Int32Array(256); - for (let i = 0; i < 256; i++) { - let c = i; - for (let h = 0; h < 8; h++) { - if (c & 1) { - c = 0xedb88320 ^ c >> 1 & 0x7fffffff; - } else { - c = c >> 1 & 0x7fffffff; - } - } - crcTable[i] = c; - } - function crc32(data, start, end) { - let crc = -1; - for (let i = start; i < end; i++) { - const a = (crc ^ data[i]) & 0xff; - const b = crcTable[a]; - crc = crc >>> 8 ^ b; - } - return crc ^ -1; - } - function writePngChunk(type, body, data, offset) { - let p = offset; - const len = body.length; - data[p] = len >> 24 & 0xff; - data[p + 1] = len >> 16 & 0xff; - data[p + 2] = len >> 8 & 0xff; - data[p + 3] = len & 0xff; - p += 4; - data[p] = type.charCodeAt(0) & 0xff; - data[p + 1] = type.charCodeAt(1) & 0xff; - data[p + 2] = type.charCodeAt(2) & 0xff; - data[p + 3] = type.charCodeAt(3) & 0xff; - p += 4; - data.set(body, p); - p += body.length; - const crc = crc32(data, offset + 4, p); - data[p] = crc >> 24 & 0xff; - data[p + 1] = crc >> 16 & 0xff; - data[p + 2] = crc >> 8 & 0xff; - data[p + 3] = crc & 0xff; - } - function adler32(data, start, end) { - let a = 1; - let b = 0; - for (let i = start; i < end; ++i) { - a = (a + (data[i] & 0xff)) % 65521; - b = (b + a) % 65521; - } - return b << 16 | a; - } - function deflateSync(literals) { - if (!_is_node.isNodeJS) { - return deflateSyncUncompressed(literals); - } - try { - let input; - if (parseInt(process.versions.node) >= 8) { - input = literals; - } else { - input = Buffer.from(literals); - } - const output = require("zlib").deflateSync(input, { - level: 9 - }); - return output instanceof Uint8Array ? output : new Uint8Array(output); - } catch (e) { - (0, _util.warn)("Not compressing PNG because zlib.deflateSync is unavailable: " + e); - } - return deflateSyncUncompressed(literals); - } - function deflateSyncUncompressed(literals) { - let len = literals.length; - const maxBlockLength = 0xffff; - const deflateBlocks = Math.ceil(len / maxBlockLength); - const idat = new Uint8Array(2 + len + deflateBlocks * 5 + 4); - let pi = 0; - idat[pi++] = 0x78; - idat[pi++] = 0x9c; - let pos = 0; - while (len > maxBlockLength) { - idat[pi++] = 0x00; - idat[pi++] = 0xff; - idat[pi++] = 0xff; - idat[pi++] = 0x00; - idat[pi++] = 0x00; - idat.set(literals.subarray(pos, pos + maxBlockLength), pi); - pi += maxBlockLength; - pos += maxBlockLength; - len -= maxBlockLength; - } - idat[pi++] = 0x01; - idat[pi++] = len & 0xff; - idat[pi++] = len >> 8 & 0xff; - idat[pi++] = ~len & 0xffff & 0xff; - idat[pi++] = (~len & 0xffff) >> 8 & 0xff; - idat.set(literals.subarray(pos), pi); - pi += literals.length - pos; - const adler = adler32(literals, 0, literals.length); - idat[pi++] = adler >> 24 & 0xff; - idat[pi++] = adler >> 16 & 0xff; - idat[pi++] = adler >> 8 & 0xff; - idat[pi++] = adler & 0xff; - return idat; - } - function encode(imgData, kind, forceDataSchema, isMask) { - const width = imgData.width; - const height = imgData.height; - let bitDepth, colorType, lineSize; - const bytes = imgData.data; - switch (kind) { - case _util.ImageKind.GRAYSCALE_1BPP: - colorType = 0; - bitDepth = 1; - lineSize = width + 7 >> 3; - break; - case _util.ImageKind.RGB_24BPP: - colorType = 2; - bitDepth = 8; - lineSize = width * 3; - break; - case _util.ImageKind.RGBA_32BPP: - colorType = 6; - bitDepth = 8; - lineSize = width * 4; - break; - default: - throw new Error("invalid format"); - } - const literals = new Uint8Array((1 + lineSize) * height); - let offsetLiterals = 0, - offsetBytes = 0; - for (let y = 0; y < height; ++y) { - literals[offsetLiterals++] = 0; - literals.set(bytes.subarray(offsetBytes, offsetBytes + lineSize), offsetLiterals); - offsetBytes += lineSize; - offsetLiterals += lineSize; - } - if (kind === _util.ImageKind.GRAYSCALE_1BPP && isMask) { - offsetLiterals = 0; - for (let y = 0; y < height; y++) { - offsetLiterals++; - for (let i = 0; i < lineSize; i++) { - literals[offsetLiterals++] ^= 0xff; - } - } - } - const ihdr = new Uint8Array([width >> 24 & 0xff, width >> 16 & 0xff, width >> 8 & 0xff, width & 0xff, height >> 24 & 0xff, height >> 16 & 0xff, height >> 8 & 0xff, height & 0xff, bitDepth, colorType, 0x00, 0x00, 0x00]); - const idat = deflateSync(literals); - const pngLength = PNG_HEADER.length + CHUNK_WRAPPER_SIZE * 3 + ihdr.length + idat.length; - const data = new Uint8Array(pngLength); - let offset = 0; - data.set(PNG_HEADER, offset); - offset += PNG_HEADER.length; - writePngChunk("IHDR", ihdr, data, offset); - offset += CHUNK_WRAPPER_SIZE + ihdr.length; - writePngChunk("IDATA", idat, data, offset); - offset += CHUNK_WRAPPER_SIZE + idat.length; - writePngChunk("IEND", new Uint8Array(0), data, offset); - return createObjectURL(data, "image/png", forceDataSchema); - } - return function convertImgDataToPng(imgData, forceDataSchema, isMask) { - const kind = imgData.kind === undefined ? _util.ImageKind.GRAYSCALE_1BPP : imgData.kind; - return encode(imgData, kind, forceDataSchema, isMask); - }; - }(); - class SVGExtraState { - constructor() { - this.fontSizeScale = 1; - this.fontWeight = SVG_DEFAULTS.fontWeight; - this.fontSize = 0; - this.textMatrix = _util.IDENTITY_MATRIX; - this.fontMatrix = _util.FONT_IDENTITY_MATRIX; - this.leading = 0; - this.textRenderingMode = _util.TextRenderingMode.FILL; - this.textMatrixScale = 1; - this.x = 0; - this.y = 0; - this.lineX = 0; - this.lineY = 0; - this.charSpacing = 0; - this.wordSpacing = 0; - this.textHScale = 1; - this.textRise = 0; - this.fillColor = SVG_DEFAULTS.fillColor; - this.strokeColor = "#000000"; - this.fillAlpha = 1; - this.strokeAlpha = 1; - this.lineWidth = 1; - this.lineJoin = ""; - this.lineCap = ""; - this.miterLimit = 0; - this.dashArray = []; - this.dashPhase = 0; - this.dependencies = []; - this.activeClipUrl = null; - this.clipGroup = null; - this.maskId = ""; - } - clone() { - return Object.create(this); - } - setCurrentPoint(x, y) { - this.x = x; - this.y = y; - } - } - function opListToTree(opList) { - let opTree = []; - const tmp = []; - for (const opListElement of opList) { - if (opListElement.fn === "save") { - opTree.push({ - fnId: 92, - fn: "group", - items: [] - }); - tmp.push(opTree); - opTree = opTree.at(-1).items; - continue; - } - if (opListElement.fn === "restore") { - opTree = tmp.pop(); - } else { - opTree.push(opListElement); - } - } - return opTree; - } - function pf(value) { - if (Number.isInteger(value)) { - return value.toString(); - } - const s = value.toFixed(10); - let i = s.length - 1; - if (s[i] !== "0") { - return s; - } - do { - i--; - } while (s[i] === "0"); - return s.substring(0, s[i] === "." ? i : i + 1); - } - function pm(m) { - if (m[4] === 0 && m[5] === 0) { - if (m[1] === 0 && m[2] === 0) { - if (m[0] === 1 && m[3] === 1) { - return ""; - } - return `scale(${pf(m[0])} ${pf(m[3])})`; - } - if (m[0] === m[3] && m[1] === -m[2]) { - const a = Math.acos(m[0]) * 180 / Math.PI; - return `rotate(${pf(a)})`; - } - } else { - if (m[0] === 1 && m[1] === 0 && m[2] === 0 && m[3] === 1) { - return `translate(${pf(m[4])} ${pf(m[5])})`; - } - } - return `matrix(${pf(m[0])} ${pf(m[1])} ${pf(m[2])} ${pf(m[3])} ${pf(m[4])} ` + `${pf(m[5])})`; - } - let clipCount = 0; - let maskCount = 0; - let shadingCount = 0; - exports.SVGGraphics = SVGGraphics = class { - constructor(commonObjs, objs, forceDataSchema = false) { - (0, _display_utils.deprecated)("The SVG back-end is no longer maintained and *may* be removed in the future."); - this.svgFactory = new _display_utils.DOMSVGFactory(); - this.current = new SVGExtraState(); - this.transformMatrix = _util.IDENTITY_MATRIX; - this.transformStack = []; - this.extraStack = []; - this.commonObjs = commonObjs; - this.objs = objs; - this.pendingClip = null; - this.pendingEOFill = false; - this.embedFonts = false; - this.embeddedFonts = Object.create(null); - this.cssStyle = null; - this.forceDataSchema = !!forceDataSchema; - this._operatorIdMapping = []; - for (const op in _util.OPS) { - this._operatorIdMapping[_util.OPS[op]] = op; - } - } - getObject(data, fallback = null) { - if (typeof data === "string") { - return data.startsWith("g_") ? this.commonObjs.get(data) : this.objs.get(data); - } - return fallback; - } - save() { - this.transformStack.push(this.transformMatrix); - const old = this.current; - this.extraStack.push(old); - this.current = old.clone(); - } - restore() { - this.transformMatrix = this.transformStack.pop(); - this.current = this.extraStack.pop(); - this.pendingClip = null; - this.tgrp = null; - } - group(items) { - this.save(); - this.executeOpTree(items); - this.restore(); - } - loadDependencies(operatorList) { - const fnArray = operatorList.fnArray; - const argsArray = operatorList.argsArray; - for (let i = 0, ii = fnArray.length; i < ii; i++) { - if (fnArray[i] !== _util.OPS.dependency) { - continue; - } - for (const obj of argsArray[i]) { - const objsPool = obj.startsWith("g_") ? this.commonObjs : this.objs; - const promise = new Promise(resolve => { - objsPool.get(obj, resolve); - }); - this.current.dependencies.push(promise); - } - } - return Promise.all(this.current.dependencies); - } - transform(a, b, c, d, e, f) { - const transformMatrix = [a, b, c, d, e, f]; - this.transformMatrix = _util.Util.transform(this.transformMatrix, transformMatrix); - this.tgrp = null; - } - getSVG(operatorList, viewport) { - this.viewport = viewport; - const svgElement = this._initialize(viewport); - return this.loadDependencies(operatorList).then(() => { - this.transformMatrix = _util.IDENTITY_MATRIX; - this.executeOpTree(this.convertOpList(operatorList)); - return svgElement; - }); - } - convertOpList(operatorList) { - const operatorIdMapping = this._operatorIdMapping; - const argsArray = operatorList.argsArray; - const fnArray = operatorList.fnArray; - const opList = []; - for (let i = 0, ii = fnArray.length; i < ii; i++) { - const fnId = fnArray[i]; - opList.push({ - fnId, - fn: operatorIdMapping[fnId], - args: argsArray[i] - }); - } - return opListToTree(opList); - } - executeOpTree(opTree) { - for (const opTreeElement of opTree) { - const fn = opTreeElement.fn; - const fnId = opTreeElement.fnId; - const args = opTreeElement.args; - switch (fnId | 0) { - case _util.OPS.beginText: - this.beginText(); - break; - case _util.OPS.dependency: - break; - case _util.OPS.setLeading: - this.setLeading(args); - break; - case _util.OPS.setLeadingMoveText: - this.setLeadingMoveText(args[0], args[1]); - break; - case _util.OPS.setFont: - this.setFont(args); - break; - case _util.OPS.showText: - this.showText(args[0]); - break; - case _util.OPS.showSpacedText: - this.showText(args[0]); - break; - case _util.OPS.endText: - this.endText(); - break; - case _util.OPS.moveText: - this.moveText(args[0], args[1]); - break; - case _util.OPS.setCharSpacing: - this.setCharSpacing(args[0]); - break; - case _util.OPS.setWordSpacing: - this.setWordSpacing(args[0]); - break; - case _util.OPS.setHScale: - this.setHScale(args[0]); - break; - case _util.OPS.setTextMatrix: - this.setTextMatrix(args[0], args[1], args[2], args[3], args[4], args[5]); - break; - case _util.OPS.setTextRise: - this.setTextRise(args[0]); - break; - case _util.OPS.setTextRenderingMode: - this.setTextRenderingMode(args[0]); - break; - case _util.OPS.setLineWidth: - this.setLineWidth(args[0]); - break; - case _util.OPS.setLineJoin: - this.setLineJoin(args[0]); - break; - case _util.OPS.setLineCap: - this.setLineCap(args[0]); - break; - case _util.OPS.setMiterLimit: - this.setMiterLimit(args[0]); - break; - case _util.OPS.setFillRGBColor: - this.setFillRGBColor(args[0], args[1], args[2]); - break; - case _util.OPS.setStrokeRGBColor: - this.setStrokeRGBColor(args[0], args[1], args[2]); - break; - case _util.OPS.setStrokeColorN: - this.setStrokeColorN(args); - break; - case _util.OPS.setFillColorN: - this.setFillColorN(args); - break; - case _util.OPS.shadingFill: - this.shadingFill(args[0]); - break; - case _util.OPS.setDash: - this.setDash(args[0], args[1]); - break; - case _util.OPS.setRenderingIntent: - this.setRenderingIntent(args[0]); - break; - case _util.OPS.setFlatness: - this.setFlatness(args[0]); - break; - case _util.OPS.setGState: - this.setGState(args[0]); - break; - case _util.OPS.fill: - this.fill(); - break; - case _util.OPS.eoFill: - this.eoFill(); - break; - case _util.OPS.stroke: - this.stroke(); - break; - case _util.OPS.fillStroke: - this.fillStroke(); - break; - case _util.OPS.eoFillStroke: - this.eoFillStroke(); - break; - case _util.OPS.clip: - this.clip("nonzero"); - break; - case _util.OPS.eoClip: - this.clip("evenodd"); - break; - case _util.OPS.paintSolidColorImageMask: - this.paintSolidColorImageMask(); - break; - case _util.OPS.paintImageXObject: - this.paintImageXObject(args[0]); - break; - case _util.OPS.paintInlineImageXObject: - this.paintInlineImageXObject(args[0]); - break; - case _util.OPS.paintImageMaskXObject: - this.paintImageMaskXObject(args[0]); - break; - case _util.OPS.paintFormXObjectBegin: - this.paintFormXObjectBegin(args[0], args[1]); - break; - case _util.OPS.paintFormXObjectEnd: - this.paintFormXObjectEnd(); - break; - case _util.OPS.closePath: - this.closePath(); - break; - case _util.OPS.closeStroke: - this.closeStroke(); - break; - case _util.OPS.closeFillStroke: - this.closeFillStroke(); - break; - case _util.OPS.closeEOFillStroke: - this.closeEOFillStroke(); - break; - case _util.OPS.nextLine: - this.nextLine(); - break; - case _util.OPS.transform: - this.transform(args[0], args[1], args[2], args[3], args[4], args[5]); - break; - case _util.OPS.constructPath: - this.constructPath(args[0], args[1]); - break; - case _util.OPS.endPath: - this.endPath(); - break; - case 92: - this.group(opTreeElement.items); - break; - default: - (0, _util.warn)(`Unimplemented operator ${fn}`); - break; - } - } - } - setWordSpacing(wordSpacing) { - this.current.wordSpacing = wordSpacing; - } - setCharSpacing(charSpacing) { - this.current.charSpacing = charSpacing; - } - nextLine() { - this.moveText(0, this.current.leading); - } - setTextMatrix(a, b, c, d, e, f) { - const current = this.current; - current.textMatrix = current.lineMatrix = [a, b, c, d, e, f]; - current.textMatrixScale = Math.hypot(a, b); - current.x = current.lineX = 0; - current.y = current.lineY = 0; - current.xcoords = []; - current.ycoords = []; - current.tspan = this.svgFactory.createElement("svg:tspan"); - current.tspan.setAttributeNS(null, "font-family", current.fontFamily); - current.tspan.setAttributeNS(null, "font-size", `${pf(current.fontSize)}px`); - current.tspan.setAttributeNS(null, "y", pf(-current.y)); - current.txtElement = this.svgFactory.createElement("svg:text"); - current.txtElement.append(current.tspan); - } - beginText() { - const current = this.current; - current.x = current.lineX = 0; - current.y = current.lineY = 0; - current.textMatrix = _util.IDENTITY_MATRIX; - current.lineMatrix = _util.IDENTITY_MATRIX; - current.textMatrixScale = 1; - current.tspan = this.svgFactory.createElement("svg:tspan"); - current.txtElement = this.svgFactory.createElement("svg:text"); - current.txtgrp = this.svgFactory.createElement("svg:g"); - current.xcoords = []; - current.ycoords = []; - } - moveText(x, y) { - const current = this.current; - current.x = current.lineX += x; - current.y = current.lineY += y; - current.xcoords = []; - current.ycoords = []; - current.tspan = this.svgFactory.createElement("svg:tspan"); - current.tspan.setAttributeNS(null, "font-family", current.fontFamily); - current.tspan.setAttributeNS(null, "font-size", `${pf(current.fontSize)}px`); - current.tspan.setAttributeNS(null, "y", pf(-current.y)); - } - showText(glyphs) { - const current = this.current; - const font = current.font; - const fontSize = current.fontSize; - if (fontSize === 0) { - return; - } - const fontSizeScale = current.fontSizeScale; - const charSpacing = current.charSpacing; - const wordSpacing = current.wordSpacing; - const fontDirection = current.fontDirection; - const textHScale = current.textHScale * fontDirection; - const vertical = font.vertical; - const spacingDir = vertical ? 1 : -1; - const defaultVMetrics = font.defaultVMetrics; - const widthAdvanceScale = fontSize * current.fontMatrix[0]; - let x = 0; - for (const glyph of glyphs) { - if (glyph === null) { - x += fontDirection * wordSpacing; - continue; - } else if (typeof glyph === "number") { - x += spacingDir * glyph * fontSize / 1000; - continue; - } - const spacing = (glyph.isSpace ? wordSpacing : 0) + charSpacing; - const character = glyph.fontChar; - let scaledX, scaledY; - let width = glyph.width; - if (vertical) { - let vx; - const vmetric = glyph.vmetric || defaultVMetrics; - vx = glyph.vmetric ? vmetric[1] : width * 0.5; - vx = -vx * widthAdvanceScale; - const vy = vmetric[2] * widthAdvanceScale; - width = vmetric ? -vmetric[0] : width; - scaledX = vx / fontSizeScale; - scaledY = (x + vy) / fontSizeScale; - } else { - scaledX = x / fontSizeScale; - scaledY = 0; - } - if (glyph.isInFont || font.missingFile) { - current.xcoords.push(current.x + scaledX); - if (vertical) { - current.ycoords.push(-current.y + scaledY); - } - current.tspan.textContent += character; - } else {} - let charWidth; - if (vertical) { - charWidth = width * widthAdvanceScale - spacing * fontDirection; - } else { - charWidth = width * widthAdvanceScale + spacing * fontDirection; - } - x += charWidth; - } - current.tspan.setAttributeNS(null, "x", current.xcoords.map(pf).join(" ")); - if (vertical) { - current.tspan.setAttributeNS(null, "y", current.ycoords.map(pf).join(" ")); - } else { - current.tspan.setAttributeNS(null, "y", pf(-current.y)); - } - if (vertical) { - current.y -= x; - } else { - current.x += x * textHScale; - } - current.tspan.setAttributeNS(null, "font-family", current.fontFamily); - current.tspan.setAttributeNS(null, "font-size", `${pf(current.fontSize)}px`); - if (current.fontStyle !== SVG_DEFAULTS.fontStyle) { - current.tspan.setAttributeNS(null, "font-style", current.fontStyle); - } - if (current.fontWeight !== SVG_DEFAULTS.fontWeight) { - current.tspan.setAttributeNS(null, "font-weight", current.fontWeight); - } - const fillStrokeMode = current.textRenderingMode & _util.TextRenderingMode.FILL_STROKE_MASK; - if (fillStrokeMode === _util.TextRenderingMode.FILL || fillStrokeMode === _util.TextRenderingMode.FILL_STROKE) { - if (current.fillColor !== SVG_DEFAULTS.fillColor) { - current.tspan.setAttributeNS(null, "fill", current.fillColor); - } - if (current.fillAlpha < 1) { - current.tspan.setAttributeNS(null, "fill-opacity", current.fillAlpha); - } - } else if (current.textRenderingMode === _util.TextRenderingMode.ADD_TO_PATH) { - current.tspan.setAttributeNS(null, "fill", "transparent"); - } else { - current.tspan.setAttributeNS(null, "fill", "none"); - } - if (fillStrokeMode === _util.TextRenderingMode.STROKE || fillStrokeMode === _util.TextRenderingMode.FILL_STROKE) { - const lineWidthScale = 1 / (current.textMatrixScale || 1); - this._setStrokeAttributes(current.tspan, lineWidthScale); - } - let textMatrix = current.textMatrix; - if (current.textRise !== 0) { - textMatrix = textMatrix.slice(); - textMatrix[5] += current.textRise; - } - current.txtElement.setAttributeNS(null, "transform", `${pm(textMatrix)} scale(${pf(textHScale)}, -1)`); - current.txtElement.setAttributeNS(XML_NS, "xml:space", "preserve"); - current.txtElement.append(current.tspan); - current.txtgrp.append(current.txtElement); - this._ensureTransformGroup().append(current.txtElement); - } - setLeadingMoveText(x, y) { - this.setLeading(-y); - this.moveText(x, y); - } - addFontStyle(fontObj) { - if (!fontObj.data) { - throw new Error("addFontStyle: No font data available, " + 'ensure that the "fontExtraProperties" API parameter is set.'); - } - if (!this.cssStyle) { - this.cssStyle = this.svgFactory.createElement("svg:style"); - this.cssStyle.setAttributeNS(null, "type", "text/css"); - this.defs.append(this.cssStyle); - } - const url = createObjectURL(fontObj.data, fontObj.mimetype, this.forceDataSchema); - this.cssStyle.textContent += `@font-face { font-family: "${fontObj.loadedName}";` + ` src: url(${url}); }\n`; - } - setFont(details) { - const current = this.current; - const fontObj = this.commonObjs.get(details[0]); - let size = details[1]; - current.font = fontObj; - if (this.embedFonts && !fontObj.missingFile && !this.embeddedFonts[fontObj.loadedName]) { - this.addFontStyle(fontObj); - this.embeddedFonts[fontObj.loadedName] = fontObj; - } - current.fontMatrix = fontObj.fontMatrix || _util.FONT_IDENTITY_MATRIX; - let bold = "normal"; - if (fontObj.black) { - bold = "900"; - } else if (fontObj.bold) { - bold = "bold"; - } - const italic = fontObj.italic ? "italic" : "normal"; - if (size < 0) { - size = -size; - current.fontDirection = -1; - } else { - current.fontDirection = 1; - } - current.fontSize = size; - current.fontFamily = fontObj.loadedName; - current.fontWeight = bold; - current.fontStyle = italic; - current.tspan = this.svgFactory.createElement("svg:tspan"); - current.tspan.setAttributeNS(null, "y", pf(-current.y)); - current.xcoords = []; - current.ycoords = []; - } - endText() { - const current = this.current; - if (current.textRenderingMode & _util.TextRenderingMode.ADD_TO_PATH_FLAG && current.txtElement?.hasChildNodes()) { - current.element = current.txtElement; - this.clip("nonzero"); - this.endPath(); - } - } - setLineWidth(width) { - if (width > 0) { - this.current.lineWidth = width; - } - } - setLineCap(style) { - this.current.lineCap = LINE_CAP_STYLES[style]; - } - setLineJoin(style) { - this.current.lineJoin = LINE_JOIN_STYLES[style]; - } - setMiterLimit(limit) { - this.current.miterLimit = limit; - } - setStrokeAlpha(strokeAlpha) { - this.current.strokeAlpha = strokeAlpha; - } - setStrokeRGBColor(r, g, b) { - this.current.strokeColor = _util.Util.makeHexColor(r, g, b); - } - setFillAlpha(fillAlpha) { - this.current.fillAlpha = fillAlpha; - } - setFillRGBColor(r, g, b) { - this.current.fillColor = _util.Util.makeHexColor(r, g, b); - this.current.tspan = this.svgFactory.createElement("svg:tspan"); - this.current.xcoords = []; - this.current.ycoords = []; - } - setStrokeColorN(args) { - this.current.strokeColor = this._makeColorN_Pattern(args); - } - setFillColorN(args) { - this.current.fillColor = this._makeColorN_Pattern(args); - } - shadingFill(args) { - const width = this.viewport.width; - const height = this.viewport.height; - const inv = _util.Util.inverseTransform(this.transformMatrix); - const bl = _util.Util.applyTransform([0, 0], inv); - const br = _util.Util.applyTransform([0, height], inv); - const ul = _util.Util.applyTransform([width, 0], inv); - const ur = _util.Util.applyTransform([width, height], inv); - const x0 = Math.min(bl[0], br[0], ul[0], ur[0]); - const y0 = Math.min(bl[1], br[1], ul[1], ur[1]); - const x1 = Math.max(bl[0], br[0], ul[0], ur[0]); - const y1 = Math.max(bl[1], br[1], ul[1], ur[1]); - const rect = this.svgFactory.createElement("svg:rect"); - rect.setAttributeNS(null, "x", x0); - rect.setAttributeNS(null, "y", y0); - rect.setAttributeNS(null, "width", x1 - x0); - rect.setAttributeNS(null, "height", y1 - y0); - rect.setAttributeNS(null, "fill", this._makeShadingPattern(args)); - if (this.current.fillAlpha < 1) { - rect.setAttributeNS(null, "fill-opacity", this.current.fillAlpha); - } - this._ensureTransformGroup().append(rect); - } - _makeColorN_Pattern(args) { - if (args[0] === "TilingPattern") { - return this._makeTilingPattern(args); - } - return this._makeShadingPattern(args); - } - _makeTilingPattern(args) { - const color = args[1]; - const operatorList = args[2]; - const matrix = args[3] || _util.IDENTITY_MATRIX; - const [x0, y0, x1, y1] = args[4]; - const xstep = args[5]; - const ystep = args[6]; - const paintType = args[7]; - const tilingId = `shading${shadingCount++}`; - const [tx0, ty0, tx1, ty1] = _util.Util.normalizeRect([..._util.Util.applyTransform([x0, y0], matrix), ..._util.Util.applyTransform([x1, y1], matrix)]); - const [xscale, yscale] = _util.Util.singularValueDecompose2dScale(matrix); - const txstep = xstep * xscale; - const tystep = ystep * yscale; - const tiling = this.svgFactory.createElement("svg:pattern"); - tiling.setAttributeNS(null, "id", tilingId); - tiling.setAttributeNS(null, "patternUnits", "userSpaceOnUse"); - tiling.setAttributeNS(null, "width", txstep); - tiling.setAttributeNS(null, "height", tystep); - tiling.setAttributeNS(null, "x", `${tx0}`); - tiling.setAttributeNS(null, "y", `${ty0}`); - const svg = this.svg; - const transformMatrix = this.transformMatrix; - const fillColor = this.current.fillColor; - const strokeColor = this.current.strokeColor; - const bbox = this.svgFactory.create(tx1 - tx0, ty1 - ty0); - this.svg = bbox; - this.transformMatrix = matrix; - if (paintType === 2) { - const cssColor = _util.Util.makeHexColor(...color); - this.current.fillColor = cssColor; - this.current.strokeColor = cssColor; - } - this.executeOpTree(this.convertOpList(operatorList)); - this.svg = svg; - this.transformMatrix = transformMatrix; - this.current.fillColor = fillColor; - this.current.strokeColor = strokeColor; - tiling.append(bbox.childNodes[0]); - this.defs.append(tiling); - return `url(#${tilingId})`; - } - _makeShadingPattern(args) { - if (typeof args === "string") { - args = this.objs.get(args); - } - switch (args[0]) { - case "RadialAxial": - const shadingId = `shading${shadingCount++}`; - const colorStops = args[3]; - let gradient; - switch (args[1]) { - case "axial": - const point0 = args[4]; - const point1 = args[5]; - gradient = this.svgFactory.createElement("svg:linearGradient"); - gradient.setAttributeNS(null, "id", shadingId); - gradient.setAttributeNS(null, "gradientUnits", "userSpaceOnUse"); - gradient.setAttributeNS(null, "x1", point0[0]); - gradient.setAttributeNS(null, "y1", point0[1]); - gradient.setAttributeNS(null, "x2", point1[0]); - gradient.setAttributeNS(null, "y2", point1[1]); - break; - case "radial": - const focalPoint = args[4]; - const circlePoint = args[5]; - const focalRadius = args[6]; - const circleRadius = args[7]; - gradient = this.svgFactory.createElement("svg:radialGradient"); - gradient.setAttributeNS(null, "id", shadingId); - gradient.setAttributeNS(null, "gradientUnits", "userSpaceOnUse"); - gradient.setAttributeNS(null, "cx", circlePoint[0]); - gradient.setAttributeNS(null, "cy", circlePoint[1]); - gradient.setAttributeNS(null, "r", circleRadius); - gradient.setAttributeNS(null, "fx", focalPoint[0]); - gradient.setAttributeNS(null, "fy", focalPoint[1]); - gradient.setAttributeNS(null, "fr", focalRadius); - break; - default: - throw new Error(`Unknown RadialAxial type: ${args[1]}`); - } - for (const colorStop of colorStops) { - const stop = this.svgFactory.createElement("svg:stop"); - stop.setAttributeNS(null, "offset", colorStop[0]); - stop.setAttributeNS(null, "stop-color", colorStop[1]); - gradient.append(stop); - } - this.defs.append(gradient); - return `url(#${shadingId})`; - case "Mesh": - (0, _util.warn)("Unimplemented pattern Mesh"); - return null; - case "Dummy": - return "hotpink"; - default: - throw new Error(`Unknown IR type: ${args[0]}`); - } - } - setDash(dashArray, dashPhase) { - this.current.dashArray = dashArray; - this.current.dashPhase = dashPhase; - } - constructPath(ops, args) { - const current = this.current; - let x = current.x, - y = current.y; - let d = []; - let j = 0; - for (const op of ops) { - switch (op | 0) { - case _util.OPS.rectangle: - x = args[j++]; - y = args[j++]; - const width = args[j++]; - const height = args[j++]; - const xw = x + width; - const yh = y + height; - d.push("M", pf(x), pf(y), "L", pf(xw), pf(y), "L", pf(xw), pf(yh), "L", pf(x), pf(yh), "Z"); - break; - case _util.OPS.moveTo: - x = args[j++]; - y = args[j++]; - d.push("M", pf(x), pf(y)); - break; - case _util.OPS.lineTo: - x = args[j++]; - y = args[j++]; - d.push("L", pf(x), pf(y)); - break; - case _util.OPS.curveTo: - x = args[j + 4]; - y = args[j + 5]; - d.push("C", pf(args[j]), pf(args[j + 1]), pf(args[j + 2]), pf(args[j + 3]), pf(x), pf(y)); - j += 6; - break; - case _util.OPS.curveTo2: - d.push("C", pf(x), pf(y), pf(args[j]), pf(args[j + 1]), pf(args[j + 2]), pf(args[j + 3])); - x = args[j + 2]; - y = args[j + 3]; - j += 4; - break; - case _util.OPS.curveTo3: - x = args[j + 2]; - y = args[j + 3]; - d.push("C", pf(args[j]), pf(args[j + 1]), pf(x), pf(y), pf(x), pf(y)); - j += 4; - break; - case _util.OPS.closePath: - d.push("Z"); - break; - } - } - d = d.join(" "); - if (current.path && ops.length > 0 && ops[0] !== _util.OPS.rectangle && ops[0] !== _util.OPS.moveTo) { - d = current.path.getAttributeNS(null, "d") + d; - } else { - current.path = this.svgFactory.createElement("svg:path"); - this._ensureTransformGroup().append(current.path); - } - current.path.setAttributeNS(null, "d", d); - current.path.setAttributeNS(null, "fill", "none"); - current.element = current.path; - current.setCurrentPoint(x, y); - } - endPath() { - const current = this.current; - current.path = null; - if (!this.pendingClip) { - return; - } - if (!current.element) { - this.pendingClip = null; - return; - } - const clipId = `clippath${clipCount++}`; - const clipPath = this.svgFactory.createElement("svg:clipPath"); - clipPath.setAttributeNS(null, "id", clipId); - clipPath.setAttributeNS(null, "transform", pm(this.transformMatrix)); - const clipElement = current.element.cloneNode(true); - if (this.pendingClip === "evenodd") { - clipElement.setAttributeNS(null, "clip-rule", "evenodd"); - } else { - clipElement.setAttributeNS(null, "clip-rule", "nonzero"); - } - this.pendingClip = null; - clipPath.append(clipElement); - this.defs.append(clipPath); - if (current.activeClipUrl) { - current.clipGroup = null; - for (const prev of this.extraStack) { - prev.clipGroup = null; - } - clipPath.setAttributeNS(null, "clip-path", current.activeClipUrl); - } - current.activeClipUrl = `url(#${clipId})`; - this.tgrp = null; - } - clip(type) { - this.pendingClip = type; - } - closePath() { - const current = this.current; - if (current.path) { - const d = `${current.path.getAttributeNS(null, "d")}Z`; - current.path.setAttributeNS(null, "d", d); - } - } - setLeading(leading) { - this.current.leading = -leading; - } - setTextRise(textRise) { - this.current.textRise = textRise; - } - setTextRenderingMode(textRenderingMode) { - this.current.textRenderingMode = textRenderingMode; - } - setHScale(scale) { - this.current.textHScale = scale / 100; - } - setRenderingIntent(intent) {} - setFlatness(flatness) {} - setGState(states) { - for (const [key, value] of states) { - switch (key) { - case "LW": - this.setLineWidth(value); - break; - case "LC": - this.setLineCap(value); - break; - case "LJ": - this.setLineJoin(value); - break; - case "ML": - this.setMiterLimit(value); - break; - case "D": - this.setDash(value[0], value[1]); - break; - case "RI": - this.setRenderingIntent(value); - break; - case "FL": - this.setFlatness(value); - break; - case "Font": - this.setFont(value); - break; - case "CA": - this.setStrokeAlpha(value); - break; - case "ca": - this.setFillAlpha(value); - break; - default: - (0, _util.warn)(`Unimplemented graphic state operator ${key}`); - break; - } - } - } - fill() { - const current = this.current; - if (current.element) { - current.element.setAttributeNS(null, "fill", current.fillColor); - current.element.setAttributeNS(null, "fill-opacity", current.fillAlpha); - this.endPath(); - } - } - stroke() { - const current = this.current; - if (current.element) { - this._setStrokeAttributes(current.element); - current.element.setAttributeNS(null, "fill", "none"); - this.endPath(); - } - } - _setStrokeAttributes(element, lineWidthScale = 1) { - const current = this.current; - let dashArray = current.dashArray; - if (lineWidthScale !== 1 && dashArray.length > 0) { - dashArray = dashArray.map(function (value) { - return lineWidthScale * value; - }); - } - element.setAttributeNS(null, "stroke", current.strokeColor); - element.setAttributeNS(null, "stroke-opacity", current.strokeAlpha); - element.setAttributeNS(null, "stroke-miterlimit", pf(current.miterLimit)); - element.setAttributeNS(null, "stroke-linecap", current.lineCap); - element.setAttributeNS(null, "stroke-linejoin", current.lineJoin); - element.setAttributeNS(null, "stroke-width", pf(lineWidthScale * current.lineWidth) + "px"); - element.setAttributeNS(null, "stroke-dasharray", dashArray.map(pf).join(" ")); - element.setAttributeNS(null, "stroke-dashoffset", pf(lineWidthScale * current.dashPhase) + "px"); - } - eoFill() { - this.current.element?.setAttributeNS(null, "fill-rule", "evenodd"); - this.fill(); - } - fillStroke() { - this.stroke(); - this.fill(); - } - eoFillStroke() { - this.current.element?.setAttributeNS(null, "fill-rule", "evenodd"); - this.fillStroke(); - } - closeStroke() { - this.closePath(); - this.stroke(); - } - closeFillStroke() { - this.closePath(); - this.fillStroke(); - } - closeEOFillStroke() { - this.closePath(); - this.eoFillStroke(); - } - paintSolidColorImageMask() { - const rect = this.svgFactory.createElement("svg:rect"); - rect.setAttributeNS(null, "x", "0"); - rect.setAttributeNS(null, "y", "0"); - rect.setAttributeNS(null, "width", "1px"); - rect.setAttributeNS(null, "height", "1px"); - rect.setAttributeNS(null, "fill", this.current.fillColor); - this._ensureTransformGroup().append(rect); - } - paintImageXObject(objId) { - const imgData = this.getObject(objId); - if (!imgData) { - (0, _util.warn)(`Dependent image with object ID ${objId} is not ready yet`); - return; - } - this.paintInlineImageXObject(imgData); - } - paintInlineImageXObject(imgData, mask) { - const width = imgData.width; - const height = imgData.height; - const imgSrc = convertImgDataToPng(imgData, this.forceDataSchema, !!mask); - const cliprect = this.svgFactory.createElement("svg:rect"); - cliprect.setAttributeNS(null, "x", "0"); - cliprect.setAttributeNS(null, "y", "0"); - cliprect.setAttributeNS(null, "width", pf(width)); - cliprect.setAttributeNS(null, "height", pf(height)); - this.current.element = cliprect; - this.clip("nonzero"); - const imgEl = this.svgFactory.createElement("svg:image"); - imgEl.setAttributeNS(XLINK_NS, "xlink:href", imgSrc); - imgEl.setAttributeNS(null, "x", "0"); - imgEl.setAttributeNS(null, "y", pf(-height)); - imgEl.setAttributeNS(null, "width", pf(width) + "px"); - imgEl.setAttributeNS(null, "height", pf(height) + "px"); - imgEl.setAttributeNS(null, "transform", `scale(${pf(1 / width)} ${pf(-1 / height)})`); - if (mask) { - mask.append(imgEl); - } else { - this._ensureTransformGroup().append(imgEl); - } - } - paintImageMaskXObject(img) { - const imgData = this.getObject(img.data, img); - if (imgData.bitmap) { - (0, _util.warn)("paintImageMaskXObject: ImageBitmap support is not implemented, " + "ensure that the `isOffscreenCanvasSupported` API parameter is disabled."); - return; - } - const current = this.current; - const width = imgData.width; - const height = imgData.height; - const fillColor = current.fillColor; - current.maskId = `mask${maskCount++}`; - const mask = this.svgFactory.createElement("svg:mask"); - mask.setAttributeNS(null, "id", current.maskId); - const rect = this.svgFactory.createElement("svg:rect"); - rect.setAttributeNS(null, "x", "0"); - rect.setAttributeNS(null, "y", "0"); - rect.setAttributeNS(null, "width", pf(width)); - rect.setAttributeNS(null, "height", pf(height)); - rect.setAttributeNS(null, "fill", fillColor); - rect.setAttributeNS(null, "mask", `url(#${current.maskId})`); - this.defs.append(mask); - this._ensureTransformGroup().append(rect); - this.paintInlineImageXObject(imgData, mask); - } - paintFormXObjectBegin(matrix, bbox) { - if (Array.isArray(matrix) && matrix.length === 6) { - this.transform(matrix[0], matrix[1], matrix[2], matrix[3], matrix[4], matrix[5]); - } - if (bbox) { - const width = bbox[2] - bbox[0]; - const height = bbox[3] - bbox[1]; - const cliprect = this.svgFactory.createElement("svg:rect"); - cliprect.setAttributeNS(null, "x", bbox[0]); - cliprect.setAttributeNS(null, "y", bbox[1]); - cliprect.setAttributeNS(null, "width", pf(width)); - cliprect.setAttributeNS(null, "height", pf(height)); - this.current.element = cliprect; - this.clip("nonzero"); - this.endPath(); - } - } - paintFormXObjectEnd() {} - _initialize(viewport) { - const svg = this.svgFactory.create(viewport.width, viewport.height); - const definitions = this.svgFactory.createElement("svg:defs"); - svg.append(definitions); - this.defs = definitions; - const rootGroup = this.svgFactory.createElement("svg:g"); - rootGroup.setAttributeNS(null, "transform", pm(viewport.transform)); - svg.append(rootGroup); - this.svg = rootGroup; - return svg; - } - _ensureClipGroup() { - if (!this.current.clipGroup) { - const clipGroup = this.svgFactory.createElement("svg:g"); - clipGroup.setAttributeNS(null, "clip-path", this.current.activeClipUrl); - this.svg.append(clipGroup); - this.current.clipGroup = clipGroup; - } - return this.current.clipGroup; - } - _ensureTransformGroup() { - if (!this.tgrp) { - this.tgrp = this.svgFactory.createElement("svg:g"); - this.tgrp.setAttributeNS(null, "transform", pm(this.transformMatrix)); - if (this.current.activeClipUrl) { - this._ensureClipGroup().append(this.tgrp); - } else { - this.svg.append(this.tgrp); - } - } - return this.tgrp; - } - }; -} - -/***/ }) -/******/ ]); -/************************************************************************/ -/******/ // The module cache -/******/ var __webpack_module_cache__ = {}; -/******/ -/******/ // The require function -/******/ function __w_pdfjs_require__(moduleId) { -/******/ // Check if module is in cache -/******/ var cachedModule = __webpack_module_cache__[moduleId]; -/******/ if (cachedModule !== undefined) { -/******/ return cachedModule.exports; -/******/ } -/******/ // Create a new module (and put it into the cache) -/******/ var module = __webpack_module_cache__[moduleId] = { -/******/ // no module.id needed -/******/ // no module.loaded needed -/******/ exports: {} -/******/ }; -/******/ -/******/ // Execute the module function -/******/ __webpack_modules__[moduleId](module, module.exports, __w_pdfjs_require__); -/******/ -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } -/******/ -/************************************************************************/ -var __webpack_exports__ = {}; -// This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk. -(() => { -var exports = __webpack_exports__; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -Object.defineProperty(exports, "AbortException", ({ - enumerable: true, - get: function () { - return _util.AbortException; - } -})); -Object.defineProperty(exports, "AnnotationEditorLayer", ({ - enumerable: true, - get: function () { - return _annotation_editor_layer.AnnotationEditorLayer; - } -})); -Object.defineProperty(exports, "AnnotationEditorParamsType", ({ - enumerable: true, - get: function () { - return _util.AnnotationEditorParamsType; - } -})); -Object.defineProperty(exports, "AnnotationEditorType", ({ - enumerable: true, - get: function () { - return _util.AnnotationEditorType; - } -})); -Object.defineProperty(exports, "AnnotationEditorUIManager", ({ - enumerable: true, - get: function () { - return _tools.AnnotationEditorUIManager; - } -})); -Object.defineProperty(exports, "AnnotationLayer", ({ - enumerable: true, - get: function () { - return _annotation_layer.AnnotationLayer; - } -})); -Object.defineProperty(exports, "AnnotationMode", ({ - enumerable: true, - get: function () { - return _util.AnnotationMode; - } -})); -Object.defineProperty(exports, "CMapCompressionType", ({ - enumerable: true, - get: function () { - return _util.CMapCompressionType; - } -})); -Object.defineProperty(exports, "FeatureTest", ({ - enumerable: true, - get: function () { - return _util.FeatureTest; - } -})); -Object.defineProperty(exports, "GlobalWorkerOptions", ({ - enumerable: true, - get: function () { - return _worker_options.GlobalWorkerOptions; - } -})); -Object.defineProperty(exports, "InvalidPDFException", ({ - enumerable: true, - get: function () { - return _util.InvalidPDFException; - } -})); -Object.defineProperty(exports, "MissingPDFException", ({ - enumerable: true, - get: function () { - return _util.MissingPDFException; - } -})); -Object.defineProperty(exports, "OPS", ({ - enumerable: true, - get: function () { - return _util.OPS; - } -})); -Object.defineProperty(exports, "PDFDataRangeTransport", ({ - enumerable: true, - get: function () { - return _api.PDFDataRangeTransport; - } -})); -Object.defineProperty(exports, "PDFDateString", ({ - enumerable: true, - get: function () { - return _display_utils.PDFDateString; - } -})); -Object.defineProperty(exports, "PDFWorker", ({ - enumerable: true, - get: function () { - return _api.PDFWorker; - } -})); -Object.defineProperty(exports, "PasswordResponses", ({ - enumerable: true, - get: function () { - return _util.PasswordResponses; - } -})); -Object.defineProperty(exports, "PermissionFlag", ({ - enumerable: true, - get: function () { - return _util.PermissionFlag; - } -})); -Object.defineProperty(exports, "PixelsPerInch", ({ - enumerable: true, - get: function () { - return _display_utils.PixelsPerInch; - } -})); -Object.defineProperty(exports, "RenderingCancelledException", ({ - enumerable: true, - get: function () { - return _display_utils.RenderingCancelledException; - } -})); -Object.defineProperty(exports, "SVGGraphics", ({ - enumerable: true, - get: function () { - return _svg.SVGGraphics; - } -})); -Object.defineProperty(exports, "UNSUPPORTED_FEATURES", ({ - enumerable: true, - get: function () { - return _util.UNSUPPORTED_FEATURES; - } -})); -Object.defineProperty(exports, "UnexpectedResponseException", ({ - enumerable: true, - get: function () { - return _util.UnexpectedResponseException; - } -})); -Object.defineProperty(exports, "Util", ({ - enumerable: true, - get: function () { - return _util.Util; - } -})); -Object.defineProperty(exports, "VerbosityLevel", ({ - enumerable: true, - get: function () { - return _util.VerbosityLevel; - } -})); -Object.defineProperty(exports, "XfaLayer", ({ - enumerable: true, - get: function () { - return _xfa_layer.XfaLayer; - } -})); -Object.defineProperty(exports, "build", ({ - enumerable: true, - get: function () { - return _api.build; - } -})); -Object.defineProperty(exports, "createPromiseCapability", ({ - enumerable: true, - get: function () { - return _util.createPromiseCapability; - } -})); -Object.defineProperty(exports, "createValidAbsoluteUrl", ({ - enumerable: true, - get: function () { - return _util.createValidAbsoluteUrl; - } -})); -Object.defineProperty(exports, "getDocument", ({ - enumerable: true, - get: function () { - return _api.getDocument; - } -})); -Object.defineProperty(exports, "getFilenameFromUrl", ({ - enumerable: true, - get: function () { - return _display_utils.getFilenameFromUrl; - } -})); -Object.defineProperty(exports, "getPdfFilenameFromUrl", ({ - enumerable: true, - get: function () { - return _display_utils.getPdfFilenameFromUrl; - } -})); -Object.defineProperty(exports, "getXfaPageViewport", ({ - enumerable: true, - get: function () { - return _display_utils.getXfaPageViewport; - } -})); -Object.defineProperty(exports, "isDataScheme", ({ - enumerable: true, - get: function () { - return _display_utils.isDataScheme; - } -})); -Object.defineProperty(exports, "isPdfFile", ({ - enumerable: true, - get: function () { - return _display_utils.isPdfFile; - } -})); -Object.defineProperty(exports, "loadScript", ({ - enumerable: true, - get: function () { - return _display_utils.loadScript; - } -})); -Object.defineProperty(exports, "renderTextLayer", ({ - enumerable: true, - get: function () { - return _text_layer.renderTextLayer; - } -})); -Object.defineProperty(exports, "setLayerDimensions", ({ - enumerable: true, - get: function () { - return _display_utils.setLayerDimensions; - } -})); -Object.defineProperty(exports, "shadow", ({ - enumerable: true, - get: function () { - return _util.shadow; - } -})); -Object.defineProperty(exports, "updateTextLayer", ({ - enumerable: true, - get: function () { - return _text_layer.updateTextLayer; - } -})); -Object.defineProperty(exports, "version", ({ - enumerable: true, - get: function () { - return _api.version; - } -})); -var _util = __w_pdfjs_require__(1); -var _api = __w_pdfjs_require__(2); -var _display_utils = __w_pdfjs_require__(6); -var _text_layer = __w_pdfjs_require__(26); -var _annotation_editor_layer = __w_pdfjs_require__(27); -var _tools = __w_pdfjs_require__(5); -var _annotation_layer = __w_pdfjs_require__(32); -var _worker_options = __w_pdfjs_require__(14); -var _svg = __w_pdfjs_require__(35); -var _xfa_layer = __w_pdfjs_require__(34); -const pdfjsVersion = '3.4.120'; -const pdfjsBuild = 'af6414988'; -})(); - -/******/ return __webpack_exports__; -/******/ })() -; -}); -//# sourceMappingURL=pdf.js.map \ No newline at end of file diff --git a/static/js/pdf-js/build/pdf.js.map b/static/js/pdf-js/build/pdf.js.map deleted file mode 100644 index de46837..0000000 --- a/static/js/pdf-js/build/pdf.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"pdf.js","mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACMA;AASA,MAAMA,kBAAkB,CAAC,CAAD,EAAI,CAAJ,EAAO,CAAP,EAAU,CAAV,EAAa,CAAb,EAAgB,CAA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACIA;AAoBA;AAOA;AAYA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA,MAAM0D,eAC8B,SADpC;AAGA,MAAMC,aAC8B,WADpC","sources":["webpack://pdfjs-dist/build/pdf/webpack/universalModuleDefinition","webpack://pdfjs-dist/build/pdf/src/shared/util.js","webpack://pdfjs-dist/build/pdf/src/display/api.js","webpack://pdfjs-dist/build/pdf/src/display/annotation_storage.js","webpack://pdfjs-dist/build/pdf/src/display/editor/editor.js","webpack://pdfjs-dist/build/pdf/src/display/editor/tools.js","webpack://pdfjs-dist/build/pdf/src/display/display_utils.js","webpack://pdfjs-dist/build/pdf/src/display/base_factory.js","webpack://pdfjs-dist/build/pdf/src/shared/murmurhash3.js","webpack://pdfjs-dist/build/pdf/src/display/font_loader.js","webpack://pdfjs-dist/build/pdf/src/shared/is_node.js","webpack://pdfjs-dist/build/pdf/src/display/canvas.js","webpack://pdfjs-dist/build/pdf/src/display/pattern_helper.js","webpack://pdfjs-dist/build/pdf/src/shared/image_utils.js","webpack://pdfjs-dist/build/pdf/src/display/worker_options.js","webpack://pdfjs-dist/build/pdf/src/shared/message_handler.js","webpack://pdfjs-dist/build/pdf/src/display/metadata.js","webpack://pdfjs-dist/build/pdf/src/display/optional_content_config.js","webpack://pdfjs-dist/build/pdf/src/display/transport_stream.js","webpack://pdfjs-dist/build/pdf/src/display/xfa_text.js","webpack://pdfjs-dist/build/pdf/src/display/node_utils.js","webpack://pdfjs-dist/build/pdf/src/display/node_stream.js","webpack://pdfjs-dist/build/pdf/src/display/network_utils.js","webpack://pdfjs-dist/build/pdf/src/display/content_disposition.js","webpack://pdfjs-dist/build/pdf/src/display/network.js","webpack://pdfjs-dist/build/pdf/src/display/fetch_stream.js","webpack://pdfjs-dist/build/pdf/src/display/text_layer.js","webpack://pdfjs-dist/build/pdf/src/display/editor/annotation_editor_layer.js","webpack://pdfjs-dist/build/pdf/src/display/editor/freetext.js","webpack://pdfjs-dist/build/pdf/src/display/editor/ink.js","webpack://pdfjs-dist/build/pdf/src/display/editor/fit_curve.js","webpack://pdfjs-dist/build/pdf/node_modules/fit-curve/src/fit-curve.js","webpack://pdfjs-dist/build/pdf/src/display/annotation_layer.js","webpack://pdfjs-dist/build/pdf/src/shared/scripting_utils.js","webpack://pdfjs-dist/build/pdf/src/display/xfa_layer.js","webpack://pdfjs-dist/build/pdf/src/display/svg.js","webpack://pdfjs-dist/build/pdf/webpack/bootstrap","webpack://pdfjs-dist/build/pdf/src/pdf.js"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"pdfjs-dist/build/pdf\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"pdfjs-dist/build/pdf\"] = factory();\n\telse\n\t\troot[\"pdfjs-dist/build/pdf\"] = factory();\n})(globalThis, () => {\nreturn ","/* Copyright 2012 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// Skip compatibility checks for modern builds and if we already ran the module.\nif (\n typeof PDFJSDev !== \"undefined\" &&\n !PDFJSDev.test(\"SKIP_BABEL\") &&\n !globalThis._pdfjsCompatibilityChecked\n) {\n globalThis._pdfjsCompatibilityChecked = true;\n require(\"./compatibility.js\");\n}\n\nconst IDENTITY_MATRIX = [1, 0, 0, 1, 0, 0];\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 * - ANNOTATIONS_FORMS, ANNOTATIONS_STORAGE, ANNOTATIONS_DISABLE control which\n * annotations are rendered onto the canvas (i.e. by being included in the\n * operatorList), note the `PDFPageProxy.{render, getOperatorList}`-methods\n * and their `annotationMode`-option.\n * - OPLIST is used with the `PDFPageProxy.getOperatorList`-method, note the\n * `OperatorList`-constructor (on the worker-thread).\n */\nconst RenderingIntentFlag = {\n ANY: 0x01,\n DISPLAY: 0x02,\n PRINT: 0x04,\n SAVE: 0x08,\n ANNOTATIONS_FORMS: 0x10,\n ANNOTATIONS_STORAGE: 0x20,\n ANNOTATIONS_DISABLE: 0x40,\n OPLIST: 0x100,\n};\n\nconst AnnotationMode = {\n DISABLE: 0,\n ENABLE: 1,\n ENABLE_FORMS: 2,\n ENABLE_STORAGE: 3,\n};\n\nconst AnnotationEditorPrefix = \"pdfjs_internal_editor_\";\n\nconst AnnotationEditorType = {\n DISABLE: -1,\n NONE: 0,\n FREETEXT: 3,\n INK: 15,\n};\n\nconst AnnotationEditorParamsType = {\n FREETEXT_SIZE: 1,\n FREETEXT_COLOR: 2,\n FREETEXT_OPACITY: 3,\n INK_COLOR: 11,\n INK_THICKNESS: 12,\n INK_OPACITY: 13,\n};\n\n// Permission flags from Table 22, Section 7.6.3.2 of the PDF specification.\nconst PermissionFlag = {\n PRINT: 0x04,\n MODIFY_CONTENTS: 0x08,\n COPY: 0x10,\n MODIFY_ANNOTATIONS: 0x20,\n FILL_INTERACTIVE_FORMS: 0x100,\n COPY_FOR_ACCESSIBILITY: 0x200,\n ASSEMBLE: 0x400,\n PRINT_HIGH_QUALITY: 0x800,\n};\n\nconst TextRenderingMode = {\n FILL: 0,\n STROKE: 1,\n FILL_STROKE: 2,\n INVISIBLE: 3,\n FILL_ADD_TO_PATH: 4,\n STROKE_ADD_TO_PATH: 5,\n FILL_STROKE_ADD_TO_PATH: 6,\n ADD_TO_PATH: 7,\n FILL_STROKE_MASK: 3,\n ADD_TO_PATH_FLAG: 4,\n};\n\nconst ImageKind = {\n GRAYSCALE_1BPP: 1,\n RGB_24BPP: 2,\n RGBA_32BPP: 3,\n};\n\nconst AnnotationType = {\n TEXT: 1,\n LINK: 2,\n FREETEXT: 3,\n LINE: 4,\n SQUARE: 5,\n CIRCLE: 6,\n POLYGON: 7,\n POLYLINE: 8,\n HIGHLIGHT: 9,\n UNDERLINE: 10,\n SQUIGGLY: 11,\n STRIKEOUT: 12,\n STAMP: 13,\n CARET: 14,\n INK: 15,\n POPUP: 16,\n FILEATTACHMENT: 17,\n SOUND: 18,\n MOVIE: 19,\n WIDGET: 20,\n SCREEN: 21,\n PRINTERMARK: 22,\n TRAPNET: 23,\n WATERMARK: 24,\n THREED: 25,\n REDACT: 26,\n};\n\nconst AnnotationStateModelType = {\n MARKED: \"Marked\",\n REVIEW: \"Review\",\n};\n\nconst AnnotationMarkedState = {\n MARKED: \"Marked\",\n UNMARKED: \"Unmarked\",\n};\n\nconst AnnotationReviewState = {\n ACCEPTED: \"Accepted\",\n REJECTED: \"Rejected\",\n CANCELLED: \"Cancelled\",\n COMPLETED: \"Completed\",\n NONE: \"None\",\n};\n\nconst AnnotationReplyType = {\n GROUP: \"Group\",\n REPLY: \"R\",\n};\n\nconst AnnotationFlag = {\n INVISIBLE: 0x01,\n HIDDEN: 0x02,\n PRINT: 0x04,\n NOZOOM: 0x08,\n NOROTATE: 0x10,\n NOVIEW: 0x20,\n READONLY: 0x40,\n LOCKED: 0x80,\n TOGGLENOVIEW: 0x100,\n LOCKEDCONTENTS: 0x200,\n};\n\nconst AnnotationFieldFlag = {\n READONLY: 0x0000001,\n REQUIRED: 0x0000002,\n NOEXPORT: 0x0000004,\n MULTILINE: 0x0001000,\n PASSWORD: 0x0002000,\n NOTOGGLETOOFF: 0x0004000,\n RADIO: 0x0008000,\n PUSHBUTTON: 0x0010000,\n COMBO: 0x0020000,\n EDIT: 0x0040000,\n SORT: 0x0080000,\n FILESELECT: 0x0100000,\n MULTISELECT: 0x0200000,\n DONOTSPELLCHECK: 0x0400000,\n DONOTSCROLL: 0x0800000,\n COMB: 0x1000000,\n RICHTEXT: 0x2000000,\n RADIOSINUNISON: 0x2000000,\n COMMITONSELCHANGE: 0x4000000,\n};\n\nconst AnnotationBorderStyleType = {\n SOLID: 1,\n DASHED: 2,\n BEVELED: 3,\n INSET: 4,\n UNDERLINE: 5,\n};\n\nconst AnnotationActionEventType = {\n E: \"Mouse Enter\",\n X: \"Mouse Exit\",\n D: \"Mouse Down\",\n U: \"Mouse Up\",\n Fo: \"Focus\",\n Bl: \"Blur\",\n PO: \"PageOpen\",\n PC: \"PageClose\",\n PV: \"PageVisible\",\n PI: \"PageInvisible\",\n K: \"Keystroke\",\n F: \"Format\",\n V: \"Validate\",\n C: \"Calculate\",\n};\n\nconst DocumentActionEventType = {\n WC: \"WillClose\",\n WS: \"WillSave\",\n DS: \"DidSave\",\n WP: \"WillPrint\",\n DP: \"DidPrint\",\n};\n\nconst PageActionEventType = {\n O: \"PageOpen\",\n C: \"PageClose\",\n};\n\nconst VerbosityLevel = {\n ERRORS: 0,\n WARNINGS: 1,\n INFOS: 5,\n};\n\nconst CMapCompressionType = {\n NONE: 0,\n BINARY: 1,\n};\n\n// All the possible operations for an operator list.\nconst OPS = {\n // Intentionally start from 1 so it is easy to spot bad operators that will be\n // 0's.\n // PLEASE NOTE: We purposely keep any removed operators commented out, since\n // re-numbering the list would risk breaking third-party users.\n dependency: 1,\n setLineWidth: 2,\n setLineCap: 3,\n setLineJoin: 4,\n setMiterLimit: 5,\n setDash: 6,\n setRenderingIntent: 7,\n setFlatness: 8,\n setGState: 9,\n save: 10,\n restore: 11,\n transform: 12,\n moveTo: 13,\n lineTo: 14,\n curveTo: 15,\n curveTo2: 16,\n curveTo3: 17,\n closePath: 18,\n rectangle: 19,\n stroke: 20,\n closeStroke: 21,\n fill: 22,\n eoFill: 23,\n fillStroke: 24,\n eoFillStroke: 25,\n closeFillStroke: 26,\n closeEOFillStroke: 27,\n endPath: 28,\n clip: 29,\n eoClip: 30,\n beginText: 31,\n endText: 32,\n setCharSpacing: 33,\n setWordSpacing: 34,\n setHScale: 35,\n setLeading: 36,\n setFont: 37,\n setTextRenderingMode: 38,\n setTextRise: 39,\n moveText: 40,\n setLeadingMoveText: 41,\n setTextMatrix: 42,\n nextLine: 43,\n showText: 44,\n showSpacedText: 45,\n nextLineShowText: 46,\n nextLineSetSpacingShowText: 47,\n setCharWidth: 48,\n setCharWidthAndBounds: 49,\n setStrokeColorSpace: 50,\n setFillColorSpace: 51,\n setStrokeColor: 52,\n setStrokeColorN: 53,\n setFillColor: 54,\n setFillColorN: 55,\n setStrokeGray: 56,\n setFillGray: 57,\n setStrokeRGBColor: 58,\n setFillRGBColor: 59,\n setStrokeCMYKColor: 60,\n setFillCMYKColor: 61,\n shadingFill: 62,\n beginInlineImage: 63,\n beginImageData: 64,\n endInlineImage: 65,\n paintXObject: 66,\n markPoint: 67,\n markPointProps: 68,\n beginMarkedContent: 69,\n beginMarkedContentProps: 70,\n endMarkedContent: 71,\n beginCompat: 72,\n endCompat: 73,\n paintFormXObjectBegin: 74,\n paintFormXObjectEnd: 75,\n beginGroup: 76,\n endGroup: 77,\n // beginAnnotations: 78,\n // endAnnotations: 79,\n beginAnnotation: 80,\n endAnnotation: 81,\n // paintJpegXObject: 82,\n paintImageMaskXObject: 83,\n paintImageMaskXObjectGroup: 84,\n paintImageXObject: 85,\n paintInlineImageXObject: 86,\n paintInlineImageXObjectGroup: 87,\n paintImageXObjectRepeat: 88,\n paintImageMaskXObjectRepeat: 89,\n paintSolidColorImageMask: 90,\n constructPath: 91,\n};\n\nconst UNSUPPORTED_FEATURES =\n typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"GENERIC\")\n ? {\n forms: \"forms\",\n javaScript: \"javaScript\",\n signatures: \"signatures\",\n smask: \"smask\",\n shadingPattern: \"shadingPattern\",\n errorTilingPattern: \"errorTilingPattern\",\n errorExtGState: \"errorExtGState\",\n errorXObject: \"errorXObject\",\n errorFontLoadType3: \"errorFontLoadType3\",\n errorFontState: \"errorFontState\",\n errorFontMissing: \"errorFontMissing\",\n errorFontTranslate: \"errorFontTranslate\",\n errorColorSpace: \"errorColorSpace\",\n errorOperatorList: \"errorOperatorList\",\n errorFontToUnicode: \"errorFontToUnicode\",\n errorFontLoadNative: \"errorFontLoadNative\",\n errorFontBuildPath: \"errorFontBuildPath\",\n errorFontGetPath: \"errorFontGetPath\",\n errorMarkedContent: \"errorMarkedContent\",\n errorContentSubStream: \"errorContentSubStream\",\n }\n : null;\n\nconst PasswordResponses = {\n NEED_PASSWORD: 1,\n INCORRECT_PASSWORD: 2,\n};\n\nlet verbosity = VerbosityLevel.WARNINGS;\n\nfunction setVerbosityLevel(level) {\n if (Number.isInteger(level)) {\n verbosity = level;\n }\n}\n\nfunction getVerbosityLevel() {\n return verbosity;\n}\n\n// A notice for devs. These are good for things that are helpful to devs, such\n// as warning that Workers were disabled, which is important to devs but not\n// end users.\nfunction info(msg) {\n if (verbosity >= VerbosityLevel.INFOS) {\n console.log(`Info: ${msg}`);\n }\n}\n\n// Non-fatal warnings.\nfunction warn(msg) {\n if (verbosity >= VerbosityLevel.WARNINGS) {\n console.log(`Warning: ${msg}`);\n }\n}\n\nfunction unreachable(msg) {\n throw new Error(msg);\n}\n\nfunction assert(cond, msg) {\n if (!cond) {\n unreachable(msg);\n }\n}\n\n// Checks if URLs use one of the allowed protocols, e.g. to avoid XSS.\nfunction _isValidProtocol(url) {\n if (!url) {\n return false;\n }\n switch (url.protocol) {\n case \"http:\":\n case \"https:\":\n case \"ftp:\":\n case \"mailto:\":\n case \"tel:\":\n return true;\n default:\n return false;\n }\n}\n\n/**\n * Attempts to create a valid absolute URL.\n *\n * @param {URL|string} url - An absolute, or relative, URL.\n * @param {URL|string} [baseUrl] - An absolute URL.\n * @param {Object} [options]\n * @returns Either a valid {URL}, or `null` otherwise.\n */\nfunction createValidAbsoluteUrl(url, baseUrl = null, options = null) {\n if (!url) {\n return null;\n }\n try {\n if (options && typeof url === \"string\") {\n // Let URLs beginning with \"www.\" default to using the \"http://\" protocol.\n if (options.addDefaultProtocol && url.startsWith(\"www.\")) {\n const dots = url.match(/\\./g);\n // Avoid accidentally matching a *relative* URL pointing to a file named\n // e.g. \"www.pdf\" or similar.\n if (dots && dots.length >= 2) {\n url = `http://${url}`;\n }\n }\n\n // According to ISO 32000-1:2008, section 12.6.4.7, URIs should be encoded\n // in 7-bit ASCII. Some bad PDFs use UTF-8 encoding; see bug 1122280.\n if (options.tryConvertEncoding) {\n try {\n url = stringToUTF8String(url);\n } catch (ex) {}\n }\n }\n\n const absoluteUrl = baseUrl ? new URL(url, baseUrl) : new URL(url);\n if (_isValidProtocol(absoluteUrl)) {\n return absoluteUrl;\n }\n } catch (ex) {\n /* `new URL()` will throw on incorrect data. */\n }\n return null;\n}\n\nfunction shadow(obj, prop, value, nonSerializable = false) {\n if (\n typeof PDFJSDev === \"undefined\" ||\n PDFJSDev.test(\"!PRODUCTION || TESTING\")\n ) {\n assert(\n prop in obj,\n `shadow: Property \"${prop && prop.toString()}\" not found in object.`\n );\n }\n Object.defineProperty(obj, prop, {\n value,\n enumerable: !nonSerializable,\n configurable: true,\n writable: false,\n });\n return value;\n}\n\n/**\n * @type {any}\n */\nconst BaseException = (function BaseExceptionClosure() {\n // eslint-disable-next-line no-shadow\n function BaseException(message, name) {\n if (this.constructor === BaseException) {\n unreachable(\"Cannot initialize BaseException.\");\n }\n this.message = message;\n this.name = name;\n }\n BaseException.prototype = new Error();\n BaseException.constructor = BaseException;\n\n return BaseException;\n})();\n\nclass PasswordException extends BaseException {\n constructor(msg, code) {\n super(msg, \"PasswordException\");\n this.code = code;\n }\n}\n\nclass UnknownErrorException extends BaseException {\n constructor(msg, details) {\n super(msg, \"UnknownErrorException\");\n this.details = details;\n }\n}\n\nclass InvalidPDFException extends BaseException {\n constructor(msg) {\n super(msg, \"InvalidPDFException\");\n }\n}\n\nclass MissingPDFException extends BaseException {\n constructor(msg) {\n super(msg, \"MissingPDFException\");\n }\n}\n\nclass UnexpectedResponseException extends BaseException {\n constructor(msg, status) {\n super(msg, \"UnexpectedResponseException\");\n this.status = status;\n }\n}\n\n/**\n * Error caused during parsing PDF data.\n */\nclass FormatError extends BaseException {\n constructor(msg) {\n super(msg, \"FormatError\");\n }\n}\n\n/**\n * Error used to indicate task cancellation.\n */\nclass AbortException extends BaseException {\n constructor(msg) {\n super(msg, \"AbortException\");\n }\n}\n\nfunction bytesToString(bytes) {\n if (\n typeof bytes !== \"object\" ||\n bytes === null ||\n bytes.length === undefined\n ) {\n unreachable(\"Invalid argument for bytesToString\");\n }\n const length = bytes.length;\n const MAX_ARGUMENT_COUNT = 8192;\n if (length < MAX_ARGUMENT_COUNT) {\n return String.fromCharCode.apply(null, bytes);\n }\n const strBuf = [];\n for (let i = 0; i < length; i += MAX_ARGUMENT_COUNT) {\n const chunkEnd = Math.min(i + MAX_ARGUMENT_COUNT, length);\n const chunk = bytes.subarray(i, chunkEnd);\n strBuf.push(String.fromCharCode.apply(null, chunk));\n }\n return strBuf.join(\"\");\n}\n\nfunction stringToBytes(str) {\n if (typeof str !== \"string\") {\n unreachable(\"Invalid argument for stringToBytes\");\n }\n const length = str.length;\n const bytes = new Uint8Array(length);\n for (let i = 0; i < length; ++i) {\n bytes[i] = str.charCodeAt(i) & 0xff;\n }\n return bytes;\n}\n\nfunction string32(value) {\n if (\n typeof PDFJSDev === \"undefined\" ||\n PDFJSDev.test(\"!PRODUCTION || TESTING\")\n ) {\n assert(\n typeof value === \"number\" && Math.abs(value) < 2 ** 32,\n `string32: Unexpected input \"${value}\".`\n );\n }\n return String.fromCharCode(\n (value >> 24) & 0xff,\n (value >> 16) & 0xff,\n (value >> 8) & 0xff,\n value & 0xff\n );\n}\n\nfunction objectSize(obj) {\n return Object.keys(obj).length;\n}\n\n// Ensure that the returned Object has a `null` prototype; hence why\n// `Object.fromEntries(...)` is not used.\nfunction objectFromMap(map) {\n const obj = Object.create(null);\n for (const [key, value] of map) {\n obj[key] = value;\n }\n return obj;\n}\n\n// Checks the endianness of the platform.\nfunction isLittleEndian() {\n const buffer8 = new Uint8Array(4);\n buffer8[0] = 1;\n const view32 = new Uint32Array(buffer8.buffer, 0, 1);\n return view32[0] === 1;\n}\n\n// Checks if it's possible to eval JS expressions.\nfunction isEvalSupported() {\n try {\n new Function(\"\"); // eslint-disable-line no-new, no-new-func\n return true;\n } catch (e) {\n return false;\n }\n}\n\nclass FeatureTest {\n static get isLittleEndian() {\n return shadow(this, \"isLittleEndian\", isLittleEndian());\n }\n\n static get isEvalSupported() {\n return shadow(this, \"isEvalSupported\", isEvalSupported());\n }\n\n static get isOffscreenCanvasSupported() {\n return shadow(\n this,\n \"isOffscreenCanvasSupported\",\n typeof OffscreenCanvas !== \"undefined\"\n );\n }\n\n static get platform() {\n if (\n (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"GENERIC\")) &&\n typeof navigator === \"undefined\"\n ) {\n return shadow(this, \"platform\", { isWin: false, isMac: false });\n }\n return shadow(this, \"platform\", {\n isWin: navigator.platform.includes(\"Win\"),\n isMac: navigator.platform.includes(\"Mac\"),\n });\n }\n}\n\nconst hexNumbers = [...Array(256).keys()].map(n =>\n n.toString(16).padStart(2, \"0\")\n);\n\nclass Util {\n static makeHexColor(r, g, b) {\n return `#${hexNumbers[r]}${hexNumbers[g]}${hexNumbers[b]}`;\n }\n\n // Apply a scaling matrix to some min/max values.\n // If a scaling factor is negative then min and max must be\n // swaped.\n static scaleMinMax(transform, minMax) {\n let temp;\n if (transform[0]) {\n if (transform[0] < 0) {\n temp = minMax[0];\n minMax[0] = minMax[1];\n minMax[1] = temp;\n }\n minMax[0] *= transform[0];\n minMax[1] *= transform[0];\n\n if (transform[3] < 0) {\n temp = minMax[2];\n minMax[2] = minMax[3];\n minMax[3] = temp;\n }\n minMax[2] *= transform[3];\n minMax[3] *= transform[3];\n } else {\n temp = minMax[0];\n minMax[0] = minMax[2];\n minMax[2] = temp;\n temp = minMax[1];\n minMax[1] = minMax[3];\n minMax[3] = temp;\n\n if (transform[1] < 0) {\n temp = minMax[2];\n minMax[2] = minMax[3];\n minMax[3] = temp;\n }\n minMax[2] *= transform[1];\n minMax[3] *= transform[1];\n\n if (transform[2] < 0) {\n temp = minMax[0];\n minMax[0] = minMax[1];\n minMax[1] = temp;\n }\n minMax[0] *= transform[2];\n minMax[1] *= transform[2];\n }\n minMax[0] += transform[4];\n minMax[1] += transform[4];\n minMax[2] += transform[5];\n minMax[3] += transform[5];\n }\n\n // Concatenates two transformation matrices together and returns the result.\n static transform(m1, m2) {\n return [\n m1[0] * m2[0] + m1[2] * m2[1],\n m1[1] * m2[0] + m1[3] * m2[1],\n m1[0] * m2[2] + m1[2] * m2[3],\n m1[1] * m2[2] + m1[3] * m2[3],\n m1[0] * m2[4] + m1[2] * m2[5] + m1[4],\n m1[1] * m2[4] + m1[3] * m2[5] + m1[5],\n ];\n }\n\n // For 2d affine transforms\n static applyTransform(p, m) {\n const xt = p[0] * m[0] + p[1] * m[2] + m[4];\n const yt = p[0] * m[1] + p[1] * m[3] + m[5];\n return [xt, yt];\n }\n\n static applyInverseTransform(p, m) {\n const d = m[0] * m[3] - m[1] * m[2];\n const xt = (p[0] * m[3] - p[1] * m[2] + m[2] * m[5] - m[4] * m[3]) / d;\n const yt = (-p[0] * m[1] + p[1] * m[0] + m[4] * m[1] - m[5] * m[0]) / d;\n return [xt, yt];\n }\n\n // Applies the transform to the rectangle and finds the minimum axially\n // aligned bounding box.\n static getAxialAlignedBoundingBox(r, m) {\n const p1 = Util.applyTransform(r, m);\n const p2 = Util.applyTransform(r.slice(2, 4), m);\n const p3 = Util.applyTransform([r[0], r[3]], m);\n const p4 = Util.applyTransform([r[2], r[1]], m);\n return [\n Math.min(p1[0], p2[0], p3[0], p4[0]),\n Math.min(p1[1], p2[1], p3[1], p4[1]),\n Math.max(p1[0], p2[0], p3[0], p4[0]),\n Math.max(p1[1], p2[1], p3[1], p4[1]),\n ];\n }\n\n static inverseTransform(m) {\n const d = m[0] * m[3] - m[1] * m[2];\n return [\n m[3] / d,\n -m[1] / d,\n -m[2] / d,\n m[0] / d,\n (m[2] * m[5] - m[4] * m[3]) / d,\n (m[4] * m[1] - m[5] * m[0]) / d,\n ];\n }\n\n // This calculation uses Singular Value Decomposition.\n // The SVD can be represented with formula A = USV. We are interested in the\n // matrix S here because it represents the scale values.\n static singularValueDecompose2dScale(m) {\n const transpose = [m[0], m[2], m[1], m[3]];\n\n // Multiply matrix m with its transpose.\n const a = m[0] * transpose[0] + m[1] * transpose[2];\n const b = m[0] * transpose[1] + m[1] * transpose[3];\n const c = m[2] * transpose[0] + m[3] * transpose[2];\n const d = m[2] * transpose[1] + m[3] * transpose[3];\n\n // Solve the second degree polynomial to get roots.\n const first = (a + d) / 2;\n const second = Math.sqrt((a + d) ** 2 - 4 * (a * d - c * b)) / 2;\n const sx = first + second || 1;\n const sy = first - second || 1;\n\n // Scale values are the square roots of the eigenvalues.\n return [Math.sqrt(sx), Math.sqrt(sy)];\n }\n\n // Normalize rectangle rect=[x1, y1, x2, y2] so that (x1,y1) < (x2,y2)\n // For coordinate systems whose origin lies in the bottom-left, this\n // means normalization to (BL,TR) ordering. For systems with origin in the\n // top-left, this means (TL,BR) ordering.\n static normalizeRect(rect) {\n const r = rect.slice(0); // clone rect\n if (rect[0] > rect[2]) {\n r[0] = rect[2];\n r[2] = rect[0];\n }\n if (rect[1] > rect[3]) {\n r[1] = rect[3];\n r[3] = rect[1];\n }\n return r;\n }\n\n // Returns a rectangle [x1, y1, x2, y2] corresponding to the\n // intersection of rect1 and rect2. If no intersection, returns 'null'\n // The rectangle coordinates of rect1, rect2 should be [x1, y1, x2, y2]\n static intersect(rect1, rect2) {\n const xLow = Math.max(\n Math.min(rect1[0], rect1[2]),\n Math.min(rect2[0], rect2[2])\n );\n const xHigh = Math.min(\n Math.max(rect1[0], rect1[2]),\n Math.max(rect2[0], rect2[2])\n );\n if (xLow > xHigh) {\n return null;\n }\n const yLow = Math.max(\n Math.min(rect1[1], rect1[3]),\n Math.min(rect2[1], rect2[3])\n );\n const yHigh = Math.min(\n Math.max(rect1[1], rect1[3]),\n Math.max(rect2[1], rect2[3])\n );\n if (yLow > yHigh) {\n return null;\n }\n\n return [xLow, yLow, xHigh, yHigh];\n }\n\n // From https://github.com/adobe-webplatform/Snap.svg/blob/b365287722a72526000ac4bfcf0ce4cac2faa015/src/path.js#L852\n static bezierBoundingBox(x0, y0, x1, y1, x2, y2, x3, y3) {\n const tvalues = [],\n bounds = [[], []];\n let a, b, c, t, t1, t2, b2ac, sqrtb2ac;\n for (let i = 0; i < 2; ++i) {\n if (i === 0) {\n b = 6 * x0 - 12 * x1 + 6 * x2;\n a = -3 * x0 + 9 * x1 - 9 * x2 + 3 * x3;\n c = 3 * x1 - 3 * x0;\n } else {\n b = 6 * y0 - 12 * y1 + 6 * y2;\n a = -3 * y0 + 9 * y1 - 9 * y2 + 3 * y3;\n c = 3 * y1 - 3 * y0;\n }\n if (Math.abs(a) < 1e-12) {\n if (Math.abs(b) < 1e-12) {\n continue;\n }\n t = -c / b;\n if (0 < t && t < 1) {\n tvalues.push(t);\n }\n continue;\n }\n b2ac = b * b - 4 * c * a;\n sqrtb2ac = Math.sqrt(b2ac);\n if (b2ac < 0) {\n continue;\n }\n t1 = (-b + sqrtb2ac) / (2 * a);\n if (0 < t1 && t1 < 1) {\n tvalues.push(t1);\n }\n t2 = (-b - sqrtb2ac) / (2 * a);\n if (0 < t2 && t2 < 1) {\n tvalues.push(t2);\n }\n }\n\n let j = tvalues.length,\n mt;\n const jlen = j;\n while (j--) {\n t = tvalues[j];\n mt = 1 - t;\n bounds[0][j] =\n mt * mt * mt * x0 +\n 3 * mt * mt * t * x1 +\n 3 * mt * t * t * x2 +\n t * t * t * x3;\n bounds[1][j] =\n mt * mt * mt * y0 +\n 3 * mt * mt * t * y1 +\n 3 * mt * t * t * y2 +\n t * t * t * y3;\n }\n\n bounds[0][jlen] = x0;\n bounds[1][jlen] = y0;\n bounds[0][jlen + 1] = x3;\n bounds[1][jlen + 1] = y3;\n bounds[0].length = bounds[1].length = jlen + 2;\n\n return [\n Math.min(...bounds[0]),\n Math.min(...bounds[1]),\n Math.max(...bounds[0]),\n Math.max(...bounds[1]),\n ];\n }\n}\n\nconst PDFStringTranslateTable = [\n 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x2d8,\n 0x2c7, 0x2c6, 0x2d9, 0x2dd, 0x2db, 0x2da, 0x2dc, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n 0, 0, 0, 0, 0, 0, 0, 0, 0x2022, 0x2020, 0x2021, 0x2026, 0x2014, 0x2013, 0x192,\n 0x2044, 0x2039, 0x203a, 0x2212, 0x2030, 0x201e, 0x201c, 0x201d, 0x2018,\n 0x2019, 0x201a, 0x2122, 0xfb01, 0xfb02, 0x141, 0x152, 0x160, 0x178, 0x17d,\n 0x131, 0x142, 0x153, 0x161, 0x17e, 0, 0x20ac,\n];\n\nfunction stringToPDFString(str) {\n if (str[0] >= \"\\xEF\") {\n let encoding;\n if (str[0] === \"\\xFE\" && str[1] === \"\\xFF\") {\n encoding = \"utf-16be\";\n } else if (str[0] === \"\\xFF\" && str[1] === \"\\xFE\") {\n encoding = \"utf-16le\";\n } else if (str[0] === \"\\xEF\" && str[1] === \"\\xBB\" && str[2] === \"\\xBF\") {\n encoding = \"utf-8\";\n }\n\n if (encoding) {\n try {\n const decoder = new TextDecoder(encoding, { fatal: true });\n const buffer = stringToBytes(str);\n return decoder.decode(buffer);\n } catch (ex) {\n warn(`stringToPDFString: \"${ex}\".`);\n }\n }\n }\n // ISO Latin 1\n const strBuf = [];\n for (let i = 0, ii = str.length; i < ii; i++) {\n const code = PDFStringTranslateTable[str.charCodeAt(i)];\n strBuf.push(code ? String.fromCharCode(code) : str.charAt(i));\n }\n return strBuf.join(\"\");\n}\n\nfunction stringToUTF8String(str) {\n return decodeURIComponent(escape(str));\n}\n\nfunction utf8StringToString(str) {\n return unescape(encodeURIComponent(str));\n}\n\nfunction isArrayBuffer(v) {\n return typeof v === \"object\" && v !== null && v.byteLength !== undefined;\n}\n\nfunction isArrayEqual(arr1, arr2) {\n if (arr1.length !== arr2.length) {\n return false;\n }\n for (let i = 0, ii = arr1.length; i < ii; i++) {\n if (arr1[i] !== arr2[i]) {\n return false;\n }\n }\n return true;\n}\n\nfunction getModificationDate(date = new Date()) {\n const buffer = [\n date.getUTCFullYear().toString(),\n (date.getUTCMonth() + 1).toString().padStart(2, \"0\"),\n date.getUTCDate().toString().padStart(2, \"0\"),\n date.getUTCHours().toString().padStart(2, \"0\"),\n date.getUTCMinutes().toString().padStart(2, \"0\"),\n date.getUTCSeconds().toString().padStart(2, \"0\"),\n ];\n\n return buffer.join(\"\");\n}\n\n/**\n * Promise Capability object.\n *\n * @typedef {Object} PromiseCapability\n * @property {Promise} promise - A Promise object.\n * @property {boolean} settled - If the Promise has been fulfilled/rejected.\n * @property {function} resolve - Fulfills the Promise.\n * @property {function} reject - Rejects the Promise.\n */\n\n/**\n * Creates a promise capability object.\n * @alias createPromiseCapability\n *\n * @returns {PromiseCapability}\n */\nfunction createPromiseCapability() {\n const capability = Object.create(null);\n let isSettled = false;\n\n Object.defineProperty(capability, \"settled\", {\n get() {\n return isSettled;\n },\n });\n capability.promise = new Promise(function (resolve, reject) {\n capability.resolve = function (data) {\n isSettled = true;\n resolve(data);\n };\n capability.reject = function (reason) {\n isSettled = true;\n reject(reason);\n };\n });\n return capability;\n}\n\nexport {\n AbortException,\n AnnotationActionEventType,\n AnnotationBorderStyleType,\n AnnotationEditorParamsType,\n AnnotationEditorPrefix,\n AnnotationEditorType,\n AnnotationFieldFlag,\n AnnotationFlag,\n AnnotationMarkedState,\n AnnotationMode,\n AnnotationReplyType,\n AnnotationReviewState,\n AnnotationStateModelType,\n AnnotationType,\n assert,\n BaseException,\n BASELINE_FACTOR,\n bytesToString,\n CMapCompressionType,\n createPromiseCapability,\n createValidAbsoluteUrl,\n DocumentActionEventType,\n FeatureTest,\n FONT_IDENTITY_MATRIX,\n FormatError,\n getModificationDate,\n getVerbosityLevel,\n IDENTITY_MATRIX,\n ImageKind,\n info,\n InvalidPDFException,\n isArrayBuffer,\n isArrayEqual,\n LINE_DESCENT_FACTOR,\n LINE_FACTOR,\n MissingPDFException,\n objectFromMap,\n objectSize,\n OPS,\n PageActionEventType,\n PasswordException,\n PasswordResponses,\n PermissionFlag,\n RenderingIntentFlag,\n setVerbosityLevel,\n shadow,\n string32,\n stringToBytes,\n stringToPDFString,\n stringToUTF8String,\n TextRenderingMode,\n UnexpectedResponseException,\n UnknownErrorException,\n unreachable,\n UNSUPPORTED_FEATURES,\n utf8StringToString,\n Util,\n VerbosityLevel,\n warn,\n};\n","/* Copyright 2012 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * @module pdfjsLib\n */\n\nimport {\n AbortException,\n AnnotationMode,\n assert,\n createPromiseCapability,\n getVerbosityLevel,\n info,\n InvalidPDFException,\n isArrayBuffer,\n MissingPDFException,\n PasswordException,\n RenderingIntentFlag,\n setVerbosityLevel,\n shadow,\n stringToBytes,\n UnexpectedResponseException,\n UnknownErrorException,\n unreachable,\n warn,\n} from \"../shared/util.js\";\nimport {\n AnnotationStorage,\n PrintAnnotationStorage,\n} from \"./annotation_storage.js\";\nimport {\n deprecated,\n DOMCanvasFactory,\n DOMCMapReaderFactory,\n DOMStandardFontDataFactory,\n isDataScheme,\n isValidFetchUrl,\n loadScript,\n PageViewport,\n RenderingCancelledException,\n StatTimer,\n} from \"./display_utils.js\";\nimport { FontFaceObject, FontLoader } from \"./font_loader.js\";\nimport { CanvasGraphics } from \"./canvas.js\";\nimport { GlobalWorkerOptions } from \"./worker_options.js\";\nimport { isNodeJS } from \"../shared/is_node.js\";\nimport { MessageHandler } from \"../shared/message_handler.js\";\nimport { Metadata } from \"./metadata.js\";\nimport { OptionalContentConfig } from \"./optional_content_config.js\";\nimport { PDFDataTransportStream } from \"./transport_stream.js\";\nimport { XfaText } from \"./xfa_text.js\";\n\nconst DEFAULT_RANGE_CHUNK_SIZE = 65536; // 2^16 = 65536\nconst RENDERING_CANCELLED_TIMEOUT = 100; // ms\n\nlet DefaultCanvasFactory = DOMCanvasFactory;\nlet DefaultCMapReaderFactory = DOMCMapReaderFactory;\nlet DefaultStandardFontDataFactory = DOMStandardFontDataFactory;\n\nif (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"GENERIC\") && isNodeJS) {\n const {\n NodeCanvasFactory,\n NodeCMapReaderFactory,\n NodeStandardFontDataFactory,\n } = require(\"./node_utils.js\");\n\n DefaultCanvasFactory = NodeCanvasFactory;\n DefaultCMapReaderFactory = NodeCMapReaderFactory;\n DefaultStandardFontDataFactory = NodeStandardFontDataFactory;\n}\n\nlet createPDFNetworkStream;\nif (typeof PDFJSDev === \"undefined\" || !PDFJSDev.test(\"PRODUCTION\")) {\n const streamsPromise = Promise.all([\n import(\"./network.js\"),\n import(\"./fetch_stream.js\"),\n ]);\n\n createPDFNetworkStream = async params => {\n const [{ PDFNetworkStream }, { PDFFetchStream }] = await streamsPromise;\n\n return isValidFetchUrl(params.url)\n ? new PDFFetchStream(params)\n : new PDFNetworkStream(params);\n };\n} else if (PDFJSDev.test(\"GENERIC || CHROME\")) {\n if (PDFJSDev.test(\"GENERIC\") && isNodeJS) {\n const { PDFNodeStream } = require(\"./node_stream.js\");\n\n createPDFNetworkStream = params => {\n return new PDFNodeStream(params);\n };\n } else {\n const { PDFNetworkStream } = require(\"./network.js\");\n const { PDFFetchStream } = require(\"./fetch_stream.js\");\n\n createPDFNetworkStream = params => {\n return isValidFetchUrl(params.url)\n ? new PDFFetchStream(params)\n : new PDFNetworkStream(params);\n };\n }\n}\n\n/**\n * @typedef { Int8Array | Uint8Array | Uint8ClampedArray |\n * Int16Array | Uint16Array |\n * Int32Array | Uint32Array | Float32Array |\n * Float64Array\n * } TypedArray\n */\n\n/**\n * @typedef { TypedArray | ArrayBuffer | Array | string } BinaryData\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 {BinaryData} [data] - Binary PDF data.\n * Use TypedArrays (Uint8Array) to improve the memory usage. If PDF data is\n * BASE64-encoded, use `atob()` to convert it to a binary string first.\n *\n * NOTE: If TypedArrays are used they will generally be transferred to the\n * worker-thread. This will help reduce main-thread memory usage, however\n * it will take ownership of the TypedArrays.\n * @property {Object} [httpHeaders] - Basic authentication headers.\n * @property {boolean} [withCredentials] - Indicates whether or not\n * cross-site Access-Control requests should be made using credentials such\n * as cookies or authorization headers. The default is `false`.\n * @property {string} [password] - For decrypting password-protected PDFs.\n * @property {number} [length] - The PDF file length. It's used for progress\n * reports and range requests operations.\n * @property {PDFDataRangeTransport} [range] - Allows for using a custom range\n * transport implementation.\n * @property {number} [rangeChunkSize] - Specify maximum number of bytes fetched\n * per range request. The default value is {@link DEFAULT_RANGE_CHUNK_SIZE}.\n * @property {PDFWorker} [worker] - The worker that will be used for loading and\n * parsing the PDF data.\n * @property {number} [verbosity] - Controls the logging level; the constants\n * from {@link VerbosityLevel} should be used.\n * @property {string} [docBaseUrl] - The base URL of the document, used when\n * attempting to recover valid absolute URLs for annotations, and outline\n * items, that (incorrectly) only specify relative URLs.\n * @property {string} [cMapUrl] - The URL where the predefined Adobe CMaps are\n * located. Include the trailing slash.\n * @property {boolean} [cMapPacked] - Specifies if the Adobe CMaps are binary\n * packed or not. The default value is `true`.\n * @property {Object} [CMapReaderFactory] - The factory that will be used when\n * reading built-in CMap files. Providing a custom factory is useful for\n * environments without Fetch API or `XMLHttpRequest` support, such as\n * Node.js. The default value is {DOMCMapReaderFactory}.\n * @property {boolean} [useSystemFonts] - When `true`, fonts that aren't\n * embedded in the PDF document will fallback to a system font.\n * The default value is `true` in web environments and `false` in Node.js;\n * unless `disableFontFace === true` in which case this defaults to `false`\n * regardless of the environment (to prevent completely broken fonts).\n * @property {string} [standardFontDataUrl] - The URL where the standard font\n * files are located. Include the trailing slash.\n * @property {Object} [StandardFontDataFactory] - The factory that will be used\n * when reading the standard font files. Providing a custom factory is useful\n * for environments without Fetch API or `XMLHttpRequest` support, such as\n * Node.js. The default value is {DOMStandardFontDataFactory}.\n * @property {boolean} [useWorkerFetch] - Enable using the Fetch API in the\n * worker-thread when reading CMap and standard font files. When `true`,\n * the `CMapReaderFactory` and `StandardFontDataFactory` options are ignored.\n * The default value is `true` in web environments and `false` in Node.js.\n * @property {boolean} [stopAtErrors] - Reject certain promises, e.g.\n * `getOperatorList`, `getTextContent`, and `RenderTask`, when the associated\n * PDF data cannot be successfully parsed, instead of attempting to recover\n * whatever possible of the data. The default value is `false`.\n * @property {number} [maxImageSize] - The maximum allowed image size in total\n * pixels, i.e. width * height. Images above this value will not be rendered.\n * Use -1 for no limit, which is also the default value.\n * @property {boolean} [isEvalSupported] - Determines if we can evaluate strings\n * as JavaScript. Primarily used to improve performance of font rendering, and\n * when parsing PDF functions. 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} [disableFontFace] - By default fonts are converted to\n * OpenType fonts and loaded via the Font Loading API or `@font-face` rules.\n * If disabled, fonts will be rendered using a built-in font renderer that\n * constructs the glyphs with primitive path commands.\n * The default value is `false` in web environments and `true` in Node.js.\n * @property {boolean} [fontExtraProperties] - Include additional properties,\n * which are unused during rendering of PDF documents, when exporting the\n * parsed font data from the worker-thread. This may be useful for debugging\n * purposes (and backwards compatibility), but note that it will lead to\n * increased memory usage. The default value is `false`.\n * @property {boolean} [enableXfa] - Render Xfa forms if any.\n * The default value is `false`.\n * @property {HTMLDocument} [ownerDocument] - Specify an explicit document\n * context to create elements with and to load resources, such as fonts,\n * into. Defaults to the current document.\n * @property {boolean} [disableRange] - Disable range request loading of PDF\n * files. When enabled, and if the server supports partial content requests,\n * then the PDF will be fetched in chunks. The default value is `false`.\n * @property {boolean} [disableStream] - Disable streaming of PDF file data.\n * By default PDF.js attempts to load PDF files in chunks. The default value\n * is `false`.\n * @property {boolean} [disableAutoFetch] - Disable pre-fetching of PDF file\n * data. When range requests are enabled PDF.js will automatically keep\n * fetching more data even if it isn't needed to display the current page.\n * The default value is `false`.\n *\n * NOTE: It is also necessary to disable streaming, see above, in order for\n * disabling of pre-fetching to work correctly.\n * @property {boolean} [pdfBug] - Enables special hooks for debugging PDF.js\n * (see `web/debugger.js`). The default value is `false`.\n */\n\n/**\n * This is the main entry point for loading a PDF and interacting with it.\n *\n * NOTE: If a URL is used to fetch the PDF data a standard Fetch API call (or\n * XHR as fallback) is used, which means it must follow same origin rules,\n * e.g. no cross-domain requests without CORS.\n *\n * @param {string | URL | TypedArray | 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 (isArrayBuffer(src)) {\n src = { data: src };\n } else if (src instanceof PDFDataRangeTransport) {\n deprecated(\n \"`PDFDataRangeTransport`-instance, \" +\n \"please use a parameter object with `range`-property instead.\"\n );\n src = { range: src };\n } else {\n if (typeof src !== \"object\") {\n throw new Error(\n \"Invalid parameter in getDocument, \" +\n \"need either string, URL, TypedArray, or parameter object.\"\n );\n }\n }\n } else if (typeof src !== \"object\") {\n throw new Error(\"Invalid parameter in getDocument, need parameter object.\");\n }\n if (!src.url && !src.data && !src.range) {\n throw new Error(\n \"Invalid parameter object: need either .data, .range or .url\"\n );\n }\n const task = new PDFDocumentLoadingTask();\n\n const url = src.url ? getUrlProp(src.url) : null;\n const data = src.data ? getDataProp(src.data) : null;\n const httpHeaders = src.httpHeaders || null;\n const withCredentials = src.withCredentials === true;\n const password = src.password ?? null;\n const rangeTransport =\n src.range instanceof PDFDataRangeTransport ? src.range : null;\n const rangeChunkSize =\n Number.isInteger(src.rangeChunkSize) && src.rangeChunkSize > 0\n ? src.rangeChunkSize\n : DEFAULT_RANGE_CHUNK_SIZE;\n let worker = src.worker instanceof PDFWorker ? src.worker : null;\n const verbosity = src.verbosity;\n // Ignore \"data:\"-URLs, since they can't be used to recover valid absolute\n // URLs anyway. We want to avoid sending them to the worker-thread, since\n // they contain the *entire* PDF document and can thus be arbitrarily long.\n const docBaseUrl =\n typeof src.docBaseUrl === \"string\" && !isDataScheme(src.docBaseUrl)\n ? src.docBaseUrl\n : null;\n const cMapUrl = typeof src.cMapUrl === \"string\" ? src.cMapUrl : null;\n const cMapPacked = src.cMapPacked !== false;\n const CMapReaderFactory = src.CMapReaderFactory || DefaultCMapReaderFactory;\n const standardFontDataUrl =\n typeof src.standardFontDataUrl === \"string\"\n ? src.standardFontDataUrl\n : null;\n const StandardFontDataFactory =\n src.StandardFontDataFactory || DefaultStandardFontDataFactory;\n const ignoreErrors = src.stopAtErrors !== true;\n const maxImageSize =\n Number.isInteger(src.maxImageSize) && src.maxImageSize > -1\n ? src.maxImageSize\n : -1;\n const isEvalSupported = src.isEvalSupported !== false;\n const isOffscreenCanvasSupported =\n typeof src.isOffscreenCanvasSupported === \"boolean\"\n ? src.isOffscreenCanvasSupported\n : !isNodeJS;\n const disableFontFace =\n typeof src.disableFontFace === \"boolean\" ? src.disableFontFace : isNodeJS;\n const fontExtraProperties = src.fontExtraProperties === true;\n const enableXfa = src.enableXfa === true;\n const ownerDocument = src.ownerDocument || globalThis.document;\n const disableRange = src.disableRange === true;\n const disableStream = src.disableStream === true;\n const disableAutoFetch = src.disableAutoFetch === true;\n const pdfBug = src.pdfBug === true;\n\n // Parameters whose default values depend on other parameters.\n const length = rangeTransport ? rangeTransport.length : src.length ?? NaN;\n const useSystemFonts =\n typeof src.useSystemFonts === \"boolean\"\n ? src.useSystemFonts\n : !isNodeJS && !disableFontFace;\n const useWorkerFetch =\n typeof src.useWorkerFetch === \"boolean\"\n ? src.useWorkerFetch\n : (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) ||\n (CMapReaderFactory === DOMCMapReaderFactory &&\n StandardFontDataFactory === DOMStandardFontDataFactory &&\n isValidFetchUrl(cMapUrl, document.baseURI) &&\n isValidFetchUrl(standardFontDataUrl, document.baseURI));\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 = useWorkerFetch\n ? null\n : {\n cMapReaderFactory: new CMapReaderFactory({\n baseUrl: cMapUrl,\n isCompressed: cMapPacked,\n }),\n standardFontDataFactory: new StandardFontDataFactory({\n baseUrl: standardFontDataUrl,\n }),\n };\n\n if (!worker) {\n const workerParams = {\n verbosity,\n port: GlobalWorkerOptions.workerPort,\n };\n // Worker was not provided -- creating and owning our own. If message port\n // is specified in global worker options, using it.\n worker = workerParams.port\n ? PDFWorker.fromPort(workerParams)\n : new PDFWorker(workerParams);\n task._worker = worker;\n }\n const docId = task.docId;\n\n const fetchDocParams = {\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 fontExtraProperties,\n useSystemFonts,\n cMapUrl: useWorkerFetch ? cMapUrl : null,\n standardFontDataUrl: useWorkerFetch ? standardFontDataUrl : null,\n },\n };\n const transportParams = {\n ignoreErrors,\n isEvalSupported,\n disableFontFace,\n fontExtraProperties,\n enableXfa,\n ownerDocument,\n disableAutoFetch,\n pdfBug,\n styleElement,\n };\n\n worker.promise\n .then(function () {\n if (task.destroyed) {\n throw new Error(\"Loading aborted\");\n }\n\n const workerIdPromise = _fetchDocument(worker, fetchDocParams);\n const networkStreamPromise = new Promise(function (resolve) {\n let networkStream;\n if (rangeTransport) {\n networkStream = new PDFDataTransportStream(\n {\n length,\n initialData: rangeTransport.initialData,\n progressiveDone: rangeTransport.progressiveDone,\n contentDispositionFilename:\n rangeTransport.contentDispositionFilename,\n disableRange,\n disableStream,\n },\n rangeTransport\n );\n } else if (!data) {\n if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) {\n throw new Error(\"Not implemented: createPDFNetworkStream\");\n }\n networkStream = createPDFNetworkStream({\n url,\n length,\n httpHeaders,\n withCredentials,\n rangeChunkSize,\n disableRange,\n disableStream,\n });\n }\n resolve(networkStream);\n });\n\n return Promise.all([workerIdPromise, networkStreamPromise]).then(\n function ([workerId, networkStream]) {\n if (task.destroyed) {\n throw new Error(\"Loading aborted\");\n }\n\n const messageHandler = new MessageHandler(\n docId,\n workerId,\n worker.port\n );\n const transport = new WorkerTransport(\n messageHandler,\n task,\n networkStream,\n transportParams,\n transportFactory\n );\n task._transport = transport;\n messageHandler.send(\"Ready\", null);\n }\n );\n })\n .catch(task._capability.reject);\n\n return task;\n}\n\n/**\n * Starts fetching of specified PDF document/data.\n *\n * @param {PDFWorker} worker\n * @param {Object} source\n * @returns {Promise} A promise that is resolved when the worker ID of\n * the `MessageHandler` is known.\n * @private\n */\nasync function _fetchDocument(worker, source) {\n if (worker.destroyed) {\n throw new Error(\"Worker was destroyed\");\n }\n const workerId = await worker.messageHandler.sendWithPromise(\n \"GetDocRequest\",\n source,\n source.data ? [source.data.buffer] : null\n );\n\n if (worker.destroyed) {\n throw new Error(\"Worker was destroyed\");\n }\n return workerId;\n}\n\nfunction getUrlProp(val) {\n if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) {\n return null; // The 'url' is unused with `PDFDataRangeTransport`.\n }\n if (val instanceof URL) {\n return val.href;\n }\n try {\n // The full path is required in the 'url' field.\n return new URL(val, window.location).href;\n } catch (ex) {\n if (\n typeof PDFJSDev !== \"undefined\" &&\n PDFJSDev.test(\"GENERIC\") &&\n isNodeJS &&\n typeof val === \"string\"\n ) {\n return val; // Use the url as-is in Node.js environments.\n }\n }\n throw new Error(\n \"Invalid PDF url data: \" +\n \"either string or URL-object is expected in the url property.\"\n );\n}\n\nfunction getDataProp(val) {\n // Converting string or array-like data to Uint8Array.\n if (\n typeof PDFJSDev !== \"undefined\" &&\n PDFJSDev.test(\"GENERIC\") &&\n isNodeJS &&\n typeof Buffer !== \"undefined\" && // eslint-disable-line no-undef\n val instanceof Buffer // eslint-disable-line no-undef\n ) {\n deprecated(\n \"Please provide binary data as `Uint8Array`, rather than `Buffer`.\"\n );\n return new Uint8Array(val);\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 ((typeof val === \"object\" && !isNaN(val?.length)) || isArrayBuffer(val)) {\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\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 #onUnsupportedFeature = null;\n\n constructor() {\n this._capability = createPromiseCapability();\n this._transport = null;\n this._worker = null;\n\n /**\n * Unique identifier for the document loading task.\n * @type {string}\n */\n this.docId = `d${PDFDocumentLoadingTask.#docId++}`;\n\n /**\n * Whether the loading task is destroyed or not.\n * @type {boolean}\n */\n this.destroyed = false;\n\n /**\n * Callback to request a password if a wrong or no password was provided.\n * The callback receives two parameters: a function that should be called\n * with the new password, and a reason (see {@link PasswordResponses}).\n * @type {function}\n */\n this.onPassword = null;\n\n /**\n * Callback to be able to monitor the loading progress of the PDF file\n * (necessary to implement e.g. a loading bar).\n * The callback receives an {@link OnProgressParameters} argument.\n * @type {function}\n */\n this.onProgress = null;\n }\n\n /**\n * @type {function | null} The current callback used with unsupported\n * features.\n */\n get onUnsupportedFeature() {\n return this.#onUnsupportedFeature;\n }\n\n /**\n * Callback for when an unsupported feature is used in the PDF document.\n * The callback receives an {@link UNSUPPORTED_FEATURES} argument.\n * @type {function}\n */\n set onUnsupportedFeature(callback) {\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"GENERIC\")) {\n deprecated(\n \"The PDFDocumentLoadingTask onUnsupportedFeature property will be removed in the future.\"\n );\n this.#onUnsupportedFeature = callback;\n }\n }\n\n /**\n * Promise for document loading task completion.\n * @type {Promise}\n */\n get promise() {\n return this._capability.promise;\n }\n\n /**\n * Abort all network requests and destroy the worker.\n * @returns {Promise} A promise that is resolved when destruction is\n * completed.\n */\n async destroy() {\n this.destroyed = true;\n await this._transport?.destroy();\n\n this._transport = null;\n if (this._worker) {\n this._worker.destroy();\n this._worker = null;\n }\n }\n}\n\n/**\n * Abstract class to support range requests file loading.\n *\n * NOTE: The TypedArrays passed to the constructor and relevant methods below\n * will generally be transferred to the worker-thread. This will help reduce\n * main-thread memory usage, however it will take ownership of the TypedArrays.\n */\nclass PDFDataRangeTransport {\n /**\n * @param {number} length\n * @param {Uint8Array|null} initialData\n * @param {boolean} [progressiveDone]\n * @param {string} [contentDispositionFilename]\n */\n constructor(\n length,\n initialData,\n progressiveDone = false,\n contentDispositionFilename = null\n ) {\n this.length = length;\n this.initialData = initialData;\n this.progressiveDone = progressiveDone;\n this.contentDispositionFilename = contentDispositionFilename;\n\n this._rangeListeners = [];\n this._progressListeners = [];\n this._progressiveReadListeners = [];\n this._progressiveDoneListeners = [];\n this._readyCapability = createPromiseCapability();\n }\n\n /**\n * @param {function} listener\n */\n addRangeListener(listener) {\n this._rangeListeners.push(listener);\n }\n\n /**\n * @param {function} listener\n */\n addProgressListener(listener) {\n this._progressListeners.push(listener);\n }\n\n /**\n * @param {function} listener\n */\n addProgressiveReadListener(listener) {\n this._progressiveReadListeners.push(listener);\n }\n\n /**\n * @param {function} listener\n */\n addProgressiveDoneListener(listener) {\n this._progressiveDoneListeners.push(listener);\n }\n\n /**\n * @param {number} begin\n * @param {Uint8Array|null} chunk\n */\n onDataRange(begin, chunk) {\n for (const listener of this._rangeListeners) {\n listener(begin, chunk);\n }\n }\n\n /**\n * @param {number} loaded\n * @param {number|undefined} total\n */\n onDataProgress(loaded, total) {\n this._readyCapability.promise.then(() => {\n for (const listener of this._progressListeners) {\n listener(loaded, total);\n }\n });\n }\n\n /**\n * @param {Uint8Array|null} chunk\n */\n onDataProgressiveRead(chunk) {\n this._readyCapability.promise.then(() => {\n for (const listener of this._progressiveReadListeners) {\n listener(chunk);\n }\n });\n }\n\n onDataProgressiveDone() {\n this._readyCapability.promise.then(() => {\n for (const listener of this._progressiveDoneListeners) {\n listener();\n }\n });\n }\n\n transportReady() {\n this._readyCapability.resolve();\n }\n\n /**\n * @param {number} begin\n * @param {number} end\n */\n requestDataRange(begin, end) {\n unreachable(\"Abstract method PDFDataRangeTransport.requestDataRange\");\n }\n\n abort() {}\n}\n\n/**\n * Proxy to a `PDFDocument` in the worker thread.\n */\nclass PDFDocumentProxy {\n constructor(pdfInfo, transport) {\n this._pdfInfo = pdfInfo;\n this._transport = transport;\n\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) {\n // For testing purposes.\n Object.defineProperty(this, \"getXFADatasets\", {\n value: () => {\n return this._transport.getXFADatasets();\n },\n });\n }\n }\n\n /**\n * @type {AnnotationStorage} Storage for annotation data in forms.\n */\n get annotationStorage() {\n return this._transport.annotationStorage;\n }\n\n /**\n * @type {number} Total number of pages in the PDF file.\n */\n get numPages() {\n return this._pdfInfo.numPages;\n }\n\n /**\n * @type {Array} A (not guaranteed to be) unique ID to\n * identify the PDF document.\n * NOTE: The first element will always be defined for all PDF documents,\n * whereas the second element is only defined for *modified* PDF documents.\n */\n get fingerprints() {\n return this._pdfInfo.fingerprints;\n }\n\n /**\n * @type {boolean} True if only XFA form.\n */\n get isPureXfa() {\n return shadow(this, \"isPureXfa\", !!this._transport._htmlForXfa);\n }\n\n /**\n * NOTE: This is (mostly) intended to support printing of XFA forms.\n *\n * @type {Object | null} An object representing a HTML tree structure\n * to render the XFA, or `null` when no XFA form exists.\n */\n get allXfaHtml() {\n return this._transport._htmlForXfa;\n }\n\n /**\n * @param {number} pageNumber - The page number to get. The first page is 1.\n * @returns {Promise} A promise that is resolved with\n * a {@link PDFPageProxy} object.\n */\n getPage(pageNumber) {\n return this._transport.getPage(pageNumber);\n }\n\n /**\n * @param {RefProxy} ref - The page reference.\n * @returns {Promise} A promise that is resolved with the page index,\n * starting from zero, that is associated with the reference.\n */\n getPageIndex(ref) {\n return this._transport.getPageIndex(ref);\n }\n\n /**\n * @returns {Promise>>} A promise that is resolved\n * with a mapping from named destinations to references.\n *\n * This can be slow for large documents. Use `getDestination` instead.\n */\n getDestinations() {\n return this._transport.getDestinations();\n }\n\n /**\n * @param {string} id - The named destination to get.\n * @returns {Promise | null>} A promise that is resolved with all\n * information of the given named destination, or `null` when the named\n * destination is not present in the PDF file.\n */\n getDestination(id) {\n return this._transport.getDestination(id);\n }\n\n /**\n * @returns {Promise | null>} A promise that is resolved with\n * an {Array} containing the page labels that correspond to the page\n * indexes, or `null` when no page labels are present in the PDF file.\n */\n getPageLabels() {\n return this._transport.getPageLabels();\n }\n\n /**\n * @returns {Promise} A promise that is resolved with a {string}\n * containing the page layout name.\n */\n getPageLayout() {\n return this._transport.getPageLayout();\n }\n\n /**\n * @returns {Promise} A promise that is resolved with a {string}\n * containing the page mode name.\n */\n getPageMode() {\n return this._transport.getPageMode();\n }\n\n /**\n * @returns {Promise} A promise that is resolved with an\n * {Object} containing the viewer preferences, or `null` when no viewer\n * preferences are present in the PDF file.\n */\n getViewerPreferences() {\n return this._transport.getViewerPreferences();\n }\n\n /**\n * @returns {Promise} A promise that is resolved with an {Array}\n * containing the destination, or `null` when no open action is present\n * in the PDF.\n */\n getOpenAction() {\n return this._transport.getOpenAction();\n }\n\n /**\n * @returns {Promise} A promise that is resolved with a lookup table\n * for mapping named attachments to their content.\n */\n getAttachments() {\n return this._transport.getAttachments();\n }\n\n /**\n * @returns {Promise | null>} A promise that is resolved with\n * an {Array} of all the JavaScript strings in the name tree, or `null`\n * if no JavaScript exists.\n */\n getJavaScript() {\n return this._transport.getJavaScript();\n }\n\n /**\n * @returns {Promise} A promise that is resolved with\n * an {Object} with the JavaScript actions:\n * - from the name tree (like getJavaScript);\n * - from A or AA entries in the catalog dictionary.\n * , or `null` if no JavaScript exists.\n */\n getJSActions() {\n return this._transport.getDocJSActions();\n }\n\n /**\n * @typedef {Object} OutlineNode\n * @property {string} title\n * @property {boolean} bold\n * @property {boolean} italic\n * @property {Uint8ClampedArray} color - The color in RGB format to use for\n * display purposes.\n * @property {string | Array | null} dest\n * @property {string | null} url\n * @property {string | undefined} unsafeUrl\n * @property {boolean | undefined} newWindow\n * @property {number | undefined} count\n * @property {Array} items\n */\n\n /**\n * @returns {Promise>} A promise that is resolved with an\n * {Array} that is a tree outline (if it has one) of the PDF file.\n */\n getOutline() {\n return this._transport.getOutline();\n }\n\n /**\n * @returns {Promise} A promise that is resolved with\n * an {@link OptionalContentConfig} that contains all the optional content\n * groups (assuming that the document has any).\n */\n getOptionalContentConfig() {\n return this._transport.getOptionalContentConfig();\n }\n\n /**\n * @returns {Promise | null>} A promise that is resolved with\n * an {Array} that contains the permission flags for the PDF document, or\n * `null` when no permissions are present in the PDF file.\n */\n getPermissions() {\n return this._transport.getPermissions();\n }\n\n /**\n * @returns {Promise<{ info: Object, metadata: Metadata }>} A promise that is\n * resolved with an {Object} that has `info` and `metadata` properties.\n * `info` is an {Object} filled with anything available in the information\n * dictionary and similarly `metadata` is a {Metadata} object with\n * information from the metadata section of the PDF.\n */\n getMetadata() {\n return this._transport.getMetadata();\n }\n\n /**\n * @typedef {Object} MarkInfo\n * Properties correspond to Table 321 of the PDF 32000-1:2008 spec.\n * @property {boolean} Marked\n * @property {boolean} UserProperties\n * @property {boolean} Suspects\n */\n\n /**\n * @returns {Promise} A promise that is resolved with\n * a {MarkInfo} object that contains the MarkInfo flags for the PDF\n * document, or `null` when no MarkInfo values are present in the PDF file.\n */\n getMarkInfo() {\n return this._transport.getMarkInfo();\n }\n\n /**\n * @returns {Promise} A promise that is resolved with a\n * {Uint8Array} containing the raw data of the PDF document.\n */\n getData() {\n return this._transport.getData();\n }\n\n /**\n * @returns {Promise} A promise that is resolved with a\n * {Uint8Array} containing the full data of the saved document.\n */\n saveDocument() {\n return this._transport.saveDocument();\n }\n\n /**\n * @returns {Promise<{ length: number }>} A promise that is resolved when the\n * document's data is loaded. It is resolved with an {Object} that contains\n * the `length` property that indicates size of the PDF data in bytes.\n */\n getDownloadInfo() {\n return this._transport.downloadInfoCapability.promise;\n }\n\n /**\n * Cleans up resources allocated by the document on both the main and worker\n * threads.\n *\n * NOTE: Do not, under any circumstances, call this method when rendering is\n * currently ongoing since that may lead to rendering errors.\n *\n * @param {boolean} [keepLoadedFonts] - Let fonts remain attached to the DOM.\n * NOTE: This will increase persistent memory usage, hence don't use this\n * option unless absolutely necessary. The default value is `false`.\n * @returns {Promise} A promise that is resolved when clean-up has finished.\n */\n cleanup(keepLoadedFonts = false) {\n return this._transport.startCleanup(keepLoadedFonts || this.isPureXfa);\n }\n\n /**\n * Destroys the current document instance and terminates the worker.\n */\n destroy() {\n return this.loadingTask.destroy();\n }\n\n /**\n * @type {DocumentInitParameters} A subset of the current\n * {DocumentInitParameters}, which are needed in the viewer.\n */\n get loadingParams() {\n return this._transport.loadingParams;\n }\n\n /**\n * @type {PDFDocumentLoadingTask} The loadingTask for the current document.\n */\n get loadingTask() {\n return this._transport.loadingTask;\n }\n\n /**\n * @returns {Promise> | null>} A promise that is\n * resolved with an {Object} containing /AcroForm field data for the JS\n * sandbox, or `null` when no field data is present in the PDF file.\n */\n getFieldObjects() {\n return this._transport.getFieldObjects();\n }\n\n /**\n * @returns {Promise} A promise that is resolved with `true`\n * if some /AcroForm fields have JavaScript actions.\n */\n hasJSActions() {\n return this._transport.hasJSActions();\n }\n\n /**\n * @returns {Promise | null>} A promise that is resolved with an\n * {Array} containing IDs of annotations that have a calculation\n * action, or `null` when no such annotations are present in the PDF file.\n */\n getCalculationOrderIds() {\n return this._transport.getCalculationOrderIds();\n }\n}\n\n/**\n * Page getViewport parameters.\n *\n * @typedef {Object} GetViewportParameters\n * @property {number} scale - The desired scale of the viewport.\n * @property {number} [rotation] - The desired rotation, in degrees, of\n * the viewport. If omitted it defaults to the page rotation.\n * @property {number} [offsetX] - The horizontal, i.e. x-axis, offset.\n * The default value is `0`.\n * @property {number} [offsetY] - The vertical, i.e. y-axis, offset.\n * The default value is `0`.\n * @property {boolean} [dontFlip] - If true, the y-axis will not be\n * flipped. The default value is `false`.\n */\n\n/**\n * Page getTextContent parameters.\n *\n * @typedef {Object} getTextContentParameters\n * @property {boolean} disableCombineTextItems - Do not attempt to combine\n * same line {@link TextItem}'s. The default value is `false`.\n * @property {boolean} [includeMarkedContent] - When true include marked\n * content items in the items array of TextContent. The default is `false`.\n */\n\n/**\n * Page text content.\n *\n * @typedef {Object} TextContent\n * @property {Array} items - Array of\n * {@link TextItem} and {@link TextMarkedContent} objects. TextMarkedContent\n * items are included when includeMarkedContent is true.\n * @property {Object} styles - {@link TextStyle} objects,\n * indexed by font name.\n */\n\n/**\n * Page text content part.\n *\n * @typedef {Object} TextItem\n * @property {string} str - Text content.\n * @property {string} dir - Text direction: 'ttb', 'ltr' or 'rtl'.\n * @property {Array} transform - Transformation matrix.\n * @property {number} width - Width in device space.\n * @property {number} height - Height in device space.\n * @property {string} fontName - Font name used by PDF.js for converted font.\n * @property {boolean} hasEOL - Indicating if the text content is followed by a\n * line-break.\n */\n\n/**\n * Page text marked content part.\n *\n * @typedef {Object} TextMarkedContent\n * @property {string} type - Either 'beginMarkedContent',\n * 'beginMarkedContentProps', or 'endMarkedContent'.\n * @property {string} id - The marked content identifier. Only used for type\n * 'beginMarkedContentProps'.\n */\n\n/**\n * Text style.\n *\n * @typedef {Object} TextStyle\n * @property {number} ascent - Font ascent.\n * @property {number} descent - Font descent.\n * @property {boolean} vertical - Whether or not the text is in vertical mode.\n * @property {string} fontFamily - The possible font family.\n */\n\n/**\n * Page annotation parameters.\n *\n * @typedef {Object} GetAnnotationsParameters\n * @property {string} [intent] - Determines the annotations that are fetched,\n * can be 'display' (viewable annotations), 'print' (printable annotations),\n * or 'any' (all annotations). The default value is 'display'.\n */\n\n/**\n * Page render parameters.\n *\n * @typedef {Object} RenderParameters\n * @property {Object} canvasContext - A 2D context of a DOM Canvas object.\n * @property {PageViewport} viewport - Rendering viewport obtained by calling\n * the `PDFPageProxy.getViewport` method.\n * @property {string} [intent] - Rendering intent, can be 'display', 'print',\n * or 'any'. The default value is 'display'.\n * @property {number} [annotationMode] Controls which annotations are rendered\n * onto the canvas, for annotations with appearance-data; the values from\n * {@link AnnotationMode} should be used. The following values are supported:\n * - `AnnotationMode.DISABLE`, which disables all annotations.\n * - `AnnotationMode.ENABLE`, which includes all possible annotations (thus\n * it also depends on the `intent`-option, see above).\n * - `AnnotationMode.ENABLE_FORMS`, which excludes annotations that contain\n * interactive form elements (those will be rendered in the display layer).\n * - `AnnotationMode.ENABLE_STORAGE`, which includes all possible annotations\n * (as above) but where interactive form elements are updated with data\n * from the {@link AnnotationStorage}-instance; useful e.g. for printing.\n * The default value is `AnnotationMode.ENABLE`.\n * @property {Array} [transform] - Additional transform, applied just\n * before viewport transform.\n * @property {Object} [canvasFactory] - The factory instance that will be used\n * when creating canvases. The default value is {new DOMCanvasFactory()}.\n * @property {Object | string} [background] - Background to use for the canvas.\n * Any valid `canvas.fillStyle` can be used: a `DOMString` parsed as CSS\n * value, a `CanvasGradient` object (a linear or radial gradient) or\n * a `CanvasPattern` object (a repetitive image). The default value is\n * 'rgb(255,255,255)'.\n *\n * NOTE: This option may be partially, or completely, ignored when the\n * `pageColors`-option is used.\n * @property {Object} [pageColors] - Overwrites background and foreground colors\n * with user defined ones in order to improve readability in high contrast\n * mode.\n * @property {Promise} [optionalContentConfigPromise] -\n * A promise that should resolve with an {@link OptionalContentConfig}\n * created from `PDFDocumentProxy.getOptionalContentConfig`. If `null`,\n * the configuration will be fetched automatically with the default visibility\n * states set.\n * @property {Map} [annotationCanvasMap] - Map some\n * annotation ids with canvases used to render them.\n * @property {PrintAnnotationStorage} [printAnnotationStorage]\n */\n\n/**\n * Page getOperatorList parameters.\n *\n * @typedef {Object} GetOperatorListParameters\n * @property {string} [intent] - Rendering intent, can be 'display', 'print',\n * or 'any'. The default value is 'display'.\n * @property {number} [annotationMode] Controls which annotations are included\n * in the operatorList, for annotations with appearance-data; the values from\n * {@link AnnotationMode} should be used. The following values are supported:\n * - `AnnotationMode.DISABLE`, which disables all annotations.\n * - `AnnotationMode.ENABLE`, which includes all possible annotations (thus\n * it also depends on the `intent`-option, see above).\n * - `AnnotationMode.ENABLE_FORMS`, which excludes annotations that contain\n * interactive form elements (those will be rendered in the display layer).\n * - `AnnotationMode.ENABLE_STORAGE`, which includes all possible annotations\n * (as above) but where interactive form elements are updated with data\n * from the {@link AnnotationStorage}-instance; useful e.g. for printing.\n * The default value is `AnnotationMode.ENABLE`.\n * @property {PrintAnnotationStorage} [printAnnotationStorage]\n */\n\n/**\n * Structure tree node. The root node will have a role \"Root\".\n *\n * @typedef {Object} StructTreeNode\n * @property {Array} children - Array of\n * {@link StructTreeNode} and {@link StructTreeContent} objects.\n * @property {string} role - element's role, already mapped if a role map exists\n * in the PDF.\n */\n\n/**\n * Structure tree content.\n *\n * @typedef {Object} StructTreeContent\n * @property {string} type - either \"content\" for page and stream structure\n * elements or \"object\" for object references.\n * @property {string} id - unique id that will map to the text layer.\n */\n\n/**\n * PDF page operator list.\n *\n * @typedef {Object} PDFOperatorList\n * @property {Array} fnArray - Array containing the operator functions.\n * @property {Array} argsArray - Array containing the arguments of the\n * functions.\n */\n\n/**\n * Proxy to a `PDFPage` in the worker thread.\n */\nclass PDFPageProxy {\n constructor(pageIndex, pageInfo, transport, ownerDocument, pdfBug = false) {\n this._pageIndex = pageIndex;\n this._pageInfo = pageInfo;\n this._ownerDocument = ownerDocument;\n this._transport = transport;\n this._stats = pdfBug ? new StatTimer() : null;\n this._pdfBug = pdfBug;\n /** @type {PDFObjects} */\n this.commonObjs = transport.commonObjs;\n this.objs = new PDFObjects();\n\n this.cleanupAfterRender = false;\n this.pendingCleanup = false;\n this._intentStates = new Map();\n this.destroyed = false;\n }\n\n /**\n * @type {number} Page number of the page. First page is 1.\n */\n get pageNumber() {\n return this._pageIndex + 1;\n }\n\n /**\n * @type {number} The number of degrees the page is rotated clockwise.\n */\n get rotate() {\n return this._pageInfo.rotate;\n }\n\n /**\n * @type {RefProxy | null} The reference that points to this page.\n */\n get ref() {\n return this._pageInfo.ref;\n }\n\n /**\n * @type {number} The default size of units in 1/72nds of an inch.\n */\n get userUnit() {\n return this._pageInfo.userUnit;\n }\n\n /**\n * @type {Array} An array of the visible portion of the PDF page in\n * user space units [x1, y1, x2, y2].\n */\n get view() {\n return this._pageInfo.view;\n }\n\n /**\n * @param {GetViewportParameters} params - Viewport parameters.\n * @returns {PageViewport} Contains 'width' and 'height' properties\n * along with transforms required for rendering.\n */\n getViewport({\n scale,\n rotation = this.rotate,\n offsetX = 0,\n offsetY = 0,\n dontFlip = false,\n } = {}) {\n return new PageViewport({\n viewBox: this.view,\n scale,\n rotation,\n offsetX,\n offsetY,\n dontFlip,\n });\n }\n\n /**\n * @param {GetAnnotationsParameters} params - Annotation parameters.\n * @returns {Promise>} A promise that is resolved with an\n * {Array} of the annotation objects.\n */\n getAnnotations({ intent = \"display\" } = {}) {\n const intentArgs = this._transport.getRenderingIntent(intent);\n\n return this._transport.getAnnotations(\n this._pageIndex,\n intentArgs.renderingIntent\n );\n }\n\n /**\n * @returns {Promise} A promise that is resolved with an\n * {Object} with JS actions.\n */\n getJSActions() {\n return this._transport.getPageJSActions(this._pageIndex);\n }\n\n /**\n * @type {boolean} True if only XFA form.\n */\n get isPureXfa() {\n return shadow(this, \"isPureXfa\", !!this._transport._htmlForXfa);\n }\n\n /**\n * @returns {Promise} A promise that is resolved with\n * an {Object} with a fake DOM object (a tree structure where elements\n * are {Object} with a name, attributes (class, style, ...), value and\n * children, very similar to a HTML DOM tree), or `null` if no XFA exists.\n */\n async getXfa() {\n return this._transport._htmlForXfa?.children[this._pageIndex] || null;\n }\n\n /**\n * Begins the process of rendering a page to the desired context.\n *\n * @param {RenderParameters} params - Page render parameters.\n * @returns {RenderTask} An object that contains a promise that is\n * resolved when the page finishes rendering.\n */\n render({\n canvasContext,\n viewport,\n intent = \"display\",\n annotationMode = AnnotationMode.ENABLE,\n transform = null,\n canvasFactory = null,\n background = null,\n optionalContentConfigPromise = null,\n annotationCanvasMap = null,\n pageColors = null,\n printAnnotationStorage = null,\n }) {\n this._stats?.time(\"Overall\");\n\n const intentArgs = this._transport.getRenderingIntent(\n intent,\n annotationMode,\n printAnnotationStorage\n );\n // If there was a pending destroy, cancel it so no cleanup happens during\n // this call to render.\n this.pendingCleanup = false;\n\n if (!optionalContentConfigPromise) {\n optionalContentConfigPromise = this._transport.getOptionalContentConfig();\n }\n\n let intentState = this._intentStates.get(intentArgs.cacheKey);\n if (!intentState) {\n intentState = Object.create(null);\n this._intentStates.set(intentArgs.cacheKey, intentState);\n }\n\n // Ensure that a pending `streamReader` cancel timeout is always aborted.\n if (intentState.streamReaderCancelTimeout) {\n clearTimeout(intentState.streamReaderCancelTimeout);\n intentState.streamReaderCancelTimeout = null;\n }\n\n const canvasFactoryInstance =\n canvasFactory ||\n new DefaultCanvasFactory({ ownerDocument: this._ownerDocument });\n const intentPrint = !!(\n intentArgs.renderingIntent & RenderingIntentFlag.PRINT\n );\n\n // If there's no displayReadyCapability yet, then the operatorList\n // was never requested before. Make the request and create the promise.\n if (!intentState.displayReadyCapability) {\n intentState.displayReadyCapability = createPromiseCapability();\n intentState.operatorList = {\n fnArray: [],\n argsArray: [],\n lastChunk: false,\n separateAnnots: null,\n };\n\n this._stats?.time(\"Page Request\");\n this._pumpOperatorList(intentArgs);\n }\n\n const complete = error => {\n intentState.renderTasks.delete(internalRenderTask);\n\n // Attempt to reduce memory usage during *printing*, by always running\n // cleanup once rendering has finished (regardless of cleanupAfterRender).\n if (this.cleanupAfterRender || intentPrint) {\n this.pendingCleanup = true;\n }\n this._tryCleanup();\n\n if (error) {\n internalRenderTask.capability.reject(error);\n\n this._abortOperatorList({\n intentState,\n reason: error instanceof Error ? error : new Error(error),\n });\n } else {\n internalRenderTask.capability.resolve();\n }\n\n this._stats?.timeEnd(\"Rendering\");\n this._stats?.timeEnd(\"Overall\");\n };\n\n const internalRenderTask = new InternalRenderTask({\n callback: complete,\n // Only include the required properties, and *not* the entire object.\n params: {\n canvasContext,\n viewport,\n transform,\n background,\n },\n objs: this.objs,\n commonObjs: this.commonObjs,\n annotationCanvasMap,\n operatorList: intentState.operatorList,\n pageIndex: this._pageIndex,\n canvasFactory: canvasFactoryInstance,\n useRequestAnimationFrame: !intentPrint,\n pdfBug: this._pdfBug,\n pageColors,\n });\n\n (intentState.renderTasks ||= new Set()).add(internalRenderTask);\n const renderTask = internalRenderTask.task;\n\n Promise.all([\n intentState.displayReadyCapability.promise,\n optionalContentConfigPromise,\n ])\n .then(([transparency, optionalContentConfig]) => {\n if (this.pendingCleanup) {\n complete();\n return;\n }\n this._stats?.time(\"Rendering\");\n\n internalRenderTask.initializeGraphics({\n transparency,\n optionalContentConfig,\n });\n internalRenderTask.operatorListChanged();\n })\n .catch(complete);\n\n return renderTask;\n }\n\n /**\n * @param {GetOperatorListParameters} params - Page getOperatorList\n * parameters.\n * @returns {Promise} A promise resolved with an\n * {@link PDFOperatorList} object that represents the page's operator list.\n */\n getOperatorList({\n intent = \"display\",\n annotationMode = AnnotationMode.ENABLE,\n printAnnotationStorage = null,\n } = {}) {\n function operatorListChanged() {\n if (intentState.operatorList.lastChunk) {\n intentState.opListReadCapability.resolve(intentState.operatorList);\n\n intentState.renderTasks.delete(opListTask);\n }\n }\n\n const intentArgs = this._transport.getRenderingIntent(\n intent,\n annotationMode,\n printAnnotationStorage,\n /* isOpList = */ true\n );\n let intentState = this._intentStates.get(intentArgs.cacheKey);\n if (!intentState) {\n intentState = Object.create(null);\n this._intentStates.set(intentArgs.cacheKey, intentState);\n }\n let opListTask;\n\n if (!intentState.opListReadCapability) {\n opListTask = Object.create(null);\n opListTask.operatorListChanged = operatorListChanged;\n intentState.opListReadCapability = createPromiseCapability();\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 disableCombineTextItems = false,\n includeMarkedContent = false,\n } = {}) {\n const TEXT_CONTENT_CHUNK_SIZE = 100;\n\n return this._transport.messageHandler.sendWithStream(\n \"GetTextContent\",\n {\n pageIndex: this._pageIndex,\n combineTextItems: disableCombineTextItems !== true,\n includeMarkedContent: includeMarkedContent === true,\n },\n {\n highWaterMark: TEXT_CONTENT_CHUNK_SIZE,\n size(textContent) {\n return textContent.items.length;\n },\n }\n );\n }\n\n /**\n * NOTE: All occurrences of whitespace will be replaced by\n * standard spaces (0x20).\n *\n * @param {getTextContentParameters} params - getTextContent parameters.\n * @returns {Promise} A promise that is resolved with a\n * {@link TextContent} object that represents the page's text content.\n */\n getTextContent(params = {}) {\n if (this._transport._htmlForXfa) {\n // TODO: We need to revisit this once the XFA foreground patch lands and\n // only do this for non-foreground XFA.\n return this.getXfa().then(xfa => {\n return XfaText.textContent(xfa);\n });\n }\n const readableStream = this.streamTextContent(params);\n\n return new Promise(function (resolve, reject) {\n function pump() {\n reader.read().then(function ({ value, done }) {\n if (done) {\n resolve(textContent);\n return;\n }\n Object.assign(textContent.styles, value.styles);\n textContent.items.push(...value.items);\n pump();\n }, reject);\n }\n\n const reader = readableStream.getReader();\n const textContent = {\n items: [],\n styles: Object.create(null),\n };\n pump();\n });\n }\n\n /**\n * @returns {Promise} 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 return Promise.all(waitOn);\n }\n\n /**\n * Cleans up resources allocated by the page.\n *\n * @param {boolean} [resetStats] - Reset page stats, if enabled.\n * The default value is `false`.\n * @returns {boolean} Indicates if clean-up was successfully run.\n */\n cleanup(resetStats = false) {\n this.pendingCleanup = true;\n return this._tryCleanup(resetStats);\n }\n\n /**\n * Attempts to clean up if rendering is in a state where that's possible.\n * @private\n */\n _tryCleanup(resetStats = false) {\n if (!this.pendingCleanup) {\n return false;\n }\n for (const { renderTasks, operatorList } of this._intentStates.values()) {\n if (renderTasks.size > 0 || !operatorList.lastChunk) {\n return false;\n }\n }\n\n this._intentStates.clear();\n this.objs.clear();\n if (resetStats && this._stats) {\n this._stats = new StatTimer();\n }\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({ renderingIntent, cacheKey, annotationStorageMap }) {\n if (\n typeof PDFJSDev === \"undefined\" ||\n PDFJSDev.test(\"!PRODUCTION || TESTING\")\n ) {\n assert(\n Number.isInteger(renderingIntent) && renderingIntent > 0,\n '_pumpOperatorList: Expected valid \"renderingIntent\" argument.'\n );\n }\n\n const readableStream = this._transport.messageHandler.sendWithStream(\n \"GetOperatorList\",\n {\n pageIndex: this._pageIndex,\n intent: renderingIntent,\n cacheKey,\n annotationStorage: annotationStorageMap,\n }\n );\n const reader = readableStream.getReader();\n\n const intentState = this._intentStates.get(cacheKey);\n intentState.streamReader = reader;\n\n const pump = () => {\n reader.read().then(\n ({ value, done }) => {\n if (done) {\n intentState.streamReader = null;\n return;\n }\n if (this._transport.destroyed) {\n return; // Ignore any pending requests if the worker was terminated.\n }\n this._renderPageChunk(value, intentState);\n pump();\n },\n reason => {\n intentState.streamReader = null;\n\n if (this._transport.destroyed) {\n return; // Ignore any pending requests if the worker was terminated.\n }\n if (intentState.operatorList) {\n // Mark operator list as complete.\n intentState.operatorList.lastChunk = true;\n\n for (const internalRenderTask of intentState.renderTasks) {\n internalRenderTask.operatorListChanged();\n }\n this._tryCleanup();\n }\n\n if (intentState.displayReadyCapability) {\n intentState.displayReadyCapability.reject(reason);\n } else if (intentState.opListReadCapability) {\n intentState.opListReadCapability.reject(reason);\n } else {\n throw reason;\n }\n }\n );\n };\n pump();\n }\n\n /**\n * @private\n */\n _abortOperatorList({ intentState, reason, force = false }) {\n if (\n typeof PDFJSDev === \"undefined\" ||\n PDFJSDev.test(\"!PRODUCTION || TESTING\")\n ) {\n assert(\n reason instanceof Error,\n '_abortOperatorList: Expected valid \"reason\" argument.'\n );\n }\n\n if (!intentState.streamReader) {\n return;\n }\n // 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 {Object} Returns page stats, if enabled; returns `null` otherwise.\n */\n get stats() {\n return this._stats;\n }\n}\n\nclass LoopbackPort {\n #listeners = new Set();\n\n #deferred = Promise.resolve();\n\n postMessage(obj, transfers) {\n const event = {\n data: structuredClone(obj, transfers),\n };\n\n this.#deferred.then(() => {\n for (const listener of this.#listeners) {\n listener.call(this, event);\n }\n });\n }\n\n addEventListener(name, listener) {\n this.#listeners.add(listener);\n }\n\n removeEventListener(name, listener) {\n this.#listeners.delete(listener);\n }\n\n terminate() {\n this.#listeners.clear();\n }\n}\n\n/**\n * @typedef {Object} PDFWorkerParameters\n * @property {string} [name] - The name of the worker.\n * @property {Object} [port] - The `workerPort` object.\n * @property {number} [verbosity] - Controls the logging level;\n * the constants from {@link VerbosityLevel} should be used.\n */\n\nconst PDFWorkerUtil = {\n isWorkerDisabled: false,\n fallbackWorkerSrc: null,\n fakeWorkerId: 0,\n};\nif (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"GENERIC\")) {\n // eslint-disable-next-line no-undef\n if (isNodeJS && typeof __non_webpack_require__ === \"function\") {\n // Workers aren't supported in Node.js, force-disabling them there.\n PDFWorkerUtil.isWorkerDisabled = true;\n\n PDFWorkerUtil.fallbackWorkerSrc = PDFJSDev.test(\"LIB\")\n ? \"../pdf.worker.js\"\n : \"./pdf.worker.js\";\n } else if (typeof document === \"object\") {\n const pdfjsFilePath = document?.currentScript?.src;\n if (pdfjsFilePath) {\n PDFWorkerUtil.fallbackWorkerSrc = pdfjsFilePath.replace(\n /(\\.(?:min\\.)?js)(\\?.*)?$/i,\n \".worker$1$2\"\n );\n }\n }\n\n // Check if URLs have the same origin. For non-HTTP based URLs, returns false.\n PDFWorkerUtil.isSameOrigin = function (baseUrl, otherUrl) {\n let base;\n try {\n base = new URL(baseUrl);\n if (!base.origin || base.origin === \"null\") {\n return false; // non-HTTP url\n }\n } catch (e) {\n return false;\n }\n\n const other = new URL(otherUrl, base);\n return base.origin === other.origin;\n };\n\n PDFWorkerUtil.createCDNWrapper = function (url) {\n // We will rely on blob URL's property to specify origin.\n // We want this function to fail in case if createObjectURL or Blob do not\n // exist or fail for some reason -- our Worker creation will fail anyway.\n const wrapper = `importScripts(\"${url}\");`;\n return URL.createObjectURL(new Blob([wrapper]));\n };\n}\n\n/**\n * PDF.js web worker abstraction that controls the instantiation of PDF\n * documents. Message handlers are used to pass information from the main\n * thread to the worker thread and vice versa. If the creation of a web\n * worker is not possible, a \"fake\" worker will be used instead.\n *\n * @param {PDFWorkerParameters} params - The worker initialization parameters.\n */\nclass PDFWorker {\n static #workerPorts = new WeakMap();\n\n constructor({\n name = null,\n port = null,\n verbosity = getVerbosityLevel(),\n } = {}) {\n if (port && PDFWorker.#workerPorts.has(port)) {\n throw new Error(\"Cannot use more than one PDFWorker per port.\");\n }\n\n this.name = name;\n this.destroyed = false;\n this.verbosity = verbosity;\n\n this._readyCapability = createPromiseCapability();\n this._port = null;\n this._webWorker = null;\n this._messageHandler = null;\n\n if (port) {\n PDFWorker.#workerPorts.set(port, this);\n this._initializeFromPort(port);\n return;\n }\n this._initialize();\n }\n\n /**\n * Promise for worker initialization completion.\n * @type {Promise}\n */\n get promise() {\n return this._readyCapability.promise;\n }\n\n /**\n * The current `workerPort`, when it exists.\n * @type {Worker}\n */\n get port() {\n return this._port;\n }\n\n /**\n * The current MessageHandler-instance.\n * @type {MessageHandler}\n */\n get messageHandler() {\n return this._messageHandler;\n }\n\n _initializeFromPort(port) {\n this._port = port;\n this._messageHandler = new MessageHandler(\"main\", \"worker\", port);\n this._messageHandler.on(\"ready\", function () {\n // Ignoring \"ready\" event -- MessageHandler should already be initialized\n // and ready to accept messages.\n });\n this._readyCapability.resolve();\n // Send global setting, e.g. verbosity level.\n this._messageHandler.send(\"configure\", {\n verbosity: this.verbosity,\n });\n }\n\n _initialize() {\n // If worker support isn't disabled explicit and the browser has worker\n // support, create a new web worker and test if it/the browser fulfills\n // all requirements to run parts of pdf.js in a web worker.\n // Right now, the requirement is, that an Uint8Array is still an\n // Uint8Array as it arrives on the worker. (Chrome added this with v.15.)\n if (\n !PDFWorkerUtil.isWorkerDisabled &&\n !PDFWorker._mainThreadWorkerMessageHandler\n ) {\n let { workerSrc } = PDFWorker;\n\n try {\n // Wraps workerSrc path into blob URL, if the former does not belong\n // to the same origin.\n if (\n typeof PDFJSDev !== \"undefined\" &&\n PDFJSDev.test(\"GENERIC\") &&\n !PDFWorkerUtil.isSameOrigin(window.location.href, workerSrc)\n ) {\n workerSrc = PDFWorkerUtil.createCDNWrapper(\n new URL(workerSrc, window.location).href\n );\n }\n\n // Some versions of FF can't create a worker on localhost, see:\n // https://bugzilla.mozilla.org/show_bug.cgi?id=683280\n const worker =\n (typeof PDFJSDev === \"undefined\" || !PDFJSDev.test(\"PRODUCTION\")) &&\n !workerSrc.endsWith(\"/build/pdf.worker.js\") &&\n !workerSrc.endsWith(\"/src/worker_loader.js\")\n ? new Worker(workerSrc, { type: \"module\" })\n : new Worker(workerSrc);\n const messageHandler = new MessageHandler(\"main\", \"worker\", worker);\n const terminateEarly = () => {\n worker.removeEventListener(\"error\", onWorkerError);\n messageHandler.destroy();\n worker.terminate();\n if (this.destroyed) {\n this._readyCapability.reject(new Error(\"Worker was destroyed\"));\n } else {\n // Fall back to fake worker if the termination is caused by an\n // error (e.g. NetworkError / SecurityError).\n this._setupFakeWorker();\n }\n };\n\n const onWorkerError = () => {\n if (!this._webWorker) {\n // Worker failed to initialize due to an error. Clean up and fall\n // back to the fake worker.\n terminateEarly();\n }\n };\n worker.addEventListener(\"error\", onWorkerError);\n\n messageHandler.on(\"test\", data => {\n worker.removeEventListener(\"error\", onWorkerError);\n if (this.destroyed) {\n terminateEarly();\n return; // worker was destroyed\n }\n if (data) {\n this._messageHandler = messageHandler;\n this._port = worker;\n this._webWorker = worker;\n\n this._readyCapability.resolve();\n // Send global setting, e.g. verbosity level.\n messageHandler.send(\"configure\", {\n verbosity: this.verbosity,\n });\n } else {\n this._setupFakeWorker();\n messageHandler.destroy();\n worker.terminate();\n }\n });\n\n messageHandler.on(\"ready\", data => {\n worker.removeEventListener(\"error\", onWorkerError);\n if (this.destroyed) {\n terminateEarly();\n return; // worker was destroyed\n }\n try {\n sendTest();\n } catch (e) {\n // We need fallback to a faked worker.\n this._setupFakeWorker();\n }\n });\n\n const sendTest = () => {\n const testObj = new Uint8Array();\n // Ensure that we can use `postMessage` transfers.\n messageHandler.send(\"test\", testObj, [testObj.buffer]);\n };\n\n // It might take time for the worker to initialize. We will try to send\n // the \"test\" message immediately, and once the \"ready\" message arrives.\n // The worker shall process only the first received \"test\" message.\n sendTest();\n return;\n } catch (e) {\n info(\"The worker has been disabled.\");\n }\n }\n // Either workers are disabled, not supported or have thrown an exception.\n // Thus, we fallback to a faked worker.\n this._setupFakeWorker();\n }\n\n _setupFakeWorker() {\n if (!PDFWorkerUtil.isWorkerDisabled) {\n warn(\"Setting up fake worker.\");\n PDFWorkerUtil.isWorkerDisabled = true;\n }\n\n PDFWorker._setupFakeWorkerGlobal\n .then(WorkerMessageHandler => {\n if (this.destroyed) {\n this._readyCapability.reject(new Error(\"Worker was destroyed\"));\n return;\n }\n const port = new LoopbackPort();\n this._port = port;\n\n // All fake workers use the same port, making id unique.\n const id = `fake${PDFWorkerUtil.fakeWorkerId++}`;\n\n // If the main thread is our worker, setup the handling for the\n // messages -- the main thread sends to it self.\n const workerHandler = new MessageHandler(id + \"_worker\", id, port);\n WorkerMessageHandler.setup(workerHandler, port);\n\n const messageHandler = new MessageHandler(id, id + \"_worker\", port);\n this._messageHandler = messageHandler;\n this._readyCapability.resolve();\n // Send global setting, e.g. verbosity level.\n messageHandler.send(\"configure\", {\n verbosity: this.verbosity,\n });\n })\n .catch(reason => {\n this._readyCapability.reject(\n new Error(`Setting up fake worker failed: \"${reason.message}\".`)\n );\n });\n }\n\n /**\n * Destroys the worker instance.\n */\n destroy() {\n this.destroyed = true;\n if (this._webWorker) {\n // We need to terminate only web worker created resource.\n this._webWorker.terminate();\n this._webWorker = null;\n }\n PDFWorker.#workerPorts.delete(this._port);\n this._port = null;\n if (this._messageHandler) {\n this._messageHandler.destroy();\n this._messageHandler = null;\n }\n }\n\n /**\n * @param {PDFWorkerParameters} params - The worker initialization parameters.\n */\n static fromPort(params) {\n if (!params?.port) {\n throw new Error(\"PDFWorker.fromPort - invalid method signature.\");\n }\n if (this.#workerPorts.has(params.port)) {\n return this.#workerPorts.get(params.port);\n }\n return new PDFWorker(params);\n }\n\n /**\n * The current `workerSrc`, when it exists.\n * @type {string}\n */\n static get workerSrc() {\n if (GlobalWorkerOptions.workerSrc) {\n return GlobalWorkerOptions.workerSrc;\n }\n if (\n (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"GENERIC\")) &&\n PDFWorkerUtil.fallbackWorkerSrc !== null\n ) {\n if (!isNodeJS) {\n deprecated('No \"GlobalWorkerOptions.workerSrc\" specified.');\n }\n return PDFWorkerUtil.fallbackWorkerSrc;\n }\n throw new Error('No \"GlobalWorkerOptions.workerSrc\" specified.');\n }\n\n static get _mainThreadWorkerMessageHandler() {\n try {\n return globalThis.pdfjsWorker?.WorkerMessageHandler || null;\n } catch (ex) {\n return null;\n }\n }\n\n // Loads worker code into the main-thread.\n static get _setupFakeWorkerGlobal() {\n const loader = async () => {\n const mainWorkerMessageHandler = this._mainThreadWorkerMessageHandler;\n\n if (mainWorkerMessageHandler) {\n // The worker was already loaded using e.g. a ` - - - - - - -
- -
-
-
-
- - - - -
-
- -
- -
-
-
-
-
- - - -
-
-
- -
- - - - - - - - -
-
-
-
- -
- -
- -
- -
- - -
-
- - - - - - -
- -
- - -
- -
- - -
-
-
- -
- -
- - - -
-
-
-
-
-
-
-
-
-
- -
-
-
-
- -
- -
- -
-
- -
-
- - -
-
- -
- File name: -

-

-
-
- File size: -

-

-
-
-
- Title: -

-

-
-
- Author: -

-

-
-
- Subject: -

-

-
-
- Keywords: -

-

-
-
- Creation Date: -

-

-
-
- Modification Date: -

-

-
-
- Creator: -

-

-
-
-
- PDF Producer: -

-

-
-
- PDF Version: -

-

-
-
- Page Count: -

-

-
-
- Page Size: -

-

-
-
-
- Fast Web View: -

-

-
-
- -
-
- -
- Preparing document for printing… -
-
- - 0% -
-
- -
-
-
- -
-
- - - - diff --git a/static/js/pdf-js/web/viewer.js b/static/js/pdf-js/web/viewer.js deleted file mode 100644 index 6706c10..0000000 --- a/static/js/pdf-js/web/viewer.js +++ /dev/null @@ -1,13912 +0,0 @@ -/** - * @licstart The following is the entire license notice for the - * JavaScript code in this page - * - * Copyright 2023 Mozilla Foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * @licend The above is the entire license notice for the - * JavaScript code in this page - */ - -/******/ (() => { // webpackBootstrap -/******/ "use strict"; -/******/ var __webpack_modules__ = ([ -/* 0 */, -/* 1 */ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.GenericCom = void 0; -var _app = __webpack_require__(2); -var _preferences = __webpack_require__(42); -var _download_manager = __webpack_require__(43); -var _genericl10n = __webpack_require__(44); -var _generic_scripting = __webpack_require__(46); -; -const GenericCom = {}; -exports.GenericCom = GenericCom; -class GenericPreferences extends _preferences.BasePreferences { - async _writeToStorage(prefObj) { - localStorage.setItem("pdfjs.preferences", JSON.stringify(prefObj)); - } - async _readFromStorage(prefObj) { - return JSON.parse(localStorage.getItem("pdfjs.preferences")); - } -} -class GenericExternalServices extends _app.DefaultExternalServices { - static createDownloadManager() { - return new _download_manager.DownloadManager(); - } - static createPreferences() { - return new GenericPreferences(); - } - static createL10n({ - locale = "en-US" - }) { - return new _genericl10n.GenericL10n(locale); - } - static createScripting({ - sandboxBundleSrc - }) { - return new _generic_scripting.GenericScripting(sandboxBundleSrc); - } -} -_app.PDFViewerApplication.externalServices = GenericExternalServices; - -/***/ }), -/* 2 */ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.PDFViewerApplication = exports.PDFPrintServiceFactory = exports.DefaultExternalServices = void 0; -var _ui_utils = __webpack_require__(3); -var _pdfjsLib = __webpack_require__(4); -var _app_options = __webpack_require__(5); -var _event_utils = __webpack_require__(6); -var _pdf_link_service = __webpack_require__(7); -var _webAnnotation_editor_params = __webpack_require__(8); -var _overlay_manager = __webpack_require__(9); -var _password_prompt = __webpack_require__(10); -var _webPdf_attachment_viewer = __webpack_require__(11); -var _webPdf_cursor_tools = __webpack_require__(13); -var _webPdf_document_properties = __webpack_require__(15); -var _webPdf_find_bar = __webpack_require__(16); -var _pdf_find_controller = __webpack_require__(17); -var _pdf_history = __webpack_require__(19); -var _webPdf_layer_viewer = __webpack_require__(20); -var _webPdf_outline_viewer = __webpack_require__(21); -var _webPdf_presentation_mode = __webpack_require__(22); -var _pdf_rendering_queue = __webpack_require__(23); -var _pdf_scripting_manager = __webpack_require__(24); -var _webPdf_sidebar = __webpack_require__(25); -var _webPdf_sidebar_resizer = __webpack_require__(26); -var _webPdf_thumbnail_viewer = __webpack_require__(27); -var _pdf_viewer = __webpack_require__(29); -var _webSecondary_toolbar = __webpack_require__(39); -var _webToolbar = __webpack_require__(40); -var _view_history = __webpack_require__(41); -const FORCE_PAGES_LOADED_TIMEOUT = 10000; -const WHEEL_ZOOM_DISABLED_TIMEOUT = 1000; -const ViewOnLoad = { - UNKNOWN: -1, - PREVIOUS: 0, - INITIAL: 1 -}; -const ViewerCssTheme = { - AUTOMATIC: 0, - LIGHT: 1, - DARK: 2 -}; -class DefaultExternalServices { - constructor() { - throw new Error("Cannot initialize DefaultExternalServices."); - } - static updateFindControlState(data) {} - static updateFindMatchesCount(data) {} - static initPassiveLoading(callbacks) {} - static reportTelemetry(data) {} - static createDownloadManager() { - throw new Error("Not implemented: createDownloadManager"); - } - static createPreferences() { - throw new Error("Not implemented: createPreferences"); - } - static createL10n(options) { - throw new Error("Not implemented: createL10n"); - } - static createScripting(options) { - throw new Error("Not implemented: createScripting"); - } - static get supportsPinchToZoom() { - return (0, _pdfjsLib.shadow)(this, "supportsPinchToZoom", true); - } - static get supportsIntegratedFind() { - return (0, _pdfjsLib.shadow)(this, "supportsIntegratedFind", false); - } - static get supportsDocumentFonts() { - return (0, _pdfjsLib.shadow)(this, "supportsDocumentFonts", true); - } - static get supportedMouseWheelZoomModifierKeys() { - return (0, _pdfjsLib.shadow)(this, "supportedMouseWheelZoomModifierKeys", { - ctrlKey: true, - metaKey: true - }); - } - static get isInAutomation() { - return (0, _pdfjsLib.shadow)(this, "isInAutomation", false); - } - static updateEditorStates(data) { - throw new Error("Not implemented: updateEditorStates"); - } -} -exports.DefaultExternalServices = DefaultExternalServices; -const PDFViewerApplication = { - initialBookmark: document.location.hash.substring(1), - _initializedCapability: (0, _pdfjsLib.createPromiseCapability)(), - appConfig: null, - pdfDocument: null, - pdfLoadingTask: null, - printService: null, - pdfViewer: null, - pdfThumbnailViewer: null, - pdfRenderingQueue: null, - pdfPresentationMode: null, - pdfDocumentProperties: null, - pdfLinkService: null, - pdfHistory: null, - pdfSidebar: null, - pdfSidebarResizer: null, - pdfOutlineViewer: null, - pdfAttachmentViewer: null, - pdfLayerViewer: null, - pdfCursorTools: null, - pdfScriptingManager: null, - store: null, - downloadManager: null, - overlayManager: null, - preferences: null, - toolbar: null, - secondaryToolbar: null, - eventBus: null, - l10n: null, - annotationEditorParams: null, - isInitialViewSet: false, - downloadComplete: false, - isViewerEmbedded: window.parent !== window, - url: "", - baseUrl: "", - _downloadUrl: "", - externalServices: DefaultExternalServices, - _boundEvents: Object.create(null), - documentInfo: null, - metadata: null, - _contentDispositionFilename: null, - _contentLength: null, - _saveInProgress: false, - _wheelUnusedTicks: 0, - _wheelUnusedFactor: 1, - _touchUnusedTicks: 0, - _touchUnusedFactor: 1, - _PDFBug: null, - _hasAnnotationEditors: false, - _title: document.title, - _printAnnotationStoragePromise: null, - _touchInfo: null, - _isCtrlKeyDown: false, - async initialize(appConfig) { - this.preferences = this.externalServices.createPreferences(); - this.appConfig = appConfig; - await this._initializeOptions(); - this._forceCssTheme(); - await this._initializeL10n(); - if (this.isViewerEmbedded && _app_options.AppOptions.get("externalLinkTarget") === _pdf_link_service.LinkTarget.NONE) { - _app_options.AppOptions.set("externalLinkTarget", _pdf_link_service.LinkTarget.TOP); - } - await this._initializeViewerComponents(); - this.bindEvents(); - this.bindWindowEvents(); - const appContainer = appConfig.appContainer || document.documentElement; - this.l10n.translate(appContainer).then(() => { - this.eventBus.dispatch("localized", { - source: this - }); - }); - this._initializedCapability.resolve(); - }, - async _initializeOptions() { - if (_app_options.AppOptions.get("disablePreferences")) { - if (_app_options.AppOptions.get("pdfBugEnabled")) { - await this._parseHashParams(); - } - return; - } - if (_app_options.AppOptions._hasUserOptions()) { - console.warn("_initializeOptions: The Preferences may override manually set AppOptions; " + 'please use the "disablePreferences"-option in order to prevent that.'); - } - try { - _app_options.AppOptions.setAll(await this.preferences.getAll()); - } catch (reason) { - console.error(`_initializeOptions: "${reason.message}".`); - } - if (_app_options.AppOptions.get("pdfBugEnabled")) { - await this._parseHashParams(); - } - }, - async _parseHashParams() { - const hash = document.location.hash.substring(1); - if (!hash) { - return; - } - const { - mainContainer, - viewerContainer - } = this.appConfig, - params = (0, _ui_utils.parseQueryString)(hash); - if (params.get("disableworker") === "true") { - try { - await loadFakeWorker(); - } catch (ex) { - console.error(`_parseHashParams: "${ex.message}".`); - } - } - if (params.has("disablerange")) { - _app_options.AppOptions.set("disableRange", params.get("disablerange") === "true"); - } - if (params.has("disablestream")) { - _app_options.AppOptions.set("disableStream", params.get("disablestream") === "true"); - } - if (params.has("disableautofetch")) { - _app_options.AppOptions.set("disableAutoFetch", params.get("disableautofetch") === "true"); - } - if (params.has("disablefontface")) { - _app_options.AppOptions.set("disableFontFace", params.get("disablefontface") === "true"); - } - if (params.has("disablehistory")) { - _app_options.AppOptions.set("disableHistory", params.get("disablehistory") === "true"); - } - if (params.has("verbosity")) { - _app_options.AppOptions.set("verbosity", params.get("verbosity") | 0); - } - if (params.has("textlayer")) { - switch (params.get("textlayer")) { - case "off": - _app_options.AppOptions.set("textLayerMode", _ui_utils.TextLayerMode.DISABLE); - break; - case "visible": - case "shadow": - case "hover": - viewerContainer.classList.add(`textLayer-${params.get("textlayer")}`); - try { - await loadPDFBug(this); - this._PDFBug.loadCSS(); - } catch (ex) { - console.error(`_parseHashParams: "${ex.message}".`); - } - break; - } - } - if (params.has("pdfbug")) { - _app_options.AppOptions.set("pdfBug", true); - _app_options.AppOptions.set("fontExtraProperties", true); - const enabled = params.get("pdfbug").split(","); - try { - await loadPDFBug(this); - this._PDFBug.init({ - OPS: _pdfjsLib.OPS - }, mainContainer, enabled); - } catch (ex) { - console.error(`_parseHashParams: "${ex.message}".`); - } - } - if (params.has("locale")) { - _app_options.AppOptions.set("locale", params.get("locale")); - } - }, - async _initializeL10n() { - this.l10n = this.externalServices.createL10n({ - locale: _app_options.AppOptions.get("locale") - }); - const dir = await this.l10n.getDirection(); - document.getElementsByTagName("html")[0].dir = dir; - }, - _forceCssTheme() { - const cssTheme = _app_options.AppOptions.get("viewerCssTheme"); - if (cssTheme === ViewerCssTheme.AUTOMATIC || !Object.values(ViewerCssTheme).includes(cssTheme)) { - return; - } - try { - const styleSheet = document.styleSheets[0]; - const cssRules = styleSheet?.cssRules || []; - for (let i = 0, ii = cssRules.length; i < ii; i++) { - const rule = cssRules[i]; - if (rule instanceof CSSMediaRule && rule.media?.[0] === "(prefers-color-scheme: dark)") { - if (cssTheme === ViewerCssTheme.LIGHT) { - styleSheet.deleteRule(i); - return; - } - const darkRules = /^@media \(prefers-color-scheme: dark\) {\n\s*([\w\s-.,:;/\\{}()]+)\n}$/.exec(rule.cssText); - if (darkRules?.[1]) { - styleSheet.deleteRule(i); - styleSheet.insertRule(darkRules[1], i); - } - return; - } - } - } catch (reason) { - console.error(`_forceCssTheme: "${reason?.message}".`); - } - }, - async _initializeViewerComponents() { - const { - appConfig, - externalServices - } = this; - const eventBus = externalServices.isInAutomation ? new _event_utils.AutomationEventBus() : new _event_utils.EventBus(); - this.eventBus = eventBus; - this.overlayManager = new _overlay_manager.OverlayManager(); - const pdfRenderingQueue = new _pdf_rendering_queue.PDFRenderingQueue(); - pdfRenderingQueue.onIdle = this._cleanup.bind(this); - this.pdfRenderingQueue = pdfRenderingQueue; - const pdfLinkService = new _pdf_link_service.PDFLinkService({ - eventBus, - externalLinkTarget: _app_options.AppOptions.get("externalLinkTarget"), - externalLinkRel: _app_options.AppOptions.get("externalLinkRel"), - ignoreDestinationZoom: _app_options.AppOptions.get("ignoreDestinationZoom") - }); - this.pdfLinkService = pdfLinkService; - const downloadManager = externalServices.createDownloadManager(); - this.downloadManager = downloadManager; - const findController = new _pdf_find_controller.PDFFindController({ - linkService: pdfLinkService, - eventBus, - updateMatchesCountOnProgress: true - }); - this.findController = findController; - const pdfScriptingManager = new _pdf_scripting_manager.PDFScriptingManager({ - eventBus, - sandboxBundleSrc: _app_options.AppOptions.get("sandboxBundleSrc"), - scriptingFactory: externalServices, - docPropertiesLookup: this._scriptingDocProperties.bind(this) - }); - this.pdfScriptingManager = pdfScriptingManager; - const container = appConfig.mainContainer, - viewer = appConfig.viewerContainer; - const annotationEditorMode = _app_options.AppOptions.get("annotationEditorMode"); - const pageColors = _app_options.AppOptions.get("forcePageColors") || window.matchMedia("(forced-colors: active)").matches ? { - background: _app_options.AppOptions.get("pageColorsBackground"), - foreground: _app_options.AppOptions.get("pageColorsForeground") - } : null; - this.pdfViewer = new _pdf_viewer.PDFViewer({ - container, - viewer, - eventBus, - renderingQueue: pdfRenderingQueue, - linkService: pdfLinkService, - downloadManager, - findController, - scriptingManager: _app_options.AppOptions.get("enableScripting") && pdfScriptingManager, - renderer: _app_options.AppOptions.get("renderer"), - l10n: this.l10n, - textLayerMode: _app_options.AppOptions.get("textLayerMode"), - annotationMode: _app_options.AppOptions.get("annotationMode"), - annotationEditorMode, - imageResourcesPath: _app_options.AppOptions.get("imageResourcesPath"), - enablePrintAutoRotate: _app_options.AppOptions.get("enablePrintAutoRotate"), - useOnlyCssZoom: _app_options.AppOptions.get("useOnlyCssZoom"), - isOffscreenCanvasSupported: _app_options.AppOptions.get("isOffscreenCanvasSupported"), - maxCanvasPixels: _app_options.AppOptions.get("maxCanvasPixels"), - enablePermissions: _app_options.AppOptions.get("enablePermissions"), - pageColors - }); - pdfRenderingQueue.setViewer(this.pdfViewer); - pdfLinkService.setViewer(this.pdfViewer); - pdfScriptingManager.setViewer(this.pdfViewer); - if (appConfig.sidebar?.thumbnailView) { - this.pdfThumbnailViewer = new _webPdf_thumbnail_viewer.PDFThumbnailViewer({ - container: appConfig.sidebar.thumbnailView, - renderingQueue: pdfRenderingQueue, - linkService: pdfLinkService, - l10n: this.l10n, - pageColors - }); - pdfRenderingQueue.setThumbnailViewer(this.pdfThumbnailViewer); - } - if (!this.isViewerEmbedded && !_app_options.AppOptions.get("disableHistory")) { - this.pdfHistory = new _pdf_history.PDFHistory({ - linkService: pdfLinkService, - eventBus - }); - pdfLinkService.setHistory(this.pdfHistory); - } - if (!this.supportsIntegratedFind && appConfig.findBar) { - this.findBar = new _webPdf_find_bar.PDFFindBar(appConfig.findBar, eventBus, this.l10n); - } - if (appConfig.annotationEditorParams) { - if (annotationEditorMode !== _pdfjsLib.AnnotationEditorType.DISABLE) { - this.annotationEditorParams = new _webAnnotation_editor_params.AnnotationEditorParams(appConfig.annotationEditorParams, eventBus); - } else { - for (const id of ["editorModeButtons", "editorModeSeparator"]) { - document.getElementById(id)?.classList.add("hidden"); - } - } - } - if (appConfig.documentProperties) { - this.pdfDocumentProperties = new _webPdf_document_properties.PDFDocumentProperties(appConfig.documentProperties, this.overlayManager, eventBus, this.l10n, () => { - return this._docFilename; - }); - } - if (appConfig.secondaryToolbar?.cursorHandToolButton) { - this.pdfCursorTools = new _webPdf_cursor_tools.PDFCursorTools({ - container, - eventBus, - cursorToolOnLoad: _app_options.AppOptions.get("cursorToolOnLoad") - }); - } - if (appConfig.toolbar) { - this.toolbar = new _webToolbar.Toolbar(appConfig.toolbar, eventBus, this.l10n); - } - if (appConfig.secondaryToolbar) { - this.secondaryToolbar = new _webSecondary_toolbar.SecondaryToolbar(appConfig.secondaryToolbar, eventBus, this.externalServices); - } - if (this.supportsFullscreen && appConfig.secondaryToolbar?.presentationModeButton) { - this.pdfPresentationMode = new _webPdf_presentation_mode.PDFPresentationMode({ - container, - pdfViewer: this.pdfViewer, - eventBus - }); - } - if (appConfig.passwordOverlay) { - this.passwordPrompt = new _password_prompt.PasswordPrompt(appConfig.passwordOverlay, this.overlayManager, this.l10n, this.isViewerEmbedded); - } - if (appConfig.sidebar?.outlineView) { - this.pdfOutlineViewer = new _webPdf_outline_viewer.PDFOutlineViewer({ - container: appConfig.sidebar.outlineView, - eventBus, - linkService: pdfLinkService, - downloadManager - }); - } - if (appConfig.sidebar?.attachmentsView) { - this.pdfAttachmentViewer = new _webPdf_attachment_viewer.PDFAttachmentViewer({ - container: appConfig.sidebar.attachmentsView, - eventBus, - downloadManager - }); - } - if (appConfig.sidebar?.layersView) { - this.pdfLayerViewer = new _webPdf_layer_viewer.PDFLayerViewer({ - container: appConfig.sidebar.layersView, - eventBus, - l10n: this.l10n - }); - } - if (appConfig.sidebar) { - this.pdfSidebar = new _webPdf_sidebar.PDFSidebar({ - elements: appConfig.sidebar, - pdfViewer: this.pdfViewer, - pdfThumbnailViewer: this.pdfThumbnailViewer, - eventBus, - l10n: this.l10n - }); - this.pdfSidebar.onToggled = this.forceRendering.bind(this); - this.pdfSidebarResizer = new _webPdf_sidebar_resizer.PDFSidebarResizer(appConfig.sidebarResizer, eventBus, this.l10n); - } - }, - run(config) { - this.initialize(config).then(webViewerInitialized); - }, - get initialized() { - return this._initializedCapability.settled; - }, - get initializedPromise() { - return this._initializedCapability.promise; - }, - zoomIn(steps, scaleFactor) { - if (this.pdfViewer.isInPresentationMode) { - return; - } - this.pdfViewer.increaseScale({ - drawingDelay: _app_options.AppOptions.get("defaultZoomDelay"), - steps, - scaleFactor - }); - }, - zoomOut(steps, scaleFactor) { - if (this.pdfViewer.isInPresentationMode) { - return; - } - this.pdfViewer.decreaseScale({ - drawingDelay: _app_options.AppOptions.get("defaultZoomDelay"), - steps, - scaleFactor - }); - }, - zoomReset() { - if (this.pdfViewer.isInPresentationMode) { - return; - } - this.pdfViewer.currentScaleValue = _ui_utils.DEFAULT_SCALE_VALUE; - }, - get pagesCount() { - return this.pdfDocument ? this.pdfDocument.numPages : 0; - }, - get page() { - return this.pdfViewer.currentPageNumber; - }, - set page(val) { - this.pdfViewer.currentPageNumber = val; - }, - get supportsPrinting() { - return PDFPrintServiceFactory.instance.supportsPrinting; - }, - get supportsFullscreen() { - return (0, _pdfjsLib.shadow)(this, "supportsFullscreen", document.fullscreenEnabled); - }, - get supportsPinchToZoom() { - return this.externalServices.supportsPinchToZoom; - }, - get supportsIntegratedFind() { - return this.externalServices.supportsIntegratedFind; - }, - get supportsDocumentFonts() { - return this.externalServices.supportsDocumentFonts; - }, - get loadingBar() { - const barElement = document.getElementById("loadingBar"); - const bar = barElement ? new _ui_utils.ProgressBar(barElement) : null; - return (0, _pdfjsLib.shadow)(this, "loadingBar", bar); - }, - get supportedMouseWheelZoomModifierKeys() { - return this.externalServices.supportedMouseWheelZoomModifierKeys; - }, - initPassiveLoading() { - throw new Error("Not implemented: initPassiveLoading"); - }, - setTitleUsingUrl(url = "", downloadUrl = null) { - this.url = url; - this.baseUrl = url.split("#")[0]; - if (downloadUrl) { - this._downloadUrl = downloadUrl === url ? this.baseUrl : downloadUrl.split("#")[0]; - } - if ((0, _pdfjsLib.isDataScheme)(url)) { - this._hideViewBookmark(); - } - let title = (0, _pdfjsLib.getPdfFilenameFromUrl)(url, ""); - if (!title) { - try { - title = decodeURIComponent((0, _pdfjsLib.getFilenameFromUrl)(url)) || url; - } catch (ex) { - title = url; - } - } - this.setTitle(title); - }, - setTitle(title = this._title) { - this._title = title; - if (this.isViewerEmbedded) { - return; - } - const editorIndicator = this._hasAnnotationEditors && !this.pdfRenderingQueue.printing; - document.title = `${editorIndicator ? "* " : ""}${title}`; - }, - get _docFilename() { - return this._contentDispositionFilename || (0, _pdfjsLib.getPdfFilenameFromUrl)(this.url); - }, - _hideViewBookmark() { - const { - secondaryToolbar - } = this.appConfig; - secondaryToolbar?.viewBookmarkButton.classList.add("hidden"); - if (secondaryToolbar?.presentationModeButton.classList.contains("hidden")) { - document.getElementById("viewBookmarkSeparator")?.classList.add("hidden"); - } - }, - async close() { - this._unblockDocumentLoadEvent(); - this._hideViewBookmark(); - if (!this.pdfLoadingTask) { - return; - } - if (this.pdfDocument?.annotationStorage.size > 0 && this._annotationStorageModified) { - try { - await this.save(); - } catch (reason) {} - } - const promises = []; - promises.push(this.pdfLoadingTask.destroy()); - this.pdfLoadingTask = null; - if (this.pdfDocument) { - this.pdfDocument = null; - this.pdfThumbnailViewer?.setDocument(null); - this.pdfViewer.setDocument(null); - this.pdfLinkService.setDocument(null); - this.pdfDocumentProperties?.setDocument(null); - } - this.pdfLinkService.externalLinkEnabled = true; - this.store = null; - this.isInitialViewSet = false; - this.downloadComplete = false; - this.url = ""; - this.baseUrl = ""; - this._downloadUrl = ""; - this.documentInfo = null; - this.metadata = null; - this._contentDispositionFilename = null; - this._contentLength = null; - this._saveInProgress = false; - this._hasAnnotationEditors = false; - promises.push(this.pdfScriptingManager.destroyPromise); - this.setTitle(); - this.pdfSidebar?.reset(); - this.pdfOutlineViewer?.reset(); - this.pdfAttachmentViewer?.reset(); - this.pdfLayerViewer?.reset(); - this.pdfHistory?.reset(); - this.findBar?.reset(); - this.toolbar?.reset(); - this.secondaryToolbar?.reset(); - this._PDFBug?.cleanup(); - await Promise.all(promises); - }, - async open(args) { - let deprecatedArgs = false; - if (typeof args === "string") { - args = { - url: args - }; - deprecatedArgs = true; - } else if (args?.byteLength) { - args = { - data: args - }; - deprecatedArgs = true; - } - if (deprecatedArgs) { - console.error("The `PDFViewerApplication.open` signature was updated, please use an object instead."); - } - if (this.pdfLoadingTask) { - await this.close(); - } - const workerParams = _app_options.AppOptions.getAll(_app_options.OptionKind.WORKER); - Object.assign(_pdfjsLib.GlobalWorkerOptions, workerParams); - if (args.url) { - this.setTitleUsingUrl(args.originalUrl || args.url, args.url); - } - const apiParams = _app_options.AppOptions.getAll(_app_options.OptionKind.API); - const params = { - ...apiParams, - ...args - }; - const loadingTask = (0, _pdfjsLib.getDocument)(params); - this.pdfLoadingTask = loadingTask; - loadingTask.onPassword = (updateCallback, reason) => { - if (this.isViewerEmbedded) { - this._unblockDocumentLoadEvent(); - } - this.pdfLinkService.externalLinkEnabled = false; - this.passwordPrompt.setUpdateCallback(updateCallback, reason); - this.passwordPrompt.open(); - }; - loadingTask.onProgress = ({ - loaded, - total - }) => { - this.progress(loaded / total); - }; - return loadingTask.promise.then(pdfDocument => { - this.load(pdfDocument); - }, reason => { - if (loadingTask !== this.pdfLoadingTask) { - return undefined; - } - let key = "loading_error"; - if (reason instanceof _pdfjsLib.InvalidPDFException) { - key = "invalid_file_error"; - } else if (reason instanceof _pdfjsLib.MissingPDFException) { - key = "missing_file_error"; - } else if (reason instanceof _pdfjsLib.UnexpectedResponseException) { - key = "unexpected_response_error"; - } - return this.l10n.get(key).then(msg => { - this._documentError(msg, { - message: reason?.message - }); - throw reason; - }); - }); - }, - _ensureDownloadComplete() { - if (this.pdfDocument && this.downloadComplete) { - return; - } - throw new Error("PDF document not downloaded."); - }, - async download() { - const url = this._downloadUrl, - filename = this._docFilename; - try { - this._ensureDownloadComplete(); - const data = await this.pdfDocument.getData(); - const blob = new Blob([data], { - type: "application/pdf" - }); - await this.downloadManager.download(blob, url, filename); - } catch (reason) { - await this.downloadManager.downloadUrl(url, filename); - } - }, - async save() { - if (this._saveInProgress) { - return; - } - this._saveInProgress = true; - await this.pdfScriptingManager.dispatchWillSave(); - const url = this._downloadUrl, - filename = this._docFilename; - try { - this._ensureDownloadComplete(); - const data = await this.pdfDocument.saveDocument(); - const blob = new Blob([data], { - type: "application/pdf" - }); - await this.downloadManager.download(blob, url, filename); - } catch (reason) { - console.error(`Error when saving the document: ${reason.message}`); - await this.download(); - } finally { - await this.pdfScriptingManager.dispatchDidSave(); - this._saveInProgress = false; - } - if (this._hasAnnotationEditors) { - this.externalServices.reportTelemetry({ - type: "editing", - data: { - type: "save" - } - }); - } - }, - downloadOrSave() { - if (this.pdfDocument?.annotationStorage.size > 0) { - this.save(); - } else { - this.download(); - } - }, - _documentError(message, moreInfo = null) { - this._unblockDocumentLoadEvent(); - this._otherError(message, moreInfo); - this.eventBus.dispatch("documenterror", { - source: this, - message, - reason: moreInfo?.message ?? null - }); - }, - _otherError(message, moreInfo = null) { - const moreInfoText = [`PDF.js v${_pdfjsLib.version || "?"} (build: ${_pdfjsLib.build || "?"})`]; - if (moreInfo) { - moreInfoText.push(`Message: ${moreInfo.message}`); - if (moreInfo.stack) { - moreInfoText.push(`Stack: ${moreInfo.stack}`); - } else { - if (moreInfo.filename) { - moreInfoText.push(`File: ${moreInfo.filename}`); - } - if (moreInfo.lineNumber) { - moreInfoText.push(`Line: ${moreInfo.lineNumber}`); - } - } - } - console.error(`${message}\n\n${moreInfoText.join("\n")}`); - }, - progress(level) { - if (!this.loadingBar || this.downloadComplete) { - return; - } - const percent = Math.round(level * 100); - if (percent <= this.loadingBar.percent) { - return; - } - this.loadingBar.percent = percent; - if (this.pdfDocument?.loadingParams.disableAutoFetch ?? _app_options.AppOptions.get("disableAutoFetch")) { - this.loadingBar.setDisableAutoFetch(); - } - }, - load(pdfDocument) { - this.pdfDocument = pdfDocument; - pdfDocument.getDownloadInfo().then(({ - length - }) => { - this._contentLength = length; - this.downloadComplete = true; - this.loadingBar?.hide(); - firstPagePromise.then(() => { - this.eventBus.dispatch("documentloaded", { - source: this - }); - }); - }); - const pageLayoutPromise = pdfDocument.getPageLayout().catch(function () {}); - const pageModePromise = pdfDocument.getPageMode().catch(function () {}); - const openActionPromise = pdfDocument.getOpenAction().catch(function () {}); - this.toolbar?.setPagesCount(pdfDocument.numPages, false); - this.secondaryToolbar?.setPagesCount(pdfDocument.numPages); - let baseDocumentUrl; - baseDocumentUrl = null; - if (baseDocumentUrl && (0, _pdfjsLib.isDataScheme)(baseDocumentUrl)) { - baseDocumentUrl = null; - } - this.pdfLinkService.setDocument(pdfDocument, baseDocumentUrl); - this.pdfDocumentProperties?.setDocument(pdfDocument); - const pdfViewer = this.pdfViewer; - pdfViewer.setDocument(pdfDocument); - const { - firstPagePromise, - onePageRendered, - pagesPromise - } = pdfViewer; - this.pdfThumbnailViewer?.setDocument(pdfDocument); - const storedPromise = (this.store = new _view_history.ViewHistory(pdfDocument.fingerprints[0])).getMultiple({ - page: null, - zoom: _ui_utils.DEFAULT_SCALE_VALUE, - scrollLeft: "0", - scrollTop: "0", - rotation: null, - sidebarView: _ui_utils.SidebarView.UNKNOWN, - scrollMode: _ui_utils.ScrollMode.UNKNOWN, - spreadMode: _ui_utils.SpreadMode.UNKNOWN - }).catch(() => { - return Object.create(null); - }); - firstPagePromise.then(pdfPage => { - this.loadingBar?.setWidth(this.appConfig.viewerContainer); - this._initializeAnnotationStorageCallbacks(pdfDocument); - Promise.all([_ui_utils.animationStarted, storedPromise, pageLayoutPromise, pageModePromise, openActionPromise]).then(async ([timeStamp, stored, pageLayout, pageMode, openAction]) => { - const viewOnLoad = _app_options.AppOptions.get("viewOnLoad"); - this._initializePdfHistory({ - fingerprint: pdfDocument.fingerprints[0], - viewOnLoad, - initialDest: openAction?.dest - }); - const initialBookmark = this.initialBookmark; - const zoom = _app_options.AppOptions.get("defaultZoomValue"); - let hash = zoom ? `zoom=${zoom}` : null; - let rotation = null; - let sidebarView = _app_options.AppOptions.get("sidebarViewOnLoad"); - let scrollMode = _app_options.AppOptions.get("scrollModeOnLoad"); - let spreadMode = _app_options.AppOptions.get("spreadModeOnLoad"); - if (stored.page && viewOnLoad !== ViewOnLoad.INITIAL) { - hash = `page=${stored.page}&zoom=${zoom || stored.zoom},` + `${stored.scrollLeft},${stored.scrollTop}`; - rotation = parseInt(stored.rotation, 10); - if (sidebarView === _ui_utils.SidebarView.UNKNOWN) { - sidebarView = stored.sidebarView | 0; - } - if (scrollMode === _ui_utils.ScrollMode.UNKNOWN) { - scrollMode = stored.scrollMode | 0; - } - if (spreadMode === _ui_utils.SpreadMode.UNKNOWN) { - spreadMode = stored.spreadMode | 0; - } - } - if (pageMode && sidebarView === _ui_utils.SidebarView.UNKNOWN) { - sidebarView = (0, _ui_utils.apiPageModeToSidebarView)(pageMode); - } - if (pageLayout && scrollMode === _ui_utils.ScrollMode.UNKNOWN && spreadMode === _ui_utils.SpreadMode.UNKNOWN) { - const modes = (0, _ui_utils.apiPageLayoutToViewerModes)(pageLayout); - spreadMode = modes.spreadMode; - } - this.setInitialView(hash, { - rotation, - sidebarView, - scrollMode, - spreadMode - }); - this.eventBus.dispatch("documentinit", { - source: this - }); - if (!this.isViewerEmbedded) { - pdfViewer.focus(); - } - await Promise.race([pagesPromise, new Promise(resolve => { - setTimeout(resolve, FORCE_PAGES_LOADED_TIMEOUT); - })]); - if (!initialBookmark && !hash) { - return; - } - if (pdfViewer.hasEqualPageSizes) { - return; - } - this.initialBookmark = initialBookmark; - pdfViewer.currentScaleValue = pdfViewer.currentScaleValue; - this.setInitialView(hash); - }).catch(() => { - this.setInitialView(); - }).then(function () { - pdfViewer.update(); - }); - }); - pagesPromise.then(() => { - this._unblockDocumentLoadEvent(); - this._initializeAutoPrint(pdfDocument, openActionPromise); - }, reason => { - this.l10n.get("loading_error").then(msg => { - this._documentError(msg, { - message: reason?.message - }); - }); - }); - onePageRendered.then(data => { - this.externalServices.reportTelemetry({ - type: "pageInfo", - timestamp: data.timestamp - }); - if (this.pdfOutlineViewer) { - pdfDocument.getOutline().then(outline => { - if (pdfDocument !== this.pdfDocument) { - return; - } - this.pdfOutlineViewer.render({ - outline, - pdfDocument - }); - }); - } - if (this.pdfAttachmentViewer) { - pdfDocument.getAttachments().then(attachments => { - if (pdfDocument !== this.pdfDocument) { - return; - } - this.pdfAttachmentViewer.render({ - attachments - }); - }); - } - if (this.pdfLayerViewer) { - pdfViewer.optionalContentConfigPromise.then(optionalContentConfig => { - if (pdfDocument !== this.pdfDocument) { - return; - } - this.pdfLayerViewer.render({ - optionalContentConfig, - pdfDocument - }); - }); - } - }); - this._initializePageLabels(pdfDocument); - this._initializeMetadata(pdfDocument); - }, - async _scriptingDocProperties(pdfDocument) { - if (!this.documentInfo) { - await new Promise(resolve => { - this.eventBus._on("metadataloaded", resolve, { - once: true - }); - }); - if (pdfDocument !== this.pdfDocument) { - return null; - } - } - if (!this._contentLength) { - await new Promise(resolve => { - this.eventBus._on("documentloaded", resolve, { - once: true - }); - }); - if (pdfDocument !== this.pdfDocument) { - return null; - } - } - return { - ...this.documentInfo, - baseURL: this.baseUrl, - filesize: this._contentLength, - filename: this._docFilename, - metadata: this.metadata?.getRaw(), - authors: this.metadata?.get("dc:creator"), - numPages: this.pagesCount, - URL: this.url - }; - }, - async _initializeAutoPrint(pdfDocument, openActionPromise) { - const [openAction, javaScript] = await Promise.all([openActionPromise, !this.pdfViewer.enableScripting ? pdfDocument.getJavaScript() : null]); - if (pdfDocument !== this.pdfDocument) { - return; - } - let triggerAutoPrint = false; - if (openAction?.action === "Print") { - triggerAutoPrint = true; - } - if (javaScript) { - javaScript.some(js => { - if (!js) { - return false; - } - console.warn("Warning: JavaScript support is not enabled"); - return true; - }); - if (!triggerAutoPrint) { - for (const js of javaScript) { - if (js && _ui_utils.AutoPrintRegExp.test(js)) { - triggerAutoPrint = true; - break; - } - } - } - } - if (triggerAutoPrint) { - this.triggerPrinting(); - } - }, - async _initializeMetadata(pdfDocument) { - const { - info, - metadata, - contentDispositionFilename, - contentLength - } = await pdfDocument.getMetadata(); - if (pdfDocument !== this.pdfDocument) { - return; - } - this.documentInfo = info; - this.metadata = metadata; - this._contentDispositionFilename ??= contentDispositionFilename; - this._contentLength ??= contentLength; - console.log(`PDF ${pdfDocument.fingerprints[0]} [${info.PDFFormatVersion} ` + `${(info.Producer || "-").trim()} / ${(info.Creator || "-").trim()}] ` + `(PDF.js: ${_pdfjsLib.version || "?"} [${_pdfjsLib.build || "?"}])`); - let pdfTitle = info.Title; - const metadataTitle = metadata?.get("dc:title"); - if (metadataTitle) { - if (metadataTitle !== "Untitled" && !/[\uFFF0-\uFFFF]/g.test(metadataTitle)) { - pdfTitle = metadataTitle; - } - } - if (pdfTitle) { - this.setTitle(`${pdfTitle} - ${this._contentDispositionFilename || this._title}`); - } else if (this._contentDispositionFilename) { - this.setTitle(this._contentDispositionFilename); - } - if (info.IsXFAPresent && !info.IsAcroFormPresent && !pdfDocument.isPureXfa) { - if (pdfDocument.loadingParams.enableXfa) { - console.warn("Warning: XFA Foreground documents are not supported"); - } else { - console.warn("Warning: XFA support is not enabled"); - } - } else if ((info.IsAcroFormPresent || info.IsXFAPresent) && !this.pdfViewer.renderForms) { - console.warn("Warning: Interactive form support is not enabled"); - } - if (info.IsSignaturesPresent) { - console.warn("Warning: Digital signatures validation is not supported"); - } - this.eventBus.dispatch("metadataloaded", { - source: this - }); - }, - async _initializePageLabels(pdfDocument) { - const labels = await pdfDocument.getPageLabels(); - if (pdfDocument !== this.pdfDocument) { - return; - } - if (!labels || _app_options.AppOptions.get("disablePageLabels")) { - return; - } - const numLabels = labels.length; - let standardLabels = 0, - emptyLabels = 0; - for (let i = 0; i < numLabels; i++) { - const label = labels[i]; - if (label === (i + 1).toString()) { - standardLabels++; - } else if (label === "") { - emptyLabels++; - } else { - break; - } - } - if (standardLabels >= numLabels || emptyLabels >= numLabels) { - return; - } - const { - pdfViewer, - pdfThumbnailViewer, - toolbar - } = this; - pdfViewer.setPageLabels(labels); - pdfThumbnailViewer?.setPageLabels(labels); - toolbar?.setPagesCount(numLabels, true); - toolbar?.setPageNumber(pdfViewer.currentPageNumber, pdfViewer.currentPageLabel); - }, - _initializePdfHistory({ - fingerprint, - viewOnLoad, - initialDest = null - }) { - if (!this.pdfHistory) { - return; - } - this.pdfHistory.initialize({ - fingerprint, - resetHistory: viewOnLoad === ViewOnLoad.INITIAL, - updateUrl: _app_options.AppOptions.get("historyUpdateUrl") - }); - if (this.pdfHistory.initialBookmark) { - this.initialBookmark = this.pdfHistory.initialBookmark; - this.initialRotation = this.pdfHistory.initialRotation; - } - if (initialDest && !this.initialBookmark && viewOnLoad === ViewOnLoad.UNKNOWN) { - this.initialBookmark = JSON.stringify(initialDest); - this.pdfHistory.push({ - explicitDest: initialDest, - pageNumber: null - }); - } - }, - _initializeAnnotationStorageCallbacks(pdfDocument) { - if (pdfDocument !== this.pdfDocument) { - return; - } - const { - annotationStorage - } = pdfDocument; - annotationStorage.onSetModified = () => { - window.addEventListener("beforeunload", beforeUnload); - this._annotationStorageModified = true; - }; - annotationStorage.onResetModified = () => { - window.removeEventListener("beforeunload", beforeUnload); - delete this._annotationStorageModified; - }; - annotationStorage.onAnnotationEditor = typeStr => { - this._hasAnnotationEditors = !!typeStr; - this.setTitle(); - if (typeStr) { - this.externalServices.reportTelemetry({ - type: "editing", - data: { - type: typeStr - } - }); - } - }; - }, - setInitialView(storedHash, { - rotation, - sidebarView, - scrollMode, - spreadMode - } = {}) { - const setRotation = angle => { - if ((0, _ui_utils.isValidRotation)(angle)) { - this.pdfViewer.pagesRotation = angle; - } - }; - const setViewerModes = (scroll, spread) => { - if ((0, _ui_utils.isValidScrollMode)(scroll)) { - this.pdfViewer.scrollMode = scroll; - } - if ((0, _ui_utils.isValidSpreadMode)(spread)) { - this.pdfViewer.spreadMode = spread; - } - }; - this.isInitialViewSet = true; - this.pdfSidebar?.setInitialView(sidebarView); - setViewerModes(scrollMode, spreadMode); - if (this.initialBookmark) { - setRotation(this.initialRotation); - delete this.initialRotation; - this.pdfLinkService.setHash(this.initialBookmark); - this.initialBookmark = null; - } else if (storedHash) { - setRotation(rotation); - this.pdfLinkService.setHash(storedHash); - } - this.toolbar?.setPageNumber(this.pdfViewer.currentPageNumber, this.pdfViewer.currentPageLabel); - this.secondaryToolbar?.setPageNumber(this.pdfViewer.currentPageNumber); - if (!this.pdfViewer.currentScaleValue) { - this.pdfViewer.currentScaleValue = _ui_utils.DEFAULT_SCALE_VALUE; - } - }, - _cleanup() { - if (!this.pdfDocument) { - return; - } - this.pdfViewer.cleanup(); - this.pdfThumbnailViewer?.cleanup(); - this.pdfDocument.cleanup(this.pdfViewer.renderer === _ui_utils.RendererType.SVG); - }, - forceRendering() { - this.pdfRenderingQueue.printing = !!this.printService; - this.pdfRenderingQueue.isThumbnailViewEnabled = this.pdfSidebar?.visibleView === _ui_utils.SidebarView.THUMBS; - this.pdfRenderingQueue.renderHighestPriority(); - }, - beforePrint() { - this._printAnnotationStoragePromise = this.pdfScriptingManager.dispatchWillPrint().catch(() => {}).then(() => { - return this.pdfDocument?.annotationStorage.print; - }); - if (this.printService) { - return; - } - if (!this.supportsPrinting) { - this.l10n.get("printing_not_supported").then(msg => { - this._otherError(msg); - }); - return; - } - if (!this.pdfViewer.pageViewsReady) { - this.l10n.get("printing_not_ready").then(msg => { - window.alert(msg); - }); - return; - } - const pagesOverview = this.pdfViewer.getPagesOverview(); - const printContainer = this.appConfig.printContainer; - const printResolution = _app_options.AppOptions.get("printResolution"); - const optionalContentConfigPromise = this.pdfViewer.optionalContentConfigPromise; - const printService = PDFPrintServiceFactory.instance.createPrintService(this.pdfDocument, pagesOverview, printContainer, printResolution, optionalContentConfigPromise, this._printAnnotationStoragePromise, this.l10n); - this.printService = printService; - this.forceRendering(); - this.setTitle(); - printService.layout(); - if (this._hasAnnotationEditors) { - this.externalServices.reportTelemetry({ - type: "editing", - data: { - type: "print" - } - }); - } - }, - afterPrint() { - if (this._printAnnotationStoragePromise) { - this._printAnnotationStoragePromise.then(() => { - this.pdfScriptingManager.dispatchDidPrint(); - }); - this._printAnnotationStoragePromise = null; - } - if (this.printService) { - this.printService.destroy(); - this.printService = null; - this.pdfDocument?.annotationStorage.resetModified(); - } - this.forceRendering(); - this.setTitle(); - }, - rotatePages(delta) { - this.pdfViewer.pagesRotation += delta; - }, - requestPresentationMode() { - this.pdfPresentationMode?.request(); - }, - triggerPrinting() { - if (!this.supportsPrinting) { - return; - } - window.print(); - }, - bindEvents() { - const { - eventBus, - _boundEvents - } = this; - _boundEvents.beforePrint = this.beforePrint.bind(this); - _boundEvents.afterPrint = this.afterPrint.bind(this); - eventBus._on("resize", webViewerResize); - eventBus._on("hashchange", webViewerHashchange); - eventBus._on("beforeprint", _boundEvents.beforePrint); - eventBus._on("afterprint", _boundEvents.afterPrint); - eventBus._on("pagerender", webViewerPageRender); - eventBus._on("pagerendered", webViewerPageRendered); - eventBus._on("updateviewarea", webViewerUpdateViewarea); - eventBus._on("pagechanging", webViewerPageChanging); - eventBus._on("scalechanging", webViewerScaleChanging); - eventBus._on("rotationchanging", webViewerRotationChanging); - eventBus._on("sidebarviewchanged", webViewerSidebarViewChanged); - eventBus._on("pagemode", webViewerPageMode); - eventBus._on("namedaction", webViewerNamedAction); - eventBus._on("presentationmodechanged", webViewerPresentationModeChanged); - eventBus._on("presentationmode", webViewerPresentationMode); - eventBus._on("switchannotationeditormode", webViewerSwitchAnnotationEditorMode); - eventBus._on("switchannotationeditorparams", webViewerSwitchAnnotationEditorParams); - eventBus._on("print", webViewerPrint); - eventBus._on("download", webViewerDownload); - eventBus._on("firstpage", webViewerFirstPage); - eventBus._on("lastpage", webViewerLastPage); - eventBus._on("nextpage", webViewerNextPage); - eventBus._on("previouspage", webViewerPreviousPage); - eventBus._on("zoomin", webViewerZoomIn); - eventBus._on("zoomout", webViewerZoomOut); - eventBus._on("zoomreset", webViewerZoomReset); - eventBus._on("pagenumberchanged", webViewerPageNumberChanged); - eventBus._on("scalechanged", webViewerScaleChanged); - eventBus._on("rotatecw", webViewerRotateCw); - eventBus._on("rotateccw", webViewerRotateCcw); - eventBus._on("optionalcontentconfig", webViewerOptionalContentConfig); - eventBus._on("switchscrollmode", webViewerSwitchScrollMode); - eventBus._on("scrollmodechanged", webViewerScrollModeChanged); - eventBus._on("switchspreadmode", webViewerSwitchSpreadMode); - eventBus._on("spreadmodechanged", webViewerSpreadModeChanged); - eventBus._on("documentproperties", webViewerDocumentProperties); - eventBus._on("findfromurlhash", webViewerFindFromUrlHash); - eventBus._on("updatefindmatchescount", webViewerUpdateFindMatchesCount); - eventBus._on("updatefindcontrolstate", webViewerUpdateFindControlState); - if (_app_options.AppOptions.get("pdfBug")) { - _boundEvents.reportPageStatsPDFBug = reportPageStatsPDFBug; - eventBus._on("pagerendered", _boundEvents.reportPageStatsPDFBug); - eventBus._on("pagechanging", _boundEvents.reportPageStatsPDFBug); - } - eventBus._on("fileinputchange", webViewerFileInputChange); - eventBus._on("openfile", webViewerOpenFile); - }, - bindWindowEvents() { - const { - eventBus, - _boundEvents - } = this; - function addWindowResolutionChange(evt = null) { - if (evt) { - webViewerResolutionChange(evt); - } - const mediaQueryList = window.matchMedia(`(resolution: ${window.devicePixelRatio || 1}dppx)`); - mediaQueryList.addEventListener("change", addWindowResolutionChange, { - once: true - }); - _boundEvents.removeWindowResolutionChange ||= function () { - mediaQueryList.removeEventListener("change", addWindowResolutionChange); - _boundEvents.removeWindowResolutionChange = null; - }; - } - addWindowResolutionChange(); - _boundEvents.windowResize = () => { - eventBus.dispatch("resize", { - source: window - }); - }; - _boundEvents.windowHashChange = () => { - eventBus.dispatch("hashchange", { - source: window, - hash: document.location.hash.substring(1) - }); - }; - _boundEvents.windowBeforePrint = () => { - eventBus.dispatch("beforeprint", { - source: window - }); - }; - _boundEvents.windowAfterPrint = () => { - eventBus.dispatch("afterprint", { - source: window - }); - }; - _boundEvents.windowUpdateFromSandbox = event => { - eventBus.dispatch("updatefromsandbox", { - source: window, - detail: event.detail - }); - }; - window.addEventListener("visibilitychange", webViewerVisibilityChange); - window.addEventListener("wheel", webViewerWheel, { - passive: false - }); - window.addEventListener("touchstart", webViewerTouchStart, { - passive: false - }); - window.addEventListener("touchmove", webViewerTouchMove, { - passive: false - }); - window.addEventListener("touchend", webViewerTouchEnd, { - passive: false - }); - window.addEventListener("click", webViewerClick); - window.addEventListener("keydown", webViewerKeyDown); - window.addEventListener("keyup", webViewerKeyUp); - window.addEventListener("resize", _boundEvents.windowResize); - window.addEventListener("hashchange", _boundEvents.windowHashChange); - window.addEventListener("beforeprint", _boundEvents.windowBeforePrint); - window.addEventListener("afterprint", _boundEvents.windowAfterPrint); - window.addEventListener("updatefromsandbox", _boundEvents.windowUpdateFromSandbox); - }, - unbindEvents() { - const { - eventBus, - _boundEvents - } = this; - eventBus._off("resize", webViewerResize); - eventBus._off("hashchange", webViewerHashchange); - eventBus._off("beforeprint", _boundEvents.beforePrint); - eventBus._off("afterprint", _boundEvents.afterPrint); - eventBus._off("pagerender", webViewerPageRender); - eventBus._off("pagerendered", webViewerPageRendered); - eventBus._off("updateviewarea", webViewerUpdateViewarea); - eventBus._off("pagechanging", webViewerPageChanging); - eventBus._off("scalechanging", webViewerScaleChanging); - eventBus._off("rotationchanging", webViewerRotationChanging); - eventBus._off("sidebarviewchanged", webViewerSidebarViewChanged); - eventBus._off("pagemode", webViewerPageMode); - eventBus._off("namedaction", webViewerNamedAction); - eventBus._off("presentationmodechanged", webViewerPresentationModeChanged); - eventBus._off("presentationmode", webViewerPresentationMode); - eventBus._off("print", webViewerPrint); - eventBus._off("download", webViewerDownload); - eventBus._off("firstpage", webViewerFirstPage); - eventBus._off("lastpage", webViewerLastPage); - eventBus._off("nextpage", webViewerNextPage); - eventBus._off("previouspage", webViewerPreviousPage); - eventBus._off("zoomin", webViewerZoomIn); - eventBus._off("zoomout", webViewerZoomOut); - eventBus._off("zoomreset", webViewerZoomReset); - eventBus._off("pagenumberchanged", webViewerPageNumberChanged); - eventBus._off("scalechanged", webViewerScaleChanged); - eventBus._off("rotatecw", webViewerRotateCw); - eventBus._off("rotateccw", webViewerRotateCcw); - eventBus._off("optionalcontentconfig", webViewerOptionalContentConfig); - eventBus._off("switchscrollmode", webViewerSwitchScrollMode); - eventBus._off("scrollmodechanged", webViewerScrollModeChanged); - eventBus._off("switchspreadmode", webViewerSwitchSpreadMode); - eventBus._off("spreadmodechanged", webViewerSpreadModeChanged); - eventBus._off("documentproperties", webViewerDocumentProperties); - eventBus._off("findfromurlhash", webViewerFindFromUrlHash); - eventBus._off("updatefindmatchescount", webViewerUpdateFindMatchesCount); - eventBus._off("updatefindcontrolstate", webViewerUpdateFindControlState); - if (_boundEvents.reportPageStatsPDFBug) { - eventBus._off("pagerendered", _boundEvents.reportPageStatsPDFBug); - eventBus._off("pagechanging", _boundEvents.reportPageStatsPDFBug); - _boundEvents.reportPageStatsPDFBug = null; - } - eventBus._off("fileinputchange", webViewerFileInputChange); - eventBus._off("openfile", webViewerOpenFile); - _boundEvents.beforePrint = null; - _boundEvents.afterPrint = null; - }, - unbindWindowEvents() { - const { - _boundEvents - } = this; - window.removeEventListener("visibilitychange", webViewerVisibilityChange); - window.removeEventListener("wheel", webViewerWheel, { - passive: false - }); - window.removeEventListener("touchstart", webViewerTouchStart, { - passive: false - }); - window.removeEventListener("touchmove", webViewerTouchMove, { - passive: false - }); - window.removeEventListener("touchend", webViewerTouchEnd, { - passive: false - }); - window.removeEventListener("click", webViewerClick); - window.removeEventListener("keydown", webViewerKeyDown); - window.removeEventListener("keyup", webViewerKeyUp); - window.removeEventListener("resize", _boundEvents.windowResize); - window.removeEventListener("hashchange", _boundEvents.windowHashChange); - window.removeEventListener("beforeprint", _boundEvents.windowBeforePrint); - window.removeEventListener("afterprint", _boundEvents.windowAfterPrint); - window.removeEventListener("updatefromsandbox", _boundEvents.windowUpdateFromSandbox); - _boundEvents.removeWindowResolutionChange?.(); - _boundEvents.windowResize = null; - _boundEvents.windowHashChange = null; - _boundEvents.windowBeforePrint = null; - _boundEvents.windowAfterPrint = null; - _boundEvents.windowUpdateFromSandbox = null; - }, - _accumulateTicks(ticks, prop) { - if (this[prop] > 0 && ticks < 0 || this[prop] < 0 && ticks > 0) { - this[prop] = 0; - } - this[prop] += ticks; - const wholeTicks = Math.trunc(this[prop]); - this[prop] -= wholeTicks; - return wholeTicks; - }, - _accumulateFactor(previousScale, factor, prop) { - if (factor === 1) { - return 1; - } - if (this[prop] > 1 && factor < 1 || this[prop] < 1 && factor > 1) { - this[prop] = 1; - } - const newFactor = Math.floor(previousScale * factor * this[prop] * 100) / (100 * previousScale); - this[prop] = factor / newFactor; - return newFactor; - }, - _centerAtPos(previousScale, x, y) { - const { - pdfViewer - } = this; - const scaleDiff = pdfViewer.currentScale / previousScale - 1; - if (scaleDiff !== 0) { - const [top, left] = pdfViewer.containerTopLeft; - pdfViewer.container.scrollLeft += (x - left) * scaleDiff; - pdfViewer.container.scrollTop += (y - top) * scaleDiff; - } - }, - _unblockDocumentLoadEvent() { - document.blockUnblockOnload?.(false); - this._unblockDocumentLoadEvent = () => {}; - }, - get scriptingReady() { - return this.pdfScriptingManager.ready; - } -}; -exports.PDFViewerApplication = PDFViewerApplication; -{ - const HOSTED_VIEWER_ORIGINS = ["null", "http://mozilla.github.io", "https://mozilla.github.io"]; - var validateFileURL = function (file) { - if (!file) { - return; - } - try { - const viewerOrigin = new URL(window.location.href).origin || "null"; - if (HOSTED_VIEWER_ORIGINS.includes(viewerOrigin)) { - return; - } - const fileOrigin = new URL(file, window.location.href).origin; - if (fileOrigin !== viewerOrigin) { - throw new Error("file origin does not match viewer's"); - } - } catch (ex) { - PDFViewerApplication.l10n.get("loading_error").then(msg => { - PDFViewerApplication._documentError(msg, { - message: ex?.message - }); - }); - throw ex; - } - }; -} -async function loadFakeWorker() { - _pdfjsLib.GlobalWorkerOptions.workerSrc ||= _app_options.AppOptions.get("workerSrc"); - await (0, _pdfjsLib.loadScript)(_pdfjsLib.PDFWorker.workerSrc); -} -async function loadPDFBug(self) { - const { - debuggerScriptPath - } = self.appConfig; - const { - PDFBug - } = await import(debuggerScriptPath); - self._PDFBug = PDFBug; -} -function reportPageStatsPDFBug({ - pageNumber -}) { - if (!globalThis.Stats?.enabled) { - return; - } - const pageView = PDFViewerApplication.pdfViewer.getPageView(pageNumber - 1); - globalThis.Stats.add(pageNumber, pageView?.pdfPage?.stats); -} -function webViewerInitialized() { - const { - appConfig, - eventBus, - l10n - } = PDFViewerApplication; - let file; - const queryString = document.location.search.substring(1); - const params = (0, _ui_utils.parseQueryString)(queryString); - file = params.get("file") ?? _app_options.AppOptions.get("defaultUrl"); - validateFileURL(file); - const fileInput = appConfig.openFileInput; - fileInput.value = null; - fileInput.addEventListener("change", function (evt) { - const { - files - } = evt.target; - if (!files || files.length === 0) { - return; - } - eventBus.dispatch("fileinputchange", { - source: this, - fileInput: evt.target - }); - }); - appConfig.mainContainer.addEventListener("dragover", function (evt) { - evt.preventDefault(); - evt.dataTransfer.dropEffect = evt.dataTransfer.effectAllowed === "copy" ? "copy" : "move"; - }); - appConfig.mainContainer.addEventListener("drop", function (evt) { - evt.preventDefault(); - const { - files - } = evt.dataTransfer; - if (!files || files.length === 0) { - return; - } - eventBus.dispatch("fileinputchange", { - source: this, - fileInput: evt.dataTransfer - }); - }); - if (!PDFViewerApplication.supportsDocumentFonts) { - _app_options.AppOptions.set("disableFontFace", true); - l10n.get("web_fonts_disabled").then(msg => { - console.warn(msg); - }); - } - if (!PDFViewerApplication.supportsPrinting) { - appConfig.toolbar?.print.classList.add("hidden"); - appConfig.secondaryToolbar?.printButton.classList.add("hidden"); - } - if (!PDFViewerApplication.supportsFullscreen) { - appConfig.secondaryToolbar?.presentationModeButton.classList.add("hidden"); - } - if (PDFViewerApplication.supportsIntegratedFind) { - appConfig.toolbar?.viewFind.classList.add("hidden"); - } - appConfig.mainContainer.addEventListener("transitionend", function (evt) { - if (evt.target === this) { - eventBus.dispatch("resize", { - source: this - }); - } - }, true); - try { - if (file) { - PDFViewerApplication.open({ - url: file - }); - } else { - PDFViewerApplication._hideViewBookmark(); - } - } catch (reason) { - l10n.get("loading_error").then(msg => { - PDFViewerApplication._documentError(msg, reason); - }); - } -} -function webViewerPageRender({ - pageNumber -}) { - if (pageNumber === PDFViewerApplication.page) { - PDFViewerApplication.toolbar?.updateLoadingIndicatorState(true); - } -} -function webViewerPageRendered({ - pageNumber, - error -}) { - if (pageNumber === PDFViewerApplication.page) { - PDFViewerApplication.toolbar?.updateLoadingIndicatorState(false); - } - if (PDFViewerApplication.pdfSidebar?.visibleView === _ui_utils.SidebarView.THUMBS) { - const pageView = PDFViewerApplication.pdfViewer.getPageView(pageNumber - 1); - const thumbnailView = PDFViewerApplication.pdfThumbnailViewer?.getThumbnail(pageNumber - 1); - if (pageView && thumbnailView) { - thumbnailView.setImage(pageView); - } - } - if (error) { - PDFViewerApplication.l10n.get("rendering_error").then(msg => { - PDFViewerApplication._otherError(msg, error); - }); - } -} -function webViewerPageMode({ - mode -}) { - let view; - switch (mode) { - case "thumbs": - view = _ui_utils.SidebarView.THUMBS; - break; - case "bookmarks": - case "outline": - view = _ui_utils.SidebarView.OUTLINE; - break; - case "attachments": - view = _ui_utils.SidebarView.ATTACHMENTS; - break; - case "layers": - view = _ui_utils.SidebarView.LAYERS; - break; - case "none": - view = _ui_utils.SidebarView.NONE; - break; - default: - console.error('Invalid "pagemode" hash parameter: ' + mode); - return; - } - PDFViewerApplication.pdfSidebar?.switchView(view, true); -} -function webViewerNamedAction(evt) { - switch (evt.action) { - case "GoToPage": - PDFViewerApplication.appConfig.toolbar?.pageNumber.select(); - break; - case "Find": - if (!PDFViewerApplication.supportsIntegratedFind) { - PDFViewerApplication?.findBar.toggle(); - } - break; - case "Print": - PDFViewerApplication.triggerPrinting(); - break; - case "SaveAs": - PDFViewerApplication.downloadOrSave(); - break; - } -} -function webViewerPresentationModeChanged(evt) { - PDFViewerApplication.pdfViewer.presentationModeState = evt.state; -} -function webViewerSidebarViewChanged({ - view -}) { - PDFViewerApplication.pdfRenderingQueue.isThumbnailViewEnabled = view === _ui_utils.SidebarView.THUMBS; - if (PDFViewerApplication.isInitialViewSet) { - PDFViewerApplication.store?.set("sidebarView", view).catch(() => {}); - } -} -function webViewerUpdateViewarea({ - location -}) { - if (PDFViewerApplication.isInitialViewSet) { - PDFViewerApplication.store?.setMultiple({ - page: location.pageNumber, - zoom: location.scale, - scrollLeft: location.left, - scrollTop: location.top, - rotation: location.rotation - }).catch(() => {}); - } - if (PDFViewerApplication.appConfig.secondaryToolbar) { - const href = PDFViewerApplication.pdfLinkService.getAnchorUrl(location.pdfOpenParams); - PDFViewerApplication.appConfig.secondaryToolbar.viewBookmarkButton.href = href; - } -} -function webViewerScrollModeChanged(evt) { - if (PDFViewerApplication.isInitialViewSet && !PDFViewerApplication.pdfViewer.isInPresentationMode) { - PDFViewerApplication.store?.set("scrollMode", evt.mode).catch(() => {}); - } -} -function webViewerSpreadModeChanged(evt) { - if (PDFViewerApplication.isInitialViewSet && !PDFViewerApplication.pdfViewer.isInPresentationMode) { - PDFViewerApplication.store?.set("spreadMode", evt.mode).catch(() => {}); - } -} -function webViewerResize() { - const { - pdfDocument, - pdfViewer, - pdfRenderingQueue - } = PDFViewerApplication; - if (pdfRenderingQueue.printing && window.matchMedia("print").matches) { - return; - } - if (!pdfDocument) { - return; - } - const currentScaleValue = pdfViewer.currentScaleValue; - if (currentScaleValue === "auto" || currentScaleValue === "page-fit" || currentScaleValue === "page-width") { - pdfViewer.currentScaleValue = currentScaleValue; - } - pdfViewer.update(); -} -function webViewerHashchange(evt) { - const hash = evt.hash; - if (!hash) { - return; - } - if (!PDFViewerApplication.isInitialViewSet) { - PDFViewerApplication.initialBookmark = hash; - } else if (!PDFViewerApplication.pdfHistory?.popStateInProgress) { - PDFViewerApplication.pdfLinkService.setHash(hash); - } -} -{ - var webViewerFileInputChange = function (evt) { - if (PDFViewerApplication.pdfViewer?.isInPresentationMode) { - return; - } - const file = evt.fileInput.files[0]; - PDFViewerApplication.open({ - url: URL.createObjectURL(file), - originalUrl: file.name - }); - }; - var webViewerOpenFile = function (evt) { - const fileInput = PDFViewerApplication.appConfig.openFileInput; - fileInput.click(); - }; -} -function webViewerPresentationMode() { - PDFViewerApplication.requestPresentationMode(); -} -function webViewerSwitchAnnotationEditorMode(evt) { - PDFViewerApplication.pdfViewer.annotationEditorMode = evt.mode; -} -function webViewerSwitchAnnotationEditorParams(evt) { - PDFViewerApplication.pdfViewer.annotationEditorParams = evt; -} -function webViewerPrint() { - PDFViewerApplication.triggerPrinting(); -} -function webViewerDownload() { - PDFViewerApplication.downloadOrSave(); -} -function webViewerFirstPage() { - PDFViewerApplication.page = 1; -} -function webViewerLastPage() { - PDFViewerApplication.page = PDFViewerApplication.pagesCount; -} -function webViewerNextPage() { - PDFViewerApplication.pdfViewer.nextPage(); -} -function webViewerPreviousPage() { - PDFViewerApplication.pdfViewer.previousPage(); -} -function webViewerZoomIn() { - PDFViewerApplication.zoomIn(); -} -function webViewerZoomOut() { - PDFViewerApplication.zoomOut(); -} -function webViewerZoomReset() { - PDFViewerApplication.zoomReset(); -} -function webViewerPageNumberChanged(evt) { - const pdfViewer = PDFViewerApplication.pdfViewer; - if (evt.value !== "") { - PDFViewerApplication.pdfLinkService.goToPage(evt.value); - } - if (evt.value !== pdfViewer.currentPageNumber.toString() && evt.value !== pdfViewer.currentPageLabel) { - PDFViewerApplication.toolbar?.setPageNumber(pdfViewer.currentPageNumber, pdfViewer.currentPageLabel); - } -} -function webViewerScaleChanged(evt) { - PDFViewerApplication.pdfViewer.currentScaleValue = evt.value; -} -function webViewerRotateCw() { - PDFViewerApplication.rotatePages(90); -} -function webViewerRotateCcw() { - PDFViewerApplication.rotatePages(-90); -} -function webViewerOptionalContentConfig(evt) { - PDFViewerApplication.pdfViewer.optionalContentConfigPromise = evt.promise; -} -function webViewerSwitchScrollMode(evt) { - PDFViewerApplication.pdfViewer.scrollMode = evt.mode; -} -function webViewerSwitchSpreadMode(evt) { - PDFViewerApplication.pdfViewer.spreadMode = evt.mode; -} -function webViewerDocumentProperties() { - PDFViewerApplication.pdfDocumentProperties?.open(); -} -function webViewerFindFromUrlHash(evt) { - PDFViewerApplication.eventBus.dispatch("find", { - source: evt.source, - type: "", - query: evt.query, - phraseSearch: evt.phraseSearch, - caseSensitive: false, - entireWord: false, - highlightAll: true, - findPrevious: false, - matchDiacritics: true - }); -} -function webViewerUpdateFindMatchesCount({ - matchesCount -}) { - if (PDFViewerApplication.supportsIntegratedFind) { - PDFViewerApplication.externalServices.updateFindMatchesCount(matchesCount); - } else { - PDFViewerApplication.findBar.updateResultsCount(matchesCount); - } -} -function webViewerUpdateFindControlState({ - state, - previous, - matchesCount, - rawQuery -}) { - if (PDFViewerApplication.supportsIntegratedFind) { - PDFViewerApplication.externalServices.updateFindControlState({ - result: state, - findPrevious: previous, - matchesCount, - rawQuery - }); - } else { - PDFViewerApplication.findBar?.updateUIState(state, previous, matchesCount); - } -} -function webViewerScaleChanging(evt) { - PDFViewerApplication.toolbar?.setPageScale(evt.presetValue, evt.scale); - PDFViewerApplication.pdfViewer.update(); -} -function webViewerRotationChanging(evt) { - if (PDFViewerApplication.pdfThumbnailViewer) { - PDFViewerApplication.pdfThumbnailViewer.pagesRotation = evt.pagesRotation; - } - PDFViewerApplication.forceRendering(); - PDFViewerApplication.pdfViewer.currentPageNumber = evt.pageNumber; -} -function webViewerPageChanging({ - pageNumber, - pageLabel -}) { - PDFViewerApplication.toolbar?.setPageNumber(pageNumber, pageLabel); - PDFViewerApplication.secondaryToolbar?.setPageNumber(pageNumber); - if (PDFViewerApplication.pdfSidebar?.visibleView === _ui_utils.SidebarView.THUMBS) { - PDFViewerApplication.pdfThumbnailViewer?.scrollThumbnailIntoView(pageNumber); - } - const currentPage = PDFViewerApplication.pdfViewer.getPageView(pageNumber - 1); - PDFViewerApplication.toolbar?.updateLoadingIndicatorState(currentPage?.renderingState === _ui_utils.RenderingStates.RUNNING); -} -function webViewerResolutionChange(evt) { - PDFViewerApplication.pdfViewer.refresh(); -} -function webViewerVisibilityChange(evt) { - if (document.visibilityState === "visible") { - setZoomDisabledTimeout(); - } -} -let zoomDisabledTimeout = null; -function setZoomDisabledTimeout() { - if (zoomDisabledTimeout) { - clearTimeout(zoomDisabledTimeout); - } - zoomDisabledTimeout = setTimeout(function () { - zoomDisabledTimeout = null; - }, WHEEL_ZOOM_DISABLED_TIMEOUT); -} -function webViewerWheel(evt) { - const { - pdfViewer, - supportedMouseWheelZoomModifierKeys, - supportsPinchToZoom - } = PDFViewerApplication; - if (pdfViewer.isInPresentationMode) { - return; - } - const deltaMode = evt.deltaMode; - let scaleFactor = Math.exp(-evt.deltaY / 100); - const isBuiltInMac = false; - const isPinchToZoom = evt.ctrlKey && !PDFViewerApplication._isCtrlKeyDown && deltaMode === WheelEvent.DOM_DELTA_PIXEL && evt.deltaX === 0 && (Math.abs(scaleFactor - 1) < 0.05 || isBuiltInMac) && evt.deltaZ === 0; - if (isPinchToZoom || evt.ctrlKey && supportedMouseWheelZoomModifierKeys.ctrlKey || evt.metaKey && supportedMouseWheelZoomModifierKeys.metaKey) { - evt.preventDefault(); - if (zoomDisabledTimeout || document.visibilityState === "hidden") { - return; - } - const previousScale = pdfViewer.currentScale; - if (isPinchToZoom && supportsPinchToZoom) { - scaleFactor = PDFViewerApplication._accumulateFactor(previousScale, scaleFactor, "_wheelUnusedFactor"); - if (scaleFactor < 1) { - PDFViewerApplication.zoomOut(null, scaleFactor); - } else if (scaleFactor > 1) { - PDFViewerApplication.zoomIn(null, scaleFactor); - } else { - return; - } - } else { - const delta = (0, _ui_utils.normalizeWheelEventDirection)(evt); - let ticks = 0; - if (deltaMode === WheelEvent.DOM_DELTA_LINE || deltaMode === WheelEvent.DOM_DELTA_PAGE) { - if (Math.abs(delta) >= 1) { - ticks = Math.sign(delta); - } else { - ticks = PDFViewerApplication._accumulateTicks(delta, "_wheelUnusedTicks"); - } - } else { - const PIXELS_PER_LINE_SCALE = 30; - ticks = PDFViewerApplication._accumulateTicks(delta / PIXELS_PER_LINE_SCALE, "_wheelUnusedTicks"); - } - if (ticks < 0) { - PDFViewerApplication.zoomOut(-ticks); - } else if (ticks > 0) { - PDFViewerApplication.zoomIn(ticks); - } else { - return; - } - } - PDFViewerApplication._centerAtPos(previousScale, evt.clientX, evt.clientY); - } else { - setZoomDisabledTimeout(); - } -} -function webViewerTouchStart(evt) { - if (PDFViewerApplication.pdfViewer.isInPresentationMode || evt.touches.length < 2) { - return; - } - evt.preventDefault(); - if (evt.touches.length !== 2) { - PDFViewerApplication._touchInfo = null; - return; - } - let [touch0, touch1] = evt.touches; - if (touch0.identifier > touch1.identifier) { - [touch0, touch1] = [touch1, touch0]; - } - PDFViewerApplication._touchInfo = { - touch0X: touch0.pageX, - touch0Y: touch0.pageY, - touch1X: touch1.pageX, - touch1Y: touch1.pageY - }; -} -function webViewerTouchMove(evt) { - if (!PDFViewerApplication._touchInfo || evt.touches.length !== 2) { - return; - } - const { - pdfViewer, - _touchInfo, - supportsPinchToZoom - } = PDFViewerApplication; - let [touch0, touch1] = evt.touches; - if (touch0.identifier > touch1.identifier) { - [touch0, touch1] = [touch1, touch0]; - } - const { - pageX: page0X, - pageY: page0Y - } = touch0; - const { - pageX: page1X, - pageY: page1Y - } = touch1; - const { - touch0X: pTouch0X, - touch0Y: pTouch0Y, - touch1X: pTouch1X, - touch1Y: pTouch1Y - } = _touchInfo; - if (Math.abs(pTouch0X - page0X) <= 1 && Math.abs(pTouch0Y - page0Y) <= 1 && Math.abs(pTouch1X - page1X) <= 1 && Math.abs(pTouch1Y - page1Y) <= 1) { - return; - } - _touchInfo.touch0X = page0X; - _touchInfo.touch0Y = page0Y; - _touchInfo.touch1X = page1X; - _touchInfo.touch1Y = page1Y; - if (pTouch0X === page0X && pTouch0Y === page0Y) { - const v1X = pTouch1X - page0X; - const v1Y = pTouch1Y - page0Y; - const v2X = page1X - page0X; - const v2Y = page1Y - page0Y; - const det = v1X * v2Y - v1Y * v2X; - if (Math.abs(det) > 0.02 * Math.hypot(v1X, v1Y) * Math.hypot(v2X, v2Y)) { - return; - } - } else if (pTouch1X === page1X && pTouch1Y === page1Y) { - const v1X = pTouch0X - page1X; - const v1Y = pTouch0Y - page1Y; - const v2X = page0X - page1X; - const v2Y = page0Y - page1Y; - const det = v1X * v2Y - v1Y * v2X; - if (Math.abs(det) > 0.02 * Math.hypot(v1X, v1Y) * Math.hypot(v2X, v2Y)) { - return; - } - } else { - const diff0X = page0X - pTouch0X; - const diff1X = page1X - pTouch1X; - const diff0Y = page0Y - pTouch0Y; - const diff1Y = page1Y - pTouch1Y; - const dotProduct = diff0X * diff1X + diff0Y * diff1Y; - if (dotProduct >= 0) { - return; - } - } - evt.preventDefault(); - const distance = Math.hypot(page0X - page1X, page0Y - page1Y) || 1; - const pDistance = Math.hypot(pTouch0X - pTouch1X, pTouch0Y - pTouch1Y) || 1; - const previousScale = pdfViewer.currentScale; - if (supportsPinchToZoom) { - const newScaleFactor = PDFViewerApplication._accumulateFactor(previousScale, distance / pDistance, "_touchUnusedFactor"); - if (newScaleFactor < 1) { - PDFViewerApplication.zoomOut(null, newScaleFactor); - } else if (newScaleFactor > 1) { - PDFViewerApplication.zoomIn(null, newScaleFactor); - } else { - return; - } - } else { - const PIXELS_PER_LINE_SCALE = 30; - const ticks = PDFViewerApplication._accumulateTicks((distance - pDistance) / PIXELS_PER_LINE_SCALE, "_touchUnusedTicks"); - if (ticks < 0) { - PDFViewerApplication.zoomOut(-ticks); - } else if (ticks > 0) { - PDFViewerApplication.zoomIn(ticks); - } else { - return; - } - } - PDFViewerApplication._centerAtPos(previousScale, (page0X + page1X) / 2, (page0Y + page1Y) / 2); -} -function webViewerTouchEnd(evt) { - if (!PDFViewerApplication._touchInfo) { - return; - } - evt.preventDefault(); - PDFViewerApplication._touchInfo = null; - PDFViewerApplication._touchUnusedTicks = 0; - PDFViewerApplication._touchUnusedFactor = 1; -} -function webViewerClick(evt) { - if (!PDFViewerApplication.secondaryToolbar?.isOpen) { - return; - } - const appConfig = PDFViewerApplication.appConfig; - if (PDFViewerApplication.pdfViewer.containsElement(evt.target) || appConfig.toolbar?.container.contains(evt.target) && evt.target !== appConfig.secondaryToolbar?.toggleButton) { - PDFViewerApplication.secondaryToolbar.close(); - } -} -function webViewerKeyUp(evt) { - if (evt.key === "Control") { - PDFViewerApplication._isCtrlKeyDown = false; - } -} -function webViewerKeyDown(evt) { - PDFViewerApplication._isCtrlKeyDown = evt.key === "Control"; - if (PDFViewerApplication.overlayManager.active) { - return; - } - const { - eventBus, - pdfViewer - } = PDFViewerApplication; - const isViewerInPresentationMode = pdfViewer.isInPresentationMode; - let handled = false, - ensureViewerFocused = false; - const cmd = (evt.ctrlKey ? 1 : 0) | (evt.altKey ? 2 : 0) | (evt.shiftKey ? 4 : 0) | (evt.metaKey ? 8 : 0); - if (cmd === 1 || cmd === 8 || cmd === 5 || cmd === 12) { - switch (evt.keyCode) { - case 70: - if (!PDFViewerApplication.supportsIntegratedFind && !evt.shiftKey) { - PDFViewerApplication.findBar?.open(); - handled = true; - } - break; - case 71: - if (!PDFViewerApplication.supportsIntegratedFind) { - const { - state - } = PDFViewerApplication.findController; - if (state) { - const newState = { - source: window, - type: "again", - findPrevious: cmd === 5 || cmd === 12 - }; - eventBus.dispatch("find", { - ...state, - ...newState - }); - } - handled = true; - } - break; - case 61: - case 107: - case 187: - case 171: - PDFViewerApplication.zoomIn(); - handled = true; - break; - case 173: - case 109: - case 189: - PDFViewerApplication.zoomOut(); - handled = true; - break; - case 48: - case 96: - if (!isViewerInPresentationMode) { - setTimeout(function () { - PDFViewerApplication.zoomReset(); - }); - handled = false; - } - break; - case 38: - if (isViewerInPresentationMode || PDFViewerApplication.page > 1) { - PDFViewerApplication.page = 1; - handled = true; - ensureViewerFocused = true; - } - break; - case 40: - if (isViewerInPresentationMode || PDFViewerApplication.page < PDFViewerApplication.pagesCount) { - PDFViewerApplication.page = PDFViewerApplication.pagesCount; - handled = true; - ensureViewerFocused = true; - } - break; - } - } - if (cmd === 1 || cmd === 8) { - switch (evt.keyCode) { - case 83: - eventBus.dispatch("download", { - source: window - }); - handled = true; - break; - case 79: - { - eventBus.dispatch("openfile", { - source: window - }); - handled = true; - } - break; - } - } - if (cmd === 3 || cmd === 10) { - switch (evt.keyCode) { - case 80: - PDFViewerApplication.requestPresentationMode(); - handled = true; - PDFViewerApplication.externalServices.reportTelemetry({ - type: "buttons", - data: { - id: "presentationModeKeyboard" - } - }); - break; - case 71: - if (PDFViewerApplication.appConfig.toolbar) { - PDFViewerApplication.appConfig.toolbar.pageNumber.select(); - handled = true; - } - break; - } - } - if (handled) { - if (ensureViewerFocused && !isViewerInPresentationMode) { - pdfViewer.focus(); - } - evt.preventDefault(); - return; - } - const curElement = (0, _ui_utils.getActiveOrFocusedElement)(); - const curElementTagName = curElement?.tagName.toUpperCase(); - if (curElementTagName === "INPUT" || curElementTagName === "TEXTAREA" || curElementTagName === "SELECT" || curElement?.isContentEditable) { - if (evt.keyCode !== 27) { - return; - } - } - if (cmd === 0) { - let turnPage = 0, - turnOnlyIfPageFit = false; - switch (evt.keyCode) { - case 38: - case 33: - if (pdfViewer.isVerticalScrollbarEnabled) { - turnOnlyIfPageFit = true; - } - turnPage = -1; - break; - case 8: - if (!isViewerInPresentationMode) { - turnOnlyIfPageFit = true; - } - turnPage = -1; - break; - case 37: - if (pdfViewer.isHorizontalScrollbarEnabled) { - turnOnlyIfPageFit = true; - } - case 75: - case 80: - turnPage = -1; - break; - case 27: - if (PDFViewerApplication.secondaryToolbar?.isOpen) { - PDFViewerApplication.secondaryToolbar.close(); - handled = true; - } - if (!PDFViewerApplication.supportsIntegratedFind && PDFViewerApplication.findBar?.opened) { - PDFViewerApplication.findBar.close(); - handled = true; - } - break; - case 40: - case 34: - if (pdfViewer.isVerticalScrollbarEnabled) { - turnOnlyIfPageFit = true; - } - turnPage = 1; - break; - case 13: - case 32: - if (!isViewerInPresentationMode) { - turnOnlyIfPageFit = true; - } - turnPage = 1; - break; - case 39: - if (pdfViewer.isHorizontalScrollbarEnabled) { - turnOnlyIfPageFit = true; - } - case 74: - case 78: - turnPage = 1; - break; - case 36: - if (isViewerInPresentationMode || PDFViewerApplication.page > 1) { - PDFViewerApplication.page = 1; - handled = true; - ensureViewerFocused = true; - } - break; - case 35: - if (isViewerInPresentationMode || PDFViewerApplication.page < PDFViewerApplication.pagesCount) { - PDFViewerApplication.page = PDFViewerApplication.pagesCount; - handled = true; - ensureViewerFocused = true; - } - break; - case 83: - PDFViewerApplication.pdfCursorTools?.switchTool(_ui_utils.CursorTool.SELECT); - break; - case 72: - PDFViewerApplication.pdfCursorTools?.switchTool(_ui_utils.CursorTool.HAND); - break; - case 82: - PDFViewerApplication.rotatePages(90); - break; - case 115: - PDFViewerApplication.pdfSidebar?.toggle(); - break; - } - if (turnPage !== 0 && (!turnOnlyIfPageFit || pdfViewer.currentScaleValue === "page-fit")) { - if (turnPage > 0) { - pdfViewer.nextPage(); - } else { - pdfViewer.previousPage(); - } - handled = true; - } - } - if (cmd === 4) { - switch (evt.keyCode) { - case 13: - case 32: - if (!isViewerInPresentationMode && pdfViewer.currentScaleValue !== "page-fit") { - break; - } - pdfViewer.previousPage(); - handled = true; - break; - case 82: - PDFViewerApplication.rotatePages(-90); - break; - } - } - if (!handled && !isViewerInPresentationMode) { - if (evt.keyCode >= 33 && evt.keyCode <= 40 || evt.keyCode === 32 && curElementTagName !== "BUTTON") { - ensureViewerFocused = true; - } - } - if (ensureViewerFocused && !pdfViewer.containsElement(curElement)) { - pdfViewer.focus(); - } - if (handled) { - evt.preventDefault(); - } -} -function beforeUnload(evt) { - evt.preventDefault(); - evt.returnValue = ""; - return false; -} -function webViewerAnnotationEditorStatesChanged(data) { - PDFViewerApplication.externalServices.updateEditorStates(data); -} -const PDFPrintServiceFactory = { - instance: { - supportsPrinting: false, - createPrintService() { - throw new Error("Not implemented: createPrintService"); - } - } -}; -exports.PDFPrintServiceFactory = PDFPrintServiceFactory; - -/***/ }), -/* 3 */ -/***/ ((__unused_webpack_module, exports) => { - - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.animationStarted = exports.VERTICAL_PADDING = exports.UNKNOWN_SCALE = exports.TextLayerMode = exports.SpreadMode = exports.SidebarView = exports.ScrollMode = exports.SCROLLBAR_PADDING = exports.RenderingStates = exports.RendererType = exports.ProgressBar = exports.PresentationModeState = exports.OutputScale = exports.MIN_SCALE = exports.MAX_SCALE = exports.MAX_AUTO_SCALE = exports.DEFAULT_SCALE_VALUE = exports.DEFAULT_SCALE_DELTA = exports.DEFAULT_SCALE = exports.CursorTool = exports.AutoPrintRegExp = void 0; -exports.apiPageLayoutToViewerModes = apiPageLayoutToViewerModes; -exports.apiPageModeToSidebarView = apiPageModeToSidebarView; -exports.approximateFraction = approximateFraction; -exports.backtrackBeforeAllVisibleElements = backtrackBeforeAllVisibleElements; -exports.binarySearchFirstItem = binarySearchFirstItem; -exports.docStyle = void 0; -exports.getActiveOrFocusedElement = getActiveOrFocusedElement; -exports.getPageSizeInches = getPageSizeInches; -exports.getVisibleElements = getVisibleElements; -exports.isPortraitOrientation = isPortraitOrientation; -exports.isValidRotation = isValidRotation; -exports.isValidScrollMode = isValidScrollMode; -exports.isValidSpreadMode = isValidSpreadMode; -exports.noContextMenuHandler = noContextMenuHandler; -exports.normalizeWheelEventDelta = normalizeWheelEventDelta; -exports.normalizeWheelEventDirection = normalizeWheelEventDirection; -exports.parseQueryString = parseQueryString; -exports.removeNullCharacters = removeNullCharacters; -exports.roundToDivide = roundToDivide; -exports.scrollIntoView = scrollIntoView; -exports.watchScroll = watchScroll; -const DEFAULT_SCALE_VALUE = "auto"; -exports.DEFAULT_SCALE_VALUE = DEFAULT_SCALE_VALUE; -const DEFAULT_SCALE = 1.0; -exports.DEFAULT_SCALE = DEFAULT_SCALE; -const DEFAULT_SCALE_DELTA = 1.1; -exports.DEFAULT_SCALE_DELTA = DEFAULT_SCALE_DELTA; -const MIN_SCALE = 0.1; -exports.MIN_SCALE = MIN_SCALE; -const MAX_SCALE = 10.0; -exports.MAX_SCALE = MAX_SCALE; -const UNKNOWN_SCALE = 0; -exports.UNKNOWN_SCALE = UNKNOWN_SCALE; -const MAX_AUTO_SCALE = 1.25; -exports.MAX_AUTO_SCALE = MAX_AUTO_SCALE; -const SCROLLBAR_PADDING = 40; -exports.SCROLLBAR_PADDING = SCROLLBAR_PADDING; -const VERTICAL_PADDING = 5; -exports.VERTICAL_PADDING = VERTICAL_PADDING; -const RenderingStates = { - INITIAL: 0, - RUNNING: 1, - PAUSED: 2, - FINISHED: 3 -}; -exports.RenderingStates = RenderingStates; -const PresentationModeState = { - UNKNOWN: 0, - NORMAL: 1, - CHANGING: 2, - FULLSCREEN: 3 -}; -exports.PresentationModeState = PresentationModeState; -const SidebarView = { - UNKNOWN: -1, - NONE: 0, - THUMBS: 1, - OUTLINE: 2, - ATTACHMENTS: 3, - LAYERS: 4 -}; -exports.SidebarView = SidebarView; -const RendererType = { - CANVAS: "canvas", - SVG: "svg" -}; -exports.RendererType = RendererType; -const TextLayerMode = { - DISABLE: 0, - ENABLE: 1 -}; -exports.TextLayerMode = TextLayerMode; -const ScrollMode = { - UNKNOWN: -1, - VERTICAL: 0, - HORIZONTAL: 1, - WRAPPED: 2, - PAGE: 3 -}; -exports.ScrollMode = ScrollMode; -const SpreadMode = { - UNKNOWN: -1, - NONE: 0, - ODD: 1, - EVEN: 2 -}; -exports.SpreadMode = SpreadMode; -const CursorTool = { - SELECT: 0, - HAND: 1, - ZOOM: 2 -}; -exports.CursorTool = CursorTool; -const AutoPrintRegExp = /\bprint\s*\(/; -exports.AutoPrintRegExp = AutoPrintRegExp; -class OutputScale { - constructor() { - const pixelRatio = window.devicePixelRatio || 1; - this.sx = pixelRatio; - this.sy = pixelRatio; - } - get scaled() { - return this.sx !== 1 || this.sy !== 1; - } -} -exports.OutputScale = OutputScale; -function scrollIntoView(element, spot, scrollMatches = false) { - let parent = element.offsetParent; - if (!parent) { - console.error("offsetParent is not set -- cannot scroll"); - return; - } - let offsetY = element.offsetTop + element.clientTop; - let offsetX = element.offsetLeft + element.clientLeft; - while (parent.clientHeight === parent.scrollHeight && parent.clientWidth === parent.scrollWidth || scrollMatches && (parent.classList.contains("markedContent") || getComputedStyle(parent).overflow === "hidden")) { - offsetY += parent.offsetTop; - offsetX += parent.offsetLeft; - parent = parent.offsetParent; - if (!parent) { - return; - } - } - if (spot) { - if (spot.top !== undefined) { - offsetY += spot.top; - } - if (spot.left !== undefined) { - offsetX += spot.left; - parent.scrollLeft = offsetX; - } - } - parent.scrollTop = offsetY; -} -function watchScroll(viewAreaElement, callback) { - const debounceScroll = function (evt) { - if (rAF) { - return; - } - rAF = window.requestAnimationFrame(function viewAreaElementScrolled() { - rAF = null; - const currentX = viewAreaElement.scrollLeft; - const lastX = state.lastX; - if (currentX !== lastX) { - state.right = currentX > lastX; - } - state.lastX = currentX; - const currentY = viewAreaElement.scrollTop; - const lastY = state.lastY; - if (currentY !== lastY) { - state.down = currentY > lastY; - } - state.lastY = currentY; - callback(state); - }); - }; - const state = { - right: true, - down: true, - lastX: viewAreaElement.scrollLeft, - lastY: viewAreaElement.scrollTop, - _eventHandler: debounceScroll - }; - let rAF = null; - viewAreaElement.addEventListener("scroll", debounceScroll, true); - return state; -} -function parseQueryString(query) { - const params = new Map(); - for (const [key, value] of new URLSearchParams(query)) { - params.set(key.toLowerCase(), value); - } - return params; -} -const NullCharactersRegExp = /\x00/g; -const InvisibleCharactersRegExp = /[\x01-\x1F]/g; -function removeNullCharacters(str, replaceInvisible = false) { - if (typeof str !== "string") { - console.error(`The argument must be a string.`); - return str; - } - if (replaceInvisible) { - str = str.replace(InvisibleCharactersRegExp, " "); - } - return str.replace(NullCharactersRegExp, ""); -} -function binarySearchFirstItem(items, condition, start = 0) { - let minIndex = start; - let maxIndex = items.length - 1; - if (maxIndex < 0 || !condition(items[maxIndex])) { - return items.length; - } - if (condition(items[minIndex])) { - return minIndex; - } - while (minIndex < maxIndex) { - const currentIndex = minIndex + maxIndex >> 1; - const currentItem = items[currentIndex]; - if (condition(currentItem)) { - maxIndex = currentIndex; - } else { - minIndex = currentIndex + 1; - } - } - return minIndex; -} -function approximateFraction(x) { - if (Math.floor(x) === x) { - return [x, 1]; - } - const xinv = 1 / x; - const limit = 8; - if (xinv > limit) { - return [1, limit]; - } else if (Math.floor(xinv) === xinv) { - return [1, xinv]; - } - const x_ = x > 1 ? xinv : x; - let a = 0, - b = 1, - c = 1, - d = 1; - while (true) { - const p = a + c, - q = b + d; - if (q > limit) { - break; - } - if (x_ <= p / q) { - c = p; - d = q; - } else { - a = p; - b = q; - } - } - let result; - if (x_ - a / b < c / d - x_) { - result = x_ === x ? [a, b] : [b, a]; - } else { - result = x_ === x ? [c, d] : [d, c]; - } - return result; -} -function roundToDivide(x, div) { - const r = x % div; - return r === 0 ? x : Math.round(x - r + div); -} -function getPageSizeInches({ - view, - userUnit, - rotate -}) { - const [x1, y1, x2, y2] = view; - const changeOrientation = rotate % 180 !== 0; - const width = (x2 - x1) / 72 * userUnit; - const height = (y2 - y1) / 72 * userUnit; - return { - width: changeOrientation ? height : width, - height: changeOrientation ? width : height - }; -} -function backtrackBeforeAllVisibleElements(index, views, top) { - if (index < 2) { - return index; - } - let elt = views[index].div; - let pageTop = elt.offsetTop + elt.clientTop; - if (pageTop >= top) { - elt = views[index - 1].div; - pageTop = elt.offsetTop + elt.clientTop; - } - for (let i = index - 2; i >= 0; --i) { - elt = views[i].div; - if (elt.offsetTop + elt.clientTop + elt.clientHeight <= pageTop) { - break; - } - index = i; - } - return index; -} -function getVisibleElements({ - scrollEl, - views, - sortByVisibility = false, - horizontal = false, - rtl = false -}) { - const top = scrollEl.scrollTop, - bottom = top + scrollEl.clientHeight; - const left = scrollEl.scrollLeft, - right = left + scrollEl.clientWidth; - function isElementBottomAfterViewTop(view) { - const element = view.div; - const elementBottom = element.offsetTop + element.clientTop + element.clientHeight; - return elementBottom > top; - } - function isElementNextAfterViewHorizontally(view) { - const element = view.div; - const elementLeft = element.offsetLeft + element.clientLeft; - const elementRight = elementLeft + element.clientWidth; - return rtl ? elementLeft < right : elementRight > left; - } - const visible = [], - ids = new Set(), - numViews = views.length; - let firstVisibleElementInd = binarySearchFirstItem(views, horizontal ? isElementNextAfterViewHorizontally : isElementBottomAfterViewTop); - if (firstVisibleElementInd > 0 && firstVisibleElementInd < numViews && !horizontal) { - firstVisibleElementInd = backtrackBeforeAllVisibleElements(firstVisibleElementInd, views, top); - } - let lastEdge = horizontal ? right : -1; - for (let i = firstVisibleElementInd; i < numViews; i++) { - const view = views[i], - element = view.div; - const currentWidth = element.offsetLeft + element.clientLeft; - const currentHeight = element.offsetTop + element.clientTop; - const viewWidth = element.clientWidth, - viewHeight = element.clientHeight; - const viewRight = currentWidth + viewWidth; - const viewBottom = currentHeight + viewHeight; - if (lastEdge === -1) { - if (viewBottom >= bottom) { - lastEdge = viewBottom; - } - } else if ((horizontal ? currentWidth : currentHeight) > lastEdge) { - break; - } - if (viewBottom <= top || currentHeight >= bottom || viewRight <= left || currentWidth >= right) { - continue; - } - const hiddenHeight = Math.max(0, top - currentHeight) + Math.max(0, viewBottom - bottom); - const hiddenWidth = Math.max(0, left - currentWidth) + Math.max(0, viewRight - right); - const fractionHeight = (viewHeight - hiddenHeight) / viewHeight, - fractionWidth = (viewWidth - hiddenWidth) / viewWidth; - const percent = fractionHeight * fractionWidth * 100 | 0; - visible.push({ - id: view.id, - x: currentWidth, - y: currentHeight, - view, - percent, - widthPercent: fractionWidth * 100 | 0 - }); - ids.add(view.id); - } - const first = visible[0], - last = visible.at(-1); - if (sortByVisibility) { - visible.sort(function (a, b) { - const pc = a.percent - b.percent; - if (Math.abs(pc) > 0.001) { - return -pc; - } - return a.id - b.id; - }); - } - return { - first, - last, - views: visible, - ids - }; -} -function noContextMenuHandler(evt) { - evt.preventDefault(); -} -function normalizeWheelEventDirection(evt) { - let delta = Math.hypot(evt.deltaX, evt.deltaY); - const angle = Math.atan2(evt.deltaY, evt.deltaX); - if (-0.25 * Math.PI < angle && angle < 0.75 * Math.PI) { - delta = -delta; - } - return delta; -} -function normalizeWheelEventDelta(evt) { - const deltaMode = evt.deltaMode; - let delta = normalizeWheelEventDirection(evt); - const MOUSE_PIXELS_PER_LINE = 30; - const MOUSE_LINES_PER_PAGE = 30; - if (deltaMode === WheelEvent.DOM_DELTA_PIXEL) { - delta /= MOUSE_PIXELS_PER_LINE * MOUSE_LINES_PER_PAGE; - } else if (deltaMode === WheelEvent.DOM_DELTA_LINE) { - delta /= MOUSE_LINES_PER_PAGE; - } - return delta; -} -function isValidRotation(angle) { - return Number.isInteger(angle) && angle % 90 === 0; -} -function isValidScrollMode(mode) { - return Number.isInteger(mode) && Object.values(ScrollMode).includes(mode) && mode !== ScrollMode.UNKNOWN; -} -function isValidSpreadMode(mode) { - return Number.isInteger(mode) && Object.values(SpreadMode).includes(mode) && mode !== SpreadMode.UNKNOWN; -} -function isPortraitOrientation(size) { - return size.width <= size.height; -} -const animationStarted = new Promise(function (resolve) { - window.requestAnimationFrame(resolve); -}); -exports.animationStarted = animationStarted; -const docStyle = document.documentElement.style; -exports.docStyle = docStyle; -function clamp(v, min, max) { - return Math.min(Math.max(v, min), max); -} -class ProgressBar { - #classList = null; - #disableAutoFetchTimeout = null; - #percent = 0; - #style = null; - #visible = true; - constructor(bar) { - this.#classList = bar.classList; - this.#style = bar.style; - } - get percent() { - return this.#percent; - } - set percent(val) { - this.#percent = clamp(val, 0, 100); - if (isNaN(val)) { - this.#classList.add("indeterminate"); - return; - } - this.#classList.remove("indeterminate"); - this.#style.setProperty("--progressBar-percent", `${this.#percent}%`); - } - setWidth(viewer) { - if (!viewer) { - return; - } - const container = viewer.parentNode; - const scrollbarWidth = container.offsetWidth - viewer.offsetWidth; - if (scrollbarWidth > 0) { - this.#style.setProperty("--progressBar-end-offset", `${scrollbarWidth}px`); - } - } - setDisableAutoFetch(delay = 5000) { - if (isNaN(this.#percent)) { - return; - } - if (this.#disableAutoFetchTimeout) { - clearTimeout(this.#disableAutoFetchTimeout); - } - this.show(); - this.#disableAutoFetchTimeout = setTimeout(() => { - this.#disableAutoFetchTimeout = null; - this.hide(); - }, delay); - } - hide() { - if (!this.#visible) { - return; - } - this.#visible = false; - this.#classList.add("hidden"); - } - show() { - if (this.#visible) { - return; - } - this.#visible = true; - this.#classList.remove("hidden"); - } -} -exports.ProgressBar = ProgressBar; -function getActiveOrFocusedElement() { - let curRoot = document; - let curActiveOrFocused = curRoot.activeElement || curRoot.querySelector(":focus"); - while (curActiveOrFocused?.shadowRoot) { - curRoot = curActiveOrFocused.shadowRoot; - curActiveOrFocused = curRoot.activeElement || curRoot.querySelector(":focus"); - } - return curActiveOrFocused; -} -function apiPageLayoutToViewerModes(layout) { - let scrollMode = ScrollMode.VERTICAL, - spreadMode = SpreadMode.NONE; - switch (layout) { - case "SinglePage": - scrollMode = ScrollMode.PAGE; - break; - case "OneColumn": - break; - case "TwoPageLeft": - scrollMode = ScrollMode.PAGE; - case "TwoColumnLeft": - spreadMode = SpreadMode.ODD; - break; - case "TwoPageRight": - scrollMode = ScrollMode.PAGE; - case "TwoColumnRight": - spreadMode = SpreadMode.EVEN; - break; - } - return { - scrollMode, - spreadMode - }; -} -function apiPageModeToSidebarView(mode) { - switch (mode) { - case "UseNone": - return SidebarView.NONE; - case "UseThumbs": - return SidebarView.THUMBS; - case "UseOutlines": - return SidebarView.OUTLINE; - case "UseAttachments": - return SidebarView.ATTACHMENTS; - case "UseOC": - return SidebarView.LAYERS; - } - return SidebarView.NONE; -} - -/***/ }), -/* 4 */ -/***/ ((module) => { - - - -let pdfjsLib; -if (typeof window !== "undefined" && window["pdfjs-dist/build/pdf"]) { - pdfjsLib = window["pdfjs-dist/build/pdf"]; -} else { - pdfjsLib = require("../build/pdf.js"); -} -module.exports = pdfjsLib; - -/***/ }), -/* 5 */ -/***/ ((__unused_webpack_module, exports) => { - - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.compatibilityParams = exports.OptionKind = exports.AppOptions = void 0; -const compatibilityParams = Object.create(null); -exports.compatibilityParams = compatibilityParams; -{ - const userAgent = navigator.userAgent || ""; - const platform = navigator.platform || ""; - const maxTouchPoints = navigator.maxTouchPoints || 1; - const isAndroid = /Android/.test(userAgent); - const isIOS = /\b(iPad|iPhone|iPod)(?=;)/.test(userAgent) || platform === "MacIntel" && maxTouchPoints > 1; - (function checkCanvasSizeLimitation() { - if (isIOS || isAndroid) { - compatibilityParams.maxCanvasPixels = 5242880; - } - })(); -} -const OptionKind = { - VIEWER: 0x02, - API: 0x04, - WORKER: 0x08, - PREFERENCE: 0x80 -}; -exports.OptionKind = OptionKind; -const defaultOptions = { - annotationEditorMode: { - value: 0, - kind: OptionKind.VIEWER + OptionKind.PREFERENCE - }, - annotationMode: { - value: 2, - kind: OptionKind.VIEWER + OptionKind.PREFERENCE - }, - cursorToolOnLoad: { - value: 0, - kind: OptionKind.VIEWER + OptionKind.PREFERENCE - }, - defaultZoomDelay: { - value: 400, - kind: OptionKind.VIEWER + OptionKind.PREFERENCE - }, - defaultZoomValue: { - value: "", - kind: OptionKind.VIEWER + OptionKind.PREFERENCE - }, - disableHistory: { - value: false, - kind: OptionKind.VIEWER - }, - disablePageLabels: { - value: false, - kind: OptionKind.VIEWER + OptionKind.PREFERENCE - }, - enablePermissions: { - value: false, - kind: OptionKind.VIEWER + OptionKind.PREFERENCE - }, - enablePrintAutoRotate: { - value: true, - kind: OptionKind.VIEWER + OptionKind.PREFERENCE - }, - enableScripting: { - value: true, - kind: OptionKind.VIEWER + OptionKind.PREFERENCE - }, - externalLinkRel: { - value: "noopener noreferrer nofollow", - kind: OptionKind.VIEWER - }, - externalLinkTarget: { - value: 0, - kind: OptionKind.VIEWER + OptionKind.PREFERENCE - }, - historyUpdateUrl: { - value: false, - kind: OptionKind.VIEWER + OptionKind.PREFERENCE - }, - ignoreDestinationZoom: { - value: false, - kind: OptionKind.VIEWER + OptionKind.PREFERENCE - }, - imageResourcesPath: { - value: "./images/", - kind: OptionKind.VIEWER - }, - maxCanvasPixels: { - value: 16777216, - kind: OptionKind.VIEWER - }, - forcePageColors: { - value: false, - kind: OptionKind.VIEWER + OptionKind.PREFERENCE - }, - pageColorsBackground: { - value: "Canvas", - kind: OptionKind.VIEWER + OptionKind.PREFERENCE - }, - pageColorsForeground: { - value: "CanvasText", - kind: OptionKind.VIEWER + OptionKind.PREFERENCE - }, - pdfBugEnabled: { - value: false, - kind: OptionKind.VIEWER + OptionKind.PREFERENCE - }, - printResolution: { - value: 150, - kind: OptionKind.VIEWER - }, - sidebarViewOnLoad: { - value: -1, - kind: OptionKind.VIEWER + OptionKind.PREFERENCE - }, - scrollModeOnLoad: { - value: -1, - kind: OptionKind.VIEWER + OptionKind.PREFERENCE - }, - spreadModeOnLoad: { - value: -1, - kind: OptionKind.VIEWER + OptionKind.PREFERENCE - }, - textLayerMode: { - value: 1, - kind: OptionKind.VIEWER + OptionKind.PREFERENCE - }, - useOnlyCssZoom: { - value: false, - kind: OptionKind.VIEWER + OptionKind.PREFERENCE - }, - viewerCssTheme: { - value: 0, - kind: OptionKind.VIEWER + OptionKind.PREFERENCE - }, - viewOnLoad: { - value: 0, - kind: OptionKind.VIEWER + OptionKind.PREFERENCE - }, - cMapPacked: { - value: true, - kind: OptionKind.API - }, - cMapUrl: { - value: "../web/cmaps/", - kind: OptionKind.API - }, - disableAutoFetch: { - value: false, - kind: OptionKind.API + OptionKind.PREFERENCE - }, - disableFontFace: { - value: false, - kind: OptionKind.API + OptionKind.PREFERENCE - }, - disableRange: { - value: false, - kind: OptionKind.API + OptionKind.PREFERENCE - }, - disableStream: { - value: false, - kind: OptionKind.API + OptionKind.PREFERENCE - }, - docBaseUrl: { - value: "", - kind: OptionKind.API - }, - enableXfa: { - value: true, - kind: OptionKind.API + OptionKind.PREFERENCE - }, - fontExtraProperties: { - value: false, - kind: OptionKind.API - }, - isEvalSupported: { - value: true, - kind: OptionKind.API - }, - isOffscreenCanvasSupported: { - value: true, - kind: OptionKind.API - }, - maxImageSize: { - value: -1, - kind: OptionKind.API - }, - pdfBug: { - value: false, - kind: OptionKind.API - }, - standardFontDataUrl: { - value: "../web/standard_fonts/", - kind: OptionKind.API - }, - verbosity: { - value: 1, - kind: OptionKind.API - }, - workerPort: { - value: null, - kind: OptionKind.WORKER - }, - workerSrc: { - value: "../build/pdf.worker.js", - kind: OptionKind.WORKER - } -}; -{ - defaultOptions.defaultUrl = { - value: "compressed.tracemonkey-pldi-09.pdf", - kind: OptionKind.VIEWER - }; - defaultOptions.disablePreferences = { - value: false, - kind: OptionKind.VIEWER - }; - defaultOptions.locale = { - value: navigator.language || "en-US", - kind: OptionKind.VIEWER - }; - defaultOptions.renderer = { - value: "canvas", - kind: OptionKind.VIEWER + OptionKind.PREFERENCE - }; - defaultOptions.sandboxBundleSrc = { - value: "../build/pdf.sandbox.js", - kind: OptionKind.VIEWER - }; -} -const userOptions = Object.create(null); -class AppOptions { - constructor() { - throw new Error("Cannot initialize AppOptions."); - } - static get(name) { - const userOption = userOptions[name]; - if (userOption !== undefined) { - return userOption; - } - const defaultOption = defaultOptions[name]; - if (defaultOption !== undefined) { - return compatibilityParams[name] ?? defaultOption.value; - } - return undefined; - } - static getAll(kind = null) { - const options = Object.create(null); - for (const name in defaultOptions) { - const defaultOption = defaultOptions[name]; - if (kind) { - if ((kind & defaultOption.kind) === 0) { - continue; - } - if (kind === OptionKind.PREFERENCE) { - const value = defaultOption.value, - valueType = typeof value; - if (valueType === "boolean" || valueType === "string" || valueType === "number" && Number.isInteger(value)) { - options[name] = value; - continue; - } - throw new Error(`Invalid type for preference: ${name}`); - } - } - const userOption = userOptions[name]; - options[name] = userOption !== undefined ? userOption : compatibilityParams[name] ?? defaultOption.value; - } - return options; - } - static set(name, value) { - userOptions[name] = value; - } - static setAll(options) { - for (const name in options) { - userOptions[name] = options[name]; - } - } - static remove(name) { - delete userOptions[name]; - } -} -exports.AppOptions = AppOptions; -{ - AppOptions._hasUserOptions = function () { - return Object.keys(userOptions).length > 0; - }; -} - -/***/ }), -/* 6 */ -/***/ ((__unused_webpack_module, exports) => { - - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.WaitOnType = exports.EventBus = exports.AutomationEventBus = void 0; -exports.waitOnEventOrTimeout = waitOnEventOrTimeout; -const WaitOnType = { - EVENT: "event", - TIMEOUT: "timeout" -}; -exports.WaitOnType = WaitOnType; -function waitOnEventOrTimeout({ - target, - name, - delay = 0 -}) { - return new Promise(function (resolve, reject) { - if (typeof target !== "object" || !(name && typeof name === "string") || !(Number.isInteger(delay) && delay >= 0)) { - throw new Error("waitOnEventOrTimeout - invalid parameters."); - } - function handler(type) { - if (target instanceof EventBus) { - target._off(name, eventHandler); - } else { - target.removeEventListener(name, eventHandler); - } - if (timeout) { - clearTimeout(timeout); - } - resolve(type); - } - const eventHandler = handler.bind(null, WaitOnType.EVENT); - if (target instanceof EventBus) { - target._on(name, eventHandler); - } else { - target.addEventListener(name, eventHandler); - } - const timeoutHandler = handler.bind(null, WaitOnType.TIMEOUT); - const timeout = setTimeout(timeoutHandler, delay); - }); -} -class EventBus { - #listeners = Object.create(null); - on(eventName, listener, options = null) { - this._on(eventName, listener, { - external: true, - once: options?.once - }); - } - off(eventName, listener, options = null) { - this._off(eventName, listener, { - external: true, - once: options?.once - }); - } - dispatch(eventName, data) { - const eventListeners = this.#listeners[eventName]; - if (!eventListeners || eventListeners.length === 0) { - return; - } - let externalListeners; - for (const { - listener, - external, - once - } of eventListeners.slice(0)) { - if (once) { - this._off(eventName, listener); - } - if (external) { - (externalListeners ||= []).push(listener); - continue; - } - listener(data); - } - if (externalListeners) { - for (const listener of externalListeners) { - listener(data); - } - externalListeners = null; - } - } - _on(eventName, listener, options = null) { - const eventListeners = this.#listeners[eventName] ||= []; - eventListeners.push({ - listener, - external: options?.external === true, - once: options?.once === true - }); - } - _off(eventName, listener, options = null) { - const eventListeners = this.#listeners[eventName]; - if (!eventListeners) { - return; - } - for (let i = 0, ii = eventListeners.length; i < ii; i++) { - if (eventListeners[i].listener === listener) { - eventListeners.splice(i, 1); - return; - } - } - } -} -exports.EventBus = EventBus; -class AutomationEventBus extends EventBus { - dispatch(eventName, data) { - throw new Error("Not implemented: AutomationEventBus.dispatch"); - } -} -exports.AutomationEventBus = AutomationEventBus; - -/***/ }), -/* 7 */ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.SimpleLinkService = exports.PDFLinkService = exports.LinkTarget = void 0; -var _ui_utils = __webpack_require__(3); -const DEFAULT_LINK_REL = "noopener noreferrer nofollow"; -const LinkTarget = { - NONE: 0, - SELF: 1, - BLANK: 2, - PARENT: 3, - TOP: 4 -}; -exports.LinkTarget = LinkTarget; -function addLinkAttributes(link, { - url, - target, - rel, - enabled = true -} = {}) { - if (!url || typeof url !== "string") { - throw new Error('A valid "url" parameter must provided.'); - } - const urlNullRemoved = (0, _ui_utils.removeNullCharacters)(url); - if (enabled) { - link.href = link.title = urlNullRemoved; - } else { - link.href = ""; - link.title = `Disabled: ${urlNullRemoved}`; - link.onclick = () => { - return false; - }; - } - let targetStr = ""; - switch (target) { - case LinkTarget.NONE: - break; - case LinkTarget.SELF: - targetStr = "_self"; - break; - case LinkTarget.BLANK: - targetStr = "_blank"; - break; - case LinkTarget.PARENT: - targetStr = "_parent"; - break; - case LinkTarget.TOP: - targetStr = "_top"; - break; - } - link.target = targetStr; - link.rel = typeof rel === "string" ? rel : DEFAULT_LINK_REL; -} -class PDFLinkService { - #pagesRefCache = new Map(); - constructor({ - eventBus, - externalLinkTarget = null, - externalLinkRel = null, - ignoreDestinationZoom = false - } = {}) { - this.eventBus = eventBus; - this.externalLinkTarget = externalLinkTarget; - this.externalLinkRel = externalLinkRel; - this.externalLinkEnabled = true; - this._ignoreDestinationZoom = ignoreDestinationZoom; - this.baseUrl = null; - this.pdfDocument = null; - this.pdfViewer = null; - this.pdfHistory = null; - } - setDocument(pdfDocument, baseUrl = null) { - this.baseUrl = baseUrl; - this.pdfDocument = pdfDocument; - this.#pagesRefCache.clear(); - } - setViewer(pdfViewer) { - this.pdfViewer = pdfViewer; - } - setHistory(pdfHistory) { - this.pdfHistory = pdfHistory; - } - get pagesCount() { - return this.pdfDocument ? this.pdfDocument.numPages : 0; - } - get page() { - return this.pdfViewer.currentPageNumber; - } - set page(value) { - this.pdfViewer.currentPageNumber = value; - } - get rotation() { - return this.pdfViewer.pagesRotation; - } - set rotation(value) { - this.pdfViewer.pagesRotation = value; - } - get isInPresentationMode() { - return this.pdfViewer.isInPresentationMode; - } - #goToDestinationHelper(rawDest, namedDest = null, explicitDest) { - const destRef = explicitDest[0]; - let pageNumber; - if (typeof destRef === "object" && destRef !== null) { - pageNumber = this._cachedPageNumber(destRef); - if (!pageNumber) { - this.pdfDocument.getPageIndex(destRef).then(pageIndex => { - this.cachePageRef(pageIndex + 1, destRef); - this.#goToDestinationHelper(rawDest, namedDest, explicitDest); - }).catch(() => { - console.error(`PDFLinkService.#goToDestinationHelper: "${destRef}" is not ` + `a valid page reference, for dest="${rawDest}".`); - }); - return; - } - } else if (Number.isInteger(destRef)) { - pageNumber = destRef + 1; - } else { - console.error(`PDFLinkService.#goToDestinationHelper: "${destRef}" is not ` + `a valid destination reference, for dest="${rawDest}".`); - return; - } - if (!pageNumber || pageNumber < 1 || pageNumber > this.pagesCount) { - console.error(`PDFLinkService.#goToDestinationHelper: "${pageNumber}" is not ` + `a valid page number, for dest="${rawDest}".`); - return; - } - if (this.pdfHistory) { - this.pdfHistory.pushCurrentPosition(); - this.pdfHistory.push({ - namedDest, - explicitDest, - pageNumber - }); - } - this.pdfViewer.scrollPageIntoView({ - pageNumber, - destArray: explicitDest, - ignoreDestinationZoom: this._ignoreDestinationZoom - }); - } - async goToDestination(dest) { - if (!this.pdfDocument) { - return; - } - let namedDest, explicitDest; - if (typeof dest === "string") { - namedDest = dest; - explicitDest = await this.pdfDocument.getDestination(dest); - } else { - namedDest = null; - explicitDest = await dest; - } - if (!Array.isArray(explicitDest)) { - console.error(`PDFLinkService.goToDestination: "${explicitDest}" is not ` + `a valid destination array, for dest="${dest}".`); - return; - } - this.#goToDestinationHelper(dest, namedDest, explicitDest); - } - goToPage(val) { - if (!this.pdfDocument) { - return; - } - const pageNumber = typeof val === "string" && this.pdfViewer.pageLabelToPageNumber(val) || val | 0; - if (!(Number.isInteger(pageNumber) && pageNumber > 0 && pageNumber <= this.pagesCount)) { - console.error(`PDFLinkService.goToPage: "${val}" is not a valid page.`); - return; - } - if (this.pdfHistory) { - this.pdfHistory.pushCurrentPosition(); - this.pdfHistory.pushPage(pageNumber); - } - this.pdfViewer.scrollPageIntoView({ - pageNumber - }); - } - addLinkAttributes(link, url, newWindow = false) { - addLinkAttributes(link, { - url, - target: newWindow ? LinkTarget.BLANK : this.externalLinkTarget, - rel: this.externalLinkRel, - enabled: this.externalLinkEnabled - }); - } - getDestinationHash(dest) { - if (typeof dest === "string") { - if (dest.length > 0) { - return this.getAnchorUrl("#" + escape(dest)); - } - } else if (Array.isArray(dest)) { - const str = JSON.stringify(dest); - if (str.length > 0) { - return this.getAnchorUrl("#" + escape(str)); - } - } - return this.getAnchorUrl(""); - } - getAnchorUrl(anchor) { - return (this.baseUrl || "") + anchor; - } - setHash(hash) { - if (!this.pdfDocument) { - return; - } - let pageNumber, dest; - if (hash.includes("=")) { - const params = (0, _ui_utils.parseQueryString)(hash); - if (params.has("search")) { - this.eventBus.dispatch("findfromurlhash", { - source: this, - query: params.get("search").replace(/"/g, ""), - phraseSearch: params.get("phrase") === "true" - }); - } - if (params.has("page")) { - pageNumber = params.get("page") | 0 || 1; - } - if (params.has("zoom")) { - const zoomArgs = params.get("zoom").split(","); - const zoomArg = zoomArgs[0]; - const zoomArgNumber = parseFloat(zoomArg); - if (!zoomArg.includes("Fit")) { - dest = [null, { - name: "XYZ" - }, zoomArgs.length > 1 ? zoomArgs[1] | 0 : null, zoomArgs.length > 2 ? zoomArgs[2] | 0 : null, zoomArgNumber ? zoomArgNumber / 100 : zoomArg]; - } else { - if (zoomArg === "Fit" || zoomArg === "FitB") { - dest = [null, { - name: zoomArg - }]; - } else if (zoomArg === "FitH" || zoomArg === "FitBH" || zoomArg === "FitV" || zoomArg === "FitBV") { - dest = [null, { - name: zoomArg - }, zoomArgs.length > 1 ? zoomArgs[1] | 0 : null]; - } else if (zoomArg === "FitR") { - if (zoomArgs.length !== 5) { - console.error('PDFLinkService.setHash: Not enough parameters for "FitR".'); - } else { - dest = [null, { - name: zoomArg - }, zoomArgs[1] | 0, zoomArgs[2] | 0, zoomArgs[3] | 0, zoomArgs[4] | 0]; - } - } else { - console.error(`PDFLinkService.setHash: "${zoomArg}" is not a valid zoom value.`); - } - } - } - if (dest) { - this.pdfViewer.scrollPageIntoView({ - pageNumber: pageNumber || this.page, - destArray: dest, - allowNegativeOffset: true - }); - } else if (pageNumber) { - this.page = pageNumber; - } - if (params.has("pagemode")) { - this.eventBus.dispatch("pagemode", { - source: this, - mode: params.get("pagemode") - }); - } - if (params.has("nameddest")) { - this.goToDestination(params.get("nameddest")); - } - } else { - dest = unescape(hash); - try { - dest = JSON.parse(dest); - if (!Array.isArray(dest)) { - dest = dest.toString(); - } - } catch (ex) {} - if (typeof dest === "string" || PDFLinkService.#isValidExplicitDestination(dest)) { - this.goToDestination(dest); - return; - } - console.error(`PDFLinkService.setHash: "${unescape(hash)}" is not a valid destination.`); - } - } - executeNamedAction(action) { - switch (action) { - case "GoBack": - this.pdfHistory?.back(); - break; - case "GoForward": - this.pdfHistory?.forward(); - break; - case "NextPage": - this.pdfViewer.nextPage(); - break; - case "PrevPage": - this.pdfViewer.previousPage(); - break; - case "LastPage": - this.page = this.pagesCount; - break; - case "FirstPage": - this.page = 1; - break; - default: - break; - } - this.eventBus.dispatch("namedaction", { - source: this, - action - }); - } - async executeSetOCGState(action) { - const pdfDocument = this.pdfDocument; - const optionalContentConfig = await this.pdfViewer.optionalContentConfigPromise; - if (pdfDocument !== this.pdfDocument) { - return; - } - let operator; - for (const elem of action.state) { - switch (elem) { - case "ON": - case "OFF": - case "Toggle": - operator = elem; - continue; - } - switch (operator) { - case "ON": - optionalContentConfig.setVisibility(elem, true); - break; - case "OFF": - optionalContentConfig.setVisibility(elem, false); - break; - case "Toggle": - const group = optionalContentConfig.getGroup(elem); - if (group) { - optionalContentConfig.setVisibility(elem, !group.visible); - } - break; - } - } - this.pdfViewer.optionalContentConfigPromise = Promise.resolve(optionalContentConfig); - } - cachePageRef(pageNum, pageRef) { - if (!pageRef) { - return; - } - const refStr = pageRef.gen === 0 ? `${pageRef.num}R` : `${pageRef.num}R${pageRef.gen}`; - this.#pagesRefCache.set(refStr, pageNum); - } - _cachedPageNumber(pageRef) { - if (!pageRef) { - return null; - } - const refStr = pageRef.gen === 0 ? `${pageRef.num}R` : `${pageRef.num}R${pageRef.gen}`; - return this.#pagesRefCache.get(refStr) || null; - } - isPageVisible(pageNumber) { - return this.pdfViewer.isPageVisible(pageNumber); - } - isPageCached(pageNumber) { - return this.pdfViewer.isPageCached(pageNumber); - } - static #isValidExplicitDestination(dest) { - if (!Array.isArray(dest)) { - return false; - } - const destLength = dest.length; - if (destLength < 2) { - return false; - } - const page = dest[0]; - if (!(typeof page === "object" && Number.isInteger(page.num) && Number.isInteger(page.gen)) && !(Number.isInteger(page) && page >= 0)) { - return false; - } - const zoom = dest[1]; - if (!(typeof zoom === "object" && typeof zoom.name === "string")) { - return false; - } - let allowNull = true; - switch (zoom.name) { - case "XYZ": - if (destLength !== 5) { - return false; - } - break; - case "Fit": - case "FitB": - return destLength === 2; - case "FitH": - case "FitBH": - case "FitV": - case "FitBV": - if (destLength !== 3) { - return false; - } - break; - case "FitR": - if (destLength !== 6) { - return false; - } - allowNull = false; - break; - default: - return false; - } - for (let i = 2; i < destLength; i++) { - const param = dest[i]; - if (!(typeof param === "number" || allowNull && param === null)) { - return false; - } - } - return true; - } -} -exports.PDFLinkService = PDFLinkService; -class SimpleLinkService { - constructor() { - this.externalLinkEnabled = true; - } - get pagesCount() { - return 0; - } - get page() { - return 0; - } - set page(value) {} - get rotation() { - return 0; - } - set rotation(value) {} - get isInPresentationMode() { - return false; - } - async goToDestination(dest) {} - goToPage(val) {} - addLinkAttributes(link, url, newWindow = false) { - addLinkAttributes(link, { - url, - enabled: this.externalLinkEnabled - }); - } - getDestinationHash(dest) { - return "#"; - } - getAnchorUrl(hash) { - return "#"; - } - setHash(hash) {} - executeNamedAction(action) {} - executeSetOCGState(action) {} - cachePageRef(pageNum, pageRef) {} - isPageVisible(pageNumber) { - return true; - } - isPageCached(pageNumber) { - return true; - } -} -exports.SimpleLinkService = SimpleLinkService; - -/***/ }), -/* 8 */ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.AnnotationEditorParams = void 0; -var _pdfjsLib = __webpack_require__(4); -class AnnotationEditorParams { - constructor(options, eventBus) { - this.eventBus = eventBus; - this.#bindListeners(options); - } - #bindListeners({ - editorFreeTextFontSize, - editorFreeTextColor, - editorInkColor, - editorInkThickness, - editorInkOpacity - }) { - editorFreeTextFontSize.addEventListener("input", evt => { - this.eventBus.dispatch("switchannotationeditorparams", { - source: this, - type: _pdfjsLib.AnnotationEditorParamsType.FREETEXT_SIZE, - value: editorFreeTextFontSize.valueAsNumber - }); - }); - editorFreeTextColor.addEventListener("input", evt => { - this.eventBus.dispatch("switchannotationeditorparams", { - source: this, - type: _pdfjsLib.AnnotationEditorParamsType.FREETEXT_COLOR, - value: editorFreeTextColor.value - }); - }); - editorInkColor.addEventListener("input", evt => { - this.eventBus.dispatch("switchannotationeditorparams", { - source: this, - type: _pdfjsLib.AnnotationEditorParamsType.INK_COLOR, - value: editorInkColor.value - }); - }); - editorInkThickness.addEventListener("input", evt => { - this.eventBus.dispatch("switchannotationeditorparams", { - source: this, - type: _pdfjsLib.AnnotationEditorParamsType.INK_THICKNESS, - value: editorInkThickness.valueAsNumber - }); - }); - editorInkOpacity.addEventListener("input", evt => { - this.eventBus.dispatch("switchannotationeditorparams", { - source: this, - type: _pdfjsLib.AnnotationEditorParamsType.INK_OPACITY, - value: editorInkOpacity.valueAsNumber - }); - }); - this.eventBus._on("annotationeditorparamschanged", evt => { - for (const [type, value] of evt.details) { - switch (type) { - case _pdfjsLib.AnnotationEditorParamsType.FREETEXT_SIZE: - editorFreeTextFontSize.value = value; - break; - case _pdfjsLib.AnnotationEditorParamsType.FREETEXT_COLOR: - editorFreeTextColor.value = value; - break; - case _pdfjsLib.AnnotationEditorParamsType.INK_COLOR: - editorInkColor.value = value; - break; - case _pdfjsLib.AnnotationEditorParamsType.INK_THICKNESS: - editorInkThickness.value = value; - break; - case _pdfjsLib.AnnotationEditorParamsType.INK_OPACITY: - editorInkOpacity.value = value; - break; - } - } - }); - } -} -exports.AnnotationEditorParams = AnnotationEditorParams; - -/***/ }), -/* 9 */ -/***/ ((__unused_webpack_module, exports) => { - - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.OverlayManager = void 0; -class OverlayManager { - #overlays = new WeakMap(); - #active = null; - get active() { - return this.#active; - } - async register(dialog, canForceClose = false) { - if (typeof dialog !== "object") { - throw new Error("Not enough parameters."); - } else if (this.#overlays.has(dialog)) { - throw new Error("The overlay is already registered."); - } - this.#overlays.set(dialog, { - canForceClose - }); - dialog.addEventListener("cancel", evt => { - this.#active = null; - }); - } - async unregister(dialog) { - if (!this.#overlays.has(dialog)) { - throw new Error("The overlay does not exist."); - } else if (this.#active === dialog) { - throw new Error("The overlay cannot be removed while it is active."); - } - this.#overlays.delete(dialog); - } - async open(dialog) { - if (!this.#overlays.has(dialog)) { - throw new Error("The overlay does not exist."); - } else if (this.#active) { - if (this.#active === dialog) { - throw new Error("The overlay is already active."); - } else if (this.#overlays.get(dialog).canForceClose) { - await this.close(); - } else { - throw new Error("Another overlay is currently active."); - } - } - this.#active = dialog; - dialog.showModal(); - } - async close(dialog = this.#active) { - if (!this.#overlays.has(dialog)) { - throw new Error("The overlay does not exist."); - } else if (!this.#active) { - throw new Error("The overlay is currently not active."); - } else if (this.#active !== dialog) { - throw new Error("Another overlay is currently active."); - } - dialog.close(); - this.#active = null; - } -} -exports.OverlayManager = OverlayManager; - -/***/ }), -/* 10 */ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.PasswordPrompt = void 0; -var _pdfjsLib = __webpack_require__(4); -class PasswordPrompt { - #activeCapability = null; - #updateCallback = null; - #reason = null; - constructor(options, overlayManager, l10n, isViewerEmbedded = false) { - this.dialog = options.dialog; - this.label = options.label; - this.input = options.input; - this.submitButton = options.submitButton; - this.cancelButton = options.cancelButton; - this.overlayManager = overlayManager; - this.l10n = l10n; - this._isViewerEmbedded = isViewerEmbedded; - this.submitButton.addEventListener("click", this.#verify.bind(this)); - this.cancelButton.addEventListener("click", this.close.bind(this)); - this.input.addEventListener("keydown", e => { - if (e.keyCode === 13) { - this.#verify(); - } - }); - this.overlayManager.register(this.dialog, true); - this.dialog.addEventListener("close", this.#cancel.bind(this)); - } - async open() { - if (this.#activeCapability) { - await this.#activeCapability.promise; - } - this.#activeCapability = (0, _pdfjsLib.createPromiseCapability)(); - try { - await this.overlayManager.open(this.dialog); - } catch (ex) { - this.#activeCapability = null; - throw ex; - } - const passwordIncorrect = this.#reason === _pdfjsLib.PasswordResponses.INCORRECT_PASSWORD; - if (!this._isViewerEmbedded || passwordIncorrect) { - this.input.focus(); - } - this.label.textContent = await this.l10n.get(`password_${passwordIncorrect ? "invalid" : "label"}`); - } - async close() { - if (this.overlayManager.active === this.dialog) { - this.overlayManager.close(this.dialog); - } - } - #verify() { - const password = this.input.value; - if (password?.length > 0) { - this.#invokeCallback(password); - } - } - #cancel() { - this.#invokeCallback(new Error("PasswordPrompt cancelled.")); - this.#activeCapability.resolve(); - } - #invokeCallback(password) { - if (!this.#updateCallback) { - return; - } - this.close(); - this.input.value = ""; - this.#updateCallback(password); - this.#updateCallback = null; - } - async setUpdateCallback(updateCallback, reason) { - if (this.#activeCapability) { - await this.#activeCapability.promise; - } - this.#updateCallback = updateCallback; - this.#reason = reason; - } -} -exports.PasswordPrompt = PasswordPrompt; - -/***/ }), -/* 11 */ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.PDFAttachmentViewer = void 0; -var _pdfjsLib = __webpack_require__(4); -var _base_tree_viewer = __webpack_require__(12); -var _event_utils = __webpack_require__(6); -class PDFAttachmentViewer extends _base_tree_viewer.BaseTreeViewer { - constructor(options) { - super(options); - this.downloadManager = options.downloadManager; - this.eventBus._on("fileattachmentannotation", this.#appendAttachment.bind(this)); - } - reset(keepRenderedCapability = false) { - super.reset(); - this._attachments = null; - if (!keepRenderedCapability) { - this._renderedCapability = (0, _pdfjsLib.createPromiseCapability)(); - } - this._pendingDispatchEvent = false; - } - async _dispatchEvent(attachmentsCount) { - this._renderedCapability.resolve(); - if (attachmentsCount === 0 && !this._pendingDispatchEvent) { - this._pendingDispatchEvent = true; - await (0, _event_utils.waitOnEventOrTimeout)({ - target: this.eventBus, - name: "annotationlayerrendered", - delay: 1000 - }); - if (!this._pendingDispatchEvent) { - return; - } - } - this._pendingDispatchEvent = false; - this.eventBus.dispatch("attachmentsloaded", { - source: this, - attachmentsCount - }); - } - _bindLink(element, { - content, - filename - }) { - element.onclick = () => { - this.downloadManager.openOrDownloadData(element, content, filename); - return false; - }; - } - render({ - attachments, - keepRenderedCapability = false - }) { - if (this._attachments) { - this.reset(keepRenderedCapability); - } - this._attachments = attachments || null; - if (!attachments) { - this._dispatchEvent(0); - return; - } - const names = Object.keys(attachments).sort(function (a, b) { - return a.toLowerCase().localeCompare(b.toLowerCase()); - }); - const fragment = document.createDocumentFragment(); - let attachmentsCount = 0; - for (const name of names) { - const item = attachments[name]; - const content = item.content, - filename = (0, _pdfjsLib.getFilenameFromUrl)(item.filename, true); - const div = document.createElement("div"); - div.className = "treeItem"; - const element = document.createElement("a"); - this._bindLink(element, { - content, - filename - }); - element.textContent = this._normalizeTextContent(filename); - div.append(element); - fragment.append(div); - attachmentsCount++; - } - this._finishRendering(fragment, attachmentsCount); - } - #appendAttachment({ - filename, - content - }) { - const renderedPromise = this._renderedCapability.promise; - renderedPromise.then(() => { - if (renderedPromise !== this._renderedCapability.promise) { - return; - } - const attachments = this._attachments || Object.create(null); - for (const name in attachments) { - if (filename === name) { - return; - } - } - attachments[filename] = { - filename, - content - }; - this.render({ - attachments, - keepRenderedCapability: true - }); - }); - } -} -exports.PDFAttachmentViewer = PDFAttachmentViewer; - -/***/ }), -/* 12 */ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.BaseTreeViewer = void 0; -var _ui_utils = __webpack_require__(3); -const TREEITEM_OFFSET_TOP = -100; -const TREEITEM_SELECTED_CLASS = "selected"; -class BaseTreeViewer { - constructor(options) { - if (this.constructor === BaseTreeViewer) { - throw new Error("Cannot initialize BaseTreeViewer."); - } - this.container = options.container; - this.eventBus = options.eventBus; - this.reset(); - } - reset() { - this._pdfDocument = null; - this._lastToggleIsShow = true; - this._currentTreeItem = null; - this.container.textContent = ""; - this.container.classList.remove("treeWithDeepNesting"); - } - _dispatchEvent(count) { - throw new Error("Not implemented: _dispatchEvent"); - } - _bindLink(element, params) { - throw new Error("Not implemented: _bindLink"); - } - _normalizeTextContent(str) { - return (0, _ui_utils.removeNullCharacters)(str, true) || "\u2013"; - } - _addToggleButton(div, hidden = false) { - const toggler = document.createElement("div"); - toggler.className = "treeItemToggler"; - if (hidden) { - toggler.classList.add("treeItemsHidden"); - } - toggler.onclick = evt => { - evt.stopPropagation(); - toggler.classList.toggle("treeItemsHidden"); - if (evt.shiftKey) { - const shouldShowAll = !toggler.classList.contains("treeItemsHidden"); - this._toggleTreeItem(div, shouldShowAll); - } - }; - div.prepend(toggler); - } - _toggleTreeItem(root, show = false) { - this._lastToggleIsShow = show; - for (const toggler of root.querySelectorAll(".treeItemToggler")) { - toggler.classList.toggle("treeItemsHidden", !show); - } - } - _toggleAllTreeItems() { - this._toggleTreeItem(this.container, !this._lastToggleIsShow); - } - _finishRendering(fragment, count, hasAnyNesting = false) { - if (hasAnyNesting) { - this.container.classList.add("treeWithDeepNesting"); - this._lastToggleIsShow = !fragment.querySelector(".treeItemsHidden"); - } - this.container.append(fragment); - this._dispatchEvent(count); - } - render(params) { - throw new Error("Not implemented: render"); - } - _updateCurrentTreeItem(treeItem = null) { - if (this._currentTreeItem) { - this._currentTreeItem.classList.remove(TREEITEM_SELECTED_CLASS); - this._currentTreeItem = null; - } - if (treeItem) { - treeItem.classList.add(TREEITEM_SELECTED_CLASS); - this._currentTreeItem = treeItem; - } - } - _scrollToCurrentTreeItem(treeItem) { - if (!treeItem) { - return; - } - let currentNode = treeItem.parentNode; - while (currentNode && currentNode !== this.container) { - if (currentNode.classList.contains("treeItem")) { - const toggler = currentNode.firstElementChild; - toggler?.classList.remove("treeItemsHidden"); - } - currentNode = currentNode.parentNode; - } - this._updateCurrentTreeItem(treeItem); - this.container.scrollTo(treeItem.offsetLeft, treeItem.offsetTop + TREEITEM_OFFSET_TOP); - } -} -exports.BaseTreeViewer = BaseTreeViewer; - -/***/ }), -/* 13 */ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.PDFCursorTools = void 0; -var _ui_utils = __webpack_require__(3); -var _pdfjsLib = __webpack_require__(4); -var _grab_to_pan = __webpack_require__(14); -class PDFCursorTools { - constructor({ - container, - eventBus, - cursorToolOnLoad = _ui_utils.CursorTool.SELECT - }) { - this.container = container; - this.eventBus = eventBus; - this.active = _ui_utils.CursorTool.SELECT; - this.previouslyActive = null; - this.handTool = new _grab_to_pan.GrabToPan({ - element: this.container - }); - this.#addEventListeners(); - Promise.resolve().then(() => { - this.switchTool(cursorToolOnLoad); - }); - } - get activeTool() { - return this.active; - } - switchTool(tool) { - if (this.previouslyActive !== null) { - return; - } - if (tool === this.active) { - return; - } - const disableActiveTool = () => { - switch (this.active) { - case _ui_utils.CursorTool.SELECT: - break; - case _ui_utils.CursorTool.HAND: - this.handTool.deactivate(); - break; - case _ui_utils.CursorTool.ZOOM: - } - }; - switch (tool) { - case _ui_utils.CursorTool.SELECT: - disableActiveTool(); - break; - case _ui_utils.CursorTool.HAND: - disableActiveTool(); - this.handTool.activate(); - break; - case _ui_utils.CursorTool.ZOOM: - default: - console.error(`switchTool: "${tool}" is an unsupported value.`); - return; - } - this.active = tool; - this.#dispatchEvent(); - } - #dispatchEvent() { - this.eventBus.dispatch("cursortoolchanged", { - source: this, - tool: this.active - }); - } - #addEventListeners() { - this.eventBus._on("switchcursortool", evt => { - this.switchTool(evt.tool); - }); - let annotationEditorMode = _pdfjsLib.AnnotationEditorType.NONE, - presentationModeState = _ui_utils.PresentationModeState.NORMAL; - const disableActive = () => { - const previouslyActive = this.active; - this.switchTool(_ui_utils.CursorTool.SELECT); - this.previouslyActive ??= previouslyActive; - }; - const enableActive = () => { - const previouslyActive = this.previouslyActive; - if (previouslyActive !== null && annotationEditorMode === _pdfjsLib.AnnotationEditorType.NONE && presentationModeState === _ui_utils.PresentationModeState.NORMAL) { - this.previouslyActive = null; - this.switchTool(previouslyActive); - } - }; - this.eventBus._on("secondarytoolbarreset", evt => { - if (this.previouslyActive !== null) { - annotationEditorMode = _pdfjsLib.AnnotationEditorType.NONE; - presentationModeState = _ui_utils.PresentationModeState.NORMAL; - enableActive(); - } - }); - this.eventBus._on("annotationeditormodechanged", ({ - mode - }) => { - annotationEditorMode = mode; - if (mode === _pdfjsLib.AnnotationEditorType.NONE) { - enableActive(); - } else { - disableActive(); - } - }); - this.eventBus._on("presentationmodechanged", ({ - state - }) => { - presentationModeState = state; - if (state === _ui_utils.PresentationModeState.NORMAL) { - enableActive(); - } else if (state === _ui_utils.PresentationModeState.FULLSCREEN) { - disableActive(); - } - }); - } -} -exports.PDFCursorTools = PDFCursorTools; - -/***/ }), -/* 14 */ -/***/ ((__unused_webpack_module, exports) => { - - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.GrabToPan = void 0; -const CSS_CLASS_GRAB = "grab-to-pan-grab"; -class GrabToPan { - constructor(options) { - this.element = options.element; - this.document = options.element.ownerDocument; - if (typeof options.ignoreTarget === "function") { - this.ignoreTarget = options.ignoreTarget; - } - this.onActiveChanged = options.onActiveChanged; - this.activate = this.activate.bind(this); - this.deactivate = this.deactivate.bind(this); - this.toggle = this.toggle.bind(this); - this._onMouseDown = this.#onMouseDown.bind(this); - this._onMouseMove = this.#onMouseMove.bind(this); - this._endPan = this.#endPan.bind(this); - const overlay = this.overlay = document.createElement("div"); - overlay.className = "grab-to-pan-grabbing"; - } - activate() { - if (!this.active) { - this.active = true; - this.element.addEventListener("mousedown", this._onMouseDown, true); - this.element.classList.add(CSS_CLASS_GRAB); - this.onActiveChanged?.(true); - } - } - deactivate() { - if (this.active) { - this.active = false; - this.element.removeEventListener("mousedown", this._onMouseDown, true); - this._endPan(); - this.element.classList.remove(CSS_CLASS_GRAB); - this.onActiveChanged?.(false); - } - } - toggle() { - if (this.active) { - this.deactivate(); - } else { - this.activate(); - } - } - ignoreTarget(node) { - return node.matches("a[href], a[href] *, input, textarea, button, button *, select, option"); - } - #onMouseDown(event) { - if (event.button !== 0 || this.ignoreTarget(event.target)) { - return; - } - if (event.originalTarget) { - try { - event.originalTarget.tagName; - } catch (e) { - return; - } - } - this.scrollLeftStart = this.element.scrollLeft; - this.scrollTopStart = this.element.scrollTop; - this.clientXStart = event.clientX; - this.clientYStart = event.clientY; - this.document.addEventListener("mousemove", this._onMouseMove, true); - this.document.addEventListener("mouseup", this._endPan, true); - this.element.addEventListener("scroll", this._endPan, true); - event.preventDefault(); - event.stopPropagation(); - const focusedElement = document.activeElement; - if (focusedElement && !focusedElement.contains(event.target)) { - focusedElement.blur(); - } - } - #onMouseMove(event) { - this.element.removeEventListener("scroll", this._endPan, true); - if (!(event.buttons & 1)) { - this._endPan(); - return; - } - const xDiff = event.clientX - this.clientXStart; - const yDiff = event.clientY - this.clientYStart; - const scrollTop = this.scrollTopStart - yDiff; - const scrollLeft = this.scrollLeftStart - xDiff; - if (this.element.scrollTo) { - this.element.scrollTo({ - top: scrollTop, - left: scrollLeft, - behavior: "instant" - }); - } else { - this.element.scrollTop = scrollTop; - this.element.scrollLeft = scrollLeft; - } - if (!this.overlay.parentNode) { - document.body.append(this.overlay); - } - } - #endPan() { - this.element.removeEventListener("scroll", this._endPan, true); - this.document.removeEventListener("mousemove", this._onMouseMove, true); - this.document.removeEventListener("mouseup", this._endPan, true); - this.overlay.remove(); - } -} -exports.GrabToPan = GrabToPan; - -/***/ }), -/* 15 */ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.PDFDocumentProperties = void 0; -var _pdfjsLib = __webpack_require__(4); -var _ui_utils = __webpack_require__(3); -const DEFAULT_FIELD_CONTENT = "-"; -const NON_METRIC_LOCALES = ["en-us", "en-lr", "my"]; -const US_PAGE_NAMES = { - "8.5x11": "Letter", - "8.5x14": "Legal" -}; -const METRIC_PAGE_NAMES = { - "297x420": "A3", - "210x297": "A4" -}; -function getPageName(size, isPortrait, pageNames) { - const width = isPortrait ? size.width : size.height; - const height = isPortrait ? size.height : size.width; - return pageNames[`${width}x${height}`]; -} -class PDFDocumentProperties { - #fieldData = null; - constructor({ - dialog, - fields, - closeButton - }, overlayManager, eventBus, l10n, fileNameLookup) { - this.dialog = dialog; - this.fields = fields; - this.overlayManager = overlayManager; - this.l10n = l10n; - this._fileNameLookup = fileNameLookup; - this.#reset(); - closeButton.addEventListener("click", this.close.bind(this)); - this.overlayManager.register(this.dialog); - eventBus._on("pagechanging", evt => { - this._currentPageNumber = evt.pageNumber; - }); - eventBus._on("rotationchanging", evt => { - this._pagesRotation = evt.pagesRotation; - }); - this._isNonMetricLocale = true; - l10n.getLanguage().then(locale => { - this._isNonMetricLocale = NON_METRIC_LOCALES.includes(locale); - }); - } - async open() { - await Promise.all([this.overlayManager.open(this.dialog), this._dataAvailableCapability.promise]); - const currentPageNumber = this._currentPageNumber; - const pagesRotation = this._pagesRotation; - if (this.#fieldData && currentPageNumber === this.#fieldData._currentPageNumber && pagesRotation === this.#fieldData._pagesRotation) { - this.#updateUI(); - return; - } - const { - info, - contentLength - } = await this.pdfDocument.getMetadata(); - const [fileName, fileSize, creationDate, modificationDate, pageSize, isLinearized] = await Promise.all([this._fileNameLookup(), this.#parseFileSize(contentLength), this.#parseDate(info.CreationDate), this.#parseDate(info.ModDate), this.pdfDocument.getPage(currentPageNumber).then(pdfPage => { - return this.#parsePageSize((0, _ui_utils.getPageSizeInches)(pdfPage), pagesRotation); - }), this.#parseLinearization(info.IsLinearized)]); - this.#fieldData = Object.freeze({ - fileName, - fileSize, - title: info.Title, - author: info.Author, - subject: info.Subject, - keywords: info.Keywords, - creationDate, - modificationDate, - creator: info.Creator, - producer: info.Producer, - version: info.PDFFormatVersion, - pageCount: this.pdfDocument.numPages, - pageSize, - linearized: isLinearized, - _currentPageNumber: currentPageNumber, - _pagesRotation: pagesRotation - }); - this.#updateUI(); - const { - length - } = await this.pdfDocument.getDownloadInfo(); - if (contentLength === length) { - return; - } - const data = Object.assign(Object.create(null), this.#fieldData); - data.fileSize = await this.#parseFileSize(length); - this.#fieldData = Object.freeze(data); - this.#updateUI(); - } - async close() { - this.overlayManager.close(this.dialog); - } - setDocument(pdfDocument) { - if (this.pdfDocument) { - this.#reset(); - this.#updateUI(true); - } - if (!pdfDocument) { - return; - } - this.pdfDocument = pdfDocument; - this._dataAvailableCapability.resolve(); - } - #reset() { - this.pdfDocument = null; - this.#fieldData = null; - this._dataAvailableCapability = (0, _pdfjsLib.createPromiseCapability)(); - this._currentPageNumber = 1; - this._pagesRotation = 0; - } - #updateUI(reset = false) { - if (reset || !this.#fieldData) { - for (const id in this.fields) { - this.fields[id].textContent = DEFAULT_FIELD_CONTENT; - } - return; - } - if (this.overlayManager.active !== this.dialog) { - return; - } - for (const id in this.fields) { - const content = this.#fieldData[id]; - this.fields[id].textContent = content || content === 0 ? content : DEFAULT_FIELD_CONTENT; - } - } - async #parseFileSize(fileSize = 0) { - const kb = fileSize / 1024, - mb = kb / 1024; - if (!kb) { - return undefined; - } - return this.l10n.get(`document_properties_${mb >= 1 ? "mb" : "kb"}`, { - size_mb: mb >= 1 && (+mb.toPrecision(3)).toLocaleString(), - size_kb: mb < 1 && (+kb.toPrecision(3)).toLocaleString(), - size_b: fileSize.toLocaleString() - }); - } - async #parsePageSize(pageSizeInches, pagesRotation) { - if (!pageSizeInches) { - return undefined; - } - if (pagesRotation % 180 !== 0) { - pageSizeInches = { - width: pageSizeInches.height, - height: pageSizeInches.width - }; - } - const isPortrait = (0, _ui_utils.isPortraitOrientation)(pageSizeInches); - let sizeInches = { - width: Math.round(pageSizeInches.width * 100) / 100, - height: Math.round(pageSizeInches.height * 100) / 100 - }; - let sizeMillimeters = { - width: Math.round(pageSizeInches.width * 25.4 * 10) / 10, - height: Math.round(pageSizeInches.height * 25.4 * 10) / 10 - }; - let rawName = getPageName(sizeInches, isPortrait, US_PAGE_NAMES) || getPageName(sizeMillimeters, isPortrait, METRIC_PAGE_NAMES); - if (!rawName && !(Number.isInteger(sizeMillimeters.width) && Number.isInteger(sizeMillimeters.height))) { - const exactMillimeters = { - width: pageSizeInches.width * 25.4, - height: pageSizeInches.height * 25.4 - }; - const intMillimeters = { - width: Math.round(sizeMillimeters.width), - height: Math.round(sizeMillimeters.height) - }; - if (Math.abs(exactMillimeters.width - intMillimeters.width) < 0.1 && Math.abs(exactMillimeters.height - intMillimeters.height) < 0.1) { - rawName = getPageName(intMillimeters, isPortrait, METRIC_PAGE_NAMES); - if (rawName) { - sizeInches = { - width: Math.round(intMillimeters.width / 25.4 * 100) / 100, - height: Math.round(intMillimeters.height / 25.4 * 100) / 100 - }; - sizeMillimeters = intMillimeters; - } - } - } - const [{ - width, - height - }, unit, name, orientation] = await Promise.all([this._isNonMetricLocale ? sizeInches : sizeMillimeters, this.l10n.get(`document_properties_page_size_unit_${this._isNonMetricLocale ? "inches" : "millimeters"}`), rawName && this.l10n.get(`document_properties_page_size_name_${rawName.toLowerCase()}`), this.l10n.get(`document_properties_page_size_orientation_${isPortrait ? "portrait" : "landscape"}`)]); - return this.l10n.get(`document_properties_page_size_dimension_${name ? "name_" : ""}string`, { - width: width.toLocaleString(), - height: height.toLocaleString(), - unit, - name, - orientation - }); - } - async #parseDate(inputDate) { - const dateObject = _pdfjsLib.PDFDateString.toDateObject(inputDate); - if (!dateObject) { - return undefined; - } - return this.l10n.get("document_properties_date_string", { - date: dateObject.toLocaleDateString(), - time: dateObject.toLocaleTimeString() - }); - } - #parseLinearization(isLinearized) { - return this.l10n.get(`document_properties_linearized_${isLinearized ? "yes" : "no"}`); - } -} -exports.PDFDocumentProperties = PDFDocumentProperties; - -/***/ }), -/* 16 */ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.PDFFindBar = void 0; -var _pdf_find_controller = __webpack_require__(17); -const MATCHES_COUNT_LIMIT = 1000; -class PDFFindBar { - constructor(options, eventBus, l10n) { - this.opened = false; - this.bar = options.bar; - this.toggleButton = options.toggleButton; - this.findField = options.findField; - this.highlightAll = options.highlightAllCheckbox; - this.caseSensitive = options.caseSensitiveCheckbox; - this.matchDiacritics = options.matchDiacriticsCheckbox; - this.entireWord = options.entireWordCheckbox; - this.findMsg = options.findMsg; - this.findResultsCount = options.findResultsCount; - this.findPreviousButton = options.findPreviousButton; - this.findNextButton = options.findNextButton; - this.eventBus = eventBus; - this.l10n = l10n; - this.toggleButton.addEventListener("click", () => { - this.toggle(); - }); - this.findField.addEventListener("input", () => { - this.dispatchEvent(""); - }); - this.bar.addEventListener("keydown", e => { - switch (e.keyCode) { - case 13: - if (e.target === this.findField) { - this.dispatchEvent("again", e.shiftKey); - } - break; - case 27: - this.close(); - break; - } - }); - this.findPreviousButton.addEventListener("click", () => { - this.dispatchEvent("again", true); - }); - this.findNextButton.addEventListener("click", () => { - this.dispatchEvent("again", false); - }); - this.highlightAll.addEventListener("click", () => { - this.dispatchEvent("highlightallchange"); - }); - this.caseSensitive.addEventListener("click", () => { - this.dispatchEvent("casesensitivitychange"); - }); - this.entireWord.addEventListener("click", () => { - this.dispatchEvent("entirewordchange"); - }); - this.matchDiacritics.addEventListener("click", () => { - this.dispatchEvent("diacriticmatchingchange"); - }); - this.eventBus._on("resize", this.#adjustWidth.bind(this)); - } - reset() { - this.updateUIState(); - } - dispatchEvent(type, findPrev = false) { - this.eventBus.dispatch("find", { - source: this, - type, - query: this.findField.value, - phraseSearch: true, - caseSensitive: this.caseSensitive.checked, - entireWord: this.entireWord.checked, - highlightAll: this.highlightAll.checked, - findPrevious: findPrev, - matchDiacritics: this.matchDiacritics.checked - }); - } - updateUIState(state, previous, matchesCount) { - let findMsg = Promise.resolve(""); - let status = ""; - switch (state) { - case _pdf_find_controller.FindState.FOUND: - break; - case _pdf_find_controller.FindState.PENDING: - status = "pending"; - break; - case _pdf_find_controller.FindState.NOT_FOUND: - findMsg = this.l10n.get("find_not_found"); - status = "notFound"; - break; - case _pdf_find_controller.FindState.WRAPPED: - findMsg = this.l10n.get(`find_reached_${previous ? "top" : "bottom"}`); - break; - } - this.findField.setAttribute("data-status", status); - this.findField.setAttribute("aria-invalid", state === _pdf_find_controller.FindState.NOT_FOUND); - findMsg.then(msg => { - this.findMsg.textContent = msg; - this.#adjustWidth(); - }); - this.updateResultsCount(matchesCount); - } - updateResultsCount({ - current = 0, - total = 0 - } = {}) { - const limit = MATCHES_COUNT_LIMIT; - let matchCountMsg = Promise.resolve(""); - if (total > 0) { - if (total > limit) { - let key = "find_match_count_limit"; - matchCountMsg = this.l10n.get(key, { - limit - }); - } else { - let key = "find_match_count"; - matchCountMsg = this.l10n.get(key, { - current, - total - }); - } - } - matchCountMsg.then(msg => { - this.findResultsCount.textContent = msg; - this.#adjustWidth(); - }); - } - open() { - if (!this.opened) { - this.opened = true; - this.toggleButton.classList.add("toggled"); - this.toggleButton.setAttribute("aria-expanded", "true"); - this.bar.classList.remove("hidden"); - } - this.findField.select(); - this.findField.focus(); - this.#adjustWidth(); - } - close() { - if (!this.opened) { - return; - } - this.opened = false; - this.toggleButton.classList.remove("toggled"); - this.toggleButton.setAttribute("aria-expanded", "false"); - this.bar.classList.add("hidden"); - this.eventBus.dispatch("findbarclose", { - source: this - }); - } - toggle() { - if (this.opened) { - this.close(); - } else { - this.open(); - } - } - #adjustWidth() { - if (!this.opened) { - return; - } - this.bar.classList.remove("wrapContainers"); - const findbarHeight = this.bar.clientHeight; - const inputContainerHeight = this.bar.firstElementChild.clientHeight; - if (findbarHeight > inputContainerHeight) { - this.bar.classList.add("wrapContainers"); - } - } -} -exports.PDFFindBar = PDFFindBar; - -/***/ }), -/* 17 */ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.PDFFindController = exports.FindState = void 0; -var _ui_utils = __webpack_require__(3); -var _pdfjsLib = __webpack_require__(4); -var _pdf_find_utils = __webpack_require__(18); -const FindState = { - FOUND: 0, - NOT_FOUND: 1, - WRAPPED: 2, - PENDING: 3 -}; -exports.FindState = FindState; -const FIND_TIMEOUT = 250; -const MATCH_SCROLL_OFFSET_TOP = -50; -const MATCH_SCROLL_OFFSET_LEFT = -400; -const CHARACTERS_TO_NORMALIZE = { - "\u2010": "-", - "\u2018": "'", - "\u2019": "'", - "\u201A": "'", - "\u201B": "'", - "\u201C": '"', - "\u201D": '"', - "\u201E": '"', - "\u201F": '"', - "\u00BC": "1/4", - "\u00BD": "1/2", - "\u00BE": "3/4" -}; -const DIACRITICS_EXCEPTION = new Set([0x3099, 0x309a, 0x094d, 0x09cd, 0x0a4d, 0x0acd, 0x0b4d, 0x0bcd, 0x0c4d, 0x0ccd, 0x0d3b, 0x0d3c, 0x0d4d, 0x0dca, 0x0e3a, 0x0eba, 0x0f84, 0x1039, 0x103a, 0x1714, 0x1734, 0x17d2, 0x1a60, 0x1b44, 0x1baa, 0x1bab, 0x1bf2, 0x1bf3, 0x2d7f, 0xa806, 0xa82c, 0xa8c4, 0xa953, 0xa9c0, 0xaaf6, 0xabed, 0x0c56, 0x0f71, 0x0f72, 0x0f7a, 0x0f7b, 0x0f7c, 0x0f7d, 0x0f80, 0x0f74]); -let DIACRITICS_EXCEPTION_STR; -const DIACRITICS_REG_EXP = /\p{M}+/gu; -const SPECIAL_CHARS_REG_EXP = /([.*+?^${}()|[\]\\])|(\p{P})|(\s+)|(\p{M})|(\p{L})/gu; -const NOT_DIACRITIC_FROM_END_REG_EXP = /([^\p{M}])\p{M}*$/u; -const NOT_DIACRITIC_FROM_START_REG_EXP = /^\p{M}*([^\p{M}])/u; -const SYLLABLES_REG_EXP = /[\uAC00-\uD7AF\uFA6C\uFACF-\uFAD1\uFAD5-\uFAD7]+/g; -const SYLLABLES_LENGTHS = new Map(); -const FIRST_CHAR_SYLLABLES_REG_EXP = "[\\u1100-\\u1112\\ud7a4-\\ud7af\\ud84a\\ud84c\\ud850\\ud854\\ud857\\ud85f]"; -const NFKC_CHARS_TO_NORMALIZE = new Map(); -let noSyllablesRegExp = null; -let withSyllablesRegExp = null; -function normalize(text) { - const syllablePositions = []; - let m; - while ((m = SYLLABLES_REG_EXP.exec(text)) !== null) { - let { - index - } = m; - for (const char of m[0]) { - let len = SYLLABLES_LENGTHS.get(char); - if (!len) { - len = char.normalize("NFD").length; - SYLLABLES_LENGTHS.set(char, len); - } - syllablePositions.push([len, index++]); - } - } - let normalizationRegex; - if (syllablePositions.length === 0 && noSyllablesRegExp) { - normalizationRegex = noSyllablesRegExp; - } else if (syllablePositions.length > 0 && withSyllablesRegExp) { - normalizationRegex = withSyllablesRegExp; - } else { - const replace = Object.keys(CHARACTERS_TO_NORMALIZE).join(""); - const toNormalizeWithNFKC = "\u2460-\u2473" + "\u24b6-\u24ff" + "\u3244-\u32bf" + "\u32d0-\u32fe" + "\uff00-\uffef"; - const CJK = "(?:\\p{Ideographic}|[\u3040-\u30FF])"; - const HKDiacritics = "(?:\u3099|\u309A)"; - const regexp = `([${replace}])|([${toNormalizeWithNFKC}])|(${HKDiacritics}\\n)|(\\p{M}+(?:-\\n)?)|(\\S-\\n)|(${CJK}\\n)|(\\n)`; - if (syllablePositions.length === 0) { - normalizationRegex = noSyllablesRegExp = new RegExp(regexp + "|(\\u0000)", "gum"); - } else { - normalizationRegex = withSyllablesRegExp = new RegExp(regexp + `|(${FIRST_CHAR_SYLLABLES_REG_EXP})`, "gum"); - } - } - const rawDiacriticsPositions = []; - while ((m = DIACRITICS_REG_EXP.exec(text)) !== null) { - rawDiacriticsPositions.push([m[0].length, m.index]); - } - let normalized = text.normalize("NFD"); - const positions = [[0, 0]]; - let rawDiacriticsIndex = 0; - let syllableIndex = 0; - let shift = 0; - let shiftOrigin = 0; - let eol = 0; - let hasDiacritics = false; - normalized = normalized.replace(normalizationRegex, (match, p1, p2, p3, p4, p5, p6, p7, p8, i) => { - i -= shiftOrigin; - if (p1) { - const replacement = CHARACTERS_TO_NORMALIZE[p1]; - const jj = replacement.length; - for (let j = 1; j < jj; j++) { - positions.push([i - shift + j, shift - j]); - } - shift -= jj - 1; - return replacement; - } - if (p2) { - let replacement = NFKC_CHARS_TO_NORMALIZE.get(p2); - if (!replacement) { - replacement = p2.normalize("NFKC"); - NFKC_CHARS_TO_NORMALIZE.set(p2, replacement); - } - const jj = replacement.length; - for (let j = 1; j < jj; j++) { - positions.push([i - shift + j, shift - j]); - } - shift -= jj - 1; - return replacement; - } - if (p3) { - hasDiacritics = true; - if (i + eol === rawDiacriticsPositions[rawDiacriticsIndex]?.[1]) { - ++rawDiacriticsIndex; - } else { - positions.push([i - 1 - shift + 1, shift - 1]); - shift -= 1; - shiftOrigin += 1; - } - positions.push([i - shift + 1, shift]); - shiftOrigin += 1; - eol += 1; - return p3.charAt(0); - } - if (p4) { - const hasTrailingDashEOL = p4.endsWith("\n"); - const len = hasTrailingDashEOL ? p4.length - 2 : p4.length; - hasDiacritics = true; - let jj = len; - if (i + eol === rawDiacriticsPositions[rawDiacriticsIndex]?.[1]) { - jj -= rawDiacriticsPositions[rawDiacriticsIndex][0]; - ++rawDiacriticsIndex; - } - for (let j = 1; j <= jj; j++) { - positions.push([i - 1 - shift + j, shift - j]); - } - shift -= jj; - shiftOrigin += jj; - if (hasTrailingDashEOL) { - i += len - 1; - positions.push([i - shift + 1, 1 + shift]); - shift += 1; - shiftOrigin += 1; - eol += 1; - return p4.slice(0, len); - } - return p4; - } - if (p5) { - positions.push([i - shift + 1, 1 + shift]); - shift += 1; - shiftOrigin += 1; - eol += 1; - return p5.charAt(0); - } - if (p6) { - positions.push([i - shift + 1, shift]); - shiftOrigin += 1; - eol += 1; - return p6.charAt(0); - } - if (p7) { - positions.push([i - shift + 1, shift - 1]); - shift -= 1; - shiftOrigin += 1; - eol += 1; - return " "; - } - if (i + eol === syllablePositions[syllableIndex]?.[1]) { - const newCharLen = syllablePositions[syllableIndex][0] - 1; - ++syllableIndex; - for (let j = 1; j <= newCharLen; j++) { - positions.push([i - (shift - j), shift - j]); - } - shift -= newCharLen; - shiftOrigin += newCharLen; - } - return p8; - }); - positions.push([normalized.length, shift]); - return [normalized, positions, hasDiacritics]; -} -function getOriginalIndex(diffs, pos, len) { - if (!diffs) { - return [pos, len]; - } - const start = pos; - const end = pos + len; - let i = (0, _ui_utils.binarySearchFirstItem)(diffs, x => x[0] >= start); - if (diffs[i][0] > start) { - --i; - } - let j = (0, _ui_utils.binarySearchFirstItem)(diffs, x => x[0] >= end, i); - if (diffs[j][0] > end) { - --j; - } - return [start + diffs[i][1], len + diffs[j][1] - diffs[i][1]]; -} -class PDFFindController { - #updateMatchesCountOnProgress = true; - #visitedPagesCount = 0; - constructor({ - linkService, - eventBus, - updateMatchesCountOnProgress = true - }) { - this._linkService = linkService; - this._eventBus = eventBus; - this.#updateMatchesCountOnProgress = updateMatchesCountOnProgress; - this.#reset(); - eventBus._on("find", this.#onFind.bind(this)); - eventBus._on("findbarclose", this.#onFindBarClose.bind(this)); - } - get highlightMatches() { - return this._highlightMatches; - } - get pageMatches() { - return this._pageMatches; - } - get pageMatchesLength() { - return this._pageMatchesLength; - } - get selected() { - return this._selected; - } - get state() { - return this._state; - } - setDocument(pdfDocument) { - if (this._pdfDocument) { - this.#reset(); - } - if (!pdfDocument) { - return; - } - this._pdfDocument = pdfDocument; - this._firstPageCapability.resolve(); - } - #onFind(state) { - if (!state) { - return; - } - const pdfDocument = this._pdfDocument; - const { - type - } = state; - if (this._state === null || this.#shouldDirtyMatch(state)) { - this._dirtyMatch = true; - } - this._state = state; - if (type !== "highlightallchange") { - this.#updateUIState(FindState.PENDING); - } - this._firstPageCapability.promise.then(() => { - if (!this._pdfDocument || pdfDocument && this._pdfDocument !== pdfDocument) { - return; - } - this.#extractText(); - const findbarClosed = !this._highlightMatches; - const pendingTimeout = !!this._findTimeout; - if (this._findTimeout) { - clearTimeout(this._findTimeout); - this._findTimeout = null; - } - if (!type) { - this._findTimeout = setTimeout(() => { - this.#nextMatch(); - this._findTimeout = null; - }, FIND_TIMEOUT); - } else if (this._dirtyMatch) { - this.#nextMatch(); - } else if (type === "again") { - this.#nextMatch(); - if (findbarClosed && this._state.highlightAll) { - this.#updateAllPages(); - } - } else if (type === "highlightallchange") { - if (pendingTimeout) { - this.#nextMatch(); - } else { - this._highlightMatches = true; - } - this.#updateAllPages(); - } else { - this.#nextMatch(); - } - }); - } - scrollMatchIntoView({ - element = null, - selectedLeft = 0, - pageIndex = -1, - matchIndex = -1 - }) { - if (!this._scrollMatches || !element) { - return; - } else if (matchIndex === -1 || matchIndex !== this._selected.matchIdx) { - return; - } else if (pageIndex === -1 || pageIndex !== this._selected.pageIdx) { - return; - } - this._scrollMatches = false; - const spot = { - top: MATCH_SCROLL_OFFSET_TOP, - left: selectedLeft + MATCH_SCROLL_OFFSET_LEFT - }; - (0, _ui_utils.scrollIntoView)(element, spot, true); - } - #reset() { - this._highlightMatches = false; - this._scrollMatches = false; - this._pdfDocument = null; - this._pageMatches = []; - this._pageMatchesLength = []; - this.#visitedPagesCount = 0; - this._state = null; - this._selected = { - pageIdx: -1, - matchIdx: -1 - }; - this._offset = { - pageIdx: null, - matchIdx: null, - wrapped: false - }; - this._extractTextPromises = []; - this._pageContents = []; - this._pageDiffs = []; - this._hasDiacritics = []; - this._matchesCountTotal = 0; - this._pagesToSearch = null; - this._pendingFindMatches = new Set(); - this._resumePageIdx = null; - this._dirtyMatch = false; - clearTimeout(this._findTimeout); - this._findTimeout = null; - this._firstPageCapability = (0, _pdfjsLib.createPromiseCapability)(); - } - get #query() { - if (this._state.query !== this._rawQuery) { - this._rawQuery = this._state.query; - [this._normalizedQuery] = normalize(this._state.query); - } - return this._normalizedQuery; - } - #shouldDirtyMatch(state) { - if (state.query !== this._state.query) { - return true; - } - switch (state.type) { - case "again": - const pageNumber = this._selected.pageIdx + 1; - const linkService = this._linkService; - if (pageNumber >= 1 && pageNumber <= linkService.pagesCount && pageNumber !== linkService.page && !linkService.isPageVisible(pageNumber)) { - return true; - } - return false; - case "highlightallchange": - return false; - } - return true; - } - #isEntireWord(content, startIdx, length) { - let match = content.slice(0, startIdx).match(NOT_DIACRITIC_FROM_END_REG_EXP); - if (match) { - const first = content.charCodeAt(startIdx); - const limit = match[1].charCodeAt(0); - if ((0, _pdf_find_utils.getCharacterType)(first) === (0, _pdf_find_utils.getCharacterType)(limit)) { - return false; - } - } - match = content.slice(startIdx + length).match(NOT_DIACRITIC_FROM_START_REG_EXP); - if (match) { - const last = content.charCodeAt(startIdx + length - 1); - const limit = match[1].charCodeAt(0); - if ((0, _pdf_find_utils.getCharacterType)(last) === (0, _pdf_find_utils.getCharacterType)(limit)) { - return false; - } - } - return true; - } - #calculateRegExpMatch(query, entireWord, pageIndex, pageContent) { - const matches = this._pageMatches[pageIndex] = []; - const matchesLength = this._pageMatchesLength[pageIndex] = []; - if (!query) { - return; - } - const diffs = this._pageDiffs[pageIndex]; - let match; - while ((match = query.exec(pageContent)) !== null) { - if (entireWord && !this.#isEntireWord(pageContent, match.index, match[0].length)) { - continue; - } - const [matchPos, matchLen] = getOriginalIndex(diffs, match.index, match[0].length); - if (matchLen) { - matches.push(matchPos); - matchesLength.push(matchLen); - } - } - } - #convertToRegExpString(query, hasDiacritics) { - const { - matchDiacritics - } = this._state; - let isUnicode = false; - query = query.replace(SPECIAL_CHARS_REG_EXP, (match, p1, p2, p3, p4, p5) => { - if (p1) { - return `[ ]*\\${p1}[ ]*`; - } - if (p2) { - return `[ ]*${p2}[ ]*`; - } - if (p3) { - return "[ ]+"; - } - if (matchDiacritics) { - return p4 || p5; - } - if (p4) { - return DIACRITICS_EXCEPTION.has(p4.charCodeAt(0)) ? p4 : ""; - } - if (hasDiacritics) { - isUnicode = true; - return `${p5}\\p{M}*`; - } - return p5; - }); - const trailingSpaces = "[ ]*"; - if (query.endsWith(trailingSpaces)) { - query = query.slice(0, query.length - trailingSpaces.length); - } - if (matchDiacritics) { - if (hasDiacritics) { - DIACRITICS_EXCEPTION_STR ||= String.fromCharCode(...DIACRITICS_EXCEPTION); - isUnicode = true; - query = `${query}(?=[${DIACRITICS_EXCEPTION_STR}]|[^\\p{M}]|$)`; - } - } - return [isUnicode, query]; - } - #calculateMatch(pageIndex) { - let query = this.#query; - if (!query) { - return; - } - const { - caseSensitive, - entireWord, - phraseSearch - } = this._state; - const pageContent = this._pageContents[pageIndex]; - const hasDiacritics = this._hasDiacritics[pageIndex]; - let isUnicode = false; - if (phraseSearch) { - [isUnicode, query] = this.#convertToRegExpString(query, hasDiacritics); - } else { - const match = query.match(/\S+/g); - if (match) { - query = match.sort().reverse().map(q => { - const [isUnicodePart, queryPart] = this.#convertToRegExpString(q, hasDiacritics); - isUnicode ||= isUnicodePart; - return `(${queryPart})`; - }).join("|"); - } - } - const flags = `g${isUnicode ? "u" : ""}${caseSensitive ? "" : "i"}`; - query = query ? new RegExp(query, flags) : null; - this.#calculateRegExpMatch(query, entireWord, pageIndex, pageContent); - if (this._state.highlightAll) { - this.#updatePage(pageIndex); - } - if (this._resumePageIdx === pageIndex) { - this._resumePageIdx = null; - this.#nextPageMatch(); - } - const pageMatchesCount = this._pageMatches[pageIndex].length; - this._matchesCountTotal += pageMatchesCount; - if (this.#updateMatchesCountOnProgress) { - if (pageMatchesCount > 0) { - this.#updateUIResultsCount(); - } - } else if (++this.#visitedPagesCount === this._linkService.pagesCount) { - this.#updateUIResultsCount(); - } - } - #extractText() { - if (this._extractTextPromises.length > 0) { - return; - } - let promise = Promise.resolve(); - for (let i = 0, ii = this._linkService.pagesCount; i < ii; i++) { - const extractTextCapability = (0, _pdfjsLib.createPromiseCapability)(); - this._extractTextPromises[i] = extractTextCapability.promise; - promise = promise.then(() => { - return this._pdfDocument.getPage(i + 1).then(pdfPage => { - return pdfPage.getTextContent(); - }).then(textContent => { - const strBuf = []; - for (const textItem of textContent.items) { - strBuf.push(textItem.str); - if (textItem.hasEOL) { - strBuf.push("\n"); - } - } - [this._pageContents[i], this._pageDiffs[i], this._hasDiacritics[i]] = normalize(strBuf.join("")); - extractTextCapability.resolve(); - }, reason => { - console.error(`Unable to get text content for page ${i + 1}`, reason); - this._pageContents[i] = ""; - this._pageDiffs[i] = null; - this._hasDiacritics[i] = false; - extractTextCapability.resolve(); - }); - }); - } - } - #updatePage(index) { - if (this._scrollMatches && this._selected.pageIdx === index) { - this._linkService.page = index + 1; - } - this._eventBus.dispatch("updatetextlayermatches", { - source: this, - pageIndex: index - }); - } - #updateAllPages() { - this._eventBus.dispatch("updatetextlayermatches", { - source: this, - pageIndex: -1 - }); - } - #nextMatch() { - const previous = this._state.findPrevious; - const currentPageIndex = this._linkService.page - 1; - const numPages = this._linkService.pagesCount; - this._highlightMatches = true; - if (this._dirtyMatch) { - this._dirtyMatch = false; - this._selected.pageIdx = this._selected.matchIdx = -1; - this._offset.pageIdx = currentPageIndex; - this._offset.matchIdx = null; - this._offset.wrapped = false; - this._resumePageIdx = null; - this._pageMatches.length = 0; - this._pageMatchesLength.length = 0; - this.#visitedPagesCount = 0; - this._matchesCountTotal = 0; - this.#updateAllPages(); - for (let i = 0; i < numPages; i++) { - if (this._pendingFindMatches.has(i)) { - continue; - } - this._pendingFindMatches.add(i); - this._extractTextPromises[i].then(() => { - this._pendingFindMatches.delete(i); - this.#calculateMatch(i); - }); - } - } - if (!this.#query) { - this.#updateUIState(FindState.FOUND); - return; - } - if (this._resumePageIdx) { - return; - } - const offset = this._offset; - this._pagesToSearch = numPages; - if (offset.matchIdx !== null) { - const numPageMatches = this._pageMatches[offset.pageIdx].length; - if (!previous && offset.matchIdx + 1 < numPageMatches || previous && offset.matchIdx > 0) { - offset.matchIdx = previous ? offset.matchIdx - 1 : offset.matchIdx + 1; - this.#updateMatch(true); - return; - } - this.#advanceOffsetPage(previous); - } - this.#nextPageMatch(); - } - #matchesReady(matches) { - const offset = this._offset; - const numMatches = matches.length; - const previous = this._state.findPrevious; - if (numMatches) { - offset.matchIdx = previous ? numMatches - 1 : 0; - this.#updateMatch(true); - return true; - } - this.#advanceOffsetPage(previous); - if (offset.wrapped) { - offset.matchIdx = null; - if (this._pagesToSearch < 0) { - this.#updateMatch(false); - return true; - } - } - return false; - } - #nextPageMatch() { - if (this._resumePageIdx !== null) { - console.error("There can only be one pending page."); - } - let matches = null; - do { - const pageIdx = this._offset.pageIdx; - matches = this._pageMatches[pageIdx]; - if (!matches) { - this._resumePageIdx = pageIdx; - break; - } - } while (!this.#matchesReady(matches)); - } - #advanceOffsetPage(previous) { - const offset = this._offset; - const numPages = this._linkService.pagesCount; - offset.pageIdx = previous ? offset.pageIdx - 1 : offset.pageIdx + 1; - offset.matchIdx = null; - this._pagesToSearch--; - if (offset.pageIdx >= numPages || offset.pageIdx < 0) { - offset.pageIdx = previous ? numPages - 1 : 0; - offset.wrapped = true; - } - } - #updateMatch(found = false) { - let state = FindState.NOT_FOUND; - const wrapped = this._offset.wrapped; - this._offset.wrapped = false; - if (found) { - const previousPage = this._selected.pageIdx; - this._selected.pageIdx = this._offset.pageIdx; - this._selected.matchIdx = this._offset.matchIdx; - state = wrapped ? FindState.WRAPPED : FindState.FOUND; - if (previousPage !== -1 && previousPage !== this._selected.pageIdx) { - this.#updatePage(previousPage); - } - } - this.#updateUIState(state, this._state.findPrevious); - if (this._selected.pageIdx !== -1) { - this._scrollMatches = true; - this.#updatePage(this._selected.pageIdx); - } - } - #onFindBarClose(evt) { - const pdfDocument = this._pdfDocument; - this._firstPageCapability.promise.then(() => { - if (!this._pdfDocument || pdfDocument && this._pdfDocument !== pdfDocument) { - return; - } - if (this._findTimeout) { - clearTimeout(this._findTimeout); - this._findTimeout = null; - } - if (this._resumePageIdx) { - this._resumePageIdx = null; - this._dirtyMatch = true; - } - this.#updateUIState(FindState.FOUND); - this._highlightMatches = false; - this.#updateAllPages(); - }); - } - #requestMatchesCount() { - const { - pageIdx, - matchIdx - } = this._selected; - let current = 0, - total = this._matchesCountTotal; - if (matchIdx !== -1) { - for (let i = 0; i < pageIdx; i++) { - current += this._pageMatches[i]?.length || 0; - } - current += matchIdx + 1; - } - if (current < 1 || current > total) { - current = total = 0; - } - return { - current, - total - }; - } - #updateUIResultsCount() { - this._eventBus.dispatch("updatefindmatchescount", { - source: this, - matchesCount: this.#requestMatchesCount() - }); - } - #updateUIState(state, previous = false) { - if (!this.#updateMatchesCountOnProgress && (this.#visitedPagesCount !== this._linkService.pagesCount || state === FindState.PENDING)) { - return; - } - this._eventBus.dispatch("updatefindcontrolstate", { - source: this, - state, - previous, - matchesCount: this.#requestMatchesCount(), - rawQuery: this._state?.query ?? null - }); - } -} -exports.PDFFindController = PDFFindController; - -/***/ }), -/* 18 */ -/***/ ((__unused_webpack_module, exports) => { - - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.CharacterType = void 0; -exports.getCharacterType = getCharacterType; -const CharacterType = { - SPACE: 0, - ALPHA_LETTER: 1, - PUNCT: 2, - HAN_LETTER: 3, - KATAKANA_LETTER: 4, - HIRAGANA_LETTER: 5, - HALFWIDTH_KATAKANA_LETTER: 6, - THAI_LETTER: 7 -}; -exports.CharacterType = CharacterType; -function isAlphabeticalScript(charCode) { - return charCode < 0x2e80; -} -function isAscii(charCode) { - return (charCode & 0xff80) === 0; -} -function isAsciiAlpha(charCode) { - return charCode >= 0x61 && charCode <= 0x7a || charCode >= 0x41 && charCode <= 0x5a; -} -function isAsciiDigit(charCode) { - return charCode >= 0x30 && charCode <= 0x39; -} -function isAsciiSpace(charCode) { - return charCode === 0x20 || charCode === 0x09 || charCode === 0x0d || charCode === 0x0a; -} -function isHan(charCode) { - return charCode >= 0x3400 && charCode <= 0x9fff || charCode >= 0xf900 && charCode <= 0xfaff; -} -function isKatakana(charCode) { - return charCode >= 0x30a0 && charCode <= 0x30ff; -} -function isHiragana(charCode) { - return charCode >= 0x3040 && charCode <= 0x309f; -} -function isHalfwidthKatakana(charCode) { - return charCode >= 0xff60 && charCode <= 0xff9f; -} -function isThai(charCode) { - return (charCode & 0xff80) === 0x0e00; -} -function getCharacterType(charCode) { - if (isAlphabeticalScript(charCode)) { - if (isAscii(charCode)) { - if (isAsciiSpace(charCode)) { - return CharacterType.SPACE; - } else if (isAsciiAlpha(charCode) || isAsciiDigit(charCode) || charCode === 0x5f) { - return CharacterType.ALPHA_LETTER; - } - return CharacterType.PUNCT; - } else if (isThai(charCode)) { - return CharacterType.THAI_LETTER; - } else if (charCode === 0xa0) { - return CharacterType.SPACE; - } - return CharacterType.ALPHA_LETTER; - } - if (isHan(charCode)) { - return CharacterType.HAN_LETTER; - } else if (isKatakana(charCode)) { - return CharacterType.KATAKANA_LETTER; - } else if (isHiragana(charCode)) { - return CharacterType.HIRAGANA_LETTER; - } else if (isHalfwidthKatakana(charCode)) { - return CharacterType.HALFWIDTH_KATAKANA_LETTER; - } - return CharacterType.ALPHA_LETTER; -} - -/***/ }), -/* 19 */ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.PDFHistory = void 0; -exports.isDestArraysEqual = isDestArraysEqual; -exports.isDestHashesEqual = isDestHashesEqual; -var _ui_utils = __webpack_require__(3); -var _event_utils = __webpack_require__(6); -const HASH_CHANGE_TIMEOUT = 1000; -const POSITION_UPDATED_THRESHOLD = 50; -const UPDATE_VIEWAREA_TIMEOUT = 1000; -function getCurrentHash() { - return document.location.hash; -} -class PDFHistory { - constructor({ - linkService, - eventBus - }) { - this.linkService = linkService; - this.eventBus = eventBus; - this._initialized = false; - this._fingerprint = ""; - this.reset(); - this._boundEvents = null; - this.eventBus._on("pagesinit", () => { - this._isPagesLoaded = false; - this.eventBus._on("pagesloaded", evt => { - this._isPagesLoaded = !!evt.pagesCount; - }, { - once: true - }); - }); - } - initialize({ - fingerprint, - resetHistory = false, - updateUrl = false - }) { - if (!fingerprint || typeof fingerprint !== "string") { - console.error('PDFHistory.initialize: The "fingerprint" must be a non-empty string.'); - return; - } - if (this._initialized) { - this.reset(); - } - const reInitialized = this._fingerprint !== "" && this._fingerprint !== fingerprint; - this._fingerprint = fingerprint; - this._updateUrl = updateUrl === true; - this._initialized = true; - this._bindEvents(); - const state = window.history.state; - this._popStateInProgress = false; - this._blockHashChange = 0; - this._currentHash = getCurrentHash(); - this._numPositionUpdates = 0; - this._uid = this._maxUid = 0; - this._destination = null; - this._position = null; - if (!this._isValidState(state, true) || resetHistory) { - const { - hash, - page, - rotation - } = this._parseCurrentHash(true); - if (!hash || reInitialized || resetHistory) { - this._pushOrReplaceState(null, true); - return; - } - this._pushOrReplaceState({ - hash, - page, - rotation - }, true); - return; - } - const destination = state.destination; - this._updateInternalState(destination, state.uid, true); - if (destination.rotation !== undefined) { - this._initialRotation = destination.rotation; - } - if (destination.dest) { - this._initialBookmark = JSON.stringify(destination.dest); - this._destination.page = null; - } else if (destination.hash) { - this._initialBookmark = destination.hash; - } else if (destination.page) { - this._initialBookmark = `page=${destination.page}`; - } - } - reset() { - if (this._initialized) { - this._pageHide(); - this._initialized = false; - this._unbindEvents(); - } - if (this._updateViewareaTimeout) { - clearTimeout(this._updateViewareaTimeout); - this._updateViewareaTimeout = null; - } - this._initialBookmark = null; - this._initialRotation = null; - } - push({ - namedDest = null, - explicitDest, - pageNumber - }) { - if (!this._initialized) { - return; - } - if (namedDest && typeof namedDest !== "string") { - console.error("PDFHistory.push: " + `"${namedDest}" is not a valid namedDest parameter.`); - return; - } else if (!Array.isArray(explicitDest)) { - console.error("PDFHistory.push: " + `"${explicitDest}" is not a valid explicitDest parameter.`); - return; - } else if (!this._isValidPage(pageNumber)) { - if (pageNumber !== null || this._destination) { - console.error("PDFHistory.push: " + `"${pageNumber}" is not a valid pageNumber parameter.`); - return; - } - } - const hash = namedDest || JSON.stringify(explicitDest); - if (!hash) { - return; - } - let forceReplace = false; - if (this._destination && (isDestHashesEqual(this._destination.hash, hash) || isDestArraysEqual(this._destination.dest, explicitDest))) { - if (this._destination.page) { - return; - } - forceReplace = true; - } - if (this._popStateInProgress && !forceReplace) { - return; - } - this._pushOrReplaceState({ - dest: explicitDest, - hash, - page: pageNumber, - rotation: this.linkService.rotation - }, forceReplace); - if (!this._popStateInProgress) { - this._popStateInProgress = true; - Promise.resolve().then(() => { - this._popStateInProgress = false; - }); - } - } - pushPage(pageNumber) { - if (!this._initialized) { - return; - } - if (!this._isValidPage(pageNumber)) { - console.error(`PDFHistory.pushPage: "${pageNumber}" is not a valid page number.`); - return; - } - if (this._destination?.page === pageNumber) { - return; - } - if (this._popStateInProgress) { - return; - } - this._pushOrReplaceState({ - dest: null, - hash: `page=${pageNumber}`, - page: pageNumber, - rotation: this.linkService.rotation - }); - if (!this._popStateInProgress) { - this._popStateInProgress = true; - Promise.resolve().then(() => { - this._popStateInProgress = false; - }); - } - } - pushCurrentPosition() { - if (!this._initialized || this._popStateInProgress) { - return; - } - this._tryPushCurrentPosition(); - } - back() { - if (!this._initialized || this._popStateInProgress) { - return; - } - const state = window.history.state; - if (this._isValidState(state) && state.uid > 0) { - window.history.back(); - } - } - forward() { - if (!this._initialized || this._popStateInProgress) { - return; - } - const state = window.history.state; - if (this._isValidState(state) && state.uid < this._maxUid) { - window.history.forward(); - } - } - get popStateInProgress() { - return this._initialized && (this._popStateInProgress || this._blockHashChange > 0); - } - get initialBookmark() { - return this._initialized ? this._initialBookmark : null; - } - get initialRotation() { - return this._initialized ? this._initialRotation : null; - } - _pushOrReplaceState(destination, forceReplace = false) { - const shouldReplace = forceReplace || !this._destination; - const newState = { - fingerprint: this._fingerprint, - uid: shouldReplace ? this._uid : this._uid + 1, - destination - }; - this._updateInternalState(destination, newState.uid); - let newUrl; - if (this._updateUrl && destination?.hash) { - const baseUrl = document.location.href.split("#")[0]; - if (!baseUrl.startsWith("file://")) { - newUrl = `${baseUrl}#${destination.hash}`; - } - } - if (shouldReplace) { - window.history.replaceState(newState, "", newUrl); - } else { - window.history.pushState(newState, "", newUrl); - } - } - _tryPushCurrentPosition(temporary = false) { - if (!this._position) { - return; - } - let position = this._position; - if (temporary) { - position = Object.assign(Object.create(null), this._position); - position.temporary = true; - } - if (!this._destination) { - this._pushOrReplaceState(position); - return; - } - if (this._destination.temporary) { - this._pushOrReplaceState(position, true); - return; - } - if (this._destination.hash === position.hash) { - return; - } - if (!this._destination.page && (POSITION_UPDATED_THRESHOLD <= 0 || this._numPositionUpdates <= POSITION_UPDATED_THRESHOLD)) { - return; - } - let forceReplace = false; - if (this._destination.page >= position.first && this._destination.page <= position.page) { - if (this._destination.dest !== undefined || !this._destination.first) { - return; - } - forceReplace = true; - } - this._pushOrReplaceState(position, forceReplace); - } - _isValidPage(val) { - return Number.isInteger(val) && val > 0 && val <= this.linkService.pagesCount; - } - _isValidState(state, checkReload = false) { - if (!state) { - return false; - } - if (state.fingerprint !== this._fingerprint) { - if (checkReload) { - if (typeof state.fingerprint !== "string" || state.fingerprint.length !== this._fingerprint.length) { - return false; - } - const [perfEntry] = performance.getEntriesByType("navigation"); - if (perfEntry?.type !== "reload") { - return false; - } - } else { - return false; - } - } - if (!Number.isInteger(state.uid) || state.uid < 0) { - return false; - } - if (state.destination === null || typeof state.destination !== "object") { - return false; - } - return true; - } - _updateInternalState(destination, uid, removeTemporary = false) { - if (this._updateViewareaTimeout) { - clearTimeout(this._updateViewareaTimeout); - this._updateViewareaTimeout = null; - } - if (removeTemporary && destination?.temporary) { - delete destination.temporary; - } - this._destination = destination; - this._uid = uid; - this._maxUid = Math.max(this._maxUid, uid); - this._numPositionUpdates = 0; - } - _parseCurrentHash(checkNameddest = false) { - const hash = unescape(getCurrentHash()).substring(1); - const params = (0, _ui_utils.parseQueryString)(hash); - const nameddest = params.get("nameddest") || ""; - let page = params.get("page") | 0; - if (!this._isValidPage(page) || checkNameddest && nameddest.length > 0) { - page = null; - } - return { - hash, - page, - rotation: this.linkService.rotation - }; - } - _updateViewarea({ - location - }) { - if (this._updateViewareaTimeout) { - clearTimeout(this._updateViewareaTimeout); - this._updateViewareaTimeout = null; - } - this._position = { - hash: location.pdfOpenParams.substring(1), - page: this.linkService.page, - first: location.pageNumber, - rotation: location.rotation - }; - if (this._popStateInProgress) { - return; - } - if (POSITION_UPDATED_THRESHOLD > 0 && this._isPagesLoaded && this._destination && !this._destination.page) { - this._numPositionUpdates++; - } - if (UPDATE_VIEWAREA_TIMEOUT > 0) { - this._updateViewareaTimeout = setTimeout(() => { - if (!this._popStateInProgress) { - this._tryPushCurrentPosition(true); - } - this._updateViewareaTimeout = null; - }, UPDATE_VIEWAREA_TIMEOUT); - } - } - _popState({ - state - }) { - const newHash = getCurrentHash(), - hashChanged = this._currentHash !== newHash; - this._currentHash = newHash; - if (!state) { - this._uid++; - const { - hash, - page, - rotation - } = this._parseCurrentHash(); - this._pushOrReplaceState({ - hash, - page, - rotation - }, true); - return; - } - if (!this._isValidState(state)) { - return; - } - this._popStateInProgress = true; - if (hashChanged) { - this._blockHashChange++; - (0, _event_utils.waitOnEventOrTimeout)({ - target: window, - name: "hashchange", - delay: HASH_CHANGE_TIMEOUT - }).then(() => { - this._blockHashChange--; - }); - } - const destination = state.destination; - this._updateInternalState(destination, state.uid, true); - if ((0, _ui_utils.isValidRotation)(destination.rotation)) { - this.linkService.rotation = destination.rotation; - } - if (destination.dest) { - this.linkService.goToDestination(destination.dest); - } else if (destination.hash) { - this.linkService.setHash(destination.hash); - } else if (destination.page) { - this.linkService.page = destination.page; - } - Promise.resolve().then(() => { - this._popStateInProgress = false; - }); - } - _pageHide() { - if (!this._destination || this._destination.temporary) { - this._tryPushCurrentPosition(); - } - } - _bindEvents() { - if (this._boundEvents) { - return; - } - this._boundEvents = { - updateViewarea: this._updateViewarea.bind(this), - popState: this._popState.bind(this), - pageHide: this._pageHide.bind(this) - }; - this.eventBus._on("updateviewarea", this._boundEvents.updateViewarea); - window.addEventListener("popstate", this._boundEvents.popState); - window.addEventListener("pagehide", this._boundEvents.pageHide); - } - _unbindEvents() { - if (!this._boundEvents) { - return; - } - this.eventBus._off("updateviewarea", this._boundEvents.updateViewarea); - window.removeEventListener("popstate", this._boundEvents.popState); - window.removeEventListener("pagehide", this._boundEvents.pageHide); - this._boundEvents = null; - } -} -exports.PDFHistory = PDFHistory; -function isDestHashesEqual(destHash, pushHash) { - if (typeof destHash !== "string" || typeof pushHash !== "string") { - return false; - } - if (destHash === pushHash) { - return true; - } - const nameddest = (0, _ui_utils.parseQueryString)(destHash).get("nameddest"); - if (nameddest === pushHash) { - return true; - } - return false; -} -function isDestArraysEqual(firstDest, secondDest) { - function isEntryEqual(first, second) { - if (typeof first !== typeof second) { - return false; - } - if (Array.isArray(first) || Array.isArray(second)) { - return false; - } - if (first !== null && typeof first === "object" && second !== null) { - if (Object.keys(first).length !== Object.keys(second).length) { - return false; - } - for (const key in first) { - if (!isEntryEqual(first[key], second[key])) { - return false; - } - } - return true; - } - return first === second || Number.isNaN(first) && Number.isNaN(second); - } - if (!(Array.isArray(firstDest) && Array.isArray(secondDest))) { - return false; - } - if (firstDest.length !== secondDest.length) { - return false; - } - for (let i = 0, ii = firstDest.length; i < ii; i++) { - if (!isEntryEqual(firstDest[i], secondDest[i])) { - return false; - } - } - return true; -} - -/***/ }), -/* 20 */ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.PDFLayerViewer = void 0; -var _base_tree_viewer = __webpack_require__(12); -class PDFLayerViewer extends _base_tree_viewer.BaseTreeViewer { - constructor(options) { - super(options); - this.l10n = options.l10n; - this.eventBus._on("optionalcontentconfigchanged", evt => { - this.#updateLayers(evt.promise); - }); - this.eventBus._on("resetlayers", () => { - this.#updateLayers(); - }); - this.eventBus._on("togglelayerstree", this._toggleAllTreeItems.bind(this)); - } - reset() { - super.reset(); - this._optionalContentConfig = null; - this._optionalContentHash = null; - } - _dispatchEvent(layersCount) { - this.eventBus.dispatch("layersloaded", { - source: this, - layersCount - }); - } - _bindLink(element, { - groupId, - input - }) { - const setVisibility = () => { - this._optionalContentConfig.setVisibility(groupId, input.checked); - this._optionalContentHash = this._optionalContentConfig.getHash(); - this.eventBus.dispatch("optionalcontentconfig", { - source: this, - promise: Promise.resolve(this._optionalContentConfig) - }); - }; - element.onclick = evt => { - if (evt.target === input) { - setVisibility(); - return true; - } else if (evt.target !== element) { - return true; - } - input.checked = !input.checked; - setVisibility(); - return false; - }; - } - async _setNestedName(element, { - name = null - }) { - if (typeof name === "string") { - element.textContent = this._normalizeTextContent(name); - return; - } - element.textContent = await this.l10n.get("additional_layers"); - element.style.fontStyle = "italic"; - } - _addToggleButton(div, { - name = null - }) { - super._addToggleButton(div, name === null); - } - _toggleAllTreeItems() { - if (!this._optionalContentConfig) { - return; - } - super._toggleAllTreeItems(); - } - render({ - optionalContentConfig, - pdfDocument - }) { - if (this._optionalContentConfig) { - this.reset(); - } - this._optionalContentConfig = optionalContentConfig || null; - this._pdfDocument = pdfDocument || null; - const groups = optionalContentConfig?.getOrder(); - if (!groups) { - this._dispatchEvent(0); - return; - } - this._optionalContentHash = optionalContentConfig.getHash(); - const fragment = document.createDocumentFragment(), - queue = [{ - parent: fragment, - groups - }]; - let layersCount = 0, - hasAnyNesting = false; - while (queue.length > 0) { - const levelData = queue.shift(); - for (const groupId of levelData.groups) { - const div = document.createElement("div"); - div.className = "treeItem"; - const element = document.createElement("a"); - div.append(element); - if (typeof groupId === "object") { - hasAnyNesting = true; - this._addToggleButton(div, groupId); - this._setNestedName(element, groupId); - const itemsDiv = document.createElement("div"); - itemsDiv.className = "treeItems"; - div.append(itemsDiv); - queue.push({ - parent: itemsDiv, - groups: groupId.order - }); - } else { - const group = optionalContentConfig.getGroup(groupId); - const input = document.createElement("input"); - this._bindLink(element, { - groupId, - input - }); - input.type = "checkbox"; - input.checked = group.visible; - const label = document.createElement("label"); - label.textContent = this._normalizeTextContent(group.name); - label.append(input); - element.append(label); - layersCount++; - } - levelData.parent.append(div); - } - } - this._finishRendering(fragment, layersCount, hasAnyNesting); - } - async #updateLayers(promise = null) { - if (!this._optionalContentConfig) { - return; - } - const pdfDocument = this._pdfDocument; - const optionalContentConfig = await (promise || pdfDocument.getOptionalContentConfig()); - if (pdfDocument !== this._pdfDocument) { - return; - } - if (promise) { - if (optionalContentConfig.getHash() === this._optionalContentHash) { - return; - } - } else { - this.eventBus.dispatch("optionalcontentconfig", { - source: this, - promise: Promise.resolve(optionalContentConfig) - }); - } - this.render({ - optionalContentConfig, - pdfDocument: this._pdfDocument - }); - } -} -exports.PDFLayerViewer = PDFLayerViewer; - -/***/ }), -/* 21 */ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.PDFOutlineViewer = void 0; -var _base_tree_viewer = __webpack_require__(12); -var _pdfjsLib = __webpack_require__(4); -var _ui_utils = __webpack_require__(3); -class PDFOutlineViewer extends _base_tree_viewer.BaseTreeViewer { - constructor(options) { - super(options); - this.linkService = options.linkService; - this.downloadManager = options.downloadManager; - this.eventBus._on("toggleoutlinetree", this._toggleAllTreeItems.bind(this)); - this.eventBus._on("currentoutlineitem", this._currentOutlineItem.bind(this)); - this.eventBus._on("pagechanging", evt => { - this._currentPageNumber = evt.pageNumber; - }); - this.eventBus._on("pagesloaded", evt => { - this._isPagesLoaded = !!evt.pagesCount; - if (this._currentOutlineItemCapability && !this._currentOutlineItemCapability.settled) { - this._currentOutlineItemCapability.resolve(this._isPagesLoaded); - } - }); - this.eventBus._on("sidebarviewchanged", evt => { - this._sidebarView = evt.view; - }); - } - reset() { - super.reset(); - this._outline = null; - this._pageNumberToDestHashCapability = null; - this._currentPageNumber = 1; - this._isPagesLoaded = null; - if (this._currentOutlineItemCapability && !this._currentOutlineItemCapability.settled) { - this._currentOutlineItemCapability.resolve(false); - } - this._currentOutlineItemCapability = null; - } - _dispatchEvent(outlineCount) { - this._currentOutlineItemCapability = (0, _pdfjsLib.createPromiseCapability)(); - if (outlineCount === 0 || this._pdfDocument?.loadingParams.disableAutoFetch) { - this._currentOutlineItemCapability.resolve(false); - } else if (this._isPagesLoaded !== null) { - this._currentOutlineItemCapability.resolve(this._isPagesLoaded); - } - this.eventBus.dispatch("outlineloaded", { - source: this, - outlineCount, - currentOutlineItemPromise: this._currentOutlineItemCapability.promise - }); - } - _bindLink(element, { - url, - newWindow, - action, - attachment, - dest, - setOCGState - }) { - const { - linkService - } = this; - if (url) { - linkService.addLinkAttributes(element, url, newWindow); - return; - } - if (action) { - element.href = linkService.getAnchorUrl(""); - element.onclick = () => { - linkService.executeNamedAction(action); - return false; - }; - return; - } - if (attachment) { - element.href = linkService.getAnchorUrl(""); - element.onclick = () => { - this.downloadManager.openOrDownloadData(element, attachment.content, attachment.filename); - return false; - }; - return; - } - if (setOCGState) { - element.href = linkService.getAnchorUrl(""); - element.onclick = () => { - linkService.executeSetOCGState(setOCGState); - return false; - }; - return; - } - element.href = linkService.getDestinationHash(dest); - element.onclick = evt => { - this._updateCurrentTreeItem(evt.target.parentNode); - if (dest) { - linkService.goToDestination(dest); - } - return false; - }; - } - _setStyles(element, { - bold, - italic - }) { - if (bold) { - element.style.fontWeight = "bold"; - } - if (italic) { - element.style.fontStyle = "italic"; - } - } - _addToggleButton(div, { - count, - items - }) { - let hidden = false; - if (count < 0) { - let totalCount = items.length; - if (totalCount > 0) { - const queue = [...items]; - while (queue.length > 0) { - const { - count: nestedCount, - items: nestedItems - } = queue.shift(); - if (nestedCount > 0 && nestedItems.length > 0) { - totalCount += nestedItems.length; - queue.push(...nestedItems); - } - } - } - if (Math.abs(count) === totalCount) { - hidden = true; - } - } - super._addToggleButton(div, hidden); - } - _toggleAllTreeItems() { - if (!this._outline) { - return; - } - super._toggleAllTreeItems(); - } - render({ - outline, - pdfDocument - }) { - if (this._outline) { - this.reset(); - } - this._outline = outline || null; - this._pdfDocument = pdfDocument || null; - if (!outline) { - this._dispatchEvent(0); - return; - } - const fragment = document.createDocumentFragment(); - const queue = [{ - parent: fragment, - items: outline - }]; - let outlineCount = 0, - hasAnyNesting = false; - while (queue.length > 0) { - const levelData = queue.shift(); - for (const item of levelData.items) { - const div = document.createElement("div"); - div.className = "treeItem"; - const element = document.createElement("a"); - this._bindLink(element, item); - this._setStyles(element, item); - element.textContent = this._normalizeTextContent(item.title); - div.append(element); - if (item.items.length > 0) { - hasAnyNesting = true; - this._addToggleButton(div, item); - const itemsDiv = document.createElement("div"); - itemsDiv.className = "treeItems"; - div.append(itemsDiv); - queue.push({ - parent: itemsDiv, - items: item.items - }); - } - levelData.parent.append(div); - outlineCount++; - } - } - this._finishRendering(fragment, outlineCount, hasAnyNesting); - } - async _currentOutlineItem() { - if (!this._isPagesLoaded) { - throw new Error("_currentOutlineItem: All pages have not been loaded."); - } - if (!this._outline || !this._pdfDocument) { - return; - } - const pageNumberToDestHash = await this._getPageNumberToDestHash(this._pdfDocument); - if (!pageNumberToDestHash) { - return; - } - this._updateCurrentTreeItem(null); - if (this._sidebarView !== _ui_utils.SidebarView.OUTLINE) { - return; - } - for (let i = this._currentPageNumber; i > 0; i--) { - const destHash = pageNumberToDestHash.get(i); - if (!destHash) { - continue; - } - const linkElement = this.container.querySelector(`a[href="${destHash}"]`); - if (!linkElement) { - continue; - } - this._scrollToCurrentTreeItem(linkElement.parentNode); - break; - } - } - async _getPageNumberToDestHash(pdfDocument) { - if (this._pageNumberToDestHashCapability) { - return this._pageNumberToDestHashCapability.promise; - } - this._pageNumberToDestHashCapability = (0, _pdfjsLib.createPromiseCapability)(); - const pageNumberToDestHash = new Map(), - pageNumberNesting = new Map(); - const queue = [{ - nesting: 0, - items: this._outline - }]; - while (queue.length > 0) { - const levelData = queue.shift(), - currentNesting = levelData.nesting; - for (const { - dest, - items - } of levelData.items) { - let explicitDest, pageNumber; - if (typeof dest === "string") { - explicitDest = await pdfDocument.getDestination(dest); - if (pdfDocument !== this._pdfDocument) { - return null; - } - } else { - explicitDest = dest; - } - if (Array.isArray(explicitDest)) { - const [destRef] = explicitDest; - if (typeof destRef === "object" && destRef !== null) { - pageNumber = this.linkService._cachedPageNumber(destRef); - if (!pageNumber) { - try { - pageNumber = (await pdfDocument.getPageIndex(destRef)) + 1; - if (pdfDocument !== this._pdfDocument) { - return null; - } - this.linkService.cachePageRef(pageNumber, destRef); - } catch (ex) {} - } - } else if (Number.isInteger(destRef)) { - pageNumber = destRef + 1; - } - if (Number.isInteger(pageNumber) && (!pageNumberToDestHash.has(pageNumber) || currentNesting > pageNumberNesting.get(pageNumber))) { - const destHash = this.linkService.getDestinationHash(dest); - pageNumberToDestHash.set(pageNumber, destHash); - pageNumberNesting.set(pageNumber, currentNesting); - } - } - if (items.length > 0) { - queue.push({ - nesting: currentNesting + 1, - items - }); - } - } - } - this._pageNumberToDestHashCapability.resolve(pageNumberToDestHash.size > 0 ? pageNumberToDestHash : null); - return this._pageNumberToDestHashCapability.promise; - } -} -exports.PDFOutlineViewer = PDFOutlineViewer; - -/***/ }), -/* 22 */ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.PDFPresentationMode = void 0; -var _ui_utils = __webpack_require__(3); -var _pdfjsLib = __webpack_require__(4); -const DELAY_BEFORE_HIDING_CONTROLS = 3000; -const ACTIVE_SELECTOR = "pdfPresentationMode"; -const CONTROLS_SELECTOR = "pdfPresentationModeControls"; -const MOUSE_SCROLL_COOLDOWN_TIME = 50; -const PAGE_SWITCH_THRESHOLD = 0.1; -const SWIPE_MIN_DISTANCE_THRESHOLD = 50; -const SWIPE_ANGLE_THRESHOLD = Math.PI / 6; -class PDFPresentationMode { - #state = _ui_utils.PresentationModeState.UNKNOWN; - #args = null; - constructor({ - container, - pdfViewer, - eventBus - }) { - this.container = container; - this.pdfViewer = pdfViewer; - this.eventBus = eventBus; - this.contextMenuOpen = false; - this.mouseScrollTimeStamp = 0; - this.mouseScrollDelta = 0; - this.touchSwipeState = null; - } - async request() { - const { - container, - pdfViewer - } = this; - if (this.active || !pdfViewer.pagesCount || !container.requestFullscreen) { - return false; - } - this.#addFullscreenChangeListeners(); - this.#notifyStateChange(_ui_utils.PresentationModeState.CHANGING); - const promise = container.requestFullscreen(); - this.#args = { - pageNumber: pdfViewer.currentPageNumber, - scaleValue: pdfViewer.currentScaleValue, - scrollMode: pdfViewer.scrollMode, - spreadMode: null, - annotationEditorMode: null - }; - if (pdfViewer.spreadMode !== _ui_utils.SpreadMode.NONE && !(pdfViewer.pageViewsReady && pdfViewer.hasEqualPageSizes)) { - console.warn("Ignoring Spread modes when entering PresentationMode, " + "since the document may contain varying page sizes."); - this.#args.spreadMode = pdfViewer.spreadMode; - } - if (pdfViewer.annotationEditorMode !== _pdfjsLib.AnnotationEditorType.DISABLE) { - this.#args.annotationEditorMode = pdfViewer.annotationEditorMode; - } - try { - await promise; - pdfViewer.focus(); - return true; - } catch (reason) { - this.#removeFullscreenChangeListeners(); - this.#notifyStateChange(_ui_utils.PresentationModeState.NORMAL); - } - return false; - } - get active() { - return this.#state === _ui_utils.PresentationModeState.CHANGING || this.#state === _ui_utils.PresentationModeState.FULLSCREEN; - } - #mouseWheel(evt) { - if (!this.active) { - return; - } - evt.preventDefault(); - const delta = (0, _ui_utils.normalizeWheelEventDelta)(evt); - const currentTime = Date.now(); - const storedTime = this.mouseScrollTimeStamp; - if (currentTime > storedTime && currentTime - storedTime < MOUSE_SCROLL_COOLDOWN_TIME) { - return; - } - if (this.mouseScrollDelta > 0 && delta < 0 || this.mouseScrollDelta < 0 && delta > 0) { - this.#resetMouseScrollState(); - } - this.mouseScrollDelta += delta; - if (Math.abs(this.mouseScrollDelta) >= PAGE_SWITCH_THRESHOLD) { - const totalDelta = this.mouseScrollDelta; - this.#resetMouseScrollState(); - const success = totalDelta > 0 ? this.pdfViewer.previousPage() : this.pdfViewer.nextPage(); - if (success) { - this.mouseScrollTimeStamp = currentTime; - } - } - } - #notifyStateChange(state) { - this.#state = state; - this.eventBus.dispatch("presentationmodechanged", { - source: this, - state - }); - } - #enter() { - this.#notifyStateChange(_ui_utils.PresentationModeState.FULLSCREEN); - this.container.classList.add(ACTIVE_SELECTOR); - setTimeout(() => { - this.pdfViewer.scrollMode = _ui_utils.ScrollMode.PAGE; - if (this.#args.spreadMode !== null) { - this.pdfViewer.spreadMode = _ui_utils.SpreadMode.NONE; - } - this.pdfViewer.currentPageNumber = this.#args.pageNumber; - this.pdfViewer.currentScaleValue = "page-fit"; - if (this.#args.annotationEditorMode !== null) { - this.pdfViewer.annotationEditorMode = _pdfjsLib.AnnotationEditorType.NONE; - } - }, 0); - this.#addWindowListeners(); - this.#showControls(); - this.contextMenuOpen = false; - window.getSelection().removeAllRanges(); - } - #exit() { - const pageNumber = this.pdfViewer.currentPageNumber; - this.container.classList.remove(ACTIVE_SELECTOR); - setTimeout(() => { - this.#removeFullscreenChangeListeners(); - this.#notifyStateChange(_ui_utils.PresentationModeState.NORMAL); - this.pdfViewer.scrollMode = this.#args.scrollMode; - if (this.#args.spreadMode !== null) { - this.pdfViewer.spreadMode = this.#args.spreadMode; - } - this.pdfViewer.currentScaleValue = this.#args.scaleValue; - this.pdfViewer.currentPageNumber = pageNumber; - if (this.#args.annotationEditorMode !== null) { - this.pdfViewer.annotationEditorMode = this.#args.annotationEditorMode; - } - this.#args = null; - }, 0); - this.#removeWindowListeners(); - this.#hideControls(); - this.#resetMouseScrollState(); - this.contextMenuOpen = false; - } - #mouseDown(evt) { - if (this.contextMenuOpen) { - this.contextMenuOpen = false; - evt.preventDefault(); - return; - } - if (evt.button !== 0) { - return; - } - if (evt.target.href && evt.target.parentNode?.hasAttribute("data-internal-link")) { - return; - } - evt.preventDefault(); - if (evt.shiftKey) { - this.pdfViewer.previousPage(); - } else { - this.pdfViewer.nextPage(); - } - } - #contextMenu() { - this.contextMenuOpen = true; - } - #showControls() { - if (this.controlsTimeout) { - clearTimeout(this.controlsTimeout); - } else { - this.container.classList.add(CONTROLS_SELECTOR); - } - this.controlsTimeout = setTimeout(() => { - this.container.classList.remove(CONTROLS_SELECTOR); - delete this.controlsTimeout; - }, DELAY_BEFORE_HIDING_CONTROLS); - } - #hideControls() { - if (!this.controlsTimeout) { - return; - } - clearTimeout(this.controlsTimeout); - this.container.classList.remove(CONTROLS_SELECTOR); - delete this.controlsTimeout; - } - #resetMouseScrollState() { - this.mouseScrollTimeStamp = 0; - this.mouseScrollDelta = 0; - } - #touchSwipe(evt) { - if (!this.active) { - return; - } - if (evt.touches.length > 1) { - this.touchSwipeState = null; - return; - } - switch (evt.type) { - case "touchstart": - this.touchSwipeState = { - startX: evt.touches[0].pageX, - startY: evt.touches[0].pageY, - endX: evt.touches[0].pageX, - endY: evt.touches[0].pageY - }; - break; - case "touchmove": - if (this.touchSwipeState === null) { - return; - } - this.touchSwipeState.endX = evt.touches[0].pageX; - this.touchSwipeState.endY = evt.touches[0].pageY; - evt.preventDefault(); - break; - case "touchend": - if (this.touchSwipeState === null) { - return; - } - let delta = 0; - const dx = this.touchSwipeState.endX - this.touchSwipeState.startX; - const dy = this.touchSwipeState.endY - this.touchSwipeState.startY; - const absAngle = Math.abs(Math.atan2(dy, dx)); - if (Math.abs(dx) > SWIPE_MIN_DISTANCE_THRESHOLD && (absAngle <= SWIPE_ANGLE_THRESHOLD || absAngle >= Math.PI - SWIPE_ANGLE_THRESHOLD)) { - delta = dx; - } else if (Math.abs(dy) > SWIPE_MIN_DISTANCE_THRESHOLD && Math.abs(absAngle - Math.PI / 2) <= SWIPE_ANGLE_THRESHOLD) { - delta = dy; - } - if (delta > 0) { - this.pdfViewer.previousPage(); - } else if (delta < 0) { - this.pdfViewer.nextPage(); - } - break; - } - } - #addWindowListeners() { - this.showControlsBind = this.#showControls.bind(this); - this.mouseDownBind = this.#mouseDown.bind(this); - this.mouseWheelBind = this.#mouseWheel.bind(this); - this.resetMouseScrollStateBind = this.#resetMouseScrollState.bind(this); - this.contextMenuBind = this.#contextMenu.bind(this); - this.touchSwipeBind = this.#touchSwipe.bind(this); - window.addEventListener("mousemove", this.showControlsBind); - window.addEventListener("mousedown", this.mouseDownBind); - window.addEventListener("wheel", this.mouseWheelBind, { - passive: false - }); - window.addEventListener("keydown", this.resetMouseScrollStateBind); - window.addEventListener("contextmenu", this.contextMenuBind); - window.addEventListener("touchstart", this.touchSwipeBind); - window.addEventListener("touchmove", this.touchSwipeBind); - window.addEventListener("touchend", this.touchSwipeBind); - } - #removeWindowListeners() { - window.removeEventListener("mousemove", this.showControlsBind); - window.removeEventListener("mousedown", this.mouseDownBind); - window.removeEventListener("wheel", this.mouseWheelBind, { - passive: false - }); - window.removeEventListener("keydown", this.resetMouseScrollStateBind); - window.removeEventListener("contextmenu", this.contextMenuBind); - window.removeEventListener("touchstart", this.touchSwipeBind); - window.removeEventListener("touchmove", this.touchSwipeBind); - window.removeEventListener("touchend", this.touchSwipeBind); - delete this.showControlsBind; - delete this.mouseDownBind; - delete this.mouseWheelBind; - delete this.resetMouseScrollStateBind; - delete this.contextMenuBind; - delete this.touchSwipeBind; - } - #fullscreenChange() { - if (document.fullscreenElement) { - this.#enter(); - } else { - this.#exit(); - } - } - #addFullscreenChangeListeners() { - this.fullscreenChangeBind = this.#fullscreenChange.bind(this); - window.addEventListener("fullscreenchange", this.fullscreenChangeBind); - } - #removeFullscreenChangeListeners() { - window.removeEventListener("fullscreenchange", this.fullscreenChangeBind); - delete this.fullscreenChangeBind; - } -} -exports.PDFPresentationMode = PDFPresentationMode; - -/***/ }), -/* 23 */ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.PDFRenderingQueue = void 0; -var _pdfjsLib = __webpack_require__(4); -var _ui_utils = __webpack_require__(3); -const CLEANUP_TIMEOUT = 30000; -class PDFRenderingQueue { - constructor() { - this.pdfViewer = null; - this.pdfThumbnailViewer = null; - this.onIdle = null; - this.highestPriorityPage = null; - this.idleTimeout = null; - this.printing = false; - this.isThumbnailViewEnabled = false; - } - setViewer(pdfViewer) { - this.pdfViewer = pdfViewer; - } - setThumbnailViewer(pdfThumbnailViewer) { - this.pdfThumbnailViewer = pdfThumbnailViewer; - } - isHighestPriority(view) { - return this.highestPriorityPage === view.renderingId; - } - hasViewer() { - return !!this.pdfViewer; - } - renderHighestPriority(currentlyVisiblePages) { - if (this.idleTimeout) { - clearTimeout(this.idleTimeout); - this.idleTimeout = null; - } - if (this.pdfViewer.forceRendering(currentlyVisiblePages)) { - return; - } - if (this.isThumbnailViewEnabled && this.pdfThumbnailViewer?.forceRendering()) { - return; - } - if (this.printing) { - return; - } - if (this.onIdle) { - this.idleTimeout = setTimeout(this.onIdle.bind(this), CLEANUP_TIMEOUT); - } - } - getHighestPriority(visible, views, scrolledDown, preRenderExtra = false) { - const visibleViews = visible.views, - numVisible = visibleViews.length; - if (numVisible === 0) { - return null; - } - for (let i = 0; i < numVisible; i++) { - const view = visibleViews[i].view; - if (!this.isViewFinished(view)) { - return view; - } - } - const firstId = visible.first.id, - lastId = visible.last.id; - if (lastId - firstId + 1 > numVisible) { - const visibleIds = visible.ids; - for (let i = 1, ii = lastId - firstId; i < ii; i++) { - const holeId = scrolledDown ? firstId + i : lastId - i; - if (visibleIds.has(holeId)) { - continue; - } - const holeView = views[holeId - 1]; - if (!this.isViewFinished(holeView)) { - return holeView; - } - } - } - let preRenderIndex = scrolledDown ? lastId : firstId - 2; - let preRenderView = views[preRenderIndex]; - if (preRenderView && !this.isViewFinished(preRenderView)) { - return preRenderView; - } - if (preRenderExtra) { - preRenderIndex += scrolledDown ? 1 : -1; - preRenderView = views[preRenderIndex]; - if (preRenderView && !this.isViewFinished(preRenderView)) { - return preRenderView; - } - } - return null; - } - isViewFinished(view) { - return view.renderingState === _ui_utils.RenderingStates.FINISHED; - } - renderView(view) { - switch (view.renderingState) { - case _ui_utils.RenderingStates.FINISHED: - return false; - case _ui_utils.RenderingStates.PAUSED: - this.highestPriorityPage = view.renderingId; - view.resume(); - break; - case _ui_utils.RenderingStates.RUNNING: - this.highestPriorityPage = view.renderingId; - break; - case _ui_utils.RenderingStates.INITIAL: - this.highestPriorityPage = view.renderingId; - view.draw().finally(() => { - this.renderHighestPriority(); - }).catch(reason => { - if (reason instanceof _pdfjsLib.RenderingCancelledException) { - return; - } - console.error(`renderView: "${reason}"`); - }); - break; - } - return true; - } -} -exports.PDFRenderingQueue = PDFRenderingQueue; - -/***/ }), -/* 24 */ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.PDFScriptingManager = void 0; -var _ui_utils = __webpack_require__(3); -var _pdfjsLib = __webpack_require__(4); -class PDFScriptingManager { - constructor({ - eventBus, - sandboxBundleSrc = null, - scriptingFactory = null, - docPropertiesLookup = null - }) { - this._pdfDocument = null; - this._pdfViewer = null; - this._closeCapability = null; - this._destroyCapability = null; - this._scripting = null; - this._ready = false; - this._eventBus = eventBus; - this._sandboxBundleSrc = sandboxBundleSrc; - this._scriptingFactory = scriptingFactory; - this._docPropertiesLookup = docPropertiesLookup; - } - setViewer(pdfViewer) { - this._pdfViewer = pdfViewer; - } - async setDocument(pdfDocument) { - if (this._pdfDocument) { - await this._destroyScripting(); - } - this._pdfDocument = pdfDocument; - if (!pdfDocument) { - return; - } - const [objects, calculationOrder, docActions] = await Promise.all([pdfDocument.getFieldObjects(), pdfDocument.getCalculationOrderIds(), pdfDocument.getJSActions()]); - if (!objects && !docActions) { - await this._destroyScripting(); - return; - } - if (pdfDocument !== this._pdfDocument) { - return; - } - try { - this._scripting = this._createScripting(); - } catch (error) { - console.error(`PDFScriptingManager.setDocument: "${error?.message}".`); - await this._destroyScripting(); - return; - } - this._internalEvents.set("updatefromsandbox", event => { - if (event?.source !== window) { - return; - } - this._updateFromSandbox(event.detail); - }); - this._internalEvents.set("dispatcheventinsandbox", event => { - this._scripting?.dispatchEventInSandbox(event.detail); - }); - this._internalEvents.set("pagechanging", ({ - pageNumber, - previous - }) => { - if (pageNumber === previous) { - return; - } - this._dispatchPageClose(previous); - this._dispatchPageOpen(pageNumber); - }); - this._internalEvents.set("pagerendered", ({ - pageNumber - }) => { - if (!this._pageOpenPending.has(pageNumber)) { - return; - } - if (pageNumber !== this._pdfViewer.currentPageNumber) { - return; - } - this._dispatchPageOpen(pageNumber); - }); - this._internalEvents.set("pagesdestroy", async event => { - await this._dispatchPageClose(this._pdfViewer.currentPageNumber); - await this._scripting?.dispatchEventInSandbox({ - id: "doc", - name: "WillClose" - }); - this._closeCapability?.resolve(); - }); - for (const [name, listener] of this._internalEvents) { - this._eventBus._on(name, listener); - } - try { - const docProperties = await this._getDocProperties(); - if (pdfDocument !== this._pdfDocument) { - return; - } - await this._scripting.createSandbox({ - objects, - calculationOrder, - appInfo: { - platform: navigator.platform, - language: navigator.language - }, - docInfo: { - ...docProperties, - actions: docActions - } - }); - this._eventBus.dispatch("sandboxcreated", { - source: this - }); - } catch (error) { - console.error(`PDFScriptingManager.setDocument: "${error?.message}".`); - await this._destroyScripting(); - return; - } - await this._scripting?.dispatchEventInSandbox({ - id: "doc", - name: "Open" - }); - await this._dispatchPageOpen(this._pdfViewer.currentPageNumber, true); - Promise.resolve().then(() => { - if (pdfDocument === this._pdfDocument) { - this._ready = true; - } - }); - } - async dispatchWillSave(detail) { - return this._scripting?.dispatchEventInSandbox({ - id: "doc", - name: "WillSave" - }); - } - async dispatchDidSave(detail) { - return this._scripting?.dispatchEventInSandbox({ - id: "doc", - name: "DidSave" - }); - } - async dispatchWillPrint(detail) { - return this._scripting?.dispatchEventInSandbox({ - id: "doc", - name: "WillPrint" - }); - } - async dispatchDidPrint(detail) { - return this._scripting?.dispatchEventInSandbox({ - id: "doc", - name: "DidPrint" - }); - } - get destroyPromise() { - return this._destroyCapability?.promise || null; - } - get ready() { - return this._ready; - } - get _internalEvents() { - return (0, _pdfjsLib.shadow)(this, "_internalEvents", new Map()); - } - get _pageOpenPending() { - return (0, _pdfjsLib.shadow)(this, "_pageOpenPending", new Set()); - } - get _visitedPages() { - return (0, _pdfjsLib.shadow)(this, "_visitedPages", new Map()); - } - async _updateFromSandbox(detail) { - const isInPresentationMode = this._pdfViewer.isInPresentationMode || this._pdfViewer.isChangingPresentationMode; - const { - id, - siblings, - command, - value - } = detail; - if (!id) { - switch (command) { - case "clear": - console.clear(); - break; - case "error": - console.error(value); - break; - case "layout": - { - if (isInPresentationMode) { - return; - } - const modes = (0, _ui_utils.apiPageLayoutToViewerModes)(value); - this._pdfViewer.spreadMode = modes.spreadMode; - break; - } - case "page-num": - this._pdfViewer.currentPageNumber = value + 1; - break; - case "print": - await this._pdfViewer.pagesPromise; - this._eventBus.dispatch("print", { - source: this - }); - break; - case "println": - console.log(value); - break; - case "zoom": - if (isInPresentationMode) { - return; - } - this._pdfViewer.currentScaleValue = value; - break; - case "SaveAs": - this._eventBus.dispatch("download", { - source: this - }); - break; - case "FirstPage": - this._pdfViewer.currentPageNumber = 1; - break; - case "LastPage": - this._pdfViewer.currentPageNumber = this._pdfViewer.pagesCount; - break; - case "NextPage": - this._pdfViewer.nextPage(); - break; - case "PrevPage": - this._pdfViewer.previousPage(); - break; - case "ZoomViewIn": - if (isInPresentationMode) { - return; - } - this._pdfViewer.increaseScale(); - break; - case "ZoomViewOut": - if (isInPresentationMode) { - return; - } - this._pdfViewer.decreaseScale(); - break; - } - return; - } - if (isInPresentationMode) { - if (detail.focus) { - return; - } - } - delete detail.id; - delete detail.siblings; - const ids = siblings ? [id, ...siblings] : [id]; - for (const elementId of ids) { - const element = document.querySelector(`[data-element-id="${elementId}"]`); - if (element) { - element.dispatchEvent(new CustomEvent("updatefromsandbox", { - detail - })); - } else { - this._pdfDocument?.annotationStorage.setValue(elementId, detail); - } - } - } - async _dispatchPageOpen(pageNumber, initialize = false) { - const pdfDocument = this._pdfDocument, - visitedPages = this._visitedPages; - if (initialize) { - this._closeCapability = (0, _pdfjsLib.createPromiseCapability)(); - } - if (!this._closeCapability) { - return; - } - const pageView = this._pdfViewer.getPageView(pageNumber - 1); - if (pageView?.renderingState !== _ui_utils.RenderingStates.FINISHED) { - this._pageOpenPending.add(pageNumber); - return; - } - this._pageOpenPending.delete(pageNumber); - const actionsPromise = (async () => { - const actions = await (!visitedPages.has(pageNumber) ? pageView.pdfPage?.getJSActions() : null); - if (pdfDocument !== this._pdfDocument) { - return; - } - await this._scripting?.dispatchEventInSandbox({ - id: "page", - name: "PageOpen", - pageNumber, - actions - }); - })(); - visitedPages.set(pageNumber, actionsPromise); - } - async _dispatchPageClose(pageNumber) { - const pdfDocument = this._pdfDocument, - visitedPages = this._visitedPages; - if (!this._closeCapability) { - return; - } - if (this._pageOpenPending.has(pageNumber)) { - return; - } - const actionsPromise = visitedPages.get(pageNumber); - if (!actionsPromise) { - return; - } - visitedPages.set(pageNumber, null); - await actionsPromise; - if (pdfDocument !== this._pdfDocument) { - return; - } - await this._scripting?.dispatchEventInSandbox({ - id: "page", - name: "PageClose", - pageNumber - }); - } - async _getDocProperties() { - if (this._docPropertiesLookup) { - return this._docPropertiesLookup(this._pdfDocument); - } - throw new Error("_getDocProperties: Unable to lookup properties."); - } - _createScripting() { - this._destroyCapability = (0, _pdfjsLib.createPromiseCapability)(); - if (this._scripting) { - throw new Error("_createScripting: Scripting already exists."); - } - if (this._scriptingFactory) { - return this._scriptingFactory.createScripting({ - sandboxBundleSrc: this._sandboxBundleSrc - }); - } - throw new Error("_createScripting: Cannot create scripting."); - } - async _destroyScripting() { - if (!this._scripting) { - this._pdfDocument = null; - this._destroyCapability?.resolve(); - return; - } - if (this._closeCapability) { - await Promise.race([this._closeCapability.promise, new Promise(resolve => { - setTimeout(resolve, 1000); - })]).catch(reason => {}); - this._closeCapability = null; - } - this._pdfDocument = null; - try { - await this._scripting.destroySandbox(); - } catch (ex) {} - for (const [name, listener] of this._internalEvents) { - this._eventBus._off(name, listener); - } - this._internalEvents.clear(); - this._pageOpenPending.clear(); - this._visitedPages.clear(); - this._scripting = null; - this._ready = false; - this._destroyCapability?.resolve(); - } -} -exports.PDFScriptingManager = PDFScriptingManager; - -/***/ }), -/* 25 */ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.PDFSidebar = void 0; -var _ui_utils = __webpack_require__(3); -const UI_NOTIFICATION_CLASS = "pdfSidebarNotification"; -class PDFSidebar { - constructor({ - elements, - pdfViewer, - pdfThumbnailViewer, - eventBus, - l10n - }) { - this.isOpen = false; - this.active = _ui_utils.SidebarView.THUMBS; - this.isInitialViewSet = false; - this.isInitialEventDispatched = false; - this.onToggled = null; - this.pdfViewer = pdfViewer; - this.pdfThumbnailViewer = pdfThumbnailViewer; - this.outerContainer = elements.outerContainer; - this.sidebarContainer = elements.sidebarContainer; - this.toggleButton = elements.toggleButton; - this.thumbnailButton = elements.thumbnailButton; - this.outlineButton = elements.outlineButton; - this.attachmentsButton = elements.attachmentsButton; - this.layersButton = elements.layersButton; - this.thumbnailView = elements.thumbnailView; - this.outlineView = elements.outlineView; - this.attachmentsView = elements.attachmentsView; - this.layersView = elements.layersView; - this._outlineOptionsContainer = elements.outlineOptionsContainer; - this._currentOutlineItemButton = elements.currentOutlineItemButton; - this.eventBus = eventBus; - this.l10n = l10n; - this.#addEventListeners(); - } - reset() { - this.isInitialViewSet = false; - this.isInitialEventDispatched = false; - this.#hideUINotification(true); - this.switchView(_ui_utils.SidebarView.THUMBS); - this.outlineButton.disabled = false; - this.attachmentsButton.disabled = false; - this.layersButton.disabled = false; - this._currentOutlineItemButton.disabled = true; - } - get visibleView() { - return this.isOpen ? this.active : _ui_utils.SidebarView.NONE; - } - setInitialView(view = _ui_utils.SidebarView.NONE) { - if (this.isInitialViewSet) { - return; - } - this.isInitialViewSet = true; - if (view === _ui_utils.SidebarView.NONE || view === _ui_utils.SidebarView.UNKNOWN) { - this.#dispatchEvent(); - return; - } - this.switchView(view, true); - if (!this.isInitialEventDispatched) { - this.#dispatchEvent(); - } - } - switchView(view, forceOpen = false) { - const isViewChanged = view !== this.active; - let shouldForceRendering = false; - switch (view) { - case _ui_utils.SidebarView.NONE: - if (this.isOpen) { - this.close(); - } - return; - case _ui_utils.SidebarView.THUMBS: - if (this.isOpen && isViewChanged) { - shouldForceRendering = true; - } - break; - case _ui_utils.SidebarView.OUTLINE: - if (this.outlineButton.disabled) { - return; - } - break; - case _ui_utils.SidebarView.ATTACHMENTS: - if (this.attachmentsButton.disabled) { - return; - } - break; - case _ui_utils.SidebarView.LAYERS: - if (this.layersButton.disabled) { - return; - } - break; - default: - console.error(`PDFSidebar.switchView: "${view}" is not a valid view.`); - return; - } - this.active = view; - const isThumbs = view === _ui_utils.SidebarView.THUMBS, - isOutline = view === _ui_utils.SidebarView.OUTLINE, - isAttachments = view === _ui_utils.SidebarView.ATTACHMENTS, - isLayers = view === _ui_utils.SidebarView.LAYERS; - this.thumbnailButton.classList.toggle("toggled", isThumbs); - this.outlineButton.classList.toggle("toggled", isOutline); - this.attachmentsButton.classList.toggle("toggled", isAttachments); - this.layersButton.classList.toggle("toggled", isLayers); - this.thumbnailButton.setAttribute("aria-checked", isThumbs); - this.outlineButton.setAttribute("aria-checked", isOutline); - this.attachmentsButton.setAttribute("aria-checked", isAttachments); - this.layersButton.setAttribute("aria-checked", isLayers); - this.thumbnailView.classList.toggle("hidden", !isThumbs); - this.outlineView.classList.toggle("hidden", !isOutline); - this.attachmentsView.classList.toggle("hidden", !isAttachments); - this.layersView.classList.toggle("hidden", !isLayers); - this._outlineOptionsContainer.classList.toggle("hidden", !isOutline); - if (forceOpen && !this.isOpen) { - this.open(); - return; - } - if (shouldForceRendering) { - this.#updateThumbnailViewer(); - this.#forceRendering(); - } - if (isViewChanged) { - this.#dispatchEvent(); - } - } - open() { - if (this.isOpen) { - return; - } - this.isOpen = true; - this.toggleButton.classList.add("toggled"); - this.toggleButton.setAttribute("aria-expanded", "true"); - this.outerContainer.classList.add("sidebarMoving", "sidebarOpen"); - if (this.active === _ui_utils.SidebarView.THUMBS) { - this.#updateThumbnailViewer(); - } - this.#forceRendering(); - this.#dispatchEvent(); - this.#hideUINotification(); - } - close() { - if (!this.isOpen) { - return; - } - this.isOpen = false; - this.toggleButton.classList.remove("toggled"); - this.toggleButton.setAttribute("aria-expanded", "false"); - this.outerContainer.classList.add("sidebarMoving"); - this.outerContainer.classList.remove("sidebarOpen"); - this.#forceRendering(); - this.#dispatchEvent(); - } - toggle() { - if (this.isOpen) { - this.close(); - } else { - this.open(); - } - } - #dispatchEvent() { - if (this.isInitialViewSet && !this.isInitialEventDispatched) { - this.isInitialEventDispatched = true; - } - this.eventBus.dispatch("sidebarviewchanged", { - source: this, - view: this.visibleView - }); - } - #forceRendering() { - if (this.onToggled) { - this.onToggled(); - } else { - this.pdfViewer.forceRendering(); - this.pdfThumbnailViewer.forceRendering(); - } - } - #updateThumbnailViewer() { - const { - pdfViewer, - pdfThumbnailViewer - } = this; - const pagesCount = pdfViewer.pagesCount; - for (let pageIndex = 0; pageIndex < pagesCount; pageIndex++) { - const pageView = pdfViewer.getPageView(pageIndex); - if (pageView?.renderingState === _ui_utils.RenderingStates.FINISHED) { - const thumbnailView = pdfThumbnailViewer.getThumbnail(pageIndex); - thumbnailView.setImage(pageView); - } - } - pdfThumbnailViewer.scrollThumbnailIntoView(pdfViewer.currentPageNumber); - } - #showUINotification() { - this.toggleButton.setAttribute("data-l10n-id", "toggle_sidebar_notification2"); - this.l10n.translate(this.toggleButton); - if (!this.isOpen) { - this.toggleButton.classList.add(UI_NOTIFICATION_CLASS); - } - } - #hideUINotification(reset = false) { - if (this.isOpen || reset) { - this.toggleButton.classList.remove(UI_NOTIFICATION_CLASS); - } - if (reset) { - this.toggleButton.setAttribute("data-l10n-id", "toggle_sidebar"); - this.l10n.translate(this.toggleButton); - } - } - #addEventListeners() { - this.sidebarContainer.addEventListener("transitionend", evt => { - if (evt.target === this.sidebarContainer) { - this.outerContainer.classList.remove("sidebarMoving"); - } - }); - this.toggleButton.addEventListener("click", () => { - this.toggle(); - }); - this.thumbnailButton.addEventListener("click", () => { - this.switchView(_ui_utils.SidebarView.THUMBS); - }); - this.outlineButton.addEventListener("click", () => { - this.switchView(_ui_utils.SidebarView.OUTLINE); - }); - this.outlineButton.addEventListener("dblclick", () => { - this.eventBus.dispatch("toggleoutlinetree", { - source: this - }); - }); - this.attachmentsButton.addEventListener("click", () => { - this.switchView(_ui_utils.SidebarView.ATTACHMENTS); - }); - this.layersButton.addEventListener("click", () => { - this.switchView(_ui_utils.SidebarView.LAYERS); - }); - this.layersButton.addEventListener("dblclick", () => { - this.eventBus.dispatch("resetlayers", { - source: this - }); - }); - this._currentOutlineItemButton.addEventListener("click", () => { - this.eventBus.dispatch("currentoutlineitem", { - source: this - }); - }); - const onTreeLoaded = (count, button, view) => { - button.disabled = !count; - if (count) { - this.#showUINotification(); - } else if (this.active === view) { - this.switchView(_ui_utils.SidebarView.THUMBS); - } - }; - this.eventBus._on("outlineloaded", evt => { - onTreeLoaded(evt.outlineCount, this.outlineButton, _ui_utils.SidebarView.OUTLINE); - evt.currentOutlineItemPromise.then(enabled => { - if (!this.isInitialViewSet) { - return; - } - this._currentOutlineItemButton.disabled = !enabled; - }); - }); - this.eventBus._on("attachmentsloaded", evt => { - onTreeLoaded(evt.attachmentsCount, this.attachmentsButton, _ui_utils.SidebarView.ATTACHMENTS); - }); - this.eventBus._on("layersloaded", evt => { - onTreeLoaded(evt.layersCount, this.layersButton, _ui_utils.SidebarView.LAYERS); - }); - this.eventBus._on("presentationmodechanged", evt => { - if (evt.state === _ui_utils.PresentationModeState.NORMAL && this.visibleView === _ui_utils.SidebarView.THUMBS) { - this.#updateThumbnailViewer(); - } - }); - } -} -exports.PDFSidebar = PDFSidebar; - -/***/ }), -/* 26 */ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.PDFSidebarResizer = void 0; -var _ui_utils = __webpack_require__(3); -const SIDEBAR_WIDTH_VAR = "--sidebar-width"; -const SIDEBAR_MIN_WIDTH = 200; -const SIDEBAR_RESIZING_CLASS = "sidebarResizing"; -class PDFSidebarResizer { - constructor(options, eventBus, l10n) { - this.isRTL = false; - this.sidebarOpen = false; - this._width = null; - this._outerContainerWidth = null; - this._boundEvents = Object.create(null); - this.outerContainer = options.outerContainer; - this.resizer = options.resizer; - this.eventBus = eventBus; - l10n.getDirection().then(dir => { - this.isRTL = dir === "rtl"; - }); - this._addEventListeners(); - } - get outerContainerWidth() { - return this._outerContainerWidth ||= this.outerContainer.clientWidth; - } - _updateWidth(width = 0) { - const maxWidth = Math.floor(this.outerContainerWidth / 2); - if (width > maxWidth) { - width = maxWidth; - } - if (width < SIDEBAR_MIN_WIDTH) { - width = SIDEBAR_MIN_WIDTH; - } - if (width === this._width) { - return false; - } - this._width = width; - _ui_utils.docStyle.setProperty(SIDEBAR_WIDTH_VAR, `${width}px`); - return true; - } - _mouseMove(evt) { - let width = evt.clientX; - if (this.isRTL) { - width = this.outerContainerWidth - width; - } - this._updateWidth(width); - } - _mouseUp(evt) { - this.outerContainer.classList.remove(SIDEBAR_RESIZING_CLASS); - this.eventBus.dispatch("resize", { - source: this - }); - const _boundEvents = this._boundEvents; - window.removeEventListener("mousemove", _boundEvents.mouseMove); - window.removeEventListener("mouseup", _boundEvents.mouseUp); - } - _addEventListeners() { - const _boundEvents = this._boundEvents; - _boundEvents.mouseMove = this._mouseMove.bind(this); - _boundEvents.mouseUp = this._mouseUp.bind(this); - this.resizer.addEventListener("mousedown", evt => { - if (evt.button !== 0) { - return; - } - this.outerContainer.classList.add(SIDEBAR_RESIZING_CLASS); - window.addEventListener("mousemove", _boundEvents.mouseMove); - window.addEventListener("mouseup", _boundEvents.mouseUp); - }); - this.eventBus._on("sidebarviewchanged", evt => { - this.sidebarOpen = !!evt?.view; - }); - this.eventBus._on("resize", evt => { - if (evt?.source !== window) { - return; - } - this._outerContainerWidth = null; - if (!this._width) { - return; - } - if (!this.sidebarOpen) { - this._updateWidth(this._width); - return; - } - this.outerContainer.classList.add(SIDEBAR_RESIZING_CLASS); - const updated = this._updateWidth(this._width); - Promise.resolve().then(() => { - this.outerContainer.classList.remove(SIDEBAR_RESIZING_CLASS); - if (updated) { - this.eventBus.dispatch("resize", { - source: this - }); - } - }); - }); - } -} -exports.PDFSidebarResizer = PDFSidebarResizer; - -/***/ }), -/* 27 */ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.PDFThumbnailViewer = void 0; -var _ui_utils = __webpack_require__(3); -var _pdf_thumbnail_view = __webpack_require__(28); -const THUMBNAIL_SCROLL_MARGIN = -19; -const THUMBNAIL_SELECTED_CLASS = "selected"; -class PDFThumbnailViewer { - constructor({ - container, - linkService, - renderingQueue, - l10n, - pageColors - }) { - this.container = container; - this.linkService = linkService; - this.renderingQueue = renderingQueue; - this.l10n = l10n; - this.pageColors = pageColors || null; - if (this.pageColors && !(CSS.supports("color", this.pageColors.background) && CSS.supports("color", this.pageColors.foreground))) { - if (this.pageColors.background || this.pageColors.foreground) { - console.warn("PDFThumbnailViewer: Ignoring `pageColors`-option, since the browser doesn't support the values used."); - } - this.pageColors = null; - } - this.scroll = (0, _ui_utils.watchScroll)(this.container, this._scrollUpdated.bind(this)); - this._resetView(); - } - _scrollUpdated() { - this.renderingQueue.renderHighestPriority(); - } - getThumbnail(index) { - return this._thumbnails[index]; - } - _getVisibleThumbs() { - return (0, _ui_utils.getVisibleElements)({ - scrollEl: this.container, - views: this._thumbnails - }); - } - scrollThumbnailIntoView(pageNumber) { - if (!this.pdfDocument) { - return; - } - const thumbnailView = this._thumbnails[pageNumber - 1]; - if (!thumbnailView) { - console.error('scrollThumbnailIntoView: Invalid "pageNumber" parameter.'); - return; - } - if (pageNumber !== this._currentPageNumber) { - const prevThumbnailView = this._thumbnails[this._currentPageNumber - 1]; - prevThumbnailView.div.classList.remove(THUMBNAIL_SELECTED_CLASS); - thumbnailView.div.classList.add(THUMBNAIL_SELECTED_CLASS); - } - const { - first, - last, - views - } = this._getVisibleThumbs(); - if (views.length > 0) { - let shouldScroll = false; - if (pageNumber <= first.id || pageNumber >= last.id) { - shouldScroll = true; - } else { - for (const { - id, - percent - } of views) { - if (id !== pageNumber) { - continue; - } - shouldScroll = percent < 100; - break; - } - } - if (shouldScroll) { - (0, _ui_utils.scrollIntoView)(thumbnailView.div, { - top: THUMBNAIL_SCROLL_MARGIN - }); - } - } - this._currentPageNumber = pageNumber; - } - get pagesRotation() { - return this._pagesRotation; - } - set pagesRotation(rotation) { - if (!(0, _ui_utils.isValidRotation)(rotation)) { - throw new Error("Invalid thumbnails rotation angle."); - } - if (!this.pdfDocument) { - return; - } - if (this._pagesRotation === rotation) { - return; - } - this._pagesRotation = rotation; - const updateArgs = { - rotation - }; - for (const thumbnail of this._thumbnails) { - thumbnail.update(updateArgs); - } - } - cleanup() { - for (const thumbnail of this._thumbnails) { - if (thumbnail.renderingState !== _ui_utils.RenderingStates.FINISHED) { - thumbnail.reset(); - } - } - _pdf_thumbnail_view.TempImageFactory.destroyCanvas(); - } - _resetView() { - this._thumbnails = []; - this._currentPageNumber = 1; - this._pageLabels = null; - this._pagesRotation = 0; - this.container.textContent = ""; - } - setDocument(pdfDocument) { - if (this.pdfDocument) { - this._cancelRendering(); - this._resetView(); - } - this.pdfDocument = pdfDocument; - if (!pdfDocument) { - return; - } - const firstPagePromise = pdfDocument.getPage(1); - const optionalContentConfigPromise = pdfDocument.getOptionalContentConfig(); - firstPagePromise.then(firstPdfPage => { - const pagesCount = pdfDocument.numPages; - const viewport = firstPdfPage.getViewport({ - scale: 1 - }); - for (let pageNum = 1; pageNum <= pagesCount; ++pageNum) { - const thumbnail = new _pdf_thumbnail_view.PDFThumbnailView({ - container: this.container, - id: pageNum, - defaultViewport: viewport.clone(), - optionalContentConfigPromise, - linkService: this.linkService, - renderingQueue: this.renderingQueue, - l10n: this.l10n, - pageColors: this.pageColors - }); - this._thumbnails.push(thumbnail); - } - this._thumbnails[0]?.setPdfPage(firstPdfPage); - const thumbnailView = this._thumbnails[this._currentPageNumber - 1]; - thumbnailView.div.classList.add(THUMBNAIL_SELECTED_CLASS); - }).catch(reason => { - console.error("Unable to initialize thumbnail viewer", reason); - }); - } - _cancelRendering() { - for (const thumbnail of this._thumbnails) { - thumbnail.cancelRendering(); - } - } - setPageLabels(labels) { - if (!this.pdfDocument) { - return; - } - if (!labels) { - this._pageLabels = null; - } else if (!(Array.isArray(labels) && this.pdfDocument.numPages === labels.length)) { - this._pageLabels = null; - console.error("PDFThumbnailViewer_setPageLabels: Invalid page labels."); - } else { - this._pageLabels = labels; - } - for (let i = 0, ii = this._thumbnails.length; i < ii; i++) { - this._thumbnails[i].setPageLabel(this._pageLabels?.[i] ?? null); - } - } - async #ensurePdfPageLoaded(thumbView) { - if (thumbView.pdfPage) { - return thumbView.pdfPage; - } - try { - const pdfPage = await this.pdfDocument.getPage(thumbView.id); - if (!thumbView.pdfPage) { - thumbView.setPdfPage(pdfPage); - } - return pdfPage; - } catch (reason) { - console.error("Unable to get page for thumb view", reason); - return null; - } - } - #getScrollAhead(visible) { - if (visible.first?.id === 1) { - return true; - } else if (visible.last?.id === this._thumbnails.length) { - return false; - } - return this.scroll.down; - } - forceRendering() { - const visibleThumbs = this._getVisibleThumbs(); - const scrollAhead = this.#getScrollAhead(visibleThumbs); - const thumbView = this.renderingQueue.getHighestPriority(visibleThumbs, this._thumbnails, scrollAhead); - if (thumbView) { - this.#ensurePdfPageLoaded(thumbView).then(() => { - this.renderingQueue.renderView(thumbView); - }); - return true; - } - return false; - } -} -exports.PDFThumbnailViewer = PDFThumbnailViewer; - -/***/ }), -/* 28 */ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.TempImageFactory = exports.PDFThumbnailView = void 0; -var _ui_utils = __webpack_require__(3); -var _pdfjsLib = __webpack_require__(4); -const DRAW_UPSCALE_FACTOR = 2; -const MAX_NUM_SCALING_STEPS = 3; -const THUMBNAIL_CANVAS_BORDER_WIDTH = 1; -const THUMBNAIL_WIDTH = 98; -class TempImageFactory { - static #tempCanvas = null; - static getCanvas(width, height) { - const tempCanvas = this.#tempCanvas ||= document.createElement("canvas"); - tempCanvas.width = width; - tempCanvas.height = height; - const ctx = tempCanvas.getContext("2d", { - alpha: false - }); - ctx.save(); - ctx.fillStyle = "rgb(255, 255, 255)"; - ctx.fillRect(0, 0, width, height); - ctx.restore(); - return [tempCanvas, tempCanvas.getContext("2d")]; - } - static destroyCanvas() { - const tempCanvas = this.#tempCanvas; - if (tempCanvas) { - tempCanvas.width = 0; - tempCanvas.height = 0; - } - this.#tempCanvas = null; - } -} -exports.TempImageFactory = TempImageFactory; -class PDFThumbnailView { - constructor({ - container, - id, - defaultViewport, - optionalContentConfigPromise, - linkService, - renderingQueue, - l10n, - pageColors - }) { - this.id = id; - this.renderingId = "thumbnail" + id; - this.pageLabel = null; - this.pdfPage = null; - this.rotation = 0; - this.viewport = defaultViewport; - this.pdfPageRotate = defaultViewport.rotation; - this._optionalContentConfigPromise = optionalContentConfigPromise || null; - this.pageColors = pageColors || null; - this.linkService = linkService; - this.renderingQueue = renderingQueue; - this.renderTask = null; - this.renderingState = _ui_utils.RenderingStates.INITIAL; - this.resume = null; - const pageWidth = this.viewport.width, - pageHeight = this.viewport.height, - pageRatio = pageWidth / pageHeight; - this.canvasWidth = THUMBNAIL_WIDTH; - this.canvasHeight = this.canvasWidth / pageRatio | 0; - this.scale = this.canvasWidth / pageWidth; - this.l10n = l10n; - const anchor = document.createElement("a"); - anchor.href = linkService.getAnchorUrl("#page=" + id); - this._thumbPageTitle.then(msg => { - anchor.title = msg; - }); - anchor.onclick = function () { - linkService.goToPage(id); - return false; - }; - this.anchor = anchor; - const div = document.createElement("div"); - div.className = "thumbnail"; - div.setAttribute("data-page-number", this.id); - this.div = div; - const ring = document.createElement("div"); - ring.className = "thumbnailSelectionRing"; - const borderAdjustment = 2 * THUMBNAIL_CANVAS_BORDER_WIDTH; - ring.style.width = this.canvasWidth + borderAdjustment + "px"; - ring.style.height = this.canvasHeight + borderAdjustment + "px"; - this.ring = ring; - div.append(ring); - anchor.append(div); - container.append(anchor); - } - setPdfPage(pdfPage) { - this.pdfPage = pdfPage; - this.pdfPageRotate = pdfPage.rotate; - const totalRotation = (this.rotation + this.pdfPageRotate) % 360; - this.viewport = pdfPage.getViewport({ - scale: 1, - rotation: totalRotation - }); - this.reset(); - } - reset() { - this.cancelRendering(); - this.renderingState = _ui_utils.RenderingStates.INITIAL; - const pageWidth = this.viewport.width, - pageHeight = this.viewport.height, - pageRatio = pageWidth / pageHeight; - this.canvasHeight = this.canvasWidth / pageRatio | 0; - this.scale = this.canvasWidth / pageWidth; - this.div.removeAttribute("data-loaded"); - const ring = this.ring; - ring.textContent = ""; - const borderAdjustment = 2 * THUMBNAIL_CANVAS_BORDER_WIDTH; - ring.style.width = this.canvasWidth + borderAdjustment + "px"; - ring.style.height = this.canvasHeight + borderAdjustment + "px"; - if (this.canvas) { - this.canvas.width = 0; - this.canvas.height = 0; - delete this.canvas; - } - if (this.image) { - this.image.removeAttribute("src"); - delete this.image; - } - } - update({ - rotation = null - }) { - if (typeof rotation === "number") { - this.rotation = rotation; - } - const totalRotation = (this.rotation + this.pdfPageRotate) % 360; - this.viewport = this.viewport.clone({ - scale: 1, - rotation: totalRotation - }); - this.reset(); - } - cancelRendering() { - if (this.renderTask) { - this.renderTask.cancel(); - this.renderTask = null; - } - this.resume = null; - } - _getPageDrawContext(upscaleFactor = 1) { - const canvas = document.createElement("canvas"); - const ctx = canvas.getContext("2d", { - alpha: false - }); - const outputScale = new _ui_utils.OutputScale(); - canvas.width = upscaleFactor * this.canvasWidth * outputScale.sx | 0; - canvas.height = upscaleFactor * this.canvasHeight * outputScale.sy | 0; - const transform = outputScale.scaled ? [outputScale.sx, 0, 0, outputScale.sy, 0, 0] : null; - return { - ctx, - canvas, - transform - }; - } - _convertCanvasToImage(canvas) { - if (this.renderingState !== _ui_utils.RenderingStates.FINISHED) { - throw new Error("_convertCanvasToImage: Rendering has not finished."); - } - const reducedCanvas = this._reduceImage(canvas); - const image = document.createElement("img"); - image.className = "thumbnailImage"; - this._thumbPageCanvas.then(msg => { - image.setAttribute("aria-label", msg); - }); - image.style.width = this.canvasWidth + "px"; - image.style.height = this.canvasHeight + "px"; - image.src = reducedCanvas.toDataURL(); - this.image = image; - this.div.setAttribute("data-loaded", true); - this.ring.append(image); - reducedCanvas.width = 0; - reducedCanvas.height = 0; - } - draw() { - if (this.renderingState !== _ui_utils.RenderingStates.INITIAL) { - console.error("Must be in new state before drawing"); - return Promise.resolve(); - } - const { - pdfPage - } = this; - if (!pdfPage) { - this.renderingState = _ui_utils.RenderingStates.FINISHED; - return Promise.reject(new Error("pdfPage is not loaded")); - } - this.renderingState = _ui_utils.RenderingStates.RUNNING; - const finishRenderTask = async (error = null) => { - if (renderTask === this.renderTask) { - this.renderTask = null; - } - if (error instanceof _pdfjsLib.RenderingCancelledException) { - return; - } - this.renderingState = _ui_utils.RenderingStates.FINISHED; - this._convertCanvasToImage(canvas); - if (error) { - throw error; - } - }; - const { - ctx, - canvas, - transform - } = this._getPageDrawContext(DRAW_UPSCALE_FACTOR); - const drawViewport = this.viewport.clone({ - scale: DRAW_UPSCALE_FACTOR * this.scale - }); - const renderContinueCallback = cont => { - if (!this.renderingQueue.isHighestPriority(this)) { - this.renderingState = _ui_utils.RenderingStates.PAUSED; - this.resume = () => { - this.renderingState = _ui_utils.RenderingStates.RUNNING; - cont(); - }; - return; - } - cont(); - }; - const renderContext = { - canvasContext: ctx, - transform, - viewport: drawViewport, - optionalContentConfigPromise: this._optionalContentConfigPromise, - pageColors: this.pageColors - }; - const renderTask = this.renderTask = pdfPage.render(renderContext); - renderTask.onContinue = renderContinueCallback; - const resultPromise = renderTask.promise.then(function () { - return finishRenderTask(null); - }, function (error) { - return finishRenderTask(error); - }); - resultPromise.finally(() => { - canvas.width = 0; - canvas.height = 0; - const pageCached = this.linkService.isPageCached(this.id); - if (!pageCached) { - this.pdfPage?.cleanup(); - } - }); - return resultPromise; - } - setImage(pageView) { - if (this.renderingState !== _ui_utils.RenderingStates.INITIAL) { - return; - } - const { - thumbnailCanvas: canvas, - pdfPage, - scale - } = pageView; - if (!canvas) { - return; - } - if (!this.pdfPage) { - this.setPdfPage(pdfPage); - } - if (scale < this.scale) { - return; - } - this.renderingState = _ui_utils.RenderingStates.FINISHED; - this._convertCanvasToImage(canvas); - } - _reduceImage(img) { - const { - ctx, - canvas - } = this._getPageDrawContext(); - if (img.width <= 2 * canvas.width) { - ctx.drawImage(img, 0, 0, img.width, img.height, 0, 0, canvas.width, canvas.height); - return canvas; - } - let reducedWidth = canvas.width << MAX_NUM_SCALING_STEPS; - let reducedHeight = canvas.height << MAX_NUM_SCALING_STEPS; - const [reducedImage, reducedImageCtx] = TempImageFactory.getCanvas(reducedWidth, reducedHeight); - while (reducedWidth > img.width || reducedHeight > img.height) { - reducedWidth >>= 1; - reducedHeight >>= 1; - } - reducedImageCtx.drawImage(img, 0, 0, img.width, img.height, 0, 0, reducedWidth, reducedHeight); - while (reducedWidth > 2 * canvas.width) { - reducedImageCtx.drawImage(reducedImage, 0, 0, reducedWidth, reducedHeight, 0, 0, reducedWidth >> 1, reducedHeight >> 1); - reducedWidth >>= 1; - reducedHeight >>= 1; - } - ctx.drawImage(reducedImage, 0, 0, reducedWidth, reducedHeight, 0, 0, canvas.width, canvas.height); - return canvas; - } - get _thumbPageTitle() { - return this.l10n.get("thumb_page_title", { - page: this.pageLabel ?? this.id - }); - } - get _thumbPageCanvas() { - return this.l10n.get("thumb_page_canvas", { - page: this.pageLabel ?? this.id - }); - } - setPageLabel(label) { - this.pageLabel = typeof label === "string" ? label : null; - this._thumbPageTitle.then(msg => { - this.anchor.title = msg; - }); - if (this.renderingState !== _ui_utils.RenderingStates.FINISHED) { - return; - } - this._thumbPageCanvas.then(msg => { - this.image?.setAttribute("aria-label", msg); - }); - } -} -exports.PDFThumbnailView = PDFThumbnailView; - -/***/ }), -/* 29 */ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.PagesCountLimit = exports.PDFViewer = exports.PDFPageViewBuffer = void 0; -var _pdfjsLib = __webpack_require__(4); -var _ui_utils = __webpack_require__(3); -var _l10n_utils = __webpack_require__(30); -var _pdf_page_view = __webpack_require__(31); -var _pdf_rendering_queue = __webpack_require__(23); -var _pdf_link_service = __webpack_require__(7); -const DEFAULT_CACHE_SIZE = 10; -const ENABLE_PERMISSIONS_CLASS = "enablePermissions"; -const PagesCountLimit = { - FORCE_SCROLL_MODE_PAGE: 15000, - FORCE_LAZY_PAGE_INIT: 7500, - PAUSE_EAGER_PAGE_INIT: 250 -}; -exports.PagesCountLimit = PagesCountLimit; -function isValidAnnotationEditorMode(mode) { - return Object.values(_pdfjsLib.AnnotationEditorType).includes(mode) && mode !== _pdfjsLib.AnnotationEditorType.DISABLE; -} -class PDFPageViewBuffer { - #buf = new Set(); - #size = 0; - constructor(size) { - this.#size = size; - } - push(view) { - const buf = this.#buf; - if (buf.has(view)) { - buf.delete(view); - } - buf.add(view); - if (buf.size > this.#size) { - this.#destroyFirstView(); - } - } - resize(newSize, idsToKeep = null) { - this.#size = newSize; - const buf = this.#buf; - if (idsToKeep) { - const ii = buf.size; - let i = 1; - for (const view of buf) { - if (idsToKeep.has(view.id)) { - buf.delete(view); - buf.add(view); - } - if (++i > ii) { - break; - } - } - } - while (buf.size > this.#size) { - this.#destroyFirstView(); - } - } - has(view) { - return this.#buf.has(view); - } - [Symbol.iterator]() { - return this.#buf.keys(); - } - #destroyFirstView() { - const firstView = this.#buf.keys().next().value; - firstView?.destroy(); - this.#buf.delete(firstView); - } -} -exports.PDFPageViewBuffer = PDFPageViewBuffer; -class PDFViewer { - #buffer = null; - #annotationEditorMode = _pdfjsLib.AnnotationEditorType.NONE; - #annotationEditorUIManager = null; - #annotationMode = _pdfjsLib.AnnotationMode.ENABLE_FORMS; - #containerTopLeft = null; - #enablePermissions = false; - #previousContainerHeight = 0; - #resizeObserver = new ResizeObserver(this.#resizeObserverCallback.bind(this)); - #scrollModePageState = null; - #onVisibilityChange = null; - #scaleTimeoutId = null; - constructor(options) { - const viewerVersion = '3.4.120'; - if (_pdfjsLib.version !== viewerVersion) { - throw new Error(`The API version "${_pdfjsLib.version}" does not match the Viewer version "${viewerVersion}".`); - } - this.container = options.container; - this.viewer = options.viewer || options.container.firstElementChild; - if (this.container?.tagName !== "DIV" || this.viewer?.tagName !== "DIV") { - throw new Error("Invalid `container` and/or `viewer` option."); - } - if (this.container.offsetParent && getComputedStyle(this.container).position !== "absolute") { - throw new Error("The `container` must be absolutely positioned."); - } - this.#resizeObserver.observe(this.container); - this.eventBus = options.eventBus; - this.linkService = options.linkService || new _pdf_link_service.SimpleLinkService(); - this.downloadManager = options.downloadManager || null; - this.findController = options.findController || null; - this._scriptingManager = options.scriptingManager || null; - this.textLayerMode = options.textLayerMode ?? _ui_utils.TextLayerMode.ENABLE; - this.#annotationMode = options.annotationMode ?? _pdfjsLib.AnnotationMode.ENABLE_FORMS; - this.#annotationEditorMode = options.annotationEditorMode ?? _pdfjsLib.AnnotationEditorType.NONE; - this.imageResourcesPath = options.imageResourcesPath || ""; - this.enablePrintAutoRotate = options.enablePrintAutoRotate || false; - this.removePageBorders = options.removePageBorders || false; - this.renderer = options.renderer || _ui_utils.RendererType.CANVAS; - this.useOnlyCssZoom = options.useOnlyCssZoom || false; - this.isOffscreenCanvasSupported = options.isOffscreenCanvasSupported ?? true; - this.maxCanvasPixels = options.maxCanvasPixels; - this.l10n = options.l10n || _l10n_utils.NullL10n; - this.#enablePermissions = options.enablePermissions || false; - this.pageColors = options.pageColors || null; - if (this.pageColors && !(CSS.supports("color", this.pageColors.background) && CSS.supports("color", this.pageColors.foreground))) { - if (this.pageColors.background || this.pageColors.foreground) { - console.warn("PDFViewer: Ignoring `pageColors`-option, since the browser doesn't support the values used."); - } - this.pageColors = null; - } - this.defaultRenderingQueue = !options.renderingQueue; - if (this.defaultRenderingQueue) { - this.renderingQueue = new _pdf_rendering_queue.PDFRenderingQueue(); - this.renderingQueue.setViewer(this); - } else { - this.renderingQueue = options.renderingQueue; - } - this.scroll = (0, _ui_utils.watchScroll)(this.container, this._scrollUpdate.bind(this)); - this.presentationModeState = _ui_utils.PresentationModeState.UNKNOWN; - this._onBeforeDraw = this._onAfterDraw = null; - this._resetView(); - if (this.removePageBorders) { - this.viewer.classList.add("removePageBorders"); - } - this.#updateContainerHeightCss(); - } - get pagesCount() { - return this._pages.length; - } - getPageView(index) { - return this._pages[index]; - } - get pageViewsReady() { - if (!this._pagesCapability.settled) { - return false; - } - return this._pages.every(function (pageView) { - return pageView?.pdfPage; - }); - } - get renderForms() { - return this.#annotationMode === _pdfjsLib.AnnotationMode.ENABLE_FORMS; - } - get enableScripting() { - return !!this._scriptingManager; - } - get currentPageNumber() { - return this._currentPageNumber; - } - set currentPageNumber(val) { - if (!Number.isInteger(val)) { - throw new Error("Invalid page number."); - } - if (!this.pdfDocument) { - return; - } - if (!this._setCurrentPageNumber(val, true)) { - console.error(`currentPageNumber: "${val}" is not a valid page.`); - } - } - _setCurrentPageNumber(val, resetCurrentPageView = false) { - if (this._currentPageNumber === val) { - if (resetCurrentPageView) { - this.#resetCurrentPageView(); - } - return true; - } - if (!(0 < val && val <= this.pagesCount)) { - return false; - } - const previous = this._currentPageNumber; - this._currentPageNumber = val; - this.eventBus.dispatch("pagechanging", { - source: this, - pageNumber: val, - pageLabel: this._pageLabels?.[val - 1] ?? null, - previous - }); - if (resetCurrentPageView) { - this.#resetCurrentPageView(); - } - return true; - } - get currentPageLabel() { - return this._pageLabels?.[this._currentPageNumber - 1] ?? null; - } - set currentPageLabel(val) { - if (!this.pdfDocument) { - return; - } - let page = val | 0; - if (this._pageLabels) { - const i = this._pageLabels.indexOf(val); - if (i >= 0) { - page = i + 1; - } - } - if (!this._setCurrentPageNumber(page, true)) { - console.error(`currentPageLabel: "${val}" is not a valid page.`); - } - } - get currentScale() { - return this._currentScale !== _ui_utils.UNKNOWN_SCALE ? this._currentScale : _ui_utils.DEFAULT_SCALE; - } - set currentScale(val) { - if (isNaN(val)) { - throw new Error("Invalid numeric scale."); - } - if (!this.pdfDocument) { - return; - } - this._setScale(val, { - noScroll: false - }); - } - get currentScaleValue() { - return this._currentScaleValue; - } - set currentScaleValue(val) { - if (!this.pdfDocument) { - return; - } - this._setScale(val, { - noScroll: false - }); - } - get pagesRotation() { - return this._pagesRotation; - } - set pagesRotation(rotation) { - if (!(0, _ui_utils.isValidRotation)(rotation)) { - throw new Error("Invalid pages rotation angle."); - } - if (!this.pdfDocument) { - return; - } - rotation %= 360; - if (rotation < 0) { - rotation += 360; - } - if (this._pagesRotation === rotation) { - return; - } - this._pagesRotation = rotation; - const pageNumber = this._currentPageNumber; - this.refresh(true, { - rotation - }); - if (this._currentScaleValue) { - this._setScale(this._currentScaleValue, { - noScroll: true - }); - } - this.eventBus.dispatch("rotationchanging", { - source: this, - pagesRotation: rotation, - pageNumber - }); - if (this.defaultRenderingQueue) { - this.update(); - } - } - get firstPagePromise() { - return this.pdfDocument ? this._firstPageCapability.promise : null; - } - get onePageRendered() { - return this.pdfDocument ? this._onePageRenderedCapability.promise : null; - } - get pagesPromise() { - return this.pdfDocument ? this._pagesCapability.promise : null; - } - #layerProperties() { - const self = this; - return { - get annotationEditorUIManager() { - return self.#annotationEditorUIManager; - }, - get annotationStorage() { - return self.pdfDocument?.annotationStorage; - }, - get downloadManager() { - return self.downloadManager; - }, - get enableScripting() { - return !!self._scriptingManager; - }, - get fieldObjectsPromise() { - return self.pdfDocument?.getFieldObjects(); - }, - get findController() { - return self.findController; - }, - get hasJSActionsPromise() { - return self.pdfDocument?.hasJSActions(); - }, - get linkService() { - return self.linkService; - } - }; - } - #initializePermissions(permissions) { - const params = { - annotationEditorMode: this.#annotationEditorMode, - annotationMode: this.#annotationMode, - textLayerMode: this.textLayerMode - }; - if (!permissions) { - return params; - } - if (!permissions.includes(_pdfjsLib.PermissionFlag.COPY)) { - this.viewer.classList.add(ENABLE_PERMISSIONS_CLASS); - } - if (!permissions.includes(_pdfjsLib.PermissionFlag.MODIFY_CONTENTS)) { - params.annotationEditorMode = _pdfjsLib.AnnotationEditorType.DISABLE; - } - if (!permissions.includes(_pdfjsLib.PermissionFlag.MODIFY_ANNOTATIONS) && !permissions.includes(_pdfjsLib.PermissionFlag.FILL_INTERACTIVE_FORMS) && this.#annotationMode === _pdfjsLib.AnnotationMode.ENABLE_FORMS) { - params.annotationMode = _pdfjsLib.AnnotationMode.ENABLE; - } - return params; - } - #onePageRenderedOrForceFetch() { - if (document.visibilityState === "hidden" || !this.container.offsetParent || this._getVisiblePages().views.length === 0) { - return Promise.resolve(); - } - const visibilityChangePromise = new Promise(resolve => { - this.#onVisibilityChange = () => { - if (document.visibilityState !== "hidden") { - return; - } - resolve(); - document.removeEventListener("visibilitychange", this.#onVisibilityChange); - this.#onVisibilityChange = null; - }; - document.addEventListener("visibilitychange", this.#onVisibilityChange); - }); - return Promise.race([this._onePageRenderedCapability.promise, visibilityChangePromise]); - } - setDocument(pdfDocument) { - if (this.pdfDocument) { - this.eventBus.dispatch("pagesdestroy", { - source: this - }); - this._cancelRendering(); - this._resetView(); - this.findController?.setDocument(null); - this._scriptingManager?.setDocument(null); - if (this.#annotationEditorUIManager) { - this.#annotationEditorUIManager.destroy(); - this.#annotationEditorUIManager = null; - } - } - this.pdfDocument = pdfDocument; - if (!pdfDocument) { - return; - } - const pagesCount = pdfDocument.numPages; - const firstPagePromise = pdfDocument.getPage(1); - const optionalContentConfigPromise = pdfDocument.getOptionalContentConfig(); - const permissionsPromise = this.#enablePermissions ? pdfDocument.getPermissions() : Promise.resolve(); - if (pagesCount > PagesCountLimit.FORCE_SCROLL_MODE_PAGE) { - console.warn("Forcing PAGE-scrolling for performance reasons, given the length of the document."); - const mode = this._scrollMode = _ui_utils.ScrollMode.PAGE; - this.eventBus.dispatch("scrollmodechanged", { - source: this, - mode - }); - } - this._pagesCapability.promise.then(() => { - this.eventBus.dispatch("pagesloaded", { - source: this, - pagesCount - }); - }, () => {}); - this._onBeforeDraw = evt => { - const pageView = this._pages[evt.pageNumber - 1]; - if (!pageView) { - return; - } - this.#buffer.push(pageView); - }; - this.eventBus._on("pagerender", this._onBeforeDraw); - this._onAfterDraw = evt => { - if (evt.cssTransform || this._onePageRenderedCapability.settled) { - return; - } - this._onePageRenderedCapability.resolve({ - timestamp: evt.timestamp - }); - this.eventBus._off("pagerendered", this._onAfterDraw); - this._onAfterDraw = null; - if (this.#onVisibilityChange) { - document.removeEventListener("visibilitychange", this.#onVisibilityChange); - this.#onVisibilityChange = null; - } - }; - this.eventBus._on("pagerendered", this._onAfterDraw); - Promise.all([firstPagePromise, permissionsPromise]).then(([firstPdfPage, permissions]) => { - if (pdfDocument !== this.pdfDocument) { - return; - } - this._firstPageCapability.resolve(firstPdfPage); - this._optionalContentConfigPromise = optionalContentConfigPromise; - const { - annotationEditorMode, - annotationMode, - textLayerMode - } = this.#initializePermissions(permissions); - if (annotationEditorMode !== _pdfjsLib.AnnotationEditorType.DISABLE) { - const mode = annotationEditorMode; - if (pdfDocument.isPureXfa) { - console.warn("Warning: XFA-editing is not implemented."); - } else if (isValidAnnotationEditorMode(mode)) { - this.#annotationEditorUIManager = new _pdfjsLib.AnnotationEditorUIManager(this.container, this.eventBus, pdfDocument?.annotationStorage); - if (mode !== _pdfjsLib.AnnotationEditorType.NONE) { - this.#annotationEditorUIManager.updateMode(mode); - } - } else { - console.error(`Invalid AnnotationEditor mode: ${mode}`); - } - } - const layerProperties = this.#layerProperties.bind(this); - const viewerElement = this._scrollMode === _ui_utils.ScrollMode.PAGE ? null : this.viewer; - const scale = this.currentScale; - const viewport = firstPdfPage.getViewport({ - scale: scale * _pdfjsLib.PixelsPerInch.PDF_TO_CSS_UNITS - }); - this.viewer.style.setProperty("--scale-factor", viewport.scale); - for (let pageNum = 1; pageNum <= pagesCount; ++pageNum) { - const pageView = new _pdf_page_view.PDFPageView({ - container: viewerElement, - eventBus: this.eventBus, - id: pageNum, - scale, - defaultViewport: viewport.clone(), - optionalContentConfigPromise, - renderingQueue: this.renderingQueue, - textLayerMode, - annotationMode, - imageResourcesPath: this.imageResourcesPath, - renderer: this.renderer, - useOnlyCssZoom: this.useOnlyCssZoom, - isOffscreenCanvasSupported: this.isOffscreenCanvasSupported, - maxCanvasPixels: this.maxCanvasPixels, - pageColors: this.pageColors, - l10n: this.l10n, - layerProperties - }); - this._pages.push(pageView); - } - const firstPageView = this._pages[0]; - if (firstPageView) { - firstPageView.setPdfPage(firstPdfPage); - this.linkService.cachePageRef(1, firstPdfPage.ref); - } - if (this._scrollMode === _ui_utils.ScrollMode.PAGE) { - this.#ensurePageViewVisible(); - } else if (this._spreadMode !== _ui_utils.SpreadMode.NONE) { - this._updateSpreadMode(); - } - this.#onePageRenderedOrForceFetch().then(async () => { - this.findController?.setDocument(pdfDocument); - this._scriptingManager?.setDocument(pdfDocument); - if (this.#annotationEditorUIManager) { - this.eventBus.dispatch("annotationeditormodechanged", { - source: this, - mode: this.#annotationEditorMode - }); - } - if (pdfDocument.loadingParams.disableAutoFetch || pagesCount > PagesCountLimit.FORCE_LAZY_PAGE_INIT) { - this._pagesCapability.resolve(); - return; - } - let getPagesLeft = pagesCount - 1; - if (getPagesLeft <= 0) { - this._pagesCapability.resolve(); - return; - } - for (let pageNum = 2; pageNum <= pagesCount; ++pageNum) { - const promise = pdfDocument.getPage(pageNum).then(pdfPage => { - const pageView = this._pages[pageNum - 1]; - if (!pageView.pdfPage) { - pageView.setPdfPage(pdfPage); - } - this.linkService.cachePageRef(pageNum, pdfPage.ref); - if (--getPagesLeft === 0) { - this._pagesCapability.resolve(); - } - }, reason => { - console.error(`Unable to get page ${pageNum} to initialize viewer`, reason); - if (--getPagesLeft === 0) { - this._pagesCapability.resolve(); - } - }); - if (pageNum % PagesCountLimit.PAUSE_EAGER_PAGE_INIT === 0) { - await promise; - } - } - }); - this.eventBus.dispatch("pagesinit", { - source: this - }); - pdfDocument.getMetadata().then(({ - info - }) => { - if (pdfDocument !== this.pdfDocument) { - return; - } - if (info.Language) { - this.viewer.lang = info.Language; - } - }); - if (this.defaultRenderingQueue) { - this.update(); - } - }).catch(reason => { - console.error("Unable to initialize viewer", reason); - this._pagesCapability.reject(reason); - }); - } - setPageLabels(labels) { - if (!this.pdfDocument) { - return; - } - if (!labels) { - this._pageLabels = null; - } else if (!(Array.isArray(labels) && this.pdfDocument.numPages === labels.length)) { - this._pageLabels = null; - console.error(`setPageLabels: Invalid page labels.`); - } else { - this._pageLabels = labels; - } - for (let i = 0, ii = this._pages.length; i < ii; i++) { - this._pages[i].setPageLabel(this._pageLabels?.[i] ?? null); - } - } - _resetView() { - this._pages = []; - this._currentPageNumber = 1; - this._currentScale = _ui_utils.UNKNOWN_SCALE; - this._currentScaleValue = null; - this._pageLabels = null; - this.#buffer = new PDFPageViewBuffer(DEFAULT_CACHE_SIZE); - this._location = null; - this._pagesRotation = 0; - this._optionalContentConfigPromise = null; - this._firstPageCapability = (0, _pdfjsLib.createPromiseCapability)(); - this._onePageRenderedCapability = (0, _pdfjsLib.createPromiseCapability)(); - this._pagesCapability = (0, _pdfjsLib.createPromiseCapability)(); - this._scrollMode = _ui_utils.ScrollMode.VERTICAL; - this._previousScrollMode = _ui_utils.ScrollMode.UNKNOWN; - this._spreadMode = _ui_utils.SpreadMode.NONE; - this.#scrollModePageState = { - previousPageNumber: 1, - scrollDown: true, - pages: [] - }; - if (this._onBeforeDraw) { - this.eventBus._off("pagerender", this._onBeforeDraw); - this._onBeforeDraw = null; - } - if (this._onAfterDraw) { - this.eventBus._off("pagerendered", this._onAfterDraw); - this._onAfterDraw = null; - } - if (this.#onVisibilityChange) { - document.removeEventListener("visibilitychange", this.#onVisibilityChange); - this.#onVisibilityChange = null; - } - this.viewer.textContent = ""; - this._updateScrollMode(); - this.viewer.removeAttribute("lang"); - this.viewer.classList.remove(ENABLE_PERMISSIONS_CLASS); - } - #ensurePageViewVisible() { - if (this._scrollMode !== _ui_utils.ScrollMode.PAGE) { - throw new Error("#ensurePageViewVisible: Invalid scrollMode value."); - } - const pageNumber = this._currentPageNumber, - state = this.#scrollModePageState, - viewer = this.viewer; - viewer.textContent = ""; - state.pages.length = 0; - if (this._spreadMode === _ui_utils.SpreadMode.NONE && !this.isInPresentationMode) { - const pageView = this._pages[pageNumber - 1]; - viewer.append(pageView.div); - state.pages.push(pageView); - } else { - const pageIndexSet = new Set(), - parity = this._spreadMode - 1; - if (parity === -1) { - pageIndexSet.add(pageNumber - 1); - } else if (pageNumber % 2 !== parity) { - pageIndexSet.add(pageNumber - 1); - pageIndexSet.add(pageNumber); - } else { - pageIndexSet.add(pageNumber - 2); - pageIndexSet.add(pageNumber - 1); - } - const spread = document.createElement("div"); - spread.className = "spread"; - if (this.isInPresentationMode) { - const dummyPage = document.createElement("div"); - dummyPage.className = "dummyPage"; - spread.append(dummyPage); - } - for (const i of pageIndexSet) { - const pageView = this._pages[i]; - if (!pageView) { - continue; - } - spread.append(pageView.div); - state.pages.push(pageView); - } - viewer.append(spread); - } - state.scrollDown = pageNumber >= state.previousPageNumber; - state.previousPageNumber = pageNumber; - } - _scrollUpdate() { - if (this.pagesCount === 0) { - return; - } - this.update(); - } - #scrollIntoView(pageView, pageSpot = null) { - const { - div, - id - } = pageView; - if (this._currentPageNumber !== id) { - this._setCurrentPageNumber(id); - } - if (this._scrollMode === _ui_utils.ScrollMode.PAGE) { - this.#ensurePageViewVisible(); - this.update(); - } - if (!pageSpot && !this.isInPresentationMode) { - const left = div.offsetLeft + div.clientLeft, - right = left + div.clientWidth; - const { - scrollLeft, - clientWidth - } = this.container; - if (this._scrollMode === _ui_utils.ScrollMode.HORIZONTAL || left < scrollLeft || right > scrollLeft + clientWidth) { - pageSpot = { - left: 0, - top: 0 - }; - } - } - (0, _ui_utils.scrollIntoView)(div, pageSpot); - if (!this._currentScaleValue && this._location) { - this._location = null; - } - } - #isSameScale(newScale) { - return newScale === this._currentScale || Math.abs(newScale - this._currentScale) < 1e-15; - } - _setScaleUpdatePages(newScale, newValue, { - noScroll = false, - preset = false, - drawingDelay = -1 - }) { - this._currentScaleValue = newValue.toString(); - if (this.#isSameScale(newScale)) { - if (preset) { - this.eventBus.dispatch("scalechanging", { - source: this, - scale: newScale, - presetValue: newValue - }); - } - return; - } - this.viewer.style.setProperty("--scale-factor", newScale * _pdfjsLib.PixelsPerInch.PDF_TO_CSS_UNITS); - const postponeDrawing = drawingDelay >= 0 && drawingDelay < 1000; - this.refresh(true, { - scale: newScale, - drawingDelay: postponeDrawing ? drawingDelay : -1 - }); - if (postponeDrawing) { - this.#scaleTimeoutId = setTimeout(() => { - this.#scaleTimeoutId = null; - this.refresh(); - }, drawingDelay); - } - this._currentScale = newScale; - if (!noScroll) { - let page = this._currentPageNumber, - dest; - if (this._location && !(this.isInPresentationMode || this.isChangingPresentationMode)) { - page = this._location.pageNumber; - dest = [null, { - name: "XYZ" - }, this._location.left, this._location.top, null]; - } - this.scrollPageIntoView({ - pageNumber: page, - destArray: dest, - allowNegativeOffset: true - }); - } - this.eventBus.dispatch("scalechanging", { - source: this, - scale: newScale, - presetValue: preset ? newValue : undefined - }); - if (this.defaultRenderingQueue) { - this.update(); - } - } - get _pageWidthScaleFactor() { - if (this._spreadMode !== _ui_utils.SpreadMode.NONE && this._scrollMode !== _ui_utils.ScrollMode.HORIZONTAL) { - return 2; - } - return 1; - } - _setScale(value, options) { - let scale = parseFloat(value); - if (scale > 0) { - options.preset = false; - this._setScaleUpdatePages(scale, value, options); - } else { - const currentPage = this._pages[this._currentPageNumber - 1]; - if (!currentPage) { - return; - } - let hPadding = _ui_utils.SCROLLBAR_PADDING, - vPadding = _ui_utils.VERTICAL_PADDING; - if (this.isInPresentationMode) { - hPadding = vPadding = 4; - if (this._spreadMode !== _ui_utils.SpreadMode.NONE) { - hPadding *= 2; - } - } else if (this.removePageBorders) { - hPadding = vPadding = 0; - } else if (this._scrollMode === _ui_utils.ScrollMode.HORIZONTAL) { - [hPadding, vPadding] = [vPadding, hPadding]; - } - const pageWidthScale = (this.container.clientWidth - hPadding) / currentPage.width * currentPage.scale / this._pageWidthScaleFactor; - const pageHeightScale = (this.container.clientHeight - vPadding) / currentPage.height * currentPage.scale; - switch (value) { - case "page-actual": - scale = 1; - break; - case "page-width": - scale = pageWidthScale; - break; - case "page-height": - scale = pageHeightScale; - break; - case "page-fit": - scale = Math.min(pageWidthScale, pageHeightScale); - break; - case "auto": - const horizontalScale = (0, _ui_utils.isPortraitOrientation)(currentPage) ? pageWidthScale : Math.min(pageHeightScale, pageWidthScale); - scale = Math.min(_ui_utils.MAX_AUTO_SCALE, horizontalScale); - break; - default: - console.error(`_setScale: "${value}" is an unknown zoom value.`); - return; - } - options.preset = true; - this._setScaleUpdatePages(scale, value, options); - } - } - #resetCurrentPageView() { - const pageView = this._pages[this._currentPageNumber - 1]; - if (this.isInPresentationMode) { - this._setScale(this._currentScaleValue, { - noScroll: true - }); - } - this.#scrollIntoView(pageView); - } - pageLabelToPageNumber(label) { - if (!this._pageLabels) { - return null; - } - const i = this._pageLabels.indexOf(label); - if (i < 0) { - return null; - } - return i + 1; - } - scrollPageIntoView({ - pageNumber, - destArray = null, - allowNegativeOffset = false, - ignoreDestinationZoom = false - }) { - if (!this.pdfDocument) { - return; - } - const pageView = Number.isInteger(pageNumber) && this._pages[pageNumber - 1]; - if (!pageView) { - console.error(`scrollPageIntoView: "${pageNumber}" is not a valid pageNumber parameter.`); - return; - } - if (this.isInPresentationMode || !destArray) { - this._setCurrentPageNumber(pageNumber, true); - return; - } - let x = 0, - y = 0; - let width = 0, - height = 0, - widthScale, - heightScale; - const changeOrientation = pageView.rotation % 180 !== 0; - const pageWidth = (changeOrientation ? pageView.height : pageView.width) / pageView.scale / _pdfjsLib.PixelsPerInch.PDF_TO_CSS_UNITS; - const pageHeight = (changeOrientation ? pageView.width : pageView.height) / pageView.scale / _pdfjsLib.PixelsPerInch.PDF_TO_CSS_UNITS; - let scale = 0; - switch (destArray[1].name) { - case "XYZ": - x = destArray[2]; - y = destArray[3]; - scale = destArray[4]; - x = x !== null ? x : 0; - y = y !== null ? y : pageHeight; - break; - case "Fit": - case "FitB": - scale = "page-fit"; - break; - case "FitH": - case "FitBH": - y = destArray[2]; - scale = "page-width"; - if (y === null && this._location) { - x = this._location.left; - y = this._location.top; - } else if (typeof y !== "number" || y < 0) { - y = pageHeight; - } - break; - case "FitV": - case "FitBV": - x = destArray[2]; - width = pageWidth; - height = pageHeight; - scale = "page-height"; - break; - case "FitR": - x = destArray[2]; - y = destArray[3]; - width = destArray[4] - x; - height = destArray[5] - y; - let hPadding = _ui_utils.SCROLLBAR_PADDING, - vPadding = _ui_utils.VERTICAL_PADDING; - if (this.removePageBorders) { - hPadding = vPadding = 0; - } - widthScale = (this.container.clientWidth - hPadding) / width / _pdfjsLib.PixelsPerInch.PDF_TO_CSS_UNITS; - heightScale = (this.container.clientHeight - vPadding) / height / _pdfjsLib.PixelsPerInch.PDF_TO_CSS_UNITS; - scale = Math.min(Math.abs(widthScale), Math.abs(heightScale)); - break; - default: - console.error(`scrollPageIntoView: "${destArray[1].name}" is not a valid destination type.`); - return; - } - if (!ignoreDestinationZoom) { - if (scale && scale !== this._currentScale) { - this.currentScaleValue = scale; - } else if (this._currentScale === _ui_utils.UNKNOWN_SCALE) { - this.currentScaleValue = _ui_utils.DEFAULT_SCALE_VALUE; - } - } - if (scale === "page-fit" && !destArray[4]) { - this.#scrollIntoView(pageView); - return; - } - const boundingRect = [pageView.viewport.convertToViewportPoint(x, y), pageView.viewport.convertToViewportPoint(x + width, y + height)]; - let left = Math.min(boundingRect[0][0], boundingRect[1][0]); - let top = Math.min(boundingRect[0][1], boundingRect[1][1]); - if (!allowNegativeOffset) { - left = Math.max(left, 0); - top = Math.max(top, 0); - } - this.#scrollIntoView(pageView, { - left, - top - }); - } - _updateLocation(firstPage) { - const currentScale = this._currentScale; - const currentScaleValue = this._currentScaleValue; - const normalizedScaleValue = parseFloat(currentScaleValue) === currentScale ? Math.round(currentScale * 10000) / 100 : currentScaleValue; - const pageNumber = firstPage.id; - const currentPageView = this._pages[pageNumber - 1]; - const container = this.container; - const topLeft = currentPageView.getPagePoint(container.scrollLeft - firstPage.x, container.scrollTop - firstPage.y); - const intLeft = Math.round(topLeft[0]); - const intTop = Math.round(topLeft[1]); - let pdfOpenParams = `#page=${pageNumber}`; - if (!this.isInPresentationMode) { - pdfOpenParams += `&zoom=${normalizedScaleValue},${intLeft},${intTop}`; - } - this._location = { - pageNumber, - scale: normalizedScaleValue, - top: intTop, - left: intLeft, - rotation: this._pagesRotation, - pdfOpenParams - }; - } - update() { - const visible = this._getVisiblePages(); - const visiblePages = visible.views, - numVisiblePages = visiblePages.length; - if (numVisiblePages === 0) { - return; - } - const newCacheSize = Math.max(DEFAULT_CACHE_SIZE, 2 * numVisiblePages + 1); - this.#buffer.resize(newCacheSize, visible.ids); - this.renderingQueue.renderHighestPriority(visible); - const isSimpleLayout = this._spreadMode === _ui_utils.SpreadMode.NONE && (this._scrollMode === _ui_utils.ScrollMode.PAGE || this._scrollMode === _ui_utils.ScrollMode.VERTICAL); - const currentId = this._currentPageNumber; - let stillFullyVisible = false; - for (const page of visiblePages) { - if (page.percent < 100) { - break; - } - if (page.id === currentId && isSimpleLayout) { - stillFullyVisible = true; - break; - } - } - this._setCurrentPageNumber(stillFullyVisible ? currentId : visiblePages[0].id); - this._updateLocation(visible.first); - this.eventBus.dispatch("updateviewarea", { - source: this, - location: this._location - }); - } - containsElement(element) { - return this.container.contains(element); - } - focus() { - this.container.focus(); - } - get _isContainerRtl() { - return getComputedStyle(this.container).direction === "rtl"; - } - get isInPresentationMode() { - return this.presentationModeState === _ui_utils.PresentationModeState.FULLSCREEN; - } - get isChangingPresentationMode() { - return this.presentationModeState === _ui_utils.PresentationModeState.CHANGING; - } - get isHorizontalScrollbarEnabled() { - return this.isInPresentationMode ? false : this.container.scrollWidth > this.container.clientWidth; - } - get isVerticalScrollbarEnabled() { - return this.isInPresentationMode ? false : this.container.scrollHeight > this.container.clientHeight; - } - _getVisiblePages() { - const views = this._scrollMode === _ui_utils.ScrollMode.PAGE ? this.#scrollModePageState.pages : this._pages, - horizontal = this._scrollMode === _ui_utils.ScrollMode.HORIZONTAL, - rtl = horizontal && this._isContainerRtl; - return (0, _ui_utils.getVisibleElements)({ - scrollEl: this.container, - views, - sortByVisibility: true, - horizontal, - rtl - }); - } - isPageVisible(pageNumber) { - if (!this.pdfDocument) { - return false; - } - if (!(Number.isInteger(pageNumber) && pageNumber > 0 && pageNumber <= this.pagesCount)) { - console.error(`isPageVisible: "${pageNumber}" is not a valid page.`); - return false; - } - return this._getVisiblePages().ids.has(pageNumber); - } - isPageCached(pageNumber) { - if (!this.pdfDocument) { - return false; - } - if (!(Number.isInteger(pageNumber) && pageNumber > 0 && pageNumber <= this.pagesCount)) { - console.error(`isPageCached: "${pageNumber}" is not a valid page.`); - return false; - } - const pageView = this._pages[pageNumber - 1]; - return this.#buffer.has(pageView); - } - cleanup() { - for (const pageView of this._pages) { - if (pageView.renderingState !== _ui_utils.RenderingStates.FINISHED) { - pageView.reset(); - } - } - } - _cancelRendering() { - for (const pageView of this._pages) { - pageView.cancelRendering(); - } - } - async #ensurePdfPageLoaded(pageView) { - if (pageView.pdfPage) { - return pageView.pdfPage; - } - try { - const pdfPage = await this.pdfDocument.getPage(pageView.id); - if (!pageView.pdfPage) { - pageView.setPdfPage(pdfPage); - } - if (!this.linkService._cachedPageNumber?.(pdfPage.ref)) { - this.linkService.cachePageRef(pageView.id, pdfPage.ref); - } - return pdfPage; - } catch (reason) { - console.error("Unable to get page for page view", reason); - return null; - } - } - #getScrollAhead(visible) { - if (visible.first?.id === 1) { - return true; - } else if (visible.last?.id === this.pagesCount) { - return false; - } - switch (this._scrollMode) { - case _ui_utils.ScrollMode.PAGE: - return this.#scrollModePageState.scrollDown; - case _ui_utils.ScrollMode.HORIZONTAL: - return this.scroll.right; - } - return this.scroll.down; - } - forceRendering(currentlyVisiblePages) { - const visiblePages = currentlyVisiblePages || this._getVisiblePages(); - const scrollAhead = this.#getScrollAhead(visiblePages); - const preRenderExtra = this._spreadMode !== _ui_utils.SpreadMode.NONE && this._scrollMode !== _ui_utils.ScrollMode.HORIZONTAL; - const pageView = this.renderingQueue.getHighestPriority(visiblePages, this._pages, scrollAhead, preRenderExtra); - if (pageView) { - this.#ensurePdfPageLoaded(pageView).then(() => { - this.renderingQueue.renderView(pageView); - }); - return true; - } - return false; - } - get hasEqualPageSizes() { - const firstPageView = this._pages[0]; - for (let i = 1, ii = this._pages.length; i < ii; ++i) { - const pageView = this._pages[i]; - if (pageView.width !== firstPageView.width || pageView.height !== firstPageView.height) { - return false; - } - } - return true; - } - getPagesOverview() { - return this._pages.map(pageView => { - const viewport = pageView.pdfPage.getViewport({ - scale: 1 - }); - if (!this.enablePrintAutoRotate || (0, _ui_utils.isPortraitOrientation)(viewport)) { - return { - width: viewport.width, - height: viewport.height, - rotation: viewport.rotation - }; - } - return { - width: viewport.height, - height: viewport.width, - rotation: (viewport.rotation - 90) % 360 - }; - }); - } - get optionalContentConfigPromise() { - if (!this.pdfDocument) { - return Promise.resolve(null); - } - if (!this._optionalContentConfigPromise) { - console.error("optionalContentConfigPromise: Not initialized yet."); - return this.pdfDocument.getOptionalContentConfig(); - } - return this._optionalContentConfigPromise; - } - set optionalContentConfigPromise(promise) { - if (!(promise instanceof Promise)) { - throw new Error(`Invalid optionalContentConfigPromise: ${promise}`); - } - if (!this.pdfDocument) { - return; - } - if (!this._optionalContentConfigPromise) { - return; - } - this._optionalContentConfigPromise = promise; - this.refresh(false, { - optionalContentConfigPromise: promise - }); - this.eventBus.dispatch("optionalcontentconfigchanged", { - source: this, - promise - }); - } - get scrollMode() { - return this._scrollMode; - } - set scrollMode(mode) { - if (this._scrollMode === mode) { - return; - } - if (!(0, _ui_utils.isValidScrollMode)(mode)) { - throw new Error(`Invalid scroll mode: ${mode}`); - } - if (this.pagesCount > PagesCountLimit.FORCE_SCROLL_MODE_PAGE) { - return; - } - this._previousScrollMode = this._scrollMode; - this._scrollMode = mode; - this.eventBus.dispatch("scrollmodechanged", { - source: this, - mode - }); - this._updateScrollMode(this._currentPageNumber); - } - _updateScrollMode(pageNumber = null) { - const scrollMode = this._scrollMode, - viewer = this.viewer; - viewer.classList.toggle("scrollHorizontal", scrollMode === _ui_utils.ScrollMode.HORIZONTAL); - viewer.classList.toggle("scrollWrapped", scrollMode === _ui_utils.ScrollMode.WRAPPED); - if (!this.pdfDocument || !pageNumber) { - return; - } - if (scrollMode === _ui_utils.ScrollMode.PAGE) { - this.#ensurePageViewVisible(); - } else if (this._previousScrollMode === _ui_utils.ScrollMode.PAGE) { - this._updateSpreadMode(); - } - if (this._currentScaleValue && isNaN(this._currentScaleValue)) { - this._setScale(this._currentScaleValue, { - noScroll: true - }); - } - this._setCurrentPageNumber(pageNumber, true); - this.update(); - } - get spreadMode() { - return this._spreadMode; - } - set spreadMode(mode) { - if (this._spreadMode === mode) { - return; - } - if (!(0, _ui_utils.isValidSpreadMode)(mode)) { - throw new Error(`Invalid spread mode: ${mode}`); - } - this._spreadMode = mode; - this.eventBus.dispatch("spreadmodechanged", { - source: this, - mode - }); - this._updateSpreadMode(this._currentPageNumber); - } - _updateSpreadMode(pageNumber = null) { - if (!this.pdfDocument) { - return; - } - const viewer = this.viewer, - pages = this._pages; - if (this._scrollMode === _ui_utils.ScrollMode.PAGE) { - this.#ensurePageViewVisible(); - } else { - viewer.textContent = ""; - if (this._spreadMode === _ui_utils.SpreadMode.NONE) { - for (const pageView of this._pages) { - viewer.append(pageView.div); - } - } else { - const parity = this._spreadMode - 1; - let spread = null; - for (let i = 0, ii = pages.length; i < ii; ++i) { - if (spread === null) { - spread = document.createElement("div"); - spread.className = "spread"; - viewer.append(spread); - } else if (i % 2 === parity) { - spread = spread.cloneNode(false); - viewer.append(spread); - } - spread.append(pages[i].div); - } - } - } - if (!pageNumber) { - return; - } - if (this._currentScaleValue && isNaN(this._currentScaleValue)) { - this._setScale(this._currentScaleValue, { - noScroll: true - }); - } - this._setCurrentPageNumber(pageNumber, true); - this.update(); - } - _getPageAdvance(currentPageNumber, previous = false) { - switch (this._scrollMode) { - case _ui_utils.ScrollMode.WRAPPED: - { - const { - views - } = this._getVisiblePages(), - pageLayout = new Map(); - for (const { - id, - y, - percent, - widthPercent - } of views) { - if (percent === 0 || widthPercent < 100) { - continue; - } - let yArray = pageLayout.get(y); - if (!yArray) { - pageLayout.set(y, yArray ||= []); - } - yArray.push(id); - } - for (const yArray of pageLayout.values()) { - const currentIndex = yArray.indexOf(currentPageNumber); - if (currentIndex === -1) { - continue; - } - const numPages = yArray.length; - if (numPages === 1) { - break; - } - if (previous) { - for (let i = currentIndex - 1, ii = 0; i >= ii; i--) { - const currentId = yArray[i], - expectedId = yArray[i + 1] - 1; - if (currentId < expectedId) { - return currentPageNumber - expectedId; - } - } - } else { - for (let i = currentIndex + 1, ii = numPages; i < ii; i++) { - const currentId = yArray[i], - expectedId = yArray[i - 1] + 1; - if (currentId > expectedId) { - return expectedId - currentPageNumber; - } - } - } - if (previous) { - const firstId = yArray[0]; - if (firstId < currentPageNumber) { - return currentPageNumber - firstId + 1; - } - } else { - const lastId = yArray[numPages - 1]; - if (lastId > currentPageNumber) { - return lastId - currentPageNumber + 1; - } - } - break; - } - break; - } - case _ui_utils.ScrollMode.HORIZONTAL: - { - break; - } - case _ui_utils.ScrollMode.PAGE: - case _ui_utils.ScrollMode.VERTICAL: - { - if (this._spreadMode === _ui_utils.SpreadMode.NONE) { - break; - } - const parity = this._spreadMode - 1; - if (previous && currentPageNumber % 2 !== parity) { - break; - } else if (!previous && currentPageNumber % 2 === parity) { - break; - } - const { - views - } = this._getVisiblePages(), - expectedId = previous ? currentPageNumber - 1 : currentPageNumber + 1; - for (const { - id, - percent, - widthPercent - } of views) { - if (id !== expectedId) { - continue; - } - if (percent > 0 && widthPercent === 100) { - return 2; - } - break; - } - break; - } - } - return 1; - } - nextPage() { - const currentPageNumber = this._currentPageNumber, - pagesCount = this.pagesCount; - if (currentPageNumber >= pagesCount) { - return false; - } - const advance = this._getPageAdvance(currentPageNumber, false) || 1; - this.currentPageNumber = Math.min(currentPageNumber + advance, pagesCount); - return true; - } - previousPage() { - const currentPageNumber = this._currentPageNumber; - if (currentPageNumber <= 1) { - return false; - } - const advance = this._getPageAdvance(currentPageNumber, true) || 1; - this.currentPageNumber = Math.max(currentPageNumber - advance, 1); - return true; - } - increaseScale(options = null) { - if (typeof options === "number") { - console.error("The `increaseScale` method-signature was updated, please use an object instead."); - options = { - steps: options - }; - } - if (!this.pdfDocument) { - return; - } - options ||= Object.create(null); - let newScale = this._currentScale; - if (options.scaleFactor > 1) { - newScale = Math.min(_ui_utils.MAX_SCALE, Math.round(newScale * options.scaleFactor * 100) / 100); - } else { - let steps = options.steps ?? 1; - do { - newScale = (newScale * _ui_utils.DEFAULT_SCALE_DELTA).toFixed(2); - newScale = Math.ceil(newScale * 10) / 10; - newScale = Math.min(_ui_utils.MAX_SCALE, newScale); - } while (--steps > 0 && newScale < _ui_utils.MAX_SCALE); - } - options.noScroll = false; - this._setScale(newScale, options); - } - decreaseScale(options = null) { - if (typeof options === "number") { - console.error("The `decreaseScale` method-signature was updated, please use an object instead."); - options = { - steps: options - }; - } - if (!this.pdfDocument) { - return; - } - options ||= Object.create(null); - let newScale = this._currentScale; - if (options.scaleFactor > 0 && options.scaleFactor < 1) { - newScale = Math.max(_ui_utils.MIN_SCALE, Math.round(newScale * options.scaleFactor * 100) / 100); - } else { - let steps = options.steps ?? 1; - do { - newScale = (newScale / _ui_utils.DEFAULT_SCALE_DELTA).toFixed(2); - newScale = Math.floor(newScale * 10) / 10; - newScale = Math.max(_ui_utils.MIN_SCALE, newScale); - } while (--steps > 0 && newScale > _ui_utils.MIN_SCALE); - } - options.noScroll = false; - this._setScale(newScale, options); - } - #updateContainerHeightCss(height = this.container.clientHeight) { - if (height !== this.#previousContainerHeight) { - this.#previousContainerHeight = height; - _ui_utils.docStyle.setProperty("--viewer-container-height", `${height}px`); - } - } - #resizeObserverCallback(entries) { - for (const entry of entries) { - if (entry.target === this.container) { - this.#updateContainerHeightCss(Math.floor(entry.borderBoxSize[0].blockSize)); - this.#containerTopLeft = null; - break; - } - } - } - get containerTopLeft() { - return this.#containerTopLeft ||= [this.container.offsetTop, this.container.offsetLeft]; - } - get annotationEditorMode() { - return this.#annotationEditorUIManager ? this.#annotationEditorMode : _pdfjsLib.AnnotationEditorType.DISABLE; - } - set annotationEditorMode(mode) { - if (!this.#annotationEditorUIManager) { - throw new Error(`The AnnotationEditor is not enabled.`); - } - if (this.#annotationEditorMode === mode) { - return; - } - if (!isValidAnnotationEditorMode(mode)) { - throw new Error(`Invalid AnnotationEditor mode: ${mode}`); - } - if (!this.pdfDocument) { - return; - } - this.#annotationEditorMode = mode; - this.eventBus.dispatch("annotationeditormodechanged", { - source: this, - mode - }); - this.#annotationEditorUIManager.updateMode(mode); - } - set annotationEditorParams({ - type, - value - }) { - if (!this.#annotationEditorUIManager) { - throw new Error(`The AnnotationEditor is not enabled.`); - } - this.#annotationEditorUIManager.updateParams(type, value); - } - refresh(noUpdate = false, updateArgs = Object.create(null)) { - if (!this.pdfDocument) { - return; - } - for (const pageView of this._pages) { - pageView.update(updateArgs); - } - if (this.#scaleTimeoutId !== null) { - clearTimeout(this.#scaleTimeoutId); - this.#scaleTimeoutId = null; - } - if (!noUpdate) { - this.update(); - } - } -} -exports.PDFViewer = PDFViewer; - -/***/ }), -/* 30 */ -/***/ ((__unused_webpack_module, exports) => { - - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.NullL10n = void 0; -exports.fixupLangCode = fixupLangCode; -exports.getL10nFallback = getL10nFallback; -const DEFAULT_L10N_STRINGS = { - of_pages: "of {{pagesCount}}", - page_of_pages: "({{pageNumber}} of {{pagesCount}})", - document_properties_kb: "{{size_kb}} KB ({{size_b}} bytes)", - document_properties_mb: "{{size_mb}} MB ({{size_b}} bytes)", - document_properties_date_string: "{{date}}, {{time}}", - document_properties_page_size_unit_inches: "in", - document_properties_page_size_unit_millimeters: "mm", - document_properties_page_size_orientation_portrait: "portrait", - document_properties_page_size_orientation_landscape: "landscape", - document_properties_page_size_name_a3: "A3", - document_properties_page_size_name_a4: "A4", - document_properties_page_size_name_letter: "Letter", - document_properties_page_size_name_legal: "Legal", - document_properties_page_size_dimension_string: "{{width}} × {{height}} {{unit}} ({{orientation}})", - document_properties_page_size_dimension_name_string: "{{width}} × {{height}} {{unit}} ({{name}}, {{orientation}})", - document_properties_linearized_yes: "Yes", - document_properties_linearized_no: "No", - additional_layers: "Additional Layers", - page_landmark: "Page {{page}}", - thumb_page_title: "Page {{page}}", - thumb_page_canvas: "Thumbnail of Page {{page}}", - find_reached_top: "Reached top of document, continued from bottom", - find_reached_bottom: "Reached end of document, continued from top", - "find_match_count[one]": "{{current}} of {{total}} match", - "find_match_count[other]": "{{current}} of {{total}} matches", - "find_match_count_limit[one]": "More than {{limit}} match", - "find_match_count_limit[other]": "More than {{limit}} matches", - find_not_found: "Phrase not found", - page_scale_width: "Page Width", - page_scale_fit: "Page Fit", - page_scale_auto: "Automatic Zoom", - page_scale_actual: "Actual Size", - page_scale_percent: "{{scale}}%", - loading_error: "An error occurred while loading the PDF.", - invalid_file_error: "Invalid or corrupted PDF file.", - missing_file_error: "Missing PDF file.", - unexpected_response_error: "Unexpected server response.", - rendering_error: "An error occurred while rendering the page.", - printing_not_supported: "Warning: Printing is not fully supported by this browser.", - printing_not_ready: "Warning: The PDF is not fully loaded for printing.", - web_fonts_disabled: "Web fonts are disabled: unable to use embedded PDF fonts.", - free_text2_default_content: "Start typing…", - editor_free_text2_aria_label: "Text Editor", - editor_ink2_aria_label: "Draw Editor", - editor_ink_canvas_aria_label: "User-created image" -}; -{ - DEFAULT_L10N_STRINGS.print_progress_percent = "{{progress}}%"; -} -function getL10nFallback(key, args) { - switch (key) { - case "find_match_count": - key = `find_match_count[${args.total === 1 ? "one" : "other"}]`; - break; - case "find_match_count_limit": - key = `find_match_count_limit[${args.limit === 1 ? "one" : "other"}]`; - break; - } - return DEFAULT_L10N_STRINGS[key] || ""; -} -const PARTIAL_LANG_CODES = { - en: "en-US", - es: "es-ES", - fy: "fy-NL", - ga: "ga-IE", - gu: "gu-IN", - hi: "hi-IN", - hy: "hy-AM", - nb: "nb-NO", - ne: "ne-NP", - nn: "nn-NO", - pa: "pa-IN", - pt: "pt-PT", - sv: "sv-SE", - zh: "zh-CN" -}; -function fixupLangCode(langCode) { - return PARTIAL_LANG_CODES[langCode?.toLowerCase()] || langCode; -} -function formatL10nValue(text, args) { - if (!args) { - return text; - } - return text.replace(/\{\{\s*(\w+)\s*\}\}/g, (all, name) => { - return name in args ? args[name] : "{{" + name + "}}"; - }); -} -const NullL10n = { - async getLanguage() { - return "en-us"; - }, - async getDirection() { - return "ltr"; - }, - async get(key, args = null, fallback = getL10nFallback(key, args)) { - return formatL10nValue(fallback, args); - }, - async translate(element) {} -}; -exports.NullL10n = NullL10n; - -/***/ }), -/* 31 */ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.PDFPageView = void 0; -var _pdfjsLib = __webpack_require__(4); -var _ui_utils = __webpack_require__(3); -var _annotation_editor_layer_builder = __webpack_require__(32); -var _annotation_layer_builder = __webpack_require__(33); -var _app_options = __webpack_require__(5); -var _l10n_utils = __webpack_require__(30); -var _pdf_link_service = __webpack_require__(7); -var _struct_tree_layer_builder = __webpack_require__(34); -var _text_accessibility = __webpack_require__(35); -var _text_highlighter = __webpack_require__(36); -var _text_layer_builder = __webpack_require__(37); -var _xfa_layer_builder = __webpack_require__(38); -const MAX_CANVAS_PIXELS = _app_options.compatibilityParams.maxCanvasPixels || 16777216; -const DEFAULT_LAYER_PROPERTIES = () => { - return null; -}; -class PDFPageView { - #annotationMode = _pdfjsLib.AnnotationMode.ENABLE_FORMS; - #layerProperties = null; - #loadingId = null; - #previousRotation = null; - #renderingState = _ui_utils.RenderingStates.INITIAL; - #useThumbnailCanvas = { - initialOptionalContent: true, - regularAnnotations: true - }; - constructor(options) { - const container = options.container; - const defaultViewport = options.defaultViewport; - this.id = options.id; - this.renderingId = "page" + this.id; - this.#layerProperties = options.layerProperties || DEFAULT_LAYER_PROPERTIES; - this.pdfPage = null; - this.pageLabel = null; - this.rotation = 0; - this.scale = options.scale || _ui_utils.DEFAULT_SCALE; - this.viewport = defaultViewport; - this.pdfPageRotate = defaultViewport.rotation; - this._optionalContentConfigPromise = options.optionalContentConfigPromise || null; - this.hasRestrictedScaling = false; - this.textLayerMode = options.textLayerMode ?? _ui_utils.TextLayerMode.ENABLE; - this.#annotationMode = options.annotationMode ?? _pdfjsLib.AnnotationMode.ENABLE_FORMS; - this.imageResourcesPath = options.imageResourcesPath || ""; - this.useOnlyCssZoom = options.useOnlyCssZoom || false; - this.isOffscreenCanvasSupported = options.isOffscreenCanvasSupported ?? true; - this.maxCanvasPixels = options.maxCanvasPixels || MAX_CANVAS_PIXELS; - this.pageColors = options.pageColors || null; - this.eventBus = options.eventBus; - this.renderingQueue = options.renderingQueue; - this.renderer = options.renderer || _ui_utils.RendererType.CANVAS; - this.l10n = options.l10n || _l10n_utils.NullL10n; - this.paintTask = null; - this.paintedViewportMap = new WeakMap(); - this.resume = null; - this._renderError = null; - this._isStandalone = !this.renderingQueue?.hasViewer(); - this._annotationCanvasMap = null; - this.annotationLayer = null; - this.annotationEditorLayer = null; - this.textLayer = null; - this.zoomLayer = null; - this.xfaLayer = null; - this.structTreeLayer = null; - const div = document.createElement("div"); - div.className = "page"; - div.setAttribute("data-page-number", this.id); - div.setAttribute("role", "region"); - this.l10n.get("page_landmark", { - page: this.id - }).then(msg => { - div.setAttribute("aria-label", msg); - }); - this.div = div; - this.#setDimensions(); - container?.append(div); - if (this._isStandalone) { - container?.style.setProperty("--scale-factor", this.scale * _pdfjsLib.PixelsPerInch.PDF_TO_CSS_UNITS); - const { - optionalContentConfigPromise - } = options; - if (optionalContentConfigPromise) { - optionalContentConfigPromise.then(optionalContentConfig => { - if (optionalContentConfigPromise !== this._optionalContentConfigPromise) { - return; - } - this.#useThumbnailCanvas.initialOptionalContent = optionalContentConfig.hasInitialVisibility; - }); - } - } - } - get renderingState() { - return this.#renderingState; - } - set renderingState(state) { - if (state === this.#renderingState) { - return; - } - this.#renderingState = state; - if (this.#loadingId) { - clearTimeout(this.#loadingId); - this.#loadingId = null; - } - switch (state) { - case _ui_utils.RenderingStates.PAUSED: - this.div.classList.remove("loading"); - break; - case _ui_utils.RenderingStates.RUNNING: - this.div.classList.add("loadingIcon"); - this.#loadingId = setTimeout(() => { - this.div.classList.add("loading"); - this.#loadingId = null; - }, 0); - break; - case _ui_utils.RenderingStates.INITIAL: - case _ui_utils.RenderingStates.FINISHED: - this.div.classList.remove("loadingIcon", "loading"); - break; - } - } - #setDimensions() { - const { - viewport - } = this; - if (this.pdfPage) { - if (this.#previousRotation === viewport.rotation) { - return; - } - this.#previousRotation = viewport.rotation; - } - (0, _pdfjsLib.setLayerDimensions)(this.div, viewport, true, false); - } - setPdfPage(pdfPage) { - this.pdfPage = pdfPage; - this.pdfPageRotate = pdfPage.rotate; - const totalRotation = (this.rotation + this.pdfPageRotate) % 360; - this.viewport = pdfPage.getViewport({ - scale: this.scale * _pdfjsLib.PixelsPerInch.PDF_TO_CSS_UNITS, - rotation: totalRotation - }); - this.#setDimensions(); - this.reset(); - } - destroy() { - this.reset(); - this.pdfPage?.cleanup(); - } - get _textHighlighter() { - return (0, _pdfjsLib.shadow)(this, "_textHighlighter", new _text_highlighter.TextHighlighter({ - pageIndex: this.id - 1, - eventBus: this.eventBus, - findController: this.#layerProperties().findController - })); - } - async #renderAnnotationLayer() { - let error = null; - try { - await this.annotationLayer.render(this.viewport, "display"); - } catch (ex) { - console.error(`#renderAnnotationLayer: "${ex}".`); - error = ex; - } finally { - this.eventBus.dispatch("annotationlayerrendered", { - source: this, - pageNumber: this.id, - error - }); - } - } - async #renderAnnotationEditorLayer() { - let error = null; - try { - await this.annotationEditorLayer.render(this.viewport, "display"); - } catch (ex) { - console.error(`#renderAnnotationEditorLayer: "${ex}".`); - error = ex; - } finally { - this.eventBus.dispatch("annotationeditorlayerrendered", { - source: this, - pageNumber: this.id, - error - }); - } - } - async #renderXfaLayer() { - let error = null; - try { - const result = await this.xfaLayer.render(this.viewport, "display"); - if (result?.textDivs && this._textHighlighter) { - this.#buildXfaTextContentItems(result.textDivs); - } - } catch (ex) { - console.error(`#renderXfaLayer: "${ex}".`); - error = ex; - } finally { - this.eventBus.dispatch("xfalayerrendered", { - source: this, - pageNumber: this.id, - error - }); - } - } - async #renderTextLayer() { - const { - pdfPage, - textLayer, - viewport - } = this; - if (!textLayer) { - return; - } - let error = null; - try { - if (!textLayer.renderingDone) { - const readableStream = pdfPage.streamTextContent({ - includeMarkedContent: true - }); - textLayer.setTextContentSource(readableStream); - } - await textLayer.render(viewport); - } catch (ex) { - if (ex instanceof _pdfjsLib.AbortException) { - return; - } - console.error(`#renderTextLayer: "${ex}".`); - error = ex; - } - this.eventBus.dispatch("textlayerrendered", { - source: this, - pageNumber: this.id, - numTextDivs: textLayer.numTextDivs, - error - }); - this.#renderStructTreeLayer(); - } - async #renderStructTreeLayer() { - if (!this.textLayer) { - return; - } - this.structTreeLayer ||= new _struct_tree_layer_builder.StructTreeLayerBuilder(); - const tree = await (!this.structTreeLayer.renderingDone ? this.pdfPage.getStructTree() : null); - const treeDom = this.structTreeLayer?.render(tree); - if (treeDom) { - this.canvas?.append(treeDom); - } - this.structTreeLayer?.show(); - } - async #buildXfaTextContentItems(textDivs) { - const text = await this.pdfPage.getTextContent(); - const items = []; - for (const item of text.items) { - items.push(item.str); - } - this._textHighlighter.setTextMapping(textDivs, items); - this._textHighlighter.enable(); - } - _resetZoomLayer(removeFromDOM = false) { - if (!this.zoomLayer) { - return; - } - const zoomLayerCanvas = this.zoomLayer.firstChild; - this.paintedViewportMap.delete(zoomLayerCanvas); - zoomLayerCanvas.width = 0; - zoomLayerCanvas.height = 0; - if (removeFromDOM) { - this.zoomLayer.remove(); - } - this.zoomLayer = null; - } - reset({ - keepZoomLayer = false, - keepAnnotationLayer = false, - keepAnnotationEditorLayer = false, - keepXfaLayer = false, - keepTextLayer = false - } = {}) { - this.cancelRendering({ - keepAnnotationLayer, - keepAnnotationEditorLayer, - keepXfaLayer, - keepTextLayer - }); - this.renderingState = _ui_utils.RenderingStates.INITIAL; - const div = this.div; - const childNodes = div.childNodes, - zoomLayerNode = keepZoomLayer && this.zoomLayer || null, - annotationLayerNode = keepAnnotationLayer && this.annotationLayer?.div || null, - annotationEditorLayerNode = keepAnnotationEditorLayer && this.annotationEditorLayer?.div || null, - xfaLayerNode = keepXfaLayer && this.xfaLayer?.div || null, - textLayerNode = keepTextLayer && this.textLayer?.div || null; - for (let i = childNodes.length - 1; i >= 0; i--) { - const node = childNodes[i]; - switch (node) { - case zoomLayerNode: - case annotationLayerNode: - case annotationEditorLayerNode: - case xfaLayerNode: - case textLayerNode: - continue; - } - node.remove(); - } - div.removeAttribute("data-loaded"); - if (annotationLayerNode) { - this.annotationLayer.hide(); - } - if (annotationEditorLayerNode) { - this.annotationEditorLayer.hide(); - } - if (xfaLayerNode) { - this.xfaLayer.hide(); - } - if (textLayerNode) { - this.textLayer.hide(); - } - this.structTreeLayer?.hide(); - if (!zoomLayerNode) { - if (this.canvas) { - this.paintedViewportMap.delete(this.canvas); - this.canvas.width = 0; - this.canvas.height = 0; - delete this.canvas; - } - this._resetZoomLayer(); - } - if (this.svg) { - this.paintedViewportMap.delete(this.svg); - delete this.svg; - } - } - update({ - scale = 0, - rotation = null, - optionalContentConfigPromise = null, - drawingDelay = -1 - }) { - this.scale = scale || this.scale; - if (typeof rotation === "number") { - this.rotation = rotation; - } - if (optionalContentConfigPromise instanceof Promise) { - this._optionalContentConfigPromise = optionalContentConfigPromise; - optionalContentConfigPromise.then(optionalContentConfig => { - if (optionalContentConfigPromise !== this._optionalContentConfigPromise) { - return; - } - this.#useThumbnailCanvas.initialOptionalContent = optionalContentConfig.hasInitialVisibility; - }); - } - const totalRotation = (this.rotation + this.pdfPageRotate) % 360; - this.viewport = this.viewport.clone({ - scale: this.scale * _pdfjsLib.PixelsPerInch.PDF_TO_CSS_UNITS, - rotation: totalRotation - }); - this.#setDimensions(); - if (this._isStandalone) { - this.div.parentNode?.style.setProperty("--scale-factor", this.viewport.scale); - } - if (this.svg) { - this.cssTransform({ - target: this.svg, - redrawAnnotationLayer: true, - redrawAnnotationEditorLayer: true, - redrawXfaLayer: true, - redrawTextLayer: true - }); - this.eventBus.dispatch("pagerendered", { - source: this, - pageNumber: this.id, - cssTransform: true, - timestamp: performance.now(), - error: this._renderError - }); - return; - } - let isScalingRestricted = false; - if (this.canvas && this.maxCanvasPixels > 0) { - const outputScale = this.outputScale; - if ((Math.floor(this.viewport.width) * outputScale.sx | 0) * (Math.floor(this.viewport.height) * outputScale.sy | 0) > this.maxCanvasPixels) { - isScalingRestricted = true; - } - } - const postponeDrawing = drawingDelay >= 0 && drawingDelay < 1000; - if (this.canvas) { - if (postponeDrawing || this.useOnlyCssZoom || this.hasRestrictedScaling && isScalingRestricted) { - if (postponeDrawing && this.renderingState !== _ui_utils.RenderingStates.FINISHED) { - this.cancelRendering({ - keepZoomLayer: true, - keepAnnotationLayer: true, - keepAnnotationEditorLayer: true, - keepXfaLayer: true, - keepTextLayer: true, - cancelExtraDelay: drawingDelay - }); - this.renderingState = _ui_utils.RenderingStates.FINISHED; - } - this.cssTransform({ - target: this.canvas, - redrawAnnotationLayer: true, - redrawAnnotationEditorLayer: true, - redrawXfaLayer: true, - redrawTextLayer: !postponeDrawing, - hideTextLayer: postponeDrawing - }); - this.eventBus.dispatch("pagerendered", { - source: this, - pageNumber: this.id, - cssTransform: true, - timestamp: performance.now(), - error: this._renderError - }); - return; - } - if (!this.zoomLayer && !this.canvas.hidden) { - this.zoomLayer = this.canvas.parentNode; - this.zoomLayer.style.position = "absolute"; - } - } - if (this.zoomLayer) { - this.cssTransform({ - target: this.zoomLayer.firstChild - }); - } - this.reset({ - keepZoomLayer: true, - keepAnnotationLayer: true, - keepAnnotationEditorLayer: true, - keepXfaLayer: true, - keepTextLayer: true - }); - } - cancelRendering({ - keepAnnotationLayer = false, - keepAnnotationEditorLayer = false, - keepXfaLayer = false, - keepTextLayer = false, - cancelExtraDelay = 0 - } = {}) { - if (this.paintTask) { - this.paintTask.cancel(cancelExtraDelay); - this.paintTask = null; - } - this.resume = null; - if (this.textLayer && (!keepTextLayer || !this.textLayer.div)) { - this.textLayer.cancel(); - this.textLayer = null; - } - if (this.structTreeLayer && !this.textLayer) { - this.structTreeLayer = null; - } - if (this.annotationLayer && (!keepAnnotationLayer || !this.annotationLayer.div)) { - this.annotationLayer.cancel(); - this.annotationLayer = null; - this._annotationCanvasMap = null; - } - if (this.annotationEditorLayer && (!keepAnnotationEditorLayer || !this.annotationEditorLayer.div)) { - this.annotationEditorLayer.cancel(); - this.annotationEditorLayer = null; - } - if (this.xfaLayer && (!keepXfaLayer || !this.xfaLayer.div)) { - this.xfaLayer.cancel(); - this.xfaLayer = null; - this._textHighlighter?.disable(); - } - } - cssTransform({ - target, - redrawAnnotationLayer = false, - redrawAnnotationEditorLayer = false, - redrawXfaLayer = false, - redrawTextLayer = false, - hideTextLayer = false - }) { - if (target instanceof HTMLCanvasElement) { - if (!target.hasAttribute("zooming")) { - target.setAttribute("zooming", true); - const { - style - } = target; - style.width = style.height = ""; - } - } else { - const div = this.div; - const { - width, - height - } = this.viewport; - target.style.width = target.parentNode.style.width = div.style.width = Math.floor(width) + "px"; - target.style.height = target.parentNode.style.height = div.style.height = Math.floor(height) + "px"; - } - const originalViewport = this.paintedViewportMap.get(target); - if (this.viewport !== originalViewport) { - const relativeRotation = this.viewport.rotation - originalViewport.rotation; - const absRotation = Math.abs(relativeRotation); - let scaleX = 1, - scaleY = 1; - if (absRotation === 90 || absRotation === 270) { - const { - width, - height - } = this.viewport; - scaleX = height / width; - scaleY = width / height; - } - if (absRotation !== 0) { - target.style.transform = `rotate(${relativeRotation}deg) scale(${scaleX}, ${scaleY})`; - } - } - if (redrawAnnotationLayer && this.annotationLayer) { - this.#renderAnnotationLayer(); - } - if (redrawAnnotationEditorLayer && this.annotationEditorLayer) { - this.#renderAnnotationEditorLayer(); - } - if (redrawXfaLayer && this.xfaLayer) { - this.#renderXfaLayer(); - } - if (this.textLayer) { - if (hideTextLayer) { - this.textLayer.hide(); - this.structTreeLayer?.hide(); - } else if (redrawTextLayer) { - this.#renderTextLayer(); - } - } - } - get width() { - return this.viewport.width; - } - get height() { - return this.viewport.height; - } - getPagePoint(x, y) { - return this.viewport.convertToPdfPoint(x, y); - } - draw() { - if (this.renderingState !== _ui_utils.RenderingStates.INITIAL) { - console.error("Must be in new state before drawing"); - this.reset(); - } - const { - div, - pdfPage - } = this; - if (!pdfPage) { - this.renderingState = _ui_utils.RenderingStates.FINISHED; - return Promise.reject(new Error("pdfPage is not loaded")); - } - this.renderingState = _ui_utils.RenderingStates.RUNNING; - const canvasWrapper = document.createElement("div"); - canvasWrapper.classList.add("canvasWrapper"); - div.append(canvasWrapper); - if (!this.textLayer && this.textLayerMode !== _ui_utils.TextLayerMode.DISABLE && !pdfPage.isPureXfa) { - this._accessibilityManager ||= new _text_accessibility.TextAccessibilityManager(); - this.textLayer = new _text_layer_builder.TextLayerBuilder({ - highlighter: this._textHighlighter, - accessibilityManager: this._accessibilityManager, - isOffscreenCanvasSupported: this.isOffscreenCanvasSupported - }); - div.append(this.textLayer.div); - } - if (!this.annotationLayer && this.#annotationMode !== _pdfjsLib.AnnotationMode.DISABLE) { - const { - annotationStorage, - downloadManager, - enableScripting, - fieldObjectsPromise, - hasJSActionsPromise, - linkService - } = this.#layerProperties(); - this._annotationCanvasMap ||= new Map(); - this.annotationLayer = new _annotation_layer_builder.AnnotationLayerBuilder({ - pageDiv: div, - pdfPage, - annotationStorage, - imageResourcesPath: this.imageResourcesPath, - renderForms: this.#annotationMode === _pdfjsLib.AnnotationMode.ENABLE_FORMS, - linkService, - downloadManager, - l10n: this.l10n, - enableScripting, - hasJSActionsPromise, - fieldObjectsPromise, - annotationCanvasMap: this._annotationCanvasMap, - accessibilityManager: this._accessibilityManager - }); - } - let renderContinueCallback = null; - if (this.renderingQueue) { - renderContinueCallback = cont => { - if (!this.renderingQueue.isHighestPriority(this)) { - this.renderingState = _ui_utils.RenderingStates.PAUSED; - this.resume = () => { - this.renderingState = _ui_utils.RenderingStates.RUNNING; - cont(); - }; - return; - } - cont(); - }; - } - const finishPaintTask = async (error = null) => { - if (paintTask === this.paintTask) { - this.paintTask = null; - } - if (error instanceof _pdfjsLib.RenderingCancelledException) { - this._renderError = null; - return; - } - this._renderError = error; - this.renderingState = _ui_utils.RenderingStates.FINISHED; - this._resetZoomLayer(true); - this.#useThumbnailCanvas.regularAnnotations = !paintTask.separateAnnots; - this.eventBus.dispatch("pagerendered", { - source: this, - pageNumber: this.id, - cssTransform: false, - timestamp: performance.now(), - error: this._renderError - }); - if (error) { - throw error; - } - }; - const paintTask = this.renderer === _ui_utils.RendererType.SVG ? this.paintOnSvg(canvasWrapper) : this.paintOnCanvas(canvasWrapper); - paintTask.onRenderContinue = renderContinueCallback; - this.paintTask = paintTask; - const resultPromise = paintTask.promise.then(() => { - return finishPaintTask(null).then(async () => { - this.#renderTextLayer(); - if (this.annotationLayer) { - await this.#renderAnnotationLayer(); - } - if (!this.annotationEditorLayer) { - const { - annotationEditorUIManager - } = this.#layerProperties(); - if (!annotationEditorUIManager) { - return; - } - this.annotationEditorLayer = new _annotation_editor_layer_builder.AnnotationEditorLayerBuilder({ - uiManager: annotationEditorUIManager, - pageDiv: div, - pdfPage, - l10n: this.l10n, - accessibilityManager: this._accessibilityManager - }); - } - this.#renderAnnotationEditorLayer(); - }); - }, function (reason) { - return finishPaintTask(reason); - }); - if (pdfPage.isPureXfa) { - if (!this.xfaLayer) { - const { - annotationStorage, - linkService - } = this.#layerProperties(); - this.xfaLayer = new _xfa_layer_builder.XfaLayerBuilder({ - pageDiv: div, - pdfPage, - annotationStorage, - linkService - }); - } else if (this.xfaLayer.div) { - div.append(this.xfaLayer.div); - } - this.#renderXfaLayer(); - } - div.setAttribute("data-loaded", true); - this.eventBus.dispatch("pagerender", { - source: this, - pageNumber: this.id - }); - return resultPromise; - } - paintOnCanvas(canvasWrapper) { - const renderCapability = (0, _pdfjsLib.createPromiseCapability)(); - const result = { - promise: renderCapability.promise, - onRenderContinue(cont) { - cont(); - }, - cancel(extraDelay = 0) { - renderTask.cancel(extraDelay); - }, - get separateAnnots() { - return renderTask.separateAnnots; - } - }; - const viewport = this.viewport; - const { - width, - height - } = viewport; - const canvas = document.createElement("canvas"); - canvas.setAttribute("role", "presentation"); - canvas.hidden = true; - let isCanvasHidden = true; - const showCanvas = function () { - if (isCanvasHidden) { - canvas.hidden = false; - isCanvasHidden = false; - } - }; - canvasWrapper.append(canvas); - this.canvas = canvas; - const ctx = canvas.getContext("2d", { - alpha: false - }); - const outputScale = this.outputScale = new _ui_utils.OutputScale(); - if (this.useOnlyCssZoom) { - const actualSizeViewport = viewport.clone({ - scale: _pdfjsLib.PixelsPerInch.PDF_TO_CSS_UNITS - }); - outputScale.sx *= actualSizeViewport.width / width; - outputScale.sy *= actualSizeViewport.height / height; - } - if (this.maxCanvasPixels > 0) { - const pixelsInViewport = width * height; - const maxScale = Math.sqrt(this.maxCanvasPixels / pixelsInViewport); - if (outputScale.sx > maxScale || outputScale.sy > maxScale) { - outputScale.sx = maxScale; - outputScale.sy = maxScale; - this.hasRestrictedScaling = true; - } else { - this.hasRestrictedScaling = false; - } - } - const sfx = (0, _ui_utils.approximateFraction)(outputScale.sx); - const sfy = (0, _ui_utils.approximateFraction)(outputScale.sy); - canvas.width = (0, _ui_utils.roundToDivide)(viewport.width * outputScale.sx, sfx[0]); - canvas.height = (0, _ui_utils.roundToDivide)(viewport.height * outputScale.sy, sfy[0]); - const { - style - } = canvas; - style.width = (0, _ui_utils.roundToDivide)(viewport.width, sfx[1]) + "px"; - style.height = (0, _ui_utils.roundToDivide)(viewport.height, sfy[1]) + "px"; - this.paintedViewportMap.set(canvas, viewport); - const transform = outputScale.scaled ? [outputScale.sx, 0, 0, outputScale.sy, 0, 0] : null; - const renderContext = { - canvasContext: ctx, - transform, - viewport, - annotationMode: this.#annotationMode, - optionalContentConfigPromise: this._optionalContentConfigPromise, - annotationCanvasMap: this._annotationCanvasMap, - pageColors: this.pageColors - }; - const renderTask = this.pdfPage.render(renderContext); - renderTask.onContinue = function (cont) { - showCanvas(); - if (result.onRenderContinue) { - result.onRenderContinue(cont); - } else { - cont(); - } - }; - renderTask.promise.then(function () { - showCanvas(); - renderCapability.resolve(); - }, function (error) { - if (!(error instanceof _pdfjsLib.RenderingCancelledException)) { - showCanvas(); - } - renderCapability.reject(error); - }); - return result; - } - paintOnSvg(wrapper) { - let cancelled = false; - const ensureNotCancelled = () => { - if (cancelled) { - throw new _pdfjsLib.RenderingCancelledException(`Rendering cancelled, page ${this.id}`, "svg"); - } - }; - const pdfPage = this.pdfPage; - const actualSizeViewport = this.viewport.clone({ - scale: _pdfjsLib.PixelsPerInch.PDF_TO_CSS_UNITS - }); - const promise = pdfPage.getOperatorList({ - annotationMode: this.#annotationMode - }).then(opList => { - ensureNotCancelled(); - const svgGfx = new _pdfjsLib.SVGGraphics(pdfPage.commonObjs, pdfPage.objs); - return svgGfx.getSVG(opList, actualSizeViewport).then(svg => { - ensureNotCancelled(); - this.svg = svg; - this.paintedViewportMap.set(svg, actualSizeViewport); - svg.style.width = wrapper.style.width; - svg.style.height = wrapper.style.height; - this.renderingState = _ui_utils.RenderingStates.FINISHED; - wrapper.append(svg); - }); - }); - return { - promise, - onRenderContinue(cont) { - cont(); - }, - cancel() { - cancelled = true; - }, - get separateAnnots() { - return false; - } - }; - } - setPageLabel(label) { - this.pageLabel = typeof label === "string" ? label : null; - if (this.pageLabel !== null) { - this.div.setAttribute("data-page-label", this.pageLabel); - } else { - this.div.removeAttribute("data-page-label"); - } - } - get thumbnailCanvas() { - const { - initialOptionalContent, - regularAnnotations - } = this.#useThumbnailCanvas; - return initialOptionalContent && regularAnnotations ? this.canvas : null; - } -} -exports.PDFPageView = PDFPageView; - -/***/ }), -/* 32 */ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.AnnotationEditorLayerBuilder = void 0; -var _pdfjsLib = __webpack_require__(4); -var _l10n_utils = __webpack_require__(30); -class AnnotationEditorLayerBuilder { - #uiManager; - constructor(options) { - this.pageDiv = options.pageDiv; - this.pdfPage = options.pdfPage; - this.accessibilityManager = options.accessibilityManager; - this.l10n = options.l10n || _l10n_utils.NullL10n; - this.annotationEditorLayer = null; - this.div = null; - this._cancelled = false; - this.#uiManager = options.uiManager; - } - async render(viewport, intent = "display") { - if (intent !== "display") { - return; - } - if (this._cancelled) { - return; - } - const clonedViewport = viewport.clone({ - dontFlip: true - }); - if (this.div) { - this.annotationEditorLayer.update({ - viewport: clonedViewport - }); - this.show(); - return; - } - const div = this.div = document.createElement("div"); - div.className = "annotationEditorLayer"; - div.tabIndex = 0; - div.hidden = true; - this.pageDiv.append(div); - this.annotationEditorLayer = new _pdfjsLib.AnnotationEditorLayer({ - uiManager: this.#uiManager, - div, - accessibilityManager: this.accessibilityManager, - pageIndex: this.pdfPage.pageNumber - 1, - l10n: this.l10n, - viewport: clonedViewport - }); - const parameters = { - viewport: clonedViewport, - div, - annotations: null, - intent - }; - this.annotationEditorLayer.render(parameters); - this.show(); - } - cancel() { - this._cancelled = true; - if (!this.div) { - return; - } - this.pageDiv = null; - this.annotationEditorLayer.destroy(); - this.div.remove(); - } - hide() { - if (!this.div) { - return; - } - this.div.hidden = true; - } - show() { - if (!this.div || this.annotationEditorLayer.isEmpty) { - return; - } - this.div.hidden = false; - } -} -exports.AnnotationEditorLayerBuilder = AnnotationEditorLayerBuilder; - -/***/ }), -/* 33 */ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.AnnotationLayerBuilder = void 0; -var _pdfjsLib = __webpack_require__(4); -var _l10n_utils = __webpack_require__(30); -var _ui_utils = __webpack_require__(3); -class AnnotationLayerBuilder { - #numAnnotations = 0; - #onPresentationModeChanged = null; - constructor({ - pageDiv, - pdfPage, - linkService, - downloadManager, - annotationStorage = null, - imageResourcesPath = "", - renderForms = true, - l10n = _l10n_utils.NullL10n, - enableScripting = false, - hasJSActionsPromise = null, - fieldObjectsPromise = null, - annotationCanvasMap = null, - accessibilityManager = null - }) { - this.pageDiv = pageDiv; - this.pdfPage = pdfPage; - this.linkService = linkService; - this.downloadManager = downloadManager; - this.imageResourcesPath = imageResourcesPath; - this.renderForms = renderForms; - this.l10n = l10n; - this.annotationStorage = annotationStorage; - this.enableScripting = enableScripting; - this._hasJSActionsPromise = hasJSActionsPromise || Promise.resolve(false); - this._fieldObjectsPromise = fieldObjectsPromise || Promise.resolve(null); - this._annotationCanvasMap = annotationCanvasMap; - this._accessibilityManager = accessibilityManager; - this.div = null; - this._cancelled = false; - this._eventBus = linkService.eventBus; - } - async render(viewport, intent = "display") { - if (this.div) { - if (this._cancelled || this.#numAnnotations === 0) { - return; - } - _pdfjsLib.AnnotationLayer.update({ - viewport: viewport.clone({ - dontFlip: true - }), - div: this.div, - annotationCanvasMap: this._annotationCanvasMap - }); - return; - } - const [annotations, hasJSActions, fieldObjects] = await Promise.all([this.pdfPage.getAnnotations({ - intent - }), this._hasJSActionsPromise, this._fieldObjectsPromise]); - if (this._cancelled) { - return; - } - this.#numAnnotations = annotations.length; - this.div = document.createElement("div"); - this.div.className = "annotationLayer"; - this.pageDiv.append(this.div); - if (this.#numAnnotations === 0) { - this.hide(); - return; - } - _pdfjsLib.AnnotationLayer.render({ - viewport: viewport.clone({ - dontFlip: true - }), - div: this.div, - annotations, - page: this.pdfPage, - imageResourcesPath: this.imageResourcesPath, - renderForms: this.renderForms, - linkService: this.linkService, - downloadManager: this.downloadManager, - annotationStorage: this.annotationStorage, - enableScripting: this.enableScripting, - hasJSActions, - fieldObjects, - annotationCanvasMap: this._annotationCanvasMap, - accessibilityManager: this._accessibilityManager - }); - this.l10n.translate(this.div); - if (this.linkService.isInPresentationMode) { - this.#updatePresentationModeState(_ui_utils.PresentationModeState.FULLSCREEN); - } - if (!this.#onPresentationModeChanged) { - this.#onPresentationModeChanged = evt => { - this.#updatePresentationModeState(evt.state); - }; - this._eventBus?._on("presentationmodechanged", this.#onPresentationModeChanged); - } - } - cancel() { - this._cancelled = true; - if (this.#onPresentationModeChanged) { - this._eventBus?._off("presentationmodechanged", this.#onPresentationModeChanged); - this.#onPresentationModeChanged = null; - } - } - hide() { - if (!this.div) { - return; - } - this.div.hidden = true; - } - #updatePresentationModeState(state) { - if (!this.div) { - return; - } - let disableFormElements = false; - switch (state) { - case _ui_utils.PresentationModeState.FULLSCREEN: - disableFormElements = true; - break; - case _ui_utils.PresentationModeState.NORMAL: - break; - default: - return; - } - for (const section of this.div.childNodes) { - if (section.hasAttribute("data-internal-link")) { - continue; - } - section.inert = disableFormElements; - } - } -} -exports.AnnotationLayerBuilder = AnnotationLayerBuilder; - -/***/ }), -/* 34 */ -/***/ ((__unused_webpack_module, exports) => { - - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.StructTreeLayerBuilder = void 0; -const PDF_ROLE_TO_HTML_ROLE = { - Document: null, - DocumentFragment: null, - Part: "group", - Sect: "group", - Div: "group", - Aside: "note", - NonStruct: "none", - P: null, - H: "heading", - Title: null, - FENote: "note", - Sub: "group", - Lbl: null, - Span: null, - Em: null, - Strong: null, - Link: "link", - Annot: "note", - Form: "form", - Ruby: null, - RB: null, - RT: null, - RP: null, - Warichu: null, - WT: null, - WP: null, - L: "list", - LI: "listitem", - LBody: null, - Table: "table", - TR: "row", - TH: "columnheader", - TD: "cell", - THead: "columnheader", - TBody: null, - TFoot: null, - Caption: null, - Figure: "figure", - Formula: null, - Artifact: null -}; -const HEADING_PATTERN = /^H(\d+)$/; -class StructTreeLayerBuilder { - #treeDom = undefined; - get renderingDone() { - return this.#treeDom !== undefined; - } - render(structTree) { - if (this.#treeDom !== undefined) { - return this.#treeDom; - } - const treeDom = this.#walk(structTree); - treeDom?.classList.add("structTree"); - return this.#treeDom = treeDom; - } - hide() { - if (this.#treeDom && !this.#treeDom.hidden) { - this.#treeDom.hidden = true; - } - } - show() { - if (this.#treeDom?.hidden) { - this.#treeDom.hidden = false; - } - } - #setAttributes(structElement, htmlElement) { - if (structElement.alt !== undefined) { - htmlElement.setAttribute("aria-label", structElement.alt); - } - if (structElement.id !== undefined) { - htmlElement.setAttribute("aria-owns", structElement.id); - } - if (structElement.lang !== undefined) { - htmlElement.setAttribute("lang", structElement.lang); - } - } - #walk(node) { - if (!node) { - return null; - } - const element = document.createElement("span"); - if ("role" in node) { - const { - role - } = node; - const match = role.match(HEADING_PATTERN); - if (match) { - element.setAttribute("role", "heading"); - element.setAttribute("aria-level", match[1]); - } else if (PDF_ROLE_TO_HTML_ROLE[role]) { - element.setAttribute("role", PDF_ROLE_TO_HTML_ROLE[role]); - } - } - this.#setAttributes(node, element); - if (node.children) { - if (node.children.length === 1 && "id" in node.children[0]) { - this.#setAttributes(node.children[0], element); - } else { - for (const kid of node.children) { - element.append(this.#walk(kid)); - } - } - } - return element; - } -} -exports.StructTreeLayerBuilder = StructTreeLayerBuilder; - -/***/ }), -/* 35 */ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.TextAccessibilityManager = void 0; -var _ui_utils = __webpack_require__(3); -class TextAccessibilityManager { - #enabled = false; - #textChildren = null; - #textNodes = new Map(); - #waitingElements = new Map(); - setTextMapping(textDivs) { - this.#textChildren = textDivs; - } - static #compareElementPositions(e1, e2) { - const rect1 = e1.getBoundingClientRect(); - const rect2 = e2.getBoundingClientRect(); - if (rect1.width === 0 && rect1.height === 0) { - return +1; - } - if (rect2.width === 0 && rect2.height === 0) { - return -1; - } - const top1 = rect1.y; - const bot1 = rect1.y + rect1.height; - const mid1 = rect1.y + rect1.height / 2; - const top2 = rect2.y; - const bot2 = rect2.y + rect2.height; - const mid2 = rect2.y + rect2.height / 2; - if (mid1 <= top2 && mid2 >= bot1) { - return -1; - } - if (mid2 <= top1 && mid1 >= bot2) { - return +1; - } - const centerX1 = rect1.x + rect1.width / 2; - const centerX2 = rect2.x + rect2.width / 2; - return centerX1 - centerX2; - } - enable() { - if (this.#enabled) { - throw new Error("TextAccessibilityManager is already enabled."); - } - if (!this.#textChildren) { - throw new Error("Text divs and strings have not been set."); - } - this.#enabled = true; - this.#textChildren = this.#textChildren.slice(); - this.#textChildren.sort(TextAccessibilityManager.#compareElementPositions); - if (this.#textNodes.size > 0) { - const textChildren = this.#textChildren; - for (const [id, nodeIndex] of this.#textNodes) { - const element = document.getElementById(id); - if (!element) { - this.#textNodes.delete(id); - continue; - } - this.#addIdToAriaOwns(id, textChildren[nodeIndex]); - } - } - for (const [element, isRemovable] of this.#waitingElements) { - this.addPointerInTextLayer(element, isRemovable); - } - this.#waitingElements.clear(); - } - disable() { - if (!this.#enabled) { - return; - } - this.#waitingElements.clear(); - this.#textChildren = null; - this.#enabled = false; - } - removePointerInTextLayer(element) { - if (!this.#enabled) { - this.#waitingElements.delete(element); - return; - } - const children = this.#textChildren; - if (!children || children.length === 0) { - return; - } - const { - id - } = element; - const nodeIndex = this.#textNodes.get(id); - if (nodeIndex === undefined) { - return; - } - const node = children[nodeIndex]; - this.#textNodes.delete(id); - let owns = node.getAttribute("aria-owns"); - if (owns?.includes(id)) { - owns = owns.split(" ").filter(x => x !== id).join(" "); - if (owns) { - node.setAttribute("aria-owns", owns); - } else { - node.removeAttribute("aria-owns"); - node.setAttribute("role", "presentation"); - } - } - } - #addIdToAriaOwns(id, node) { - const owns = node.getAttribute("aria-owns"); - if (!owns?.includes(id)) { - node.setAttribute("aria-owns", owns ? `${owns} ${id}` : id); - } - node.removeAttribute("role"); - } - addPointerInTextLayer(element, isRemovable) { - const { - id - } = element; - if (!id) { - return; - } - if (!this.#enabled) { - this.#waitingElements.set(element, isRemovable); - return; - } - if (isRemovable) { - this.removePointerInTextLayer(element); - } - const children = this.#textChildren; - if (!children || children.length === 0) { - return; - } - const index = (0, _ui_utils.binarySearchFirstItem)(children, node => TextAccessibilityManager.#compareElementPositions(element, node) < 0); - const nodeIndex = Math.max(0, index - 1); - this.#addIdToAriaOwns(id, children[nodeIndex]); - this.#textNodes.set(id, nodeIndex); - } - moveElementInDOM(container, element, contentElement, isRemovable) { - this.addPointerInTextLayer(contentElement, isRemovable); - if (!container.hasChildNodes()) { - container.append(element); - return; - } - const children = Array.from(container.childNodes).filter(node => node !== element); - if (children.length === 0) { - return; - } - const elementToCompare = contentElement || element; - const index = (0, _ui_utils.binarySearchFirstItem)(children, node => TextAccessibilityManager.#compareElementPositions(elementToCompare, node) < 0); - if (index === 0) { - children[0].before(element); - } else { - children[index - 1].after(element); - } - } -} -exports.TextAccessibilityManager = TextAccessibilityManager; - -/***/ }), -/* 36 */ -/***/ ((__unused_webpack_module, exports) => { - - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.TextHighlighter = void 0; -class TextHighlighter { - constructor({ - findController, - eventBus, - pageIndex - }) { - this.findController = findController; - this.matches = []; - this.eventBus = eventBus; - this.pageIdx = pageIndex; - this._onUpdateTextLayerMatches = null; - this.textDivs = null; - this.textContentItemsStr = null; - this.enabled = false; - } - setTextMapping(divs, texts) { - this.textDivs = divs; - this.textContentItemsStr = texts; - } - enable() { - if (!this.textDivs || !this.textContentItemsStr) { - throw new Error("Text divs and strings have not been set."); - } - if (this.enabled) { - throw new Error("TextHighlighter is already enabled."); - } - this.enabled = true; - if (!this._onUpdateTextLayerMatches) { - this._onUpdateTextLayerMatches = evt => { - if (evt.pageIndex === this.pageIdx || evt.pageIndex === -1) { - this._updateMatches(); - } - }; - this.eventBus._on("updatetextlayermatches", this._onUpdateTextLayerMatches); - } - this._updateMatches(); - } - disable() { - if (!this.enabled) { - return; - } - this.enabled = false; - if (this._onUpdateTextLayerMatches) { - this.eventBus._off("updatetextlayermatches", this._onUpdateTextLayerMatches); - this._onUpdateTextLayerMatches = null; - } - this._updateMatches(true); - } - _convertMatches(matches, matchesLength) { - if (!matches) { - return []; - } - const { - textContentItemsStr - } = this; - let i = 0, - iIndex = 0; - const end = textContentItemsStr.length - 1; - const result = []; - for (let m = 0, mm = matches.length; m < mm; m++) { - let matchIdx = matches[m]; - while (i !== end && matchIdx >= iIndex + textContentItemsStr[i].length) { - iIndex += textContentItemsStr[i].length; - i++; - } - if (i === textContentItemsStr.length) { - console.error("Could not find a matching mapping"); - } - const match = { - begin: { - divIdx: i, - offset: matchIdx - iIndex - } - }; - matchIdx += matchesLength[m]; - while (i !== end && matchIdx > iIndex + textContentItemsStr[i].length) { - iIndex += textContentItemsStr[i].length; - i++; - } - match.end = { - divIdx: i, - offset: matchIdx - iIndex - }; - result.push(match); - } - return result; - } - _renderMatches(matches) { - if (matches.length === 0) { - return; - } - const { - findController, - pageIdx - } = this; - const { - textContentItemsStr, - textDivs - } = this; - const isSelectedPage = pageIdx === findController.selected.pageIdx; - const selectedMatchIdx = findController.selected.matchIdx; - const highlightAll = findController.state.highlightAll; - let prevEnd = null; - const infinity = { - divIdx: -1, - offset: undefined - }; - function beginText(begin, className) { - const divIdx = begin.divIdx; - textDivs[divIdx].textContent = ""; - return appendTextToDiv(divIdx, 0, begin.offset, className); - } - function appendTextToDiv(divIdx, fromOffset, toOffset, className) { - let div = textDivs[divIdx]; - if (div.nodeType === Node.TEXT_NODE) { - const span = document.createElement("span"); - div.before(span); - span.append(div); - textDivs[divIdx] = span; - div = span; - } - const content = textContentItemsStr[divIdx].substring(fromOffset, toOffset); - const node = document.createTextNode(content); - if (className) { - const span = document.createElement("span"); - span.className = `${className} appended`; - span.append(node); - div.append(span); - return className.includes("selected") ? span.offsetLeft : 0; - } - div.append(node); - return 0; - } - let i0 = selectedMatchIdx, - i1 = i0 + 1; - if (highlightAll) { - i0 = 0; - i1 = matches.length; - } else if (!isSelectedPage) { - return; - } - for (let i = i0; i < i1; i++) { - const match = matches[i]; - const begin = match.begin; - const end = match.end; - const isSelected = isSelectedPage && i === selectedMatchIdx; - const highlightSuffix = isSelected ? " selected" : ""; - let selectedLeft = 0; - if (!prevEnd || begin.divIdx !== prevEnd.divIdx) { - if (prevEnd !== null) { - appendTextToDiv(prevEnd.divIdx, prevEnd.offset, infinity.offset); - } - beginText(begin); - } else { - appendTextToDiv(prevEnd.divIdx, prevEnd.offset, begin.offset); - } - if (begin.divIdx === end.divIdx) { - selectedLeft = appendTextToDiv(begin.divIdx, begin.offset, end.offset, "highlight" + highlightSuffix); - } else { - selectedLeft = appendTextToDiv(begin.divIdx, begin.offset, infinity.offset, "highlight begin" + highlightSuffix); - for (let n0 = begin.divIdx + 1, n1 = end.divIdx; n0 < n1; n0++) { - textDivs[n0].className = "highlight middle" + highlightSuffix; - } - beginText(end, "highlight end" + highlightSuffix); - } - prevEnd = end; - if (isSelected) { - findController.scrollMatchIntoView({ - element: textDivs[begin.divIdx], - selectedLeft, - pageIndex: pageIdx, - matchIndex: selectedMatchIdx - }); - } - } - if (prevEnd) { - appendTextToDiv(prevEnd.divIdx, prevEnd.offset, infinity.offset); - } - } - _updateMatches(reset = false) { - if (!this.enabled && !reset) { - return; - } - const { - findController, - matches, - pageIdx - } = this; - const { - textContentItemsStr, - textDivs - } = this; - let clearedUntilDivIdx = -1; - for (const match of matches) { - const begin = Math.max(clearedUntilDivIdx, match.begin.divIdx); - for (let n = begin, end = match.end.divIdx; n <= end; n++) { - const div = textDivs[n]; - div.textContent = textContentItemsStr[n]; - div.className = ""; - } - clearedUntilDivIdx = match.end.divIdx + 1; - } - if (!findController?.highlightMatches || reset) { - return; - } - const pageMatches = findController.pageMatches[pageIdx] || null; - const pageMatchesLength = findController.pageMatchesLength[pageIdx] || null; - this.matches = this._convertMatches(pageMatches, pageMatchesLength); - this._renderMatches(this.matches); - } -} -exports.TextHighlighter = TextHighlighter; - -/***/ }), -/* 37 */ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.TextLayerBuilder = void 0; -var _pdfjsLib = __webpack_require__(4); -class TextLayerBuilder { - #rotation = 0; - #scale = 0; - #textContentSource = null; - constructor({ - highlighter = null, - accessibilityManager = null, - isOffscreenCanvasSupported = true - }) { - this.textContentItemsStr = []; - this.renderingDone = false; - this.textDivs = []; - this.textDivProperties = new WeakMap(); - this.textLayerRenderTask = null; - this.highlighter = highlighter; - this.accessibilityManager = accessibilityManager; - this.isOffscreenCanvasSupported = isOffscreenCanvasSupported; - this.div = document.createElement("div"); - this.div.className = "textLayer"; - this.hide(); - } - #finishRendering() { - this.renderingDone = true; - const endOfContent = document.createElement("div"); - endOfContent.className = "endOfContent"; - this.div.append(endOfContent); - this.#bindMouse(); - } - get numTextDivs() { - return this.textDivs.length; - } - async render(viewport) { - if (!this.#textContentSource) { - throw new Error('No "textContentSource" parameter specified.'); - } - const scale = viewport.scale * (globalThis.devicePixelRatio || 1); - const { - rotation - } = viewport; - if (this.renderingDone) { - const mustRotate = rotation !== this.#rotation; - const mustRescale = scale !== this.#scale; - if (mustRotate || mustRescale) { - this.hide(); - (0, _pdfjsLib.updateTextLayer)({ - container: this.div, - viewport, - textDivs: this.textDivs, - textDivProperties: this.textDivProperties, - isOffscreenCanvasSupported: this.isOffscreenCanvasSupported, - mustRescale, - mustRotate - }); - this.#scale = scale; - this.#rotation = rotation; - } - this.show(); - return; - } - this.cancel(); - this.highlighter?.setTextMapping(this.textDivs, this.textContentItemsStr); - this.accessibilityManager?.setTextMapping(this.textDivs); - this.textLayerRenderTask = (0, _pdfjsLib.renderTextLayer)({ - textContentSource: this.#textContentSource, - container: this.div, - viewport, - textDivs: this.textDivs, - textDivProperties: this.textDivProperties, - textContentItemsStr: this.textContentItemsStr, - isOffscreenCanvasSupported: this.isOffscreenCanvasSupported - }); - await this.textLayerRenderTask.promise; - this.#finishRendering(); - this.#scale = scale; - this.#rotation = rotation; - this.show(); - this.accessibilityManager?.enable(); - } - hide() { - if (!this.div.hidden) { - this.highlighter?.disable(); - this.div.hidden = true; - } - } - show() { - if (this.div.hidden && this.renderingDone) { - this.div.hidden = false; - this.highlighter?.enable(); - } - } - cancel() { - if (this.textLayerRenderTask) { - this.textLayerRenderTask.cancel(); - this.textLayerRenderTask = null; - } - this.highlighter?.disable(); - this.accessibilityManager?.disable(); - this.textContentItemsStr.length = 0; - this.textDivs.length = 0; - this.textDivProperties = new WeakMap(); - } - setTextContentSource(source) { - this.cancel(); - this.#textContentSource = source; - } - #bindMouse() { - const { - div - } = this; - div.addEventListener("mousedown", evt => { - const end = div.querySelector(".endOfContent"); - if (!end) { - return; - } - let adjustTop = evt.target !== div; - adjustTop &&= getComputedStyle(end).getPropertyValue("-moz-user-select") !== "none"; - if (adjustTop) { - const divBounds = div.getBoundingClientRect(); - const r = Math.max(0, (evt.pageY - divBounds.top) / divBounds.height); - end.style.top = (r * 100).toFixed(2) + "%"; - } - end.classList.add("active"); - }); - div.addEventListener("mouseup", () => { - const end = div.querySelector(".endOfContent"); - if (!end) { - return; - } - end.style.top = ""; - end.classList.remove("active"); - }); - } -} -exports.TextLayerBuilder = TextLayerBuilder; - -/***/ }), -/* 38 */ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.XfaLayerBuilder = void 0; -var _pdfjsLib = __webpack_require__(4); -class XfaLayerBuilder { - constructor({ - pageDiv, - pdfPage, - annotationStorage = null, - linkService, - xfaHtml = null - }) { - this.pageDiv = pageDiv; - this.pdfPage = pdfPage; - this.annotationStorage = annotationStorage; - this.linkService = linkService; - this.xfaHtml = xfaHtml; - this.div = null; - this._cancelled = false; - } - async render(viewport, intent = "display") { - if (intent === "print") { - const parameters = { - viewport: viewport.clone({ - dontFlip: true - }), - div: this.div, - xfaHtml: this.xfaHtml, - annotationStorage: this.annotationStorage, - linkService: this.linkService, - intent - }; - const div = document.createElement("div"); - this.pageDiv.append(div); - parameters.div = div; - return _pdfjsLib.XfaLayer.render(parameters); - } - const xfaHtml = await this.pdfPage.getXfa(); - if (this._cancelled || !xfaHtml) { - return { - textDivs: [] - }; - } - const parameters = { - viewport: viewport.clone({ - dontFlip: true - }), - div: this.div, - xfaHtml, - annotationStorage: this.annotationStorage, - linkService: this.linkService, - intent - }; - if (this.div) { - return _pdfjsLib.XfaLayer.update(parameters); - } - this.div = document.createElement("div"); - this.pageDiv.append(this.div); - parameters.div = this.div; - return _pdfjsLib.XfaLayer.render(parameters); - } - cancel() { - this._cancelled = true; - } - hide() { - if (!this.div) { - return; - } - this.div.hidden = true; - } -} -exports.XfaLayerBuilder = XfaLayerBuilder; - -/***/ }), -/* 39 */ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.SecondaryToolbar = void 0; -var _ui_utils = __webpack_require__(3); -var _pdf_viewer = __webpack_require__(29); -class SecondaryToolbar { - constructor(options, eventBus, externalServices) { - this.toolbar = options.toolbar; - this.toggleButton = options.toggleButton; - this.buttons = [{ - element: options.presentationModeButton, - eventName: "presentationmode", - close: true - }, { - element: options.printButton, - eventName: "print", - close: true - }, { - element: options.downloadButton, - eventName: "download", - close: true - }, { - element: options.viewBookmarkButton, - eventName: null, - close: true - }, { - element: options.firstPageButton, - eventName: "firstpage", - close: true - }, { - element: options.lastPageButton, - eventName: "lastpage", - close: true - }, { - element: options.pageRotateCwButton, - eventName: "rotatecw", - close: false - }, { - element: options.pageRotateCcwButton, - eventName: "rotateccw", - close: false - }, { - element: options.cursorSelectToolButton, - eventName: "switchcursortool", - eventDetails: { - tool: _ui_utils.CursorTool.SELECT - }, - close: true - }, { - element: options.cursorHandToolButton, - eventName: "switchcursortool", - eventDetails: { - tool: _ui_utils.CursorTool.HAND - }, - close: true - }, { - element: options.scrollPageButton, - eventName: "switchscrollmode", - eventDetails: { - mode: _ui_utils.ScrollMode.PAGE - }, - close: true - }, { - element: options.scrollVerticalButton, - eventName: "switchscrollmode", - eventDetails: { - mode: _ui_utils.ScrollMode.VERTICAL - }, - close: true - }, { - element: options.scrollHorizontalButton, - eventName: "switchscrollmode", - eventDetails: { - mode: _ui_utils.ScrollMode.HORIZONTAL - }, - close: true - }, { - element: options.scrollWrappedButton, - eventName: "switchscrollmode", - eventDetails: { - mode: _ui_utils.ScrollMode.WRAPPED - }, - close: true - }, { - element: options.spreadNoneButton, - eventName: "switchspreadmode", - eventDetails: { - mode: _ui_utils.SpreadMode.NONE - }, - close: true - }, { - element: options.spreadOddButton, - eventName: "switchspreadmode", - eventDetails: { - mode: _ui_utils.SpreadMode.ODD - }, - close: true - }, { - element: options.spreadEvenButton, - eventName: "switchspreadmode", - eventDetails: { - mode: _ui_utils.SpreadMode.EVEN - }, - close: true - }, { - element: options.documentPropertiesButton, - eventName: "documentproperties", - close: true - }]; - this.buttons.push({ - element: options.openFileButton, - eventName: "openfile", - close: true - }); - this.items = { - firstPage: options.firstPageButton, - lastPage: options.lastPageButton, - pageRotateCw: options.pageRotateCwButton, - pageRotateCcw: options.pageRotateCcwButton - }; - this.eventBus = eventBus; - this.externalServices = externalServices; - this.opened = false; - this.#bindClickListeners(); - this.#bindCursorToolsListener(options); - this.#bindScrollModeListener(options); - this.#bindSpreadModeListener(options); - this.reset(); - } - get isOpen() { - return this.opened; - } - setPageNumber(pageNumber) { - this.pageNumber = pageNumber; - this.#updateUIState(); - } - setPagesCount(pagesCount) { - this.pagesCount = pagesCount; - this.#updateUIState(); - } - reset() { - this.pageNumber = 0; - this.pagesCount = 0; - this.#updateUIState(); - this.eventBus.dispatch("secondarytoolbarreset", { - source: this - }); - } - #updateUIState() { - this.items.firstPage.disabled = this.pageNumber <= 1; - this.items.lastPage.disabled = this.pageNumber >= this.pagesCount; - this.items.pageRotateCw.disabled = this.pagesCount === 0; - this.items.pageRotateCcw.disabled = this.pagesCount === 0; - } - #bindClickListeners() { - this.toggleButton.addEventListener("click", this.toggle.bind(this)); - for (const { - element, - eventName, - close, - eventDetails - } of this.buttons) { - element.addEventListener("click", evt => { - if (eventName !== null) { - const details = { - source: this - }; - for (const property in eventDetails) { - details[property] = eventDetails[property]; - } - this.eventBus.dispatch(eventName, details); - } - if (close) { - this.close(); - } - this.externalServices.reportTelemetry({ - type: "buttons", - data: { - id: element.id - } - }); - }); - } - } - #bindCursorToolsListener({ - cursorSelectToolButton, - cursorHandToolButton - }) { - this.eventBus._on("cursortoolchanged", function ({ - tool - }) { - const isSelect = tool === _ui_utils.CursorTool.SELECT, - isHand = tool === _ui_utils.CursorTool.HAND; - cursorSelectToolButton.classList.toggle("toggled", isSelect); - cursorHandToolButton.classList.toggle("toggled", isHand); - cursorSelectToolButton.setAttribute("aria-checked", isSelect); - cursorHandToolButton.setAttribute("aria-checked", isHand); - }); - } - #bindScrollModeListener({ - scrollPageButton, - scrollVerticalButton, - scrollHorizontalButton, - scrollWrappedButton, - spreadNoneButton, - spreadOddButton, - spreadEvenButton - }) { - const scrollModeChanged = ({ - mode - }) => { - const isPage = mode === _ui_utils.ScrollMode.PAGE, - isVertical = mode === _ui_utils.ScrollMode.VERTICAL, - isHorizontal = mode === _ui_utils.ScrollMode.HORIZONTAL, - isWrapped = mode === _ui_utils.ScrollMode.WRAPPED; - scrollPageButton.classList.toggle("toggled", isPage); - scrollVerticalButton.classList.toggle("toggled", isVertical); - scrollHorizontalButton.classList.toggle("toggled", isHorizontal); - scrollWrappedButton.classList.toggle("toggled", isWrapped); - scrollPageButton.setAttribute("aria-checked", isPage); - scrollVerticalButton.setAttribute("aria-checked", isVertical); - scrollHorizontalButton.setAttribute("aria-checked", isHorizontal); - scrollWrappedButton.setAttribute("aria-checked", isWrapped); - const forceScrollModePage = this.pagesCount > _pdf_viewer.PagesCountLimit.FORCE_SCROLL_MODE_PAGE; - scrollPageButton.disabled = forceScrollModePage; - scrollVerticalButton.disabled = forceScrollModePage; - scrollHorizontalButton.disabled = forceScrollModePage; - scrollWrappedButton.disabled = forceScrollModePage; - spreadNoneButton.disabled = isHorizontal; - spreadOddButton.disabled = isHorizontal; - spreadEvenButton.disabled = isHorizontal; - }; - this.eventBus._on("scrollmodechanged", scrollModeChanged); - this.eventBus._on("secondarytoolbarreset", evt => { - if (evt.source === this) { - scrollModeChanged({ - mode: _ui_utils.ScrollMode.VERTICAL - }); - } - }); - } - #bindSpreadModeListener({ - spreadNoneButton, - spreadOddButton, - spreadEvenButton - }) { - function spreadModeChanged({ - mode - }) { - const isNone = mode === _ui_utils.SpreadMode.NONE, - isOdd = mode === _ui_utils.SpreadMode.ODD, - isEven = mode === _ui_utils.SpreadMode.EVEN; - spreadNoneButton.classList.toggle("toggled", isNone); - spreadOddButton.classList.toggle("toggled", isOdd); - spreadEvenButton.classList.toggle("toggled", isEven); - spreadNoneButton.setAttribute("aria-checked", isNone); - spreadOddButton.setAttribute("aria-checked", isOdd); - spreadEvenButton.setAttribute("aria-checked", isEven); - } - this.eventBus._on("spreadmodechanged", spreadModeChanged); - this.eventBus._on("secondarytoolbarreset", evt => { - if (evt.source === this) { - spreadModeChanged({ - mode: _ui_utils.SpreadMode.NONE - }); - } - }); - } - open() { - if (this.opened) { - return; - } - this.opened = true; - this.toggleButton.classList.add("toggled"); - this.toggleButton.setAttribute("aria-expanded", "true"); - this.toolbar.classList.remove("hidden"); - } - close() { - if (!this.opened) { - return; - } - this.opened = false; - this.toolbar.classList.add("hidden"); - this.toggleButton.classList.remove("toggled"); - this.toggleButton.setAttribute("aria-expanded", "false"); - } - toggle() { - if (this.opened) { - this.close(); - } else { - this.open(); - } - } -} -exports.SecondaryToolbar = SecondaryToolbar; - -/***/ }), -/* 40 */ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.Toolbar = void 0; -var _ui_utils = __webpack_require__(3); -var _pdfjsLib = __webpack_require__(4); -const PAGE_NUMBER_LOADING_INDICATOR = "visiblePageIsLoading"; -class Toolbar { - #wasLocalized = false; - constructor(options, eventBus, l10n) { - this.toolbar = options.container; - this.eventBus = eventBus; - this.l10n = l10n; - this.buttons = [{ - element: options.previous, - eventName: "previouspage" - }, { - element: options.next, - eventName: "nextpage" - }, { - element: options.zoomIn, - eventName: "zoomin" - }, { - element: options.zoomOut, - eventName: "zoomout" - }, { - element: options.print, - eventName: "print" - }, { - element: options.download, - eventName: "download" - }, { - element: options.editorFreeTextButton, - eventName: "switchannotationeditormode", - eventDetails: { - get mode() { - const { - classList - } = options.editorFreeTextButton; - return classList.contains("toggled") ? _pdfjsLib.AnnotationEditorType.NONE : _pdfjsLib.AnnotationEditorType.FREETEXT; - } - } - }, { - element: options.editorInkButton, - eventName: "switchannotationeditormode", - eventDetails: { - get mode() { - const { - classList - } = options.editorInkButton; - return classList.contains("toggled") ? _pdfjsLib.AnnotationEditorType.NONE : _pdfjsLib.AnnotationEditorType.INK; - } - } - }]; - this.buttons.push({ - element: options.openFile, - eventName: "openfile" - }); - this.items = { - numPages: options.numPages, - pageNumber: options.pageNumber, - scaleSelect: options.scaleSelect, - customScaleOption: options.customScaleOption, - previous: options.previous, - next: options.next, - zoomIn: options.zoomIn, - zoomOut: options.zoomOut - }; - this.#bindListeners(options); - this.reset(); - } - setPageNumber(pageNumber, pageLabel) { - this.pageNumber = pageNumber; - this.pageLabel = pageLabel; - this.#updateUIState(false); - } - setPagesCount(pagesCount, hasPageLabels) { - this.pagesCount = pagesCount; - this.hasPageLabels = hasPageLabels; - this.#updateUIState(true); - } - setPageScale(pageScaleValue, pageScale) { - this.pageScaleValue = (pageScaleValue || pageScale).toString(); - this.pageScale = pageScale; - this.#updateUIState(false); - } - reset() { - this.pageNumber = 0; - this.pageLabel = null; - this.hasPageLabels = false; - this.pagesCount = 0; - this.pageScaleValue = _ui_utils.DEFAULT_SCALE_VALUE; - this.pageScale = _ui_utils.DEFAULT_SCALE; - this.#updateUIState(true); - this.updateLoadingIndicatorState(); - this.eventBus.dispatch("toolbarreset", { - source: this - }); - } - #bindListeners(options) { - const { - pageNumber, - scaleSelect - } = this.items; - const self = this; - for (const { - element, - eventName, - eventDetails - } of this.buttons) { - element.addEventListener("click", evt => { - if (eventName !== null) { - const details = { - source: this - }; - if (eventDetails) { - for (const property in eventDetails) { - details[property] = eventDetails[property]; - } - } - this.eventBus.dispatch(eventName, details); - } - }); - } - pageNumber.addEventListener("click", function () { - this.select(); - }); - pageNumber.addEventListener("change", function () { - self.eventBus.dispatch("pagenumberchanged", { - source: self, - value: this.value - }); - }); - scaleSelect.addEventListener("change", function () { - if (this.value === "custom") { - return; - } - self.eventBus.dispatch("scalechanged", { - source: self, - value: this.value - }); - }); - scaleSelect.addEventListener("click", function (evt) { - const target = evt.target; - if (this.value === self.pageScaleValue && target.tagName.toUpperCase() === "OPTION") { - this.blur(); - } - }); - scaleSelect.oncontextmenu = _ui_utils.noContextMenuHandler; - this.eventBus._on("localized", () => { - this.#wasLocalized = true; - this.#adjustScaleWidth(); - this.#updateUIState(true); - }); - this.#bindEditorToolsListener(options); - } - #bindEditorToolsListener({ - editorFreeTextButton, - editorFreeTextParamsToolbar, - editorInkButton, - editorInkParamsToolbar - }) { - const editorModeChanged = (evt, disableButtons = false) => { - const editorButtons = [{ - mode: _pdfjsLib.AnnotationEditorType.FREETEXT, - button: editorFreeTextButton, - toolbar: editorFreeTextParamsToolbar - }, { - mode: _pdfjsLib.AnnotationEditorType.INK, - button: editorInkButton, - toolbar: editorInkParamsToolbar - }]; - for (const { - mode, - button, - toolbar - } of editorButtons) { - const checked = mode === evt.mode; - button.classList.toggle("toggled", checked); - button.setAttribute("aria-checked", checked); - button.disabled = disableButtons; - toolbar?.classList.toggle("hidden", !checked); - } - }; - this.eventBus._on("annotationeditormodechanged", editorModeChanged); - this.eventBus._on("toolbarreset", evt => { - if (evt.source === this) { - editorModeChanged({ - mode: _pdfjsLib.AnnotationEditorType.NONE - }, true); - } - }); - } - #updateUIState(resetNumPages = false) { - if (!this.#wasLocalized) { - return; - } - const { - pageNumber, - pagesCount, - pageScaleValue, - pageScale, - items - } = this; - if (resetNumPages) { - if (this.hasPageLabels) { - items.pageNumber.type = "text"; - } else { - items.pageNumber.type = "number"; - this.l10n.get("of_pages", { - pagesCount - }).then(msg => { - items.numPages.textContent = msg; - }); - } - items.pageNumber.max = pagesCount; - } - if (this.hasPageLabels) { - items.pageNumber.value = this.pageLabel; - this.l10n.get("page_of_pages", { - pageNumber, - pagesCount - }).then(msg => { - items.numPages.textContent = msg; - }); - } else { - items.pageNumber.value = pageNumber; - } - items.previous.disabled = pageNumber <= 1; - items.next.disabled = pageNumber >= pagesCount; - items.zoomOut.disabled = pageScale <= _ui_utils.MIN_SCALE; - items.zoomIn.disabled = pageScale >= _ui_utils.MAX_SCALE; - this.l10n.get("page_scale_percent", { - scale: Math.round(pageScale * 10000) / 100 - }).then(msg => { - let predefinedValueFound = false; - for (const option of items.scaleSelect.options) { - if (option.value !== pageScaleValue) { - option.selected = false; - continue; - } - option.selected = true; - predefinedValueFound = true; - } - if (!predefinedValueFound) { - items.customScaleOption.textContent = msg; - items.customScaleOption.selected = true; - } - }); - } - updateLoadingIndicatorState(loading = false) { - const { - pageNumber - } = this.items; - pageNumber.classList.toggle(PAGE_NUMBER_LOADING_INDICATOR, loading); - } - async #adjustScaleWidth() { - const { - items, - l10n - } = this; - const predefinedValuesPromise = Promise.all([l10n.get("page_scale_auto"), l10n.get("page_scale_actual"), l10n.get("page_scale_fit"), l10n.get("page_scale_width")]); - await _ui_utils.animationStarted; - const style = getComputedStyle(items.scaleSelect); - const scaleSelectWidth = parseFloat(style.getPropertyValue("--scale-select-width")); - const canvas = document.createElement("canvas"); - const ctx = canvas.getContext("2d", { - alpha: false - }); - ctx.font = `${style.fontSize} ${style.fontFamily}`; - let maxWidth = 0; - for (const predefinedValue of await predefinedValuesPromise) { - const { - width - } = ctx.measureText(predefinedValue); - if (width > maxWidth) { - maxWidth = width; - } - } - maxWidth += 0.3 * scaleSelectWidth; - if (maxWidth > scaleSelectWidth) { - const container = items.scaleSelect.parentNode; - container.style.setProperty("--scale-select-width", `${maxWidth}px`); - } - canvas.width = 0; - canvas.height = 0; - } -} -exports.Toolbar = Toolbar; - -/***/ }), -/* 41 */ -/***/ ((__unused_webpack_module, exports) => { - - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.ViewHistory = void 0; -const DEFAULT_VIEW_HISTORY_CACHE_SIZE = 20; -class ViewHistory { - constructor(fingerprint, cacheSize = DEFAULT_VIEW_HISTORY_CACHE_SIZE) { - this.fingerprint = fingerprint; - this.cacheSize = cacheSize; - this._initializedPromise = this._readFromStorage().then(databaseStr => { - const database = JSON.parse(databaseStr || "{}"); - let index = -1; - if (!Array.isArray(database.files)) { - database.files = []; - } else { - while (database.files.length >= this.cacheSize) { - database.files.shift(); - } - for (let i = 0, ii = database.files.length; i < ii; i++) { - const branch = database.files[i]; - if (branch.fingerprint === this.fingerprint) { - index = i; - break; - } - } - } - if (index === -1) { - index = database.files.push({ - fingerprint: this.fingerprint - }) - 1; - } - this.file = database.files[index]; - this.database = database; - }); - } - async _writeToStorage() { - const databaseStr = JSON.stringify(this.database); - localStorage.setItem("pdfjs.history", databaseStr); - } - async _readFromStorage() { - return localStorage.getItem("pdfjs.history"); - } - async set(name, val) { - await this._initializedPromise; - this.file[name] = val; - return this._writeToStorage(); - } - async setMultiple(properties) { - await this._initializedPromise; - for (const name in properties) { - this.file[name] = properties[name]; - } - return this._writeToStorage(); - } - async get(name, defaultValue) { - await this._initializedPromise; - const val = this.file[name]; - return val !== undefined ? val : defaultValue; - } - async getMultiple(properties) { - await this._initializedPromise; - const values = Object.create(null); - for (const name in properties) { - const val = this.file[name]; - values[name] = val !== undefined ? val : properties[name]; - } - return values; - } -} -exports.ViewHistory = ViewHistory; - -/***/ }), -/* 42 */ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.BasePreferences = void 0; -var _app_options = __webpack_require__(5); -class BasePreferences { - #defaults = Object.freeze({ - "annotationEditorMode": 0, - "annotationMode": 2, - "cursorToolOnLoad": 0, - "defaultZoomDelay": 400, - "defaultZoomValue": "", - "disablePageLabels": false, - "enablePermissions": false, - "enablePrintAutoRotate": true, - "enableScripting": true, - "externalLinkTarget": 0, - "historyUpdateUrl": false, - "ignoreDestinationZoom": false, - "forcePageColors": false, - "pageColorsBackground": "Canvas", - "pageColorsForeground": "CanvasText", - "pdfBugEnabled": false, - "sidebarViewOnLoad": -1, - "scrollModeOnLoad": -1, - "spreadModeOnLoad": -1, - "textLayerMode": 1, - "useOnlyCssZoom": false, - "viewerCssTheme": 0, - "viewOnLoad": 0, - "disableAutoFetch": false, - "disableFontFace": false, - "disableRange": false, - "disableStream": false, - "enableXfa": true, - "renderer": "canvas" - }); - #prefs = Object.create(null); - #initializedPromise = null; - constructor() { - if (this.constructor === BasePreferences) { - throw new Error("Cannot initialize BasePreferences."); - } - this.#initializedPromise = this._readFromStorage(this.#defaults).then(prefs => { - for (const name in this.#defaults) { - const prefValue = prefs?.[name]; - if (typeof prefValue === typeof this.#defaults[name]) { - this.#prefs[name] = prefValue; - } - } - }); - } - async _writeToStorage(prefObj) { - throw new Error("Not implemented: _writeToStorage"); - } - async _readFromStorage(prefObj) { - throw new Error("Not implemented: _readFromStorage"); - } - async reset() { - await this.#initializedPromise; - const prefs = this.#prefs; - this.#prefs = Object.create(null); - return this._writeToStorage(this.#defaults).catch(reason => { - this.#prefs = prefs; - throw reason; - }); - } - async set(name, value) { - await this.#initializedPromise; - const defaultValue = this.#defaults[name], - prefs = this.#prefs; - if (defaultValue === undefined) { - throw new Error(`Set preference: "${name}" is undefined.`); - } else if (value === undefined) { - throw new Error("Set preference: no value is specified."); - } - const valueType = typeof value, - defaultType = typeof defaultValue; - if (valueType !== defaultType) { - if (valueType === "number" && defaultType === "string") { - value = value.toString(); - } else { - throw new Error(`Set preference: "${value}" is a ${valueType}, expected a ${defaultType}.`); - } - } else { - if (valueType === "number" && !Number.isInteger(value)) { - throw new Error(`Set preference: "${value}" must be an integer.`); - } - } - this.#prefs[name] = value; - return this._writeToStorage(this.#prefs).catch(reason => { - this.#prefs = prefs; - throw reason; - }); - } - async get(name) { - await this.#initializedPromise; - const defaultValue = this.#defaults[name]; - if (defaultValue === undefined) { - throw new Error(`Get preference: "${name}" is undefined.`); - } - return this.#prefs[name] ?? defaultValue; - } - async getAll() { - await this.#initializedPromise; - const obj = Object.create(null); - for (const name in this.#defaults) { - obj[name] = this.#prefs[name] ?? this.#defaults[name]; - } - return obj; - } -} -exports.BasePreferences = BasePreferences; - -/***/ }), -/* 43 */ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.DownloadManager = void 0; -var _pdfjsLib = __webpack_require__(4); -; -function download(blobUrl, filename) { - const a = document.createElement("a"); - if (!a.click) { - throw new Error('DownloadManager: "a.click()" is not supported.'); - } - a.href = blobUrl; - a.target = "_parent"; - if ("download" in a) { - a.download = filename; - } - (document.body || document.documentElement).append(a); - a.click(); - a.remove(); -} -class DownloadManager { - #openBlobUrls = new WeakMap(); - downloadUrl(url, filename) { - if (!(0, _pdfjsLib.createValidAbsoluteUrl)(url, "http://example.com")) { - console.error(`downloadUrl - not a valid URL: ${url}`); - return; - } - download(url + "#pdfjs.action=download", filename); - } - downloadData(data, filename, contentType) { - const blobUrl = URL.createObjectURL(new Blob([data], { - type: contentType - })); - download(blobUrl, filename); - } - openOrDownloadData(element, data, filename) { - const isPdfData = (0, _pdfjsLib.isPdfFile)(filename); - const contentType = isPdfData ? "application/pdf" : ""; - if (isPdfData) { - let blobUrl = this.#openBlobUrls.get(element); - if (!blobUrl) { - blobUrl = URL.createObjectURL(new Blob([data], { - type: contentType - })); - this.#openBlobUrls.set(element, blobUrl); - } - let viewerUrl; - viewerUrl = "?file=" + encodeURIComponent(blobUrl + "#" + filename); - try { - window.open(viewerUrl); - return true; - } catch (ex) { - console.error(`openOrDownloadData: ${ex}`); - URL.revokeObjectURL(blobUrl); - this.#openBlobUrls.delete(element); - } - } - this.downloadData(data, filename, contentType); - return false; - } - download(blob, url, filename) { - const blobUrl = URL.createObjectURL(blob); - download(blobUrl, filename); - } -} -exports.DownloadManager = DownloadManager; - -/***/ }), -/* 44 */ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.GenericL10n = void 0; -__webpack_require__(45); -var _l10n_utils = __webpack_require__(30); -const webL10n = document.webL10n; -class GenericL10n { - constructor(lang) { - this._lang = lang; - this._ready = new Promise((resolve, reject) => { - webL10n.setLanguage((0, _l10n_utils.fixupLangCode)(lang), () => { - resolve(webL10n); - }); - }); - } - async getLanguage() { - const l10n = await this._ready; - return l10n.getLanguage(); - } - async getDirection() { - const l10n = await this._ready; - return l10n.getDirection(); - } - async get(key, args = null, fallback = (0, _l10n_utils.getL10nFallback)(key, args)) { - const l10n = await this._ready; - return l10n.get(key, args, fallback); - } - async translate(element) { - const l10n = await this._ready; - return l10n.translate(element); - } -} -exports.GenericL10n = GenericL10n; - -/***/ }), -/* 45 */ -/***/ (() => { - - - -document.webL10n = function (window, document, undefined) { - var gL10nData = {}; - var gTextData = ''; - var gTextProp = 'textContent'; - var gLanguage = ''; - var gMacros = {}; - var gReadyState = 'loading'; - var gAsyncResourceLoading = true; - function getL10nResourceLinks() { - return document.querySelectorAll('link[type="application/l10n"]'); - } - function getL10nDictionary() { - var script = document.querySelector('script[type="application/l10n"]'); - return script ? JSON.parse(script.innerHTML) : null; - } - function getTranslatableChildren(element) { - return element ? element.querySelectorAll('*[data-l10n-id]') : []; - } - function getL10nAttributes(element) { - if (!element) return {}; - var l10nId = element.getAttribute('data-l10n-id'); - var l10nArgs = element.getAttribute('data-l10n-args'); - var args = {}; - if (l10nArgs) { - try { - args = JSON.parse(l10nArgs); - } catch (e) { - console.warn('could not parse arguments for #' + l10nId); - } - } - return { - id: l10nId, - args: args - }; - } - function xhrLoadText(url, onSuccess, onFailure) { - onSuccess = onSuccess || function _onSuccess(data) {}; - onFailure = onFailure || function _onFailure() {}; - var xhr = new XMLHttpRequest(); - xhr.open('GET', url, gAsyncResourceLoading); - if (xhr.overrideMimeType) { - xhr.overrideMimeType('text/plain; charset=utf-8'); - } - xhr.onreadystatechange = function () { - if (xhr.readyState == 4) { - if (xhr.status == 200 || xhr.status === 0) { - onSuccess(xhr.responseText); - } else { - onFailure(); - } - } - }; - xhr.onerror = onFailure; - xhr.ontimeout = onFailure; - try { - xhr.send(null); - } catch (e) { - onFailure(); - } - } - function parseResource(href, lang, successCallback, failureCallback) { - var baseURL = href.replace(/[^\/]*$/, '') || './'; - function evalString(text) { - if (text.lastIndexOf('\\') < 0) return text; - return text.replace(/\\\\/g, '\\').replace(/\\n/g, '\n').replace(/\\r/g, '\r').replace(/\\t/g, '\t').replace(/\\b/g, '\b').replace(/\\f/g, '\f').replace(/\\{/g, '{').replace(/\\}/g, '}').replace(/\\"/g, '"').replace(/\\'/g, "'"); - } - function parseProperties(text, parsedPropertiesCallback) { - var dictionary = {}; - var reBlank = /^\s*|\s*$/; - var reComment = /^\s*#|^\s*$/; - var reSection = /^\s*\[(.*)\]\s*$/; - var reImport = /^\s*@import\s+url\((.*)\)\s*$/i; - var reSplit = /^([^=\s]*)\s*=\s*(.+)$/; - function parseRawLines(rawText, extendedSyntax, parsedRawLinesCallback) { - var entries = rawText.replace(reBlank, '').split(/[\r\n]+/); - var currentLang = '*'; - var genericLang = lang.split('-', 1)[0]; - var skipLang = false; - var match = ''; - function nextEntry() { - while (true) { - if (!entries.length) { - parsedRawLinesCallback(); - return; - } - var line = entries.shift(); - if (reComment.test(line)) continue; - if (extendedSyntax) { - match = reSection.exec(line); - if (match) { - currentLang = match[1].toLowerCase(); - skipLang = currentLang !== '*' && currentLang !== lang && currentLang !== genericLang; - continue; - } else if (skipLang) { - continue; - } - match = reImport.exec(line); - if (match) { - loadImport(baseURL + match[1], nextEntry); - return; - } - } - var tmp = line.match(reSplit); - if (tmp && tmp.length == 3) { - dictionary[tmp[1]] = evalString(tmp[2]); - } - } - } - nextEntry(); - } - function loadImport(url, callback) { - xhrLoadText(url, function (content) { - parseRawLines(content, false, callback); - }, function () { - console.warn(url + ' not found.'); - callback(); - }); - } - parseRawLines(text, true, function () { - parsedPropertiesCallback(dictionary); - }); - } - xhrLoadText(href, function (response) { - gTextData += response; - parseProperties(response, function (data) { - for (var key in data) { - var id, - prop, - index = key.lastIndexOf('.'); - if (index > 0) { - id = key.substring(0, index); - prop = key.substring(index + 1); - } else { - id = key; - prop = gTextProp; - } - if (!gL10nData[id]) { - gL10nData[id] = {}; - } - gL10nData[id][prop] = data[key]; - } - if (successCallback) { - successCallback(); - } - }); - }, failureCallback); - } - function loadLocale(lang, callback) { - if (lang) { - lang = lang.toLowerCase(); - } - callback = callback || function _callback() {}; - clear(); - gLanguage = lang; - var langLinks = getL10nResourceLinks(); - var langCount = langLinks.length; - if (langCount === 0) { - var dict = getL10nDictionary(); - if (dict && dict.locales && dict.default_locale) { - console.log('using the embedded JSON directory, early way out'); - gL10nData = dict.locales[lang]; - if (!gL10nData) { - var defaultLocale = dict.default_locale.toLowerCase(); - for (var anyCaseLang in dict.locales) { - anyCaseLang = anyCaseLang.toLowerCase(); - if (anyCaseLang === lang) { - gL10nData = dict.locales[lang]; - break; - } else if (anyCaseLang === defaultLocale) { - gL10nData = dict.locales[defaultLocale]; - } - } - } - callback(); - } else { - console.log('no resource to load, early way out'); - } - gReadyState = 'complete'; - return; - } - var onResourceLoaded = null; - var gResourceCount = 0; - onResourceLoaded = function () { - gResourceCount++; - if (gResourceCount >= langCount) { - callback(); - gReadyState = 'complete'; - } - }; - function L10nResourceLink(link) { - var href = link.href; - this.load = function (lang, callback) { - parseResource(href, lang, callback, function () { - console.warn(href + ' not found.'); - console.warn('"' + lang + '" resource not found'); - gLanguage = ''; - callback(); - }); - }; - } - for (var i = 0; i < langCount; i++) { - var resource = new L10nResourceLink(langLinks[i]); - resource.load(lang, onResourceLoaded); - } - } - function clear() { - gL10nData = {}; - gTextData = ''; - gLanguage = ''; - } - function getPluralRules(lang) { - var locales2rules = { - 'af': 3, - 'ak': 4, - 'am': 4, - 'ar': 1, - 'asa': 3, - 'az': 0, - 'be': 11, - 'bem': 3, - 'bez': 3, - 'bg': 3, - 'bh': 4, - 'bm': 0, - 'bn': 3, - 'bo': 0, - 'br': 20, - 'brx': 3, - 'bs': 11, - 'ca': 3, - 'cgg': 3, - 'chr': 3, - 'cs': 12, - 'cy': 17, - 'da': 3, - 'de': 3, - 'dv': 3, - 'dz': 0, - 'ee': 3, - 'el': 3, - 'en': 3, - 'eo': 3, - 'es': 3, - 'et': 3, - 'eu': 3, - 'fa': 0, - 'ff': 5, - 'fi': 3, - 'fil': 4, - 'fo': 3, - 'fr': 5, - 'fur': 3, - 'fy': 3, - 'ga': 8, - 'gd': 24, - 'gl': 3, - 'gsw': 3, - 'gu': 3, - 'guw': 4, - 'gv': 23, - 'ha': 3, - 'haw': 3, - 'he': 2, - 'hi': 4, - 'hr': 11, - 'hu': 0, - 'id': 0, - 'ig': 0, - 'ii': 0, - 'is': 3, - 'it': 3, - 'iu': 7, - 'ja': 0, - 'jmc': 3, - 'jv': 0, - 'ka': 0, - 'kab': 5, - 'kaj': 3, - 'kcg': 3, - 'kde': 0, - 'kea': 0, - 'kk': 3, - 'kl': 3, - 'km': 0, - 'kn': 0, - 'ko': 0, - 'ksb': 3, - 'ksh': 21, - 'ku': 3, - 'kw': 7, - 'lag': 18, - 'lb': 3, - 'lg': 3, - 'ln': 4, - 'lo': 0, - 'lt': 10, - 'lv': 6, - 'mas': 3, - 'mg': 4, - 'mk': 16, - 'ml': 3, - 'mn': 3, - 'mo': 9, - 'mr': 3, - 'ms': 0, - 'mt': 15, - 'my': 0, - 'nah': 3, - 'naq': 7, - 'nb': 3, - 'nd': 3, - 'ne': 3, - 'nl': 3, - 'nn': 3, - 'no': 3, - 'nr': 3, - 'nso': 4, - 'ny': 3, - 'nyn': 3, - 'om': 3, - 'or': 3, - 'pa': 3, - 'pap': 3, - 'pl': 13, - 'ps': 3, - 'pt': 3, - 'rm': 3, - 'ro': 9, - 'rof': 3, - 'ru': 11, - 'rwk': 3, - 'sah': 0, - 'saq': 3, - 'se': 7, - 'seh': 3, - 'ses': 0, - 'sg': 0, - 'sh': 11, - 'shi': 19, - 'sk': 12, - 'sl': 14, - 'sma': 7, - 'smi': 7, - 'smj': 7, - 'smn': 7, - 'sms': 7, - 'sn': 3, - 'so': 3, - 'sq': 3, - 'sr': 11, - 'ss': 3, - 'ssy': 3, - 'st': 3, - 'sv': 3, - 'sw': 3, - 'syr': 3, - 'ta': 3, - 'te': 3, - 'teo': 3, - 'th': 0, - 'ti': 4, - 'tig': 3, - 'tk': 3, - 'tl': 4, - 'tn': 3, - 'to': 0, - 'tr': 0, - 'ts': 3, - 'tzm': 22, - 'uk': 11, - 'ur': 3, - 've': 3, - 'vi': 0, - 'vun': 3, - 'wa': 4, - 'wae': 3, - 'wo': 0, - 'xh': 3, - 'xog': 3, - 'yo': 0, - 'zh': 0, - 'zu': 3 - }; - function isIn(n, list) { - return list.indexOf(n) !== -1; - } - function isBetween(n, start, end) { - return start <= n && n <= end; - } - var pluralRules = { - '0': function (n) { - return 'other'; - }, - '1': function (n) { - if (isBetween(n % 100, 3, 10)) return 'few'; - if (n === 0) return 'zero'; - if (isBetween(n % 100, 11, 99)) return 'many'; - if (n == 2) return 'two'; - if (n == 1) return 'one'; - return 'other'; - }, - '2': function (n) { - if (n !== 0 && n % 10 === 0) return 'many'; - if (n == 2) return 'two'; - if (n == 1) return 'one'; - return 'other'; - }, - '3': function (n) { - if (n == 1) return 'one'; - return 'other'; - }, - '4': function (n) { - if (isBetween(n, 0, 1)) return 'one'; - return 'other'; - }, - '5': function (n) { - if (isBetween(n, 0, 2) && n != 2) return 'one'; - return 'other'; - }, - '6': function (n) { - if (n === 0) return 'zero'; - if (n % 10 == 1 && n % 100 != 11) return 'one'; - return 'other'; - }, - '7': function (n) { - if (n == 2) return 'two'; - if (n == 1) return 'one'; - return 'other'; - }, - '8': function (n) { - if (isBetween(n, 3, 6)) return 'few'; - if (isBetween(n, 7, 10)) return 'many'; - if (n == 2) return 'two'; - if (n == 1) return 'one'; - return 'other'; - }, - '9': function (n) { - if (n === 0 || n != 1 && isBetween(n % 100, 1, 19)) return 'few'; - if (n == 1) return 'one'; - return 'other'; - }, - '10': function (n) { - if (isBetween(n % 10, 2, 9) && !isBetween(n % 100, 11, 19)) return 'few'; - if (n % 10 == 1 && !isBetween(n % 100, 11, 19)) return 'one'; - return 'other'; - }, - '11': function (n) { - if (isBetween(n % 10, 2, 4) && !isBetween(n % 100, 12, 14)) return 'few'; - if (n % 10 === 0 || isBetween(n % 10, 5, 9) || isBetween(n % 100, 11, 14)) return 'many'; - if (n % 10 == 1 && n % 100 != 11) return 'one'; - return 'other'; - }, - '12': function (n) { - if (isBetween(n, 2, 4)) return 'few'; - if (n == 1) return 'one'; - return 'other'; - }, - '13': function (n) { - if (isBetween(n % 10, 2, 4) && !isBetween(n % 100, 12, 14)) return 'few'; - if (n != 1 && isBetween(n % 10, 0, 1) || isBetween(n % 10, 5, 9) || isBetween(n % 100, 12, 14)) return 'many'; - if (n == 1) return 'one'; - return 'other'; - }, - '14': function (n) { - if (isBetween(n % 100, 3, 4)) return 'few'; - if (n % 100 == 2) return 'two'; - if (n % 100 == 1) return 'one'; - return 'other'; - }, - '15': function (n) { - if (n === 0 || isBetween(n % 100, 2, 10)) return 'few'; - if (isBetween(n % 100, 11, 19)) return 'many'; - if (n == 1) return 'one'; - return 'other'; - }, - '16': function (n) { - if (n % 10 == 1 && n != 11) return 'one'; - return 'other'; - }, - '17': function (n) { - if (n == 3) return 'few'; - if (n === 0) return 'zero'; - if (n == 6) return 'many'; - if (n == 2) return 'two'; - if (n == 1) return 'one'; - return 'other'; - }, - '18': function (n) { - if (n === 0) return 'zero'; - if (isBetween(n, 0, 2) && n !== 0 && n != 2) return 'one'; - return 'other'; - }, - '19': function (n) { - if (isBetween(n, 2, 10)) return 'few'; - if (isBetween(n, 0, 1)) return 'one'; - return 'other'; - }, - '20': function (n) { - if ((isBetween(n % 10, 3, 4) || n % 10 == 9) && !(isBetween(n % 100, 10, 19) || isBetween(n % 100, 70, 79) || isBetween(n % 100, 90, 99))) return 'few'; - if (n % 1000000 === 0 && n !== 0) return 'many'; - if (n % 10 == 2 && !isIn(n % 100, [12, 72, 92])) return 'two'; - if (n % 10 == 1 && !isIn(n % 100, [11, 71, 91])) return 'one'; - return 'other'; - }, - '21': function (n) { - if (n === 0) return 'zero'; - if (n == 1) return 'one'; - return 'other'; - }, - '22': function (n) { - if (isBetween(n, 0, 1) || isBetween(n, 11, 99)) return 'one'; - return 'other'; - }, - '23': function (n) { - if (isBetween(n % 10, 1, 2) || n % 20 === 0) return 'one'; - return 'other'; - }, - '24': function (n) { - if (isBetween(n, 3, 10) || isBetween(n, 13, 19)) return 'few'; - if (isIn(n, [2, 12])) return 'two'; - if (isIn(n, [1, 11])) return 'one'; - return 'other'; - } - }; - var index = locales2rules[lang.replace(/-.*$/, '')]; - if (!(index in pluralRules)) { - console.warn('plural form unknown for [' + lang + ']'); - return function () { - return 'other'; - }; - } - return pluralRules[index]; - } - gMacros.plural = function (str, param, key, prop) { - var n = parseFloat(param); - if (isNaN(n)) return str; - if (prop != gTextProp) return str; - if (!gMacros._pluralRules) { - gMacros._pluralRules = getPluralRules(gLanguage); - } - var index = '[' + gMacros._pluralRules(n) + ']'; - if (n === 0 && key + '[zero]' in gL10nData) { - str = gL10nData[key + '[zero]'][prop]; - } else if (n == 1 && key + '[one]' in gL10nData) { - str = gL10nData[key + '[one]'][prop]; - } else if (n == 2 && key + '[two]' in gL10nData) { - str = gL10nData[key + '[two]'][prop]; - } else if (key + index in gL10nData) { - str = gL10nData[key + index][prop]; - } else if (key + '[other]' in gL10nData) { - str = gL10nData[key + '[other]'][prop]; - } - return str; - }; - function getL10nData(key, args, fallback) { - var data = gL10nData[key]; - if (!data) { - console.warn('#' + key + ' is undefined.'); - if (!fallback) { - return null; - } - data = fallback; - } - var rv = {}; - for (var prop in data) { - var str = data[prop]; - str = substIndexes(str, args, key, prop); - str = substArguments(str, args, key); - rv[prop] = str; - } - return rv; - } - function substIndexes(str, args, key, prop) { - var reIndex = /\{\[\s*([a-zA-Z]+)\(([a-zA-Z]+)\)\s*\]\}/; - var reMatch = reIndex.exec(str); - if (!reMatch || !reMatch.length) return str; - var macroName = reMatch[1]; - var paramName = reMatch[2]; - var param; - if (args && paramName in args) { - param = args[paramName]; - } else if (paramName in gL10nData) { - param = gL10nData[paramName]; - } - if (macroName in gMacros) { - var macro = gMacros[macroName]; - str = macro(str, param, key, prop); - } - return str; - } - function substArguments(str, args, key) { - var reArgs = /\{\{\s*(.+?)\s*\}\}/g; - return str.replace(reArgs, function (matched_text, arg) { - if (args && arg in args) { - return args[arg]; - } - if (arg in gL10nData) { - return gL10nData[arg]; - } - console.log('argument {{' + arg + '}} for #' + key + ' is undefined.'); - return matched_text; - }); - } - function translateElement(element) { - var l10n = getL10nAttributes(element); - if (!l10n.id) return; - var data = getL10nData(l10n.id, l10n.args); - if (!data) { - console.warn('#' + l10n.id + ' is undefined.'); - return; - } - if (data[gTextProp]) { - if (getChildElementCount(element) === 0) { - element[gTextProp] = data[gTextProp]; - } else { - var children = element.childNodes; - var found = false; - for (var i = 0, l = children.length; i < l; i++) { - if (children[i].nodeType === 3 && /\S/.test(children[i].nodeValue)) { - if (found) { - children[i].nodeValue = ''; - } else { - children[i].nodeValue = data[gTextProp]; - found = true; - } - } - } - if (!found) { - var textNode = document.createTextNode(data[gTextProp]); - element.prepend(textNode); - } - } - delete data[gTextProp]; - } - for (var k in data) { - element[k] = data[k]; - } - } - function getChildElementCount(element) { - if (element.children) { - return element.children.length; - } - if (typeof element.childElementCount !== 'undefined') { - return element.childElementCount; - } - var count = 0; - for (var i = 0; i < element.childNodes.length; i++) { - count += element.nodeType === 1 ? 1 : 0; - } - return count; - } - function translateFragment(element) { - element = element || document.documentElement; - var children = getTranslatableChildren(element); - var elementCount = children.length; - for (var i = 0; i < elementCount; i++) { - translateElement(children[i]); - } - translateElement(element); - } - return { - get: function (key, args, fallbackString) { - var index = key.lastIndexOf('.'); - var prop = gTextProp; - if (index > 0) { - prop = key.substring(index + 1); - key = key.substring(0, index); - } - var fallback; - if (fallbackString) { - fallback = {}; - fallback[prop] = fallbackString; - } - var data = getL10nData(key, args, fallback); - if (data && prop in data) { - return data[prop]; - } - return '{{' + key + '}}'; - }, - getData: function () { - return gL10nData; - }, - getText: function () { - return gTextData; - }, - getLanguage: function () { - return gLanguage; - }, - setLanguage: function (lang, callback) { - loadLocale(lang, function () { - if (callback) callback(); - }); - }, - getDirection: function () { - var rtlList = ['ar', 'he', 'fa', 'ps', 'ur']; - var shortCode = gLanguage.split('-', 1)[0]; - return rtlList.indexOf(shortCode) >= 0 ? 'rtl' : 'ltr'; - }, - translate: translateFragment, - getReadyState: function () { - return gReadyState; - }, - ready: function (callback) { - if (!callback) { - return; - } else if (gReadyState == 'complete' || gReadyState == 'interactive') { - window.setTimeout(function () { - callback(); - }); - } else if (document.addEventListener) { - document.addEventListener('localized', function once() { - document.removeEventListener('localized', once); - callback(); - }); - } - } - }; -}(window, document); - -/***/ }), -/* 46 */ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.GenericScripting = void 0; -exports.docPropertiesLookup = docPropertiesLookup; -var _pdfjsLib = __webpack_require__(4); -async function docPropertiesLookup(pdfDocument) { - const url = "", - baseUrl = url.split("#")[0]; - let { - info, - metadata, - contentDispositionFilename, - contentLength - } = await pdfDocument.getMetadata(); - if (!contentLength) { - const { - length - } = await pdfDocument.getDownloadInfo(); - contentLength = length; - } - return { - ...info, - baseURL: baseUrl, - filesize: contentLength, - filename: contentDispositionFilename || (0, _pdfjsLib.getPdfFilenameFromUrl)(url), - metadata: metadata?.getRaw(), - authors: metadata?.get("dc:creator"), - numPages: pdfDocument.numPages, - URL: url - }; -} -class GenericScripting { - constructor(sandboxBundleSrc) { - this._ready = (0, _pdfjsLib.loadScript)(sandboxBundleSrc, true).then(() => { - return window.pdfjsSandbox.QuickJSSandbox(); - }); - } - async createSandbox(data) { - const sandbox = await this._ready; - sandbox.create(data); - } - async dispatchEventInSandbox(event) { - const sandbox = await this._ready; - setTimeout(() => sandbox.dispatchEvent(event), 0); - } - async destroySandbox() { - const sandbox = await this._ready; - sandbox.nukeSandbox(); - } -} -exports.GenericScripting = GenericScripting; - -/***/ }), -/* 47 */ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.PDFPrintService = PDFPrintService; -var _pdfjsLib = __webpack_require__(4); -var _app = __webpack_require__(2); -var _print_utils = __webpack_require__(48); -let activeService = null; -let dialog = null; -let overlayManager = null; -function renderPage(activeServiceOnEntry, pdfDocument, pageNumber, size, printResolution, optionalContentConfigPromise, printAnnotationStoragePromise) { - const scratchCanvas = activeService.scratchCanvas; - const PRINT_UNITS = printResolution / _pdfjsLib.PixelsPerInch.PDF; - scratchCanvas.width = Math.floor(size.width * PRINT_UNITS); - scratchCanvas.height = Math.floor(size.height * PRINT_UNITS); - const ctx = scratchCanvas.getContext("2d"); - ctx.save(); - ctx.fillStyle = "rgb(255, 255, 255)"; - ctx.fillRect(0, 0, scratchCanvas.width, scratchCanvas.height); - ctx.restore(); - return Promise.all([pdfDocument.getPage(pageNumber), printAnnotationStoragePromise]).then(function ([pdfPage, printAnnotationStorage]) { - const renderContext = { - canvasContext: ctx, - transform: [PRINT_UNITS, 0, 0, PRINT_UNITS, 0, 0], - viewport: pdfPage.getViewport({ - scale: 1, - rotation: size.rotation - }), - intent: "print", - annotationMode: _pdfjsLib.AnnotationMode.ENABLE_STORAGE, - optionalContentConfigPromise, - printAnnotationStorage - }; - return pdfPage.render(renderContext).promise; - }); -} -function PDFPrintService(pdfDocument, pagesOverview, printContainer, printResolution, optionalContentConfigPromise = null, printAnnotationStoragePromise = null, l10n) { - this.pdfDocument = pdfDocument; - this.pagesOverview = pagesOverview; - this.printContainer = printContainer; - this._printResolution = printResolution || 150; - this._optionalContentConfigPromise = optionalContentConfigPromise || pdfDocument.getOptionalContentConfig(); - this._printAnnotationStoragePromise = printAnnotationStoragePromise || Promise.resolve(); - this.l10n = l10n; - this.currentPage = -1; - this.scratchCanvas = document.createElement("canvas"); -} -PDFPrintService.prototype = { - layout() { - this.throwIfInactive(); - const body = document.querySelector("body"); - body.setAttribute("data-pdfjsprinting", true); - const hasEqualPageSizes = this.pagesOverview.every(function (size) { - return size.width === this.pagesOverview[0].width && size.height === this.pagesOverview[0].height; - }, this); - if (!hasEqualPageSizes) { - console.warn("Not all pages have the same size. The printed " + "result may be incorrect!"); - } - this.pageStyleSheet = document.createElement("style"); - const pageSize = this.pagesOverview[0]; - this.pageStyleSheet.textContent = "@page { size: " + pageSize.width + "pt " + pageSize.height + "pt;}"; - body.append(this.pageStyleSheet); - }, - destroy() { - if (activeService !== this) { - return; - } - this.printContainer.textContent = ""; - const body = document.querySelector("body"); - body.removeAttribute("data-pdfjsprinting"); - if (this.pageStyleSheet) { - this.pageStyleSheet.remove(); - this.pageStyleSheet = null; - } - this.scratchCanvas.width = this.scratchCanvas.height = 0; - this.scratchCanvas = null; - activeService = null; - ensureOverlay().then(function () { - if (overlayManager.active === dialog) { - overlayManager.close(dialog); - } - }); - }, - renderPages() { - if (this.pdfDocument.isPureXfa) { - (0, _print_utils.getXfaHtmlForPrinting)(this.printContainer, this.pdfDocument); - return Promise.resolve(); - } - const pageCount = this.pagesOverview.length; - const renderNextPage = (resolve, reject) => { - this.throwIfInactive(); - if (++this.currentPage >= pageCount) { - renderProgress(pageCount, pageCount, this.l10n); - resolve(); - return; - } - const index = this.currentPage; - renderProgress(index, pageCount, this.l10n); - renderPage(this, this.pdfDocument, index + 1, this.pagesOverview[index], this._printResolution, this._optionalContentConfigPromise, this._printAnnotationStoragePromise).then(this.useRenderedPage.bind(this)).then(function () { - renderNextPage(resolve, reject); - }, reject); - }; - return new Promise(renderNextPage); - }, - useRenderedPage() { - this.throwIfInactive(); - const img = document.createElement("img"); - const scratchCanvas = this.scratchCanvas; - if ("toBlob" in scratchCanvas) { - scratchCanvas.toBlob(function (blob) { - img.src = URL.createObjectURL(blob); - }); - } else { - img.src = scratchCanvas.toDataURL(); - } - const wrapper = document.createElement("div"); - wrapper.className = "printedPage"; - wrapper.append(img); - this.printContainer.append(wrapper); - return new Promise(function (resolve, reject) { - img.onload = resolve; - img.onerror = reject; - }); - }, - performPrint() { - this.throwIfInactive(); - return new Promise(resolve => { - setTimeout(() => { - if (!this.active) { - resolve(); - return; - } - print.call(window); - setTimeout(resolve, 20); - }, 0); - }); - }, - get active() { - return this === activeService; - }, - throwIfInactive() { - if (!this.active) { - throw new Error("This print request was cancelled or completed."); - } - } -}; -const print = window.print; -window.print = function () { - if (activeService) { - console.warn("Ignored window.print() because of a pending print job."); - return; - } - ensureOverlay().then(function () { - if (activeService) { - overlayManager.open(dialog); - } - }); - try { - dispatchEvent("beforeprint"); - } finally { - if (!activeService) { - console.error("Expected print service to be initialized."); - ensureOverlay().then(function () { - if (overlayManager.active === dialog) { - overlayManager.close(dialog); - } - }); - return; - } - const activeServiceOnEntry = activeService; - activeService.renderPages().then(function () { - return activeServiceOnEntry.performPrint(); - }).catch(function () {}).then(function () { - if (activeServiceOnEntry.active) { - abort(); - } - }); - } -}; -function dispatchEvent(eventType) { - const event = document.createEvent("CustomEvent"); - event.initCustomEvent(eventType, false, false, "custom"); - window.dispatchEvent(event); -} -function abort() { - if (activeService) { - activeService.destroy(); - dispatchEvent("afterprint"); - } -} -function renderProgress(index, total, l10n) { - dialog ||= document.getElementById("printServiceDialog"); - const progress = Math.round(100 * index / total); - const progressBar = dialog.querySelector("progress"); - const progressPerc = dialog.querySelector(".relative-progress"); - progressBar.value = progress; - l10n.get("print_progress_percent", { - progress - }).then(msg => { - progressPerc.textContent = msg; - }); -} -window.addEventListener("keydown", function (event) { - if (event.keyCode === 80 && (event.ctrlKey || event.metaKey) && !event.altKey && (!event.shiftKey || window.chrome || window.opera)) { - window.print(); - event.preventDefault(); - event.stopImmediatePropagation(); - } -}, true); -if ("onbeforeprint" in window) { - const stopPropagationIfNeeded = function (event) { - if (event.detail !== "custom") { - event.stopImmediatePropagation(); - } - }; - window.addEventListener("beforeprint", stopPropagationIfNeeded); - window.addEventListener("afterprint", stopPropagationIfNeeded); -} -let overlayPromise; -function ensureOverlay() { - if (!overlayPromise) { - overlayManager = _app.PDFViewerApplication.overlayManager; - if (!overlayManager) { - throw new Error("The overlay manager has not yet been initialized."); - } - dialog ||= document.getElementById("printServiceDialog"); - overlayPromise = overlayManager.register(dialog, true); - document.getElementById("printCancel").onclick = abort; - dialog.addEventListener("close", abort); - } - return overlayPromise; -} -_app.PDFPrintServiceFactory.instance = { - supportsPrinting: true, - createPrintService(pdfDocument, pagesOverview, printContainer, printResolution, optionalContentConfigPromise, printAnnotationStoragePromise, l10n) { - if (activeService) { - throw new Error("The print service is created and active."); - } - activeService = new PDFPrintService(pdfDocument, pagesOverview, printContainer, printResolution, optionalContentConfigPromise, printAnnotationStoragePromise, l10n); - return activeService; - } -}; - -/***/ }), -/* 48 */ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.getXfaHtmlForPrinting = getXfaHtmlForPrinting; -var _pdfjsLib = __webpack_require__(4); -var _pdf_link_service = __webpack_require__(7); -var _xfa_layer_builder = __webpack_require__(38); -function getXfaHtmlForPrinting(printContainer, pdfDocument) { - const xfaHtml = pdfDocument.allXfaHtml; - const linkService = new _pdf_link_service.SimpleLinkService(); - const scale = Math.round(_pdfjsLib.PixelsPerInch.PDF_TO_CSS_UNITS * 100) / 100; - for (const xfaPage of xfaHtml.children) { - const page = document.createElement("div"); - page.className = "xfaPrintedPage"; - printContainer.append(page); - const builder = new _xfa_layer_builder.XfaLayerBuilder({ - pageDiv: page, - pdfPage: null, - annotationStorage: pdfDocument.annotationStorage, - linkService, - xfaHtml: xfaPage - }); - const viewport = (0, _pdfjsLib.getXfaPageViewport)(xfaPage, { - scale - }); - builder.render(viewport, "print"); - } -} - -/***/ }) -/******/ ]); -/************************************************************************/ -/******/ // The module cache -/******/ var __webpack_module_cache__ = {}; -/******/ -/******/ // The require function -/******/ function __webpack_require__(moduleId) { -/******/ // Check if module is in cache -/******/ var cachedModule = __webpack_module_cache__[moduleId]; -/******/ if (cachedModule !== undefined) { -/******/ return cachedModule.exports; -/******/ } -/******/ // Create a new module (and put it into the cache) -/******/ var module = __webpack_module_cache__[moduleId] = { -/******/ // no module.id needed -/******/ // no module.loaded needed -/******/ exports: {} -/******/ }; -/******/ -/******/ // Execute the module function -/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); -/******/ -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } -/******/ -/************************************************************************/ -var __webpack_exports__ = {}; -// This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk. -(() => { -var exports = __webpack_exports__; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -Object.defineProperty(exports, "PDFViewerApplication", ({ - enumerable: true, - get: function () { - return _app.PDFViewerApplication; - } -})); -exports.PDFViewerApplicationConstants = void 0; -Object.defineProperty(exports, "PDFViewerApplicationOptions", ({ - enumerable: true, - get: function () { - return _app_options.AppOptions; - } -})); -__webpack_require__(1); -__webpack_require__(47); -var _ui_utils = __webpack_require__(3); -var _app_options = __webpack_require__(5); -var _pdf_link_service = __webpack_require__(7); -var _app = __webpack_require__(2); -const pdfjsVersion = '3.4.120'; -const pdfjsBuild = 'af6414988'; -const AppConstants = { - LinkTarget: _pdf_link_service.LinkTarget, - RenderingStates: _ui_utils.RenderingStates, - ScrollMode: _ui_utils.ScrollMode, - SpreadMode: _ui_utils.SpreadMode -}; -exports.PDFViewerApplicationConstants = AppConstants; -window.PDFViewerApplication = _app.PDFViewerApplication; -window.PDFViewerApplicationConstants = AppConstants; -window.PDFViewerApplicationOptions = _app_options.AppOptions; -function getViewerConfiguration() { - return { - appContainer: document.body, - mainContainer: document.getElementById("viewerContainer"), - viewerContainer: document.getElementById("viewer"), - toolbar: { - container: document.getElementById("toolbarViewer"), - numPages: document.getElementById("numPages"), - pageNumber: document.getElementById("pageNumber"), - scaleSelect: document.getElementById("scaleSelect"), - customScaleOption: document.getElementById("customScaleOption"), - previous: document.getElementById("previous"), - next: document.getElementById("next"), - zoomIn: document.getElementById("zoomIn"), - zoomOut: document.getElementById("zoomOut"), - viewFind: document.getElementById("viewFind"), - openFile: document.getElementById("openFile"), - print: document.getElementById("print"), - editorFreeTextButton: document.getElementById("editorFreeText"), - editorFreeTextParamsToolbar: document.getElementById("editorFreeTextParamsToolbar"), - editorInkButton: document.getElementById("editorInk"), - editorInkParamsToolbar: document.getElementById("editorInkParamsToolbar"), - download: document.getElementById("download") - }, - secondaryToolbar: { - toolbar: document.getElementById("secondaryToolbar"), - toggleButton: document.getElementById("secondaryToolbarToggle"), - presentationModeButton: document.getElementById("presentationMode"), - openFileButton: document.getElementById("secondaryOpenFile"), - printButton: document.getElementById("secondaryPrint"), - downloadButton: document.getElementById("secondaryDownload"), - viewBookmarkButton: document.getElementById("viewBookmark"), - firstPageButton: document.getElementById("firstPage"), - lastPageButton: document.getElementById("lastPage"), - pageRotateCwButton: document.getElementById("pageRotateCw"), - pageRotateCcwButton: document.getElementById("pageRotateCcw"), - cursorSelectToolButton: document.getElementById("cursorSelectTool"), - cursorHandToolButton: document.getElementById("cursorHandTool"), - scrollPageButton: document.getElementById("scrollPage"), - scrollVerticalButton: document.getElementById("scrollVertical"), - scrollHorizontalButton: document.getElementById("scrollHorizontal"), - scrollWrappedButton: document.getElementById("scrollWrapped"), - spreadNoneButton: document.getElementById("spreadNone"), - spreadOddButton: document.getElementById("spreadOdd"), - spreadEvenButton: document.getElementById("spreadEven"), - documentPropertiesButton: document.getElementById("documentProperties") - }, - sidebar: { - outerContainer: document.getElementById("outerContainer"), - sidebarContainer: document.getElementById("sidebarContainer"), - toggleButton: document.getElementById("sidebarToggle"), - thumbnailButton: document.getElementById("viewThumbnail"), - outlineButton: document.getElementById("viewOutline"), - attachmentsButton: document.getElementById("viewAttachments"), - layersButton: document.getElementById("viewLayers"), - thumbnailView: document.getElementById("thumbnailView"), - outlineView: document.getElementById("outlineView"), - attachmentsView: document.getElementById("attachmentsView"), - layersView: document.getElementById("layersView"), - outlineOptionsContainer: document.getElementById("outlineOptionsContainer"), - currentOutlineItemButton: document.getElementById("currentOutlineItem") - }, - sidebarResizer: { - outerContainer: document.getElementById("outerContainer"), - resizer: document.getElementById("sidebarResizer") - }, - findBar: { - bar: document.getElementById("findbar"), - toggleButton: document.getElementById("viewFind"), - findField: document.getElementById("findInput"), - highlightAllCheckbox: document.getElementById("findHighlightAll"), - caseSensitiveCheckbox: document.getElementById("findMatchCase"), - matchDiacriticsCheckbox: document.getElementById("findMatchDiacritics"), - entireWordCheckbox: document.getElementById("findEntireWord"), - findMsg: document.getElementById("findMsg"), - findResultsCount: document.getElementById("findResultsCount"), - findPreviousButton: document.getElementById("findPrevious"), - findNextButton: document.getElementById("findNext") - }, - passwordOverlay: { - dialog: document.getElementById("passwordDialog"), - label: document.getElementById("passwordText"), - input: document.getElementById("password"), - submitButton: document.getElementById("passwordSubmit"), - cancelButton: document.getElementById("passwordCancel") - }, - documentProperties: { - dialog: document.getElementById("documentPropertiesDialog"), - closeButton: document.getElementById("documentPropertiesClose"), - fields: { - fileName: document.getElementById("fileNameField"), - fileSize: document.getElementById("fileSizeField"), - title: document.getElementById("titleField"), - author: document.getElementById("authorField"), - subject: document.getElementById("subjectField"), - keywords: document.getElementById("keywordsField"), - creationDate: document.getElementById("creationDateField"), - modificationDate: document.getElementById("modificationDateField"), - creator: document.getElementById("creatorField"), - producer: document.getElementById("producerField"), - version: document.getElementById("versionField"), - pageCount: document.getElementById("pageCountField"), - pageSize: document.getElementById("pageSizeField"), - linearized: document.getElementById("linearizedField") - } - }, - annotationEditorParams: { - editorFreeTextFontSize: document.getElementById("editorFreeTextFontSize"), - editorFreeTextColor: document.getElementById("editorFreeTextColor"), - editorInkColor: document.getElementById("editorInkColor"), - editorInkThickness: document.getElementById("editorInkThickness"), - editorInkOpacity: document.getElementById("editorInkOpacity") - }, - printContainer: document.getElementById("printContainer"), - openFileInput: document.getElementById("fileInput"), - debuggerScriptPath: "./debugger.js" - }; -} -function webViewerLoad() { - const config = getViewerConfiguration(); - const event = document.createEvent("CustomEvent"); - event.initCustomEvent("webviewerloaded", true, true, { - source: window - }); - try { - parent.document.dispatchEvent(event); - } catch (ex) { - console.error(`webviewerloaded: ${ex}`); - document.dispatchEvent(event); - } - _app.PDFViewerApplication.run(config); -} -document.blockUnblockOnload?.(true); -if (document.readyState === "interactive" || document.readyState === "complete") { - webViewerLoad(); -} else { - document.addEventListener("DOMContentLoaded", webViewerLoad, true); -} -})(); - -/******/ })() -; -//# sourceMappingURL=viewer.js.map \ No newline at end of file diff --git a/static/js/pdf-js/web/viewer.js.map b/static/js/pdf-js/web/viewer.js.map deleted file mode 100644 index f5b6354..0000000 --- a/static/js/pdf-js/web/viewer.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"viewer.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAeA;AACA;AACA;AACA;AACA;AAEA;AAMA,MAAMA,aAAa,EAAnB;AA3BA;AA6BA,MAAMC,kBAAN,SAAiCC,4BAAjC,CAAiD;EAC/C,MAAMC,eAAN,CAAs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ASgb,gBAAT,CAA0B,kBAA1B,EAA8Co8D,aAA9C,EAA6D,IAA7D;AADK","sources":["webpack://pdf.js/web/genericcom.js","webpack://pdf.js/web/app.js","webpack://pdf.js/web/ui_utils.js","webpack://pdf.js/web/pdfjs.js","webpack://pdf.js/web/app_options.js","webpack://pdf.js/web/event_utils.js","webpack://pdf.js/web/pdf_link_service.js","webpack://pdf.js/web/annotation_editor_params.js","webpack://pdf.js/web/overlay_manager.js","webpack://pdf.js/web/password_prompt.js","webpack://pdf.js/web/pdf_attachment_viewer.js","webpack://pdf.js/web/base_tree_viewer.js","webpack://pdf.js/web/pdf_cursor_tools.js","webpack://pdf.js/web/grab_to_pan.js","webpack://pdf.js/web/pdf_document_properties.js","webpack://pdf.js/web/pdf_find_bar.js","webpack://pdf.js/web/pdf_find_controller.js","webpack://pdf.js/web/pdf_find_utils.js","webpack://pdf.js/web/pdf_history.js","webpack://pdf.js/web/pdf_layer_viewer.js","webpack://pdf.js/web/pdf_outline_viewer.js","webpack://pdf.js/web/pdf_presentation_mode.js","webpack://pdf.js/web/pdf_rendering_queue.js","webpack://pdf.js/web/pdf_scripting_manager.js","webpack://pdf.js/web/pdf_sidebar.js","webpack://pdf.js/web/pdf_sidebar_resizer.js","webpack://pdf.js/web/pdf_thumbnail_viewer.js","webpack://pdf.js/web/pdf_thumbnail_view.js","webpack://pdf.js/web/pdf_viewer.js","webpack://pdf.js/web/l10n_utils.js","webpack://pdf.js/web/pdf_page_view.js","webpack://pdf.js/web/annotation_editor_layer_builder.js","webpack://pdf.js/web/annotation_layer_builder.js","webpack://pdf.js/web/struct_tree_layer_builder.js","webpack://pdf.js/web/text_accessibility.js","webpack://pdf.js/web/text_highlighter.js","webpack://pdf.js/web/text_layer_builder.js","webpack://pdf.js/web/xfa_layer_builder.js","webpack://pdf.js/web/secondary_toolbar.js","webpack://pdf.js/web/toolbar.js","webpack://pdf.js/web/view_history.js","webpack://pdf.js/web/preferences.js","webpack://pdf.js/web/download_manager.js","webpack://pdf.js/web/genericl10n.js","webpack://pdf.js/external/webL10n/l10n.js","webpack://pdf.js/web/generic_scripting.js","webpack://pdf.js/web/pdf_print_service.js","webpack://pdf.js/web/print_utils.js","webpack://pdf.js/webpack/bootstrap","webpack://pdf.js/web/viewer.js"],"sourcesContent":["/* 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 { DefaultExternalServices, PDFViewerApplication } from \"./app.js\";\nimport { BasePreferences } from \"./preferences.js\";\nimport { DownloadManager } from \"./download_manager.js\";\nimport { GenericL10n } from \"./genericl10n.js\";\nimport { GenericScripting } from \"./generic_scripting.js\";\n\nif (typeof PDFJSDev !== \"undefined\" && !PDFJSDev.test(\"GENERIC\")) {\n throw new Error(\n 'Module \"pdfjs-web/genericcom\" shall not be used outside GENERIC build.'\n );\n}\n\nconst GenericCom = {};\n\nclass GenericPreferences extends BasePreferences {\n async _writeToStorage(prefObj) {\n localStorage.setItem(\"pdfjs.preferences\", JSON.stringify(prefObj));\n }\n\n async _readFromStorage(prefObj) {\n return JSON.parse(localStorage.getItem(\"pdfjs.preferences\"));\n }\n}\n\nclass GenericExternalServices extends DefaultExternalServices {\n static createDownloadManager() {\n return new DownloadManager();\n }\n\n static createPreferences() {\n return new GenericPreferences();\n }\n\n static createL10n({ locale = \"en-US\" }) {\n return new GenericL10n(locale);\n }\n\n static createScripting({ sandboxBundleSrc }) {\n return new GenericScripting(sandboxBundleSrc);\n }\n}\nPDFViewerApplication.externalServices = GenericExternalServices;\n\nexport { GenericCom };\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 animationStarted,\n apiPageLayoutToViewerModes,\n apiPageModeToSidebarView,\n AutoPrintRegExp,\n CursorTool,\n DEFAULT_SCALE_VALUE,\n getActiveOrFocusedElement,\n isValidRotation,\n isValidScrollMode,\n isValidSpreadMode,\n normalizeWheelEventDirection,\n parseQueryString,\n ProgressBar,\n RendererType,\n RenderingStates,\n ScrollMode,\n SidebarView,\n SpreadMode,\n TextLayerMode,\n} from \"./ui_utils.js\";\nimport {\n AnnotationEditorType,\n build,\n createPromiseCapability,\n FeatureTest,\n getDocument,\n getFilenameFromUrl,\n getPdfFilenameFromUrl,\n GlobalWorkerOptions,\n InvalidPDFException,\n isDataScheme,\n isPdfFile,\n loadScript,\n MissingPDFException,\n OPS,\n PDFWorker,\n shadow,\n UnexpectedResponseException,\n version,\n} from \"pdfjs-lib\";\nimport { AppOptions, OptionKind } from \"./app_options.js\";\nimport { AutomationEventBus, EventBus } from \"./event_utils.js\";\nimport { LinkTarget, PDFLinkService } from \"./pdf_link_service.js\";\nimport { AnnotationEditorParams } from \"web-annotation_editor_params\";\nimport { OverlayManager } from \"./overlay_manager.js\";\nimport { PasswordPrompt } from \"./password_prompt.js\";\nimport { PDFAttachmentViewer } from \"web-pdf_attachment_viewer\";\nimport { PDFCursorTools } from \"web-pdf_cursor_tools\";\nimport { PDFDocumentProperties } from \"web-pdf_document_properties\";\nimport { PDFFindBar } from \"web-pdf_find_bar\";\nimport { PDFFindController } from \"./pdf_find_controller.js\";\nimport { PDFHistory } from \"./pdf_history.js\";\nimport { PDFLayerViewer } from \"web-pdf_layer_viewer\";\nimport { PDFOutlineViewer } from \"web-pdf_outline_viewer\";\nimport { PDFPresentationMode } from \"web-pdf_presentation_mode\";\nimport { PDFRenderingQueue } from \"./pdf_rendering_queue.js\";\nimport { PDFScriptingManager } from \"./pdf_scripting_manager.js\";\nimport { PDFSidebar } from \"web-pdf_sidebar\";\nimport { PDFSidebarResizer } from \"web-pdf_sidebar_resizer\";\nimport { PDFThumbnailViewer } from \"web-pdf_thumbnail_viewer\";\nimport { PDFViewer } from \"./pdf_viewer.js\";\nimport { SecondaryToolbar } from \"web-secondary_toolbar\";\nimport { Toolbar } from \"web-toolbar\";\nimport { ViewHistory } from \"./view_history.js\";\n\nconst FORCE_PAGES_LOADED_TIMEOUT = 10000; // ms\nconst WHEEL_ZOOM_DISABLED_TIMEOUT = 1000; // ms\n\nconst ViewOnLoad = {\n UNKNOWN: -1,\n PREVIOUS: 0, // Default value.\n INITIAL: 1,\n};\n\nconst ViewerCssTheme = {\n AUTOMATIC: 0, // Default value.\n LIGHT: 1,\n DARK: 2,\n};\n\nclass DefaultExternalServices {\n constructor() {\n throw new Error(\"Cannot initialize DefaultExternalServices.\");\n }\n\n static updateFindControlState(data) {}\n\n static updateFindMatchesCount(data) {}\n\n static initPassiveLoading(callbacks) {}\n\n static reportTelemetry(data) {}\n\n static createDownloadManager() {\n throw new Error(\"Not implemented: createDownloadManager\");\n }\n\n static createPreferences() {\n throw new Error(\"Not implemented: createPreferences\");\n }\n\n static createL10n(options) {\n throw new Error(\"Not implemented: createL10n\");\n }\n\n static createScripting(options) {\n throw new Error(\"Not implemented: createScripting\");\n }\n\n static get supportsPinchToZoom() {\n return shadow(this, \"supportsPinchToZoom\", true);\n }\n\n static get supportsIntegratedFind() {\n return shadow(this, \"supportsIntegratedFind\", false);\n }\n\n static get supportsDocumentFonts() {\n return shadow(this, \"supportsDocumentFonts\", true);\n }\n\n static get supportedMouseWheelZoomModifierKeys() {\n return shadow(this, \"supportedMouseWheelZoomModifierKeys\", {\n ctrlKey: true,\n metaKey: true,\n });\n }\n\n static get isInAutomation() {\n return shadow(this, \"isInAutomation\", false);\n }\n\n static updateEditorStates(data) {\n throw new Error(\"Not implemented: updateEditorStates\");\n }\n}\n\nconst PDFViewerApplication = {\n initialBookmark: document.location.hash.substring(1),\n _initializedCapability: createPromiseCapability(),\n appConfig: null,\n pdfDocument: null,\n pdfLoadingTask: null,\n printService: null,\n /** @type {PDFViewer} */\n pdfViewer: null,\n /** @type {PDFThumbnailViewer} */\n pdfThumbnailViewer: null,\n /** @type {PDFRenderingQueue} */\n pdfRenderingQueue: null,\n /** @type {PDFPresentationMode} */\n pdfPresentationMode: null,\n /** @type {PDFDocumentProperties} */\n pdfDocumentProperties: null,\n /** @type {PDFLinkService} */\n pdfLinkService: null,\n /** @type {PDFHistory} */\n pdfHistory: null,\n /** @type {PDFSidebar} */\n pdfSidebar: null,\n /** @type {PDFSidebarResizer} */\n pdfSidebarResizer: null,\n /** @type {PDFOutlineViewer} */\n pdfOutlineViewer: null,\n /** @type {PDFAttachmentViewer} */\n pdfAttachmentViewer: null,\n /** @type {PDFLayerViewer} */\n pdfLayerViewer: null,\n /** @type {PDFCursorTools} */\n pdfCursorTools: null,\n /** @type {PDFScriptingManager} */\n pdfScriptingManager: null,\n /** @type {ViewHistory} */\n store: null,\n /** @type {DownloadManager} */\n downloadManager: null,\n /** @type {OverlayManager} */\n overlayManager: null,\n /** @type {Preferences} */\n preferences: null,\n /** @type {Toolbar} */\n toolbar: null,\n /** @type {SecondaryToolbar} */\n secondaryToolbar: null,\n /** @type {EventBus} */\n eventBus: null,\n /** @type {IL10n} */\n l10n: null,\n /** @type {AnnotationEditorParams} */\n annotationEditorParams: null,\n isInitialViewSet: false,\n downloadComplete: false,\n isViewerEmbedded: window.parent !== window,\n url: \"\",\n baseUrl: \"\",\n _downloadUrl: \"\",\n externalServices: DefaultExternalServices,\n _boundEvents: Object.create(null),\n documentInfo: null,\n metadata: null,\n _contentDispositionFilename: null,\n _contentLength: null,\n _saveInProgress: false,\n _wheelUnusedTicks: 0,\n _wheelUnusedFactor: 1,\n _touchUnusedTicks: 0,\n _touchUnusedFactor: 1,\n _PDFBug: null,\n _hasAnnotationEditors: false,\n _title: document.title,\n _printAnnotationStoragePromise: null,\n _touchInfo: null,\n _isCtrlKeyDown: false,\n\n // Called once when the document is loaded.\n async initialize(appConfig) {\n this.preferences = this.externalServices.createPreferences();\n this.appConfig = appConfig;\n\n await this._initializeOptions();\n this._forceCssTheme();\n await this._initializeL10n();\n\n if (\n this.isViewerEmbedded &&\n AppOptions.get(\"externalLinkTarget\") === LinkTarget.NONE\n ) {\n // Prevent external links from \"replacing\" the viewer,\n // when it's embedded in e.g. an